Skip to content

Commit 4052725

Browse files
authored
🤖 Merge PR DefinitelyTyped#73353 fix(node-pushnotifications): fix fcm settings definition by @vitalyster
1 parent 242b6f6 commit 4052725

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

‎types/node-pushnotifications/index.d.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="node" />
22

3+
import { Credential, ServiceAccount } from "firebase-admin/app";
34
import * as webPush from "web-push";
4-
55
export = PushNotifications;
66

77
declare class PushNotifications {
@@ -34,8 +34,10 @@ declare namespace PushNotifications {
3434
} | undefined;
3535
/** Firebase Cloud Messaging */
3636
fcm?: {
37-
/** FCM token */
38-
id?: string | undefined;
37+
/** Firebase settings */
38+
appName: string;
39+
serviceAccountKey: ServiceAccount;
40+
credential: Credential | null;
3941
} | undefined;
4042
/** Apple Push Notifications */
4143
apn?: {

‎types/node-pushnotifications/node-pushnotifications-tests.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import PushNotifications = require("node-pushnotifications");
22
import { supportedContentEncodings } from "web-push";
33

4-
const settings = {
4+
const settings: PushNotifications.Settings = {
55
gcm: {
66
id: "null",
77
},
88
fcm: {
9-
id: "null",
9+
appName: "null",
10+
serviceAccountKey: require("path/to/serviceAccountKey.json"),
11+
credential: null,
1012
},
1113
apn: {
1214
token: {

‎types/node-pushnotifications/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
],
88
"dependencies": {
99
"@types/node": "*",
10-
"@types/web-push": "*"
10+
"@types/web-push": "*",
11+
"firebase-admin": "^11.5.0"
1112
},
1213
"devDependencies": {
1314
"@types/node-pushnotifications": "workspace:."

0 commit comments

Comments
 (0)