@lvce-editor/file-search-worker 5.14.0 → 5.15.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/fileSearchWorkerMain.js +34 -27
- package/package.json +1 -1
|
@@ -356,22 +356,11 @@ class IpcChildWithModuleWorker extends Ipc {
|
|
|
356
356
|
const wrap$f = global => {
|
|
357
357
|
return new IpcChildWithModuleWorker(global);
|
|
358
358
|
};
|
|
359
|
-
const withResolvers = () => {
|
|
360
|
-
let _resolve;
|
|
361
|
-
const promise = new Promise(resolve => {
|
|
362
|
-
_resolve = resolve;
|
|
363
|
-
});
|
|
364
|
-
return {
|
|
365
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
366
|
-
resolve: _resolve,
|
|
367
|
-
promise
|
|
368
|
-
};
|
|
369
|
-
};
|
|
370
359
|
const waitForFirstMessage = async port => {
|
|
371
360
|
const {
|
|
372
361
|
resolve,
|
|
373
362
|
promise
|
|
374
|
-
} = withResolvers();
|
|
363
|
+
} = Promise.withResolvers();
|
|
375
364
|
port.addEventListener('message', resolve, {
|
|
376
365
|
once: true
|
|
377
366
|
});
|
|
@@ -434,7 +423,7 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
|
434
423
|
};
|
|
435
424
|
|
|
436
425
|
const Two = '2.0';
|
|
437
|
-
const create$4 = (method, params) => {
|
|
426
|
+
const create$4$1 = (method, params) => {
|
|
438
427
|
return {
|
|
439
428
|
jsonrpc: Two,
|
|
440
429
|
method,
|
|
@@ -442,7 +431,7 @@ const create$4 = (method, params) => {
|
|
|
442
431
|
};
|
|
443
432
|
};
|
|
444
433
|
const callbacks = Object.create(null);
|
|
445
|
-
const set$
|
|
434
|
+
const set$3 = (id, fn) => {
|
|
446
435
|
callbacks[id] = fn;
|
|
447
436
|
};
|
|
448
437
|
const get$2 = id => {
|
|
@@ -461,7 +450,7 @@ const registerPromise = () => {
|
|
|
461
450
|
resolve,
|
|
462
451
|
promise
|
|
463
452
|
} = Promise.withResolvers();
|
|
464
|
-
set$
|
|
453
|
+
set$3(id, resolve);
|
|
465
454
|
return {
|
|
466
455
|
id,
|
|
467
456
|
promise
|
|
@@ -769,7 +758,7 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
769
758
|
return unwrapJsonRpcResult(responseMessage);
|
|
770
759
|
};
|
|
771
760
|
const send = (transport, method, ...params) => {
|
|
772
|
-
const message = create$4(method, params);
|
|
761
|
+
const message = create$4$1(method, params);
|
|
773
762
|
transport.send(message);
|
|
774
763
|
};
|
|
775
764
|
const invoke$3 = (ipc, method, ...params) => {
|
|
@@ -846,7 +835,7 @@ const listen$1 = async (module, options) => {
|
|
|
846
835
|
const ipc = module.wrap(rawIpc);
|
|
847
836
|
return ipc;
|
|
848
837
|
};
|
|
849
|
-
const create$
|
|
838
|
+
const create$4 = async ({
|
|
850
839
|
commandMap
|
|
851
840
|
}) => {
|
|
852
841
|
// TODO create a commandMap per rpc instance
|
|
@@ -858,25 +847,43 @@ const create$3 = async ({
|
|
|
858
847
|
};
|
|
859
848
|
const WebWorkerRpcClient = {
|
|
860
849
|
__proto__: null,
|
|
861
|
-
create: create$
|
|
850
|
+
create: create$4
|
|
862
851
|
};
|
|
863
852
|
|
|
864
853
|
const rpcs = Object.create(null);
|
|
865
|
-
const set$
|
|
854
|
+
const set$7 = (id, rpc) => {
|
|
866
855
|
rpcs[id] = rpc;
|
|
867
856
|
};
|
|
868
857
|
const get$1 = id => {
|
|
869
858
|
return rpcs[id];
|
|
870
859
|
};
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
return
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
860
|
+
|
|
861
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
862
|
+
|
|
863
|
+
const create$3 = rpcId => {
|
|
864
|
+
return {
|
|
865
|
+
// @ts-ignore
|
|
866
|
+
invoke(method, ...params) {
|
|
867
|
+
const rpc = get$1(rpcId);
|
|
868
|
+
// @ts-ignore
|
|
869
|
+
return rpc.invoke(method, ...params);
|
|
870
|
+
},
|
|
871
|
+
// @ts-ignore
|
|
872
|
+
invokeAndTransfer(method, ...params) {
|
|
873
|
+
const rpc = get$1(rpcId);
|
|
874
|
+
// @ts-ignore
|
|
875
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
876
|
+
},
|
|
877
|
+
set(rpc) {
|
|
878
|
+
set$7(rpcId, rpc);
|
|
879
|
+
}
|
|
880
|
+
};
|
|
879
881
|
};
|
|
882
|
+
const RendererWorker$1 = 1;
|
|
883
|
+
const {
|
|
884
|
+
invoke: invoke$2,
|
|
885
|
+
set: set$2
|
|
886
|
+
} = create$3(RendererWorker$1);
|
|
880
887
|
const RendererWorker = {
|
|
881
888
|
__proto__: null,
|
|
882
889
|
invoke: invoke$2,
|