-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow dynamic names in types #15473
Allow dynamic names in types #15473
Changes from 63 commits
d8cb3c6
0c1eef7
d572a54
2714295
3181a8d
b5f1169
3b684d4
64fd857
d8ae9c0
83b5a75
57674dd
fc61863
fe414a2
93ea56b
2a73d08
625b37e
8c3b73f
c4e9ce5
5854e87
3f83b55
38ee475
022e81b
d7ef995
e81c83c
891e71d
7eedf2e
fb3168d
1b45a05
6f05e43
7ab451b
1745e17
4395f25
43c151a
ee23f93
51ded0b
fea6a87
36f90b6
906a79d
180ca23
7fd38c8
55e63a8
3341e07
0b31860
ccd98af
b5a7b03
51929ac
3febc80
170e6ec
44117e1
ec90dbc
26ca98c
208dfa6
211b2f0
33e09f9
8b717d3
ee36e6a
444e282
d0fb7e4
b9dbf5d
ae11ae5
804c7d3
a21a129
86b0759
0b24f02
ccba128
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -736,15 +736,17 @@ namespace ts { | |
return <ThisTypeNode>createSynthesizedNode(SyntaxKind.ThisType); | ||
} | ||
|
||
export function createTypeOperatorNode(type: TypeNode) { | ||
export function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; | ||
export function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword, type: TypeNode): TypeOperatorNode; | ||
export function createTypeOperatorNode(operatorOrType: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | TypeNode, type?: TypeNode) { | ||
const node = createSynthesizedNode(SyntaxKind.TypeOperator) as TypeOperatorNode; | ||
node.operator = SyntaxKind.KeyOfKeyword; | ||
node.type = parenthesizeElementTypeMember(type); | ||
node.operator = typeof operatorOrType === "number" ? operatorOrType : SyntaxKind.KeyOfKeyword; | ||
node.type = parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); | ||
return node; | ||
} | ||
|
||
export function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode) { | ||
return node.type !== type ? updateNode(createTypeOperatorNode(type), node) : node; | ||
return node.type !== type ? updateNode(createTypeOperatorNode(node.operator, type), node) : node; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. |
||
} | ||
|
||
export function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many error messages.