@lvce-editor/rpc-registry 2.72.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/index.d.ts +3 -27
  2. package/dist/index.js +1 -1000
  3. package/dist/parts/BulkReplacementEdit/BulkReplacementEdit.js +1 -0
  4. package/dist/parts/Change/Change.js +1 -0
  5. package/dist/parts/ClipBoardProcess/ClipBoardProcess.js +3 -0
  6. package/dist/parts/ClipBoardProcessApi/ClipBoardProcessApi.js +1 -0
  7. package/dist/parts/ClipBoardWorker/ClipBoardWorker.js +19 -0
  8. package/dist/parts/ClipBoardWorkerApi/ClipBoardWorkerApi.js +1 -0
  9. package/dist/parts/ConfirmPromptOptions/ConfirmPromptOptions.js +1 -0
  10. package/dist/parts/CreateLazyRpc/CreateLazyRpc.js +25 -0
  11. package/dist/parts/DebugWorker/DebugWorker.js +3 -0
  12. package/dist/parts/DebugWorkerApi/DebugWorkerApi.js +1 -0
  13. package/dist/parts/EditorWorker/EditorWorker.js +68 -0
  14. package/dist/parts/EditorWorkerApi/EditorWorkerApi.js +1 -0
  15. package/dist/parts/EmbedsProcess/EmbedsProcess.js +3 -0
  16. package/dist/parts/EmbedsProcessApi/EmbedsProcessApi.js +1 -0
  17. package/dist/parts/ErrorWorker/ErrorWorker.js +3 -0
  18. package/dist/parts/ErrorWorkerApi/ErrorWorkerApi.js +1 -0
  19. package/dist/parts/ExtensionHost/ExtensionHost.js +15 -0
  20. package/dist/parts/ExtensionHostWorkerApi/ExtensionHostWorkerApi.js +1 -0
  21. package/dist/parts/FileSystemProcess/FileSystemProcess.js +56 -0
  22. package/dist/parts/FileSystemProcessApi/FileSystemProcessApi.js +1 -0
  23. package/dist/parts/FileSystemWorker/FileSystemWorker.js +53 -0
  24. package/dist/parts/FileSystemWorkerApi/FileSystemWorkerApi.js +1 -0
  25. package/dist/parts/GetIpcType/GetIpcType.js +13 -0
  26. package/dist/parts/IpcType/IpcType.js +5 -0
  27. package/dist/parts/LazyRpc/LazyRpc.js +1 -0
  28. package/dist/parts/Main/Main.js +21 -0
  29. package/dist/parts/MainProcess/MainProcess.js +3 -0
  30. package/dist/parts/MainProcessApi/MainProcessApi.js +1 -0
  31. package/dist/parts/MarkdownWorker/MarkdownWorker.js +11 -0
  32. package/dist/parts/MarkdownWorkerApi/MarkdownWorkerApi.js +1 -0
  33. package/dist/parts/PositionAtCursor/PositionAtCursor.js +1 -0
  34. package/dist/parts/RendererProcess/RendererProcess.js +15 -0
  35. package/dist/parts/RendererProcessApi/RendererProcessApi.js +1 -0
  36. package/dist/parts/RendererWorker/RendererWorker.js +257 -0
  37. package/dist/parts/RendererWorkerApi/RendererWorkerApi.js +1 -0
  38. package/dist/parts/RpcFactory/RpcFactory.js +24 -0
  39. package/dist/parts/RpcFactoryResult/RpcFactoryResult.js +1 -0
  40. package/dist/parts/RpcId/RpcId.js +2 -0
  41. package/dist/parts/RpcRegistry/RpcRegistry.js +10 -0
  42. package/dist/parts/RuntimeStatus/RuntimeStatus.js +1 -0
  43. package/dist/parts/SearchProcess/SearchProcess.js +16 -0
  44. package/dist/parts/SearchProcessApi/SearchProcessApi.js +1 -0
  45. package/dist/parts/SearchResult/SearchResult.js +1 -0
  46. package/dist/parts/SharedProcess/SharedProcess.js +3 -0
  47. package/dist/parts/SharedProcessApi/SharedProcessApi.js +1 -0
  48. package/dist/parts/SyntaxHighlightingWorker/SyntaxHighlightingWorker.js +3 -0
  49. package/dist/parts/SyntaxHighlightingWorkerApi/SyntaxHighlightingWorkerApi.js +1 -0
  50. package/dist/parts/TextEdit/TextEdit.js +1 -0
  51. package/package.json +3 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.ClipBoardProcess);
@@ -0,0 +1,19 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.ClipBoardWorker);
4
+ export const writeText = async (text) => {
5
+ // @ts-ignore
6
+ return invoke('ClipBoard.writeText', text);
7
+ };
8
+ export const readText = async () => {
9
+ // @ts-ignore
10
+ return invoke('ClipBoard.readText');
11
+ };
12
+ export const writeImage = async (image) => {
13
+ // @ts-ignore
14
+ return invoke('ClipBoard.writeImage', image);
15
+ };
16
+ export const readNativeFiles = async () => {
17
+ // @ts-ignore
18
+ return invoke('ClipBoard.readNativeFiles');
19
+ };
@@ -0,0 +1,25 @@
1
+ import * as RpcRegistry from "../RpcRegistry/RpcRegistry.js";
2
+ export const createLazyRpc = (rpcId) => {
3
+ let rpcPromise;
4
+ let factory;
5
+ const createRpc = async () => {
6
+ const rpc = await factory();
7
+ RpcRegistry.set(rpcId, rpc);
8
+ };
9
+ const ensureRpc = async () => {
10
+ if (!rpcPromise) {
11
+ rpcPromise = createRpc();
12
+ }
13
+ await rpcPromise;
14
+ };
15
+ return {
16
+ setFactory(value) {
17
+ factory = value;
18
+ },
19
+ async invoke(method, ...params) {
20
+ await ensureRpc();
21
+ const rpc = RpcRegistry.get(rpcId);
22
+ return rpc.invoke(method, ...params);
23
+ },
24
+ };
25
+ };
@@ -0,0 +1,3 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.DebugWorker);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,68 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.EditorWorker);
4
+ export const sendMessagePortToExtensionHostWorker = async (port) => {
5
+ const command = 'HandleMessagePort.handleMessagePort2';
6
+ await invokeAndTransfer(
7
+ // @ts-ignore
8
+ 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, 0);
9
+ };
10
+ // TODO add tests for this
11
+ export const activateByEvent = async (event) => {
12
+ // @ts-ignore
13
+ await invoke('ActivateByEvent.activateByEvent', event);
14
+ };
15
+ export const applyEdit = async (editorUid, changes) => {
16
+ // @ts-ignore
17
+ await invoke('Editor.applyEdit2', editorUid, changes);
18
+ };
19
+ export const applyWorkspaceEdit = async (editorUid, changes) => {
20
+ // @ts-ignore
21
+ await invoke('Editor.applyWorkspaceEdit', editorUid, changes);
22
+ };
23
+ export const closeWidget = async (editorUid, widgetId, widgetName, focusId) => {
24
+ // @ts-ignore
25
+ await invoke('Editor.closeWidget2', editorUid, widgetId, widgetName, focusId);
26
+ };
27
+ export const getWordAt = async (uid, rowIndex, columnIndex) => {
28
+ // @ts-ignore
29
+ const word = await invoke('Editor.getWordAt2', uid, rowIndex, columnIndex);
30
+ return word;
31
+ };
32
+ export const getLines = async (editorUid) => {
33
+ const lines = await invoke('Editor.getLines2', editorUid);
34
+ return lines;
35
+ };
36
+ export const getPositionAtCursor = async (parentUid) => {
37
+ const position = await invoke('Editor.getPositionAtCursor', parentUid);
38
+ return position;
39
+ };
40
+ export const getOffsetAtCursor = async (editorId) => {
41
+ // @ts-ignore
42
+ return await invoke('Editor.getOffsetAtCursor', editorId);
43
+ };
44
+ export const getSelections = async (editorUid) => {
45
+ const selections = await invoke('Editor.getSelections2', editorUid);
46
+ return selections;
47
+ };
48
+ export const getWordAtOffset2 = async (editorUid) => {
49
+ return invoke('Editor.getWordAtOffset2', editorUid);
50
+ };
51
+ export const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
52
+ return invoke('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
53
+ };
54
+ export const updateDebugInfo = async (info) => {
55
+ await invoke('Editor.updateDebugInfo', info);
56
+ };
57
+ export const getUri = async (editorUid) => {
58
+ // @ts-ignore
59
+ return invoke('Editor.getUri', editorUid);
60
+ };
61
+ export const getLanguageId = async (editorUid) => {
62
+ // @ts-ignore
63
+ return invoke('Editor.getLanguageId', editorUid);
64
+ };
65
+ export const getProblems = async () => {
66
+ // @ts-ignore
67
+ return invoke('Editor.getProblems');
68
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.EmbedsProcess);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.ErrorWorker);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.ExtensionHostWorker);
4
+ export const executeReferenceProvider = async (id, offset) => {
5
+ // @ts-ignore
6
+ return invoke('ExtensionHostReference.executeReferenceProvider', id, offset);
7
+ };
8
+ export const executeFileReferenceProvider = async (id) => {
9
+ // @ts-ignore
10
+ return invoke('ExtensionHostReference.executeFileReferenceProvider', id);
11
+ };
12
+ export const getRuntimeStatus = async (extensionId) => {
13
+ // @ts-ignore
14
+ return invoke('ExtensionHost.getRuntimeStatus', extensionId);
15
+ };
@@ -0,0 +1,56 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.FileSystemProcess);
4
+ export const remove = async (uri) => {
5
+ return invoke('FileSystem.remove', uri);
6
+ };
7
+ export const readFile = async (uri) => {
8
+ return invoke('FileSystem.readFile', uri);
9
+ };
10
+ export const appendFile = async (uri, text) => {
11
+ // @ts-ignore
12
+ return invoke('FileSystem.appendFile', uri, text);
13
+ };
14
+ export const readDirWithFileTypes = async (uri) => {
15
+ return invoke('FileSystem.readDirWithFileTypes', uri);
16
+ };
17
+ export const getPathSeparator = async (root) => {
18
+ // @ts-ignore
19
+ return invoke('FileSystem.getPathSeparator', root);
20
+ };
21
+ export const readJson = async (root) => {
22
+ // @ts-ignore
23
+ return invoke('FileSystem.readJson', root);
24
+ };
25
+ export const getRealPath = async (path) => {
26
+ // @ts-ignore
27
+ return invoke('FileSystem.getRealPath', path);
28
+ };
29
+ export const stat = async (path) => {
30
+ // @ts-ignore
31
+ return invoke('FileSystem.stat', path);
32
+ };
33
+ export const writeFile = async (path, content) => {
34
+ // @ts-ignore
35
+ return invoke('FileSystem.writeFile', path, content);
36
+ };
37
+ export const mkdir = async (path) => {
38
+ // @ts-ignore
39
+ return invoke('FileSystem.mkdir', path);
40
+ };
41
+ export const rename = async (oldUri, newUri) => {
42
+ // @ts-ignore
43
+ return invoke('FileSystem.rename', oldUri, newUri);
44
+ };
45
+ export const copy = async (oldUri, newUri) => {
46
+ // @ts-ignore
47
+ return invoke('FileSystem.copy', oldUri, newUri);
48
+ };
49
+ export const getFolderSize = async (uri) => {
50
+ // @ts-ignore
51
+ return invoke('FileSystem.getFolderSize', uri);
52
+ };
53
+ export const exists = async (uri) => {
54
+ // @ts-ignore
55
+ return invoke('FileSystem.exists', uri);
56
+ };
@@ -0,0 +1,53 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.FileSystemWorker);
4
+ export const remove = async (dirent) => {
5
+ return invoke('FileSystem.remove', dirent);
6
+ };
7
+ export const readDirWithFileTypes = async (uri) => {
8
+ return invoke('FileSystem.readDirWithFileTypes', uri);
9
+ };
10
+ export const getPathSeparator = async (root) => {
11
+ // @ts-ignore
12
+ return invoke('FileSystem.getPathSeparator', root);
13
+ };
14
+ export const getRealPath = async (path) => {
15
+ return invoke('FileSystem.getRealPath', path);
16
+ };
17
+ export const stat = async (dirent) => {
18
+ return invoke('FileSystem.stat', dirent);
19
+ };
20
+ export const createFile = async (uri) => {
21
+ return invoke('FileSystem.writeFile', uri, '');
22
+ };
23
+ export const readFile = async (uri) => {
24
+ return invoke('FileSystem.readFile', uri);
25
+ };
26
+ export const writeFile = async (uri, content) => {
27
+ return invoke('FileSystem.writeFile', uri, content);
28
+ };
29
+ export const mkdir = async (uri) => {
30
+ return invoke('FileSystem.mkdir', uri);
31
+ };
32
+ export const rename = async (oldUri, newUri) => {
33
+ return invoke('FileSystem.rename', oldUri, newUri);
34
+ };
35
+ export const copy = async (oldUri, newUri) => {
36
+ return invoke('FileSystem.copy', oldUri, newUri);
37
+ };
38
+ export const exists = async (uri) => {
39
+ // @ts-ignore
40
+ return invoke('FileSystem.exists', uri);
41
+ };
42
+ export const getFolderSize = async (uri) => {
43
+ // @ts-ignore
44
+ return invoke('FileSystem.getFolderSize', uri);
45
+ };
46
+ export const readFileAsBlob = async (uri) => {
47
+ // @ts-ignore
48
+ return invoke('FileSystem.readFileAsBlob', uri);
49
+ };
50
+ export const appendFile = async (uri, text) => {
51
+ // @ts-ignore
52
+ return invoke('FileSystem.appendFile', uri, text);
53
+ };
@@ -0,0 +1,13 @@
1
+ import { ElectronUtilityProcess, NodeForkedProcess, NodeWorker } from "../IpcType/IpcType.js";
2
+ export const getIpcType = (argv) => {
3
+ if (argv.includes('--ipc-type=node-worker')) {
4
+ return NodeWorker;
5
+ }
6
+ if (argv.includes('--ipc-type=node-forked-process')) {
7
+ return NodeForkedProcess;
8
+ }
9
+ if (argv.includes('--ipc-type=electron-utility-process')) {
10
+ return ElectronUtilityProcess;
11
+ }
12
+ throw new Error(`[file-system-process] unknown ipc type`);
13
+ };
@@ -0,0 +1,5 @@
1
+ export const NodeWorker = 1;
2
+ export const NodeForkedProcess = 2;
3
+ export const ElectronUtilityProcess = 3;
4
+ export const ElectronMessagePort = 4;
5
+ export const WebSocket = 6;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ export * as ClipBoardProcess from "../ClipBoardProcess/ClipBoardProcess.js";
2
+ export * as ClipBoardWorker from "../ClipBoardWorker/ClipBoardWorker.js";
3
+ export * as DebugWorker from "../DebugWorker/DebugWorker.js";
4
+ export * as EditorWorker from "../EditorWorker/EditorWorker.js";
5
+ export * as EmbedsProcess from "../EmbedsProcess/EmbedsProcess.js";
6
+ export * as ErrorWorker from "../ErrorWorker/ErrorWorker.js";
7
+ export * as ExtensionHost from "../ExtensionHost/ExtensionHost.js";
8
+ export * as FileSystemProcess from "../FileSystemProcess/FileSystemProcess.js";
9
+ export * as FileSystemWorker from "../FileSystemWorker/FileSystemWorker.js";
10
+ export * as IpcType from "../IpcType/IpcType.js";
11
+ export * as MainProcess from "../MainProcess/MainProcess.js";
12
+ export * as MarkdownWorker from "../MarkdownWorker/MarkdownWorker.js";
13
+ export * as RendererProcess from "../RendererProcess/RendererProcess.js";
14
+ export * as RendererWorker from "../RendererWorker/RendererWorker.js";
15
+ export * as RpcId from "../RpcId/RpcId.js";
16
+ export * as SearchProcess from "../SearchProcess/SearchProcess.js";
17
+ export * as SharedProcess from "../SharedProcess/SharedProcess.js";
18
+ export * as SyntaxHighlightingWorker from "../SyntaxHighlightingWorker/SyntaxHighlightingWorker.js";
19
+ export * from "../CreateLazyRpc/CreateLazyRpc.js";
20
+ export * from "../GetIpcType/GetIpcType.js";
21
+ export * from "../RpcRegistry/RpcRegistry.js";
@@ -0,0 +1,3 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.MainProcess);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.MarkdownWorker);
4
+ export const getVirtualDom = async (html) => {
5
+ // @ts-ignore
6
+ return invoke('Markdown.getVirtualDom', html);
7
+ };
8
+ export const render = async (markdown, options) => {
9
+ // @ts-ignore
10
+ return invoke('Markdown.render', markdown, options);
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.RendererProcess);
4
+ export const readClipBoardText = async () => {
5
+ // @ts-ignore
6
+ return await invoke('ClipBoard.readText');
7
+ };
8
+ export const readClipBoard = async () => {
9
+ // @ts-ignore
10
+ return await invoke('ClipBoard.read');
11
+ };
12
+ export const writeClipBoard = async (options) => {
13
+ // @ts-ignore
14
+ await invoke('ClipBoard.write', options);
15
+ };
@@ -0,0 +1,257 @@
1
+ import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
+ import * as RpcId from "../RpcId/RpcId.js";
3
+ export const { invoke, invokeAndTransfer, set, dispose } = RpcFactory.create(RpcId.RendererWorker);
4
+ export const searchFileHtml = async (uri) => {
5
+ return invoke('ExtensionHost.searchFileWithHtml', uri);
6
+ };
7
+ export const getFilePathElectron = async (file) => {
8
+ return invoke('FileSystemHandle.getFilePathElectron', file);
9
+ };
10
+ export const showContextMenu = async (x, y, id, ...args) => {
11
+ return invoke('ContextMenu.show', x, y, id, ...args);
12
+ };
13
+ export const getElectronVersion = async () => {
14
+ return invoke('Process.getElectronVersion');
15
+ };
16
+ export const applyBulkReplacement = async (bulkEdits) => {
17
+ await invoke('BulkReplacement.applyBulkReplacement', bulkEdits);
18
+ };
19
+ export const setColorTheme = async (id) => {
20
+ // @ts-ignore
21
+ return invoke(/* ColorTheme.setColorTheme */ 'ColorTheme.setColorTheme', /* colorThemeId */ id);
22
+ };
23
+ export const getNodeVersion = async () => {
24
+ return invoke('Process.getNodeVersion');
25
+ };
26
+ export const getChromeVersion = async () => {
27
+ return invoke('Process.getChromeVersion');
28
+ };
29
+ export const getV8Version = async () => {
30
+ return invoke('Process.getV8Version');
31
+ };
32
+ export const getFileHandles = async (fileIds) => {
33
+ const files = await invoke('FileSystemHandle.getFileHandles', fileIds);
34
+ return files;
35
+ };
36
+ export const setWorkspacePath = async (path) => {
37
+ await invoke('Workspace.setPath', path);
38
+ };
39
+ export const registerWebViewInterceptor = async (id, port) => {
40
+ await invokeAndTransfer('WebView.registerInterceptor', id, port);
41
+ };
42
+ export const unregisterWebViewInterceptor = async (id) => {
43
+ await invoke('WebView.unregisterInterceptor', id);
44
+ };
45
+ export const sendMessagePortToEditorWorker = async (port, rpcId) => {
46
+ const command = 'HandleMessagePort.handleMessagePort';
47
+ // @ts-ignore
48
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
49
+ };
50
+ export const sendMessagePortToErrorWorker = async (port, rpcId) => {
51
+ const command = 'Errors.handleMessagePort';
52
+ // @ts-ignore
53
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
54
+ };
55
+ export const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
56
+ const command = 'Markdown.handleMessagePort';
57
+ // @ts-ignore
58
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
59
+ };
60
+ export const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
61
+ const command = 'FileSystem.handleMessagePort';
62
+ // @ts-ignore
63
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
64
+ };
65
+ export const readFile = async (uri) => {
66
+ return invoke('FileSystem.readFile', uri);
67
+ };
68
+ export const getWebViewSecret = async (key) => {
69
+ // @ts-ignore
70
+ return invoke('WebView.getSecret', key);
71
+ };
72
+ export const setWebViewPort = async (uid, port, origin, portType) => {
73
+ return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
74
+ };
75
+ export const setFocus = (key) => {
76
+ return invoke('Focus.setFocus', key);
77
+ };
78
+ export const getFileIcon = async (options) => {
79
+ return invoke('IconTheme.getFileIcon', options);
80
+ };
81
+ export const getColorThemeNames = async () => {
82
+ return invoke('ColorTheme.getColorThemeNames');
83
+ };
84
+ export const disableExtension = async (id) => {
85
+ return invoke('ExtensionManagement.disable', id);
86
+ };
87
+ export const enableExtension = async (id) => {
88
+ // @ts-ignore
89
+ return invoke('ExtensionManagement.enable', id);
90
+ };
91
+ export const handleDebugChange = async (params) => {
92
+ // @ts-ignore
93
+ return invoke('Run And Debug.handleChange', params);
94
+ };
95
+ export const getFolderIcon = async (options) => {
96
+ return invoke('IconTheme.getFolderIcon', options);
97
+ };
98
+ export const closeWidget = async (widgetId) => {
99
+ return invoke('Viewlet.closeWidget', widgetId);
100
+ };
101
+ export const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
102
+ const command = 'HandleMessagePort.handleMessagePort2';
103
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
104
+ };
105
+ export const sendMessagePortToSearchProcess = async (port) => {
106
+ await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
107
+ };
108
+ export const confirm = async (message, options) => {
109
+ // @ts-ignore
110
+ const result = await invoke('Confirmprompt.prompt', message, options);
111
+ return result;
112
+ };
113
+ export const getRecentlyOpened = async () => {
114
+ return invoke(/* RecentlyOpened.getRecentlyOpened */ 'RecentlyOpened.getRecentlyOpened');
115
+ };
116
+ export const getKeyBindings = async () => {
117
+ return invoke('KeyBindingsInitial.getKeyBindings');
118
+ };
119
+ export const writeClipBoardText = async (text) => {
120
+ await invoke('ClipBoard.writeText', /* text */ text);
121
+ };
122
+ export const writeClipBoardImage = async (blob) => {
123
+ // @ts-ignore
124
+ await invoke('ClipBoard.writeImage', /* text */ blob);
125
+ };
126
+ export const searchFileMemory = async (uri) => {
127
+ // @ts-ignore
128
+ return invoke('ExtensionHost.searchFileWithMemory', uri);
129
+ };
130
+ export const searchFileFetch = async (uri) => {
131
+ return invoke('ExtensionHost.searchFileWithFetch', uri);
132
+ };
133
+ export const showMessageBox = async (options) => {
134
+ return invoke('ElectronDialog.showMessageBox', options);
135
+ };
136
+ export const handleDebugResumed = async (params) => {
137
+ await invoke('Run And Debug.handleResumed', params);
138
+ };
139
+ export const openWidget = async (name) => {
140
+ await invoke('Viewlet.openWidget', name);
141
+ };
142
+ export const getIcons = async (requests) => {
143
+ const icons = await invoke('IconTheme.getIcons', requests);
144
+ return icons;
145
+ };
146
+ export const activateByEvent = (event) => {
147
+ return invoke('ExtensionHostManagement.activateByEvent', event);
148
+ };
149
+ export const setAdditionalFocus = (focusKey) => {
150
+ // @ts-ignore
151
+ return invoke('Focus.setAdditionalFocus', focusKey);
152
+ };
153
+ export const getActiveEditorId = () => {
154
+ // @ts-ignore
155
+ return invoke('GetActiveEditor.getActiveEditorId');
156
+ };
157
+ export const getWorkspacePath = () => {
158
+ return invoke('Workspace.getPath');
159
+ };
160
+ export const sendMessagePortToRendererProcess = async (port) => {
161
+ const command = 'HandleMessagePort.handleMessagePort';
162
+ // @ts-ignore
163
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, RpcId.DebugWorker);
164
+ };
165
+ export const getPreference = async (key) => {
166
+ return await invoke('Preferences.get', key);
167
+ };
168
+ export const getAllExtensions = async () => {
169
+ return invoke('ExtensionManagement.getAllExtensions');
170
+ };
171
+ export const rerenderEditor = async (key) => {
172
+ // @ts-ignore
173
+ return invoke('Editor.rerender', key);
174
+ };
175
+ export const handleDebugPaused = async (params) => {
176
+ await invoke('Run And Debug.handlePaused', params);
177
+ };
178
+ export const openUri = async (uri, focus, options) => {
179
+ await invoke('Main.openUri', uri, focus, options);
180
+ };
181
+ export const sendMessagePortToSyntaxHighlightingWorker = async (port) => {
182
+ await invokeAndTransfer(
183
+ // @ts-ignore
184
+ 'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
185
+ };
186
+ export const handleDebugScriptParsed = async (script) => {
187
+ await invoke('Run And Debug.handleScriptParsed', script);
188
+ };
189
+ export const getWindowId = async () => {
190
+ return invoke('GetWindowId.getWindowId');
191
+ };
192
+ export const getBlob = async (uri) => {
193
+ // @ts-ignore
194
+ return invoke('FileSystem.getBlob', uri);
195
+ };
196
+ export const getExtensionCommands = async () => {
197
+ return invoke('ExtensionHost.getCommands');
198
+ };
199
+ export const showErrorDialog = async (errorInfo) => {
200
+ // @ts-ignore
201
+ await invoke('ErrorHandling.showErrorDialog', errorInfo);
202
+ };
203
+ export const getFolderSize = async (uri) => {
204
+ // @ts-ignore
205
+ return await invoke('FileSystem.getFolderSize', uri);
206
+ };
207
+ export const getExtension = async (id) => {
208
+ // @ts-ignore
209
+ return invoke('ExtensionManagement.getExtension', id);
210
+ };
211
+ export const getMarkdownDom = async (html) => {
212
+ // @ts-ignore
213
+ return invoke('Markdown.getVirtualDom', html);
214
+ };
215
+ export const renderMarkdown = async (markdown, options) => {
216
+ // @ts-ignore
217
+ return invoke('Markdown.renderMarkdown', markdown, options);
218
+ };
219
+ export const openNativeFolder = async (uri) => {
220
+ // @ts-ignore
221
+ await invoke('OpenNativeFolder.openNativeFolder', uri);
222
+ };
223
+ export const uninstallExtension = async (id) => {
224
+ return invoke('ExtensionManagement.uninstall', id);
225
+ };
226
+ export const installExtension = async (id) => {
227
+ // @ts-ignore
228
+ return invoke('ExtensionManagement.install', id);
229
+ };
230
+ export const openExtensionSearch = async () => {
231
+ // @ts-ignore
232
+ return invoke('SideBar.openViewlet', 'Extensions');
233
+ };
234
+ export const setExtensionsSearchValue = async (searchValue) => {
235
+ // @ts-ignore
236
+ return invoke('Extensions.handleInput', searchValue);
237
+ };
238
+ export const openExternal = async (uri) => {
239
+ // @ts-ignore
240
+ await invoke('Open.openExternal', uri);
241
+ };
242
+ export const openUrl = async (uri) => {
243
+ // @ts-ignore
244
+ await invoke('Open.openUrl', uri);
245
+ };
246
+ export const getAllPreferences = async () => {
247
+ // @ts-ignore
248
+ return invoke('Preferences.getAll');
249
+ };
250
+ export const showSaveFilePicker = async () => {
251
+ // @ts-ignore
252
+ return invoke('FilePicker.showSaveFilePicker');
253
+ };
254
+ export const getLogsDir = async () => {
255
+ // @ts-ignore
256
+ return invoke('PlatformPaths.getLogsDir');
257
+ };
@@ -0,0 +1 @@
1
+ export {};