Skip to content
Interfacecustom-idv0.2.7

CustomIdField

One field in a customId shape, its wire kind plus the type it decodes to.

The chain methods build these for you. Write one by hand to name a shape in a type position, as CustomId<'page', { index: CustomIdField<number> }>.

interface CustomIdField<Decoded>

Decoded

Decoded

choices

The allowed values, for a oneOf field.

readonly choices?: readonly string[]

decoded

Phantom only, carries the decoded type and is never set at runtime.

readonly decoded?: Decoded

kind

Which wire encoding this field uses.

readonly kind: 'snowflake' | 'uuid' | 'int' | 'bool' | 'oneOf' | 'someOf' | 'string'

max

Upper bound, for a bounded int field.

readonly max?: number

min

Lower bound, for a bounded int field.

readonly min?: number

nullable

Whether this field also carries null.

readonly nullable?: boolean