fn

orderedSelection

tested

Endpoints of a text selection in document order (from before to). Within one block they are ordered by offset; across blocks by block index.

Signature

ts
export function orderedSelection(sel: TextSelection, doc: WritekitDocument):{ ... }

Parameters

ParameterTypeDescription
selTextSelection—
docWritekitDocument—

Returns

{ from: Position; to: Position }
PropertyTypeDescription
fromPosition—
toPosition—