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

Module TypeScript

Import path

import semmle.javascript.TypeScript

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Classes

AnonymousInterfaceType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

AnyType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ArrayType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ArrayTypeExpr

An array type, such as number[], or in general T[] where T is a type.

AsTypeAssertion

A type assertion specifically of the form E as T (as opposed to the <T> E syntax).

BigIntLiteralType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

BigIntLiteralTypeExpr

A bigint literal used as a TypeScript type annotation.

BigIntType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

BooleanLikeType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

BooleanLiteralType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

BooleanLiteralTypeExpr

A boolean literal used as a type.

BooleanType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

CallSignatureType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

CanonicalTypeVariableType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ClassType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ConditionalTypeExpr

A conditional type annotation, such as T extends any[] ? A : B.

ConditionalTypeScope

A scope induced by a conditional type expression whose extends type contains infer types.

ConstructorCallSignatureType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ConstructorTypeExpr

A constructor type, such as new (x: string) => Object.

EnumDeclaration

A TypeScript enum declaration, such as the following declaration: enum Color { red = 1, green, blue }

EnumLiteralType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

EnumMember

A member of a TypeScript enum declaration, such as red in the following declaration: enum Color { red = 1, green, blue }

EnumScope

A scope induced by an enum declaration, containing the names of its enum members.

EnumType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ExportAsNamespaceDeclaration

A TypeScript export of form export as namespace X where X is an identifier.

ExportAssignDeclaration

A TypeScript “export-assign” declaration.

ExpressionWithTypeArguments

An expression with type arguments, occurring as the super-class expression of a class, for example: class StringList extends List<string> In the above example, List is a concrete expression, string is a type annotation, and List<string> is thus an expression with type arguments.

ExternalModuleDeclaration

A TypeScript declaration of form declare module "X" {...} where X is the name of an external module.

ExternalModuleReference

A require() call in a TypeScript import-equals declaration, such as require("foo") in: import foo = require("foo");

ExternalModuleScope

A scope induced by a declaration of form declare module "X" {...}.

FunctionCallSignatureType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

FunctionTypeExpr

A TypeScript function type, such as (x: string) => number or a constructor type such as new (x: string) => Object.

GenericTypeExpr

A type consisting of a name and at least one type argument, such as Array<number>.

GlobalAugmentationDeclaration

A TypeScript declaration of form declare global {...}.

ImportEqualsDeclaration

A TypeScript “import-equals” declaration.

ImportNamespaceAccess

An import used in the context of a namespace inside a type annotation, such as in let x: import("http").ServerRequest.

ImportTypeAccess

An import used in the context of a type, such as in let x: import("foo").

ImportTypeExpr

An import inside a type annotation, such as in import("http").ServerRequest.

ImportVarTypeAccess

An import used in the context of a variable type, such as in let x: typeof import("fs").

IndexedAccessTypeExpr

A type of form T[K] where T and K are types.

InferTypeExpr

A type annotation of form infer R.

InterfaceDeclaration

A TypeScript interface declaration.

InterfaceDefinition

A TypeScript interface declaration, inline interface type, or function type.

InterfaceScope

A scope induced by an interface declaration, containing the type parameters declared on the interface.

InterfaceType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

InterfaceTypeExpr

An inline TypeScript interface type, such as {x: number; y: number}.

IntersectionType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

IntersectionTypeExpr

A type of form S&T, denoting the intersection of type S and type T.

IsTypeExpr

A function return type of form x is T or asserts x is T.

KeyofTypeExpr

A type of form keyof T where T is a type.

LexicalTypeVariableType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

LiteralType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

LiteralTypeExpr

A string, number, or boolean literal used as a type.

LocalNamespaceAccess

An identifier that refers to a namespace from inside a type annotation.

LocalNamespaceDecl

An identifier that declares a local name for a namespace, that is, the name of an actual namespace declaration or the local name of an import.

LocalNamespaceName

The local name for a namespace in a particular scope.

LocalTypeAccess

An identifier that is used as part of a type, such as Date.

LocalTypeName

The local name for a type in a particular scope.

LocalVarTypeAccess

An identifier that refers to a variable from inside a type.

MappedTypeExpr

A type of form { [K in C]: T } where K in C declares a type parameter with C as the bound, and T is a type that may refer to K.

MappedTypeScope

A scope induced by a mapped type expression, containing the type parameter declared as part of the type.

NamespaceAccess

A possibly qualified name that refers to a namespace from inside a type annotation.

NamespaceDeclaration

A TypeScript namespace declaration.

NamespaceDefinition

A statement that defines a namespace, that is, a namespace declaration or enum declaration.

NamespaceRef

A possibly qualified identifier that refers to or declares a local name for a namespace.

NeverType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

NonNullAssertion

A TypeScript expression of form E!, asserting that E is not null.

NullType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

NumberLikeType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

NumberLiteralType

A number literal as a static type.

NumberLiteralTypeExpr

A number literal used as a type.

NumberType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ObjectKeywordType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

OptionalTypeExpr

An optional type element in a tuple type, such as number? in [string, number?].

ParenthesizedTypeExpr

A type expression enclosed in parentheses.

PlainArrayType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

PlainFunctionTypeExpr

A function type that is not a constructor type, such as (x: string) => number.

PlainSymbolType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

PredefinedTypeExpr

A use of the predefined type any, string, number, boolean, null, undefined, void, never, symbol, or object.

PredicateTypeExpr

A function return type that refines the type of one of its parameters or this.

PrefixTypeAssertion

A type assertion specifically of the form <T> E (as opposed to the E as T syntax).

PromiseType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

QualifiedNamespaceAccess

A qualified name that refers to a namespace from inside a type annotation.

QualifiedTypeAccess

A qualified name that is used as part of a type, such as http.ServerRequest.

QualifiedVarTypeAccess

A qualified name that refers to a variable from inside a type.

ReadonlyArrayType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ReadonlyTypeExpr

A type of form readonly T, such as readonly number[].

ReferenceImport

A TypeScript comment of one of the two forms: /// <reference path="FILE.d.ts"/> /// <reference types="NAME"/>

ReferencePathImport

A TypeScript comment of the form: /// <reference path="FILE.d.ts"/>

ReferenceTypesImport

A TypeScript comment of the form: /// <reference types="NAME" />

RestTypeExpr

A rest element in a tuple type, such as ...string[] in [number, ...string[]].

SatisfiesExpr

A satisfies type asserion of the form E satisfies T where E is an expression and T is a type.

SignatureKind

A value indicating if a signature is a function or constructor signature.

StringLikeType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

StringLiteralType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

StringLiteralTypeExpr

A string literal used as a type.

StringType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

SymbolType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

TSGlobalDeclImport

A reference to a global variable for which there is a TypeScript type annotation suggesting that it contains the namespace object of a module.

TemplateLiteralTypeExpr

A template literal used as a type.

ThisType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

ThisTypeExpr

A use of the this type.

ThisVarTypeAccess

A this keyword used as the first operand to an is type.

TupleType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

TupleTypeExpr

A tuple type such as [number, string].

Type

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

TypeAccess

A possibly qualified name that is used as part of a type, such as Date or http.ServerRequest.

TypeAliasDeclaration

A type alias declaration, that is, a statement of form type A = T.

TypeAliasReference

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

TypeAliasScope

A scope induced by a type alias declaration, containing the type parameters declared the the alias.

TypeAssertion

A type assertion, also known as an unchecked type cast, is a TypeScript expression of form E as T or <T> E where E is an expression and T is a type.

TypeDecl

An identifier declaring a type name, that is, the name of a class, interface, type parameter, or import.

TypeDefinition

A statement that defines a named type, that is, a class, interface, type alias, or enum declaration.

TypeExpr

A type expression, that is, an AST node that is part of a TypeScript type annotation.

TypeParameter

A type parameter declared on a class, interface, function, or type alias.

TypeParameterized

A program element that supports type parameters, that is, a function, class, interface, type alias, mapped type, or infer type.

TypeRef

A possibly qualified identifier that declares or refers to a type.

TypeReference

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

TypeRootFolder

A folder where TypeScript finds declaration files for imported modules.

TypeVariableType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

TypeofType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

TypeofTypeExpr

A type of form typeof E where E is a possibly qualified name referring to a variable, function, class, or namespace.

UndefinedType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

UnionOrIntersectionType
  • DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()
UnionOrIntersectionTypeExpr

A union or intersection type, such as string|number|boolean or A & B.

UnionType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

UnionTypeExpr

A union type, such as string|number|boolean.

UniqueSymbolType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

UnknownType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

VarTypeAccess

A possibly qualified name that refers to a variable from inside a type.

VoidType

DEPRECATED. Static types from the TypeScript compiler are not longer available. Use one of the following alternatives instead: - Expr.getTypeBinding() - Expr.getNameBinding() - TypeAnnotation.getTypeBinding()

Modules