Whether the surface is spell checked; the browser default until set.
Intercept keydown before the keymap runs; return true to consume the event (suggestion popups take Enter/Arrows while open). Returns a disposer.
Give the surface keyboard focus without moving the page.
A bare HTMLElement.focus() scrolls the caret into view, and the caret
can be thousands of pixels from whatever the reader is actually looking
at. Every caller of this method is handing focus back after a piece of
chrome took it (a menu, the command palette, a dialog) and none of them
means "take me to the caret": the page simply jumped. So focus moves and
the viewport does not. To deliberately reveal the caret, which is a
different intention, call scrollSelectionIntoView.
Scroll the caret into view, the least the scrollers involved allow.
The counterpart to focus: navigation (an outline entry, a search hit) means to move the reader, so it says so rather than relying on a side effect of focusing.
Install (or clear, with null) an independent decoration layer.
Extensions each own a key: code highlighting, search matches and
track-change ranges compose without clobbering one another.
Toggle read-only mode.
Highlight inline ranges (find & replace matches) as decorations, never stored in the document. Pass an empty array to clear.
Turn the browser's spell checking of the surface on or off. Set as the
content attribute rather than the IDL property, so it survives a DOM that
does not reflect spellcheck (and shows up in the markup for tests).
Switching it off is enough on its own. The browser drops the marks it has
already drawn. Switching it back on is not: the text is not new to the
spell checker, so nothing is re-scanned and the surface stays unmarked
until the next edit happens to touch a block. refreshTextNodes below is
what makes it look new.
Pull the browser selection into the model. selectionchange is
asynchronous, so anything acting outside the input pipeline, a toolbar
button, which suppresses focus changes, must call this first to avoid
operating on a stale selection.
Re-render from the editor state and push the selection into the DOM.
Advanced API: the renderer's DOM↔model mapping, used by adapters.