@lvce-editor/test-worker 4.34.0 → 4.35.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/api.d.ts CHANGED
@@ -29,6 +29,9 @@ declare const openProcessExplorer: () => Promise<void>;
29
29
  declare const reloadColorTheme: () => Promise<void>;
30
30
  declare const reloadIconTheme: () => Promise<void>;
31
31
  declare const toggleDeveloperTools: () => Promise<void>;
32
+ declare const showSaveFilePicker: () => Promise<void>;
33
+ declare const mockSaveFilePicker: (fn: () => string) => Promise<void>;
34
+ declare const executeMock: (id: number) => string;
32
35
  declare const setCursor: (rowIndex: number, columnIndex: number) => Promise<void>;
33
36
  declare const openCompletion: () => Promise<void>;
34
37
  declare const closeCompletion: () => Promise<void>;
@@ -190,6 +193,7 @@ declare const focusLast$4: () => Promise<void>;
190
193
  declare const show$1: () => Promise<void>;
191
194
  declare const handleFilterInput: (text: string) => Promise<void>;
192
195
  declare const selectChannel: (channelId: string) => Promise<void>;
196
+ declare const clear: () => Promise<void>;
193
197
  declare const open$2: (id: string) => Promise<void>;
194
198
  declare const getNodePath: () => Promise<string>;
195
199
  declare const isFirefox: () => boolean;
@@ -252,7 +256,7 @@ declare const show$3: () => Promise<void>;
252
256
  declare const handleInput$2: (searchValue: string) => Promise<void>;
253
257
  declare const usePreviousSearchValue: () => Promise<void>;
254
258
  declare const useNextSearchValue: () => Promise<void>;
255
- declare const clear: (searchValue: string) => Promise<void>;
259
+ declare const clear$1: (searchValue: string) => Promise<void>;
256
260
  declare const selectTab$1: (tabId: string) => Promise<void>;
257
261
  declare const selectWorkspace: () => Promise<void>;
258
262
  declare const selectTextEditor: () => Promise<void>;
@@ -312,6 +316,9 @@ declare namespace ContextMenu {
312
316
  declare namespace Developer {
313
317
  export { openCacheFolder, openConfigFolder, openIframeInspector, openLogsFolder, openProcessExplorer, reloadColorTheme, reloadIconTheme, toggleDeveloperTools };
314
318
  }
319
+ declare namespace Dialog {
320
+ export { executeMock, mockSaveFilePicker, showSaveFilePicker };
321
+ }
315
322
  declare namespace Editor {
316
323
  export { addAllMissingImports, closeColorPicker, closeCompletion, closeCompletionDetails, copy, copyLineDown, copyLineUp, cursorCharacterLeft, cursorCharacterRight, cursorDown, cursorEnd, cursorHome, cursorUp, cursorWordLeft, cursorWordPartLeft, cursorWordPartRight, cursorWordRight, deleteAllLeft, deleteAllRight, executeTabCompletion, findAllImplementations, findAllReferences, format, getText, goToDefinition, goToTypeDefinition, insertLineBreak, invokeBraceCompletion, invokeTabCompletion, openColorPicker, openCompletion, openCompletionDetails, openContextMenu, openEditorContextMenu, openFind, openFindWidget, openHover, openRename, openSourceActions, organizeImports, rename, selectAll, setCursor, setDeltaY, setSelections, shouldHaveText, showHover, sortImports, sourceActionsSelectCurrent, toggleBlockComment, toggleCompletionDetails, toggleLineComment, type };
317
324
  }
@@ -349,7 +356,7 @@ declare namespace Main {
349
356
  export { closeActiveEditor, closeAllEditors, closeOthers, closeTabsLeft, closeTabsRight, focusFirst$4 as focusFirst, focusLast$4 as focusLast, focusNext$6 as focusNext, focusPrevious$4 as focusPrevious, openKeyBindings, openUri, splitRight };
350
357
  }
351
358
  declare namespace Output {
352
- export { handleFilterInput, selectChannel, show$1 as show };
359
+ export { clear, handleFilterInput, selectChannel, show$1 as show };
353
360
  }
354
361
  declare namespace Panel {
355
362
  export { open$2 as open };
@@ -373,7 +380,7 @@ declare namespace Settings {
373
380
  export { update };
374
381
  }
375
382
  declare namespace SettingsView {
376
- export { clear, handleInput$2 as handleInput, handleScroll$1 as handleScroll, selectExtensions, selectTab$1 as selectTab, selectTextEditor, selectWorkspace, show$3 as show, useNextSearchValue, usePreviousSearchValue };
383
+ export { clear$1 as clear, handleInput$2 as handleInput, handleScroll$1 as handleScroll, selectExtensions, selectTab$1 as selectTab, selectTextEditor, selectWorkspace, show$3 as show, useNextSearchValue, usePreviousSearchValue };
377
384
  }
378
385
  declare namespace SideBar {
379
386
  export { hide, open$4 as open };
@@ -402,6 +409,7 @@ export interface TestApi {
402
409
  readonly Command: typeof Command,
403
410
  readonly ContextMenu: typeof ContextMenu,
404
411
  readonly Developer: typeof Developer,
412
+ readonly Dialog: typeof Dialog,
405
413
  readonly Editor: typeof Editor,
406
414
  readonly EditorCompletion: typeof EditorCompletion,
407
415
  readonly Explorer: typeof Explorer,
@@ -1776,6 +1776,41 @@ const TestFrameWorkComponentDeveloper = {
1776
1776
  toggleDeveloperTools
1777
1777
  };
1778
1778
 
1779
+ const createId = () => {
1780
+ return Math.random();
1781
+ };
1782
+
1783
+ const mocks = Object.create(null);
1784
+ const registerMock = fn => {
1785
+ const id = createId();
1786
+ mocks[id] = fn;
1787
+ return id;
1788
+ };
1789
+ const executeMock$1 = id => {
1790
+ const fn = mocks[id];
1791
+ return fn();
1792
+ };
1793
+
1794
+ const showSaveFilePicker = async () => {
1795
+ // @ts-ignore
1796
+ await invoke('FilePicker.showSaveFilePicker');
1797
+ };
1798
+ const mockSaveFilePicker = async fn => {
1799
+ const id = registerMock(fn);
1800
+ // @ts-ignore
1801
+ await invoke('FilePicker.mockSaveFilePicker', id);
1802
+ };
1803
+ const executeMock = id => {
1804
+ return executeMock$1(id);
1805
+ };
1806
+
1807
+ const TestFrameWorkComponentDialog = {
1808
+ __proto__: null,
1809
+ executeMock,
1810
+ mockSaveFilePicker,
1811
+ showSaveFilePicker
1812
+ };
1813
+
1779
1814
  const setCursor = async (rowIndex, columnIndex) => {
1780
1815
  await invoke('Editor.cursorSet', rowIndex, columnIndex);
1781
1816
  };
@@ -2573,21 +2608,28 @@ const TestFrameWorkComponentMain = {
2573
2608
  splitRight
2574
2609
  };
2575
2610
 
2611
+ const Script = 2;
2612
+
2576
2613
  const show$2 = async () => {
2577
2614
  // @ts-ignore
2578
2615
  await invoke('Panel.selectIndex', 1);
2579
2616
  };
2580
2617
  const handleFilterInput$1 = async text => {
2581
2618
  // @ts-ignore
2582
- await invoke('Output.handleFilterInput', text);
2619
+ await invoke('Output.handleFilterInput', text, Script);
2583
2620
  };
2584
2621
  const selectChannel = async channelId => {
2585
2622
  // @ts-ignore
2586
2623
  await invoke('Output.selectChannel', channelId);
2587
2624
  };
2625
+ const clear$1 = async () => {
2626
+ // @ts-ignore
2627
+ await invoke('Output.clear');
2628
+ };
2588
2629
 
2589
2630
  const TestFrameWorkComponentOutput = {
2590
2631
  __proto__: null,
2632
+ clear: clear$1,
2591
2633
  handleFilterInput: handleFilterInput$1,
2592
2634
  selectChannel,
2593
2635
  show: show$2
@@ -2814,8 +2856,6 @@ const TestFrameWorkComponentRunAndDebug = {
2814
2856
  setPauseOnExceptions
2815
2857
  };
2816
2858
 
2817
- const Script = 2;
2818
-
2819
2859
  const setValue = async value => {
2820
2860
  // @ts-ignore
2821
2861
  await invoke('Search.handleInput', value, Script);
@@ -3206,6 +3246,7 @@ const TestFrameWorkComponent = {
3206
3246
  Command: TestFrameWorkComponentCommand,
3207
3247
  ContextMenu: TestFrameWorkComponentContextMenu,
3208
3248
  Developer: TestFrameWorkComponentDeveloper,
3249
+ Dialog: TestFrameWorkComponentDialog,
3209
3250
  Editor: TestFrameWorkComponentEditor,
3210
3251
  EditorCompletion: TestFrameWorkComponentEditorCompletion,
3211
3252
  Explorer: TestFrameWorkComponentExplorer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "4.34.0",
3
+ "version": "4.35.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",