@lvce-editor/rpc-registry 2.9.0 → 2.10.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 +42 -21
- package/dist/index.js +37 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,29 @@ 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 ExtensionHostWorkerApi {
|
|
9
|
+
readonly "Extensions.getExtensions": () => Promise<readonly any[]>;
|
|
10
|
+
}
|
|
11
|
+
declare const invoke: <T extends keyof ExtensionHostWorkerApi>(method: T, ...params: Parameters<ExtensionHostWorkerApi[T]>) => ReturnType<ExtensionHostWorkerApi[T]>;
|
|
12
|
+
declare const invokeAndTransfer: <T extends keyof ExtensionHostWorkerApi>(method: T, ...params: Parameters<ExtensionHostWorkerApi[T]>) => ReturnType<ExtensionHostWorkerApi[T]>;
|
|
13
|
+
declare const set$1: (rpc: Rpc) => void;
|
|
14
|
+
export interface MainProcessApi {
|
|
15
|
+
readonly "ElectronWebContents.callFunction": (webContentsId: any, method: string, ...params: readonly any[]) => Promise<any>;
|
|
16
|
+
readonly "ElectronWebContents.dispose": (id: any) => Promise<void>;
|
|
17
|
+
readonly "ElectronWebContentsView.attachEventListeners": (webContentsId: any) => Promise<void>;
|
|
18
|
+
readonly "ElectronWebContentsView.createWebContentsView": (webContentsId: any) => Promise<any>;
|
|
19
|
+
readonly "ElectronWebContentsView.disposeWebContentsView": (webContentsId: any) => Promise<void>;
|
|
20
|
+
readonly "ElectronWebContentsViewFunctions.getStats": (id: any, ...args: readonly any[]) => Promise<any>;
|
|
21
|
+
readonly "ElectronWebContentsViewFunctions.resizeBrowserView": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
22
|
+
readonly "ElectronWebContentsViewFunctions.setBackgroundColor": (webContentsId: any, backgroundColor: string) => Promise<void>;
|
|
23
|
+
readonly "ElectronWebContentsViewFunctions.setFallthroughKeyBindings": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
24
|
+
readonly "ElectronWebContentsViewFunctions.setIframeSrc": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
25
|
+
readonly "ElectronWebContentsViewFunctions.setIframeSrcFallback": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
26
|
+
readonly "ElectronWebContentsViewFunctions.show": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
declare const invoke$1: <T extends keyof MainProcessApi>(method: T, ...params: Parameters<MainProcessApi[T]>) => ReturnType<MainProcessApi[T]>;
|
|
29
|
+
declare const invokeAndTransfer$1: <T extends keyof MainProcessApi>(method: T, ...params: Parameters<MainProcessApi[T]>) => ReturnType<MainProcessApi[T]>;
|
|
30
|
+
declare const set$2: (rpc: Rpc) => void;
|
|
8
31
|
export interface TextEdit {
|
|
9
32
|
readonly text: string;
|
|
10
33
|
readonly startRowIndex: number;
|
|
@@ -103,22 +126,16 @@ export interface RendererWorkerApi {
|
|
|
103
126
|
readonly "Workspace.getPath": () => Promise<string>;
|
|
104
127
|
readonly "Workspace.setPath": (uri: string) => Promise<void>;
|
|
105
128
|
}
|
|
106
|
-
declare const invoke: <T extends keyof RendererWorkerApi>(method: T, ...params: Parameters<RendererWorkerApi[T]>) => ReturnType<RendererWorkerApi[T]>;
|
|
107
|
-
declare const invokeAndTransfer: <T extends keyof RendererWorkerApi>(method: T, ...params: Parameters<RendererWorkerApi[T]>) => ReturnType<RendererWorkerApi[T]>;
|
|
108
|
-
declare const set$
|
|
109
|
-
export interface ExtensionHostWorkerApi {
|
|
110
|
-
readonly "Extensions.getExtensions": () => Promise<readonly any[]>;
|
|
111
|
-
}
|
|
112
|
-
declare const invoke$1: <T extends keyof ExtensionHostWorkerApi>(method: T, ...params: Parameters<ExtensionHostWorkerApi[T]>) => ReturnType<ExtensionHostWorkerApi[T]>;
|
|
113
|
-
declare const invokeAndTransfer$1: <T extends keyof ExtensionHostWorkerApi>(method: T, ...params: Parameters<ExtensionHostWorkerApi[T]>) => ReturnType<ExtensionHostWorkerApi[T]>;
|
|
114
|
-
declare const set$2: (rpc: Rpc) => void;
|
|
129
|
+
declare const invoke$2: <T extends keyof RendererWorkerApi>(method: T, ...params: Parameters<RendererWorkerApi[T]>) => ReturnType<RendererWorkerApi[T]>;
|
|
130
|
+
declare const invokeAndTransfer$2: <T extends keyof RendererWorkerApi>(method: T, ...params: Parameters<RendererWorkerApi[T]>) => ReturnType<RendererWorkerApi[T]>;
|
|
131
|
+
declare const set$3: (rpc: Rpc) => void;
|
|
115
132
|
export interface SearchProcessApi {
|
|
116
133
|
readonly "TextSearch.search": (options: any) => Promise<readonly SearchResult[]>;
|
|
117
134
|
}
|
|
118
|
-
declare const invoke$
|
|
119
|
-
declare const invokeAndTransfer$
|
|
120
|
-
declare const set$
|
|
121
|
-
export interface
|
|
135
|
+
declare const invoke$3: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
|
|
136
|
+
declare const invokeAndTransfer$3: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
|
|
137
|
+
declare const set$4: (rpc: Rpc) => void;
|
|
138
|
+
export interface SharedProcessApi {
|
|
122
139
|
readonly "ElectronWebContents.callFunction": (webContentsId: any, method: string, ...params: readonly any[]) => Promise<any>;
|
|
123
140
|
readonly "ElectronWebContents.dispose": (id: any) => Promise<void>;
|
|
124
141
|
readonly "ElectronWebContentsView.attachEventListeners": (webContentsId: any) => Promise<void>;
|
|
@@ -132,28 +149,32 @@ export interface MainProcessApi {
|
|
|
132
149
|
readonly "ElectronWebContentsViewFunctions.setIframeSrcFallback": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
133
150
|
readonly "ElectronWebContentsViewFunctions.show": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
134
151
|
}
|
|
135
|
-
declare const invoke$
|
|
136
|
-
declare const invokeAndTransfer$
|
|
137
|
-
declare const set$
|
|
152
|
+
declare const invoke$4: <T extends keyof SharedProcessApi>(method: T, ...params: Parameters<SharedProcessApi[T]>) => ReturnType<SharedProcessApi[T]>;
|
|
153
|
+
declare const invokeAndTransfer$4: <T extends keyof SharedProcessApi>(method: T, ...params: Parameters<SharedProcessApi[T]>) => ReturnType<SharedProcessApi[T]>;
|
|
154
|
+
declare const set$5: (rpc: Rpc) => void;
|
|
138
155
|
|
|
139
|
-
declare namespace
|
|
140
|
-
export { invoke$
|
|
156
|
+
declare namespace SharedProcess {
|
|
157
|
+
export { invoke$4 as invoke, invokeAndTransfer$4 as invokeAndTransfer, set$5 as set };
|
|
141
158
|
}
|
|
142
|
-
declare namespace
|
|
159
|
+
declare namespace ExtensionHost {
|
|
143
160
|
export { invoke, invokeAndTransfer, set$1 as set };
|
|
144
161
|
}
|
|
145
|
-
declare namespace
|
|
162
|
+
declare namespace MainProcess {
|
|
146
163
|
export { invoke$1 as invoke, invokeAndTransfer$1 as invokeAndTransfer, set$2 as set };
|
|
147
164
|
}
|
|
148
|
-
declare namespace
|
|
165
|
+
declare namespace RendererWorker {
|
|
149
166
|
export { invoke$2 as invoke, invokeAndTransfer$2 as invokeAndTransfer, set$3 as set };
|
|
150
167
|
}
|
|
168
|
+
declare namespace SearchProcess {
|
|
169
|
+
export { invoke$3 as invoke, invokeAndTransfer$3 as invokeAndTransfer, set$4 as set };
|
|
170
|
+
}
|
|
151
171
|
|
|
152
172
|
export {
|
|
153
173
|
ExtensionHost,
|
|
154
174
|
MainProcess,
|
|
155
175
|
RendererWorker,
|
|
156
176
|
SearchProcess,
|
|
177
|
+
SharedProcess,
|
|
157
178
|
};
|
|
158
179
|
|
|
159
180
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const rpcs = Object.create(null);
|
|
2
|
-
const set$
|
|
2
|
+
const set$5 = (id, rpc) => {
|
|
3
3
|
rpcs[id] = rpc;
|
|
4
4
|
};
|
|
5
5
|
const get = id => {
|
|
@@ -13,22 +13,44 @@ const RendererWorker$1 = 1;
|
|
|
13
13
|
const ExtensionHostWorker = 44;
|
|
14
14
|
const SearchProcess$1 = 77;
|
|
15
15
|
const MainProcess$1 = -5;
|
|
16
|
+
const SharedProcess$1 = 1;
|
|
17
|
+
|
|
18
|
+
const invoke$4 = (method, ...params) => {
|
|
19
|
+
const rpc = get(ExtensionHostWorker);
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
return rpc.invoke(method, ...params);
|
|
22
|
+
};
|
|
23
|
+
const invokeAndTransfer$4 = (method, ...params) => {
|
|
24
|
+
const rpc = get(ExtensionHostWorker);
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
27
|
+
};
|
|
28
|
+
const set$4 = rpc => {
|
|
29
|
+
set$5(ExtensionHostWorker, rpc);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const ExtensionHost = {
|
|
33
|
+
__proto__: null,
|
|
34
|
+
invoke: invoke$4,
|
|
35
|
+
invokeAndTransfer: invokeAndTransfer$4,
|
|
36
|
+
set: set$4
|
|
37
|
+
};
|
|
16
38
|
|
|
17
39
|
const invoke$3 = (method, ...params) => {
|
|
18
|
-
const rpc = get(
|
|
40
|
+
const rpc = get(MainProcess$1);
|
|
19
41
|
// @ts-ignore
|
|
20
42
|
return rpc.invoke(method, ...params);
|
|
21
43
|
};
|
|
22
44
|
const invokeAndTransfer$3 = (method, ...params) => {
|
|
23
|
-
const rpc = get(
|
|
45
|
+
const rpc = get(MainProcess$1);
|
|
24
46
|
// @ts-ignore
|
|
25
47
|
return rpc.invokeAndTransfer(method, ...params);
|
|
26
48
|
};
|
|
27
49
|
const set$3 = rpc => {
|
|
28
|
-
set$
|
|
50
|
+
set$5(MainProcess$1, rpc);
|
|
29
51
|
};
|
|
30
52
|
|
|
31
|
-
const
|
|
53
|
+
const MainProcess = {
|
|
32
54
|
__proto__: null,
|
|
33
55
|
invoke: invoke$3,
|
|
34
56
|
invokeAndTransfer: invokeAndTransfer$3,
|
|
@@ -36,20 +58,20 @@ const RendererWorker = {
|
|
|
36
58
|
};
|
|
37
59
|
|
|
38
60
|
const invoke$2 = (method, ...params) => {
|
|
39
|
-
const rpc = get(
|
|
61
|
+
const rpc = get(RendererWorker$1);
|
|
40
62
|
// @ts-ignore
|
|
41
63
|
return rpc.invoke(method, ...params);
|
|
42
64
|
};
|
|
43
65
|
const invokeAndTransfer$2 = (method, ...params) => {
|
|
44
|
-
const rpc = get(
|
|
66
|
+
const rpc = get(RendererWorker$1);
|
|
45
67
|
// @ts-ignore
|
|
46
68
|
return rpc.invokeAndTransfer(method, ...params);
|
|
47
69
|
};
|
|
48
70
|
const set$2 = rpc => {
|
|
49
|
-
set$
|
|
71
|
+
set$5(RendererWorker$1, rpc);
|
|
50
72
|
};
|
|
51
73
|
|
|
52
|
-
const
|
|
74
|
+
const RendererWorker = {
|
|
53
75
|
__proto__: null,
|
|
54
76
|
invoke: invoke$2,
|
|
55
77
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
@@ -67,7 +89,7 @@ const invokeAndTransfer$1 = (method, ...params) => {
|
|
|
67
89
|
return rpc.invokeAndTransfer(method, ...params);
|
|
68
90
|
};
|
|
69
91
|
const set$1 = rpc => {
|
|
70
|
-
set$
|
|
92
|
+
set$5(SearchProcess$1, rpc);
|
|
71
93
|
};
|
|
72
94
|
|
|
73
95
|
const SearchProcess = {
|
|
@@ -78,24 +100,24 @@ const SearchProcess = {
|
|
|
78
100
|
};
|
|
79
101
|
|
|
80
102
|
const invoke = (method, ...params) => {
|
|
81
|
-
const rpc = get(
|
|
103
|
+
const rpc = get(SharedProcess$1);
|
|
82
104
|
// @ts-ignore
|
|
83
105
|
return rpc.invoke(method, ...params);
|
|
84
106
|
};
|
|
85
107
|
const invokeAndTransfer = (method, ...params) => {
|
|
86
|
-
const rpc = get(
|
|
108
|
+
const rpc = get(SharedProcess$1);
|
|
87
109
|
// @ts-ignore
|
|
88
110
|
return rpc.invokeAndTransfer(method, ...params);
|
|
89
111
|
};
|
|
90
112
|
const set = rpc => {
|
|
91
|
-
set$
|
|
113
|
+
set$5(SharedProcess$1, rpc);
|
|
92
114
|
};
|
|
93
115
|
|
|
94
|
-
const
|
|
116
|
+
const SharedProcess = {
|
|
95
117
|
__proto__: null,
|
|
96
118
|
invoke,
|
|
97
119
|
invokeAndTransfer,
|
|
98
120
|
set
|
|
99
121
|
};
|
|
100
122
|
|
|
101
|
-
export { ExtensionHost, MainProcess, RendererWorker, SearchProcess, get, remove, set$
|
|
123
|
+
export { ExtensionHost, MainProcess, RendererWorker, SearchProcess, SharedProcess, get, remove, set$5 as set };
|