@lvce-editor/rpc-registry 2.7.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 CHANGED
@@ -37,6 +37,10 @@ export interface RendererWorkerApi {
37
37
  readonly "ConfirmPrompt.prompt": (confirmText: string, options: ConfirmPromptOptions) => Promise<boolean>;
38
38
  readonly "ContextMenu.show": (x: number, y: number, id: any, ...args: readonly any[]) => Promise<void>;
39
39
  readonly "ElectronDialog.showMessageBox": (options: any) => Promise<any>;
40
+ readonly "ElectronWindow.close": () => Promise<void>;
41
+ readonly "ElectronWindow.maximize": () => Promise<void>;
42
+ readonly "ElectronWindow.minimize": () => Promise<void>;
43
+ readonly "ElectronWindow.unmaximize": () => Promise<void>;
40
44
  readonly "ErrorHandling.showErrorDialog": (errorInfo: any) => Promise<void>;
41
45
  readonly "Explorer.cancelTypeAhead": () => Promise<void>;
42
46
  readonly "Explorer.handleKeyDown": (key: string) => Promise<void>;
@@ -114,9 +118,26 @@ export interface SearchProcessApi {
114
118
  declare const invoke$2: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
115
119
  declare const invokeAndTransfer$2: <T extends keyof SearchProcessApi>(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>;
116
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;
117
138
 
118
- declare namespace SearchProcess {
119
- export { invoke$2 as invoke, invokeAndTransfer$2 as invokeAndTransfer, set$3 as set };
139
+ declare namespace MainProcess {
140
+ export { invoke$3 as invoke, invokeAndTransfer$3 as invokeAndTransfer, set$4 as set };
120
141
  }
121
142
  declare namespace RendererWorker {
122
143
  export { invoke, invokeAndTransfer, set$1 as set };
@@ -124,9 +145,13 @@ declare namespace RendererWorker {
124
145
  declare namespace ExtensionHost {
125
146
  export { invoke$1 as invoke, invokeAndTransfer$1 as invokeAndTransfer, set$2 as set };
126
147
  }
148
+ declare namespace SearchProcess {
149
+ export { invoke$2 as invoke, invokeAndTransfer$2 as invokeAndTransfer, set$3 as set };
150
+ }
127
151
 
128
152
  export {
129
153
  ExtensionHost,
154
+ MainProcess,
130
155
  RendererWorker,
131
156
  SearchProcess,
132
157
  };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const rpcs = Object.create(null);
2
- const set$3 = (id, rpc) => {
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$2 = (method, ...params) => {
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$2 = (method, ...params) => {
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$2 = rpc => {
27
- set$3(RendererWorker$1, rpc);
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(ExtensionHostWorker);
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(ExtensionHostWorker);
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$3(ExtensionHostWorker, rpc);
70
+ set$4(SearchProcess$1, rpc);
49
71
  };
50
72
 
51
- const ExtensionHost = {
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(SearchProcess$1);
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(SearchProcess$1);
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$3(SearchProcess$1, rpc);
91
+ set$4(MainProcess$1, rpc);
70
92
  };
71
93
 
72
- const SearchProcess = {
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$3 as set };
101
+ export { ExtensionHost, MainProcess, RendererWorker, SearchProcess, get, remove, set$4 as set };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/rpc-registry",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Rpc Registry",
5
5
  "license": "MIT",
6
6
  "author": "Lvce Editor",