1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | import * as t from '@babel/types';
|
14 | export import Node = t.Node;
|
15 |
|
16 | 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;
|
31 |
|
32 | visitors: typeof visitors;
|
33 | verify: typeof visitors.verify;
|
34 | explode: typeof visitors.explode;
|
35 | };
|
36 |
|
37 | export namespace visitors {
|
38 | |
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | function explode<S = {}>(
|
53 | visitor: Visitor<S>,
|
54 | ): {
|
55 | [Type in Node['type']]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
|
56 | };
|
57 | function verify(visitor: Visitor): void;
|
58 | function merge<S = {}>(visitors: Array<Visitor<S>>, states?: S[]): Visitor<unknown>;
|
59 | }
|
60 |
|
61 | export default traverse;
|
62 |
|
63 | export interface TraverseOptions<S = Node> extends Visitor<S> {
|
64 | scope?: Scope | undefined;
|
65 | noScope?: boolean | undefined;
|
66 | }
|
67 |
|
68 | export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
|
69 |
|
70 | export class Scope {
|
71 | constructor(path: NodePath, parentScope?: Scope);
|
72 | path: NodePath;
|
73 | block: Node;
|
74 | parentBlock: Node;
|
75 | parent: Scope;
|
76 | hub: HubInterface;
|
77 | bindings: { [name: string]: Binding };
|
78 |
|
79 |
|
80 | traverse<S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void;
|
81 | traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void;
|
82 |
|
83 |
|
84 | generateDeclaredUidIdentifier(name?: string): t.Identifier;
|
85 |
|
86 |
|
87 | generateUidIdentifier(name?: string): t.Identifier;
|
88 |
|
89 |
|
90 | generateUid(name?: string): string;
|
91 |
|
92 |
|
93 | generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): t.Identifier;
|
94 |
|
95 | |
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | isStatic(node: Node): boolean;
|
105 |
|
106 |
|
107 | maybeGenerateMemoised(node: Node, dontPush?: boolean): t.Identifier;
|
108 |
|
109 | checkBlockScopedCollisions(local: Node, kind: string, name: string, id: object): void;
|
110 |
|
111 | rename(oldName: string, newName?: string, block?: Node): void;
|
112 |
|
113 | dump(): void;
|
114 |
|
115 | toArray(node: Node, i?: number): Node;
|
116 |
|
117 | registerDeclaration(path: NodePath): void;
|
118 |
|
119 | buildUndefinedNode(): Node;
|
120 |
|
121 | registerConstantViolation(path: NodePath): void;
|
122 |
|
123 | registerBinding(kind: string, path: NodePath, bindingPath?: NodePath): void;
|
124 |
|
125 | addGlobal(node: Node): void;
|
126 |
|
127 | hasUid(name: string): boolean;
|
128 |
|
129 | hasGlobal(name: string): boolean;
|
130 |
|
131 | hasReference(name: string): boolean;
|
132 |
|
133 | isPure(node: Node, constantsOnly?: boolean): boolean;
|
134 |
|
135 | setData(key: string, val: any): any;
|
136 |
|
137 | getData(key: string): any;
|
138 |
|
139 | removeData(key: string): void;
|
140 |
|
141 | crawl(): void;
|
142 |
|
143 | push(opts: { id: t.LVal; init?: t.Expression | undefined; unique?: boolean | undefined; kind?: 'var' | 'let' | 'const' | undefined }): void;
|
144 |
|
145 | getProgramParent(): Scope;
|
146 |
|
147 | getFunctionParent(): Scope | null;
|
148 |
|
149 | getBlockParent(): Scope;
|
150 |
|
151 |
|
152 | getAllBindings(...kinds: string[]): object;
|
153 |
|
154 | bindingIdentifierEquals(name: string, node: Node): boolean;
|
155 |
|
156 | getBinding(name: string): Binding | undefined;
|
157 |
|
158 | getOwnBinding(name: string): Binding | undefined;
|
159 |
|
160 | getBindingIdentifier(name: string): t.Identifier;
|
161 |
|
162 | getOwnBindingIdentifier(name: string): t.Identifier;
|
163 |
|
164 | hasOwnBinding(name: string): boolean;
|
165 |
|
166 | hasBinding(name: string, noGlobals?: boolean): boolean;
|
167 |
|
168 | parentHasBinding(name: string, noGlobals?: boolean): boolean;
|
169 |
|
170 |
|
171 | moveBindingTo(name: string, scope: Scope): void;
|
172 |
|
173 | removeOwnBinding(name: string): void;
|
174 |
|
175 | removeBinding(name: string): void;
|
176 | }
|
177 |
|
178 | export class Binding {
|
179 | constructor(opts: {
|
180 | existing: Binding;
|
181 | identifier: t.Identifier;
|
182 | scope: Scope;
|
183 | path: NodePath;
|
184 | kind: 'var' | 'let' | 'const';
|
185 | });
|
186 | identifier: t.Identifier;
|
187 | scope: Scope;
|
188 | path: NodePath;
|
189 | kind: 'var' | 'let' | 'const' | 'module';
|
190 | referenced: boolean;
|
191 | references: number;
|
192 | referencePaths: NodePath[];
|
193 | constant: boolean;
|
194 | constantViolations: NodePath[];
|
195 | }
|
196 |
|
197 | export type Visitor<S = {}> = VisitNodeObject<S, Node> &
|
198 | {
|
199 | [Type in Node['type']]?: VisitNode<S, Extract<Node, { type: Type }>>;
|
200 | } &
|
201 | {
|
202 | [K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>;
|
203 | };
|
204 |
|
205 | export type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
206 |
|
207 | export type VisitNodeFunction<S, P extends Node> = (this: S, path: NodePath<P>, state: S) => void;
|
208 |
|
209 | type NodeType = Node['type'] | keyof t.Aliases;
|
210 |
|
211 | export interface VisitNodeObject<S, P extends Node> {
|
212 | enter?: VisitNodeFunction<S, P> | undefined;
|
213 | exit?: VisitNodeFunction<S, P> | undefined;
|
214 | denylist?: NodeType[] | undefined;
|
215 | |
216 |
|
217 |
|
218 | blacklist?: NodeType[] | undefined;
|
219 | }
|
220 |
|
221 | export type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[]
|
222 | ? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> }
|
223 | : T extends Node
|
224 | ? [NodePath<T>]
|
225 | : never;
|
226 |
|
227 | export class NodePath<T = Node> {
|
228 | constructor(hub: Hub, parent: Node);
|
229 | parent: Node;
|
230 | hub: Hub;
|
231 | contexts: TraversalContext[];
|
232 | data: object;
|
233 | shouldSkip: boolean;
|
234 | shouldStop: boolean;
|
235 | removed: boolean;
|
236 | state: any;
|
237 | opts: object;
|
238 | skipKeys: object;
|
239 | parentPath: T extends t.Program ? null : NodePath;
|
240 | context: TraversalContext;
|
241 | container: object | object[];
|
242 | listKey: string;
|
243 | inList: boolean;
|
244 | parentKey: string;
|
245 | key: string | number;
|
246 | node: T;
|
247 | scope: Scope;
|
248 | type: T extends null | undefined ? undefined : T extends Node ? T['type'] : string | undefined;
|
249 | typeAnnotation: object;
|
250 |
|
251 | getScope(scope: Scope): Scope;
|
252 |
|
253 | setData(key: string, val: any): any;
|
254 |
|
255 | getData(key: string, def?: any): any;
|
256 |
|
257 | buildCodeFrameError<TError extends Error>(msg: string, Error?: new (msg: string) => TError): TError;
|
258 |
|
259 | traverse<T>(visitor: Visitor<T>, state: T): void;
|
260 | traverse(visitor: Visitor): void;
|
261 |
|
262 | set(key: string, node: Node): void;
|
263 |
|
264 | getPathLocation(): string;
|
265 |
|
266 | // Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
|
267 | debug(buildMessage: () => string): void;
|
268 |
|
269 | static get<C extends Node, K extends keyof C>(opts: {
|
270 | hub: HubInterface;
|
271 | parentPath: NodePath | null;
|
272 | parent: Node;
|
273 | container: C;
|
274 | listKey?: string | undefined;
|
275 | key: K;
|
276 | }): NodePath<C[K]>;
|
277 |
|
278 | //#region ------------------------- ancestry -------------------------
|
279 | /**
|
280 | * Starting at the parent path of the current `NodePath` and going up the
|
281 | * tree, return the first `NodePath` that causes the provided `callback`
|
282 | * to return a truthy value, or `null` if the `callback` never returns a
|
283 | * truthy value.
|
284 | */
|
285 | findParent(callback: (path: NodePath) => boolean): NodePath | null;
|
286 |
|
287 | /**
|
288 | * Starting at current `NodePath` and going up the tree, return the first
|
289 | * `NodePath` that causes the provided `callback` to return a truthy value,
|
290 | * or `null` if the `callback` never returns a truthy value.
|
291 | */
|
292 | find(callback: (path: NodePath) => boolean): NodePath | null;
|
293 |
|
294 | /** Get the parent function of the current path. */
|
295 | getFunctionParent(): NodePath<t.Function> | null;
|
296 |
|
297 | /** Walk up the tree until we hit a parent node path in a list. */
|
298 | getStatementParent(): NodePath<t.Statement> | null;
|
299 |
|
300 | /**
|
301 | * Get the deepest common ancestor and then from it, get the earliest relationship path
|
302 | * to that ancestor.
|
303 | *
|
304 | * Earliest is defined as being "before" all the other nodes in terms of list container
|
305 | * position and visiting key.
|
306 | */
|
307 | getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath;
|
308 |
|
309 | /** Get the earliest path in the tree where the provided `paths` intersect. */
|
310 | getDeepestCommonAncestorFrom(
|
311 | paths: NodePath[],
|
312 | filter?: (deepest: Node, i: number, ancestries: NodePath[]) => NodePath,
|
313 | ): NodePath;
|
314 |
|
315 | /**
|
316 | * Build an array of node paths containing the entire ancestry of the current node path.
|
317 | *
|
318 | * NOTE: The current node path is included in this.
|
319 | */
|
320 | getAncestry(): [this, ...NodePath[]];
|
321 |
|
322 | /**
|
323 | * A helper to find if `this` path is an ancestor of `maybeDescendant`
|
324 | */
|
325 | isAncestor(maybeDescendant: NodePath): boolean;
|
326 |
|
327 | /**
|
328 | * A helper to find if `this` path is a descendant of `maybeAncestor`
|
329 | */
|
330 | isDescendant(maybeAncestor: NodePath): boolean;
|
331 |
|
332 | inType(...candidateTypes: string[]): boolean;
|
333 | //#endregion
|
334 |
|
335 | //#region ------------------------- inference -------------------------
|
336 | /** Infer the type of the current `NodePath`. */
|
337 | getTypeAnnotation(): t.FlowType;
|
338 |
|
339 | isBaseType(baseName: string, soft?: boolean): boolean;
|
340 |
|
341 | couldBeBaseType(name: string): boolean;
|
342 |
|
343 | baseTypeStrictlyMatches(right: NodePath): boolean;
|
344 |
|
345 | isGenericType(genericName: string): boolean;
|
346 | //#endregion
|
347 |
|
348 | //#region ------------------------- replacement -------------------------
|
349 | /**
|
350 | * Replace a node with an array of multiple. This method performs the following steps:
|
351 | *
|
352 | * - Inherit the comments of first provided node with that of the current node.
|
353 | * - Insert the provided nodes after the current node.
|
354 | * - Remove the current node.
|
355 | */
|
356 | replaceWithMultiple<Nodes extends readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
|
357 |
|
358 | /**
|
359 | * Parse a string as an expression and replace the current node with the result.
|
360 | *
|
361 | * NOTE: This is typically not a good idea to use. Building source strings when
|
362 | * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's
|
363 | * easier to use, your transforms will be extremely brittle.
|
364 | */
|
365 | replaceWithSourceString(replacement: any): [NodePath];
|
366 |
|
367 | /** Replace the current node with another. */
|
368 | replaceWith<T extends Node>(replacement: T | NodePath<T>): [NodePath<T>];
|
369 |
|
370 | /**
|
371 | * This method takes an array of statements nodes and then explodes it
|
372 | * into expressions. This method retains completion records which is
|
373 | * extremely important to retain original semantics.
|
374 | */
|
375 | replaceExpressionWithStatements<Nodes extends readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
|
376 |
|
377 | replaceInline<Nodes extends Node | readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
|
378 | //#endregion
|
379 |
|
380 | //#region ------------------------- evaluation -------------------------
|
381 | /**
|
382 | * Walk the input `node` and statically evaluate if it's truthy.
|
383 | *
|
384 | * Returning `true` when we're sure that the expression will evaluate to a
|
385 | * truthy value, `false` if we're sure that it will evaluate to a falsy
|
386 | * value and `undefined` if we aren't sure. Because of this please do not
|
387 | * rely on coercion when using this method and check with === if it's false.
|
388 | */
|
389 | evaluateTruthy(): boolean;
|
390 |
|
391 | /**
|
392 | * Walk the input `node` and statically evaluate it.
|
393 | *
|
394 | * Returns an object in the form `{ confident, value }`. `confident` indicates
|
395 | * whether or not we had to drop out of evaluating the expression because of
|
396 | * hitting an unknown node that we couldn't confidently find the value of.
|
397 | *
|
398 | * Example:
|
399 | *
|
400 | * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 }
|
401 | * t.evaluate(parse("!true")) // { confident: true, value: false }
|
402 | * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined }
|
403 | */
|
404 | evaluate(): { confident: boolean; value: any };
|
405 | //#endregion
|
406 |
|
407 | //#region ------------------------- introspection -------------------------
|
408 | /**
|
409 | * Match the current node if it matches the provided `pattern`.
|
410 | *
|
411 | * For example, given the match `React.createClass` it would match the
|
412 | * parsed nodes of `React.createClass` and `React["createClass"]`.
|
413 | */
|
414 | matchesPattern(pattern: string, allowPartial?: boolean): boolean;
|
415 |
|
416 | /**
|
417 | * Check whether we have the input `key`. If the `key` references an array then we check
|
418 | * if the array has any items, otherwise we just check if it's falsy.
|
419 | */
|
420 | has(key: string): boolean;
|
421 |
|
422 | isStatic(): boolean;
|
423 |
|
424 | /** Alias of `has`. */
|
425 | is(key: string): boolean;
|
426 |
|
427 | /** Opposite of `has`. */
|
428 | isnt(key: string): boolean;
|
429 |
|
430 | /** Check whether the path node `key` strict equals `value`. */
|
431 | equals(key: string, value: any): boolean;
|
432 |
|
433 | /**
|
434 | * Check the type against our stored internal type of the node. This is handy when a node has
|
435 | * been removed yet we still internally know the type and need it to calculate node replacement.
|
436 | */
|
437 | isNodeType(type: string): boolean;
|
438 |
|
439 | /**
|
440 | * This checks whether or not we're in one of the following positions:
|
441 | *
|
442 | * for (KEY in right);
|
443 | * for (KEY;;);
|
444 | *
|
445 | * This is because these spots allow VariableDeclarations AND normal expressions so we need
|
446 | * to tell the path replacement that it's ok to replace this with an expression.
|
447 | */
|
448 | canHaveVariableDeclarationOrExpression(): boolean;
|
449 |
|
450 | /**
|
451 | * This checks whether we are swapping an arrow function's body between an
|
452 | * expression and a block statement (or vice versa).
|
453 | *
|
454 | * This is because arrow functions may implicitly return an expression, which
|
455 | * is the same as containing a block statement.
|
456 | */
|
457 | canSwapBetweenExpressionAndStatement(replacement: Node): boolean;
|
458 |
|
459 | /** Check whether the current path references a completion record */
|
460 | isCompletionRecord(allowInsideFunction?: boolean): boolean;
|
461 |
|
462 | /**
|
463 | * Check whether or not the current `key` allows either a single statement or block statement
|
464 | * so we can explode it if necessary.
|
465 | */
|
466 | isStatementOrBlock(): boolean;
|
467 |
|
468 | /** Check if the currently assigned path references the `importName` of `moduleSource`. */
|
469 | referencesImport(moduleSource: string, importName: string): boolean;
|
470 |
|
471 | /** Get the source code associated with this node. */
|
472 | getSource(): string;
|
473 |
|
474 | /** Check if the current path will maybe execute before another path */
|
475 | willIMaybeExecuteBefore(path: NodePath): boolean;
|
476 | //#endregion
|
477 |
|
478 | //#region ------------------------- context -------------------------
|
479 | call(key: string): boolean;
|
480 |
|
481 | isBlacklisted(): boolean;
|
482 |
|
483 | visit(): boolean;
|
484 |
|
485 | skip(): void;
|
486 |
|
487 | skipKey(key: string): void;
|
488 |
|
489 | stop(): void;
|
490 |
|
491 | setScope(): void;
|
492 |
|
493 | setContext(context: TraversalContext): NodePath<T>;
|
494 |
|
495 | popContext(): void;
|
496 |
|
497 | pushContext(context: TraversalContext): void;
|
498 | //#endregion
|
499 |
|
500 | //#region ------------------------- removal -------------------------
|
501 | remove(): void;
|
502 | //#endregion
|
503 |
|
504 | //#region ------------------------- modification -------------------------
|
505 | /** Insert the provided nodes before the current one. */
|
506 | insertBefore<Nodes extends Node | readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
|
507 |
|
508 | /**
|
509 | * Insert the provided nodes after the current one. When inserting nodes after an
|
510 | * expression, ensure that the completion record is correct by pushing the current node.
|
511 | */
|
512 | insertAfter<Nodes extends Node | readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
|
513 |
|
514 | /** Update all sibling node paths after `fromIndex` by `incrementBy`. */
|
515 | updateSiblingKeys(fromIndex: number, incrementBy: number): void;
|
516 |
|
517 | /**
|
518 | * Insert child nodes at the start of the current node.
|
519 | * @param listKey - The key at which the child nodes are stored (usually body).
|
520 | * @param nodes - the nodes to insert.
|
521 | */
|
522 | unshiftContainer<Nodes extends Node | readonly Node[]>(listKey: ArrayKeys<T>, nodes: Nodes): NodePaths<Nodes>;
|
523 |
|
524 | /**
|
525 | * Insert child nodes at the end of the current node.
|
526 | * @param listKey - The key at which the child nodes are stored (usually body).
|
527 | * @param nodes - the nodes to insert.
|
528 | */
|
529 | pushContainer<Nodes extends Node | readonly Node[]>(listKey: ArrayKeys<T>, nodes: Nodes): NodePaths<Nodes>;
|
530 |
|
531 | /** Hoist the current node to the highest scope possible and return a UID referencing it. */
|
532 | hoist(scope: Scope): void;
|
533 | //#endregion
|
534 |
|
535 | //#region ------------------------- family -------------------------
|
536 | getOpposite(): NodePath;
|
537 |
|
538 | getCompletionRecords(): NodePath[];
|
539 |
|
540 | getSibling(key: string | number): NodePath;
|
541 | getPrevSibling(): NodePath;
|
542 | getNextSibling(): NodePath;
|
543 | getAllPrevSiblings(): NodePath[];
|
544 | getAllNextSiblings(): NodePath[];
|
545 |
|
546 | get<K extends keyof T>(
|
547 | key: K,
|
548 | context?: boolean | TraversalContext,
|
549 | ): T[K] extends Array<Node | null | undefined>
|
550 | ? Array<NodePath<T[K][number]>>
|
551 | : T[K] extends Node | null | undefined
|
552 | ? NodePath<T[K]>
|
553 | : never;
|
554 | get(key: string, context?: boolean | TraversalContext): NodePath | NodePath[];
|
555 |
|
556 | getBindingIdentifiers(duplicates?: boolean): Node[];
|
557 |
|
558 | getOuterBindingIdentifiers(duplicates?: boolean): Node[];
|
559 | //#endregion
|
560 |
|
561 | //#region ------------------------- comments -------------------------
|
562 | /** Share comments amongst siblings. */
|
563 | shareCommentsWithSiblings(): void;
|
564 |
|
565 | addComment(type: string, content: string, line?: boolean): void;
|
566 |
|
567 | /** Give node `comments` of the specified `type`. */
|
568 | addComments(type: string, comments: any[]): void;
|
569 | //#endregion
|
570 |
|
571 | //#region ------------------------- isXXX -------------------------
|
572 | isAnyTypeAnnotation(props?: object | null): this is NodePath<t.AnyTypeAnnotation>;
|
573 | isArrayExpression(props?: object | null): this is NodePath<t.ArrayExpression>;
|
574 | isArrayPattern(props?: object | null): this is NodePath<t.ArrayPattern>;
|
575 | isArrayTypeAnnotation(props?: object | null): this is NodePath<t.ArrayTypeAnnotation>;
|
576 | isArrowFunctionExpression(props?: object | null): this is NodePath<t.ArrowFunctionExpression>;
|
577 | isAssignmentExpression(props?: object | null): this is NodePath<t.AssignmentExpression>;
|
578 | isAssignmentPattern(props?: object | null): this is NodePath<t.AssignmentPattern>;
|
579 | isAwaitExpression(props?: object | null): this is NodePath<t.AwaitExpression>;
|
580 | isBigIntLiteral(props?: object | null): this is NodePath<t.BigIntLiteral>;
|
581 | isBinary(props?: object | null): this is NodePath<t.Binary>;
|
582 | isBinaryExpression(props?: object | null): this is NodePath<t.BinaryExpression>;
|
583 | isBindExpression(props?: object | null): this is NodePath<t.BindExpression>;
|
584 | isBlock(props?: object | null): this is NodePath<t.Block>;
|
585 | isBlockParent(props?: object | null): this is NodePath<t.BlockParent>;
|
586 | isBlockStatement(props?: object | null): this is NodePath<t.BlockStatement>;
|
587 | isBooleanLiteral(props?: object | null): this is NodePath<t.BooleanLiteral>;
|
588 | isBooleanLiteralTypeAnnotation(props?: object | null): this is NodePath<t.BooleanLiteralTypeAnnotation>;
|
589 | isBooleanTypeAnnotation(props?: object | null): this is NodePath<t.BooleanTypeAnnotation>;
|
590 | isBreakStatement(props?: object | null): this is NodePath<t.BreakStatement>;
|
591 | isCallExpression(props?: object | null): this is NodePath<t.CallExpression>;
|
592 | isCatchClause(props?: object | null): this is NodePath<t.CatchClause>;
|
593 | isClass(props?: object | null): this is NodePath<t.Class>;
|
594 | isClassBody(props?: object | null): this is NodePath<t.ClassBody>;
|
595 | isClassDeclaration(props?: object | null): this is NodePath<t.ClassDeclaration>;
|
596 | isClassExpression(props?: object | null): this is NodePath<t.ClassExpression>;
|
597 | isClassImplements(props?: object | null): this is NodePath<t.ClassImplements>;
|
598 | isClassMethod(props?: object | null): this is NodePath<t.ClassMethod>;
|
599 | isClassPrivateMethod(props?: object | null): this is NodePath<t.ClassPrivateMethod>;
|
600 | isClassPrivateProperty(props?: object | null): this is NodePath<t.ClassPrivateProperty>;
|
601 | isClassProperty(props?: object | null): this is NodePath<t.ClassProperty>;
|
602 | isCompletionStatement(props?: object | null): this is NodePath<t.CompletionStatement>;
|
603 | isConditional(props?: object | null): this is NodePath<t.Conditional>;
|
604 | isConditionalExpression(props?: object | null): this is NodePath<t.ConditionalExpression>;
|
605 | isContinueStatement(props?: object | null): this is NodePath<t.ContinueStatement>;
|
606 | isDebuggerStatement(props?: object | null): this is NodePath<t.DebuggerStatement>;
|
607 | isDeclaration(props?: object | null): this is NodePath<t.Declaration>;
|
608 | isDeclareClass(props?: object | null): this is NodePath<t.DeclareClass>;
|
609 | isDeclareExportAllDeclaration(props?: object | null): this is NodePath<t.DeclareExportAllDeclaration>;
|
610 | isDeclareExportDeclaration(props?: object | null): this is NodePath<t.DeclareExportDeclaration>;
|
611 | isDeclareFunction(props?: object | null): this is NodePath<t.DeclareFunction>;
|
612 | isDeclareInterface(props?: object | null): this is NodePath<t.DeclareInterface>;
|
613 | isDeclareModule(props?: object | null): this is NodePath<t.DeclareModule>;
|
614 | isDeclareModuleExports(props?: object | null): this is NodePath<t.DeclareModuleExports>;
|
615 | isDeclareOpaqueType(props?: object | null): this is NodePath<t.DeclareOpaqueType>;
|
616 | isDeclareTypeAlias(props?: object | null): this is NodePath<t.DeclareTypeAlias>;
|
617 | isDeclareVariable(props?: object | null): this is NodePath<t.DeclareVariable>;
|
618 | isDeclaredPredicate(props?: object | null): this is NodePath<t.DeclaredPredicate>;
|
619 | isDecorator(props?: object | null): this is NodePath<t.Decorator>;
|
620 | isDirective(props?: object | null): this is NodePath<t.Directive>;
|
621 | isDirectiveLiteral(props?: object | null): this is NodePath<t.DirectiveLiteral>;
|
622 | isDoExpression(props?: object | null): this is NodePath<t.DoExpression>;
|
623 | isDoWhileStatement(props?: object | null): this is NodePath<t.DoWhileStatement>;
|
624 | isEmptyStatement(props?: object | null): this is NodePath<t.EmptyStatement>;
|
625 | isEmptyTypeAnnotation(props?: object | null): this is NodePath<t.EmptyTypeAnnotation>;
|
626 | isExistsTypeAnnotation(props?: object | null): this is NodePath<t.ExistsTypeAnnotation>;
|
627 | isExportAllDeclaration(props?: object | null): this is NodePath<t.ExportAllDeclaration>;
|
628 | isExportDeclaration(props?: object | null): this is NodePath<t.ExportDeclaration>;
|
629 | isExportDefaultDeclaration(props?: object | null): this is NodePath<t.ExportDefaultDeclaration>;
|
630 | isExportDefaultSpecifier(props?: object | null): this is NodePath<t.ExportDefaultSpecifier>;
|
631 | isExportNamedDeclaration(props?: object | null): this is NodePath<t.ExportNamedDeclaration>;
|
632 | isExportNamespaceSpecifier(props?: object | null): this is NodePath<t.ExportNamespaceSpecifier>;
|
633 | isExportSpecifier(props?: object | null): this is NodePath<t.ExportSpecifier>;
|
634 | isExpression(props?: object | null): this is NodePath<t.Expression>;
|
635 | isExpressionStatement(props?: object | null): this is NodePath<t.ExpressionStatement>;
|
636 | isExpressionWrapper(props?: object | null): this is NodePath<t.ExpressionWrapper>;
|
637 | isFile(props?: object | null): this is NodePath<t.File>;
|
638 | isFlow(props?: object | null): this is NodePath<t.Flow>;
|
639 | isFlowBaseAnnotation(props?: object | null): this is NodePath<t.FlowBaseAnnotation>;
|
640 | isFlowDeclaration(props?: object | null): this is NodePath<t.FlowDeclaration>;
|
641 | isFlowPredicate(props?: object | null): this is NodePath<t.FlowPredicate>;
|
642 | isFlowType(props?: object | null): this is NodePath<t.FlowType>;
|
643 | isFor(props?: object | null): this is NodePath<t.For>;
|
644 | isForInStatement(props?: object | null): this is NodePath<t.ForInStatement>;
|
645 | isForOfStatement(props?: object | null): this is NodePath<t.ForOfStatement>;
|
646 | isForStatement(props?: object | null): this is NodePath<t.ForStatement>;
|
647 | isForXStatement(props?: object | null): this is NodePath<t.ForXStatement>;
|
648 | isFunction(props?: object | null): this is NodePath<t.Function>;
|
649 | isFunctionDeclaration(props?: object | null): this is NodePath<t.FunctionDeclaration>;
|
650 | isFunctionExpression(props?: object | null): this is NodePath<t.FunctionExpression>;
|
651 | isFunctionParent(props?: object | null): this is NodePath<t.FunctionParent>;
|
652 | isFunctionTypeAnnotation(props?: object | null): this is NodePath<t.FunctionTypeAnnotation>;
|
653 | isFunctionTypeParam(props?: object | null): this is NodePath<t.FunctionTypeParam>;
|
654 | isGenericTypeAnnotation(props?: object | null): this is NodePath<t.GenericTypeAnnotation>;
|
655 | isIdentifier(props?: object | null): this is NodePath<t.Identifier>;
|
656 | isIfStatement(props?: object | null): this is NodePath<t.IfStatement>;
|
657 | isImmutable(props?: object | null): this is NodePath<t.Immutable>;
|
658 | isImport(props?: object | null): this is NodePath<t.Import>;
|
659 | isImportDeclaration(props?: object | null): this is NodePath<t.ImportDeclaration>;
|
660 | isImportDefaultSpecifier(props?: object | null): this is NodePath<t.ImportDefaultSpecifier>;
|
661 | isImportNamespaceSpecifier(props?: object | null): this is NodePath<t.ImportNamespaceSpecifier>;
|
662 | isImportSpecifier(props?: object | null): this is NodePath<t.ImportSpecifier>;
|
663 | isInferredPredicate(props?: object | null): this is NodePath<t.InferredPredicate>;
|
664 | isInterfaceDeclaration(props?: object | null): this is NodePath<t.InterfaceDeclaration>;
|
665 | isInterfaceExtends(props?: object | null): this is NodePath<t.InterfaceExtends>;
|
666 | isInterfaceTypeAnnotation(props?: object | null): this is NodePath<t.InterfaceTypeAnnotation>;
|
667 | isInterpreterDirective(props?: object | null): this is NodePath<t.InterpreterDirective>;
|
668 | isIntersectionTypeAnnotation(props?: object | null): this is NodePath<t.IntersectionTypeAnnotation>;
|
669 | isJSX(props?: object | null): this is NodePath<t.JSX>;
|
670 | isJSXAttribute(props?: object | null): this is NodePath<t.JSXAttribute>;
|
671 | isJSXClosingElement(props?: object | null): this is NodePath<t.JSXClosingElement>;
|
672 | isJSXClosingFragment(props?: object | null): this is NodePath<t.JSXClosingFragment>;
|
673 | isJSXElement(props?: object | null): this is NodePath<t.JSXElement>;
|
674 | isJSXEmptyExpression(props?: object | null): this is NodePath<t.JSXEmptyExpression>;
|
675 | isJSXExpressionContainer(props?: object | null): this is NodePath<t.JSXExpressionContainer>;
|
676 | isJSXFragment(props?: object | null): this is NodePath<t.JSXFragment>;
|
677 | isJSXIdentifier(props?: object | null): this is NodePath<t.JSXIdentifier>;
|
678 | isJSXMemberExpression(props?: object | null): this is NodePath<t.JSXMemberExpression>;
|
679 | isJSXNamespacedName(props?: object | null): this is NodePath<t.JSXNamespacedName>;
|
680 | isJSXOpeningElement(props?: object | null): this is NodePath<t.JSXOpeningElement>;
|
681 | isJSXOpeningFragment(props?: object | null): this is NodePath<t.JSXOpeningFragment>;
|
682 | isJSXSpreadAttribute(props?: object | null): this is NodePath<t.JSXSpreadAttribute>;
|
683 | isJSXSpreadChild(props?: object | null): this is NodePath<t.JSXSpreadChild>;
|
684 | isJSXText(props?: object | null): this is NodePath<t.JSXText>;
|
685 | isLVal(props?: object | null): this is NodePath<t.LVal>;
|
686 | isLabeledStatement(props?: object | null): this is NodePath<t.LabeledStatement>;
|
687 | isLiteral(props?: object | null): this is NodePath<t.Literal>;
|
688 | isLogicalExpression(props?: object | null): this is NodePath<t.LogicalExpression>;
|
689 | isLoop(props?: object | null): this is NodePath<t.Loop>;
|
690 | isMemberExpression(props?: object | null): this is NodePath<t.MemberExpression>;
|
691 | isMetaProperty(props?: object | null): this is NodePath<t.MetaProperty>;
|
692 | isMethod(props?: object | null): this is NodePath<t.Method>;
|
693 | isMixedTypeAnnotation(props?: object | null): this is NodePath<t.MixedTypeAnnotation>;
|
694 | isModuleDeclaration(props?: object | null): this is NodePath<t.ModuleDeclaration>;
|
695 | isModuleSpecifier(props?: object | null): this is NodePath<t.ModuleSpecifier>;
|
696 | isNewExpression(props?: object | null): this is NodePath<t.NewExpression>;
|
697 | isNoop(props?: object | null): this is NodePath<t.Noop>;
|
698 | isNullLiteral(props?: object | null): this is NodePath<t.NullLiteral>;
|
699 | isNullLiteralTypeAnnotation(props?: object | null): this is NodePath<t.NullLiteralTypeAnnotation>;
|
700 | isNullableTypeAnnotation(props?: object | null): this is NodePath<t.NullableTypeAnnotation>;
|
701 |
|
702 | /** @deprecated Use `isNumericLiteral` */
|
703 | isNumberLiteral(props?: object | null): this is NodePath<t.NumericLiteral>;
|
704 | isNumberLiteralTypeAnnotation(props?: object | null): this is NodePath<t.NumberLiteralTypeAnnotation>;
|
705 | isNumberTypeAnnotation(props?: object | null): this is NodePath<t.NumberTypeAnnotation>;
|
706 | isNumericLiteral(props?: object | null): this is NodePath<t.NumericLiteral>;
|
707 | isObjectExpression(props?: object | null): this is NodePath<t.ObjectExpression>;
|
708 | isObjectMember(props?: object | null): this is NodePath<t.ObjectMember>;
|
709 | isObjectMethod(props?: object | null): this is NodePath<t.ObjectMethod>;
|
710 | isObjectPattern(props?: object | null): this is NodePath<t.ObjectPattern>;
|
711 | isObjectProperty(props?: object | null): this is NodePath<t.ObjectProperty>;
|
712 | isObjectTypeAnnotation(props?: object | null): this is NodePath<t.ObjectTypeAnnotation>;
|
713 | isObjectTypeCallProperty(props?: object | null): this is NodePath<t.ObjectTypeCallProperty>;
|
714 | isObjectTypeIndexer(props?: object | null): this is NodePath<t.ObjectTypeIndexer>;
|
715 | isObjectTypeInternalSlot(props?: object | null): this is NodePath<t.ObjectTypeInternalSlot>;
|
716 | isObjectTypeProperty(props?: object | null): this is NodePath<t.ObjectTypeProperty>;
|
717 | isObjectTypeSpreadProperty(props?: object | null): this is NodePath<t.ObjectTypeSpreadProperty>;
|
718 | isOpaqueType(props?: object | null): this is NodePath<t.OpaqueType>;
|
719 | isOptionalCallExpression(props?: object | null): this is NodePath<t.OptionalCallExpression>;
|
720 | isOptionalMemberExpression(props?: object | null): this is NodePath<t.OptionalMemberExpression>;
|
721 | isParenthesizedExpression(props?: object | null): this is NodePath<t.ParenthesizedExpression>;
|
722 | isPattern(props?: object | null): this is NodePath<t.Pattern>;
|
723 | isPatternLike(props?: object | null): this is NodePath<t.PatternLike>;
|
724 | isPipelineBareFunction(props?: object | null): this is NodePath<t.PipelineBareFunction>;
|
725 | isPipelinePrimaryTopicReference(props?: object | null): this is NodePath<t.PipelinePrimaryTopicReference>;
|
726 | isPipelineTopicExpression(props?: object | null): this is NodePath<t.PipelineTopicExpression>;
|
727 | isPrivate(props?: object | null): this is NodePath<t.Private>;
|
728 | isPrivateName(props?: object | null): this is NodePath<t.PrivateName>;
|
729 | isProgram(props?: object | null): this is NodePath<t.Program>;
|
730 | isProperty(props?: object | null): this is NodePath<t.Property>;
|
731 | isPureish(props?: object | null): this is NodePath<t.Pureish>;
|
732 | isQualifiedTypeIdentifier(props?: object | null): this is NodePath<t.QualifiedTypeIdentifier>;
|
733 | isRegExpLiteral(props?: object | null): this is NodePath<t.RegExpLiteral>;
|
734 |
|
735 | /** @deprecated Use `isRegExpLiteral` */
|
736 | isRegexLiteral(props?: object | null): this is NodePath<t.RegExpLiteral>;
|
737 | isRestElement(props?: object | null): this is NodePath<t.RestElement>;
|
738 |
|
739 | /** @deprecated Use `isRestElement` */
|
740 | isRestProperty(props?: object | null): this is NodePath<t.RestElement>;
|
741 | isReturnStatement(props?: object | null): this is NodePath<t.ReturnStatement>;
|
742 | isScopable(props?: object | null): this is NodePath<t.Scopable>;
|
743 | isSequenceExpression(props?: object | null): this is NodePath<t.SequenceExpression>;
|
744 | isSpreadElement(props?: object | null): this is NodePath<t.SpreadElement>;
|
745 |
|
746 | /** @deprecated Use `isSpreadElement` */
|
747 | isSpreadProperty(props?: object | null): this is NodePath<t.SpreadElement>;
|
748 | isStatement(props?: object | null): this is NodePath<t.Statement>;
|
749 | isStringLiteral(props?: object | null): this is NodePath<t.StringLiteral>;
|
750 | isStringLiteralTypeAnnotation(props?: object | null): this is NodePath<t.StringLiteralTypeAnnotation>;
|
751 | isStringTypeAnnotation(props?: object | null): this is NodePath<t.StringTypeAnnotation>;
|
752 | isSuper(props?: object | null): this is NodePath<t.Super>;
|
753 | isSwitchCase(props?: object | null): this is NodePath<t.SwitchCase>;
|
754 | isSwitchStatement(props?: object | null): this is NodePath<t.SwitchStatement>;
|
755 | isTSAnyKeyword(props?: object | null): this is NodePath<t.TSAnyKeyword>;
|
756 | isTSArrayType(props?: object | null): this is NodePath<t.TSArrayType>;
|
757 | isTSAsExpression(props?: object | null): this is NodePath<t.TSAsExpression>;
|
758 | isTSBooleanKeyword(props?: object | null): this is NodePath<t.TSBooleanKeyword>;
|
759 | isTSCallSignatureDeclaration(props?: object | null): this is NodePath<t.TSCallSignatureDeclaration>;
|
760 | isTSConditionalType(props?: object | null): this is NodePath<t.TSConditionalType>;
|
761 | isTSConstructSignatureDeclaration(props?: object | null): this is NodePath<t.TSConstructSignatureDeclaration>;
|
762 | isTSConstructorType(props?: object | null): this is NodePath<t.TSConstructorType>;
|
763 | isTSDeclareFunction(props?: object | null): this is NodePath<t.TSDeclareFunction>;
|
764 | isTSDeclareMethod(props?: object | null): this is NodePath<t.TSDeclareMethod>;
|
765 | isTSEntityName(props?: object | null): this is NodePath<t.TSEntityName>;
|
766 | isTSEnumDeclaration(props?: object | null): this is NodePath<t.TSEnumDeclaration>;
|
767 | isTSEnumMember(props?: object | null): this is NodePath<t.TSEnumMember>;
|
768 | isTSExportAssignment(props?: object | null): this is NodePath<t.TSExportAssignment>;
|
769 | isTSExpressionWithTypeArguments(props?: object | null): this is NodePath<t.TSExpressionWithTypeArguments>;
|
770 | isTSExternalModuleReference(props?: object | null): this is NodePath<t.TSExternalModuleReference>;
|
771 | isTSFunctionType(props?: object | null): this is NodePath<t.TSFunctionType>;
|
772 | isTSImportEqualsDeclaration(props?: object | null): this is NodePath<t.TSImportEqualsDeclaration>;
|
773 | isTSImportType(props?: object | null): this is NodePath<t.TSImportType>;
|
774 | isTSIndexSignature(props?: object | null): this is NodePath<t.TSIndexSignature>;
|
775 | isTSIndexedAccessType(props?: object | null): this is NodePath<t.TSIndexedAccessType>;
|
776 | isTSInferType(props?: object | null): this is NodePath<t.TSInferType>;
|
777 | isTSInterfaceBody(props?: object | null): this is NodePath<t.TSInterfaceBody>;
|
778 | isTSInterfaceDeclaration(props?: object | null): this is NodePath<t.TSInterfaceDeclaration>;
|
779 | isTSIntersectionType(props?: object | null): this is NodePath<t.TSIntersectionType>;
|
780 | isTSLiteralType(props?: object | null): this is NodePath<t.TSLiteralType>;
|
781 | isTSMappedType(props?: object | null): this is NodePath<t.TSMappedType>;
|
782 | isTSMethodSignature(props?: object | null): this is NodePath<t.TSMethodSignature>;
|
783 | isTSModuleBlock(props?: object | null): this is NodePath<t.TSModuleBlock>;
|
784 | isTSModuleDeclaration(props?: object | null): this is NodePath<t.TSModuleDeclaration>;
|
785 | isTSNamespaceExportDeclaration(props?: object | null): this is NodePath<t.TSNamespaceExportDeclaration>;
|
786 | isTSNeverKeyword(props?: object | null): this is NodePath<t.TSNeverKeyword>;
|
787 | isTSNonNullExpression(props?: object | null): this is NodePath<t.TSNonNullExpression>;
|
788 | isTSNullKeyword(props?: object | null): this is NodePath<t.TSNullKeyword>;
|
789 | isTSNumberKeyword(props?: object | null): this is NodePath<t.TSNumberKeyword>;
|
790 | isTSObjectKeyword(props?: object | null): this is NodePath<t.TSObjectKeyword>;
|
791 | isTSOptionalType(props?: object | null): this is NodePath<t.TSOptionalType>;
|
792 | isTSParameterProperty(props?: object | null): this is NodePath<t.TSParameterProperty>;
|
793 | isTSParenthesizedType(props?: object | null): this is NodePath<t.TSParenthesizedType>;
|
794 | isTSPropertySignature(props?: object | null): this is NodePath<t.TSPropertySignature>;
|
795 | isTSQualifiedName(props?: object | null): this is NodePath<t.TSQualifiedName>;
|
796 | isTSRestType(props?: object | null): this is NodePath<t.TSRestType>;
|
797 | isTSStringKeyword(props?: object | null): this is NodePath<t.TSStringKeyword>;
|
798 | isTSSymbolKeyword(props?: object | null): this is NodePath<t.TSSymbolKeyword>;
|
799 | isTSThisType(props?: object | null): this is NodePath<t.TSThisType>;
|
800 | isTSTupleType(props?: object | null): this is NodePath<t.TSTupleType>;
|
801 | isTSType(props?: object | null): this is NodePath<t.TSType>;
|
802 | isTSTypeAliasDeclaration(props?: object | null): this is NodePath<t.TSTypeAliasDeclaration>;
|
803 | isTSTypeAnnotation(props?: object | null): this is NodePath<t.TSTypeAnnotation>;
|
804 | isTSTypeAssertion(props?: object | null): this is NodePath<t.TSTypeAssertion>;
|
805 | isTSTypeElement(props?: object | null): this is NodePath<t.TSTypeElement>;
|
806 | isTSTypeLiteral(props?: object | null): this is NodePath<t.TSTypeLiteral>;
|
807 | isTSTypeOperator(props?: object | null): this is NodePath<t.TSTypeOperator>;
|
808 | isTSTypeParameter(props?: object | null): this is NodePath<t.TSTypeParameter>;
|
809 | isTSTypeParameterDeclaration(props?: object | null): this is NodePath<t.TSTypeParameterDeclaration>;
|
810 | isTSTypeParameterInstantiation(props?: object | null): this is NodePath<t.TSTypeParameterInstantiation>;
|
811 | isTSTypePredicate(props?: object | null): this is NodePath<t.TSTypePredicate>;
|
812 | isTSTypeQuery(props?: object | null): this is NodePath<t.TSTypeQuery>;
|
813 | isTSTypeReference(props?: object | null): this is NodePath<t.TSTypeReference>;
|
814 | isTSUndefinedKeyword(props?: object | null): this is NodePath<t.TSUndefinedKeyword>;
|
815 | isTSUnionType(props?: object | null): this is NodePath<t.TSUnionType>;
|
816 | isTSUnknownKeyword(props?: object | null): this is NodePath<t.TSUnknownKeyword>;
|
817 | isTSVoidKeyword(props?: object | null): this is NodePath<t.TSVoidKeyword>;
|
818 | isTaggedTemplateExpression(props?: object | null): this is NodePath<t.TaggedTemplateExpression>;
|
819 | isTemplateElement(props?: object | null): this is NodePath<t.TemplateElement>;
|
820 | isTemplateLiteral(props?: object | null): this is NodePath<t.TemplateLiteral>;
|
821 | isTerminatorless(props?: object | null): this is NodePath<t.Terminatorless>;
|
822 | isThisExpression(props?: object | null): this is NodePath<t.ThisExpression>;
|
823 | isThisTypeAnnotation(props?: object | null): this is NodePath<t.ThisTypeAnnotation>;
|
824 | isThrowStatement(props?: object | null): this is NodePath<t.ThrowStatement>;
|
825 | isTryStatement(props?: object | null): this is NodePath<t.TryStatement>;
|
826 | isTupleTypeAnnotation(props?: object | null): this is NodePath<t.TupleTypeAnnotation>;
|
827 | isTypeAlias(props?: object | null): this is NodePath<t.TypeAlias>;
|
828 | isTypeAnnotation(props?: object | null): this is NodePath<t.TypeAnnotation>;
|
829 | isTypeCastExpression(props?: object | null): this is NodePath<t.TypeCastExpression>;
|
830 | isTypeParameter(props?: object | null): this is NodePath<t.TypeParameter>;
|
831 | isTypeParameterDeclaration(props?: object | null): this is NodePath<t.TypeParameterDeclaration>;
|
832 | isTypeParameterInstantiation(props?: object | null): this is NodePath<t.TypeParameterInstantiation>;
|
833 | isTypeofTypeAnnotation(props?: object | null): this is NodePath<t.TypeofTypeAnnotation>;
|
834 | isUnaryExpression(props?: object | null): this is NodePath<t.UnaryExpression>;
|
835 | isUnaryLike(props?: object | null): this is NodePath<t.UnaryLike>;
|
836 | isUnionTypeAnnotation(props?: object | null): this is NodePath<t.UnionTypeAnnotation>;
|
837 | isUpdateExpression(props?: object | null): this is NodePath<t.UpdateExpression>;
|
838 | isUserWhitespacable(props?: object | null): this is NodePath<t.UserWhitespacable>;
|
839 | isVariableDeclaration(props?: object | null): this is NodePath<t.VariableDeclaration>;
|
840 | isVariableDeclarator(props?: object | null): this is NodePath<t.VariableDeclarator>;
|
841 | isVariance(props?: object | null): this is NodePath<t.Variance>;
|
842 | isVoidTypeAnnotation(props?: object | null): this is NodePath<t.VoidTypeAnnotation>;
|
843 | isWhile(props?: object | null): this is NodePath<t.While>;
|
844 | isWhileStatement(props?: object | null): this is NodePath<t.WhileStatement>;
|
845 | isWithStatement(props?: object | null): this is NodePath<t.WithStatement>;
|
846 | isYieldExpression(props?: object | null): this is NodePath<t.YieldExpression>;
|
847 |
|
848 | isBindingIdentifier(props?: object | null): this is NodePath<t.Identifier>;
|
849 | isBlockScoped(
|
850 | props?: object | null,
|
851 | ): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
|
852 | isGenerated(props?: object | null): boolean;
|
853 | isPure(props?: object | null): boolean;
|
854 | isReferenced(props?: object | null): boolean;
|
855 | isReferencedIdentifier(props?: object | null): this is NodePath<t.Identifier | t.JSXIdentifier>;
|
856 | isReferencedMemberExpression(props?: object | null): this is NodePath<t.MemberExpression>;
|
857 | isScope(props?: object | null): this is NodePath<t.Scopable>;
|
858 | isUser(props?: object | null): boolean;
|
859 | isVar(props?: object | null): this is NodePath<t.VariableDeclaration>;
|
860 | //#endregion
|
861 |
|
862 | //#region ------------------------- assertXXX -------------------------
|
863 | assertAnyTypeAnnotation(props?: object | null): void;
|
864 | assertArrayExpression(props?: object | null): void;
|
865 | assertArrayPattern(props?: object | null): void;
|
866 | assertArrayTypeAnnotation(props?: object | null): void;
|
867 | assertArrowFunctionExpression(props?: object | null): void;
|
868 | assertAssignmentExpression(props?: object | null): void;
|
869 | assertAssignmentPattern(props?: object | null): void;
|
870 | assertAwaitExpression(props?: object | null): void;
|
871 | assertBigIntLiteral(props?: object | null): void;
|
872 | assertBinary(props?: object | null): void;
|
873 | assertBinaryExpression(props?: object | null): void;
|
874 | assertBindExpression(props?: object | null): void;
|
875 | assertBlock(props?: object | null): void;
|
876 | assertBlockParent(props?: object | null): void;
|
877 | assertBlockStatement(props?: object | null): void;
|
878 | assertBooleanLiteral(props?: object | null): void;
|
879 | assertBooleanLiteralTypeAnnotation(props?: object | null): void;
|
880 | assertBooleanTypeAnnotation(props?: object | null): void;
|
881 | assertBreakStatement(props?: object | null): void;
|
882 | assertCallExpression(props?: object | null): void;
|
883 | assertCatchClause(props?: object | null): void;
|
884 | assertClass(props?: object | null): void;
|
885 | assertClassBody(props?: object | null): void;
|
886 | assertClassDeclaration(props?: object | null): void;
|
887 | assertClassExpression(props?: object | null): void;
|
888 | assertClassImplements(props?: object | null): void;
|
889 | assertClassMethod(props?: object | null): void;
|
890 | assertClassPrivateMethod(props?: object | null): void;
|
891 | assertClassPrivateProperty(props?: object | null): void;
|
892 | assertClassProperty(props?: object | null): void;
|
893 | assertCompletionStatement(props?: object | null): void;
|
894 | assertConditional(props?: object | null): void;
|
895 | assertConditionalExpression(props?: object | null): void;
|
896 | assertContinueStatement(props?: object | null): void;
|
897 | assertDebuggerStatement(props?: object | null): void;
|
898 | assertDeclaration(props?: object | null): void;
|
899 | assertDeclareClass(props?: object | null): void;
|
900 | assertDeclareExportAllDeclaration(props?: object | null): void;
|
901 | assertDeclareExportDeclaration(props?: object | null): void;
|
902 | assertDeclareFunction(props?: object | null): void;
|
903 | assertDeclareInterface(props?: object | null): void;
|
904 | assertDeclareModule(props?: object | null): void;
|
905 | assertDeclareModuleExports(props?: object | null): void;
|
906 | assertDeclareOpaqueType(props?: object | null): void;
|
907 | assertDeclareTypeAlias(props?: object | null): void;
|
908 | assertDeclareVariable(props?: object | null): void;
|
909 | assertDeclaredPredicate(props?: object | null): void;
|
910 | assertDecorator(props?: object | null): void;
|
911 | assertDirective(props?: object | null): void;
|
912 | assertDirectiveLiteral(props?: object | null): void;
|
913 | assertDoExpression(props?: object | null): void;
|
914 | assertDoWhileStatement(props?: object | null): void;
|
915 | assertEmptyStatement(props?: object | null): void;
|
916 | assertEmptyTypeAnnotation(props?: object | null): void;
|
917 | assertExistsTypeAnnotation(props?: object | null): void;
|
918 | assertExportAllDeclaration(props?: object | null): void;
|
919 | assertExportDeclaration(props?: object | null): void;
|
920 | assertExportDefaultDeclaration(props?: object | null): void;
|
921 | assertExportDefaultSpecifier(props?: object | null): void;
|
922 | assertExportNamedDeclaration(props?: object | null): void;
|
923 | assertExportNamespaceSpecifier(props?: object | null): void;
|
924 | assertExportSpecifier(props?: object | null): void;
|
925 | assertExpression(props?: object | null): void;
|
926 | assertExpressionStatement(props?: object | null): void;
|
927 | assertExpressionWrapper(props?: object | null): void;
|
928 | assertFile(props?: object | null): void;
|
929 | assertFlow(props?: object | null): void;
|
930 | assertFlowBaseAnnotation(props?: object | null): void;
|
931 | assertFlowDeclaration(props?: object | null): void;
|
932 | assertFlowPredicate(props?: object | null): void;
|
933 | assertFlowType(props?: object | null): void;
|
934 | assertFor(props?: object | null): void;
|
935 | assertForInStatement(props?: object | null): void;
|
936 | assertForOfStatement(props?: object | null): void;
|
937 | assertForStatement(props?: object | null): void;
|
938 | assertForXStatement(props?: object | null): void;
|
939 | assertFunction(props?: object | null): void;
|
940 | assertFunctionDeclaration(props?: object | null): void;
|
941 | assertFunctionExpression(props?: object | null): void;
|
942 | assertFunctionParent(props?: object | null): void;
|
943 | assertFunctionTypeAnnotation(props?: object | null): void;
|
944 | assertFunctionTypeParam(props?: object | null): void;
|
945 | assertGenericTypeAnnotation(props?: object | null): void;
|
946 | assertIdentifier(props?: object | null): void;
|
947 | assertIfStatement(props?: object | null): void;
|
948 | assertImmutable(props?: object | null): void;
|
949 | assertImport(props?: object | null): void;
|
950 | assertImportDeclaration(props?: object | null): void;
|
951 | assertImportDefaultSpecifier(props?: object | null): void;
|
952 | assertImportNamespaceSpecifier(props?: object | null): void;
|
953 | assertImportSpecifier(props?: object | null): void;
|
954 | assertInferredPredicate(props?: object | null): void;
|
955 | assertInterfaceDeclaration(props?: object | null): void;
|
956 | assertInterfaceExtends(props?: object | null): void;
|
957 | assertInterfaceTypeAnnotation(props?: object | null): void;
|
958 | assertInterpreterDirective(props?: object | null): void;
|
959 | assertIntersectionTypeAnnotation(props?: object | null): void;
|
960 | assertJSX(props?: object | null): void;
|
961 | assertJSXAttribute(props?: object | null): void;
|
962 | assertJSXClosingElement(props?: object | null): void;
|
963 | assertJSXClosingFragment(props?: object | null): void;
|
964 | assertJSXElement(props?: object | null): void;
|
965 | assertJSXEmptyExpression(props?: object | null): void;
|
966 | assertJSXExpressionContainer(props?: object | null): void;
|
967 | assertJSXFragment(props?: object | null): void;
|
968 | assertJSXIdentifier(props?: object | null): void;
|
969 | assertJSXMemberExpression(props?: object | null): void;
|
970 | assertJSXNamespacedName(props?: object | null): void;
|
971 | assertJSXOpeningElement(props?: object | null): void;
|
972 | assertJSXOpeningFragment(props?: object | null): void;
|
973 | assertJSXSpreadAttribute(props?: object | null): void;
|
974 | assertJSXSpreadChild(props?: object | null): void;
|
975 | assertJSXText(props?: object | null): void;
|
976 | assertLVal(props?: object | null): void;
|
977 | assertLabeledStatement(props?: object | null): void;
|
978 | assertLiteral(props?: object | null): void;
|
979 | assertLogicalExpression(props?: object | null): void;
|
980 | assertLoop(props?: object | null): void;
|
981 | assertMemberExpression(props?: object | null): void;
|
982 | assertMetaProperty(props?: object | null): void;
|
983 | assertMethod(props?: object | null): void;
|
984 | assertMixedTypeAnnotation(props?: object | null): void;
|
985 | assertModuleDeclaration(props?: object | null): void;
|
986 | assertModuleSpecifier(props?: object | null): void;
|
987 | assertNewExpression(props?: object | null): void;
|
988 | assertNoop(props?: object | null): void;
|
989 | assertNullLiteral(props?: object | null): void;
|
990 | assertNullLiteralTypeAnnotation(props?: object | null): void;
|
991 | assertNullableTypeAnnotation(props?: object | null): void;
|
992 |
|
993 | /** @deprecated Use `assertNumericLiteral` */
|
994 | assertNumberLiteral(props?: object | null): void;
|
995 | assertNumberLiteralTypeAnnotation(props?: object | null): void;
|
996 | assertNumberTypeAnnotation(props?: object | null): void;
|
997 | assertNumericLiteral(props?: object | null): void;
|
998 | assertObjectExpression(props?: object | null): void;
|
999 | assertObjectMember(props?: object | null): void;
|
1000 | assertObjectMethod(props?: object | null): void;
|
1001 | assertObjectPattern(props?: object | null): void;
|
1002 | assertObjectProperty(props?: object | null): void;
|
1003 | assertObjectTypeAnnotation(props?: object | null): void;
|
1004 | assertObjectTypeCallProperty(props?: object | null): void;
|
1005 | assertObjectTypeIndexer(props?: object | null): void;
|
1006 | assertObjectTypeInternalSlot(props?: object | null): void;
|
1007 | assertObjectTypeProperty(props?: object | null): void;
|
1008 | assertObjectTypeSpreadProperty(props?: object | null): void;
|
1009 | assertOpaqueType(props?: object | null): void;
|
1010 | assertOptionalCallExpression(props?: object | null): void;
|
1011 | assertOptionalMemberExpression(props?: object | null): void;
|
1012 | assertParenthesizedExpression(props?: object | null): void;
|
1013 | assertPattern(props?: object | null): void;
|
1014 | assertPatternLike(props?: object | null): void;
|
1015 | assertPipelineBareFunction(props?: object | null): void;
|
1016 | assertPipelinePrimaryTopicReference(props?: object | null): void;
|
1017 | assertPipelineTopicExpression(props?: object | null): void;
|
1018 | assertPrivate(props?: object | null): void;
|
1019 | assertPrivateName(props?: object | null): void;
|
1020 | assertProgram(props?: object | null): void;
|
1021 | assertProperty(props?: object | null): void;
|
1022 | assertPureish(props?: object | null): void;
|
1023 | assertQualifiedTypeIdentifier(props?: object | null): void;
|
1024 | assertRegExpLiteral(props?: object | null): void;
|
1025 |
|
1026 | /** @deprecated Use `assertRegExpLiteral` */
|
1027 | assertRegexLiteral(props?: object | null): void;
|
1028 | assertRestElement(props?: object | null): void;
|
1029 |
|
1030 | /** @deprecated Use `assertRestElement` */
|
1031 | assertRestProperty(props?: object | null): void;
|
1032 | assertReturnStatement(props?: object | null): void;
|
1033 | assertScopable(props?: object | null): void;
|
1034 | assertSequenceExpression(props?: object | null): void;
|
1035 | assertSpreadElement(props?: object | null): void;
|
1036 |
|
1037 | /** @deprecated Use `assertSpreadElement` */
|
1038 | assertSpreadProperty(props?: object | null): void;
|
1039 | assertStatement(props?: object | null): void;
|
1040 | assertStringLiteral(props?: object | null): void;
|
1041 | assertStringLiteralTypeAnnotation(props?: object | null): void;
|
1042 | assertStringTypeAnnotation(props?: object | null): void;
|
1043 | assertSuper(props?: object | null): void;
|
1044 | assertSwitchCase(props?: object | null): void;
|
1045 | assertSwitchStatement(props?: object | null): void;
|
1046 | assertTSAnyKeyword(props?: object | null): void;
|
1047 | assertTSArrayType(props?: object | null): void;
|
1048 | assertTSAsExpression(props?: object | null): void;
|
1049 | assertTSBooleanKeyword(props?: object | null): void;
|
1050 | assertTSCallSignatureDeclaration(props?: object | null): void;
|
1051 | assertTSConditionalType(props?: object | null): void;
|
1052 | assertTSConstructSignatureDeclaration(props?: object | null): void;
|
1053 | assertTSConstructorType(props?: object | null): void;
|
1054 | assertTSDeclareFunction(props?: object | null): void;
|
1055 | assertTSDeclareMethod(props?: object | null): void;
|
1056 | assertTSEntityName(props?: object | null): void;
|
1057 | assertTSEnumDeclaration(props?: object | null): void;
|
1058 | assertTSEnumMember(props?: object | null): void;
|
1059 | assertTSExportAssignment(props?: object | null): void;
|
1060 | assertTSExpressionWithTypeArguments(props?: object | null): void;
|
1061 | assertTSExternalModuleReference(props?: object | null): void;
|
1062 | assertTSFunctionType(props?: object | null): void;
|
1063 | assertTSImportEqualsDeclaration(props?: object | null): void;
|
1064 | assertTSImportType(props?: object | null): void;
|
1065 | assertTSIndexSignature(props?: object | null): void;
|
1066 | assertTSIndexedAccessType(props?: object | null): void;
|
1067 | assertTSInferType(props?: object | null): void;
|
1068 | assertTSInterfaceBody(props?: object | null): void;
|
1069 | assertTSInterfaceDeclaration(props?: object | null): void;
|
1070 | assertTSIntersectionType(props?: object | null): void;
|
1071 | assertTSLiteralType(props?: object | null): void;
|
1072 | assertTSMappedType(props?: object | null): void;
|
1073 | assertTSMethodSignature(props?: object | null): void;
|
1074 | assertTSModuleBlock(props?: object | null): void;
|
1075 | assertTSModuleDeclaration(props?: object | null): void;
|
1076 | assertTSNamespaceExportDeclaration(props?: object | null): void;
|
1077 | assertTSNeverKeyword(props?: object | null): void;
|
1078 | assertTSNonNullExpression(props?: object | null): void;
|
1079 | assertTSNullKeyword(props?: object | null): void;
|
1080 | assertTSNumberKeyword(props?: object | null): void;
|
1081 | assertTSObjectKeyword(props?: object | null): void;
|
1082 | assertTSOptionalType(props?: object | null): void;
|
1083 | assertTSParameterProperty(props?: object | null): void;
|
1084 | assertTSParenthesizedType(props?: object | null): void;
|
1085 | assertTSPropertySignature(props?: object | null): void;
|
1086 | assertTSQualifiedName(props?: object | null): void;
|
1087 | assertTSRestType(props?: object | null): void;
|
1088 | assertTSStringKeyword(props?: object | null): void;
|
1089 | assertTSSymbolKeyword(props?: object | null): void;
|
1090 | assertTSThisType(props?: object | null): void;
|
1091 | assertTSTupleType(props?: object | null): void;
|
1092 | assertTSType(props?: object | null): void;
|
1093 | assertTSTypeAliasDeclaration(props?: object | null): void;
|
1094 | assertTSTypeAnnotation(props?: object | null): void;
|
1095 | assertTSTypeAssertion(props?: object | null): void;
|
1096 | assertTSTypeElement(props?: object | null): void;
|
1097 | assertTSTypeLiteral(props?: object | null): void;
|
1098 | assertTSTypeOperator(props?: object | null): void;
|
1099 | assertTSTypeParameter(props?: object | null): void;
|
1100 | assertTSTypeParameterDeclaration(props?: object | null): void;
|
1101 | assertTSTypeParameterInstantiation(props?: object | null): void;
|
1102 | assertTSTypePredicate(props?: object | null): void;
|
1103 | assertTSTypeQuery(props?: object | null): void;
|
1104 | assertTSTypeReference(props?: object | null): void;
|
1105 | assertTSUndefinedKeyword(props?: object | null): void;
|
1106 | assertTSUnionType(props?: object | null): void;
|
1107 | assertTSUnknownKeyword(props?: object | null): void;
|
1108 | assertTSVoidKeyword(props?: object | null): void;
|
1109 | assertTaggedTemplateExpression(props?: object | null): void;
|
1110 | assertTemplateElement(props?: object | null): void;
|
1111 | assertTemplateLiteral(props?: object | null): void;
|
1112 | assertTerminatorless(props?: object | null): void;
|
1113 | assertThisExpression(props?: object | null): void;
|
1114 | assertThisTypeAnnotation(props?: object | null): void;
|
1115 | assertThrowStatement(props?: object | null): void;
|
1116 | assertTryStatement(props?: object | null): void;
|
1117 | assertTupleTypeAnnotation(props?: object | null): void;
|
1118 | assertTypeAlias(props?: object | null): void;
|
1119 | assertTypeAnnotation(props?: object | null): void;
|
1120 | assertTypeCastExpression(props?: object | null): void;
|
1121 | assertTypeParameter(props?: object | null): void;
|
1122 | assertTypeParameterDeclaration(props?: object | null): void;
|
1123 | assertTypeParameterInstantiation(props?: object | null): void;
|
1124 | assertTypeofTypeAnnotation(props?: object | null): void;
|
1125 | assertUnaryExpression(props?: object | null): void;
|
1126 | assertUnaryLike(props?: object | null): void;
|
1127 | assertUnionTypeAnnotation(props?: object | null): void;
|
1128 | assertUpdateExpression(props?: object | null): void;
|
1129 | assertUserWhitespacable(props?: object | null): void;
|
1130 | assertVariableDeclaration(props?: object | null): void;
|
1131 | assertVariableDeclarator(props?: object | null): void;
|
1132 | assertVariance(props?: object | null): void;
|
1133 | assertVoidTypeAnnotation(props?: object | null): void;
|
1134 | assertWhile(props?: object | null): void;
|
1135 | assertWhileStatement(props?: object | null): void;
|
1136 | assertWithStatement(props?: object | null): void;
|
1137 | assertYieldExpression(props?: object | null): void;
|
1138 |
|
1139 | assertBindingIdentifier(props?: object | null): void;
|
1140 | assertBlockScoped(props?: object | null): void;
|
1141 | assertGenerated(props?: object | null): void;
|
1142 | assertPure(props?: object | null): void;
|
1143 | assertReferenced(props?: object | null): void;
|
1144 | assertReferencedIdentifier(props?: object | null): void;
|
1145 | assertReferencedMemberExpression(props?: object | null): void;
|
1146 | assertScope(props?: object | null): void;
|
1147 | assertUser(props?: object | null): void;
|
1148 | assertVar(props?: object | null): void;
|
1149 | //#endregion
|
1150 | }
|
1151 |
|
1152 | export interface HubInterface {
|
1153 | getCode(): string | undefined;
|
1154 | getScope(): Scope | undefined;
|
1155 | addHelper(name: string): any;
|
1156 | buildError<E extends Error>(node: Node, msg: string, Error: new (message?: string) => E): E;
|
1157 | }
|
1158 |
|
1159 | export class Hub implements HubInterface {
|
1160 | constructor();
|
1161 | getCode(): string | undefined;
|
1162 | getScope(): Scope | undefined;
|
1163 | addHelper(name: string): any;
|
1164 | buildError<E extends Error>(node: Node, msg: string, Constructor: new (message?: string) => E): E;
|
1165 | }
|
1166 |
|
1167 | export interface TraversalContext {
|
1168 | parentPath: NodePath;
|
1169 | scope: Scope;
|
1170 | state: any;
|
1171 | opts: any;
|
1172 | }
|
1173 |
|
\ | No newline at end of file |