diff --git a/ts/editor/EditingArea.svelte b/ts/editor/EditingArea.svelte index be5654a79..8aa156bed 100644 --- a/ts/editor/EditingArea.svelte +++ b/ts/editor/EditingArea.svelte @@ -7,7 +7,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import contextProperty from "../sveltelib/context-property"; - export interface EditingInputAPI { + export interface FocusableInputAPI { readonly name: string; focusable: boolean; /** @@ -22,6 +22,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html refocus(): void; } + export interface EditingInputAPI extends FocusableInputAPI { + /** + * Check whether blurred target belongs to an editing input. + * The editing area can then restore focus to this input. + * + * @returns An editing input api that is associated with the event target. + */ + getInputAPI(target: EventTarget): Promise; + } + export interface EditingAreaAPI { content: Writable; editingInputs: Writable; @@ -36,7 +46,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html