Skip to content

Commit 0b47fdd

Browse files
authored
Merge pull request #17 from maxholman/types-2024-12-15
fix: improve typescript compat
2 parents 3e3763c + 4eed2d1 commit 0b47fdd

File tree

5 files changed

+44
-42
lines changed

5 files changed

+44
-42
lines changed

packages/web-push/lib/types.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export type PushMessage<T extends Jsonifiable = Jsonifiable> = {
2424

2525
export type PushSubscription = {
2626
endpoint: string;
27-
expirationTime: null | DOMHighResTimeStamp;
27+
28+
/** DOMHighResTimeStamp */
29+
expirationTime: number | null;
2830
keys: {
2931
auth: string; // secret
3032
p256dh: string; // key

packages/web-push/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
},
3131
"dependencies": {
3232
"@block65/custom-error": "^12.2.0",
33+
"type-fest": "^4.20.0",
3334
"base64-arraybuffer": "^1.0.2"
3435
},
3536
"devDependencies": {
3637
"@tsconfig/node20": "^20.1.4",
3738
"@types/node": "^20.14.2",
38-
"type-fest": "^4.20.0",
3939
"vitest": "<=1.5.0"
4040
}
4141
}

packages/web-push/test/__snapshots__/notification.test.ts.snap

+34-34
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@
22

33
exports[`buildPushPayload 1`] = `
44
Uint8Array [
5-
94,
6-
43,
7-
206,
8-
12,
9-
35,
10-
84,
11-
222,
12-
164,
13-
14,
14-
84,
15-
27,
16-
103,
17-
93,
18-
135,
19-
57,
20-
15,
21-
55,
22-
130,
23-
240,
24-
181,
25-
195,
26-
28,
27-
112,
28-
112,
29-
78,
30-
204,
31-
132,
32-
168,
33-
189,
34-
200,
35-
158,
36-
205,
37-
71,
38-
53,
5+
3,
6+
190,
397
254,
8+
232,
9+
87,
10+
55,
11+
210,
12+
61,
13+
25,
14+
227,
15+
75,
4016
197,
17+
243,
18+
37,
19+
221,
20+
53,
21+
182,
22+
76,
23+
230,
24+
68,
25+
44,
26+
50,
27+
246,
28+
235,
29+
187,
30+
191,
31+
193,
32+
141,
33+
134,
34+
128,
35+
106,
36+
42,
37+
251,
38+
15,
39+
207,
40+
153,
4141
]
4242
`;
4343

packages/web-push/test/fixtures.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import type { PushSubscription } from '../lib/types.js';
33
export const fakeSubscriptions = {
44
chrome: {
55
endpoint:
6-
'https://fcm.googleapis.com/fcm/send/fL4MGn77FGc:APA91bE9RjT5iS_lfuBIm7PeOS2789EzyWGbUrh-viIAgsGbJIG-Rc65ipPt8hFS6aLwiyvyfXsSIVTZTuISxPUo3kcaklfv_WYpZ4g1g8jY6wChNoHkRmDpGN7qFgI2SkrV2SxYlL-r',
6+
'https://fcm.googleapis.com/fcm/send/ekhJ4l8bTqw:APA91bGyU0XqT5uWpyGzpx9TDtGc0m-CTPpjnnOVnl_ybIOlue7LPYlHoRyWZ4JgySwceHjmvDprQMW9vehEZn5ifluMA0Bq2FA5qfYceC3vv5YivFFtA2debLNbpfiLEN73WyoVJfgG',
77
expirationTime: null,
88
keys: {
99
p256dh:
10-
'BJSK63fSr4N3Vrx2DPFmRrGLglmDOZBFy5AwUDINlEFMQYHjDS2YjZbIYTuOGQVp4ZbzJKki6cCYcKsMHSBF9-Y',
11-
auth: 'lzqdvQzre8BPRpJTvFJZng',
10+
'BGPknDTtnF3sW5XPDzZl9DD2YqFY0WsyqZJ2Pxrzq8x1HY-5aF2aRiCz_QKDY2nj-ZFtqdBwRsV9yoPRg_015Vo',
11+
auth: 'ynfeyAwBSXODSCaeRNQZiw',
1212
},
1313
},
1414
edge: {

pnpm-lock.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)