flow-parser 0.320.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 (104) hide show
  1. package/README.md +14 -26
  2. package/package.json +6 -7
  3. package/flow_parser.js +0 -14585
  4. package/oxidized/oxidized-src/FlowParser.js +0 -249
  5. package/oxidized/oxidized-src/FlowParserDeserializer.js +0 -209
  6. package/oxidized/oxidized-src/FlowParserNodeDeserializers.js +0 -1781
  7. package/oxidized/oxidized-src/HermesParserDecodeUTF8String.js +0 -45
  8. package/oxidized/oxidized-src/ParserOptions.js +0 -8
  9. package/oxidized/oxidized-src/babel/TransformESTreeToBabel.js +0 -1063
  10. package/oxidized/oxidized-src/estree/StripFlowTypes.js +0 -158
  11. package/oxidized/oxidized-src/estree/StripFlowTypesForBabel.js +0 -191
  12. package/oxidized/oxidized-src/estree/TransformComponentSyntax.js +0 -764
  13. package/oxidized/oxidized-src/estree/TransformEnumSyntax.js +0 -92
  14. package/oxidized/oxidized-src/estree/TransformMatchSyntax.js +0 -990
  15. package/oxidized/oxidized-src/estree/TransformRecordSyntax.js +0 -283
  16. package/oxidized/oxidized-src/generated/ESTreeVisitorKeys.js +0 -234
  17. package/oxidized/oxidized-src/getModuleDocblock.js +0 -87
  18. package/oxidized/oxidized-src/index.js +0 -220
  19. package/oxidized/transform/SimpleTransform.js +0 -95
  20. package/oxidized/transform/astArrayMutationHelpers.js +0 -52
  21. package/oxidized/transform/astNodeMutationHelpers.js +0 -142
  22. package/oxidized/transform/print/comments/comments.js +0 -245
  23. package/oxidized/transform/print/comments/prettier/common/util.js +0 -235
  24. package/oxidized/transform/print/comments/prettier/language-js/comments.js +0 -663
  25. package/oxidized/transform/print/comments/prettier/language-js/loc.js +0 -30
  26. package/oxidized/transform/print/comments/prettier/language-js/printer-estree.js +0 -23
  27. package/oxidized/transform/print/comments/prettier/language-js/utils.js +0 -89
  28. package/oxidized/transform/print/comments/prettier/main/comments.js +0 -374
  29. package/oxidized/transform/print/comments/prettier/utils/get-last.js +0 -5
  30. package/oxidized/transform/print/detachedNodeTypes.js +0 -1
  31. package/oxidized/transform/print/print.js +0 -68
  32. package/oxidized/traverse/SimpleTraverser.js +0 -90
  33. package/oxidized/traverse/getVisitorKeys.js +0 -29
  34. package/oxidized/utils/Builders.js +0 -181
  35. package/oxidized/utils/GenID.js +0 -37
  36. package/oxidized/utils/createSyntaxError.js +0 -15
  37. package/oxidized/utils/isReservedWord.js +0 -53
  38. package/oxidized/utils/mutateESTreeASTForPrettier.js +0 -85
  39. /package/{oxidized → dist}/FlowParser.js +0 -0
  40. /package/{oxidized → dist}/FlowParser.js.flow +0 -0
  41. /package/{oxidized → dist}/FlowParserDeserializer.js +0 -0
  42. /package/{oxidized → dist}/FlowParserDeserializer.js.flow +0 -0
  43. /package/{oxidized → dist}/FlowParserNodeDeserializers.js +0 -0
  44. /package/{oxidized → dist}/FlowParserNodeDeserializers.js.flow +0 -0
  45. /package/{oxidized → dist}/FlowParserWASM.js +0 -0
  46. /package/{oxidized → dist}/FlowParserWASM.js.flow +0 -0
  47. /package/{oxidized → dist}/HermesAST.js.flow +0 -0
  48. /package/{oxidized → dist}/HermesParserDecodeUTF8String.js +0 -0
  49. /package/{oxidized → dist}/HermesParserDecodeUTF8String.js.flow +0 -0
  50. /package/{oxidized → dist}/ParserOptions.js +0 -0
  51. /package/{oxidized → dist}/ParserOptions.js.flow +0 -0
  52. /package/{oxidized → dist}/babel/TransformESTreeToBabel.js +0 -0
  53. /package/{oxidized → dist}/babel/TransformESTreeToBabel.js.flow +0 -0
  54. /package/{oxidized → dist}/estree/StripFlowTypes.js +0 -0
  55. /package/{oxidized → dist}/estree/StripFlowTypes.js.flow +0 -0
  56. /package/{oxidized → dist}/estree/StripFlowTypesForBabel.js +0 -0
  57. /package/{oxidized → dist}/estree/StripFlowTypesForBabel.js.flow +0 -0
  58. /package/{oxidized → dist}/estree/TransformComponentSyntax.js +0 -0
  59. /package/{oxidized → dist}/estree/TransformComponentSyntax.js.flow +0 -0
  60. /package/{oxidized → dist}/estree/TransformEnumSyntax.js +0 -0
  61. /package/{oxidized → dist}/estree/TransformEnumSyntax.js.flow +0 -0
  62. /package/{oxidized → dist}/estree/TransformMatchSyntax.js +0 -0
  63. /package/{oxidized → dist}/estree/TransformMatchSyntax.js.flow +0 -0
  64. /package/{oxidized → dist}/estree/TransformRecordSyntax.js +0 -0
  65. /package/{oxidized → dist}/estree/TransformRecordSyntax.js.flow +0 -0
  66. /package/{oxidized → dist}/generated/ESTreeVisitorKeys.js +0 -0
  67. /package/{oxidized → dist}/generated/ESTreeVisitorKeys.js.flow +0 -0
  68. /package/{oxidized → dist}/getModuleDocblock.js +0 -0
  69. /package/{oxidized → dist}/getModuleDocblock.js.flow +0 -0
  70. /package/{oxidized → dist}/index.js +0 -0
  71. /package/{oxidized → dist}/index.js.flow +0 -0
  72. /package/{oxidized/oxidized-src → dist}/transform/SimpleTransform.js +0 -0
  73. /package/{oxidized → dist}/transform/SimpleTransform.js.flow +0 -0
  74. /package/{oxidized/oxidized-src → dist}/transform/astArrayMutationHelpers.js +0 -0
  75. /package/{oxidized → dist}/transform/astArrayMutationHelpers.js.flow +0 -0
  76. /package/{oxidized/oxidized-src → dist}/transform/astNodeMutationHelpers.js +0 -0
  77. /package/{oxidized → dist}/transform/astNodeMutationHelpers.js.flow +0 -0
  78. /package/{oxidized/oxidized-src → dist}/transform/print/comments/comments.js +0 -0
  79. /package/{oxidized → dist}/transform/print/comments/comments.js.flow +0 -0
  80. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/common/util.js +0 -0
  81. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/comments.js +0 -0
  82. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/loc.js +0 -0
  83. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/printer-estree.js +0 -0
  84. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/language-js/utils.js +0 -0
  85. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/main/comments.js +0 -0
  86. /package/{oxidized/oxidized-src → dist}/transform/print/comments/prettier/utils/get-last.js +0 -0
  87. /package/{oxidized/oxidized-src → dist}/transform/print/detachedNodeTypes.js +0 -0
  88. /package/{oxidized → dist}/transform/print/detachedNodeTypes.js.flow +0 -0
  89. /package/{oxidized/oxidized-src → dist}/transform/print/print.js +0 -0
  90. /package/{oxidized → dist}/transform/print/print.js.flow +0 -0
  91. /package/{oxidized/oxidized-src → dist}/traverse/SimpleTraverser.js +0 -0
  92. /package/{oxidized → dist}/traverse/SimpleTraverser.js.flow +0 -0
  93. /package/{oxidized/oxidized-src → dist}/traverse/getVisitorKeys.js +0 -0
  94. /package/{oxidized → dist}/traverse/getVisitorKeys.js.flow +0 -0
  95. /package/{oxidized/oxidized-src → dist}/utils/Builders.js +0 -0
  96. /package/{oxidized → dist}/utils/Builders.js.flow +0 -0
  97. /package/{oxidized/oxidized-src → dist}/utils/GenID.js +0 -0
  98. /package/{oxidized → dist}/utils/GenID.js.flow +0 -0
  99. /package/{oxidized/oxidized-src → dist}/utils/createSyntaxError.js +0 -0
  100. /package/{oxidized → dist}/utils/createSyntaxError.js.flow +0 -0
  101. /package/{oxidized/oxidized-src → dist}/utils/isReservedWord.js +0 -0
  102. /package/{oxidized → dist}/utils/isReservedWord.js.flow +0 -0
  103. /package/{oxidized/oxidized-src → dist}/utils/mutateESTreeASTForPrettier.js +0 -0
  104. /package/{oxidized → dist}/utils/mutateESTreeASTForPrettier.js.flow +0 -0
@@ -1,1781 +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
- declarations: this.deserializeNodeList(),
820
- kind: this.deserializeString(),
821
- implicitDeclare: this.deserializeBoolean()
822
- };
823
- }, function () {
824
- return {
825
- type: 'DeclareFunction',
826
- loc: this.addEmptyLoc(),
827
- id: this.deserializeNode(),
828
- implicitDeclare: this.deserializeBoolean(),
829
- predicate: this.deserializeNode()
830
- };
831
- }, function () {
832
- return {
833
- type: 'DeclareClass',
834
- loc: this.addEmptyLoc(),
835
- id: this.deserializeNode(),
836
- typeParameters: this.deserializeNode(),
837
- extends: this.deserializeNodeList(),
838
- implements: this.deserializeNodeList(),
839
- mixins: this.deserializeNodeList(),
840
- body: this.deserializeNode(),
841
- implicitDeclare: this.deserializeBoolean()
842
- };
843
- }, function () {
844
- return {
845
- type: 'DeclareComponent',
846
- loc: this.addEmptyLoc(),
847
- id: this.deserializeNode(),
848
- params: this.deserializeNodeList(),
849
- rest: this.deserializeNode(),
850
- rendersType: this.deserializeNode(),
851
- typeParameters: this.deserializeNode(),
852
- implicitDeclare: this.deserializeBoolean()
853
- };
854
- }, function () {
855
- return {
856
- type: 'DeclareHook',
857
- loc: this.addEmptyLoc(),
858
- id: this.deserializeNode(),
859
- implicitDeclare: this.deserializeBoolean()
860
- };
861
- }, function () {
862
- return {
863
- type: 'DeclareModule',
864
- loc: this.addEmptyLoc(),
865
- id: this.deserializeNode(),
866
- body: this.deserializeNode()
867
- };
868
- }, function () {
869
- return {
870
- type: 'DeclareModuleExports',
871
- loc: this.addEmptyLoc(),
872
- typeAnnotation: this.deserializeNode()
873
- };
874
- }, function () {
875
- return {
876
- type: 'DeclareExportDeclaration',
877
- loc: this.addEmptyLoc(),
878
- default: this.deserializeBoolean(),
879
- declaration: this.deserializeNode(),
880
- specifiers: this.deserializeNodeList(),
881
- source: this.deserializeNode(),
882
- implicitDeclare: this.deserializeBoolean()
883
- };
884
- }, function () {
885
- return {
886
- type: 'DeclareExportAllDeclaration',
887
- loc: this.addEmptyLoc(),
888
- source: this.deserializeNode(),
889
- implicitDeclare: this.deserializeBoolean()
890
- };
891
- }, function () {
892
- return {
893
- type: 'DeclareNamespace',
894
- loc: this.addEmptyLoc(),
895
- global: this.deserializeBoolean(),
896
- id: this.deserializeNode(),
897
- body: this.deserializeNode(),
898
- implicitDeclare: this.deserializeBoolean(),
899
- keyword: this.deserializeString()
900
- };
901
- }, function () {
902
- return {
903
- type: 'DeclareInterface',
904
- loc: this.addEmptyLoc(),
905
- id: this.deserializeNode(),
906
- typeParameters: this.deserializeNode(),
907
- body: this.deserializeNode(),
908
- extends: this.deserializeNodeList(),
909
- implicitDeclare: this.deserializeBoolean()
910
- };
911
- }, function () {
912
- return {
913
- type: 'DeclareTypeAlias',
914
- loc: this.addEmptyLoc(),
915
- id: this.deserializeNode(),
916
- typeParameters: this.deserializeNode(),
917
- right: this.deserializeNode(),
918
- implicitDeclare: this.deserializeBoolean()
919
- };
920
- }, function () {
921
- return {
922
- type: 'DeclareEnum',
923
- loc: this.addEmptyLoc(),
924
- id: this.deserializeNode(),
925
- body: this.deserializeNode(),
926
- implicitDeclare: this.deserializeBoolean()
927
- };
928
- }, function () {
929
- return {
930
- type: 'TypeAnnotation',
931
- loc: this.addEmptyLoc(),
932
- typeAnnotation: this.deserializeNode()
933
- };
934
- }, function () {
935
- return {
936
- type: 'Variance',
937
- loc: this.addEmptyLoc(),
938
- kind: this.deserializeString()
939
- };
940
- }, function () {
941
- return {
942
- type: 'AnyTypeAnnotation',
943
- loc: this.addEmptyLoc()
944
- };
945
- }, function () {
946
- return {
947
- type: 'MixedTypeAnnotation',
948
- loc: this.addEmptyLoc()
949
- };
950
- }, function () {
951
- return {
952
- type: 'EmptyTypeAnnotation',
953
- loc: this.addEmptyLoc()
954
- };
955
- }, function () {
956
- return {
957
- type: 'VoidTypeAnnotation',
958
- loc: this.addEmptyLoc()
959
- };
960
- }, function () {
961
- return {
962
- type: 'NullLiteralTypeAnnotation',
963
- loc: this.addEmptyLoc()
964
- };
965
- }, function () {
966
- return {
967
- type: 'SymbolTypeAnnotation',
968
- loc: this.addEmptyLoc()
969
- };
970
- }, function () {
971
- return {
972
- type: 'NumberTypeAnnotation',
973
- loc: this.addEmptyLoc()
974
- };
975
- }, function () {
976
- return {
977
- type: 'BigIntTypeAnnotation',
978
- loc: this.addEmptyLoc()
979
- };
980
- }, function () {
981
- return {
982
- type: 'StringTypeAnnotation',
983
- loc: this.addEmptyLoc()
984
- };
985
- }, function () {
986
- return {
987
- type: 'BooleanTypeAnnotation',
988
- loc: this.addEmptyLoc()
989
- };
990
- }, function () {
991
- return {
992
- type: 'NullableTypeAnnotation',
993
- loc: this.addEmptyLoc(),
994
- typeAnnotation: this.deserializeNode()
995
- };
996
- }, function () {
997
- return {
998
- type: 'ArrayTypeAnnotation',
999
- loc: this.addEmptyLoc(),
1000
- elementType: this.deserializeNode()
1001
- };
1002
- }, function () {
1003
- return {
1004
- type: 'IndexedAccessType',
1005
- loc: this.addEmptyLoc(),
1006
- objectType: this.deserializeNode(),
1007
- indexType: this.deserializeNode()
1008
- };
1009
- }, function () {
1010
- return {
1011
- type: 'OptionalIndexedAccessType',
1012
- loc: this.addEmptyLoc(),
1013
- objectType: this.deserializeNode(),
1014
- indexType: this.deserializeNode(),
1015
- optional: this.deserializeBoolean()
1016
- };
1017
- }, function () {
1018
- return {
1019
- type: 'UnionTypeAnnotation',
1020
- loc: this.addEmptyLoc(),
1021
- types: this.deserializeNodeList()
1022
- };
1023
- }, function () {
1024
- return {
1025
- type: 'IntersectionTypeAnnotation',
1026
- loc: this.addEmptyLoc(),
1027
- types: this.deserializeNodeList()
1028
- };
1029
- }, function () {
1030
- return {
1031
- type: 'KeyofTypeAnnotation',
1032
- loc: this.addEmptyLoc(),
1033
- argument: this.deserializeNode()
1034
- };
1035
- }, function () {
1036
- return {
1037
- type: 'TypeOperator',
1038
- loc: this.addEmptyLoc(),
1039
- operator: this.deserializeString(),
1040
- typeAnnotation: this.deserializeNode()
1041
- };
1042
- }, function () {
1043
- return {
1044
- type: 'StringLiteralTypeAnnotation',
1045
- loc: this.addEmptyLoc(),
1046
- value: this.deserializeString(),
1047
- raw: this.deserializeString()
1048
- };
1049
- }, function () {
1050
- return {
1051
- type: 'NumberLiteralTypeAnnotation',
1052
- loc: this.addEmptyLoc(),
1053
- value: this.deserializeNumber(),
1054
- raw: this.deserializeString()
1055
- };
1056
- }, function () {
1057
- const loc = this.addEmptyLoc();
1058
- this.deserializeNode();
1059
- const raw = this.deserializeString();
1060
- const bigint = this.deserializeString();
1061
- let value = null;
1062
-
1063
- if (bigint != null && typeof BigInt === 'function') {
1064
- try {
1065
- value = BigInt(bigint);
1066
- } catch (e) {
1067
- value = null;
1068
- }
1069
- }
1070
-
1071
- return {
1072
- type: 'BigIntLiteralTypeAnnotation',
1073
- loc,
1074
- value,
1075
- raw,
1076
- bigint
1077
- };
1078
- }, function () {
1079
- return {
1080
- type: 'BooleanLiteralTypeAnnotation',
1081
- loc: this.addEmptyLoc(),
1082
- value: this.deserializeBoolean(),
1083
- raw: this.deserializeString()
1084
- };
1085
- }, function () {
1086
- return {
1087
- type: 'ExistsTypeAnnotation',
1088
- loc: this.addEmptyLoc()
1089
- };
1090
- }, function () {
1091
- return {
1092
- type: 'UnknownTypeAnnotation',
1093
- loc: this.addEmptyLoc()
1094
- };
1095
- }, function () {
1096
- return {
1097
- type: 'NeverTypeAnnotation',
1098
- loc: this.addEmptyLoc()
1099
- };
1100
- }, function () {
1101
- return {
1102
- type: 'UndefinedTypeAnnotation',
1103
- loc: this.addEmptyLoc()
1104
- };
1105
- }, function () {
1106
- return {
1107
- type: 'GenericTypeAnnotation',
1108
- loc: this.addEmptyLoc(),
1109
- id: this.deserializeNode(),
1110
- typeParameters: this.deserializeNode()
1111
- };
1112
- }, function () {
1113
- return {
1114
- type: 'QualifiedTypeIdentifier',
1115
- loc: this.addEmptyLoc(),
1116
- qualification: this.deserializeNode(),
1117
- id: this.deserializeNode()
1118
- };
1119
- }, function () {
1120
- return {
1121
- type: 'QualifiedTypeofIdentifier',
1122
- loc: this.addEmptyLoc(),
1123
- qualification: this.deserializeNode(),
1124
- id: this.deserializeNode()
1125
- };
1126
- }, function () {
1127
- return {
1128
- type: 'TypeofTypeAnnotation',
1129
- loc: this.addEmptyLoc(),
1130
- argument: this.deserializeNode(),
1131
- typeArguments: this.deserializeNode()
1132
- };
1133
- }, function () {
1134
- return {
1135
- type: 'ImportType',
1136
- loc: this.addEmptyLoc(),
1137
- argument: this.deserializeNode()
1138
- };
1139
- }, function () {
1140
- return {
1141
- type: 'TupleTypeAnnotation',
1142
- loc: this.addEmptyLoc(),
1143
- elementTypes: this.deserializeNodeList(),
1144
- inexact: this.deserializeBoolean()
1145
- };
1146
- }, function () {
1147
- return {
1148
- type: 'TupleTypeLabeledElement',
1149
- loc: this.addEmptyLoc(),
1150
- label: this.deserializeNode(),
1151
- elementType: this.deserializeNode(),
1152
- variance: this.deserializeNode(),
1153
- optional: this.deserializeBoolean()
1154
- };
1155
- }, function () {
1156
- return {
1157
- type: 'TupleTypeSpreadElement',
1158
- loc: this.addEmptyLoc(),
1159
- label: this.deserializeNode(),
1160
- typeAnnotation: this.deserializeNode()
1161
- };
1162
- }, function () {
1163
- return {
1164
- type: 'ObjectTypeAnnotation',
1165
- loc: this.addEmptyLoc(),
1166
- properties: this.deserializeNodeList(),
1167
- indexers: this.deserializeNodeList(),
1168
- callProperties: this.deserializeNodeList(),
1169
- internalSlots: this.deserializeNodeList(),
1170
- inexact: this.deserializeBoolean(),
1171
- exact: this.deserializeBoolean()
1172
- };
1173
- }, function () {
1174
- return {
1175
- type: 'ObjectTypeProperty',
1176
- loc: this.addEmptyLoc(),
1177
- key: this.deserializeNode(),
1178
- value: this.deserializeNode(),
1179
- method: this.deserializeBoolean(),
1180
- optional: this.deserializeBoolean(),
1181
- static: this.deserializeBoolean(),
1182
- proto: this.deserializeBoolean(),
1183
- variance: this.deserializeNode(),
1184
- kind: this.deserializeString()
1185
- };
1186
- }, function () {
1187
- return {
1188
- type: 'ObjectTypeSpreadProperty',
1189
- loc: this.addEmptyLoc(),
1190
- argument: this.deserializeNode()
1191
- };
1192
- }, function () {
1193
- return {
1194
- type: 'ObjectTypeIndexer',
1195
- loc: this.addEmptyLoc(),
1196
- id: this.deserializeNode(),
1197
- key: this.deserializeNode(),
1198
- value: this.deserializeNode(),
1199
- static: this.deserializeBoolean(),
1200
- variance: this.deserializeNode()
1201
- };
1202
- }, function () {
1203
- return {
1204
- type: 'ObjectTypeCallProperty',
1205
- loc: this.addEmptyLoc(),
1206
- value: this.deserializeNode(),
1207
- static: this.deserializeBoolean()
1208
- };
1209
- }, function () {
1210
- return {
1211
- type: 'ObjectTypeMappedTypeProperty',
1212
- loc: this.addEmptyLoc(),
1213
- keyTparam: this.deserializeNode(),
1214
- propType: this.deserializeNode(),
1215
- sourceType: this.deserializeNode(),
1216
- variance: this.deserializeNode(),
1217
- optional: this.deserializeString()
1218
- };
1219
- }, function () {
1220
- return {
1221
- type: 'ObjectTypeInternalSlot',
1222
- loc: this.addEmptyLoc(),
1223
- id: this.deserializeNode(),
1224
- optional: this.deserializeBoolean(),
1225
- static: this.deserializeBoolean(),
1226
- method: this.deserializeBoolean(),
1227
- value: this.deserializeNode()
1228
- };
1229
- }, function () {
1230
- return {
1231
- type: 'FunctionTypeParam',
1232
- loc: this.addEmptyLoc(),
1233
- name: this.deserializeNode(),
1234
- typeAnnotation: this.deserializeNode(),
1235
- optional: this.deserializeBoolean()
1236
- };
1237
- }, function () {
1238
- return {
1239
- type: 'TypePredicate',
1240
- loc: this.addEmptyLoc(),
1241
- parameterName: this.deserializeNode(),
1242
- typeAnnotation: this.deserializeNode(),
1243
- kind: this.deserializeString()
1244
- };
1245
- }, function () {
1246
- return {
1247
- type: 'ConditionalTypeAnnotation',
1248
- loc: this.addEmptyLoc(),
1249
- checkType: this.deserializeNode(),
1250
- extendsType: this.deserializeNode(),
1251
- trueType: this.deserializeNode(),
1252
- falseType: this.deserializeNode()
1253
- };
1254
- }, function () {
1255
- return {
1256
- type: 'InferTypeAnnotation',
1257
- loc: this.addEmptyLoc(),
1258
- typeParameter: this.deserializeNode()
1259
- };
1260
- }, function () {
1261
- return {
1262
- type: 'InterfaceExtends',
1263
- loc: this.addEmptyLoc(),
1264
- id: this.deserializeNode(),
1265
- typeParameters: this.deserializeNode()
1266
- };
1267
- }, function () {
1268
- return {
1269
- type: 'InterfaceTypeAnnotation',
1270
- loc: this.addEmptyLoc(),
1271
- extends: this.deserializeNodeList(),
1272
- body: this.deserializeNode()
1273
- };
1274
- }, function () {
1275
- return {
1276
- type: 'TypeParameterDeclaration',
1277
- loc: this.addEmptyLoc(),
1278
- params: this.deserializeNodeList()
1279
- };
1280
- }, function () {
1281
- return {
1282
- type: 'TypeParameter',
1283
- loc: this.addEmptyLoc(),
1284
- name: this.deserializeString(),
1285
- const: this.deserializeBoolean(),
1286
- bound: this.deserializeNode(),
1287
- variance: this.deserializeNode(),
1288
- default: this.deserializeNode(),
1289
- usesExtendsBound: this.deserializeBoolean()
1290
- };
1291
- }, function () {
1292
- return {
1293
- type: 'TypeParameterInstantiation',
1294
- loc: this.addEmptyLoc(),
1295
- params: this.deserializeNodeList()
1296
- };
1297
- }, function () {
1298
- return {
1299
- type: 'ComponentTypeAnnotation',
1300
- loc: this.addEmptyLoc(),
1301
- params: this.deserializeNodeList(),
1302
- rest: this.deserializeNode(),
1303
- rendersType: this.deserializeNode(),
1304
- typeParameters: this.deserializeNode()
1305
- };
1306
- }, function () {
1307
- return {
1308
- type: 'ComponentTypeParameter',
1309
- loc: this.addEmptyLoc(),
1310
- name: this.deserializeNode(),
1311
- typeAnnotation: this.deserializeNode(),
1312
- optional: this.deserializeBoolean()
1313
- };
1314
- }, function () {
1315
- return {
1316
- type: 'DeclaredPredicate',
1317
- loc: this.addEmptyLoc(),
1318
- value: this.deserializeNode()
1319
- };
1320
- }, function () {
1321
- return {
1322
- type: 'InferredPredicate',
1323
- loc: this.addEmptyLoc()
1324
- };
1325
- }, function () {
1326
- return {
1327
- type: 'JSXElement',
1328
- loc: this.addEmptyLoc(),
1329
- openingElement: this.deserializeNode(),
1330
- children: this.deserializeNodeList(),
1331
- closingElement: this.deserializeNode()
1332
- };
1333
- }, function () {
1334
- return {
1335
- type: 'JSXFragment',
1336
- loc: this.addEmptyLoc(),
1337
- openingFragment: this.deserializeNode(),
1338
- children: this.deserializeNodeList(),
1339
- closingFragment: this.deserializeNode()
1340
- };
1341
- }, function () {
1342
- return {
1343
- type: 'JSXOpeningElement',
1344
- loc: this.addEmptyLoc(),
1345
- name: this.deserializeNode(),
1346
- attributes: this.deserializeNodeList(),
1347
- selfClosing: this.deserializeBoolean(),
1348
- typeArguments: this.deserializeNode()
1349
- };
1350
- }, function () {
1351
- return {
1352
- type: 'JSXOpeningFragment',
1353
- loc: this.addEmptyLoc()
1354
- };
1355
- }, function () {
1356
- return {
1357
- type: 'JSXClosingElement',
1358
- loc: this.addEmptyLoc(),
1359
- name: this.deserializeNode()
1360
- };
1361
- }, function () {
1362
- return {
1363
- type: 'JSXClosingFragment',
1364
- loc: this.addEmptyLoc()
1365
- };
1366
- }, function () {
1367
- return {
1368
- type: 'JSXAttribute',
1369
- loc: this.addEmptyLoc(),
1370
- name: this.deserializeNode(),
1371
- value: this.deserializeNode()
1372
- };
1373
- }, function () {
1374
- return {
1375
- type: 'JSXSpreadAttribute',
1376
- loc: this.addEmptyLoc(),
1377
- argument: this.deserializeNode()
1378
- };
1379
- }, function () {
1380
- return {
1381
- type: 'JSXEmptyExpression',
1382
- loc: this.addEmptyLoc()
1383
- };
1384
- }, function () {
1385
- return {
1386
- type: 'JSXExpressionContainer',
1387
- loc: this.addEmptyLoc(),
1388
- expression: this.deserializeNode()
1389
- };
1390
- }, function () {
1391
- return {
1392
- type: 'JSXSpreadChild',
1393
- loc: this.addEmptyLoc(),
1394
- expression: this.deserializeNode()
1395
- };
1396
- }, function () {
1397
- return {
1398
- type: 'JSXText',
1399
- loc: this.addEmptyLoc(),
1400
- value: this.deserializeString(),
1401
- raw: this.deserializeString()
1402
- };
1403
- }, function () {
1404
- return {
1405
- type: 'JSXMemberExpression',
1406
- loc: this.addEmptyLoc(),
1407
- object: this.deserializeNode(),
1408
- property: this.deserializeNode()
1409
- };
1410
- }, function () {
1411
- return {
1412
- type: 'JSXNamespacedName',
1413
- loc: this.addEmptyLoc(),
1414
- namespace: this.deserializeNode(),
1415
- name: this.deserializeNode()
1416
- };
1417
- }, function () {
1418
- return {
1419
- type: 'JSXIdentifier',
1420
- loc: this.addEmptyLoc(),
1421
- name: this.deserializeString()
1422
- };
1423
- }, function () {
1424
- return {
1425
- type: 'EnumBooleanBody',
1426
- loc: this.addEmptyLoc(),
1427
- members: this.deserializeNodeList(),
1428
- explicitType: this.deserializeBoolean(),
1429
- hasUnknownMembers: this.deserializeBoolean()
1430
- };
1431
- }, function () {
1432
- return {
1433
- type: 'EnumBooleanMember',
1434
- loc: this.addEmptyLoc(),
1435
- id: this.deserializeNode(),
1436
- init: this.deserializeNode()
1437
- };
1438
- }, function () {
1439
- return {
1440
- type: 'EnumNumberBody',
1441
- loc: this.addEmptyLoc(),
1442
- members: this.deserializeNodeList(),
1443
- explicitType: this.deserializeBoolean(),
1444
- hasUnknownMembers: this.deserializeBoolean()
1445
- };
1446
- }, function () {
1447
- return {
1448
- type: 'EnumNumberMember',
1449
- loc: this.addEmptyLoc(),
1450
- id: this.deserializeNode(),
1451
- init: this.deserializeNode()
1452
- };
1453
- }, function () {
1454
- return {
1455
- type: 'EnumStringBody',
1456
- loc: this.addEmptyLoc(),
1457
- members: this.deserializeNodeList(),
1458
- explicitType: this.deserializeBoolean(),
1459
- hasUnknownMembers: this.deserializeBoolean()
1460
- };
1461
- }, function () {
1462
- return {
1463
- type: 'EnumStringMember',
1464
- loc: this.addEmptyLoc(),
1465
- id: this.deserializeNode(),
1466
- init: this.deserializeNode()
1467
- };
1468
- }, function () {
1469
- return {
1470
- type: 'EnumSymbolBody',
1471
- loc: this.addEmptyLoc(),
1472
- members: this.deserializeNodeList(),
1473
- hasUnknownMembers: this.deserializeBoolean()
1474
- };
1475
- }, function () {
1476
- return {
1477
- type: 'EnumDefaultedMember',
1478
- loc: this.addEmptyLoc(),
1479
- id: this.deserializeNode()
1480
- };
1481
- }, function () {
1482
- return {
1483
- type: 'EnumBigIntBody',
1484
- loc: this.addEmptyLoc(),
1485
- members: this.deserializeNodeList(),
1486
- explicitType: this.deserializeBoolean(),
1487
- hasUnknownMembers: this.deserializeBoolean()
1488
- };
1489
- }, function () {
1490
- return {
1491
- type: 'EnumBigIntMember',
1492
- loc: this.addEmptyLoc(),
1493
- id: this.deserializeNode(),
1494
- init: this.deserializeNode()
1495
- };
1496
- }, function () {
1497
- return {
1498
- type: 'RecordDeclarationBody',
1499
- loc: this.addEmptyLoc(),
1500
- elements: this.deserializeNodeList()
1501
- };
1502
- }, function () {
1503
- return {
1504
- type: 'RecordDeclarationProperty',
1505
- loc: this.addEmptyLoc(),
1506
- key: this.deserializeNode(),
1507
- typeAnnotation: this.deserializeNode(),
1508
- defaultValue: this.deserializeNode()
1509
- };
1510
- }, function () {
1511
- return {
1512
- type: 'RecordDeclarationStaticProperty',
1513
- loc: this.addEmptyLoc(),
1514
- key: this.deserializeNode(),
1515
- typeAnnotation: this.deserializeNode(),
1516
- value: this.deserializeNode()
1517
- };
1518
- }, function () {
1519
- return {
1520
- type: 'RecordDeclarationImplements',
1521
- loc: this.addEmptyLoc(),
1522
- id: this.deserializeNode(),
1523
- typeArguments: this.deserializeNode()
1524
- };
1525
- }, function () {
1526
- return {
1527
- type: 'MatchExpressionCase',
1528
- loc: this.addEmptyLoc(),
1529
- pattern: this.deserializeNode(),
1530
- body: this.deserializeNode(),
1531
- guard: this.deserializeNode()
1532
- };
1533
- }, function () {
1534
- return {
1535
- type: 'MatchStatementCase',
1536
- loc: this.addEmptyLoc(),
1537
- pattern: this.deserializeNode(),
1538
- body: this.deserializeNode(),
1539
- guard: this.deserializeNode()
1540
- };
1541
- }, function () {
1542
- return {
1543
- type: 'MatchWildcardPattern',
1544
- loc: this.addEmptyLoc()
1545
- };
1546
- }, function () {
1547
- return {
1548
- type: 'MatchLiteralPattern',
1549
- loc: this.addEmptyLoc(),
1550
- literal: this.deserializeNode()
1551
- };
1552
- }, function () {
1553
- return {
1554
- type: 'MatchUnaryPattern',
1555
- loc: this.addEmptyLoc(),
1556
- operator: this.deserializeString(),
1557
- argument: this.deserializeNode()
1558
- };
1559
- }, function () {
1560
- return {
1561
- type: 'MatchObjectPattern',
1562
- loc: this.addEmptyLoc(),
1563
- properties: this.deserializeNodeList(),
1564
- rest: this.deserializeNode()
1565
- };
1566
- }, function () {
1567
- return {
1568
- type: 'MatchInstancePattern',
1569
- loc: this.addEmptyLoc(),
1570
- targetConstructor: this.deserializeNode(),
1571
- properties: this.deserializeNode()
1572
- };
1573
- }, function () {
1574
- return {
1575
- type: 'MatchInstanceObjectPattern',
1576
- loc: this.addEmptyLoc(),
1577
- properties: this.deserializeNodeList(),
1578
- rest: this.deserializeNode()
1579
- };
1580
- }, function () {
1581
- return {
1582
- type: 'MatchOrPattern',
1583
- loc: this.addEmptyLoc(),
1584
- patterns: this.deserializeNodeList()
1585
- };
1586
- }, function () {
1587
- return {
1588
- type: 'MatchAsPattern',
1589
- loc: this.addEmptyLoc(),
1590
- pattern: this.deserializeNode(),
1591
- target: this.deserializeNode()
1592
- };
1593
- }, function () {
1594
- return {
1595
- type: 'MatchIdentifierPattern',
1596
- loc: this.addEmptyLoc(),
1597
- id: this.deserializeNode()
1598
- };
1599
- }, function () {
1600
- return {
1601
- type: 'MatchMemberPattern',
1602
- loc: this.addEmptyLoc(),
1603
- base: this.deserializeNode(),
1604
- property: this.deserializeNode()
1605
- };
1606
- }, function () {
1607
- return {
1608
- type: 'MatchBindingPattern',
1609
- loc: this.addEmptyLoc(),
1610
- id: this.deserializeNode(),
1611
- kind: this.deserializeString()
1612
- };
1613
- }, function () {
1614
- return {
1615
- type: 'MatchArrayPattern',
1616
- loc: this.addEmptyLoc(),
1617
- elements: this.deserializeNodeList(),
1618
- rest: this.deserializeNode()
1619
- };
1620
- }, function () {
1621
- return {
1622
- type: 'MatchObjectPatternProperty',
1623
- loc: this.addEmptyLoc(),
1624
- key: this.deserializeNode(),
1625
- pattern: this.deserializeNode(),
1626
- shorthand: this.deserializeBoolean()
1627
- };
1628
- }, function () {
1629
- return {
1630
- type: 'MatchRestPattern',
1631
- loc: this.addEmptyLoc(),
1632
- argument: this.deserializeNode()
1633
- };
1634
- }, function () {
1635
- return {
1636
- type: 'Program',
1637
- loc: this.addEmptyLoc(),
1638
- body: this.deserializeNodeList()
1639
- };
1640
- }, function () {
1641
- return {
1642
- type: 'InterpreterDirective',
1643
- loc: this.addEmptyLoc(),
1644
- value: this.deserializeString()
1645
- };
1646
- }, function () {
1647
- return {
1648
- type: 'FunctionTypeAnnotation',
1649
- loc: this.addEmptyLoc(),
1650
- params: this.deserializeNodeList(),
1651
- this: this.deserializeNode(),
1652
- returnType: this.deserializeNode(),
1653
- rest: this.deserializeNode(),
1654
- typeParameters: this.deserializeNode()
1655
- };
1656
- }, function () {
1657
- return {
1658
- type: 'RendersType',
1659
- loc: this.addEmptyLoc(),
1660
- argument: this.deserializeNode()
1661
- };
1662
- }, function () {
1663
- return {
1664
- type: 'RendersMaybeType',
1665
- loc: this.addEmptyLoc(),
1666
- argument: this.deserializeNode()
1667
- };
1668
- }, function () {
1669
- return {
1670
- type: 'RendersStarType',
1671
- loc: this.addEmptyLoc(),
1672
- argument: this.deserializeNode()
1673
- };
1674
- }, function () {
1675
- return {
1676
- type: 'TemplateLiteralTypeAnnotation',
1677
- loc: this.addEmptyLoc(),
1678
- quasis: this.deserializeNodeList(),
1679
- types: this.deserializeNodeList()
1680
- };
1681
- }, function () {
1682
- return {
1683
- type: 'NamespaceExportDeclaration',
1684
- loc: this.addEmptyLoc(),
1685
- id: this.deserializeNode()
1686
- };
1687
- }, function () {
1688
- return {
1689
- type: 'DeclareClassExtendsCall',
1690
- loc: this.addEmptyLoc(),
1691
- callee: this.deserializeNode(),
1692
- argument: this.deserializeNode()
1693
- };
1694
- }, function () {
1695
- return {
1696
- type: 'OpaqueType',
1697
- loc: this.addEmptyLoc(),
1698
- id: this.deserializeNode(),
1699
- typeParameters: this.deserializeNode(),
1700
- impltype: this.deserializeNode(),
1701
- lowerBound: this.deserializeNode(),
1702
- upperBound: this.deserializeNode(),
1703
- supertype: this.deserializeNode()
1704
- };
1705
- }, function () {
1706
- return {
1707
- type: 'DeclareOpaqueType',
1708
- loc: this.addEmptyLoc(),
1709
- id: this.deserializeNode(),
1710
- typeParameters: this.deserializeNode(),
1711
- impltype: this.deserializeNode(),
1712
- lowerBound: this.deserializeNode(),
1713
- upperBound: this.deserializeNode(),
1714
- supertype: this.deserializeNode(),
1715
- implicitDeclare: this.deserializeBoolean()
1716
- };
1717
- }, function () {
1718
- return {
1719
- type: 'EnumBody',
1720
- loc: this.addEmptyLoc(),
1721
- members: this.deserializeNodeList(),
1722
- explicitType: this.deserializeString(),
1723
- hasUnknownMembers: this.deserializeBoolean()
1724
- };
1725
- }, function () {
1726
- return {
1727
- type: 'HookTypeAnnotation',
1728
- loc: this.addEmptyLoc(),
1729
- params: this.deserializeNodeList(),
1730
- returnType: this.deserializeNode(),
1731
- rest: this.deserializeNode(),
1732
- typeParameters: this.deserializeNode()
1733
- };
1734
- }, function () {
1735
- return {
1736
- type: 'ConstructorTypeAnnotation',
1737
- loc: this.addEmptyLoc(),
1738
- abstract: this.deserializeBoolean(),
1739
- params: this.deserializeNodeList(),
1740
- returnType: this.deserializeNode(),
1741
- rest: this.deserializeNode(),
1742
- typeParameters: this.deserializeNode()
1743
- };
1744
- }, function () {
1745
- return {
1746
- type: 'ObjectTypePrivateField',
1747
- loc: this.addEmptyLoc(),
1748
- key: this.deserializeNode()
1749
- };
1750
- }, function () {
1751
- return {
1752
- type: 'TupleTypeElement',
1753
- loc: this.addEmptyLoc(),
1754
- elementType: this.deserializeNode(),
1755
- optional: this.deserializeBoolean()
1756
- };
1757
- }, function () {
1758
- return {
1759
- type: 'DeclareComponent',
1760
- loc: this.addEmptyLoc(),
1761
- body: this.deserializeNode(),
1762
- id: this.deserializeNode(),
1763
- implicitDeclare: this.deserializeBoolean(),
1764
- params: this.deserializeNodeList(),
1765
- rest: this.deserializeNode(),
1766
- rendersType: this.deserializeNode(),
1767
- typeParameters: this.deserializeNode(),
1768
- async: this.deserializeBoolean()
1769
- };
1770
- }, function () {
1771
- return {
1772
- type: 'ThisTypeAnnotation',
1773
- loc: this.addEmptyLoc()
1774
- };
1775
- }, function () {
1776
- return {
1777
- type: 'ChainExpression',
1778
- loc: this.addEmptyLoc(),
1779
- expression: this.deserializeNode()
1780
- };
1781
- }];