Skip to content
This is the alpha v4 version website. Looking for the v3 documentation?

enumProp

enumProp<T>(values, defaultValue): PropertySchema<T, EnumPropertyType<T>>

Defined in: packages/sigma/src/primitives/schema.ts:265

Creates an enum property schema with restricted string values. Enum properties cannot be variable references.

Type Parameters

T

T extends string

Parameters

values

readonly T[]

Array of allowed string values

defaultValue

T

Default value (must be one of the allowed values)

Returns

PropertySchema<T, EnumPropertyType<T>>

Enum property schema