Interface: MdastImportVisitor<UN>

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

Type parameters

NameTypeDescription
UNextends Mdast.NodesThe type of the mdast node that is being visited.

Table of contents

Methods

Properties

Methods

visitNode

visitNode(params): void

Parameters

NameTypeDescription
paramsObject-
params.actionsObjectA set of convenience utilities that can be used to add nodes to the lexical tree.
params.actions.addAndStepInto(lexicalNode: LexicalNode) => void-
params.actions.addFormatting(format: 1 | 2 | 8 | 16, node?: null | Parent) => void-
params.actions.getParentFormatting() => number-
params.actions.removeFormatting(format: 1 | 2 | 8 | 16, node?: null | Parent) => void-
params.actions.visitChildren(node: Parent, lexicalParent: LexicalNode) => void-
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

priority

Optional priority: number

Default 0, optional, sets the priority of the visitor. The higher the number, the earlier it will be called.


testNode

testNode: string | (mdastNode: Nodes, options: Descriptors) => boolean

The 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.

Param

the registered descriptors for composite nodes (jsx, directives, code blocks).