@servicenow/sdk - v4.4.1
    Preparing search index...

    Wrapper around the TypeChecker.

    Index

    Accessors

    • get compilerObject(): tsc.TypeChecker

      Gets the compiler's TypeChecker.

      Returns tsc.TypeChecker

    Methods

    • Gets the aliased symbol of a symbol.

      Parameters

      • symbol: Symbol

        Symbol to get the alias symbol of.

      Returns Symbol | undefined

    • Gets the ambient module symbols (ex. modules in the

      Returns Symbol[]

      folder or node_modules).

    • Gets the apparent type of a type.

      Parameters

      • type: Type

        Type to get the apparent type of.

      Returns Type<tsc.Type>

    • Gets the base type of a literal type.

      For example, for a number literal type it will return the number type.

      Parameters

      • type: Type

        Literal type to get the base type of.

      Returns Type<tsc.Type>

    • Gets the constant value of a declaration.

      Parameters

      • node: EnumMember

        Node to get the constant value from.

      Returns string | number | undefined

    • Gets the contextual type of an expression.

      Parameters

      Returns Type<tsc.Type> | undefined

    • Gets the declared type of a symbol.

      Parameters

      • symbol: Symbol

        Symbol to get the type for.

      Returns Type

    • Gets the exports of a module.

      Parameters

      • moduleSymbol: Symbol

        Module symbol.

      Returns Symbol[]

    • Gets the local target symbol of the provided export specifier.

      Parameters

      Returns Symbol | undefined

    • Gets the export symbol of a local symbol with a corresponding export symbol. Otherwise returns the input symbol.

      The following is from the compiler API documentation:

      For example, at export type T = number;: - getSymbolAtLocation at the location T will return the exported symbol for T. - But the result of getSymbolsInScope will contain the local symbol for T, not the exported symbol. - Calling getExportSymbolOfSymbol on that local symbol will return the exported symbol.

      Parameters

      Returns Symbol

    • Gets the fully qualified name of a symbol.

      Parameters

      • symbol: Symbol

        Symbol to get the fully qualified name of.

      Returns string

    • Follow a single alias to get the immediately aliased symbol.

      Parameters

      • symbol: Symbol

        Symbol to get the immediate alias symbol of.

      Returns Symbol | undefined

    • Gets the properties of a type.

      Parameters

      Returns Symbol[]

    • Gets the resolved signature from a node or returns undefined if the signature can't be resolved.

      Parameters

      Returns Signature | undefined

    • Gets the resolved signature from a node or throws if the signature cannot be resolved.

      Parameters

      • node: CallLikeExpression

        Node to get the signature from.

      • Optionalmessage: string | (() => string)

      Returns Signature

    • Gets the return type of a signature.

      Parameters

      • signature: Signature

        Signature to get the return type of.

      Returns Type

    • Gets the shorthand assignment value symbol of the provided node.

      Parameters

      Returns Symbol | undefined

    • Gets the symbol at the specified location or undefined if none exists.

      Parameters

      • node: Node

        Node to get the symbol for.

      Returns Symbol | undefined

    • Gets the symbols in the scope of the provided node.

      Note: This will always return the local symbols. If you want the export symbol from a local symbol, then use the #getExportSymbolOfSymbol(symbol) method.

      Parameters

      • node: Node

        Node to check the scope for.

      • meaning: tsc.SymbolFlags

        Meaning of symbol to filter by.

      Returns Symbol[]

    • Gets the type arguments from a type reference.

      Parameters

      • typeReference: Type

        Type reference.

      Returns Type<tsc.Type>[]

    • Gets the type at the specified location.

      Parameters

      • node: Node

        Node to get the type for.

      Returns Type

    • Gets the type of a symbol at the specified location.

      Parameters

      • symbol: Symbol

        Symbol to get the type for.

      • node: Node

        Location to get the type for.

      Returns Type

    • Gets the type text

      Parameters

      Returns string

    • Checks if a type is assignable to another type.

      Parameters

      Returns boolean

    • Parameters

      Returns Symbol | undefined