@serwist/window 9.0.0-preview.24 → 9.0.0-preview.26

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/Serwist.d.ts CHANGED
@@ -95,23 +95,21 @@ export declare class Serwist extends SerwistEventTarget {
95
95
  getSW(): Promise<ServiceWorker>;
96
96
  /**
97
97
  * Sends the passed data object to the service worker registered by this
98
- * instance (via `@serwist/window.Serwist.getSW`) and resolves
99
- * with a response (if any).
98
+ * instance (via `getSW`) and resolves with a response (if any).
100
99
  *
101
- * A response can be set in a message handler in the service worker by
102
- * calling `event.ports[0].postMessage(...)`, which will resolve the promise
103
- * returned by `messageSW()`. If no response is set, the promise will never
104
- * resolve.
100
+ * A response can be sent by calling `event.ports[0].postMessage(...)`, which will
101
+ * resolve the promise returned by `messageSW()`. If no response is sent, the promise
102
+ * will never resolve.
105
103
  *
106
104
  * @param data An object to send to the service worker
107
105
  * @returns
108
106
  */
109
107
  messageSW(data: any): Promise<any>;
110
108
  /**
111
- * Sends a `{type: 'SKIP_WAITING'}` message to the service worker that's
112
- * currently in the `waiting` state associated with the current registration.
109
+ * Sends a `{ type: "SKIP_WAITING" }` message to the service worker that is
110
+ * currently waiting and associated with the current registration.
113
111
  *
114
- * If there is no current registration or no service worker is `waiting`,
112
+ * If there is no current registration, or no service worker is waiting,
115
113
  * calling this will have no effect.
116
114
  */
117
115
  messageSkipWaiting(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"Serwist.d.ts","sourceRoot":"","sources":["../src/Serwist.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAK1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAgBnE;;;;;;;;;;GAUG;AACH,qBAAa,OAAQ,SAAQ,kBAAkB;IAC7C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;IACvD,OAAO,CAAC,QAAQ,CAAC,gBAA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;;;;;;;;;;;;GAaG"}
@@ -2,10 +2,9 @@
2
2
  * Sends a data object to a service worker via `postMessage` and resolves with
3
3
  * a response (if any).
4
4
  *
5
- * A response can be set in a message handler in the service worker by
6
- * calling `event.ports[0].postMessage(...)`, which will resolve the promise
7
- * returned by `messageSW()`. If no response is set, the promise will not
8
- * resolve.
5
+ * A response can be sent by calling `event.ports[0].postMessage(...)`, which will
6
+ * resolve the promise returned by `messageSW()`. If no response is sent, the promise
7
+ * will never resolve.
9
8
  *
10
9
  * @param sw The service worker to send the message to.
11
10
  * @param data An object to send to the service worker.
@@ -1 +1 @@
1
- {"version":3,"file":"messageSW.d.ts","sourceRoot":"","sources":["../src/messageSW.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,OAAQ,aAAa,QAAQ,GAAG,KAAG,QAAQ,GAAG,CAQnE,CAAC"}
1
+ {"version":3,"file":"messageSW.d.ts","sourceRoot":"","sources":["../src/messageSW.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,OAAQ,aAAa,QAAQ,GAAG,KAAG,QAAQ,GAAG,CAQnE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/window",
3
- "version": "9.0.0-preview.24",
3
+ "version": "9.0.0-preview.26",
4
4
  "type": "module",
5
5
  "description": "Simplifies communications with Serwist packages running in the service worker",
6
6
  "files": [
@@ -18,8 +18,8 @@
18
18
  ],
19
19
  "author": "Google's Web DevRel Team, Serwist's Team",
20
20
  "license": "MIT",
21
- "repository": "https://gitlab.com/serwist/serwist",
22
- "bugs": "https://gitlab.com/serwist/serwist/issues",
21
+ "repository": "https://github.com/serwist/serwist",
22
+ "bugs": "https://github.com/serwist/serwist/issues",
23
23
  "homepage": "https://serwist.pages.dev",
24
24
  "main": "./dist/index.js",
25
25
  "types": "./dist/index.d.ts",
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@types/trusted-types": "2.0.7",
35
- "serwist": "9.0.0-preview.24"
35
+ "serwist": "9.0.0-preview.26"
36
36
  },
37
37
  "devDependencies": {
38
- "rollup": "4.14.0",
39
- "typescript": "5.5.0-dev.20240404",
40
- "@serwist/constants": "9.0.0-preview.24"
38
+ "rollup": "4.14.3",
39
+ "typescript": "5.5.0-dev.20240415",
40
+ "@serwist/configs": "9.0.0-preview.26"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "typescript": ">=5.0.0"
package/src/Serwist.ts CHANGED
@@ -255,13 +255,11 @@ export class Serwist extends SerwistEventTarget {
255
255
 
256
256
  /**
257
257
  * Sends the passed data object to the service worker registered by this
258
- * instance (via `@serwist/window.Serwist.getSW`) and resolves
259
- * with a response (if any).
258
+ * instance (via `getSW`) and resolves with a response (if any).
260
259
  *
261
- * A response can be set in a message handler in the service worker by
262
- * calling `event.ports[0].postMessage(...)`, which will resolve the promise
263
- * returned by `messageSW()`. If no response is set, the promise will never
264
- * resolve.
260
+ * A response can be sent by calling `event.ports[0].postMessage(...)`, which will
261
+ * resolve the promise returned by `messageSW()`. If no response is sent, the promise
262
+ * will never resolve.
265
263
  *
266
264
  * @param data An object to send to the service worker
267
265
  * @returns
@@ -273,10 +271,10 @@ export class Serwist extends SerwistEventTarget {
273
271
  }
274
272
 
275
273
  /**
276
- * Sends a `{type: 'SKIP_WAITING'}` message to the service worker that's
277
- * currently in the `waiting` state associated with the current registration.
274
+ * Sends a `{ type: "SKIP_WAITING" }` message to the service worker that is
275
+ * currently waiting and associated with the current registration.
278
276
  *
279
- * If there is no current registration or no service worker is `waiting`,
277
+ * If there is no current registration, or no service worker is waiting,
280
278
  * calling this will have no effect.
281
279
  */
282
280
  messageSkipWaiting(): void {
package/src/messageSW.ts CHANGED
@@ -10,10 +10,9 @@
10
10
  * Sends a data object to a service worker via `postMessage` and resolves with
11
11
  * a response (if any).
12
12
  *
13
- * A response can be set in a message handler in the service worker by
14
- * calling `event.ports[0].postMessage(...)`, which will resolve the promise
15
- * returned by `messageSW()`. If no response is set, the promise will not
16
- * resolve.
13
+ * A response can be sent by calling `event.ports[0].postMessage(...)`, which will
14
+ * resolve the promise returned by `messageSW()`. If no response is sent, the promise
15
+ * will never resolve.
17
16
  *
18
17
  * @param sw The service worker to send the message to.
19
18
  * @param data An object to send to the service worker.