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
| Parameter | Type | Description |
|---|---|---|
node | PmNode | The node being split |
atEnd | boolean | Whether the split is at the end of the node |
$from | ResolvedPos | The 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