Skip to main content
Version: Next 🚧

[F] $knownValues

function $knownValues(
context,
target,
knownValues): void

@knownValues marks a string type with an enum that contains all known values

The first parameter is a reference to an enum type that describes all possible values that the type accepts.

@knownValues can only be applied to model types that extend string.

Parameters

ParameterTypeDescription
contextDecoratorContext-
targetModelProperty | ScalarDecorator target. Must be a string. (model Foo extends string)
knownValuesEnumMust be an enum.

Returns

void