|
|
|
|
@@ -32,7 +32,7 @@ class NamespaceDefinition extends Stmt, @namespace_definition, AST::ValueNode {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the namespace being defined.
|
|
|
|
|
*/
|
|
|
|
|
Namespace getNamespace() { result.getADefinition() = this }
|
|
|
|
|
deprecated Namespace getNamespace() { result.getADefinition() = this }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -112,12 +112,12 @@ class TypeDefinition extends AstNode, @type_definition {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the type being defined.
|
|
|
|
|
*/
|
|
|
|
|
TypeName getTypeName() { result.getADefinition() = this }
|
|
|
|
|
deprecated TypeName getTypeName() { result.getADefinition() = this }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the type defined by this declaration.
|
|
|
|
|
*/
|
|
|
|
|
Type getType() { ast_node_type(this.getIdentifier(), result) }
|
|
|
|
|
deprecated Type getType() { ast_node_type(this.getIdentifier(), result) }
|
|
|
|
|
|
|
|
|
|
override string getAPrimaryQlClass() { result = "TypeDefinition" }
|
|
|
|
|
}
|
|
|
|
|
@@ -269,7 +269,7 @@ class TypeAliasDeclaration extends @type_alias_declaration, TypeParameterized, S
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the type being defined.
|
|
|
|
|
*/
|
|
|
|
|
TypeName getTypeName() { result.getADefinition() = this }
|
|
|
|
|
deprecated TypeName getTypeName() { result.getADefinition() = this }
|
|
|
|
|
|
|
|
|
|
override string getAPrimaryQlClass() { result = "TypeAliasDeclaration" }
|
|
|
|
|
}
|
|
|
|
|
@@ -549,7 +549,7 @@ class LocalNamespaceName extends @local_namespace_name, LexicalName {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the namespace referenced by this name.
|
|
|
|
|
*/
|
|
|
|
|
Namespace getNamespace() { result = this.getADeclaration().getNamespace() }
|
|
|
|
|
deprecated Namespace getNamespace() { result = this.getADeclaration().getNamespace() }
|
|
|
|
|
|
|
|
|
|
override DeclarationSpace getDeclarationSpace() { result = "namespace" }
|
|
|
|
|
}
|
|
|
|
|
@@ -569,7 +569,7 @@ class TypeExpr extends ExprOrType, @typeexpr, TypeAnnotation {
|
|
|
|
|
* Has no result if this occurs in a TypeScript file that was extracted
|
|
|
|
|
* without type information.
|
|
|
|
|
*/
|
|
|
|
|
override Type getType() { ast_node_type(this, result) }
|
|
|
|
|
deprecated override Type getType() { ast_node_type(this, result) }
|
|
|
|
|
|
|
|
|
|
override Stmt getEnclosingStmt() { result = ExprOrType.super.getEnclosingStmt() }
|
|
|
|
|
|
|
|
|
|
@@ -693,7 +693,7 @@ class TypeAccess extends @typeaccess, TypeExpr, TypeRef {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the type being accessed.
|
|
|
|
|
*/
|
|
|
|
|
TypeName getTypeName() { ast_node_symbol(this, result) }
|
|
|
|
|
deprecated TypeName getTypeName() { ast_node_symbol(this, result) }
|
|
|
|
|
|
|
|
|
|
override string getAPrimaryQlClass() { result = "TypeAccess" }
|
|
|
|
|
}
|
|
|
|
|
@@ -1380,7 +1380,7 @@ class LocalNamespaceDecl extends VarDecl, NamespaceRef {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the namespace being defined or aliased by this name.
|
|
|
|
|
*/
|
|
|
|
|
Namespace getNamespace() { ast_node_symbol(this, result) }
|
|
|
|
|
deprecated Namespace getNamespace() { ast_node_symbol(this, result) }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -1398,7 +1398,7 @@ class NamespaceAccess extends TypeExpr, NamespaceRef, @namespace_access {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the namespace being accessed.
|
|
|
|
|
*/
|
|
|
|
|
Namespace getNamespace() { ast_node_symbol(this, result) }
|
|
|
|
|
deprecated Namespace getNamespace() { ast_node_symbol(this, result) }
|
|
|
|
|
|
|
|
|
|
override string getAPrimaryQlClass() { result = "NamespaceAccess" }
|
|
|
|
|
}
|
|
|
|
|
@@ -1507,7 +1507,7 @@ class EnumDeclaration extends NamespaceDefinition, @enum_declaration, AST::Value
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the type being defined.
|
|
|
|
|
*/
|
|
|
|
|
TypeName getTypeName() { ast_node_symbol(this, result) }
|
|
|
|
|
deprecated TypeName getTypeName() { ast_node_symbol(this, result) }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the local namespace name introduced by the enumeration, for use in
|
|
|
|
|
@@ -1595,7 +1595,7 @@ class EnumMember extends AstNode, @enum_member {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the type defined by this enum member.
|
|
|
|
|
*/
|
|
|
|
|
TypeName getTypeName() { ast_node_symbol(this, result) }
|
|
|
|
|
deprecated TypeName getTypeName() { ast_node_symbol(this, result) }
|
|
|
|
|
|
|
|
|
|
override string getAPrimaryQlClass() { result = "EnumMember" }
|
|
|
|
|
}
|
|
|
|
|
@@ -1776,7 +1776,7 @@ class TypeRootFolder extends Folder {
|
|
|
|
|
* For instance, there may be many AST nodes representing different uses of the
|
|
|
|
|
* `number` keyword, but there only exists one `number` type.
|
|
|
|
|
*/
|
|
|
|
|
class Type extends @type {
|
|
|
|
|
deprecated class Type extends @type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets a string representation of this type.
|
|
|
|
|
*/
|
|
|
|
|
@@ -1975,7 +1975,7 @@ class Type extends @type {
|
|
|
|
|
/**
|
|
|
|
|
* A union type or intersection type, such as `string | number` or `T & U`.
|
|
|
|
|
*/
|
|
|
|
|
class UnionOrIntersectionType extends Type, @union_or_intersection_type {
|
|
|
|
|
deprecated class UnionOrIntersectionType extends Type, @union_or_intersection_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the `i`th member of this union or intersection, starting at 0.
|
|
|
|
|
*/
|
|
|
|
|
@@ -1998,12 +1998,12 @@ class UnionOrIntersectionType extends Type, @union_or_intersection_type {
|
|
|
|
|
* Note that the `boolean` type is represented as the union `true | false`,
|
|
|
|
|
* but is still displayed as `boolean` in string representations.
|
|
|
|
|
*/
|
|
|
|
|
class UnionType extends UnionOrIntersectionType, @union_type { }
|
|
|
|
|
deprecated class UnionType extends UnionOrIntersectionType, @union_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* An intersection type, such as `T & {x: number}`.
|
|
|
|
|
*/
|
|
|
|
|
class IntersectionType extends UnionOrIntersectionType, @intersection_type { }
|
|
|
|
|
deprecated class IntersectionType extends UnionOrIntersectionType, @intersection_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A type that describes a JavaScript `Array` object.
|
|
|
|
|
@@ -2016,7 +2016,7 @@ class IntersectionType extends UnionOrIntersectionType, @intersection_type { }
|
|
|
|
|
* Foreign array-like objects such as `HTMLCollection` are not normal JavaScript arrays,
|
|
|
|
|
* and their corresponding types are not considered array types either.
|
|
|
|
|
*/
|
|
|
|
|
class ArrayType extends Type {
|
|
|
|
|
deprecated class ArrayType extends Type {
|
|
|
|
|
ArrayType() {
|
|
|
|
|
this instanceof @tuple_type or
|
|
|
|
|
this.(TypeReference).hasQualifiedName("Array") or
|
|
|
|
|
@@ -2032,7 +2032,7 @@ class ArrayType extends Type {
|
|
|
|
|
/**
|
|
|
|
|
* An array type such as `Array<string>`, or equivalently, `string[]`.
|
|
|
|
|
*/
|
|
|
|
|
class PlainArrayType extends ArrayType, TypeReference {
|
|
|
|
|
deprecated class PlainArrayType extends ArrayType, TypeReference {
|
|
|
|
|
PlainArrayType() { this.hasQualifiedName("Array") }
|
|
|
|
|
|
|
|
|
|
override Type getNumberIndexType() { result = this.getTypeArgument(0) }
|
|
|
|
|
@@ -2041,14 +2041,14 @@ class PlainArrayType extends ArrayType, TypeReference {
|
|
|
|
|
/**
|
|
|
|
|
* A read-only array type such as `ReadonlyArray<string>`.
|
|
|
|
|
*/
|
|
|
|
|
class ReadonlyArrayType extends ArrayType, TypeReference {
|
|
|
|
|
deprecated class ReadonlyArrayType extends ArrayType, TypeReference {
|
|
|
|
|
ReadonlyArrayType() { this.hasQualifiedName("ReadonlyArray") }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A tuple type, such as `[number, string]`.
|
|
|
|
|
*/
|
|
|
|
|
class TupleType extends ArrayType, @tuple_type {
|
|
|
|
|
deprecated class TupleType extends ArrayType, @tuple_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the `i`th member of this tuple type, starting at 0.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2104,32 +2104,32 @@ class TupleType extends ArrayType, @tuple_type {
|
|
|
|
|
/**
|
|
|
|
|
* The predefined `any` type.
|
|
|
|
|
*/
|
|
|
|
|
class AnyType extends Type, @any_type { }
|
|
|
|
|
deprecated class AnyType extends Type, @any_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The predefined `unknown` type.
|
|
|
|
|
*/
|
|
|
|
|
class UnknownType extends Type, @unknown_type { }
|
|
|
|
|
deprecated class UnknownType extends Type, @unknown_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The predefined `string` type.
|
|
|
|
|
*/
|
|
|
|
|
class StringType extends Type, @string_type { }
|
|
|
|
|
deprecated class StringType extends Type, @string_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The predefined `number` type.
|
|
|
|
|
*/
|
|
|
|
|
class NumberType extends Type, @number_type { }
|
|
|
|
|
deprecated class NumberType extends Type, @number_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The predefined `bigint` type.
|
|
|
|
|
*/
|
|
|
|
|
class BigIntType extends Type, @bigint_type { }
|
|
|
|
|
deprecated class BigIntType extends Type, @bigint_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A boolean, number, or string literal type.
|
|
|
|
|
*/
|
|
|
|
|
class LiteralType extends Type, @literal_type {
|
|
|
|
|
deprecated class LiteralType extends Type, @literal_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the string value of this literal.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2139,7 +2139,7 @@ class LiteralType extends Type, @literal_type {
|
|
|
|
|
/**
|
|
|
|
|
* The boolean literal type `true` or `false`.
|
|
|
|
|
*/
|
|
|
|
|
class BooleanLiteralType extends LiteralType, @boolean_literal_type {
|
|
|
|
|
deprecated class BooleanLiteralType extends LiteralType, @boolean_literal_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the boolean value represented by this type.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2153,7 +2153,7 @@ class BooleanLiteralType extends LiteralType, @boolean_literal_type {
|
|
|
|
|
/**
|
|
|
|
|
* A number literal as a static type.
|
|
|
|
|
*/
|
|
|
|
|
class NumberLiteralType extends LiteralType, @number_literal_type {
|
|
|
|
|
deprecated class NumberLiteralType extends LiteralType, @number_literal_type {
|
|
|
|
|
override string getStringValue() { type_literal_value(this, result) }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -2170,14 +2170,14 @@ class NumberLiteralType extends LiteralType, @number_literal_type {
|
|
|
|
|
/**
|
|
|
|
|
* A string literal as a static type.
|
|
|
|
|
*/
|
|
|
|
|
class StringLiteralType extends LiteralType, @string_literal_type {
|
|
|
|
|
deprecated class StringLiteralType extends LiteralType, @string_literal_type {
|
|
|
|
|
override string getStringValue() { type_literal_value(this, result) }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A bigint literal as a static type.
|
|
|
|
|
*/
|
|
|
|
|
class BigIntLiteralType extends LiteralType {
|
|
|
|
|
deprecated class BigIntLiteralType extends LiteralType {
|
|
|
|
|
override string getStringValue() { type_literal_value(this, result) }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -2194,7 +2194,7 @@ class BigIntLiteralType extends LiteralType {
|
|
|
|
|
/**
|
|
|
|
|
* The `boolean` type, internally represented as the union type `true | false`.
|
|
|
|
|
*/
|
|
|
|
|
class BooleanType extends UnionType {
|
|
|
|
|
deprecated class BooleanType extends UnionType {
|
|
|
|
|
BooleanType() {
|
|
|
|
|
this.getAnElementType() instanceof @true_type and
|
|
|
|
|
this.getAnElementType() instanceof @false_type and
|
|
|
|
|
@@ -2205,7 +2205,7 @@ class BooleanType extends UnionType {
|
|
|
|
|
/**
|
|
|
|
|
* The `string` type or a string literal type.
|
|
|
|
|
*/
|
|
|
|
|
class StringLikeType extends Type {
|
|
|
|
|
deprecated class StringLikeType extends Type {
|
|
|
|
|
StringLikeType() {
|
|
|
|
|
this instanceof StringType or
|
|
|
|
|
this instanceof StringLiteralType
|
|
|
|
|
@@ -2215,7 +2215,7 @@ class StringLikeType extends Type {
|
|
|
|
|
/**
|
|
|
|
|
* The `number` type or a number literal type.
|
|
|
|
|
*/
|
|
|
|
|
class NumberLikeType extends Type {
|
|
|
|
|
deprecated class NumberLikeType extends Type {
|
|
|
|
|
NumberLikeType() {
|
|
|
|
|
this instanceof NumberType or
|
|
|
|
|
this instanceof NumberLiteralType
|
|
|
|
|
@@ -2225,7 +2225,7 @@ class NumberLikeType extends Type {
|
|
|
|
|
/**
|
|
|
|
|
* The `boolean`, `true,` or `false` type.
|
|
|
|
|
*/
|
|
|
|
|
class BooleanLikeType extends Type {
|
|
|
|
|
deprecated class BooleanLikeType extends Type {
|
|
|
|
|
BooleanLikeType() {
|
|
|
|
|
this instanceof BooleanType or
|
|
|
|
|
this instanceof BooleanLiteralType
|
|
|
|
|
@@ -2235,37 +2235,37 @@ class BooleanLikeType extends Type {
|
|
|
|
|
/**
|
|
|
|
|
* The `void` type.
|
|
|
|
|
*/
|
|
|
|
|
class VoidType extends Type, @void_type { }
|
|
|
|
|
deprecated class VoidType extends Type, @void_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The `undefined` type.
|
|
|
|
|
*/
|
|
|
|
|
class UndefinedType extends Type, @undefined_type { }
|
|
|
|
|
deprecated class UndefinedType extends Type, @undefined_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The `null` type.
|
|
|
|
|
*/
|
|
|
|
|
class NullType extends Type, @null_type { }
|
|
|
|
|
deprecated class NullType extends Type, @null_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The `never` type.
|
|
|
|
|
*/
|
|
|
|
|
class NeverType extends Type, @never_type { }
|
|
|
|
|
deprecated class NeverType extends Type, @never_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The `symbol` type or a specific `unique symbol` type.
|
|
|
|
|
*/
|
|
|
|
|
class SymbolType extends Type, @symbol_type { }
|
|
|
|
|
deprecated class SymbolType extends Type, @symbol_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The `symbol` type.
|
|
|
|
|
*/
|
|
|
|
|
class PlainSymbolType extends SymbolType, @plain_symbol_type { }
|
|
|
|
|
deprecated class PlainSymbolType extends SymbolType, @plain_symbol_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A `unique symbol` type.
|
|
|
|
|
*/
|
|
|
|
|
class UniqueSymbolType extends SymbolType, @unique_symbol_type {
|
|
|
|
|
deprecated class UniqueSymbolType extends SymbolType, @unique_symbol_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the variable exposing the symbol.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2294,12 +2294,12 @@ class UniqueSymbolType extends SymbolType, @unique_symbol_type {
|
|
|
|
|
/**
|
|
|
|
|
* The `object` type.
|
|
|
|
|
*/
|
|
|
|
|
class ObjectKeywordType extends Type, @objectkeyword_type { }
|
|
|
|
|
deprecated class ObjectKeywordType extends Type, @objectkeyword_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to a class, interface, enum, or enum member.
|
|
|
|
|
*/
|
|
|
|
|
class TypeReference extends Type, @type_reference {
|
|
|
|
|
deprecated class TypeReference extends Type, @type_reference {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the type being referenced.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2352,7 +2352,7 @@ class TypeReference extends Type, @type_reference {
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to a class, possibly with type arguments.
|
|
|
|
|
*/
|
|
|
|
|
class ClassType extends TypeReference {
|
|
|
|
|
deprecated class ClassType extends TypeReference {
|
|
|
|
|
ClassDefinition declaration;
|
|
|
|
|
|
|
|
|
|
ClassType() { declaration = this.getADefinition() }
|
|
|
|
|
@@ -2366,7 +2366,7 @@ class ClassType extends TypeReference {
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to an interface, possibly with type arguents.
|
|
|
|
|
*/
|
|
|
|
|
class InterfaceType extends TypeReference {
|
|
|
|
|
deprecated class InterfaceType extends TypeReference {
|
|
|
|
|
InterfaceDeclaration declaration;
|
|
|
|
|
|
|
|
|
|
InterfaceType() { declaration = this.getADefinition() }
|
|
|
|
|
@@ -2380,7 +2380,7 @@ class InterfaceType extends TypeReference {
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to an enum.
|
|
|
|
|
*/
|
|
|
|
|
class EnumType extends TypeReference {
|
|
|
|
|
deprecated class EnumType extends TypeReference {
|
|
|
|
|
EnumDeclaration declaration;
|
|
|
|
|
|
|
|
|
|
EnumType() { declaration = this.getADefinition() }
|
|
|
|
|
@@ -2394,7 +2394,7 @@ class EnumType extends TypeReference {
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to the value of an enum member.
|
|
|
|
|
*/
|
|
|
|
|
class EnumLiteralType extends TypeReference {
|
|
|
|
|
deprecated class EnumLiteralType extends TypeReference {
|
|
|
|
|
EnumMember declaration;
|
|
|
|
|
|
|
|
|
|
EnumLiteralType() { declaration = this.getADefinition() }
|
|
|
|
|
@@ -2408,7 +2408,7 @@ class EnumLiteralType extends TypeReference {
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to a type alias.
|
|
|
|
|
*/
|
|
|
|
|
class TypeAliasReference extends TypeReference {
|
|
|
|
|
deprecated class TypeAliasReference extends TypeReference {
|
|
|
|
|
TypeAliasReference() { type_alias(this, _) }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -2422,12 +2422,12 @@ class TypeAliasReference extends TypeReference {
|
|
|
|
|
/**
|
|
|
|
|
* An anonymous interface type, such as `{ x: number }`.
|
|
|
|
|
*/
|
|
|
|
|
class AnonymousInterfaceType extends Type, @object_type { }
|
|
|
|
|
deprecated class AnonymousInterfaceType extends Type, @object_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to a type variable.
|
|
|
|
|
*/
|
|
|
|
|
class TypeVariableType extends Type, @typevariable_type {
|
|
|
|
|
deprecated class TypeVariableType extends Type, @typevariable_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets a syntactic declaration of this type variable.
|
|
|
|
|
*
|
|
|
|
|
@@ -2467,7 +2467,7 @@ class TypeVariableType extends Type, @typevariable_type {
|
|
|
|
|
/**
|
|
|
|
|
* A type that refers to a type variable declared on a class, interface or function.
|
|
|
|
|
*/
|
|
|
|
|
class CanonicalTypeVariableType extends TypeVariableType, @canonical_type_variable_type {
|
|
|
|
|
deprecated class CanonicalTypeVariableType extends TypeVariableType, @canonical_type_variable_type {
|
|
|
|
|
override TypeName getHostType() { result = this.getCanonicalName().getParent() }
|
|
|
|
|
|
|
|
|
|
override CanonicalName getCanonicalName() { type_symbol(this, result) }
|
|
|
|
|
@@ -2487,7 +2487,7 @@ class CanonicalTypeVariableType extends TypeVariableType, @canonical_type_variab
|
|
|
|
|
* - `<T>(x: T) => T`
|
|
|
|
|
* - `<S, T>(x: S, y: T) => T`.
|
|
|
|
|
*/
|
|
|
|
|
class LexicalTypeVariableType extends TypeVariableType, @lexical_type_variable_type {
|
|
|
|
|
deprecated class LexicalTypeVariableType extends TypeVariableType, @lexical_type_variable_type {
|
|
|
|
|
override string getName() {
|
|
|
|
|
types(this, _, result) // The toString value contains the name.
|
|
|
|
|
}
|
|
|
|
|
@@ -2504,7 +2504,7 @@ class LexicalTypeVariableType extends TypeVariableType, @lexical_type_variable_t
|
|
|
|
|
* }
|
|
|
|
|
* ```
|
|
|
|
|
*/
|
|
|
|
|
class ThisType extends Type, @this_type {
|
|
|
|
|
deprecated class ThisType extends Type, @this_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the type containing the `this` type.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2517,7 +2517,7 @@ class ThisType extends Type, @this_type {
|
|
|
|
|
* The type of a named value, `typeof X`, typically denoting the type of
|
|
|
|
|
* a class constructor, namespace object, enum object, or module object.
|
|
|
|
|
*/
|
|
|
|
|
class TypeofType extends Type, @typeof_type {
|
|
|
|
|
deprecated class TypeofType extends Type, @typeof_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets the canonical name of the named value.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2592,7 +2592,7 @@ module SignatureKind {
|
|
|
|
|
/**
|
|
|
|
|
* A function or constructor signature in a TypeScript type.
|
|
|
|
|
*/
|
|
|
|
|
class CallSignatureType extends @signature_type {
|
|
|
|
|
deprecated class CallSignatureType extends @signature_type {
|
|
|
|
|
/**
|
|
|
|
|
* Gets a value indicating if this is a function or constructor signature.
|
|
|
|
|
*/
|
|
|
|
|
@@ -2741,12 +2741,13 @@ class CallSignatureType extends @signature_type {
|
|
|
|
|
/**
|
|
|
|
|
* A function call signature in a type, that is, a signature without the `new` keyword.
|
|
|
|
|
*/
|
|
|
|
|
class FunctionCallSignatureType extends CallSignatureType, @function_signature_type { }
|
|
|
|
|
deprecated class FunctionCallSignatureType extends CallSignatureType, @function_signature_type { }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A constructor call signature in a type, that is, a signature with the `new` keyword.
|
|
|
|
|
*/
|
|
|
|
|
class ConstructorCallSignatureType extends CallSignatureType, @constructor_signature_type { }
|
|
|
|
|
deprecated class ConstructorCallSignatureType extends CallSignatureType, @constructor_signature_type
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A type name that defines a promise.
|
|
|
|
|
@@ -2756,7 +2757,7 @@ class ConstructorCallSignatureType extends CallSignatureType, @constructor_signa
|
|
|
|
|
* - It has one type parameter, say, `T`
|
|
|
|
|
* - It has a `then` method whose first argument is a callback that takes a `T` as argument.
|
|
|
|
|
*/
|
|
|
|
|
private class PromiseTypeName extends TypeName {
|
|
|
|
|
deprecated private class PromiseTypeName extends TypeName {
|
|
|
|
|
PromiseTypeName() {
|
|
|
|
|
// The name must suggest it is a promise.
|
|
|
|
|
this.getName().matches(["%Promise", "%PromiseLike", "%Thenable", "%Deferred"]) and
|
|
|
|
|
@@ -2780,7 +2781,7 @@ private class PromiseTypeName extends TypeName {
|
|
|
|
|
* This includes types whose name and `then` method signature suggest it is a promise,
|
|
|
|
|
* such as `PromiseLike<T>` and `Thenable<T>`.
|
|
|
|
|
*/
|
|
|
|
|
class PromiseType extends TypeReference {
|
|
|
|
|
deprecated class PromiseType extends TypeReference {
|
|
|
|
|
PromiseType() {
|
|
|
|
|
this.getNumTypeArgument() = 1 and
|
|
|
|
|
this.getTypeName() instanceof PromiseTypeName
|
|
|
|
|
|