@@ -168,6 +168,7 @@ namespace ts {
168
168
DeclareKeyword ,
169
169
GetKeyword ,
170
170
IsKeyword ,
171
+ KeyOfKeyword ,
171
172
ModuleKeyword ,
172
173
NamespaceKeyword ,
173
174
NeverKeyword ,
@@ -216,6 +217,8 @@ namespace ts {
216
217
IntersectionType ,
217
218
ParenthesizedType ,
218
219
ThisType ,
220
+ TypeOperator ,
221
+ IndexedAccessType ,
219
222
LiteralType ,
220
223
// Binding patterns
221
224
ObjectBindingPattern ,
@@ -882,6 +885,18 @@ namespace ts {
882
885
type : TypeNode ;
883
886
}
884
887
888
+ export interface TypeOperatorNode extends TypeNode {
889
+ kind : SyntaxKind . TypeOperator ;
890
+ operator : SyntaxKind . KeyOfKeyword ;
891
+ type : TypeNode ;
892
+ }
893
+
894
+ export interface IndexedAccessTypeNode extends TypeNode {
895
+ kind : SyntaxKind . IndexedAccessType ;
896
+ objectType : TypeNode ;
897
+ indexType : TypeNode ;
898
+ }
899
+
885
900
export interface LiteralTypeNode extends TypeNode {
886
901
kind : SyntaxKind . LiteralType ;
887
902
literal : Expression ;
@@ -953,10 +968,6 @@ namespace ts {
953
968
operator : PostfixUnaryOperator ;
954
969
}
955
970
956
- export interface PostfixExpression extends UnaryExpression {
957
- _postfixExpressionBrand : any ;
958
- }
959
-
960
971
export interface LeftHandSideExpression extends IncrementExpression {
961
972
_leftHandSideExpressionBrand : any ;
962
973
}
@@ -2667,14 +2678,16 @@ namespace ts {
2667
2678
Object = 1 << 15 , // Object type
2668
2679
Union = 1 << 16 , // Union (T | U)
2669
2680
Intersection = 1 << 17 , // Intersection (T & U)
2681
+ Index = 1 << 18 , // keyof T
2682
+ IndexedAccess = 1 << 19 , // T[K]
2670
2683
/* @internal */
2671
- FreshLiteral = 1 << 18 , // Fresh literal type
2684
+ FreshLiteral = 1 << 20 , // Fresh literal type
2672
2685
/* @internal */
2673
- ContainsWideningType = 1 << 19 , // Type is or contains undefined or null widening type
2686
+ ContainsWideningType = 1 << 21 , // Type is or contains undefined or null widening type
2674
2687
/* @internal */
2675
- ContainsObjectLiteral = 1 << 20 , // Type is or contains object literal type
2688
+ ContainsObjectLiteral = 1 << 22 , // Type is or contains object literal type
2676
2689
/* @internal */
2677
- ContainsAnyFunctionType = 1 << 21 , // Type is or contains object literal type
2690
+ ContainsAnyFunctionType = 1 << 23 , // Type is or contains object literal type
2678
2691
2679
2692
/* @internal */
2680
2693
Nullable = Undefined | Null ,
@@ -2697,7 +2710,7 @@ namespace ts {
2697
2710
2698
2711
// 'Narrowable' types are types where narrowing actually narrows.
2699
2712
// This *should* be every type other than null, undefined, void, and never
2700
- Narrowable = Any | StructuredType | TypeParameter | StringLike | NumberLike | BooleanLike | ESSymbol ,
2713
+ Narrowable = Any | StructuredType | TypeParameter | Index | IndexedAccess | StringLike | NumberLike | BooleanLike | ESSymbol ,
2701
2714
NotUnionOrUnit = Any | ESSymbol | Object ,
2702
2715
/* @internal */
2703
2716
RequiresWidening = ContainsWideningType | ContainsObjectLiteral ,
@@ -2860,9 +2873,22 @@ namespace ts {
2860
2873
/* @internal */
2861
2874
resolvedApparentType : Type ;
2862
2875
/* @internal */
2876
+ resolvedIndexType : IndexType ;
2877
+ /* @internal */
2878
+ resolvedIndexedAccessTypes : IndexedAccessType [ ] ;
2879
+ /* @internal */
2863
2880
isThisType ?: boolean ;
2864
2881
}
2865
2882
2883
+ export interface IndexType extends Type {
2884
+ type : TypeParameter ;
2885
+ }
2886
+
2887
+ export interface IndexedAccessType extends Type {
2888
+ objectType : Type ;
2889
+ indexType : TypeParameter ;
2890
+ }
2891
+
2866
2892
export const enum SignatureKind {
2867
2893
Call ,
2868
2894
Construct ,
0 commit comments