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 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, transfer: Transferable[] }` rather than just `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.0",
3
+ "version": "4.1.1",
4
4
  "description": "Promise-based messaging for Web Workers and Shared Workers",
5
- "main": "dist/commonjs.js",
6
- "module": "dist/esmodules.js",
7
- "types": "dist/index.d.ts",
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",