@marko/compiler 5.34.2 → 5.34.4

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.
@@ -1,15 +1,3 @@
1
- // Type definitions for @babel/traverse 7.20
2
- // Project: https://github.com/babel/babel/tree/main/packages/babel-traverse, https://babeljs.io
3
- // Definitions by: Troy Gerwien <https://github.com/yortus>
4
- // Marvin Hagemeister <https://github.com/marvinhagemeister>
5
- // Ryan Petrich <https://github.com/rpetrich>
6
- // Melvin Groenhoff <https://github.com/mgroenhoff>
7
- // Dean L. <https://github.com/dlgrit>
8
- // Ifiok Jr. <https://github.com/ifiokjr>
9
- // ExE Boss <https://github.com/ExE-Boss>
10
- // Daniel Tschinder <https://github.com/danez>
11
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
12
-
13
1
  import * as t from './types';
14
2
  type Node = t.Node
15
3
  export import RemovePropertiesOptions = t.RemovePropertiesOptions;
@@ -33,7 +21,7 @@ declare const traverse: {
33
21
  ) => void;
34
22
  clearNode: (node: Node, opts?: RemovePropertiesOptions) => void;
35
23
  removeProperties: (tree: Node, opts?: RemovePropertiesOptions) => Node;
36
- hasType: (tree: Node, type: Node['type'], denylistTypes?: string[]) => boolean;
24
+ hasType: (tree: Node, type: Node["type"], denylistTypes?: string[]) => boolean;
37
25
 
38
26
  cache: typeof cache;
39
27
  };
@@ -56,7 +44,7 @@ export namespace visitors {
56
44
  function explode<S = unknown>(
57
45
  visitor: Visitor<S>,
58
46
  ): {
59
- [Type in Exclude<Node, t.DeprecatedAliases>['type']]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
47
+ [Type in Exclude<Node, t.DeprecatedAliases>["type"]]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
60
48
  };
61
49
  function verify(visitor: Visitor): void;
62
50
  function merge<State>(visitors: Array<Visitor<State>>): Visitor<State>;
@@ -203,7 +191,7 @@ export class Scope {
203
191
  init?: t.Expression;
204
192
  unique?: boolean;
205
193
  _blockHoist?: number | undefined;
206
- kind?: 'var' | 'let' | 'const';
194
+ kind?: "var" | "let" | "const";
207
195
  }): void;
208
196
 
209
197
  /** Walk up to the top of the scope tree and get the `Program`. */
@@ -248,9 +236,9 @@ export class Scope {
248
236
  optsOrNoGlobals?:
249
237
  | boolean
250
238
  | {
251
- noGlobals?: boolean;
252
- noUids?: boolean;
253
- },
239
+ noGlobals?: boolean;
240
+ noUids?: boolean;
241
+ },
254
242
  ): boolean;
255
243
 
256
244
  parentHasBinding(
@@ -269,7 +257,7 @@ export class Scope {
269
257
  removeBinding(name: string): void;
270
258
  }
271
259
 
272
- export type BindingKind = 'var' | 'let' | 'const' | 'module' | 'hoisted' | 'param' | 'local' | 'unknown';
260
+ export type BindingKind = "var" | "let" | "const" | "module" | "hoisted" | "param" | "local" | "unknown";
273
261
 
274
262
  /**
275
263
  * This class is responsible for a binding inside of a scope.
@@ -308,24 +296,29 @@ export class Binding {
308
296
  dereference(): void;
309
297
  }
310
298
 
311
- export type Visitor<S = unknown> = VisitNodeObject<S, Node> & {
312
- [Type in Node['type']]?: VisitNode<S, Extract<Node, { type: Type }>>;
313
- } & {
314
- [K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>;
315
- } & {
316
- [K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]>;
317
- } & {
318
- // Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is
319
- // too complex for TS. So we type it as a general visitor only if the key contains `|`
320
- // this is good enough for non-visitor traverse options e.g. `noScope`
321
- [k: `${string}|${string}`]: VisitNode<S, Node>;
322
- };
299
+ export type Visitor<S = unknown> =
300
+ & VisitNodeObject<S, Node>
301
+ & {
302
+ [Type in Node["type"]]?: VisitNode<S, Extract<Node, { type: Type }>>;
303
+ }
304
+ & {
305
+ [K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>;
306
+ }
307
+ & {
308
+ [K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]>;
309
+ }
310
+ & {
311
+ // Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is
312
+ // too complex for TS. So we type it as a general visitor only if the key contains `|`
313
+ // this is good enough for non-visitor traverse options e.g. `noScope`
314
+ [k: `${string}|${string}`]: VisitNode<S, Node>;
315
+ };
323
316
 
324
317
  export type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
325
318
 
326
319
  export type VisitNodeFunction<S, P extends Node> = (this: S, path: NodePath<P>, state: S) => void;
327
320
 
328
- type NodeType = Node['type'] | keyof t.Aliases;
321
+ type NodeType = Node["type"] | keyof t.Aliases;
329
322
 
330
323
  export interface VisitNodeObject<S, P extends Node> {
331
324
  enter?: VisitNodeFunction<S, P>;
@@ -342,8 +335,7 @@ export type NodeKeyOfNodes<T extends Node> = {
342
335
 
343
336
  export type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[]
344
337
  ? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> }
345
- : T extends Node
346
- ? [NodePath<T>]
338
+ : T extends Node ? [NodePath<T>]
347
339
  : never;
348
340
 
349
341
  type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node ? P : never) : never;
@@ -366,7 +358,7 @@ export class NodePath<T = Node> {
366
358
  listKey: string | null;
367
359
  key: string | number | null;
368
360
  node: T;
369
- type: T extends Node ? T['type'] : T extends null | undefined ? undefined : Node['type'] | undefined;
361
+ type: T extends Node ? T["type"] : T extends null | undefined ? undefined : Node["type"] | undefined;
370
362
  shouldSkip: boolean;
371
363
  shouldStop: boolean;
372
364
  removed: boolean;
@@ -400,8 +392,8 @@ export class NodePath<T = Node> {
400
392
 
401
393
  buildCodeFrameError(msg: string, Error?: ErrorConstructor): Error;
402
394
 
403
- traverse<T>(visitor: Visitor<T>, state: T): void;
404
- traverse(visitor: Visitor): void;
395
+ traverse<T>(visitor: TraverseOptions<T>, state: T): void;
396
+ traverse(visitor: TraverseOptions): void;
405
397
 
406
398
  set(key: string, node: any): void;
407
399
 
@@ -410,7 +402,7 @@ export class NodePath<T = Node> {
410
402
  // Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
411
403
  debug(buildMessage: () => string): void;
412
404
 
413
- //#region ------------------------- ancestry -------------------------
405
+ // #region ------------------------- ancestry -------------------------
414
406
  /**
415
407
  * Starting at the parent path of the current `NodePath` and going up the
416
408
  * tree, return the first `NodePath` that causes the provided `callback`
@@ -465,9 +457,9 @@ export class NodePath<T = Node> {
465
457
  isDescendant(maybeAncestor: NodePath): boolean;
466
458
 
467
459
  inType(...candidateTypes: string[]): boolean;
468
- //#endregion
460
+ // #endregion
469
461
 
470
- //#region ------------------------- inference -------------------------
462
+ // #region ------------------------- inference -------------------------
471
463
  /** Infer the type of the current `NodePath`. */
472
464
  getTypeAnnotation(): t.FlowType | t.TSType;
473
465
 
@@ -478,9 +470,9 @@ export class NodePath<T = Node> {
478
470
  baseTypeStrictlyMatches(rightArg: NodePath): boolean;
479
471
 
480
472
  isGenericType(genericName: string): boolean;
481
- //#endregion
473
+ // #endregion
482
474
 
483
- //#region ------------------------- replacement -------------------------
475
+ // #region ------------------------- replacement -------------------------
484
476
  /**
485
477
  * Replace a node with an array of multiple. This method performs the following steps:
486
478
  *
@@ -511,9 +503,9 @@ export class NodePath<T = Node> {
511
503
  replaceExpressionWithStatements(nodes: t.Statement[]): NodePaths<t.Expression | t.Statement>;
512
504
 
513
505
  replaceInline<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
514
- //#endregion
506
+ // #endregion
515
507
 
516
- //#region ------------------------- evaluation -------------------------
508
+ // #region ------------------------- evaluation -------------------------
517
509
  /**
518
510
  * Walk the input `node` and statically evaluate if it's truthy.
519
511
  *
@@ -537,16 +529,15 @@ export class NodePath<T = Node> {
537
529
  * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 }
538
530
  * t.evaluate(parse("!true")) // { confident: true, value: false }
539
531
  * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined, deopt: NodePath }
540
- *
541
532
  */
542
533
  evaluate(): {
543
534
  confident: boolean;
544
535
  value: any;
545
536
  deopt?: NodePath;
546
537
  };
547
- //#endregion
538
+ // #endregion
548
539
 
549
- //#region ------------------------- introspection -------------------------
540
+ // #region ------------------------- introspection -------------------------
550
541
  /**
551
542
  * Match the current node if it matches the provided `pattern`.
552
543
  *
@@ -625,9 +616,9 @@ export class NodePath<T = Node> {
625
616
  isConstantExpression(): boolean;
626
617
 
627
618
  isInStrictMode(): boolean;
628
- //#endregion
619
+ // #endregion
629
620
 
630
- //#region ------------------------- context -------------------------
621
+ // #region ------------------------- context -------------------------
631
622
  call(key: string): boolean;
632
623
 
633
624
  isDenylisted(): boolean;
@@ -659,13 +650,13 @@ export class NodePath<T = Node> {
659
650
  pushContext(context: TraversalContext): void;
660
651
 
661
652
  requeue(pathToQueue?: NodePath): void;
662
- //#endregion
653
+ // #endregion
663
654
 
664
- //#region ------------------------- removal -------------------------
655
+ // #region ------------------------- removal -------------------------
665
656
  remove(): void;
666
- //#endregion
657
+ // #endregion
667
658
 
668
- //#region ------------------------- conversion -------------------------
659
+ // #region ------------------------- conversion -------------------------
669
660
  toComputedKey(): t.PrivateName | t.Expression;
670
661
 
671
662
  /** @deprecated Use `arrowFunctionToExpression` */
@@ -702,9 +693,9 @@ export class NodePath<T = Node> {
702
693
  body: t.BlockStatement;
703
694
  }
704
695
  >;
705
- //#endregion
696
+ // #endregion
706
697
 
707
- //#region ------------------------- modification -------------------------
698
+ // #region ------------------------- modification -------------------------
708
699
  /** Insert the provided nodes before the current one. */
709
700
  insertBefore<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
710
701
 
@@ -741,9 +732,9 @@ export class NodePath<T = Node> {
741
732
 
742
733
  /** Hoist the current node to the highest scope possible and return a UID referencing it. */
743
734
  hoist(scope: Scope): void;
744
- //#endregion
735
+ // #endregion
745
736
 
746
- //#region ------------------------- family -------------------------
737
+ // #region ------------------------- family -------------------------
747
738
  getOpposite(): NodePath | null;
748
739
 
749
740
  getCompletionRecords(): NodePath[];
@@ -778,9 +769,9 @@ export class NodePath<T = Node> {
778
769
  duplicates?: boolean,
779
770
  outerOnly?: boolean,
780
771
  ): Record<string, NodePath<t.Identifier> | Array<NodePath<t.Identifier>>>;
781
- //#endregion
772
+ // #endregion
782
773
 
783
- //#region ------------------------- comments -------------------------
774
+ // #region ------------------------- comments -------------------------
784
775
  /** Share comments amongst siblings. */
785
776
  shareCommentsWithSiblings(): void;
786
777
 
@@ -788,22 +779,22 @@ export class NodePath<T = Node> {
788
779
 
789
780
  /** Give node `comments` of the specified `type`. */
790
781
  addComments(type: t.CommentTypeShorthand, comments: t.Comment[]): void;
791
- //#endregion
792
-
793
- //#region ------------------------- isXXX -------------------------
794
- isMarkoParseError(props?: object | null): this is NodePath<t.MarkoParseError>;
795
- isMarkoDocumentType(props?: object | null): this is NodePath<t.MarkoDocumentType>;
796
- isMarkoDeclaration(props?: object | null): this is NodePath<t.MarkoDeclaration>;
797
- isMarkoCDATA(props?: object | null): this is NodePath<t.MarkoCDATA>;
798
- isMarkoComment(props?: object | null): this is NodePath<t.MarkoComment>;
799
- isMarkoText(props?: object | null): this is NodePath<t.MarkoText>;
800
- isMarkoPlaceholder(props?: object | null): this is NodePath<t.MarkoPlaceholder>;
801
- isMarkoScriptlet(props?: object | null): this is NodePath<t.MarkoScriptlet>;
802
- isMarkoClass(props?: object | null): this is NodePath<t.MarkoClass>;
803
- isMarkoAttribute(props?: object | null): this is NodePath<t.MarkoAttribute>;
804
- isMarkoSpreadAttribute(props?: object | null): this is NodePath<t.MarkoSpreadAttribute>;
805
- isMarkoTagBody(props?: object | null): this is NodePath<t.MarkoTagBody>;
806
- isMarkoTag(props?: object | null): this is NodePath<t.MarkoTag>;
782
+ // #endregion
783
+
784
+ // #region ------------------------- isXXX -------------------------
785
+ isMarkoParseError(opts?: object | null): this is NodePath<t.MarkoParseError>;
786
+ isMarkoDocumentType(opts?: object | null): this is NodePath<t.MarkoDocumentType>;
787
+ isMarkoDeclaration(opts?: object | null): this is NodePath<t.MarkoDeclaration>;
788
+ isMarkoCDATA(opts?: object | null): this is NodePath<t.MarkoCDATA>;
789
+ isMarkoComment(opts?: object | null): this is NodePath<t.MarkoComment>;
790
+ isMarkoText(opts?: object | null): this is NodePath<t.MarkoText>;
791
+ isMarkoPlaceholder(opts?: object | null): this is NodePath<t.MarkoPlaceholder>;
792
+ isMarkoScriptlet(opts?: object | null): this is NodePath<t.MarkoScriptlet>;
793
+ isMarkoClass(opts?: object | null): this is NodePath<t.MarkoClass>;
794
+ isMarkoAttribute(opts?: object | null): this is NodePath<t.MarkoAttribute>;
795
+ isMarkoSpreadAttribute(opts?: object | null): this is NodePath<t.MarkoSpreadAttribute>;
796
+ isMarkoTagBody(opts?: object | null): this is NodePath<t.MarkoTagBody>;
797
+ isMarkoTag(opts?: object | null): this is NodePath<t.MarkoTag>;
807
798
  isAccessor(opts?: object): this is NodePath<t.Accessor>;
808
799
  isAnyTypeAnnotation(opts?: object): this is NodePath<t.AnyTypeAnnotation>;
809
800
  isArgumentPlaceholder(opts?: object): this is NodePath<t.ArgumentPlaceholder>;
@@ -1115,39 +1106,39 @@ export class NodePath<T = Node> {
1115
1106
  isWithStatement(opts?: object): this is NodePath<t.WithStatement>;
1116
1107
  isYieldExpression(opts?: object): this is NodePath<t.YieldExpression>;
1117
1108
 
1118
- isBindingIdentifier(opts?: object): this is NodePath<VirtualTypeAliases['BindingIdentifier']>;
1109
+ isBindingIdentifier(opts?: object): this is NodePath<VirtualTypeAliases["BindingIdentifier"]>;
1119
1110
  isBlockScoped(opts?: object): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
1120
1111
 
1121
1112
  /** @deprecated */
1122
- isExistentialTypeParam(opts?: object): this is NodePath<VirtualTypeAliases['ExistentialTypeParam']>;
1123
- isForAwaitStatement(opts?: object): this is NodePath<VirtualTypeAliases['ForAwaitStatement']>;
1113
+ isExistentialTypeParam(opts?: object): this is NodePath<VirtualTypeAliases["ExistentialTypeParam"]>;
1114
+ isForAwaitStatement(opts?: object): this is NodePath<VirtualTypeAliases["ForAwaitStatement"]>;
1124
1115
  isGenerated(opts?: object): boolean;
1125
1116
 
1126
1117
  /** @deprecated */
1127
1118
  isNumericLiteralTypeAnnotation(opts?: object): void;
1128
1119
  isPure(opts?: object): boolean;
1129
1120
  isReferenced(opts?: object): boolean;
1130
- isReferencedIdentifier(opts?: object): this is NodePath<VirtualTypeAliases['ReferencedIdentifier']>;
1131
- isReferencedMemberExpression(opts?: object): this is NodePath<VirtualTypeAliases['ReferencedMemberExpression']>;
1132
- isScope(opts?: object): this is NodePath<VirtualTypeAliases['Scope']>;
1121
+ isReferencedIdentifier(opts?: object): this is NodePath<VirtualTypeAliases["ReferencedIdentifier"]>;
1122
+ isReferencedMemberExpression(opts?: object): this is NodePath<VirtualTypeAliases["ReferencedMemberExpression"]>;
1123
+ isScope(opts?: object): this is NodePath<VirtualTypeAliases["Scope"]>;
1133
1124
  isUser(opts?: object): boolean;
1134
- isVar(opts?: object): this is NodePath<VirtualTypeAliases['Var']>;
1135
- //#endregion
1136
-
1137
- //#region ------------------------- assertXXX -------------------------
1138
- assertMarkoParseError(props?: object | null): void;
1139
- assertMarkoDocumentType(props?: object | null): void;
1140
- assertMarkoDeclaration(props?: object | null): void;
1141
- assertMarkoCDATA(props?: object | null): void;
1142
- assertMarkoComment(props?: object | null): void;
1143
- assertMarkoText(props?: object | null): void;
1144
- assertMarkoPlaceholder(props?: object | null): void;
1145
- assertMarkoScriptlet(props?: object | null): void;
1146
- assertMarkoClass(props?: object | null): void;
1147
- assertMarkoAttribute(props?: object | null): void;
1148
- assertMarkoSpreadAttribute(props?: object | null): void;
1149
- assertMarkoTagBody(props?: object | null): void;
1150
- assertMarkoTag(props?: object | null): void;
1125
+ isVar(opts?: object): this is NodePath<VirtualTypeAliases["Var"]>;
1126
+ // #endregion
1127
+
1128
+ // #region ------------------------- assertXXX -------------------------
1129
+ assertMarkoParseError(opts?: object | null): void;
1130
+ assertMarkoDocumentType(opts?: object | null): void;
1131
+ assertMarkoDeclaration(opts?: object | null): void;
1132
+ assertMarkoCDATA(opts?: object | null): void;
1133
+ assertMarkoComment(opts?: object | null): void;
1134
+ assertMarkoText(opts?: object | null): void;
1135
+ assertMarkoPlaceholder(opts?: object | null): void;
1136
+ assertMarkoScriptlet(opts?: object | null): void;
1137
+ assertMarkoClass(opts?: object | null): void;
1138
+ assertMarkoAttribute(opts?: object | null): void;
1139
+ assertMarkoSpreadAttribute(opts?: object | null): void;
1140
+ assertMarkoTagBody(opts?: object | null): void;
1141
+ assertMarkoTag(opts?: object | null): void;
1151
1142
  assertAccessor(opts?: object): asserts this is NodePath<t.Accessor>;
1152
1143
  assertAnyTypeAnnotation(opts?: object): asserts this is NodePath<t.AnyTypeAnnotation>;
1153
1144
  assertArgumentPlaceholder(opts?: object): asserts this is NodePath<t.ArgumentPlaceholder>;
@@ -1458,7 +1449,7 @@ export class NodePath<T = Node> {
1458
1449
  assertWhileStatement(opts?: object): asserts this is NodePath<t.WhileStatement>;
1459
1450
  assertWithStatement(opts?: object): asserts this is NodePath<t.WithStatement>;
1460
1451
  assertYieldExpression(opts?: object): asserts this is NodePath<t.YieldExpression>;
1461
- //#endregion
1452
+ // #endregion
1462
1453
  }
1463
1454
 
1464
1455
  export interface BabelFile {
package/dist/types.d.ts CHANGED
@@ -42,7 +42,7 @@ interface BaseNode {
42
42
  extra?: Record<string, unknown>;
43
43
  }
44
44
 
45
- export type Node = Accessor | AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportOrExportDeclaration | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | Marko | MarkoAttribute | MarkoCDATA | MarkoClass | MarkoComment | MarkoDeclaration | MarkoDocumentType | MarkoParseError | MarkoPlaceholder | MarkoScriptlet | MarkoSpreadAttribute | MarkoTag | MarkoTagBody | MarkoText | MemberExpression | MetaProperty | Method | Miscellaneous | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | Scope | SequenceExpression | SpreadElement | SpreadProperty | Standardized | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeScript | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression;
45
+ export type Node = Accessor | AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportOrExportDeclaration | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | Marko | MarkoAttribute | MarkoCDATA | MarkoClass | MarkoComment | MarkoDeclaration | MarkoDocumentType | MarkoParseError | MarkoPlaceholder | MarkoScriptlet | MarkoSpreadAttribute | MarkoTag | MarkoTagBody | MarkoText | MemberExpression | MetaProperty | Method | Miscellaneous | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | Scope | SequenceExpression | SpreadElement | SpreadProperty | Standardized | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeScript | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression;
46
46
 
47
47
  export interface ArrayExpression extends BaseNode {
48
48
  type: "ArrayExpression";
@@ -52,7 +52,7 @@ export interface ArrayExpression extends BaseNode {
52
52
  export interface AssignmentExpression extends BaseNode {
53
53
  type: "AssignmentExpression";
54
54
  operator: string;
55
- left: LVal;
55
+ left: LVal | OptionalMemberExpression;
56
56
  right: Expression;
57
57
  }
58
58
 
@@ -428,7 +428,7 @@ export interface ClassExpression extends BaseNode {
428
428
 
429
429
  export interface ClassDeclaration extends BaseNode {
430
430
  type: "ClassDeclaration";
431
- id: Identifier;
431
+ id: Identifier | null;
432
432
  superClass: Expression | null;
433
433
  body: ClassBody;
434
434
  decorators: Array<Decorator> | null;
@@ -487,6 +487,7 @@ export interface ImportDeclaration extends BaseNode {
487
487
  attributes: Array<ImportAttribute> | null;
488
488
  importKind: "type" | "typeof" | "value" | null;
489
489
  module: boolean | null;
490
+ phase: "source" | "defer" | null;
490
491
  }
491
492
 
492
493
  export interface ImportDefaultSpecifier extends BaseNode {
@@ -506,6 +507,13 @@ export interface ImportSpecifier extends BaseNode {
506
507
  importKind: "type" | "typeof" | "value" | null;
507
508
  }
508
509
 
510
+ export interface ImportExpression extends BaseNode {
511
+ type: "ImportExpression";
512
+ source: Expression;
513
+ options: Expression | null;
514
+ phase: "source" | "defer" | null;
515
+ }
516
+
509
517
  export interface MetaProperty extends BaseNode {
510
518
  type: "MetaProperty";
511
519
  meta: Identifier;
@@ -1295,14 +1303,14 @@ export interface TSQualifiedName extends BaseNode {
1295
1303
  export interface TSCallSignatureDeclaration extends BaseNode {
1296
1304
  type: "TSCallSignatureDeclaration";
1297
1305
  typeParameters: TSTypeParameterDeclaration | null;
1298
- parameters: Array<Identifier | RestElement>;
1306
+ parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
1299
1307
  typeAnnotation: TSTypeAnnotation | null;
1300
1308
  }
1301
1309
 
1302
1310
  export interface TSConstructSignatureDeclaration extends BaseNode {
1303
1311
  type: "TSConstructSignatureDeclaration";
1304
1312
  typeParameters: TSTypeParameterDeclaration | null;
1305
- parameters: Array<Identifier | RestElement>;
1313
+ parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
1306
1314
  typeAnnotation: TSTypeAnnotation | null;
1307
1315
  }
1308
1316
 
@@ -1310,7 +1318,6 @@ export interface TSPropertySignature extends BaseNode {
1310
1318
  type: "TSPropertySignature";
1311
1319
  key: Expression;
1312
1320
  typeAnnotation: TSTypeAnnotation | null;
1313
- initializer: Expression | null;
1314
1321
  computed: boolean;
1315
1322
  kind: "get" | "set";
1316
1323
  optional: boolean | null;
@@ -1321,7 +1328,7 @@ export interface TSMethodSignature extends BaseNode {
1321
1328
  type: "TSMethodSignature";
1322
1329
  key: Expression;
1323
1330
  typeParameters: TSTypeParameterDeclaration | null;
1324
- parameters: Array<Identifier | RestElement>;
1331
+ parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
1325
1332
  typeAnnotation: TSTypeAnnotation | null;
1326
1333
  computed: boolean;
1327
1334
  kind: "method" | "get" | "set";
@@ -1395,14 +1402,14 @@ export interface TSThisType extends BaseNode {
1395
1402
  export interface TSFunctionType extends BaseNode {
1396
1403
  type: "TSFunctionType";
1397
1404
  typeParameters: TSTypeParameterDeclaration | null;
1398
- parameters: Array<Identifier | RestElement>;
1405
+ parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
1399
1406
  typeAnnotation: TSTypeAnnotation | null;
1400
1407
  }
1401
1408
 
1402
1409
  export interface TSConstructorType extends BaseNode {
1403
1410
  type: "TSConstructorType";
1404
1411
  typeParameters: TSTypeParameterDeclaration | null;
1405
- parameters: Array<Identifier | RestElement>;
1412
+ parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
1406
1413
  typeAnnotation: TSTypeAnnotation | null;
1407
1414
  abstract: boolean | null;
1408
1415
  }
@@ -1754,8 +1761,8 @@ export type RestProperty = RestElement;
1754
1761
  */
1755
1762
  export type SpreadProperty = SpreadElement;
1756
1763
 
1757
- export type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;
1758
- export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | MarkoParseError;
1764
+ export type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ImportExpression | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;
1765
+ export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | ImportExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | MarkoParseError;
1759
1766
  export type Binary = BinaryExpression | LogicalExpression;
1760
1767
  export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
1761
1768
  export type BlockParent = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock | MarkoTagBody;
@@ -1863,7 +1870,7 @@ export interface Aliases {
1863
1870
  }
1864
1871
 
1865
1872
  export function arrayExpression(elements?: Array<null | Expression | SpreadElement>): ArrayExpression;
1866
- export function assignmentExpression(operator: string, left: LVal, right: Expression): AssignmentExpression;
1873
+ export function assignmentExpression(operator: string, left: LVal | OptionalMemberExpression, right: Expression): AssignmentExpression;
1867
1874
  export function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>", left: Expression | PrivateName, right: Expression): BinaryExpression;
1868
1875
  export function interpreterDirective(value: string): InterpreterDirective;
1869
1876
  export function directive(value: DirectiveLiteral): Directive;
@@ -1918,7 +1925,7 @@ export function arrayPattern(elements: Array<null | PatternLike | LVal>): ArrayP
1918
1925
  export function arrowFunctionExpression(params: Array<Identifier | Pattern | RestElement>, body: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression;
1919
1926
  export function classBody(body: Array<ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock>): ClassBody;
1920
1927
  export function classExpression(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassExpression;
1921
- export function classDeclaration(id: Identifier, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassDeclaration;
1928
+ export function classDeclaration(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassDeclaration;
1922
1929
  export function exportAllDeclaration(source: StringLiteral): ExportAllDeclaration;
1923
1930
  export function exportDefaultDeclaration(declaration: TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression): ExportDefaultDeclaration;
1924
1931
  export function exportNamedDeclaration(declaration?: Declaration | null, specifiers?: Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier>, source?: StringLiteral | null): ExportNamedDeclaration;
@@ -1928,6 +1935,7 @@ export function importDeclaration(specifiers: Array<ImportSpecifier | ImportDefa
1928
1935
  export function importDefaultSpecifier(local: Identifier): ImportDefaultSpecifier;
1929
1936
  export function importNamespaceSpecifier(local: Identifier): ImportNamespaceSpecifier;
1930
1937
  export function importSpecifier(local: Identifier, imported: Identifier | StringLiteral): ImportSpecifier;
1938
+ export function importExpression(source: Expression, options?: Expression | null): ImportExpression;
1931
1939
  export function metaProperty(meta: Identifier, property: Identifier): MetaProperty;
1932
1940
  export function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod;
1933
1941
  export function objectPattern(properties: Array<RestElement | ObjectProperty>): ObjectPattern;
@@ -2052,10 +2060,10 @@ export function tsParameterProperty(parameter: Identifier | AssignmentPattern):
2052
2060
  export function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<Identifier | Pattern | RestElement>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareFunction;
2053
2061
  export function tsDeclareMethod(decorators: Array<Decorator> | null | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod;
2054
2062
  export function tsQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName;
2055
- export function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration;
2056
- export function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration;
2057
- export function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null, initializer?: Expression | null): TSPropertySignature;
2058
- export function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature;
2063
+ export function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration;
2064
+ export function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration;
2065
+ export function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null): TSPropertySignature;
2066
+ export function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature;
2059
2067
  export function tsIndexSignature(parameters: Array<Identifier>, typeAnnotation?: TSTypeAnnotation | null): TSIndexSignature;
2060
2068
  export function tsAnyKeyword(): TSAnyKeyword;
2061
2069
  export function tsBooleanKeyword(): TSBooleanKeyword;
@@ -2071,8 +2079,8 @@ export function tsUndefinedKeyword(): TSUndefinedKeyword;
2071
2079
  export function tsUnknownKeyword(): TSUnknownKeyword;
2072
2080
  export function tsVoidKeyword(): TSVoidKeyword;
2073
2081
  export function tsThisType(): TSThisType;
2074
- export function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSFunctionType;
2075
- export function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructorType;
2082
+ export function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSFunctionType;
2083
+ export function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructorType;
2076
2084
  export function tsTypeReference(typeName: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSTypeReference;
2077
2085
  export function tsTypePredicate(parameterName: Identifier | TSThisType, typeAnnotation?: TSTypeAnnotation | null, asserts?: boolean | null): TSTypePredicate;
2078
2086
  export function tsTypeQuery(exprName: TSEntityName | TSImportType, typeParameters?: TSTypeParameterInstantiation | null): TSTypeQuery;
@@ -2336,6 +2344,8 @@ export function isImportDeclaration(node: object | null | undefined, opts?: obje
2336
2344
  export function assertImportDeclaration(node: object | null | undefined, opts?: object | null): void;
2337
2345
  export function isImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ImportDefaultSpecifier;
2338
2346
  export function assertImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): void;
2347
+ export function isImportExpression(node: object | null | undefined, opts?: object | null): node is ImportExpression;
2348
+ export function assertImportExpression(node: object | null | undefined, opts?: object | null): void;
2339
2349
  export function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ImportNamespaceSpecifier;
2340
2350
  export function assertImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): void;
2341
2351
  export function isImportOrExportDeclaration(node: object | null | undefined, opts?: object | null): node is ImportOrExportDeclaration;
@@ -1,6 +1,6 @@
1
1
  "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.buildCodeFrameError = buildCodeFrameError;var _path = _interopRequireDefault(require("path"));
2
- var _kleur = _interopRequireDefault(require("kleur"));
3
2
  var _codeFrame = require("@babel/code-frame");
3
+ var _kleur = _interopRequireDefault(require("kleur"));
4
4
  const CWD = process.cwd();
5
5
  const indent = " ";
6
6
 
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { SourceMap } from "magic-string";
2
1
  import { Diagnostic, TaglibLookup } from "@marko/babel-utils";
2
+ import { SourceMap } from "magic-string";
3
3
  import * as types from "./babel-types";
4
4
  export { types };
5
5
 
@@ -42,28 +42,28 @@ export function configure(config: Config): void;
42
42
  export function compile(
43
43
  src: string,
44
44
  filename: string,
45
- config?: Config
45
+ config?: Config,
46
46
  ): Promise<CompileResult>;
47
47
 
48
48
  export function compileSync(
49
49
  src: string,
50
50
  filename: string,
51
- config?: Config
51
+ config?: Config,
52
52
  ): CompileResult;
53
53
 
54
54
  export function compileFile(
55
55
  filename: string,
56
- config?: Config
56
+ config?: Config,
57
57
  ): Promise<CompileResult>;
58
58
 
59
59
  export function compileFileSync(
60
60
  filename: string,
61
- config?: Config
61
+ config?: Config,
62
62
  ): CompileResult;
63
63
 
64
64
  export function getRuntimeEntryFiles(
65
65
  output: string,
66
- translator?: string | undefined
66
+ translator?: string | undefined,
67
67
  ): string[];
68
68
 
69
69
  export namespace taglib {
@@ -74,7 +74,7 @@ export namespace taglib {
74
74
  export function buildLookup(
75
75
  dirname: string,
76
76
  translator?: unknown,
77
- onError?: (err: Error) => void
77
+ onError?: (err: Error) => void,
78
78
  ): TaglibLookup;
79
79
  export function clearCaches(): void;
80
80
  }