// Type definitions for babel-traverse v6.7 // Project: https://github.com/babel/babel/tree/master/packages/babel-traverse // Definitions by: Troy Gerwien // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// declare module "babel-traverse" { import * as t from 'babel-types'; type Node = t.Node; export default function traverse(parent: Node | Node[], opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void; export interface TraverseOptions extends Visitor { scope?: Scope; noScope?: boolean; } export class Scope { constructor(path: NodePath, parentScope?: Scope); path: NodePath; block: Node; parentBlock: Node; parent: Scope; hub: Hub; bindings: { [name: string]: Binding; }; /** Traverse node with current scope and path. */ traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void; /** Generate a unique identifier and add it to the current scope. */ generateDeclaredUidIdentifier(name?: string): t.Identifier; /** Generate a unique identifier. */ generateUidIdentifier(name?: string): t.Identifier; /** Generate a unique `_id1` binding. */ generateUid(name?: string): string; /** Generate a unique identifier based on a node. */ generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): t.Identifier; /** * Determine whether evaluating the specific input `node` is a consequenceless reference. ie. * evaluating it wont result in potentially arbitrary code from being ran. The following are * whitelisted and determined not to cause side effects: * * - `this` expressions * - `super` expressions * - Bound identifiers */ isStatic(node: Node): boolean; /** Possibly generate a memoised identifier if it is not static and has consequences. */ maybeGenerateMemoised(node: Node, dontPush?: boolean): t.Identifier; checkBlockScopedCollisions(local: Node, kind: string, name: string, id: Object): void; rename(oldName: string, newName?: string, block?: Node): void; dump(): void; toArray(node: Node, i?: number): Node; registerDeclaration(path: NodePath): void; buildUndefinedNode(): Node; registerConstantViolation(path: NodePath): void; registerBinding(kind: string, path: NodePath, bindingPath?: NodePath): void; addGlobal(node: Node): void; hasUid(name: string): boolean; hasGlobal(name: string): boolean; hasReference(name: string): boolean; isPure(node: Node, constantsOnly?: boolean): boolean; setData(key: string, val: any): any; getData(key: string): any; removeData(key: string): void; push(opts: any): void; getProgramParent(): Scope; getFunctionParent(): Scope; getBlockParent(): Scope; /** Walks the scope tree and gathers **all** bindings. */ getAllBindings(...kinds: string[]): Object; bindingIdentifierEquals(name: string, node: Node): boolean; getBinding(name: string): Binding; getOwnBinding(name: string): Binding; getBindingIdentifier(name: string): t.Identifier; getOwnBindingIdentifier(name: string): t.Identifier; hasOwnBinding(name: string): boolean; hasBinding(name: string, noGlobals?: boolean): boolean; parentHasBinding(name: string, noGlobals?: boolean): boolean; /** Move a binding of `name` to another `scope`. */ moveBindingTo(name: string, scope: Scope): void; removeOwnBinding(name: string): void; removeBinding(name: string): void; } export class Binding { constructor(opts: { existing: Binding; identifier: t.Identifier; scope: Scope; path: NodePath; kind: 'var' | 'let' | 'const'; }); identifier: t.Identifier; scope: Scope; path: NodePath; kind: 'var' | 'let' | 'const'; referenced: boolean; references: number; referencePaths: NodePath[]; constant: boolean; constantViolations: NodePath[]; } export interface Visitor extends VisitNodeObject { ArrayExpression?: VisitNode; AssignmentExpression?: VisitNode; LVal?: VisitNode; Expression?: VisitNode; BinaryExpression?: VisitNode; Directive?: VisitNode; DirectiveLiteral?: VisitNode; BlockStatement?: VisitNode; BreakStatement?: VisitNode; Identifier?: VisitNode; CallExpression?: VisitNode; CatchClause?: VisitNode; ConditionalExpression?: VisitNode; ContinueStatement?: VisitNode; DebuggerStatement?: VisitNode; DoWhileStatement?: VisitNode; Statement?: VisitNode; EmptyStatement?: VisitNode; ExpressionStatement?: VisitNode; File?: VisitNode; Program?: VisitNode; ForInStatement?: VisitNode; VariableDeclaration?: VisitNode; ForStatement?: VisitNode; FunctionDeclaration?: VisitNode; FunctionExpression?: VisitNode; IfStatement?: VisitNode; LabeledStatement?: VisitNode; StringLiteral?: VisitNode; NumericLiteral?: VisitNode; NullLiteral?: VisitNode; BooleanLiteral?: VisitNode; RegExpLiteral?: VisitNode; LogicalExpression?: VisitNode; MemberExpression?: VisitNode; NewExpression?: VisitNode; ObjectExpression?: VisitNode; ObjectMethod?: VisitNode; ObjectProperty?: VisitNode; RestElement?: VisitNode; ReturnStatement?: VisitNode; SequenceExpression?: VisitNode; SwitchCase?: VisitNode; SwitchStatement?: VisitNode; ThisExpression?: VisitNode; ThrowStatement?: VisitNode; TryStatement?: VisitNode; UnaryExpression?: VisitNode; UpdateExpression?: VisitNode; VariableDeclarator?: VisitNode; WhileStatement?: VisitNode; WithStatement?: VisitNode; AssignmentPattern?: VisitNode; ArrayPattern?: VisitNode; ArrowFunctionExpression?: VisitNode; ClassBody?: VisitNode; ClassDeclaration?: VisitNode; ClassExpression?: VisitNode; ExportAllDeclaration?: VisitNode; ExportDefaultDeclaration?: VisitNode; ExportNamedDeclaration?: VisitNode; Declaration?: VisitNode; ExportSpecifier?: VisitNode; ForOfStatement?: VisitNode; ImportDeclaration?: VisitNode; ImportDefaultSpecifier?: VisitNode; ImportNamespaceSpecifier?: VisitNode; ImportSpecifier?: VisitNode; MetaProperty?: VisitNode; ClassMethod?: VisitNode; ObjectPattern?: VisitNode; SpreadElement?: VisitNode; Super?: VisitNode; TaggedTemplateExpression?: VisitNode; TemplateLiteral?: VisitNode; TemplateElement?: VisitNode; YieldExpression?: VisitNode; AnyTypeAnnotation?: VisitNode; ArrayTypeAnnotation?: VisitNode; BooleanTypeAnnotation?: VisitNode; BooleanLiteralTypeAnnotation?: VisitNode; NullLiteralTypeAnnotation?: VisitNode; ClassImplements?: VisitNode; ClassProperty?: VisitNode; DeclareClass?: VisitNode; DeclareFunction?: VisitNode; DeclareInterface?: VisitNode; DeclareModule?: VisitNode; DeclareTypeAlias?: VisitNode; DeclareVariable?: VisitNode; ExistentialTypeParam?: VisitNode; FunctionTypeAnnotation?: VisitNode; FunctionTypeParam?: VisitNode; GenericTypeAnnotation?: VisitNode; InterfaceExtends?: VisitNode; InterfaceDeclaration?: VisitNode; IntersectionTypeAnnotation?: VisitNode; MixedTypeAnnotation?: VisitNode; NullableTypeAnnotation?: VisitNode; NumericLiteralTypeAnnotation?: VisitNode; NumberTypeAnnotation?: VisitNode; StringLiteralTypeAnnotation?: VisitNode; StringTypeAnnotation?: VisitNode; ThisTypeAnnotation?: VisitNode; TupleTypeAnnotation?: VisitNode; TypeofTypeAnnotation?: VisitNode; TypeAlias?: VisitNode; TypeAnnotation?: VisitNode; TypeCastExpression?: VisitNode; TypeParameterDeclaration?: VisitNode; TypeParameterInstantiation?: VisitNode; ObjectTypeAnnotation?: VisitNode; ObjectTypeCallProperty?: VisitNode; ObjectTypeIndexer?: VisitNode; ObjectTypeProperty?: VisitNode; QualifiedTypeIdentifier?: VisitNode; UnionTypeAnnotation?: VisitNode; VoidTypeAnnotation?: VisitNode; JSXAttribute?: VisitNode; JSXIdentifier?: VisitNode; JSXNamespacedName?: VisitNode; JSXElement?: VisitNode; JSXExpressionContainer?: VisitNode; JSXClosingElement?: VisitNode; JSXMemberExpression?: VisitNode; JSXOpeningElement?: VisitNode; JSXEmptyExpression?: VisitNode; JSXSpreadAttribute?: VisitNode; JSXText?: VisitNode; Noop?: VisitNode; ParenthesizedExpression?: VisitNode; AwaitExpression?: VisitNode; BindExpression?: VisitNode; Decorator?: VisitNode; DoExpression?: VisitNode; ExportDefaultSpecifier?: VisitNode; ExportNamespaceSpecifier?: VisitNode; RestProperty?: VisitNode; SpreadProperty?: VisitNode; Binary?: VisitNode; Scopable?: VisitNode; BlockParent?: VisitNode; Block?: VisitNode; Terminatorless?: VisitNode; CompletionStatement?: VisitNode; Conditional?: VisitNode; Loop?: VisitNode; While?: VisitNode; ExpressionWrapper?: VisitNode; For?: VisitNode; ForXStatement?: VisitNode; Function?: VisitNode; FunctionParent?: VisitNode; Pureish?: VisitNode; Literal?: VisitNode; Immutable?: VisitNode; UserWhitespacable?: VisitNode; Method?: VisitNode; ObjectMember?: VisitNode; Property?: VisitNode; UnaryLike?: VisitNode; Pattern?: VisitNode; Class?: VisitNode; ModuleDeclaration?: VisitNode; ExportDeclaration?: VisitNode; ModuleSpecifier?: VisitNode; Flow?: VisitNode; FlowBaseAnnotation?: VisitNode; FlowDeclaration?: VisitNode; JSX?: VisitNode; } export type VisitNode = VisitNodeFunction | VisitNodeObject; export type VisitNodeFunction = (path: NodePath, state: any) => void; export interface VisitNodeObject { enter?(path: NodePath, state: any): void; exit?(path: NodePath, state: any): void; } export class NodePath { constructor(hub: Hub, parent: Node); parent: Node; hub: Hub; contexts: TraversalContext[]; data: Object; shouldSkip: boolean; shouldStop: boolean; removed: boolean; state: any; opts: Object; skipKeys: Object; parentPath: NodePath; context: TraversalContext; container: Object | Object[]; listKey: string; inList: boolean; parentKey: string; key: string; node: T; scope: Scope; type: string; typeAnnotation: Object; getScope(scope: Scope): Scope; setData(key: string, val: any): any; getData(key: string, def?: any): any; buildCodeFrameError(msg: string, Error: Error): Error; traverse(visitor: Visitor, state?: any): void; set(key: string, node: Node): void; getPathLocation(): string; debug(buildMessage: Function): void; // ------------------------- ancestry ------------------------- /** * Call the provided `callback` with the `NodePath`s of all the parents. * When the `callback` returns a truthy value, we return that node path. */ findParent(callback: (path: NodePath) => boolean): NodePath; find(callback: (path: NodePath) => boolean): NodePath; /** Get the parent function of the current path. */ getFunctionParent(): NodePath; /** Walk up the tree until we hit a parent node path in a list. */ getStatementParent(): NodePath; /** * Get the deepest common ancestor and then from it, get the earliest relationship path * to that ancestor. * * Earliest is defined as being "before" all the other nodes in terms of list container * position and visiting key. */ getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath; /** Get the earliest path in the tree where the provided `paths` intersect. */ getDeepestCommonAncestorFrom(paths: NodePath[], filter?: Function): NodePath; /** * Build an array of node paths containing the entire ancestry of the current node path. * * NOTE: The current node path is included in this. */ getAncestry(): NodePath[]; inType(...candidateTypes: string[]): boolean; // ------------------------- inference ------------------------- /** Infer the type of the current `NodePath`. */ getTypeAnnotation(): t.FlowTypeAnnotation; isBaseType(baseName: string, soft?: boolean): boolean; couldBeBaseType(name: string): boolean; baseTypeStrictlyMatches(right: NodePath): boolean; isGenericType(genericName: string): boolean; // ------------------------- replacement ------------------------- /** * Replace a node with an array of multiple. This method performs the following steps: * * - Inherit the comments of first provided node with that of the current node. * - Insert the provided nodes after the current node. * - Remove the current node. */ replaceWithMultiple(nodes: Node[]): void; /** * Parse a string as an expression and replace the current node with the result. * * NOTE: This is typically not a good idea to use. Building source strings when * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's * easier to use, your transforms will be extremely brittle. */ replaceWithSourceString(replacement: any): void; /** Replace the current node with another. */ replaceWith(replacement: Node | NodePath): void; /** * This method takes an array of statements nodes and then explodes it * into expressions. This method retains completion records which is * extremely important to retain original semantics. */ replaceExpressionWithStatements(nodes: Node[]): Node; replaceInline(nodes: Node | Node[]): void; // ------------------------- evaluation ------------------------- /** * Walk the input `node` and statically evaluate if it's truthy. * * Returning `true` when we're sure that the expression will evaluate to a * truthy value, `false` if we're sure that it will evaluate to a falsy * value and `undefined` if we aren't sure. Because of this please do not * rely on coercion when using this method and check with === if it's false. */ evaluateTruthy(): boolean; /** * Walk the input `node` and statically evaluate it. * * Returns an object in the form `{ confident, value }`. `confident` indicates * whether or not we had to drop out of evaluating the expression because of * hitting an unknown node that we couldn't confidently find the value of. * * Example: * * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 } * t.evaluate(parse("!true")) // { confident: true, value: false } * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined } */ evaluate(): { confident: boolean; value: any }; // ------------------------- introspection ------------------------- /** * Match the current node if it matches the provided `pattern`. * * For example, given the match `React.createClass` it would match the * parsed nodes of `React.createClass` and `React["createClass"]`. */ matchesPattern(pattern: string, allowPartial?: boolean): boolean; /** * Check whether we have the input `key`. If the `key` references an array then we check * if the array has any items, otherwise we just check if it's falsy. */ has(key: string): boolean; isStatic(): boolean; /** Alias of `has`. */ is(key: string): boolean; /** Opposite of `has`. */ isnt(key: string): boolean; /** Check whether the path node `key` strict equals `value`. */ equals(key: string, value: any): boolean; /** * Check the type against our stored internal type of the node. This is handy when a node has * been removed yet we still internally know the type and need it to calculate node replacement. */ isNodeType(type: string): boolean; /** * This checks whether or not we're in one of the following positions: * * for (KEY in right); * for (KEY;;); * * This is because these spots allow VariableDeclarations AND normal expressions so we need * to tell the path replacement that it's ok to replace this with an expression. */ canHaveVariableDeclarationOrExpression(): boolean; /** * This checks whether we are swapping an arrow function's body between an * expression and a block statement (or vice versa). * * This is because arrow functions may implicitly return an expression, which * is the same as containing a block statement. */ canSwapBetweenExpressionAndStatement(replacement: Node): boolean; /** Check whether the current path references a completion record */ isCompletionRecord(allowInsideFunction?: boolean): boolean; /** * Check whether or not the current `key` allows either a single statement or block statement * so we can explode it if necessary. */ isStatementOrBlock(): boolean; /** Check if the currently assigned path references the `importName` of `moduleSource`. */ referencesImport(moduleSource: string, importName: string): boolean; /** Get the source code associated with this node. */ getSource(): string; // ------------------------- context ------------------------- call(key: string): boolean; isBlacklisted(): boolean; visit(): boolean; skip(): void; skipKey(key: string): void; stop(): void; setScope(): void; setContext(context: TraversalContext): NodePath; popContext(): void; pushContext(context: TraversalContext): void; // ------------------------- removal ------------------------- remove(): void; // ------------------------- modification ------------------------- /** Insert the provided nodes before the current one. */ insertBefore(nodes: Node | Node[]): any; /** * Insert the provided nodes after the current one. When inserting nodes after an * expression, ensure that the completion record is correct by pushing the current node. */ insertAfter(nodes: Node | Node[]): any; /** Update all sibling node paths after `fromIndex` by `incrementBy`. */ updateSiblingKeys(fromIndex: number, incrementBy: number): void; /** Hoist the current node to the highest scope possible and return a UID referencing it. */ hoist(scope: Scope): void; // ------------------------- family ------------------------- getStatementParent(): NodePath; getOpposite(): NodePath; getCompletionRecords(): NodePath[]; getSibling(key: string): NodePath; get(key: string, context?: boolean | TraversalContext): NodePath; getBindingIdentifiers(duplicates?: boolean): Node[]; getOuterBindingIdentifiers(duplicates?: boolean): Node[]; // ------------------------- comments ------------------------- /** Share comments amongst siblings. */ shareCommentsWithSiblings(): void; addComment(type: string, content: string, line?: boolean): void; /** Give node `comments` of the specified `type`. */ addComments(type: string, comments: any[]): void; // ------------------------- isXXX ------------------------- isArrayExpression(opts?: Object): boolean; isAssignmentExpression(opts?: Object): boolean; isBinaryExpression(opts?: Object): boolean; isDirective(opts?: Object): boolean; isDirectiveLiteral(opts?: Object): boolean; isBlockStatement(opts?: Object): boolean; isBreakStatement(opts?: Object): boolean; isCallExpression(opts?: Object): boolean; isCatchClause(opts?: Object): boolean; isConditionalExpression(opts?: Object): boolean; isContinueStatement(opts?: Object): boolean; isDebuggerStatement(opts?: Object): boolean; isDoWhileStatement(opts?: Object): boolean; isEmptyStatement(opts?: Object): boolean; isExpressionStatement(opts?: Object): boolean; isFile(opts?: Object): boolean; isForInStatement(opts?: Object): boolean; isForStatement(opts?: Object): boolean; isFunctionDeclaration(opts?: Object): boolean; isFunctionExpression(opts?: Object): boolean; isIdentifier(opts?: Object): boolean; isIfStatement(opts?: Object): boolean; isLabeledStatement(opts?: Object): boolean; isStringLiteral(opts?: Object): boolean; isNumericLiteral(opts?: Object): boolean; isNullLiteral(opts?: Object): boolean; isBooleanLiteral(opts?: Object): boolean; isRegExpLiteral(opts?: Object): boolean; isLogicalExpression(opts?: Object): boolean; isMemberExpression(opts?: Object): boolean; isNewExpression(opts?: Object): boolean; isProgram(opts?: Object): boolean; isObjectExpression(opts?: Object): boolean; isObjectMethod(opts?: Object): boolean; isObjectProperty(opts?: Object): boolean; isRestElement(opts?: Object): boolean; isReturnStatement(opts?: Object): boolean; isSequenceExpression(opts?: Object): boolean; isSwitchCase(opts?: Object): boolean; isSwitchStatement(opts?: Object): boolean; isThisExpression(opts?: Object): boolean; isThrowStatement(opts?: Object): boolean; isTryStatement(opts?: Object): boolean; isUnaryExpression(opts?: Object): boolean; isUpdateExpression(opts?: Object): boolean; isVariableDeclaration(opts?: Object): boolean; isVariableDeclarator(opts?: Object): boolean; isWhileStatement(opts?: Object): boolean; isWithStatement(opts?: Object): boolean; isAssignmentPattern(opts?: Object): boolean; isArrayPattern(opts?: Object): boolean; isArrowFunctionExpression(opts?: Object): boolean; isClassBody(opts?: Object): boolean; isClassDeclaration(opts?: Object): boolean; isClassExpression(opts?: Object): boolean; isExportAllDeclaration(opts?: Object): boolean; isExportDefaultDeclaration(opts?: Object): boolean; isExportNamedDeclaration(opts?: Object): boolean; isExportSpecifier(opts?: Object): boolean; isForOfStatement(opts?: Object): boolean; isImportDeclaration(opts?: Object): boolean; isImportDefaultSpecifier(opts?: Object): boolean; isImportNamespaceSpecifier(opts?: Object): boolean; isImportSpecifier(opts?: Object): boolean; isMetaProperty(opts?: Object): boolean; isClassMethod(opts?: Object): boolean; isObjectPattern(opts?: Object): boolean; isSpreadElement(opts?: Object): boolean; isSuper(opts?: Object): boolean; isTaggedTemplateExpression(opts?: Object): boolean; isTemplateElement(opts?: Object): boolean; isTemplateLiteral(opts?: Object): boolean; isYieldExpression(opts?: Object): boolean; isAnyTypeAnnotation(opts?: Object): boolean; isArrayTypeAnnotation(opts?: Object): boolean; isBooleanTypeAnnotation(opts?: Object): boolean; isBooleanLiteralTypeAnnotation(opts?: Object): boolean; isNullLiteralTypeAnnotation(opts?: Object): boolean; isClassImplements(opts?: Object): boolean; isClassProperty(opts?: Object): boolean; isDeclareClass(opts?: Object): boolean; isDeclareFunction(opts?: Object): boolean; isDeclareInterface(opts?: Object): boolean; isDeclareModule(opts?: Object): boolean; isDeclareTypeAlias(opts?: Object): boolean; isDeclareVariable(opts?: Object): boolean; isExistentialTypeParam(opts?: Object): boolean; isFunctionTypeAnnotation(opts?: Object): boolean; isFunctionTypeParam(opts?: Object): boolean; isGenericTypeAnnotation(opts?: Object): boolean; isInterfaceExtends(opts?: Object): boolean; isInterfaceDeclaration(opts?: Object): boolean; isIntersectionTypeAnnotation(opts?: Object): boolean; isMixedTypeAnnotation(opts?: Object): boolean; isNullableTypeAnnotation(opts?: Object): boolean; isNumericLiteralTypeAnnotation(opts?: Object): boolean; isNumberTypeAnnotation(opts?: Object): boolean; isStringLiteralTypeAnnotation(opts?: Object): boolean; isStringTypeAnnotation(opts?: Object): boolean; isThisTypeAnnotation(opts?: Object): boolean; isTupleTypeAnnotation(opts?: Object): boolean; isTypeofTypeAnnotation(opts?: Object): boolean; isTypeAlias(opts?: Object): boolean; isTypeAnnotation(opts?: Object): boolean; isTypeCastExpression(opts?: Object): boolean; isTypeParameterDeclaration(opts?: Object): boolean; isTypeParameterInstantiation(opts?: Object): boolean; isObjectTypeAnnotation(opts?: Object): boolean; isObjectTypeCallProperty(opts?: Object): boolean; isObjectTypeIndexer(opts?: Object): boolean; isObjectTypeProperty(opts?: Object): boolean; isQualifiedTypeIdentifier(opts?: Object): boolean; isUnionTypeAnnotation(opts?: Object): boolean; isVoidTypeAnnotation(opts?: Object): boolean; isJSXAttribute(opts?: Object): boolean; isJSXClosingElement(opts?: Object): boolean; isJSXElement(opts?: Object): boolean; isJSXEmptyExpression(opts?: Object): boolean; isJSXExpressionContainer(opts?: Object): boolean; isJSXIdentifier(opts?: Object): boolean; isJSXMemberExpression(opts?: Object): boolean; isJSXNamespacedName(opts?: Object): boolean; isJSXOpeningElement(opts?: Object): boolean; isJSXSpreadAttribute(opts?: Object): boolean; isJSXText(opts?: Object): boolean; isNoop(opts?: Object): boolean; isParenthesizedExpression(opts?: Object): boolean; isAwaitExpression(opts?: Object): boolean; isBindExpression(opts?: Object): boolean; isDecorator(opts?: Object): boolean; isDoExpression(opts?: Object): boolean; isExportDefaultSpecifier(opts?: Object): boolean; isExportNamespaceSpecifier(opts?: Object): boolean; isRestProperty(opts?: Object): boolean; isSpreadProperty(opts?: Object): boolean; isExpression(opts?: Object): boolean; isBinary(opts?: Object): boolean; isScopable(opts?: Object): boolean; isBlockParent(opts?: Object): boolean; isBlock(opts?: Object): boolean; isStatement(opts?: Object): boolean; isTerminatorless(opts?: Object): boolean; isCompletionStatement(opts?: Object): boolean; isConditional(opts?: Object): boolean; isLoop(opts?: Object): boolean; isWhile(opts?: Object): boolean; isExpressionWrapper(opts?: Object): boolean; isFor(opts?: Object): boolean; isForXStatement(opts?: Object): boolean; isFunction(opts?: Object): boolean; isFunctionParent(opts?: Object): boolean; isPureish(opts?: Object): boolean; isDeclaration(opts?: Object): boolean; isLVal(opts?: Object): boolean; isLiteral(opts?: Object): boolean; isImmutable(opts?: Object): boolean; isUserWhitespacable(opts?: Object): boolean; isMethod(opts?: Object): boolean; isObjectMember(opts?: Object): boolean; isProperty(opts?: Object): boolean; isUnaryLike(opts?: Object): boolean; isPattern(opts?: Object): boolean; isClass(opts?: Object): boolean; isModuleDeclaration(opts?: Object): boolean; isExportDeclaration(opts?: Object): boolean; isModuleSpecifier(opts?: Object): boolean; isFlow(opts?: Object): boolean; isFlowBaseAnnotation(opts?: Object): boolean; isFlowDeclaration(opts?: Object): boolean; isJSX(opts?: Object): boolean; isNumberLiteral(opts?: Object): boolean; isRegexLiteral(opts?: Object): boolean; isReferencedIdentifier(opts?: Object): boolean; isReferencedMemberExpression(opts?: Object): boolean; isBindingIdentifier(opts?: Object): boolean; isScope(opts?: Object): boolean; isReferenced(opts?: Object): boolean; isBlockScoped(opts?: Object): boolean; isVar(opts?: Object): boolean; isUser(opts?: Object): boolean; isGenerated(opts?: Object): boolean; isPure(opts?: Object): boolean; // ------------------------- assertXXX ------------------------- assertArrayExpression(opts?: Object): void; assertAssignmentExpression(opts?: Object): void; assertBinaryExpression(opts?: Object): void; assertDirective(opts?: Object): void; assertDirectiveLiteral(opts?: Object): void; assertBlockStatement(opts?: Object): void; assertBreakStatement(opts?: Object): void; assertCallExpression(opts?: Object): void; assertCatchClause(opts?: Object): void; assertConditionalExpression(opts?: Object): void; assertContinueStatement(opts?: Object): void; assertDebuggerStatement(opts?: Object): void; assertDoWhileStatement(opts?: Object): void; assertEmptyStatement(opts?: Object): void; assertExpressionStatement(opts?: Object): void; assertFile(opts?: Object): void; assertForInStatement(opts?: Object): void; assertForStatement(opts?: Object): void; assertFunctionDeclaration(opts?: Object): void; assertFunctionExpression(opts?: Object): void; assertIdentifier(opts?: Object): void; assertIfStatement(opts?: Object): void; assertLabeledStatement(opts?: Object): void; assertStringLiteral(opts?: Object): void; assertNumericLiteral(opts?: Object): void; assertNullLiteral(opts?: Object): void; assertBooleanLiteral(opts?: Object): void; assertRegExpLiteral(opts?: Object): void; assertLogicalExpression(opts?: Object): void; assertMemberExpression(opts?: Object): void; assertNewExpression(opts?: Object): void; assertProgram(opts?: Object): void; assertObjectExpression(opts?: Object): void; assertObjectMethod(opts?: Object): void; assertObjectProperty(opts?: Object): void; assertRestElement(opts?: Object): void; assertReturnStatement(opts?: Object): void; assertSequenceExpression(opts?: Object): void; assertSwitchCase(opts?: Object): void; assertSwitchStatement(opts?: Object): void; assertThisExpression(opts?: Object): void; assertThrowStatement(opts?: Object): void; assertTryStatement(opts?: Object): void; assertUnaryExpression(opts?: Object): void; assertUpdateExpression(opts?: Object): void; assertVariableDeclaration(opts?: Object): void; assertVariableDeclarator(opts?: Object): void; assertWhileStatement(opts?: Object): void; assertWithStatement(opts?: Object): void; assertAssignmentPattern(opts?: Object): void; assertArrayPattern(opts?: Object): void; assertArrowFunctionExpression(opts?: Object): void; assertClassBody(opts?: Object): void; assertClassDeclaration(opts?: Object): void; assertClassExpression(opts?: Object): void; assertExportAllDeclaration(opts?: Object): void; assertExportDefaultDeclaration(opts?: Object): void; assertExportNamedDeclaration(opts?: Object): void; assertExportSpecifier(opts?: Object): void; assertForOfStatement(opts?: Object): void; assertImportDeclaration(opts?: Object): void; assertImportDefaultSpecifier(opts?: Object): void; assertImportNamespaceSpecifier(opts?: Object): void; assertImportSpecifier(opts?: Object): void; assertMetaProperty(opts?: Object): void; assertClassMethod(opts?: Object): void; assertObjectPattern(opts?: Object): void; assertSpreadElement(opts?: Object): void; assertSuper(opts?: Object): void; assertTaggedTemplateExpression(opts?: Object): void; assertTemplateElement(opts?: Object): void; assertTemplateLiteral(opts?: Object): void; assertYieldExpression(opts?: Object): void; assertAnyTypeAnnotation(opts?: Object): void; assertArrayTypeAnnotation(opts?: Object): void; assertBooleanTypeAnnotation(opts?: Object): void; assertBooleanLiteralTypeAnnotation(opts?: Object): void; assertNullLiteralTypeAnnotation(opts?: Object): void; assertClassImplements(opts?: Object): void; assertClassProperty(opts?: Object): void; assertDeclareClass(opts?: Object): void; assertDeclareFunction(opts?: Object): void; assertDeclareInterface(opts?: Object): void; assertDeclareModule(opts?: Object): void; assertDeclareTypeAlias(opts?: Object): void; assertDeclareVariable(opts?: Object): void; assertExistentialTypeParam(opts?: Object): void; assertFunctionTypeAnnotation(opts?: Object): void; assertFunctionTypeParam(opts?: Object): void; assertGenericTypeAnnotation(opts?: Object): void; assertInterfaceExtends(opts?: Object): void; assertInterfaceDeclaration(opts?: Object): void; assertIntersectionTypeAnnotation(opts?: Object): void; assertMixedTypeAnnotation(opts?: Object): void; assertNullableTypeAnnotation(opts?: Object): void; assertNumericLiteralTypeAnnotation(opts?: Object): void; assertNumberTypeAnnotation(opts?: Object): void; assertStringLiteralTypeAnnotation(opts?: Object): void; assertStringTypeAnnotation(opts?: Object): void; assertThisTypeAnnotation(opts?: Object): void; assertTupleTypeAnnotation(opts?: Object): void; assertTypeofTypeAnnotation(opts?: Object): void; assertTypeAlias(opts?: Object): void; assertTypeAnnotation(opts?: Object): void; assertTypeCastExpression(opts?: Object): void; assertTypeParameterDeclaration(opts?: Object): void; assertTypeParameterInstantiation(opts?: Object): void; assertObjectTypeAnnotation(opts?: Object): void; assertObjectTypeCallProperty(opts?: Object): void; assertObjectTypeIndexer(opts?: Object): void; assertObjectTypeProperty(opts?: Object): void; assertQualifiedTypeIdentifier(opts?: Object): void; assertUnionTypeAnnotation(opts?: Object): void; assertVoidTypeAnnotation(opts?: Object): void; assertJSXAttribute(opts?: Object): void; assertJSXClosingElement(opts?: Object): void; assertJSXElement(opts?: Object): void; assertJSXEmptyExpression(opts?: Object): void; assertJSXExpressionContainer(opts?: Object): void; assertJSXIdentifier(opts?: Object): void; assertJSXMemberExpression(opts?: Object): void; assertJSXNamespacedName(opts?: Object): void; assertJSXOpeningElement(opts?: Object): void; assertJSXSpreadAttribute(opts?: Object): void; assertJSXText(opts?: Object): void; assertNoop(opts?: Object): void; assertParenthesizedExpression(opts?: Object): void; assertAwaitExpression(opts?: Object): void; assertBindExpression(opts?: Object): void; assertDecorator(opts?: Object): void; assertDoExpression(opts?: Object): void; assertExportDefaultSpecifier(opts?: Object): void; assertExportNamespaceSpecifier(opts?: Object): void; assertRestProperty(opts?: Object): void; assertSpreadProperty(opts?: Object): void; assertExpression(opts?: Object): void; assertBinary(opts?: Object): void; assertScopable(opts?: Object): void; assertBlockParent(opts?: Object): void; assertBlock(opts?: Object): void; assertStatement(opts?: Object): void; assertTerminatorless(opts?: Object): void; assertCompletionStatement(opts?: Object): void; assertConditional(opts?: Object): void; assertLoop(opts?: Object): void; assertWhile(opts?: Object): void; assertExpressionWrapper(opts?: Object): void; assertFor(opts?: Object): void; assertForXStatement(opts?: Object): void; assertFunction(opts?: Object): void; assertFunctionParent(opts?: Object): void; assertPureish(opts?: Object): void; assertDeclaration(opts?: Object): void; assertLVal(opts?: Object): void; assertLiteral(opts?: Object): void; assertImmutable(opts?: Object): void; assertUserWhitespacable(opts?: Object): void; assertMethod(opts?: Object): void; assertObjectMember(opts?: Object): void; assertProperty(opts?: Object): void; assertUnaryLike(opts?: Object): void; assertPattern(opts?: Object): void; assertClass(opts?: Object): void; assertModuleDeclaration(opts?: Object): void; assertExportDeclaration(opts?: Object): void; assertModuleSpecifier(opts?: Object): void; assertFlow(opts?: Object): void; assertFlowBaseAnnotation(opts?: Object): void; assertFlowDeclaration(opts?: Object): void; assertJSX(opts?: Object): void; assertNumberLiteral(opts?: Object): void; assertRegexLiteral(opts?: Object): void; } export class Hub { constructor(file: any, options: any); file: any; options: any; } interface TraversalContext { parentPath: NodePath; scope: Scope; state: any; opts: any; } }