@lvce-editor/test-worker 13.13.0 → 13.14.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
@@ -53,6 +53,11 @@ export interface UpdateConfig {
53
53
  readonly state: number;
54
54
  }
55
55
 
56
+ export interface DroppedFileHandle {
57
+ readonly file: File;
58
+ readonly id: number;
59
+ }
60
+
56
61
  export interface MockOpenAiResponseOptions {
57
62
  readonly status: number;
58
63
  readonly value: any;
@@ -67,11 +72,6 @@ export interface Diagnostic {
67
72
  readonly type: "error" | "warning";
68
73
  }
69
74
 
70
- export interface DroppedFileHandle {
71
- readonly file: File;
72
- readonly id: number;
73
- }
74
-
75
75
  export interface FileSystemTmpDirOptions {
76
76
  readonly scheme?: string;
77
77
  }
@@ -138,6 +138,7 @@ interface Chat {
138
138
  readonly handleClickDelete: () => Promise<void>;
139
139
  readonly handleClickNew: () => Promise<void>;
140
140
  readonly handleClickSettings: () => Promise<void>;
141
+ readonly handleDropFiles: (file: DroppedFileHandle) => Promise<void>;
141
142
  readonly handleInput: (text: string) => Promise<void>;
142
143
  readonly handleInputCopy: () => Promise<void>;
143
144
  readonly handleInputCut: () => Promise<void>;
@@ -152,6 +153,7 @@ interface Chat {
152
153
  readonly mockOpenApiStreamFinish: () => Promise<void>;
153
154
  readonly mockOpenApiStreamPushChunk: (chunk: string) => Promise<void>;
154
155
  readonly mockOpenApiStreamReset: () => Promise<void>;
156
+ readonly openMockSession: (sessionId: string, messages: readonly any[]) => Promise<void>;
155
157
  readonly rerender: () => Promise<void>;
156
158
  readonly reset: () => Promise<void>;
157
159
  readonly selectIndex: (index: number) => Promise<void>;
@@ -1373,6 +1373,7 @@ const toHaveJSProperty = async (locator, options) => {
1373
1373
  return `expected ${locatorString} to have js property ${key} ${value} but was ${actual}`;
1374
1374
  };
1375
1375
 
1376
+ /* eslint-disable @typescript-eslint/only-throw-error */
1376
1377
  const getFunction = fnName => {
1377
1378
  switch (fnName) {
1378
1379
  case 'toBeFocused':
@@ -1404,6 +1405,7 @@ const getFunction = fnName => {
1404
1405
  }
1405
1406
  };
1406
1407
 
1408
+ /* eslint-disable @typescript-eslint/only-throw-error */
1407
1409
  const string = (value, message) => {
1408
1410
  if (typeof value !== 'string') {
1409
1411
  throw new TypeError(message);
@@ -1415,6 +1417,8 @@ const number = (value, message) => {
1415
1417
  }
1416
1418
  };
1417
1419
 
1420
+ /* eslint-disable @typescript-eslint/only-throw-error, @typescript-eslint/prefer-readonly-parameter-types */
1421
+
1418
1422
  const expect$1 = locator => {
1419
1423
  return new Expect(locator);
1420
1424
  };
@@ -1550,6 +1554,7 @@ const performAction = async (locator, action, options) => {
1550
1554
  return invoke('TestFrameWork.performAction', locator, action, options);
1551
1555
  };
1552
1556
 
1557
+ /* eslint-disable @typescript-eslint/only-throw-error */
1553
1558
  const toButtonNumber = buttonType => {
1554
1559
  switch (buttonType) {
1555
1560
  case 'left':
@@ -1669,6 +1674,7 @@ const About = {
1669
1674
  show: show$7
1670
1675
  };
1671
1676
 
1677
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
1672
1678
  const focus$2 = async () => {
1673
1679
  await invoke$1('ActivityBar.focus');
1674
1680
  };
@@ -1721,6 +1727,15 @@ const ActivityBar = {
1721
1727
  toggleActivityBarItem
1722
1728
  };
1723
1729
 
1730
+ const execute$1 = async (id, ...args) => {
1731
+ return invoke$1(id, ...args);
1732
+ };
1733
+
1734
+ const Command = {
1735
+ execute: execute$1
1736
+ };
1737
+
1738
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
1724
1739
  const handleChatListContextMenu = async (eventX, eventY) => {
1725
1740
  await invoke$1('Chat.handleChatListContextMenu', eventX, eventY);
1726
1741
  };
@@ -1758,6 +1773,9 @@ const getSelectedSessionId = async () => {
1758
1773
  const handleInput$7 = async text => {
1759
1774
  await invoke$1('Chat.handleInput', 'composer', text, 'script');
1760
1775
  };
1776
+ const handleDropFiles = async file => {
1777
+ await execute$1('Chat.handleDropFiles', 'composer-drop-target', [file]);
1778
+ };
1761
1779
  const reset = async () => {
1762
1780
  await invoke$1('Chat.reset');
1763
1781
  };
@@ -1767,6 +1785,9 @@ const mockOpenApiStreamFinish = async () => {
1767
1785
  const mockOpenApiStreamPushChunk = async chunk => {
1768
1786
  await invoke$1('Chat.mockOpenApiStreamPushChunk', chunk);
1769
1787
  };
1788
+ const openMockSession = async (sessionId, messages) => {
1789
+ await invoke$1('Chat.openMockSession', sessionId, messages);
1790
+ };
1770
1791
  const handleSubmit = async () => {
1771
1792
  await invoke$1('Chat.handleSubmit');
1772
1793
  };
@@ -1832,6 +1853,7 @@ const Chat = {
1832
1853
  handleClickDelete,
1833
1854
  handleClickNew,
1834
1855
  handleClickSettings,
1856
+ handleDropFiles,
1835
1857
  handleInput: handleInput$7,
1836
1858
  handleInputCopy: handleInputCopy$1,
1837
1859
  handleInputCut: handleInputCut$1,
@@ -1846,6 +1868,7 @@ const Chat = {
1846
1868
  mockOpenApiStreamFinish,
1847
1869
  mockOpenApiStreamPushChunk,
1848
1870
  mockOpenApiStreamReset,
1871
+ openMockSession,
1849
1872
  rerender,
1850
1873
  reset,
1851
1874
  selectIndex: selectIndex$7,
@@ -1858,6 +1881,7 @@ const Chat = {
1858
1881
  useMockApi
1859
1882
  };
1860
1883
 
1884
+ /* eslint-disable @typescript-eslint/only-throw-error, @typescript-eslint/prefer-readonly-parameter-types */
1861
1885
  const readNativeFiles = async () => {
1862
1886
  await invoke$1('ClipBoard.readNativeFiles');
1863
1887
  };
@@ -1903,14 +1927,6 @@ const ColorPicker = {
1903
1927
  setRelativeX
1904
1928
  };
1905
1929
 
1906
- const execute$1 = async (id, ...args) => {
1907
- return invoke$1(id, ...args);
1908
- };
1909
-
1910
- const Command = {
1911
- execute: execute$1
1912
- };
1913
-
1914
1930
  const selectItem$1 = async text => {
1915
1931
  await invoke$1('Menu.selectItem', text);
1916
1932
  };
@@ -2020,6 +2036,7 @@ const areSelectionsEqual = (a, b) => {
2020
2036
  return true;
2021
2037
  };
2022
2038
 
2039
+ /* eslint-disable @typescript-eslint/only-throw-error */
2023
2040
  const getEditorKey = async () => {
2024
2041
  const keys = await invoke$2('Editor.getKeys');
2025
2042
  if (keys.length === 0) {
@@ -2052,6 +2069,7 @@ const Settings = {
2052
2069
  update: update$1
2053
2070
  };
2054
2071
 
2072
+ /* eslint-disable @typescript-eslint/only-throw-error */
2055
2073
  const setCursor = async (rowIndex, columnIndex) => {
2056
2074
  await invoke$1('Editor.cursorSet', rowIndex, columnIndex);
2057
2075
  };
@@ -2520,6 +2538,7 @@ const EditorSourceAction = {
2520
2538
  selectIndex: selectIndex$5
2521
2539
  };
2522
2540
 
2541
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
2523
2542
  const openContextMenu = async index => {
2524
2543
  await invoke$1('Explorer.handleContextMenuKeyboard', index);
2525
2544
  };
@@ -2859,6 +2878,7 @@ const ExtensionSearch = {
2859
2878
 
2860
2879
  const Memfs = 'memfs';
2861
2880
 
2881
+ /* eslint-disable @typescript-eslint/only-throw-error */
2862
2882
  const toFileUrl = url => {
2863
2883
  const urlObject = new URL(url);
2864
2884
  const pathName = urlObject.pathname;
@@ -2909,6 +2929,8 @@ const isValidFileMap = value => {
2909
2929
  return true;
2910
2930
  };
2911
2931
 
2932
+ /* eslint-disable @typescript-eslint/only-throw-error */
2933
+
2912
2934
  const loadFileMap = async fileMapUrl => {
2913
2935
  try {
2914
2936
  const response = await fetch(fileMapUrl);
@@ -2953,6 +2975,7 @@ const stringifyJson = data => {
2953
2975
  return JSON.stringify(data, null, 2) + '\n';
2954
2976
  };
2955
2977
 
2978
+ /* eslint-disable @typescript-eslint/only-throw-error */
2956
2979
  const writeFile = async (uri, content) => {
2957
2980
  await invoke$1('FileSystem.writeFile', uri, content);
2958
2981
  };
@@ -3319,6 +3342,7 @@ const LanguageModels = {
3319
3342
  removeModel
3320
3343
  };
3321
3344
 
3345
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
3322
3346
  const openUri = async uri => {
3323
3347
  await invoke$1('Main.openUri', uri);
3324
3348
  };
@@ -3407,6 +3431,7 @@ const Main = {
3407
3431
  splitRight
3408
3432
  };
3409
3433
 
3434
+ /* eslint-disable @typescript-eslint/only-throw-error, @typescript-eslint/prefer-readonly-parameter-types */
3410
3435
  const enableMemoryOpener = async () => {
3411
3436
  await invoke('Open.enableMemoryOpener');
3412
3437
  };
@@ -3738,6 +3763,7 @@ const RunAndDebug = {
3738
3763
  show: show$2
3739
3764
  };
3740
3765
 
3766
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
3741
3767
  const setValue = async value => {
3742
3768
  await invoke$1('Search.handleInput', value, Script);
3743
3769
  };
@@ -4112,6 +4138,8 @@ const waitForFirstEventEvent = async port => {
4112
4138
  return firstEvent;
4113
4139
  };
4114
4140
 
4141
+ /* eslint-disable @typescript-eslint/only-throw-error */
4142
+
4115
4143
  const createPortRpc = async webViewId => {
4116
4144
  // TODO use transforpemssageportrpc
4117
4145
  const {
@@ -4346,6 +4374,7 @@ const importScript = async url => {
4346
4374
  }
4347
4375
  };
4348
4376
 
4377
+ /* eslint-disable @typescript-eslint/only-throw-error */
4349
4378
  const importTest = async url => {
4350
4379
  try {
4351
4380
  return await importScript(url);
@@ -4354,6 +4383,8 @@ const importTest = async url => {
4354
4383
  }
4355
4384
  };
4356
4385
 
4386
+ /* eslint-disable @typescript-eslint/only-throw-error */
4387
+
4357
4388
  let items = [];
4358
4389
  const push = item => {
4359
4390
  items = [...items, item];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "13.13.0",
3
+ "version": "13.14.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",