@@ -241,6 +241,7 @@ namespace ts {
241241 TypeKeyword ,
242242 UndefinedKeyword ,
243243 UniqueKeyword ,
244+ UnknownKeyword ,
244245 FromKeyword ,
245246 GlobalKeyword ,
246247 OfKeyword , // LastKeyword and LastToken and LastContextualKeyword
@@ -1068,6 +1069,7 @@ namespace ts {
10681069
10691070 export interface KeywordTypeNode extends TypeNode {
10701071 kind : SyntaxKind . AnyKeyword
1072+ | SyntaxKind . UnknownKeyword
10711073 | SyntaxKind . NumberKeyword
10721074 | SyntaxKind . ObjectKeyword
10731075 | SyntaxKind . BooleanKeyword
@@ -3665,42 +3667,43 @@ namespace ts {
36653667
36663668 export const enum TypeFlags {
36673669 Any = 1 << 0 ,
3668- String = 1 << 1 ,
3669- Number = 1 << 2 ,
3670- Boolean = 1 << 3 ,
3671- Enum = 1 << 4 ,
3672- StringLiteral = 1 << 5 ,
3673- NumberLiteral = 1 << 6 ,
3674- BooleanLiteral = 1 << 7 ,
3675- EnumLiteral = 1 << 8 , // Always combined with StringLiteral, NumberLiteral, or Union
3676- ESSymbol = 1 << 9 , // Type of symbol primitive introduced in ES6
3677- UniqueESSymbol = 1 << 10 , // unique symbol
3678- Void = 1 << 11 ,
3679- Undefined = 1 << 12 ,
3680- Null = 1 << 13 ,
3681- Never = 1 << 14 , // Never type
3682- TypeParameter = 1 << 15 , // Type parameter
3683- Object = 1 << 16 , // Object type
3684- Union = 1 << 17 , // Union (T | U)
3685- Intersection = 1 << 18 , // Intersection (T & U)
3686- Index = 1 << 19 , // keyof T
3687- IndexedAccess = 1 << 20 , // T[K]
3688- Conditional = 1 << 21 , // T extends U ? X : Y
3689- Substitution = 1 << 22 , // Type parameter substitution
3670+ Unknown = 1 << 1 ,
3671+ String = 1 << 2 ,
3672+ Number = 1 << 3 ,
3673+ Boolean = 1 << 4 ,
3674+ Enum = 1 << 5 ,
3675+ StringLiteral = 1 << 6 ,
3676+ NumberLiteral = 1 << 7 ,
3677+ BooleanLiteral = 1 << 8 ,
3678+ EnumLiteral = 1 << 9 , // Always combined with StringLiteral, NumberLiteral, or Union
3679+ ESSymbol = 1 << 10 , // Type of symbol primitive introduced in ES6
3680+ UniqueESSymbol = 1 << 11 , // unique symbol
3681+ Void = 1 << 12 ,
3682+ Undefined = 1 << 13 ,
3683+ Null = 1 << 14 ,
3684+ Never = 1 << 15 , // Never type
3685+ TypeParameter = 1 << 16 , // Type parameter
3686+ Object = 1 << 17 , // Object type
3687+ Union = 1 << 18 , // Union (T | U)
3688+ Intersection = 1 << 19 , // Intersection (T & U)
3689+ Index = 1 << 20 , // keyof T
3690+ IndexedAccess = 1 << 21 , // T[K]
3691+ Conditional = 1 << 22 , // T extends U ? X : Y
3692+ Substitution = 1 << 23 , // Type parameter substitution
3693+ NonPrimitive = 1 << 24 , // intrinsic object type
36903694 /* @internal */
3691- FreshLiteral = 1 << 23 , // Fresh literal or unique type
3695+ FreshLiteral = 1 << 25 , // Fresh literal or unique type
36923696 /* @internal */
3693- ContainsWideningType = 1 << 24 , // Type is or contains undefined or null widening type
3697+ UnionOfUnitTypes = 1 << 26 , // Type is union of unit types
36943698 /* @internal */
3695- ContainsObjectLiteral = 1 << 25 , // Type is or contains object literal type
3699+ ContainsWideningType = 1 << 27 , // Type is or contains undefined or null widening type
36963700 /* @internal */
3697- ContainsAnyFunctionType = 1 << 26 , // Type is or contains the anyFunctionType
3698- NonPrimitive = 1 << 27 , // intrinsic object type
3701+ ContainsObjectLiteral = 1 << 28 , // Type is or contains object literal type
36993702 /* @internal */
3700- UnionOfUnitTypes = 1 << 28 , // Type is union of unit types
3701- /* @internal */
3702- GenericMappedType = 1 << 29 , // Flag used by maybeTypeOfKind
3703+ ContainsAnyFunctionType = 1 << 29 , // Type is or contains the anyFunctionType
37033704
3705+ /* @internal */
3706+ AnyOrUnknown = Any | Unknown ,
37043707 /* @internal */
37053708 Nullable = Undefined | Null ,
37063709 Literal = StringLiteral | NumberLiteral | BooleanLiteral ,
@@ -3712,7 +3715,7 @@ namespace ts {
37123715 DefinitelyFalsy = StringLiteral | NumberLiteral | BooleanLiteral | Void | Undefined | Null ,
37133716 PossiblyFalsy = DefinitelyFalsy | String | Number | Boolean ,
37143717 /* @internal */
3715- Intrinsic = Any | String | Number | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive ,
3718+ Intrinsic = Any | Unknown | String | Number | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive ,
37163719 /* @internal */
37173720 Primitive = String | Number | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol ,
37183721 StringLike = String | StringLiteral ,
@@ -3733,8 +3736,8 @@ namespace ts {
37333736
37343737 // 'Narrowable' types are types where narrowing actually narrows.
37353738 // This *should* be every type other than null, undefined, void, and never
3736- Narrowable = Any | StructuredOrInstantiable | StringLike | NumberLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive ,
3737- NotUnionOrUnit = Any | ESSymbol | Object | NonPrimitive ,
3739+ Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive ,
3740+ NotUnionOrUnit = Any | Unknown | ESSymbol | Object | NonPrimitive ,
37383741 /* @internal */
37393742 NotUnit = Any | String | Number | Boolean | Enum | ESSymbol | Void | Never | StructuredOrInstantiable ,
37403743 /* @internal */
@@ -3749,7 +3752,10 @@ namespace ts {
37493752 /* @internal */
37503753 EmptyObject = ContainsAnyFunctionType ,
37513754 /* @internal */
3752- ConstructionFlags = NonWideningType | Wildcard | EmptyObject
3755+ ConstructionFlags = NonWideningType | Wildcard | EmptyObject ,
3756+ // The following flag is used for different purposes by maybeTypeOfKind
3757+ /* @internal */
3758+ GenericMappedType = ContainsWideningType
37533759 }
37543760
37553761 export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression ;
0 commit comments