@lvce-editor/test-worker 11.0.0 → 11.1.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
@@ -50,6 +50,11 @@ export interface FileSystemTmpDirOptions {
50
50
  readonly scheme?: string;
51
51
  }
52
52
 
53
+ export interface FileItem {
54
+ readonly content: string;
55
+ readonly uri: string;
56
+ }
57
+
53
58
  export interface SelectItem2Options {
54
59
  readonly callbackCommand: string;
55
60
  readonly label: string;
@@ -312,6 +317,7 @@ interface FileSystem {
312
317
  readonly readDir: (uri: string) => Promise<void>;
313
318
  readonly readFile: (uri: string) => Promise<string>;
314
319
  readonly remove: (uri: string) => Promise<void>;
320
+ readonly setFiles: (files: readonly FileItem[]) => Promise<void>;
315
321
  readonly writeFile: (uri: string, content: string) => Promise<void>;
316
322
  readonly writeJson: (uri: string, data: any) => Promise<void>;
317
323
  }
@@ -394,6 +400,7 @@ interface Main {
394
400
  interface Output {
395
401
  readonly clear: () => Promise<void>;
396
402
  readonly handleFilterInput: (text: string) => Promise<void>;
403
+ readonly saveAs: () => Promise<void>;
397
404
  readonly selectChannel: (channelId: string) => Promise<void>;
398
405
  readonly show: () => Promise<void>;
399
406
  }
@@ -1183,7 +1183,6 @@ const getLocatorInvoke = locator => {
1183
1183
  const module = get(locator.webViewId);
1184
1184
  return module.invoke;
1185
1185
  }
1186
- // @ts-ignore
1187
1186
  return invoke;
1188
1187
  };
1189
1188
 
@@ -1599,7 +1598,6 @@ test.skip = async id => {
1599
1598
  const state = 'skip';
1600
1599
  const background = 'yellow';
1601
1600
  const text = `test skipped ${id}`;
1602
- // @ts-ignore
1603
1601
  await invoke('TestFrameWork.showOverlay', state, background, text);
1604
1602
  };
1605
1603
  const {
@@ -1676,15 +1674,12 @@ const readNativeFiles = async () => {
1676
1674
  await invoke('ClipBoard.readNativeFiles');
1677
1675
  };
1678
1676
  const writeNativeFiles = async uris => {
1679
- // @ts-ignore
1680
1677
  await invoke('ClipBoard.writeNativeFiles', uris);
1681
1678
  };
1682
1679
  const enableMemoryClipBoard = async () => {
1683
- // @ts-ignore
1684
1680
  await invoke('ClipBoard.enableMemoryClipBoard');
1685
1681
  };
1686
1682
  const disableMemoryClipBoard = async () => {
1687
- // @ts-ignore
1688
1683
  await invoke('ClipBoard.disableMemoryClipBoard');
1689
1684
  };
1690
1685
  const matchesExpectedText = (actualText, expectedText) => {
@@ -1694,14 +1689,12 @@ const matchesExpectedText = (actualText, expectedText) => {
1694
1689
  return expectedText.test(actualText);
1695
1690
  };
1696
1691
  const shouldHaveText$1 = async expectedText => {
1697
- // @ts-ignore
1698
1692
  const actualText = await invoke('ClipBoard.readMemoryText');
1699
1693
  if (!matchesExpectedText(actualText, expectedText)) {
1700
1694
  throw new AssertionError(`expected clipboard to have text "${expectedText}" but was "${actualText}"`);
1701
1695
  }
1702
1696
  };
1703
1697
  const writeText = async text => {
1704
- // @ts-ignore
1705
1698
  await invoke('ClipBoard.writeText', text);
1706
1699
  };
1707
1700
 
@@ -1725,7 +1718,6 @@ const ColorPicker = {
1725
1718
  };
1726
1719
 
1727
1720
  const execute$1 = async (id, ...args) => {
1728
- // @ts-ignore
1729
1721
  return invoke(id, ...args);
1730
1722
  };
1731
1723
 
@@ -1744,35 +1736,27 @@ const ContextMenu = {
1744
1736
  };
1745
1737
 
1746
1738
  const openIframeInspector = async () => {
1747
- // @ts-ignore
1748
1739
  return invoke('Developer.openIframeInspector');
1749
1740
  };
1750
1741
  const openCacheFolder = async () => {
1751
- // @ts-ignore
1752
1742
  return invoke('Developer.openCacheFolder');
1753
1743
  };
1754
1744
  const openConfigFolder = async () => {
1755
- // @ts-ignore
1756
1745
  return invoke('Developer.openConfigFolder');
1757
1746
  };
1758
1747
  const openLogsFolder = async () => {
1759
- // @ts-ignore
1760
1748
  return invoke('Developer.openLogsFolder');
1761
1749
  };
1762
1750
  const openProcessExplorer = async () => {
1763
- // @ts-ignore
1764
1751
  return invoke('Developer.openProcessExplorer');
1765
1752
  };
1766
1753
  const reloadColorTheme = async () => {
1767
- // @ts-ignore
1768
1754
  return invoke('Developer.reloadColorTheme');
1769
1755
  };
1770
1756
  const reloadIconTheme = async () => {
1771
- // @ts-ignore
1772
1757
  return invoke('Developer.reloadIconTheme');
1773
1758
  };
1774
1759
  const toggleDeveloperTools = async () => {
1775
- // @ts-ignore
1776
1760
  return invoke('Developer.toggleDeveloperTools');
1777
1761
  };
1778
1762
 
@@ -1804,17 +1788,14 @@ const executeMock$1 = (id, ...args) => {
1804
1788
  };
1805
1789
 
1806
1790
  const showSaveFilePicker = async () => {
1807
- // @ts-ignore
1808
1791
  await invoke('FilePicker.showSaveFilePicker');
1809
1792
  };
1810
1793
  const mockSaveFilePicker = async fn => {
1811
1794
  const id = registerMock(fn);
1812
- // @ts-ignore
1813
1795
  await invoke('FilePicker.mockSaveFilePicker', id);
1814
1796
  };
1815
1797
  const mockConfirm = async fn => {
1816
1798
  const id = registerMock(fn);
1817
- // @ts-ignore
1818
1799
  await invoke('ConfirmPrompt.mock', id);
1819
1800
  };
1820
1801
  const executeMock = (id, ...args) => {
@@ -1870,17 +1851,14 @@ const getEditorKey = async () => {
1870
1851
  const Script = 2;
1871
1852
 
1872
1853
  const update$1 = settings => {
1873
- // @ts-ignore
1874
1854
  return invoke('Preferences.update', settings);
1875
1855
  };
1876
1856
  const enableDiagnostics$1 = () => {
1877
- // @ts-ignore
1878
1857
  return invoke('Preferences.update', {
1879
1858
  'editor.diagnostics': true
1880
1859
  });
1881
1860
  };
1882
1861
  const disableDiagnostics$1 = () => {
1883
- // @ts-ignore
1884
1862
  return invoke('Preferences.update', {
1885
1863
  'editor.diagnostics': false
1886
1864
  });
@@ -1900,7 +1878,6 @@ const openCompletion = async () => {
1900
1878
  await invoke('Editor.openCompletion');
1901
1879
  };
1902
1880
  const closeCompletion = async () => {
1903
- // @ts-ignore
1904
1881
  await invoke('EditorCompletion.close');
1905
1882
  };
1906
1883
  const openEditorContextMenu = async () => {
@@ -1949,11 +1926,9 @@ const type = async text => {
1949
1926
  await invoke('Editor.type', text);
1950
1927
  };
1951
1928
  const findAllReferences = async () => {
1952
- // @ts-ignore
1953
1929
  await invoke('SideBar.show', 'References', /* focus */true);
1954
1930
  };
1955
1931
  const findAllImplementations = async () => {
1956
- // @ts-ignore
1957
1932
  await invoke('SideBar.show', 'Implementations', /* focus */true);
1958
1933
  };
1959
1934
  const setSelections = async selections => {
@@ -1981,11 +1956,9 @@ const openCompletionDetails = async () => {
1981
1956
  await invoke('EditorCompletion.openDetails');
1982
1957
  };
1983
1958
  const closeCompletionDetails = async () => {
1984
- // @ts-ignore
1985
1959
  await invoke('EditorCompletion.closeDetails');
1986
1960
  };
1987
1961
  const toggleCompletionDetails = async () => {
1988
- // @ts-ignore
1989
1962
  await invoke('EditorCompletion.toggleDetails');
1990
1963
  };
1991
1964
  const organizeImports = async () => {
@@ -2010,7 +1983,6 @@ const openColorPicker = async () => {
2010
1983
  await invoke('Editor.openColorPicker');
2011
1984
  };
2012
1985
  const openFind = async () => {
2013
- // @ts-ignore
2014
1986
  await invoke('Editor.openFind2');
2015
1987
  };
2016
1988
  const deleteAllLeft = async () => {
@@ -2060,18 +2032,14 @@ const openRename = async () => {
2060
2032
  };
2061
2033
  const rename2 = async newName => {
2062
2034
  await openRename();
2063
- // @ts-ignore
2064
2035
  await invoke('EditorRename.handleInput', newName, Script);
2065
- // @ts-ignore
2066
2036
  await invoke('EditorRename.accept');
2067
2037
  };
2068
2038
  const growSelection = async () => {
2069
- // @ts-ignore
2070
2039
  await invoke('Editor.selectionGrow');
2071
2040
  };
2072
2041
  const getSelections = async () => {
2073
2042
  const key = await getEditorKey();
2074
- // @ts-ignore
2075
2043
  return invoke$1('Editor.getSelections', key);
2076
2044
  };
2077
2045
  const shouldHaveText = async expectedText => {
@@ -2089,11 +2057,9 @@ const shouldHaveSelections = async expectedSelections => {
2089
2057
  }
2090
2058
  };
2091
2059
  const undo = async () => {
2092
- // @ts-ignore
2093
2060
  await invoke$1('Editor.undo');
2094
2061
  };
2095
2062
  const redo = async () => {
2096
- // @ts-ignore
2097
2063
  await invoke$1('Editor.redo');
2098
2064
  };
2099
2065
  const shouldHaveDiagnostics = async expectedDiagnostics => {
@@ -2201,15 +2167,12 @@ const selectCurrentIndex$2 = async () => {
2201
2167
  await invoke('EditorCompletion.selectCurrentIndex');
2202
2168
  };
2203
2169
  const close$2 = async () => {
2204
- // @ts-ignore
2205
2170
  await invoke('EditorCompletion.close');
2206
2171
  };
2207
2172
  const handleWheel$2 = async (deltaMode, deltaY) => {
2208
- // @ts-ignore
2209
2173
  await invoke('EditorCompletion.handleWheel', deltaMode, deltaY);
2210
2174
  };
2211
2175
  const handlePointerdown = async (clientX, clientY) => {
2212
- // @ts-ignore
2213
2176
  await invoke('EditorCompletion.handlePointerdown', clientX, clientY);
2214
2177
  };
2215
2178
 
@@ -2226,7 +2189,6 @@ const show$5 = async () => {
2226
2189
  await invoke('Editor.showHover2');
2227
2190
  };
2228
2191
  const close$1 = async () => {
2229
- // @ts-ignore
2230
2192
  await invoke('EditorHover.close');
2231
2193
  };
2232
2194
 
@@ -2237,15 +2199,12 @@ const EditorHover = {
2237
2199
  };
2238
2200
 
2239
2201
  const handleInput$5 = async value => {
2240
- // @ts-ignore
2241
2202
  await invoke('EditorRename.handleInput', value, Script);
2242
2203
  };
2243
2204
  const accept = async () => {
2244
- // @ts-ignore
2245
2205
  await invoke('EditorRename.accept');
2246
2206
  };
2247
2207
  const cancel = async () => {
2248
- // @ts-ignore
2249
2208
  await invoke('EditorRename.cancel');
2250
2209
  };
2251
2210
 
@@ -2257,11 +2216,9 @@ const EditorRename = {
2257
2216
  };
2258
2217
 
2259
2218
  const selectIndex$5 = async index => {
2260
- // @ts-ignore
2261
2219
  await invoke('EditorSourceAction.selectIndex', index);
2262
2220
  };
2263
2221
  const selectCurrentIndex$1 = async () => {
2264
- // @ts-ignore
2265
2222
  await invoke('EditorSourceAction.selectCurrentIndex');
2266
2223
  };
2267
2224
 
@@ -2272,7 +2229,6 @@ const EditorSourceAction = {
2272
2229
  };
2273
2230
 
2274
2231
  const openContextMenu = async index => {
2275
- // @ts-ignore
2276
2232
  await invoke('Explorer.handleContextMenuKeyboard', index);
2277
2233
  };
2278
2234
  const handleDragLeave = async () => {
@@ -2282,7 +2238,6 @@ const handleBlur = async () => {
2282
2238
  await invoke('Explorer.handleBlur');
2283
2239
  };
2284
2240
  const handleEscape = async () => {
2285
- // @ts-ignore
2286
2241
  await invoke('Explorer.handleEscape');
2287
2242
  };
2288
2243
  const handleInputBlur = async () => {
@@ -2292,21 +2247,18 @@ const focus$1 = async () => {
2292
2247
  await invoke('Explorer.focusIndex', -1);
2293
2248
  };
2294
2249
  const focusNext$7 = async () => {
2295
- // @ts-ignore
2296
2250
  await invoke('Explorer.focusNext');
2297
2251
  };
2298
2252
  const selectUp = async () => {
2299
2253
  await invoke('Explorer.selectUp');
2300
2254
  };
2301
2255
  const handleDragOverIndex = async index => {
2302
- // @ts-ignore
2303
2256
  await invoke('Explorer.handleDragOverIndex', index);
2304
2257
  };
2305
2258
  const selectDown = async () => {
2306
2259
  await invoke('Explorer.selectDown');
2307
2260
  };
2308
2261
  const collapseAll$2 = async () => {
2309
- // @ts-ignore
2310
2262
  await invoke('Explorer.collapseAll');
2311
2263
  };
2312
2264
  const refresh$1 = async () => {
@@ -2340,22 +2292,18 @@ const newFolder = async () => {
2340
2292
  await invoke('Explorer.newFolder');
2341
2293
  };
2342
2294
  const copyPath$1 = async () => {
2343
- // @ts-ignore
2344
2295
  await invoke('Explorer.copyPath');
2345
2296
  };
2346
2297
  const copyRelativePath = async () => {
2347
- // @ts-ignore
2348
2298
  await invoke('Explorer.copyRelativePath');
2349
2299
  };
2350
2300
  const handleClick$2 = async index => {
2351
2301
  await invoke('Explorer.handleClick', index);
2352
2302
  };
2353
2303
  const handleClickAt$2 = async (preventDefault, button, ctrlKey, shiftKey, x, y) => {
2354
- // @ts-ignore
2355
2304
  await invoke('Explorer.handleClickAt', preventDefault, button, ctrlKey, shiftKey, x, y);
2356
2305
  };
2357
2306
  const handleDrop = async (x, y, fileIds, fileList) => {
2358
- // @ts-ignore
2359
2307
  await invoke('Explorer.handleDrop', x, y, fileIds, fileIds);
2360
2308
  };
2361
2309
  const rename = async () => {
@@ -2383,22 +2331,18 @@ const handleDragOver = async (x, y) => {
2383
2331
  await invoke('Explorer.handleDragOver', x, y);
2384
2332
  };
2385
2333
  const handleCut = async () => {
2386
- // @ts-ignore
2387
2334
  await invoke('Explorer.handleCut');
2388
2335
  };
2389
2336
  const handleCopy = async () => {
2390
- // @ts-ignore
2391
2337
  await invoke('Explorer.handleCopy');
2392
2338
  };
2393
2339
  const handlePaste = async () => {
2394
- // @ts-ignore
2395
2340
  await invoke('Explorer.handlePaste');
2396
2341
  };
2397
2342
  const selectIndices = async indices => {
2398
2343
  await invoke('Explorer.selectIndices', indices);
2399
2344
  };
2400
2345
  const toggleIndividualSelection = async index => {
2401
- // @ts-ignore
2402
2346
  await invoke('Explorer.toggleIndividualSelection', index);
2403
2347
  };
2404
2348
 
@@ -2463,27 +2407,21 @@ const Extension = {
2463
2407
  };
2464
2408
 
2465
2409
  const handleClickCategory = async categoryId => {
2466
- // @ts-ignore
2467
2410
  await invoke('ExtensionDetail.handleClickCategory', categoryId);
2468
2411
  };
2469
2412
  const handleReadmeContextMenu = async (x, y, nodeName, href) => {
2470
- // @ts-ignore
2471
2413
  await invoke('ExtensionDetail.handleReadmeContextMenu', x, y, nodeName, href);
2472
2414
  };
2473
2415
  const copyReadmeLink = async href => {
2474
- // @ts-ignore
2475
2416
  await invoke('ExtensionDetail.copyReadmeLink', href);
2476
2417
  };
2477
2418
  const handleClickEnable = async () => {
2478
- // @ts-ignore
2479
2419
  await invoke('ExtensionDetail.handleClickEnable');
2480
2420
  };
2481
2421
  const handleClickDisable = async () => {
2482
- // @ts-ignore
2483
2422
  await invoke('ExtensionDetail.handleClickDisable');
2484
2423
  };
2485
2424
  const handleClickSetColorTheme = async () => {
2486
- // @ts-ignore
2487
2425
  await invoke('ExtensionDetail.handleClickSetColorTheme');
2488
2426
  };
2489
2427
  const selectFeature = name => {
@@ -2518,7 +2456,6 @@ const handleImageContextMenu = () => {
2518
2456
  return invoke('ExtensionDetail.handleImageContextMenu');
2519
2457
  };
2520
2458
  const openFeature = featureName => {
2521
- // @ts-ignore
2522
2459
  return invoke('ExtensionDetail.handleFeaturesClick', featureName);
2523
2460
  };
2524
2461
  const openThemes = async () => {
@@ -2540,7 +2477,6 @@ const openSettings = async () => {
2540
2477
  await openFeature('Settings');
2541
2478
  };
2542
2479
  const handleScroll$1 = async scrollTop => {
2543
- // @ts-ignore
2544
2480
  return invoke('ExtensionDetail.handleScroll', scrollTop);
2545
2481
  };
2546
2482
  const hideSizeLink = async () => {
@@ -2597,27 +2533,21 @@ const open$4 = async () => {
2597
2533
  await open$5('Extensions');
2598
2534
  };
2599
2535
  const handleInput$4 = async value => {
2600
- // @ts-ignore
2601
2536
  await invoke('Extensions.handleInput', value, Script$1);
2602
2537
  };
2603
2538
  const handleClick$1 = async index => {
2604
- // @ts-ignore
2605
2539
  await invoke('Extensions.handleClick', index);
2606
2540
  };
2607
2541
  const handleContextMenu$4 = async (button, x, y) => {
2608
- // @ts-ignore
2609
2542
  await invoke('Extensions.handleContextMenu', button, x, y);
2610
2543
  };
2611
2544
  const copyExtensionInfo = async () => {
2612
- // @ts-ignore
2613
2545
  await invoke('Extensions.copyExtensionInfo');
2614
2546
  };
2615
2547
  const copyExtensionId = async () => {
2616
- // @ts-ignore
2617
2548
  await invoke('Extensions.copyExtensionId');
2618
2549
  };
2619
2550
  const clearSearchResults$1 = async () => {
2620
- // @ts-ignore
2621
2551
  await invoke('Extensions.clearSearchResults');
2622
2552
  };
2623
2553
 
@@ -2741,14 +2671,18 @@ const readFile = async uri => {
2741
2671
  return invoke('FileSystem.readFile', uri);
2742
2672
  };
2743
2673
  const addFileHandle = async file => {
2744
- // @ts-ignore
2745
2674
  await invoke('FileSystem.addFileHandle', file);
2746
2675
  };
2747
2676
  const mkdir = async uri => {
2748
2677
  await invoke('FileSystem.mkdir', uri);
2749
2678
  };
2679
+ const setFiles = async files => {
2680
+ // TODO maybe have a method to send all the files to file system worker directly
2681
+ await Promise.all(files.map(file => {
2682
+ return writeFile(file.uri, file.content);
2683
+ }));
2684
+ };
2750
2685
  const readDir = async uri => {
2751
- // @ts-ignore
2752
2686
  return invoke('FileSystem.readDirWithFileTypes', uri);
2753
2687
  };
2754
2688
  const remove = async uri => {
@@ -2761,19 +2695,16 @@ const getTmpDir = async ({
2761
2695
  case Memfs:
2762
2696
  return 'memfs:///workspace';
2763
2697
  default:
2764
- // @ts-ignore
2765
2698
  return invoke('PlatformPaths.getTmpDir');
2766
2699
  }
2767
2700
  };
2768
2701
  const chmod = async (uri, permissions) => {
2769
- // @ts-ignore
2770
2702
  await invoke('FileSystem.chmod', uri, permissions);
2771
2703
  };
2772
2704
  const createExecutable = async content => {
2773
2705
  const tmpDir = await getTmpDir({
2774
2706
  scheme: 'file'
2775
2707
  });
2776
- // @ts-ignore
2777
2708
  const nodePath = await invoke('PlatformPaths.getNodePath');
2778
2709
  const gitPath = `${tmpDir}/git`;
2779
2710
  await writeFile(gitPath, `#!${nodePath}
@@ -2782,10 +2713,8 @@ const createExecutable = async content => {
2782
2713
  return gitPath;
2783
2714
  };
2784
2715
  const createExecutableFrom = async uri => {
2785
- // @ts-ignore
2786
2716
  const testPath = await invoke('PlatformPaths.getTestPath');
2787
2717
  const absolutePath = testPath + Slash + uri;
2788
- // @ts-ignore
2789
2718
  const content = await invoke('Ajax.getText', absolutePath);
2790
2719
  return createExecutable(content);
2791
2720
  };
@@ -2795,7 +2724,6 @@ const createDroppedFileHandle = async () => {
2795
2724
  create: true
2796
2725
  });
2797
2726
  const file = await fileHandle.getFile();
2798
- // @ts-ignore
2799
2727
  const id = await invoke('FileSystemHandle.addFileHandle', fileHandle);
2800
2728
  return {
2801
2729
  file,
@@ -2825,6 +2753,7 @@ const FileSystem = {
2825
2753
  readDir,
2826
2754
  readFile,
2827
2755
  remove,
2756
+ setFiles,
2828
2757
  writeFile,
2829
2758
  writeJson
2830
2759
  };
@@ -2833,59 +2762,45 @@ const focusNext$6 = async () => {
2833
2762
  await invoke('FindWidget.focusNext');
2834
2763
  };
2835
2764
  const focusPrevious$6 = async () => {
2836
- // @ts-ignore
2837
2765
  await invoke('FindWidget.focusPrevious');
2838
2766
  };
2839
2767
  const close = async () => {
2840
- // @ts-ignore
2841
2768
  await invoke('FindWidget.close');
2842
2769
  };
2843
2770
  const setReplaceValue$1 = async value => {
2844
- // @ts-ignore
2845
2771
  await invoke('FindWidget.handleReplaceInput', value, Script);
2846
2772
  };
2847
2773
  const setValue$2 = async value => {
2848
- // @ts-ignore
2849
2774
  await invoke('FindWidget.handleInput', value, Script);
2850
2775
  };
2851
2776
  const toggleReplace$1 = async () => {
2852
- // @ts-ignore
2853
2777
  await invoke('FindWidget.toggleReplace');
2854
2778
  };
2855
2779
  const toggleMatchCase$1 = async () => {
2856
- // @ts-ignore
2857
2780
  await invoke('FindWidget.toggleMatchCase');
2858
2781
  };
2859
2782
  const toggleMatchWholeWord$1 = async () => {
2860
- // @ts-ignore
2861
2783
  await invoke('FindWidget.toggleMatchWholeWord');
2862
2784
  };
2863
2785
  const togglePreserveCase$1 = async () => {
2864
- // @ts-ignore
2865
2786
  await invoke('FindWidget.togglePreserveCase');
2866
2787
  };
2867
2788
  const toggleUseRegularExpression$1 = async () => {
2868
- // @ts-ignore
2869
2789
  await invoke('FindWidget.toggleUseRegularExpression');
2870
2790
  };
2871
2791
  const replace = async () => {
2872
- // @ts-ignore
2873
2792
  await invoke('FindWidget.replace');
2874
2793
  };
2875
2794
  const replaceAll$1 = async () => {
2876
- // @ts-ignore
2877
2795
  await invoke('FindWidget.replaceAll');
2878
2796
  };
2879
2797
  const focusElement = async whenExpression => {
2880
- // @ts-ignore
2881
2798
  await invoke('FindWidget.focusElement', whenExpression);
2882
2799
  };
2883
2800
  const focusNextElement = async () => {
2884
- // @ts-ignore
2885
2801
  await invoke('FindWidget.focusNextElement');
2886
2802
  };
2887
2803
  const focusPreviousElement = async () => {
2888
- // @ts-ignore
2889
2804
  await invoke('FindWidget.focusPreviousElement');
2890
2805
  };
2891
2806
 
@@ -2967,7 +2882,6 @@ const focusFirst$4 = () => {
2967
2882
  return invoke('KeyBindings.focusFirst');
2968
2883
  };
2969
2884
  const focusIndex$4 = index => {
2970
- // @ts-ignore
2971
2885
  return invoke('KeyBindings.focusIndex', index);
2972
2886
  };
2973
2887
  const focusLast$3 = () => {
@@ -3086,7 +3000,6 @@ const press = async key => {
3086
3000
  cancelable: true,
3087
3001
  ...keyOptions
3088
3002
  };
3089
- // @ts-ignore
3090
3003
  await invoke('TestFrameWork.performKeyBoardAction', 'press', options);
3091
3004
  };
3092
3005
 
@@ -3149,26 +3062,26 @@ const Main = {
3149
3062
  };
3150
3063
 
3151
3064
  const show$4 = async () => {
3152
- // @ts-ignore
3153
3065
  await invoke('Panel.selectIndex', 1);
3154
3066
  };
3155
3067
  const handleFilterInput$1 = async text => {
3156
- // @ts-ignore
3157
3068
  await invoke('Output.handleFilterInput', text, Script);
3158
3069
  };
3159
3070
  const selectChannel = async channelId => {
3160
- // @ts-ignore
3161
3071
  await invoke('Output.selectChannel', channelId);
3162
3072
  };
3163
3073
  const clear$2 = async () => {
3164
- // @ts-ignore
3165
3074
  await invoke('Output.clear');
3166
3075
  };
3076
+ const saveAs = async () => {
3077
+ await invoke('Output.saveAs');
3078
+ };
3167
3079
 
3168
3080
  const Output = {
3169
3081
  __proto__: null,
3170
3082
  clear: clear$2,
3171
3083
  handleFilterInput: handleFilterInput$1,
3084
+ saveAs,
3172
3085
  selectChannel,
3173
3086
  show: show$4
3174
3087
  };
@@ -3178,7 +3091,6 @@ const open$2 = async id => {
3178
3091
  };
3179
3092
  const openProblems = async () => {
3180
3093
  await open$2('Problems');
3181
- // @ts-ignore
3182
3094
  await invoke('Panel.selectIndex', 0);
3183
3095
  };
3184
3096
 
@@ -3202,7 +3114,6 @@ const getIsFirefox = () => {
3202
3114
  };
3203
3115
 
3204
3116
  const getNodePath$1 = () => {
3205
- // @ts-ignore
3206
3117
  return invoke(/* Platform.getNodePath */'Platform.getNodePath');
3207
3118
  };
3208
3119
 
@@ -3220,43 +3131,33 @@ const Platform = {
3220
3131
  };
3221
3132
 
3222
3133
  const show$3 = async () => {
3223
- // @ts-ignore
3224
3134
  await invoke('Panel.selectIndex', 0);
3225
3135
  };
3226
3136
  const handleFilterInput = async text => {
3227
- // @ts-ignore
3228
3137
  await invoke('Problems.handleFilterInput', text, Script);
3229
3138
  };
3230
3139
  const copyMessage = async () => {
3231
- // @ts-ignore
3232
3140
  await invoke('Problems.copyMessage');
3233
3141
  };
3234
3142
  const focusIndex$3 = async index => {
3235
- // @ts-ignore
3236
3143
  await invoke('Problems.focusIndex', index);
3237
3144
  };
3238
3145
  const handleArrowLeft = async () => {
3239
- // @ts-ignore
3240
3146
  await invoke('Problems.handleArrowLeft');
3241
3147
  };
3242
3148
  const handleArrowRight = async () => {
3243
- // @ts-ignore
3244
3149
  await invoke('Problems.handleArrowRight');
3245
3150
  };
3246
3151
  const handleClickAt$1 = async (x, y) => {
3247
- // @ts-ignore
3248
3152
  await invoke('Problems.handleClickAt', x, y);
3249
3153
  };
3250
3154
  const handleIconThemeChange = async () => {
3251
- // @ts-ignore
3252
3155
  await invoke('Problems.handleIconThemeChange');
3253
3156
  };
3254
3157
  const viewAsList = async () => {
3255
- // @ts-ignore
3256
3158
  await invoke('Problems.viewAsList');
3257
3159
  };
3258
3160
  const viewAsTable = async () => {
3259
- // @ts-ignore
3260
3161
  await invoke('Problems.viewAsTable');
3261
3162
  };
3262
3163
 
@@ -3282,7 +3183,6 @@ const registerCallbackCommand = async commandId => {
3282
3183
  resolve
3283
3184
  } = Promise.withResolvers();
3284
3185
  callbacks[id] = resolve;
3285
- // @ts-ignore
3286
3186
  await invoke(`Test.registerTestCommand`, commandId);
3287
3187
  return {
3288
3188
  promise
@@ -3292,59 +3192,44 @@ const registerCallbackCommand = async commandId => {
3292
3192
  const QuickPick$1 = 'QuickPick';
3293
3193
 
3294
3194
  const open$1 = async () => {
3295
- // @ts-ignore
3296
3195
  await invoke('Viewlet.openWidget', QuickPick$1, 'everything');
3297
3196
  };
3298
3197
  const handleInput$2 = async value => {
3299
- // @ts-ignore
3300
3198
  await invoke('QuickPick.handleInput', value, 0);
3301
3199
  };
3302
3200
  const handleClickAt = async (x, y) => {
3303
- // @ts-ignore
3304
3201
  await invoke('QuickPick.handleClickAt', x, y);
3305
3202
  };
3306
3203
  const setValue$1 = async value => {
3307
- // @ts-ignore
3308
3204
  await invoke('QuickPick.setValue', value);
3309
3205
  };
3310
3206
  const focusNext$2 = async () => {
3311
- // @ts-ignore
3312
3207
  await invoke('QuickPick.focusNext');
3313
3208
  };
3314
3209
  const focusFirst$2 = async () => {
3315
- // @ts-ignore
3316
3210
  await invoke('QuickPick.focusFirst');
3317
3211
  };
3318
3212
  const focusLast$1 = async () => {
3319
- // @ts-ignore
3320
3213
  await invoke('QuickPick.focusLast');
3321
3214
  };
3322
3215
  const focusIndex$2 = async index => {
3323
- // @ts-ignore
3324
3216
  await invoke('QuickPick.focusIndex', index);
3325
3217
  };
3326
3218
  const focusPrevious$2 = async () => {
3327
- // @ts-ignore
3328
3219
  await invoke('QuickPick.focusPrevious');
3329
3220
  };
3330
3221
  const selectItem = async label => {
3331
- // @ts-ignore
3332
3222
  await invoke('QuickPick.selectItem', label);
3333
3223
  };
3334
3224
  const selectIndex$3 = async index => {
3335
- // @ts-ignore
3336
3225
  await invoke('QuickPick.selectIndex', index);
3337
3226
  };
3338
3227
  const selectCurrentIndex = async () => {
3339
- // @ts-ignore
3340
3228
  await invoke('QuickPick.selectCurrentIndex');
3341
3229
  };
3342
3230
  const executeCommand = async label => {
3343
- // @ts-ignore
3344
3231
  await invoke('QuickPick.showCommands');
3345
- // @ts-ignore
3346
3232
  await invoke('QuickPick.handleInput', label, 0);
3347
- // @ts-ignore
3348
3233
  await invoke('QuickPick.selectItem', label);
3349
3234
  };
3350
3235
  const selectItem2 = async ({
@@ -3354,6 +3239,7 @@ const selectItem2 = async ({
3354
3239
  const {
3355
3240
  promise
3356
3241
  } = await registerCallbackCommand(callbackCommand);
3242
+
3357
3243
  // @ts-ignore
3358
3244
  invoke('QuickPick.selectItem', label);
3359
3245
  await promise;
@@ -3378,15 +3264,12 @@ const QuickPick = {
3378
3264
  };
3379
3265
 
3380
3266
  const clear$1 = async () => {
3381
- // @ts-ignore
3382
3267
  return invoke('References.clear');
3383
3268
  };
3384
3269
  const collapseAll$1 = async () => {
3385
- // @ts-ignore
3386
3270
  return invoke('References.collapseAll');
3387
3271
  };
3388
3272
  const refresh = async () => {
3389
- // @ts-ignore
3390
3273
  return invoke('References.refresh');
3391
3274
  };
3392
3275
 
@@ -3401,39 +3284,30 @@ const show$2 = async () => {
3401
3284
  await open$5('Run And Debug');
3402
3285
  };
3403
3286
  const handleClickSectionBreakPoints = async () => {
3404
- // @ts-ignore
3405
3287
  await invoke('Run And Debug.handleClickSectionBreakPoints');
3406
3288
  };
3407
3289
  const handleClickSectionWatch = async () => {
3408
- // @ts-ignore
3409
3290
  await invoke('Run And Debug.handleClickSectionWatch');
3410
3291
  };
3411
3292
  const addWatchExpression = async expression => {
3412
- // @ts-ignore
3413
3293
  await invoke('Run And Debug.addWatchExpression', expression);
3414
3294
  };
3415
3295
  const handleWatchValueChange = async () => {
3416
- // @ts-ignore
3417
3296
  await invoke('Run And Debug.handleWatchValueChange');
3418
3297
  };
3419
3298
  const acceptWatchExpressionEdit = async () => {
3420
- // @ts-ignore
3421
3299
  await invoke('Run And Debug.acceptWatchExpressionEdit');
3422
3300
  };
3423
3301
  const selectIndex$2 = async index => {
3424
- // @ts-ignore
3425
3302
  await invoke('Run And Debug.selectIndex', index);
3426
3303
  };
3427
3304
  const setPauseOnExceptions = async value => {
3428
- // @ts-ignore
3429
3305
  await invoke('Run And Debug.setPauseOnExceptions', value);
3430
3306
  };
3431
3307
  const handleRename = async () => {
3432
- // @ts-ignore
3433
3308
  await invoke('Run And Debug.handleRename');
3434
3309
  };
3435
3310
  const handleSpace = async () => {
3436
- // @ts-ignore
3437
3311
  await invoke('Run And Debug.handleSpace');
3438
3312
  };
3439
3313
 
@@ -3452,22 +3326,18 @@ const RunAndDebug = {
3452
3326
  };
3453
3327
 
3454
3328
  const setValue = async value => {
3455
- // @ts-ignore
3456
3329
  await invoke('Search.handleInput', value, Script);
3457
3330
  };
3458
3331
  const setReplaceValue = async value => {
3459
- // @ts-ignore
3460
3332
  await invoke('Search.handleReplaceInput', value, Script);
3461
3333
  };
3462
3334
  const setExcludeValue = async value => {
3463
- // @ts-ignore
3464
3335
  await invoke('Search.handleExcludeInput', value, Script);
3465
3336
  };
3466
3337
  const replaceAll = async () => {
3467
3338
  await invoke('Search.replaceAll');
3468
3339
  };
3469
3340
  const setIncludeValue = async value => {
3470
- // @ts-ignore
3471
3341
  await invoke('Search.handleIncludeInput', value, Script);
3472
3342
  };
3473
3343
  const clearSearchResults = async () => {
@@ -3498,7 +3368,6 @@ const handleWheel = async (deltaMode, deltaY) => {
3498
3368
  await invoke('Search.handleWheel', deltaMode, deltaY);
3499
3369
  };
3500
3370
  const focusNextPage = async () => {
3501
- // @ts-ignore
3502
3371
  await invoke('Search.focusPage');
3503
3372
  };
3504
3373
  const focusPreviousPage = async () => {
@@ -3529,47 +3398,36 @@ const open = async () => {
3529
3398
  await invoke('SideBar.openViewlet', 'Search');
3530
3399
  };
3531
3400
  const setLimit = async limit => {
3532
- // @ts-ignore
3533
3401
  await invoke('Search.setLimit', limit);
3534
3402
  };
3535
3403
  const handleListBlur = async () => {
3536
- // @ts-ignore
3537
3404
  await invoke('Search.handleListBlur');
3538
3405
  };
3539
3406
  const collapseAll = async () => {
3540
- // @ts-ignore
3541
3407
  await invoke('Search.collapseAll');
3542
3408
  };
3543
3409
  const copy = async () => {
3544
- // @ts-ignore
3545
3410
  await invoke('Search.copy');
3546
3411
  };
3547
3412
  const copyPath = async () => {
3548
- // @ts-ignore
3549
3413
  await invoke('Search.copyPath');
3550
3414
  };
3551
3415
  const handleInputCut = async name => {
3552
- // @ts-ignore
3553
3416
  await invoke('Search.handleInputCut', name);
3554
3417
  };
3555
3418
  const handleInputPaste = async name => {
3556
- // @ts-ignore
3557
3419
  await invoke('Search.handleInputPaste', name);
3558
3420
  };
3559
3421
  const handleInputCopy = async name => {
3560
- // @ts-ignore
3561
3422
  await invoke('Search.handleInputCopy', name);
3562
3423
  };
3563
3424
  const handleInputSelectionChange = async (name, start, end) => {
3564
- // @ts-ignore
3565
3425
  await invoke('Search.handleInputSelectionChange', name, start, end);
3566
3426
  };
3567
3427
  const handleInputContextMenu = async (name, button, x, y) => {
3568
- // @ts-ignore
3569
3428
  await invoke('Search.handleInputConextMenu', name, button, x, y);
3570
3429
  };
3571
3430
  const handleContextMenu$2 = async (button, x, y) => {
3572
- // @ts-ignore
3573
3431
  await invoke('Search.handleContextMenu', name, button, x, y);
3574
3432
  };
3575
3433
 
@@ -3616,19 +3474,15 @@ const show$1 = async () => {
3616
3474
  return invoke('Main.openUri', 'settings://');
3617
3475
  };
3618
3476
  const handleInput$1 = async searchValue => {
3619
- // @ts-ignore
3620
3477
  return invoke('Settings.handleInput', searchValue, Script);
3621
3478
  };
3622
3479
  const usePreviousSearchValue = async () => {
3623
- // @ts-ignore
3624
3480
  return invoke('Settings.usePreviousSearchValue');
3625
3481
  };
3626
3482
  const useNextSearchValue = async () => {
3627
- // @ts-ignore
3628
3483
  return invoke('Settings.useNextSearchValue');
3629
3484
  };
3630
3485
  const clear = async searchValue => {
3631
- // @ts-ignore
3632
3486
  return invoke('Settings.clear', searchValue, Script);
3633
3487
  };
3634
3488
  const clearHistory = async () => {
@@ -3636,7 +3490,6 @@ const clearHistory = async () => {
3636
3490
  return invoke('Settings.clearHistory', searchValue, Script);
3637
3491
  };
3638
3492
  const selectTab = async tabId => {
3639
- // @ts-ignore
3640
3493
  return invoke('Settings.handleClickTab', tabId);
3641
3494
  };
3642
3495
  const selectWorkspace = async () => {
@@ -3652,11 +3505,9 @@ const selectWindow = async () => {
3652
3505
  await selectTab('window');
3653
3506
  };
3654
3507
  const handleScroll = async scrollTop => {
3655
- // @ts-ignore
3656
3508
  await invoke('Settings.handleScroll', scrollTop, Script);
3657
3509
  };
3658
3510
  const handleClickFilterButton = async (x, y) => {
3659
- // @ts-ignore
3660
3511
  await invoke('Settings.handleClickFilterButton', x, y);
3661
3512
  };
3662
3513
 
@@ -3678,14 +3529,12 @@ const SettingsView = {
3678
3529
  };
3679
3530
 
3680
3531
  const selectIndex = async index => {
3681
- // @ts-ignore
3682
3532
  await invoke('Source Control.selectIndex', index);
3683
3533
  };
3684
3534
  const acceptInput = async () => {
3685
3535
  await invoke('Source Control.acceptInput');
3686
3536
  };
3687
3537
  const handleInput = async text => {
3688
- // @ts-ignore
3689
3538
  await invoke('Source Control.handleInput', text, Script$1);
3690
3539
  };
3691
3540
  const handleClickSourceControlButtons = async (index, name) => {
@@ -3695,7 +3544,6 @@ const handleContextMenu$1 = async (button, x, y) => {
3695
3544
  await invoke('Source Control.handleContextMenu', button, x, y);
3696
3545
  };
3697
3546
  const show = async () => {
3698
- // @ts-ignore
3699
3547
  await open$5('Source Control');
3700
3548
  };
3701
3549
 
@@ -3719,75 +3567,57 @@ const StatusBar = {
3719
3567
  };
3720
3568
 
3721
3569
  const closeMenu = async () => {
3722
- // @ts-ignore
3723
3570
  await invoke('TitleBar.closeMenu');
3724
3571
  };
3725
3572
  const focus = async () => {
3726
- // @ts-ignore
3727
3573
  await invoke('TitleBar.focus');
3728
3574
  };
3729
3575
  const focusFirst = async () => {
3730
- // @ts-ignore
3731
3576
  await invoke('TitleBar.focusFirst');
3732
3577
  };
3733
3578
  const focusIndex = async index => {
3734
- // @ts-ignore
3735
3579
  await invoke('TitleBar.focusIndex', index);
3736
3580
  };
3737
3581
  const focusLast = async () => {
3738
- // @ts-ignore
3739
3582
  await invoke('TitleBar.focusLast');
3740
3583
  };
3741
3584
  const focusNext = async () => {
3742
- // @ts-ignore
3743
3585
  await invoke('TitleBar.focusNext');
3744
3586
  };
3745
3587
  const focusPrevious = async () => {
3746
- // @ts-ignore
3747
3588
  await invoke('TitleBar.focusPrevious');
3748
3589
  };
3749
3590
  const handleKeyArrowDown = async () => {
3750
- // @ts-ignore
3751
3591
  await invoke('TitleBar.handleKeyArrowDown');
3752
3592
  };
3753
3593
  const handleKeyArrowLeft = async () => {
3754
- // @ts-ignore
3755
3594
  await invoke('TitleBar.handleKeyArrowLeft');
3756
3595
  };
3757
3596
  const handleKeyArrowRight = async () => {
3758
- // @ts-ignore
3759
3597
  await invoke('TitleBar.handleKeyArrowRight');
3760
3598
  };
3761
3599
  const handleKeyArrowUp = async () => {
3762
- // @ts-ignore
3763
3600
  await invoke('TitleBar.handleKeyArrowUp');
3764
3601
  };
3765
3602
  const handleKeyEnd = async () => {
3766
- // @ts-ignore
3767
3603
  await invoke('TitleBar.handleKeyEnd');
3768
3604
  };
3769
3605
  const handleKeyHome = async () => {
3770
- // @ts-ignore
3771
3606
  await invoke('TitleBar.handleKeyHome');
3772
3607
  };
3773
3608
  const handleKeySpace = async () => {
3774
- // @ts-ignore
3775
3609
  await invoke('TitleBar.handleKeySpace');
3776
3610
  };
3777
3611
  const handleKeyEscape = async () => {
3778
- // @ts-ignore
3779
3612
  await invoke('TitleBar.handleKeyEscape');
3780
3613
  };
3781
3614
  const toggleIndex = async index => {
3782
- // @ts-ignore
3783
3615
  await invoke('TitleBar.toggleIndex', index);
3784
3616
  };
3785
3617
  const toggleMenu = async () => {
3786
- // @ts-ignore
3787
3618
  await invoke('TitleBar.toggleMenu');
3788
3619
  };
3789
3620
  const handleContextMenu = async (button, x, y) => {
3790
- // @ts-ignore
3791
3621
  await invoke('TitleBar.handleContextMenu', button, x, y);
3792
3622
  };
3793
3623
 
@@ -3891,6 +3721,7 @@ const fromId = async webViewId => {
3891
3721
  return {
3892
3722
  locator(selector, options) {
3893
3723
  const baseLocator = create(selector, options);
3724
+
3894
3725
  // @ts-ignore
3895
3726
  baseLocator.webViewId = webViewId;
3896
3727
  return baseLocator;
@@ -4059,7 +3890,6 @@ const executeTest = async (name, fn, globals = {}) => {
4059
3890
  // eslint-disable-next-line no-console
4060
3891
  console.info(`PASS ${name} in ${formattedDuration}`);
4061
3892
  }
4062
- // @ts-ignore
4063
3893
  await invoke('TestFrameWork.showOverlay', type, background, text);
4064
3894
  };
4065
3895
 
@@ -4117,7 +3947,6 @@ const watchForHotReload = async (platform, href) => {
4117
3947
  }
4118
3948
  const fileUrl = getFileUri(href);
4119
3949
  const callbackCommand = 'FileWatcher.handleEvent';
4120
- // @ts-ignore
4121
3950
  await invoke('FileWatcher.watchFile', TestWorker, callbackCommand, fileUrl);
4122
3951
  };
4123
3952
 
@@ -4152,7 +3981,6 @@ const execute = async (href, platform, assetDir) => {
4152
3981
  } else {
4153
3982
  const tests = getTests();
4154
3983
  for (const test of tests) {
4155
- // @ts-ignore
4156
3984
  await executeTest(test.name, test.fn);
4157
3985
  }
4158
3986
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "11.0.0",
3
+ "version": "11.1.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",