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

Class TupleType

A tuple type, such as [number, string].

Import path

import javascript

Direct supertypes

Indirect supertypes

Predicates

getAnElementType

Gets a member of this tuple type.

getElementType

Gets the ith member of this tuple type, starting at 0.

getMinimumLength

Gets the number of required tuple elements, that is, excluding optional and rest elements.

getNumElementType

Gets the number of elements in this tuple type, including optional elements and the rest element.

getRestElementIndex

Gets the index of the rest element. For example, for a type [number, ...string[]] the result is 1, or for a type [...number[], string] the result is 0.

getRestElementType

Gets the type of the rest element, if there is one.

getUnderlyingArrayType

Gets the underlying instantiation of the Array type.

hasRestElement

Holds if this tuple type has a rest element, such as [number, ...string[]] or [...number[], string].

Inherited predicates

getAConstructorSignature

Gets a constructor call signature.

from Type
getAFunctionSignature

Gets a function call signature.

from Type
getASignature

Gets a signature of the given kind.

from Type
getArrayElementType

Gets the type of element in the type.

from ArrayType
getChild

Gets the ith child of this type.

from Type
getConstructorSignature

Gets the nth constructor call signature.

from Type
getFunctionSignature

Gets the nth function call signature.

from Type
getKind

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

from Type
getLastConstructorSignature

Gets the last constructor call signature.

from Type
getLastFunctionSignature

Gets the last function call signature.

from Type
getLastSignature

Gets the last signature of the given kind.

from Type
getNumConstructorSignature

Gets the number of constructor call signatures.

from Type
getNumFunctionSignature

Gets the number of function call signatures.

from Type
getNumSignature

Gets the number of signatures of the given kind.

from Type
getNumberIndexType

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

from Type
getSignature

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

from Type
getStringIndexType

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

from 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.

from 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.

from 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.

from Type
toString

Gets a string representation of this type.

from 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.

from Type
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.

from Type