@lvce-editor/ipc 4.1.0 → 5.0.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.
Files changed (2) hide show
  1. package/dist/index.js +24 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -150,7 +150,6 @@ const isMessagePortMain = value => {
150
150
  return value && value.constructor && value.constructor.name === 'MessagePortMain';
151
151
  };
152
152
 
153
- // @ts-ignore
154
153
  const listen$7 = ({
155
154
  messagePort
156
155
  }) => {
@@ -159,8 +158,9 @@ const listen$7 = ({
159
158
  }
160
159
  return messagePort;
161
160
  };
162
-
163
- // @ts-ignore
161
+ const signal$6 = messagePort => {
162
+ messagePort.start();
163
+ };
164
164
  const getActualData$1 = event => {
165
165
  const {
166
166
  data,
@@ -174,12 +174,9 @@ const getActualData$1 = event => {
174
174
  params: [...ports, ...data.params]
175
175
  };
176
176
  };
177
-
178
- // @ts-ignore
179
177
  const wrap$a = messagePort => {
180
178
  return {
181
179
  messagePort,
182
- // @ts-ignore
183
180
  on(event, listener) {
184
181
  if (event === 'message') {
185
182
  // @ts-ignore
@@ -198,11 +195,9 @@ const wrap$a = messagePort => {
198
195
  throw new Error('unsupported event type');
199
196
  }
200
197
  },
201
- // @ts-ignore
202
198
  off(event, listener) {
203
199
  this.messagePort.off(event, listener);
204
200
  },
205
- // @ts-ignore
206
201
  send(message) {
207
202
  this.messagePort.postMessage(message);
208
203
  },
@@ -210,7 +205,7 @@ const wrap$a = messagePort => {
210
205
  this.messagePort.close();
211
206
  },
212
207
  start() {
213
- this.messagePort.start();
208
+ throw new Error('start method is deprecated');
214
209
  }
215
210
  };
216
211
  };
@@ -218,6 +213,7 @@ const wrap$a = messagePort => {
218
213
  const IpcChildWithElectronMessagePort = {
219
214
  __proto__: null,
220
215
  listen: listen$7,
216
+ signal: signal$6,
221
217
  wrap: wrap$a
222
218
  };
223
219
 
@@ -250,7 +246,7 @@ const listen$6 = () => {
250
246
  };
251
247
 
252
248
  // @ts-ignore
253
- const signal$3 = parentPort => {
249
+ const signal$5 = parentPort => {
254
250
  parentPort.postMessage(readyMessage);
255
251
  };
256
252
 
@@ -298,7 +294,7 @@ const wrap$9 = parentPort => {
298
294
  const IpcChildWithElectronUtilityProcess = {
299
295
  __proto__: null,
300
296
  listen: listen$6,
301
- signal: signal$3,
297
+ signal: signal$5,
302
298
  wrap: wrap$9
303
299
  };
304
300
 
@@ -313,7 +309,7 @@ const listen$5 = () => {
313
309
  }
314
310
  return globalThis;
315
311
  };
316
- const signal$2 = global => {
312
+ const signal$4 = global => {
317
313
  global.postMessage(readyMessage);
318
314
  };
319
315
  const wrap$8 = global => {
@@ -355,7 +351,7 @@ const wrap$8 = global => {
355
351
  const IpcChildWithModuleWorker = {
356
352
  __proto__: null,
357
353
  listen: listen$5,
358
- signal: signal$2,
354
+ signal: signal$4,
359
355
  wrap: wrap$8
360
356
  };
361
357
 
@@ -390,7 +386,7 @@ const waitForFirstMessage = async port => {
390
386
 
391
387
  const listen$4 = async () => {
392
388
  const parentIpcRaw = listen$5();
393
- signal$2(parentIpcRaw);
389
+ signal$4(parentIpcRaw);
394
390
  const parentIpc = wrap$8(parentIpcRaw);
395
391
  const firstMessage = await waitForFirstMessage(parentIpc);
396
392
  if (firstMessage.method !== 'initialize') {
@@ -453,7 +449,7 @@ const listen$3 = async () => {
453
449
  };
454
450
 
455
451
  // @ts-ignore
456
- const signal$1 = process => {
452
+ const signal$3 = process => {
457
453
  process.send(readyMessage);
458
454
  };
459
455
 
@@ -506,7 +502,7 @@ const wrap$6 = process => {
506
502
  const IpcChildWithNodeForkedProcess = {
507
503
  __proto__: null,
508
504
  listen: listen$3,
509
- signal: signal$1,
505
+ signal: signal$3,
510
506
  wrap: wrap$6
511
507
  };
512
508
 
@@ -522,6 +518,9 @@ const listen$2 = async ({
522
518
  }
523
519
  return messagePort;
524
520
  };
521
+ const signal$2 = messagePort => {
522
+ messagePort.start();
523
+ };
525
524
  const wrap$5 = port => {
526
525
  return {
527
526
  port,
@@ -545,7 +544,7 @@ const wrap$5 = port => {
545
544
  this.port.close();
546
545
  },
547
546
  start() {
548
- this.port.start();
547
+ throw new Error('start method is deprecated');
549
548
  }
550
549
  };
551
550
  };
@@ -553,6 +552,7 @@ const wrap$5 = port => {
553
552
  const IpcChildWithNodeMessagePort = {
554
553
  __proto__: null,
555
554
  listen: listen$2,
555
+ signal: signal$2,
556
556
  wrap: wrap$5
557
557
  };
558
558
 
@@ -565,7 +565,7 @@ const listen$1 = async () => {
565
565
  }
566
566
  return parentPort;
567
567
  };
568
- const signal = parentPort => {
568
+ const signal$1 = parentPort => {
569
569
  parentPort.postMessage(readyMessage);
570
570
  };
571
571
  const wrap$4 = parentPort => {
@@ -596,7 +596,7 @@ const wrap$4 = parentPort => {
596
596
  const IpcChildWithNodeWorker = {
597
597
  __proto__: null,
598
598
  listen: listen$1,
599
- signal,
599
+ signal: signal$1,
600
600
  wrap: wrap$4
601
601
  };
602
602
 
@@ -718,6 +718,9 @@ const listen = async ({
718
718
  }
719
719
  return webSocket;
720
720
  };
721
+ const signal = webSocket => {
722
+ webSocket.resume();
723
+ };
721
724
 
722
725
  // @ts-ignore
723
726
  const wrap$3 = webSocket => {
@@ -762,7 +765,7 @@ const wrap$3 = webSocket => {
762
765
  this.webSocket.close();
763
766
  },
764
767
  start() {
765
- this.webSocket.resume();
768
+ throw new Error('start method is deprecated');
766
769
  }
767
770
  };
768
771
  };
@@ -770,6 +773,7 @@ const wrap$3 = webSocket => {
770
773
  const IpcChildWithWebSocket = {
771
774
  __proto__: null,
772
775
  listen,
776
+ signal,
773
777
  wrap: wrap$3
774
778
  };
775
779
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/ipc",
3
- "version": "4.1.0",
3
+ "version": "5.0.0",
4
4
  "description": "Inter Process Communication for Lvce Editor",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",