@@ -21,11 +21,12 @@ class Options {
2121}
2222
2323type Dictionary < T > = { [ x : string ] : T } ;
24+ type NumericallyIndexed < T > = { [ x : number ] : T } ;
2425
2526const enum E { A, B, C }
2627
27- type K00 = keyof any ; // string | number
28- type K01 = keyof string ; // number | "toString" | "charAt" | ...
28+ type K00 = keyof any ; // string
29+ type K01 = keyof string ; // "toString" | "charAt" | ...
2930type K02 = keyof number ; // "toString" | "toFixed" | "toExponential" | ...
3031type K03 = keyof boolean ; // "valueOf"
3132type K04 = keyof void ; // never
@@ -34,19 +35,20 @@ type K06 = keyof null; // never
3435type K07 = keyof never ; // never
3536
3637type K10 = keyof Shape ; // "name" | "width" | "height" | "visible"
37- type K11 = keyof Shape [ ] ; // number | "length" | "toString" | ...
38- type K12 = keyof Dictionary < Shape > ; // string | number
38+ type K11 = keyof Shape [ ] ; // "length" | "toString" | ...
39+ type K12 = keyof Dictionary < Shape > ; // string
3940type K13 = keyof { } ; // never
4041type K14 = keyof Object ; // "constructor" | "toString" | ...
4142type K15 = keyof E ; // "toString" | "toFixed" | "toExponential" | ...
42- type K16 = keyof [ string , number ] ; // number | "0" | "1" | "length" | "toString" | ...
43+ type K16 = keyof [ string , number ] ; // "0" | "1" | "length" | "toString" | ...
4344type K17 = keyof ( Shape | Item ) ; // "name"
4445type K18 = keyof ( Shape & Item ) ; // "name" | "width" | "height" | "visible" | "price"
46+ type K19 = keyof NumericallyIndexed < Shape > // never
4547
4648type KeyOf < T > = keyof T ;
4749
4850type K20 = KeyOf < Shape > ; // "name" | "width" | "height" | "visible"
49- type K21 = KeyOf < Dictionary < Shape >> ; // string | number
51+ type K21 = KeyOf < Dictionary < Shape >> ; // string
5052
5153type NAME = "name" ;
5254type WIDTH_OR_HEIGHT = "width" | "height" ;
@@ -247,7 +249,8 @@ class OtherPerson {
247249 getParts() {
248250 return getProperty ( this , "parts" )
249251 }
250- }
252+ }
253+
251254
252255//// [keyofAndIndexedAccess.js]
253256var __extends = ( this && this . __extends ) || function ( d , b ) {
@@ -449,6 +452,9 @@ declare class Options {
449452declare type Dictionary< T > = {
450453 [ x : string ] : T ;
451454} ;
455+ declare type NumericallyIndexed< T > = {
456+ [ x : number ] : T ;
457+ } ;
452458declare const enum E {
453459 A = 0 ,
454460 B = 1 ,
@@ -471,6 +477,7 @@ declare type K15 = keyof E;
471477declare type K16 = keyof [string, number];
472478declare type K17 = keyof (Shape | Item);
473479declare type K18 = keyof (Shape & Item ) ;
480+ declare type K19 = keyof NumericallyIndexed < Shape > ;
474481declare type KeyOf< T > = keyof T;
475482declare type K20 = KeyOf< Shape > ;
476483declare type K21 = KeyOf< Dictionary < Shape > > ;
0 commit comments