fn

createSlice

tested

Signature

ts
export function createSlice(blocks: readonly Node[], openStart = false, openEnd = false): Slice{ ... }

Parameters

ParameterTypeDescription
blocksreadonly Node[]—
openStart?boolean—
openEnd?boolean—

Returns

Slice
PropertyTypeDescription
blocksreadonly Node[]—
openStartbooleanThe first block's runs continue the block the caret is in — no boundary before them.
openEndbooleanThe last block stays open: the caret lands inside it and the tail of the split block joins it.