@types/babel__traverse
- Version 7.18.3
- Published
- 65.2 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
Variables
Classes
NodePath
- addComment()
- addComments()
- assertAnyTypeAnnotation()
- assertArrayExpression()
- assertArrayPattern()
- assertArrayTypeAnnotation()
- assertArrowFunctionExpression()
- assertAssignmentExpression()
- assertAssignmentPattern()
- assertAwaitExpression()
- assertBigIntLiteral()
- assertBinary()
- assertBinaryExpression()
- assertBindExpression()
- assertBindingIdentifier()
- assertBlock()
- assertBlockParent()
- assertBlockScoped()
- assertBlockStatement()
- assertBooleanLiteral()
- assertBooleanLiteralTypeAnnotation()
- assertBooleanTypeAnnotation()
- assertBreakStatement()
- assertCallExpression()
- assertCatchClause()
- assertClass()
- assertClassBody()
- assertClassDeclaration()
- assertClassExpression()
- assertClassImplements()
- assertClassMethod()
- assertClassPrivateMethod()
- assertClassPrivateProperty()
- assertClassProperty()
- assertCompletionStatement()
- assertConditional()
- assertConditionalExpression()
- assertContinueStatement()
- assertDebuggerStatement()
- assertDeclaration()
- assertDeclareClass()
- assertDeclaredPredicate()
- assertDeclareExportAllDeclaration()
- assertDeclareExportDeclaration()
- assertDeclareFunction()
- assertDeclareInterface()
- assertDeclareModule()
- assertDeclareModuleExports()
- assertDeclareOpaqueType()
- assertDeclareTypeAlias()
- assertDeclareVariable()
- assertDecorator()
- assertDirective()
- assertDirectiveLiteral()
- assertDoExpression()
- assertDoWhileStatement()
- assertEmptyStatement()
- assertEmptyTypeAnnotation()
- assertExistsTypeAnnotation()
- assertExportAllDeclaration()
- assertExportDeclaration()
- assertExportDefaultDeclaration()
- assertExportDefaultSpecifier()
- assertExportNamedDeclaration()
- assertExportNamespaceSpecifier()
- assertExportSpecifier()
- assertExpression()
- assertExpressionStatement()
- assertExpressionWrapper()
- assertFile()
- assertFlow()
- assertFlowBaseAnnotation()
- assertFlowDeclaration()
- assertFlowPredicate()
- assertFlowType()
- assertFor()
- assertForInStatement()
- assertForOfStatement()
- assertForStatement()
- assertForXStatement()
- assertFunction()
- assertFunctionDeclaration()
- assertFunctionExpression()
- assertFunctionParent()
- assertFunctionTypeAnnotation()
- assertFunctionTypeParam()
- assertGenerated()
- assertGenericTypeAnnotation()
- assertIdentifier()
- assertIfStatement()
- assertImmutable()
- assertImport()
- assertImportDeclaration()
- assertImportDefaultSpecifier()
- assertImportNamespaceSpecifier()
- assertImportSpecifier()
- assertInferredPredicate()
- assertInterfaceDeclaration()
- assertInterfaceExtends()
- assertInterfaceTypeAnnotation()
- assertInterpreterDirective()
- assertIntersectionTypeAnnotation()
- assertJSX()
- assertJSXAttribute()
- assertJSXClosingElement()
- assertJSXClosingFragment()
- assertJSXElement()
- assertJSXEmptyExpression()
- assertJSXExpressionContainer()
- assertJSXFragment()
- assertJSXIdentifier()
- assertJSXMemberExpression()
- assertJSXNamespacedName()
- assertJSXOpeningElement()
- assertJSXOpeningFragment()
- assertJSXSpreadAttribute()
- assertJSXSpreadChild()
- assertJSXText()
- assertLabeledStatement()
- assertLiteral()
- assertLogicalExpression()
- assertLoop()
- assertLVal()
- assertMemberExpression()
- assertMetaProperty()
- assertMethod()
- assertMixedTypeAnnotation()
- assertModuleDeclaration()
- assertModuleSpecifier()
- assertNewExpression()
- assertNoop()
- assertNullableTypeAnnotation()
- assertNullLiteral()
- assertNullLiteralTypeAnnotation()
- assertNumberLiteral()
- assertNumberLiteralTypeAnnotation()
- assertNumberTypeAnnotation()
- assertNumericLiteral()
- assertObjectExpression()
- assertObjectMember()
- assertObjectMethod()
- assertObjectPattern()
- assertObjectProperty()
- assertObjectTypeAnnotation()
- assertObjectTypeCallProperty()
- assertObjectTypeIndexer()
- assertObjectTypeInternalSlot()
- assertObjectTypeProperty()
- assertObjectTypeSpreadProperty()
- assertOpaqueType()
- assertOptionalCallExpression()
- assertOptionalMemberExpression()
- assertParenthesizedExpression()
- assertPattern()
- assertPatternLike()
- assertPipelineBareFunction()
- assertPipelinePrimaryTopicReference()
- assertPipelineTopicExpression()
- assertPrivate()
- assertPrivateName()
- assertProgram()
- assertProperty()
- assertPure()
- assertPureish()
- assertQualifiedTypeIdentifier()
- assertReferenced()
- assertReferencedIdentifier()
- assertReferencedMemberExpression()
- assertRegexLiteral()
- assertRegExpLiteral()
- assertRestElement()
- assertRestProperty()
- assertReturnStatement()
- assertScopable()
- assertScope()
- assertSequenceExpression()
- assertSpreadElement()
- assertSpreadProperty()
- assertStatement()
- assertStringLiteral()
- assertStringLiteralTypeAnnotation()
- assertStringTypeAnnotation()
- assertSuper()
- assertSwitchCase()
- assertSwitchStatement()
- assertTaggedTemplateExpression()
- assertTemplateElement()
- assertTemplateLiteral()
- assertTerminatorless()
- assertThisExpression()
- assertThisTypeAnnotation()
- assertThrowStatement()
- assertTryStatement()
- assertTSAnyKeyword()
- assertTSArrayType()
- assertTSAsExpression()
- assertTSBooleanKeyword()
- assertTSCallSignatureDeclaration()
- assertTSConditionalType()
- assertTSConstructorType()
- assertTSConstructSignatureDeclaration()
- assertTSDeclareFunction()
- assertTSDeclareMethod()
- assertTSEntityName()
- assertTSEnumDeclaration()
- assertTSEnumMember()
- assertTSExportAssignment()
- assertTSExpressionWithTypeArguments()
- assertTSExternalModuleReference()
- assertTSFunctionType()
- assertTSImportEqualsDeclaration()
- assertTSImportType()
- assertTSIndexedAccessType()
- assertTSIndexSignature()
- assertTSInferType()
- assertTSInterfaceBody()
- assertTSInterfaceDeclaration()
- assertTSIntersectionType()
- assertTSLiteralType()
- assertTSMappedType()
- assertTSMethodSignature()
- assertTSModuleBlock()
- assertTSModuleDeclaration()
- assertTSNamespaceExportDeclaration()
- assertTSNeverKeyword()
- assertTSNonNullExpression()
- assertTSNullKeyword()
- assertTSNumberKeyword()
- assertTSObjectKeyword()
- assertTSOptionalType()
- assertTSParameterProperty()
- assertTSParenthesizedType()
- assertTSPropertySignature()
- assertTSQualifiedName()
- assertTSRestType()
- assertTSStringKeyword()
- assertTSSymbolKeyword()
- assertTSThisType()
- assertTSTupleType()
- assertTSType()
- assertTSTypeAliasDeclaration()
- assertTSTypeAnnotation()
- assertTSTypeAssertion()
- assertTSTypeElement()
- assertTSTypeLiteral()
- assertTSTypeOperator()
- assertTSTypeParameter()
- assertTSTypeParameterDeclaration()
- assertTSTypeParameterInstantiation()
- assertTSTypePredicate()
- assertTSTypeQuery()
- assertTSTypeReference()
- assertTSUndefinedKeyword()
- assertTSUnionType()
- assertTSUnknownKeyword()
- assertTSVoidKeyword()
- assertTupleTypeAnnotation()
- assertTypeAlias()
- assertTypeAnnotation()
- assertTypeCastExpression()
- assertTypeofTypeAnnotation()
- assertTypeParameter()
- assertTypeParameterDeclaration()
- assertTypeParameterInstantiation()
- assertUnaryExpression()
- assertUnaryLike()
- assertUnionTypeAnnotation()
- assertUpdateExpression()
- assertUser()
- assertUserWhitespacable()
- assertVar()
- assertVariableDeclaration()
- assertVariableDeclarator()
- assertVariance()
- 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()
- getBindingIdentifierPaths()
- getBindingIdentifiers()
- getCompletionRecords()
- getData()
- getDeepestCommonAncestorFrom()
- getEarliestCommonAncestorFrom()
- getFunctionParent()
- getNextSibling()
- getOpposite()
- getOuterBindingIdentifierPaths()
- getOuterBindingIdentifiers()
- getPathLocation()
- getPrevSibling()
- getScope()
- getSibling()
- getSource()
- getStatementParent()
- getTypeAnnotation()
- has()
- hasNode()
- hoist()
- hub
- inList
- insertAfter()
- insertBefore()
- inType()
- is()
- isAncestor()
- isAnyTypeAnnotation()
- isArrayExpression()
- isArrayPattern()
- isArrayTypeAnnotation()
- isArrowFunctionExpression()
- isAssignmentExpression()
- isAssignmentPattern()
- isAwaitExpression()
- isBaseType()
- isBigIntLiteral()
- isBinary()
- isBinaryExpression()
- isBindExpression()
- isBindingIdentifier()
- isBlacklisted()
- isBlock()
- isBlockParent()
- isBlockScoped()
- isBlockStatement()
- isBooleanLiteral()
- isBooleanLiteralTypeAnnotation()
- isBooleanTypeAnnotation()
- isBreakStatement()
- isCallExpression()
- isCatchClause()
- isClass()
- isClassBody()
- isClassDeclaration()
- isClassExpression()
- isClassImplements()
- isClassMethod()
- isClassPrivateMethod()
- isClassPrivateProperty()
- isClassProperty()
- isCompletionRecord()
- isCompletionStatement()
- isConditional()
- isConditionalExpression()
- isContinueStatement()
- isDebuggerStatement()
- isDeclaration()
- isDeclareClass()
- isDeclaredPredicate()
- isDeclareExportAllDeclaration()
- isDeclareExportDeclaration()
- isDeclareFunction()
- isDeclareInterface()
- isDeclareModule()
- isDeclareModuleExports()
- isDeclareOpaqueType()
- isDeclareTypeAlias()
- isDeclareVariable()
- isDecorator()
- isDescendant()
- isDirective()
- isDirectiveLiteral()
- isDoExpression()
- isDoWhileStatement()
- isEmptyStatement()
- isEmptyTypeAnnotation()
- isExistsTypeAnnotation()
- isExportAllDeclaration()
- isExportDeclaration()
- isExportDefaultDeclaration()
- isExportDefaultSpecifier()
- isExportNamedDeclaration()
- isExportNamespaceSpecifier()
- isExportSpecifier()
- isExpression()
- isExpressionStatement()
- isExpressionWrapper()
- isFile()
- isFlow()
- isFlowBaseAnnotation()
- isFlowDeclaration()
- isFlowPredicate()
- isFlowType()
- isFor()
- isForInStatement()
- isForOfStatement()
- isForStatement()
- isForXStatement()
- isFunction()
- isFunctionDeclaration()
- isFunctionExpression()
- isFunctionParent()
- isFunctionTypeAnnotation()
- isFunctionTypeParam()
- isGenerated()
- isGenericType()
- isGenericTypeAnnotation()
- isIdentifier()
- isIfStatement()
- isImmutable()
- isImport()
- isImportDeclaration()
- isImportDefaultSpecifier()
- isImportNamespaceSpecifier()
- isImportSpecifier()
- isInferredPredicate()
- isInterfaceDeclaration()
- isInterfaceExtends()
- isInterfaceTypeAnnotation()
- isInterpreterDirective()
- isIntersectionTypeAnnotation()
- isJSX()
- isJSXAttribute()
- isJSXClosingElement()
- isJSXClosingFragment()
- isJSXElement()
- isJSXEmptyExpression()
- isJSXExpressionContainer()
- isJSXFragment()
- isJSXIdentifier()
- isJSXMemberExpression()
- isJSXNamespacedName()
- isJSXOpeningElement()
- isJSXOpeningFragment()
- isJSXSpreadAttribute()
- isJSXSpreadChild()
- isJSXText()
- isLabeledStatement()
- isLiteral()
- isLogicalExpression()
- isLoop()
- isLVal()
- isMemberExpression()
- isMetaProperty()
- isMethod()
- isMixedTypeAnnotation()
- isModuleDeclaration()
- isModuleSpecifier()
- isNewExpression()
- isNodeType()
- isNoop()
- isnt()
- isNullableTypeAnnotation()
- isNullLiteral()
- isNullLiteralTypeAnnotation()
- isNumberLiteral()
- isNumberLiteralTypeAnnotation()
- isNumberTypeAnnotation()
- isNumericLiteral()
- isObjectExpression()
- isObjectMember()
- isObjectMethod()
- isObjectPattern()
- isObjectProperty()
- isObjectTypeAnnotation()
- isObjectTypeCallProperty()
- isObjectTypeIndexer()
- isObjectTypeInternalSlot()
- isObjectTypeProperty()
- isObjectTypeSpreadProperty()
- isOpaqueType()
- isOptionalCallExpression()
- isOptionalMemberExpression()
- isParenthesizedExpression()
- isPattern()
- isPatternLike()
- isPipelineBareFunction()
- isPipelinePrimaryTopicReference()
- isPipelineTopicExpression()
- isPrivate()
- isPrivateName()
- 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()
- isTSAnyKeyword()
- isTSArrayType()
- isTSAsExpression()
- isTSBooleanKeyword()
- isTSCallSignatureDeclaration()
- isTSConditionalType()
- isTSConstructorType()
- isTSConstructSignatureDeclaration()
- isTSDeclareFunction()
- isTSDeclareMethod()
- isTSEntityName()
- isTSEnumDeclaration()
- isTSEnumMember()
- isTSExportAssignment()
- isTSExpressionWithTypeArguments()
- isTSExternalModuleReference()
- isTSFunctionType()
- isTSImportEqualsDeclaration()
- isTSImportType()
- isTSIndexedAccessType()
- isTSIndexSignature()
- isTSInferType()
- isTSInterfaceBody()
- isTSInterfaceDeclaration()
- isTSIntersectionType()
- isTSLiteralType()
- isTSMappedType()
- isTSMethodSignature()
- isTSModuleBlock()
- isTSModuleDeclaration()
- isTSNamespaceExportDeclaration()
- isTSNeverKeyword()
- isTSNonNullExpression()
- isTSNullKeyword()
- isTSNumberKeyword()
- isTSObjectKeyword()
- isTSOptionalType()
- isTSParameterProperty()
- isTSParenthesizedType()
- isTSPropertySignature()
- isTSQualifiedName()
- isTSRestType()
- isTSStringKeyword()
- isTSSymbolKeyword()
- isTSThisType()
- isTSTupleType()
- isTSType()
- isTSTypeAliasDeclaration()
- isTSTypeAnnotation()
- isTSTypeAssertion()
- isTSTypeElement()
- isTSTypeLiteral()
- isTSTypeOperator()
- isTSTypeParameter()
- isTSTypeParameterDeclaration()
- isTSTypeParameterInstantiation()
- isTSTypePredicate()
- isTSTypeQuery()
- isTSTypeReference()
- isTSUndefinedKeyword()
- isTSUnionType()
- isTSUnknownKeyword()
- isTSVoidKeyword()
- isTupleTypeAnnotation()
- isTypeAlias()
- isTypeAnnotation()
- isTypeCastExpression()
- isTypeofTypeAnnotation()
- isTypeParameter()
- isTypeParameterDeclaration()
- isTypeParameterInstantiation()
- isUnaryExpression()
- isUnaryLike()
- isUnionTypeAnnotation()
- isUpdateExpression()
- isUser()
- isUserWhitespacable()
- isVar()
- isVariableDeclaration()
- isVariableDeclarator()
- isVariance()
- isVoidTypeAnnotation()
- isWhile()
- isWhileStatement()
- isWithStatement()
- isYieldExpression()
- key
- listKey
- matchesPattern()
- node
- opts
- parent
- parentKey
- parentPath
- popContext()
- pushContainer()
- 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
- unshiftContainer()
- updateSiblingKeys()
- visit()
- willIMaybeExecuteBefore()
Scope
- addGlobal()
- bindingIdentifierEquals()
- bindings
- block
- buildUndefinedNode()
- checkBlockScopedCollisions()
- crawl()
- 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
Type Aliases
Namespaces
Variables
variable traverse
const traverse: { <S>( parent: Node | Node[] | null | undefined, opts: TraverseOptions<S>, scope: Scope | undefined, state: S, parentPath?: NodePath ): void; ( parent: Node | Node[] | null | undefined, opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath ): void; visitors: typeof visitors; verify: typeof visitors.verify; explode: typeof visitors.explode;};
Classes
class Binding
class Binding {}
constructor
constructor(opts: { identifier: t.Identifier; scope: Scope; path: NodePath; kind: BindingKind;});
property constant
constant: boolean;
property constantViolations
constantViolations: NodePath<Node>[];
property hasDeoptedValue
hasDeoptedValue?: boolean;
property hasValue
hasValue?: boolean;
property identifier
identifier: t.Identifier;
property kind
kind: BindingKind;
property path
path: NodePath<Node>;
property referenced
referenced: boolean;
property referencePaths
referencePaths: NodePath<Node>[];
property references
references: number;
property scope
scope: Scope;
property value
value?: any;
method clearValue
clearValue: () => void;
method deopValue
deopValue: () => void;
method dereference
dereference: () => void;
method reassign
reassign: (path: NodePath) => void;
method reference
reference: (path: NodePath) => void;
method setValue
setValue: (value: any) => void;
class Hub
class Hub implements HubInterface {}
constructor
constructor();
method addHelper
addHelper: (name: string) => any;
method buildError
buildError: <E extends Error>( node: Node, msg: string, Constructor: new (message?: string) => E) => E;
method getCode
getCode: () => string | undefined;
method getScope
getScope: () => Scope | undefined;
class NodePath
class NodePath<T = Node> {}
constructor
constructor(hub: Hub, parent: 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: Node;
property parentKey
parentKey: string;
property parentPath
parentPath: NodePath<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: {};
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: (props?: object | null) => void;
method assertArrayExpression
assertArrayExpression: (props?: object | null) => void;
method assertArrayPattern
assertArrayPattern: (props?: object | null) => void;
method assertArrayTypeAnnotation
assertArrayTypeAnnotation: (props?: object | null) => void;
method assertArrowFunctionExpression
assertArrowFunctionExpression: (props?: object | null) => void;
method assertAssignmentExpression
assertAssignmentExpression: (props?: object | null) => void;
method assertAssignmentPattern
assertAssignmentPattern: (props?: object | null) => void;
method assertAwaitExpression
assertAwaitExpression: (props?: object | null) => void;
method assertBigIntLiteral
assertBigIntLiteral: (props?: object | null) => void;
method assertBinary
assertBinary: (props?: object | null) => void;
method assertBinaryExpression
assertBinaryExpression: (props?: object | null) => void;
method assertBindExpression
assertBindExpression: (props?: object | null) => void;
method assertBindingIdentifier
assertBindingIdentifier: (props?: object | null) => void;
method assertBlock
assertBlock: (props?: object | null) => void;
method assertBlockParent
assertBlockParent: (props?: object | null) => void;
method assertBlockScoped
assertBlockScoped: (props?: object | null) => void;
method assertBlockStatement
assertBlockStatement: (props?: object | null) => void;
method assertBooleanLiteral
assertBooleanLiteral: (props?: object | null) => void;
method assertBooleanLiteralTypeAnnotation
assertBooleanLiteralTypeAnnotation: (props?: object | null) => void;
method assertBooleanTypeAnnotation
assertBooleanTypeAnnotation: (props?: object | null) => void;
method assertBreakStatement
assertBreakStatement: (props?: object | null) => void;
method assertCallExpression
assertCallExpression: (props?: object | null) => void;
method assertCatchClause
assertCatchClause: (props?: object | null) => void;
method assertClass
assertClass: (props?: object | null) => void;
method assertClassBody
assertClassBody: (props?: object | null) => void;
method assertClassDeclaration
assertClassDeclaration: (props?: object | null) => void;
method assertClassExpression
assertClassExpression: (props?: object | null) => void;
method assertClassImplements
assertClassImplements: (props?: object | null) => void;
method assertClassMethod
assertClassMethod: (props?: object | null) => void;
method assertClassPrivateMethod
assertClassPrivateMethod: (props?: object | null) => void;
method assertClassPrivateProperty
assertClassPrivateProperty: (props?: object | null) => void;
method assertClassProperty
assertClassProperty: (props?: object | null) => void;
method assertCompletionStatement
assertCompletionStatement: (props?: object | null) => void;
method assertConditional
assertConditional: (props?: object | null) => void;
method assertConditionalExpression
assertConditionalExpression: (props?: object | null) => void;
method assertContinueStatement
assertContinueStatement: (props?: object | null) => void;
method assertDebuggerStatement
assertDebuggerStatement: (props?: object | null) => void;
method assertDeclaration
assertDeclaration: (props?: object | null) => void;
method assertDeclareClass
assertDeclareClass: (props?: object | null) => void;
method assertDeclaredPredicate
assertDeclaredPredicate: (props?: object | null) => void;
method assertDeclareExportAllDeclaration
assertDeclareExportAllDeclaration: (props?: object | null) => void;
method assertDeclareExportDeclaration
assertDeclareExportDeclaration: (props?: object | null) => void;
method assertDeclareFunction
assertDeclareFunction: (props?: object | null) => void;
method assertDeclareInterface
assertDeclareInterface: (props?: object | null) => void;
method assertDeclareModule
assertDeclareModule: (props?: object | null) => void;
method assertDeclareModuleExports
assertDeclareModuleExports: (props?: object | null) => void;
method assertDeclareOpaqueType
assertDeclareOpaqueType: (props?: object | null) => void;
method assertDeclareTypeAlias
assertDeclareTypeAlias: (props?: object | null) => void;
method assertDeclareVariable
assertDeclareVariable: (props?: object | null) => void;
method assertDecorator
assertDecorator: (props?: object | null) => void;
method assertDirective
assertDirective: (props?: object | null) => void;
method assertDirectiveLiteral
assertDirectiveLiteral: (props?: object | null) => void;
method assertDoExpression
assertDoExpression: (props?: object | null) => void;
method assertDoWhileStatement
assertDoWhileStatement: (props?: object | null) => void;
method assertEmptyStatement
assertEmptyStatement: (props?: object | null) => void;
method assertEmptyTypeAnnotation
assertEmptyTypeAnnotation: (props?: object | null) => void;
method assertExistsTypeAnnotation
assertExistsTypeAnnotation: (props?: object | null) => void;
method assertExportAllDeclaration
assertExportAllDeclaration: (props?: object | null) => void;
method assertExportDeclaration
assertExportDeclaration: (props?: object | null) => void;
method assertExportDefaultDeclaration
assertExportDefaultDeclaration: (props?: object | null) => void;
method assertExportDefaultSpecifier
assertExportDefaultSpecifier: (props?: object | null) => void;
method assertExportNamedDeclaration
assertExportNamedDeclaration: (props?: object | null) => void;
method assertExportNamespaceSpecifier
assertExportNamespaceSpecifier: (props?: object | null) => void;
method assertExportSpecifier
assertExportSpecifier: (props?: object | null) => void;
method assertExpression
assertExpression: (props?: object | null) => void;
method assertExpressionStatement
assertExpressionStatement: (props?: object | null) => void;
method assertExpressionWrapper
assertExpressionWrapper: (props?: object | null) => void;
method assertFile
assertFile: (props?: object | null) => void;
method assertFlow
assertFlow: (props?: object | null) => void;
method assertFlowBaseAnnotation
assertFlowBaseAnnotation: (props?: object | null) => void;
method assertFlowDeclaration
assertFlowDeclaration: (props?: object | null) => void;
method assertFlowPredicate
assertFlowPredicate: (props?: object | null) => void;
method assertFlowType
assertFlowType: (props?: object | null) => void;
method assertFor
assertFor: (props?: object | null) => void;
method assertForInStatement
assertForInStatement: (props?: object | null) => void;
method assertForOfStatement
assertForOfStatement: (props?: object | null) => void;
method assertForStatement
assertForStatement: (props?: object | null) => void;
method assertForXStatement
assertForXStatement: (props?: object | null) => void;
method assertFunction
assertFunction: (props?: object | null) => void;
method assertFunctionDeclaration
assertFunctionDeclaration: (props?: object | null) => void;
method assertFunctionExpression
assertFunctionExpression: (props?: object | null) => void;
method assertFunctionParent
assertFunctionParent: (props?: object | null) => void;
method assertFunctionTypeAnnotation
assertFunctionTypeAnnotation: (props?: object | null) => void;
method assertFunctionTypeParam
assertFunctionTypeParam: (props?: object | null) => void;
method assertGenerated
assertGenerated: (props?: object | null) => void;
method assertGenericTypeAnnotation
assertGenericTypeAnnotation: (props?: object | null) => void;
method assertIdentifier
assertIdentifier: (props?: object | null) => void;
method assertIfStatement
assertIfStatement: (props?: object | null) => void;
method assertImmutable
assertImmutable: (props?: object | null) => void;
method assertImport
assertImport: (props?: object | null) => void;
method assertImportDeclaration
assertImportDeclaration: (props?: object | null) => void;
method assertImportDefaultSpecifier
assertImportDefaultSpecifier: (props?: object | null) => void;
method assertImportNamespaceSpecifier
assertImportNamespaceSpecifier: (props?: object | null) => void;
method assertImportSpecifier
assertImportSpecifier: (props?: object | null) => void;
method assertInferredPredicate
assertInferredPredicate: (props?: object | null) => void;
method assertInterfaceDeclaration
assertInterfaceDeclaration: (props?: object | null) => void;
method assertInterfaceExtends
assertInterfaceExtends: (props?: object | null) => void;
method assertInterfaceTypeAnnotation
assertInterfaceTypeAnnotation: (props?: object | null) => void;
method assertInterpreterDirective
assertInterpreterDirective: (props?: object | null) => void;
method assertIntersectionTypeAnnotation
assertIntersectionTypeAnnotation: (props?: object | null) => void;
method assertJSX
assertJSX: (props?: object | null) => void;
method assertJSXAttribute
assertJSXAttribute: (props?: object | null) => void;
method assertJSXClosingElement
assertJSXClosingElement: (props?: object | null) => void;
method assertJSXClosingFragment
assertJSXClosingFragment: (props?: object | null) => void;
method assertJSXElement
assertJSXElement: (props?: object | null) => void;
method assertJSXEmptyExpression
assertJSXEmptyExpression: (props?: object | null) => void;
method assertJSXExpressionContainer
assertJSXExpressionContainer: (props?: object | null) => void;
method assertJSXFragment
assertJSXFragment: (props?: object | null) => void;
method assertJSXIdentifier
assertJSXIdentifier: (props?: object | null) => void;
method assertJSXMemberExpression
assertJSXMemberExpression: (props?: object | null) => void;
method assertJSXNamespacedName
assertJSXNamespacedName: (props?: object | null) => void;
method assertJSXOpeningElement
assertJSXOpeningElement: (props?: object | null) => void;
method assertJSXOpeningFragment
assertJSXOpeningFragment: (props?: object | null) => void;
method assertJSXSpreadAttribute
assertJSXSpreadAttribute: (props?: object | null) => void;
method assertJSXSpreadChild
assertJSXSpreadChild: (props?: object | null) => void;
method assertJSXText
assertJSXText: (props?: object | null) => void;
method assertLabeledStatement
assertLabeledStatement: (props?: object | null) => void;
method assertLiteral
assertLiteral: (props?: object | null) => void;
method assertLogicalExpression
assertLogicalExpression: (props?: object | null) => void;
method assertLoop
assertLoop: (props?: object | null) => void;
method assertLVal
assertLVal: (props?: object | null) => void;
method assertMemberExpression
assertMemberExpression: (props?: object | null) => void;
method assertMetaProperty
assertMetaProperty: (props?: object | null) => void;
method assertMethod
assertMethod: (props?: object | null) => void;
method assertMixedTypeAnnotation
assertMixedTypeAnnotation: (props?: object | null) => void;
method assertModuleDeclaration
assertModuleDeclaration: (props?: object | null) => void;
method assertModuleSpecifier
assertModuleSpecifier: (props?: object | null) => void;
method assertNewExpression
assertNewExpression: (props?: object | null) => void;
method assertNoop
assertNoop: (props?: object | null) => void;
method assertNullableTypeAnnotation
assertNullableTypeAnnotation: (props?: object | null) => void;
method assertNullLiteral
assertNullLiteral: (props?: object | null) => void;
method assertNullLiteralTypeAnnotation
assertNullLiteralTypeAnnotation: (props?: object | null) => void;
method assertNumberLiteral
assertNumberLiteral: (props?: object | null) => void;
Deprecated
Use
assertNumericLiteral
method assertNumberLiteralTypeAnnotation
assertNumberLiteralTypeAnnotation: (props?: object | null) => void;
method assertNumberTypeAnnotation
assertNumberTypeAnnotation: (props?: object | null) => void;
method assertNumericLiteral
assertNumericLiteral: (props?: object | null) => void;
method assertObjectExpression
assertObjectExpression: (props?: object | null) => void;
method assertObjectMember
assertObjectMember: (props?: object | null) => void;
method assertObjectMethod
assertObjectMethod: (props?: object | null) => void;
method assertObjectPattern
assertObjectPattern: (props?: object | null) => void;
method assertObjectProperty
assertObjectProperty: (props?: object | null) => void;
method assertObjectTypeAnnotation
assertObjectTypeAnnotation: (props?: object | null) => void;
method assertObjectTypeCallProperty
assertObjectTypeCallProperty: (props?: object | null) => void;
method assertObjectTypeIndexer
assertObjectTypeIndexer: (props?: object | null) => void;
method assertObjectTypeInternalSlot
assertObjectTypeInternalSlot: (props?: object | null) => void;
method assertObjectTypeProperty
assertObjectTypeProperty: (props?: object | null) => void;
method assertObjectTypeSpreadProperty
assertObjectTypeSpreadProperty: (props?: object | null) => void;
method assertOpaqueType
assertOpaqueType: (props?: object | null) => void;
method assertOptionalCallExpression
assertOptionalCallExpression: (props?: object | null) => void;
method assertOptionalMemberExpression
assertOptionalMemberExpression: (props?: object | null) => void;
method assertParenthesizedExpression
assertParenthesizedExpression: (props?: object | null) => void;
method assertPattern
assertPattern: (props?: object | null) => void;
method assertPatternLike
assertPatternLike: (props?: object | null) => void;
method assertPipelineBareFunction
assertPipelineBareFunction: (props?: object | null) => void;
method assertPipelinePrimaryTopicReference
assertPipelinePrimaryTopicReference: (props?: object | null) => void;
method assertPipelineTopicExpression
assertPipelineTopicExpression: (props?: object | null) => void;
method assertPrivate
assertPrivate: (props?: object | null) => void;
method assertPrivateName
assertPrivateName: (props?: object | null) => void;
method assertProgram
assertProgram: (props?: object | null) => void;
method assertProperty
assertProperty: (props?: object | null) => void;
method assertPure
assertPure: (props?: object | null) => void;
method assertPureish
assertPureish: (props?: object | null) => void;
method assertQualifiedTypeIdentifier
assertQualifiedTypeIdentifier: (props?: object | null) => void;
method assertReferenced
assertReferenced: (props?: object | null) => void;
method assertReferencedIdentifier
assertReferencedIdentifier: (props?: object | null) => void;
method assertReferencedMemberExpression
assertReferencedMemberExpression: (props?: object | null) => void;
method assertRegexLiteral
assertRegexLiteral: (props?: object | null) => void;
Deprecated
Use
assertRegExpLiteral
method assertRegExpLiteral
assertRegExpLiteral: (props?: object | null) => void;
method assertRestElement
assertRestElement: (props?: object | null) => void;
method assertRestProperty
assertRestProperty: (props?: object | null) => void;
Deprecated
Use
assertRestElement
method assertReturnStatement
assertReturnStatement: (props?: object | null) => void;
method assertScopable
assertScopable: (props?: object | null) => void;
method assertScope
assertScope: (props?: object | null) => void;
method assertSequenceExpression
assertSequenceExpression: (props?: object | null) => void;
method assertSpreadElement
assertSpreadElement: (props?: object | null) => void;
method assertSpreadProperty
assertSpreadProperty: (props?: object | null) => void;
Deprecated
Use
assertSpreadElement
method assertStatement
assertStatement: (props?: object | null) => void;
method assertStringLiteral
assertStringLiteral: (props?: object | null) => void;
method assertStringLiteralTypeAnnotation
assertStringLiteralTypeAnnotation: (props?: object | null) => void;
method assertStringTypeAnnotation
assertStringTypeAnnotation: (props?: object | null) => void;
method assertSuper
assertSuper: (props?: object | null) => void;
method assertSwitchCase
assertSwitchCase: (props?: object | null) => void;
method assertSwitchStatement
assertSwitchStatement: (props?: object | null) => void;
method assertTaggedTemplateExpression
assertTaggedTemplateExpression: (props?: object | null) => void;
method assertTemplateElement
assertTemplateElement: (props?: object | null) => void;
method assertTemplateLiteral
assertTemplateLiteral: (props?: object | null) => void;
method assertTerminatorless
assertTerminatorless: (props?: object | null) => void;
method assertThisExpression
assertThisExpression: (props?: object | null) => void;
method assertThisTypeAnnotation
assertThisTypeAnnotation: (props?: object | null) => void;
method assertThrowStatement
assertThrowStatement: (props?: object | null) => void;
method assertTryStatement
assertTryStatement: (props?: object | null) => void;
method assertTSAnyKeyword
assertTSAnyKeyword: (props?: object | null) => void;
method assertTSArrayType
assertTSArrayType: (props?: object | null) => void;
method assertTSAsExpression
assertTSAsExpression: (props?: object | null) => void;
method assertTSBooleanKeyword
assertTSBooleanKeyword: (props?: object | null) => void;
method assertTSCallSignatureDeclaration
assertTSCallSignatureDeclaration: (props?: object | null) => void;
method assertTSConditionalType
assertTSConditionalType: (props?: object | null) => void;
method assertTSConstructorType
assertTSConstructorType: (props?: object | null) => void;
method assertTSConstructSignatureDeclaration
assertTSConstructSignatureDeclaration: (props?: object | null) => void;
method assertTSDeclareFunction
assertTSDeclareFunction: (props?: object | null) => void;
method assertTSDeclareMethod
assertTSDeclareMethod: (props?: object | null) => void;
method assertTSEntityName
assertTSEntityName: (props?: object | null) => void;
method assertTSEnumDeclaration
assertTSEnumDeclaration: (props?: object | null) => void;
method assertTSEnumMember
assertTSEnumMember: (props?: object | null) => void;
method assertTSExportAssignment
assertTSExportAssignment: (props?: object | null) => void;
method assertTSExpressionWithTypeArguments
assertTSExpressionWithTypeArguments: (props?: object | null) => void;
method assertTSExternalModuleReference
assertTSExternalModuleReference: (props?: object | null) => void;
method assertTSFunctionType
assertTSFunctionType: (props?: object | null) => void;
method assertTSImportEqualsDeclaration
assertTSImportEqualsDeclaration: (props?: object | null) => void;
method assertTSImportType
assertTSImportType: (props?: object | null) => void;
method assertTSIndexedAccessType
assertTSIndexedAccessType: (props?: object | null) => void;
method assertTSIndexSignature
assertTSIndexSignature: (props?: object | null) => void;
method assertTSInferType
assertTSInferType: (props?: object | null) => void;
method assertTSInterfaceBody
assertTSInterfaceBody: (props?: object | null) => void;
method assertTSInterfaceDeclaration
assertTSInterfaceDeclaration: (props?: object | null) => void;
method assertTSIntersectionType
assertTSIntersectionType: (props?: object | null) => void;
method assertTSLiteralType
assertTSLiteralType: (props?: object | null) => void;
method assertTSMappedType
assertTSMappedType: (props?: object | null) => void;
method assertTSMethodSignature
assertTSMethodSignature: (props?: object | null) => void;
method assertTSModuleBlock
assertTSModuleBlock: (props?: object | null) => void;
method assertTSModuleDeclaration
assertTSModuleDeclaration: (props?: object | null) => void;
method assertTSNamespaceExportDeclaration
assertTSNamespaceExportDeclaration: (props?: object | null) => void;
method assertTSNeverKeyword
assertTSNeverKeyword: (props?: object | null) => void;
method assertTSNonNullExpression
assertTSNonNullExpression: (props?: object | null) => void;
method assertTSNullKeyword
assertTSNullKeyword: (props?: object | null) => void;
method assertTSNumberKeyword
assertTSNumberKeyword: (props?: object | null) => void;
method assertTSObjectKeyword
assertTSObjectKeyword: (props?: object | null) => void;
method assertTSOptionalType
assertTSOptionalType: (props?: object | null) => void;
method assertTSParameterProperty
assertTSParameterProperty: (props?: object | null) => void;
method assertTSParenthesizedType
assertTSParenthesizedType: (props?: object | null) => void;
method assertTSPropertySignature
assertTSPropertySignature: (props?: object | null) => void;
method assertTSQualifiedName
assertTSQualifiedName: (props?: object | null) => void;
method assertTSRestType
assertTSRestType: (props?: object | null) => void;
method assertTSStringKeyword
assertTSStringKeyword: (props?: object | null) => void;
method assertTSSymbolKeyword
assertTSSymbolKeyword: (props?: object | null) => void;
method assertTSThisType
assertTSThisType: (props?: object | null) => void;
method assertTSTupleType
assertTSTupleType: (props?: object | null) => void;
method assertTSType
assertTSType: (props?: object | null) => void;
method assertTSTypeAliasDeclaration
assertTSTypeAliasDeclaration: (props?: object | null) => void;
method assertTSTypeAnnotation
assertTSTypeAnnotation: (props?: object | null) => void;
method assertTSTypeAssertion
assertTSTypeAssertion: (props?: object | null) => void;
method assertTSTypeElement
assertTSTypeElement: (props?: object | null) => void;
method assertTSTypeLiteral
assertTSTypeLiteral: (props?: object | null) => void;
method assertTSTypeOperator
assertTSTypeOperator: (props?: object | null) => void;
method assertTSTypeParameter
assertTSTypeParameter: (props?: object | null) => void;
method assertTSTypeParameterDeclaration
assertTSTypeParameterDeclaration: (props?: object | null) => void;
method assertTSTypeParameterInstantiation
assertTSTypeParameterInstantiation: (props?: object | null) => void;
method assertTSTypePredicate
assertTSTypePredicate: (props?: object | null) => void;
method assertTSTypeQuery
assertTSTypeQuery: (props?: object | null) => void;
method assertTSTypeReference
assertTSTypeReference: (props?: object | null) => void;
method assertTSUndefinedKeyword
assertTSUndefinedKeyword: (props?: object | null) => void;
method assertTSUnionType
assertTSUnionType: (props?: object | null) => void;
method assertTSUnknownKeyword
assertTSUnknownKeyword: (props?: object | null) => void;
method assertTSVoidKeyword
assertTSVoidKeyword: (props?: object | null) => void;
method assertTupleTypeAnnotation
assertTupleTypeAnnotation: (props?: object | null) => void;
method assertTypeAlias
assertTypeAlias: (props?: object | null) => void;
method assertTypeAnnotation
assertTypeAnnotation: (props?: object | null) => void;
method assertTypeCastExpression
assertTypeCastExpression: (props?: object | null) => void;
method assertTypeofTypeAnnotation
assertTypeofTypeAnnotation: (props?: object | null) => void;
method assertTypeParameter
assertTypeParameter: (props?: object | null) => void;
method assertTypeParameterDeclaration
assertTypeParameterDeclaration: (props?: object | null) => void;
method assertTypeParameterInstantiation
assertTypeParameterInstantiation: (props?: object | null) => void;
method assertUnaryExpression
assertUnaryExpression: (props?: object | null) => void;
method assertUnaryLike
assertUnaryLike: (props?: object | null) => void;
method assertUnionTypeAnnotation
assertUnionTypeAnnotation: (props?: object | null) => void;
method assertUpdateExpression
assertUpdateExpression: (props?: object | null) => void;
method assertUser
assertUser: (props?: object | null) => void;
method assertUserWhitespacable
assertUserWhitespacable: (props?: object | null) => void;
method assertVar
assertVar: (props?: object | null) => void;
method assertVariableDeclaration
assertVariableDeclaration: (props?: object | null) => void;
method assertVariableDeclarator
assertVariableDeclarator: (props?: object | null) => void;
method assertVariance
assertVariance: (props?: object | null) => void;
method assertVoidTypeAnnotation
assertVoidTypeAnnotation: (props?: object | null) => void;
method assertWhile
assertWhile: (props?: object | null) => void;
method assertWhileStatement
assertWhileStatement: (props?: object | null) => void;
method assertWithStatement
assertWithStatement: (props?: object | null) => void;
method assertYieldExpression
assertYieldExpression: (props?: object | null) => 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: 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 | null;
Starting at current
NodePath
and going up the tree, return the firstNodePath
that causes the providedcallback
to return a truthy value, ornull
if thecallback
never returns a truthy value.
method findParent
findParent: (callback: (path: NodePath) => boolean) => NodePath | null;
Starting at the parent path of the current
NodePath
and going up the tree, return the firstNodePath
that causes the providedcallback
to return a truthy value, ornull
if thecallback
never returns a truthy value.
method get
static get: <C extends Node, K extends keyof C>(opts: { hub: HubInterface; parentPath: NodePath | null; parent: Node; container: C; listKey?: string | undefined; key: K;}) => NodePath<C[K]>;
method getAllNextSiblings
getAllNextSiblings: () => NodePath[];
method getAllPrevSiblings
getAllPrevSiblings: () => NodePath[];
method getAncestry
getAncestry: () => [this, ...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 getBindingIdentifierPaths
getBindingIdentifierPaths: { (duplicates: true, outerOnly?: boolean): Record< string, Array<NodePath<t.Identifier>> >; (duplicates?: false, outerOnly?: boolean): Record< string, NodePath<t.Identifier> >; (duplicates?: boolean, outerOnly?: boolean): Record< string, NodePath<t.Identifier> | NodePath<t.Identifier>[] >;};
method getBindingIdentifiers
getBindingIdentifiers: { (duplicates: true): Record<string, t.Identifier[]>; (duplicates?: false): Record<string, t.Identifier>; (duplicates?: boolean): Record<string, any>;};
method getCompletionRecords
getCompletionRecords: () => NodePath[];
method getData
getData: (key: string, def?: any) => any;
method getDeepestCommonAncestorFrom
getDeepestCommonAncestorFrom: ( paths: NodePath[], filter?: (deepest: 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> | null;
Get the parent function of the current path.
method getNextSibling
getNextSibling: () => NodePath;
method getOpposite
getOpposite: () => NodePath;
method getOuterBindingIdentifierPaths
getOuterBindingIdentifierPaths: { (duplicates: true): Record<string, Array<NodePath<t.Identifier>>>; (duplicates?: false): Record<string, NodePath<t.Identifier>>; (duplicates?: boolean, outerOnly?: boolean): Record< string, NodePath<t.Identifier> | NodePath<t.Identifier>[] >;};
method getOuterBindingIdentifiers
getOuterBindingIdentifiers: { (duplicates: true): Record<string, t.Identifier[]>; (duplicates?: false): Record<string, t.Identifier>; (duplicates?: boolean): Record<string, any>;};
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> | null;
Walk up the tree until we hit a parent node path in a list.
method getTypeAnnotation
getTypeAnnotation: () => t.FlowType;
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 hasNode
hasNode: () => this is NodePath<NonNullable<this['node']>>;
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 extends unknown>(nodes: Nodes) => NodePaths<Nodes>;
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 extends unknown>(nodes: Nodes) => NodePaths<Nodes>;
Insert the provided nodes before the current one.
method inType
inType: (...candidateTypes: string[]) => boolean;
method is
is: (key: string) => boolean;
Alias of
has
.
method isAncestor
isAncestor: (maybeDescendant: NodePath) => boolean;
A helper to find if
this
path is an ancestor ofmaybeDescendant
method isAnyTypeAnnotation
isAnyTypeAnnotation: ( props?: object | null) => this is NodePath<t.AnyTypeAnnotation>;
method isArrayExpression
isArrayExpression: ( props?: object | null) => this is NodePath<t.ArrayExpression>;
method isArrayPattern
isArrayPattern: (props?: object | null) => this is NodePath<t.ArrayPattern>;
method isArrayTypeAnnotation
isArrayTypeAnnotation: ( props?: object | null) => this is NodePath<t.ArrayTypeAnnotation>;
method isArrowFunctionExpression
isArrowFunctionExpression: ( props?: object | null) => this is NodePath<t.ArrowFunctionExpression>;
method isAssignmentExpression
isAssignmentExpression: ( props?: object | null) => this is NodePath<t.AssignmentExpression>;
method isAssignmentPattern
isAssignmentPattern: ( props?: object | null) => this is NodePath<t.AssignmentPattern>;
method isAwaitExpression
isAwaitExpression: ( props?: object | null) => this is NodePath<t.AwaitExpression>;
method isBaseType
isBaseType: (baseName: string, soft?: boolean) => boolean;
method isBigIntLiteral
isBigIntLiteral: (props?: object | null) => this is NodePath<t.BigIntLiteral>;
method isBinary
isBinary: (props?: object | null) => this is NodePath<t.Binary>;
method isBinaryExpression
isBinaryExpression: ( props?: object | null) => this is NodePath<t.BinaryExpression>;
method isBindExpression
isBindExpression: (props?: object | null) => this is NodePath<t.BindExpression>;
method isBindingIdentifier
isBindingIdentifier: (props?: object | null) => this is NodePath<t.Identifier>;
method isBlacklisted
isBlacklisted: () => boolean;
method isBlock
isBlock: (props?: object | null) => this is NodePath<t.Block>;
method isBlockParent
isBlockParent: (props?: object | null) => this is NodePath<t.BlockParent>;
method isBlockScoped
isBlockScoped: (props?: object | null) => this is NodePath<any>;
method isBlockStatement
isBlockStatement: (props?: object | null) => this is NodePath<t.BlockStatement>;
method isBooleanLiteral
isBooleanLiteral: (props?: object | null) => this is NodePath<t.BooleanLiteral>;
method isBooleanLiteralTypeAnnotation
isBooleanLiteralTypeAnnotation: ( props?: object | null) => this is NodePath<t.BooleanLiteralTypeAnnotation>;
method isBooleanTypeAnnotation
isBooleanTypeAnnotation: ( props?: object | null) => this is NodePath<t.BooleanTypeAnnotation>;
method isBreakStatement
isBreakStatement: (props?: object | null) => this is NodePath<t.BreakStatement>;
method isCallExpression
isCallExpression: (props?: object | null) => this is NodePath<t.CallExpression>;
method isCatchClause
isCatchClause: (props?: object | null) => this is NodePath<t.CatchClause>;
method isClass
isClass: (props?: object | null) => this is NodePath<t.Class>;
method isClassBody
isClassBody: (props?: object | null) => this is NodePath<t.ClassBody>;
method isClassDeclaration
isClassDeclaration: ( props?: object | null) => this is NodePath<t.ClassDeclaration>;
method isClassExpression
isClassExpression: ( props?: object | null) => this is NodePath<t.ClassExpression>;
method isClassImplements
isClassImplements: ( props?: object | null) => this is NodePath<t.ClassImplements>;
method isClassMethod
isClassMethod: (props?: object | null) => this is NodePath<t.ClassMethod>;
method isClassPrivateMethod
isClassPrivateMethod: ( props?: object | null) => this is NodePath<t.ClassPrivateMethod>;
method isClassPrivateProperty
isClassPrivateProperty: ( props?: object | null) => this is NodePath<t.ClassPrivateProperty>;
method isClassProperty
isClassProperty: (props?: object | null) => this is NodePath<t.ClassProperty>;
method isCompletionRecord
isCompletionRecord: (allowInsideFunction?: boolean) => boolean;
Check whether the current path references a completion record
method isCompletionStatement
isCompletionStatement: ( props?: object | null) => this is NodePath<t.CompletionStatement>;
method isConditional
isConditional: (props?: object | null) => this is NodePath<t.Conditional>;
method isConditionalExpression
isConditionalExpression: ( props?: object | null) => this is NodePath<t.ConditionalExpression>;
method isContinueStatement
isContinueStatement: ( props?: object | null) => this is NodePath<t.ContinueStatement>;
method isDebuggerStatement
isDebuggerStatement: ( props?: object | null) => this is NodePath<t.DebuggerStatement>;
method isDeclaration
isDeclaration: (props?: object | null) => this is NodePath<t.Declaration>;
method isDeclareClass
isDeclareClass: (props?: object | null) => this is NodePath<t.DeclareClass>;
method isDeclaredPredicate
isDeclaredPredicate: ( props?: object | null) => this is NodePath<t.DeclaredPredicate>;
method isDeclareExportAllDeclaration
isDeclareExportAllDeclaration: ( props?: object | null) => this is NodePath<t.DeclareExportAllDeclaration>;
method isDeclareExportDeclaration
isDeclareExportDeclaration: ( props?: object | null) => this is NodePath<t.DeclareExportDeclaration>;
method isDeclareFunction
isDeclareFunction: ( props?: object | null) => this is NodePath<t.DeclareFunction>;
method isDeclareInterface
isDeclareInterface: ( props?: object | null) => this is NodePath<t.DeclareInterface>;
method isDeclareModule
isDeclareModule: (props?: object | null) => this is NodePath<t.DeclareModule>;
method isDeclareModuleExports
isDeclareModuleExports: ( props?: object | null) => this is NodePath<t.DeclareModuleExports>;
method isDeclareOpaqueType
isDeclareOpaqueType: ( props?: object | null) => this is NodePath<t.DeclareOpaqueType>;
method isDeclareTypeAlias
isDeclareTypeAlias: ( props?: object | null) => this is NodePath<t.DeclareTypeAlias>;
method isDeclareVariable
isDeclareVariable: ( props?: object | null) => this is NodePath<t.DeclareVariable>;
method isDecorator
isDecorator: (props?: object | null) => this is NodePath<t.Decorator>;
method isDescendant
isDescendant: (maybeAncestor: NodePath) => boolean;
A helper to find if
this
path is a descendant ofmaybeAncestor
method isDirective
isDirective: (props?: object | null) => this is NodePath<t.Directive>;
method isDirectiveLiteral
isDirectiveLiteral: ( props?: object | null) => this is NodePath<t.DirectiveLiteral>;
method isDoExpression
isDoExpression: (props?: object | null) => this is NodePath<t.DoExpression>;
method isDoWhileStatement
isDoWhileStatement: ( props?: object | null) => this is NodePath<t.DoWhileStatement>;
method isEmptyStatement
isEmptyStatement: (props?: object | null) => this is NodePath<t.EmptyStatement>;
method isEmptyTypeAnnotation
isEmptyTypeAnnotation: ( props?: object | null) => this is NodePath<t.EmptyTypeAnnotation>;
method isExistsTypeAnnotation
isExistsTypeAnnotation: ( props?: object | null) => this is NodePath<t.ExistsTypeAnnotation>;
method isExportAllDeclaration
isExportAllDeclaration: ( props?: object | null) => this is NodePath<t.ExportAllDeclaration>;
method isExportDeclaration
isExportDeclaration: ( props?: object | null) => this is NodePath<t.ExportDeclaration>;
method isExportDefaultDeclaration
isExportDefaultDeclaration: ( props?: object | null) => this is NodePath<t.ExportDefaultDeclaration>;
method isExportDefaultSpecifier
isExportDefaultSpecifier: ( props?: object | null) => this is NodePath<t.ExportDefaultSpecifier>;
method isExportNamedDeclaration
isExportNamedDeclaration: ( props?: object | null) => this is NodePath<t.ExportNamedDeclaration>;
method isExportNamespaceSpecifier
isExportNamespaceSpecifier: ( props?: object | null) => this is NodePath<t.ExportNamespaceSpecifier>;
method isExportSpecifier
isExportSpecifier: ( props?: object | null) => this is NodePath<t.ExportSpecifier>;
method isExpression
isExpression: (props?: object | null) => this is NodePath<t.Expression>;
method isExpressionStatement
isExpressionStatement: ( props?: object | null) => this is NodePath<t.ExpressionStatement>;
method isExpressionWrapper
isExpressionWrapper: ( props?: object | null) => this is NodePath<t.ExpressionWrapper>;
method isFile
isFile: (props?: object | null) => this is NodePath<t.File>;
method isFlow
isFlow: (props?: object | null) => this is NodePath<t.Flow>;
method isFlowBaseAnnotation
isFlowBaseAnnotation: ( props?: object | null) => this is NodePath<t.FlowBaseAnnotation>;
method isFlowDeclaration
isFlowDeclaration: ( props?: object | null) => this is NodePath<t.FlowDeclaration>;
method isFlowPredicate
isFlowPredicate: (props?: object | null) => this is NodePath<t.FlowPredicate>;
method isFlowType
isFlowType: (props?: object | null) => this is NodePath<t.FlowType>;
method isFor
isFor: (props?: object | null) => this is NodePath<t.For>;
method isForInStatement
isForInStatement: (props?: object | null) => this is NodePath<t.ForInStatement>;
method isForOfStatement
isForOfStatement: (props?: object | null) => this is NodePath<t.ForOfStatement>;
method isForStatement
isForStatement: (props?: object | null) => this is NodePath<t.ForStatement>;
method isForXStatement
isForXStatement: (props?: object | null) => this is NodePath<t.ForXStatement>;
method isFunction
isFunction: (props?: object | null) => this is NodePath<t.Function>;
method isFunctionDeclaration
isFunctionDeclaration: ( props?: object | null) => this is NodePath<t.FunctionDeclaration>;
method isFunctionExpression
isFunctionExpression: ( props?: object | null) => this is NodePath<t.FunctionExpression>;
method isFunctionParent
isFunctionParent: (props?: object | null) => this is NodePath<t.FunctionParent>;
method isFunctionTypeAnnotation
isFunctionTypeAnnotation: ( props?: object | null) => this is NodePath<t.FunctionTypeAnnotation>;
method isFunctionTypeParam
isFunctionTypeParam: ( props?: object | null) => this is NodePath<t.FunctionTypeParam>;
method isGenerated
isGenerated: (props?: object | null) => boolean;
method isGenericType
isGenericType: (genericName: string) => boolean;
method isGenericTypeAnnotation
isGenericTypeAnnotation: ( props?: object | null) => this is NodePath<t.GenericTypeAnnotation>;
method isIdentifier
isIdentifier: (props?: object | null) => this is NodePath<t.Identifier>;
method isIfStatement
isIfStatement: (props?: object | null) => this is NodePath<t.IfStatement>;
method isImmutable
isImmutable: (props?: object | null) => this is NodePath<t.Immutable>;
method isImport
isImport: (props?: object | null) => this is NodePath<t.Import>;
method isImportDeclaration
isImportDeclaration: ( props?: object | null) => this is NodePath<t.ImportDeclaration>;
method isImportDefaultSpecifier
isImportDefaultSpecifier: ( props?: object | null) => this is NodePath<t.ImportDefaultSpecifier>;
method isImportNamespaceSpecifier
isImportNamespaceSpecifier: ( props?: object | null) => this is NodePath<t.ImportNamespaceSpecifier>;
method isImportSpecifier
isImportSpecifier: ( props?: object | null) => this is NodePath<t.ImportSpecifier>;
method isInferredPredicate
isInferredPredicate: ( props?: object | null) => this is NodePath<t.InferredPredicate>;
method isInterfaceDeclaration
isInterfaceDeclaration: ( props?: object | null) => this is NodePath<t.InterfaceDeclaration>;
method isInterfaceExtends
isInterfaceExtends: ( props?: object | null) => this is NodePath<t.InterfaceExtends>;
method isInterfaceTypeAnnotation
isInterfaceTypeAnnotation: ( props?: object | null) => this is NodePath<t.InterfaceTypeAnnotation>;
method isInterpreterDirective
isInterpreterDirective: ( props?: object | null) => this is NodePath<t.InterpreterDirective>;
method isIntersectionTypeAnnotation
isIntersectionTypeAnnotation: ( props?: object | null) => this is NodePath<t.IntersectionTypeAnnotation>;
method isJSX
isJSX: (props?: object | null) => this is NodePath<t.JSX>;
method isJSXAttribute
isJSXAttribute: (props?: object | null) => this is NodePath<t.JSXAttribute>;
method isJSXClosingElement
isJSXClosingElement: ( props?: object | null) => this is NodePath<t.JSXClosingElement>;
method isJSXClosingFragment
isJSXClosingFragment: ( props?: object | null) => this is NodePath<t.JSXClosingFragment>;
method isJSXElement
isJSXElement: (props?: object | null) => this is NodePath<t.JSXElement>;
method isJSXEmptyExpression
isJSXEmptyExpression: ( props?: object | null) => this is NodePath<t.JSXEmptyExpression>;
method isJSXExpressionContainer
isJSXExpressionContainer: ( props?: object | null) => this is NodePath<t.JSXExpressionContainer>;
method isJSXFragment
isJSXFragment: (props?: object | null) => this is NodePath<t.JSXFragment>;
method isJSXIdentifier
isJSXIdentifier: (props?: object | null) => this is NodePath<t.JSXIdentifier>;
method isJSXMemberExpression
isJSXMemberExpression: ( props?: object | null) => this is NodePath<t.JSXMemberExpression>;
method isJSXNamespacedName
isJSXNamespacedName: ( props?: object | null) => this is NodePath<t.JSXNamespacedName>;
method isJSXOpeningElement
isJSXOpeningElement: ( props?: object | null) => this is NodePath<t.JSXOpeningElement>;
method isJSXOpeningFragment
isJSXOpeningFragment: ( props?: object | null) => this is NodePath<t.JSXOpeningFragment>;
method isJSXSpreadAttribute
isJSXSpreadAttribute: ( props?: object | null) => this is NodePath<t.JSXSpreadAttribute>;
method isJSXSpreadChild
isJSXSpreadChild: (props?: object | null) => this is NodePath<t.JSXSpreadChild>;
method isJSXText
isJSXText: (props?: object | null) => this is NodePath<t.JSXText>;
method isLabeledStatement
isLabeledStatement: ( props?: object | null) => this is NodePath<t.LabeledStatement>;
method isLiteral
isLiteral: (props?: object | null) => this is NodePath<t.Literal>;
method isLogicalExpression
isLogicalExpression: ( props?: object | null) => this is NodePath<t.LogicalExpression>;
method isLoop
isLoop: (props?: object | null) => this is NodePath<t.