diff options
| author | Shulhan <ms@kilabit.info> | 2021-08-28 22:28:01 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-08-28 22:29:37 +0700 |
| commit | 51e7db8b61ec21628fc0ed2f5f48bfff47962684 (patch) | |
| tree | badf3236a140f228fbdbf2315c65e3b7c2f51e99 /editor/editor.d.ts | |
| parent | c246299101e47c28e064dbeacdbe718909bd7f17 (diff) | |
| download | pakakeh.ts-51e7db8b61ec21628fc0ed2f5f48bfff47962684.tar.xz | |
editor: listen on key Escape on document to clear selection
Previously, to clear selection, user must set the editor to active
by selecting any line.
This commit allow user to clear selection by pressing "Escape" anywhere
on the document.
While at it, add methods to turn on or off the editor editability.
Diffstat (limited to 'editor/editor.d.ts')
| -rw-r--r-- | editor/editor.d.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/editor.d.ts b/editor/editor.d.ts index 2784506..14f3675 100644 --- a/editor/editor.d.ts +++ b/editor/editor.d.ts @@ -26,10 +26,12 @@ export declare class WuiEditor { GetSelectionRange(): WuiEditorSelectionRangeInterface; OnClickText(text: HTMLElement): void; OnKeyup(x: number, text: HTMLElement, ev: KeyboardEvent): boolean | undefined; - OnKeydown(x: number, el_text: HTMLElement, ev: KeyboardEvent): false | undefined; + OnKeydownOnLine(x: number, el_text: HTMLElement, ev: KeyboardEvent): false | undefined; OnMouseDownAtLine(x: number): void; OnMouseUpAtLine(x: number): void; - OpenFile(path: string): Promise<WuiVfsResponseInterface>; + SetEditOff(): void; + SetEditOn(): void; + OpenFile(path: string): Promise<WuiResponseInterface>; private clearSelection; private initStyle; private doJoin; @@ -39,6 +41,7 @@ export declare class WuiEditor { private doUndo; private deleteLine; private insertNewline; + private onKeyupDocument; private render; private setCaret; } |
