[F] validateDecoratorParamType
function validateDecoratorParamType<K>( program, target, value, expectedType): value is InferredTypeSpecValue<K>
Validate a decorator parameter has the correct type.
Type Parameters
Type Parameter |
---|
K extends | "Model" | "ModelProperty" | "Boolean" | "Decorator" | "Enum" | "EnumMember" | "FunctionParameter" | "Function" | "Interface" | "Intrinsic" | "Namespace" | "Number" | "Object" | "Operation" | "Projection" | "Scalar" | "ScalarConstructor" | "String" | "StringTemplate" | "StringTemplateSpan" | "TemplateParameter" | "Tuple" | "Union" | "UnionVariant" |
Parameters
Parameter | Type | Description |
---|---|---|
program | Program | Program |
target | Type | Decorator target |
value | TypeSpecValue | Value of the parameter. |
expectedType | K | K [] | Expected type or list of expected type |
Returns
value is InferredTypeSpecValue<K>
true if the value is of one of the type in the list of expected types. If not emit a diagnostic.
Deprecated
use
See
createDecoratorDefinition#validate instead.