@lvce-editor/file-system-worker 1.17.0 → 1.18.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.
@@ -1318,6 +1318,9 @@ const watchCallbacks = Object.create(null);
1318
1318
  const registerWatchCallback = (id, fn) => {
1319
1319
  watchCallbacks[id] = fn;
1320
1320
  };
1321
+ const executeWatchCallBack = async id => {
1322
+ await watchCallbacks[id]();
1323
+ };
1321
1324
  const unregisterWatchCallback = id => {
1322
1325
  delete watchCallbacks[id];
1323
1326
  };
@@ -1330,6 +1333,9 @@ const watchFile = async (id, uri, rpc) => {
1330
1333
  // @ts-ignore
1331
1334
  await invoke('FileSystem.watchFile', id, uri);
1332
1335
  };
1336
+ const executeWatchCallback = async id => {
1337
+ await executeWatchCallBack(id);
1338
+ };
1333
1339
  const unwatchFile = async id => {
1334
1340
  unregisterWatchCallback(id);
1335
1341
  // @ts-ignore
@@ -1431,6 +1437,7 @@ const commandMap = {
1431
1437
  'FileSystem.appendFile': appendFile,
1432
1438
  'FileSystem.copy': copy,
1433
1439
  'FileSystem.createFile': createFile,
1440
+ 'FileSystem.executeWatchcallback': executeWatchCallback,
1434
1441
  'FileSystem.exists': exists,
1435
1442
  'FileSystem.getFolderSize': getFolderSize,
1436
1443
  'FileSystem.getPathSeparator': getPathSeparator,
@@ -1444,8 +1451,8 @@ const commandMap = {
1444
1451
  'FileSystem.remove': remove,
1445
1452
  'FileSystem.rename': rename,
1446
1453
  'FileSystem.stat': stat,
1447
- 'FileSystem.watchFile': watchFile,
1448
1454
  'FileSystem.unwatchFile': unwatchFile,
1455
+ 'FileSystem.watchFile': watchFile,
1449
1456
  'FileSystem.writeFile': writeFile,
1450
1457
  'Initialize.initialize': initialize
1451
1458
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-system-worker",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "File System Worker",
5
5
  "keywords": [
6
6
  "Lvce Editor"