CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.15-dev (changelog, source)
Search

Class Type

A static type in the TypeScript type system.

Types are generally not associated with a specific location or AST node. For instance, there may be many AST nodes representing different uses of the number keyword, but there only exists one number type.

Import path

import javascript

Direct supertypes

Known direct subtypes

Predicates

getAConstructorSignature

Gets a constructor call signature.

getAFunctionSignature

Gets a function call signature.

getASignature

Gets a signature of the given kind.

getChild

Gets the ith child of this type.

getConstructorSignature

Gets the nth constructor call signature.

getFunctionSignature

Gets the nth function call signature.

getKind

Gets the kind of this type, which is an integer value denoting how the type is stored in the database.

getLastConstructorSignature

Gets the last constructor call signature.

getLastFunctionSignature

Gets the last function call signature.

getLastSignature

Gets the last signature of the given kind.

getNumConstructorSignature

Gets the number of constructor call signatures.

getNumFunctionSignature

Gets the number of function call signatures.

getNumSignature

Gets the number of signatures of the given kind.

getNumberIndexType

Gets the type of the number index signature on this type, such as T in the type { [n: number]: T }.

getSignature

Gets the nth signature of the given kind present on this type.

getStringIndexType

Gets the type of the string index signature on this type, such as T in the type { [s: string]: T }.

hasUnderlyingType

Holds if this refers to the given named type, or is declared as a subtype thereof, or is a union or intersection containing such a type.

hasUnderlyingType

Holds if this refers to the given named type, or is declared as a subtype thereof, or is a union or intersection containing such a type.

hasUnderlyingTypeName

Holds if this refers to the given named type, or is declared as a subtype thereof, or is a union or intersection containing such a type.

toString

Gets a string representation of this type.

unfold

Repeatedly unfolds unions, intersections, and type aliases and gets any of the underlying types, or this type itself if it is not a union or intersection.

unfoldUnionAndIntersection

Repeatedly unfolds union and intersection types and gets any of the underlying types, or this type itself if it is not a union or intersection.