FindNamespaceNEW
FindNamespace:
The Find namespace on DocAuthEditor. Lets hosts drive the editor’s Find bar
programmatically — open it with a preset query, close it, or read whether it is open.
Example
Section titled “Example”// Open the Find bar with a preset queryeditor.find.open({ query: 'hello' });
// Close it programmaticallyeditor.find.close();
// Drive a Find button in your own chromeconst toggleFind = () => (editor.find.getState().open ? editor.find.close() : editor.find.open());Methods
Section titled “Methods”open()
Section titled “open()”open(
opts?):void
Opens the Find bar and focuses its input.
Calling open() while the bar is already open with no state delta is a no-op — it does
not refocus the input.
Parameters
Section titled “Parameters”Optional overrides for the bar’s persisted state.
query— preset the search text. Overrides any persisted value.
query?
Section titled “query?”Returns
Section titled “Returns”close()
Section titled “close()”close():
void
Closes the Find bar. Match decorations are cleared. Calling close() while already
closed is a no-op.
Returns
Section titled “Returns”getState()
Section titled “getState()”getState():
object
Reads the current state of the Find bar.
Use this to keep host-rendered Find affordances in sync — the bar can also be opened
with Mod+F and closed from inside the bar (Escape or its close button), so a host
that tracks the state itself will drift.
Returns
Section titled “Returns”An object with open — whether the Find bar is currently shown.
open:
boolean