Skip to content

[I] DecoratorContext

PropertyTypeDescription
decoratorTargetDiagnosticTargetPoint to the decorator target
programProgram-
call<T, A, R>(
decorator,
target, ...
args): R;

Helper to call out to another decorator

Type Parameter
T extends Type
A extends any[]
R
ParameterTypeDescription
decorator(context, target, …args) => ROther decorator function
targetT-
argsAArgs to pass to other decorator function

R


getArgumentTarget(paramIndex): undefined | DiagnosticTarget;

Function that can be used to retrieve the target for a parameter at the given index.

ParameterTypeDescription
paramIndexnumberParameter index in the typespec

undefined | DiagnosticTarget

@foo("bar", 123) -> $foo(context, target, arg0: string, arg1: number);
getArgumentTarget(0) -> target for arg0
getArgumentTarget(1) -> target for arg1