docs/libs/typescript.js
function getEffectiveDecoratorFirstArgumentType(node) {
            // The first argument to a decorator is its `target`.
            if (node.kind === 221 /* ClassDeclaration */) {
                // For a class decorator, the `target` is the type of the class (e.g. the
                // "static" or "constructor" side of the class)
                var classSymbol = getSymbolOfNode(node);
                return getTypeOfSymbol(classSymbol);
            }
            if (node.kind === 142 /* Parameter */) {
                // For a parameter decorator, the `target` is the parent type of the
                // parameter's containing method.
                node = node.parent;
                if (node.kind === 148 /* Constructor */) {
                    var classSymbol = getSymbolOfNode(node);
                    return getTypeOfSymbol(classSymbol);
                }
            }
            if (node.kind === 145 /* PropertyDeclaration */ ||
                node.kind === 147 /* MethodDeclaration */ ||
                node.kind === 149 /* GetAccessor */ ||
                node.kind === 150 /* SetAccessor */) {
                // For a property or method decorator, the `target` is the
                // "static"-side type of the parent of the member if the member is
                // declared "static"; otherwise, it is the "instance"-side type of the
                // parent of the member.
                return getParentTypeOfClassElement(node);
            }
            ts.Debug.fail("Unsupported decorator target.");
            return unknownType;
        }
function getEffectiveDecoratorFirstArgumentType(node) {
            // The first argument to a decorator is its `target`.
            if (node.kind === 221 /* ClassDeclaration */) {
                // For a class decorator, the `target` is the type of the class (e.g. the
                // "static" or "constructor" side of the class)
                var classSymbol = getSymbolOfNode(node);
                return getTypeOfSymbol(classSymbol);
            }
            if (node.kind === 142 /* Parameter */) {
                // For a parameter decorator, the `target` is the parent type of the
                // parameter's containing method.
                node = node.parent;
                if (node.kind === 148 /* Constructor */) {
                    var classSymbol = getSymbolOfNode(node);
                    return getTypeOfSymbol(classSymbol);
                }
            }
            if (node.kind === 145 /* PropertyDeclaration */ ||
                node.kind === 147 /* MethodDeclaration */ ||
                node.kind === 149 /* GetAccessor */ ||
                node.kind === 150 /* SetAccessor */) {
                // For a property or method decorator, the `target` is the
                // "static"-side type of the parent of the member if the member is
                // declared "static"; otherwise, it is the "instance"-side type of the
                // parent of the member.
                return getParentTypeOfClassElement(node);
            }
            ts.Debug.fail("Unsupported decorator target.");
            return unknownType;
        }
function getEffectiveDecoratorFirstArgumentType ( node ) { // The first argument to a decorator is its `target`. if ( node . kind === 221 /* ClassDeclaration */ ) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode ( node ) ; return getTypeOfSymbol ( classSymbol ) ; } if ( node . kind === 142 /* Parameter */ ) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node . parent ; if ( node . kind === 148 /* Constructor */ ) { var classSymbol = getSymbolOfNode ( node ) ; return getTypeOfSymbol ( classSymbol ) ; } } if ( node . kind === 145 /* PropertyDeclaration */ || node . kind === 147 /* MethodDeclaration */ || node . kind === 149 /* GetAccessor */ || node . kind === 150 /* SetAccessor */ ) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the // parent of the member. return getParentTypeOfClassElement ( node ) ; } ts . Debug . fail ( "Unsupported decorator target." ) ; return unknownType ; }
Returns the effective type of the first argument to a decorator.
If 'node' is a class declaration or class expression, the effective argument type
is the type of the static side of the class.
If 'node' is a parameter declaration, the effective argument type is either the type
of the static or instance side of the class for the parameter's parent method,
depending on whether the method is declared static.
For a constructor, the type is always the type of the static side of the class.
If 'node' is a property, method, or accessor declaration, the effective argument
type is the type of the static or instance side of the parent class for class
element, depending on whether the element is declared static.
Returns the effective type of the first argument to a decorator . If node is a class declaration or class expression the effective argument type is the type of the static side of the class . If node is a parameter declaration the effective argument type is either the type of the static or instance side of the class for the parameter s parent method depending on whether the method is declared static . For a constructor the type is always the type of the static side of the class . If node is a property method or accessor declaration the effective argument type is the type of the static or instance side of the parent class for class element depending on whether the element is declared static .