[I] DecoratorContext
Properties
Section titled “Properties”Property | Type | Description |
---|---|---|
decoratorTarget | DiagnosticTarget | Point to the decorator target |
program | Program | - |
Methods
Section titled “Methods”call()
Section titled “call()”call<T, A, R>( decorator, target, ... args): R;
Helper to call out to another decorator
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
T extends Type |
A extends any [] |
R |
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
decorator | (context , target , …args ) => R | Other decorator function |
target | T | - |
…args | A | Args to pass to other decorator function |
Returns
Section titled “Returns”R
getArgumentTarget()
Section titled “getArgumentTarget()”getArgumentTarget(paramIndex): undefined | DiagnosticTarget;
Function that can be used to retrieve the target for a parameter at the given index.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
paramIndex | number | Parameter index in the typespec |
Returns
Section titled “Returns”undefined
| DiagnosticTarget
Example
Section titled “Example”@foo("bar", 123) -> $foo(context, target, arg0: string, arg1: number); getArgumentTarget(0) -> target for arg0 getArgumentTarget(1) -> target for arg1