@types/estraverse
- Version 5.1.7
- Published
- 7.32 kB
- 1 dependency
- MIT license
Install
npm i @types/estraverse
yarn add @types/estraverse
pnpm add @types/estraverse
Overview
TypeScript definitions for estraverse
Index
Variables
variable Syntax
const Syntax: Syntax;
variable VisitorKeys
const VisitorKeys: VisitorKeys;
Functions
function attachComments
attachComments: ( tree: ESTree.Node, providedComments: ESTree.Comment[], tokens: ESTree.Node[]) => ESTree.Node;
function cloneEnvironment
cloneEnvironment: () => typeof ESTraverse;
function replace
replace: (root: ESTree.Node, visitor: Visitor) => ESTree.Node;
function traverse
traverse: (root: ESTree.Node, visitor: Visitor) => void;
Classes
class Controller
class Controller {}
method break
break: () => void;
Break the traversals.
method current
current: () => ESTree.Node;
The current node.
method notify
notify: (flag: VisitorOption) => void;
Notify the controller to break the traversals, skip the child nodes of current node or remove the current node.
method parents
parents: () => ESTree.Node[];
An array of parent elements.
method path
path: () => Array<string | number> | null;
Obtain the property paths array from root to the current node.
method remove
remove: () => void;
Remove the current node.
method replace
replace: (root: ESTree.Node, visitor: Visitor) => ESTree.Node;
Traverse and replace the AST.
method skip
skip: () => void;
Skip the child nodes of current node.
method traverse
traverse: (root: ESTree.Node, visitor: Visitor) => void;
Traverse the AST.
method type
type: () => string;
The type of current node.
Interfaces
interface Syntax
interface Syntax extends Record<NodeType, NodeType> {}
interface Visitor
interface Visitor {}
property enter
enter?: // eslint-disable-next-line @typescript-eslint/no-invalid-void-type| (( this: Controller, node: ESTree.Node, parent: ESTree.Node | null ) => VisitorOption | ESTree.Node | void) | undefined;
property fallback
fallback?: | 'iteration' | ((this: Controller, node: ESTree.Node) => string[]) | undefined;
property keys
keys?: Record<string, string[]> | undefined;
property leave
leave?: // eslint-disable-next-line @typescript-eslint/no-invalid-void-type| (( this: Controller, node: ESTree.Node, parent: ESTree.Node | null ) => VisitorOption | ESTree.Node | void) | undefined;
interface VisitorKeys
interface VisitorKeys extends Record<NodeType, string[]> {}
Enums
enum VisitorOption
enum VisitorOption { Break, Skip, Remove,}
Type Aliases
type NodeType
type NodeType = | 'AssignmentExpression' | 'AssignmentPattern' | 'ArrayExpression' | 'ArrayPattern' | 'ArrowFunctionExpression' | 'AwaitExpression' | 'BlockStatement' | 'BinaryExpression' | 'BreakStatement' | 'CallExpression' | 'CatchClause' | 'ClassBody' | 'ClassDeclaration' | 'ClassExpression' | 'ComprehensionBlock' | 'ComprehensionExpression' | 'ConditionalExpression' | 'ContinueStatement' | 'DebuggerStatement' | 'DirectiveStatement' | 'DoWhileStatement' | 'EmptyStatement' | 'ExportAllDeclaration' | 'ExportDefaultDeclaration' | 'ExportNamedDeclaration' | 'ExportSpecifier' | 'ExpressionStatement' | 'ForStatement' | 'ForInStatement' | 'ForOfStatement' | 'FunctionDeclaration' | 'FunctionExpression' | 'GeneratorExpression' | 'Identifier' | 'IfStatement' | 'ImportExpression' | 'ImportDeclaration' | 'ImportDefaultSpecifier' | 'ImportNamespaceSpecifier' | 'ImportSpecifier' | 'Literal' | 'LabeledStatement' | 'LogicalExpression' | 'MemberExpression' | 'MetaProperty' | 'MethodDefinition' | 'ModuleSpecifier' | 'NewExpression' | 'ObjectExpression' | 'ObjectPattern' | 'Program' | 'Property' | 'RestElement' | 'ReturnStatement' | 'SequenceExpression' | 'SpreadElement' | 'Super' | 'SwitchStatement' | 'SwitchCase' | 'TaggedTemplateExpression' | 'TemplateElement' | 'TemplateLiteral' | 'ThisExpression' | 'ThrowStatement' | 'TryStatement' | 'UnaryExpression' | 'UpdateExpression' | 'VariableDeclaration' | 'VariableDeclarator' | 'WhileStatement' | 'WithStatement' | 'YieldExpression';
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/estraverse
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/estraverse)
- HTML<a href="https://www.jsdocs.io/package/@types/estraverse"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1709 ms. - Missing or incorrect documentation? Open an issue for this package.