@@ -28,6 +28,8 @@ The new name is a drop-in replacement with identical functionality.
28
28
29
29
const ab1 = ` ${' a' }${' b' } ` ;
30
30
const ab2 = ` a${' b' } ` ;
31
+ type AB1 = ` ${' A' }${' B' } ` ;
32
+ type AB2 = ` A${' B' } ` ;
31
33
32
34
const stringWithNumber = ` ${' 1 + 1 = ' }${2 } ` ;
33
35
@@ -38,9 +40,13 @@ const stringWithBoolean = `${'true is '}${true}`;
38
40
39
41
const text = ' a' ;
40
42
const wrappedText = ` ${text } ` ;
43
+ type Text = ' A' ;
44
+ type WrappedText = ` ${Text } ` ;
41
45
42
46
declare const intersectionWithString: string & { _brand: ' test-brand' };
43
47
const wrappedIntersection = ` ${intersectionWithString } ` ;
48
+ type IntersectionWithString = string & { _brand: ' test-brand' };
49
+ type WrappedIntersection = ` ${IntersectionWithString } ` ;
44
50
```
45
51
46
52
</TabItem >
@@ -51,6 +57,15 @@ const wrappedIntersection = `${intersectionWithString}`;
51
57
52
58
const ab1 = ` ab ` ;
53
59
const ab2 = ` ab ` ;
60
+ type AB = ` AB ` ;
61
+
62
+ // Transforming enum members into string unions using template literals is allowed.
63
+ enum ABC {
64
+ A = ' A' ,
65
+ B = ' B' ,
66
+ C = ' C' ,
67
+ }
68
+ type ABCUnion = ` ${ABC } ` ;
54
69
55
70
const stringWithNumber = ` 1 + 1 = 2 ` ;
56
71
@@ -61,9 +76,13 @@ const stringWithBoolean = `true is true`;
61
76
62
77
const text = ' a' ;
63
78
const wrappedText = text ;
79
+ type Text = ' A' ;
80
+ type WrappedText = Text ;
64
81
65
82
declare const intersectionWithString: string & { _brand: ' test-brand' };
66
83
const wrappedIntersection = intersectionWithString ;
84
+ type IntersectionWithString = string & { _brand: ' test-brand' };
85
+ type WrappedIntersection = IntersectionWithString ;
67
86
```
68
87
69
88
</TabItem >
0 commit comments