diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 544b804e86536..87a72ea860f3b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4927,7 +4927,7 @@ export interface TypeCheckerHost extends ModuleSpecifierResolutionHost { export interface TypeChecker { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - /** @internal */ getTypeOfSymbol(symbol: Symbol): Type; + getTypeOfSymbol(symbol: Symbol): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; @@ -5153,9 +5153,21 @@ export interface TypeChecker { /** @internal */ getRecursionIdentity(type: Type): object | undefined; /** @internal */ getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean): IterableIterator; - /** @internal */ isArrayType(type: Type): boolean; - /** @internal */ isTupleType(type: Type): boolean; - /** @internal */ isArrayLikeType(type: Type): boolean; + /** + * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts. + * This function will _not_ return true if passed a type which + * extends `Array` (for example, the TypeScript AST's `NodeArray` type). + */ + isArrayType(type: Type): boolean; + /** + * True if this type is a tuple type. This function will _not_ return true if + * passed a type which extends from a tuple. + */ + isTupleType(type: Type): boolean; + /** + * True if this type is assignable to `ReadonlyArray`. + */ + isArrayLikeType(type: Type): boolean; /** * True if `contextualType` should not be considered for completions because diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 65f9a35b41dc6..035abc4d7ff10 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -6310,6 +6310,7 @@ declare namespace ts { } interface TypeChecker { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; + getTypeOfSymbol(symbol: Symbol): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; @@ -6400,6 +6401,21 @@ declare namespace ts { getApparentType(type: Type): Type; getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; + /** + * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts. + * This function will _not_ return true if passed a type which + * extends `Array` (for example, the TypeScript AST's `NodeArray` type). + */ + isArrayType(type: Type): boolean; + /** + * True if this type is a tuple type. This function will _not_ return true if + * passed a type which extends from a tuple. + */ + isTupleType(type: Type): boolean; + /** + * True if this type is assignable to `ReadonlyArray`. + */ + isArrayLikeType(type: Type): boolean; getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined; /** * Depending on the operation performed, it may be appropriate to throw away the checker diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index e973a18179380..a8a5c3bb97f1b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2335,6 +2335,7 @@ declare namespace ts { } interface TypeChecker { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; + getTypeOfSymbol(symbol: Symbol): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; @@ -2425,6 +2426,21 @@ declare namespace ts { getApparentType(type: Type): Type; getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; + /** + * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts. + * This function will _not_ return true if passed a type which + * extends `Array` (for example, the TypeScript AST's `NodeArray` type). + */ + isArrayType(type: Type): boolean; + /** + * True if this type is a tuple type. This function will _not_ return true if + * passed a type which extends from a tuple. + */ + isTupleType(type: Type): boolean; + /** + * True if this type is assignable to `ReadonlyArray`. + */ + isArrayLikeType(type: Type): boolean; getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined; /** * Depending on the operation performed, it may be appropriate to throw away the checker