Interface: MdastImportVisitor<UN>

Implement this interface to convert certian mdast nodes into lexical nodes.

Type parameters

Type parameterDescription
UN extends Mdast.NodesThe type of the mdast node that is being visited.

Methods

visitNode()

visitNode(params): void

Parameters

ParameterTypeDescription
paramsobject-
params.actionsobjectA set of convenience utilities that can be used to add nodes to the lexical tree.
params.actions.addAndStepInto-
params.actions.addFormatting-
params.actions.getParentFormatting-
params.actions.removeFormatting-
params.actions.visitChildren-
params.descriptorsDescriptorsThe descriptors for composite nodes (jsx, directives, code blocks).
params.lexicalParentLexicalNodeThe parent lexical node to which the results of the processing should be added.
params.mdastNodeUNThe node that is currently being visited.
params.mdastParentnull | ParentThe MDAST parent of the node that is currently being visited.

Returns

void

Properties

PropertyTypeDescription
priority?numberDefault 0, optional, sets the priority of the visitor. The higher the number, the earlier it will be called.
testNodestring | (mdastNode, descriptors) => booleanThe test function that determines if this visitor should be used for the given node. As a convenience, you can also pass a string here, which will be compared to the node's type.Paramthe registered descriptors for composite nodes (jsx, directives, code blocks).