Skip to content

[I] Decorator

A checked TypeSpec decorator declaration, distinct from an application of that decorator.

PropertyModifierTypeDescriptionOverridesInherited from
creating?publictrueIf the type is currently being created.-BaseType.creating
declarationKindpublic"extern" | "auto"How this decorator was declared.--
entityKindreadonly"Type"Distinguishes semantic types from values and parameter constraints.-BaseType.entityKind
implementationpublic(ctx, target, …args) => voidJavaScript implementation receiving the context, target, and marshalled custom arguments.--
instantiationParameters?publicType[]Legacy instantiation metadata. The compiler’s type checker does not populate this field, so its absence does not indicate whether this type is a template instance.-BaseType.instantiationParameters
isFinishedpublicbooleanReflect if a type has been finished(Decorators have been called). There is multiple reasons a type might not be finished: - a template declaration will not - a template instance that argument that are still template parameters - a template instance that is only partially instantiated(like a templated operation inside a templated interface)-BaseType.isFinished
kindpublic"Decorator"Discriminant for decorator declarations rather than decorator applications.BaseType.kind-
namepublic`@${string}`Local decorator name including its leading @, without namespace qualifiers.--
namespacepublicNamespaceDeclaring namespace, including the global namespace for unqualified declarations.--
node?publicDecoratorDeclarationStatementNodeNode used to construct this type. If the node is undefined it means the type was dynamically built. With typekit for example.BaseType.node-
parameterspublicMixedFunctionParameter[]Custom parameter constraints in declaration order, excluding the target.--
targetpublicMixedFunctionParameterConstraint on the decorated target, separate from custom arguments.--