flow-parser 0.319.0 → 0.321.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +14 -26
  2. package/{oxidized → dist}/FlowParserNodeDeserializers.js +26 -12
  3. package/dist/FlowParserWASM.js +1 -0
  4. package/{oxidized → dist}/babel/TransformESTreeToBabel.js +11 -3
  5. package/{oxidized → dist}/babel/TransformESTreeToBabel.js.flow +12 -4
  6. package/{oxidized/oxidized-src → dist}/estree/StripFlowTypesForBabel.js +33 -18
  7. package/{oxidized → dist}/estree/StripFlowTypesForBabel.js.flow +40 -18
  8. package/{oxidized/oxidized-src → dist}/estree/TransformComponentSyntax.js +25 -12
  9. package/{oxidized → dist}/estree/TransformComponentSyntax.js.flow +29 -11
  10. package/{oxidized → dist}/generated/ESTreeVisitorKeys.js +1 -1
  11. package/package.json +6 -7
  12. package/flow_parser.js +0 -14575
  13. package/oxidized/FlowParserWASM.js +0 -1
  14. package/oxidized/estree/StripFlowTypesForBabel.js +0 -176
  15. package/oxidized/estree/TransformComponentSyntax.js +0 -751
  16. package/oxidized/oxidized-src/FlowParser.js +0 -249
  17. package/oxidized/oxidized-src/FlowParserDeserializer.js +0 -209
  18. package/oxidized/oxidized-src/FlowParserNodeDeserializers.js +0 -1767
  19. package/oxidized/oxidized-src/HermesParserDecodeUTF8String.js +0 -45
  20. package/oxidized/oxidized-src/ParserOptions.js +0 -8
  21. package/oxidized/oxidized-src/babel/TransformESTreeToBabel.js +0 -1055
  22. package/oxidized/oxidized-src/estree/StripFlowTypes.js +0 -158
  23. package/oxidized/oxidized-src/estree/TransformEnumSyntax.js +0 -92
  24. package/oxidized/oxidized-src/estree/TransformMatchSyntax.js +0 -990
  25. package/oxidized/oxidized-src/estree/TransformRecordSyntax.js +0 -283
  26. package/oxidized/oxidized-src/generated/ESTreeVisitorKeys.js +0 -234
  27. package/oxidized/oxidized-src/getModuleDocblock.js +0 -87
  28. package/oxidized/oxidized-src/index.js +0 -220
  29. package/oxidized/transform/SimpleTransform.js +0 -95
  30. package/oxidized/transform/astArrayMutationHelpers.js +0 -52
  31. package/oxidized/transform/astNodeMutationHelpers.js +0 -142
  32. package/oxidized/transform/print/comments/comments.js +0 -245
  33. package/oxidized/transform/print/comments/prettier/common/util.js +0 -235
  34. package/oxidized/transform/print/comments/prettier/language-js/comments.js +0 -663
  35. package/oxidized/transform/print/comments/prettier/language-js/loc.js +0 -30
  36. package/oxidized/transform/print/comments/prettier/language-js/printer-estree.js +0 -23
  37. package/oxidized/transform/print/comments/prettier/language-js/utils.js +0 -89
  38. package/oxidized/transform/print/comments/prettier/main/comments.js +0 -374
  39. package/oxidized/transform/print/comments/prettier/utils/get-last.js +0 -5
  40. package/oxidized/transform/print/detachedNodeTypes.js +0 -1
  41. package/oxidized/transform/print/print.js +0 -68
  42. package/oxidized/traverse/SimpleTraverser.js +0 -90
  43. package/oxidized/traverse/getVisitorKeys.js +0 -29
  44. package/oxidized/utils/Builders.js +0 -181
  45. package/oxidized/utils/GenID.js +0 -37
  46. package/oxidized/utils/createSyntaxError.js +0 -15
  47. package/oxidized/utils/isReservedWord.js +0 -53
  48. package/oxidized/utils/mutateESTreeASTForPrettier.js +0 -85
  49. /package/{oxidized → dist}/FlowParser.js +0 -0
  50. /package/{oxidized → dist}/FlowParser.js.flow +0 -0
  51. /package/{oxidized → dist}/FlowParserDeserializer.js +0 -0
  52. /package/{oxidized → dist}/FlowParserDeserializer.js.flow +0 -0
  53. /package/{oxidized → dist}/FlowParserNodeDeserializers.js.flow +0 -0
  54. /package/{oxidized → dist}/FlowParserWASM.js.flow +0 -0
  55. /package/{oxidized → dist}/HermesAST.js.flow +0 -0
  56. /package/{oxidized → dist}/HermesParserDecodeUTF8String.js +0 -0
  57. /package/{oxidized → dist}/HermesParserDecodeUTF8String.js.flow +0 -0
  58. /package/{oxidized → dist}/ParserOptions.js +0 -0
  59. /package/{oxidized → dist}/ParserOptions.js.flow +0 -0
  60. /package/{oxidized → dist}/estree/StripFlowTypes.js +0 -0
  61. /package/{oxidized → dist}/estree/StripFlowTypes.js.flow +0 -0
  62. /package/{oxidized → dist}/estree/TransformEnumSyntax.js +0 -0
  63. /package/{oxidized → dist}/estree/TransformEnumSyntax.js.flow +0 -0
  64. /package/{oxidized → dist}/estree/TransformMatchSyntax.js +0 -0
  65. /package/{oxidized → dist}/estree/TransformMatchSyntax.js.flow +0 -0
  66. /package/{oxidized → dist}/estree/TransformRecordSyntax.js +0 -0
  67. /package/{oxidized → dist}/estree/TransformRecordSyntax.js.flow +0 -0
  68. /package/{oxidized → dist}/generated/ESTreeVisitorKeys.js.flow +0 -0
  69. /package/{oxidized → dist}/getModuleDocblock.js +0 -0
  70. /package/{oxidized → dist}/getModuleDocblock.js.flow +0 -0
  71. /package/{oxidized → dist}/index.js +0 -0
  72. /package/{oxidized → dist}/index.js.flow +0 -0
  73. /package/{oxidized/oxidized-src → dist}/transform/SimpleTransform.js +0 -0
  74. /package/{oxidized → dist}/transform/SimpleTransform.js.flow +0 -0
  75. /package/{oxidized/oxidized-src → dist}/transform/astArrayMutationHelpers.js +0 -0
  76. /package/{oxidized → dist}/transform/astArrayMutationHelpers.js.flow +0 -0
  77. /package/{oxidized/oxidized-src → dist}/transform/astNodeMutationHelpers.js +0 -0
  78. /package/{oxidized → dist}/transform/astNodeMutationHelpers.js.flow +0 -0
  79. /package/{oxidized/oxidized-src → dist}/transform/print/comments/comments.js +0 -0
  80. /package/{oxidized → dist}/transform/print/comments/comments.js.flow +0 -0
  81. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/common/util.js +0 -0
  82. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/comments.js +0 -0
  83. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/loc.js +0 -0
  84. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/printer-estree.js +0 -0
  85. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/utils.js +0 -0
  86. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/main/comments.js +0 -0
  87. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/utils/get-last.js +0 -0
  88. /package/{oxidized/oxidized-src → dist}/transform/print/detachedNodeTypes.js +0 -0
  89. /package/{oxidized → dist}/transform/print/detachedNodeTypes.js.flow +0 -0
  90. /package/{oxidized/oxidized-src → dist}/transform/print/print.js +0 -0
  91. /package/{oxidized → dist}/transform/print/print.js.flow +0 -0
  92. /package/{oxidized/oxidized-src → dist}/traverse/SimpleTraverser.js +0 -0
  93. /package/{oxidized → dist}/traverse/SimpleTraverser.js.flow +0 -0
  94. /package/{oxidized/oxidized-src → dist}/traverse/getVisitorKeys.js +0 -0
  95. /package/{oxidized → dist}/traverse/getVisitorKeys.js.flow +0 -0
  96. /package/{oxidized/oxidized-src → dist}/utils/Builders.js +0 -0
  97. /package/{oxidized → dist}/utils/Builders.js.flow +0 -0
  98. /package/{oxidized/oxidized-src → dist}/utils/GenID.js +0 -0
  99. /package/{oxidized → dist}/utils/GenID.js.flow +0 -0
  100. /package/{oxidized/oxidized-src → dist}/utils/createSyntaxError.js +0 -0
  101. /package/{oxidized → dist}/utils/createSyntaxError.js.flow +0 -0
  102. /package/{oxidized/oxidized-src → dist}/utils/isReservedWord.js +0 -0
  103. /package/{oxidized → dist}/utils/isReservedWord.js.flow +0 -0
  104. /package/{oxidized/oxidized-src → dist}/utils/mutateESTreeASTForPrettier.js +0 -0
  105. /package/{oxidized → dist}/utils/mutateESTreeASTForPrettier.js.flow +0 -0
@@ -1,1767 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = [function () {
4
- return {
5
- type: 'EmptyStatement',
6
- loc: this.addEmptyLoc()
7
- };
8
- }, function () {
9
- return {
10
- type: 'ExpressionStatement',
11
- loc: this.addEmptyLoc(),
12
- expression: this.deserializeNode(),
13
- directive: this.deserializeString()
14
- };
15
- }, function () {
16
- return {
17
- type: 'BlockStatement',
18
- loc: this.addEmptyLoc(),
19
- body: this.deserializeNodeList()
20
- };
21
- }, function () {
22
- return {
23
- type: 'IfStatement',
24
- loc: this.addEmptyLoc(),
25
- test: this.deserializeNode(),
26
- consequent: this.deserializeNode(),
27
- alternate: this.deserializeNode()
28
- };
29
- }, function () {
30
- return {
31
- type: 'LabeledStatement',
32
- loc: this.addEmptyLoc(),
33
- label: this.deserializeNode(),
34
- body: this.deserializeNode()
35
- };
36
- }, function () {
37
- return {
38
- type: 'BreakStatement',
39
- loc: this.addEmptyLoc(),
40
- label: this.deserializeNode()
41
- };
42
- }, function () {
43
- return {
44
- type: 'ContinueStatement',
45
- loc: this.addEmptyLoc(),
46
- label: this.deserializeNode()
47
- };
48
- }, function () {
49
- return {
50
- type: 'WithStatement',
51
- loc: this.addEmptyLoc(),
52
- object: this.deserializeNode(),
53
- body: this.deserializeNode()
54
- };
55
- }, function () {
56
- return {
57
- type: 'SwitchStatement',
58
- loc: this.addEmptyLoc(),
59
- discriminant: this.deserializeNode(),
60
- cases: this.deserializeNodeList()
61
- };
62
- }, function () {
63
- return {
64
- type: 'ReturnStatement',
65
- loc: this.addEmptyLoc(),
66
- argument: this.deserializeNode()
67
- };
68
- }, function () {
69
- return {
70
- type: 'ThrowStatement',
71
- loc: this.addEmptyLoc(),
72
- argument: this.deserializeNode()
73
- };
74
- }, function () {
75
- return {
76
- type: 'TryStatement',
77
- loc: this.addEmptyLoc(),
78
- block: this.deserializeNode(),
79
- handler: this.deserializeNode(),
80
- finalizer: this.deserializeNode()
81
- };
82
- }, function () {
83
- return {
84
- type: 'WhileStatement',
85
- loc: this.addEmptyLoc(),
86
- body: this.deserializeNode(),
87
- test: this.deserializeNode()
88
- };
89
- }, function () {
90
- return {
91
- type: 'DoWhileStatement',
92
- loc: this.addEmptyLoc(),
93
- body: this.deserializeNode(),
94
- test: this.deserializeNode()
95
- };
96
- }, function () {
97
- return {
98
- type: 'ForStatement',
99
- loc: this.addEmptyLoc(),
100
- init: this.deserializeNode(),
101
- test: this.deserializeNode(),
102
- update: this.deserializeNode(),
103
- body: this.deserializeNode()
104
- };
105
- }, function () {
106
- return {
107
- type: 'ForInStatement',
108
- loc: this.addEmptyLoc(),
109
- left: this.deserializeNode(),
110
- right: this.deserializeNode(),
111
- body: this.deserializeNode()
112
- };
113
- }, function () {
114
- return {
115
- type: 'ForOfStatement',
116
- loc: this.addEmptyLoc(),
117
- left: this.deserializeNode(),
118
- right: this.deserializeNode(),
119
- body: this.deserializeNode(),
120
- await: this.deserializeBoolean()
121
- };
122
- }, function () {
123
- return {
124
- type: 'DebuggerStatement',
125
- loc: this.addEmptyLoc()
126
- };
127
- }, function () {
128
- return {
129
- type: 'MatchStatement',
130
- loc: this.addEmptyLoc(),
131
- argument: this.deserializeNode(),
132
- cases: this.deserializeNodeList()
133
- };
134
- }, function () {
135
- return {
136
- type: 'FunctionDeclaration',
137
- loc: this.addEmptyLoc(),
138
- id: this.deserializeNode(),
139
- params: this.deserializeNodeList(),
140
- body: this.deserializeNode(),
141
- typeParameters: this.deserializeNode(),
142
- returnType: this.deserializeNode(),
143
- generator: this.deserializeBoolean(),
144
- async: this.deserializeBoolean(),
145
- predicate: this.deserializeNode(),
146
- expression: this.deserializeBoolean()
147
- };
148
- }, function () {
149
- return {
150
- type: 'VariableDeclaration',
151
- loc: this.addEmptyLoc(),
152
- kind: this.deserializeString(),
153
- declarations: this.deserializeNodeList()
154
- };
155
- }, function () {
156
- return {
157
- type: 'VariableDeclarator',
158
- loc: this.addEmptyLoc(),
159
- init: this.deserializeNode(),
160
- id: this.deserializeNode()
161
- };
162
- }, function () {
163
- return {
164
- type: 'ClassDeclaration',
165
- loc: this.addEmptyLoc(),
166
- id: this.deserializeNode(),
167
- typeParameters: this.deserializeNode(),
168
- superClass: this.deserializeNode(),
169
- implements: this.deserializeNodeList(),
170
- body: this.deserializeNode(),
171
- superTypeArguments: this.deserializeNode(),
172
- decorators: this.deserializeNodeList()
173
- };
174
- }, function () {
175
- return {
176
- type: 'ComponentDeclaration',
177
- loc: this.addEmptyLoc(),
178
- body: this.deserializeNode(),
179
- id: this.deserializeNode(),
180
- params: this.deserializeNodeList(),
181
- rendersType: this.deserializeNode(),
182
- typeParameters: this.deserializeNode(),
183
- async: this.deserializeBoolean()
184
- };
185
- }, function () {
186
- return {
187
- type: 'HookDeclaration',
188
- loc: this.addEmptyLoc(),
189
- id: this.deserializeNode(),
190
- params: this.deserializeNodeList(),
191
- body: this.deserializeNode(),
192
- returnType: this.deserializeNode(),
193
- typeParameters: this.deserializeNode(),
194
- async: this.deserializeBoolean()
195
- };
196
- }, function () {
197
- return {
198
- type: 'EnumDeclaration',
199
- loc: this.addEmptyLoc(),
200
- id: this.deserializeNode(),
201
- body: this.deserializeNode()
202
- };
203
- }, function () {
204
- return {
205
- type: 'InterfaceDeclaration',
206
- loc: this.addEmptyLoc(),
207
- id: this.deserializeNode(),
208
- typeParameters: this.deserializeNode(),
209
- extends: this.deserializeNodeList(),
210
- body: this.deserializeNode()
211
- };
212
- }, function () {
213
- return {
214
- type: 'TypeAlias',
215
- loc: this.addEmptyLoc(),
216
- id: this.deserializeNode(),
217
- typeParameters: this.deserializeNode(),
218
- right: this.deserializeNode()
219
- };
220
- }, function () {
221
- return {
222
- type: 'RecordDeclaration',
223
- loc: this.addEmptyLoc(),
224
- id: this.deserializeNode(),
225
- typeParameters: this.deserializeNode(),
226
- implements: this.deserializeNodeList(),
227
- body: this.deserializeNode()
228
- };
229
- }, function () {
230
- return {
231
- type: 'ImportDeclaration',
232
- loc: this.addEmptyLoc(),
233
- specifiers: this.deserializeNodeList(),
234
- source: this.deserializeNode(),
235
- importKind: this.deserializeString(),
236
- attributes: this.deserializeNodeList()
237
- };
238
- }, function () {
239
- return {
240
- type: 'ImportDefaultSpecifier',
241
- loc: this.addEmptyLoc(),
242
- local: this.deserializeNode()
243
- };
244
- }, function () {
245
- return {
246
- type: 'ImportNamespaceSpecifier',
247
- loc: this.addEmptyLoc(),
248
- local: this.deserializeNode()
249
- };
250
- }, function () {
251
- return {
252
- type: 'ImportSpecifier',
253
- loc: this.addEmptyLoc(),
254
- imported: this.deserializeNode(),
255
- local: this.deserializeNode(),
256
- importKind: this.deserializeString()
257
- };
258
- }, function () {
259
- return {
260
- type: 'ImportAttribute',
261
- loc: this.addEmptyLoc(),
262
- key: this.deserializeNode(),
263
- value: this.deserializeNode()
264
- };
265
- }, function () {
266
- return {
267
- type: 'ImportEqualsDeclaration',
268
- loc: this.addEmptyLoc(),
269
- id: this.deserializeNode(),
270
- moduleReference: this.deserializeNode(),
271
- importKind: this.deserializeString(),
272
- isExport: this.deserializeBoolean()
273
- };
274
- }, function () {
275
- return {
276
- type: 'ExternalModuleReference',
277
- loc: this.addEmptyLoc(),
278
- expression: this.deserializeNode()
279
- };
280
- }, function () {
281
- return {
282
- type: 'ExportNamedDeclaration',
283
- loc: this.addEmptyLoc(),
284
- declaration: this.deserializeNode(),
285
- specifiers: this.deserializeNodeList(),
286
- source: this.deserializeNode(),
287
- exportKind: this.deserializeString()
288
- };
289
- }, function () {
290
- return {
291
- type: 'ExportDefaultDeclaration',
292
- loc: this.addEmptyLoc(),
293
- declaration: this.deserializeNode()
294
- };
295
- }, function () {
296
- return {
297
- type: 'ExportAllDeclaration',
298
- loc: this.addEmptyLoc(),
299
- source: this.deserializeNode(),
300
- exported: this.deserializeNode(),
301
- exportKind: this.deserializeString()
302
- };
303
- }, function () {
304
- return {
305
- type: 'ExportSpecifier',
306
- loc: this.addEmptyLoc(),
307
- exported: this.deserializeNode(),
308
- local: this.deserializeNode()
309
- };
310
- }, function () {
311
- return {
312
- type: 'ExportNamespaceSpecifier',
313
- loc: this.addEmptyLoc(),
314
- exported: this.deserializeNode()
315
- };
316
- }, function () {
317
- return {
318
- type: 'ExportAssignment',
319
- loc: this.addEmptyLoc(),
320
- expression: this.deserializeNode()
321
- };
322
- }, function () {
323
- return {
324
- type: 'ThisExpression',
325
- loc: this.addEmptyLoc()
326
- };
327
- }, function () {
328
- return {
329
- type: 'Super',
330
- loc: this.addEmptyLoc()
331
- };
332
- }, function () {
333
- return {
334
- type: 'ArrayExpression',
335
- loc: this.addEmptyLoc(),
336
- elements: this.deserializeNodeList(),
337
- trailingComma: this.deserializeBoolean()
338
- };
339
- }, function () {
340
- return {
341
- type: 'ObjectExpression',
342
- loc: this.addEmptyLoc(),
343
- properties: this.deserializeNodeList()
344
- };
345
- }, function () {
346
- return {
347
- type: 'FunctionExpression',
348
- loc: this.addEmptyLoc(),
349
- id: this.deserializeNode(),
350
- params: this.deserializeNodeList(),
351
- body: this.deserializeNode(),
352
- typeParameters: this.deserializeNode(),
353
- returnType: this.deserializeNode(),
354
- generator: this.deserializeBoolean(),
355
- async: this.deserializeBoolean(),
356
- predicate: this.deserializeNode(),
357
- expression: this.deserializeBoolean()
358
- };
359
- }, function () {
360
- return {
361
- type: 'ArrowFunctionExpression',
362
- loc: this.addEmptyLoc(),
363
- params: this.deserializeNodeList(),
364
- body: this.deserializeNode(),
365
- typeParameters: this.deserializeNode(),
366
- returnType: this.deserializeNode(),
367
- async: this.deserializeBoolean(),
368
- id: this.deserializeNode(),
369
- predicate: this.deserializeNode(),
370
- expression: this.deserializeBoolean()
371
- };
372
- }, function () {
373
- return {
374
- type: 'SequenceExpression',
375
- loc: this.addEmptyLoc(),
376
- expressions: this.deserializeNodeList()
377
- };
378
- }, function () {
379
- return {
380
- type: 'UnaryExpression',
381
- loc: this.addEmptyLoc(),
382
- operator: this.deserializeString(),
383
- argument: this.deserializeNode(),
384
- prefix: this.deserializeBoolean()
385
- };
386
- }, function () {
387
- return {
388
- type: 'BinaryExpression',
389
- loc: this.addEmptyLoc(),
390
- left: this.deserializeNode(),
391
- right: this.deserializeNode(),
392
- operator: this.deserializeString()
393
- };
394
- }, function () {
395
- return {
396
- type: 'LogicalExpression',
397
- loc: this.addEmptyLoc(),
398
- left: this.deserializeNode(),
399
- right: this.deserializeNode(),
400
- operator: this.deserializeString()
401
- };
402
- }, function () {
403
- return {
404
- type: 'ConditionalExpression',
405
- loc: this.addEmptyLoc(),
406
- test: this.deserializeNode(),
407
- alternate: this.deserializeNode(),
408
- consequent: this.deserializeNode()
409
- };
410
- }, function () {
411
- return {
412
- type: 'UpdateExpression',
413
- loc: this.addEmptyLoc(),
414
- operator: this.deserializeString(),
415
- argument: this.deserializeNode(),
416
- prefix: this.deserializeBoolean()
417
- };
418
- }, function () {
419
- return {
420
- type: 'AssignmentExpression',
421
- loc: this.addEmptyLoc(),
422
- operator: this.deserializeString(),
423
- left: this.deserializeNode(),
424
- right: this.deserializeNode()
425
- };
426
- }, function () {
427
- return {
428
- type: 'MemberExpression',
429
- loc: this.addEmptyLoc(),
430
- object: this.deserializeNode(),
431
- property: this.deserializeNode(),
432
- computed: this.deserializeBoolean(),
433
- optional: this.deserializeBoolean()
434
- };
435
- }, function () {
436
- return {
437
- type: 'OptionalMemberExpression',
438
- loc: this.addEmptyLoc(),
439
- object: this.deserializeNode(),
440
- property: this.deserializeNode(),
441
- computed: this.deserializeBoolean(),
442
- optional: this.deserializeBoolean()
443
- };
444
- }, function () {
445
- return {
446
- type: 'CallExpression',
447
- loc: this.addEmptyLoc(),
448
- callee: this.deserializeNode(),
449
- typeArguments: this.deserializeNode(),
450
- arguments: this.deserializeNodeList(),
451
- optional: this.deserializeBoolean()
452
- };
453
- }, function () {
454
- return {
455
- type: 'OptionalCallExpression',
456
- loc: this.addEmptyLoc(),
457
- callee: this.deserializeNode(),
458
- typeArguments: this.deserializeNode(),
459
- arguments: this.deserializeNodeList(),
460
- optional: this.deserializeBoolean()
461
- };
462
- }, function () {
463
- return {
464
- type: 'NewExpression',
465
- loc: this.addEmptyLoc(),
466
- callee: this.deserializeNode(),
467
- typeArguments: this.deserializeNode(),
468
- arguments: this.deserializeNodeList()
469
- };
470
- }, function () {
471
- return {
472
- type: 'YieldExpression',
473
- loc: this.addEmptyLoc(),
474
- argument: this.deserializeNode(),
475
- delegate: this.deserializeBoolean()
476
- };
477
- }, function () {
478
- return {
479
- type: 'AwaitExpression',
480
- loc: this.addEmptyLoc(),
481
- argument: this.deserializeNode()
482
- };
483
- }, function () {
484
- return {
485
- type: 'ImportExpression',
486
- loc: this.addEmptyLoc(),
487
- source: this.deserializeNode(),
488
- options: this.deserializeNode()
489
- };
490
- }, function () {
491
- return {
492
- type: 'MetaProperty',
493
- loc: this.addEmptyLoc(),
494
- meta: this.deserializeNode(),
495
- property: this.deserializeNode()
496
- };
497
- }, function () {
498
- return {
499
- type: 'TaggedTemplateExpression',
500
- loc: this.addEmptyLoc(),
501
- tag: this.deserializeNode(),
502
- quasi: this.deserializeNode()
503
- };
504
- }, function () {
505
- return {
506
- type: 'TemplateLiteral',
507
- loc: this.addEmptyLoc(),
508
- quasis: this.deserializeNodeList(),
509
- expressions: this.deserializeNodeList()
510
- };
511
- }, function () {
512
- return {
513
- type: 'TemplateElement',
514
- loc: this.addEmptyLoc(),
515
- tail: this.deserializeBoolean(),
516
- value: {
517
- cooked: this.deserializeString(),
518
- raw: this.deserializeString()
519
- }
520
- };
521
- }, function () {
522
- return {
523
- type: 'TypeCastExpression',
524
- loc: this.addEmptyLoc(),
525
- expression: this.deserializeNode(),
526
- typeAnnotation: this.deserializeNode()
527
- };
528
- }, function () {
529
- return {
530
- type: 'AsExpression',
531
- loc: this.addEmptyLoc(),
532
- expression: this.deserializeNode(),
533
- typeAnnotation: this.deserializeNode()
534
- };
535
- }, function () {
536
- return {
537
- type: 'SatisfiesExpression',
538
- loc: this.addEmptyLoc(),
539
- expression: this.deserializeNode(),
540
- typeAnnotation: this.deserializeNode()
541
- };
542
- }, function () {
543
- return {
544
- type: 'AsConstExpression',
545
- loc: this.addEmptyLoc(),
546
- expression: this.deserializeNode()
547
- };
548
- }, function () {
549
- return {
550
- type: 'NonNullExpression',
551
- loc: this.addEmptyLoc(),
552
- argument: this.deserializeNode(),
553
- chain: this.deserializeBoolean()
554
- };
555
- }, function () {
556
- return {
557
- type: 'MatchExpression',
558
- loc: this.addEmptyLoc(),
559
- argument: this.deserializeNode(),
560
- cases: this.deserializeNodeList()
561
- };
562
- }, function () {
563
- return {
564
- type: 'RecordExpression',
565
- loc: this.addEmptyLoc(),
566
- recordConstructor: this.deserializeNode(),
567
- typeArguments: this.deserializeNode(),
568
- properties: this.deserializeNode()
569
- };
570
- }, function () {
571
- return {
572
- type: 'RecordExpressionProperties',
573
- loc: this.addEmptyLoc(),
574
- properties: this.deserializeNodeList()
575
- };
576
- }, function () {
577
- const loc = this.addEmptyLoc();
578
- const valueKind = this.next();
579
- let value = null;
580
- if (valueKind === 1) value = this.deserializeBoolean();else if (valueKind === 2) value = this.deserializeNumber();else if (valueKind === 3) value = this.deserializeString();
581
- const literalType = this.deserializeString();
582
- const raw = this.deserializeString();
583
- const bigint = this.deserializeString();
584
- const regexPattern = this.deserializeString();
585
- const regexFlags = this.deserializeString();
586
- const node = {
587
- type: 'Literal',
588
- loc,
589
- value,
590
- raw,
591
- literalType
592
- };
593
-
594
- if (bigint != null) {
595
- node.bigint = bigint;
596
-
597
- try {
598
- node.value = typeof BigInt === 'function' ? BigInt(bigint) : null;
599
- } catch (e) {
600
- node.value = null;
601
- }
602
- }
603
-
604
- if (regexPattern != null) {
605
- const flags = regexFlags != null ? regexFlags : '';
606
- node.regex = {
607
- pattern: regexPattern,
608
- flags
609
- };
610
-
611
- try {
612
- node.value = new RegExp(regexPattern, flags);
613
- } catch (e) {
614
- node.value = null;
615
- }
616
- }
617
-
618
- return node;
619
- }, function () {
620
- return {
621
- type: 'Identifier',
622
- loc: this.addEmptyLoc(),
623
- name: this.deserializeString(),
624
- typeAnnotation: this.deserializeNode(),
625
- optional: this.deserializeBoolean()
626
- };
627
- }, function () {
628
- return {
629
- type: 'PrivateIdentifier',
630
- loc: this.addEmptyLoc(),
631
- name: this.deserializeString(),
632
- typeAnnotation: this.deserializeNode(),
633
- optional: this.deserializeBoolean()
634
- };
635
- }, function () {
636
- return {
637
- type: 'ObjectPattern',
638
- loc: this.addEmptyLoc(),
639
- properties: this.deserializeNodeList(),
640
- typeAnnotation: this.deserializeNode()
641
- };
642
- }, function () {
643
- return {
644
- type: 'ArrayPattern',
645
- loc: this.addEmptyLoc(),
646
- elements: this.deserializeNodeList(),
647
- typeAnnotation: this.deserializeNode()
648
- };
649
- }, function () {
650
- return {
651
- type: 'RestElement',
652
- loc: this.addEmptyLoc(),
653
- argument: this.deserializeNode()
654
- };
655
- }, function () {
656
- return {
657
- type: 'AssignmentPattern',
658
- loc: this.addEmptyLoc(),
659
- left: this.deserializeNode(),
660
- right: this.deserializeNode()
661
- };
662
- }, function () {
663
- return {
664
- type: 'Property',
665
- loc: this.addEmptyLoc(),
666
- key: this.deserializeNode(),
667
- value: this.deserializeNode(),
668
- kind: this.deserializeString(),
669
- method: this.deserializeBoolean(),
670
- shorthand: this.deserializeBoolean(),
671
- computed: this.deserializeBoolean()
672
- };
673
- }, function () {
674
- return {
675
- type: 'SpreadElement',
676
- loc: this.addEmptyLoc(),
677
- argument: this.deserializeNode()
678
- };
679
- }, function () {
680
- return {
681
- type: 'ClassExpression',
682
- loc: this.addEmptyLoc(),
683
- id: this.deserializeNode(),
684
- typeParameters: this.deserializeNode(),
685
- superClass: this.deserializeNode(),
686
- implements: this.deserializeNodeList(),
687
- body: this.deserializeNode(),
688
- superTypeArguments: this.deserializeNode(),
689
- decorators: this.deserializeNodeList()
690
- };
691
- }, function () {
692
- return {
693
- type: 'ClassBody',
694
- loc: this.addEmptyLoc(),
695
- body: this.deserializeNodeList()
696
- };
697
- }, function () {
698
- return {
699
- type: 'ClassImplements',
700
- loc: this.addEmptyLoc(),
701
- id: this.deserializeNode(),
702
- typeParameters: this.deserializeNode()
703
- };
704
- }, function () {
705
- return {
706
- type: 'MethodDefinition',
707
- loc: this.addEmptyLoc(),
708
- key: this.deserializeNode(),
709
- value: this.deserializeNode(),
710
- kind: this.deserializeString(),
711
- static: this.deserializeBoolean(),
712
- computed: this.deserializeBoolean(),
713
- decorators: this.deserializeNodeList(),
714
- override: this.deserializeBoolean(),
715
- tsAccessibility: this.deserializeString()
716
- };
717
- }, function () {
718
- return {
719
- type: 'PropertyDefinition',
720
- loc: this.addEmptyLoc(),
721
- key: this.deserializeNode(),
722
- value: this.deserializeNode(),
723
- typeAnnotation: this.deserializeNode(),
724
- computed: this.deserializeBoolean(),
725
- static: this.deserializeBoolean(),
726
- variance: this.deserializeNode(),
727
- tsAccessibility: this.deserializeString(),
728
- declare: this.deserializeBoolean(),
729
- optional: this.deserializeBoolean(),
730
- override: this.deserializeBoolean(),
731
- decorators: this.deserializeNodeList()
732
- };
733
- }, function () {
734
- return {
735
- type: 'StaticBlock',
736
- loc: this.addEmptyLoc(),
737
- body: this.deserializeNodeList()
738
- };
739
- }, function () {
740
- return {
741
- type: 'Decorator',
742
- loc: this.addEmptyLoc(),
743
- expression: this.deserializeNode()
744
- };
745
- }, function () {
746
- return {
747
- type: 'ParameterProperty',
748
- loc: this.addEmptyLoc(),
749
- key: this.deserializeNode(),
750
- value: this.deserializeNode(),
751
- typeAnnotation: this.deserializeNode(),
752
- computed: this.deserializeBoolean(),
753
- static: this.deserializeBoolean(),
754
- variance: this.deserializeNode(),
755
- tsAccessibility: this.deserializeString(),
756
- declare: this.deserializeBoolean(),
757
- optional: this.deserializeBoolean(),
758
- decorators: this.deserializeNodeList()
759
- };
760
- }, function () {
761
- return {
762
- type: 'DeclareMethodDefinition',
763
- loc: this.addEmptyLoc(),
764
- key: this.deserializeNode(),
765
- value: this.deserializeNode(),
766
- static: this.deserializeBoolean(),
767
- optional: this.deserializeBoolean(),
768
- computed: this.deserializeBoolean(),
769
- kind: this.deserializeString(),
770
- override: this.deserializeBoolean()
771
- };
772
- }, function () {
773
- return {
774
- type: 'AbstractMethodDefinition',
775
- loc: this.addEmptyLoc(),
776
- key: this.deserializeNode(),
777
- value: this.deserializeNode(),
778
- computed: this.deserializeBoolean(),
779
- override: this.deserializeBoolean(),
780
- tsAccessibility: this.deserializeString()
781
- };
782
- }, function () {
783
- return {
784
- type: 'AbstractPropertyDefinition',
785
- loc: this.addEmptyLoc(),
786
- key: this.deserializeNode(),
787
- value: this.deserializeNode(),
788
- computed: this.deserializeBoolean(),
789
- variance: this.deserializeNode(),
790
- override: this.deserializeBoolean(),
791
- tsAccessibility: this.deserializeString()
792
- };
793
- }, function () {
794
- return {
795
- type: 'SwitchCase',
796
- loc: this.addEmptyLoc(),
797
- test: this.deserializeNode(),
798
- consequent: this.deserializeNodeList()
799
- };
800
- }, function () {
801
- return {
802
- type: 'CatchClause',
803
- loc: this.addEmptyLoc(),
804
- param: this.deserializeNode(),
805
- body: this.deserializeNode()
806
- };
807
- }, function () {
808
- return {
809
- type: 'ComponentParameter',
810
- loc: this.addEmptyLoc(),
811
- name: this.deserializeNode(),
812
- local: this.deserializeNode(),
813
- shorthand: this.deserializeBoolean()
814
- };
815
- }, function () {
816
- return {
817
- type: 'DeclareVariable',
818
- loc: this.addEmptyLoc(),
819
- id: this.deserializeNode(),
820
- kind: this.deserializeString()
821
- };
822
- }, function () {
823
- return {
824
- type: 'DeclareFunction',
825
- loc: this.addEmptyLoc(),
826
- id: this.deserializeNode(),
827
- predicate: this.deserializeNode()
828
- };
829
- }, function () {
830
- return {
831
- type: 'DeclareClass',
832
- loc: this.addEmptyLoc(),
833
- id: this.deserializeNode(),
834
- typeParameters: this.deserializeNode(),
835
- extends: this.deserializeNodeList(),
836
- implements: this.deserializeNodeList(),
837
- mixins: this.deserializeNodeList(),
838
- body: this.deserializeNode()
839
- };
840
- }, function () {
841
- return {
842
- type: 'DeclareComponent',
843
- loc: this.addEmptyLoc(),
844
- id: this.deserializeNode(),
845
- params: this.deserializeNodeList(),
846
- rest: this.deserializeNode(),
847
- rendersType: this.deserializeNode(),
848
- typeParameters: this.deserializeNode()
849
- };
850
- }, function () {
851
- return {
852
- type: 'DeclareHook',
853
- loc: this.addEmptyLoc(),
854
- id: this.deserializeNode()
855
- };
856
- }, function () {
857
- return {
858
- type: 'DeclareModule',
859
- loc: this.addEmptyLoc(),
860
- id: this.deserializeNode(),
861
- body: this.deserializeNode()
862
- };
863
- }, function () {
864
- return {
865
- type: 'DeclareModuleExports',
866
- loc: this.addEmptyLoc(),
867
- typeAnnotation: this.deserializeNode()
868
- };
869
- }, function () {
870
- return {
871
- type: 'DeclareExportDeclaration',
872
- loc: this.addEmptyLoc(),
873
- default: this.deserializeBoolean(),
874
- declaration: this.deserializeNode(),
875
- specifiers: this.deserializeNodeList(),
876
- source: this.deserializeNode()
877
- };
878
- }, function () {
879
- return {
880
- type: 'DeclareExportAllDeclaration',
881
- loc: this.addEmptyLoc(),
882
- source: this.deserializeNode()
883
- };
884
- }, function () {
885
- return {
886
- type: 'DeclareNamespace',
887
- loc: this.addEmptyLoc(),
888
- id: this.deserializeNode(),
889
- body: this.deserializeNode()
890
- };
891
- }, function () {
892
- return {
893
- type: 'DeclareInterface',
894
- loc: this.addEmptyLoc(),
895
- id: this.deserializeNode(),
896
- typeParameters: this.deserializeNode(),
897
- body: this.deserializeNode(),
898
- extends: this.deserializeNodeList()
899
- };
900
- }, function () {
901
- return {
902
- type: 'DeclareTypeAlias',
903
- loc: this.addEmptyLoc(),
904
- id: this.deserializeNode(),
905
- typeParameters: this.deserializeNode(),
906
- right: this.deserializeNode()
907
- };
908
- }, function () {
909
- return {
910
- type: 'DeclareEnum',
911
- loc: this.addEmptyLoc(),
912
- id: this.deserializeNode(),
913
- body: this.deserializeNode()
914
- };
915
- }, function () {
916
- return {
917
- type: 'TypeAnnotation',
918
- loc: this.addEmptyLoc(),
919
- typeAnnotation: this.deserializeNode()
920
- };
921
- }, function () {
922
- return {
923
- type: 'Variance',
924
- loc: this.addEmptyLoc(),
925
- kind: this.deserializeString()
926
- };
927
- }, function () {
928
- return {
929
- type: 'AnyTypeAnnotation',
930
- loc: this.addEmptyLoc()
931
- };
932
- }, function () {
933
- return {
934
- type: 'MixedTypeAnnotation',
935
- loc: this.addEmptyLoc()
936
- };
937
- }, function () {
938
- return {
939
- type: 'EmptyTypeAnnotation',
940
- loc: this.addEmptyLoc()
941
- };
942
- }, function () {
943
- return {
944
- type: 'VoidTypeAnnotation',
945
- loc: this.addEmptyLoc()
946
- };
947
- }, function () {
948
- return {
949
- type: 'NullLiteralTypeAnnotation',
950
- loc: this.addEmptyLoc()
951
- };
952
- }, function () {
953
- return {
954
- type: 'SymbolTypeAnnotation',
955
- loc: this.addEmptyLoc()
956
- };
957
- }, function () {
958
- return {
959
- type: 'NumberTypeAnnotation',
960
- loc: this.addEmptyLoc()
961
- };
962
- }, function () {
963
- return {
964
- type: 'BigIntTypeAnnotation',
965
- loc: this.addEmptyLoc()
966
- };
967
- }, function () {
968
- return {
969
- type: 'StringTypeAnnotation',
970
- loc: this.addEmptyLoc()
971
- };
972
- }, function () {
973
- return {
974
- type: 'BooleanTypeAnnotation',
975
- loc: this.addEmptyLoc()
976
- };
977
- }, function () {
978
- return {
979
- type: 'NullableTypeAnnotation',
980
- loc: this.addEmptyLoc(),
981
- typeAnnotation: this.deserializeNode()
982
- };
983
- }, function () {
984
- return {
985
- type: 'ArrayTypeAnnotation',
986
- loc: this.addEmptyLoc(),
987
- elementType: this.deserializeNode()
988
- };
989
- }, function () {
990
- return {
991
- type: 'IndexedAccessType',
992
- loc: this.addEmptyLoc(),
993
- objectType: this.deserializeNode(),
994
- indexType: this.deserializeNode()
995
- };
996
- }, function () {
997
- return {
998
- type: 'OptionalIndexedAccessType',
999
- loc: this.addEmptyLoc(),
1000
- objectType: this.deserializeNode(),
1001
- indexType: this.deserializeNode(),
1002
- optional: this.deserializeBoolean()
1003
- };
1004
- }, function () {
1005
- return {
1006
- type: 'UnionTypeAnnotation',
1007
- loc: this.addEmptyLoc(),
1008
- types: this.deserializeNodeList()
1009
- };
1010
- }, function () {
1011
- return {
1012
- type: 'IntersectionTypeAnnotation',
1013
- loc: this.addEmptyLoc(),
1014
- types: this.deserializeNodeList()
1015
- };
1016
- }, function () {
1017
- return {
1018
- type: 'KeyofTypeAnnotation',
1019
- loc: this.addEmptyLoc(),
1020
- argument: this.deserializeNode()
1021
- };
1022
- }, function () {
1023
- return {
1024
- type: 'TypeOperator',
1025
- loc: this.addEmptyLoc(),
1026
- operator: this.deserializeString(),
1027
- typeAnnotation: this.deserializeNode()
1028
- };
1029
- }, function () {
1030
- return {
1031
- type: 'StringLiteralTypeAnnotation',
1032
- loc: this.addEmptyLoc(),
1033
- value: this.deserializeString(),
1034
- raw: this.deserializeString()
1035
- };
1036
- }, function () {
1037
- return {
1038
- type: 'NumberLiteralTypeAnnotation',
1039
- loc: this.addEmptyLoc(),
1040
- value: this.deserializeNumber(),
1041
- raw: this.deserializeString()
1042
- };
1043
- }, function () {
1044
- const loc = this.addEmptyLoc();
1045
- this.deserializeNode();
1046
- const raw = this.deserializeString();
1047
- const bigint = this.deserializeString();
1048
- let value = null;
1049
-
1050
- if (bigint != null && typeof BigInt === 'function') {
1051
- try {
1052
- value = BigInt(bigint);
1053
- } catch (e) {
1054
- value = null;
1055
- }
1056
- }
1057
-
1058
- return {
1059
- type: 'BigIntLiteralTypeAnnotation',
1060
- loc,
1061
- value,
1062
- raw,
1063
- bigint
1064
- };
1065
- }, function () {
1066
- return {
1067
- type: 'BooleanLiteralTypeAnnotation',
1068
- loc: this.addEmptyLoc(),
1069
- value: this.deserializeBoolean(),
1070
- raw: this.deserializeString()
1071
- };
1072
- }, function () {
1073
- return {
1074
- type: 'ExistsTypeAnnotation',
1075
- loc: this.addEmptyLoc()
1076
- };
1077
- }, function () {
1078
- return {
1079
- type: 'UnknownTypeAnnotation',
1080
- loc: this.addEmptyLoc()
1081
- };
1082
- }, function () {
1083
- return {
1084
- type: 'NeverTypeAnnotation',
1085
- loc: this.addEmptyLoc()
1086
- };
1087
- }, function () {
1088
- return {
1089
- type: 'UndefinedTypeAnnotation',
1090
- loc: this.addEmptyLoc()
1091
- };
1092
- }, function () {
1093
- return {
1094
- type: 'GenericTypeAnnotation',
1095
- loc: this.addEmptyLoc(),
1096
- id: this.deserializeNode(),
1097
- typeParameters: this.deserializeNode()
1098
- };
1099
- }, function () {
1100
- return {
1101
- type: 'QualifiedTypeIdentifier',
1102
- loc: this.addEmptyLoc(),
1103
- qualification: this.deserializeNode(),
1104
- id: this.deserializeNode()
1105
- };
1106
- }, function () {
1107
- return {
1108
- type: 'QualifiedTypeofIdentifier',
1109
- loc: this.addEmptyLoc(),
1110
- qualification: this.deserializeNode(),
1111
- id: this.deserializeNode()
1112
- };
1113
- }, function () {
1114
- return {
1115
- type: 'TypeofTypeAnnotation',
1116
- loc: this.addEmptyLoc(),
1117
- argument: this.deserializeNode(),
1118
- typeArguments: this.deserializeNode()
1119
- };
1120
- }, function () {
1121
- return {
1122
- type: 'ImportType',
1123
- loc: this.addEmptyLoc(),
1124
- argument: this.deserializeNode()
1125
- };
1126
- }, function () {
1127
- return {
1128
- type: 'TupleTypeAnnotation',
1129
- loc: this.addEmptyLoc(),
1130
- elementTypes: this.deserializeNodeList(),
1131
- inexact: this.deserializeBoolean()
1132
- };
1133
- }, function () {
1134
- return {
1135
- type: 'TupleTypeLabeledElement',
1136
- loc: this.addEmptyLoc(),
1137
- label: this.deserializeNode(),
1138
- elementType: this.deserializeNode(),
1139
- variance: this.deserializeNode(),
1140
- optional: this.deserializeBoolean()
1141
- };
1142
- }, function () {
1143
- return {
1144
- type: 'TupleTypeSpreadElement',
1145
- loc: this.addEmptyLoc(),
1146
- label: this.deserializeNode(),
1147
- typeAnnotation: this.deserializeNode()
1148
- };
1149
- }, function () {
1150
- return {
1151
- type: 'ObjectTypeAnnotation',
1152
- loc: this.addEmptyLoc(),
1153
- properties: this.deserializeNodeList(),
1154
- indexers: this.deserializeNodeList(),
1155
- callProperties: this.deserializeNodeList(),
1156
- internalSlots: this.deserializeNodeList(),
1157
- inexact: this.deserializeBoolean(),
1158
- exact: this.deserializeBoolean()
1159
- };
1160
- }, function () {
1161
- return {
1162
- type: 'ObjectTypeProperty',
1163
- loc: this.addEmptyLoc(),
1164
- key: this.deserializeNode(),
1165
- value: this.deserializeNode(),
1166
- method: this.deserializeBoolean(),
1167
- optional: this.deserializeBoolean(),
1168
- static: this.deserializeBoolean(),
1169
- proto: this.deserializeBoolean(),
1170
- variance: this.deserializeNode(),
1171
- kind: this.deserializeString()
1172
- };
1173
- }, function () {
1174
- return {
1175
- type: 'ObjectTypeSpreadProperty',
1176
- loc: this.addEmptyLoc(),
1177
- argument: this.deserializeNode()
1178
- };
1179
- }, function () {
1180
- return {
1181
- type: 'ObjectTypeIndexer',
1182
- loc: this.addEmptyLoc(),
1183
- id: this.deserializeNode(),
1184
- key: this.deserializeNode(),
1185
- value: this.deserializeNode(),
1186
- static: this.deserializeBoolean(),
1187
- variance: this.deserializeNode()
1188
- };
1189
- }, function () {
1190
- return {
1191
- type: 'ObjectTypeCallProperty',
1192
- loc: this.addEmptyLoc(),
1193
- value: this.deserializeNode(),
1194
- static: this.deserializeBoolean()
1195
- };
1196
- }, function () {
1197
- return {
1198
- type: 'ObjectTypeMappedTypeProperty',
1199
- loc: this.addEmptyLoc(),
1200
- keyTparam: this.deserializeNode(),
1201
- propType: this.deserializeNode(),
1202
- sourceType: this.deserializeNode(),
1203
- variance: this.deserializeNode(),
1204
- optional: this.deserializeString()
1205
- };
1206
- }, function () {
1207
- return {
1208
- type: 'ObjectTypeInternalSlot',
1209
- loc: this.addEmptyLoc(),
1210
- id: this.deserializeNode(),
1211
- optional: this.deserializeBoolean(),
1212
- static: this.deserializeBoolean(),
1213
- method: this.deserializeBoolean(),
1214
- value: this.deserializeNode()
1215
- };
1216
- }, function () {
1217
- return {
1218
- type: 'FunctionTypeParam',
1219
- loc: this.addEmptyLoc(),
1220
- name: this.deserializeNode(),
1221
- typeAnnotation: this.deserializeNode(),
1222
- optional: this.deserializeBoolean()
1223
- };
1224
- }, function () {
1225
- return {
1226
- type: 'TypePredicate',
1227
- loc: this.addEmptyLoc(),
1228
- parameterName: this.deserializeNode(),
1229
- typeAnnotation: this.deserializeNode(),
1230
- kind: this.deserializeString()
1231
- };
1232
- }, function () {
1233
- return {
1234
- type: 'ConditionalTypeAnnotation',
1235
- loc: this.addEmptyLoc(),
1236
- checkType: this.deserializeNode(),
1237
- extendsType: this.deserializeNode(),
1238
- trueType: this.deserializeNode(),
1239
- falseType: this.deserializeNode()
1240
- };
1241
- }, function () {
1242
- return {
1243
- type: 'InferTypeAnnotation',
1244
- loc: this.addEmptyLoc(),
1245
- typeParameter: this.deserializeNode()
1246
- };
1247
- }, function () {
1248
- return {
1249
- type: 'InterfaceExtends',
1250
- loc: this.addEmptyLoc(),
1251
- id: this.deserializeNode(),
1252
- typeParameters: this.deserializeNode()
1253
- };
1254
- }, function () {
1255
- return {
1256
- type: 'InterfaceTypeAnnotation',
1257
- loc: this.addEmptyLoc(),
1258
- extends: this.deserializeNodeList(),
1259
- body: this.deserializeNode()
1260
- };
1261
- }, function () {
1262
- return {
1263
- type: 'TypeParameterDeclaration',
1264
- loc: this.addEmptyLoc(),
1265
- params: this.deserializeNodeList()
1266
- };
1267
- }, function () {
1268
- return {
1269
- type: 'TypeParameter',
1270
- loc: this.addEmptyLoc(),
1271
- name: this.deserializeString(),
1272
- const: this.deserializeBoolean(),
1273
- bound: this.deserializeNode(),
1274
- variance: this.deserializeNode(),
1275
- default: this.deserializeNode(),
1276
- usesExtendsBound: this.deserializeBoolean()
1277
- };
1278
- }, function () {
1279
- return {
1280
- type: 'TypeParameterInstantiation',
1281
- loc: this.addEmptyLoc(),
1282
- params: this.deserializeNodeList()
1283
- };
1284
- }, function () {
1285
- return {
1286
- type: 'ComponentTypeAnnotation',
1287
- loc: this.addEmptyLoc(),
1288
- params: this.deserializeNodeList(),
1289
- rest: this.deserializeNode(),
1290
- rendersType: this.deserializeNode(),
1291
- typeParameters: this.deserializeNode()
1292
- };
1293
- }, function () {
1294
- return {
1295
- type: 'ComponentTypeParameter',
1296
- loc: this.addEmptyLoc(),
1297
- name: this.deserializeNode(),
1298
- typeAnnotation: this.deserializeNode(),
1299
- optional: this.deserializeBoolean()
1300
- };
1301
- }, function () {
1302
- return {
1303
- type: 'DeclaredPredicate',
1304
- loc: this.addEmptyLoc(),
1305
- value: this.deserializeNode()
1306
- };
1307
- }, function () {
1308
- return {
1309
- type: 'InferredPredicate',
1310
- loc: this.addEmptyLoc()
1311
- };
1312
- }, function () {
1313
- return {
1314
- type: 'JSXElement',
1315
- loc: this.addEmptyLoc(),
1316
- openingElement: this.deserializeNode(),
1317
- children: this.deserializeNodeList(),
1318
- closingElement: this.deserializeNode()
1319
- };
1320
- }, function () {
1321
- return {
1322
- type: 'JSXFragment',
1323
- loc: this.addEmptyLoc(),
1324
- openingFragment: this.deserializeNode(),
1325
- children: this.deserializeNodeList(),
1326
- closingFragment: this.deserializeNode()
1327
- };
1328
- }, function () {
1329
- return {
1330
- type: 'JSXOpeningElement',
1331
- loc: this.addEmptyLoc(),
1332
- name: this.deserializeNode(),
1333
- attributes: this.deserializeNodeList(),
1334
- selfClosing: this.deserializeBoolean(),
1335
- typeArguments: this.deserializeNode()
1336
- };
1337
- }, function () {
1338
- return {
1339
- type: 'JSXOpeningFragment',
1340
- loc: this.addEmptyLoc()
1341
- };
1342
- }, function () {
1343
- return {
1344
- type: 'JSXClosingElement',
1345
- loc: this.addEmptyLoc(),
1346
- name: this.deserializeNode()
1347
- };
1348
- }, function () {
1349
- return {
1350
- type: 'JSXClosingFragment',
1351
- loc: this.addEmptyLoc()
1352
- };
1353
- }, function () {
1354
- return {
1355
- type: 'JSXAttribute',
1356
- loc: this.addEmptyLoc(),
1357
- name: this.deserializeNode(),
1358
- value: this.deserializeNode()
1359
- };
1360
- }, function () {
1361
- return {
1362
- type: 'JSXSpreadAttribute',
1363
- loc: this.addEmptyLoc(),
1364
- argument: this.deserializeNode()
1365
- };
1366
- }, function () {
1367
- return {
1368
- type: 'JSXEmptyExpression',
1369
- loc: this.addEmptyLoc()
1370
- };
1371
- }, function () {
1372
- return {
1373
- type: 'JSXExpressionContainer',
1374
- loc: this.addEmptyLoc(),
1375
- expression: this.deserializeNode()
1376
- };
1377
- }, function () {
1378
- return {
1379
- type: 'JSXSpreadChild',
1380
- loc: this.addEmptyLoc(),
1381
- expression: this.deserializeNode()
1382
- };
1383
- }, function () {
1384
- return {
1385
- type: 'JSXText',
1386
- loc: this.addEmptyLoc(),
1387
- value: this.deserializeString(),
1388
- raw: this.deserializeString()
1389
- };
1390
- }, function () {
1391
- return {
1392
- type: 'JSXMemberExpression',
1393
- loc: this.addEmptyLoc(),
1394
- object: this.deserializeNode(),
1395
- property: this.deserializeNode()
1396
- };
1397
- }, function () {
1398
- return {
1399
- type: 'JSXNamespacedName',
1400
- loc: this.addEmptyLoc(),
1401
- namespace: this.deserializeNode(),
1402
- name: this.deserializeNode()
1403
- };
1404
- }, function () {
1405
- return {
1406
- type: 'JSXIdentifier',
1407
- loc: this.addEmptyLoc(),
1408
- name: this.deserializeString()
1409
- };
1410
- }, function () {
1411
- return {
1412
- type: 'EnumBooleanBody',
1413
- loc: this.addEmptyLoc(),
1414
- members: this.deserializeNodeList(),
1415
- explicitType: this.deserializeBoolean(),
1416
- hasUnknownMembers: this.deserializeBoolean()
1417
- };
1418
- }, function () {
1419
- return {
1420
- type: 'EnumBooleanMember',
1421
- loc: this.addEmptyLoc(),
1422
- id: this.deserializeNode(),
1423
- init: this.deserializeNode()
1424
- };
1425
- }, function () {
1426
- return {
1427
- type: 'EnumNumberBody',
1428
- loc: this.addEmptyLoc(),
1429
- members: this.deserializeNodeList(),
1430
- explicitType: this.deserializeBoolean(),
1431
- hasUnknownMembers: this.deserializeBoolean()
1432
- };
1433
- }, function () {
1434
- return {
1435
- type: 'EnumNumberMember',
1436
- loc: this.addEmptyLoc(),
1437
- id: this.deserializeNode(),
1438
- init: this.deserializeNode()
1439
- };
1440
- }, function () {
1441
- return {
1442
- type: 'EnumStringBody',
1443
- loc: this.addEmptyLoc(),
1444
- members: this.deserializeNodeList(),
1445
- explicitType: this.deserializeBoolean(),
1446
- hasUnknownMembers: this.deserializeBoolean()
1447
- };
1448
- }, function () {
1449
- return {
1450
- type: 'EnumStringMember',
1451
- loc: this.addEmptyLoc(),
1452
- id: this.deserializeNode(),
1453
- init: this.deserializeNode()
1454
- };
1455
- }, function () {
1456
- return {
1457
- type: 'EnumSymbolBody',
1458
- loc: this.addEmptyLoc(),
1459
- members: this.deserializeNodeList(),
1460
- hasUnknownMembers: this.deserializeBoolean()
1461
- };
1462
- }, function () {
1463
- return {
1464
- type: 'EnumDefaultedMember',
1465
- loc: this.addEmptyLoc(),
1466
- id: this.deserializeNode()
1467
- };
1468
- }, function () {
1469
- return {
1470
- type: 'EnumBigIntBody',
1471
- loc: this.addEmptyLoc(),
1472
- members: this.deserializeNodeList(),
1473
- explicitType: this.deserializeBoolean(),
1474
- hasUnknownMembers: this.deserializeBoolean()
1475
- };
1476
- }, function () {
1477
- return {
1478
- type: 'EnumBigIntMember',
1479
- loc: this.addEmptyLoc(),
1480
- id: this.deserializeNode(),
1481
- init: this.deserializeNode()
1482
- };
1483
- }, function () {
1484
- return {
1485
- type: 'RecordDeclarationBody',
1486
- loc: this.addEmptyLoc(),
1487
- elements: this.deserializeNodeList()
1488
- };
1489
- }, function () {
1490
- return {
1491
- type: 'RecordDeclarationProperty',
1492
- loc: this.addEmptyLoc(),
1493
- key: this.deserializeNode(),
1494
- typeAnnotation: this.deserializeNode(),
1495
- defaultValue: this.deserializeNode()
1496
- };
1497
- }, function () {
1498
- return {
1499
- type: 'RecordDeclarationStaticProperty',
1500
- loc: this.addEmptyLoc(),
1501
- key: this.deserializeNode(),
1502
- typeAnnotation: this.deserializeNode(),
1503
- value: this.deserializeNode()
1504
- };
1505
- }, function () {
1506
- return {
1507
- type: 'RecordDeclarationImplements',
1508
- loc: this.addEmptyLoc(),
1509
- id: this.deserializeNode(),
1510
- typeArguments: this.deserializeNode()
1511
- };
1512
- }, function () {
1513
- return {
1514
- type: 'MatchExpressionCase',
1515
- loc: this.addEmptyLoc(),
1516
- pattern: this.deserializeNode(),
1517
- body: this.deserializeNode(),
1518
- guard: this.deserializeNode()
1519
- };
1520
- }, function () {
1521
- return {
1522
- type: 'MatchStatementCase',
1523
- loc: this.addEmptyLoc(),
1524
- pattern: this.deserializeNode(),
1525
- body: this.deserializeNode(),
1526
- guard: this.deserializeNode()
1527
- };
1528
- }, function () {
1529
- return {
1530
- type: 'MatchWildcardPattern',
1531
- loc: this.addEmptyLoc()
1532
- };
1533
- }, function () {
1534
- return {
1535
- type: 'MatchLiteralPattern',
1536
- loc: this.addEmptyLoc(),
1537
- literal: this.deserializeNode()
1538
- };
1539
- }, function () {
1540
- return {
1541
- type: 'MatchUnaryPattern',
1542
- loc: this.addEmptyLoc(),
1543
- operator: this.deserializeString(),
1544
- argument: this.deserializeNode()
1545
- };
1546
- }, function () {
1547
- return {
1548
- type: 'MatchObjectPattern',
1549
- loc: this.addEmptyLoc(),
1550
- properties: this.deserializeNodeList(),
1551
- rest: this.deserializeNode()
1552
- };
1553
- }, function () {
1554
- return {
1555
- type: 'MatchInstancePattern',
1556
- loc: this.addEmptyLoc(),
1557
- targetConstructor: this.deserializeNode(),
1558
- properties: this.deserializeNode()
1559
- };
1560
- }, function () {
1561
- return {
1562
- type: 'MatchInstanceObjectPattern',
1563
- loc: this.addEmptyLoc(),
1564
- properties: this.deserializeNodeList(),
1565
- rest: this.deserializeNode()
1566
- };
1567
- }, function () {
1568
- return {
1569
- type: 'MatchOrPattern',
1570
- loc: this.addEmptyLoc(),
1571
- patterns: this.deserializeNodeList()
1572
- };
1573
- }, function () {
1574
- return {
1575
- type: 'MatchAsPattern',
1576
- loc: this.addEmptyLoc(),
1577
- pattern: this.deserializeNode(),
1578
- target: this.deserializeNode()
1579
- };
1580
- }, function () {
1581
- return {
1582
- type: 'MatchIdentifierPattern',
1583
- loc: this.addEmptyLoc(),
1584
- id: this.deserializeNode()
1585
- };
1586
- }, function () {
1587
- return {
1588
- type: 'MatchMemberPattern',
1589
- loc: this.addEmptyLoc(),
1590
- base: this.deserializeNode(),
1591
- property: this.deserializeNode()
1592
- };
1593
- }, function () {
1594
- return {
1595
- type: 'MatchBindingPattern',
1596
- loc: this.addEmptyLoc(),
1597
- id: this.deserializeNode(),
1598
- kind: this.deserializeString()
1599
- };
1600
- }, function () {
1601
- return {
1602
- type: 'MatchArrayPattern',
1603
- loc: this.addEmptyLoc(),
1604
- elements: this.deserializeNodeList(),
1605
- rest: this.deserializeNode()
1606
- };
1607
- }, function () {
1608
- return {
1609
- type: 'MatchObjectPatternProperty',
1610
- loc: this.addEmptyLoc(),
1611
- key: this.deserializeNode(),
1612
- pattern: this.deserializeNode(),
1613
- shorthand: this.deserializeBoolean()
1614
- };
1615
- }, function () {
1616
- return {
1617
- type: 'MatchRestPattern',
1618
- loc: this.addEmptyLoc(),
1619
- argument: this.deserializeNode()
1620
- };
1621
- }, function () {
1622
- return {
1623
- type: 'Program',
1624
- loc: this.addEmptyLoc(),
1625
- body: this.deserializeNodeList()
1626
- };
1627
- }, function () {
1628
- return {
1629
- type: 'InterpreterDirective',
1630
- loc: this.addEmptyLoc(),
1631
- value: this.deserializeString()
1632
- };
1633
- }, function () {
1634
- return {
1635
- type: 'FunctionTypeAnnotation',
1636
- loc: this.addEmptyLoc(),
1637
- params: this.deserializeNodeList(),
1638
- this: this.deserializeNode(),
1639
- returnType: this.deserializeNode(),
1640
- rest: this.deserializeNode(),
1641
- typeParameters: this.deserializeNode()
1642
- };
1643
- }, function () {
1644
- return {
1645
- type: 'RendersType',
1646
- loc: this.addEmptyLoc(),
1647
- argument: this.deserializeNode()
1648
- };
1649
- }, function () {
1650
- return {
1651
- type: 'RendersMaybeType',
1652
- loc: this.addEmptyLoc(),
1653
- argument: this.deserializeNode()
1654
- };
1655
- }, function () {
1656
- return {
1657
- type: 'RendersStarType',
1658
- loc: this.addEmptyLoc(),
1659
- argument: this.deserializeNode()
1660
- };
1661
- }, function () {
1662
- return {
1663
- type: 'TemplateLiteralTypeAnnotation',
1664
- loc: this.addEmptyLoc(),
1665
- quasis: this.deserializeNodeList(),
1666
- types: this.deserializeNodeList()
1667
- };
1668
- }, function () {
1669
- return {
1670
- type: 'NamespaceExportDeclaration',
1671
- loc: this.addEmptyLoc(),
1672
- id: this.deserializeNode()
1673
- };
1674
- }, function () {
1675
- return {
1676
- type: 'DeclareClassExtendsCall',
1677
- loc: this.addEmptyLoc(),
1678
- callee: this.deserializeNode(),
1679
- argument: this.deserializeNode()
1680
- };
1681
- }, function () {
1682
- return {
1683
- type: 'OpaqueType',
1684
- loc: this.addEmptyLoc(),
1685
- id: this.deserializeNode(),
1686
- typeParameters: this.deserializeNode(),
1687
- impltype: this.deserializeNode(),
1688
- lowerBound: this.deserializeNode(),
1689
- upperBound: this.deserializeNode(),
1690
- supertype: this.deserializeNode()
1691
- };
1692
- }, function () {
1693
- return {
1694
- type: 'DeclareOpaqueType',
1695
- loc: this.addEmptyLoc(),
1696
- id: this.deserializeNode(),
1697
- typeParameters: this.deserializeNode(),
1698
- impltype: this.deserializeNode(),
1699
- lowerBound: this.deserializeNode(),
1700
- upperBound: this.deserializeNode(),
1701
- supertype: this.deserializeNode()
1702
- };
1703
- }, function () {
1704
- return {
1705
- type: 'EnumBody',
1706
- loc: this.addEmptyLoc(),
1707
- members: this.deserializeNodeList(),
1708
- explicitType: this.deserializeString(),
1709
- hasUnknownMembers: this.deserializeBoolean()
1710
- };
1711
- }, function () {
1712
- return {
1713
- type: 'HookTypeAnnotation',
1714
- loc: this.addEmptyLoc(),
1715
- params: this.deserializeNodeList(),
1716
- returnType: this.deserializeNode(),
1717
- rest: this.deserializeNode(),
1718
- typeParameters: this.deserializeNode()
1719
- };
1720
- }, function () {
1721
- return {
1722
- type: 'ConstructorTypeAnnotation',
1723
- loc: this.addEmptyLoc(),
1724
- abstract: this.deserializeBoolean(),
1725
- params: this.deserializeNodeList(),
1726
- returnType: this.deserializeNode(),
1727
- rest: this.deserializeNode(),
1728
- typeParameters: this.deserializeNode()
1729
- };
1730
- }, function () {
1731
- return {
1732
- type: 'ObjectTypePrivateField',
1733
- loc: this.addEmptyLoc(),
1734
- key: this.deserializeNode()
1735
- };
1736
- }, function () {
1737
- return {
1738
- type: 'TupleTypeElement',
1739
- loc: this.addEmptyLoc(),
1740
- elementType: this.deserializeNode(),
1741
- optional: this.deserializeBoolean()
1742
- };
1743
- }, function () {
1744
- return {
1745
- type: 'DeclareComponent',
1746
- loc: this.addEmptyLoc(),
1747
- body: this.deserializeNode(),
1748
- id: this.deserializeNode(),
1749
- implicitDeclare: this.deserializeBoolean(),
1750
- params: this.deserializeNodeList(),
1751
- rest: this.deserializeNode(),
1752
- rendersType: this.deserializeNode(),
1753
- typeParameters: this.deserializeNode(),
1754
- async: this.deserializeBoolean()
1755
- };
1756
- }, function () {
1757
- return {
1758
- type: 'ThisTypeAnnotation',
1759
- loc: this.addEmptyLoc()
1760
- };
1761
- }, function () {
1762
- return {
1763
- type: 'ChainExpression',
1764
- loc: this.addEmptyLoc(),
1765
- expression: this.deserializeNode()
1766
- };
1767
- }];