@lvce-editor/embeds-process 2.2.0 → 2.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/embeds-process",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "main": "src/embedsProcessMain.js",
6
6
  "type": "module",
@@ -53,6 +53,9 @@
53
53
  "dependencies": {
54
54
  "@lvce-editor/assert": "^1.3.0",
55
55
  "@lvce-editor/ipc": "^14.1.0",
56
- "@lvce-editor/json-rpc": "^5.4.0"
56
+ "@lvce-editor/json-rpc": "^5.4.0",
57
+ "@lvce-editor/rpc": "^3.4.0",
58
+ "@lvce-editor/rpc-registry": "^2.8.0",
59
+ "@lvce-editor/verror": "^1.6.0"
57
60
  }
58
61
  }
@@ -1,9 +1,14 @@
1
1
  import * as ElectronWebContentsViewIpcState from '../ElectronWebContentsViewIpcState/ElectronWebContentsViewIpcState.js'
2
2
  import * as ElectronWebContentsViewState from '../ElectronWebContentsViewState/ElectronWebContentsViewState.js'
3
3
  import * as ParentIpc from '../ParentIpc/ParentIpc.js'
4
+ import { VError } from '../VError/VError.js'
4
5
 
5
6
  export const dispose = async (id) => {
6
- await ParentIpc.invoke('ElectronWebContents.dispose', id)
7
+ try {
8
+ await ParentIpc.invoke('ElectronWebContents.dispose', id)
9
+ } catch (error) {
10
+ throw new VError(error, `Failed to dispose webcontents`)
11
+ }
7
12
  }
8
13
 
9
14
  export const callFunction = (webContentsId, method, ...params) => {
@@ -0,0 +1 @@
1
+ export * from '@lvce-editor/verror'
@@ -1,20 +0,0 @@
1
- import * as JsonRpc from '../JsonRpc/JsonRpc.js'
2
-
3
- export const state = {
4
- /**
5
- * @type {any}
6
- */
7
- ipc: undefined,
8
- }
9
-
10
- export const invoke = (method, ...params) => {
11
- return JsonRpc.invoke(state.ipc, method, ...params)
12
- }
13
-
14
- export const send = (method, ...params) => {
15
- return JsonRpc.send(state.ipc, method, ...params)
16
- }
17
-
18
- export const invokeAndTransfer = (method, transfer, ...params) => {
19
- return JsonRpc.invokeAndTransfer(state.ipc, transfer, method, ...params)
20
- }