fn

sliceFromSelection

tested

The 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

ParameterTypeDescription
docWritekitDocument—
selectionSelection—

Returns

Slice | null