fn
sliceFromSelection
testedThe fragment covered by a selection, or null when there is nothing to copy.
A text range is open at both ends; a node selection is whole blocks.
Signature
ts
export function sliceFromSelection(doc: WritekitDocument, selection: Selection): Slice | null{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
doc | WritekitDocument | — |
selection | Selection | — |
Returns
Slice | null