promise-worker-bi 4.1.0 → 4.1.1
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/README.md +1 -1
- package/package.json +10 -4
- package/dist/test/test.js +0 -3840
- package/dist/test/worker-bidirectional-echo.js +0 -3180
- package/dist/test/worker-echo-custom-2.js +0 -310
- package/dist/test/worker-echo-custom.js +0 -310
- package/dist/test/worker-echo.js +0 -303
- package/dist/test/worker-empty.js +0 -302
- package/dist/test/worker-error-async.js +0 -305
- package/dist/test/worker-error-sync.js +0 -303
- package/dist/test/worker-host-echo-custom.js +0 -3194
- package/dist/test/worker-host-echo-multiple.js +0 -3193
- package/dist/test/worker-host-echo.js +0 -3175
- package/dist/test/worker-host-empty.js +0 -3183
- package/dist/test/worker-host-error-async.js +0 -3180
- package/dist/test/worker-host-error-outside-response.js +0 -305
- package/dist/test/worker-host-error-sync.js +0 -3180
- package/dist/test/worker-host-ping.js +0 -3175
- package/dist/test/worker-host-transferable.js +0 -3185
- package/dist/test/worker-hostid.js +0 -304
- package/dist/test/worker-pong-promise.js +0 -303
- package/dist/test/worker-pong.js +0 -303
- package/dist/test/worker-shared.js +0 -311
- package/dist/test/worker-transferable.js +0 -3188
- /package/dist/{esmodules.js → esmodules.mjs} +0 -0
package/README.md
CHANGED
|
@@ -303,7 +303,7 @@ The `hostID` parameter is only defined inside a shared worker, in which case it
|
|
|
303
303
|
|
|
304
304
|
The return value of the callback function (shown above as `any`) must resolve to something [structured cloneable](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm).
|
|
305
305
|
|
|
306
|
-
If you want to [transfer an object](https://developer.mozilla.org/en-US/docs/Glossary/Transferable_objects) in the return value of the callback, then the return type should be `{ message: any,
|
|
306
|
+
If you want to [transfer an object](https://developer.mozilla.org/en-US/docs/Glossary/Transferable_objects) in the return value of the callback, then the return type should be `{ message: any, _PWB_TRANSFER: Transferable[] }` rather than just `any`.
|
|
307
307
|
|
|
308
308
|
#### `promiseWorker.postMessage(message: any, hostID?: number, transfer?: Transferable[]): Promise<any>`
|
|
309
309
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "promise-worker-bi",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Promise-based messaging for Web Workers and Shared Workers",
|
|
5
|
-
"main": "dist/commonjs.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"main": "./dist/commonjs.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/esmodules.mjs",
|
|
11
|
+
"require": "./dist/commonjs.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
"scripts": {
|
|
9
15
|
"prepublish": "yarn run build",
|
|
10
16
|
"build": "rm -rf dist && rollup -c && yarn run tsc",
|