1 | /*! firebase-admin v13.0.1 */
|
2 | /*!
|
3 | * Copyright 2021 Google Inc.
|
4 | *
|
5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
6 | * you may not use this file except in compliance with the License.
|
7 | * You may obtain a copy of the License at
|
8 | *
|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
10 | *
|
11 | * Unless required by applicable law or agreed to in writing, software
|
12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 | * See the License for the specific language governing permissions and
|
15 | * limitations under the License.
|
16 | */
|
17 | import { App } from '../app';
|
18 | import { Messaging as TMessaging } from './messaging';
|
19 | import { AndroidConfig as TAndroidConfig, AndroidFcmOptions as TAndroidFcmOptions, AndroidNotification as TAndroidNotification, ApnsConfig as TApnsConfig, ApnsFcmOptions as TApnsFcmOptions, ApnsPayload as TApnsPayload, Aps as TAps, ApsAlert as TApsAlert, BatchResponse as TBatchResponse, CriticalSound as TCriticalSound, ConditionMessage as TConditionMessage, FcmOptions as TFcmOptions, LightSettings as TLightSettings, Message as TMessage, MessagingTopicManagementResponse as TMessagingTopicManagementResponse, MulticastMessage as TMulticastMessage, Notification as TNotification, SendResponse as TSendResponse, TokenMessage as TTokenMessage, TopicMessage as TTopicMessage, WebpushConfig as TWebpushConfig, WebpushFcmOptions as TWebpushFcmOptions, WebpushNotification as TWebpushNotification, DataMessagePayload as TDataMessagePayload, MessagingOptions as TMessagingOptions, MessagingPayload as TMessagingPayload, NotificationMessagePayload as TNotificationMessagePayload } from './messaging-api';
|
20 | /**
|
21 | * Gets the {@link firebase-admin.messaging#Messaging} service for the
|
22 | * default app or a given app.
|
23 | *
|
24 | * `admin.messaging()` can be called with no arguments to access the default
|
25 | * app's `Messaging` service or as `admin.messaging(app)` to access the
|
26 | * `Messaging` service associated with a specific app.
|
27 | *
|
28 | * @example
|
29 | * ```javascript
|
30 | * // Get the Messaging service for the default app
|
31 | * var defaultMessaging = admin.messaging();
|
32 | * ```
|
33 | *
|
34 | * @example
|
35 | * ```javascript
|
36 | * // Get the Messaging service for a given app
|
37 | * var otherMessaging = admin.messaging(otherApp);
|
38 | * ```
|
39 | *
|
40 | * @param app - Optional app whose `Messaging` service to
|
41 | * return. If not provided, the default `Messaging` service will be returned.
|
42 | *
|
43 | * @returns The default `Messaging` service if no
|
44 | * app is provided or the `Messaging` service associated with the provided
|
45 | * app.
|
46 | */
|
47 | export declare function messaging(app?: App): messaging.Messaging;
|
48 | export declare namespace messaging {
|
49 | /**
|
50 | * Type alias to {@link firebase-admin.messaging#Messaging}.
|
51 | */
|
52 | type Messaging = TMessaging;
|
53 | /**
|
54 | * Type alias to {@link firebase-admin.messaging#AndroidConfig}.
|
55 | */
|
56 | type AndroidConfig = TAndroidConfig;
|
57 | /**
|
58 | * Type alias to {@link firebase-admin.messaging#AndroidFcmOptions}.
|
59 | */
|
60 | type AndroidFcmOptions = TAndroidFcmOptions;
|
61 | /**
|
62 | * Type alias to {@link firebase-admin.messaging#AndroidNotification}.
|
63 | */
|
64 | type AndroidNotification = TAndroidNotification;
|
65 | /**
|
66 | * Type alias to {@link firebase-admin.messaging#ApnsConfig}.
|
67 | */
|
68 | type ApnsConfig = TApnsConfig;
|
69 | /**
|
70 | * Type alias to {@link firebase-admin.messaging#ApnsFcmOptions}.
|
71 | */
|
72 | type ApnsFcmOptions = TApnsFcmOptions;
|
73 | /**
|
74 | * Type alias to {@link firebase-admin.messaging#ApnsPayload}.
|
75 | */
|
76 | type ApnsPayload = TApnsPayload;
|
77 | /**
|
78 | * Type alias to {@link firebase-admin.messaging#Aps}.
|
79 | */
|
80 | type Aps = TAps;
|
81 | /**
|
82 | * Type alias to {@link firebase-admin.messaging#ApsAlert}.
|
83 | */
|
84 | type ApsAlert = TApsAlert;
|
85 | /**
|
86 | * Type alias to {@link firebase-admin.messaging#BatchResponse}.
|
87 | */
|
88 | type BatchResponse = TBatchResponse;
|
89 | /**
|
90 | * Type alias to {@link firebase-admin.messaging#CriticalSound}.
|
91 | */
|
92 | type CriticalSound = TCriticalSound;
|
93 | /**
|
94 | * Type alias to {@link firebase-admin.messaging#ConditionMessage}.
|
95 | */
|
96 | type ConditionMessage = TConditionMessage;
|
97 | /**
|
98 | * Type alias to {@link firebase-admin.messaging#FcmOptions}.
|
99 | */
|
100 | type FcmOptions = TFcmOptions;
|
101 | /**
|
102 | * Type alias to {@link firebase-admin.messaging#LightSettings}.
|
103 | */
|
104 | type LightSettings = TLightSettings;
|
105 | /**
|
106 | * Type alias to {@link firebase-admin.messaging#Message}.
|
107 | */
|
108 | type Message = TMessage;
|
109 | /**
|
110 | * Type alias to {@link firebase-admin.messaging#MessagingTopicManagementResponse}.
|
111 | */
|
112 | type MessagingTopicManagementResponse = TMessagingTopicManagementResponse;
|
113 | /**
|
114 | * Type alias to {@link firebase-admin.messaging#MulticastMessage}.
|
115 | */
|
116 | type MulticastMessage = TMulticastMessage;
|
117 | /**
|
118 | * Type alias to {@link firebase-admin.messaging#Notification}.
|
119 | */
|
120 | type Notification = TNotification;
|
121 | /**
|
122 | * Type alias to {@link firebase-admin.messaging#SendResponse}.
|
123 | */
|
124 | type SendResponse = TSendResponse;
|
125 | /**
|
126 | * Type alias to {@link firebase-admin.messaging#TokenMessage}.
|
127 | */
|
128 | type TokenMessage = TTokenMessage;
|
129 | /**
|
130 | * Type alias to {@link firebase-admin.messaging#TopicMessage}.
|
131 | */
|
132 | type TopicMessage = TTopicMessage;
|
133 | /**
|
134 | * Type alias to {@link firebase-admin.messaging#WebpushConfig}.
|
135 | */
|
136 | type WebpushConfig = TWebpushConfig;
|
137 | /**
|
138 | * Type alias to {@link firebase-admin.messaging#WebpushFcmOptions}.
|
139 | */
|
140 | type WebpushFcmOptions = TWebpushFcmOptions;
|
141 | /**
|
142 | * Type alias to {@link firebase-admin.messaging#WebpushNotification}.
|
143 | */
|
144 | type WebpushNotification = TWebpushNotification;
|
145 | /**
|
146 | * Type alias to {@link firebase-admin.messaging#DataMessagePayload}.
|
147 | */
|
148 | type DataMessagePayload = TDataMessagePayload;
|
149 | /**
|
150 | * Type alias to {@link firebase-admin.messaging#MessagingOptions}.
|
151 | */
|
152 | type MessagingOptions = TMessagingOptions;
|
153 | /**
|
154 | * Type alias to {@link firebase-admin.messaging#MessagingPayload}.
|
155 | */
|
156 | type MessagingPayload = TMessagingPayload;
|
157 | /**
|
158 | * Type alias to {@link firebase-admin.messaging#NotificationMessagePayload}.
|
159 | */
|
160 | type NotificationMessagePayload = TNotificationMessagePayload;
|
161 | }
|