diff options
| author | Shulhan <ms@kilabit.info> | 2021-08-15 23:56:49 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-08-15 23:56:49 +0700 |
| commit | 4912019d4e3df64fde43bcfd6a8f0519e15c8af3 (patch) | |
| tree | 6d7992f412831551f46fd18862f6093947602729 /editor/editor.d.ts | |
| parent | 19d01aa025cf672f8ea5dd18eda7bf3f2466318f (diff) | |
| download | pakakeh.ts-4912019d4e3df64fde43bcfd6a8f0519e15c8af3.tar.xz | |
editor: add method to get file and selection range
The GetFile method return the current file as IVfsNode, including its
content (concatenated).
The GetSelectionRange return the current selection on the editor.
Diffstat (limited to 'editor/editor.d.ts')
| -rw-r--r-- | editor/editor.d.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/editor.d.ts b/editor/editor.d.ts index dba9e3a..ba4fade 100644 --- a/editor/editor.d.ts +++ b/editor/editor.d.ts @@ -22,6 +22,8 @@ export declare class Editor { private isKeyControl; private unre; constructor(opts: IEditor); + GetFile(): IVfsNode; + GetSelectionRange(): SelectionRange; OpenFile(path: string): Promise<Response>; SaveFile(node: IVfsNode): Response; clearSelection(): void; @@ -47,4 +49,8 @@ interface ActionChanges { nextLine: number; nextText: string; } +interface SelectionRange { + BeginAt: number; + EndAt: number; +} export {}; |
