@marko/compiler 5.33.0 → 5.33.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.
@@ -1,4 +1,4 @@
1
- // Type definitions for @babel/traverse 7.18
1
+ // Type definitions for @babel/traverse 7.20
2
2
  // Project: https://github.com/babel/babel/tree/main/packages/babel-traverse, https://babeljs.io
3
3
  // Definitions by: Troy Gerwien <https://github.com/yortus>
4
4
  // Marvin Hagemeister <https://github.com/marvinhagemeister>
@@ -12,26 +12,30 @@
12
12
 
13
13
  import * as t from './types';
14
14
  type Node = t.Node
15
+ export import RemovePropertiesOptions = t.RemovePropertiesOptions;
15
16
 
16
17
  declare const traverse: {
17
- <S>(
18
- parent: Node | Node[] | null | undefined,
19
- opts: TraverseOptions<S>,
20
- scope: Scope | undefined,
21
- state: S,
22
- parentPath?: NodePath,
23
- ): void;
24
- (
25
- parent: Node | Node[] | null | undefined,
26
- opts?: TraverseOptions,
27
- scope?: Scope,
28
- state?: any,
29
- parentPath?: NodePath,
30
- ): void;
18
+ <S>(parent: Node, opts: TraverseOptions<S>, scope: Scope | undefined, state: S, parentPath?: NodePath): void;
19
+ (parent: Node, opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void;
31
20
 
32
21
  visitors: typeof visitors;
33
22
  verify: typeof visitors.verify;
34
23
  explode: typeof visitors.explode;
24
+
25
+ cheap: (node: Node, enter: (node: Node) => void) => void;
26
+ node: (
27
+ node: Node,
28
+ opts: TraverseOptions,
29
+ scope?: Scope,
30
+ state?: any,
31
+ path?: NodePath,
32
+ skipKeys?: Record<string, boolean>,
33
+ ) => void;
34
+ clearNode: (node: Node, opts?: RemovePropertiesOptions) => void;
35
+ removeProperties: (tree: Node, opts?: RemovePropertiesOptions) => Node;
36
+ hasType: (tree: Node, type: Node['type'], denylistTypes?: string[]) => boolean;
37
+
38
+ cache: typeof cache;
35
39
  };
36
40
 
37
41
  export namespace visitors {
@@ -49,32 +53,66 @@ export namespace visitors {
49
53
  * - Visitors of virtual types are wrapped, so that they are only visited when their dynamic check passes
50
54
  * - `enter` and `exit` functions are wrapped in arrays, to ease merging of visitors
51
55
  */
52
- function explode<S = {}>(
56
+ function explode<S = unknown>(
53
57
  visitor: Visitor<S>,
54
58
  ): {
55
- [Type in Node['type']]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
59
+ [Type in Exclude<Node, t.DeprecatedAliases>['type']]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
56
60
  };
57
61
  function verify(visitor: Visitor): void;
58
- function merge<S = {}>(visitors: Array<Visitor<S>>, states?: S[]): Visitor<unknown>;
62
+ function merge<State>(visitors: Array<Visitor<State>>): Visitor<State>;
63
+ function merge(
64
+ visitors: Visitor[],
65
+ states?: any[],
66
+ wrapper?: (
67
+ stateKey: any,
68
+ visitorKey: keyof Visitor,
69
+ func: VisitNodeFunction<unknown, Node>,
70
+ ) => VisitNodeFunction<unknown, Node> | null,
71
+ ): Visitor;
59
72
  }
60
73
 
61
- export default traverse;
62
-
63
- export interface TraverseOptions<S = Node> extends Visitor<S> {
64
- scope?: Scope | undefined;
65
- noScope?: boolean | undefined;
74
+ export namespace cache {
75
+ let path: WeakMap<t.Node, Map<t.Node, NodePath>>;
76
+ let scope: WeakMap<t.Node, Scope>;
77
+ function clear(): void;
78
+ function clearPath(): void;
79
+ function clearScope(): void;
66
80
  }
67
81
 
68
- export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
82
+ export default traverse;
83
+
84
+ export type TraverseOptions<S = Node> = {
85
+ scope?: Scope;
86
+ noScope?: boolean;
87
+ denylist?: NodeType[];
88
+ /** @deprecated will be removed in Babel 8 */
89
+ blacklist?: NodeType[];
90
+ shouldSkip?: (node: NodePath) => boolean;
91
+ } & Visitor<S>;
69
92
 
70
93
  export class Scope {
94
+ /**
95
+ * This searches the current "scope" and collects all references/bindings
96
+ * within.
97
+ */
71
98
  constructor(path: NodePath, parentScope?: Scope);
99
+ uid: number;
72
100
  path: NodePath;
73
101
  block: Node;
102
+ labels: Map<string, NodePath<t.LabeledStatement>>;
74
103
  parentBlock: Node;
75
104
  parent: Scope;
76
105
  hub: HubInterface;
77
106
  bindings: { [name: string]: Binding };
107
+ references: { [name: string]: true };
108
+ globals: { [name: string]: t.Identifier | t.JSXIdentifier };
109
+ uids: { [name: string]: boolean };
110
+ data: Record<string | symbol, unknown>;
111
+ crawling: boolean;
112
+
113
+ static globals: string[];
114
+ /** Variables available in current context. */
115
+ static contextVariables: string[];
78
116
 
79
117
  /** Traverse node with current scope and path. */
80
118
  traverse<S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void;
@@ -112,17 +150,27 @@ export class Scope {
112
150
 
113
151
  dump(): void;
114
152
 
115
- toArray(node: Node, i?: number): Node;
153
+ toArray(
154
+ node: t.Node,
155
+ i?: number | boolean,
156
+ arrayLikeIsIterable?: boolean,
157
+ ): t.ArrayExpression | t.CallExpression | t.Identifier;
158
+
159
+ hasLabel(name: string): boolean;
160
+
161
+ getLabel(name: string): NodePath<t.LabeledStatement> | undefined;
162
+
163
+ registerLabel(path: NodePath<t.LabeledStatement>): void;
116
164
 
117
165
  registerDeclaration(path: NodePath): void;
118
166
 
119
- buildUndefinedNode(): Node;
167
+ buildUndefinedNode(): t.UnaryExpression;
120
168
 
121
169
  registerConstantViolation(path: NodePath): void;
122
170
 
123
- registerBinding(kind: string, path: NodePath, bindingPath?: NodePath): void;
171
+ registerBinding(kind: BindingKind, path: NodePath, bindingPath?: NodePath): void;
124
172
 
125
- addGlobal(node: Node): void;
173
+ addGlobal(node: t.Identifier | t.JSXIdentifier): void;
126
174
 
127
175
  hasUid(name: string): boolean;
128
176
 
@@ -132,29 +180,56 @@ export class Scope {
132
180
 
133
181
  isPure(node: Node, constantsOnly?: boolean): boolean;
134
182
 
183
+ /**
184
+ * Set some arbitrary data on the current scope.
185
+ */
135
186
  setData(key: string, val: any): any;
136
187
 
188
+ /**
189
+ * Recursively walk up scope tree looking for the data `key`.
190
+ */
137
191
  getData(key: string): any;
138
192
 
193
+ /**
194
+ * Recursively walk up scope tree looking for the data `key` and if it exists,
195
+ * remove it.
196
+ */
139
197
  removeData(key: string): void;
140
198
 
141
199
  crawl(): void;
142
200
 
143
201
  push(opts: {
144
202
  id: t.LVal;
145
- init?: t.Expression | undefined;
146
- unique?: boolean | undefined;
147
- kind?: 'var' | 'let' | 'const' | undefined;
203
+ init?: t.Expression;
204
+ unique?: boolean;
205
+ _blockHoist?: number | undefined;
206
+ kind?: 'var' | 'let' | 'const';
148
207
  }): void;
149
208
 
209
+ /** Walk up to the top of the scope tree and get the `Program`. */
150
210
  getProgramParent(): Scope;
151
211
 
212
+ /** Walk up the scope tree until we hit either a Function or return null. */
152
213
  getFunctionParent(): Scope | null;
153
214
 
215
+ /**
216
+ * Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the
217
+ * very top and hit Program.
218
+ */
154
219
  getBlockParent(): Scope;
155
220
 
221
+ /**
222
+ * Walk up from a pattern scope (function param initializer) until we hit a non-pattern scope,
223
+ * then returns its block parent
224
+ * @returns An ancestry scope whose path is a block parent
225
+ */
226
+ getPatternParent(): Scope;
227
+
156
228
  /** Walks the scope tree and gathers **all** bindings. */
157
- getAllBindings(...kinds: string[]): object;
229
+ getAllBindings(): Record<string, Binding>;
230
+
231
+ /** Walks the scope tree and gathers all declarations of `kind`. */
232
+ getAllBindingsOfKind(...kinds: string[]): Record<string, Binding>;
158
233
 
159
234
  bindingIdentifierEquals(name: string, node: Node): boolean;
160
235
 
@@ -168,9 +243,23 @@ export class Scope {
168
243
 
169
244
  hasOwnBinding(name: string): boolean;
170
245
 
171
- hasBinding(name: string, noGlobals?: boolean): boolean;
172
-
173
- parentHasBinding(name: string, noGlobals?: boolean): boolean;
246
+ hasBinding(
247
+ name: string,
248
+ optsOrNoGlobals?:
249
+ | boolean
250
+ | {
251
+ noGlobals?: boolean;
252
+ noUids?: boolean;
253
+ },
254
+ ): boolean;
255
+
256
+ parentHasBinding(
257
+ name: string,
258
+ opts?: {
259
+ noGlobals?: boolean;
260
+ noUids?: boolean;
261
+ },
262
+ ): boolean;
174
263
 
175
264
  /** Move a binding of `name` to another `scope`. */
176
265
  moveBindingTo(name: string, scope: Scope): void;
@@ -182,6 +271,16 @@ export class Scope {
182
271
 
183
272
  export type BindingKind = 'var' | 'let' | 'const' | 'module' | 'hoisted' | 'param' | 'local' | 'unknown';
184
273
 
274
+ /**
275
+ * This class is responsible for a binding inside of a scope.
276
+ *
277
+ * It tracks the following:
278
+ *
279
+ * * Node path.
280
+ * * Amount of times referenced by other nodes.
281
+ * * Paths to nodes that reassign or modify this binding.
282
+ * * The kind of binding. (Is it a parameter, declaration etc)
283
+ */
185
284
  export class Binding {
186
285
  constructor(opts: { identifier: t.Identifier; scope: Scope; path: NodePath; kind: BindingKind });
187
286
  identifier: t.Identifier;
@@ -193,23 +292,33 @@ export class Binding {
193
292
  referencePaths: NodePath[];
194
293
  constant: boolean;
195
294
  constantViolations: NodePath[];
196
- hasDeoptedValue?: boolean;
197
- hasValue?: boolean;
198
- value?: any;
295
+ hasDeoptedValue: boolean;
296
+ hasValue: boolean;
297
+ value: any;
199
298
 
200
299
  deopValue(): void;
201
300
  setValue(value: any): void;
202
301
  clearValue(): void;
203
302
 
303
+ /** Register a constant violation with the provided `path`. */
204
304
  reassign(path: NodePath): void;
305
+ /** Increment the amount of references to this binding. */
205
306
  reference(path: NodePath): void;
307
+ /** Decrement the amount of references to this binding. */
206
308
  dereference(): void;
207
309
  }
208
310
 
209
- export type Visitor<S = {}> = VisitNodeObject<S, Node> & {
311
+ export type Visitor<S = unknown> = VisitNodeObject<S, Node> & {
210
312
  [Type in Node['type']]?: VisitNode<S, Extract<Node, { type: Type }>>;
211
313
  } & {
212
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>;
213
322
  };
214
323
 
215
324
  export type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
@@ -219,74 +328,88 @@ export type VisitNodeFunction<S, P extends Node> = (this: S, path: NodePath<P>,
219
328
  type NodeType = Node['type'] | keyof t.Aliases;
220
329
 
221
330
  export interface VisitNodeObject<S, P extends Node> {
222
- enter?: VisitNodeFunction<S, P> | undefined;
223
- exit?: VisitNodeFunction<S, P> | undefined;
224
- denylist?: NodeType[] | undefined;
225
- /**
226
- * @deprecated will be removed in Babel 8
227
- */
228
- blacklist?: NodeType[] | undefined;
331
+ enter?: VisitNodeFunction<S, P>;
332
+ exit?: VisitNodeFunction<S, P>;
229
333
  }
230
334
 
335
+ export type NodeKeyOfArrays<T extends Node> = {
336
+ [P in keyof T]-?: T[P] extends Array<Node | null | undefined> ? P : never;
337
+ }[keyof T];
338
+
339
+ export type NodeKeyOfNodes<T extends Node> = {
340
+ [P in keyof T]-?: T[P] extends Node | null | undefined ? P : never;
341
+ }[keyof T];
342
+
231
343
  export type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[]
232
344
  ? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> }
233
345
  : T extends Node
234
346
  ? [NodePath<T>]
235
347
  : never;
236
348
 
349
+ type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node ? P : never) : never;
350
+
351
+ type NodesInsertionParam<T extends Node> = T | readonly T[] | [T, ...T[]];
352
+
237
353
  export class NodePath<T = Node> {
238
- constructor(hub: Hub, parent: Node);
354
+ constructor(hub: HubInterface, parent: Node);
239
355
  parent: Node;
240
356
  hub: Hub;
357
+ data: Record<string | symbol, unknown>;
358
+ context: TraversalContext;
359
+ scope: Scope;
241
360
  contexts: TraversalContext[];
242
- data: object;
361
+ state: any;
362
+ opts: any; // exploded TraverseOptions
363
+ skipKeys: Record<string, boolean> | null;
364
+ parentPath: T extends t.Program ? null : NodePath;
365
+ container: Node | Node[] | null;
366
+ listKey: string | null;
367
+ key: string | number | null;
368
+ node: T;
369
+ type: T extends Node ? T['type'] : T extends null | undefined ? undefined : Node['type'] | undefined;
243
370
  shouldSkip: boolean;
244
371
  shouldStop: boolean;
245
372
  removed: boolean;
246
- state: any;
247
- opts: object;
248
- skipKeys: object;
249
- parentPath: T extends t.Program ? null : NodePath;
250
- context: TraversalContext;
251
- container: object | object[];
252
- listKey: string;
253
373
  inList: boolean;
254
374
  parentKey: string;
255
- key: string | number;
256
- node: T;
257
- scope: Scope;
258
- type: T extends null | undefined ? undefined : T extends Node ? T['type'] : string | undefined;
259
375
  typeAnnotation: object;
260
376
 
377
+ static get<C extends Node, K extends keyof C>(opts: {
378
+ hub?: HubInterface;
379
+ parentPath: NodePath | null;
380
+ parent: Node;
381
+ container: C;
382
+ key: K;
383
+ }): NodePath<C[K]>;
384
+ static get<C extends Node, L extends NodeKeyOfArrays<C>>(opts: {
385
+ hub?: HubInterface;
386
+ parentPath: NodePath | null;
387
+ parent: Node;
388
+ container: C;
389
+ listKey: L;
390
+ key: number;
391
+ }): C[L] extends Array<Node | null | undefined> ? NodePath<C[L][number]> : never;
392
+
261
393
  getScope(scope: Scope): Scope;
262
394
 
263
- setData(key: string, val: any): any;
395
+ setData(key: string | symbol, val: any): any;
264
396
 
265
- getData(key: string, def?: any): any;
397
+ getData(key: string | symbol, def?: any): any;
266
398
 
267
- hasNode(): this is NodePath<NonNullable<this['node']>>;
399
+ hasNode(): this is NodePath<Exclude<T, null | undefined>>;
268
400
 
269
- buildCodeFrameError<TError extends Error>(msg: string, Error?: new (msg: string) => TError): TError;
401
+ buildCodeFrameError(msg: string, Error?: ErrorConstructor): Error;
270
402
 
271
403
  traverse<T>(visitor: Visitor<T>, state: T): void;
272
404
  traverse(visitor: Visitor): void;
273
405
 
274
- set(key: string, node: Node): void;
406
+ set(key: string, node: any): void;
275
407
 
276
408
  getPathLocation(): string;
277
409
 
278
410
  // Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
279
411
  debug(buildMessage: () => string): void;
280
412
 
281
- static get<C extends Node, K extends keyof C>(opts: {
282
- hub: HubInterface;
283
- parentPath: NodePath | null;
284
- parent: Node;
285
- container: C;
286
- listKey?: string | undefined;
287
- key: K;
288
- }): NodePath<C[K]>;
289
-
290
413
  //#region ------------------------- ancestry -------------------------
291
414
  /**
292
415
  * Starting at the parent path of the current `NodePath` and going up the
@@ -321,7 +444,7 @@ export class NodePath<T = Node> {
321
444
  /** Get the earliest path in the tree where the provided `paths` intersect. */
322
445
  getDeepestCommonAncestorFrom(
323
446
  paths: NodePath[],
324
- filter?: (deepest: Node, i: number, ancestries: NodePath[]) => NodePath,
447
+ filter?: (deepest: Node, i: number, ancestries: NodePath[][]) => NodePath,
325
448
  ): NodePath;
326
449
 
327
450
  /**
@@ -346,13 +469,13 @@ export class NodePath<T = Node> {
346
469
 
347
470
  //#region ------------------------- inference -------------------------
348
471
  /** Infer the type of the current `NodePath`. */
349
- getTypeAnnotation(): t.FlowType;
472
+ getTypeAnnotation(): t.FlowType | t.TSType;
350
473
 
351
474
  isBaseType(baseName: string, soft?: boolean): boolean;
352
475
 
353
476
  couldBeBaseType(name: string): boolean;
354
477
 
355
- baseTypeStrictlyMatches(right: NodePath): boolean;
478
+ baseTypeStrictlyMatches(rightArg: NodePath): boolean;
356
479
 
357
480
  isGenericType(genericName: string): boolean;
358
481
  //#endregion
@@ -365,7 +488,7 @@ export class NodePath<T = Node> {
365
488
  * - Insert the provided nodes after the current node.
366
489
  * - Remove the current node.
367
490
  */
368
- replaceWithMultiple<Nodes extends readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
491
+ replaceWithMultiple<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
369
492
 
370
493
  /**
371
494
  * Parse a string as an expression and replace the current node with the result.
@@ -374,19 +497,20 @@ export class NodePath<T = Node> {
374
497
  * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's
375
498
  * easier to use, your transforms will be extremely brittle.
376
499
  */
377
- replaceWithSourceString(replacement: any): [NodePath];
500
+ replaceWithSourceString(replacement: string): [NodePath];
378
501
 
379
502
  /** Replace the current node with another. */
380
- replaceWith<T extends Node>(replacement: T | NodePath<T>): [NodePath<T>];
503
+ replaceWith<R extends Node>(replacementPath: R | NodePath<R>): [NodePath<R>];
504
+ replaceWith<R extends NodePath>(replacementPath: R): [R];
381
505
 
382
506
  /**
383
507
  * This method takes an array of statements nodes and then explodes it
384
508
  * into expressions. This method retains completion records which is
385
509
  * extremely important to retain original semantics.
386
510
  */
387
- replaceExpressionWithStatements<Nodes extends readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
511
+ replaceExpressionWithStatements(nodes: t.Statement[]): NodePaths<t.Expression | t.Statement>;
388
512
 
389
- replaceInline<Nodes extends Node | readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
513
+ replaceInline<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
390
514
  //#endregion
391
515
 
392
516
  //#region ------------------------- evaluation -------------------------
@@ -398,22 +522,28 @@ export class NodePath<T = Node> {
398
522
  * value and `undefined` if we aren't sure. Because of this please do not
399
523
  * rely on coercion when using this method and check with === if it's false.
400
524
  */
401
- evaluateTruthy(): boolean;
525
+ evaluateTruthy(): boolean | undefined;
402
526
 
403
527
  /**
404
528
  * Walk the input `node` and statically evaluate it.
405
529
  *
406
- * Returns an object in the form `{ confident, value }`. `confident` indicates
407
- * whether or not we had to drop out of evaluating the expression because of
408
- * hitting an unknown node that we couldn't confidently find the value of.
530
+ * Returns an object in the form `{ confident, value, deopt }`. `confident`
531
+ * indicates whether or not we had to drop out of evaluating the expression
532
+ * because of hitting an unknown node that we couldn't confidently find the
533
+ * value of, in which case `deopt` is the path of said node.
409
534
  *
410
535
  * Example:
411
536
  *
412
537
  * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 }
413
538
  * t.evaluate(parse("!true")) // { confident: true, value: false }
414
- * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined }
539
+ * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined, deopt: NodePath }
540
+ *
415
541
  */
416
- evaluate(): { confident: boolean; value: any };
542
+ evaluate(): {
543
+ confident: boolean;
544
+ value: any;
545
+ deopt?: NodePath;
546
+ };
417
547
  //#endregion
418
548
 
419
549
  //#region ------------------------- introspection -------------------------
@@ -430,17 +560,21 @@ export class NodePath<T = Node> {
430
560
  * if the array has any items, otherwise we just check if it's falsy.
431
561
  */
432
562
  has(key: string): boolean;
563
+ // has(key: keyof T): boolean;
433
564
 
434
565
  isStatic(): boolean;
435
566
 
436
567
  /** Alias of `has`. */
437
568
  is(key: string): boolean;
569
+ // is(key: keyof T): boolean;
438
570
 
439
571
  /** Opposite of `has`. */
440
572
  isnt(key: string): boolean;
573
+ // isnt(key: keyof T): boolean;
441
574
 
442
575
  /** Check whether the path node `key` strict equals `value`. */
443
576
  equals(key: string, value: any): boolean;
577
+ // equals(key: keyof T, value: any): boolean;
444
578
 
445
579
  /**
446
580
  * Check the type against our stored internal type of the node. This is handy when a node has
@@ -484,12 +618,21 @@ export class NodePath<T = Node> {
484
618
  getSource(): string;
485
619
 
486
620
  /** Check if the current path will maybe execute before another path */
487
- willIMaybeExecuteBefore(path: NodePath): boolean;
621
+ willIMaybeExecuteBefore(target: NodePath): boolean;
622
+
623
+ resolve(dangerous?: boolean, resolved?: NodePath[]): NodePath;
624
+
625
+ isConstantExpression(): boolean;
626
+
627
+ isInStrictMode(): boolean;
488
628
  //#endregion
489
629
 
490
630
  //#region ------------------------- context -------------------------
491
631
  call(key: string): boolean;
492
632
 
633
+ isDenylisted(): boolean;
634
+
635
+ /** @deprecated will be removed in Babel 8 */
493
636
  isBlacklisted(): boolean;
494
637
 
495
638
  visit(): boolean;
@@ -504,24 +647,72 @@ export class NodePath<T = Node> {
504
647
 
505
648
  setContext(context?: TraversalContext): this;
506
649
 
650
+ /**
651
+ * Here we resync the node paths `key` and `container`. If they've changed according
652
+ * to what we have stored internally then we attempt to resync by crawling and looking
653
+ * for the new values.
654
+ */
655
+ resync(): void;
656
+
507
657
  popContext(): void;
508
658
 
509
659
  pushContext(context: TraversalContext): void;
660
+
661
+ requeue(pathToQueue?: NodePath): void;
510
662
  //#endregion
511
663
 
512
664
  //#region ------------------------- removal -------------------------
513
665
  remove(): void;
514
666
  //#endregion
515
667
 
668
+ //#region ------------------------- conversion -------------------------
669
+ toComputedKey(): t.PrivateName | t.Expression;
670
+
671
+ /** @deprecated Use `arrowFunctionToExpression` */
672
+ arrowFunctionToShadowed(): void;
673
+
674
+ /**
675
+ * Given an arbitrary function, process its content as if it were an arrow function, moving references
676
+ * to "this", "arguments", "super", and such into the function's parent scope. This method is useful if
677
+ * you have wrapped some set of items in an IIFE or other function, but want "this", "arguments", and super"
678
+ * to continue behaving as expected.
679
+ */
680
+ unwrapFunctionEnvironment(): void;
681
+
682
+ /**
683
+ * Convert a given arrow function into a normal ES5 function expression.
684
+ */
685
+ arrowFunctionToExpression({
686
+ allowInsertArrow,
687
+ allowInsertArrowWithRest,
688
+ /** @deprecated Use `noNewArrows` instead */
689
+ specCompliant,
690
+ noNewArrows,
691
+ }?: {
692
+ allowInsertArrow?: boolean;
693
+ allowInsertArrowWithRest?: boolean;
694
+ specCompliant?: boolean;
695
+ noNewArrows?: boolean;
696
+ }): NodePath<Exclude<t.Function, t.Method | t.ArrowFunctionExpression> | t.CallExpression>;
697
+
698
+ ensureBlock(
699
+ this: NodePath<t.Loop | t.WithStatement | t.Function | t.LabeledStatement | t.CatchClause>,
700
+ ): asserts this is NodePath<
701
+ T & {
702
+ body: t.BlockStatement;
703
+ }
704
+ >;
705
+ //#endregion
706
+
516
707
  //#region ------------------------- modification -------------------------
517
708
  /** Insert the provided nodes before the current one. */
518
- insertBefore<Nodes extends Node | readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
709
+ insertBefore<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
519
710
 
520
711
  /**
521
712
  * Insert the provided nodes after the current one. When inserting nodes after an
522
713
  * expression, ensure that the completion record is correct by pushing the current node.
523
714
  */
524
- insertAfter<Nodes extends Node | readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
715
+ insertAfter<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
525
716
 
526
717
  /** Update all sibling node paths after `fromIndex` by `incrementBy`. */
527
718
  updateSiblingKeys(fromIndex: number, incrementBy: number): void;
@@ -531,21 +722,29 @@ export class NodePath<T = Node> {
531
722
  * @param listKey - The key at which the child nodes are stored (usually body).
532
723
  * @param nodes - the nodes to insert.
533
724
  */
534
- unshiftContainer<Nodes extends Node | readonly Node[]>(listKey: ArrayKeys<T>, nodes: Nodes): NodePaths<Nodes>;
725
+ unshiftContainer<
726
+ T extends Node,
727
+ K extends NodeKeyOfArrays<T>,
728
+ Nodes extends NodesInsertionParam<NodeListType<T, K>>,
729
+ >(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
535
730
 
536
731
  /**
537
732
  * Insert child nodes at the end of the current node.
538
733
  * @param listKey - The key at which the child nodes are stored (usually body).
539
734
  * @param nodes - the nodes to insert.
540
735
  */
541
- pushContainer<Nodes extends Node | readonly Node[]>(listKey: ArrayKeys<T>, nodes: Nodes): NodePaths<Nodes>;
736
+ pushContainer<T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(
737
+ this: NodePath<T>,
738
+ listKey: K,
739
+ nodes: Nodes,
740
+ ): NodePaths<Nodes>;
542
741
 
543
742
  /** Hoist the current node to the highest scope possible and return a UID referencing it. */
544
743
  hoist(scope: Scope): void;
545
744
  //#endregion
546
745
 
547
746
  //#region ------------------------- family -------------------------
548
- getOpposite(): NodePath;
747
+ getOpposite(): NodePath | null;
549
748
 
550
749
  getCompletionRecords(): NodePath[];
551
750
 
@@ -585,10 +784,10 @@ export class NodePath<T = Node> {
585
784
  /** Share comments amongst siblings. */
586
785
  shareCommentsWithSiblings(): void;
587
786
 
588
- addComment(type: string, content: string, line?: boolean): void;
787
+ addComment(type: t.CommentTypeShorthand, content: string, line?: boolean): void;
589
788
 
590
789
  /** Give node `comments` of the specified `type`. */
591
- addComments(type: string, comments: any[]): void;
790
+ addComments(type: t.CommentTypeShorthand, comments: t.Comment[]): void;
592
791
  //#endregion
593
792
 
594
793
  //#region ------------------------- isXXX -------------------------
@@ -605,294 +804,334 @@ export class NodePath<T = Node> {
605
804
  isMarkoSpreadAttribute(props?: object | null): this is NodePath<t.MarkoSpreadAttribute>;
606
805
  isMarkoTagBody(props?: object | null): this is NodePath<t.MarkoTagBody>;
607
806
  isMarkoTag(props?: object | null): this is NodePath<t.MarkoTag>;
608
- isAnyTypeAnnotation(props?: object | null): this is NodePath<t.AnyTypeAnnotation>;
609
- isArrayExpression(props?: object | null): this is NodePath<t.ArrayExpression>;
610
- isArrayPattern(props?: object | null): this is NodePath<t.ArrayPattern>;
611
- isArrayTypeAnnotation(props?: object | null): this is NodePath<t.ArrayTypeAnnotation>;
612
- isArrowFunctionExpression(props?: object | null): this is NodePath<t.ArrowFunctionExpression>;
613
- isAssignmentExpression(props?: object | null): this is NodePath<t.AssignmentExpression>;
614
- isAssignmentPattern(props?: object | null): this is NodePath<t.AssignmentPattern>;
615
- isAwaitExpression(props?: object | null): this is NodePath<t.AwaitExpression>;
616
- isBigIntLiteral(props?: object | null): this is NodePath<t.BigIntLiteral>;
617
- isBinary(props?: object | null): this is NodePath<t.Binary>;
618
- isBinaryExpression(props?: object | null): this is NodePath<t.BinaryExpression>;
619
- isBindExpression(props?: object | null): this is NodePath<t.BindExpression>;
620
- isBlock(props?: object | null): this is NodePath<t.Block>;
621
- isBlockParent(props?: object | null): this is NodePath<t.BlockParent>;
622
- isBlockStatement(props?: object | null): this is NodePath<t.BlockStatement>;
623
- isBooleanLiteral(props?: object | null): this is NodePath<t.BooleanLiteral>;
624
- isBooleanLiteralTypeAnnotation(props?: object | null): this is NodePath<t.BooleanLiteralTypeAnnotation>;
625
- isBooleanTypeAnnotation(props?: object | null): this is NodePath<t.BooleanTypeAnnotation>;
626
- isBreakStatement(props?: object | null): this is NodePath<t.BreakStatement>;
627
- isCallExpression(props?: object | null): this is NodePath<t.CallExpression>;
628
- isCatchClause(props?: object | null): this is NodePath<t.CatchClause>;
629
- isClass(props?: object | null): this is NodePath<t.Class>;
630
- isClassBody(props?: object | null): this is NodePath<t.ClassBody>;
631
- isClassDeclaration(props?: object | null): this is NodePath<t.ClassDeclaration>;
632
- isClassExpression(props?: object | null): this is NodePath<t.ClassExpression>;
633
- isClassImplements(props?: object | null): this is NodePath<t.ClassImplements>;
634
- isClassMethod(props?: object | null): this is NodePath<t.ClassMethod>;
635
- isClassPrivateMethod(props?: object | null): this is NodePath<t.ClassPrivateMethod>;
636
- isClassPrivateProperty(props?: object | null): this is NodePath<t.ClassPrivateProperty>;
637
- isClassProperty(props?: object | null): this is NodePath<t.ClassProperty>;
638
- isCompletionStatement(props?: object | null): this is NodePath<t.CompletionStatement>;
639
- isConditional(props?: object | null): this is NodePath<t.Conditional>;
640
- isConditionalExpression(props?: object | null): this is NodePath<t.ConditionalExpression>;
641
- isContinueStatement(props?: object | null): this is NodePath<t.ContinueStatement>;
642
- isDebuggerStatement(props?: object | null): this is NodePath<t.DebuggerStatement>;
643
- isDeclaration(props?: object | null): this is NodePath<t.Declaration>;
644
- isDeclareClass(props?: object | null): this is NodePath<t.DeclareClass>;
645
- isDeclareExportAllDeclaration(props?: object | null): this is NodePath<t.DeclareExportAllDeclaration>;
646
- isDeclareExportDeclaration(props?: object | null): this is NodePath<t.DeclareExportDeclaration>;
647
- isDeclareFunction(props?: object | null): this is NodePath<t.DeclareFunction>;
648
- isDeclareInterface(props?: object | null): this is NodePath<t.DeclareInterface>;
649
- isDeclareModule(props?: object | null): this is NodePath<t.DeclareModule>;
650
- isDeclareModuleExports(props?: object | null): this is NodePath<t.DeclareModuleExports>;
651
- isDeclareOpaqueType(props?: object | null): this is NodePath<t.DeclareOpaqueType>;
652
- isDeclareTypeAlias(props?: object | null): this is NodePath<t.DeclareTypeAlias>;
653
- isDeclareVariable(props?: object | null): this is NodePath<t.DeclareVariable>;
654
- isDeclaredPredicate(props?: object | null): this is NodePath<t.DeclaredPredicate>;
655
- isDecorator(props?: object | null): this is NodePath<t.Decorator>;
656
- isDirective(props?: object | null): this is NodePath<t.Directive>;
657
- isDirectiveLiteral(props?: object | null): this is NodePath<t.DirectiveLiteral>;
658
- isDoExpression(props?: object | null): this is NodePath<t.DoExpression>;
659
- isDoWhileStatement(props?: object | null): this is NodePath<t.DoWhileStatement>;
660
- isEmptyStatement(props?: object | null): this is NodePath<t.EmptyStatement>;
661
- isEmptyTypeAnnotation(props?: object | null): this is NodePath<t.EmptyTypeAnnotation>;
662
- isExistsTypeAnnotation(props?: object | null): this is NodePath<t.ExistsTypeAnnotation>;
663
- isExportAllDeclaration(props?: object | null): this is NodePath<t.ExportAllDeclaration>;
664
- isExportDeclaration(props?: object | null): this is NodePath<t.ExportDeclaration>;
665
- isExportDefaultDeclaration(props?: object | null): this is NodePath<t.ExportDefaultDeclaration>;
666
- isExportDefaultSpecifier(props?: object | null): this is NodePath<t.ExportDefaultSpecifier>;
667
- isExportNamedDeclaration(props?: object | null): this is NodePath<t.ExportNamedDeclaration>;
668
- isExportNamespaceSpecifier(props?: object | null): this is NodePath<t.ExportNamespaceSpecifier>;
669
- isExportSpecifier(props?: object | null): this is NodePath<t.ExportSpecifier>;
670
- isExpression(props?: object | null): this is NodePath<t.Expression>;
671
- isExpressionStatement(props?: object | null): this is NodePath<t.ExpressionStatement>;
672
- isExpressionWrapper(props?: object | null): this is NodePath<t.ExpressionWrapper>;
673
- isFile(props?: object | null): this is NodePath<t.File>;
674
- isFlow(props?: object | null): this is NodePath<t.Flow>;
675
- isFlowBaseAnnotation(props?: object | null): this is NodePath<t.FlowBaseAnnotation>;
676
- isFlowDeclaration(props?: object | null): this is NodePath<t.FlowDeclaration>;
677
- isFlowPredicate(props?: object | null): this is NodePath<t.FlowPredicate>;
678
- isFlowType(props?: object | null): this is NodePath<t.FlowType>;
679
- isFor(props?: object | null): this is NodePath<t.For>;
680
- isForInStatement(props?: object | null): this is NodePath<t.ForInStatement>;
681
- isForOfStatement(props?: object | null): this is NodePath<t.ForOfStatement>;
682
- isForStatement(props?: object | null): this is NodePath<t.ForStatement>;
683
- isForXStatement(props?: object | null): this is NodePath<t.ForXStatement>;
684
- isFunction(props?: object | null): this is NodePath<t.Function>;
685
- isFunctionDeclaration(props?: object | null): this is NodePath<t.FunctionDeclaration>;
686
- isFunctionExpression(props?: object | null): this is NodePath<t.FunctionExpression>;
687
- isFunctionParent(props?: object | null): this is NodePath<t.FunctionParent>;
688
- isFunctionTypeAnnotation(props?: object | null): this is NodePath<t.FunctionTypeAnnotation>;
689
- isFunctionTypeParam(props?: object | null): this is NodePath<t.FunctionTypeParam>;
690
- isGenericTypeAnnotation(props?: object | null): this is NodePath<t.GenericTypeAnnotation>;
691
- isIdentifier(props?: object | null): this is NodePath<t.Identifier>;
692
- isIfStatement(props?: object | null): this is NodePath<t.IfStatement>;
693
- isImmutable(props?: object | null): this is NodePath<t.Immutable>;
694
- isImport(props?: object | null): this is NodePath<t.Import>;
695
- isImportDeclaration(props?: object | null): this is NodePath<t.ImportDeclaration>;
696
- isImportDefaultSpecifier(props?: object | null): this is NodePath<t.ImportDefaultSpecifier>;
697
- isImportNamespaceSpecifier(props?: object | null): this is NodePath<t.ImportNamespaceSpecifier>;
698
- isImportSpecifier(props?: object | null): this is NodePath<t.ImportSpecifier>;
699
- isInferredPredicate(props?: object | null): this is NodePath<t.InferredPredicate>;
700
- isInterfaceDeclaration(props?: object | null): this is NodePath<t.InterfaceDeclaration>;
701
- isInterfaceExtends(props?: object | null): this is NodePath<t.InterfaceExtends>;
702
- isInterfaceTypeAnnotation(props?: object | null): this is NodePath<t.InterfaceTypeAnnotation>;
703
- isInterpreterDirective(props?: object | null): this is NodePath<t.InterpreterDirective>;
704
- isIntersectionTypeAnnotation(props?: object | null): this is NodePath<t.IntersectionTypeAnnotation>;
705
- isJSX(props?: object | null): this is NodePath<t.JSX>;
706
- isJSXAttribute(props?: object | null): this is NodePath<t.JSXAttribute>;
707
- isJSXClosingElement(props?: object | null): this is NodePath<t.JSXClosingElement>;
708
- isJSXClosingFragment(props?: object | null): this is NodePath<t.JSXClosingFragment>;
709
- isJSXElement(props?: object | null): this is NodePath<t.JSXElement>;
710
- isJSXEmptyExpression(props?: object | null): this is NodePath<t.JSXEmptyExpression>;
711
- isJSXExpressionContainer(props?: object | null): this is NodePath<t.JSXExpressionContainer>;
712
- isJSXFragment(props?: object | null): this is NodePath<t.JSXFragment>;
713
- isJSXIdentifier(props?: object | null): this is NodePath<t.JSXIdentifier>;
714
- isJSXMemberExpression(props?: object | null): this is NodePath<t.JSXMemberExpression>;
715
- isJSXNamespacedName(props?: object | null): this is NodePath<t.JSXNamespacedName>;
716
- isJSXOpeningElement(props?: object | null): this is NodePath<t.JSXOpeningElement>;
717
- isJSXOpeningFragment(props?: object | null): this is NodePath<t.JSXOpeningFragment>;
718
- isJSXSpreadAttribute(props?: object | null): this is NodePath<t.JSXSpreadAttribute>;
719
- isJSXSpreadChild(props?: object | null): this is NodePath<t.JSXSpreadChild>;
720
- isJSXText(props?: object | null): this is NodePath<t.JSXText>;
721
- isLVal(props?: object | null): this is NodePath<t.LVal>;
722
- isLabeledStatement(props?: object | null): this is NodePath<t.LabeledStatement>;
723
- isLiteral(props?: object | null): this is NodePath<t.Literal>;
724
- isLogicalExpression(props?: object | null): this is NodePath<t.LogicalExpression>;
725
- isLoop(props?: object | null): this is NodePath<t.Loop>;
726
- isMemberExpression(props?: object | null): this is NodePath<t.MemberExpression>;
727
- isMetaProperty(props?: object | null): this is NodePath<t.MetaProperty>;
728
- isMethod(props?: object | null): this is NodePath<t.Method>;
729
- isMixedTypeAnnotation(props?: object | null): this is NodePath<t.MixedTypeAnnotation>;
730
- isModuleDeclaration(props?: object | null): this is NodePath<t.ModuleDeclaration>;
731
- isModuleSpecifier(props?: object | null): this is NodePath<t.ModuleSpecifier>;
732
- isNewExpression(props?: object | null): this is NodePath<t.NewExpression>;
733
- isNoop(props?: object | null): this is NodePath<t.Noop>;
734
- isNullLiteral(props?: object | null): this is NodePath<t.NullLiteral>;
735
- isNullLiteralTypeAnnotation(props?: object | null): this is NodePath<t.NullLiteralTypeAnnotation>;
736
- isNullableTypeAnnotation(props?: object | null): this is NodePath<t.NullableTypeAnnotation>;
807
+ isAccessor(opts?: object): this is NodePath<t.Accessor>;
808
+ isAnyTypeAnnotation(opts?: object): this is NodePath<t.AnyTypeAnnotation>;
809
+ isArgumentPlaceholder(opts?: object): this is NodePath<t.ArgumentPlaceholder>;
810
+ isArrayExpression(opts?: object): this is NodePath<t.ArrayExpression>;
811
+ isArrayPattern(opts?: object): this is NodePath<t.ArrayPattern>;
812
+ isArrayTypeAnnotation(opts?: object): this is NodePath<t.ArrayTypeAnnotation>;
813
+ isArrowFunctionExpression(opts?: object): this is NodePath<t.ArrowFunctionExpression>;
814
+ isAssignmentExpression(opts?: object): this is NodePath<t.AssignmentExpression>;
815
+ isAssignmentPattern(opts?: object): this is NodePath<t.AssignmentPattern>;
816
+ isAwaitExpression(opts?: object): this is NodePath<t.AwaitExpression>;
817
+ isBigIntLiteral(opts?: object): this is NodePath<t.BigIntLiteral>;
818
+ isBinary(opts?: object): this is NodePath<t.Binary>;
819
+ isBinaryExpression(opts?: object): this is NodePath<t.BinaryExpression>;
820
+ isBindExpression(opts?: object): this is NodePath<t.BindExpression>;
821
+ isBlock(opts?: object): this is NodePath<t.Block>;
822
+ isBlockParent(opts?: object): this is NodePath<t.BlockParent>;
823
+ isBlockStatement(opts?: object): this is NodePath<t.BlockStatement>;
824
+ isBooleanLiteral(opts?: object): this is NodePath<t.BooleanLiteral>;
825
+ isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath<t.BooleanLiteralTypeAnnotation>;
826
+ isBooleanTypeAnnotation(opts?: object): this is NodePath<t.BooleanTypeAnnotation>;
827
+ isBreakStatement(opts?: object): this is NodePath<t.BreakStatement>;
828
+ isCallExpression(opts?: object): this is NodePath<t.CallExpression>;
829
+ isCatchClause(opts?: object): this is NodePath<t.CatchClause>;
830
+ isClass(opts?: object): this is NodePath<t.Class>;
831
+ isClassAccessorProperty(opts?: object): this is NodePath<t.ClassAccessorProperty>;
832
+ isClassBody(opts?: object): this is NodePath<t.ClassBody>;
833
+ isClassDeclaration(opts?: object): this is NodePath<t.ClassDeclaration>;
834
+ isClassExpression(opts?: object): this is NodePath<t.ClassExpression>;
835
+ isClassImplements(opts?: object): this is NodePath<t.ClassImplements>;
836
+ isClassMethod(opts?: object): this is NodePath<t.ClassMethod>;
837
+ isClassPrivateMethod(opts?: object): this is NodePath<t.ClassPrivateMethod>;
838
+ isClassPrivateProperty(opts?: object): this is NodePath<t.ClassPrivateProperty>;
839
+ isClassProperty(opts?: object): this is NodePath<t.ClassProperty>;
840
+ isCompletionStatement(opts?: object): this is NodePath<t.CompletionStatement>;
841
+ isConditional(opts?: object): this is NodePath<t.Conditional>;
842
+ isConditionalExpression(opts?: object): this is NodePath<t.ConditionalExpression>;
843
+ isContinueStatement(opts?: object): this is NodePath<t.ContinueStatement>;
844
+ isDebuggerStatement(opts?: object): this is NodePath<t.DebuggerStatement>;
845
+ isDecimalLiteral(opts?: object): this is NodePath<t.DecimalLiteral>;
846
+ isDeclaration(opts?: object): this is NodePath<t.Declaration>;
847
+ isDeclareClass(opts?: object): this is NodePath<t.DeclareClass>;
848
+ isDeclareExportAllDeclaration(opts?: object): this is NodePath<t.DeclareExportAllDeclaration>;
849
+ isDeclareExportDeclaration(opts?: object): this is NodePath<t.DeclareExportDeclaration>;
850
+ isDeclareFunction(opts?: object): this is NodePath<t.DeclareFunction>;
851
+ isDeclareInterface(opts?: object): this is NodePath<t.DeclareInterface>;
852
+ isDeclareModule(opts?: object): this is NodePath<t.DeclareModule>;
853
+ isDeclareModuleExports(opts?: object): this is NodePath<t.DeclareModuleExports>;
854
+ isDeclareOpaqueType(opts?: object): this is NodePath<t.DeclareOpaqueType>;
855
+ isDeclareTypeAlias(opts?: object): this is NodePath<t.DeclareTypeAlias>;
856
+ isDeclareVariable(opts?: object): this is NodePath<t.DeclareVariable>;
857
+ isDeclaredPredicate(opts?: object): this is NodePath<t.DeclaredPredicate>;
858
+ isDecorator(opts?: object): this is NodePath<t.Decorator>;
859
+ isDirective(opts?: object): this is NodePath<t.Directive>;
860
+ isDirectiveLiteral(opts?: object): this is NodePath<t.DirectiveLiteral>;
861
+ isDoExpression(opts?: object): this is NodePath<t.DoExpression>;
862
+ isDoWhileStatement(opts?: object): this is NodePath<t.DoWhileStatement>;
863
+ isEmptyStatement(opts?: object): this is NodePath<t.EmptyStatement>;
864
+ isEmptyTypeAnnotation(opts?: object): this is NodePath<t.EmptyTypeAnnotation>;
865
+ isEnumBody(opts?: object): this is NodePath<t.EnumBody>;
866
+ isEnumBooleanBody(opts?: object): this is NodePath<t.EnumBooleanBody>;
867
+ isEnumBooleanMember(opts?: object): this is NodePath<t.EnumBooleanMember>;
868
+ isEnumDeclaration(opts?: object): this is NodePath<t.EnumDeclaration>;
869
+ isEnumDefaultedMember(opts?: object): this is NodePath<t.EnumDefaultedMember>;
870
+ isEnumMember(opts?: object): this is NodePath<t.EnumMember>;
871
+ isEnumNumberBody(opts?: object): this is NodePath<t.EnumNumberBody>;
872
+ isEnumNumberMember(opts?: object): this is NodePath<t.EnumNumberMember>;
873
+ isEnumStringBody(opts?: object): this is NodePath<t.EnumStringBody>;
874
+ isEnumStringMember(opts?: object): this is NodePath<t.EnumStringMember>;
875
+ isEnumSymbolBody(opts?: object): this is NodePath<t.EnumSymbolBody>;
876
+ isExistsTypeAnnotation(opts?: object): this is NodePath<t.ExistsTypeAnnotation>;
877
+ isExportAllDeclaration(opts?: object): this is NodePath<t.ExportAllDeclaration>;
878
+ isExportDeclaration(opts?: object): this is NodePath<t.ExportDeclaration>;
879
+ isExportDefaultDeclaration(opts?: object): this is NodePath<t.ExportDefaultDeclaration>;
880
+ isExportDefaultSpecifier(opts?: object): this is NodePath<t.ExportDefaultSpecifier>;
881
+ isExportNamedDeclaration(opts?: object): this is NodePath<t.ExportNamedDeclaration>;
882
+ isExportNamespaceSpecifier(opts?: object): this is NodePath<t.ExportNamespaceSpecifier>;
883
+ isExportSpecifier(opts?: object): this is NodePath<t.ExportSpecifier>;
884
+ isExpression(opts?: object): this is NodePath<t.Expression>;
885
+ isExpressionStatement(opts?: object): this is NodePath<t.ExpressionStatement>;
886
+ isExpressionWrapper(opts?: object): this is NodePath<t.ExpressionWrapper>;
887
+ isFile(opts?: object): this is NodePath<t.File>;
888
+ isFlow(opts?: object): this is NodePath<t.Flow>;
889
+ isFlowBaseAnnotation(opts?: object): this is NodePath<t.FlowBaseAnnotation>;
890
+ isFlowDeclaration(opts?: object): this is NodePath<t.FlowDeclaration>;
891
+ isFlowPredicate(opts?: object): this is NodePath<t.FlowPredicate>;
892
+ isFlowType(opts?: object): this is NodePath<t.FlowType>;
893
+ isFor(opts?: object): this is NodePath<t.For>;
894
+ isForInStatement(opts?: object): this is NodePath<t.ForInStatement>;
895
+ isForOfStatement(opts?: object): this is NodePath<t.ForOfStatement>;
896
+ isForStatement(opts?: object): this is NodePath<t.ForStatement>;
897
+ isForXStatement(opts?: object): this is NodePath<t.ForXStatement>;
898
+ isFunction(opts?: object): this is NodePath<t.Function>;
899
+ isFunctionDeclaration(opts?: object): this is NodePath<t.FunctionDeclaration>;
900
+ isFunctionExpression(opts?: object): this is NodePath<t.FunctionExpression>;
901
+ isFunctionParent(opts?: object): this is NodePath<t.FunctionParent>;
902
+ isFunctionTypeAnnotation(opts?: object): this is NodePath<t.FunctionTypeAnnotation>;
903
+ isFunctionTypeParam(opts?: object): this is NodePath<t.FunctionTypeParam>;
904
+ isGenericTypeAnnotation(opts?: object): this is NodePath<t.GenericTypeAnnotation>;
905
+ isIdentifier(opts?: object): this is NodePath<t.Identifier>;
906
+ isIfStatement(opts?: object): this is NodePath<t.IfStatement>;
907
+ isImmutable(opts?: object): this is NodePath<t.Immutable>;
908
+ isImport(opts?: object): this is NodePath<t.Import>;
909
+ isImportAttribute(opts?: object): this is NodePath<t.ImportAttribute>;
910
+ isImportDeclaration(opts?: object): this is NodePath<t.ImportDeclaration>;
911
+ isImportDefaultSpecifier(opts?: object): this is NodePath<t.ImportDefaultSpecifier>;
912
+ isImportNamespaceSpecifier(opts?: object): this is NodePath<t.ImportNamespaceSpecifier>;
913
+ isImportSpecifier(opts?: object): this is NodePath<t.ImportSpecifier>;
914
+ isIndexedAccessType(opts?: object): this is NodePath<t.IndexedAccessType>;
915
+ isInferredPredicate(opts?: object): this is NodePath<t.InferredPredicate>;
916
+ isInterfaceDeclaration(opts?: object): this is NodePath<t.InterfaceDeclaration>;
917
+ isInterfaceExtends(opts?: object): this is NodePath<t.InterfaceExtends>;
918
+ isInterfaceTypeAnnotation(opts?: object): this is NodePath<t.InterfaceTypeAnnotation>;
919
+ isInterpreterDirective(opts?: object): this is NodePath<t.InterpreterDirective>;
920
+ isIntersectionTypeAnnotation(opts?: object): this is NodePath<t.IntersectionTypeAnnotation>;
921
+ isJSX(opts?: object): this is NodePath<t.JSX>;
922
+ isJSXAttribute(opts?: object): this is NodePath<t.JSXAttribute>;
923
+ isJSXClosingElement(opts?: object): this is NodePath<t.JSXClosingElement>;
924
+ isJSXClosingFragment(opts?: object): this is NodePath<t.JSXClosingFragment>;
925
+ isJSXElement(opts?: object): this is NodePath<t.JSXElement>;
926
+ isJSXEmptyExpression(opts?: object): this is NodePath<t.JSXEmptyExpression>;
927
+ isJSXExpressionContainer(opts?: object): this is NodePath<t.JSXExpressionContainer>;
928
+ isJSXFragment(opts?: object): this is NodePath<t.JSXFragment>;
929
+ isJSXIdentifier(opts?: object): this is NodePath<t.JSXIdentifier>;
930
+ isJSXMemberExpression(opts?: object): this is NodePath<t.JSXMemberExpression>;
931
+ isJSXNamespacedName(opts?: object): this is NodePath<t.JSXNamespacedName>;
932
+ isJSXOpeningElement(opts?: object): this is NodePath<t.JSXOpeningElement>;
933
+ isJSXOpeningFragment(opts?: object): this is NodePath<t.JSXOpeningFragment>;
934
+ isJSXSpreadAttribute(opts?: object): this is NodePath<t.JSXSpreadAttribute>;
935
+ isJSXSpreadChild(opts?: object): this is NodePath<t.JSXSpreadChild>;
936
+ isJSXText(opts?: object): this is NodePath<t.JSXText>;
937
+ isLVal(opts?: object): this is NodePath<t.LVal>;
938
+ isLabeledStatement(opts?: object): this is NodePath<t.LabeledStatement>;
939
+ isLiteral(opts?: object): this is NodePath<t.Literal>;
940
+ isLogicalExpression(opts?: object): this is NodePath<t.LogicalExpression>;
941
+ isLoop(opts?: object): this is NodePath<t.Loop>;
942
+ isMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
943
+ isMetaProperty(opts?: object): this is NodePath<t.MetaProperty>;
944
+ isMethod(opts?: object): this is NodePath<t.Method>;
945
+ isMiscellaneous(opts?: object): this is NodePath<t.Miscellaneous>;
946
+ isMixedTypeAnnotation(opts?: object): this is NodePath<t.MixedTypeAnnotation>;
947
+ isModuleDeclaration(opts?: object): this is NodePath<t.ModuleDeclaration>;
948
+ isModuleExpression(opts?: object): this is NodePath<t.ModuleExpression>;
949
+ isModuleSpecifier(opts?: object): this is NodePath<t.ModuleSpecifier>;
950
+ isNewExpression(opts?: object): this is NodePath<t.NewExpression>;
951
+ isNoop(opts?: object): this is NodePath<t.Noop>;
952
+ isNullLiteral(opts?: object): this is NodePath<t.NullLiteral>;
953
+ isNullLiteralTypeAnnotation(opts?: object): this is NodePath<t.NullLiteralTypeAnnotation>;
954
+ isNullableTypeAnnotation(opts?: object): this is NodePath<t.NullableTypeAnnotation>;
737
955
 
738
956
  /** @deprecated Use `isNumericLiteral` */
739
- isNumberLiteral(props?: object | null): this is NodePath<t.NumericLiteral>;
740
- isNumberLiteralTypeAnnotation(props?: object | null): this is NodePath<t.NumberLiteralTypeAnnotation>;
741
- isNumberTypeAnnotation(props?: object | null): this is NodePath<t.NumberTypeAnnotation>;
742
- isNumericLiteral(props?: object | null): this is NodePath<t.NumericLiteral>;
743
- isObjectExpression(props?: object | null): this is NodePath<t.ObjectExpression>;
744
- isObjectMember(props?: object | null): this is NodePath<t.ObjectMember>;
745
- isObjectMethod(props?: object | null): this is NodePath<t.ObjectMethod>;
746
- isObjectPattern(props?: object | null): this is NodePath<t.ObjectPattern>;
747
- isObjectProperty(props?: object | null): this is NodePath<t.ObjectProperty>;
748
- isObjectTypeAnnotation(props?: object | null): this is NodePath<t.ObjectTypeAnnotation>;
749
- isObjectTypeCallProperty(props?: object | null): this is NodePath<t.ObjectTypeCallProperty>;
750
- isObjectTypeIndexer(props?: object | null): this is NodePath<t.ObjectTypeIndexer>;
751
- isObjectTypeInternalSlot(props?: object | null): this is NodePath<t.ObjectTypeInternalSlot>;
752
- isObjectTypeProperty(props?: object | null): this is NodePath<t.ObjectTypeProperty>;
753
- isObjectTypeSpreadProperty(props?: object | null): this is NodePath<t.ObjectTypeSpreadProperty>;
754
- isOpaqueType(props?: object | null): this is NodePath<t.OpaqueType>;
755
- isOptionalCallExpression(props?: object | null): this is NodePath<t.OptionalCallExpression>;
756
- isOptionalMemberExpression(props?: object | null): this is NodePath<t.OptionalMemberExpression>;
757
- isParenthesizedExpression(props?: object | null): this is NodePath<t.ParenthesizedExpression>;
758
- isPattern(props?: object | null): this is NodePath<t.Pattern>;
759
- isPatternLike(props?: object | null): this is NodePath<t.PatternLike>;
760
- isPipelineBareFunction(props?: object | null): this is NodePath<t.PipelineBareFunction>;
761
- isPipelinePrimaryTopicReference(props?: object | null): this is NodePath<t.PipelinePrimaryTopicReference>;
762
- isPipelineTopicExpression(props?: object | null): this is NodePath<t.PipelineTopicExpression>;
763
- isPrivate(props?: object | null): this is NodePath<t.Private>;
764
- isPrivateName(props?: object | null): this is NodePath<t.PrivateName>;
765
- isProgram(props?: object | null): this is NodePath<t.Program>;
766
- isProperty(props?: object | null): this is NodePath<t.Property>;
767
- isPureish(props?: object | null): this is NodePath<t.Pureish>;
768
- isQualifiedTypeIdentifier(props?: object | null): this is NodePath<t.QualifiedTypeIdentifier>;
769
- isRegExpLiteral(props?: object | null): this is NodePath<t.RegExpLiteral>;
957
+ isNumberLiteral(opts?: object): this is NodePath<t.NumberLiteral>;
958
+ isNumberLiteralTypeAnnotation(opts?: object): this is NodePath<t.NumberLiteralTypeAnnotation>;
959
+ isNumberTypeAnnotation(opts?: object): this is NodePath<t.NumberTypeAnnotation>;
960
+ isNumericLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
961
+ isObjectExpression(opts?: object): this is NodePath<t.ObjectExpression>;
962
+ isObjectMember(opts?: object): this is NodePath<t.ObjectMember>;
963
+ isObjectMethod(opts?: object): this is NodePath<t.ObjectMethod>;
964
+ isObjectPattern(opts?: object): this is NodePath<t.ObjectPattern>;
965
+ isObjectProperty(opts?: object): this is NodePath<t.ObjectProperty>;
966
+ isObjectTypeAnnotation(opts?: object): this is NodePath<t.ObjectTypeAnnotation>;
967
+ isObjectTypeCallProperty(opts?: object): this is NodePath<t.ObjectTypeCallProperty>;
968
+ isObjectTypeIndexer(opts?: object): this is NodePath<t.ObjectTypeIndexer>;
969
+ isObjectTypeInternalSlot(opts?: object): this is NodePath<t.ObjectTypeInternalSlot>;
970
+ isObjectTypeProperty(opts?: object): this is NodePath<t.ObjectTypeProperty>;
971
+ isObjectTypeSpreadProperty(opts?: object): this is NodePath<t.ObjectTypeSpreadProperty>;
972
+ isOpaqueType(opts?: object): this is NodePath<t.OpaqueType>;
973
+ isOptionalCallExpression(opts?: object): this is NodePath<t.OptionalCallExpression>;
974
+ isOptionalIndexedAccessType(opts?: object): this is NodePath<t.OptionalIndexedAccessType>;
975
+ isOptionalMemberExpression(opts?: object): this is NodePath<t.OptionalMemberExpression>;
976
+ isParenthesizedExpression(opts?: object): this is NodePath<t.ParenthesizedExpression>;
977
+ isPattern(opts?: object): this is NodePath<t.Pattern>;
978
+ isPatternLike(opts?: object): this is NodePath<t.PatternLike>;
979
+ isPipelineBareFunction(opts?: object): this is NodePath<t.PipelineBareFunction>;
980
+ isPipelinePrimaryTopicReference(opts?: object): this is NodePath<t.PipelinePrimaryTopicReference>;
981
+ isPipelineTopicExpression(opts?: object): this is NodePath<t.PipelineTopicExpression>;
982
+ isPlaceholder(opts?: object): this is NodePath<t.Placeholder>;
983
+ isPrivate(opts?: object): this is NodePath<t.Private>;
984
+ isPrivateName(opts?: object): this is NodePath<t.PrivateName>;
985
+ isProgram(opts?: object): this is NodePath<t.Program>;
986
+ isProperty(opts?: object): this is NodePath<t.Property>;
987
+ isPureish(opts?: object): this is NodePath<t.Pureish>;
988
+ isQualifiedTypeIdentifier(opts?: object): this is NodePath<t.QualifiedTypeIdentifier>;
989
+ isRecordExpression(opts?: object): this is NodePath<t.RecordExpression>;
990
+ isRegExpLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
770
991
 
771
992
  /** @deprecated Use `isRegExpLiteral` */
772
- isRegexLiteral(props?: object | null): this is NodePath<t.RegExpLiteral>;
773
- isRestElement(props?: object | null): this is NodePath<t.RestElement>;
993
+ isRegexLiteral(opts?: object): this is NodePath<t.RegexLiteral>;
994
+ isRestElement(opts?: object): this is NodePath<t.RestElement>;
774
995
 
775
996
  /** @deprecated Use `isRestElement` */
776
- isRestProperty(props?: object | null): this is NodePath<t.RestElement>;
777
- isReturnStatement(props?: object | null): this is NodePath<t.ReturnStatement>;
778
- isScopable(props?: object | null): this is NodePath<t.Scopable>;
779
- isSequenceExpression(props?: object | null): this is NodePath<t.SequenceExpression>;
780
- isSpreadElement(props?: object | null): this is NodePath<t.SpreadElement>;
997
+ isRestProperty(opts?: object): this is NodePath<t.RestProperty>;
998
+ isReturnStatement(opts?: object): this is NodePath<t.ReturnStatement>;
999
+ isScopable(opts?: object): this is NodePath<t.Scopable>;
1000
+ isSequenceExpression(opts?: object): this is NodePath<t.SequenceExpression>;
1001
+ isSpreadElement(opts?: object): this is NodePath<t.SpreadElement>;
781
1002
 
782
1003
  /** @deprecated Use `isSpreadElement` */
783
- isSpreadProperty(props?: object | null): this is NodePath<t.SpreadElement>;
784
- isStatement(props?: object | null): this is NodePath<t.Statement>;
785
- isStringLiteral(props?: object | null): this is NodePath<t.StringLiteral>;
786
- isStringLiteralTypeAnnotation(props?: object | null): this is NodePath<t.StringLiteralTypeAnnotation>;
787
- isStringTypeAnnotation(props?: object | null): this is NodePath<t.StringTypeAnnotation>;
788
- isSuper(props?: object | null): this is NodePath<t.Super>;
789
- isSwitchCase(props?: object | null): this is NodePath<t.SwitchCase>;
790
- isSwitchStatement(props?: object | null): this is NodePath<t.SwitchStatement>;
791
- isTSAnyKeyword(props?: object | null): this is NodePath<t.TSAnyKeyword>;
792
- isTSArrayType(props?: object | null): this is NodePath<t.TSArrayType>;
793
- isTSAsExpression(props?: object | null): this is NodePath<t.TSAsExpression>;
794
- isTSBooleanKeyword(props?: object | null): this is NodePath<t.TSBooleanKeyword>;
795
- isTSCallSignatureDeclaration(props?: object | null): this is NodePath<t.TSCallSignatureDeclaration>;
796
- isTSConditionalType(props?: object | null): this is NodePath<t.TSConditionalType>;
797
- isTSConstructSignatureDeclaration(props?: object | null): this is NodePath<t.TSConstructSignatureDeclaration>;
798
- isTSConstructorType(props?: object | null): this is NodePath<t.TSConstructorType>;
799
- isTSDeclareFunction(props?: object | null): this is NodePath<t.TSDeclareFunction>;
800
- isTSDeclareMethod(props?: object | null): this is NodePath<t.TSDeclareMethod>;
801
- isTSEntityName(props?: object | null): this is NodePath<t.TSEntityName>;
802
- isTSEnumDeclaration(props?: object | null): this is NodePath<t.TSEnumDeclaration>;
803
- isTSEnumMember(props?: object | null): this is NodePath<t.TSEnumMember>;
804
- isTSExportAssignment(props?: object | null): this is NodePath<t.TSExportAssignment>;
805
- isTSExpressionWithTypeArguments(props?: object | null): this is NodePath<t.TSExpressionWithTypeArguments>;
806
- isTSExternalModuleReference(props?: object | null): this is NodePath<t.TSExternalModuleReference>;
807
- isTSFunctionType(props?: object | null): this is NodePath<t.TSFunctionType>;
808
- isTSImportEqualsDeclaration(props?: object | null): this is NodePath<t.TSImportEqualsDeclaration>;
809
- isTSImportType(props?: object | null): this is NodePath<t.TSImportType>;
810
- isTSIndexSignature(props?: object | null): this is NodePath<t.TSIndexSignature>;
811
- isTSIndexedAccessType(props?: object | null): this is NodePath<t.TSIndexedAccessType>;
812
- isTSInferType(props?: object | null): this is NodePath<t.TSInferType>;
813
- isTSInterfaceBody(props?: object | null): this is NodePath<t.TSInterfaceBody>;
814
- isTSInterfaceDeclaration(props?: object | null): this is NodePath<t.TSInterfaceDeclaration>;
815
- isTSIntersectionType(props?: object | null): this is NodePath<t.TSIntersectionType>;
816
- isTSLiteralType(props?: object | null): this is NodePath<t.TSLiteralType>;
817
- isTSMappedType(props?: object | null): this is NodePath<t.TSMappedType>;
818
- isTSMethodSignature(props?: object | null): this is NodePath<t.TSMethodSignature>;
819
- isTSModuleBlock(props?: object | null): this is NodePath<t.TSModuleBlock>;
820
- isTSModuleDeclaration(props?: object | null): this is NodePath<t.TSModuleDeclaration>;
821
- isTSNamespaceExportDeclaration(props?: object | null): this is NodePath<t.TSNamespaceExportDeclaration>;
822
- isTSNeverKeyword(props?: object | null): this is NodePath<t.TSNeverKeyword>;
823
- isTSNonNullExpression(props?: object | null): this is NodePath<t.TSNonNullExpression>;
824
- isTSNullKeyword(props?: object | null): this is NodePath<t.TSNullKeyword>;
825
- isTSNumberKeyword(props?: object | null): this is NodePath<t.TSNumberKeyword>;
826
- isTSObjectKeyword(props?: object | null): this is NodePath<t.TSObjectKeyword>;
827
- isTSOptionalType(props?: object | null): this is NodePath<t.TSOptionalType>;
828
- isTSParameterProperty(props?: object | null): this is NodePath<t.TSParameterProperty>;
829
- isTSParenthesizedType(props?: object | null): this is NodePath<t.TSParenthesizedType>;
830
- isTSPropertySignature(props?: object | null): this is NodePath<t.TSPropertySignature>;
831
- isTSQualifiedName(props?: object | null): this is NodePath<t.TSQualifiedName>;
832
- isTSRestType(props?: object | null): this is NodePath<t.TSRestType>;
833
- isTSStringKeyword(props?: object | null): this is NodePath<t.TSStringKeyword>;
834
- isTSSymbolKeyword(props?: object | null): this is NodePath<t.TSSymbolKeyword>;
835
- isTSThisType(props?: object | null): this is NodePath<t.TSThisType>;
836
- isTSTupleType(props?: object | null): this is NodePath<t.TSTupleType>;
837
- isTSType(props?: object | null): this is NodePath<t.TSType>;
838
- isTSTypeAliasDeclaration(props?: object | null): this is NodePath<t.TSTypeAliasDeclaration>;
839
- isTSTypeAnnotation(props?: object | null): this is NodePath<t.TSTypeAnnotation>;
840
- isTSTypeAssertion(props?: object | null): this is NodePath<t.TSTypeAssertion>;
841
- isTSTypeElement(props?: object | null): this is NodePath<t.TSTypeElement>;
842
- isTSTypeLiteral(props?: object | null): this is NodePath<t.TSTypeLiteral>;
843
- isTSTypeOperator(props?: object | null): this is NodePath<t.TSTypeOperator>;
844
- isTSTypeParameter(props?: object | null): this is NodePath<t.TSTypeParameter>;
845
- isTSTypeParameterDeclaration(props?: object | null): this is NodePath<t.TSTypeParameterDeclaration>;
846
- isTSTypeParameterInstantiation(props?: object | null): this is NodePath<t.TSTypeParameterInstantiation>;
847
- isTSTypePredicate(props?: object | null): this is NodePath<t.TSTypePredicate>;
848
- isTSTypeQuery(props?: object | null): this is NodePath<t.TSTypeQuery>;
849
- isTSTypeReference(props?: object | null): this is NodePath<t.TSTypeReference>;
850
- isTSUndefinedKeyword(props?: object | null): this is NodePath<t.TSUndefinedKeyword>;
851
- isTSUnionType(props?: object | null): this is NodePath<t.TSUnionType>;
852
- isTSUnknownKeyword(props?: object | null): this is NodePath<t.TSUnknownKeyword>;
853
- isTSVoidKeyword(props?: object | null): this is NodePath<t.TSVoidKeyword>;
854
- isTaggedTemplateExpression(props?: object | null): this is NodePath<t.TaggedTemplateExpression>;
855
- isTemplateElement(props?: object | null): this is NodePath<t.TemplateElement>;
856
- isTemplateLiteral(props?: object | null): this is NodePath<t.TemplateLiteral>;
857
- isTerminatorless(props?: object | null): this is NodePath<t.Terminatorless>;
858
- isThisExpression(props?: object | null): this is NodePath<t.ThisExpression>;
859
- isThisTypeAnnotation(props?: object | null): this is NodePath<t.ThisTypeAnnotation>;
860
- isThrowStatement(props?: object | null): this is NodePath<t.ThrowStatement>;
861
- isTryStatement(props?: object | null): this is NodePath<t.TryStatement>;
862
- isTupleTypeAnnotation(props?: object | null): this is NodePath<t.TupleTypeAnnotation>;
863
- isTypeAlias(props?: object | null): this is NodePath<t.TypeAlias>;
864
- isTypeAnnotation(props?: object | null): this is NodePath<t.TypeAnnotation>;
865
- isTypeCastExpression(props?: object | null): this is NodePath<t.TypeCastExpression>;
866
- isTypeParameter(props?: object | null): this is NodePath<t.TypeParameter>;
867
- isTypeParameterDeclaration(props?: object | null): this is NodePath<t.TypeParameterDeclaration>;
868
- isTypeParameterInstantiation(props?: object | null): this is NodePath<t.TypeParameterInstantiation>;
869
- isTypeofTypeAnnotation(props?: object | null): this is NodePath<t.TypeofTypeAnnotation>;
870
- isUnaryExpression(props?: object | null): this is NodePath<t.UnaryExpression>;
871
- isUnaryLike(props?: object | null): this is NodePath<t.UnaryLike>;
872
- isUnionTypeAnnotation(props?: object | null): this is NodePath<t.UnionTypeAnnotation>;
873
- isUpdateExpression(props?: object | null): this is NodePath<t.UpdateExpression>;
874
- isUserWhitespacable(props?: object | null): this is NodePath<t.UserWhitespacable>;
875
- isVariableDeclaration(props?: object | null): this is NodePath<t.VariableDeclaration>;
876
- isVariableDeclarator(props?: object | null): this is NodePath<t.VariableDeclarator>;
877
- isVariance(props?: object | null): this is NodePath<t.Variance>;
878
- isVoidTypeAnnotation(props?: object | null): this is NodePath<t.VoidTypeAnnotation>;
879
- isWhile(props?: object | null): this is NodePath<t.While>;
880
- isWhileStatement(props?: object | null): this is NodePath<t.WhileStatement>;
881
- isWithStatement(props?: object | null): this is NodePath<t.WithStatement>;
882
- isYieldExpression(props?: object | null): this is NodePath<t.YieldExpression>;
883
-
884
- isBindingIdentifier(props?: object | null): this is NodePath<t.Identifier>;
885
- isBlockScoped(
886
- props?: object | null,
887
- ): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
888
- isGenerated(props?: object | null): boolean;
889
- isPure(props?: object | null): boolean;
890
- isReferenced(props?: object | null): boolean;
891
- isReferencedIdentifier(props?: object | null): this is NodePath<t.Identifier | t.JSXIdentifier>;
892
- isReferencedMemberExpression(props?: object | null): this is NodePath<t.MemberExpression>;
893
- isScope(props?: object | null): this is NodePath<t.Scopable>;
894
- isUser(props?: object | null): boolean;
895
- isVar(props?: object | null): this is NodePath<t.VariableDeclaration>;
1004
+ isSpreadProperty(opts?: object): this is NodePath<t.SpreadProperty>;
1005
+ isStandardized(opts?: object): this is NodePath<t.Standardized>;
1006
+ isStatement(opts?: object): this is NodePath<t.Statement>;
1007
+ isStaticBlock(opts?: object): this is NodePath<t.StaticBlock>;
1008
+ isStringLiteral(opts?: object): this is NodePath<t.StringLiteral>;
1009
+ isStringLiteralTypeAnnotation(opts?: object): this is NodePath<t.StringLiteralTypeAnnotation>;
1010
+ isStringTypeAnnotation(opts?: object): this is NodePath<t.StringTypeAnnotation>;
1011
+ isSuper(opts?: object): this is NodePath<t.Super>;
1012
+ isSwitchCase(opts?: object): this is NodePath<t.SwitchCase>;
1013
+ isSwitchStatement(opts?: object): this is NodePath<t.SwitchStatement>;
1014
+ isSymbolTypeAnnotation(opts?: object): this is NodePath<t.SymbolTypeAnnotation>;
1015
+ isTSAnyKeyword(opts?: object): this is NodePath<t.TSAnyKeyword>;
1016
+ isTSArrayType(opts?: object): this is NodePath<t.TSArrayType>;
1017
+ isTSAsExpression(opts?: object): this is NodePath<t.TSAsExpression>;
1018
+ isTSBaseType(opts?: object): this is NodePath<t.TSBaseType>;
1019
+ isTSBigIntKeyword(opts?: object): this is NodePath<t.TSBigIntKeyword>;
1020
+ isTSBooleanKeyword(opts?: object): this is NodePath<t.TSBooleanKeyword>;
1021
+ isTSCallSignatureDeclaration(opts?: object): this is NodePath<t.TSCallSignatureDeclaration>;
1022
+ isTSConditionalType(opts?: object): this is NodePath<t.TSConditionalType>;
1023
+ isTSConstructSignatureDeclaration(opts?: object): this is NodePath<t.TSConstructSignatureDeclaration>;
1024
+ isTSConstructorType(opts?: object): this is NodePath<t.TSConstructorType>;
1025
+ isTSDeclareFunction(opts?: object): this is NodePath<t.TSDeclareFunction>;
1026
+ isTSDeclareMethod(opts?: object): this is NodePath<t.TSDeclareMethod>;
1027
+ isTSEntityName(opts?: object): this is NodePath<t.TSEntityName>;
1028
+ isTSEnumDeclaration(opts?: object): this is NodePath<t.TSEnumDeclaration>;
1029
+ isTSEnumMember(opts?: object): this is NodePath<t.TSEnumMember>;
1030
+ isTSExportAssignment(opts?: object): this is NodePath<t.TSExportAssignment>;
1031
+ isTSExpressionWithTypeArguments(opts?: object): this is NodePath<t.TSExpressionWithTypeArguments>;
1032
+ isTSExternalModuleReference(opts?: object): this is NodePath<t.TSExternalModuleReference>;
1033
+ isTSFunctionType(opts?: object): this is NodePath<t.TSFunctionType>;
1034
+ isTSImportEqualsDeclaration(opts?: object): this is NodePath<t.TSImportEqualsDeclaration>;
1035
+ isTSImportType(opts?: object): this is NodePath<t.TSImportType>;
1036
+ isTSIndexSignature(opts?: object): this is NodePath<t.TSIndexSignature>;
1037
+ isTSIndexedAccessType(opts?: object): this is NodePath<t.TSIndexedAccessType>;
1038
+ isTSInferType(opts?: object): this is NodePath<t.TSInferType>;
1039
+ isTSInstantiationExpression(opts?: object): this is NodePath<t.TSInstantiationExpression>;
1040
+ isTSInterfaceBody(opts?: object): this is NodePath<t.TSInterfaceBody>;
1041
+ isTSInterfaceDeclaration(opts?: object): this is NodePath<t.TSInterfaceDeclaration>;
1042
+ isTSIntersectionType(opts?: object): this is NodePath<t.TSIntersectionType>;
1043
+ isTSIntrinsicKeyword(opts?: object): this is NodePath<t.TSIntrinsicKeyword>;
1044
+ isTSLiteralType(opts?: object): this is NodePath<t.TSLiteralType>;
1045
+ isTSMappedType(opts?: object): this is NodePath<t.TSMappedType>;
1046
+ isTSMethodSignature(opts?: object): this is NodePath<t.TSMethodSignature>;
1047
+ isTSModuleBlock(opts?: object): this is NodePath<t.TSModuleBlock>;
1048
+ isTSModuleDeclaration(opts?: object): this is NodePath<t.TSModuleDeclaration>;
1049
+ isTSNamedTupleMember(opts?: object): this is NodePath<t.TSNamedTupleMember>;
1050
+ isTSNamespaceExportDeclaration(opts?: object): this is NodePath<t.TSNamespaceExportDeclaration>;
1051
+ isTSNeverKeyword(opts?: object): this is NodePath<t.TSNeverKeyword>;
1052
+ isTSNonNullExpression(opts?: object): this is NodePath<t.TSNonNullExpression>;
1053
+ isTSNullKeyword(opts?: object): this is NodePath<t.TSNullKeyword>;
1054
+ isTSNumberKeyword(opts?: object): this is NodePath<t.TSNumberKeyword>;
1055
+ isTSObjectKeyword(opts?: object): this is NodePath<t.TSObjectKeyword>;
1056
+ isTSOptionalType(opts?: object): this is NodePath<t.TSOptionalType>;
1057
+ isTSParameterProperty(opts?: object): this is NodePath<t.TSParameterProperty>;
1058
+ isTSParenthesizedType(opts?: object): this is NodePath<t.TSParenthesizedType>;
1059
+ isTSPropertySignature(opts?: object): this is NodePath<t.TSPropertySignature>;
1060
+ isTSQualifiedName(opts?: object): this is NodePath<t.TSQualifiedName>;
1061
+ isTSRestType(opts?: object): this is NodePath<t.TSRestType>;
1062
+ isTSSatisfiesExpression(opts?: object): this is NodePath<t.TSSatisfiesExpression>;
1063
+ isTSStringKeyword(opts?: object): this is NodePath<t.TSStringKeyword>;
1064
+ isTSSymbolKeyword(opts?: object): this is NodePath<t.TSSymbolKeyword>;
1065
+ isTSThisType(opts?: object): this is NodePath<t.TSThisType>;
1066
+ isTSTupleType(opts?: object): this is NodePath<t.TSTupleType>;
1067
+ isTSType(opts?: object): this is NodePath<t.TSType>;
1068
+ isTSTypeAliasDeclaration(opts?: object): this is NodePath<t.TSTypeAliasDeclaration>;
1069
+ isTSTypeAnnotation(opts?: object): this is NodePath<t.TSTypeAnnotation>;
1070
+ isTSTypeAssertion(opts?: object): this is NodePath<t.TSTypeAssertion>;
1071
+ isTSTypeElement(opts?: object): this is NodePath<t.TSTypeElement>;
1072
+ isTSTypeLiteral(opts?: object): this is NodePath<t.TSTypeLiteral>;
1073
+ isTSTypeOperator(opts?: object): this is NodePath<t.TSTypeOperator>;
1074
+ isTSTypeParameter(opts?: object): this is NodePath<t.TSTypeParameter>;
1075
+ isTSTypeParameterDeclaration(opts?: object): this is NodePath<t.TSTypeParameterDeclaration>;
1076
+ isTSTypeParameterInstantiation(opts?: object): this is NodePath<t.TSTypeParameterInstantiation>;
1077
+ isTSTypePredicate(opts?: object): this is NodePath<t.TSTypePredicate>;
1078
+ isTSTypeQuery(opts?: object): this is NodePath<t.TSTypeQuery>;
1079
+ isTSTypeReference(opts?: object): this is NodePath<t.TSTypeReference>;
1080
+ isTSUndefinedKeyword(opts?: object): this is NodePath<t.TSUndefinedKeyword>;
1081
+ isTSUnionType(opts?: object): this is NodePath<t.TSUnionType>;
1082
+ isTSUnknownKeyword(opts?: object): this is NodePath<t.TSUnknownKeyword>;
1083
+ isTSVoidKeyword(opts?: object): this is NodePath<t.TSVoidKeyword>;
1084
+ isTaggedTemplateExpression(opts?: object): this is NodePath<t.TaggedTemplateExpression>;
1085
+ isTemplateElement(opts?: object): this is NodePath<t.TemplateElement>;
1086
+ isTemplateLiteral(opts?: object): this is NodePath<t.TemplateLiteral>;
1087
+ isTerminatorless(opts?: object): this is NodePath<t.Terminatorless>;
1088
+ isThisExpression(opts?: object): this is NodePath<t.ThisExpression>;
1089
+ isThisTypeAnnotation(opts?: object): this is NodePath<t.ThisTypeAnnotation>;
1090
+ isThrowStatement(opts?: object): this is NodePath<t.ThrowStatement>;
1091
+ isTopicReference(opts?: object): this is NodePath<t.TopicReference>;
1092
+ isTryStatement(opts?: object): this is NodePath<t.TryStatement>;
1093
+ isTupleExpression(opts?: object): this is NodePath<t.TupleExpression>;
1094
+ isTupleTypeAnnotation(opts?: object): this is NodePath<t.TupleTypeAnnotation>;
1095
+ isTypeAlias(opts?: object): this is NodePath<t.TypeAlias>;
1096
+ isTypeAnnotation(opts?: object): this is NodePath<t.TypeAnnotation>;
1097
+ isTypeCastExpression(opts?: object): this is NodePath<t.TypeCastExpression>;
1098
+ isTypeParameter(opts?: object): this is NodePath<t.TypeParameter>;
1099
+ isTypeParameterDeclaration(opts?: object): this is NodePath<t.TypeParameterDeclaration>;
1100
+ isTypeParameterInstantiation(opts?: object): this is NodePath<t.TypeParameterInstantiation>;
1101
+ isTypeScript(opts?: object): this is NodePath<t.TypeScript>;
1102
+ isTypeofTypeAnnotation(opts?: object): this is NodePath<t.TypeofTypeAnnotation>;
1103
+ isUnaryExpression(opts?: object): this is NodePath<t.UnaryExpression>;
1104
+ isUnaryLike(opts?: object): this is NodePath<t.UnaryLike>;
1105
+ isUnionTypeAnnotation(opts?: object): this is NodePath<t.UnionTypeAnnotation>;
1106
+ isUpdateExpression(opts?: object): this is NodePath<t.UpdateExpression>;
1107
+ isUserWhitespacable(opts?: object): this is NodePath<t.UserWhitespacable>;
1108
+ isV8IntrinsicIdentifier(opts?: object): this is NodePath<t.V8IntrinsicIdentifier>;
1109
+ isVariableDeclaration(opts?: object): this is NodePath<t.VariableDeclaration>;
1110
+ isVariableDeclarator(opts?: object): this is NodePath<t.VariableDeclarator>;
1111
+ isVariance(opts?: object): this is NodePath<t.Variance>;
1112
+ isVoidTypeAnnotation(opts?: object): this is NodePath<t.VoidTypeAnnotation>;
1113
+ isWhile(opts?: object): this is NodePath<t.While>;
1114
+ isWhileStatement(opts?: object): this is NodePath<t.WhileStatement>;
1115
+ isWithStatement(opts?: object): this is NodePath<t.WithStatement>;
1116
+ isYieldExpression(opts?: object): this is NodePath<t.YieldExpression>;
1117
+
1118
+ isBindingIdentifier(opts?: object): this is NodePath<VirtualTypeAliases['BindingIdentifier']>;
1119
+ isBlockScoped(opts?: object): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
1120
+
1121
+ /** @deprecated */
1122
+ isExistentialTypeParam(opts?: object): this is NodePath<VirtualTypeAliases['ExistentialTypeParam']>;
1123
+ isForAwaitStatement(opts?: object): this is NodePath<VirtualTypeAliases['ForAwaitStatement']>;
1124
+ isGenerated(opts?: object): boolean;
1125
+
1126
+ /** @deprecated */
1127
+ isNumericLiteralTypeAnnotation(opts?: object): void;
1128
+ isPure(opts?: object): boolean;
1129
+ 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']>;
1133
+ isUser(opts?: object): boolean;
1134
+ isVar(opts?: object): this is NodePath<VirtualTypeAliases['Var']>;
896
1135
  //#endregion
897
1136
 
898
1137
  //#region ------------------------- assertXXX -------------------------
@@ -909,292 +1148,316 @@ export class NodePath<T = Node> {
909
1148
  assertMarkoSpreadAttribute(props?: object | null): void;
910
1149
  assertMarkoTagBody(props?: object | null): void;
911
1150
  assertMarkoTag(props?: object | null): void;
912
- assertAnyTypeAnnotation(props?: object | null): void;
913
- assertArrayExpression(props?: object | null): void;
914
- assertArrayPattern(props?: object | null): void;
915
- assertArrayTypeAnnotation(props?: object | null): void;
916
- assertArrowFunctionExpression(props?: object | null): void;
917
- assertAssignmentExpression(props?: object | null): void;
918
- assertAssignmentPattern(props?: object | null): void;
919
- assertAwaitExpression(props?: object | null): void;
920
- assertBigIntLiteral(props?: object | null): void;
921
- assertBinary(props?: object | null): void;
922
- assertBinaryExpression(props?: object | null): void;
923
- assertBindExpression(props?: object | null): void;
924
- assertBlock(props?: object | null): void;
925
- assertBlockParent(props?: object | null): void;
926
- assertBlockStatement(props?: object | null): void;
927
- assertBooleanLiteral(props?: object | null): void;
928
- assertBooleanLiteralTypeAnnotation(props?: object | null): void;
929
- assertBooleanTypeAnnotation(props?: object | null): void;
930
- assertBreakStatement(props?: object | null): void;
931
- assertCallExpression(props?: object | null): void;
932
- assertCatchClause(props?: object | null): void;
933
- assertClass(props?: object | null): void;
934
- assertClassBody(props?: object | null): void;
935
- assertClassDeclaration(props?: object | null): void;
936
- assertClassExpression(props?: object | null): void;
937
- assertClassImplements(props?: object | null): void;
938
- assertClassMethod(props?: object | null): void;
939
- assertClassPrivateMethod(props?: object | null): void;
940
- assertClassPrivateProperty(props?: object | null): void;
941
- assertClassProperty(props?: object | null): void;
942
- assertCompletionStatement(props?: object | null): void;
943
- assertConditional(props?: object | null): void;
944
- assertConditionalExpression(props?: object | null): void;
945
- assertContinueStatement(props?: object | null): void;
946
- assertDebuggerStatement(props?: object | null): void;
947
- assertDeclaration(props?: object | null): void;
948
- assertDeclareClass(props?: object | null): void;
949
- assertDeclareExportAllDeclaration(props?: object | null): void;
950
- assertDeclareExportDeclaration(props?: object | null): void;
951
- assertDeclareFunction(props?: object | null): void;
952
- assertDeclareInterface(props?: object | null): void;
953
- assertDeclareModule(props?: object | null): void;
954
- assertDeclareModuleExports(props?: object | null): void;
955
- assertDeclareOpaqueType(props?: object | null): void;
956
- assertDeclareTypeAlias(props?: object | null): void;
957
- assertDeclareVariable(props?: object | null): void;
958
- assertDeclaredPredicate(props?: object | null): void;
959
- assertDecorator(props?: object | null): void;
960
- assertDirective(props?: object | null): void;
961
- assertDirectiveLiteral(props?: object | null): void;
962
- assertDoExpression(props?: object | null): void;
963
- assertDoWhileStatement(props?: object | null): void;
964
- assertEmptyStatement(props?: object | null): void;
965
- assertEmptyTypeAnnotation(props?: object | null): void;
966
- assertExistsTypeAnnotation(props?: object | null): void;
967
- assertExportAllDeclaration(props?: object | null): void;
968
- assertExportDeclaration(props?: object | null): void;
969
- assertExportDefaultDeclaration(props?: object | null): void;
970
- assertExportDefaultSpecifier(props?: object | null): void;
971
- assertExportNamedDeclaration(props?: object | null): void;
972
- assertExportNamespaceSpecifier(props?: object | null): void;
973
- assertExportSpecifier(props?: object | null): void;
974
- assertExpression(props?: object | null): void;
975
- assertExpressionStatement(props?: object | null): void;
976
- assertExpressionWrapper(props?: object | null): void;
977
- assertFile(props?: object | null): void;
978
- assertFlow(props?: object | null): void;
979
- assertFlowBaseAnnotation(props?: object | null): void;
980
- assertFlowDeclaration(props?: object | null): void;
981
- assertFlowPredicate(props?: object | null): void;
982
- assertFlowType(props?: object | null): void;
983
- assertFor(props?: object | null): void;
984
- assertForInStatement(props?: object | null): void;
985
- assertForOfStatement(props?: object | null): void;
986
- assertForStatement(props?: object | null): void;
987
- assertForXStatement(props?: object | null): void;
988
- assertFunction(props?: object | null): void;
989
- assertFunctionDeclaration(props?: object | null): void;
990
- assertFunctionExpression(props?: object | null): void;
991
- assertFunctionParent(props?: object | null): void;
992
- assertFunctionTypeAnnotation(props?: object | null): void;
993
- assertFunctionTypeParam(props?: object | null): void;
994
- assertGenericTypeAnnotation(props?: object | null): void;
995
- assertIdentifier(props?: object | null): void;
996
- assertIfStatement(props?: object | null): void;
997
- assertImmutable(props?: object | null): void;
998
- assertImport(props?: object | null): void;
999
- assertImportDeclaration(props?: object | null): void;
1000
- assertImportDefaultSpecifier(props?: object | null): void;
1001
- assertImportNamespaceSpecifier(props?: object | null): void;
1002
- assertImportSpecifier(props?: object | null): void;
1003
- assertInferredPredicate(props?: object | null): void;
1004
- assertInterfaceDeclaration(props?: object | null): void;
1005
- assertInterfaceExtends(props?: object | null): void;
1006
- assertInterfaceTypeAnnotation(props?: object | null): void;
1007
- assertInterpreterDirective(props?: object | null): void;
1008
- assertIntersectionTypeAnnotation(props?: object | null): void;
1009
- assertJSX(props?: object | null): void;
1010
- assertJSXAttribute(props?: object | null): void;
1011
- assertJSXClosingElement(props?: object | null): void;
1012
- assertJSXClosingFragment(props?: object | null): void;
1013
- assertJSXElement(props?: object | null): void;
1014
- assertJSXEmptyExpression(props?: object | null): void;
1015
- assertJSXExpressionContainer(props?: object | null): void;
1016
- assertJSXFragment(props?: object | null): void;
1017
- assertJSXIdentifier(props?: object | null): void;
1018
- assertJSXMemberExpression(props?: object | null): void;
1019
- assertJSXNamespacedName(props?: object | null): void;
1020
- assertJSXOpeningElement(props?: object | null): void;
1021
- assertJSXOpeningFragment(props?: object | null): void;
1022
- assertJSXSpreadAttribute(props?: object | null): void;
1023
- assertJSXSpreadChild(props?: object | null): void;
1024
- assertJSXText(props?: object | null): void;
1025
- assertLVal(props?: object | null): void;
1026
- assertLabeledStatement(props?: object | null): void;
1027
- assertLiteral(props?: object | null): void;
1028
- assertLogicalExpression(props?: object | null): void;
1029
- assertLoop(props?: object | null): void;
1030
- assertMemberExpression(props?: object | null): void;
1031
- assertMetaProperty(props?: object | null): void;
1032
- assertMethod(props?: object | null): void;
1033
- assertMixedTypeAnnotation(props?: object | null): void;
1034
- assertModuleDeclaration(props?: object | null): void;
1035
- assertModuleSpecifier(props?: object | null): void;
1036
- assertNewExpression(props?: object | null): void;
1037
- assertNoop(props?: object | null): void;
1038
- assertNullLiteral(props?: object | null): void;
1039
- assertNullLiteralTypeAnnotation(props?: object | null): void;
1040
- assertNullableTypeAnnotation(props?: object | null): void;
1151
+ assertAccessor(opts?: object): asserts this is NodePath<t.Accessor>;
1152
+ assertAnyTypeAnnotation(opts?: object): asserts this is NodePath<t.AnyTypeAnnotation>;
1153
+ assertArgumentPlaceholder(opts?: object): asserts this is NodePath<t.ArgumentPlaceholder>;
1154
+ assertArrayExpression(opts?: object): asserts this is NodePath<t.ArrayExpression>;
1155
+ assertArrayPattern(opts?: object): asserts this is NodePath<t.ArrayPattern>;
1156
+ assertArrayTypeAnnotation(opts?: object): asserts this is NodePath<t.ArrayTypeAnnotation>;
1157
+ assertArrowFunctionExpression(opts?: object): asserts this is NodePath<t.ArrowFunctionExpression>;
1158
+ assertAssignmentExpression(opts?: object): asserts this is NodePath<t.AssignmentExpression>;
1159
+ assertAssignmentPattern(opts?: object): asserts this is NodePath<t.AssignmentPattern>;
1160
+ assertAwaitExpression(opts?: object): asserts this is NodePath<t.AwaitExpression>;
1161
+ assertBigIntLiteral(opts?: object): asserts this is NodePath<t.BigIntLiteral>;
1162
+ assertBinary(opts?: object): asserts this is NodePath<t.Binary>;
1163
+ assertBinaryExpression(opts?: object): asserts this is NodePath<t.BinaryExpression>;
1164
+ assertBindExpression(opts?: object): asserts this is NodePath<t.BindExpression>;
1165
+ assertBlock(opts?: object): asserts this is NodePath<t.Block>;
1166
+ assertBlockParent(opts?: object): asserts this is NodePath<t.BlockParent>;
1167
+ assertBlockStatement(opts?: object): asserts this is NodePath<t.BlockStatement>;
1168
+ assertBooleanLiteral(opts?: object): asserts this is NodePath<t.BooleanLiteral>;
1169
+ assertBooleanLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.BooleanLiteralTypeAnnotation>;
1170
+ assertBooleanTypeAnnotation(opts?: object): asserts this is NodePath<t.BooleanTypeAnnotation>;
1171
+ assertBreakStatement(opts?: object): asserts this is NodePath<t.BreakStatement>;
1172
+ assertCallExpression(opts?: object): asserts this is NodePath<t.CallExpression>;
1173
+ assertCatchClause(opts?: object): asserts this is NodePath<t.CatchClause>;
1174
+ assertClass(opts?: object): asserts this is NodePath<t.Class>;
1175
+ assertClassAccessorProperty(opts?: object): asserts this is NodePath<t.ClassAccessorProperty>;
1176
+ assertClassBody(opts?: object): asserts this is NodePath<t.ClassBody>;
1177
+ assertClassDeclaration(opts?: object): asserts this is NodePath<t.ClassDeclaration>;
1178
+ assertClassExpression(opts?: object): asserts this is NodePath<t.ClassExpression>;
1179
+ assertClassImplements(opts?: object): asserts this is NodePath<t.ClassImplements>;
1180
+ assertClassMethod(opts?: object): asserts this is NodePath<t.ClassMethod>;
1181
+ assertClassPrivateMethod(opts?: object): asserts this is NodePath<t.ClassPrivateMethod>;
1182
+ assertClassPrivateProperty(opts?: object): asserts this is NodePath<t.ClassPrivateProperty>;
1183
+ assertClassProperty(opts?: object): asserts this is NodePath<t.ClassProperty>;
1184
+ assertCompletionStatement(opts?: object): asserts this is NodePath<t.CompletionStatement>;
1185
+ assertConditional(opts?: object): asserts this is NodePath<t.Conditional>;
1186
+ assertConditionalExpression(opts?: object): asserts this is NodePath<t.ConditionalExpression>;
1187
+ assertContinueStatement(opts?: object): asserts this is NodePath<t.ContinueStatement>;
1188
+ assertDebuggerStatement(opts?: object): asserts this is NodePath<t.DebuggerStatement>;
1189
+ assertDecimalLiteral(opts?: object): asserts this is NodePath<t.DecimalLiteral>;
1190
+ assertDeclaration(opts?: object): asserts this is NodePath<t.Declaration>;
1191
+ assertDeclareClass(opts?: object): asserts this is NodePath<t.DeclareClass>;
1192
+ assertDeclareExportAllDeclaration(opts?: object): asserts this is NodePath<t.DeclareExportAllDeclaration>;
1193
+ assertDeclareExportDeclaration(opts?: object): asserts this is NodePath<t.DeclareExportDeclaration>;
1194
+ assertDeclareFunction(opts?: object): asserts this is NodePath<t.DeclareFunction>;
1195
+ assertDeclareInterface(opts?: object): asserts this is NodePath<t.DeclareInterface>;
1196
+ assertDeclareModule(opts?: object): asserts this is NodePath<t.DeclareModule>;
1197
+ assertDeclareModuleExports(opts?: object): asserts this is NodePath<t.DeclareModuleExports>;
1198
+ assertDeclareOpaqueType(opts?: object): asserts this is NodePath<t.DeclareOpaqueType>;
1199
+ assertDeclareTypeAlias(opts?: object): asserts this is NodePath<t.DeclareTypeAlias>;
1200
+ assertDeclareVariable(opts?: object): asserts this is NodePath<t.DeclareVariable>;
1201
+ assertDeclaredPredicate(opts?: object): asserts this is NodePath<t.DeclaredPredicate>;
1202
+ assertDecorator(opts?: object): asserts this is NodePath<t.Decorator>;
1203
+ assertDirective(opts?: object): asserts this is NodePath<t.Directive>;
1204
+ assertDirectiveLiteral(opts?: object): asserts this is NodePath<t.DirectiveLiteral>;
1205
+ assertDoExpression(opts?: object): asserts this is NodePath<t.DoExpression>;
1206
+ assertDoWhileStatement(opts?: object): asserts this is NodePath<t.DoWhileStatement>;
1207
+ assertEmptyStatement(opts?: object): asserts this is NodePath<t.EmptyStatement>;
1208
+ assertEmptyTypeAnnotation(opts?: object): asserts this is NodePath<t.EmptyTypeAnnotation>;
1209
+ assertEnumBody(opts?: object): asserts this is NodePath<t.EnumBody>;
1210
+ assertEnumBooleanBody(opts?: object): asserts this is NodePath<t.EnumBooleanBody>;
1211
+ assertEnumBooleanMember(opts?: object): asserts this is NodePath<t.EnumBooleanMember>;
1212
+ assertEnumDeclaration(opts?: object): asserts this is NodePath<t.EnumDeclaration>;
1213
+ assertEnumDefaultedMember(opts?: object): asserts this is NodePath<t.EnumDefaultedMember>;
1214
+ assertEnumMember(opts?: object): asserts this is NodePath<t.EnumMember>;
1215
+ assertEnumNumberBody(opts?: object): asserts this is NodePath<t.EnumNumberBody>;
1216
+ assertEnumNumberMember(opts?: object): asserts this is NodePath<t.EnumNumberMember>;
1217
+ assertEnumStringBody(opts?: object): asserts this is NodePath<t.EnumStringBody>;
1218
+ assertEnumStringMember(opts?: object): asserts this is NodePath<t.EnumStringMember>;
1219
+ assertEnumSymbolBody(opts?: object): asserts this is NodePath<t.EnumSymbolBody>;
1220
+ assertExistsTypeAnnotation(opts?: object): asserts this is NodePath<t.ExistsTypeAnnotation>;
1221
+ assertExportAllDeclaration(opts?: object): asserts this is NodePath<t.ExportAllDeclaration>;
1222
+ assertExportDeclaration(opts?: object): asserts this is NodePath<t.ExportDeclaration>;
1223
+ assertExportDefaultDeclaration(opts?: object): asserts this is NodePath<t.ExportDefaultDeclaration>;
1224
+ assertExportDefaultSpecifier(opts?: object): asserts this is NodePath<t.ExportDefaultSpecifier>;
1225
+ assertExportNamedDeclaration(opts?: object): asserts this is NodePath<t.ExportNamedDeclaration>;
1226
+ assertExportNamespaceSpecifier(opts?: object): asserts this is NodePath<t.ExportNamespaceSpecifier>;
1227
+ assertExportSpecifier(opts?: object): asserts this is NodePath<t.ExportSpecifier>;
1228
+ assertExpression(opts?: object): asserts this is NodePath<t.Expression>;
1229
+ assertExpressionStatement(opts?: object): asserts this is NodePath<t.ExpressionStatement>;
1230
+ assertExpressionWrapper(opts?: object): asserts this is NodePath<t.ExpressionWrapper>;
1231
+ assertFile(opts?: object): asserts this is NodePath<t.File>;
1232
+ assertFlow(opts?: object): asserts this is NodePath<t.Flow>;
1233
+ assertFlowBaseAnnotation(opts?: object): asserts this is NodePath<t.FlowBaseAnnotation>;
1234
+ assertFlowDeclaration(opts?: object): asserts this is NodePath<t.FlowDeclaration>;
1235
+ assertFlowPredicate(opts?: object): asserts this is NodePath<t.FlowPredicate>;
1236
+ assertFlowType(opts?: object): asserts this is NodePath<t.FlowType>;
1237
+ assertFor(opts?: object): asserts this is NodePath<t.For>;
1238
+ assertForInStatement(opts?: object): asserts this is NodePath<t.ForInStatement>;
1239
+ assertForOfStatement(opts?: object): asserts this is NodePath<t.ForOfStatement>;
1240
+ assertForStatement(opts?: object): asserts this is NodePath<t.ForStatement>;
1241
+ assertForXStatement(opts?: object): asserts this is NodePath<t.ForXStatement>;
1242
+ assertFunction(opts?: object): asserts this is NodePath<t.Function>;
1243
+ assertFunctionDeclaration(opts?: object): asserts this is NodePath<t.FunctionDeclaration>;
1244
+ assertFunctionExpression(opts?: object): asserts this is NodePath<t.FunctionExpression>;
1245
+ assertFunctionParent(opts?: object): asserts this is NodePath<t.FunctionParent>;
1246
+ assertFunctionTypeAnnotation(opts?: object): asserts this is NodePath<t.FunctionTypeAnnotation>;
1247
+ assertFunctionTypeParam(opts?: object): asserts this is NodePath<t.FunctionTypeParam>;
1248
+ assertGenericTypeAnnotation(opts?: object): asserts this is NodePath<t.GenericTypeAnnotation>;
1249
+ assertIdentifier(opts?: object): asserts this is NodePath<t.Identifier>;
1250
+ assertIfStatement(opts?: object): asserts this is NodePath<t.IfStatement>;
1251
+ assertImmutable(opts?: object): asserts this is NodePath<t.Immutable>;
1252
+ assertImport(opts?: object): asserts this is NodePath<t.Import>;
1253
+ assertImportAttribute(opts?: object): asserts this is NodePath<t.ImportAttribute>;
1254
+ assertImportDeclaration(opts?: object): asserts this is NodePath<t.ImportDeclaration>;
1255
+ assertImportDefaultSpecifier(opts?: object): asserts this is NodePath<t.ImportDefaultSpecifier>;
1256
+ assertImportNamespaceSpecifier(opts?: object): asserts this is NodePath<t.ImportNamespaceSpecifier>;
1257
+ assertImportSpecifier(opts?: object): asserts this is NodePath<t.ImportSpecifier>;
1258
+ assertIndexedAccessType(opts?: object): asserts this is NodePath<t.IndexedAccessType>;
1259
+ assertInferredPredicate(opts?: object): asserts this is NodePath<t.InferredPredicate>;
1260
+ assertInterfaceDeclaration(opts?: object): asserts this is NodePath<t.InterfaceDeclaration>;
1261
+ assertInterfaceExtends(opts?: object): asserts this is NodePath<t.InterfaceExtends>;
1262
+ assertInterfaceTypeAnnotation(opts?: object): asserts this is NodePath<t.InterfaceTypeAnnotation>;
1263
+ assertInterpreterDirective(opts?: object): asserts this is NodePath<t.InterpreterDirective>;
1264
+ assertIntersectionTypeAnnotation(opts?: object): asserts this is NodePath<t.IntersectionTypeAnnotation>;
1265
+ assertJSX(opts?: object): asserts this is NodePath<t.JSX>;
1266
+ assertJSXAttribute(opts?: object): asserts this is NodePath<t.JSXAttribute>;
1267
+ assertJSXClosingElement(opts?: object): asserts this is NodePath<t.JSXClosingElement>;
1268
+ assertJSXClosingFragment(opts?: object): asserts this is NodePath<t.JSXClosingFragment>;
1269
+ assertJSXElement(opts?: object): asserts this is NodePath<t.JSXElement>;
1270
+ assertJSXEmptyExpression(opts?: object): asserts this is NodePath<t.JSXEmptyExpression>;
1271
+ assertJSXExpressionContainer(opts?: object): asserts this is NodePath<t.JSXExpressionContainer>;
1272
+ assertJSXFragment(opts?: object): asserts this is NodePath<t.JSXFragment>;
1273
+ assertJSXIdentifier(opts?: object): asserts this is NodePath<t.JSXIdentifier>;
1274
+ assertJSXMemberExpression(opts?: object): asserts this is NodePath<t.JSXMemberExpression>;
1275
+ assertJSXNamespacedName(opts?: object): asserts this is NodePath<t.JSXNamespacedName>;
1276
+ assertJSXOpeningElement(opts?: object): asserts this is NodePath<t.JSXOpeningElement>;
1277
+ assertJSXOpeningFragment(opts?: object): asserts this is NodePath<t.JSXOpeningFragment>;
1278
+ assertJSXSpreadAttribute(opts?: object): asserts this is NodePath<t.JSXSpreadAttribute>;
1279
+ assertJSXSpreadChild(opts?: object): asserts this is NodePath<t.JSXSpreadChild>;
1280
+ assertJSXText(opts?: object): asserts this is NodePath<t.JSXText>;
1281
+ assertLVal(opts?: object): asserts this is NodePath<t.LVal>;
1282
+ assertLabeledStatement(opts?: object): asserts this is NodePath<t.LabeledStatement>;
1283
+ assertLiteral(opts?: object): asserts this is NodePath<t.Literal>;
1284
+ assertLogicalExpression(opts?: object): asserts this is NodePath<t.LogicalExpression>;
1285
+ assertLoop(opts?: object): asserts this is NodePath<t.Loop>;
1286
+ assertMemberExpression(opts?: object): asserts this is NodePath<t.MemberExpression>;
1287
+ assertMetaProperty(opts?: object): asserts this is NodePath<t.MetaProperty>;
1288
+ assertMethod(opts?: object): asserts this is NodePath<t.Method>;
1289
+ assertMiscellaneous(opts?: object): asserts this is NodePath<t.Miscellaneous>;
1290
+ assertMixedTypeAnnotation(opts?: object): asserts this is NodePath<t.MixedTypeAnnotation>;
1291
+ assertModuleDeclaration(opts?: object): asserts this is NodePath<t.ModuleDeclaration>;
1292
+ assertModuleExpression(opts?: object): asserts this is NodePath<t.ModuleExpression>;
1293
+ assertModuleSpecifier(opts?: object): asserts this is NodePath<t.ModuleSpecifier>;
1294
+ assertNewExpression(opts?: object): asserts this is NodePath<t.NewExpression>;
1295
+ assertNoop(opts?: object): asserts this is NodePath<t.Noop>;
1296
+ assertNullLiteral(opts?: object): asserts this is NodePath<t.NullLiteral>;
1297
+ assertNullLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.NullLiteralTypeAnnotation>;
1298
+ assertNullableTypeAnnotation(opts?: object): asserts this is NodePath<t.NullableTypeAnnotation>;
1041
1299
 
1042
1300
  /** @deprecated Use `assertNumericLiteral` */
1043
- assertNumberLiteral(props?: object | null): void;
1044
- assertNumberLiteralTypeAnnotation(props?: object | null): void;
1045
- assertNumberTypeAnnotation(props?: object | null): void;
1046
- assertNumericLiteral(props?: object | null): void;
1047
- assertObjectExpression(props?: object | null): void;
1048
- assertObjectMember(props?: object | null): void;
1049
- assertObjectMethod(props?: object | null): void;
1050
- assertObjectPattern(props?: object | null): void;
1051
- assertObjectProperty(props?: object | null): void;
1052
- assertObjectTypeAnnotation(props?: object | null): void;
1053
- assertObjectTypeCallProperty(props?: object | null): void;
1054
- assertObjectTypeIndexer(props?: object | null): void;
1055
- assertObjectTypeInternalSlot(props?: object | null): void;
1056
- assertObjectTypeProperty(props?: object | null): void;
1057
- assertObjectTypeSpreadProperty(props?: object | null): void;
1058
- assertOpaqueType(props?: object | null): void;
1059
- assertOptionalCallExpression(props?: object | null): void;
1060
- assertOptionalMemberExpression(props?: object | null): void;
1061
- assertParenthesizedExpression(props?: object | null): void;
1062
- assertPattern(props?: object | null): void;
1063
- assertPatternLike(props?: object | null): void;
1064
- assertPipelineBareFunction(props?: object | null): void;
1065
- assertPipelinePrimaryTopicReference(props?: object | null): void;
1066
- assertPipelineTopicExpression(props?: object | null): void;
1067
- assertPrivate(props?: object | null): void;
1068
- assertPrivateName(props?: object | null): void;
1069
- assertProgram(props?: object | null): void;
1070
- assertProperty(props?: object | null): void;
1071
- assertPureish(props?: object | null): void;
1072
- assertQualifiedTypeIdentifier(props?: object | null): void;
1073
- assertRegExpLiteral(props?: object | null): void;
1301
+ assertNumberLiteral(opts?: object): asserts this is NodePath<t.NumberLiteral>;
1302
+ assertNumberLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.NumberLiteralTypeAnnotation>;
1303
+ assertNumberTypeAnnotation(opts?: object): asserts this is NodePath<t.NumberTypeAnnotation>;
1304
+ assertNumericLiteral(opts?: object): asserts this is NodePath<t.NumericLiteral>;
1305
+ assertObjectExpression(opts?: object): asserts this is NodePath<t.ObjectExpression>;
1306
+ assertObjectMember(opts?: object): asserts this is NodePath<t.ObjectMember>;
1307
+ assertObjectMethod(opts?: object): asserts this is NodePath<t.ObjectMethod>;
1308
+ assertObjectPattern(opts?: object): asserts this is NodePath<t.ObjectPattern>;
1309
+ assertObjectProperty(opts?: object): asserts this is NodePath<t.ObjectProperty>;
1310
+ assertObjectTypeAnnotation(opts?: object): asserts this is NodePath<t.ObjectTypeAnnotation>;
1311
+ assertObjectTypeCallProperty(opts?: object): asserts this is NodePath<t.ObjectTypeCallProperty>;
1312
+ assertObjectTypeIndexer(opts?: object): asserts this is NodePath<t.ObjectTypeIndexer>;
1313
+ assertObjectTypeInternalSlot(opts?: object): asserts this is NodePath<t.ObjectTypeInternalSlot>;
1314
+ assertObjectTypeProperty(opts?: object): asserts this is NodePath<t.ObjectTypeProperty>;
1315
+ assertObjectTypeSpreadProperty(opts?: object): asserts this is NodePath<t.ObjectTypeSpreadProperty>;
1316
+ assertOpaqueType(opts?: object): asserts this is NodePath<t.OpaqueType>;
1317
+ assertOptionalCallExpression(opts?: object): asserts this is NodePath<t.OptionalCallExpression>;
1318
+ assertOptionalIndexedAccessType(opts?: object): asserts this is NodePath<t.OptionalIndexedAccessType>;
1319
+ assertOptionalMemberExpression(opts?: object): asserts this is NodePath<t.OptionalMemberExpression>;
1320
+ assertParenthesizedExpression(opts?: object): asserts this is NodePath<t.ParenthesizedExpression>;
1321
+ assertPattern(opts?: object): asserts this is NodePath<t.Pattern>;
1322
+ assertPatternLike(opts?: object): asserts this is NodePath<t.PatternLike>;
1323
+ assertPipelineBareFunction(opts?: object): asserts this is NodePath<t.PipelineBareFunction>;
1324
+ assertPipelinePrimaryTopicReference(opts?: object): asserts this is NodePath<t.PipelinePrimaryTopicReference>;
1325
+ assertPipelineTopicExpression(opts?: object): asserts this is NodePath<t.PipelineTopicExpression>;
1326
+ assertPlaceholder(opts?: object): asserts this is NodePath<t.Placeholder>;
1327
+ assertPrivate(opts?: object): asserts this is NodePath<t.Private>;
1328
+ assertPrivateName(opts?: object): asserts this is NodePath<t.PrivateName>;
1329
+ assertProgram(opts?: object): asserts this is NodePath<t.Program>;
1330
+ assertProperty(opts?: object): asserts this is NodePath<t.Property>;
1331
+ assertPureish(opts?: object): asserts this is NodePath<t.Pureish>;
1332
+ assertQualifiedTypeIdentifier(opts?: object): asserts this is NodePath<t.QualifiedTypeIdentifier>;
1333
+ assertRecordExpression(opts?: object): asserts this is NodePath<t.RecordExpression>;
1334
+ assertRegExpLiteral(opts?: object): asserts this is NodePath<t.RegExpLiteral>;
1074
1335
 
1075
1336
  /** @deprecated Use `assertRegExpLiteral` */
1076
- assertRegexLiteral(props?: object | null): void;
1077
- assertRestElement(props?: object | null): void;
1337
+ assertRegexLiteral(opts?: object): asserts this is NodePath<t.RegexLiteral>;
1338
+ assertRestElement(opts?: object): asserts this is NodePath<t.RestElement>;
1078
1339
 
1079
1340
  /** @deprecated Use `assertRestElement` */
1080
- assertRestProperty(props?: object | null): void;
1081
- assertReturnStatement(props?: object | null): void;
1082
- assertScopable(props?: object | null): void;
1083
- assertSequenceExpression(props?: object | null): void;
1084
- assertSpreadElement(props?: object | null): void;
1341
+ assertRestProperty(opts?: object): asserts this is NodePath<t.RestProperty>;
1342
+ assertReturnStatement(opts?: object): asserts this is NodePath<t.ReturnStatement>;
1343
+ assertScopable(opts?: object): asserts this is NodePath<t.Scopable>;
1344
+ assertSequenceExpression(opts?: object): asserts this is NodePath<t.SequenceExpression>;
1345
+ assertSpreadElement(opts?: object): asserts this is NodePath<t.SpreadElement>;
1085
1346
 
1086
1347
  /** @deprecated Use `assertSpreadElement` */
1087
- assertSpreadProperty(props?: object | null): void;
1088
- assertStatement(props?: object | null): void;
1089
- assertStringLiteral(props?: object | null): void;
1090
- assertStringLiteralTypeAnnotation(props?: object | null): void;
1091
- assertStringTypeAnnotation(props?: object | null): void;
1092
- assertSuper(props?: object | null): void;
1093
- assertSwitchCase(props?: object | null): void;
1094
- assertSwitchStatement(props?: object | null): void;
1095
- assertTSAnyKeyword(props?: object | null): void;
1096
- assertTSArrayType(props?: object | null): void;
1097
- assertTSAsExpression(props?: object | null): void;
1098
- assertTSBooleanKeyword(props?: object | null): void;
1099
- assertTSCallSignatureDeclaration(props?: object | null): void;
1100
- assertTSConditionalType(props?: object | null): void;
1101
- assertTSConstructSignatureDeclaration(props?: object | null): void;
1102
- assertTSConstructorType(props?: object | null): void;
1103
- assertTSDeclareFunction(props?: object | null): void;
1104
- assertTSDeclareMethod(props?: object | null): void;
1105
- assertTSEntityName(props?: object | null): void;
1106
- assertTSEnumDeclaration(props?: object | null): void;
1107
- assertTSEnumMember(props?: object | null): void;
1108
- assertTSExportAssignment(props?: object | null): void;
1109
- assertTSExpressionWithTypeArguments(props?: object | null): void;
1110
- assertTSExternalModuleReference(props?: object | null): void;
1111
- assertTSFunctionType(props?: object | null): void;
1112
- assertTSImportEqualsDeclaration(props?: object | null): void;
1113
- assertTSImportType(props?: object | null): void;
1114
- assertTSIndexSignature(props?: object | null): void;
1115
- assertTSIndexedAccessType(props?: object | null): void;
1116
- assertTSInferType(props?: object | null): void;
1117
- assertTSInterfaceBody(props?: object | null): void;
1118
- assertTSInterfaceDeclaration(props?: object | null): void;
1119
- assertTSIntersectionType(props?: object | null): void;
1120
- assertTSLiteralType(props?: object | null): void;
1121
- assertTSMappedType(props?: object | null): void;
1122
- assertTSMethodSignature(props?: object | null): void;
1123
- assertTSModuleBlock(props?: object | null): void;
1124
- assertTSModuleDeclaration(props?: object | null): void;
1125
- assertTSNamespaceExportDeclaration(props?: object | null): void;
1126
- assertTSNeverKeyword(props?: object | null): void;
1127
- assertTSNonNullExpression(props?: object | null): void;
1128
- assertTSNullKeyword(props?: object | null): void;
1129
- assertTSNumberKeyword(props?: object | null): void;
1130
- assertTSObjectKeyword(props?: object | null): void;
1131
- assertTSOptionalType(props?: object | null): void;
1132
- assertTSParameterProperty(props?: object | null): void;
1133
- assertTSParenthesizedType(props?: object | null): void;
1134
- assertTSPropertySignature(props?: object | null): void;
1135
- assertTSQualifiedName(props?: object | null): void;
1136
- assertTSRestType(props?: object | null): void;
1137
- assertTSStringKeyword(props?: object | null): void;
1138
- assertTSSymbolKeyword(props?: object | null): void;
1139
- assertTSThisType(props?: object | null): void;
1140
- assertTSTupleType(props?: object | null): void;
1141
- assertTSType(props?: object | null): void;
1142
- assertTSTypeAliasDeclaration(props?: object | null): void;
1143
- assertTSTypeAnnotation(props?: object | null): void;
1144
- assertTSTypeAssertion(props?: object | null): void;
1145
- assertTSTypeElement(props?: object | null): void;
1146
- assertTSTypeLiteral(props?: object | null): void;
1147
- assertTSTypeOperator(props?: object | null): void;
1148
- assertTSTypeParameter(props?: object | null): void;
1149
- assertTSTypeParameterDeclaration(props?: object | null): void;
1150
- assertTSTypeParameterInstantiation(props?: object | null): void;
1151
- assertTSTypePredicate(props?: object | null): void;
1152
- assertTSTypeQuery(props?: object | null): void;
1153
- assertTSTypeReference(props?: object | null): void;
1154
- assertTSUndefinedKeyword(props?: object | null): void;
1155
- assertTSUnionType(props?: object | null): void;
1156
- assertTSUnknownKeyword(props?: object | null): void;
1157
- assertTSVoidKeyword(props?: object | null): void;
1158
- assertTaggedTemplateExpression(props?: object | null): void;
1159
- assertTemplateElement(props?: object | null): void;
1160
- assertTemplateLiteral(props?: object | null): void;
1161
- assertTerminatorless(props?: object | null): void;
1162
- assertThisExpression(props?: object | null): void;
1163
- assertThisTypeAnnotation(props?: object | null): void;
1164
- assertThrowStatement(props?: object | null): void;
1165
- assertTryStatement(props?: object | null): void;
1166
- assertTupleTypeAnnotation(props?: object | null): void;
1167
- assertTypeAlias(props?: object | null): void;
1168
- assertTypeAnnotation(props?: object | null): void;
1169
- assertTypeCastExpression(props?: object | null): void;
1170
- assertTypeParameter(props?: object | null): void;
1171
- assertTypeParameterDeclaration(props?: object | null): void;
1172
- assertTypeParameterInstantiation(props?: object | null): void;
1173
- assertTypeofTypeAnnotation(props?: object | null): void;
1174
- assertUnaryExpression(props?: object | null): void;
1175
- assertUnaryLike(props?: object | null): void;
1176
- assertUnionTypeAnnotation(props?: object | null): void;
1177
- assertUpdateExpression(props?: object | null): void;
1178
- assertUserWhitespacable(props?: object | null): void;
1179
- assertVariableDeclaration(props?: object | null): void;
1180
- assertVariableDeclarator(props?: object | null): void;
1181
- assertVariance(props?: object | null): void;
1182
- assertVoidTypeAnnotation(props?: object | null): void;
1183
- assertWhile(props?: object | null): void;
1184
- assertWhileStatement(props?: object | null): void;
1185
- assertWithStatement(props?: object | null): void;
1186
- assertYieldExpression(props?: object | null): void;
1187
-
1188
- assertBindingIdentifier(props?: object | null): void;
1189
- assertBlockScoped(props?: object | null): void;
1190
- assertGenerated(props?: object | null): void;
1191
- assertPure(props?: object | null): void;
1192
- assertReferenced(props?: object | null): void;
1193
- assertReferencedIdentifier(props?: object | null): void;
1194
- assertReferencedMemberExpression(props?: object | null): void;
1195
- assertScope(props?: object | null): void;
1196
- assertUser(props?: object | null): void;
1197
- assertVar(props?: object | null): void;
1348
+ assertSpreadProperty(opts?: object): asserts this is NodePath<t.SpreadProperty>;
1349
+ assertStandardized(opts?: object): asserts this is NodePath<t.Standardized>;
1350
+ assertStatement(opts?: object): asserts this is NodePath<t.Statement>;
1351
+ assertStaticBlock(opts?: object): asserts this is NodePath<t.StaticBlock>;
1352
+ assertStringLiteral(opts?: object): asserts this is NodePath<t.StringLiteral>;
1353
+ assertStringLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.StringLiteralTypeAnnotation>;
1354
+ assertStringTypeAnnotation(opts?: object): asserts this is NodePath<t.StringTypeAnnotation>;
1355
+ assertSuper(opts?: object): asserts this is NodePath<t.Super>;
1356
+ assertSwitchCase(opts?: object): asserts this is NodePath<t.SwitchCase>;
1357
+ assertSwitchStatement(opts?: object): asserts this is NodePath<t.SwitchStatement>;
1358
+ assertSymbolTypeAnnotation(opts?: object): asserts this is NodePath<t.SymbolTypeAnnotation>;
1359
+ assertTSAnyKeyword(opts?: object): asserts this is NodePath<t.TSAnyKeyword>;
1360
+ assertTSArrayType(opts?: object): asserts this is NodePath<t.TSArrayType>;
1361
+ assertTSAsExpression(opts?: object): asserts this is NodePath<t.TSAsExpression>;
1362
+ assertTSBaseType(opts?: object): asserts this is NodePath<t.TSBaseType>;
1363
+ assertTSBigIntKeyword(opts?: object): asserts this is NodePath<t.TSBigIntKeyword>;
1364
+ assertTSBooleanKeyword(opts?: object): asserts this is NodePath<t.TSBooleanKeyword>;
1365
+ assertTSCallSignatureDeclaration(opts?: object): asserts this is NodePath<t.TSCallSignatureDeclaration>;
1366
+ assertTSConditionalType(opts?: object): asserts this is NodePath<t.TSConditionalType>;
1367
+ assertTSConstructSignatureDeclaration(opts?: object): asserts this is NodePath<t.TSConstructSignatureDeclaration>;
1368
+ assertTSConstructorType(opts?: object): asserts this is NodePath<t.TSConstructorType>;
1369
+ assertTSDeclareFunction(opts?: object): asserts this is NodePath<t.TSDeclareFunction>;
1370
+ assertTSDeclareMethod(opts?: object): asserts this is NodePath<t.TSDeclareMethod>;
1371
+ assertTSEntityName(opts?: object): asserts this is NodePath<t.TSEntityName>;
1372
+ assertTSEnumDeclaration(opts?: object): asserts this is NodePath<t.TSEnumDeclaration>;
1373
+ assertTSEnumMember(opts?: object): asserts this is NodePath<t.TSEnumMember>;
1374
+ assertTSExportAssignment(opts?: object): asserts this is NodePath<t.TSExportAssignment>;
1375
+ assertTSExpressionWithTypeArguments(opts?: object): asserts this is NodePath<t.TSExpressionWithTypeArguments>;
1376
+ assertTSExternalModuleReference(opts?: object): asserts this is NodePath<t.TSExternalModuleReference>;
1377
+ assertTSFunctionType(opts?: object): asserts this is NodePath<t.TSFunctionType>;
1378
+ assertTSImportEqualsDeclaration(opts?: object): asserts this is NodePath<t.TSImportEqualsDeclaration>;
1379
+ assertTSImportType(opts?: object): asserts this is NodePath<t.TSImportType>;
1380
+ assertTSIndexSignature(opts?: object): asserts this is NodePath<t.TSIndexSignature>;
1381
+ assertTSIndexedAccessType(opts?: object): asserts this is NodePath<t.TSIndexedAccessType>;
1382
+ assertTSInferType(opts?: object): asserts this is NodePath<t.TSInferType>;
1383
+ assertTSInstantiationExpression(opts?: object): asserts this is NodePath<t.TSInstantiationExpression>;
1384
+ assertTSInterfaceBody(opts?: object): asserts this is NodePath<t.TSInterfaceBody>;
1385
+ assertTSInterfaceDeclaration(opts?: object): asserts this is NodePath<t.TSInterfaceDeclaration>;
1386
+ assertTSIntersectionType(opts?: object): asserts this is NodePath<t.TSIntersectionType>;
1387
+ assertTSIntrinsicKeyword(opts?: object): asserts this is NodePath<t.TSIntrinsicKeyword>;
1388
+ assertTSLiteralType(opts?: object): asserts this is NodePath<t.TSLiteralType>;
1389
+ assertTSMappedType(opts?: object): asserts this is NodePath<t.TSMappedType>;
1390
+ assertTSMethodSignature(opts?: object): asserts this is NodePath<t.TSMethodSignature>;
1391
+ assertTSModuleBlock(opts?: object): asserts this is NodePath<t.TSModuleBlock>;
1392
+ assertTSModuleDeclaration(opts?: object): asserts this is NodePath<t.TSModuleDeclaration>;
1393
+ assertTSNamedTupleMember(opts?: object): asserts this is NodePath<t.TSNamedTupleMember>;
1394
+ assertTSNamespaceExportDeclaration(opts?: object): asserts this is NodePath<t.TSNamespaceExportDeclaration>;
1395
+ assertTSNeverKeyword(opts?: object): asserts this is NodePath<t.TSNeverKeyword>;
1396
+ assertTSNonNullExpression(opts?: object): asserts this is NodePath<t.TSNonNullExpression>;
1397
+ assertTSNullKeyword(opts?: object): asserts this is NodePath<t.TSNullKeyword>;
1398
+ assertTSNumberKeyword(opts?: object): asserts this is NodePath<t.TSNumberKeyword>;
1399
+ assertTSObjectKeyword(opts?: object): asserts this is NodePath<t.TSObjectKeyword>;
1400
+ assertTSOptionalType(opts?: object): asserts this is NodePath<t.TSOptionalType>;
1401
+ assertTSParameterProperty(opts?: object): asserts this is NodePath<t.TSParameterProperty>;
1402
+ assertTSParenthesizedType(opts?: object): asserts this is NodePath<t.TSParenthesizedType>;
1403
+ assertTSPropertySignature(opts?: object): asserts this is NodePath<t.TSPropertySignature>;
1404
+ assertTSQualifiedName(opts?: object): asserts this is NodePath<t.TSQualifiedName>;
1405
+ assertTSRestType(opts?: object): asserts this is NodePath<t.TSRestType>;
1406
+ assertTSSatisfiesExpression(opts?: object): asserts this is NodePath<t.TSSatisfiesExpression>;
1407
+ assertTSStringKeyword(opts?: object): asserts this is NodePath<t.TSStringKeyword>;
1408
+ assertTSSymbolKeyword(opts?: object): asserts this is NodePath<t.TSSymbolKeyword>;
1409
+ assertTSThisType(opts?: object): asserts this is NodePath<t.TSThisType>;
1410
+ assertTSTupleType(opts?: object): asserts this is NodePath<t.TSTupleType>;
1411
+ assertTSType(opts?: object): asserts this is NodePath<t.TSType>;
1412
+ assertTSTypeAliasDeclaration(opts?: object): asserts this is NodePath<t.TSTypeAliasDeclaration>;
1413
+ assertTSTypeAnnotation(opts?: object): asserts this is NodePath<t.TSTypeAnnotation>;
1414
+ assertTSTypeAssertion(opts?: object): asserts this is NodePath<t.TSTypeAssertion>;
1415
+ assertTSTypeElement(opts?: object): asserts this is NodePath<t.TSTypeElement>;
1416
+ assertTSTypeLiteral(opts?: object): asserts this is NodePath<t.TSTypeLiteral>;
1417
+ assertTSTypeOperator(opts?: object): asserts this is NodePath<t.TSTypeOperator>;
1418
+ assertTSTypeParameter(opts?: object): asserts this is NodePath<t.TSTypeParameter>;
1419
+ assertTSTypeParameterDeclaration(opts?: object): asserts this is NodePath<t.TSTypeParameterDeclaration>;
1420
+ assertTSTypeParameterInstantiation(opts?: object): asserts this is NodePath<t.TSTypeParameterInstantiation>;
1421
+ assertTSTypePredicate(opts?: object): asserts this is NodePath<t.TSTypePredicate>;
1422
+ assertTSTypeQuery(opts?: object): asserts this is NodePath<t.TSTypeQuery>;
1423
+ assertTSTypeReference(opts?: object): asserts this is NodePath<t.TSTypeReference>;
1424
+ assertTSUndefinedKeyword(opts?: object): asserts this is NodePath<t.TSUndefinedKeyword>;
1425
+ assertTSUnionType(opts?: object): asserts this is NodePath<t.TSUnionType>;
1426
+ assertTSUnknownKeyword(opts?: object): asserts this is NodePath<t.TSUnknownKeyword>;
1427
+ assertTSVoidKeyword(opts?: object): asserts this is NodePath<t.TSVoidKeyword>;
1428
+ assertTaggedTemplateExpression(opts?: object): asserts this is NodePath<t.TaggedTemplateExpression>;
1429
+ assertTemplateElement(opts?: object): asserts this is NodePath<t.TemplateElement>;
1430
+ assertTemplateLiteral(opts?: object): asserts this is NodePath<t.TemplateLiteral>;
1431
+ assertTerminatorless(opts?: object): asserts this is NodePath<t.Terminatorless>;
1432
+ assertThisExpression(opts?: object): asserts this is NodePath<t.ThisExpression>;
1433
+ assertThisTypeAnnotation(opts?: object): asserts this is NodePath<t.ThisTypeAnnotation>;
1434
+ assertThrowStatement(opts?: object): asserts this is NodePath<t.ThrowStatement>;
1435
+ assertTopicReference(opts?: object): asserts this is NodePath<t.TopicReference>;
1436
+ assertTryStatement(opts?: object): asserts this is NodePath<t.TryStatement>;
1437
+ assertTupleExpression(opts?: object): asserts this is NodePath<t.TupleExpression>;
1438
+ assertTupleTypeAnnotation(opts?: object): asserts this is NodePath<t.TupleTypeAnnotation>;
1439
+ assertTypeAlias(opts?: object): asserts this is NodePath<t.TypeAlias>;
1440
+ assertTypeAnnotation(opts?: object): asserts this is NodePath<t.TypeAnnotation>;
1441
+ assertTypeCastExpression(opts?: object): asserts this is NodePath<t.TypeCastExpression>;
1442
+ assertTypeParameter(opts?: object): asserts this is NodePath<t.TypeParameter>;
1443
+ assertTypeParameterDeclaration(opts?: object): asserts this is NodePath<t.TypeParameterDeclaration>;
1444
+ assertTypeParameterInstantiation(opts?: object): asserts this is NodePath<t.TypeParameterInstantiation>;
1445
+ assertTypeScript(opts?: object): asserts this is NodePath<t.TypeScript>;
1446
+ assertTypeofTypeAnnotation(opts?: object): asserts this is NodePath<t.TypeofTypeAnnotation>;
1447
+ assertUnaryExpression(opts?: object): asserts this is NodePath<t.UnaryExpression>;
1448
+ assertUnaryLike(opts?: object): asserts this is NodePath<t.UnaryLike>;
1449
+ assertUnionTypeAnnotation(opts?: object): asserts this is NodePath<t.UnionTypeAnnotation>;
1450
+ assertUpdateExpression(opts?: object): asserts this is NodePath<t.UpdateExpression>;
1451
+ assertUserWhitespacable(opts?: object): asserts this is NodePath<t.UserWhitespacable>;
1452
+ assertV8IntrinsicIdentifier(opts?: object): asserts this is NodePath<t.V8IntrinsicIdentifier>;
1453
+ assertVariableDeclaration(opts?: object): asserts this is NodePath<t.VariableDeclaration>;
1454
+ assertVariableDeclarator(opts?: object): asserts this is NodePath<t.VariableDeclarator>;
1455
+ assertVariance(opts?: object): asserts this is NodePath<t.Variance>;
1456
+ assertVoidTypeAnnotation(opts?: object): asserts this is NodePath<t.VoidTypeAnnotation>;
1457
+ assertWhile(opts?: object): asserts this is NodePath<t.While>;
1458
+ assertWhileStatement(opts?: object): asserts this is NodePath<t.WhileStatement>;
1459
+ assertWithStatement(opts?: object): asserts this is NodePath<t.WithStatement>;
1460
+ assertYieldExpression(opts?: object): asserts this is NodePath<t.YieldExpression>;
1198
1461
  //#endregion
1199
1462
  }
1200
1463
 
@@ -1215,7 +1478,7 @@ export interface HubInterface {
1215
1478
  getCode(): string | undefined;
1216
1479
  getScope(): Scope | undefined;
1217
1480
  addHelper(name: string): any;
1218
- buildError<E extends Error>(node: Node, msg: string, Error: new (message?: string) => E): E;
1481
+ buildError(node: Node, msg: string, Error: ErrorConstructor): Error;
1219
1482
  }
1220
1483
 
1221
1484
  export class Hub implements HubInterface {
@@ -1224,16 +1487,35 @@ export class Hub implements HubInterface {
1224
1487
  getCode(): string | undefined;
1225
1488
  getScope(): Scope | undefined;
1226
1489
  addHelper(name: string): any;
1227
- buildError<E extends Error>(node: Node, msg: string, Constructor: new (message?: string) => E): E;
1490
+ buildError(node: Node, msg: string, Error?: ErrorConstructor): Error;
1228
1491
  }
1229
1492
 
1230
- export interface TraversalContext {
1493
+ export interface TraversalContext<S = unknown> {
1231
1494
  parentPath: NodePath;
1232
1495
  scope: Scope;
1233
- state: any;
1234
- opts: any;
1496
+ state: S;
1497
+ opts: TraverseOptions;
1235
1498
  }
1236
1499
 
1237
1500
  export type NodePathResult<T> =
1238
1501
  | (Extract<T, Node | null | undefined> extends never ? never : NodePath<Extract<T, Node | null | undefined>>)
1239
1502
  | (T extends Array<Node | null | undefined> ? Array<NodePath<T[number]>> : never);
1503
+
1504
+ export interface VirtualTypeAliases {
1505
+ BindingIdentifier: t.Identifier;
1506
+ BlockScoped: Node;
1507
+ ExistentialTypeParam: t.ExistsTypeAnnotation;
1508
+ Flow: t.Flow | t.ImportDeclaration | t.ExportDeclaration | t.ImportSpecifier;
1509
+ ForAwaitStatement: t.ForOfStatement;
1510
+ Generated: Node;
1511
+ NumericLiteralTypeAnnotation: t.NumberLiteralTypeAnnotation;
1512
+ Pure: Node;
1513
+ Referenced: Node;
1514
+ ReferencedIdentifier: t.Identifier | t.JSXIdentifier;
1515
+ ReferencedMemberExpression: t.MemberExpression;
1516
+ RestProperty: t.RestElement;
1517
+ Scope: t.Scopable | t.Pattern;
1518
+ SpreadProperty: t.RestElement;
1519
+ User: Node;
1520
+ Var: t.VariableDeclaration;
1521
+ }