@php-wasm/web 0.6.4 → 0.6.6

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 (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +7 -7
  3. package/package.json +5 -5
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export type WithAPIState = {
16
16
  isReady: () => Promise<void>;
17
17
  };
18
18
  export type RemoteAPI<T> = Comlink.Remote<T> & WithAPIState;
19
- export declare function consumeAPI<APIType>(remote: Worker | Window): RemoteAPI<APIType>;
19
+ export declare function consumeAPI<APIType>(remote: Worker | Window, context?: undefined | EventTarget): RemoteAPI<APIType>;
20
20
  export type PublicAPI<Methods, PipedAPI = unknown> = RemoteAPI<Methods & PipedAPI>;
21
21
  export declare function exposeAPI<Methods, PipedAPI>(apiMethods?: Methods, pipedApi?: PipedAPI): [
22
22
  () => void,
package/index.js CHANGED
@@ -1691,18 +1691,18 @@ function requestResponseMessage(e, t, r) {
1691
1691
  function generateUUID() {
1692
1692
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
1693
1693
  }
1694
- function consumeAPI(e) {
1694
+ function consumeAPI(e, t = void 0) {
1695
1695
  setupTransferHandlers();
1696
- const t = e instanceof Worker ? e : windowEndpoint(e), r = wrap(t), s = proxyClone(r);
1697
- return new Proxy(s, {
1698
- get: (n, o) => o === "isConnected" ? async () => {
1699
- for (let i = 0; i < 10; i++)
1696
+ const r = e instanceof Worker ? e : windowEndpoint(e, t), s = wrap(r), n = proxyClone(s);
1697
+ return new Proxy(n, {
1698
+ get: (o, i) => i === "isConnected" ? async () => {
1699
+ for (; ; )
1700
1700
  try {
1701
- await runWithTimeout(r.isConnected(), 200);
1701
+ await runWithTimeout(s.isConnected(), 200);
1702
1702
  break;
1703
1703
  } catch {
1704
1704
  }
1705
- } : r[o]
1705
+ } : s[i]
1706
1706
  });
1707
1707
  }
1708
1708
  async function runWithTimeout(e, t) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/web",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "PHP.wasm for the web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,15 +29,15 @@
29
29
  "type": "module",
30
30
  "main": "index.js",
31
31
  "types": "index.d.ts",
32
- "gitHead": "8b74852e9701f5083b367f9a294f34200230ce79",
32
+ "gitHead": "90f82ca946f8573b358c1320be0b6b8674f67cfc",
33
33
  "engines": {
34
34
  "node": ">=16.15.1",
35
35
  "npm": ">=8.11.0"
36
36
  },
37
37
  "dependencies": {
38
38
  "comlink": "^4.4.1",
39
- "@php-wasm/universal": "0.6.4",
40
- "@php-wasm/web-service-worker": "0.6.4",
41
- "@php-wasm/progress": "0.6.4"
39
+ "@php-wasm/universal": "0.6.6",
40
+ "@php-wasm/web-service-worker": "0.6.6",
41
+ "@php-wasm/progress": "0.6.6"
42
42
  }
43
43
  }