@types/babel__traverse
- Version 7.20.6
- Published
- 84.1 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()
- arrowFunctionToExpression()
- arrowFunctionToShadowed()
- assertAccessor()
- assertAnyTypeAnnotation()
- assertArgumentPlaceholder()
- assertArrayExpression()
- assertArrayPattern()
- assertArrayTypeAnnotation()
- assertArrowFunctionExpression()
- assertAssignmentExpression()
- assertAssignmentPattern()
- assertAwaitExpression()
- assertBigIntLiteral()
- assertBinary()
- assertBinaryExpression()
- assertBindExpression()
- assertBlock()
- assertBlockParent()
- assertBlockStatement()
- assertBooleanLiteral()
- assertBooleanLiteralTypeAnnotation()
- assertBooleanTypeAnnotation()
- assertBreakStatement()
- assertCallExpression()
- assertCatchClause()
- assertClass()
- assertClassAccessorProperty()
- assertClassBody()
- assertClassDeclaration()
- assertClassExpression()
- assertClassImplements()
- assertClassMethod()
- assertClassPrivateMethod()
- assertClassPrivateProperty()
- assertClassProperty()
- assertCompletionStatement()
- assertConditional()
- assertConditionalExpression()
- assertContinueStatement()
- assertDebuggerStatement()
- assertDecimalLiteral()
- assertDeclaration()
- assertDeclareClass()
- assertDeclaredPredicate()
- assertDeclareExportAllDeclaration()
- assertDeclareExportDeclaration()
- assertDeclareFunction()
- assertDeclareInterface()
- assertDeclareModule()
- assertDeclareModuleExports()
- assertDeclareOpaqueType()
- assertDeclareTypeAlias()
- assertDeclareVariable()
- assertDecorator()
- assertDirective()
- assertDirectiveLiteral()
- assertDoExpression()
- assertDoWhileStatement()
- assertEmptyStatement()
- assertEmptyTypeAnnotation()
- assertEnumBody()
- assertEnumBooleanBody()
- assertEnumBooleanMember()
- assertEnumDeclaration()
- assertEnumDefaultedMember()
- assertEnumMember()
- assertEnumNumberBody()
- assertEnumNumberMember()
- assertEnumStringBody()
- assertEnumStringMember()
- assertEnumSymbolBody()
- 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()
- assertGenericTypeAnnotation()
- assertIdentifier()
- assertIfStatement()
- assertImmutable()
- assertImport()
- assertImportAttribute()
- assertImportDeclaration()
- assertImportDefaultSpecifier()
- assertImportNamespaceSpecifier()
- assertImportSpecifier()
- assertIndexedAccessType()
- 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()
- assertMiscellaneous()
- assertMixedTypeAnnotation()
- assertModuleDeclaration()
- assertModuleExpression()
- assertModuleSpecifier()
- assertNewExpression()
- assertNoop()
- assertNullableTypeAnnotation()
- assertNullLiteral()
- assertNullLiteralTypeAnnotation()
- assertNumberLiteral()
- assertNumberLiteralTypeAnnotation()
- assertNumberTypeAnnotation()
- assertNumericLiteral()
- assertObjectExpression()
- assertObjectMember()
- assertObjectMethod()
- assertObjectPattern()
- assertObjectProperty()
- assertObjectTypeAnnotation()
- assertObjectTypeCallProperty()
- assertObjectTypeIndexer()
- assertObjectTypeInternalSlot()
- assertObjectTypeProperty()
- assertObjectTypeSpreadProperty()
- assertOpaqueType()
- assertOptionalCallExpression()
- assertOptionalIndexedAccessType()
- assertOptionalMemberExpression()
- assertParenthesizedExpression()
- assertPattern()
- assertPatternLike()
- assertPipelineBareFunction()
- assertPipelinePrimaryTopicReference()
- assertPipelineTopicExpression()
- assertPlaceholder()
- assertPrivate()
- assertPrivateName()
- assertProgram()
- assertProperty()
- assertPureish()
- assertQualifiedTypeIdentifier()
- assertRecordExpression()
- assertRegexLiteral()
- assertRegExpLiteral()
- assertRestElement()
- assertRestProperty()
- assertReturnStatement()
- assertScopable()
- assertSequenceExpression()
- assertSpreadElement()
- assertSpreadProperty()
- assertStandardized()
- assertStatement()
- assertStaticBlock()
- assertStringLiteral()
- assertStringLiteralTypeAnnotation()
- assertStringTypeAnnotation()
- assertSuper()
- assertSwitchCase()
- assertSwitchStatement()
- assertSymbolTypeAnnotation()
- assertTaggedTemplateExpression()
- assertTemplateElement()
- assertTemplateLiteral()
- assertTerminatorless()
- assertThisExpression()
- assertThisTypeAnnotation()
- assertThrowStatement()
- assertTopicReference()
- assertTryStatement()
- assertTSAnyKeyword()
- assertTSArrayType()
- assertTSAsExpression()
- assertTSBaseType()
- assertTSBigIntKeyword()
- assertTSBooleanKeyword()
- assertTSCallSignatureDeclaration()
- assertTSConditionalType()
- assertTSConstructorType()
- assertTSConstructSignatureDeclaration()
- assertTSDeclareFunction()
- assertTSDeclareMethod()
- assertTSEntityName()
- assertTSEnumDeclaration()
- assertTSEnumMember()
- assertTSExportAssignment()
- assertTSExpressionWithTypeArguments()
- assertTSExternalModuleReference()
- assertTSFunctionType()
- assertTSImportEqualsDeclaration()
- assertTSImportType()
- assertTSIndexedAccessType()
- assertTSIndexSignature()
- assertTSInferType()
- assertTSInstantiationExpression()
- assertTSInterfaceBody()
- assertTSInterfaceDeclaration()
- assertTSIntersectionType()
- assertTSIntrinsicKeyword()
- assertTSLiteralType()
- assertTSMappedType()
- assertTSMethodSignature()
- assertTSModuleBlock()
- assertTSModuleDeclaration()
- assertTSNamedTupleMember()
- assertTSNamespaceExportDeclaration()
- assertTSNeverKeyword()
- assertTSNonNullExpression()
- assertTSNullKeyword()
- assertTSNumberKeyword()
- assertTSObjectKeyword()
- assertTSOptionalType()
- assertTSParameterProperty()
- assertTSParenthesizedType()
- assertTSPropertySignature()
- assertTSQualifiedName()
- assertTSRestType()
- assertTSSatisfiesExpression()
- assertTSStringKeyword()
- assertTSSymbolKeyword()
- assertTSThisType()
- assertTSTupleType()
- assertTSType()
- assertTSTypeAliasDeclaration()
- assertTSTypeAnnotation()
- assertTSTypeAssertion()
- assertTSTypeElement()
- assertTSTypeLiteral()
- assertTSTypeOperator()
- assertTSTypeParameter()
- assertTSTypeParameterDeclaration()
- assertTSTypeParameterInstantiation()
- assertTSTypePredicate()
- assertTSTypeQuery()
- assertTSTypeReference()
- assertTSUndefinedKeyword()
- assertTSUnionType()
- assertTSUnknownKeyword()
- assertTSVoidKeyword()
- assertTupleExpression()
- assertTupleTypeAnnotation()
- assertTypeAlias()
- assertTypeAnnotation()
- assertTypeCastExpression()
- assertTypeofTypeAnnotation()
- assertTypeParameter()
- assertTypeParameterDeclaration()
- assertTypeParameterInstantiation()
- assertTypeScript()
- assertUnaryExpression()
- assertUnaryLike()
- assertUnionTypeAnnotation()
- assertUpdateExpression()
- assertUserWhitespacable()
- assertV8IntrinsicIdentifier()
- assertVariableDeclaration()
- assertVariableDeclarator()
- assertVariance()
- assertVoidTypeAnnotation()
- assertWhile()
- assertWhileStatement()
- assertWithStatement()
- assertYieldExpression()
- baseTypeStrictlyMatches()
- buildCodeFrameError()
- call()
- canHaveVariableDeclarationOrExpression()
- canSwapBetweenExpressionAndStatement()
- container
- context
- contexts
- couldBeBaseType()
- data
- debug()
- ensureBlock()
- 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()
- isAccessor()
- isAncestor()
- isAnyTypeAnnotation()
- isArgumentPlaceholder()
- 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()
- isClassAccessorProperty()
- isClassBody()
- isClassDeclaration()
- isClassExpression()
- isClassImplements()
- isClassMethod()
- isClassPrivateMethod()
- isClassPrivateProperty()
- isClassProperty()
- isCompletionRecord()
- isCompletionStatement()
- isConditional()
- isConditionalExpression()
- isConstantExpression()
- isContinueStatement()
- isDebuggerStatement()
- isDecimalLiteral()
- isDeclaration()
- isDeclareClass()
- isDeclaredPredicate()
- isDeclareExportAllDeclaration()
- isDeclareExportDeclaration()
- isDeclareFunction()
- isDeclareInterface()
- isDeclareModule()
- isDeclareModuleExports()
- isDeclareOpaqueType()
- isDeclareTypeAlias()
- isDeclareVariable()
- isDecorator()
- isDenylisted()
- isDescendant()
- isDirective()
- isDirectiveLiteral()
- isDoExpression()
- isDoWhileStatement()
- isEmptyStatement()
- isEmptyTypeAnnotation()
- isEnumBody()
- isEnumBooleanBody()
- isEnumBooleanMember()
- isEnumDeclaration()
- isEnumDefaultedMember()
- isEnumMember()
- isEnumNumberBody()
- isEnumNumberMember()
- isEnumStringBody()
- isEnumStringMember()
- isEnumSymbolBody()
- isExistentialTypeParam()
- isExistsTypeAnnotation()
- isExportAllDeclaration()
- isExportDeclaration()
- isExportDefaultDeclaration()
- isExportDefaultSpecifier()
- isExportNamedDeclaration()
- isExportNamespaceSpecifier()
- isExportSpecifier()
- isExpression()
- isExpressionStatement()
- isExpressionWrapper()
- isFile()
- isFlow()
- isFlowBaseAnnotation()
- isFlowDeclaration()
- isFlowPredicate()
- isFlowType()
- isFor()
- isForAwaitStatement()
- isForInStatement()
- isForOfStatement()
- isForStatement()
- isForXStatement()
- isFunction()
- isFunctionDeclaration()
- isFunctionExpression()
- isFunctionParent()
- isFunctionTypeAnnotation()
- isFunctionTypeParam()
- isGenerated()
- isGenericType()
- isGenericTypeAnnotation()
- isIdentifier()
- isIfStatement()
- isImmutable()
- isImport()
- isImportAttribute()
- isImportDeclaration()
- isImportDefaultSpecifier()
- isImportNamespaceSpecifier()
- isImportSpecifier()
- isIndexedAccessType()
- isInferredPredicate()
- isInStrictMode()
- 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()
- isMiscellaneous()
- isMixedTypeAnnotation()
- isModuleDeclaration()
- isModuleExpression()
- isModuleSpecifier()
- isNewExpression()
- isNodeType()
- isNoop()
- isnt()
- isNullableTypeAnnotation()
- isNullLiteral()
- isNullLiteralTypeAnnotation()
- isNumberLiteral()
- isNumberLiteralTypeAnnotation()
- isNumberTypeAnnotation()
- isNumericLiteral()
- isNumericLiteralTypeAnnotation()
- isObjectExpression()
- isObjectMember()
- isObjectMethod()
- isObjectPattern()
- isObjectProperty()
- isObjectTypeAnnotation()
- isObjectTypeCallProperty()
- isObjectTypeIndexer()
- isObjectTypeInternalSlot()
- isObjectTypeProperty()
- isObjectTypeSpreadProperty()
- isOpaqueType()
- isOptionalCallExpression()
- isOptionalIndexedAccessType()
- isOptionalMemberExpression()
- isParenthesizedExpression()
- isPattern()
- isPatternLike()
- isPipelineBareFunction()
- isPipelinePrimaryTopicReference()
- isPipelineTopicExpression()
- isPlaceholder()
- isPrivate()
- isPrivateName()
- isProgram()
- isProperty()
- isPure()
- isPureish()
- isQualifiedTypeIdentifier()
- isRecordExpression()
- isReferenced()
- isReferencedIdentifier()
- isReferencedMemberExpression()
- isRegexLiteral()
- isRegExpLiteral()
- isRestElement()
- isRestProperty()
- isReturnStatement()
- isScopable()
- isScope()
- isSequenceExpression()
- isSpreadElement()
- isSpreadProperty()
- isStandardized()
- isStatement()
- isStatementOrBlock()
- isStatic()
- isStaticBlock()
- isStringLiteral()
- isStringLiteralTypeAnnotation()
- isStringTypeAnnotation()
- isSuper()
- isSwitchCase()
- isSwitchStatement()
- isSymbolTypeAnnotation()
- isTaggedTemplateExpression()
- isTemplateElement()
- isTemplateLiteral()
- isTerminatorless()
- isThisExpression()
- isThisTypeAnnotation()
- isThrowStatement()
- isTopicReference()
- isTryStatement()
- isTSAnyKeyword()
- isTSArrayType()
- isTSAsExpression()
- isTSBaseType()
- isTSBigIntKeyword()
- isTSBooleanKeyword()
- isTSCallSignatureDeclaration()
- isTSConditionalType()
- isTSConstructorType()
- isTSConstructSignatureDeclaration()
- isTSDeclareFunction()
- isTSDeclareMethod()
- isTSEntityName()
- isTSEnumDeclaration()
- isTSEnumMember()
- isTSExportAssignment()
- isTSExpressionWithTypeArguments()
- isTSExternalModuleReference()
- isTSFunctionType()
- isTSImportEqualsDeclaration()
- isTSImportType()
- isTSIndexedAccessType()
- isTSIndexSignature()
- isTSInferType()
- isTSInstantiationExpression()
- isTSInterfaceBody()
- isTSInterfaceDeclaration()
- isTSIntersectionType()
- isTSIntrinsicKeyword()
- isTSLiteralType()
- isTSMappedType()
- isTSMethodSignature()
- isTSModuleBlock()
- isTSModuleDeclaration()
- isTSNamedTupleMember()
- isTSNamespaceExportDeclaration()
- isTSNeverKeyword()
- isTSNonNullExpression()
- isTSNullKeyword()
- isTSNumberKeyword()
- isTSObjectKeyword()
- isTSOptionalType()
- isTSParameterProperty()
- isTSParenthesizedType()
- isTSPropertySignature()
- isTSQualifiedName()
- isTSRestType()
- isTSSatisfiesExpression()
- isTSStringKeyword()
- isTSSymbolKeyword()
- isTSThisType()
- isTSTupleType()
- isTSType()
- isTSTypeAliasDeclaration()
- isTSTypeAnnotation()
- isTSTypeAssertion()
- isTSTypeElement()
- isTSTypeLiteral()
- isTSTypeOperator()
- isTSTypeParameter()
- isTSTypeParameterDeclaration()
- isTSTypeParameterInstantiation()
- isTSTypePredicate()
- isTSTypeQuery()
- isTSTypeReference()
- isTSUndefinedKeyword()
- isTSUnionType()
- isTSUnknownKeyword()
- isTSVoidKeyword()
- isTupleExpression()
- isTupleTypeAnnotation()
- isTypeAlias()
- isTypeAnnotation()
- isTypeCastExpression()
- isTypeofTypeAnnotation()
- isTypeParameter()
- isTypeParameterDeclaration()
- isTypeParameterInstantiation()
- isTypeScript()
- isUnaryExpression()
- isUnaryLike()
- isUnionTypeAnnotation()
- isUpdateExpression()
- isUser()
- isUserWhitespacable()
- isV8IntrinsicIdentifier()
- 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()
- requeue()
- resolve()
- resync()
- scope
- set()
- setContext()
- setData()
- setScope()
- shareCommentsWithSiblings()
- shouldSkip
- shouldStop
- skip()
- skipKey()
- skipKeys
- state
- stop()
- toComputedKey()
- traverse()
- type
- typeAnnotation
- unshiftContainer()
- unwrapFunctionEnvironment()
- updateSiblingKeys()
- visit()
- willIMaybeExecuteBefore()
Scope
- addGlobal()
- bindingIdentifierEquals()
- bindings
- block
- buildUndefinedNode()
- checkBlockScopedCollisions()
- contextVariables
- crawl()
- crawling
- data
- dump()
- generateDeclaredUidIdentifier()
- generateUid()
- generateUidIdentifier()
- generateUidIdentifierBasedOnNode()
- getAllBindings()
- getAllBindingsOfKind()
- getBinding()
- getBindingIdentifier()
- getBlockParent()
- getData()
- getFunctionParent()
- getLabel()
- getOwnBinding()
- getOwnBindingIdentifier()
- getPatternParent()
- getProgramParent()
- globals
- globals
- hasBinding()
- hasGlobal()
- hasLabel()
- hasOwnBinding()
- hasReference()
- hasUid()
- hub
- isPure()
- isStatic()
- labels
- maybeGenerateMemoised()
- moveBindingTo()
- parent
- parentBlock
- parentHasBinding()
- path
- push()
- references
- registerBinding()
- registerConstantViolation()
- registerDeclaration()
- registerLabel()
- removeBinding()
- removeData()
- removeOwnBinding()
- rename()
- setData()
- toArray()
- traverse()
- uid
- uids
Interfaces
Type Aliases
Namespaces
Variables
variable traverse
const traverse: { <S>( parent: Node, opts: TraverseOptions<S>, scope: Scope | undefined, state: S, parentPath?: NodePath ): void; ( parent: Node, opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath ): void; visitors: typeof visitors; verify: typeof visitors.verify; explode: typeof visitors.explode; cheap: (node: Node, enter: (node: Node) => void) => void; node: ( node: Node, opts: TraverseOptions, scope?: Scope, state?: any, path?: NodePath, skipKeys?: Record<string, boolean> ) => void; clearNode: (node: Node, opts?: RemovePropertiesOptions) => void; removeProperties: (tree: Node, opts?: RemovePropertiesOptions) => Node; hasType: (tree: Node, type: Node, denylistTypes?: string[]) => boolean; cache: typeof cache;};
Classes
class Binding
class Binding {}
This class is responsible for a binding inside of a scope.
It tracks the following:
* Node path. * Amount of times referenced by other nodes. * Paths to nodes that reassign or modify this binding. * The kind of binding. (Is it a parameter, declaration etc)
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;
Decrement the amount of references to this binding.
method reassign
reassign: (path: NodePath) => void;
Register a constant violation with the provided
path
.
method reference
reference: (path: NodePath) => void;
Increment the amount of references to this binding.
method setValue
setValue: (value: any) => void;
class Hub
class Hub implements HubInterface {}
constructor
constructor();
method addHelper
addHelper: (name: string) => any;
method buildError
buildError: (node: Node, msg: string, Error?: ErrorConstructor) => Error;
method getCode
getCode: () => string | undefined;
method getScope
getScope: () => Scope | undefined;
class NodePath
class NodePath<T = Node> {}
constructor
constructor(hub: HubInterface, parent: Node);
property container
container: any;
property context
context: TraversalContext<unknown>;
property contexts
contexts: TraversalContext<unknown>[];
property data
data: Record<string | symbol, unknown>;
property hub
hub: Hub;
property inList
inList: boolean;
property key
key: string | number;
property listKey
listKey: string;
property node
node: {};
property opts
opts: any;
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: Record<string, boolean>;
property state
state: any;
property type
type: {};
property typeAnnotation
typeAnnotation: {};
method addComment
addComment: ( type: t.CommentTypeShorthand, content: string, line?: boolean) => void;
method addComments
addComments: (type: t.CommentTypeShorthand, comments: t.Comment[]) => void;
Give node
comments
of the specifiedtype
.
method arrowFunctionToExpression
arrowFunctionToExpression: ({ allowInsertArrow, allowInsertArrowWithRest, specCompliant, noNewArrows,}?: { allowInsertArrow?: boolean; allowInsertArrowWithRest?: boolean; specCompliant?: boolean; noNewArrows?: boolean;}) => NodePath< Exclude<t.Function, t.Method | t.ArrowFunctionExpression> | t.CallExpression>;
Convert a given arrow function into a normal ES5 function expression.
method arrowFunctionToShadowed
arrowFunctionToShadowed: () => void;
Deprecated
Use
arrowFunctionToExpression
method assertAccessor
assertAccessor: (opts?: object) => asserts this is NodePath<t.Accessor>;
method assertAnyTypeAnnotation
assertAnyTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.AnyTypeAnnotation>;
method assertArgumentPlaceholder
assertArgumentPlaceholder: ( opts?: object) => asserts this is NodePath<t.ArgumentPlaceholder>;
method assertArrayExpression
assertArrayExpression: ( opts?: object) => asserts this is NodePath<t.ArrayExpression>;
method assertArrayPattern
assertArrayPattern: (opts?: object) => asserts this is NodePath<t.ArrayPattern>;
method assertArrayTypeAnnotation
assertArrayTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.ArrayTypeAnnotation>;
method assertArrowFunctionExpression
assertArrowFunctionExpression: ( opts?: object) => asserts this is NodePath<t.ArrowFunctionExpression>;
method assertAssignmentExpression
assertAssignmentExpression: ( opts?: object) => asserts this is NodePath<t.AssignmentExpression>;
method assertAssignmentPattern
assertAssignmentPattern: ( opts?: object) => asserts this is NodePath<t.AssignmentPattern>;
method assertAwaitExpression
assertAwaitExpression: ( opts?: object) => asserts this is NodePath<t.AwaitExpression>;
method assertBigIntLiteral
assertBigIntLiteral: ( opts?: object) => asserts this is NodePath<t.BigIntLiteral>;
method assertBinary
assertBinary: (opts?: object) => asserts this is NodePath<t.Binary>;
method assertBinaryExpression
assertBinaryExpression: ( opts?: object) => asserts this is NodePath<t.BinaryExpression>;
method assertBindExpression
assertBindExpression: ( opts?: object) => asserts this is NodePath<t.BindExpression>;
method assertBlock
assertBlock: (opts?: object) => asserts this is NodePath<t.Block>;
method assertBlockParent
assertBlockParent: (opts?: object) => asserts this is NodePath<t.BlockParent>;
method assertBlockStatement
assertBlockStatement: ( opts?: object) => asserts this is NodePath<t.BlockStatement>;
method assertBooleanLiteral
assertBooleanLiteral: ( opts?: object) => asserts this is NodePath<t.BooleanLiteral>;
method assertBooleanLiteralTypeAnnotation
assertBooleanLiteralTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.BooleanLiteralTypeAnnotation>;
method assertBooleanTypeAnnotation
assertBooleanTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.BooleanTypeAnnotation>;
method assertBreakStatement
assertBreakStatement: ( opts?: object) => asserts this is NodePath<t.BreakStatement>;
method assertCallExpression
assertCallExpression: ( opts?: object) => asserts this is NodePath<t.CallExpression>;
method assertCatchClause
assertCatchClause: (opts?: object) => asserts this is NodePath<t.CatchClause>;
method assertClass
assertClass: (opts?: object) => asserts this is NodePath<t.Class>;
method assertClassAccessorProperty
assertClassAccessorProperty: ( opts?: object) => asserts this is NodePath<t.ClassAccessorProperty>;
method assertClassBody
assertClassBody: (opts?: object) => asserts this is NodePath<t.ClassBody>;
method assertClassDeclaration
assertClassDeclaration: ( opts?: object) => asserts this is NodePath<t.ClassDeclaration>;
method assertClassExpression
assertClassExpression: ( opts?: object) => asserts this is NodePath<t.ClassExpression>;
method assertClassImplements
assertClassImplements: ( opts?: object) => asserts this is NodePath<t.ClassImplements>;
method assertClassMethod
assertClassMethod: (opts?: object) => asserts this is NodePath<t.ClassMethod>;
method assertClassPrivateMethod
assertClassPrivateMethod: ( opts?: object) => asserts this is NodePath<t.ClassPrivateMethod>;
method assertClassPrivateProperty
assertClassPrivateProperty: ( opts?: object) => asserts this is NodePath<t.ClassPrivateProperty>;
method assertClassProperty
assertClassProperty: ( opts?: object) => asserts this is NodePath<t.ClassProperty>;
method assertCompletionStatement
assertCompletionStatement: ( opts?: object) => asserts this is NodePath<t.CompletionStatement>;
method assertConditional
assertConditional: (opts?: object) => asserts this is NodePath<t.Conditional>;
method assertConditionalExpression
assertConditionalExpression: ( opts?: object) => asserts this is NodePath<t.ConditionalExpression>;
method assertContinueStatement
assertContinueStatement: ( opts?: object) => asserts this is NodePath<t.ContinueStatement>;
method assertDebuggerStatement
assertDebuggerStatement: ( opts?: object) => asserts this is NodePath<t.DebuggerStatement>;
method assertDecimalLiteral
assertDecimalLiteral: ( opts?: object) => asserts this is NodePath<t.DecimalLiteral>;
method assertDeclaration
assertDeclaration: (opts?: object) => asserts this is NodePath<t.Declaration>;
method assertDeclareClass
assertDeclareClass: (opts?: object) => asserts this is NodePath<t.DeclareClass>;
method assertDeclaredPredicate
assertDeclaredPredicate: ( opts?: object) => asserts this is NodePath<t.DeclaredPredicate>;
method assertDeclareExportAllDeclaration
assertDeclareExportAllDeclaration: ( opts?: object) => asserts this is NodePath<t.DeclareExportAllDeclaration>;
method assertDeclareExportDeclaration
assertDeclareExportDeclaration: ( opts?: object) => asserts this is NodePath<t.DeclareExportDeclaration>;
method assertDeclareFunction
assertDeclareFunction: ( opts?: object) => asserts this is NodePath<t.DeclareFunction>;
method assertDeclareInterface
assertDeclareInterface: ( opts?: object) => asserts this is NodePath<t.DeclareInterface>;
method assertDeclareModule
assertDeclareModule: ( opts?: object) => asserts this is NodePath<t.DeclareModule>;
method assertDeclareModuleExports
assertDeclareModuleExports: ( opts?: object) => asserts this is NodePath<t.DeclareModuleExports>;
method assertDeclareOpaqueType
assertDeclareOpaqueType: ( opts?: object) => asserts this is NodePath<t.DeclareOpaqueType>;
method assertDeclareTypeAlias
assertDeclareTypeAlias: ( opts?: object) => asserts this is NodePath<t.DeclareTypeAlias>;
method assertDeclareVariable
assertDeclareVariable: ( opts?: object) => asserts this is NodePath<t.DeclareVariable>;
method assertDecorator
assertDecorator: (opts?: object) => asserts this is NodePath<t.Decorator>;
method assertDirective
assertDirective: (opts?: object) => asserts this is NodePath<t.Directive>;
method assertDirectiveLiteral
assertDirectiveLiteral: ( opts?: object) => asserts this is NodePath<t.DirectiveLiteral>;
method assertDoExpression
assertDoExpression: (opts?: object) => asserts this is NodePath<t.DoExpression>;
method assertDoWhileStatement
assertDoWhileStatement: ( opts?: object) => asserts this is NodePath<t.DoWhileStatement>;
method assertEmptyStatement
assertEmptyStatement: ( opts?: object) => asserts this is NodePath<t.EmptyStatement>;
method assertEmptyTypeAnnotation
assertEmptyTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.EmptyTypeAnnotation>;
method assertEnumBody
assertEnumBody: (opts?: object) => asserts this is NodePath<t.EnumBody>;
method assertEnumBooleanBody
assertEnumBooleanBody: ( opts?: object) => asserts this is NodePath<t.EnumBooleanBody>;
method assertEnumBooleanMember
assertEnumBooleanMember: ( opts?: object) => asserts this is NodePath<t.EnumBooleanMember>;
method assertEnumDeclaration
assertEnumDeclaration: ( opts?: object) => asserts this is NodePath<t.EnumDeclaration>;
method assertEnumDefaultedMember
assertEnumDefaultedMember: ( opts?: object) => asserts this is NodePath<t.EnumDefaultedMember>;
method assertEnumMember
assertEnumMember: (opts?: object) => asserts this is NodePath<t.EnumMember>;
method assertEnumNumberBody
assertEnumNumberBody: ( opts?: object) => asserts this is NodePath<t.EnumNumberBody>;
method assertEnumNumberMember
assertEnumNumberMember: ( opts?: object) => asserts this is NodePath<t.EnumNumberMember>;
method assertEnumStringBody
assertEnumStringBody: ( opts?: object) => asserts this is NodePath<t.EnumStringBody>;
method assertEnumStringMember
assertEnumStringMember: ( opts?: object) => asserts this is NodePath<t.EnumStringMember>;
method assertEnumSymbolBody
assertEnumSymbolBody: ( opts?: object) => asserts this is NodePath<t.EnumSymbolBody>;
method assertExistsTypeAnnotation
assertExistsTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.ExistsTypeAnnotation>;
method assertExportAllDeclaration
assertExportAllDeclaration: ( opts?: object) => asserts this is NodePath<t.ExportAllDeclaration>;
method assertExportDeclaration
assertExportDeclaration: ( opts?: object) => asserts this is NodePath<t.ExportDeclaration>;
method assertExportDefaultDeclaration
assertExportDefaultDeclaration: ( opts?: object) => asserts this is NodePath<t.ExportDefaultDeclaration>;
method assertExportDefaultSpecifier
assertExportDefaultSpecifier: ( opts?: object) => asserts this is NodePath<t.ExportDefaultSpecifier>;
method assertExportNamedDeclaration
assertExportNamedDeclaration: ( opts?: object) => asserts this is NodePath<t.ExportNamedDeclaration>;
method assertExportNamespaceSpecifier
assertExportNamespaceSpecifier: ( opts?: object) => asserts this is NodePath<t.ExportNamespaceSpecifier>;
method assertExportSpecifier
assertExportSpecifier: ( opts?: object) => asserts this is NodePath<t.ExportSpecifier>;
method assertExpression
assertExpression: (opts?: object) => asserts this is NodePath<t.Expression>;
method assertExpressionStatement
assertExpressionStatement: ( opts?: object) => asserts this is NodePath<t.ExpressionStatement>;
method assertExpressionWrapper
assertExpressionWrapper: ( opts?: object) => asserts this is NodePath<t.ExpressionWrapper>;
method assertFile
assertFile: (opts?: object) => asserts this is NodePath<t.File>;
method assertFlow
assertFlow: (opts?: object) => asserts this is NodePath<t.Flow>;
method assertFlowBaseAnnotation
assertFlowBaseAnnotation: ( opts?: object) => asserts this is NodePath<t.FlowBaseAnnotation>;
method assertFlowDeclaration
assertFlowDeclaration: ( opts?: object) => asserts this is NodePath<t.FlowDeclaration>;
method assertFlowPredicate
assertFlowPredicate: ( opts?: object) => asserts this is NodePath<t.FlowPredicate>;
method assertFlowType
assertFlowType: (opts?: object) => asserts this is NodePath<t.FlowType>;
method assertFor
assertFor: (opts?: object) => asserts this is NodePath<t.For>;
method assertForInStatement
assertForInStatement: ( opts?: object) => asserts this is NodePath<t.ForInStatement>;
method assertForOfStatement
assertForOfStatement: ( opts?: object) => asserts this is NodePath<t.ForOfStatement>;
method assertForStatement
assertForStatement: (opts?: object) => asserts this is NodePath<t.ForStatement>;
method assertForXStatement
assertForXStatement: ( opts?: object) => asserts this is NodePath<t.ForXStatement>;
method assertFunction
assertFunction: (opts?: object) => asserts this is NodePath<t.Function>;
method assertFunctionDeclaration
assertFunctionDeclaration: ( opts?: object) => asserts this is NodePath<t.FunctionDeclaration>;
method assertFunctionExpression
assertFunctionExpression: ( opts?: object) => asserts this is NodePath<t.FunctionExpression>;
method assertFunctionParent
assertFunctionParent: ( opts?: object) => asserts this is NodePath<t.FunctionParent>;
method assertFunctionTypeAnnotation
assertFunctionTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.FunctionTypeAnnotation>;
method assertFunctionTypeParam
assertFunctionTypeParam: ( opts?: object) => asserts this is NodePath<t.FunctionTypeParam>;
method assertGenericTypeAnnotation
assertGenericTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.GenericTypeAnnotation>;
method assertIdentifier
assertIdentifier: (opts?: object) => asserts this is NodePath<t.Identifier>;
method assertIfStatement
assertIfStatement: (opts?: object) => asserts this is NodePath<t.IfStatement>;
method assertImmutable
assertImmutable: (opts?: object) => asserts this is NodePath<t.Immutable>;
method assertImport
assertImport: (opts?: object) => asserts this is NodePath<t.Import>;
method assertImportAttribute
assertImportAttribute: ( opts?: object) => asserts this is NodePath<t.ImportAttribute>;
method assertImportDeclaration
assertImportDeclaration: ( opts?: object) => asserts this is NodePath<t.ImportDeclaration>;
method assertImportDefaultSpecifier
assertImportDefaultSpecifier: ( opts?: object) => asserts this is NodePath<t.ImportDefaultSpecifier>;
method assertImportNamespaceSpecifier
assertImportNamespaceSpecifier: ( opts?: object) => asserts this is NodePath<t.ImportNamespaceSpecifier>;
method assertImportSpecifier
assertImportSpecifier: ( opts?: object) => asserts this is NodePath<t.ImportSpecifier>;
method assertIndexedAccessType
assertIndexedAccessType: ( opts?: object) => asserts this is NodePath<t.IndexedAccessType>;
method assertInferredPredicate
assertInferredPredicate: ( opts?: object) => asserts this is NodePath<t.InferredPredicate>;
method assertInterfaceDeclaration
assertInterfaceDeclaration: ( opts?: object) => asserts this is NodePath<t.InterfaceDeclaration>;
method assertInterfaceExtends
assertInterfaceExtends: ( opts?: object) => asserts this is NodePath<t.InterfaceExtends>;
method assertInterfaceTypeAnnotation
assertInterfaceTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.InterfaceTypeAnnotation>;
method assertInterpreterDirective
assertInterpreterDirective: ( opts?: object) => asserts this is NodePath<t.InterpreterDirective>;
method assertIntersectionTypeAnnotation
assertIntersectionTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.IntersectionTypeAnnotation>;
method assertJSX
assertJSX: (opts?: object) => asserts this is NodePath<t.JSX>;
method assertJSXAttribute
assertJSXAttribute: (opts?: object) => asserts this is NodePath<t.JSXAttribute>;
method assertJSXClosingElement
assertJSXClosingElement: ( opts?: object) => asserts this is NodePath<t.JSXClosingElement>;
method assertJSXClosingFragment
assertJSXClosingFragment: ( opts?: object) => asserts this is NodePath<t.JSXClosingFragment>;
method assertJSXElement
assertJSXElement: (opts?: object) => asserts this is NodePath<t.JSXElement>;
method assertJSXEmptyExpression
assertJSXEmptyExpression: ( opts?: object) => asserts this is NodePath<t.JSXEmptyExpression>;
method assertJSXExpressionContainer
assertJSXExpressionContainer: ( opts?: object) => asserts this is NodePath<t.JSXExpressionContainer>;
method assertJSXFragment
assertJSXFragment: (opts?: object) => asserts this is NodePath<t.JSXFragment>;
method assertJSXIdentifier
assertJSXIdentifier: ( opts?: object) => asserts this is NodePath<t.JSXIdentifier>;
method assertJSXMemberExpression
assertJSXMemberExpression: ( opts?: object) => asserts this is NodePath<t.JSXMemberExpression>;
method assertJSXNamespacedName
assertJSXNamespacedName: ( opts?: object) => asserts this is NodePath<t.JSXNamespacedName>;
method assertJSXOpeningElement
assertJSXOpeningElement: ( opts?: object) => asserts this is NodePath<t.JSXOpeningElement>;
method assertJSXOpeningFragment
assertJSXOpeningFragment: ( opts?: object) => asserts this is NodePath<t.JSXOpeningFragment>;
method assertJSXSpreadAttribute
assertJSXSpreadAttribute: ( opts?: object) => asserts this is NodePath<t.JSXSpreadAttribute>;
method assertJSXSpreadChild
assertJSXSpreadChild: ( opts?: object) => asserts this is NodePath<t.JSXSpreadChild>;
method assertJSXText
assertJSXText: (opts?: object) => asserts this is NodePath<t.JSXText>;
method assertLabeledStatement
assertLabeledStatement: ( opts?: object) => asserts this is NodePath<t.LabeledStatement>;
method assertLiteral
assertLiteral: (opts?: object) => asserts this is NodePath<t.Literal>;
method assertLogicalExpression
assertLogicalExpression: ( opts?: object) => asserts this is NodePath<t.LogicalExpression>;
method assertLoop
assertLoop: (opts?: object) => asserts this is NodePath<t.Loop>;
method assertLVal
assertLVal: (opts?: object) => asserts this is NodePath<t.LVal>;
method assertMemberExpression
assertMemberExpression: ( opts?: object) => asserts this is NodePath<t.MemberExpression>;
method assertMetaProperty
assertMetaProperty: (opts?: object) => asserts this is NodePath<t.MetaProperty>;
method assertMethod
assertMethod: (opts?: object) => asserts this is NodePath<t.Method>;
method assertMiscellaneous
assertMiscellaneous: ( opts?: object) => asserts this is NodePath<t.Miscellaneous>;
method assertMixedTypeAnnotation
assertMixedTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.MixedTypeAnnotation>;
method assertModuleDeclaration
assertModuleDeclaration: ( opts?: object) => asserts this is NodePath<t.ModuleDeclaration>;
method assertModuleExpression
assertModuleExpression: ( opts?: object) => asserts this is NodePath<t.ModuleExpression>;
method assertModuleSpecifier
assertModuleSpecifier: ( opts?: object) => asserts this is NodePath<t.ModuleSpecifier>;
method assertNewExpression
assertNewExpression: ( opts?: object) => asserts this is NodePath<t.NewExpression>;
method assertNoop
assertNoop: (opts?: object) => asserts this is NodePath<t.Noop>;
method assertNullableTypeAnnotation
assertNullableTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.NullableTypeAnnotation>;
method assertNullLiteral
assertNullLiteral: (opts?: object) => asserts this is NodePath<t.NullLiteral>;
method assertNullLiteralTypeAnnotation
assertNullLiteralTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.NullLiteralTypeAnnotation>;
method assertNumberLiteral
assertNumberLiteral: ( opts?: object) => asserts this is NodePath<t.NumberLiteral>;
Deprecated
Use
assertNumericLiteral
method assertNumberLiteralTypeAnnotation
assertNumberLiteralTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.NumberLiteralTypeAnnotation>;
method assertNumberTypeAnnotation
assertNumberTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.NumberTypeAnnotation>;
method assertNumericLiteral
assertNumericLiteral: ( opts?: object) => asserts this is NodePath<t.NumericLiteral>;
method assertObjectExpression
assertObjectExpression: ( opts?: object) => asserts this is NodePath<t.ObjectExpression>;
method assertObjectMember
assertObjectMember: (opts?: object) => asserts this is NodePath<t.ObjectMember>;
method assertObjectMethod
assertObjectMethod: (opts?: object) => asserts this is NodePath<t.ObjectMethod>;
method assertObjectPattern
assertObjectPattern: ( opts?: object) => asserts this is NodePath<t.ObjectPattern>;
method assertObjectProperty
assertObjectProperty: ( opts?: object) => asserts this is NodePath<t.ObjectProperty>;
method assertObjectTypeAnnotation
assertObjectTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.ObjectTypeAnnotation>;
method assertObjectTypeCallProperty
assertObjectTypeCallProperty: ( opts?: object) => asserts this is NodePath<t.ObjectTypeCallProperty>;
method assertObjectTypeIndexer
assertObjectTypeIndexer: ( opts?: object) => asserts this is NodePath<t.ObjectTypeIndexer>;
method assertObjectTypeInternalSlot
assertObjectTypeInternalSlot: ( opts?: object) => asserts this is NodePath<t.ObjectTypeInternalSlot>;
method assertObjectTypeProperty
assertObjectTypeProperty: ( opts?: object) => asserts this is NodePath<t.ObjectTypeProperty>;
method assertObjectTypeSpreadProperty
assertObjectTypeSpreadProperty: ( opts?: object) => asserts this is NodePath<t.ObjectTypeSpreadProperty>;
method assertOpaqueType
assertOpaqueType: (opts?: object) => asserts this is NodePath<t.OpaqueType>;
method assertOptionalCallExpression
assertOptionalCallExpression: ( opts?: object) => asserts this is NodePath<t.OptionalCallExpression>;
method assertOptionalIndexedAccessType
assertOptionalIndexedAccessType: ( opts?: object) => asserts this is NodePath<t.OptionalIndexedAccessType>;
method assertOptionalMemberExpression
assertOptionalMemberExpression: ( opts?: object) => asserts this is NodePath<t.OptionalMemberExpression>;
method assertParenthesizedExpression
assertParenthesizedExpression: ( opts?: object) => asserts this is NodePath<t.ParenthesizedExpression>;
method assertPattern
assertPattern: (opts?: object) => asserts this is NodePath<t.Pattern>;
method assertPatternLike
assertPatternLike: (opts?: object) => asserts this is NodePath<t.PatternLike>;
method assertPipelineBareFunction
assertPipelineBareFunction: ( opts?: object) => asserts this is NodePath<t.PipelineBareFunction>;
method assertPipelinePrimaryTopicReference
assertPipelinePrimaryTopicReference: ( opts?: object) => asserts this is NodePath<t.PipelinePrimaryTopicReference>;
method assertPipelineTopicExpression
assertPipelineTopicExpression: ( opts?: object) => asserts this is NodePath<t.PipelineTopicExpression>;
method assertPlaceholder
assertPlaceholder: (opts?: object) => asserts this is NodePath<t.Placeholder>;
method assertPrivate
assertPrivate: (opts?: object) => asserts this is NodePath<t.Private>;
method assertPrivateName
assertPrivateName: (opts?: object) => asserts this is NodePath<t.PrivateName>;
method assertProgram
assertProgram: (opts?: object) => asserts this is NodePath<t.Program>;
method assertProperty
assertProperty: (opts?: object) => asserts this is NodePath<t.Property>;
method assertPureish
assertPureish: (opts?: object) => asserts this is NodePath<t.Pureish>;
method assertQualifiedTypeIdentifier
assertQualifiedTypeIdentifier: ( opts?: object) => asserts this is NodePath<t.QualifiedTypeIdentifier>;
method assertRecordExpression
assertRecordExpression: ( opts?: object) => asserts this is NodePath<t.RecordExpression>;
method assertRegexLiteral
assertRegexLiteral: (opts?: object) => asserts this is NodePath<t.RegexLiteral>;
Deprecated
Use
assertRegExpLiteral
method assertRegExpLiteral
assertRegExpLiteral: ( opts?: object) => asserts this is NodePath<t.RegExpLiteral>;
method assertRestElement
assertRestElement: (opts?: object) => asserts this is NodePath<t.RestElement>;
method assertRestProperty
assertRestProperty: (opts?: object) => asserts this is NodePath<t.RestProperty>;
Deprecated
Use
assertRestElement
method assertReturnStatement
assertReturnStatement: ( opts?: object) => asserts this is NodePath<t.ReturnStatement>;
method assertScopable
assertScopable: (opts?: object) => asserts this is NodePath<t.Scopable>;
method assertSequenceExpression
assertSequenceExpression: ( opts?: object) => asserts this is NodePath<t.SequenceExpression>;
method assertSpreadElement
assertSpreadElement: ( opts?: object) => asserts this is NodePath<t.SpreadElement>;
method assertSpreadProperty
assertSpreadProperty: ( opts?: object) => asserts this is NodePath<t.SpreadProperty>;
Deprecated
Use
assertSpreadElement
method assertStandardized
assertStandardized: (opts?: object) => asserts this is NodePath<t.Standardized>;
method assertStatement
assertStatement: (opts?: object) => asserts this is NodePath<t.Statement>;
method assertStaticBlock
assertStaticBlock: (opts?: object) => asserts this is NodePath<t.StaticBlock>;
method assertStringLiteral
assertStringLiteral: ( opts?: object) => asserts this is NodePath<t.StringLiteral>;
method assertStringLiteralTypeAnnotation
assertStringLiteralTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.StringLiteralTypeAnnotation>;
method assertStringTypeAnnotation
assertStringTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.StringTypeAnnotation>;
method assertSuper
assertSuper: (opts?: object) => asserts this is NodePath<t.Super>;
method assertSwitchCase
assertSwitchCase: (opts?: object) => asserts this is NodePath<t.SwitchCase>;
method assertSwitchStatement
assertSwitchStatement: ( opts?: object) => asserts this is NodePath<t.SwitchStatement>;
method assertSymbolTypeAnnotation
assertSymbolTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.SymbolTypeAnnotation>;
method assertTaggedTemplateExpression
assertTaggedTemplateExpression: ( opts?: object) => asserts this is NodePath<t.TaggedTemplateExpression>;
method assertTemplateElement
assertTemplateElement: ( opts?: object) => asserts this is NodePath<t.TemplateElement>;
method assertTemplateLiteral
assertTemplateLiteral: ( opts?: object) => asserts this is NodePath<t.TemplateLiteral>;
method assertTerminatorless
assertTerminatorless: ( opts?: object) => asserts this is NodePath<t.Terminatorless>;
method assertThisExpression
assertThisExpression: ( opts?: object) => asserts this is NodePath<t.ThisExpression>;
method assertThisTypeAnnotation
assertThisTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.ThisTypeAnnotation>;
method assertThrowStatement
assertThrowStatement: ( opts?: object) => asserts this is NodePath<t.ThrowStatement>;
method assertTopicReference
assertTopicReference: ( opts?: object) => asserts this is NodePath<t.TopicReference>;
method assertTryStatement
assertTryStatement: (opts?: object) => asserts this is NodePath<t.TryStatement>;
method assertTSAnyKeyword
assertTSAnyKeyword: (opts?: object) => asserts this is NodePath<t.TSAnyKeyword>;
method assertTSArrayType
assertTSArrayType: (opts?: object) => asserts this is NodePath<t.TSArrayType>;
method assertTSAsExpression
assertTSAsExpression: ( opts?: object) => asserts this is NodePath<t.TSAsExpression>;
method assertTSBaseType
assertTSBaseType: (opts?: object) => asserts this is NodePath<t.TSBaseType>;
method assertTSBigIntKeyword
assertTSBigIntKeyword: ( opts?: object) => asserts this is NodePath<t.TSBigIntKeyword>;
method assertTSBooleanKeyword
assertTSBooleanKeyword: ( opts?: object) => asserts this is NodePath<t.TSBooleanKeyword>;
method assertTSCallSignatureDeclaration
assertTSCallSignatureDeclaration: ( opts?: object) => asserts this is NodePath<t.TSCallSignatureDeclaration>;
method assertTSConditionalType
assertTSConditionalType: ( opts?: object) => asserts this is NodePath<t.TSConditionalType>;
method assertTSConstructorType
assertTSConstructorType: ( opts?: object) => asserts this is NodePath<t.TSConstructorType>;
method assertTSConstructSignatureDeclaration
assertTSConstructSignatureDeclaration: ( opts?: object) => asserts this is NodePath<t.TSConstructSignatureDeclaration>;
method assertTSDeclareFunction
assertTSDeclareFunction: ( opts?: object) => asserts this is NodePath<t.TSDeclareFunction>;
method assertTSDeclareMethod
assertTSDeclareMethod: ( opts?: object) => asserts this is NodePath<t.TSDeclareMethod>;
method assertTSEntityName
assertTSEntityName: (opts?: object) => asserts this is NodePath<t.TSEntityName>;
method assertTSEnumDeclaration
assertTSEnumDeclaration: ( opts?: object) => asserts this is NodePath<t.TSEnumDeclaration>;
method assertTSEnumMember
assertTSEnumMember: (opts?: object) => asserts this is NodePath<t.TSEnumMember>;
method assertTSExportAssignment
assertTSExportAssignment: ( opts?: object) => asserts this is NodePath<t.TSExportAssignment>;
method assertTSExpressionWithTypeArguments
assertTSExpressionWithTypeArguments: ( opts?: object) => asserts this is NodePath<t.TSExpressionWithTypeArguments>;
method assertTSExternalModuleReference
assertTSExternalModuleReference: ( opts?: object) => asserts this is NodePath<t.TSExternalModuleReference>;
method assertTSFunctionType
assertTSFunctionType: ( opts?: object) => asserts this is NodePath<t.TSFunctionType>;
method assertTSImportEqualsDeclaration
assertTSImportEqualsDeclaration: ( opts?: object) => asserts this is NodePath<t.TSImportEqualsDeclaration>;
method assertTSImportType
assertTSImportType: (opts?: object) => asserts this is NodePath<t.TSImportType>;
method assertTSIndexedAccessType
assertTSIndexedAccessType: ( opts?: object) => asserts this is NodePath<t.TSIndexedAccessType>;
method assertTSIndexSignature
assertTSIndexSignature: ( opts?: object) => asserts this is NodePath<t.TSIndexSignature>;
method assertTSInferType
assertTSInferType: (opts?: object) => asserts this is NodePath<t.TSInferType>;
method assertTSInstantiationExpression
assertTSInstantiationExpression: ( opts?: object) => asserts this is NodePath<t.TSInstantiationExpression>;
method assertTSInterfaceBody
assertTSInterfaceBody: ( opts?: object) => asserts this is NodePath<t.TSInterfaceBody>;
method assertTSInterfaceDeclaration
assertTSInterfaceDeclaration: ( opts?: object) => asserts this is NodePath<t.TSInterfaceDeclaration>;
method assertTSIntersectionType
assertTSIntersectionType: ( opts?: object) => asserts this is NodePath<t.TSIntersectionType>;
method assertTSIntrinsicKeyword
assertTSIntrinsicKeyword: ( opts?: object) => asserts this is NodePath<t.TSIntrinsicKeyword>;
method assertTSLiteralType
assertTSLiteralType: ( opts?: object) => asserts this is NodePath<t.TSLiteralType>;
method assertTSMappedType
assertTSMappedType: (opts?: object) => asserts this is NodePath<t.TSMappedType>;
method assertTSMethodSignature
assertTSMethodSignature: ( opts?: object) => asserts this is NodePath<t.TSMethodSignature>;
method assertTSModuleBlock
assertTSModuleBlock: ( opts?: object) => asserts this is NodePath<t.TSModuleBlock>;
method assertTSModuleDeclaration
assertTSModuleDeclaration: ( opts?: object) => asserts this is NodePath<t.TSModuleDeclaration>;
method assertTSNamedTupleMember
assertTSNamedTupleMember: ( opts?: object) => asserts this is NodePath<t.TSNamedTupleMember>;
method assertTSNamespaceExportDeclaration
assertTSNamespaceExportDeclaration: ( opts?: object) => asserts this is NodePath<t.TSNamespaceExportDeclaration>;
method assertTSNeverKeyword
assertTSNeverKeyword: ( opts?: object) => asserts this is NodePath<t.TSNeverKeyword>;
method assertTSNonNullExpression
assertTSNonNullExpression: ( opts?: object) => asserts this is NodePath<t.TSNonNullExpression>;
method assertTSNullKeyword
assertTSNullKeyword: ( opts?: object) => asserts this is NodePath<t.TSNullKeyword>;
method assertTSNumberKeyword
assertTSNumberKeyword: ( opts?: object) => asserts this is NodePath<t.TSNumberKeyword>;
method assertTSObjectKeyword
assertTSObjectKeyword: ( opts?: object) => asserts this is NodePath<t.TSObjectKeyword>;
method assertTSOptionalType
assertTSOptionalType: ( opts?: object) => asserts this is NodePath<t.TSOptionalType>;
method assertTSParameterProperty
assertTSParameterProperty: ( opts?: object) => asserts this is NodePath<t.TSParameterProperty>;
method assertTSParenthesizedType
assertTSParenthesizedType: ( opts?: object) => asserts this is NodePath<t.TSParenthesizedType>;
method assertTSPropertySignature
assertTSPropertySignature: ( opts?: object) => asserts this is NodePath<t.TSPropertySignature>;
method assertTSQualifiedName
assertTSQualifiedName: ( opts?: object) => asserts this is NodePath<t.TSQualifiedName>;
method assertTSRestType
assertTSRestType: (opts?: object) => asserts this is NodePath<t.TSRestType>;
method assertTSSatisfiesExpression
assertTSSatisfiesExpression: ( opts?: object) => asserts this is NodePath<t.TSSatisfiesExpression>;
method assertTSStringKeyword
assertTSStringKeyword: ( opts?: object) => asserts this is NodePath<t.TSStringKeyword>;
method assertTSSymbolKeyword
assertTSSymbolKeyword: ( opts?: object) => asserts this is NodePath<t.TSSymbolKeyword>;
method assertTSThisType
assertTSThisType: (opts?: object) => asserts this is NodePath<t.TSThisType>;
method assertTSTupleType
assertTSTupleType: (opts?: object) => asserts this is NodePath<t.TSTupleType>;
method assertTSType
assertTSType: (opts?: object) => asserts this is NodePath<t.TSType>;
method assertTSTypeAliasDeclaration
assertTSTypeAliasDeclaration: ( opts?: object) => asserts this is NodePath<t.TSTypeAliasDeclaration>;
method assertTSTypeAnnotation
assertTSTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.TSTypeAnnotation>;
method assertTSTypeAssertion
assertTSTypeAssertion: ( opts?: object) => asserts this is NodePath<t.TSTypeAssertion>;
method assertTSTypeElement
assertTSTypeElement: ( opts?: object) => asserts this is NodePath<t.TSTypeElement>;
method assertTSTypeLiteral
assertTSTypeLiteral: ( opts?: object) => asserts this is NodePath<t.TSTypeLiteral>;
method assertTSTypeOperator
assertTSTypeOperator: ( opts?: object) => asserts this is NodePath<t.TSTypeOperator>;
method assertTSTypeParameter
assertTSTypeParameter: ( opts?: object) => asserts this is NodePath<t.TSTypeParameter>;
method assertTSTypeParameterDeclaration
assertTSTypeParameterDeclaration: ( opts?: object) => asserts this is NodePath<t.TSTypeParameterDeclaration>;
method assertTSTypeParameterInstantiation
assertTSTypeParameterInstantiation: ( opts?: object) => asserts this is NodePath<t.TSTypeParameterInstantiation>;
method assertTSTypePredicate
assertTSTypePredicate: ( opts?: object) => asserts this is NodePath<t.TSTypePredicate>;
method assertTSTypeQuery
assertTSTypeQuery: (opts?: object) => asserts this is NodePath<t.TSTypeQuery>;
method assertTSTypeReference
assertTSTypeReference: ( opts?: object) => asserts this is NodePath<t.TSTypeReference>;
method assertTSUndefinedKeyword
assertTSUndefinedKeyword: ( opts?: object) => asserts this is NodePath<t.TSUndefinedKeyword>;
method assertTSUnionType
assertTSUnionType: (opts?: object) => asserts this is NodePath<t.TSUnionType>;
method assertTSUnknownKeyword
assertTSUnknownKeyword: ( opts?: object) => asserts this is NodePath<t.TSUnknownKeyword>;
method assertTSVoidKeyword
assertTSVoidKeyword: ( opts?: object) => asserts this is NodePath<t.TSVoidKeyword>;
method assertTupleExpression
assertTupleExpression: ( opts?: object) => asserts this is NodePath<t.TupleExpression>;
method assertTupleTypeAnnotation
assertTupleTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.TupleTypeAnnotation>;
method assertTypeAlias
assertTypeAlias: (opts?: object) => asserts this is NodePath<t.TypeAlias>;
method assertTypeAnnotation
assertTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.TypeAnnotation>;
method assertTypeCastExpression
assertTypeCastExpression: ( opts?: object) => asserts this is NodePath<t.TypeCastExpression>;
method assertTypeofTypeAnnotation
assertTypeofTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.TypeofTypeAnnotation>;
method assertTypeParameter
assertTypeParameter: ( opts?: object) => asserts this is NodePath<t.TypeParameter>;
method assertTypeParameterDeclaration
assertTypeParameterDeclaration: ( opts?: object) => asserts this is NodePath<t.TypeParameterDeclaration>;
method assertTypeParameterInstantiation
assertTypeParameterInstantiation: ( opts?: object) => asserts this is NodePath<t.TypeParameterInstantiation>;
method assertTypeScript
assertTypeScript: (opts?: object) => asserts this is NodePath<t.TypeScript>;
method assertUnaryExpression
assertUnaryExpression: ( opts?: object) => asserts this is NodePath<t.UnaryExpression>;
method assertUnaryLike
assertUnaryLike: (opts?: object) => asserts this is NodePath<t.UnaryLike>;
method assertUnionTypeAnnotation
assertUnionTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.UnionTypeAnnotation>;
method assertUpdateExpression
assertUpdateExpression: ( opts?: object) => asserts this is NodePath<t.UpdateExpression>;
method assertUserWhitespacable
assertUserWhitespacable: ( opts?: object) => asserts this is NodePath<t.UserWhitespacable>;
method assertV8IntrinsicIdentifier
assertV8IntrinsicIdentifier: ( opts?: object) => asserts this is NodePath<t.V8IntrinsicIdentifier>;
method assertVariableDeclaration
assertVariableDeclaration: ( opts?: object) => asserts this is NodePath<t.VariableDeclaration>;
method assertVariableDeclarator
assertVariableDeclarator: ( opts?: object) => asserts this is NodePath<t.VariableDeclarator>;
method assertVariance
assertVariance: (opts?: object) => asserts this is NodePath<t.Variance>;
method assertVoidTypeAnnotation
assertVoidTypeAnnotation: ( opts?: object) => asserts this is NodePath<t.VoidTypeAnnotation>;
method assertWhile
assertWhile: (opts?: object) => asserts this is NodePath<t.While>;
method assertWhileStatement
assertWhileStatement: ( opts?: object) => asserts this is NodePath<t.WhileStatement>;
method assertWithStatement
assertWithStatement: ( opts?: object) => asserts this is NodePath<t.WithStatement>;
method assertYieldExpression
assertYieldExpression: ( opts?: object) => asserts this is NodePath<t.YieldExpression>;
method baseTypeStrictlyMatches
baseTypeStrictlyMatches: (rightArg: NodePath) => boolean;
method buildCodeFrameError
buildCodeFrameError: (msg: string, Error?: ErrorConstructor) => Error;
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 ensureBlock
ensureBlock: ( this: NodePath< | t.Loop | t.WithStatement | t.Function | t.LabeledStatement | t.CatchClause >) => asserts this is NodePath<T & { body: t.BlockStatement }>;
method equals
equals: (key: string, value: any) => boolean;
Check whether the path node
key
strict equalsvalue
.
method evaluate
evaluate: () => { confident: boolean; value: any; deopt?: NodePath };
Walk the input
node
and statically evaluate it.Returns an object in the form
{ confident, value, deopt }
.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, in which casedeopt
is the path of said node.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, deopt: NodePath }
method evaluateTruthy
evaluateTruthy: () => boolean | undefined;
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; key: K; }): NodePath<C[K]>; <C extends Node, L extends NodeKeyOfArrays<C>>(opts: { hub?: HubInterface; parentPath: NodePath<Node>; parent: Node; container: C; listKey: L; key: number; }): C[L] extends any[] ? NodePath<C[L][number]> : never;};
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 | symbol, 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 | null;
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 | t.TSType;
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<Exclude<T, null>>;
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 isAccessor
isAccessor: (opts?: object) => this is NodePath<t.Accessor>;
method isAncestor
isAncestor: (maybeDescendant: NodePath) => boolean;
A helper to find if
this
path is an ancestor ofmaybeDescendant
method isAnyTypeAnnotation
isAnyTypeAnnotation: (opts?: object) => this is NodePath<t.AnyTypeAnnotation>;
method isArgumentPlaceholder
isArgumentPlaceholder: ( opts?: object) => this is NodePath<t.ArgumentPlaceholder>;
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 isBigIntLiteral
isBigIntLiteral: (opts?: object) => this is NodePath<t.BigIntLiteral>;
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;
Deprecated
will be removed in Babel 8
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 isClassAccessorProperty
isClassAccessorProperty: ( opts?: object) => this is NodePath<t.ClassAccessorProperty>;
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 isClassPrivateMethod
isClassPrivateMethod: (opts?: object) => this is NodePath<t.ClassPrivateMethod>;
method isClassPrivateProperty
isClassPrivateProperty: ( opts?: object) => this is NodePath<t.ClassPrivateProperty>;
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 isConstantExpression
isConstantExpression: () => boolean;
method isContinueStatement
isContinueStatement: (opts?: object) => this is NodePath<t.ContinueStatement>;
method isDebuggerStatement
isDebuggerStatement: (opts?: object) => this is NodePath<t.DebuggerStatement>;
method isDecimalLiteral
isDecimalLiteral: (opts?: object) => this is NodePath<t.DecimalLiteral>;
method isDeclaration
isDeclaration: (opts?: object) => this is NodePath<t.Declaration>;
method isDeclareClass
isDeclareClass: (opts?: object) => this is NodePath<t.DeclareClass>;
method isDeclaredPredicate
isDeclaredPredicate: (opts?: object) => this is NodePath<t.DeclaredPredicate>;
method isDeclareExportAllDeclaration
isDeclareExportAllDeclaration: ( opts?: object) => this is NodePath<t.DeclareExportAllDeclaration>;
method isDeclareExportDeclaration
isDeclareExportDeclaration: ( opts?: object) => this is NodePath<t.DeclareExportDeclaration>;
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 isDeclareModuleExports
isDeclareModuleExports: ( opts?: object) => this is NodePath<t.DeclareModuleExports>;
method isDeclareOpaqueType
isDeclareOpaqueType: (opts?: object) => this is NodePath<t.DeclareOpaqueType>;
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 isDenylisted
isDenylisted: () => boolean;
method isDescendant
isDescendant: (maybeAncestor: NodePath) => boolean;
A helper to find if
this
path is a descendant ofmaybeAncestor
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 isEmptyTypeAnnotation
isEmptyTypeAnnotation: ( opts?: object) => this is NodePath<t.EmptyTypeAnnotation>;
method isEnumBody
isEnumBody: (opts?: object) => this is NodePath<t.EnumBody>;
method isEnumBooleanBody
isEnumBooleanBody: (opts?: object) => this is NodePath<t.EnumBooleanBody>;
method isEnumBooleanMember
isEnumBooleanMember: (opts?: object) => this is NodePath<t.EnumBooleanMember>;
method isEnumDeclaration
isEnumDeclaration: (opts?: object) => this is NodePath<t.EnumDeclaration>;
method isEnumDefaultedMember
isEnumDefaultedMember: ( opts?: object) => this is NodePath<t.EnumDefaultedMember>;
method isEnumMember
isEnumMember: (opts?: object) => this is NodePath<t.EnumMember>;
method isEnumNumberBody
isEnumNumberBody: (opts?: object) => this is NodePath<t.EnumNumberBody>;
method isEnumNumberMember
isEnumNumberMember: (opts?: object) => this is NodePath<t.EnumNumberMember>;
method isEnumStringBody
isEnumStringBody: (opts?: object) => this is NodePath<t.EnumStringBody>;
method isEnumStringMember
isEnumStringMember: (opts?: object) => this is NodePath<t.EnumStringMember>;
method isEnumSymbolBody
isEnumSymbolBody: (opts?: object) => this is NodePath<t.EnumSymbolBody>;
method isExistentialTypeParam
isExistentialTypeParam: ( opts?: object) => this is NodePath<t.ExistsTypeAnnotation>;
Deprecated
method isExistsTypeAnnotation
isExistsTypeAnnotation: ( opts?: object) => this is NodePath<t.ExistsTypeAnnotation>;
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 isFlowPredicate
isFlowPredicate: (opts?: object) => this is NodePath<t.FlowPredicate>;
method isFlowType
isFlowType: (opts?: object) => this is NodePath<t.FlowType>;
method isFor
isFor: (opts?: object) => this is NodePath<t.For>;
method isForAwaitStatement
isForAwaitStatement: (opts?: object) => this is NodePath<t.ForOfStatement>;
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 isImport
isImport: (opts?: object) => this is NodePath<t.Import>;
method isImportAttribute
isImportAttribute: (opts?: object) => this is NodePath<t.ImportAttribute>;
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 isIndexedAccessType
isIndexedAccessType: (opts?: object) => this is NodePath<t.IndexedAccessType>;
method isInferredPredicate
isInferredPredicate: (opts?: object) => this is NodePath<t.InferredPredicate>;
method isInStrictMode
isInStrictMode: () => boolean;
method isInterfaceDeclaration
isInterfaceDeclaration: ( opts?: object) => this is NodePath<t.InterfaceDeclaration>;
method isInterfaceExtends
isInterfaceExtends: (opts?: object) => this is NodePath<t.InterfaceExtends>;
method isInterfaceTypeAnnotation
isInterfaceTypeAnnotation: ( opts?: object) => this is NodePath<t.InterfaceTypeAnnotation>;
method isInterpreterDirective
isInterpreterDirective: ( opts?: object) => this is NodePath<t.InterpreterDirective>;
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 isJSXClosingFragment
isJSXClosingFragment: (opts?: object) => this is NodePath<t.JSXClosingFragment>;
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 isJSXFragment
isJSXFragment: (opts?: object) => this is NodePath<t.JSXFragment>;
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 isJSXOpeningFragment
isJSXOpeningFragment: (opts?: object) => this is NodePath<t.JSXOpeningFragment>;
method isJSXSpreadAttribute
isJSXSpreadAttribute: (opts?: object) => this is NodePath<t.JSXSpreadAttribute>;
method isJSXSpreadChild
isJSXSpreadChild: (opts?: object) => this is NodePath<t.JSXSpreadChild>;
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 isMiscellaneous
isMiscellaneous: (opts?: object) => this is NodePath<t.Miscellaneous>;
method isMixedTypeAnnotation
isMixedTypeAnnotation: ( opts?: object) => this is NodePath<t.MixedTypeAnnotation>;
method isModuleDeclaration
isModuleDeclaration: (opts?: object) => this is NodePath<t.ModuleDeclaration>;
method isModuleExpression
isModuleExpression: (opts?: object) => this is NodePath<t.ModuleExpression>;
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.NumberLiteral>;
Deprecated
Use
isNumericLiteral
method isNumberLiteralTypeAnnotation
isNumberLiteralTypeAnnotation: ( opts?: object) => this is NodePath<t.NumberLiteralTypeAnnotation>;
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) => void;
Deprecated
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 isObjectTypeInternalSlot
isObjectTypeInternalSlot: ( opts?: object) => this is NodePath<t.ObjectTypeInternalSlot>;
method isObjectTypeProperty
isObjectTypeProperty: (opts?: object) => this is NodePath<t.ObjectTypeProperty>;
method isObjectTypeSpreadProperty
isObjectTypeSpreadProperty: ( opts?: object) => this is NodePath<t.ObjectTypeSpreadProperty>;
method isOpaqueType
isOpaqueType: (opts?: object) => this is NodePath<t.OpaqueType>;
method isOptionalCallExpression
isOptionalCallExpression: ( opts?: object) => this is NodePath<t.OptionalCallExpression>;
method isOptionalIndexedAccessType
isOptionalIndexedAccessType: ( opts?: object) => this is NodePath<t.OptionalIndexedAccessType>;
method isOptionalMemberExpression
isOptionalMemberExpression: ( opts?: object) => this is NodePath<t.OptionalMemberExpression>;
method isParenthesizedExpression
isParenthesizedExpression: ( opts?: object) => this is NodePath<t.ParenthesizedExpression>;
method isPattern
isPattern: (opts?: object) => this is NodePath<t.Pattern>;
method isPatternLike
isPatternLike: (opts?: object) => this is NodePath<t.PatternLike>;
method isPipelineBareFunction
isPipelineBareFunction: ( opts?: object) => this is NodePath<t.PipelineBareFunction>;
method isPipelinePrimaryTopicReference
isPipelinePrimaryTopicReference: ( opts?: object) => this is NodePath<t.PipelinePrimaryTopicReference>;
method isPipelineTopicExpression
isPipelineTopicExpression: ( opts?: object) => this is NodePath<t.PipelineTopicExpression>;
method isPlaceholder
isPlaceholder: (opts?: object) => this is NodePath<t.Placeholder>;
method isPrivate
isPrivate: (opts?: object) => this is NodePath<t.Private>;
method isPrivateName
isPrivateName: (opts?: object) => this is NodePath<t.PrivateName>;
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 isRecordExpression
isRecordExpression: (opts?: object) => this is NodePath<t.RecordExpression>;
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.RegexLiteral>;
Deprecated
Use
isRegExpLiteral
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>;
Deprecated
Use
isRestElement
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<any>;
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>;
Deprecated
Use
isSpreadElement
method isStandardized
isStandardized: (opts?: object) => this is NodePath<t.Standardized>;
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 isStaticBlock
isStaticBlock: (opts?: object) => this is NodePath<t.StaticBlock>;
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 isSymbolTypeAnnotation
isSymbolTypeAnnotation: ( opts?: object) => this is NodePath<t.SymbolTypeAnnotation>;
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 isTopicReference
isTopicReference: (opts?: object) => this is NodePath<t.TopicReference>;
method isTryStatement
isTryStatement: (opts?: object) => this is NodePath<t.TryStatement>;
method isTSAnyKeyword
isTSAnyKeyword: (opts?: object) => this is NodePath<t.TSAnyKeyword>;
method isTSArrayType
isTSArrayType: (opts?: object) => this is NodePath<t.TSArrayType>;
method isTSAsExpression
isTSAsExpression: (opts?: object) => this is NodePath<t.TSAsExpression>;
method isTSBaseType
isTSBaseType: (opts?: object) => this is NodePath<t.TSBaseType>;
method isTSBigIntKeyword
isTSBigIntKeyword: (opts?: object) => this is NodePath<t.TSBigIntKeyword>;
method isTSBooleanKeyword
isTSBooleanKeyword: (opts?: object) => this is NodePath<t.TSBooleanKeyword>;
method isTSCallSignatureDeclaration
isTSCallSignatureDeclaration: ( opts?: object) => this is NodePath<t.TSCallSignatureDeclaration>;
method isTSConditionalType
isTSConditionalType: (opts?: object) => this is NodePath<t.TSConditionalType>;
method isTSConstructorType
isTSConstructorType: (opts?: object) => this is NodePath<t.TSConstructorType>;
method isTSConstructSignatureDeclaration
isTSConstructSignatureDeclaration: ( opts?: object) => this is NodePath<t.TSConstructSignatureDeclaration>;
method isTSDeclareFunction
isTSDeclareFunction: (opts?: object) => this is NodePath<t.TSDeclareFunction>;
method isTSDeclareMethod
isTSDeclareMethod: (opts?: object) => this is NodePath<t.TSDeclareMethod>;
method isTSEntityName
isTSEntityName: (opts?: object) => this is NodePath<t.TSEntityName>;
method isTSEnumDeclaration
isTSEnumDeclaration: (opts?: object) => this is NodePath<t.TSEnumDeclaration>;
method isTSEnumMember
isTSEnumMember: (opts?: object) => this is NodePath<t.TSEnumMember>;
method isTSExportAssignment
isTSExportAssignment: (opts?: object) => this is NodePath<t.TSExportAssignment>;
method isTSExpressionWithTypeArguments
isTSExpressionWithTypeArguments: ( opts?: object) => this is NodePath<t.TSExpressionWithTypeArguments>;
method isTSExternalModuleReference
isTSExternalModuleReference: ( opts?: object) => this is NodePath<t.TSExternalModuleReference>;
method isTSFunctionType
isTSFunctionType: (opts?: object) => this is NodePath<t.TSFunctionType>;
method isTSImportEqualsDeclaration
isTSImportEqualsDeclaration: ( opts?: object) => this is NodePath<t.TSImportEqualsDeclaration>;
method isTSImportType
isTSImportType: (opts?: object) => this is NodePath<t.TSImportType>;
method isTSIndexedAccessType
isTSIndexedAccessType: ( opts?: object) => this is NodePath<t.TSIndexedAccessType>;
method isTSIndexSignature
isTSIndexSignature: (opts?: object) => this is NodePath<t.TSIndexSignature>;
method isTSInferType
isTSInferType: (opts?: object) => this is NodePath<t.TSInferType>;
method isTSInstantiationExpression
isTSInstantiationExpression: ( opts?: object) => this is NodePath<t.TSInstantiationExpression>;
method isTSInterfaceBody
isTSInterfaceBody: (opts?: object) => this is NodePath<t.TSInterfaceBody>;
method isTSInterfaceDeclaration
isTSInterfaceDeclaration: ( opts?: object) => this is NodePath<t.TSInterfaceDeclaration>;
method isTSIntersectionType
isTSIntersectionType: (opts?: object) => this is NodePath<t.TSIntersectionType>;
method isTSIntrinsicKeyword
isTSIntrinsicKeyword: (opts?: object) => this is NodePath<t.TSIntrinsicKeyword>;
method isTSLiteralType
isTSLiteralType: (opts?: object) => this is NodePath<t.TSLiteralType>;
method isTSMappedType
isTSMappedType: (opts?: object) => this is NodePath<t.TSMappedType>;
method isTSMethodSignature
isTSMethodSignature: (opts?: object) => this is NodePath<t.TSMethodSignature>;
method isTSModuleBlock
isTSModuleBlock: (opts?: object) => this is NodePath<t.TSModuleBlock>;
method isTSModuleDeclaration
isTSModuleDeclaration: ( opts?: object) => this is NodePath<t.TSModuleDeclaration>;
method isTSNamedTupleMember
isTSNamedTupleMember: (opts?: object) => this is NodePath<t.TSNamedTupleMember>;
method isTSNamespaceExportDeclaration
isTSNamespaceExportDeclaration: ( opts?: object) => this is NodePath<t.TSNamespaceExportDeclaration>;
method isTSNeverKeyword
isTSNeverKeyword: (opts?: object) => this is NodePath<t.TSNeverKeyword>;
method isTSNonNullExpression
isTSNonNullExpression: ( opts?: object) => this is NodePath<t.TSNonNullExpression>;
method isTSNullKeyword
isTSNullKeyword: (opts?: object) => this is NodePath<t.TSNullKeyword>;
method isTSNumberKeyword
isTSNumberKeyword: (opts?: object) => this is NodePath<t.TSNumberKeyword>;
method isTSObjectKeyword
isTSObjectKeyword: (opts?: object) => this is NodePath<t.TSObjectKeyword>;
method isTSOptionalType
isTSOptionalType: (opts?: object) => this is NodePath<t.TSOptionalType>;
method isTSParameterProperty
isTSParameterProperty: ( opts?: object) => this is NodePath<t.TSParameterProperty>;
method isTSParenthesizedType
isTSParenthesizedType: ( opts?: object) => this is NodePath<t.TSParenthesizedType>;
method isTSPropertySignature
isTSPropertySignature: ( opts?: object) => this is NodePath<t.TSPropertySignature>;
method isTSQualifiedName
isTSQualifiedName: (opts?: object) => this is NodePath<t.TSQualifiedName>;
method isTSRestType
isTSRestType: (opts?: object) => this is NodePath<t.TSRestType>;
method isTSSatisfiesExpression
isTSSatisfiesExpression: ( opts?: object) => this is NodePath<t.TSSatisfiesExpression>;
method isTSStringKeyword
isTSStringKeyword: (opts?: object) => this is NodePath<t.TSStringKeyword>;
method isTSSymbolKeyword
isTSSymbolKeyword: (opts?: object) => this is NodePath<t.TSSymbolKeyword>;
method isTSThisType
isTSThisType: (opts?: object) => this is NodePath<t.TSThisType>;
method isTSTupleType
isTSTupleType: (opts?: object) => this is NodePath<t.TSTupleType>;
method isTSType
isTSType: (opts?: object) => this is NodePath<t.TSType>;
method isTSTypeAliasDeclaration
isTSTypeAliasDeclaration: ( opts?: object) => this is NodePath<t.TSTypeAliasDeclaration>;
method isTSTypeAnnotation
isTSTypeAnnotation: (opts?: object) => this is NodePath<t.TSTypeAnnotation>;
method isTSTypeAssertion
isTSTypeAssertion: (opts?: object) => this is NodePath<t.TSTypeAssertion>;
method isTSTypeElement
isTSTypeElement: (opts?: object) => this is NodePath<t.TSTypeElement>;
method isTSTypeLiteral
isTSTypeLiteral: (opts?: object) => this is NodePath<t.TSTypeLiteral>;
method isTSTypeOperator
isTSTypeOperator: (opts?: object) => this is NodePath<t.TSTypeOperator>;
method isTSTypeParameter
isTSTypeParameter: (opts?: object) => this is NodePath<t.TSTypeParameter>;
method isTSTypeParameterDeclaration
isTSTypeParameterDeclaration: ( opts?: object) => this is NodePath<t.TSTypeParameterDeclaration>;
method isTSTypeParameterInstantiation
isTSTypeParameterInstantiation: ( opts?: object) => this is NodePath<t.TSTypeParameterInstantiation>;
method isTSTypePredicate
isTSTypePredicate: (opts?: object) => this is NodePath<t.TSTypePredicate>;
method isTSTypeQuery
isTSTypeQuery: (opts?: object) => this is NodePath<t.TSTypeQuery>;
method isTSTypeReference
isTSTypeReference: (opts?: object) => this is NodePath<t.TSTypeReference>;
method isTSUndefinedKeyword
isTSUndefinedKeyword: (opts?: object) => this is NodePath<t.TSUndefinedKeyword>;
method isTSUnionType
isTSUnionType: (opts?: object) => this is NodePath<t.TSUnionType>;
method isTSUnknownKeyword
isTSUnknownKeyword: (opts?: object) => this is NodePath<t.TSUnknownKeyword>;
method isTSVoidKeyword
isTSVoidKeyword: (opts?: object) => this is NodePath<t.TSVoidKeyword>;
method isTupleExpression
isTupleExpression: (opts?: object) => this is NodePath<t.TupleExpression>;
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 isTypeParameter
isTypeParameter: (opts?: object) => this is NodePath<t.TypeParameter>;
method isTypeParameterDeclaration
isTypeParameterDeclaration: ( opts?: object) => this is NodePath<t.TypeParameterDeclaration>;
method isTypeParameterInstantiation
isTypeParameterInstantiation: ( opts?: object) => this is NodePath<t.TypeParameterInstantiation>;
method isTypeScript
isTypeScript: (opts?: object) => this is NodePath<t.TypeScript>;
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 isV8IntrinsicIdentifier
isV8IntrinsicIdentifier: ( opts?: object) => this is NodePath<t.V8IntrinsicIdentifier>;
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 isVariance
isVariance: (opts?: object) => this is NodePath<t.Variance>;
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 pushContainer
pushContainer: < T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>( this: NodePath<T>, listKey: K, nodes: Nodes) => NodePaths<Nodes>;
Insert child nodes at the end of the current node.
Parameter listKey
The key at which the child nodes are stored (usually body).
Parameter nodes
the nodes to insert.
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: t.Statement[]) => NodePaths<t.Expression | t.Statement>;
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 extends unknown>(nodes: Nodes) => NodePaths<Nodes>;
method replaceWith
replaceWith: { <R extends Node>(replacementPath: R | NodePath<R>): [NodePath<R>]; <R extends NodePath<Node>>(replacementPath: R): [R];};
Replace the current node with another.
method replaceWithMultiple
replaceWithMultiple: <Nodes extends unknown>(nodes: Nodes) => NodePaths<Nodes>;
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: string) => [NodePath];
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 requeue
requeue: (pathToQueue?: NodePath) => void;
method resolve
resolve: (dangerous?: boolean, resolved?: NodePath[]) => NodePath;
method resync
resync: () => void;
Here we resync the node paths
key
andcontainer
. If they've changed according to what we have stored internally then we attempt to resync by crawling and looking for the new values.
method set
set: (key: string, node: any) => void;
method setContext
setContext: (context?: TraversalContext) => this;
method setData
setData: (key: string | symbol, 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 toComputedKey
toComputedKey: () => t.PrivateName | t.Expression;
method traverse
traverse: { <T>(visitor: TraverseOptions<T>, state: T): void; (visitor: TraverseOptions<Node>): void;};
method unshiftContainer
unshiftContainer: < T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>( this: NodePath<T>, listKey: K, nodes: Nodes) => NodePaths<Nodes>;
Insert child nodes at the start of the current node.
Parameter listKey
The key at which the child nodes are stored (usually body).
Parameter nodes
the nodes to insert.
method unwrapFunctionEnvironment
unwrapFunctionEnvironment: () => void;
Given an arbitrary function, process its content as if it were an arrow function, moving references to "this", "arguments", "super", and such into the function's parent scope. This method is useful if you have wrapped some set of items in an IIFE or other function, but want "this", "arguments", and super" to continue behaving as expected.
method updateSiblingKeys
updateSiblingKeys: (fromIndex: number, incrementBy: number) => void;
Update all sibling node paths after
fromIndex
byincrementBy
.
method visit
visit: () => boolean;
method willIMaybeExecuteBefore
willIMaybeExecuteBefore: (target: NodePath) => boolean;
Check if the current path will maybe execute before another path
class Scope
class Scope {}
constructor
constructor(path: NodePath<Node>, parentScope?: Scope);
This searches the current "scope" and collects all references/bindings within.
property bindings
bindings: { [name: string]: Binding };
property block
block: Node;
property contextVariables
static contextVariables: string[];
Variables available in current context.
property crawling
crawling: boolean;
property data
data: Record<string | symbol, unknown>;
property globals
static globals: string[];
property globals
globals: { [name: string]: any };
property hub
hub: HubInterface;
property labels
labels: Map<string, NodePath<t.LabeledStatement>>;
property parent
parent: Scope;
property parentBlock
parentBlock: Node;
property path
path: NodePath<Node>;
property references
references: { [name: string]: true };
property uid
uid: number;
property uids
uids: { [name: string]: boolean };
method addGlobal
addGlobal: (node: t.Identifier | t.JSXIdentifier) => void;
method bindingIdentifierEquals
bindingIdentifierEquals: (name: string, node: Node) => boolean;
method buildUndefinedNode
buildUndefinedNode: () => t.UnaryExpression;
method checkBlockScopedCollisions
checkBlockScopedCollisions: ( local: Binding, kind: BindingKind, name: string, id: object) => void;
method crawl
crawl: () => 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: Node, defaultName?: string) => t.Identifier;
Generate a unique identifier based on a node.
method getAllBindings
getAllBindings: () => Record<string, Binding>;
Walks the scope tree and gathers **all** bindings.
method getAllBindingsOfKind
getAllBindingsOfKind: (...kinds: string[]) => Record<string, Binding>;
Walks the scope tree and gathers all declarations of
kind
.
method getBinding
getBinding: (name: string) => Binding | undefined;
method getBindingIdentifier
getBindingIdentifier: (name: string) => t.Identifier;
method getBlockParent
getBlockParent: () => Scope;
Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the very top and hit Program.
method getData
getData: (key: string) => any;
Recursively walk up scope tree looking for the data
key
.
method getFunctionParent
getFunctionParent: () => Scope | null;
Walk up the scope tree until we hit either a Function or return null.
method getLabel
getLabel: (name: string) => NodePath<t.LabeledStatement> | undefined;
method getOwnBinding
getOwnBinding: (name: string) => Binding | undefined;
method getOwnBindingIdentifier
getOwnBindingIdentifier: (name: string) => t.Identifier;
method getPatternParent
getPatternParent: () => Scope;
Walk up from a pattern scope (function param initializer) until we hit a non-pattern scope, then returns its block parent
Returns
An ancestry scope whose path is a block parent
method getProgramParent
getProgramParent: () => Scope;
Walk up to the top of the scope tree and get the
Program
.
method hasBinding
hasBinding: ( name: string, optsOrNoGlobals?: boolean | { noGlobals?: boolean; noUids?: boolean }) => boolean;
method hasGlobal
hasGlobal: (name: string) => boolean;
method hasLabel
hasLabel: (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: Node, constantsOnly?: boolean) => boolean;
method isStatic
isStatic: (node: 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: 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, opts?: { noGlobals?: boolean; noUids?: boolean }) => boolean;
method push
push: (opts: { id: t.LVal; init?: t.Expression; unique?: boolean; _blockHoist?: number | undefined; kind?: 'var' | 'let' | 'const';}) => void;
method registerBinding
registerBinding: ( kind: BindingKind, path: NodePath, bindingPath?: NodePath) => void;
method registerConstantViolation
registerConstantViolation: (path: NodePath) => void;
method registerDeclaration
registerDeclaration: (path: NodePath) => void;
method registerLabel
registerLabel: (path: NodePath<t.LabeledStatement>) => void;
method removeBinding
removeBinding: (name: string) => void;
method removeData
removeData: (key: string) => void;
Recursively walk up scope tree looking for the data
key
and if it exists, remove it.
method removeOwnBinding
removeOwnBinding: (name: string) => void;
method rename
rename: (oldName: string, newName?: string, block?: Node) => void;
method setData
setData: (key: string, val: any) => any;
Set some arbitrary data on the current scope.
method toArray
toArray: ( node: t.Node, i?: number | boolean, arrayLikeIsIterable?: boolean) => t.ArrayExpression | t.CallExpression | t.Identifier;
method traverse
traverse: { <S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void; (node: any, opts?: TraverseOptions<Node>, state?: any): void;};
Traverse node with current scope and path.
Interfaces
interface HubInterface
interface HubInterface {}
method addHelper
addHelper: (name: string) => any;
method buildError
buildError: (node: Node, msg: string, Error: ErrorConstructor) => Error;
method getCode
getCode: () => string | undefined;
method getScope
getScope: () => Scope | undefined;
interface TraversalContext
interface TraversalContext<S = unknown> {}
property opts
opts: TraverseOptions;
property parentPath
parentPath: NodePath;
property scope
scope: Scope;
property state
state: S;
interface VirtualTypeAliases
interface VirtualTypeAliases {}
property BindingIdentifier
BindingIdentifier: t.Identifier;
property BlockScoped
BlockScoped: Node;
property ExistentialTypeParam
ExistentialTypeParam: t.ExistsTypeAnnotation;
property Flow
Flow: t.Flow | t.ImportDeclaration | t.ExportDeclaration | t.ImportSpecifier;
property ForAwaitStatement
ForAwaitStatement: t.ForOfStatement;
property Generated
Generated: Node;
property NumericLiteralTypeAnnotation
NumericLiteralTypeAnnotation: t.NumberLiteralTypeAnnotation;
property Pure
Pure: Node;
property Referenced
Referenced: Node;
property ReferencedIdentifier
ReferencedIdentifier: t.Identifier | t.JSXIdentifier;
property ReferencedMemberExpression
ReferencedMemberExpression: t.MemberExpression;
property RestProperty
RestProperty: t.RestElement;
property Scope
Scope: t.Scopable | t.Pattern;
property SpreadProperty
SpreadProperty: t.RestElement;
property User
User: Node;
property Var
Var: t.VariableDeclaration;
interface VisitNodeObject
interface VisitNodeObject<S, P extends Node> {}
Type Aliases
type BindingKind
type BindingKind = | 'var' | 'let' | 'const' | 'module' | 'hoisted' | 'param' | 'local' | 'unknown';
type NodeKeyOfArrays
type NodeKeyOfArrays<T extends Node> = { [P in keyof T]-?: T[P] extends Array<Node | null | undefined> ? P : never;}[keyof T];
type NodeKeyOfNodes
type NodeKeyOfNodes<T extends Node> = { [P in keyof T]-?: T[P] extends Node | null | undefined ? P : never;}[keyof T];
type NodePathResult
type NodePathResult<T> = | (Extract<T, Node | null | undefined> extends never ? never : NodePath<Extract<T, Node | null | undefined>>) | (T extends Array<Node | null | undefined> ? Array<NodePath<T[number]>> : never);
type NodePaths
type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[] ? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> } : T extends Node ? [NodePath<T>] : never;
type TraverseOptions
type TraverseOptions<S = Node> = { scope?: Scope; noScope?: boolean; denylist?: NodeType[]; /** @deprecated will be removed in Babel 8 */ blacklist?: NodeType[]; shouldSkip?: (node: NodePath) => boolean;} & Visitor<S>;
type VisitNode
type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
type VisitNodeFunction
type VisitNodeFunction<S, P extends Node> = ( this: S, path: NodePath<P>, state: S) => void;
type Visitor
type Visitor<S = unknown> = VisitNodeObject<S, Node> & { [N in Node as N['type']]?: VisitNode< S, N extends { type: N['type'] } ? N : never >;} & { [K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>;} & { [K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]>;} & { // Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is // too complex for TS. So we type it as a general visitor only if the key contains `|` // this is good enough for non-visitor traverse options e.g. `noScope` [k: `${string}|${string}`]: VisitNode<S, Node>;};
Namespaces
namespace cache
namespace cache {}
variable path
let path: WeakMap<t.Node, Map<t.Node, NodePath<Node>>>;
variable scope
let scope: WeakMap<t.Node, Scope>;
function clear
clear: () => void;
function clearPath
clearPath: () => void;
function clearScope
clearScope: () => void;
namespace visitors
namespace visitors {}
function explode
explode: <S = unknown>(visitor: Visitor<S>) => {};
explode()
will take aVisitor
object with all of the various shorthands that we support, and validates & normalizes it into a common format, ready to be used in traversal.The various shorthands are: -
Identifier() { ... }
->Identifier: { enter() { ... } }
-"Identifier|NumericLiteral": { ... }
->Identifier: { ... }, NumericLiteral: { ... }
- Aliases in@babel/types
: e.g.Property: { ... }
->ObjectProperty: { ... }, ClassProperty: { ... }
Other normalizations are: - Visitors of virtual types are wrapped, so that they are only visited when their dynamic check passes -
enter
andexit
functions are wrapped in arrays, to ease merging of visitors
function merge
merge: { <State>(visitors: Array<Visitor<State>>): Visitor<State>; ( visitors: Visitor<unknown>[], states?: any[], wrapper?: ( stateKey: any, visitorKey: any, func: VisitNodeFunction<unknown, Node> ) => VisitNodeFunction<unknown, Node> ): Visitor<unknown>;};
function verify
verify: (visitor: Visitor) => 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 12431 ms. - Missing or incorrect documentation? Open an issue for this package.