@lvce-editor/rpc-registry 2.42.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 CHANGED
@@ -470,6 +470,7 @@ declare const searchFileHtml: (uri: string) => Promise<readonly string[]>;
470
470
  declare const getFilePathElectron: (file: File) => Promise<string>;
471
471
  declare const showContextMenu: (x: number, y: number, id: number, ...args: readonly any[]) => Promise<void>;
472
472
  declare const getElectronVersion: () => Promise<string>;
473
+ declare const applyBulkReplacement: (bulkEdits: readonly any[]) => Promise<void>;
473
474
  declare const setColorTheme: (id: string) => Promise<string>;
474
475
  declare const getNodeVersion: () => Promise<string>;
475
476
  declare const getChromeVersion: () => Promise<string>;
@@ -488,8 +489,8 @@ declare const getFolderIcon: (options: any) => Promise<string>;
488
489
  declare const closeWidget$1: (widgetId: string | number) => Promise<void>;
489
490
  declare const sendMessagePortToExtensionHostWorker$1: (port: MessagePort, rpcId?: number) => Promise<void>;
490
491
  declare const sendMessagePortToSearchProcess: (port: MessagePort) => Promise<void>;
491
- declare const confirm: (message: string) => Promise<boolean>;
492
- declare const getRecentlyOpened: (message: string) => Promise<readonly string[]>;
492
+ declare const confirm: (message: string, options?: any) => Promise<boolean>;
493
+ declare const getRecentlyOpened: () => Promise<readonly string[]>;
493
494
  declare const writeClipBoardText: (text: string) => Promise<void>;
494
495
  declare const searchFileMemory: (uri: string) => Promise<void>;
495
496
  declare const searchFileFetch: (uri: string) => Promise<readonly string[]>;
@@ -503,6 +504,7 @@ declare const getActiveEditorId: () => Promise<number>;
503
504
  declare const getWorkspacePath: () => Promise<string>;
504
505
  declare const sendMessagePortToRendererProcess: (port: MessagePort) => Promise<void>;
505
506
  declare const getPreference: (key: string) => Promise<any>;
507
+ declare const getAllExtensions: (key: string) => Promise<readonly any[]>;
506
508
  declare const rerenderEditor: (key: string) => Promise<void>;
507
509
  declare const handleDebugPaused: (params: any) => Promise<void>;
508
510
  declare const openUri: (uri: string, focus?: boolean, options?: any) => Promise<void>;
@@ -510,7 +512,7 @@ declare const sendMessagePortToSyntaxHighlightingWorker: (port: MessagePort) =>
510
512
  declare const handleDebugScriptParsed: (script: any) => Promise<void>;
511
513
  declare const getWindowId: () => Promise<number>;
512
514
  declare const getBlob: (uri: string) => Promise<Blob>;
513
- declare const getExtensionCommands: (uri: string) => Promise<readonly any[]>;
515
+ declare const getExtensionCommands: () => Promise<readonly any[]>;
514
516
  declare const showErrorDialog: (errorInfo: any) => Promise<void>;
515
517
  declare const DebugWorker = 55;
516
518
  declare const EditorWorker = 99;
@@ -538,6 +540,9 @@ export interface SearchProcessApi {
538
540
  readonly "TextSearch.search": (options: any) => Promise<readonly SearchResult[]>;
539
541
  }
540
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>;
541
546
  export interface SharedProcessApi {
542
547
  readonly "ElectronWebContents.callFunction": (webContentsId: any, method: string, ...params: readonly any[]) => Promise<any>;
543
548
  readonly "ElectronWebContents.dispose": (id: any) => Promise<void>;
@@ -615,13 +620,13 @@ declare namespace RendererProcess$1 {
615
620
  export { dispose$11 as dispose, invoke$11 as invoke, invokeAndTransfer$11 as invokeAndTransfer, readClipBoard, readClipBoardText, set$11 as set, writeClipBoard };
616
621
  }
617
622
  declare namespace RendererWorker$1 {
618
- export { activateByEvent$1 as activateByEvent, closeWidget$1 as closeWidget, confirm, dispose$12 as dispose, getActiveEditorId, 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 };
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 };
619
624
  }
620
625
  declare namespace RpcId {
621
626
  export { ClipBoardProcess, ClipBoardWorker, ColorPickerWorker, CompletionWorker, DebugWorker, EditorWorker, EmbedsProcess, EmbedsWorker, ErrorWorker, ExtensionHostWorker, FileSystemProcess, FileSystemWorker, MainProcess, MarkdownWorker, RendererProcess, RendererWorker, SearchProcess, SearchProcessElectron, SharedProcess, SourceActionWorker, SourceControlWorker, SyntaxHighlightingWorker };
622
627
  }
623
628
  declare namespace SearchProcess$1 {
624
- 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 };
625
630
  }
626
631
  declare namespace SharedProcess$1 {
627
632
  export { dispose$14 as dispose, invoke$14 as invoke, invokeAndTransfer$14 as invokeAndTransfer, set$14 as set };
package/dist/index.js CHANGED
@@ -426,6 +426,9 @@ const showContextMenu = async (x, y, id, ...args) => {
426
426
  const getElectronVersion = async () => {
427
427
  return invoke$4('Process.getElectronVersion');
428
428
  };
429
+ const applyBulkReplacement = async bulkEdits => {
430
+ await invoke$4('BulkReplacement.applyBulkReplacement', bulkEdits);
431
+ };
429
432
  const setColorTheme = async id => {
430
433
  // @ts-ignore
431
434
  return invoke$4(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
@@ -487,12 +490,12 @@ const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
487
490
  const sendMessagePortToSearchProcess = async port => {
488
491
  await invokeAndTransfer$3('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
489
492
  };
490
- const confirm = async message => {
493
+ const confirm = async (message, options) => {
491
494
  // @ts-ignore
492
- const result = await invoke$4('Confirmprompt.prompt', message);
495
+ const result = await invoke$4('Confirmprompt.prompt', message, options);
493
496
  return result;
494
497
  };
495
- const getRecentlyOpened = async message => {
498
+ const getRecentlyOpened = async () => {
496
499
  return invoke$4(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
497
500
  };
498
501
  const writeClipBoardText = async text => {
@@ -540,6 +543,9 @@ const sendMessagePortToRendererProcess = async port => {
540
543
  const getPreference = async key => {
541
544
  return await invoke$4('Preferences.get', key);
542
545
  };
546
+ const getAllExtensions = async key => {
547
+ return invoke$4('ExtensionManagement.getAllExtensions');
548
+ };
543
549
  const rerenderEditor = async key => {
544
550
  // @ts-ignore
545
551
  return invoke$4('Editor.rerender', key);
@@ -565,7 +571,7 @@ const getBlob = async uri => {
565
571
  // @ts-ignore
566
572
  return invoke$4('FileSystem.getBlob', uri);
567
573
  };
568
- const getExtensionCommands = async uri => {
574
+ const getExtensionCommands = async () => {
569
575
  return invoke$4('ExtensionHost.getCommands');
570
576
  };
571
577
  const showErrorDialog = async errorInfo => {
@@ -576,10 +582,12 @@ const showErrorDialog = async errorInfo => {
576
582
  const RendererWorker = {
577
583
  __proto__: null,
578
584
  activateByEvent,
585
+ applyBulkReplacement,
579
586
  closeWidget,
580
587
  confirm,
581
588
  dispose: dispose$3,
582
589
  getActiveEditorId,
590
+ getAllExtensions,
583
591
  getBlob,
584
592
  getChromeVersion,
585
593
  getColorThemeNames,
@@ -634,11 +642,28 @@ const {
634
642
  dispose: dispose$2
635
643
  } = create(SearchProcess$1);
636
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
+
637
659
  const SearchProcess = {
638
660
  __proto__: null,
639
661
  dispose: dispose$2,
662
+ getIncrementalResults,
640
663
  invoke: invoke$3,
641
664
  invokeAndTransfer: invokeAndTransfer$2,
665
+ search,
666
+ searchIncremental,
642
667
  set: set$2
643
668
  };
644
669
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/rpc-registry",
3
- "version": "2.42.0",
3
+ "version": "2.43.0",
4
4
  "description": "Rpc Registry",
5
5
  "license": "MIT",
6
6
  "author": "Lvce Editor",