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

Class CallSignatureType

A function or constructor signature in a TypeScript type.

Import path

import javascript

Direct supertypes

Known direct subtypes

Predicates

getAChildType

Gets a type contained in this signature, that is, the return type or a parameter type.

getAParameter

Gets the type of a parameter of this signature, including the rest parameter, if any.

getAParameterName

Gets the name of a parameter of this signature.

getChild

Gets the nth type contained in this signature, that is, a parameter or return type.

getKind

Gets a value indicating if this is a function or constructor signature.

getNumOptionalParameter

Gets the number of optional parameters, that is, parameters that are marked as optional with the ? suffix or is a rest parameter.

getNumParameter

Gets the number of parameters, including the rest parameter, if any.

getNumRequiredParameter

Gets the number of required parameters, that is, parameters that are not marked as optional with the ? suffix.

getNumTypeParameter

Gets the number of type parameters on this call signature.

getParameter

Gets the type of the nth parameter declared in this signature.

getParameterName

Gets the name of the nth parameter.

getRestParameterArrayType

Gets the type of the rest parameter as an array, if it exists.

getRestParameterType

Gets the type of the rest parameter, if any.

getReturnType

Gets the return type of this signature.

getTypeParameterBound

Gets the bound on the nth type parameter.

getTypeParameterName

Gets the name of the nth type parameter.

hasRestParameter

Holds if this signature declares a rest parameter, such as (x: number, ...y: string[]).

hasTypeParameters

Holds if this call signature declares type parameters.

isAbstract

Holds if this signature is abstract.

isOptionalParameter

Holds if the nth parameter is declared optional with the ? suffix or is the rest parameter.

isRequiredParameter

Holds if the nth parameter is required, that is, it is not marked as optional with the ? suffix.

toString

Gets a string representation of this signature.