Skip to content

Type Editor


Type Editor / @type-editor/commands / split-block / SplitNodeFunction

Type Alias: SplitNodeFunction()

ts
type SplitNodeFunction = (
  node,
  atEnd,
  $from,
) => {
  attrs?: Attrs;
  type: NodeType;
} | null;

Defined in: split-block.ts:138

Function type for customizing the node type of newly split blocks.

Parameters

ParameterTypeDescription
nodePmNodeThe node being split
atEndbooleanWhether the split is at the end of the node
$fromResolvedPosThe resolved position where the split occurs

Returns

| { attrs?: Attrs; type: NodeType; } | null

The type and optional attributes for the new block, or null to use default behavior