@lvce-editor/rpc-registry 2.41.0 → 2.43.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 +19 -5
- package/dist/index.js +68 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ declare const getOffsetAtCursor: (editorId: number) => Promise<number>;
|
|
|
57
57
|
declare const getSelections: (editorUid: number) => Promise<readonly number[]>;
|
|
58
58
|
declare const getWordAtOffset2: (editorUid: number) => Promise<string>;
|
|
59
59
|
declare const getWordBefore: (editorUid: number, rowIndex: number, columnIndex: number) => Promise<string>;
|
|
60
|
+
declare const updateDebugInfo: (info: any) => Promise<void>;
|
|
60
61
|
export interface EmbedsProcessApi {
|
|
61
62
|
readonly "ElectronWebContents.dispose": (id: any) => Promise<void>;
|
|
62
63
|
readonly "ElectronWebContentsView.attachEventListeners": (webContentsId: any) => Promise<void>;
|
|
@@ -465,9 +466,12 @@ export interface RendererWorkerApi {
|
|
|
465
466
|
readonly "Workspace.setPath": (uri: string) => Promise<void>;
|
|
466
467
|
}
|
|
467
468
|
declare const invoke$12: <T extends keyof RendererWorkerApi>(method: T, ...params: Parameters<RendererWorkerApi[T]>) => ReturnType<RendererWorkerApi[T]>, invokeAndTransfer$12: <T extends keyof RendererWorkerApi>(method: T, ...params: Parameters<RendererWorkerApi[T]>) => ReturnType<RendererWorkerApi[T]>, set$12: (rpc: import("@lvce-editor/rpc").Rpc) => void, dispose$12: () => Promise<void>;
|
|
469
|
+
declare const searchFileHtml: (uri: string) => Promise<readonly string[]>;
|
|
468
470
|
declare const getFilePathElectron: (file: File) => Promise<string>;
|
|
469
471
|
declare const showContextMenu: (x: number, y: number, id: number, ...args: readonly any[]) => Promise<void>;
|
|
470
472
|
declare const getElectronVersion: () => Promise<string>;
|
|
473
|
+
declare const applyBulkReplacement: (bulkEdits: readonly any[]) => Promise<void>;
|
|
474
|
+
declare const setColorTheme: (id: string) => Promise<string>;
|
|
471
475
|
declare const getNodeVersion: () => Promise<string>;
|
|
472
476
|
declare const getChromeVersion: () => Promise<string>;
|
|
473
477
|
declare const getV8Version: () => Promise<string>;
|
|
@@ -479,13 +483,17 @@ declare const getWebViewSecret: (key: string) => Promise<string>;
|
|
|
479
483
|
declare const setWebViewPort: (uid: number, port: MessagePort, origin: string, portType: any) => Promise<void>;
|
|
480
484
|
declare const setFocus: (key: number) => Promise<void>;
|
|
481
485
|
declare const getFileIcon: (options: any) => Promise<string>;
|
|
486
|
+
declare const getColorThemeNames: () => Promise<readonly string[]>;
|
|
482
487
|
declare const handleDebugChange: (params: any) => Promise<void>;
|
|
483
488
|
declare const getFolderIcon: (options: any) => Promise<string>;
|
|
484
|
-
declare const closeWidget$1: (
|
|
489
|
+
declare const closeWidget$1: (widgetId: string | number) => Promise<void>;
|
|
485
490
|
declare const sendMessagePortToExtensionHostWorker$1: (port: MessagePort, rpcId?: number) => Promise<void>;
|
|
486
491
|
declare const sendMessagePortToSearchProcess: (port: MessagePort) => Promise<void>;
|
|
487
|
-
declare const confirm: (message: string) => Promise<boolean>;
|
|
492
|
+
declare const confirm: (message: string, options?: any) => Promise<boolean>;
|
|
493
|
+
declare const getRecentlyOpened: () => Promise<readonly string[]>;
|
|
488
494
|
declare const writeClipBoardText: (text: string) => Promise<void>;
|
|
495
|
+
declare const searchFileMemory: (uri: string) => Promise<void>;
|
|
496
|
+
declare const searchFileFetch: (uri: string) => Promise<readonly string[]>;
|
|
489
497
|
declare const showMessageBox: (options: any) => Promise<void>;
|
|
490
498
|
declare const handleDebugResumed: (params: any) => Promise<void>;
|
|
491
499
|
declare const openWidget: (name: string) => Promise<void>;
|
|
@@ -493,8 +501,10 @@ declare const getIcons: (requests: readonly any[]) => Promise<readonly string[]>
|
|
|
493
501
|
declare const activateByEvent$1: (event: string) => Promise<void>;
|
|
494
502
|
declare const setAdditionalFocus: (focusKey: number) => Promise<void>;
|
|
495
503
|
declare const getActiveEditorId: () => Promise<number>;
|
|
504
|
+
declare const getWorkspacePath: () => Promise<string>;
|
|
496
505
|
declare const sendMessagePortToRendererProcess: (port: MessagePort) => Promise<void>;
|
|
497
506
|
declare const getPreference: (key: string) => Promise<any>;
|
|
507
|
+
declare const getAllExtensions: (key: string) => Promise<readonly any[]>;
|
|
498
508
|
declare const rerenderEditor: (key: string) => Promise<void>;
|
|
499
509
|
declare const handleDebugPaused: (params: any) => Promise<void>;
|
|
500
510
|
declare const openUri: (uri: string, focus?: boolean, options?: any) => Promise<void>;
|
|
@@ -502,6 +512,7 @@ declare const sendMessagePortToSyntaxHighlightingWorker: (port: MessagePort) =>
|
|
|
502
512
|
declare const handleDebugScriptParsed: (script: any) => Promise<void>;
|
|
503
513
|
declare const getWindowId: () => Promise<number>;
|
|
504
514
|
declare const getBlob: (uri: string) => Promise<Blob>;
|
|
515
|
+
declare const getExtensionCommands: () => Promise<readonly any[]>;
|
|
505
516
|
declare const showErrorDialog: (errorInfo: any) => Promise<void>;
|
|
506
517
|
declare const DebugWorker = 55;
|
|
507
518
|
declare const EditorWorker = 99;
|
|
@@ -529,6 +540,9 @@ export interface SearchProcessApi {
|
|
|
529
540
|
readonly "TextSearch.search": (options: any) => Promise<readonly SearchResult[]>;
|
|
530
541
|
}
|
|
531
542
|
declare const invoke$13: <T extends "TextSearch.search">(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>, invokeAndTransfer$13: <T extends "TextSearch.search">(method: T, ...params: Parameters<SearchProcessApi[T]>) => ReturnType<SearchProcessApi[T]>, set$13: (rpc: import("@lvce-editor/rpc").Rpc) => void, dispose$13: () => Promise<void>;
|
|
543
|
+
declare const search: (options: any) => Promise<any>;
|
|
544
|
+
declare const searchIncremental: (options: any) => Promise<any>;
|
|
545
|
+
declare const getIncrementalResults: (searchId: string, minLineY: number, maxLineY: number) => Promise<any>;
|
|
532
546
|
export interface SharedProcessApi {
|
|
533
547
|
readonly "ElectronWebContents.callFunction": (webContentsId: any, method: string, ...params: readonly any[]) => Promise<any>;
|
|
534
548
|
readonly "ElectronWebContents.dispose": (id: any) => Promise<void>;
|
|
@@ -576,7 +590,7 @@ declare namespace DebugWorker$1 {
|
|
|
576
590
|
export { dispose$2 as dispose, invoke$2 as invoke, invokeAndTransfer$2 as invokeAndTransfer, set$2 as set };
|
|
577
591
|
}
|
|
578
592
|
declare namespace EditorWorker$1 {
|
|
579
|
-
export { activateByEvent, applyEdit, closeWidget, dispose$3 as dispose, getLines, getOffsetAtCursor, getPositionAtCursor, getSelections, getWordAt, getWordAtOffset2, getWordBefore, invoke$3 as invoke, invokeAndTransfer$3 as invokeAndTransfer, sendMessagePortToExtensionHostWorker, set$3 as set };
|
|
593
|
+
export { activateByEvent, applyEdit, closeWidget, dispose$3 as dispose, getLines, getOffsetAtCursor, getPositionAtCursor, getSelections, getWordAt, getWordAtOffset2, getWordBefore, invoke$3 as invoke, invokeAndTransfer$3 as invokeAndTransfer, sendMessagePortToExtensionHostWorker, set$3 as set, updateDebugInfo };
|
|
580
594
|
}
|
|
581
595
|
declare namespace EmbedsProcess$1 {
|
|
582
596
|
export { dispose$4 as dispose, invoke$4 as invoke, invokeAndTransfer$4 as invokeAndTransfer, set$4 as set };
|
|
@@ -606,13 +620,13 @@ declare namespace RendererProcess$1 {
|
|
|
606
620
|
export { dispose$11 as dispose, invoke$11 as invoke, invokeAndTransfer$11 as invokeAndTransfer, readClipBoard, readClipBoardText, set$11 as set, writeClipBoard };
|
|
607
621
|
}
|
|
608
622
|
declare namespace RendererWorker$1 {
|
|
609
|
-
export { activateByEvent$1 as activateByEvent, closeWidget$1 as closeWidget, confirm, dispose$12 as dispose, getActiveEditorId, getBlob, getChromeVersion, getElectronVersion, getFileHandles, getFileIcon, getFilePathElectron, getFolderIcon, getIcons, getNodeVersion, getPreference, getV8Version, getWebViewSecret, getWindowId, handleDebugChange, handleDebugPaused, handleDebugResumed, handleDebugScriptParsed, invoke$12 as invoke, invokeAndTransfer$12 as invokeAndTransfer, openUri, openWidget, readFile, rerenderEditor, sendMessagePortToEditorWorker, sendMessagePortToExtensionHostWorker$1 as sendMessagePortToExtensionHostWorker, sendMessagePortToRendererProcess, sendMessagePortToSearchProcess, sendMessagePortToSyntaxHighlightingWorker, set$12 as set, setAdditionalFocus, setFocus, setWebViewPort, setWorkspacePath, showContextMenu, showErrorDialog, showMessageBox, writeClipBoardText };
|
|
623
|
+
export { activateByEvent$1 as activateByEvent, applyBulkReplacement, closeWidget$1 as closeWidget, confirm, dispose$12 as dispose, getActiveEditorId, getAllExtensions, getBlob, getChromeVersion, getColorThemeNames, getElectronVersion, getExtensionCommands, getFileHandles, getFileIcon, getFilePathElectron, getFolderIcon, getIcons, getNodeVersion, getPreference, getRecentlyOpened, getV8Version, getWebViewSecret, getWindowId, getWorkspacePath, handleDebugChange, handleDebugPaused, handleDebugResumed, handleDebugScriptParsed, invoke$12 as invoke, invokeAndTransfer$12 as invokeAndTransfer, openUri, openWidget, readFile, rerenderEditor, searchFileFetch, searchFileHtml, searchFileMemory, sendMessagePortToEditorWorker, sendMessagePortToExtensionHostWorker$1 as sendMessagePortToExtensionHostWorker, sendMessagePortToRendererProcess, sendMessagePortToSearchProcess, sendMessagePortToSyntaxHighlightingWorker, set$12 as set, setAdditionalFocus, setColorTheme, setFocus, setWebViewPort, setWorkspacePath, showContextMenu, showErrorDialog, showMessageBox, writeClipBoardText };
|
|
610
624
|
}
|
|
611
625
|
declare namespace RpcId {
|
|
612
626
|
export { ClipBoardProcess, ClipBoardWorker, ColorPickerWorker, CompletionWorker, DebugWorker, EditorWorker, EmbedsProcess, EmbedsWorker, ErrorWorker, ExtensionHostWorker, FileSystemProcess, FileSystemWorker, MainProcess, MarkdownWorker, RendererProcess, RendererWorker, SearchProcess, SearchProcessElectron, SharedProcess, SourceActionWorker, SourceControlWorker, SyntaxHighlightingWorker };
|
|
613
627
|
}
|
|
614
628
|
declare namespace SearchProcess$1 {
|
|
615
|
-
export { dispose$13 as dispose, invoke$13 as invoke, invokeAndTransfer$13 as invokeAndTransfer, set$13 as set };
|
|
629
|
+
export { dispose$13 as dispose, getIncrementalResults, invoke$13 as invoke, invokeAndTransfer$13 as invokeAndTransfer, search, searchIncremental, set$13 as set };
|
|
616
630
|
}
|
|
617
631
|
declare namespace SharedProcess$1 {
|
|
618
632
|
export { dispose$14 as dispose, invoke$14 as invoke, invokeAndTransfer$14 as invokeAndTransfer, set$14 as set };
|
package/dist/index.js
CHANGED
|
@@ -183,6 +183,9 @@ const getWordAtOffset2 = async editorUid => {
|
|
|
183
183
|
const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
|
|
184
184
|
return invoke$d('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
|
|
185
185
|
};
|
|
186
|
+
const updateDebugInfo = async info => {
|
|
187
|
+
await invoke$d('Editor.updateDebugInfo', info);
|
|
188
|
+
};
|
|
186
189
|
|
|
187
190
|
const EditorWorker = {
|
|
188
191
|
__proto__: null,
|
|
@@ -200,7 +203,8 @@ const EditorWorker = {
|
|
|
200
203
|
invoke: invoke$d,
|
|
201
204
|
invokeAndTransfer: invokeAndTransfer$c,
|
|
202
205
|
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
203
|
-
set: set$c
|
|
206
|
+
set: set$c,
|
|
207
|
+
updateDebugInfo
|
|
204
208
|
};
|
|
205
209
|
|
|
206
210
|
const {
|
|
@@ -410,6 +414,9 @@ const {
|
|
|
410
414
|
set: set$3,
|
|
411
415
|
dispose: dispose$3
|
|
412
416
|
} = create(RendererWorker$1);
|
|
417
|
+
const searchFileHtml = async uri => {
|
|
418
|
+
return invoke$4('ExtensionHost.searchFileWithHtml', uri);
|
|
419
|
+
};
|
|
413
420
|
const getFilePathElectron = async file => {
|
|
414
421
|
return invoke$4('FileSystemHandle.getFilePathElectron', file);
|
|
415
422
|
};
|
|
@@ -419,6 +426,13 @@ const showContextMenu = async (x, y, id, ...args) => {
|
|
|
419
426
|
const getElectronVersion = async () => {
|
|
420
427
|
return invoke$4('Process.getElectronVersion');
|
|
421
428
|
};
|
|
429
|
+
const applyBulkReplacement = async bulkEdits => {
|
|
430
|
+
await invoke$4('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
431
|
+
};
|
|
432
|
+
const setColorTheme = async id => {
|
|
433
|
+
// @ts-ignore
|
|
434
|
+
return invoke$4(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
435
|
+
};
|
|
422
436
|
const getNodeVersion = async () => {
|
|
423
437
|
return invoke$4('Process.getNodeVersion');
|
|
424
438
|
};
|
|
@@ -456,6 +470,9 @@ const setFocus = key => {
|
|
|
456
470
|
const getFileIcon = async options => {
|
|
457
471
|
return invoke$4('IconTheme.getFileIcon', options);
|
|
458
472
|
};
|
|
473
|
+
const getColorThemeNames = async () => {
|
|
474
|
+
return invoke$4('ColorTheme.getColorThemeNames');
|
|
475
|
+
};
|
|
459
476
|
const handleDebugChange = async params => {
|
|
460
477
|
// @ts-ignore
|
|
461
478
|
return invoke$4('Run And Debug.handleChange', params);
|
|
@@ -463,8 +480,8 @@ const handleDebugChange = async params => {
|
|
|
463
480
|
const getFolderIcon = async options => {
|
|
464
481
|
return invoke$4('IconTheme.getFolderIcon', options);
|
|
465
482
|
};
|
|
466
|
-
const closeWidget = async
|
|
467
|
-
return invoke$4('Viewlet.closeWidget',
|
|
483
|
+
const closeWidget = async widgetId => {
|
|
484
|
+
return invoke$4('Viewlet.closeWidget', widgetId);
|
|
468
485
|
};
|
|
469
486
|
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
470
487
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
@@ -473,14 +490,24 @@ const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
|
473
490
|
const sendMessagePortToSearchProcess = async port => {
|
|
474
491
|
await invokeAndTransfer$3('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
475
492
|
};
|
|
476
|
-
const confirm = async message => {
|
|
493
|
+
const confirm = async (message, options) => {
|
|
477
494
|
// @ts-ignore
|
|
478
|
-
const result = await invoke$4('Confirmprompt.prompt', message);
|
|
495
|
+
const result = await invoke$4('Confirmprompt.prompt', message, options);
|
|
479
496
|
return result;
|
|
480
497
|
};
|
|
498
|
+
const getRecentlyOpened = async () => {
|
|
499
|
+
return invoke$4(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
500
|
+
};
|
|
481
501
|
const writeClipBoardText = async text => {
|
|
482
502
|
await invoke$4('ClipBoard.writeText', /* text */text);
|
|
483
503
|
};
|
|
504
|
+
const searchFileMemory = async uri => {
|
|
505
|
+
// @ts-ignore
|
|
506
|
+
return invoke$4('ExtensionHost.searchFileWithMemory', uri);
|
|
507
|
+
};
|
|
508
|
+
const searchFileFetch = async uri => {
|
|
509
|
+
return invoke$4('ExtensionHost.searchFileWithFetch', uri);
|
|
510
|
+
};
|
|
484
511
|
const showMessageBox = async options => {
|
|
485
512
|
return invoke$4('ElectronDialog.showMessageBox', options);
|
|
486
513
|
};
|
|
@@ -505,6 +532,9 @@ const getActiveEditorId = () => {
|
|
|
505
532
|
// @ts-ignore
|
|
506
533
|
return invoke$4('GetActiveEditor.getActiveEditorId');
|
|
507
534
|
};
|
|
535
|
+
const getWorkspacePath = () => {
|
|
536
|
+
return invoke$4('Workspace.getPath');
|
|
537
|
+
};
|
|
508
538
|
const sendMessagePortToRendererProcess = async port => {
|
|
509
539
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
510
540
|
// @ts-ignore
|
|
@@ -513,6 +543,9 @@ const sendMessagePortToRendererProcess = async port => {
|
|
|
513
543
|
const getPreference = async key => {
|
|
514
544
|
return await invoke$4('Preferences.get', key);
|
|
515
545
|
};
|
|
546
|
+
const getAllExtensions = async key => {
|
|
547
|
+
return invoke$4('ExtensionManagement.getAllExtensions');
|
|
548
|
+
};
|
|
516
549
|
const rerenderEditor = async key => {
|
|
517
550
|
// @ts-ignore
|
|
518
551
|
return invoke$4('Editor.rerender', key);
|
|
@@ -538,6 +571,9 @@ const getBlob = async uri => {
|
|
|
538
571
|
// @ts-ignore
|
|
539
572
|
return invoke$4('FileSystem.getBlob', uri);
|
|
540
573
|
};
|
|
574
|
+
const getExtensionCommands = async () => {
|
|
575
|
+
return invoke$4('ExtensionHost.getCommands');
|
|
576
|
+
};
|
|
541
577
|
const showErrorDialog = async errorInfo => {
|
|
542
578
|
// @ts-ignore
|
|
543
579
|
await invoke$4('ErrorHandling.showErrorDialog', errorInfo);
|
|
@@ -546,13 +582,17 @@ const showErrorDialog = async errorInfo => {
|
|
|
546
582
|
const RendererWorker = {
|
|
547
583
|
__proto__: null,
|
|
548
584
|
activateByEvent,
|
|
585
|
+
applyBulkReplacement,
|
|
549
586
|
closeWidget,
|
|
550
587
|
confirm,
|
|
551
588
|
dispose: dispose$3,
|
|
552
589
|
getActiveEditorId,
|
|
590
|
+
getAllExtensions,
|
|
553
591
|
getBlob,
|
|
554
592
|
getChromeVersion,
|
|
593
|
+
getColorThemeNames,
|
|
555
594
|
getElectronVersion,
|
|
595
|
+
getExtensionCommands,
|
|
556
596
|
getFileHandles,
|
|
557
597
|
getFileIcon,
|
|
558
598
|
getFilePathElectron,
|
|
@@ -560,9 +600,11 @@ const RendererWorker = {
|
|
|
560
600
|
getIcons,
|
|
561
601
|
getNodeVersion,
|
|
562
602
|
getPreference,
|
|
603
|
+
getRecentlyOpened,
|
|
563
604
|
getV8Version,
|
|
564
605
|
getWebViewSecret,
|
|
565
606
|
getWindowId,
|
|
607
|
+
getWorkspacePath,
|
|
566
608
|
handleDebugChange,
|
|
567
609
|
handleDebugPaused,
|
|
568
610
|
handleDebugResumed,
|
|
@@ -573,6 +615,9 @@ const RendererWorker = {
|
|
|
573
615
|
openWidget,
|
|
574
616
|
readFile,
|
|
575
617
|
rerenderEditor,
|
|
618
|
+
searchFileFetch,
|
|
619
|
+
searchFileHtml,
|
|
620
|
+
searchFileMemory,
|
|
576
621
|
sendMessagePortToEditorWorker,
|
|
577
622
|
sendMessagePortToExtensionHostWorker,
|
|
578
623
|
sendMessagePortToRendererProcess,
|
|
@@ -580,6 +625,7 @@ const RendererWorker = {
|
|
|
580
625
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
581
626
|
set: set$3,
|
|
582
627
|
setAdditionalFocus,
|
|
628
|
+
setColorTheme,
|
|
583
629
|
setFocus,
|
|
584
630
|
setWebViewPort,
|
|
585
631
|
setWorkspacePath,
|
|
@@ -596,11 +642,28 @@ const {
|
|
|
596
642
|
dispose: dispose$2
|
|
597
643
|
} = create(SearchProcess$1);
|
|
598
644
|
|
|
645
|
+
// TODO add tests for this
|
|
646
|
+
const search = async options => {
|
|
647
|
+
const result = await invoke$3('TextSearch.search', options);
|
|
648
|
+
return result;
|
|
649
|
+
};
|
|
650
|
+
const searchIncremental = async options => {
|
|
651
|
+
// @ts-ignore
|
|
652
|
+
return invoke$3('TextSearch.searchIncremental', options);
|
|
653
|
+
};
|
|
654
|
+
const getIncrementalResults = async (searchId, minLineY, maxLineY) => {
|
|
655
|
+
// @ts-ignore
|
|
656
|
+
return invoke$3('TextSearch.getIncrementalResults', searchId, minLineY, maxLineY);
|
|
657
|
+
};
|
|
658
|
+
|
|
599
659
|
const SearchProcess = {
|
|
600
660
|
__proto__: null,
|
|
601
661
|
dispose: dispose$2,
|
|
662
|
+
getIncrementalResults,
|
|
602
663
|
invoke: invoke$3,
|
|
603
664
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
665
|
+
search,
|
|
666
|
+
searchIncremental,
|
|
604
667
|
set: set$2
|
|
605
668
|
};
|
|
606
669
|
|