I
SelectionBridge
Maps the native `Selection`/`Range` (over the single editable root) to model coordinates and back.
Signature
ts
interface SelectionBridgeProperties
| Property | Type | Description |
|---|---|---|
read | () => Selection | null | Read the native selection as a model selection (null if outside editor). |
write | (selection: Selection) => void | Apply a model selection to the native selection (focusing the root). |
save | () => Selection | null | Snapshot the current model selection. |
restore | (selection: Selection | null) => void | Restore a previously saved selection. |
domPointToOffset | (host: HTMLElement, node: Node, offset: number) => number | — |
offsetToDomPoint | (host: HTMLElement, offset: number) => { node: Node; offset: number; } | — |