@lvce-editor/rpc-registry 2.3.0 → 2.5.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.
- package/dist/index.d.ts +61 -3
- package/dist/index.js +32 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,27 +5,74 @@ import { Rpc } from '@lvce-editor/rpc';
|
|
|
5
5
|
export declare const set: (id: number, rpc: Rpc) => void;
|
|
6
6
|
export declare const get: (id: number) => Rpc;
|
|
7
7
|
export declare const remove: (id: number) => void;
|
|
8
|
+
export interface TextEdit {
|
|
9
|
+
readonly text: string;
|
|
10
|
+
readonly startRowIndex: number;
|
|
11
|
+
readonly startColumnIndex: number;
|
|
12
|
+
readonly endColumnIndex: number;
|
|
13
|
+
readonly endRowIndex: number;
|
|
14
|
+
}
|
|
15
|
+
export interface BulkReplacementEdit {
|
|
16
|
+
readonly uri: string;
|
|
17
|
+
readonly changes: readonly TextEdit[];
|
|
18
|
+
}
|
|
19
|
+
export interface ConfirmPromptOptions {
|
|
20
|
+
readonly title: string;
|
|
21
|
+
readonly confirmMessage: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SearchResult {
|
|
24
|
+
readonly type: number;
|
|
25
|
+
readonly start: number;
|
|
26
|
+
readonly end: number;
|
|
27
|
+
readonly lineNumber: number;
|
|
28
|
+
readonly text: string;
|
|
29
|
+
}
|
|
8
30
|
export interface RendererWorkerApi {
|
|
31
|
+
readonly "BulkReplacement.applyBulkReplacement": (edits: readonly BulkReplacementEdit[]) => Promise<void>;
|
|
32
|
+
readonly "ClipBoard.readNativeFiles": () => Promise<readonly string[]>;
|
|
33
|
+
readonly "ClipBoard.writeNativeFiles": (type: string, files: readonly string[]) => Promise<void>;
|
|
9
34
|
readonly "ClipBoard.writeText": (text: string) => Promise<void>;
|
|
10
35
|
readonly "ColorTheme.getColorThemeNames": () => Promise<readonly string[]>;
|
|
11
36
|
readonly "ColorTheme.setColorTheme": (id: string) => Promise<void>;
|
|
37
|
+
readonly "ConfirmPrompt.prompt": (confirmText: string, options: ConfirmPromptOptions) => Promise<boolean>;
|
|
12
38
|
readonly "ContextMenu.show": (x: number, y: number, id: any, ...args: readonly any[]) => Promise<void>;
|
|
13
39
|
readonly "ElectronDialog.showMessageBox": (options: any) => Promise<any>;
|
|
14
40
|
readonly "ErrorHandling.showErrorDialog": (errorInfo: any) => Promise<void>;
|
|
41
|
+
readonly "Explorer.cancelTypeAhead": () => Promise<void>;
|
|
42
|
+
readonly "Explorer.handleKeyDown": (key: string) => Promise<void>;
|
|
15
43
|
readonly "ExtensionHost.executeCommand": (id: string) => Promise<void>;
|
|
16
44
|
readonly "ExtensionHost.getCommands": () => Promise<readonly any[]>;
|
|
17
45
|
readonly "ExtensionHost.searchFileWithFetch": (uri: string) => Promise<readonly string[]>;
|
|
18
46
|
readonly "ExtensionHost.searchFileWithHtml": (uri: string) => Promise<readonly string[]>;
|
|
19
47
|
readonly "ExtensionHost.searchFileWithMemory": (uri: string) => Promise<readonly string[]>;
|
|
20
48
|
readonly "ExtensionHostManagement.activateByEvent": (event: string) => Promise<void>;
|
|
49
|
+
readonly "ExtensionHostTextSearch.executeTextSearchProvider": (scheme: string, query: string) => Promise<readonly SearchResult[]>;
|
|
50
|
+
readonly "ExtensionHostTextSearch.textSearchFetch": (scheme: string, root: string, query: string, options: any, assetDir: string) => Promise<readonly SearchResult[]>;
|
|
51
|
+
readonly "ExtensionHostTextSearch.textSearchHtml": (scheme: string, root: string, query: string) => Promise<readonly SearchResult[]>;
|
|
52
|
+
readonly "ExtensionHostTextSearch.textSearchMemory": (scheme: string, root: string, query: string, options: any, assetDir: string) => Promise<readonly SearchResult[]>;
|
|
53
|
+
readonly "FileSystem.copy": (oldUri: string, newUri: string) => Promise<void>;
|
|
54
|
+
readonly "FileSystem.createFile": (uri: string) => Promise<void>;
|
|
55
|
+
readonly "FileSystem.getPathSeparator": (root: string) => Promise<string>;
|
|
56
|
+
readonly "FileSystem.getRealPath": (root: string) => Promise<string>;
|
|
57
|
+
readonly "FileSystem.mkdir": (uri: string) => Promise<void>;
|
|
58
|
+
readonly "FileSystem.readDirWithFileTypes": (uri: string) => Promise<readonly any[]>;
|
|
21
59
|
readonly "FileSystem.readFile": (uri: string) => Promise<string>;
|
|
22
|
-
readonly "
|
|
60
|
+
readonly "FileSystem.remove": (uri: string) => Promise<void>;
|
|
61
|
+
readonly "FileSystem.rename": (oldUri: string, newUri: string) => Promise<void>;
|
|
62
|
+
readonly "FileSystem.stat": (root: string) => Promise<any>;
|
|
63
|
+
readonly "FileSystem.writeFile": (uri: string, content: string) => Promise<void>;
|
|
64
|
+
readonly "FileSystemHandle.getFileHandles": (fileIds: readonly number[]) => Promise<readonly FileSystemHandle[]>;
|
|
65
|
+
readonly "FileSystemHandle.getFilePathElectron": (file: File) => Promise<string>;
|
|
66
|
+
readonly "Focus.setFocus": (focusId: number) => Promise<void>;
|
|
23
67
|
readonly "GetWindowId.getWindowId": () => Promise<number>;
|
|
24
68
|
readonly "IconTheme.getFileIcon": (options: any) => Promise<string>;
|
|
25
69
|
readonly "IconTheme.getFolderIcon": (options: any) => Promise<string>;
|
|
26
70
|
readonly "IconTheme.getIcons": (request: readonly any[]) => Promise<readonly string[]>;
|
|
27
71
|
readonly "KeyBindingsInitial.getKeyBindings": () => Promise<readonly any[]>;
|
|
28
72
|
readonly "Main.openUri": (uri: string, focus?: boolean, props?: any) => Promise<void>;
|
|
73
|
+
readonly "MouseActions.get": (uid: number, button: number, modifiers: any) => Promise<any>;
|
|
74
|
+
readonly "OpenNativeFolder.openNativeFolder": (path: string) => Promise<void>;
|
|
75
|
+
readonly "Preferences.get": (key: string) => Promise<any>;
|
|
29
76
|
readonly "Process.getChromeVersion": () => Promise<string>;
|
|
30
77
|
readonly "Process.getElectronVersion": () => Promise<string>;
|
|
31
78
|
readonly "Process.getNodeVersion": () => Promise<string>;
|
|
@@ -35,6 +82,7 @@ export interface RendererWorkerApi {
|
|
|
35
82
|
readonly "Run And Debug.handleResumed": (params: any) => Promise<void>;
|
|
36
83
|
readonly "Run And Debug.handleScriptParsed": (params: any) => Promise<void>;
|
|
37
84
|
readonly "SearchProcess.invoke": (command: string, ...args: readonly any[]) => Promise<any>;
|
|
85
|
+
readonly "SendMessagePortToElectron.sendMessagePortToElectron": (port: MessagePort, command: string) => Promise<void>;
|
|
38
86
|
readonly "SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker": (port: MessagePort, initialCommand: string, rpcId: number) => Promise<void>;
|
|
39
87
|
readonly "Viewlet.closeWidget": (id: number | string) => Promise<void>;
|
|
40
88
|
readonly "Viewlet.openWidget": (widgetId: string) => Promise<string>;
|
|
@@ -50,17 +98,27 @@ export interface ExtensionHostWorkerApi {
|
|
|
50
98
|
declare const invoke$1: <T extends keyof ExtensionHostWorkerApi>(method: T, ...params: Parameters<ExtensionHostWorkerApi[T]>) => ReturnType<ExtensionHostWorkerApi[T]>;
|
|
51
99
|
declare const invokeAndTransfer$1: <T extends keyof ExtensionHostWorkerApi>(method: T, ...params: Parameters<ExtensionHostWorkerApi[T]>) => ReturnType<ExtensionHostWorkerApi[T]>;
|
|
52
100
|
declare const set$2: (rpc: Rpc) => void;
|
|
101
|
+
export interface SearchProcessApi {
|
|
102
|
+
readonly "TextSearch.search": (options: any) => Promise<readonly SearchResult[]>;
|
|
103
|
+
}
|
|
104
|
+
declare const invoke$2: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
|
|
105
|
+
declare const invokeAndTransfer$2: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
|
|
106
|
+
declare const set$3: (rpc: Rpc) => void;
|
|
53
107
|
|
|
54
|
-
declare namespace
|
|
55
|
-
export { invoke$
|
|
108
|
+
declare namespace SearchProcess {
|
|
109
|
+
export { invoke$2 as invoke, invokeAndTransfer$2 as invokeAndTransfer, set$3 as set };
|
|
56
110
|
}
|
|
57
111
|
declare namespace RendererWorker {
|
|
58
112
|
export { invoke, invokeAndTransfer, set$1 as set };
|
|
59
113
|
}
|
|
114
|
+
declare namespace ExtensionHost {
|
|
115
|
+
export { invoke$1 as invoke, invokeAndTransfer$1 as invokeAndTransfer, set$2 as set };
|
|
116
|
+
}
|
|
60
117
|
|
|
61
118
|
export {
|
|
62
119
|
ExtensionHost,
|
|
63
120
|
RendererWorker,
|
|
121
|
+
SearchProcess,
|
|
64
122
|
};
|
|
65
123
|
|
|
66
124
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const rpcs = Object.create(null);
|
|
2
|
-
const set$
|
|
2
|
+
const set$3 = (id, rpc) => {
|
|
3
3
|
rpcs[id] = rpc;
|
|
4
4
|
};
|
|
5
5
|
const get = id => {
|
|
@@ -11,22 +11,44 @@ const remove = id => {
|
|
|
11
11
|
|
|
12
12
|
const RendererWorker$1 = 1;
|
|
13
13
|
const ExtensionHostWorker = 44;
|
|
14
|
+
const SearchProcess$1 = 77;
|
|
14
15
|
|
|
15
|
-
const invoke$
|
|
16
|
+
const invoke$2 = (method, ...params) => {
|
|
16
17
|
const rpc = get(RendererWorker$1);
|
|
17
18
|
// @ts-ignore
|
|
18
19
|
return rpc.invoke(method, ...params);
|
|
19
20
|
};
|
|
20
|
-
const invokeAndTransfer$
|
|
21
|
+
const invokeAndTransfer$2 = (method, ...params) => {
|
|
21
22
|
const rpc = get(RendererWorker$1);
|
|
22
23
|
// @ts-ignore
|
|
23
24
|
return rpc.invokeAndTransfer(method, ...params);
|
|
24
25
|
};
|
|
25
|
-
const set$
|
|
26
|
-
set$
|
|
26
|
+
const set$2 = rpc => {
|
|
27
|
+
set$3(RendererWorker$1, rpc);
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
const RendererWorker = {
|
|
31
|
+
__proto__: null,
|
|
32
|
+
invoke: invoke$2,
|
|
33
|
+
invokeAndTransfer: invokeAndTransfer$2,
|
|
34
|
+
set: set$2
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const invoke$1 = (method, ...params) => {
|
|
38
|
+
const rpc = get(ExtensionHostWorker);
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
return rpc.invoke(method, ...params);
|
|
41
|
+
};
|
|
42
|
+
const invokeAndTransfer$1 = (method, ...params) => {
|
|
43
|
+
const rpc = get(ExtensionHostWorker);
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
46
|
+
};
|
|
47
|
+
const set$1 = rpc => {
|
|
48
|
+
set$3(ExtensionHostWorker, rpc);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const ExtensionHost = {
|
|
30
52
|
__proto__: null,
|
|
31
53
|
invoke: invoke$1,
|
|
32
54
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
@@ -34,24 +56,24 @@ const RendererWorker = {
|
|
|
34
56
|
};
|
|
35
57
|
|
|
36
58
|
const invoke = (method, ...params) => {
|
|
37
|
-
const rpc = get(
|
|
59
|
+
const rpc = get(SearchProcess$1);
|
|
38
60
|
// @ts-ignore
|
|
39
61
|
return rpc.invoke(method, ...params);
|
|
40
62
|
};
|
|
41
63
|
const invokeAndTransfer = (method, ...params) => {
|
|
42
|
-
const rpc = get(
|
|
64
|
+
const rpc = get(SearchProcess$1);
|
|
43
65
|
// @ts-ignore
|
|
44
66
|
return rpc.invokeAndTransfer(method, ...params);
|
|
45
67
|
};
|
|
46
68
|
const set = rpc => {
|
|
47
|
-
set$
|
|
69
|
+
set$3(SearchProcess$1, rpc);
|
|
48
70
|
};
|
|
49
71
|
|
|
50
|
-
const
|
|
72
|
+
const SearchProcess = {
|
|
51
73
|
__proto__: null,
|
|
52
74
|
invoke,
|
|
53
75
|
invokeAndTransfer,
|
|
54
76
|
set
|
|
55
77
|
};
|
|
56
78
|
|
|
57
|
-
export { ExtensionHost, RendererWorker, get, remove, set$
|
|
79
|
+
export { ExtensionHost, RendererWorker, SearchProcess, get, remove, set$3 as set };
|