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