Skip to content

Commit 750c06f

Browse files
mmermerkayahiranya911
authored andcommitted
Remove DOM from lib (#305)
* Remove DOM from lib Added DOM types manually. We should keep these in sync with any spec changes. Also removed ES5 and ES2015.Promise from lib as they are already included in ES2015. * Add CHANGELOG entry
1 parent 0e3311a commit 750c06f

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
method to return a more specific type.
88
- [changed] Admin SDK can now read the Firebase/GCP project ID from both
99
`GCLOUD_PROJECT` and `GOOGLE_CLOUD_PROJECT` environment variables.
10+
- [changed] Updated the `WebpushNotification` typings to match
11+
[the current API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushconfig).
1012

1113
# v5.12.1
1214

src/index.d.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,26 @@ declare namespace admin.messaging {
446446
notification?: WebpushNotification;
447447
};
448448

449-
interface WebpushNotification extends NotificationOptions {
449+
interface WebpushNotification {
450450
title?: string;
451+
actions?: Array<{
452+
action: string;
453+
icon?: string;
454+
title: string;
455+
}>;
456+
badge?: string;
457+
body?: string;
458+
data?: any;
459+
dir?: 'auto' | 'ltr' | 'rtl';
460+
icon?: string;
461+
image?: string;
462+
lang?: string;
463+
renotify?: boolean;
464+
requireInteraction?: boolean;
465+
silent?: boolean;
466+
tag?: string;
467+
timestamp?: number;
468+
vibrate?: number | number[];
451469
[key: string]: any;
452470
}
453471

src/messaging/messaging.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,26 @@ export interface WebpushConfig {
129129
notification?: WebpushNotification;
130130
}
131131

132-
export interface WebpushNotification extends NotificationOptions {
132+
export interface WebpushNotification {
133133
title?: string;
134+
actions?: Array<{
135+
action: string;
136+
icon?: string;
137+
title: string;
138+
}>;
139+
badge?: string;
140+
body?: string;
141+
data?: any;
142+
dir?: 'auto' | 'ltr' | 'rtl';
143+
icon?: string;
144+
image?: string;
145+
lang?: string;
146+
renotify?: boolean;
147+
requireInteraction?: boolean;
148+
silent?: boolean;
149+
tag?: string;
150+
timestamp?: number;
151+
vibrate?: number | number[];
134152
[key: string]: any;
135153
}
136154

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"module": "commonjs",
44
"target": "es5",
55
"noImplicitAny": false,
6-
"lib": ["es5", "es2015.promise", "es2015", "dom"],
6+
"lib": ["es2015"],
77
"outDir": "lib",
88
// We manually craft typings in src/index.d.ts instead of auto-generating them.
99
// "declaration": true,

0 commit comments

Comments
 (0)