Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 58KB

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