Skip to content

Commit b6a5f20

Browse files
committed
add jsdocs
1 parent 904a6e1 commit b6a5f20

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/compiler/types.ts

+10
Original file line numberDiff line numberDiff line change
@@ -4968,6 +4968,16 @@ export interface TypeChecker {
49684968
getWidenedLiteralType(type: Type): Type;
49694969
/** @internal */
49704970
getPromisedTypeOfPromise(promise: Type, errorNode?: Node): Type | undefined;
4971+
/**
4972+
* Gets the "awaited type" of a type.
4973+
*
4974+
* The "awaited type" of an expression is its "promised type" if the expression is a
4975+
* Promise-like type; otherwise, it is the type of the expression. If the "promised
4976+
* type" is itself a Promise-like, the "promised type" is recursively unwrapped until a
4977+
* non-promise type is found.
4978+
*
4979+
* This is used to reflect the runtime behavior of the `await` keyword.
4980+
*/
49714981
getAwaitedType(type: Type): Type | undefined;
49724982
/** @internal */
49734983
isEmptyAnonymousObjectType(type: Type): boolean;

tests/baselines/reference/api/typescript.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -6070,6 +6070,16 @@ declare namespace ts {
60706070
getBaseTypes(type: InterfaceType): BaseType[];
60716071
getBaseTypeOfLiteralType(type: Type): Type;
60726072
getWidenedType(type: Type): Type;
6073+
/**
6074+
* Gets the "awaited type" of a type.
6075+
*
6076+
* The "awaited type" of an expression is its "promised type" if the expression is a
6077+
* Promise-like type; otherwise, it is the type of the expression. If the "promised
6078+
* type" is itself a Promise-like, the "promised type" is recursively unwrapped until a
6079+
* non-promise type is found.
6080+
*
6081+
* This is used to reflect the runtime behavior of the `await` keyword.
6082+
*/
60736083
getAwaitedType(type: Type): Type | undefined;
60746084
getReturnTypeOfSignature(signature: Signature): Type;
60756085
getNullableType(type: Type, flags: TypeFlags): Type;

0 commit comments

Comments
 (0)