@types/babel-traverse
- Version 6.25.10
- Published
- 51.6 kB
- 1 dependency
- MIT license
Install
npm i @types/babel-traverse
yarn add @types/babel-traverse
pnpm add @types/babel-traverse
Overview
TypeScript definitions for babel-traverse
Index
Functions
Classes
NodePath
- addComment()
- addComments()
- assertAnyTypeAnnotation()
- assertArrayExpression()
- assertArrayPattern()
- assertArrayTypeAnnotation()
- assertArrowFunctionExpression()
- assertAssignmentExpression()
- assertAssignmentPattern()
- assertAwaitExpression()
- assertBinary()
- assertBinaryExpression()
- assertBindExpression()
- assertBlock()
- assertBlockParent()
- assertBlockStatement()
- assertBooleanLiteral()
- assertBooleanLiteralTypeAnnotation()
- assertBooleanTypeAnnotation()
- assertBreakStatement()
- assertCallExpression()
- assertCatchClause()
- assertClass()
- assertClassBody()
- assertClassDeclaration()
- assertClassExpression()
- assertClassImplements()
- assertClassMethod()
- assertClassProperty()
- assertCompletionStatement()
- assertConditional()
- assertConditionalExpression()
- assertContinueStatement()
- assertDebuggerStatement()
- assertDeclaration()
- assertDeclareClass()
- assertDeclareFunction()
- assertDeclareInterface()
- assertDeclareModule()
- assertDeclareTypeAlias()
- assertDeclareVariable()
- assertDecorator()
- assertDirective()
- assertDirectiveLiteral()
- assertDoExpression()
- assertDoWhileStatement()
- assertEmptyStatement()
- assertExistentialTypeParam()
- assertExportAllDeclaration()
- assertExportDeclaration()
- assertExportDefaultDeclaration()
- assertExportDefaultSpecifier()
- assertExportNamedDeclaration()
- assertExportNamespaceSpecifier()
- assertExportSpecifier()
- assertExpression()
- assertExpressionStatement()
- assertExpressionWrapper()
- assertFile()
- assertFlow()
- assertFlowBaseAnnotation()
- assertFlowDeclaration()
- assertFor()
- assertForInStatement()
- assertForOfStatement()
- assertForStatement()
- assertForXStatement()
- assertFunction()
- assertFunctionDeclaration()
- assertFunctionExpression()
- assertFunctionParent()
- assertFunctionTypeAnnotation()
- assertFunctionTypeParam()
- assertGenericTypeAnnotation()
- assertIdentifier()
- assertIfStatement()
- assertImmutable()
- assertImportDeclaration()
- assertImportDefaultSpecifier()
- assertImportNamespaceSpecifier()
- assertImportSpecifier()
- assertInterfaceDeclaration()
- assertInterfaceExtends()
- assertIntersectionTypeAnnotation()
- assertJSX()
- assertJSXAttribute()
- assertJSXClosingElement()
- assertJSXElement()
- assertJSXEmptyExpression()
- assertJSXExpressionContainer()
- assertJSXIdentifier()
- assertJSXMemberExpression()
- assertJSXNamespacedName()
- assertJSXOpeningElement()
- assertJSXSpreadAttribute()
- assertJSXText()
- assertLabeledStatement()
- assertLiteral()
- assertLogicalExpression()
- assertLoop()
- assertLVal()
- assertMemberExpression()
- assertMetaProperty()
- assertMethod()
- assertMixedTypeAnnotation()
- assertModuleDeclaration()
- assertModuleSpecifier()
- assertNewExpression()
- assertNoop()
- assertNullableTypeAnnotation()
- assertNullLiteral()
- assertNullLiteralTypeAnnotation()
- assertNumberLiteral()
- assertNumberTypeAnnotation()
- assertNumericLiteral()
- assertNumericLiteralTypeAnnotation()
- assertObjectExpression()
- assertObjectMember()
- assertObjectMethod()
- assertObjectPattern()
- assertObjectProperty()
- assertObjectTypeAnnotation()
- assertObjectTypeCallProperty()
- assertObjectTypeIndexer()
- assertObjectTypeProperty()
- assertParenthesizedExpression()
- assertPattern()
- assertProgram()
- assertProperty()
- assertPureish()
- assertQualifiedTypeIdentifier()
- assertRegexLiteral()
- assertRegExpLiteral()
- assertRestElement()
- assertRestProperty()
- assertReturnStatement()
- assertScopable()
- assertSequenceExpression()
- assertSpreadElement()
- assertSpreadProperty()
- assertStatement()
- assertStringLiteral()
- assertStringLiteralTypeAnnotation()
- assertStringTypeAnnotation()
- assertSuper()
- assertSwitchCase()
- assertSwitchStatement()
- assertTaggedTemplateExpression()
- assertTemplateElement()
- assertTemplateLiteral()
- assertTerminatorless()
- assertThisExpression()
- assertThisTypeAnnotation()
- assertThrowStatement()
- assertTryStatement()
- assertTupleTypeAnnotation()
- assertTypeAlias()
- assertTypeAnnotation()
- assertTypeCastExpression()
- assertTypeofTypeAnnotation()
- assertTypeParameterDeclaration()
- assertTypeParameterInstantiation()
- assertUnaryExpression()
- assertUnaryLike()
- assertUnionTypeAnnotation()
- assertUpdateExpression()
- assertUserWhitespacable()
- assertVariableDeclaration()
- assertVariableDeclarator()
- assertVoidTypeAnnotation()
- assertWhile()
- assertWhileStatement()
- assertWithStatement()
- assertYieldExpression()
- baseTypeStrictlyMatches()
- buildCodeFrameError()
- call()
- canHaveVariableDeclarationOrExpression()
- canSwapBetweenExpressionAndStatement()
- container
- context
- contexts
- couldBeBaseType()
- data
- debug()
- equals()
- evaluate()
- evaluateTruthy()
- find()
- findParent()
- get()
- getAllNextSiblings()
- getAllPrevSiblings()
- getAncestry()
- getBindingIdentifiers()
- getCompletionRecords()
- getData()
- getDeepestCommonAncestorFrom()
- getEarliestCommonAncestorFrom()
- getFunctionParent()
- getNextSibling()
- getOpposite()
- getOuterBindingIdentifiers()
- getPathLocation()
- getPrevSibling()
- getScope()
- getSibling()
- getSource()
- getStatementParent()
- getTypeAnnotation()
- has()
- hoist()
- hub
- inList
- insertAfter()
- insertBefore()
- inType()
- is()
- isAnyTypeAnnotation()
- isArrayExpression()
- isArrayPattern()
- isArrayTypeAnnotation()
- isArrowFunctionExpression()
- isAssignmentExpression()
- isAssignmentPattern()
- isAwaitExpression()
- isBaseType()
- isBinary()
- isBinaryExpression()
- isBindExpression()
- isBindingIdentifier()
- isBlacklisted()
- isBlock()
- isBlockParent()
- isBlockScoped()
- isBlockStatement()
- isBooleanLiteral()
- isBooleanLiteralTypeAnnotation()
- isBooleanTypeAnnotation()
- isBreakStatement()
- isCallExpression()
- isCatchClause()
- isClass()
- isClassBody()
- isClassDeclaration()
- isClassExpression()
- isClassImplements()
- isClassMethod()
- isClassProperty()
- isCompletionRecord()
- isCompletionStatement()
- isConditional()
- isConditionalExpression()
- isContinueStatement()
- isDebuggerStatement()
- isDeclaration()
- isDeclareClass()
- isDeclareFunction()
- isDeclareInterface()
- isDeclareModule()
- isDeclareTypeAlias()
- isDeclareVariable()
- isDecorator()
- isDirective()
- isDirectiveLiteral()
- isDoExpression()
- isDoWhileStatement()
- isEmptyStatement()
- isExistentialTypeParam()
- isExportAllDeclaration()
- isExportDeclaration()
- isExportDefaultDeclaration()
- isExportDefaultSpecifier()
- isExportNamedDeclaration()
- isExportNamespaceSpecifier()
- isExportSpecifier()
- isExpression()
- isExpressionStatement()
- isExpressionWrapper()
- isFile()
- isFlow()
- isFlowBaseAnnotation()
- isFlowDeclaration()
- isFor()
- isForInStatement()
- isForOfStatement()
- isForStatement()
- isForXStatement()
- isFunction()
- isFunctionDeclaration()
- isFunctionExpression()
- isFunctionParent()
- isFunctionTypeAnnotation()
- isFunctionTypeParam()
- isGenerated()
- isGenericType()
- isGenericTypeAnnotation()
- isIdentifier()
- isIfStatement()
- isImmutable()
- isImportDeclaration()
- isImportDefaultSpecifier()
- isImportNamespaceSpecifier()
- isImportSpecifier()
- isInterfaceDeclaration()
- isInterfaceExtends()
- isIntersectionTypeAnnotation()
- isJSX()
- isJSXAttribute()
- isJSXClosingElement()
- isJSXElement()
- isJSXEmptyExpression()
- isJSXExpressionContainer()
- isJSXIdentifier()
- isJSXMemberExpression()
- isJSXNamespacedName()
- isJSXOpeningElement()
- isJSXSpreadAttribute()
- isJSXText()
- isLabeledStatement()
- isLiteral()
- isLogicalExpression()
- isLoop()
- isLVal()
- isMemberExpression()
- isMetaProperty()
- isMethod()
- isMixedTypeAnnotation()
- isModuleDeclaration()
- isModuleSpecifier()
- isNewExpression()
- isNodeType()
- isNoop()
- isnt()
- isNullableTypeAnnotation()
- isNullLiteral()
- isNullLiteralTypeAnnotation()
- isNumberLiteral()
- isNumberTypeAnnotation()
- isNumericLiteral()
- isNumericLiteralTypeAnnotation()
- isObjectExpression()
- isObjectMember()
- isObjectMethod()
- isObjectPattern()
- isObjectProperty()
- isObjectTypeAnnotation()
- isObjectTypeCallProperty()
- isObjectTypeIndexer()
- isObjectTypeProperty()
- isParenthesizedExpression()
- isPattern()
- isProgram()
- isProperty()
- isPure()
- isPureish()
- isQualifiedTypeIdentifier()
- isReferenced()
- isReferencedIdentifier()
- isReferencedMemberExpression()
- isRegexLiteral()
- isRegExpLiteral()
- isRestElement()
- isRestProperty()
- isReturnStatement()
- isScopable()
- isScope()
- isSequenceExpression()
- isSpreadElement()
- isSpreadProperty()
- isStatement()
- isStatementOrBlock()
- isStatic()
- isStringLiteral()
- isStringLiteralTypeAnnotation()
- isStringTypeAnnotation()
- isSuper()
- isSwitchCase()
- isSwitchStatement()
- isTaggedTemplateExpression()
- isTemplateElement()
- isTemplateLiteral()
- isTerminatorless()
- isThisExpression()
- isThisTypeAnnotation()
- isThrowStatement()
- isTryStatement()
- isTupleTypeAnnotation()
- isTypeAlias()
- isTypeAnnotation()
- isTypeCastExpression()
- isTypeofTypeAnnotation()
- isTypeParameterDeclaration()
- isTypeParameterInstantiation()
- isUnaryExpression()
- isUnaryLike()
- isUnionTypeAnnotation()
- isUpdateExpression()
- isUser()
- isUserWhitespacable()
- isVar()
- isVariableDeclaration()
- isVariableDeclarator()
- isVoidTypeAnnotation()
- isWhile()
- isWhileStatement()
- isWithStatement()
- isYieldExpression()
- key
- listKey
- matchesPattern()
- node
- opts
- parent
- parentKey
- parentPath
- popContext()
- pushContext()
- referencesImport()
- remove()
- removed
- replaceExpressionWithStatements()
- replaceInline()
- replaceWith()
- replaceWithMultiple()
- replaceWithSourceString()
- scope
- set()
- setContext()
- setData()
- setScope()
- shareCommentsWithSiblings()
- shouldSkip
- shouldStop
- skip()
- skipKey()
- skipKeys
- state
- stop()
- traverse()
- type
- typeAnnotation
- updateSiblingKeys()
- visit()
- willIMaybeExecuteBefore()
Scope
- addGlobal()
- bindingIdentifierEquals()
- bindings
- block
- buildUndefinedNode()
- checkBlockScopedCollisions()
- dump()
- generateDeclaredUidIdentifier()
- generateUid()
- generateUidIdentifier()
- generateUidIdentifierBasedOnNode()
- getAllBindings()
- getBinding()
- getBindingIdentifier()
- getBlockParent()
- getData()
- getFunctionParent()
- getOwnBinding()
- getOwnBindingIdentifier()
- getProgramParent()
- hasBinding()
- hasGlobal()
- hasOwnBinding()
- hasReference()
- hasUid()
- hub
- isPure()
- isStatic()
- maybeGenerateMemoised()
- moveBindingTo()
- parent
- parentBlock
- parentHasBinding()
- path
- push()
- registerBinding()
- registerConstantViolation()
- registerDeclaration()
- removeBinding()
- removeData()
- removeOwnBinding()
- rename()
- setData()
- toArray()
- traverse()
Interfaces
Visitor
- AnyTypeAnnotation
- ArrayExpression
- ArrayPattern
- ArrayTypeAnnotation
- ArrowFunctionExpression
- AssignmentExpression
- AssignmentPattern
- AwaitExpression
- Binary
- BinaryExpression
- BindExpression
- Block
- BlockParent
- BlockStatement
- BooleanLiteral
- BooleanLiteralTypeAnnotation
- BooleanTypeAnnotation
- BreakStatement
- CallExpression
- CatchClause
- Class
- ClassBody
- ClassDeclaration
- ClassExpression
- ClassImplements
- ClassMethod
- ClassProperty
- CompletionStatement
- Conditional
- ConditionalExpression
- ContinueStatement
- DebuggerStatement
- Declaration
- DeclareClass
- DeclareFunction
- DeclareInterface
- DeclareModule
- DeclareTypeAlias
- DeclareVariable
- Decorator
- Directive
- DirectiveLiteral
- DoExpression
- DoWhileStatement
- EmptyStatement
- ExistentialTypeParam
- ExportAllDeclaration
- ExportDeclaration
- ExportDefaultDeclaration
- ExportDefaultSpecifier
- ExportNamedDeclaration
- ExportNamespaceSpecifier
- ExportSpecifier
- Expression
- ExpressionStatement
- ExpressionWrapper
- File
- Flow
- FlowBaseAnnotation
- FlowDeclaration
- For
- ForInStatement
- ForOfStatement
- ForStatement
- ForXStatement
- Function
- FunctionDeclaration
- FunctionExpression
- FunctionParent
- FunctionTypeAnnotation
- FunctionTypeParam
- GenericTypeAnnotation
- Identifier
- IfStatement
- Immutable
- ImportDeclaration
- ImportDefaultSpecifier
- ImportNamespaceSpecifier
- ImportSpecifier
- InterfaceDeclaration
- InterfaceExtends
- IntersectionTypeAnnotation
- JSX
- JSXAttribute
- JSXClosingElement
- JSXElement
- JSXEmptyExpression
- JSXExpressionContainer
- JSXIdentifier
- JSXMemberExpression
- JSXNamespacedName
- JSXOpeningElement
- JSXSpreadAttribute
- JSXText
- LabeledStatement
- Literal
- LogicalExpression
- Loop
- LVal
- MemberExpression
- MetaProperty
- Method
- MixedTypeAnnotation
- ModuleDeclaration
- ModuleSpecifier
- NewExpression
- Noop
- NullableTypeAnnotation
- NullLiteral
- NullLiteralTypeAnnotation
- NumberTypeAnnotation
- NumericLiteral
- NumericLiteralTypeAnnotation
- ObjectExpression
- ObjectMember
- ObjectMethod
- ObjectPattern
- ObjectProperty
- ObjectTypeAnnotation
- ObjectTypeCallProperty
- ObjectTypeIndexer
- ObjectTypeProperty
- ParenthesizedExpression
- Pattern
- Program
- Property
- Pureish
- QualifiedTypeIdentifier
- RegExpLiteral
- RestElement
- RestProperty
- ReturnStatement
- Scopable
- Scope
- SequenceExpression
- SpreadElement
- SpreadProperty
- Statement
- StringLiteral
- StringLiteralTypeAnnotation
- StringTypeAnnotation
- Super
- SwitchCase
- SwitchStatement
- TaggedTemplateExpression
- TemplateElement
- TemplateLiteral
- Terminatorless
- ThisExpression
- ThisTypeAnnotation
- ThrowStatement
- TryStatement
- TupleTypeAnnotation
- TypeAlias
- TypeAnnotation
- TypeCastExpression
- TypeofTypeAnnotation
- TypeParameterDeclaration
- TypeParameterInstantiation
- UnaryExpression
- UnaryLike
- UnionTypeAnnotation
- UpdateExpression
- UserWhitespacable
- VariableDeclaration
- VariableDeclarator
- VoidTypeAnnotation
- While
- WhileStatement
- WithStatement
- YieldExpression
Type Aliases
Functions
function traverse
traverse: { <S>( parent: Node | Node[], opts: TraverseOptions<S>, scope: Scope, state: S, parentPath?: NodePath ): void; ( parent: any, opts: TraverseOptions<t.Node>, scope?: Scope, state?: any, parentPath?: NodePath<t.Node> ): void;};
Classes
class Binding
class Binding {}
constructor
constructor(opts: { existing: Binding; identifier: t.Identifier; scope: Scope; path: NodePath; kind: 'var' | 'let' | 'const';});
property constant
constant: boolean;
property constantViolations
constantViolations: NodePath<t.Node>[];
property identifier
identifier: t.Identifier;
property kind
kind: 'var' | 'let' | 'const' | 'module';
property path
path: NodePath<t.Node>;
property referenced
referenced: boolean;
property referencePaths
referencePaths: NodePath<t.Node>[];
property references
references: number;
property scope
scope: Scope;
class Hub
class Hub {}
constructor
constructor(file: any, options: any);
property file
file: any;
property options
options: any;
class NodePath
class NodePath<T = Node> {}
constructor
constructor(hub: Hub, parent: t.Node);
property container
container: object | object[];
property context
context: TraversalContext;
property contexts
contexts: TraversalContext[];
property data
data: {};
property hub
hub: Hub;
property inList
inList: boolean;
property key
key: string | number;
property listKey
listKey: string;
property node
node: {};
property opts
opts: {};
property parent
parent: t.Node;
property parentKey
parentKey: string;
property parentPath
parentPath: NodePath<t.Node>;
property removed
removed: boolean;
property scope
scope: Scope;
property shouldSkip
shouldSkip: boolean;
property shouldStop
shouldStop: boolean;
property skipKeys
skipKeys: {};
property state
state: any;
property type
type: string;
property typeAnnotation
typeAnnotation: {};
method addComment
addComment: (type: string, content: string, line?: boolean) => void;
method addComments
addComments: (type: string, comments: any[]) => void;
Give node
comments
of the specifiedtype
.
method assertAnyTypeAnnotation
assertAnyTypeAnnotation: (opts?: object) => void;
method assertArrayExpression
assertArrayExpression: (opts?: object) => void;
method assertArrayPattern
assertArrayPattern: (opts?: object) => void;
method assertArrayTypeAnnotation
assertArrayTypeAnnotation: (opts?: object) => void;
method assertArrowFunctionExpression
assertArrowFunctionExpression: (opts?: object) => void;
method assertAssignmentExpression
assertAssignmentExpression: (opts?: object) => void;
method assertAssignmentPattern
assertAssignmentPattern: (opts?: object) => void;
method assertAwaitExpression
assertAwaitExpression: (opts?: object) => void;
method assertBinary
assertBinary: (opts?: object) => void;
method assertBinaryExpression
assertBinaryExpression: (opts?: object) => void;
method assertBindExpression
assertBindExpression: (opts?: object) => void;
method assertBlock
assertBlock: (opts?: object) => void;
method assertBlockParent
assertBlockParent: (opts?: object) => void;
method assertBlockStatement
assertBlockStatement: (opts?: object) => void;
method assertBooleanLiteral
assertBooleanLiteral: (opts?: object) => void;
method assertBooleanLiteralTypeAnnotation
assertBooleanLiteralTypeAnnotation: (opts?: object) => void;
method assertBooleanTypeAnnotation
assertBooleanTypeAnnotation: (opts?: object) => void;
method assertBreakStatement
assertBreakStatement: (opts?: object) => void;
method assertCallExpression
assertCallExpression: (opts?: object) => void;
method assertCatchClause
assertCatchClause: (opts?: object) => void;
method assertClass
assertClass: (opts?: object) => void;
method assertClassBody
assertClassBody: (opts?: object) => void;
method assertClassDeclaration
assertClassDeclaration: (opts?: object) => void;
method assertClassExpression
assertClassExpression: (opts?: object) => void;
method assertClassImplements
assertClassImplements: (opts?: object) => void;
method assertClassMethod
assertClassMethod: (opts?: object) => void;
method assertClassProperty
assertClassProperty: (opts?: object) => void;
method assertCompletionStatement
assertCompletionStatement: (opts?: object) => void;
method assertConditional
assertConditional: (opts?: object) => void;
method assertConditionalExpression
assertConditionalExpression: (opts?: object) => void;
method assertContinueStatement
assertContinueStatement: (opts?: object) => void;
method assertDebuggerStatement
assertDebuggerStatement: (opts?: object) => void;
method assertDeclaration
assertDeclaration: (opts?: object) => void;
method assertDeclareClass
assertDeclareClass: (opts?: object) => void;
method assertDeclareFunction
assertDeclareFunction: (opts?: object) => void;
method assertDeclareInterface
assertDeclareInterface: (opts?: object) => void;
method assertDeclareModule
assertDeclareModule: (opts?: object) => void;
method assertDeclareTypeAlias
assertDeclareTypeAlias: (opts?: object) => void;
method assertDeclareVariable
assertDeclareVariable: (opts?: object) => void;
method assertDecorator
assertDecorator: (opts?: object) => void;
method assertDirective
assertDirective: (opts?: object) => void;
method assertDirectiveLiteral
assertDirectiveLiteral: (opts?: object) => void;
method assertDoExpression
assertDoExpression: (opts?: object) => void;
method assertDoWhileStatement
assertDoWhileStatement: (opts?: object) => void;
method assertEmptyStatement
assertEmptyStatement: (opts?: object) => void;
method assertExistentialTypeParam
assertExistentialTypeParam: (opts?: object) => void;
method assertExportAllDeclaration
assertExportAllDeclaration: (opts?: object) => void;
method assertExportDeclaration
assertExportDeclaration: (opts?: object) => void;
method assertExportDefaultDeclaration
assertExportDefaultDeclaration: (opts?: object) => void;
method assertExportDefaultSpecifier
assertExportDefaultSpecifier: (opts?: object) => void;
method assertExportNamedDeclaration
assertExportNamedDeclaration: (opts?: object) => void;
method assertExportNamespaceSpecifier
assertExportNamespaceSpecifier: (opts?: object) => void;
method assertExportSpecifier
assertExportSpecifier: (opts?: object) => void;
method assertExpression
assertExpression: (opts?: object) => void;
method assertExpressionStatement
assertExpressionStatement: (opts?: object) => void;
method assertExpressionWrapper
assertExpressionWrapper: (opts?: object) => void;
method assertFile
assertFile: (opts?: object) => void;
method assertFlow
assertFlow: (opts?: object) => void;
method assertFlowBaseAnnotation
assertFlowBaseAnnotation: (opts?: object) => void;
method assertFlowDeclaration
assertFlowDeclaration: (opts?: object) => void;
method assertFor
assertFor: (opts?: object) => void;
method assertForInStatement
assertForInStatement: (opts?: object) => void;
method assertForOfStatement
assertForOfStatement: (opts?: object) => void;
method assertForStatement
assertForStatement: (opts?: object) => void;
method assertForXStatement
assertForXStatement: (opts?: object) => void;
method assertFunction
assertFunction: (opts?: object) => void;
method assertFunctionDeclaration
assertFunctionDeclaration: (opts?: object) => void;
method assertFunctionExpression
assertFunctionExpression: (opts?: object) => void;
method assertFunctionParent
assertFunctionParent: (opts?: object) => void;
method assertFunctionTypeAnnotation
assertFunctionTypeAnnotation: (opts?: object) => void;
method assertFunctionTypeParam
assertFunctionTypeParam: (opts?: object) => void;
method assertGenericTypeAnnotation
assertGenericTypeAnnotation: (opts?: object) => void;
method assertIdentifier
assertIdentifier: (opts?: object) => void;
method assertIfStatement
assertIfStatement: (opts?: object) => void;
method assertImmutable
assertImmutable: (opts?: object) => void;
method assertImportDeclaration
assertImportDeclaration: (opts?: object) => void;
method assertImportDefaultSpecifier
assertImportDefaultSpecifier: (opts?: object) => void;
method assertImportNamespaceSpecifier
assertImportNamespaceSpecifier: (opts?: object) => void;
method assertImportSpecifier
assertImportSpecifier: (opts?: object) => void;
method assertInterfaceDeclaration
assertInterfaceDeclaration: (opts?: object) => void;
method assertInterfaceExtends
assertInterfaceExtends: (opts?: object) => void;
method assertIntersectionTypeAnnotation
assertIntersectionTypeAnnotation: (opts?: object) => void;
method assertJSX
assertJSX: (opts?: object) => void;
method assertJSXAttribute
assertJSXAttribute: (opts?: object) => void;
method assertJSXClosingElement
assertJSXClosingElement: (opts?: object) => void;
method assertJSXElement
assertJSXElement: (opts?: object) => void;
method assertJSXEmptyExpression
assertJSXEmptyExpression: (opts?: object) => void;
method assertJSXExpressionContainer
assertJSXExpressionContainer: (opts?: object) => void;
method assertJSXIdentifier
assertJSXIdentifier: (opts?: object) => void;
method assertJSXMemberExpression
assertJSXMemberExpression: (opts?: object) => void;
method assertJSXNamespacedName
assertJSXNamespacedName: (opts?: object) => void;
method assertJSXOpeningElement
assertJSXOpeningElement: (opts?: object) => void;
method assertJSXSpreadAttribute
assertJSXSpreadAttribute: (opts?: object) => void;
method assertJSXText
assertJSXText: (opts?: object) => void;
method assertLabeledStatement
assertLabeledStatement: (opts?: object) => void;
method assertLiteral
assertLiteral: (opts?: object) => void;
method assertLogicalExpression
assertLogicalExpression: (opts?: object) => void;
method assertLoop
assertLoop: (opts?: object) => void;
method assertLVal
assertLVal: (opts?: object) => void;
method assertMemberExpression
assertMemberExpression: (opts?: object) => void;
method assertMetaProperty
assertMetaProperty: (opts?: object) => void;
method assertMethod
assertMethod: (opts?: object) => void;
method assertMixedTypeAnnotation
assertMixedTypeAnnotation: (opts?: object) => void;
method assertModuleDeclaration
assertModuleDeclaration: (opts?: object) => void;
method assertModuleSpecifier
assertModuleSpecifier: (opts?: object) => void;
method assertNewExpression
assertNewExpression: (opts?: object) => void;
method assertNoop
assertNoop: (opts?: object) => void;
method assertNullableTypeAnnotation
assertNullableTypeAnnotation: (opts?: object) => void;
method assertNullLiteral
assertNullLiteral: (opts?: object) => void;
method assertNullLiteralTypeAnnotation
assertNullLiteralTypeAnnotation: (opts?: object) => void;
method assertNumberLiteral
assertNumberLiteral: (opts?: object) => void;
method assertNumberTypeAnnotation
assertNumberTypeAnnotation: (opts?: object) => void;
method assertNumericLiteral
assertNumericLiteral: (opts?: object) => void;
method assertNumericLiteralTypeAnnotation
assertNumericLiteralTypeAnnotation: (opts?: object) => void;
method assertObjectExpression
assertObjectExpression: (opts?: object) => void;
method assertObjectMember
assertObjectMember: (opts?: object) => void;
method assertObjectMethod
assertObjectMethod: (opts?: object) => void;
method assertObjectPattern
assertObjectPattern: (opts?: object) => void;
method assertObjectProperty
assertObjectProperty: (opts?: object) => void;
method assertObjectTypeAnnotation
assertObjectTypeAnnotation: (opts?: object) => void;
method assertObjectTypeCallProperty
assertObjectTypeCallProperty: (opts?: object) => void;
method assertObjectTypeIndexer
assertObjectTypeIndexer: (opts?: object) => void;
method assertObjectTypeProperty
assertObjectTypeProperty: (opts?: object) => void;
method assertParenthesizedExpression
assertParenthesizedExpression: (opts?: object) => void;
method assertPattern
assertPattern: (opts?: object) => void;
method assertProgram
assertProgram: (opts?: object) => void;
method assertProperty
assertProperty: (opts?: object) => void;
method assertPureish
assertPureish: (opts?: object) => void;
method assertQualifiedTypeIdentifier
assertQualifiedTypeIdentifier: (opts?: object) => void;
method assertRegexLiteral
assertRegexLiteral: (opts?: object) => void;
method assertRegExpLiteral
assertRegExpLiteral: (opts?: object) => void;
method assertRestElement
assertRestElement: (opts?: object) => void;
method assertRestProperty
assertRestProperty: (opts?: object) => void;
method assertReturnStatement
assertReturnStatement: (opts?: object) => void;
method assertScopable
assertScopable: (opts?: object) => void;
method assertSequenceExpression
assertSequenceExpression: (opts?: object) => void;
method assertSpreadElement
assertSpreadElement: (opts?: object) => void;
method assertSpreadProperty
assertSpreadProperty: (opts?: object) => void;
method assertStatement
assertStatement: (opts?: object) => void;
method assertStringLiteral
assertStringLiteral: (opts?: object) => void;
method assertStringLiteralTypeAnnotation
assertStringLiteralTypeAnnotation: (opts?: object) => void;
method assertStringTypeAnnotation
assertStringTypeAnnotation: (opts?: object) => void;
method assertSuper
assertSuper: (opts?: object) => void;
method assertSwitchCase
assertSwitchCase: (opts?: object) => void;
method assertSwitchStatement
assertSwitchStatement: (opts?: object) => void;
method assertTaggedTemplateExpression
assertTaggedTemplateExpression: (opts?: object) => void;
method assertTemplateElement
assertTemplateElement: (opts?: object) => void;
method assertTemplateLiteral
assertTemplateLiteral: (opts?: object) => void;
method assertTerminatorless
assertTerminatorless: (opts?: object) => void;
method assertThisExpression
assertThisExpression: (opts?: object) => void;
method assertThisTypeAnnotation
assertThisTypeAnnotation: (opts?: object) => void;
method assertThrowStatement
assertThrowStatement: (opts?: object) => void;
method assertTryStatement
assertTryStatement: (opts?: object) => void;
method assertTupleTypeAnnotation
assertTupleTypeAnnotation: (opts?: object) => void;
method assertTypeAlias
assertTypeAlias: (opts?: object) => void;
method assertTypeAnnotation
assertTypeAnnotation: (opts?: object) => void;
method assertTypeCastExpression
assertTypeCastExpression: (opts?: object) => void;
method assertTypeofTypeAnnotation
assertTypeofTypeAnnotation: (opts?: object) => void;
method assertTypeParameterDeclaration
assertTypeParameterDeclaration: (opts?: object) => void;
method assertTypeParameterInstantiation
assertTypeParameterInstantiation: (opts?: object) => void;
method assertUnaryExpression
assertUnaryExpression: (opts?: object) => void;
method assertUnaryLike
assertUnaryLike: (opts?: object) => void;
method assertUnionTypeAnnotation
assertUnionTypeAnnotation: (opts?: object) => void;
method assertUpdateExpression
assertUpdateExpression: (opts?: object) => void;
method assertUserWhitespacable
assertUserWhitespacable: (opts?: object) => void;
method assertVariableDeclaration
assertVariableDeclaration: (opts?: object) => void;
method assertVariableDeclarator
assertVariableDeclarator: (opts?: object) => void;
method assertVoidTypeAnnotation
assertVoidTypeAnnotation: (opts?: object) => void;
method assertWhile
assertWhile: (opts?: object) => void;
method assertWhileStatement
assertWhileStatement: (opts?: object) => void;
method assertWithStatement
assertWithStatement: (opts?: object) => void;
method assertYieldExpression
assertYieldExpression: (opts?: object) => void;
method baseTypeStrictlyMatches
baseTypeStrictlyMatches: (right: NodePath) => boolean;
method buildCodeFrameError
buildCodeFrameError: <TError extends Error>( msg: string, Error?: new (msg: string) => TError) => TError;
method call
call: (key: string) => boolean;
method canHaveVariableDeclarationOrExpression
canHaveVariableDeclarationOrExpression: () => 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.
method canSwapBetweenExpressionAndStatement
canSwapBetweenExpressionAndStatement: (replacement: t.Node) => 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.
method couldBeBaseType
couldBeBaseType: (name: string) => boolean;
method debug
debug: (buildMessage: () => string) => void;
method equals
equals: (key: string, value: any) => boolean;
Check whether the path node
key
strict equalsvalue
.
method evaluate
evaluate: () => { confident: boolean; value: any };
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 }
method evaluateTruthy
evaluateTruthy: () => boolean;
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 andundefined
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.
method find
find: (callback: (path: NodePath) => boolean) => NodePath;
method findParent
findParent: (callback: (path: NodePath) => boolean) => NodePath;
Call the provided
callback
with theNodePath
s of all the parents. When thecallback
returns a truthy value, we return that node path.
method get
get: { <K extends keyof T>( key: K, context?: boolean | TraversalContext ): T[K] extends Array<Node | null | undefined> ? Array<NodePath<T[K][number]>> : T[K] extends Node | null | undefined ? NodePath<T[K]> : never; (key: string, context?: boolean | TraversalContext): | NodePath<t.Node> | NodePath<t.Node>[];};
method getAllNextSiblings
getAllNextSiblings: () => NodePath[];
method getAllPrevSiblings
getAllPrevSiblings: () => NodePath[];
method getAncestry
getAncestry: () => 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.
method getBindingIdentifiers
getBindingIdentifiers: (duplicates?: boolean) => Node[];
method getCompletionRecords
getCompletionRecords: () => NodePath[];
method getData
getData: (key: string, def?: any) => any;
method getDeepestCommonAncestorFrom
getDeepestCommonAncestorFrom: ( paths: NodePath[], filter?: (deepest: t.Node, i: number, ancestries: NodePath[]) => NodePath) => NodePath;
Get the earliest path in the tree where the provided
paths
intersect.
method getEarliestCommonAncestorFrom
getEarliestCommonAncestorFrom: (paths: NodePath[]) => 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.
method getFunctionParent
getFunctionParent: () => NodePath<t.Function>;
Get the parent function of the current path.
method getNextSibling
getNextSibling: () => NodePath;
method getOpposite
getOpposite: () => NodePath;
method getOuterBindingIdentifiers
getOuterBindingIdentifiers: (duplicates?: boolean) => Node[];
method getPathLocation
getPathLocation: () => string;
method getPrevSibling
getPrevSibling: () => NodePath;
method getScope
getScope: (scope: Scope) => Scope;
method getSibling
getSibling: (key: string | number) => NodePath;
method getSource
getSource: () => string;
Get the source code associated with this node.
method getStatementParent
getStatementParent: () => NodePath<t.Statement>;
Walk up the tree until we hit a parent node path in a list.
method getTypeAnnotation
getTypeAnnotation: () => t.FlowTypeAnnotation;
Infer the type of the current
NodePath
.
method has
has: (key: string) => boolean;
Check whether we have the input
key
. If thekey
references an array then we check if the array has any items, otherwise we just check if it's falsy.
method hoist
hoist: (scope: Scope) => void;
Hoist the current node to the highest scope possible and return a UID referencing it.
method insertAfter
insertAfter: (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.
method insertBefore
insertBefore: (nodes: Node | Node[]) => any;
Insert the provided nodes before the current one.
method inType
inType: (...candidateTypes: string[]) => boolean;
method is
is: (key: string) => boolean;
Alias of
has
.
method isAnyTypeAnnotation
isAnyTypeAnnotation: (opts?: object) => this is NodePath<t.AnyTypeAnnotation>;
method isArrayExpression
isArrayExpression: (opts?: object) => this is NodePath<t.ArrayExpression>;
method isArrayPattern
isArrayPattern: (opts?: object) => this is NodePath<t.ArrayPattern>;
method isArrayTypeAnnotation
isArrayTypeAnnotation: ( opts?: object) => this is NodePath<t.ArrayTypeAnnotation>;
method isArrowFunctionExpression
isArrowFunctionExpression: ( opts?: object) => this is NodePath<t.ArrowFunctionExpression>;
method isAssignmentExpression
isAssignmentExpression: ( opts?: object) => this is NodePath<t.AssignmentExpression>;
method isAssignmentPattern
isAssignmentPattern: (opts?: object) => this is NodePath<t.AssignmentPattern>;
method isAwaitExpression
isAwaitExpression: (opts?: object) => this is NodePath<t.AwaitExpression>;
method isBaseType
isBaseType: (baseName: string, soft?: boolean) => boolean;
method isBinary
isBinary: (opts?: object) => this is NodePath<t.Binary>;
method isBinaryExpression
isBinaryExpression: (opts?: object) => this is NodePath<t.BinaryExpression>;
method isBindExpression
isBindExpression: (opts?: object) => this is NodePath<t.BindExpression>;
method isBindingIdentifier
isBindingIdentifier: (opts?: object) => this is NodePath<t.Identifier>;
method isBlacklisted
isBlacklisted: () => boolean;
method isBlock
isBlock: (opts?: object) => this is NodePath<t.Block>;
method isBlockParent
isBlockParent: (opts?: object) => this is NodePath<t.BlockParent>;
method isBlockScoped
isBlockScoped: (opts?: object) => this is NodePath<any>;
method isBlockStatement
isBlockStatement: (opts?: object) => this is NodePath<t.BlockStatement>;
method isBooleanLiteral
isBooleanLiteral: (opts?: object) => this is NodePath<t.BooleanLiteral>;
method isBooleanLiteralTypeAnnotation
isBooleanLiteralTypeAnnotation: ( opts?: object) => this is NodePath<t.BooleanLiteralTypeAnnotation>;
method isBooleanTypeAnnotation
isBooleanTypeAnnotation: ( opts?: object) => this is NodePath<t.BooleanTypeAnnotation>;
method isBreakStatement
isBreakStatement: (opts?: object) => this is NodePath<t.BreakStatement>;
method isCallExpression
isCallExpression: (opts?: object) => this is NodePath<t.CallExpression>;
method isCatchClause
isCatchClause: (opts?: object) => this is NodePath<t.CatchClause>;
method isClass
isClass: (opts?: object) => this is NodePath<t.Class>;
method isClassBody
isClassBody: (opts?: object) => this is NodePath<t.ClassBody>;
method isClassDeclaration
isClassDeclaration: (opts?: object) => this is NodePath<t.ClassDeclaration>;
method isClassExpression
isClassExpression: (opts?: object) => this is NodePath<t.ClassExpression>;
method isClassImplements
isClassImplements: (opts?: object) => this is NodePath<t.ClassImplements>;
method isClassMethod
isClassMethod: (opts?: object) => this is NodePath<t.ClassMethod>;
method isClassProperty
isClassProperty: (opts?: object) => this is NodePath<t.ClassProperty>;
method isCompletionRecord
isCompletionRecord: (allowInsideFunction?: boolean) => boolean;
Check whether the current path references a completion record
method isCompletionStatement
isCompletionStatement: ( opts?: object) => this is NodePath<t.CompletionStatement>;
method isConditional
isConditional: (opts?: object) => this is NodePath<t.Conditional>;
method isConditionalExpression
isConditionalExpression: ( opts?: object) => this is NodePath<t.ConditionalExpression>;
method isContinueStatement
isContinueStatement: (opts?: object) => this is NodePath<t.ContinueStatement>;
method isDebuggerStatement
isDebuggerStatement: (opts?: object) => this is NodePath<t.DebuggerStatement>;
method isDeclaration
isDeclaration: (opts?: object) => this is NodePath<t.Declaration>;
method isDeclareClass
isDeclareClass: (opts?: object) => this is NodePath<t.DeclareClass>;
method isDeclareFunction
isDeclareFunction: (opts?: object) => this is NodePath<t.DeclareFunction>;
method isDeclareInterface
isDeclareInterface: (opts?: object) => this is NodePath<t.DeclareInterface>;
method isDeclareModule
isDeclareModule: (opts?: object) => this is NodePath<t.DeclareModule>;
method isDeclareTypeAlias
isDeclareTypeAlias: (opts?: object) => this is NodePath<t.DeclareTypeAlias>;
method isDeclareVariable
isDeclareVariable: (opts?: object) => this is NodePath<t.DeclareVariable>;
method isDecorator
isDecorator: (opts?: object) => this is NodePath<t.Decorator>;
method isDirective
isDirective: (opts?: object) => this is NodePath<t.Directive>;
method isDirectiveLiteral
isDirectiveLiteral: (opts?: object) => this is NodePath<t.DirectiveLiteral>;
method isDoExpression
isDoExpression: (opts?: object) => this is NodePath<t.DoExpression>;
method isDoWhileStatement
isDoWhileStatement: (opts?: object) => this is NodePath<t.DoWhileStatement>;
method isEmptyStatement
isEmptyStatement: (opts?: object) => this is NodePath<t.EmptyStatement>;
method isExistentialTypeParam
isExistentialTypeParam: ( opts?: object) => this is NodePath<t.ExistentialTypeParam>;
method isExportAllDeclaration
isExportAllDeclaration: ( opts?: object) => this is NodePath<t.ExportAllDeclaration>;
method isExportDeclaration
isExportDeclaration: (opts?: object) => this is NodePath<t.ExportDeclaration>;
method isExportDefaultDeclaration
isExportDefaultDeclaration: ( opts?: object) => this is NodePath<t.ExportDefaultDeclaration>;
method isExportDefaultSpecifier
isExportDefaultSpecifier: ( opts?: object) => this is NodePath<t.ExportDefaultSpecifier>;
method isExportNamedDeclaration
isExportNamedDeclaration: ( opts?: object) => this is NodePath<t.ExportNamedDeclaration>;
method isExportNamespaceSpecifier
isExportNamespaceSpecifier: ( opts?: object) => this is NodePath<t.ExportNamespaceSpecifier>;
method isExportSpecifier
isExportSpecifier: (opts?: object) => this is NodePath<t.ExportSpecifier>;
method isExpression
isExpression: (opts?: object) => this is NodePath<t.Expression>;
method isExpressionStatement
isExpressionStatement: ( opts?: object) => this is NodePath<t.ExpressionStatement>;
method isExpressionWrapper
isExpressionWrapper: (opts?: object) => this is NodePath<t.ExpressionWrapper>;
method isFile
isFile: (opts?: object) => this is NodePath<t.File>;
method isFlow
isFlow: (opts?: object) => this is NodePath<t.Flow>;
method isFlowBaseAnnotation
isFlowBaseAnnotation: (opts?: object) => this is NodePath<t.FlowBaseAnnotation>;
method isFlowDeclaration
isFlowDeclaration: (opts?: object) => this is NodePath<t.FlowDeclaration>;
method isFor
isFor: (opts?: object) => this is NodePath<t.For>;
method isForInStatement
isForInStatement: (opts?: object) => this is NodePath<t.ForInStatement>;
method isForOfStatement
isForOfStatement: (opts?: object) => this is NodePath<t.ForOfStatement>;
method isForStatement
isForStatement: (opts?: object) => this is NodePath<t.ForStatement>;
method isForXStatement
isForXStatement: (opts?: object) => this is NodePath<t.ForXStatement>;
method isFunction
isFunction: (opts?: object) => this is NodePath<t.Function>;
method isFunctionDeclaration
isFunctionDeclaration: ( opts?: object) => this is NodePath<t.FunctionDeclaration>;
method isFunctionExpression
isFunctionExpression: (opts?: object) => this is NodePath<t.FunctionExpression>;
method isFunctionParent
isFunctionParent: (opts?: object) => this is NodePath<t.FunctionParent>;
method isFunctionTypeAnnotation
isFunctionTypeAnnotation: ( opts?: object) => this is NodePath<t.FunctionTypeAnnotation>;
method isFunctionTypeParam
isFunctionTypeParam: (opts?: object) => this is NodePath<t.FunctionTypeParam>;
method isGenerated
isGenerated: (opts?: object) => boolean;
method isGenericType
isGenericType: (genericName: string) => boolean;
method isGenericTypeAnnotation
isGenericTypeAnnotation: ( opts?: object) => this is NodePath<t.GenericTypeAnnotation>;
method isIdentifier
isIdentifier: (opts?: object) => this is NodePath<t.Identifier>;
method isIfStatement
isIfStatement: (opts?: object) => this is NodePath<t.IfStatement>;
method isImmutable
isImmutable: (opts?: object) => this is NodePath<t.Immutable>;
method isImportDeclaration
isImportDeclaration: (opts?: object) => this is NodePath<t.ImportDeclaration>;
method isImportDefaultSpecifier
isImportDefaultSpecifier: ( opts?: object) => this is NodePath<t.ImportDefaultSpecifier>;
method isImportNamespaceSpecifier
isImportNamespaceSpecifier: ( opts?: object) => this is NodePath<t.ImportNamespaceSpecifier>;
method isImportSpecifier
isImportSpecifier: (opts?: object) => this is NodePath<t.ImportSpecifier>;
method isInterfaceDeclaration
isInterfaceDeclaration: ( opts?: object) => this is NodePath<t.InterfaceDeclaration>;
method isInterfaceExtends
isInterfaceExtends: (opts?: object) => this is NodePath<t.InterfaceExtends>;
method isIntersectionTypeAnnotation
isIntersectionTypeAnnotation: ( opts?: object) => this is NodePath<t.IntersectionTypeAnnotation>;
method isJSX
isJSX: (opts?: object) => this is NodePath<t.JSX>;
method isJSXAttribute
isJSXAttribute: (opts?: object) => this is NodePath<t.JSXAttribute>;
method isJSXClosingElement
isJSXClosingElement: (opts?: object) => this is NodePath<t.JSXClosingElement>;
method isJSXElement
isJSXElement: (opts?: object) => this is NodePath<t.JSXElement>;
method isJSXEmptyExpression
isJSXEmptyExpression: (opts?: object) => this is NodePath<t.JSXEmptyExpression>;
method isJSXExpressionContainer
isJSXExpressionContainer: ( opts?: object) => this is NodePath<t.JSXExpressionContainer>;
method isJSXIdentifier
isJSXIdentifier: (opts?: object) => this is NodePath<t.JSXIdentifier>;
method isJSXMemberExpression
isJSXMemberExpression: ( opts?: object) => this is NodePath<t.JSXMemberExpression>;
method isJSXNamespacedName
isJSXNamespacedName: (opts?: object) => this is NodePath<t.JSXNamespacedName>;
method isJSXOpeningElement
isJSXOpeningElement: (opts?: object) => this is NodePath<t.JSXOpeningElement>;
method isJSXSpreadAttribute
isJSXSpreadAttribute: (opts?: object) => this is NodePath<t.JSXSpreadAttribute>;
method isJSXText
isJSXText: (opts?: object) => this is NodePath<t.JSXText>;
method isLabeledStatement
isLabeledStatement: (opts?: object) => this is NodePath<t.LabeledStatement>;
method isLiteral
isLiteral: (opts?: object) => this is NodePath<t.Literal>;
method isLogicalExpression
isLogicalExpression: (opts?: object) => this is NodePath<t.LogicalExpression>;
method isLoop
isLoop: (opts?: object) => this is NodePath<t.Loop>;
method isLVal
isLVal: (opts?: object) => this is NodePath<t.LVal>;
method isMemberExpression
isMemberExpression: (opts?: object) => this is NodePath<t.MemberExpression>;
method isMetaProperty
isMetaProperty: (opts?: object) => this is NodePath<t.MetaProperty>;
method isMethod
isMethod: (opts?: object) => this is NodePath<t.Method>;
method isMixedTypeAnnotation
isMixedTypeAnnotation: ( opts?: object) => this is NodePath<t.MixedTypeAnnotation>;
method isModuleDeclaration
isModuleDeclaration: (opts?: object) => this is NodePath<t.ModuleDeclaration>;
method isModuleSpecifier
isModuleSpecifier: (opts?: object) => this is NodePath<t.ModuleSpecifier>;
method isNewExpression
isNewExpression: (opts?: object) => this is NodePath<t.NewExpression>;
method isNodeType
isNodeType: (type: string) => 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.
method isNoop
isNoop: (opts?: object) => this is NodePath<t.Noop>;
method isnt
isnt: (key: string) => boolean;
Opposite of
has
.
method isNullableTypeAnnotation
isNullableTypeAnnotation: ( opts?: object) => this is NodePath<t.NullableTypeAnnotation>;
method isNullLiteral
isNullLiteral: (opts?: object) => this is NodePath<t.NullLiteral>;
method isNullLiteralTypeAnnotation
isNullLiteralTypeAnnotation: ( opts?: object) => this is NodePath<t.NullLiteralTypeAnnotation>;
method isNumberLiteral
isNumberLiteral: (opts?: object) => this is NodePath<t.NumericLiteral>;
method isNumberTypeAnnotation
isNumberTypeAnnotation: ( opts?: object) => this is NodePath<t.NumberTypeAnnotation>;
method isNumericLiteral
isNumericLiteral: (opts?: object) => this is NodePath<t.NumericLiteral>;
method isNumericLiteralTypeAnnotation
isNumericLiteralTypeAnnotation: ( opts?: object) => this is NodePath<t.NumericLiteralTypeAnnotation>;
method isObjectExpression
isObjectExpression: (opts?: object) => this is NodePath<t.ObjectExpression>;
method isObjectMember
isObjectMember: (opts?: object) => this is NodePath<t.ObjectMember>;
method isObjectMethod
isObjectMethod: (opts?: object) => this is NodePath<t.ObjectMethod>;
method isObjectPattern
isObjectPattern: (opts?: object) => this is NodePath<t.ObjectPattern>;
method isObjectProperty
isObjectProperty: (opts?: object) => this is NodePath<t.ObjectProperty>;
method isObjectTypeAnnotation
isObjectTypeAnnotation: ( opts?: object) => this is NodePath<t.ObjectTypeAnnotation>;
method isObjectTypeCallProperty
isObjectTypeCallProperty: ( opts?: object) => this is NodePath<t.ObjectTypeCallProperty>;
method isObjectTypeIndexer
isObjectTypeIndexer: (opts?: object) => this is NodePath<t.ObjectTypeIndexer>;
method isObjectTypeProperty
isObjectTypeProperty: (opts?: object) => this is NodePath<t.ObjectTypeProperty>;
method isParenthesizedExpression
isParenthesizedExpression: ( opts?: object) => this is NodePath<t.ParenthesizedExpression>;
method isPattern
isPattern: (opts?: object) => this is NodePath<t.Pattern>;
method isProgram
isProgram: (opts?: object) => this is NodePath<t.Program>;
method isProperty
isProperty: (opts?: object) => this is NodePath<t.Property>;
method isPure
isPure: (opts?: object) => boolean;
method isPureish
isPureish: (opts?: object) => this is NodePath<t.Pureish>;
method isQualifiedTypeIdentifier
isQualifiedTypeIdentifier: ( opts?: object) => this is NodePath<t.QualifiedTypeIdentifier>;
method isReferenced
isReferenced: (opts?: object) => boolean;
method isReferencedIdentifier
isReferencedIdentifier: (opts?: object) => this is NodePath<any>;
method isReferencedMemberExpression
isReferencedMemberExpression: ( opts?: object) => this is NodePath<t.MemberExpression>;
method isRegexLiteral
isRegexLiteral: (opts?: object) => this is NodePath<t.RegExpLiteral>;
method isRegExpLiteral
isRegExpLiteral: (opts?: object) => this is NodePath<t.RegExpLiteral>;
method isRestElement
isRestElement: (opts?: object) => this is NodePath<t.RestElement>;
method isRestProperty
isRestProperty: (opts?: object) => this is NodePath<t.RestProperty>;
method isReturnStatement
isReturnStatement: (opts?: object) => this is NodePath<t.ReturnStatement>;
method isScopable
isScopable: (opts?: object) => this is NodePath<t.Scopable>;
method isScope
isScope: (opts?: object) => this is NodePath<t.Scopable>;
method isSequenceExpression
isSequenceExpression: (opts?: object) => this is NodePath<t.SequenceExpression>;
method isSpreadElement
isSpreadElement: (opts?: object) => this is NodePath<t.SpreadElement>;
method isSpreadProperty
isSpreadProperty: (opts?: object) => this is NodePath<t.SpreadProperty>;
method isStatement
isStatement: (opts?: object) => this is NodePath<t.Statement>;
method isStatementOrBlock
isStatementOrBlock: () => boolean;
Check whether or not the current
key
allows either a single statement or block statement so we can explode it if necessary.
method isStatic
isStatic: () => boolean;
method isStringLiteral
isStringLiteral: (opts?: object) => this is NodePath<t.StringLiteral>;
method isStringLiteralTypeAnnotation
isStringLiteralTypeAnnotation: ( opts?: object) => this is NodePath<t.StringLiteralTypeAnnotation>;
method isStringTypeAnnotation
isStringTypeAnnotation: ( opts?: object) => this is NodePath<t.StringTypeAnnotation>;
method isSuper
isSuper: (opts?: object) => this is NodePath<t.Super>;
method isSwitchCase
isSwitchCase: (opts?: object) => this is NodePath<t.SwitchCase>;
method isSwitchStatement
isSwitchStatement: (opts?: object) => this is NodePath<t.SwitchStatement>;
method isTaggedTemplateExpression
isTaggedTemplateExpression: ( opts?: object) => this is NodePath<t.TaggedTemplateExpression>;
method isTemplateElement
isTemplateElement: (opts?: object) => this is NodePath<t.TemplateElement>;
method isTemplateLiteral
isTemplateLiteral: (opts?: object) => this is NodePath<t.TemplateLiteral>;
method isTerminatorless
isTerminatorless: (opts?: object) => this is NodePath<t.Terminatorless>;
method isThisExpression
isThisExpression: (opts?: object) => this is NodePath<t.ThisExpression>;
method isThisTypeAnnotation
isThisTypeAnnotation: (opts?: object) => this is NodePath<t.ThisTypeAnnotation>;
method isThrowStatement
isThrowStatement: (opts?: object) => this is NodePath<t.ThrowStatement>;
method isTryStatement
isTryStatement: (opts?: object) => this is NodePath<t.TryStatement>;
method isTupleTypeAnnotation
isTupleTypeAnnotation: ( opts?: object) => this is NodePath<t.TupleTypeAnnotation>;
method isTypeAlias
isTypeAlias: (opts?: object) => this is NodePath<t.TypeAlias>;
method isTypeAnnotation
isTypeAnnotation: (opts?: object) => this is NodePath<t.TypeAnnotation>;
method isTypeCastExpression
isTypeCastExpression: (opts?: object) => this is NodePath<t.TypeCastExpression>;
method isTypeofTypeAnnotation
isTypeofTypeAnnotation: ( opts?: object) => this is NodePath<t.TypeofTypeAnnotation>;
method isTypeParameterDeclaration
isTypeParameterDeclaration: ( opts?: object) => this is NodePath<t.TypeParameterDeclaration>;
method isTypeParameterInstantiation
isTypeParameterInstantiation: ( opts?: object) => this is NodePath<t.TypeParameterInstantiation>;
method isUnaryExpression
isUnaryExpression: (opts?: object) => this is NodePath<t.UnaryExpression>;
method isUnaryLike
isUnaryLike: (opts?: object) => this is NodePath<t.UnaryLike>;
method isUnionTypeAnnotation
isUnionTypeAnnotation: ( opts?: object) => this is NodePath<t.UnionTypeAnnotation>;
method isUpdateExpression
isUpdateExpression: (opts?: object) => this is NodePath<t.UpdateExpression>;
method isUser
isUser: (opts?: object) => boolean;
method isUserWhitespacable
isUserWhitespacable: (opts?: object) => this is NodePath<t.UserWhitespacable>;
method isVar
isVar: (opts?: object) => this is NodePath<t.VariableDeclaration>;
method isVariableDeclaration
isVariableDeclaration: ( opts?: object) => this is NodePath<t.VariableDeclaration>;
method isVariableDeclarator
isVariableDeclarator: (opts?: object) => this is NodePath<t.VariableDeclarator>;
method isVoidTypeAnnotation
isVoidTypeAnnotation: (opts?: object) => this is NodePath<t.VoidTypeAnnotation>;
method isWhile
isWhile: (opts?: object) => this is NodePath<t.While>;
method isWhileStatement
isWhileStatement: (opts?: object) => this is NodePath<t.WhileStatement>;
method isWithStatement
isWithStatement: (opts?: object) => this is NodePath<t.WithStatement>;
method isYieldExpression
isYieldExpression: (opts?: object) => this is NodePath<t.YieldExpression>;
method matchesPattern
matchesPattern: (pattern: string, allowPartial?: boolean) => boolean;
Match the current node if it matches the provided
pattern
.For example, given the match
React.createClass
it would match the parsed nodes ofReact.createClass
andReact["createClass"]
.
method popContext
popContext: () => void;
method pushContext
pushContext: (context: TraversalContext) => void;
method referencesImport
referencesImport: (moduleSource: string, importName: string) => boolean;
Check if the currently assigned path references the
importName
ofmoduleSource
.
method remove
remove: () => void;
method replaceExpressionWithStatements
replaceExpressionWithStatements: (nodes: Node[]) => t.Node;
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.
method replaceInline
replaceInline: (nodes: Node | Node[]) => void;
method replaceWith
replaceWith: (replacement: Node | NodePath) => void;
Replace the current node with another.
method replaceWithMultiple
replaceWithMultiple: (nodes: Node[]) => void;
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.
method replaceWithSourceString
replaceWithSourceString: (replacement: any) => 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.
method set
set: (key: string, node: t.Node) => void;
method setContext
setContext: (context: TraversalContext) => NodePath<T>;
method setData
setData: (key: string, val: any) => any;
method setScope
setScope: () => void;
method shareCommentsWithSiblings
shareCommentsWithSiblings: () => void;
Share comments amongst siblings.
method skip
skip: () => void;
method skipKey
skipKey: (key: string) => void;
method stop
stop: () => void;
method traverse
traverse: { <T>(visitor: Visitor<T>, state: T): void; (visitor: Visitor<t.Node>): void;};
method updateSiblingKeys
updateSiblingKeys: (fromIndex: number, incrementBy: number) => void;
Update all sibling node paths after
fromIndex
byincrementBy
.
method visit
visit: () => boolean;
method willIMaybeExecuteBefore
willIMaybeExecuteBefore: (path: NodePath) => boolean;
Check if the current path will maybe execute before another path
class Scope
class Scope {}
constructor
constructor(path: NodePath<t.Node>, parentScope?: Scope);
property bindings
bindings: { [name: string]: Binding };
property block
block: t.Node;
property hub
hub: Hub;
property parent
parent: Scope;
property parentBlock
parentBlock: t.Node;
property path
path: NodePath<t.Node>;
method addGlobal
addGlobal: (node: t.Node) => void;
method bindingIdentifierEquals
bindingIdentifierEquals: (name: string, node: t.Node) => boolean;
method buildUndefinedNode
buildUndefinedNode: () => t.Node;
method checkBlockScopedCollisions
checkBlockScopedCollisions: ( local: t.Node, kind: string, name: string, id: object) => void;
method dump
dump: () => void;
method generateDeclaredUidIdentifier
generateDeclaredUidIdentifier: (name?: string) => t.Identifier;
Generate a unique identifier and add it to the current scope.
method generateUid
generateUid: (name?: string) => string;
Generate a unique
_id1
binding.
method generateUidIdentifier
generateUidIdentifier: (name?: string) => t.Identifier;
Generate a unique identifier.
method generateUidIdentifierBasedOnNode
generateUidIdentifierBasedOnNode: ( parent: t.Node, defaultName?: string) => t.Identifier;
Generate a unique identifier based on a node.
method getAllBindings
getAllBindings: (...kinds: string[]) => object;
Walks the scope tree and gathers **all** bindings.
method getBinding
getBinding: (name: string) => Binding | undefined;
method getBindingIdentifier
getBindingIdentifier: (name: string) => t.Identifier;
method getBlockParent
getBlockParent: () => Scope;
method getData
getData: (key: string) => any;
method getFunctionParent
getFunctionParent: () => Scope;
method getOwnBinding
getOwnBinding: (name: string) => Binding | undefined;
method getOwnBindingIdentifier
getOwnBindingIdentifier: (name: string) => t.Identifier;
method getProgramParent
getProgramParent: () => Scope;
method hasBinding
hasBinding: (name: string, noGlobals?: boolean) => boolean;
method hasGlobal
hasGlobal: (name: string) => boolean;
method hasOwnBinding
hasOwnBinding: (name: string) => boolean;
method hasReference
hasReference: (name: string) => boolean;
method hasUid
hasUid: (name: string) => boolean;
method isPure
isPure: (node: t.Node, constantsOnly?: boolean) => boolean;
method isStatic
isStatic: (node: t.Node) => boolean;
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
method maybeGenerateMemoised
maybeGenerateMemoised: (node: t.Node, dontPush?: boolean) => t.Identifier;
Possibly generate a memoised identifier if it is not static and has consequences.
method moveBindingTo
moveBindingTo: (name: string, scope: Scope) => void;
Move a binding of
name
to anotherscope
.
method parentHasBinding
parentHasBinding: (name: string, noGlobals?: boolean) => boolean;
method push
push: (opts: any) => void;
method registerBinding
registerBinding: (kind: string, path: NodePath, bindingPath?: NodePath) => void;
method registerConstantViolation
registerConstantViolation: (path: NodePath) => void;
method registerDeclaration
registerDeclaration: (path: NodePath) => void;
method removeBinding
removeBinding: (name: string) => void;
method removeData
removeData: (key: string) => void;
method removeOwnBinding
removeOwnBinding: (name: string) => void;
method rename
rename: (oldName: string, newName?: string, block?: t.Node) => void;
method setData
setData: (key: string, val: any) => any;
method toArray
toArray: (node: t.Node, i?: number) => t.Node;
method traverse
traverse: { <S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void; (node: any, opts?: TraverseOptions<t.Node>, state?: any): void;};
Traverse node with current scope and path.
Interfaces
interface TraversalContext
interface TraversalContext {}
property opts
opts: any;
property parentPath
parentPath: NodePath;
property scope
scope: Scope;
property state
state: any;
interface TraverseOptions
interface TraverseOptions<S = Node> extends Visitor<S> {}
interface VisitNodeObject
interface VisitNodeObject<T> {}
interface Visitor
interface Visitor<S = Node> extends VisitNodeObject<Node> {}
property AnyTypeAnnotation
AnyTypeAnnotation?: VisitNode<S, t.AnyTypeAnnotation> | undefined;
property ArrayExpression
ArrayExpression?: VisitNode<S, t.ArrayExpression> | undefined;
property ArrayPattern
ArrayPattern?: VisitNode<S, t.ArrayPattern> | undefined;
property ArrayTypeAnnotation
ArrayTypeAnnotation?: VisitNode<S, t.ArrayTypeAnnotation> | undefined;
property ArrowFunctionExpression
ArrowFunctionExpression?: VisitNode<S, t.ArrowFunctionExpression> | undefined;
property AssignmentExpression
AssignmentExpression?: VisitNode<S, t.AssignmentExpression> | undefined;
property AssignmentPattern
AssignmentPattern?: VisitNode<S, t.AssignmentPattern> | undefined;
property AwaitExpression
AwaitExpression?: VisitNode<S, t.AwaitExpression> | undefined;
property Binary
Binary?: VisitNode<S, t.Binary> | undefined;
property BinaryExpression
BinaryExpression?: VisitNode<S, t.BinaryExpression> | undefined;
property BindExpression
BindExpression?: VisitNode<S, t.BindExpression> | undefined;
property Block
Block?: VisitNode<S, t.Block> | undefined;
property BlockParent
BlockParent?: VisitNode<S, t.BlockParent> | undefined;
property BlockStatement
BlockStatement?: VisitNode<S, t.BlockStatement> | undefined;
property BooleanLiteral
BooleanLiteral?: VisitNode<S, t.BooleanLiteral> | undefined;
property BooleanLiteralTypeAnnotation
BooleanLiteralTypeAnnotation?: | VisitNode<S, t.BooleanLiteralTypeAnnotation> | undefined;
property BooleanTypeAnnotation
BooleanTypeAnnotation?: VisitNode<S, t.BooleanTypeAnnotation> | undefined;
property BreakStatement
BreakStatement?: VisitNode<S, t.BreakStatement> | undefined;
property CallExpression
CallExpression?: VisitNode<S, t.CallExpression> | undefined;
property CatchClause
CatchClause?: VisitNode<S, t.CatchClause> | undefined;
property Class
Class?: VisitNode<S, t.Class> | undefined;
property ClassBody
ClassBody?: VisitNode<S, t.ClassBody> | undefined;
property ClassDeclaration
ClassDeclaration?: VisitNode<S, t.ClassDeclaration> | undefined;
property ClassExpression
ClassExpression?: VisitNode<S, t.ClassExpression> | undefined;
property ClassImplements
ClassImplements?: VisitNode<S, t.ClassImplements> | undefined;
property ClassMethod
ClassMethod?: VisitNode<S, t.ClassMethod> | undefined;
property ClassProperty
ClassProperty?: VisitNode<S, t.ClassProperty> | undefined;
property CompletionStatement
CompletionStatement?: VisitNode<S, t.CompletionStatement> | undefined;
property Conditional
Conditional?: VisitNode<S, t.Conditional> | undefined;
property ConditionalExpression
ConditionalExpression?: VisitNode<S, t.ConditionalExpression> | undefined;
property ContinueStatement
ContinueStatement?: VisitNode<S, t.ContinueStatement> | undefined;
property DebuggerStatement
DebuggerStatement?: VisitNode<S, t.DebuggerStatement> | undefined;
property Declaration
Declaration?: VisitNode<S, t.Declaration> | undefined;
property DeclareClass
DeclareClass?: VisitNode<S, t.DeclareClass> | undefined;
property DeclareFunction
DeclareFunction?: VisitNode<S, t.DeclareFunction> | undefined;
property DeclareInterface
DeclareInterface?: VisitNode<S, t.DeclareInterface> | undefined;
property DeclareModule
DeclareModule?: VisitNode<S, t.DeclareModule> | undefined;
property DeclareTypeAlias
DeclareTypeAlias?: VisitNode<S, t.DeclareTypeAlias> | undefined;
property DeclareVariable
DeclareVariable?: VisitNode<S, t.DeclareVariable> | undefined;
property Decorator
Decorator?: VisitNode<S, t.Decorator> | undefined;
property Directive
Directive?: VisitNode<S, t.Directive> | undefined;
property DirectiveLiteral
DirectiveLiteral?: VisitNode<S, t.DirectiveLiteral> | undefined;
property DoExpression
DoExpression?: VisitNode<S, t.DoExpression> | undefined;
property DoWhileStatement
DoWhileStatement?: VisitNode<S, t.DoWhileStatement> | undefined;
property EmptyStatement
EmptyStatement?: VisitNode<S, t.EmptyStatement> | undefined;
property ExistentialTypeParam
ExistentialTypeParam?: VisitNode<S, t.ExistentialTypeParam> | undefined;
property ExportAllDeclaration
ExportAllDeclaration?: VisitNode<S, t.ExportAllDeclaration> | undefined;
property ExportDeclaration
ExportDeclaration?: VisitNode<S, t.ExportDeclaration> | undefined;
property ExportDefaultDeclaration
ExportDefaultDeclaration?: VisitNode<S, t.ExportDefaultDeclaration> | undefined;
property ExportDefaultSpecifier
ExportDefaultSpecifier?: VisitNode<S, t.ExportDefaultSpecifier> | undefined;
property ExportNamedDeclaration
ExportNamedDeclaration?: VisitNode<S, t.ExportNamedDeclaration> | undefined;
property ExportNamespaceSpecifier
ExportNamespaceSpecifier?: VisitNode<S, t.ExportNamespaceSpecifier> | undefined;
property ExportSpecifier
ExportSpecifier?: VisitNode<S, t.ExportSpecifier> | undefined;
property Expression
Expression?: VisitNode<S, t.Expression> | undefined;
property ExpressionStatement
ExpressionStatement?: VisitNode<S, t.ExpressionStatement> | undefined;
property ExpressionWrapper
ExpressionWrapper?: VisitNode<S, t.ExpressionWrapper> | undefined;
property File
File?: VisitNode<S, t.File> | undefined;
property Flow
Flow?: VisitNode<S, t.Flow> | undefined;
property FlowBaseAnnotation
FlowBaseAnnotation?: VisitNode<S, t.FlowBaseAnnotation> | undefined;
property FlowDeclaration
FlowDeclaration?: VisitNode<S, t.FlowDeclaration> | undefined;
property For
For?: VisitNode<S, t.For> | undefined;
property ForInStatement
ForInStatement?: VisitNode<S, t.ForInStatement> | undefined;
property ForOfStatement
ForOfStatement?: VisitNode<S, t.ForOfStatement> | undefined;
property ForStatement
ForStatement?: VisitNode<S, t.ForStatement> | undefined;
property ForXStatement
ForXStatement?: VisitNode<S, t.ForXStatement> | undefined;
property Function
Function?: VisitNode<S, t.Function> | undefined;
property FunctionDeclaration
FunctionDeclaration?: VisitNode<S, t.FunctionDeclaration> | undefined;
property FunctionExpression
FunctionExpression?: VisitNode<S, t.FunctionExpression> | undefined;
property FunctionParent
FunctionParent?: VisitNode<S, t.FunctionParent> | undefined;
property FunctionTypeAnnotation
FunctionTypeAnnotation?: VisitNode<S, t.FunctionTypeAnnotation> | undefined;
property FunctionTypeParam
FunctionTypeParam?: VisitNode<S, t.FunctionTypeParam> | undefined;
property GenericTypeAnnotation
GenericTypeAnnotation?: VisitNode<S, t.GenericTypeAnnotation> | undefined;
property Identifier
Identifier?: VisitNode<S, t.Identifier> | undefined;
property IfStatement
IfStatement?: VisitNode<S, t.IfStatement> | undefined;
property Immutable
Immutable?: VisitNode<S, t.Immutable> | undefined;
property ImportDeclaration
ImportDeclaration?: VisitNode<S, t.ImportDeclaration> | undefined;
property ImportDefaultSpecifier
ImportDefaultSpecifier?: VisitNode<S, t.ImportDefaultSpecifier> | undefined;
property ImportNamespaceSpecifier
ImportNamespaceSpecifier?: VisitNode<S, t.ImportNamespaceSpecifier> | undefined;
property ImportSpecifier
ImportSpecifier?: VisitNode<S, t.ImportSpecifier> | undefined;
property InterfaceDeclaration
InterfaceDeclaration?: VisitNode<S, t.InterfaceDeclaration> | undefined;
property InterfaceExtends
InterfaceExtends?: VisitNode<S, t.InterfaceExtends> | undefined;
property IntersectionTypeAnnotation
IntersectionTypeAnnotation?: | VisitNode<S, t.IntersectionTypeAnnotation> | undefined;
property JSX
JSX?: VisitNode<S, t.JSX> | undefined;
property JSXAttribute
JSXAttribute?: VisitNode<S, t.JSXAttribute> | undefined;
property JSXClosingElement
JSXClosingElement?: VisitNode<S, t.JSXClosingElement> | undefined;
property JSXElement
JSXElement?: VisitNode<S, t.JSXElement> | undefined;
property JSXEmptyExpression
JSXEmptyExpression?: VisitNode<S, t.JSXEmptyExpression> | undefined;
property JSXExpressionContainer
JSXExpressionContainer?: VisitNode<S, t.JSXExpressionContainer> | undefined;
property JSXIdentifier
JSXIdentifier?: VisitNode<S, t.JSXIdentifier> | undefined;
property JSXMemberExpression
JSXMemberExpression?: VisitNode<S, t.JSXMemberExpression> | undefined;
property JSXNamespacedName
JSXNamespacedName?: VisitNode<S, t.JSXNamespacedName> | undefined;
property JSXOpeningElement
JSXOpeningElement?: VisitNode<S, t.JSXOpeningElement> | undefined;
property JSXSpreadAttribute
JSXSpreadAttribute?: VisitNode<S, t.JSXSpreadAttribute> | undefined;
property JSXText
JSXText?: VisitNode<S, t.JSXText> | undefined;
property LabeledStatement
LabeledStatement?: VisitNode<S, t.LabeledStatement> | undefined;
property Literal
Literal?: VisitNode<S, t.Literal> | undefined;
property LogicalExpression
LogicalExpression?: VisitNode<S, t.LogicalExpression> | undefined;
property Loop
Loop?: VisitNode<S, t.Loop> | undefined;
property LVal
LVal?: VisitNode<S, t.LVal> | undefined;
property MemberExpression
MemberExpression?: VisitNode<S, t.MemberExpression> | undefined;
property MetaProperty
MetaProperty?: VisitNode<S, t.MetaProperty> | undefined;
property Method
Method?: VisitNode<S, t.Method> | undefined;
property MixedTypeAnnotation
MixedTypeAnnotation?: VisitNode<S, t.MixedTypeAnnotation> | undefined;
property ModuleDeclaration
ModuleDeclaration?: VisitNode<S, t.ModuleDeclaration> | undefined;
property ModuleSpecifier
ModuleSpecifier?: VisitNode<S, t.ModuleSpecifier> | undefined;
property NewExpression
NewExpression?: VisitNode<S, t.NewExpression> | undefined;
property Noop
Noop?: VisitNode<S, t.Noop> | undefined;
property NullableTypeAnnotation
NullableTypeAnnotation?: VisitNode<S, t.NullableTypeAnnotation> | undefined;
property NullLiteral
NullLiteral?: VisitNode<S, t.NullLiteral> | undefined;
property NullLiteralTypeAnnotation
NullLiteralTypeAnnotation?: | VisitNode<S, t.NullLiteralTypeAnnotation> | undefined;
property NumberTypeAnnotation
NumberTypeAnnotation?: VisitNode<S, t.NumberTypeAnnotation> | undefined;
property NumericLiteral
NumericLiteral?: VisitNode<S, t.NumericLiteral> | undefined;
property NumericLiteralTypeAnnotation
NumericLiteralTypeAnnotation?: | VisitNode<S, t.NumericLiteralTypeAnnotation> | undefined;
property ObjectExpression
ObjectExpression?: VisitNode<S, t.ObjectExpression> | undefined;
property ObjectMember
ObjectMember?: VisitNode<S, t.ObjectMember> | undefined;
property ObjectMethod
ObjectMethod?: VisitNode<S, t.ObjectMethod> | undefined;
property ObjectPattern
ObjectPattern?: VisitNode<S, t.ObjectPattern> | undefined;
property ObjectProperty
ObjectProperty?: VisitNode<S, t.ObjectProperty> | undefined;
property ObjectTypeAnnotation
ObjectTypeAnnotation?: VisitNode<S, t.ObjectTypeAnnotation> | undefined;
property ObjectTypeCallProperty
ObjectTypeCallProperty?: VisitNode<S, t.ObjectTypeCallProperty> | undefined;
property ObjectTypeIndexer
ObjectTypeIndexer?: VisitNode<S, t.ObjectTypeIndexer> | undefined;
property ObjectTypeProperty
ObjectTypeProperty?: VisitNode<S, t.ObjectTypeProperty> | undefined;
property ParenthesizedExpression
ParenthesizedExpression?: VisitNode<S, t.ParenthesizedExpression> | undefined;
property Pattern
Pattern?: VisitNode<S, t.Pattern> | undefined;
property Program
Program?: VisitNode<S, t.Program> | undefined;
property Property
Property?: VisitNode<S, t.Property> | undefined;
property Pureish
Pureish?: VisitNode<S, t.Pureish> | undefined;
property QualifiedTypeIdentifier
QualifiedTypeIdentifier?: VisitNode<S, t.QualifiedTypeIdentifier> | undefined;
property RegExpLiteral
RegExpLiteral?: VisitNode<S, t.RegExpLiteral> | undefined;
property RestElement
RestElement?: VisitNode<S, t.RestElement> | undefined;
property RestProperty
RestProperty?: VisitNode<S, t.RestProperty> | undefined;
property ReturnStatement
ReturnStatement?: VisitNode<S, t.ReturnStatement> | undefined;
property Scopable
Scopable?: VisitNode<S, t.Scopable> | undefined;
property Scope
Scope?: VisitNode<S, t.Scopable> | undefined;
property SequenceExpression
SequenceExpression?: VisitNode<S, t.SequenceExpression> | undefined;
property SpreadElement
SpreadElement?: VisitNode<S, t.SpreadElement> | undefined;
property SpreadProperty
SpreadProperty?: VisitNode<S, t.SpreadProperty> | undefined;
property Statement
Statement?: VisitNode<S, t.Statement> | undefined;
property StringLiteral
StringLiteral?: VisitNode<S, t.StringLiteral> | undefined;
property StringLiteralTypeAnnotation
StringLiteralTypeAnnotation?: | VisitNode<S, t.StringLiteralTypeAnnotation> | undefined;
property StringTypeAnnotation
StringTypeAnnotation?: VisitNode<S, t.StringTypeAnnotation> | undefined;
property Super
Super?: VisitNode<S, t.Super> | undefined;
property SwitchCase
SwitchCase?: VisitNode<S, t.SwitchCase> | undefined;
property SwitchStatement
SwitchStatement?: VisitNode<S, t.SwitchStatement> | undefined;
property TaggedTemplateExpression
TaggedTemplateExpression?: VisitNode<S, t.TaggedTemplateExpression> | undefined;
property TemplateElement
TemplateElement?: VisitNode<S, t.TemplateElement> | undefined;
property TemplateLiteral
TemplateLiteral?: VisitNode<S, t.TemplateLiteral> | undefined;
property Terminatorless
Terminatorless?: VisitNode<S, t.Terminatorless> | undefined;
property ThisExpression
ThisExpression?: VisitNode<S, t.ThisExpression> | undefined;
property ThisTypeAnnotation
ThisTypeAnnotation?: VisitNode<S, t.ThisTypeAnnotation> | undefined;
property ThrowStatement
ThrowStatement?: VisitNode<S, t.ThrowStatement> | undefined;
property TryStatement
TryStatement?: VisitNode<S, t.TryStatement> | undefined;
property TupleTypeAnnotation
TupleTypeAnnotation?: VisitNode<S, t.TupleTypeAnnotation> | undefined;
property TypeAlias
TypeAlias?: VisitNode<S, t.TypeAlias> | undefined;
property TypeAnnotation
TypeAnnotation?: VisitNode<S, t.TypeAnnotation> | undefined;
property TypeCastExpression
TypeCastExpression?: VisitNode<S, t.TypeCastExpression> | undefined;
property TypeofTypeAnnotation
TypeofTypeAnnotation?: VisitNode<S, t.TypeofTypeAnnotation> | undefined;
property TypeParameterDeclaration
TypeParameterDeclaration?: VisitNode<S, t.TypeParameterDeclaration> | undefined;
property TypeParameterInstantiation
TypeParameterInstantiation?: | VisitNode<S, t.TypeParameterInstantiation> | undefined;
property UnaryExpression
UnaryExpression?: VisitNode<S, t.UnaryExpression> | undefined;
property UnaryLike
UnaryLike?: VisitNode<S, t.UnaryLike> | undefined;
property UnionTypeAnnotation
UnionTypeAnnotation?: VisitNode<S, t.UnionTypeAnnotation> | undefined;
property UpdateExpression
UpdateExpression?: VisitNode<S, t.UpdateExpression> | undefined;
property UserWhitespacable
UserWhitespacable?: VisitNode<S, t.UserWhitespacable> | undefined;
property VariableDeclaration
VariableDeclaration?: VisitNode<S, t.VariableDeclaration> | undefined;
property VariableDeclarator
VariableDeclarator?: VisitNode<S, t.VariableDeclarator> | undefined;
property VoidTypeAnnotation
VoidTypeAnnotation?: VisitNode<S, t.VoidTypeAnnotation> | undefined;
property While
While?: VisitNode<S, t.While> | undefined;
property WhileStatement
WhileStatement?: VisitNode<S, t.WhileStatement> | undefined;
property WithStatement
WithStatement?: VisitNode<S, t.WithStatement> | undefined;
property YieldExpression
YieldExpression?: VisitNode<S, t.YieldExpression> | undefined;
Type Aliases
type Node
type Node = t.Node;
type VisitNode
type VisitNode<T, P> = VisitNodeFunction<T, P> | VisitNodeObject<T>;
type VisitNodeFunction
type VisitNodeFunction<T, P> = (this: T, path: NodePath<P>, state: any) => void;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/babel-traverse
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/babel-traverse)
- HTML<a href="https://www.jsdocs.io/package/@types/babel-traverse"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 10360 ms. - Missing or incorrect documentation? Open an issue for this package.