Skip to content

typeIntoEditor

Types text into a CodeMirror editor using trusted keyboard input, injected by the host over CDP.

Focuses the editor (caret to the end), presses every code point of the text, then polls until the document reflects the input or a bounded timeout elapses.

Import:

import { typeIntoEditor } from 'obsidian-dev-utils/obsidian/mobile-trusted-input';

Signature:

function typeIntoEditor(params: TypeIntoEditorParams): Promise<void>

Parameters:

ParameterTypeDescription
paramsTypeIntoEditorParamsThe editor to type into and the text to type.

Returns: Promise<void> — A Promise that resolves once the keystrokes have settled.