LexicalVisitActions interface
A set of covenience utilities to manipulate the mdast tree when processing lexical nodes.
Signature:
export interface LexicalVisitActions<T extends LexicalNode>
Methods
Method | Description |
---|---|
addAndStepInto(type, props, hasChildren) | Create a new mdast node with the given type, and props. Iterate over the immediate children of the current lexical node with the new mdast node as a parent. |
appendToParent(parentNode, node) | Append a new mdast node to a parent node. |
registerReferredComponent(componentName) | Used when processing JSX nodes so that later, the correct import statement can be added to the document. |
visitChildren(node, mdastParent) | Iterate over the immediate children of a lexical node with the given mdast node as a parent. |