@lvce-editor/rpc-registry 9.17.0 → 9.18.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/parts/BlobWorker/BlobWorker.d.ts +6 -0
- package/dist/parts/BlobWorker/BlobWorker.js +17 -0
- package/dist/parts/DisposableMockRpc/DisposableMockRpc.d.ts +1 -1
- package/dist/parts/Main/Main.d.ts +3 -1
- package/dist/parts/Main/Main.js +1 -0
- package/dist/parts/MockRpc/MockRpc.d.ts +2 -0
- package/dist/parts/MockRpc/MockRpc.js +1 -0
- package/dist/parts/RegisterMockRpc/RegisterMockRpc.d.ts +1 -1
- package/dist/parts/RendererWorker/RendererWorker.d.ts +4 -0
- package/dist/parts/RendererWorker/RendererWorker.js +31 -0
- package/package.json +3 -3
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const dispose: () => Promise<void>, invoke: (method: string, ...params: readonly unknown[]) => Promise<any>, invokeAndTransfer: (method: string, ...params: readonly unknown[]) => Promise<any>, registerMockRpc: (commandMap: Record<string, any>) => import("../DisposableMockRpc/DisposableMockRpc.ts").DisposableMockRpc, set: (rpc: import("@lvce-editor/rpc").Rpc) => void;
|
|
2
|
+
export declare const base64StringToBlob: (base64String: string, type: string) => Promise<Blob>;
|
|
3
|
+
export declare const binaryStringToBlob: (binaryString: string, type: string) => Promise<Blob>;
|
|
4
|
+
export declare const blobToBinaryString: (blob: Blob) => Promise<string>;
|
|
5
|
+
export declare const handleMessagePort: (port: MessagePort) => Promise<void>;
|
|
6
|
+
export declare const terminate: () => Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as RpcFactory from "../RpcFactory/RpcFactory.js";
|
|
2
|
+
export const { dispose, invoke, invokeAndTransfer, registerMockRpc, set } = RpcFactory.create(19_000);
|
|
3
|
+
export const base64StringToBlob = async (base64String, type) => {
|
|
4
|
+
return invoke('Blob.base64StringToBlob', base64String, type);
|
|
5
|
+
};
|
|
6
|
+
export const binaryStringToBlob = async (binaryString, type) => {
|
|
7
|
+
return invoke('Blob.binaryStringToBlob', binaryString, type);
|
|
8
|
+
};
|
|
9
|
+
export const blobToBinaryString = async (blob) => {
|
|
10
|
+
return invoke('Blob.blobToBinaryString', blob);
|
|
11
|
+
};
|
|
12
|
+
export const handleMessagePort = async (port) => {
|
|
13
|
+
return invokeAndTransfer('Blob.handleMessagePort', port);
|
|
14
|
+
};
|
|
15
|
+
export const terminate = async () => {
|
|
16
|
+
return invoke('Blob.terminate');
|
|
17
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export type { Rpc
|
|
1
|
+
export type { Rpc } from '@lvce-editor/rpc';
|
|
2
2
|
export * as AuthWorker from '../AuthWorker/AuthWorker.ts';
|
|
3
|
+
export * as BlobWorker from '../BlobWorker/BlobWorker.ts';
|
|
3
4
|
export * as ChatCoordinatorWorker from '../ChatCoordinatorWorker/ChatCoordinatorWorker.ts';
|
|
4
5
|
export * as ChatDebugWorker from '../ChatDebugWorker/ChatDebugWorker.ts';
|
|
5
6
|
export * as ChatMathWorker from '../ChatMathWorker/ChatMathWorker.ts';
|
|
@@ -41,6 +42,7 @@ export * from '../CreateLazyRpc/CreateLazyRpc.ts';
|
|
|
41
42
|
export * from '../GetIpcType/GetIpcType.ts';
|
|
42
43
|
export * from '../RegisterMockRpc/RegisterMockRpc.ts';
|
|
43
44
|
export * from '../RpcRegistry/RpcRegistry.ts';
|
|
45
|
+
export type * from '../MockRpc/MockRpc.ts';
|
|
44
46
|
export type * from '../SearchResult/SearchResult.ts';
|
|
45
47
|
export type * from '../Change/Change.ts';
|
|
46
48
|
export type * from '../TextEdit/TextEdit.ts';
|
package/dist/parts/Main/Main.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as AuthWorker from "../AuthWorker/AuthWorker.js";
|
|
2
|
+
export * as BlobWorker from "../BlobWorker/BlobWorker.js";
|
|
2
3
|
export * as ChatCoordinatorWorker from "../ChatCoordinatorWorker/ChatCoordinatorWorker.js";
|
|
3
4
|
export * as ChatDebugWorker from "../ChatDebugWorker/ChatDebugWorker.js";
|
|
4
5
|
export * as ChatMathWorker from "../ChatMathWorker/ChatMathWorker.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MockRpc } from '
|
|
1
|
+
import type { MockRpc } from '../MockRpc/MockRpc.ts';
|
|
2
2
|
export declare const registerMockRpc: (rpcId: number, commandMap: Record<string, any>) => MockRpc;
|
|
@@ -51,6 +51,7 @@ export declare const getViewletModuleId: (uri: string) => Promise<string>;
|
|
|
51
51
|
export declare const showPanel: () => Promise<void>;
|
|
52
52
|
export declare const showPreview: () => Promise<void>;
|
|
53
53
|
export declare const saveEditor: () => Promise<void>;
|
|
54
|
+
export declare const sendMessagePortToFileSearchWorker2: (port: MessagePort, rpcId?: number) => Promise<void>;
|
|
54
55
|
export declare const togglePanelView: (id: string) => Promise<void>;
|
|
55
56
|
export declare const resizeViewlet: (uid: number, dimensions: any) => Promise<readonly any[]>;
|
|
56
57
|
export declare const sendMessagePortToFileSearchWorker: (port: MessagePort, rpcId?: number) => Promise<void>;
|
|
@@ -91,6 +92,7 @@ export declare const rerenderEditor: (key: string) => Promise<void>;
|
|
|
91
92
|
export declare const handleDebugPaused: (params: any) => Promise<void>;
|
|
92
93
|
export declare const openUri: (uri: string, focus?: boolean, options?: any) => Promise<void>;
|
|
93
94
|
export declare const sendMessagePortToSyntaxHighlightingWorker: (port: MessagePort) => Promise<void>;
|
|
95
|
+
export declare const sendMessagePortToBlobWorker: (port: MessagePort, rpcId?: number) => Promise<void>;
|
|
94
96
|
export declare const handleDebugScriptParsed: (script: any) => Promise<void>;
|
|
95
97
|
export declare const getWindowId: () => Promise<number>;
|
|
96
98
|
export declare const getBlob: (uri: string) => Promise<Blob>;
|
|
@@ -117,3 +119,5 @@ export declare const showSaveFilePicker: () => Promise<string>;
|
|
|
117
119
|
export declare const getLogsDir: () => Promise<string>;
|
|
118
120
|
export declare const measureTextBlockHeight: (actualInput: string, fontFamily: string, fontSize: number, lineHeightPx: number | string, width: number) => Promise<number>;
|
|
119
121
|
export declare const refreshOutput: () => Promise<void>;
|
|
122
|
+
export declare const initializeOpenerWorker: () => Promise<void>;
|
|
123
|
+
export declare const initializeEditorWorker: () => Promise<void>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as Assert from '@lvce-editor/assert';
|
|
2
2
|
import { InputSource, RpcId } from '@lvce-editor/constants';
|
|
3
|
+
import { LazyTransferMessagePortRpcParent } from '@lvce-editor/rpc';
|
|
4
|
+
import * as EditorWorker from "../EditorWorker/EditorWorker.js";
|
|
5
|
+
import * as OpenerWorker from "../OpenerWorker/OpenerWorker.js";
|
|
3
6
|
import * as RpcFactory from "../RpcFactory/RpcFactory.js";
|
|
4
7
|
export const { dispose, invoke, invokeAndTransfer, registerMockRpc, set } = RpcFactory.create(RpcId.RendererWorker);
|
|
5
8
|
export const searchFileHtml = async (uri) => {
|
|
@@ -172,6 +175,10 @@ export const showPreview = async () => {
|
|
|
172
175
|
export const saveEditor = async () => {
|
|
173
176
|
return invoke('Editor.save');
|
|
174
177
|
};
|
|
178
|
+
export const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
|
|
179
|
+
const command = 'FileSearch.handleMessagePort';
|
|
180
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
181
|
+
};
|
|
175
182
|
export const togglePanelView = async (id) => {
|
|
176
183
|
return invoke('Panel.toggleView', id);
|
|
177
184
|
};
|
|
@@ -303,6 +310,10 @@ export const openUri = async (uri, focus, options) => {
|
|
|
303
310
|
export const sendMessagePortToSyntaxHighlightingWorker = async (port) => {
|
|
304
311
|
await invokeAndTransfer('SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
305
312
|
};
|
|
313
|
+
export const sendMessagePortToBlobWorker = async (port, rpcId = 0) => {
|
|
314
|
+
const command = 'Blob.handleMessagePort';
|
|
315
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToBlobWorker', port, command, rpcId);
|
|
316
|
+
};
|
|
306
317
|
export const handleDebugScriptParsed = async (script) => {
|
|
307
318
|
await invoke('Run And Debug.handleScriptParsed', script);
|
|
308
319
|
};
|
|
@@ -381,3 +392,23 @@ export const measureTextBlockHeight = async (actualInput, fontFamily, fontSize,
|
|
|
381
392
|
export const refreshOutput = async () => {
|
|
382
393
|
await invoke('Output.refresh');
|
|
383
394
|
};
|
|
395
|
+
const send = async (port, sourceId = 0) => {
|
|
396
|
+
await sendMessagePortToOpenerWorker(port, sourceId);
|
|
397
|
+
};
|
|
398
|
+
export const initializeOpenerWorker = async () => {
|
|
399
|
+
const rpc = await LazyTransferMessagePortRpcParent.create({
|
|
400
|
+
commandMap: {},
|
|
401
|
+
send,
|
|
402
|
+
});
|
|
403
|
+
OpenerWorker.set(rpc);
|
|
404
|
+
};
|
|
405
|
+
const send2 = async (port) => {
|
|
406
|
+
await sendMessagePortToEditorWorker(port, RpcId.TestWorker);
|
|
407
|
+
};
|
|
408
|
+
export const initializeEditorWorker = async () => {
|
|
409
|
+
const rpc = await LazyTransferMessagePortRpcParent.create({
|
|
410
|
+
commandMap: {},
|
|
411
|
+
send: send2,
|
|
412
|
+
});
|
|
413
|
+
EditorWorker.set(rpc);
|
|
414
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/rpc-registry",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.18.0",
|
|
4
4
|
"description": "Rpc Registry",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@lvce-editor/assert": "^1.5.1",
|
|
16
|
-
"@lvce-editor/constants": "^5.
|
|
17
|
-
"@lvce-editor/rpc": "^
|
|
16
|
+
"@lvce-editor/constants": "^5.9.0",
|
|
17
|
+
"@lvce-editor/rpc": "^6.4.0"
|
|
18
18
|
},
|
|
19
19
|
"exports": "./dist/index.js",
|
|
20
20
|
"types": "dist/index.d.ts"
|