@lvce-editor/rpc-registry 2.8.0 → 2.9.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 +23 -2
- package/dist/index.js +36 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -118,9 +118,26 @@ export interface SearchProcessApi {
|
|
|
118
118
|
declare const invoke$2: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
|
|
119
119
|
declare const invokeAndTransfer$2: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
|
|
120
120
|
declare const set$3: (rpc: Rpc) => void;
|
|
121
|
+
export interface MainProcessApi {
|
|
122
|
+
readonly "ElectronWebContents.callFunction": (webContentsId: any, method: string, ...params: readonly any[]) => Promise<any>;
|
|
123
|
+
readonly "ElectronWebContents.dispose": (id: any) => Promise<void>;
|
|
124
|
+
readonly "ElectronWebContentsView.attachEventListeners": (webContentsId: any) => Promise<void>;
|
|
125
|
+
readonly "ElectronWebContentsView.createWebContentsView": (webContentsId: any) => Promise<any>;
|
|
126
|
+
readonly "ElectronWebContentsView.disposeWebContentsView": (webContentsId: any) => Promise<void>;
|
|
127
|
+
readonly "ElectronWebContentsViewFunctions.getStats": (id: any, ...args: readonly any[]) => Promise<any>;
|
|
128
|
+
readonly "ElectronWebContentsViewFunctions.resizeBrowserView": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
129
|
+
readonly "ElectronWebContentsViewFunctions.setBackgroundColor": (webContentsId: any, backgroundColor: string) => Promise<void>;
|
|
130
|
+
readonly "ElectronWebContentsViewFunctions.setFallthroughKeyBindings": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
131
|
+
readonly "ElectronWebContentsViewFunctions.setIframeSrc": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
132
|
+
readonly "ElectronWebContentsViewFunctions.setIframeSrcFallback": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
133
|
+
readonly "ElectronWebContentsViewFunctions.show": (id: any, ...args: readonly any[]) => Promise<void>;
|
|
134
|
+
}
|
|
135
|
+
declare const invoke$3: <T extends keyof MainProcessApi>(method: T, ...params: Parameters<MainProcessApi[T]>) => ReturnType<MainProcessApi[T]>;
|
|
136
|
+
declare const invokeAndTransfer$3: <T extends keyof MainProcessApi>(method: T, ...params: Parameters<MainProcessApi[T]>) => ReturnType<MainProcessApi[T]>;
|
|
137
|
+
declare const set$4: (rpc: Rpc) => void;
|
|
121
138
|
|
|
122
|
-
declare namespace
|
|
123
|
-
export { invoke$
|
|
139
|
+
declare namespace MainProcess {
|
|
140
|
+
export { invoke$3 as invoke, invokeAndTransfer$3 as invokeAndTransfer, set$4 as set };
|
|
124
141
|
}
|
|
125
142
|
declare namespace RendererWorker {
|
|
126
143
|
export { invoke, invokeAndTransfer, set$1 as set };
|
|
@@ -128,9 +145,13 @@ declare namespace RendererWorker {
|
|
|
128
145
|
declare namespace ExtensionHost {
|
|
129
146
|
export { invoke$1 as invoke, invokeAndTransfer$1 as invokeAndTransfer, set$2 as set };
|
|
130
147
|
}
|
|
148
|
+
declare namespace SearchProcess {
|
|
149
|
+
export { invoke$2 as invoke, invokeAndTransfer$2 as invokeAndTransfer, set$3 as set };
|
|
150
|
+
}
|
|
131
151
|
|
|
132
152
|
export {
|
|
133
153
|
ExtensionHost,
|
|
154
|
+
MainProcess,
|
|
134
155
|
RendererWorker,
|
|
135
156
|
SearchProcess,
|
|
136
157
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const rpcs = Object.create(null);
|
|
2
|
-
const set$
|
|
2
|
+
const set$4 = (id, rpc) => {
|
|
3
3
|
rpcs[id] = rpc;
|
|
4
4
|
};
|
|
5
5
|
const get = id => {
|
|
@@ -12,22 +12,44 @@ const remove = id => {
|
|
|
12
12
|
const RendererWorker$1 = 1;
|
|
13
13
|
const ExtensionHostWorker = 44;
|
|
14
14
|
const SearchProcess$1 = 77;
|
|
15
|
+
const MainProcess$1 = -5;
|
|
15
16
|
|
|
16
|
-
const invoke$
|
|
17
|
+
const invoke$3 = (method, ...params) => {
|
|
17
18
|
const rpc = get(RendererWorker$1);
|
|
18
19
|
// @ts-ignore
|
|
19
20
|
return rpc.invoke(method, ...params);
|
|
20
21
|
};
|
|
21
|
-
const invokeAndTransfer$
|
|
22
|
+
const invokeAndTransfer$3 = (method, ...params) => {
|
|
22
23
|
const rpc = get(RendererWorker$1);
|
|
23
24
|
// @ts-ignore
|
|
24
25
|
return rpc.invokeAndTransfer(method, ...params);
|
|
25
26
|
};
|
|
26
|
-
const set$
|
|
27
|
-
set$
|
|
27
|
+
const set$3 = rpc => {
|
|
28
|
+
set$4(RendererWorker$1, rpc);
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
const RendererWorker = {
|
|
32
|
+
__proto__: null,
|
|
33
|
+
invoke: invoke$3,
|
|
34
|
+
invokeAndTransfer: invokeAndTransfer$3,
|
|
35
|
+
set: set$3
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const invoke$2 = (method, ...params) => {
|
|
39
|
+
const rpc = get(ExtensionHostWorker);
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
return rpc.invoke(method, ...params);
|
|
42
|
+
};
|
|
43
|
+
const invokeAndTransfer$2 = (method, ...params) => {
|
|
44
|
+
const rpc = get(ExtensionHostWorker);
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
47
|
+
};
|
|
48
|
+
const set$2 = rpc => {
|
|
49
|
+
set$4(ExtensionHostWorker, rpc);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const ExtensionHost = {
|
|
31
53
|
__proto__: null,
|
|
32
54
|
invoke: invoke$2,
|
|
33
55
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
@@ -35,20 +57,20 @@ const RendererWorker = {
|
|
|
35
57
|
};
|
|
36
58
|
|
|
37
59
|
const invoke$1 = (method, ...params) => {
|
|
38
|
-
const rpc = get(
|
|
60
|
+
const rpc = get(SearchProcess$1);
|
|
39
61
|
// @ts-ignore
|
|
40
62
|
return rpc.invoke(method, ...params);
|
|
41
63
|
};
|
|
42
64
|
const invokeAndTransfer$1 = (method, ...params) => {
|
|
43
|
-
const rpc = get(
|
|
65
|
+
const rpc = get(SearchProcess$1);
|
|
44
66
|
// @ts-ignore
|
|
45
67
|
return rpc.invokeAndTransfer(method, ...params);
|
|
46
68
|
};
|
|
47
69
|
const set$1 = rpc => {
|
|
48
|
-
set$
|
|
70
|
+
set$4(SearchProcess$1, rpc);
|
|
49
71
|
};
|
|
50
72
|
|
|
51
|
-
const
|
|
73
|
+
const SearchProcess = {
|
|
52
74
|
__proto__: null,
|
|
53
75
|
invoke: invoke$1,
|
|
54
76
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
@@ -56,24 +78,24 @@ const ExtensionHost = {
|
|
|
56
78
|
};
|
|
57
79
|
|
|
58
80
|
const invoke = (method, ...params) => {
|
|
59
|
-
const rpc = get(
|
|
81
|
+
const rpc = get(MainProcess$1);
|
|
60
82
|
// @ts-ignore
|
|
61
83
|
return rpc.invoke(method, ...params);
|
|
62
84
|
};
|
|
63
85
|
const invokeAndTransfer = (method, ...params) => {
|
|
64
|
-
const rpc = get(
|
|
86
|
+
const rpc = get(MainProcess$1);
|
|
65
87
|
// @ts-ignore
|
|
66
88
|
return rpc.invokeAndTransfer(method, ...params);
|
|
67
89
|
};
|
|
68
90
|
const set = rpc => {
|
|
69
|
-
set$
|
|
91
|
+
set$4(MainProcess$1, rpc);
|
|
70
92
|
};
|
|
71
93
|
|
|
72
|
-
const
|
|
94
|
+
const MainProcess = {
|
|
73
95
|
__proto__: null,
|
|
74
96
|
invoke,
|
|
75
97
|
invokeAndTransfer,
|
|
76
98
|
set
|
|
77
99
|
};
|
|
78
100
|
|
|
79
|
-
export { ExtensionHost, RendererWorker, SearchProcess, get, remove, set$
|
|
101
|
+
export { ExtensionHost, MainProcess, RendererWorker, SearchProcess, get, remove, set$4 as set };
|