@@ -241,6 +241,7 @@ namespace ts {
241
241
TypeKeyword ,
242
242
UndefinedKeyword ,
243
243
UniqueKeyword ,
244
+ UnknownKeyword ,
244
245
FromKeyword ,
245
246
GlobalKeyword ,
246
247
OfKeyword , // LastKeyword and LastToken and LastContextualKeyword
@@ -1068,6 +1069,7 @@ namespace ts {
1068
1069
1069
1070
export interface KeywordTypeNode extends TypeNode {
1070
1071
kind : SyntaxKind . AnyKeyword
1072
+ | SyntaxKind . UnknownKeyword
1071
1073
| SyntaxKind . NumberKeyword
1072
1074
| SyntaxKind . ObjectKeyword
1073
1075
| SyntaxKind . BooleanKeyword
@@ -3665,42 +3667,43 @@ namespace ts {
3665
3667
3666
3668
export const enum TypeFlags {
3667
3669
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
3690
3694
/* @internal */
3691
- FreshLiteral = 1 << 23 , // Fresh literal or unique type
3695
+ FreshLiteral = 1 << 25 , // Fresh literal or unique type
3692
3696
/* @internal */
3693
- ContainsWideningType = 1 << 24 , // Type is or contains undefined or null widening type
3697
+ UnionOfUnitTypes = 1 << 26 , // Type is union of unit types
3694
3698
/* @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
3696
3700
/* @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
3699
3702
/* @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
3703
3704
3705
+ /* @internal */
3706
+ AnyOrUnknown = Any | Unknown ,
3704
3707
/* @internal */
3705
3708
Nullable = Undefined | Null ,
3706
3709
Literal = StringLiteral | NumberLiteral | BooleanLiteral ,
@@ -3712,7 +3715,7 @@ namespace ts {
3712
3715
DefinitelyFalsy = StringLiteral | NumberLiteral | BooleanLiteral | Void | Undefined | Null ,
3713
3716
PossiblyFalsy = DefinitelyFalsy | String | Number | Boolean ,
3714
3717
/* @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 ,
3716
3719
/* @internal */
3717
3720
Primitive = String | Number | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol ,
3718
3721
StringLike = String | StringLiteral ,
@@ -3733,8 +3736,8 @@ namespace ts {
3733
3736
3734
3737
// 'Narrowable' types are types where narrowing actually narrows.
3735
3738
// 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 ,
3738
3741
/* @internal */
3739
3742
NotUnit = Any | String | Number | Boolean | Enum | ESSymbol | Void | Never | StructuredOrInstantiable ,
3740
3743
/* @internal */
@@ -3749,7 +3752,10 @@ namespace ts {
3749
3752
/* @internal */
3750
3753
EmptyObject = ContainsAnyFunctionType ,
3751
3754
/* @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
3753
3759
}
3754
3760
3755
3761
export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression ;
0 commit comments