File tree 2 files changed +16
-3
lines changed
src/token/PunctuatorToken
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ export interface PunctuatorTokenToText {
44
44
[ SyntaxKind . ColonToken ] : ':' ;
45
45
[ SyntaxKind . AtToken ] : '@' ;
46
46
[ SyntaxKind . QuestionQuestionToken ] : '??' ;
47
+ [ SyntaxKind . BacktickToken ] : '`' ;
48
+ // [SyntaxKind.HashToken]: '#'; // new in PunctuationSyntaxKind in TS 4.4
47
49
[ SyntaxKind . EqualsToken ] : '=' ;
48
50
[ SyntaxKind . PlusEqualsToken ] : '+=' ;
49
51
[ SyntaxKind . MinusEqualsToken ] : '-=' ;
@@ -56,8 +58,8 @@ export interface PunctuatorTokenToText {
56
58
[ SyntaxKind . GreaterThanGreaterThanGreaterThanEqualsToken ] : '>>>=' ;
57
59
[ SyntaxKind . AmpersandEqualsToken ] : '&=' ;
58
60
[ SyntaxKind . BarEqualsToken ] : '|=' ;
59
- [ SyntaxKind . BarBarEqualsToken ] : '||=' ;
60
- [ SyntaxKind . AmpersandAmpersandEqualsToken ] : '&&=' ;
61
- [ SyntaxKind . QuestionQuestionEqualsToken ] : '??=' ;
61
+ [ SyntaxKind . BarBarEqualsToken ] : '||=' ; // included in PunctuationSyntaxKind in TS 4.4
62
+ [ SyntaxKind . AmpersandAmpersandEqualsToken ] : '&&=' ; // included in PunctuationSyntaxKind in TS 4.4
63
+ [ SyntaxKind . QuestionQuestionEqualsToken ] : '??=' ; // included in PunctuationSyntaxKind in TS 4.4
62
64
[ SyntaxKind . CaretEqualsToken ] : '^=' ;
63
65
}
Original file line number Diff line number Diff line change
1
+ import type { PunctuationSyntaxKind } from 'typescript' ;
2
+
3
+ import type { PunctuatorTokenToText } from '../src' ;
4
+
5
+ // @ts -expect-error: purposely unused
6
+ type _Test = {
7
+ readonly [ T in PunctuationSyntaxKind ] : PunctuatorTokenToText [ T ] ;
8
+ // If there are any PunctuationSyntaxKind members that don't have a
9
+ // corresponding PunctuatorTokenToText, then this line will error with
10
+ // "Type 'T' cannot be used to index type 'PunctuatorTokenToText'."
11
+ } ;
You can’t perform that action at this time.
0 commit comments