@@ -167,6 +167,7 @@ namespace ts {
167
167
DeclareKeyword ,
168
168
GetKeyword ,
169
169
InferKeyword ,
170
+ IntrinsicKeyword ,
170
171
IsKeyword ,
171
172
KeyOfKeyword ,
172
173
ModuleKeyword ,
@@ -186,10 +187,6 @@ namespace ts {
186
187
FromKeyword ,
187
188
GlobalKeyword ,
188
189
BigIntKeyword ,
189
- UppercaseKeyword ,
190
- LowercaseKeyword ,
191
- CapitalizeKeyword ,
192
- UncapitalizeKeyword ,
193
190
OfKeyword , // LastKeyword and LastToken and LastContextualKeyword
194
191
195
192
// Parse tree nodes
@@ -544,7 +541,6 @@ namespace ts {
544
541
| SyntaxKind . BigIntKeyword
545
542
| SyntaxKind . BooleanKeyword
546
543
| SyntaxKind . BreakKeyword
547
- | SyntaxKind . CapitalizeKeyword
548
544
| SyntaxKind . CaseKeyword
549
545
| SyntaxKind . CatchKeyword
550
546
| SyntaxKind . ClassKeyword
@@ -574,10 +570,10 @@ namespace ts {
574
570
| SyntaxKind . InKeyword
575
571
| SyntaxKind . InstanceOfKeyword
576
572
| SyntaxKind . InterfaceKeyword
573
+ | SyntaxKind . IntrinsicKeyword
577
574
| SyntaxKind . IsKeyword
578
575
| SyntaxKind . KeyOfKeyword
579
576
| SyntaxKind . LetKeyword
580
- | SyntaxKind . LowercaseKeyword
581
577
| SyntaxKind . ModuleKeyword
582
578
| SyntaxKind . NamespaceKeyword
583
579
| SyntaxKind . NeverKeyword
@@ -605,11 +601,9 @@ namespace ts {
605
601
| SyntaxKind . TryKeyword
606
602
| SyntaxKind . TypeKeyword
607
603
| SyntaxKind . TypeOfKeyword
608
- | SyntaxKind . UncapitalizeKeyword
609
604
| SyntaxKind . UndefinedKeyword
610
605
| SyntaxKind . UniqueKeyword
611
606
| SyntaxKind . UnknownKeyword
612
- | SyntaxKind . UppercaseKeyword
613
607
| SyntaxKind . VarKeyword
614
608
| SyntaxKind . VoidKeyword
615
609
| SyntaxKind . WhileKeyword
@@ -635,6 +629,7 @@ namespace ts {
635
629
| SyntaxKind . AnyKeyword
636
630
| SyntaxKind . BigIntKeyword
637
631
| SyntaxKind . BooleanKeyword
632
+ | SyntaxKind . IntrinsicKeyword
638
633
| SyntaxKind . NeverKeyword
639
634
| SyntaxKind . NumberKeyword
640
635
| SyntaxKind . ObjectKeyword
@@ -1665,19 +1660,10 @@ namespace ts {
1665
1660
export interface TemplateLiteralTypeSpan extends TypeNode {
1666
1661
readonly kind : SyntaxKind . TemplateLiteralTypeSpan ,
1667
1662
readonly parent : TemplateLiteralTypeNode ;
1668
- readonly casing : TemplateCasing ;
1669
1663
readonly type : TypeNode ;
1670
1664
readonly literal : TemplateMiddle | TemplateTail ;
1671
1665
}
1672
1666
1673
- export const enum TemplateCasing {
1674
- None ,
1675
- Uppercase ,
1676
- Lowercase ,
1677
- Capitalize ,
1678
- Uncapitalize ,
1679
- }
1680
-
1681
1667
// Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing.
1682
1668
// Consider 'Expression'. Without the brand, 'Expression' is actually no different
1683
1669
// (structurally) than 'Node'. Because of this you can pass any Node to a function that
@@ -4892,6 +4878,7 @@ namespace ts {
4892
4878
Substitution = 1 << 25 , // Type parameter substitution
4893
4879
NonPrimitive = 1 << 26 , // intrinsic object type
4894
4880
TemplateLiteral = 1 << 27 , // Template literal type
4881
+ StringMapping = 1 << 28 , // Uppercase/Lowercase type
4895
4882
4896
4883
/* @internal */
4897
4884
AnyOrUnknown = Any | Unknown ,
@@ -4909,7 +4896,7 @@ namespace ts {
4909
4896
Intrinsic = Any | Unknown | String | Number | BigInt | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive ,
4910
4897
/* @internal */
4911
4898
Primitive = String | Number | BigInt | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol ,
4912
- StringLike = String | StringLiteral | TemplateLiteral ,
4899
+ StringLike = String | StringLiteral | TemplateLiteral | StringMapping ,
4913
4900
NumberLike = Number | NumberLiteral | Enum ,
4914
4901
BigIntLike = BigInt | BigIntLiteral ,
4915
4902
BooleanLike = Boolean | BooleanLiteral ,
@@ -4922,15 +4909,15 @@ namespace ts {
4922
4909
StructuredType = Object | Union | Intersection ,
4923
4910
TypeVariable = TypeParameter | IndexedAccess ,
4924
4911
InstantiableNonPrimitive = TypeVariable | Conditional | Substitution ,
4925
- InstantiablePrimitive = Index | TemplateLiteral ,
4912
+ InstantiablePrimitive = Index | TemplateLiteral | StringMapping ,
4926
4913
Instantiable = InstantiableNonPrimitive | InstantiablePrimitive ,
4927
4914
StructuredOrInstantiable = StructuredType | Instantiable ,
4928
4915
/* @internal */
4929
4916
ObjectFlagsType = Any | Nullable | Never | Object | Union | Intersection ,
4930
4917
/* @internal */
4931
4918
Simplifiable = IndexedAccess | Conditional ,
4932
4919
/* @internal */
4933
- Substructure = Object | Union | Intersection | Index | IndexedAccess | Conditional | Substitution | TemplateLiteral ,
4920
+ Substructure = Object | Union | Intersection | Index | IndexedAccess | Conditional | Substitution | TemplateLiteral | StringMapping ,
4934
4921
// 'Narrowable' types are types where narrowing actually narrows.
4935
4922
// This *should* be every type other than null, undefined, void, and never
4936
4923
Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive ,
@@ -5379,11 +5366,15 @@ namespace ts {
5379
5366
}
5380
5367
5381
5368
export interface TemplateLiteralType extends InstantiableType {
5382
- texts : readonly string [ ] ; // Always one element longer than casings/types
5383
- casings : readonly TemplateCasing [ ] ; // Always at least one element
5369
+ texts : readonly string [ ] ; // Always one element longer than types
5384
5370
types : readonly Type [ ] ; // Always at least one element
5385
5371
}
5386
5372
5373
+ export interface StringMappingType extends InstantiableType {
5374
+ symbol : Symbol ;
5375
+ type : Type ;
5376
+ }
5377
+
5387
5378
// Type parameter substitution (TypeFlags.Substitution)
5388
5379
// Substitution types are created for type parameters or indexed access types that occur in the
5389
5380
// true branch of a conditional type. For example, in 'T extends string ? Foo<T> : Bar<T>', the
@@ -6774,8 +6765,8 @@ namespace ts {
6774
6765
createIndexSignature ( decorators : readonly Decorator [ ] | undefined , modifiers : readonly Modifier [ ] | undefined , parameters : readonly ParameterDeclaration [ ] , type : TypeNode ) : IndexSignatureDeclaration ;
6775
6766
/* @internal */ createIndexSignature ( decorators : readonly Decorator [ ] | undefined , modifiers : readonly Modifier [ ] | undefined , parameters : readonly ParameterDeclaration [ ] , type : TypeNode | undefined ) : IndexSignatureDeclaration ; // eslint-disable-line @typescript-eslint/unified-signatures
6776
6767
updateIndexSignature ( node : IndexSignatureDeclaration , decorators : readonly Decorator [ ] | undefined , modifiers : readonly Modifier [ ] | undefined , parameters : readonly ParameterDeclaration [ ] , type : TypeNode ) : IndexSignatureDeclaration ;
6777
- createTemplateLiteralTypeSpan ( casing : TemplateCasing , type : TypeNode , literal : TemplateMiddle | TemplateTail ) : TemplateLiteralTypeSpan ;
6778
- updateTemplateLiteralTypeSpan ( casing : TemplateCasing , node : TemplateLiteralTypeSpan , type : TypeNode , literal : TemplateMiddle | TemplateTail ) : TemplateLiteralTypeSpan ;
6768
+ createTemplateLiteralTypeSpan ( type : TypeNode , literal : TemplateMiddle | TemplateTail ) : TemplateLiteralTypeSpan ;
6769
+ updateTemplateLiteralTypeSpan ( node : TemplateLiteralTypeSpan , type : TypeNode , literal : TemplateMiddle | TemplateTail ) : TemplateLiteralTypeSpan ;
6779
6770
6780
6771
//
6781
6772
// Types
0 commit comments