1.6.13 • Published 10 months ago

@nxtedition/types v1.6.13

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

@nxtedition/types

Description

This package contains:

  • TypeScript types to be shared between nxtedition packages.
  • Runtime validatiors and JSON functions for those types.

Usage

Import types and validators like this in TypeScript:

import type { TemplateRecord } from '@nxtedition/types'
import { isTemplateRecord } from '@nxtedition/types'

const templateRecord: TemplateRecord = { ... }

And like this in JavaScript:

```javascript
import { isTemplateRecord } from '@nxtedition/types'

/**
 * @typedef { import("@nxtedition/types").TemplateRecord } TemplateRecord
 */

/** @type {TemplateRecord} */
const templateRecord = { ... }

If bundle size is an issue, you can import only the parts you need like this:

import { isTemplateRecord } from '@nxtedition/types/domains/template'

Development

Generate runtime code

Generally, we only manually specify types in this package. A code generator is used to generate the runtime validators and JSON functions. It will do so for all types that are exported. To run the generator, use the following command:

yarn build

This will build the output to the dist directory.

Exports

We export all types up to the root of the package, so they can be imported directly from @nxtedition/types. This means that all exported types must be uniquely named.

1.6.13

10 months ago

1.6.12

10 months ago

1.6.11

10 months ago

1.6.10

10 months ago

1.6.9

12 months ago

1.6.8

12 months ago

1.6.7

12 months ago

1.6.6

12 months ago

1.6.4

1 year ago

1.6.3

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago