@lvce-editor/rpc-registry 9.16.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.
@@ -1,3 +1,4 @@
1
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 makeApiRequest: (options: any) => Promise<any>;
3
- export declare const makeStreamingApiRequest: (options: any) => Promise<any>;
2
+ export declare const login: (options: any) => Promise<any>;
3
+ export declare const logout: (options: any) => Promise<any>;
4
+ export declare const clearMocks: () => Promise<void>;
@@ -1,8 +1,11 @@
1
1
  import * as RpcFactory from "../RpcFactory/RpcFactory.js";
2
2
  export const { dispose, invoke, invokeAndTransfer, registerMockRpc, set } = RpcFactory.create(6010);
3
- export const makeApiRequest = async (options) => {
4
- return invoke('ChatNetwork.makeApiRequest', options);
3
+ export const login = async (options) => {
4
+ return invoke('Auth.login', options);
5
5
  };
6
- export const makeStreamingApiRequest = async (options) => {
7
- return invoke('ChatNetwork.makeStreamingApiRequest', options);
6
+ export const logout = async (options) => {
7
+ return invoke('Auth.logout', options);
8
+ };
9
+ export const clearMocks = async () => {
10
+ return invoke('Auth.clearMocks');
8
11
  };
@@ -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,4 +1,4 @@
1
- import type { MockRpc } from '@lvce-editor/rpc';
1
+ import type { MockRpc } from '../MockRpc/MockRpc.ts';
2
2
  export interface DisposableMockRpc extends MockRpc {
3
3
  [Symbol.dispose]: () => void;
4
4
  }
@@ -1,5 +1,6 @@
1
- export type { Rpc, MockRpc } from '@lvce-editor/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';
@@ -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,2 @@
1
+ import type { createMockRpc } from '@lvce-editor/rpc';
2
+ export type MockRpc = ReturnType<typeof createMockRpc>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- import type { MockRpc } from '@lvce-editor/rpc';
1
+ import type { MockRpc } from '../MockRpc/MockRpc.ts';
2
2
  export declare const registerMockRpc: (rpcId: number, commandMap: Record<string, any>) => MockRpc;
@@ -27,6 +27,7 @@ export declare const sendMessagePortToChatMessageParsingWorker: (port: MessagePo
27
27
  export declare const sendMessagePortToMainAreaWorker: (port: MessagePort, rpcId: number) => Promise<void>;
28
28
  export declare const sendMessagePortToTerminalProcess: (port: MessagePort, rpcId: number) => Promise<void>;
29
29
  export declare const sendMessagePortToTextSearchWorker: (port: MessagePort, rpcId: number) => Promise<void>;
30
+ export declare const sendMessagePortToAuthWorker: (port: MessagePort, rpcId: number) => Promise<void>;
30
31
  export declare const sendMessagePortToErrorWorker: (port: MessagePort, rpcId: number) => Promise<void>;
31
32
  export declare const sendMessagePortToMarkdownWorker: (port: MessagePort, rpcId: number) => Promise<void>;
32
33
  export declare const sendMessagePortToIconThemeWorker: (port: MessagePort, rpcId: number) => Promise<void>;
@@ -50,6 +51,7 @@ export declare const getViewletModuleId: (uri: string) => Promise<string>;
50
51
  export declare const showPanel: () => Promise<void>;
51
52
  export declare const showPreview: () => Promise<void>;
52
53
  export declare const saveEditor: () => Promise<void>;
54
+ export declare const sendMessagePortToFileSearchWorker2: (port: MessagePort, rpcId?: number) => Promise<void>;
53
55
  export declare const togglePanelView: (id: string) => Promise<void>;
54
56
  export declare const resizeViewlet: (uid: number, dimensions: any) => Promise<readonly any[]>;
55
57
  export declare const sendMessagePortToFileSearchWorker: (port: MessagePort, rpcId?: number) => Promise<void>;
@@ -90,6 +92,7 @@ export declare const rerenderEditor: (key: string) => Promise<void>;
90
92
  export declare const handleDebugPaused: (params: any) => Promise<void>;
91
93
  export declare const openUri: (uri: string, focus?: boolean, options?: any) => Promise<void>;
92
94
  export declare const sendMessagePortToSyntaxHighlightingWorker: (port: MessagePort) => Promise<void>;
95
+ export declare const sendMessagePortToBlobWorker: (port: MessagePort, rpcId?: number) => Promise<void>;
93
96
  export declare const handleDebugScriptParsed: (script: any) => Promise<void>;
94
97
  export declare const getWindowId: () => Promise<number>;
95
98
  export declare const getBlob: (uri: string) => Promise<Blob>;
@@ -116,3 +119,5 @@ export declare const showSaveFilePicker: () => Promise<string>;
116
119
  export declare const getLogsDir: () => Promise<string>;
117
120
  export declare const measureTextBlockHeight: (actualInput: string, fontFamily: string, fontSize: number, lineHeightPx: number | string, width: number) => Promise<number>;
118
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) => {
@@ -94,6 +97,10 @@ export const sendMessagePortToTextSearchWorker = async (port, rpcId) => {
94
97
  const command = 'HandleMessagePort.handleMessagePort';
95
98
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextSearchWorker', port, command, rpcId);
96
99
  };
100
+ export const sendMessagePortToAuthWorker = async (port, rpcId) => {
101
+ const command = 'HandleMessagePort.handleMessagePort';
102
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToAuthWorker', port, command, rpcId);
103
+ };
97
104
  export const sendMessagePortToErrorWorker = async (port, rpcId) => {
98
105
  const command = 'Errors.handleMessagePort';
99
106
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
@@ -168,6 +175,10 @@ export const showPreview = async () => {
168
175
  export const saveEditor = async () => {
169
176
  return invoke('Editor.save');
170
177
  };
178
+ export const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
179
+ const command = 'FileSearch.handleMessagePort';
180
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
181
+ };
171
182
  export const togglePanelView = async (id) => {
172
183
  return invoke('Panel.toggleView', id);
173
184
  };
@@ -299,6 +310,10 @@ export const openUri = async (uri, focus, options) => {
299
310
  export const sendMessagePortToSyntaxHighlightingWorker = async (port) => {
300
311
  await invokeAndTransfer('SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
301
312
  };
313
+ export const sendMessagePortToBlobWorker = async (port, rpcId = 0) => {
314
+ const command = 'Blob.handleMessagePort';
315
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToBlobWorker', port, command, rpcId);
316
+ };
302
317
  export const handleDebugScriptParsed = async (script) => {
303
318
  await invoke('Run And Debug.handleScriptParsed', script);
304
319
  };
@@ -377,3 +392,23 @@ export const measureTextBlockHeight = async (actualInput, fontFamily, fontSize,
377
392
  export const refreshOutput = async () => {
378
393
  await invoke('Output.refresh');
379
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.16.0",
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.7.0",
17
- "@lvce-editor/rpc": "^5.5.0"
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"