brumate 0.0.0-stage → 0.0.1

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 (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -2
  3. package/dist/cli.d.ts +1 -0
  4. package/dist/cli.js +68 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/client-DuDTDePF.d.ts +190 -0
  7. package/dist/context-BG8KCF3v.js +15 -0
  8. package/dist/context-BG8KCF3v.js.map +1 -0
  9. package/dist/context-aeo9esY9.d.ts +16 -0
  10. package/dist/cookies-rgIAc8IE.js +165 -0
  11. package/dist/cookies-rgIAc8IE.js.map +1 -0
  12. package/dist/devtools-Bm8cS7hX.js +108 -0
  13. package/dist/devtools-Bm8cS7hX.js.map +1 -0
  14. package/dist/devtools-panel-CTbDSBBA.js +437 -0
  15. package/dist/devtools-panel-CTbDSBBA.js.map +1 -0
  16. package/dist/files-D_JUcSU5.js +158 -0
  17. package/dist/files-D_JUcSU5.js.map +1 -0
  18. package/dist/html-CxWpXngy.js +115 -0
  19. package/dist/html-CxWpXngy.js.map +1 -0
  20. package/dist/html-DV-Tezgq.d.ts +41 -0
  21. package/dist/index.d.ts +2031 -0
  22. package/dist/index.js +691 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/inspect-CGCWfaEx.js +6346 -0
  25. package/dist/inspect-CGCWfaEx.js.map +1 -0
  26. package/dist/loader-BUhNqDHw.d.ts +30 -0
  27. package/dist/loader-py4qu6tQ.js +215 -0
  28. package/dist/loader-py4qu6tQ.js.map +1 -0
  29. package/dist/navigate-C5dP89YL.js +369 -0
  30. package/dist/navigate-C5dP89YL.js.map +1 -0
  31. package/dist/produce-BRGHP7e0.js +126 -0
  32. package/dist/produce-BRGHP7e0.js.map +1 -0
  33. package/dist/produce-BjQGMpqL.d.ts +50 -0
  34. package/dist/rpc-B86KKjzx.js +83 -0
  35. package/dist/rpc-B86KKjzx.js.map +1 -0
  36. package/dist/runtime/client.d.ts +5 -0
  37. package/dist/runtime/client.js +1052 -0
  38. package/dist/runtime/client.js.map +1 -0
  39. package/dist/runtime/context.d.ts +2 -0
  40. package/dist/runtime/context.js +1 -0
  41. package/dist/runtime/devtools.d.ts +34 -0
  42. package/dist/runtime/devtools.js +1 -0
  43. package/dist/runtime/hot.d.ts +36 -0
  44. package/dist/runtime/hot.js +40 -0
  45. package/dist/runtime/hot.js.map +1 -0
  46. package/dist/runtime/html.d.ts +2 -0
  47. package/dist/runtime/html.js +1 -0
  48. package/dist/runtime/loader.d.ts +2 -0
  49. package/dist/runtime/loader.js +1 -0
  50. package/dist/runtime/routes.d.ts +21 -0
  51. package/dist/runtime/routes.js +18 -0
  52. package/dist/runtime/routes.js.map +1 -0
  53. package/dist/runtime/server.d.ts +5 -0
  54. package/dist/runtime/server.js +7 -0
  55. package/dist/runtime/signals.d.ts +46 -0
  56. package/dist/runtime/signals.js +74 -0
  57. package/dist/runtime/signals.js.map +1 -0
  58. package/dist/runtime/testing.d.ts +36 -0
  59. package/dist/runtime/testing.js +96 -0
  60. package/dist/runtime/testing.js.map +1 -0
  61. package/dist/server-CX3JnPCs.js +1205 -0
  62. package/dist/server-CX3JnPCs.js.map +1 -0
  63. package/dist/server-sQCvduOz.d.ts +562 -0
  64. package/dist/shared-BE_oBSDM.js +176 -0
  65. package/dist/shared-BE_oBSDM.js.map +1 -0
  66. package/dist/stream-cvhqOzfs.js +145 -0
  67. package/dist/stream-cvhqOzfs.js.map +1 -0
  68. package/dist/vite.d.ts +121 -0
  69. package/dist/vite.js +958 -0
  70. package/dist/vite.js.map +1 -0
  71. package/package.json +117 -3
  72. package/types.d.ts +36 -0
@@ -0,0 +1,2031 @@
1
+ //#region ../../node_modules/.pnpm/@oxc-project+types@0.154.0/node_modules/@oxc-project/types/types.d.ts
2
+ // Auto-generated code, DO NOT EDIT DIRECTLY!
3
+ // To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`.
4
+ interface Program extends Span {
5
+ type: "Program";
6
+ body: Array<Directive | Statement>;
7
+ sourceType: ModuleKind;
8
+ hashbang: Hashbang | null;
9
+ parent?: null;
10
+ }
11
+ type Expression$1 = BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | MetaProperty | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | V8IntrinsicExpression | MemberExpression;
12
+ interface IdentifierName extends Span {
13
+ type: "Identifier";
14
+ decorators?: [];
15
+ name: string;
16
+ optional?: false;
17
+ typeAnnotation?: null;
18
+ parent?: Node;
19
+ }
20
+ interface IdentifierReference extends Span {
21
+ type: "Identifier";
22
+ decorators?: [];
23
+ name: string;
24
+ optional?: false;
25
+ typeAnnotation?: null;
26
+ parent?: Node;
27
+ }
28
+ interface BindingIdentifier extends Span {
29
+ type: "Identifier";
30
+ decorators?: [];
31
+ name: string;
32
+ optional?: false;
33
+ typeAnnotation?: TSTypeAnnotation | null;
34
+ parent?: Node;
35
+ }
36
+ interface LabelIdentifier extends Span {
37
+ type: "Identifier";
38
+ decorators?: [];
39
+ name: string;
40
+ optional?: false;
41
+ typeAnnotation?: null;
42
+ parent?: Node;
43
+ }
44
+ interface ThisExpression extends Span {
45
+ type: "ThisExpression";
46
+ parent?: Node;
47
+ }
48
+ interface ArrayExpression extends Span {
49
+ type: "ArrayExpression";
50
+ elements: Array<ArrayExpressionElement>;
51
+ parent?: Node;
52
+ }
53
+ type ArrayExpressionElement = SpreadElement | null | Expression$1;
54
+ interface ObjectExpression extends Span {
55
+ type: "ObjectExpression";
56
+ properties: Array<ObjectPropertyKind>;
57
+ parent?: Node;
58
+ }
59
+ type ObjectPropertyKind = ObjectProperty | SpreadElement;
60
+ interface ObjectProperty extends Span {
61
+ type: "Property";
62
+ kind: PropertyKind;
63
+ key: PropertyKey;
64
+ value: Expression$1;
65
+ method: boolean;
66
+ shorthand: boolean;
67
+ computed: boolean;
68
+ optional?: false;
69
+ parent?: Node;
70
+ }
71
+ type PropertyKey = IdentifierName | PrivateIdentifier | Expression$1;
72
+ type PropertyKind = "init" | "get" | "set";
73
+ interface TemplateLiteral extends Span {
74
+ type: "TemplateLiteral";
75
+ quasis: Array<TemplateElement>;
76
+ expressions: Array<Expression$1>;
77
+ parent?: Node;
78
+ }
79
+ interface TaggedTemplateExpression extends Span {
80
+ type: "TaggedTemplateExpression";
81
+ tag: Expression$1;
82
+ typeArguments?: TSTypeParameterInstantiation | null;
83
+ quasi: TemplateLiteral;
84
+ parent?: Node;
85
+ }
86
+ interface TemplateElement extends Span {
87
+ type: "TemplateElement";
88
+ value: TemplateElementValue;
89
+ tail: boolean;
90
+ parent?: Node;
91
+ }
92
+ interface TemplateElementValue {
93
+ raw: string;
94
+ cooked: string | null;
95
+ }
96
+ type MemberExpression = ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;
97
+ interface ComputedMemberExpression extends Span {
98
+ type: "MemberExpression";
99
+ object: Expression$1;
100
+ property: Expression$1;
101
+ optional: boolean;
102
+ computed: true;
103
+ parent?: Node;
104
+ }
105
+ interface StaticMemberExpression extends Span {
106
+ type: "MemberExpression";
107
+ object: Expression$1;
108
+ property: IdentifierName;
109
+ optional: boolean;
110
+ computed: false;
111
+ parent?: Node;
112
+ }
113
+ interface PrivateFieldExpression extends Span {
114
+ type: "MemberExpression";
115
+ object: Expression$1;
116
+ property: PrivateIdentifier;
117
+ optional: boolean;
118
+ computed: false;
119
+ parent?: Node;
120
+ }
121
+ interface CallExpression extends Span {
122
+ type: "CallExpression";
123
+ callee: Expression$1;
124
+ typeArguments?: TSTypeParameterInstantiation | null;
125
+ arguments: Array<Argument>;
126
+ optional: boolean;
127
+ parent?: Node;
128
+ }
129
+ interface NewExpression extends Span {
130
+ type: "NewExpression";
131
+ callee: Expression$1;
132
+ typeArguments?: TSTypeParameterInstantiation | null;
133
+ arguments: Array<Argument>;
134
+ parent?: Node;
135
+ }
136
+ interface MetaProperty extends Span {
137
+ type: "MetaProperty";
138
+ meta: IdentifierName;
139
+ property: IdentifierName;
140
+ parent?: Node;
141
+ }
142
+ interface SpreadElement extends Span {
143
+ type: "SpreadElement";
144
+ argument: Expression$1;
145
+ parent?: Node;
146
+ }
147
+ type Argument = SpreadElement | Expression$1;
148
+ interface UpdateExpression extends Span {
149
+ type: "UpdateExpression";
150
+ operator: UpdateOperator;
151
+ prefix: boolean;
152
+ argument: SimpleAssignmentTarget;
153
+ parent?: Node;
154
+ }
155
+ interface UnaryExpression extends Span {
156
+ type: "UnaryExpression";
157
+ operator: UnaryOperator;
158
+ argument: Expression$1;
159
+ prefix: true;
160
+ parent?: Node;
161
+ }
162
+ interface BinaryExpression extends Span {
163
+ type: "BinaryExpression";
164
+ left: Expression$1;
165
+ operator: BinaryOperator;
166
+ right: Expression$1;
167
+ parent?: Node;
168
+ }
169
+ interface PrivateInExpression extends Span {
170
+ type: "BinaryExpression";
171
+ left: PrivateIdentifier;
172
+ operator: "in";
173
+ right: Expression$1;
174
+ parent?: Node;
175
+ }
176
+ interface LogicalExpression extends Span {
177
+ type: "LogicalExpression";
178
+ left: Expression$1;
179
+ operator: LogicalOperator;
180
+ right: Expression$1;
181
+ parent?: Node;
182
+ }
183
+ interface ConditionalExpression extends Span {
184
+ type: "ConditionalExpression";
185
+ test: Expression$1;
186
+ consequent: Expression$1;
187
+ alternate: Expression$1;
188
+ parent?: Node;
189
+ }
190
+ interface AssignmentExpression extends Span {
191
+ type: "AssignmentExpression";
192
+ operator: AssignmentOperator;
193
+ left: AssignmentTarget;
194
+ right: Expression$1;
195
+ parent?: Node;
196
+ }
197
+ type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern;
198
+ type SimpleAssignmentTarget = IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | MemberExpression;
199
+ type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget;
200
+ interface ArrayAssignmentTarget extends Span {
201
+ type: "ArrayPattern";
202
+ decorators?: [];
203
+ elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
204
+ optional?: false;
205
+ typeAnnotation?: null;
206
+ parent?: Node;
207
+ }
208
+ interface ObjectAssignmentTarget extends Span {
209
+ type: "ObjectPattern";
210
+ decorators?: [];
211
+ properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
212
+ optional?: false;
213
+ typeAnnotation?: null;
214
+ parent?: Node;
215
+ }
216
+ interface AssignmentTargetRest extends Span {
217
+ type: "RestElement";
218
+ decorators?: [];
219
+ argument: AssignmentTarget;
220
+ optional?: false;
221
+ typeAnnotation?: null;
222
+ value?: null;
223
+ parent?: Node;
224
+ }
225
+ type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget;
226
+ interface AssignmentTargetWithDefault extends Span {
227
+ type: "AssignmentPattern";
228
+ decorators?: [];
229
+ left: AssignmentTarget;
230
+ right: Expression$1;
231
+ optional?: false;
232
+ typeAnnotation?: null;
233
+ parent?: Node;
234
+ }
235
+ type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty;
236
+ interface AssignmentTargetPropertyIdentifier extends Span {
237
+ type: "Property";
238
+ kind: "init";
239
+ key: IdentifierReference;
240
+ value: IdentifierReference | AssignmentTargetWithDefault;
241
+ method: false;
242
+ shorthand: true;
243
+ computed: false;
244
+ optional?: false;
245
+ parent?: Node;
246
+ }
247
+ interface AssignmentTargetPropertyProperty extends Span {
248
+ type: "Property";
249
+ kind: "init";
250
+ key: PropertyKey;
251
+ value: AssignmentTargetMaybeDefault;
252
+ method: false;
253
+ shorthand: false;
254
+ computed: boolean;
255
+ optional?: false;
256
+ parent?: Node;
257
+ }
258
+ interface SequenceExpression extends Span {
259
+ type: "SequenceExpression";
260
+ expressions: Array<Expression$1>;
261
+ parent?: Node;
262
+ }
263
+ interface Super extends Span {
264
+ type: "Super";
265
+ parent?: Node;
266
+ }
267
+ interface AwaitExpression extends Span {
268
+ type: "AwaitExpression";
269
+ argument: Expression$1;
270
+ parent?: Node;
271
+ }
272
+ interface ChainExpression extends Span {
273
+ type: "ChainExpression";
274
+ expression: ChainElement;
275
+ parent?: Node;
276
+ }
277
+ type ChainElement = CallExpression | TSNonNullExpression | MemberExpression;
278
+ interface ParenthesizedExpression extends Span {
279
+ type: "ParenthesizedExpression";
280
+ expression: Expression$1;
281
+ parent?: Node;
282
+ }
283
+ type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | WithStatement | Declaration$1 | ModuleDeclaration;
284
+ interface Directive extends Span {
285
+ type: "ExpressionStatement";
286
+ expression: StringLiteral;
287
+ directive: string;
288
+ parent?: Node;
289
+ }
290
+ interface Hashbang extends Span {
291
+ type: "Hashbang";
292
+ value: string;
293
+ parent?: Node;
294
+ }
295
+ interface BlockStatement extends Span {
296
+ type: "BlockStatement";
297
+ body: Array<Statement>;
298
+ parent?: Node;
299
+ }
300
+ type Declaration$1 = VariableDeclaration | Function | Class | TSTypeAliasDeclaration | TSInterfaceDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSGlobalDeclaration | TSImportEqualsDeclaration;
301
+ interface VariableDeclaration extends Span {
302
+ type: "VariableDeclaration";
303
+ kind: VariableDeclarationKind;
304
+ declarations: Array<VariableDeclarator>;
305
+ declare?: boolean;
306
+ parent?: Node;
307
+ }
308
+ type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using";
309
+ interface VariableDeclarator extends Span {
310
+ type: "VariableDeclarator";
311
+ id: BindingPattern;
312
+ init: Expression$1 | null;
313
+ definite?: boolean;
314
+ parent?: Node;
315
+ }
316
+ interface EmptyStatement extends Span {
317
+ type: "EmptyStatement";
318
+ parent?: Node;
319
+ }
320
+ interface ExpressionStatement extends Span {
321
+ type: "ExpressionStatement";
322
+ expression: Expression$1;
323
+ directive?: string | null;
324
+ parent?: Node;
325
+ }
326
+ interface IfStatement extends Span {
327
+ type: "IfStatement";
328
+ test: Expression$1;
329
+ consequent: Statement;
330
+ alternate: Statement | null;
331
+ parent?: Node;
332
+ }
333
+ interface DoWhileStatement extends Span {
334
+ type: "DoWhileStatement";
335
+ body: Statement;
336
+ test: Expression$1;
337
+ parent?: Node;
338
+ }
339
+ interface WhileStatement extends Span {
340
+ type: "WhileStatement";
341
+ test: Expression$1;
342
+ body: Statement;
343
+ parent?: Node;
344
+ }
345
+ interface ForStatement extends Span {
346
+ type: "ForStatement";
347
+ init: ForStatementInit | null;
348
+ test: Expression$1 | null;
349
+ update: Expression$1 | null;
350
+ body: Statement;
351
+ parent?: Node;
352
+ }
353
+ type ForStatementInit = VariableDeclaration | Expression$1;
354
+ interface ForInStatement extends Span {
355
+ type: "ForInStatement";
356
+ left: ForStatementLeft;
357
+ right: Expression$1;
358
+ body: Statement;
359
+ parent?: Node;
360
+ }
361
+ type ForStatementLeft = VariableDeclaration | AssignmentTarget;
362
+ interface ForOfStatement extends Span {
363
+ type: "ForOfStatement";
364
+ await: boolean;
365
+ left: ForStatementLeft;
366
+ right: Expression$1;
367
+ body: Statement;
368
+ parent?: Node;
369
+ }
370
+ interface ContinueStatement extends Span {
371
+ type: "ContinueStatement";
372
+ label: LabelIdentifier | null;
373
+ parent?: Node;
374
+ }
375
+ interface BreakStatement extends Span {
376
+ type: "BreakStatement";
377
+ label: LabelIdentifier | null;
378
+ parent?: Node;
379
+ }
380
+ interface ReturnStatement extends Span {
381
+ type: "ReturnStatement";
382
+ argument: Expression$1 | null;
383
+ parent?: Node;
384
+ }
385
+ interface WithStatement extends Span {
386
+ type: "WithStatement";
387
+ object: Expression$1;
388
+ body: Statement;
389
+ parent?: Node;
390
+ }
391
+ interface SwitchStatement extends Span {
392
+ type: "SwitchStatement";
393
+ discriminant: Expression$1;
394
+ cases: Array<SwitchCase>;
395
+ parent?: Node;
396
+ }
397
+ interface SwitchCase extends Span {
398
+ type: "SwitchCase";
399
+ test: Expression$1 | null;
400
+ consequent: Array<Statement>;
401
+ parent?: Node;
402
+ }
403
+ interface LabeledStatement extends Span {
404
+ type: "LabeledStatement";
405
+ label: LabelIdentifier;
406
+ body: Statement;
407
+ parent?: Node;
408
+ }
409
+ interface ThrowStatement extends Span {
410
+ type: "ThrowStatement";
411
+ argument: Expression$1;
412
+ parent?: Node;
413
+ }
414
+ interface TryStatement extends Span {
415
+ type: "TryStatement";
416
+ block: BlockStatement;
417
+ handler: CatchClause | null;
418
+ finalizer: BlockStatement | null;
419
+ parent?: Node;
420
+ }
421
+ interface CatchClause extends Span {
422
+ type: "CatchClause";
423
+ param: BindingPattern | null;
424
+ body: BlockStatement;
425
+ parent?: Node;
426
+ }
427
+ interface DebuggerStatement extends Span {
428
+ type: "DebuggerStatement";
429
+ parent?: Node;
430
+ }
431
+ type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;
432
+ interface AssignmentPattern extends Span {
433
+ type: "AssignmentPattern";
434
+ decorators?: [];
435
+ left: BindingPattern;
436
+ right: Expression$1;
437
+ optional?: false;
438
+ typeAnnotation?: null;
439
+ parent?: Node;
440
+ }
441
+ interface ObjectPattern extends Span {
442
+ type: "ObjectPattern";
443
+ decorators?: [];
444
+ properties: Array<BindingProperty | BindingRestElement>;
445
+ optional?: false;
446
+ typeAnnotation?: TSTypeAnnotation | null;
447
+ parent?: Node;
448
+ }
449
+ interface BindingProperty extends Span {
450
+ type: "Property";
451
+ kind: "init";
452
+ key: PropertyKey;
453
+ value: BindingPattern;
454
+ method: false;
455
+ shorthand: boolean;
456
+ computed: boolean;
457
+ optional?: false;
458
+ parent?: Node;
459
+ }
460
+ interface ArrayPattern extends Span {
461
+ type: "ArrayPattern";
462
+ decorators?: [];
463
+ elements: Array<BindingPattern | BindingRestElement | null>;
464
+ optional?: false;
465
+ typeAnnotation?: TSTypeAnnotation | null;
466
+ parent?: Node;
467
+ }
468
+ interface BindingRestElement extends Span {
469
+ type: "RestElement";
470
+ decorators?: [];
471
+ argument: BindingPattern;
472
+ optional?: false;
473
+ typeAnnotation?: TSTypeAnnotation | null;
474
+ value?: null;
475
+ parent?: Node;
476
+ }
477
+ interface Function extends Span {
478
+ type: FunctionType;
479
+ id: BindingIdentifier | null;
480
+ generator: boolean;
481
+ async: boolean;
482
+ declare?: boolean;
483
+ typeParameters?: TSTypeParameterDeclaration | null;
484
+ params: ParamPattern[];
485
+ returnType?: TSTypeAnnotation | null;
486
+ body: FunctionBody | null;
487
+ expression: false;
488
+ parent?: Node;
489
+ }
490
+ type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest;
491
+ type FunctionType = "FunctionDeclaration" | "FunctionExpression" | "TSDeclareFunction" | "TSEmptyBodyFunctionExpression";
492
+ interface FormalParameterRest extends Span {
493
+ type: "RestElement";
494
+ argument: BindingPattern;
495
+ decorators?: Array<Decorator>;
496
+ optional?: boolean;
497
+ typeAnnotation?: TSTypeAnnotation | null;
498
+ value?: null;
499
+ parent?: Node;
500
+ }
501
+ type FormalParameter = {
502
+ decorators?: Array<Decorator>;
503
+ } & BindingPattern;
504
+ interface TSParameterProperty extends Span {
505
+ type: "TSParameterProperty";
506
+ accessibility: TSAccessibility | null;
507
+ decorators: Array<Decorator>;
508
+ override: boolean;
509
+ parameter: FormalParameter;
510
+ readonly: boolean;
511
+ static: boolean;
512
+ parent?: Node;
513
+ }
514
+ interface FunctionBody extends Span {
515
+ type: "BlockStatement";
516
+ body: Array<Directive | Statement>;
517
+ parent?: Node;
518
+ }
519
+ interface ArrowFunctionExpression extends Span {
520
+ type: "ArrowFunctionExpression";
521
+ expression: boolean;
522
+ async: boolean;
523
+ typeParameters?: TSTypeParameterDeclaration | null;
524
+ params: ParamPattern[];
525
+ returnType?: TSTypeAnnotation | null;
526
+ body: FunctionBody | Expression$1;
527
+ id: null;
528
+ generator: false;
529
+ parent?: Node;
530
+ }
531
+ interface YieldExpression extends Span {
532
+ type: "YieldExpression";
533
+ delegate: boolean;
534
+ argument: Expression$1 | null;
535
+ parent?: Node;
536
+ }
537
+ interface Class extends Span {
538
+ type: ClassType;
539
+ decorators: Array<Decorator>;
540
+ id: BindingIdentifier | null;
541
+ typeParameters?: TSTypeParameterDeclaration | null;
542
+ superClass: Expression$1 | null;
543
+ superTypeArguments?: TSTypeParameterInstantiation | null;
544
+ implements?: Array<TSClassImplements>;
545
+ body: ClassBody;
546
+ abstract?: boolean;
547
+ declare?: boolean;
548
+ parent?: Node;
549
+ }
550
+ type ClassType = "ClassDeclaration" | "ClassExpression";
551
+ interface ClassBody extends Span {
552
+ type: "ClassBody";
553
+ body: Array<ClassElement>;
554
+ parent?: Node;
555
+ }
556
+ type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition | AccessorProperty | TSIndexSignature;
557
+ interface MethodDefinition extends Span {
558
+ type: MethodDefinitionType;
559
+ decorators: Array<Decorator>;
560
+ key: PropertyKey;
561
+ value: Function;
562
+ kind: MethodDefinitionKind;
563
+ computed: boolean;
564
+ static: boolean;
565
+ override?: boolean;
566
+ optional?: boolean;
567
+ accessibility?: TSAccessibility | null;
568
+ parent?: Node;
569
+ }
570
+ type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition";
571
+ interface PropertyDefinition extends Span {
572
+ type: PropertyDefinitionType;
573
+ decorators: Array<Decorator>;
574
+ key: PropertyKey;
575
+ typeAnnotation?: TSTypeAnnotation | null;
576
+ value: Expression$1 | null;
577
+ computed: boolean;
578
+ static: boolean;
579
+ declare?: boolean;
580
+ override?: boolean;
581
+ optional?: boolean;
582
+ definite?: boolean;
583
+ readonly?: boolean;
584
+ accessibility?: TSAccessibility | null;
585
+ parent?: Node;
586
+ }
587
+ type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition";
588
+ type MethodDefinitionKind = "constructor" | "method" | "get" | "set";
589
+ interface PrivateIdentifier extends Span {
590
+ type: "PrivateIdentifier";
591
+ name: string;
592
+ parent?: Node;
593
+ }
594
+ interface StaticBlock extends Span {
595
+ type: "StaticBlock";
596
+ body: Array<Statement>;
597
+ parent?: Node;
598
+ }
599
+ type ModuleDeclaration = ImportDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;
600
+ type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty";
601
+ interface AccessorProperty extends Span {
602
+ type: AccessorPropertyType;
603
+ decorators: Array<Decorator>;
604
+ key: PropertyKey;
605
+ typeAnnotation?: TSTypeAnnotation | null;
606
+ value: Expression$1 | null;
607
+ computed: boolean;
608
+ static: boolean;
609
+ override?: boolean;
610
+ definite?: boolean;
611
+ accessibility?: TSAccessibility | null;
612
+ declare?: false;
613
+ optional?: false;
614
+ readonly?: false;
615
+ parent?: Node;
616
+ }
617
+ interface ImportExpression extends Span {
618
+ type: "ImportExpression";
619
+ source: Expression$1;
620
+ options: Expression$1 | null;
621
+ phase: ImportPhase | null;
622
+ parent?: Node;
623
+ }
624
+ interface ImportDeclaration extends Span {
625
+ type: "ImportDeclaration";
626
+ specifiers: Array<ImportDeclarationSpecifier>;
627
+ source: StringLiteral;
628
+ phase: ImportPhase | null;
629
+ attributes: Array<ImportAttribute>;
630
+ importKind?: ImportOrExportKind;
631
+ parent?: Node;
632
+ }
633
+ type ImportPhase = "source" | "defer";
634
+ type ImportDeclarationSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
635
+ interface ImportSpecifier extends Span {
636
+ type: "ImportSpecifier";
637
+ imported: ModuleExportName;
638
+ local: BindingIdentifier;
639
+ importKind?: ImportOrExportKind;
640
+ parent?: Node;
641
+ }
642
+ interface ImportDefaultSpecifier extends Span {
643
+ type: "ImportDefaultSpecifier";
644
+ local: BindingIdentifier;
645
+ parent?: Node;
646
+ }
647
+ interface ImportNamespaceSpecifier extends Span {
648
+ type: "ImportNamespaceSpecifier";
649
+ local: BindingIdentifier;
650
+ parent?: Node;
651
+ }
652
+ interface ImportAttribute extends Span {
653
+ type: "ImportAttribute";
654
+ key: ImportAttributeKey;
655
+ value: StringLiteral;
656
+ parent?: Node;
657
+ }
658
+ type ImportAttributeKey = IdentifierName | StringLiteral;
659
+ interface ExportNamedDeclaration extends Span {
660
+ type: "ExportNamedDeclaration";
661
+ declaration: Declaration$1 | null;
662
+ specifiers: Array<ExportSpecifier>;
663
+ source: StringLiteral | null;
664
+ exportKind?: ImportOrExportKind;
665
+ attributes: Array<ImportAttribute>;
666
+ parent?: Node;
667
+ }
668
+ interface ExportDefaultDeclaration extends Span {
669
+ type: "ExportDefaultDeclaration";
670
+ declaration: ExportDefaultDeclarationKind;
671
+ exportKind?: "value";
672
+ parent?: Node;
673
+ }
674
+ interface ExportAllDeclaration extends Span {
675
+ type: "ExportAllDeclaration";
676
+ exported: ModuleExportName | null;
677
+ source: StringLiteral;
678
+ attributes: Array<ImportAttribute>;
679
+ exportKind?: ImportOrExportKind;
680
+ parent?: Node;
681
+ }
682
+ interface ExportSpecifier extends Span {
683
+ type: "ExportSpecifier";
684
+ local: ModuleExportName;
685
+ exported: ModuleExportName;
686
+ exportKind?: ImportOrExportKind;
687
+ parent?: Node;
688
+ }
689
+ type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression$1;
690
+ type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;
691
+ interface V8IntrinsicExpression extends Span {
692
+ type: "V8IntrinsicExpression";
693
+ name: IdentifierName;
694
+ arguments: Array<Argument>;
695
+ parent?: Node;
696
+ }
697
+ interface BooleanLiteral extends Span {
698
+ type: "Literal";
699
+ value: boolean;
700
+ raw: string | null;
701
+ parent?: Node;
702
+ }
703
+ interface NullLiteral extends Span {
704
+ type: "Literal";
705
+ value: null;
706
+ raw: "null" | null;
707
+ parent?: Node;
708
+ }
709
+ interface NumericLiteral extends Span {
710
+ type: "Literal";
711
+ value: number;
712
+ raw: string | null;
713
+ parent?: Node;
714
+ }
715
+ interface StringLiteral extends Span {
716
+ type: "Literal";
717
+ value: string;
718
+ raw: string | null;
719
+ parent?: Node;
720
+ }
721
+ interface BigIntLiteral extends Span {
722
+ type: "Literal";
723
+ value: bigint;
724
+ raw: string | null;
725
+ bigint: string;
726
+ parent?: Node;
727
+ }
728
+ interface RegExpLiteral extends Span {
729
+ type: "Literal";
730
+ value: RegExp | null;
731
+ raw: string | null;
732
+ regex: {
733
+ pattern: string;
734
+ flags: string;
735
+ };
736
+ parent?: Node;
737
+ }
738
+ interface JSXElement extends Span {
739
+ type: "JSXElement";
740
+ openingElement: JSXOpeningElement;
741
+ children: Array<JSXChild>;
742
+ closingElement: JSXClosingElement | null;
743
+ parent?: Node;
744
+ }
745
+ interface JSXOpeningElement extends Span {
746
+ type: "JSXOpeningElement";
747
+ name: JSXElementName;
748
+ typeArguments?: TSTypeParameterInstantiation | null;
749
+ attributes: Array<JSXAttributeItem>;
750
+ selfClosing: boolean;
751
+ parent?: Node;
752
+ }
753
+ interface JSXClosingElement extends Span {
754
+ type: "JSXClosingElement";
755
+ name: JSXElementName;
756
+ parent?: Node;
757
+ }
758
+ interface JSXFragment extends Span {
759
+ type: "JSXFragment";
760
+ openingFragment: JSXOpeningFragment;
761
+ children: Array<JSXChild>;
762
+ closingFragment: JSXClosingFragment;
763
+ parent?: Node;
764
+ }
765
+ interface JSXOpeningFragment extends Span {
766
+ type: "JSXOpeningFragment";
767
+ attributes?: [];
768
+ selfClosing?: false;
769
+ parent?: Node;
770
+ }
771
+ interface JSXClosingFragment extends Span {
772
+ type: "JSXClosingFragment";
773
+ parent?: Node;
774
+ }
775
+ type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
776
+ interface JSXNamespacedName extends Span {
777
+ type: "JSXNamespacedName";
778
+ namespace: JSXIdentifier;
779
+ name: JSXIdentifier;
780
+ parent?: Node;
781
+ }
782
+ interface JSXMemberExpression extends Span {
783
+ type: "JSXMemberExpression";
784
+ object: JSXMemberExpressionObject;
785
+ property: JSXIdentifier;
786
+ parent?: Node;
787
+ }
788
+ type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
789
+ interface JSXExpressionContainer extends Span {
790
+ type: "JSXExpressionContainer";
791
+ expression: JSXExpression;
792
+ parent?: Node;
793
+ }
794
+ type JSXExpression = JSXEmptyExpression | Expression$1;
795
+ interface JSXEmptyExpression extends Span {
796
+ type: "JSXEmptyExpression";
797
+ parent?: Node;
798
+ }
799
+ type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;
800
+ interface JSXAttribute extends Span {
801
+ type: "JSXAttribute";
802
+ name: JSXAttributeName;
803
+ value: JSXAttributeValue | null;
804
+ parent?: Node;
805
+ }
806
+ interface JSXSpreadAttribute extends Span {
807
+ type: "JSXSpreadAttribute";
808
+ argument: Expression$1;
809
+ parent?: Node;
810
+ }
811
+ type JSXAttributeName = JSXIdentifier | JSXNamespacedName;
812
+ type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
813
+ interface JSXIdentifier extends Span {
814
+ type: "JSXIdentifier";
815
+ name: string;
816
+ parent?: Node;
817
+ }
818
+ type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
819
+ interface JSXSpreadChild extends Span {
820
+ type: "JSXSpreadChild";
821
+ expression: Expression$1;
822
+ parent?: Node;
823
+ }
824
+ interface JSXText extends Span {
825
+ type: "JSXText";
826
+ value: string;
827
+ raw: string | null;
828
+ parent?: Node;
829
+ }
830
+ interface TSThisParameter extends Span {
831
+ type: "Identifier";
832
+ decorators: [];
833
+ name: "this";
834
+ optional: false;
835
+ typeAnnotation: TSTypeAnnotation | null;
836
+ parent?: Node;
837
+ }
838
+ interface TSEnumDeclaration extends Span {
839
+ type: "TSEnumDeclaration";
840
+ id: BindingIdentifier;
841
+ body: TSEnumBody;
842
+ const: boolean;
843
+ declare: boolean;
844
+ parent?: Node;
845
+ }
846
+ interface TSEnumBody extends Span {
847
+ type: "TSEnumBody";
848
+ members: Array<TSEnumMember>;
849
+ parent?: Node;
850
+ }
851
+ interface TSEnumMember extends Span {
852
+ type: "TSEnumMember";
853
+ id: TSEnumMemberName;
854
+ initializer: Expression$1 | null;
855
+ computed: boolean;
856
+ parent?: Node;
857
+ }
858
+ type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral;
859
+ interface TSTypeAnnotation extends Span {
860
+ type: "TSTypeAnnotation";
861
+ typeAnnotation: TSType;
862
+ parent?: Node;
863
+ }
864
+ interface TSLiteralType extends Span {
865
+ type: "TSLiteralType";
866
+ literal: TSLiteral;
867
+ parent?: Node;
868
+ }
869
+ type TSLiteral = BooleanLiteral | NumericLiteral | BigIntLiteral | StringLiteral | TemplateLiteral | UnaryExpression;
870
+ type TSType = TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSArrayType | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSLiteralType | TSMappedType | TSNamedTupleMember | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUnionType | TSParenthesizedType | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType;
871
+ interface TSConditionalType extends Span {
872
+ type: "TSConditionalType";
873
+ checkType: TSType;
874
+ extendsType: TSType;
875
+ trueType: TSType;
876
+ falseType: TSType;
877
+ parent?: Node;
878
+ }
879
+ interface TSUnionType extends Span {
880
+ type: "TSUnionType";
881
+ types: Array<TSType>;
882
+ parent?: Node;
883
+ }
884
+ interface TSIntersectionType extends Span {
885
+ type: "TSIntersectionType";
886
+ types: Array<TSType>;
887
+ parent?: Node;
888
+ }
889
+ interface TSParenthesizedType extends Span {
890
+ type: "TSParenthesizedType";
891
+ typeAnnotation: TSType;
892
+ parent?: Node;
893
+ }
894
+ interface TSTypeOperator extends Span {
895
+ type: "TSTypeOperator";
896
+ operator: TSTypeOperatorOperator;
897
+ typeAnnotation: TSType;
898
+ parent?: Node;
899
+ }
900
+ type TSTypeOperatorOperator = "keyof" | "unique" | "readonly";
901
+ interface TSArrayType extends Span {
902
+ type: "TSArrayType";
903
+ elementType: TSType;
904
+ parent?: Node;
905
+ }
906
+ interface TSIndexedAccessType extends Span {
907
+ type: "TSIndexedAccessType";
908
+ objectType: TSType;
909
+ indexType: TSType;
910
+ parent?: Node;
911
+ }
912
+ interface TSTupleType extends Span {
913
+ type: "TSTupleType";
914
+ elementTypes: Array<TSTupleElement>;
915
+ parent?: Node;
916
+ }
917
+ interface TSNamedTupleMember extends Span {
918
+ type: "TSNamedTupleMember";
919
+ label: IdentifierName;
920
+ elementType: TSTupleElement;
921
+ optional: boolean;
922
+ parent?: Node;
923
+ }
924
+ interface TSOptionalType extends Span {
925
+ type: "TSOptionalType";
926
+ typeAnnotation: TSType;
927
+ parent?: Node;
928
+ }
929
+ interface TSRestType extends Span {
930
+ type: "TSRestType";
931
+ typeAnnotation: TSType;
932
+ parent?: Node;
933
+ }
934
+ type TSTupleElement = TSOptionalType | TSRestType | TSType;
935
+ interface TSAnyKeyword extends Span {
936
+ type: "TSAnyKeyword";
937
+ parent?: Node;
938
+ }
939
+ interface TSStringKeyword extends Span {
940
+ type: "TSStringKeyword";
941
+ parent?: Node;
942
+ }
943
+ interface TSBooleanKeyword extends Span {
944
+ type: "TSBooleanKeyword";
945
+ parent?: Node;
946
+ }
947
+ interface TSNumberKeyword extends Span {
948
+ type: "TSNumberKeyword";
949
+ parent?: Node;
950
+ }
951
+ interface TSNeverKeyword extends Span {
952
+ type: "TSNeverKeyword";
953
+ parent?: Node;
954
+ }
955
+ interface TSIntrinsicKeyword extends Span {
956
+ type: "TSIntrinsicKeyword";
957
+ parent?: Node;
958
+ }
959
+ interface TSUnknownKeyword extends Span {
960
+ type: "TSUnknownKeyword";
961
+ parent?: Node;
962
+ }
963
+ interface TSNullKeyword extends Span {
964
+ type: "TSNullKeyword";
965
+ parent?: Node;
966
+ }
967
+ interface TSUndefinedKeyword extends Span {
968
+ type: "TSUndefinedKeyword";
969
+ parent?: Node;
970
+ }
971
+ interface TSVoidKeyword extends Span {
972
+ type: "TSVoidKeyword";
973
+ parent?: Node;
974
+ }
975
+ interface TSSymbolKeyword extends Span {
976
+ type: "TSSymbolKeyword";
977
+ parent?: Node;
978
+ }
979
+ interface TSThisType extends Span {
980
+ type: "TSThisType";
981
+ parent?: Node;
982
+ }
983
+ interface TSObjectKeyword extends Span {
984
+ type: "TSObjectKeyword";
985
+ parent?: Node;
986
+ }
987
+ interface TSBigIntKeyword extends Span {
988
+ type: "TSBigIntKeyword";
989
+ parent?: Node;
990
+ }
991
+ interface TSTypeReference extends Span {
992
+ type: "TSTypeReference";
993
+ typeName: TSTypeName;
994
+ typeArguments: TSTypeParameterInstantiation | null;
995
+ parent?: Node;
996
+ }
997
+ type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression;
998
+ interface TSQualifiedName extends Span {
999
+ type: "TSQualifiedName";
1000
+ left: TSTypeName;
1001
+ right: IdentifierName;
1002
+ parent?: Node;
1003
+ }
1004
+ interface TSTypeParameterInstantiation extends Span {
1005
+ type: "TSTypeParameterInstantiation";
1006
+ params: Array<TSType>;
1007
+ parent?: Node;
1008
+ }
1009
+ interface TSTypeParameter extends Span {
1010
+ type: "TSTypeParameter";
1011
+ name: BindingIdentifier;
1012
+ constraint: TSType | null;
1013
+ default: TSType | null;
1014
+ in: boolean;
1015
+ out: boolean;
1016
+ const: boolean;
1017
+ parent?: Node;
1018
+ }
1019
+ interface TSTypeParameterDeclaration extends Span {
1020
+ type: "TSTypeParameterDeclaration";
1021
+ params: Array<TSTypeParameter>;
1022
+ parent?: Node;
1023
+ }
1024
+ interface TSTypeAliasDeclaration extends Span {
1025
+ type: "TSTypeAliasDeclaration";
1026
+ id: BindingIdentifier;
1027
+ typeParameters: TSTypeParameterDeclaration | null;
1028
+ typeAnnotation: TSType;
1029
+ declare: boolean;
1030
+ parent?: Node;
1031
+ }
1032
+ type TSAccessibility = "private" | "protected" | "public";
1033
+ interface TSClassImplements extends Span {
1034
+ type: "TSClassImplements";
1035
+ expression: IdentifierReference | ThisExpression | MemberExpression;
1036
+ typeArguments: TSTypeParameterInstantiation | null;
1037
+ parent?: Node;
1038
+ }
1039
+ interface TSInterfaceDeclaration extends Span {
1040
+ type: "TSInterfaceDeclaration";
1041
+ id: BindingIdentifier;
1042
+ typeParameters: TSTypeParameterDeclaration | null;
1043
+ extends: Array<TSInterfaceHeritage>;
1044
+ body: TSInterfaceBody;
1045
+ declare: boolean;
1046
+ parent?: Node;
1047
+ }
1048
+ interface TSInterfaceBody extends Span {
1049
+ type: "TSInterfaceBody";
1050
+ body: Array<TSSignature>;
1051
+ parent?: Node;
1052
+ }
1053
+ interface TSPropertySignature extends Span {
1054
+ type: "TSPropertySignature";
1055
+ computed: boolean;
1056
+ optional: boolean;
1057
+ readonly: boolean;
1058
+ key: PropertyKey;
1059
+ typeAnnotation: TSTypeAnnotation | null;
1060
+ accessibility: null;
1061
+ static: false;
1062
+ parent?: Node;
1063
+ }
1064
+ type TSSignature = TSIndexSignature | TSPropertySignature | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSMethodSignature;
1065
+ interface TSIndexSignature extends Span {
1066
+ type: "TSIndexSignature";
1067
+ parameters: Array<TSIndexSignatureName>;
1068
+ typeAnnotation: TSTypeAnnotation;
1069
+ readonly: boolean;
1070
+ static: boolean;
1071
+ accessibility: null;
1072
+ parent?: Node;
1073
+ }
1074
+ interface TSCallSignatureDeclaration extends Span {
1075
+ type: "TSCallSignatureDeclaration";
1076
+ typeParameters: TSTypeParameterDeclaration | null;
1077
+ params: ParamPattern[];
1078
+ returnType: TSTypeAnnotation | null;
1079
+ parent?: Node;
1080
+ }
1081
+ type TSMethodSignatureKind = "method" | "get" | "set";
1082
+ interface TSMethodSignature extends Span {
1083
+ type: "TSMethodSignature";
1084
+ key: PropertyKey;
1085
+ computed: boolean;
1086
+ optional: boolean;
1087
+ kind: TSMethodSignatureKind;
1088
+ typeParameters: TSTypeParameterDeclaration | null;
1089
+ params: ParamPattern[];
1090
+ returnType: TSTypeAnnotation | null;
1091
+ accessibility: null;
1092
+ readonly: false;
1093
+ static: false;
1094
+ parent?: Node;
1095
+ }
1096
+ interface TSConstructSignatureDeclaration extends Span {
1097
+ type: "TSConstructSignatureDeclaration";
1098
+ typeParameters: TSTypeParameterDeclaration | null;
1099
+ params: ParamPattern[];
1100
+ returnType: TSTypeAnnotation | null;
1101
+ parent?: Node;
1102
+ }
1103
+ interface TSIndexSignatureName extends Span {
1104
+ type: "Identifier";
1105
+ decorators: [];
1106
+ name: string;
1107
+ optional: false;
1108
+ typeAnnotation: TSTypeAnnotation;
1109
+ parent?: Node;
1110
+ }
1111
+ interface TSInterfaceHeritage extends Span {
1112
+ type: "TSInterfaceHeritage";
1113
+ expression: Expression$1;
1114
+ typeArguments: TSTypeParameterInstantiation | null;
1115
+ parent?: Node;
1116
+ }
1117
+ interface TSTypePredicate extends Span {
1118
+ type: "TSTypePredicate";
1119
+ parameterName: TSTypePredicateName;
1120
+ asserts: boolean;
1121
+ typeAnnotation: TSTypeAnnotation | null;
1122
+ parent?: Node;
1123
+ }
1124
+ type TSTypePredicateName = IdentifierName | TSThisType;
1125
+ type TSModuleDeclarationKind = "module" | "namespace";
1126
+ interface TSModuleDeclaration extends Span {
1127
+ type: "TSModuleDeclaration";
1128
+ id: BindingIdentifier | StringLiteral | TSQualifiedName;
1129
+ body: TSModuleBlock | null;
1130
+ kind: TSModuleDeclarationKind;
1131
+ declare: boolean;
1132
+ global: false;
1133
+ parent?: Node;
1134
+ }
1135
+ interface TSGlobalDeclaration extends Span {
1136
+ type: "TSModuleDeclaration";
1137
+ id: IdentifierName;
1138
+ body: TSModuleBlock;
1139
+ kind: "global";
1140
+ declare: boolean;
1141
+ global: true;
1142
+ parent?: Node;
1143
+ }
1144
+ interface TSModuleBlock extends Span {
1145
+ type: "TSModuleBlock";
1146
+ body: Array<Directive | Statement>;
1147
+ parent?: Node;
1148
+ }
1149
+ interface TSTypeLiteral extends Span {
1150
+ type: "TSTypeLiteral";
1151
+ members: Array<TSSignature>;
1152
+ parent?: Node;
1153
+ }
1154
+ interface TSInferType extends Span {
1155
+ type: "TSInferType";
1156
+ typeParameter: TSTypeParameter;
1157
+ parent?: Node;
1158
+ }
1159
+ interface TSTypeQuery extends Span {
1160
+ type: "TSTypeQuery";
1161
+ exprName: TSTypeQueryExprName;
1162
+ typeArguments: TSTypeParameterInstantiation | null;
1163
+ parent?: Node;
1164
+ }
1165
+ type TSTypeQueryExprName = TSImportType | TSTypeName;
1166
+ interface TSImportType extends Span {
1167
+ type: "TSImportType";
1168
+ source: StringLiteral;
1169
+ options: ObjectExpression | null;
1170
+ qualifier: TSImportTypeQualifier | null;
1171
+ typeArguments: TSTypeParameterInstantiation | null;
1172
+ parent?: Node;
1173
+ }
1174
+ type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName;
1175
+ interface TSImportTypeQualifiedName extends Span {
1176
+ type: "TSQualifiedName";
1177
+ left: TSImportTypeQualifier;
1178
+ right: IdentifierName;
1179
+ parent?: Node;
1180
+ }
1181
+ interface TSFunctionType extends Span {
1182
+ type: "TSFunctionType";
1183
+ typeParameters: TSTypeParameterDeclaration | null;
1184
+ params: ParamPattern[];
1185
+ returnType: TSTypeAnnotation;
1186
+ parent?: Node;
1187
+ }
1188
+ interface TSConstructorType extends Span {
1189
+ type: "TSConstructorType";
1190
+ abstract: boolean;
1191
+ typeParameters: TSTypeParameterDeclaration | null;
1192
+ params: ParamPattern[];
1193
+ returnType: TSTypeAnnotation;
1194
+ parent?: Node;
1195
+ }
1196
+ interface TSMappedType extends Span {
1197
+ type: "TSMappedType";
1198
+ key: BindingIdentifier;
1199
+ constraint: TSType;
1200
+ nameType: TSType | null;
1201
+ typeAnnotation: TSType | null;
1202
+ optional: TSMappedTypeModifierOperator | false;
1203
+ readonly: TSMappedTypeModifierOperator | null;
1204
+ parent?: Node;
1205
+ }
1206
+ type TSMappedTypeModifierOperator = true | "+" | "-";
1207
+ interface TSTemplateLiteralType extends Span {
1208
+ type: "TSTemplateLiteralType";
1209
+ quasis: Array<TemplateElement>;
1210
+ types: Array<TSType>;
1211
+ parent?: Node;
1212
+ }
1213
+ interface TSAsExpression extends Span {
1214
+ type: "TSAsExpression";
1215
+ expression: Expression$1;
1216
+ typeAnnotation: TSType;
1217
+ parent?: Node;
1218
+ }
1219
+ interface TSSatisfiesExpression extends Span {
1220
+ type: "TSSatisfiesExpression";
1221
+ expression: Expression$1;
1222
+ typeAnnotation: TSType;
1223
+ parent?: Node;
1224
+ }
1225
+ interface TSTypeAssertion extends Span {
1226
+ type: "TSTypeAssertion";
1227
+ typeAnnotation: TSType;
1228
+ expression: Expression$1;
1229
+ parent?: Node;
1230
+ }
1231
+ interface TSImportEqualsDeclaration extends Span {
1232
+ type: "TSImportEqualsDeclaration";
1233
+ id: BindingIdentifier;
1234
+ moduleReference: TSModuleReference;
1235
+ importKind: ImportOrExportKind;
1236
+ parent?: Node;
1237
+ }
1238
+ type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;
1239
+ interface TSExternalModuleReference extends Span {
1240
+ type: "TSExternalModuleReference";
1241
+ expression: StringLiteral;
1242
+ parent?: Node;
1243
+ }
1244
+ interface TSNonNullExpression extends Span {
1245
+ type: "TSNonNullExpression";
1246
+ expression: Expression$1;
1247
+ parent?: Node;
1248
+ }
1249
+ interface Decorator extends Span {
1250
+ type: "Decorator";
1251
+ expression: Expression$1;
1252
+ parent?: Node;
1253
+ }
1254
+ interface TSExportAssignment extends Span {
1255
+ type: "TSExportAssignment";
1256
+ expression: Expression$1;
1257
+ parent?: Node;
1258
+ }
1259
+ interface TSNamespaceExportDeclaration extends Span {
1260
+ type: "TSNamespaceExportDeclaration";
1261
+ id: IdentifierName;
1262
+ parent?: Node;
1263
+ }
1264
+ interface TSInstantiationExpression extends Span {
1265
+ type: "TSInstantiationExpression";
1266
+ expression: Expression$1;
1267
+ typeArguments: TSTypeParameterInstantiation;
1268
+ parent?: Node;
1269
+ }
1270
+ type ImportOrExportKind = "value" | "type";
1271
+ interface JSDocNullableType extends Span {
1272
+ type: "TSJSDocNullableType";
1273
+ typeAnnotation: TSType;
1274
+ postfix: boolean;
1275
+ parent?: Node;
1276
+ }
1277
+ interface JSDocNonNullableType extends Span {
1278
+ type: "TSJSDocNonNullableType";
1279
+ typeAnnotation: TSType;
1280
+ postfix: boolean;
1281
+ parent?: Node;
1282
+ }
1283
+ interface JSDocUnknownType extends Span {
1284
+ type: "TSJSDocUnknownType";
1285
+ parent?: Node;
1286
+ }
1287
+ type ModuleKind = "script" | "module" | "commonjs";
1288
+ interface Span {
1289
+ start: number;
1290
+ end: number;
1291
+ range?: [number, number];
1292
+ }
1293
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
1294
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" | "%" | "**" | "<<" | ">>" | ">>>" | "|" | "^" | "&" | "in" | "instanceof";
1295
+ type LogicalOperator = "||" | "&&" | "??";
1296
+ type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
1297
+ type UpdateOperator = "++" | "--";
1298
+ type Node = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
1299
+ //#endregion
1300
+ //#region src/error.d.ts
1301
+ interface Location {
1302
+ /** 1-based. */
1303
+ line: number;
1304
+ /** 1-based. */
1305
+ column: number;
1306
+ }
1307
+ export declare function getLocation(source: string, offset: number): Location;
1308
+ /** A syntax error. Parsing stops at the first one. */
1309
+ export declare class BrumateError extends Error {
1310
+ readonly filename: string;
1311
+ readonly offset: number;
1312
+ readonly location: Location;
1313
+ /** The lines around the error. */
1314
+ readonly frame: string;
1315
+ constructor(message: string, source: string, offset: number, filename: string);
1316
+ }
1317
+ //#endregion
1318
+ //#region src/ast.d.ts
1319
+ interface Range {
1320
+ start: number;
1321
+ end: number;
1322
+ }
1323
+ /** Source text that oxc parses. */
1324
+ interface Expression extends Range {
1325
+ code: string;
1326
+ ast: Expression$1;
1327
+ }
1328
+ interface Script extends Range {
1329
+ program: Program;
1330
+ }
1331
+ interface Style extends Range {
1332
+ lang: "css" | "scss" | "less";
1333
+ /** The CSS between the tags, with `${…}` interpolations left in place. */
1334
+ content: string;
1335
+ /** The `${…}` interpolations, in source order. */
1336
+ variables: Expression[];
1337
+ }
1338
+ interface SFCFile {
1339
+ filename: string;
1340
+ source: string;
1341
+ moduleScript?: Script;
1342
+ instanceScript?: Script;
1343
+ generics?: string;
1344
+ styles: Style[];
1345
+ templates: TemplateDecl[];
1346
+ children: Markup[];
1347
+ }
1348
+ type Markup = ElementNode | ComponentNode | DynamicTagNode | FragmentNode | GlobalListenerNode | TextNode | InsertNode | Block;
1349
+ interface ElementNode extends Range {
1350
+ kind: "element";
1351
+ tag: string;
1352
+ attributes: Attribute[];
1353
+ children: Markup[];
1354
+ }
1355
+ interface ComponentNode extends Range {
1356
+ kind: "component";
1357
+ name: string;
1358
+ attributes: Attribute[];
1359
+ children: Markup[];
1360
+ }
1361
+ interface DynamicTagNode extends Range {
1362
+ kind: "dynamic";
1363
+ tag: Expression;
1364
+ attributes: Attribute[];
1365
+ children: Markup[];
1366
+ /**
1367
+ * True inside the `#key` block that the parser wraps it in. The block
1368
+ * renders it again when the tag changes, so the tag itself needs no update.
1369
+ */
1370
+ keyed?: boolean;
1371
+ }
1372
+ interface FragmentNode extends Range {
1373
+ kind: "fragment";
1374
+ children: Markup[];
1375
+ }
1376
+ interface GlobalListenerNode extends Range {
1377
+ kind: "listener";
1378
+ target: "window" | "document";
1379
+ attributes: EventAttribute[];
1380
+ }
1381
+ interface TextNode extends Range {
1382
+ kind: "text";
1383
+ value: string;
1384
+ }
1385
+ interface InsertNode extends Range {
1386
+ kind: "insert";
1387
+ expression: Expression;
1388
+ }
1389
+ type Modifier = "prevent" | "stop" | "passive" | "once" | "capture";
1390
+ type PrefetchStrategy = "hover" | "visible" | "idle" | "none";
1391
+ interface StaticAttribute extends Range {
1392
+ kind: "static";
1393
+ name: string;
1394
+ value: string | true;
1395
+ }
1396
+ interface ValueAttribute extends Range {
1397
+ kind: "value";
1398
+ name: string;
1399
+ value: Expression;
1400
+ }
1401
+ interface EventAttribute extends Range {
1402
+ kind: "event";
1403
+ /** The attribute name, such as `onClick`. */
1404
+ name: string;
1405
+ /** The DOM event name, such as `click`. */
1406
+ event: string;
1407
+ modifiers: Modifier[];
1408
+ handler: Expression;
1409
+ }
1410
+ interface RefAttribute extends Range {
1411
+ kind: "ref";
1412
+ /** The name of a signal. */
1413
+ target: string;
1414
+ /** The range of the name. */
1415
+ targetRange: Range;
1416
+ }
1417
+ interface PrefetchAttribute extends Range {
1418
+ kind: "prefetch";
1419
+ strategy: PrefetchStrategy;
1420
+ }
1421
+ interface SpreadAttribute extends Range {
1422
+ kind: "spread";
1423
+ value: Expression;
1424
+ }
1425
+ interface ComputedAttribute extends Range {
1426
+ kind: "computed";
1427
+ name: Expression;
1428
+ value: Expression | true;
1429
+ }
1430
+ type Attribute = StaticAttribute | ValueAttribute | EventAttribute | RefAttribute | PrefetchAttribute | SpreadAttribute | ComputedAttribute;
1431
+ interface Body extends Range {
1432
+ script?: Script;
1433
+ templates: TemplateDecl[];
1434
+ children: Markup[];
1435
+ }
1436
+ interface Branch {
1437
+ condition: Expression;
1438
+ body: Body;
1439
+ }
1440
+ interface IfBlock extends Range {
1441
+ kind: "if";
1442
+ branches: Branch[];
1443
+ fallback?: Body;
1444
+ }
1445
+ interface ForBlock extends Range {
1446
+ kind: "for";
1447
+ item: BindingPattern;
1448
+ index?: BindingIdentifier;
1449
+ list: Expression;
1450
+ /** `'index'` keys items by position. */
1451
+ key?: Expression | "index";
1452
+ body: Body;
1453
+ fallback?: Body;
1454
+ }
1455
+ interface RepeatBlock extends Range {
1456
+ kind: "repeat";
1457
+ index?: BindingIdentifier;
1458
+ count: Expression;
1459
+ body: Body;
1460
+ fallback?: Body;
1461
+ }
1462
+ interface SwitchBlock extends Range {
1463
+ kind: "switch";
1464
+ cases: Branch[];
1465
+ fallback?: Body;
1466
+ }
1467
+ interface KeyBlock extends Range {
1468
+ kind: "key";
1469
+ value: Expression;
1470
+ body: Body;
1471
+ }
1472
+ interface TryBlock extends Range {
1473
+ kind: "try";
1474
+ body: Body;
1475
+ error?: BindingIdentifier;
1476
+ reset?: BindingIdentifier;
1477
+ fallback: Body;
1478
+ }
1479
+ interface LoadingBlock extends Range {
1480
+ kind: "loading";
1481
+ on?: Expression;
1482
+ body: Body;
1483
+ fallback?: Body;
1484
+ }
1485
+ /** `#head { … }`: markup for the document's `<head>`. */
1486
+ interface HeadBlock extends Range {
1487
+ kind: "head";
1488
+ body: Body;
1489
+ }
1490
+ interface PortalBlock extends Range {
1491
+ kind: "portal";
1492
+ target?: Expression;
1493
+ body: Body;
1494
+ }
1495
+ type ClientTrigger = "visible" | "idle" | "load";
1496
+ interface ClientBlock extends Range {
1497
+ kind: "client";
1498
+ trigger: ClientTrigger;
1499
+ body: Body;
1500
+ }
1501
+ type Block = IfBlock | ForBlock | RepeatBlock | SwitchBlock | KeyBlock | TryBlock | LoadingBlock | PortalBlock | HeadBlock | ClientBlock;
1502
+ interface TemplateDecl extends Range {
1503
+ kind: "template";
1504
+ name: string;
1505
+ nameRange: Range;
1506
+ params: ParamPattern[];
1507
+ body: Body;
1508
+ }
1509
+ //#endregion
1510
+ //#region src/model.d.ts
1511
+ type ScopeKind = "module" | "component" | "body" | "template";
1512
+ interface Scope {
1513
+ id: number;
1514
+ kind: ScopeKind;
1515
+ parent?: Scope;
1516
+ children: Scope[];
1517
+ declarations: Map<string, Declaration>;
1518
+ /** The block that owns a body scope. */
1519
+ block?: Block;
1520
+ /** The body or template that a scope holds. */
1521
+ body?: Body;
1522
+ template?: TemplateDecl;
1523
+ }
1524
+ type DeclarationKind = "import" | "module" | "prop" | "props-rest" | "signal" | "memo" | "async-memo" | "function" | "server-function" | "const" | "let" | "item" | "index" | "error" | "reset" | "template" | "template-param" | "context" | "action";
1525
+ interface Declaration {
1526
+ id: number;
1527
+ name: string;
1528
+ kind: DeclarationKind;
1529
+ scope: Scope;
1530
+ range: Range;
1531
+ /** The site of a function, a server function or a memo. */
1532
+ site?: Site;
1533
+ /** The block that declares an item, an index, an error or a reset function. */
1534
+ block?: Block;
1535
+ reads: Reference[];
1536
+ writes: Reference[];
1537
+ /**
1538
+ * The prop that a destructured prop reads, such as `user` for
1539
+ * `const { user: { name } } = $props()`. Undefined for the props object.
1540
+ */
1541
+ propKey?: string;
1542
+ /** For `const result = $action(fn)`, the name of the server function. */
1543
+ action?: string;
1544
+ /** True for a server function that a server function refreshes with `refresh(fn)`. */
1545
+ refreshed?: boolean;
1546
+ /** For an import, the module and the name that it imports, such as `default`. */
1547
+ imported?: {
1548
+ source: string;
1549
+ name: string;
1550
+ };
1551
+ /** For an import of a function of a `'use server'` file, the ID of the function. */
1552
+ serverImport?: string;
1553
+ /**
1554
+ * For `let shown = $optimistic(source)`, the value it follows. A write sets
1555
+ * a guess, until the source changes or the server calls of the page finish.
1556
+ */
1557
+ optimistic?: Declaration;
1558
+ /** True for a memo declared with `$optimistic`, before its source is known. */
1559
+ writable?: boolean;
1560
+ /** For `const name = $id()`, the position of the call among the `$id` calls of its scope. */
1561
+ idIndex?: number;
1562
+ /** Elements whose `ref` targets this declaration. */
1563
+ refs: {
1564
+ attribute: RefAttribute;
1565
+ element: ElementNode;
1566
+ scope: Scope;
1567
+ }[];
1568
+ }
1569
+ interface Reference {
1570
+ range: Range;
1571
+ declaration: Declaration;
1572
+ site: Site;
1573
+ /** False inside `$untrack(…)`. */
1574
+ tracked: boolean;
1575
+ /** True inside a function that the site contains, such as an inline arrow function. */
1576
+ inFunction: boolean;
1577
+ }
1578
+ type SiteKind = "setup" | "function" | "server-function" | "memo" | "effect" | "client" | "insert" | "attribute" | "event" | "prop" | "spread" | "tag" | "block" | "style" | "provide" | "title";
1579
+ /** A place where code runs: a function, a statement or a markup expression. */
1580
+ interface Site {
1581
+ id: number;
1582
+ kind: SiteKind;
1583
+ scope: Scope;
1584
+ range: Range;
1585
+ node: Node;
1586
+ /** A short name for printing, such as `function add` or `insert`. */
1587
+ label: string;
1588
+ reads: Reference[];
1589
+ writes: Reference[];
1590
+ /** Functions, server functions and templates that the site references. */
1591
+ calls: Set<Declaration>;
1592
+ /**
1593
+ * The calls outside `$untrack`. The values that their functions read are
1594
+ * values that the site depends on.
1595
+ */
1596
+ trackedCalls: Set<Declaration>;
1597
+ /** The declaration that a function or memo site belongs to. */
1598
+ declaration?: Declaration;
1599
+ /** The element, component or listener of an attribute or event site. */
1600
+ owner?: ElementNode | ComponentNode | DynamicTagNode | GlobalListenerNode;
1601
+ event?: EventAttribute;
1602
+ /** The block whose header this site is. */
1603
+ block?: Block;
1604
+ /** The trigger of a `$client` site. */
1605
+ trigger?: "visible" | "idle" | "load";
1606
+ /** True if the site awaits outside a nested function. */
1607
+ awaits: boolean;
1608
+ /** More code of the site, such as the context of `$provide(context, value)`. */
1609
+ extra?: Node[];
1610
+ }
1611
+ type Severity = "error" | "warning";
1612
+ interface Diagnostic {
1613
+ severity: Severity;
1614
+ message: string;
1615
+ range: Range;
1616
+ }
1617
+ interface SemanticModel {
1618
+ module: Scope;
1619
+ component: Scope;
1620
+ scopes: Scope[];
1621
+ declarations: Declaration[];
1622
+ sites: Site[];
1623
+ diagnostics: Diagnostic[];
1624
+ }
1625
+ /** Returns true if `scope` is `ancestor` or inside it. */
1626
+ export declare function isWithin(scope: Scope, ancestor: Scope): boolean;
1627
+ /**
1628
+ * Returns the memos and props that a memo reads, directly or through other
1629
+ * memos. A memo is pending while any of them loads. A prop loads when a
1630
+ * parent passes it a promise.
1631
+ */
1632
+ declare function upstreamMemos(declaration: Declaration): Declaration[];
1633
+ /** Finds a declaration by name, from `scope` outwards. */
1634
+ export declare function lookup(scope: Scope, name: string): Declaration | undefined;
1635
+ //#endregion
1636
+ //#region src/analyze.d.ts
1637
+ export declare function analyze(file: SFCFile): SemanticModel;
1638
+ //#endregion
1639
+ //#region src/graph.d.ts
1640
+ type GraphNode = {
1641
+ kind: "source";
1642
+ declaration: Declaration;
1643
+ } | {
1644
+ kind: "memo";
1645
+ declaration: Declaration;
1646
+ site: Site;
1647
+ } | {
1648
+ kind: "binding";
1649
+ site: Site;
1650
+ } | {
1651
+ kind: "block";
1652
+ site: Site;
1653
+ block: Block;
1654
+ } | {
1655
+ kind: "effect";
1656
+ site: Site;
1657
+ };
1658
+ interface Edge {
1659
+ from: GraphNode;
1660
+ to: GraphNode;
1661
+ }
1662
+ interface Graph {
1663
+ model: SemanticModel;
1664
+ nodes: GraphNode[];
1665
+ edges: Edge[];
1666
+ /** Nodes whose value can change on the client. */
1667
+ live: Set<GraphNode>;
1668
+ /** Sites whose code can run on the client. */
1669
+ reached: Set<Site>;
1670
+ /** Body and template scopes that the client may create. */
1671
+ created: Set<Scope>;
1672
+ diagnostics: Diagnostic[];
1673
+ }
1674
+ interface GraphOptions {
1675
+ /**
1676
+ * The props that a parent can change on the client. `*` means every prop.
1677
+ * Without it, every prop can change, as when a file is compiled alone.
1678
+ */
1679
+ liveProps?: Set<string>;
1680
+ }
1681
+ export declare function buildGraph(model: SemanticModel, options?: GraphOptions): Graph;
1682
+ //#endregion
1683
+ //#region src/project.d.ts
1684
+ /** A component that a file renders, and the props it passes that can change. */
1685
+ interface ComponentUsage {
1686
+ /** The import specifier of the component. */
1687
+ source: string;
1688
+ /** The props whose values can change on the client. `*` means every prop. */
1689
+ liveProps: Set<string>;
1690
+ }
1691
+ /** Lists the components that a file renders, and the props it passes that can change. */
1692
+ export declare function summarize(file: SFCFile, graph: Graph): ComponentUsage[];
1693
+ /** Resolves an import specifier of a file to a project file, or undefined if it is not one. */
1694
+ type Resolve = (specifier: string, importer: string) => string | undefined;
1695
+ /** Resolves relative imports of `.brm` files. */
1696
+ export declare function resolveRelative(specifier: string, importer: string): string | undefined;
1697
+ /** For each file, each prop that can change, and the files that change it. */
1698
+ type ProjectProps = Map<string, Map<string, Set<string>>>;
1699
+ /**
1700
+ * Finds the props that can change on the client, and the parents that
1701
+ * change them, for every file of a project. Props start out unchanged,
1702
+ * because code outside `.brm` files renders components only on the server.
1703
+ * A prop can change when a parent passes it a value that can change. Files
1704
+ * with errors are skipped.
1705
+ */
1706
+ export declare function analyzeProjectProps(files: Map<string, string>, resolve?: Resolve): ProjectProps;
1707
+ /** Finds the props that can change on the client, for every file of a project. */
1708
+ export declare function analyzeProject(files: Map<string, string>, resolve?: Resolve): Map<string, Set<string>>;
1709
+ //#endregion
1710
+ //#region src/parser.d.ts
1711
+ interface ParseOptions {
1712
+ /** Used for error messages. */
1713
+ filename?: string;
1714
+ }
1715
+ export declare function parse(source: string, options?: ParseOptions): SFCFile;
1716
+ //#endregion
1717
+ //#region src/print.d.ts
1718
+ /** Prints the syntax tree, one node per line. */
1719
+ export declare function printAST(file: SFCFile): string;
1720
+ /** Prints scopes, declarations, sites and diagnostics. */
1721
+ export declare function printModel(source: string, model: SemanticModel): string;
1722
+ /** Prints the graph: nodes, what is live, what runs on the client and which scopes it creates. */
1723
+ export declare function printGraph(source: string, graph: Graph): string;
1724
+ //#endregion
1725
+ //#region src/modules.d.ts
1726
+ /** A module of reactive logic, read by its path. */
1727
+ interface ReactiveModule {
1728
+ /** The absolute path of the module. */
1729
+ path: string;
1730
+ source: string;
1731
+ }
1732
+ /** Finds a module that a file imports, or returns undefined if it cannot. */
1733
+ type ResolveModule = (specifier: string, importer: string) => ReactiveModule | undefined;
1734
+ /** What a name of a module function is in the component that calls it. */
1735
+ type CallName = {
1736
+ name: string;
1737
+ } | {
1738
+ literal: string;
1739
+ };
1740
+ //#endregion
1741
+ //#region src/sourcemap.d.ts
1742
+ /** A source map, version 3. */
1743
+ interface SourceMap {
1744
+ version: 3;
1745
+ file: string;
1746
+ sources: string[];
1747
+ sourcesContent: string[];
1748
+ names: string[];
1749
+ mappings: string;
1750
+ }
1751
+ //#endregion
1752
+ //#region src/css.d.ts
1753
+ interface StyleOutput {
1754
+ /** The scoped CSS of every `<style>` block, or an empty string. */
1755
+ css: string;
1756
+ /** The attribute that marks the component's elements, such as `s-1abc`. */
1757
+ attribute: string;
1758
+ /**
1759
+ * The custom property for each `${…}` interpolation, in source order. Text
1760
+ * right before or after it, such as a unit in `${size}px`, is part of the
1761
+ * value, because `var(--x)px` is not valid CSS.
1762
+ */
1763
+ variables: {
1764
+ name: string;
1765
+ expression: Expression;
1766
+ prefix: string;
1767
+ suffix: string;
1768
+ }[];
1769
+ diagnostics: Diagnostic[];
1770
+ /** Absolute paths of the files that SCSS or Less imported. */
1771
+ dependencies: string[];
1772
+ }
1773
+ //#endregion
1774
+ //#region src/plan.d.ts
1775
+ interface ScopePlan {
1776
+ scope: Scope;
1777
+ /** Declarations that client code reads, in slot order. */
1778
+ slots: Declaration[];
1779
+ /** True if the scope gets an ID at render time. */
1780
+ needsId: boolean;
1781
+ /** The number of anchors in the scope. */
1782
+ anchors: number;
1783
+ }
1784
+ /** A markup node or a site that the client must find in the page. */
1785
+ type AnchorTarget = Markup | Site;
1786
+ interface Plan {
1787
+ graph: Graph;
1788
+ /** The name of the component function, from the file name. */
1789
+ name: string;
1790
+ /** Identifies the component in handler references. */
1791
+ id: string;
1792
+ scopes: Map<Scope, ScopePlan>;
1793
+ /** The scope of each body, including template bodies. */
1794
+ bodyScopes: Map<Body, Scope>;
1795
+ /** The anchor index of a node within its scope. */
1796
+ anchors: Map<AnchorTarget, number>;
1797
+ /** The export name of each client root, such as `h3`. */
1798
+ symbols: Map<Site, string>;
1799
+ /** Sites whose code runs on the client, including update code for live nodes. */
1800
+ clientSites: Set<Site>;
1801
+ /** The compiled `<style>` blocks. */
1802
+ styles: StyleOutput;
1803
+ /** True if a style variable can change on the client. */
1804
+ liveStyles: boolean;
1805
+ /** True when server function IDs hash the names of the functions. */
1806
+ hideNames: boolean;
1807
+ }
1808
+ /** Returns the component name for a file name, such as `TodoList` for `todo-list.brm`. */
1809
+ export declare function getComponentName(filename: string): string;
1810
+ export declare function createPlan(file: SFCFile, graph: Graph, path?: string, hideNames?: boolean): Plan;
1811
+ //#endregion
1812
+ //#region src/compile.d.ts
1813
+ interface CompileOptions {
1814
+ /** Used for error messages, the component name and the component ID. */
1815
+ filename?: string;
1816
+ /**
1817
+ * The props that a parent can change on the client, from `analyzeProject`.
1818
+ * `*` means every prop. Without it, every prop can change.
1819
+ */
1820
+ liveProps?: Set<string>;
1821
+ /** The absolute path of the file, so SCSS and Less can import files next to it. */
1822
+ path?: string;
1823
+ /**
1824
+ * When the client parts of a component are smaller than this many bytes
1825
+ * in all, they become one module. Defaults to 0, which keeps one module
1826
+ * per part.
1827
+ */
1828
+ merge?: number;
1829
+ /** Warns about common accessibility mistakes in the markup. Defaults to true. */
1830
+ a11y?: boolean;
1831
+ /**
1832
+ * The ID of a function that the file imports from a `'use server'` file,
1833
+ * or undefined for other imports. Memos that call one load again when a
1834
+ * server function calls `refresh` with it. The Vite plugin passes it.
1835
+ */
1836
+ serverImport?: (specifier: string, name: string) => string | undefined;
1837
+ /**
1838
+ * Server function IDs use a hash of each function's name instead of the
1839
+ * name, so the browser does not see it. The Vite plugin sets it in builds.
1840
+ */
1841
+ hideNames?: boolean;
1842
+ /**
1843
+ * Reads a module of reactive logic, such as `./counter.brm.ts`, that the
1844
+ * component imports. Defaults to reading it from disk next to `path`.
1845
+ */
1846
+ resolveModule?: ResolveModule;
1847
+ }
1848
+ interface CompileResult {
1849
+ /** The server module, as TypeScript. Its default export renders the component. */
1850
+ server: string;
1851
+ /** The client entry module, as TypeScript. The loader imports it on the first event. */
1852
+ client: string;
1853
+ /** The parts of the client module, by name. The entry imports them when they are needed. */
1854
+ parts: Record<string, string>;
1855
+ /**
1856
+ * The render module, as TypeScript. It renders the component on the
1857
+ * client, inside a parent's block that changes.
1858
+ */
1859
+ render: string;
1860
+ /** The scoped CSS of the component. Server and render modules add it to the page. */
1861
+ css: string;
1862
+ /** The parsed file. */
1863
+ file: SFCFile;
1864
+ plan: Plan;
1865
+ warnings: Diagnostic[];
1866
+ /** The paths of the modules of reactive logic that the component calls into. */
1867
+ modules: string[];
1868
+ /**
1869
+ * Where an offset of `file.source` comes from: the component, or a module
1870
+ * whose function the component calls. `file.source` holds the bodies of
1871
+ * those functions in place of their calls.
1872
+ */
1873
+ locate: (offset: number) => {
1874
+ file: string | undefined;
1875
+ offset: number;
1876
+ };
1877
+ /** Source maps from each module back to the `.brm` file. */
1878
+ maps: {
1879
+ server: SourceMap;
1880
+ client: SourceMap;
1881
+ parts: Record<string, SourceMap>;
1882
+ render: SourceMap;
1883
+ };
1884
+ }
1885
+ /** Thrown when a file has errors. Every error is in `diagnostics`. */
1886
+ export declare class CompileError extends Error {
1887
+ readonly diagnostics: Diagnostic[];
1888
+ readonly filename: string;
1889
+ /** Where the first error is. */
1890
+ readonly location: Location;
1891
+ /** The lines around the first error. */
1892
+ readonly frame: string;
1893
+ constructor(source: string, filename: string, diagnostics: Diagnostic[]);
1894
+ }
1895
+ export declare function compile(source: string, options?: CompileOptions): CompileResult;
1896
+ //#endregion
1897
+ //#region src/shared-module.d.ts
1898
+ /** The query of the shared module of a module of reactive logic. */
1899
+ export declare const SHARED_QUERY = "?brumate-shared";
1900
+ /** A piece of a module function that the shared module holds. */
1901
+ interface SharedSite {
1902
+ /** The name of its export. */
1903
+ name: string;
1904
+ /** A function, called with its arguments, or an expression, such as the value of a memo. */
1905
+ kind: "function" | "expression";
1906
+ /** The names of the function that it reads or writes, in the order of the refs that a call passes. */
1907
+ names: string[];
1908
+ /** The names of the function that it writes. */
1909
+ writes: string[];
1910
+ }
1911
+ /** The pieces of the functions of a module that its shared module holds, by their offset in the module. */
1912
+ export declare function sharedSites(module: ReactiveModule): Map<number, SharedSite>;
1913
+ /** The shared module of a module of reactive logic, as TypeScript, with its source map. */
1914
+ export declare function generateShared(module: ReactiveModule): {
1915
+ code: string;
1916
+ map: SourceMap;
1917
+ };
1918
+ /** What code generation needs to call shared code instead of copying it. */
1919
+ interface SharedContext {
1920
+ /**
1921
+ * The shared site of a node of the compiled source, if the node is code of
1922
+ * a module function that the component calls, with what the names of the
1923
+ * function are in that call.
1924
+ */
1925
+ find(node: Node): {
1926
+ module: number;
1927
+ site: SharedSite;
1928
+ names: Map<string, CallName>;
1929
+ } | undefined;
1930
+ /** The import specifier of each shared module, relative to the component. */
1931
+ specifiers: string[];
1932
+ }
1933
+ //#endregion
1934
+ //#region src/codegen/client.d.ts
1935
+ interface ClientOutput {
1936
+ /** The entry module: the component ID, its props, its update table and its part loaders. */
1937
+ code: string;
1938
+ /**
1939
+ * The parts, by name. `h<n>` and `c<n>` parts hold one client root each,
1940
+ * `update` holds the code that updates the page, and `shared` holds the
1941
+ * functions that more than one part calls.
1942
+ */
1943
+ parts: Record<string, string>;
1944
+ diagnostics: Diagnostic[];
1945
+ }
1946
+ /**
1947
+ * Generates the client entry and its parts. When the parts are smaller than
1948
+ * `merge` bytes in all, they become one part, `all`, so the first event loads
1949
+ * one module instead of several.
1950
+ */
1951
+ declare function generateClient$1(file: SFCFile, plan: Plan, merge?: number, shared?: SharedContext): ClientOutput;
1952
+ //#endregion
1953
+ //#region src/generate.d.ts
1954
+ /** Generates the server module. */
1955
+ export declare function generateServer(file: SFCFile, plan: Plan): string;
1956
+ /** Generates the render module. */
1957
+ export declare function generateRender(file: SFCFile, plan: Plan): string;
1958
+ /** Generates the client entry and its parts. */
1959
+ export declare function generateClient(file: SFCFile, plan: Plan, merge?: number): ReturnType<typeof generateClient$1>;
1960
+ //#endregion
1961
+ //#region src/check.d.ts
1962
+ /** A range of the generated code that is copied from the file. */
1963
+ interface CheckMapping {
1964
+ /** Offset in the `.brm` file. */
1965
+ source: number;
1966
+ /** Offset in the generated code. */
1967
+ generated: number;
1968
+ length: number;
1969
+ }
1970
+ interface CheckOutput {
1971
+ code: string;
1972
+ mappings: CheckMapping[];
1973
+ /** The syntax error of the file. The code then holds only its scripts. */
1974
+ error?: BrumateError;
1975
+ }
1976
+ /**
1977
+ * Generates TypeScript for a `.brm` file. With a syntax error, the code holds
1978
+ * the scripts only, so they still get type information.
1979
+ */
1980
+ export declare function toTypeScript(source: string, filename?: string): CheckOutput;
1981
+ //#endregion
1982
+ //#region src/inspect.d.ts
1983
+ interface InspectEntry {
1984
+ /** What it is, such as `signal count` or `event button.click`. */
1985
+ label: string;
1986
+ /** `line:column` in the source. */
1987
+ at: string;
1988
+ /** Why it ships or changes. */
1989
+ reason: string;
1990
+ }
1991
+ interface InspectReport {
1992
+ filename: string;
1993
+ name: string;
1994
+ id: string;
1995
+ /** Code that runs in the browser when an event or trigger happens. */
1996
+ roots: InspectEntry[];
1997
+ /** Values and markup that can change on the client. */
1998
+ changes: InspectEntry[];
1999
+ /** Serialized values, by scope. */
2000
+ state: {
2001
+ scope: string;
2002
+ slots: string[];
2003
+ }[];
2004
+ /** Markup that ships as HTML only. */
2005
+ staticMarkup: {
2006
+ elements: number;
2007
+ inserts: number;
2008
+ };
2009
+ /** The size of each client module, in bytes. */
2010
+ sizes: {
2011
+ module: string;
2012
+ bytes: number;
2013
+ gzip: number;
2014
+ }[];
2015
+ }
2016
+ /** Describes what a compiled component ships to the client, and why. */
2017
+ export declare function report(source: string, result: CompileResult, liveProps?: Set<string>, parents?: Map<string, Set<string>>): InspectReport;
2018
+ /** Formats a report as text. */
2019
+ export declare function formatReport(value: InspectReport): string;
2020
+ interface InspectOptions extends CompileOptions {
2021
+ /** For each prop that can change, the files that change it, from `analyzeProjectProps`. */
2022
+ parents?: Map<string, Set<string>>;
2023
+ }
2024
+ /** Compiles a file and describes what it ships to the client, and why. */
2025
+ export declare function inspect(source: string, options?: InspectOptions): {
2026
+ report: InspectReport;
2027
+ text: string;
2028
+ };
2029
+ //#endregion
2030
+ export type { AnchorTarget, Attribute, Block, Body, Branch, CheckMapping, CheckOutput, ClientBlock, ClientTrigger, CompileOptions, CompileResult, ComponentNode, ComponentUsage, ComputedAttribute, Declaration, DeclarationKind, Diagnostic, DynamicTagNode, Edge, ElementNode, EventAttribute, Expression, ForBlock, FragmentNode, GlobalListenerNode, Graph, GraphNode, GraphOptions, HeadBlock, IfBlock, InsertNode, InspectEntry, InspectOptions, InspectReport, KeyBlock, LoadingBlock, Location, Markup, Modifier, ParseOptions, Plan, PortalBlock, PrefetchAttribute, PrefetchStrategy, ProjectProps, Range, ReactiveModule, RefAttribute, Reference, RepeatBlock, Resolve, ResolveModule, SFCFile, Scope, ScopeKind, ScopePlan, Script, SemanticModel, Severity, SharedSite, Site, SiteKind, SourceMap, SpreadAttribute, StaticAttribute, Style, SwitchBlock, TemplateDecl, TextNode, TryBlock, ValueAttribute, upstreamMemos };
2031
+ //# sourceMappingURL=index.d.ts.map