@firebase/app 0.9.13 → 0.9.14
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.
|
@@ -0,0 +1,754 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
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
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Provider for instance for service name T, e.g. 'auth', 'auth-internal'
|
|
20
|
+
* NameServiceMapping[T] is an alias for the type of the instance
|
|
21
|
+
*/
|
|
22
|
+
declare class Provider<T extends Name> {
|
|
23
|
+
private readonly name;
|
|
24
|
+
private readonly container;
|
|
25
|
+
private component;
|
|
26
|
+
private readonly instances;
|
|
27
|
+
private readonly instancesDeferred;
|
|
28
|
+
private readonly instancesOptions;
|
|
29
|
+
private onInitCallbacks;
|
|
30
|
+
constructor(name: T, container: ComponentContainer);
|
|
31
|
+
/**
|
|
32
|
+
* @param identifier A provider can provide mulitple instances of a service
|
|
33
|
+
* if this.component.multipleInstances is true.
|
|
34
|
+
*/
|
|
35
|
+
get(identifier?: string): Promise<NameServiceMapping[T]>;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param options.identifier A provider can provide mulitple instances of a service
|
|
39
|
+
* if this.component.multipleInstances is true.
|
|
40
|
+
* @param options.optional If optional is false or not provided, the method throws an error when
|
|
41
|
+
* the service is not immediately available.
|
|
42
|
+
* If optional is true, the method returns null if the service is not immediately available.
|
|
43
|
+
*/
|
|
44
|
+
getImmediate(options: {
|
|
45
|
+
identifier?: string;
|
|
46
|
+
optional: true;
|
|
47
|
+
}): NameServiceMapping[T] | null;
|
|
48
|
+
getImmediate(options?: {
|
|
49
|
+
identifier?: string;
|
|
50
|
+
optional?: false;
|
|
51
|
+
}): NameServiceMapping[T];
|
|
52
|
+
getComponent(): Component<T> | null;
|
|
53
|
+
setComponent(component: Component<T>): void;
|
|
54
|
+
clearInstance(identifier?: string): void;
|
|
55
|
+
delete(): Promise<void>;
|
|
56
|
+
isComponentSet(): boolean;
|
|
57
|
+
isInitialized(identifier?: string): boolean;
|
|
58
|
+
getOptions(identifier?: string): Record<string, unknown>;
|
|
59
|
+
initialize(opts?: InitializeOptions): NameServiceMapping[T];
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize().
|
|
63
|
+
* The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.
|
|
64
|
+
*
|
|
65
|
+
* @param identifier An optional instance identifier
|
|
66
|
+
* @returns a function to unregister the callback
|
|
67
|
+
*/
|
|
68
|
+
onInit(callback: OnInitCallBack<T>, identifier?: string): () => void;
|
|
69
|
+
/**
|
|
70
|
+
* Invoke onInit callbacks synchronously
|
|
71
|
+
* @param instance the service instance`
|
|
72
|
+
*/
|
|
73
|
+
private invokeOnInitCallbacks;
|
|
74
|
+
private getOrInitializeService;
|
|
75
|
+
private normalizeInstanceIdentifier;
|
|
76
|
+
private shouldAutoInitialize;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @license
|
|
81
|
+
* Copyright 2019 Google LLC
|
|
82
|
+
*
|
|
83
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
84
|
+
* you may not use this file except in compliance with the License.
|
|
85
|
+
* You may obtain a copy of the License at
|
|
86
|
+
*
|
|
87
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
88
|
+
*
|
|
89
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
90
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
91
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
92
|
+
* See the License for the specific language governing permissions and
|
|
93
|
+
* limitations under the License.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`
|
|
98
|
+
*/
|
|
99
|
+
declare class ComponentContainer {
|
|
100
|
+
private readonly name;
|
|
101
|
+
private readonly providers;
|
|
102
|
+
constructor(name: string);
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param component Component being added
|
|
106
|
+
* @param overwrite When a component with the same name has already been registered,
|
|
107
|
+
* if overwrite is true: overwrite the existing component with the new component and create a new
|
|
108
|
+
* provider with the new component. It can be useful in tests where you want to use different mocks
|
|
109
|
+
* for different tests.
|
|
110
|
+
* if overwrite is false: throw an exception
|
|
111
|
+
*/
|
|
112
|
+
addComponent<T extends Name>(component: Component<T>): void;
|
|
113
|
+
addOrOverwriteComponent<T extends Name>(component: Component<T>): void;
|
|
114
|
+
/**
|
|
115
|
+
* getProvider provides a type safe interface where it can only be called with a field name
|
|
116
|
+
* present in NameServiceMapping interface.
|
|
117
|
+
*
|
|
118
|
+
* Firebase SDKs providing services should extend NameServiceMapping interface to register
|
|
119
|
+
* themselves.
|
|
120
|
+
*/
|
|
121
|
+
getProvider<T extends Name>(name: T): Provider<T>;
|
|
122
|
+
getProviders(): Array<Provider<Name>>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @license
|
|
127
|
+
* Copyright 2019 Google LLC
|
|
128
|
+
*
|
|
129
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
130
|
+
* you may not use this file except in compliance with the License.
|
|
131
|
+
* You may obtain a copy of the License at
|
|
132
|
+
*
|
|
133
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
134
|
+
*
|
|
135
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
136
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
137
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
138
|
+
* See the License for the specific language governing permissions and
|
|
139
|
+
* limitations under the License.
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
declare const enum InstantiationMode {
|
|
143
|
+
LAZY = "LAZY",
|
|
144
|
+
EAGER = "EAGER",
|
|
145
|
+
EXPLICIT = "EXPLICIT"
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* PUBLIC: A public component provides a set of public APIs to customers. A service namespace will be patched
|
|
149
|
+
* onto `firebase` namespace. Assume the component name is `test`, customers will be able
|
|
150
|
+
* to get the service by calling `firebase.test()` or `app.test()` where `app` is a `FirebaseApp` instance.
|
|
151
|
+
*
|
|
152
|
+
* PRIVATE: A private component provides a set of private APIs that are used internally by other
|
|
153
|
+
* Firebase SDKs. No serivce namespace is created in `firebase` namespace and customers have no way to get them.
|
|
154
|
+
*/
|
|
155
|
+
declare const enum ComponentType {
|
|
156
|
+
PUBLIC = "PUBLIC",
|
|
157
|
+
PRIVATE = "PRIVATE",
|
|
158
|
+
VERSION = "VERSION"
|
|
159
|
+
}
|
|
160
|
+
interface InstanceFactoryOptions {
|
|
161
|
+
instanceIdentifier?: string;
|
|
162
|
+
options?: {};
|
|
163
|
+
}
|
|
164
|
+
declare type InitializeOptions = InstanceFactoryOptions;
|
|
165
|
+
/**
|
|
166
|
+
* Factory to create an instance of type T, given a ComponentContainer.
|
|
167
|
+
* ComponentContainer is the IOC container that provides {@link Provider}
|
|
168
|
+
* for dependencies.
|
|
169
|
+
*
|
|
170
|
+
* NOTE: The container only provides {@link Provider} rather than the actual instances of dependencies.
|
|
171
|
+
* It is useful for lazily loaded dependencies and optional dependencies.
|
|
172
|
+
*/
|
|
173
|
+
declare type InstanceFactory<T extends Name> = (container: ComponentContainer, options: InstanceFactoryOptions) => NameServiceMapping[T];
|
|
174
|
+
declare type onInstanceCreatedCallback<T extends Name> = (container: ComponentContainer, instanceIdentifier: string, instance: NameServiceMapping[T]) => void;
|
|
175
|
+
interface Dictionary {
|
|
176
|
+
[key: string]: unknown;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* This interface will be extended by Firebase SDKs to provide service name and service type mapping.
|
|
180
|
+
* It is used as a generic constraint to ensure type safety.
|
|
181
|
+
*/
|
|
182
|
+
interface NameServiceMapping {
|
|
183
|
+
}
|
|
184
|
+
declare type Name = keyof NameServiceMapping;
|
|
185
|
+
declare type OnInitCallBack<T extends Name> = (instance: NameServiceMapping[T], identifier: string) => void;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @license
|
|
189
|
+
* Copyright 2019 Google LLC
|
|
190
|
+
*
|
|
191
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
* you may not use this file except in compliance with the License.
|
|
193
|
+
* You may obtain a copy of the License at
|
|
194
|
+
*
|
|
195
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
*
|
|
197
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
* See the License for the specific language governing permissions and
|
|
201
|
+
* limitations under the License.
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Component for service name T, e.g. `auth`, `auth-internal`
|
|
206
|
+
*/
|
|
207
|
+
declare class Component<T extends Name = Name> {
|
|
208
|
+
readonly name: T;
|
|
209
|
+
readonly instanceFactory: InstanceFactory<T>;
|
|
210
|
+
readonly type: ComponentType;
|
|
211
|
+
multipleInstances: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Properties to be added to the service namespace
|
|
214
|
+
*/
|
|
215
|
+
serviceProps: Dictionary;
|
|
216
|
+
instantiationMode: InstantiationMode;
|
|
217
|
+
onInstanceCreated: onInstanceCreatedCallback<T> | null;
|
|
218
|
+
/**
|
|
219
|
+
*
|
|
220
|
+
* @param name The public service name, e.g. app, auth, firestore, database
|
|
221
|
+
* @param instanceFactory Service factory responsible for creating the public interface
|
|
222
|
+
* @param type whether the service provided by the component is public or private
|
|
223
|
+
*/
|
|
224
|
+
constructor(name: T, instanceFactory: InstanceFactory<T>, type: ComponentType);
|
|
225
|
+
setInstantiationMode(mode: InstantiationMode): this;
|
|
226
|
+
setMultipleInstances(multipleInstances: boolean): this;
|
|
227
|
+
setServiceProps(props: Dictionary): this;
|
|
228
|
+
setInstanceCreatedCallback(callback: onInstanceCreatedCallback<T>): this;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @license
|
|
233
|
+
* Copyright 2020 Google LLC
|
|
234
|
+
*
|
|
235
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
236
|
+
* you may not use this file except in compliance with the License.
|
|
237
|
+
* You may obtain a copy of the License at
|
|
238
|
+
*
|
|
239
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
240
|
+
*
|
|
241
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
242
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
243
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
244
|
+
* See the License for the specific language governing permissions and
|
|
245
|
+
* limitations under the License.
|
|
246
|
+
*/
|
|
247
|
+
interface VersionService {
|
|
248
|
+
library: string;
|
|
249
|
+
version: string;
|
|
250
|
+
}
|
|
251
|
+
interface PlatformLoggerService {
|
|
252
|
+
getPlatformInfoString(): string;
|
|
253
|
+
}
|
|
254
|
+
interface HeartbeatService {
|
|
255
|
+
/**
|
|
256
|
+
* Called to report a heartbeat. The function will generate
|
|
257
|
+
* a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
|
|
258
|
+
* to IndexedDB.
|
|
259
|
+
* Note that we only store one heartbeat per day. So if a heartbeat for today is
|
|
260
|
+
* already logged, subsequent calls to this function in the same day will be ignored.
|
|
261
|
+
*/
|
|
262
|
+
triggerHeartbeat(): Promise<void>;
|
|
263
|
+
/**
|
|
264
|
+
* Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
|
|
265
|
+
* It also clears all heartbeats from memory as well as in IndexedDB.
|
|
266
|
+
*/
|
|
267
|
+
getHeartbeatsHeader(): Promise<string>;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @license
|
|
272
|
+
* Copyright 2020 Google LLC
|
|
273
|
+
*
|
|
274
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
275
|
+
* you may not use this file except in compliance with the License.
|
|
276
|
+
* You may obtain a copy of the License at
|
|
277
|
+
*
|
|
278
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
279
|
+
*
|
|
280
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
281
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
282
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
283
|
+
* See the License for the specific language governing permissions and
|
|
284
|
+
* limitations under the License.
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
|
|
289
|
+
* services.
|
|
290
|
+
*
|
|
291
|
+
* Do not call this constructor directly. Instead, use
|
|
292
|
+
* {@link (initializeApp:1) | initializeApp()} to create an app.
|
|
293
|
+
*
|
|
294
|
+
* @public
|
|
295
|
+
*/
|
|
296
|
+
interface FirebaseApp {
|
|
297
|
+
/**
|
|
298
|
+
* The (read-only) name for this app.
|
|
299
|
+
*
|
|
300
|
+
* The default app's name is `"[DEFAULT]"`.
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```javascript
|
|
304
|
+
* // The default app's name is "[DEFAULT]"
|
|
305
|
+
* const app = initializeApp(defaultAppConfig);
|
|
306
|
+
* console.log(app.name); // "[DEFAULT]"
|
|
307
|
+
* ```
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```javascript
|
|
311
|
+
* // A named app's name is what you provide to initializeApp()
|
|
312
|
+
* const otherApp = initializeApp(otherAppConfig, "other");
|
|
313
|
+
* console.log(otherApp.name); // "other"
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
readonly name: string;
|
|
317
|
+
/**
|
|
318
|
+
* The (read-only) configuration options for this app. These are the original
|
|
319
|
+
* parameters given in {@link (initializeApp:1) | initializeApp()}.
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```javascript
|
|
323
|
+
* const app = initializeApp(config);
|
|
324
|
+
* console.log(app.options.databaseURL === config.databaseURL); // true
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
readonly options: FirebaseOptions;
|
|
328
|
+
/**
|
|
329
|
+
* The settable config flag for GDPR opt-in/opt-out
|
|
330
|
+
*/
|
|
331
|
+
automaticDataCollectionEnabled: boolean;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* @public
|
|
335
|
+
*
|
|
336
|
+
* Firebase configuration object. Contains a set of parameters required by
|
|
337
|
+
* services in order to successfully communicate with Firebase server APIs
|
|
338
|
+
* and to associate client data with your Firebase project and
|
|
339
|
+
* Firebase application. Typically this object is populated by the Firebase
|
|
340
|
+
* console at project setup. See also:
|
|
341
|
+
* {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
|
|
342
|
+
*/
|
|
343
|
+
interface FirebaseOptions {
|
|
344
|
+
/**
|
|
345
|
+
* An encrypted string used when calling certain APIs that don't need to
|
|
346
|
+
* access private user data
|
|
347
|
+
* (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
|
|
348
|
+
*/
|
|
349
|
+
apiKey?: string;
|
|
350
|
+
/**
|
|
351
|
+
* Auth domain for the project ID.
|
|
352
|
+
*/
|
|
353
|
+
authDomain?: string;
|
|
354
|
+
/**
|
|
355
|
+
* Default Realtime Database URL.
|
|
356
|
+
*/
|
|
357
|
+
databaseURL?: string;
|
|
358
|
+
/**
|
|
359
|
+
* The unique identifier for the project across all of Firebase and
|
|
360
|
+
* Google Cloud.
|
|
361
|
+
*/
|
|
362
|
+
projectId?: string;
|
|
363
|
+
/**
|
|
364
|
+
* The default Cloud Storage bucket name.
|
|
365
|
+
*/
|
|
366
|
+
storageBucket?: string;
|
|
367
|
+
/**
|
|
368
|
+
* Unique numerical value used to identify each sender that can send
|
|
369
|
+
* Firebase Cloud Messaging messages to client apps.
|
|
370
|
+
*/
|
|
371
|
+
messagingSenderId?: string;
|
|
372
|
+
/**
|
|
373
|
+
* Unique identifier for the app.
|
|
374
|
+
*/
|
|
375
|
+
appId?: string;
|
|
376
|
+
/**
|
|
377
|
+
* An ID automatically created when you enable Analytics in your
|
|
378
|
+
* Firebase project and register a web app. In versions 7.20.0
|
|
379
|
+
* and higher, this parameter is optional.
|
|
380
|
+
*/
|
|
381
|
+
measurementId?: string;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* @public
|
|
385
|
+
*
|
|
386
|
+
* Configuration options given to {@link (initializeApp:1) | initializeApp()}
|
|
387
|
+
*/
|
|
388
|
+
interface FirebaseAppSettings {
|
|
389
|
+
/**
|
|
390
|
+
* custom name for the Firebase App.
|
|
391
|
+
* The default value is `"[DEFAULT]"`.
|
|
392
|
+
*/
|
|
393
|
+
name?: string;
|
|
394
|
+
/**
|
|
395
|
+
* The settable config flag for GDPR opt-in/opt-out
|
|
396
|
+
*/
|
|
397
|
+
automaticDataCollectionEnabled?: boolean;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @internal
|
|
401
|
+
*/
|
|
402
|
+
interface _FirebaseService {
|
|
403
|
+
app: FirebaseApp;
|
|
404
|
+
/**
|
|
405
|
+
* Delete the service and free it's resources - called from
|
|
406
|
+
* {@link @firebase/app#deleteApp | deleteApp()}
|
|
407
|
+
*/
|
|
408
|
+
_delete(): Promise<void>;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @internal
|
|
412
|
+
*/
|
|
413
|
+
interface _FirebaseAppInternal extends FirebaseApp {
|
|
414
|
+
container: ComponentContainer;
|
|
415
|
+
isDeleted: boolean;
|
|
416
|
+
checkDestroyed(): void;
|
|
417
|
+
}
|
|
418
|
+
declare module '@firebase/component' {
|
|
419
|
+
interface NameServiceMapping {
|
|
420
|
+
'app': FirebaseApp;
|
|
421
|
+
'app-version': VersionService;
|
|
422
|
+
'heartbeat': HeartbeatService;
|
|
423
|
+
'platform-logger': PlatformLoggerService;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @license
|
|
429
|
+
* Copyright 2017 Google LLC
|
|
430
|
+
*
|
|
431
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
432
|
+
* you may not use this file except in compliance with the License.
|
|
433
|
+
* You may obtain a copy of the License at
|
|
434
|
+
*
|
|
435
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
436
|
+
*
|
|
437
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
438
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
439
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
440
|
+
* See the License for the specific language governing permissions and
|
|
441
|
+
* limitations under the License.
|
|
442
|
+
*/
|
|
443
|
+
declare type LogLevelString = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'silent';
|
|
444
|
+
interface LogOptions {
|
|
445
|
+
level: LogLevelString;
|
|
446
|
+
}
|
|
447
|
+
declare type LogCallback = (callbackParams: LogCallbackParams) => void;
|
|
448
|
+
interface LogCallbackParams {
|
|
449
|
+
level: LogLevelString;
|
|
450
|
+
message: string;
|
|
451
|
+
args: unknown[];
|
|
452
|
+
type: string;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* An object that can be injected into the environment as __FIREBASE_DEFAULTS__,
|
|
457
|
+
* either as a property of globalThis, a shell environment variable, or a
|
|
458
|
+
* cookie.
|
|
459
|
+
*
|
|
460
|
+
* This object can be used to automatically configure and initialize
|
|
461
|
+
* a Firebase app as well as any emulators.
|
|
462
|
+
*
|
|
463
|
+
* @public
|
|
464
|
+
*/
|
|
465
|
+
interface FirebaseDefaults {
|
|
466
|
+
config?: Record<string, string>;
|
|
467
|
+
emulatorHosts?: Record<string, string>;
|
|
468
|
+
_authTokenSyncURL?: string;
|
|
469
|
+
_authIdTokenMaxAge?: number;
|
|
470
|
+
/**
|
|
471
|
+
* Override Firebase's runtime environment detection and
|
|
472
|
+
* force the SDK to act as if it were in the specified environment.
|
|
473
|
+
*/
|
|
474
|
+
forceEnvironment?: 'browser' | 'node';
|
|
475
|
+
[key: string]: unknown;
|
|
476
|
+
}
|
|
477
|
+
declare global {
|
|
478
|
+
var __FIREBASE_DEFAULTS__: FirebaseDefaults | undefined;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare class FirebaseError extends Error {
|
|
482
|
+
/** The error code for this error. */
|
|
483
|
+
readonly code: string;
|
|
484
|
+
/** Custom data for this error. */
|
|
485
|
+
customData?: Record<string, unknown> | undefined;
|
|
486
|
+
/** The custom name for all FirebaseErrors. */
|
|
487
|
+
readonly name: string;
|
|
488
|
+
constructor(
|
|
489
|
+
/** The error code for this error. */
|
|
490
|
+
code: string, message: string,
|
|
491
|
+
/** Custom data for this error. */
|
|
492
|
+
customData?: Record<string, unknown> | undefined);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* @license
|
|
497
|
+
* Copyright 2019 Google LLC
|
|
498
|
+
*
|
|
499
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
500
|
+
* you may not use this file except in compliance with the License.
|
|
501
|
+
* You may obtain a copy of the License at
|
|
502
|
+
*
|
|
503
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
504
|
+
*
|
|
505
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
506
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
507
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
508
|
+
* See the License for the specific language governing permissions and
|
|
509
|
+
* limitations under the License.
|
|
510
|
+
*/
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* The current SDK version.
|
|
514
|
+
*
|
|
515
|
+
* @public
|
|
516
|
+
*/
|
|
517
|
+
declare const SDK_VERSION: string;
|
|
518
|
+
/**
|
|
519
|
+
* Creates and initializes a {@link @firebase/app#FirebaseApp} instance.
|
|
520
|
+
*
|
|
521
|
+
* See
|
|
522
|
+
* {@link
|
|
523
|
+
* https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
|
|
524
|
+
* | Add Firebase to your app} and
|
|
525
|
+
* {@link
|
|
526
|
+
* https://firebase.google.com/docs/web/setup#multiple-projects
|
|
527
|
+
* | Initialize multiple projects} for detailed documentation.
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```javascript
|
|
531
|
+
*
|
|
532
|
+
* // Initialize default app
|
|
533
|
+
* // Retrieve your own options values by adding a web app on
|
|
534
|
+
* // https://console.firebase.google.com
|
|
535
|
+
* initializeApp({
|
|
536
|
+
* apiKey: "AIza....", // Auth / General Use
|
|
537
|
+
* authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
|
|
538
|
+
* databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
|
|
539
|
+
* storageBucket: "YOUR_APP.appspot.com", // Storage
|
|
540
|
+
* messagingSenderId: "123456789" // Cloud Messaging
|
|
541
|
+
* });
|
|
542
|
+
* ```
|
|
543
|
+
*
|
|
544
|
+
* @example
|
|
545
|
+
* ```javascript
|
|
546
|
+
*
|
|
547
|
+
* // Initialize another app
|
|
548
|
+
* const otherApp = initializeApp({
|
|
549
|
+
* databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
|
|
550
|
+
* storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
|
|
551
|
+
* }, "otherApp");
|
|
552
|
+
* ```
|
|
553
|
+
*
|
|
554
|
+
* @param options - Options to configure the app's services.
|
|
555
|
+
* @param name - Optional name of the app to initialize. If no name
|
|
556
|
+
* is provided, the default is `"[DEFAULT]"`.
|
|
557
|
+
*
|
|
558
|
+
* @returns The initialized app.
|
|
559
|
+
*
|
|
560
|
+
* @public
|
|
561
|
+
*/
|
|
562
|
+
declare function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
|
|
563
|
+
/**
|
|
564
|
+
* Creates and initializes a FirebaseApp instance.
|
|
565
|
+
*
|
|
566
|
+
* @param options - Options to configure the app's services.
|
|
567
|
+
* @param config - FirebaseApp Configuration
|
|
568
|
+
*
|
|
569
|
+
* @public
|
|
570
|
+
*/
|
|
571
|
+
declare function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
|
|
572
|
+
/**
|
|
573
|
+
* Creates and initializes a FirebaseApp instance.
|
|
574
|
+
*
|
|
575
|
+
* @public
|
|
576
|
+
*/
|
|
577
|
+
declare function initializeApp(): FirebaseApp;
|
|
578
|
+
/**
|
|
579
|
+
* Retrieves a {@link @firebase/app#FirebaseApp} instance.
|
|
580
|
+
*
|
|
581
|
+
* When called with no arguments, the default app is returned. When an app name
|
|
582
|
+
* is provided, the app corresponding to that name is returned.
|
|
583
|
+
*
|
|
584
|
+
* An exception is thrown if the app being retrieved has not yet been
|
|
585
|
+
* initialized.
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
* ```javascript
|
|
589
|
+
* // Return the default app
|
|
590
|
+
* const app = getApp();
|
|
591
|
+
* ```
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* ```javascript
|
|
595
|
+
* // Return a named app
|
|
596
|
+
* const otherApp = getApp("otherApp");
|
|
597
|
+
* ```
|
|
598
|
+
*
|
|
599
|
+
* @param name - Optional name of the app to return. If no name is
|
|
600
|
+
* provided, the default is `"[DEFAULT]"`.
|
|
601
|
+
*
|
|
602
|
+
* @returns The app corresponding to the provided app name.
|
|
603
|
+
* If no app name is provided, the default app is returned.
|
|
604
|
+
*
|
|
605
|
+
* @public
|
|
606
|
+
*/
|
|
607
|
+
declare function getApp(name?: string): FirebaseApp;
|
|
608
|
+
/**
|
|
609
|
+
* A (read-only) array of all initialized apps.
|
|
610
|
+
* @public
|
|
611
|
+
*/
|
|
612
|
+
declare function getApps(): FirebaseApp[];
|
|
613
|
+
/**
|
|
614
|
+
* Renders this app unusable and frees the resources of all associated
|
|
615
|
+
* services.
|
|
616
|
+
*
|
|
617
|
+
* @example
|
|
618
|
+
* ```javascript
|
|
619
|
+
* deleteApp(app)
|
|
620
|
+
* .then(function() {
|
|
621
|
+
* console.log("App deleted successfully");
|
|
622
|
+
* })
|
|
623
|
+
* .catch(function(error) {
|
|
624
|
+
* console.log("Error deleting app:", error);
|
|
625
|
+
* });
|
|
626
|
+
* ```
|
|
627
|
+
*
|
|
628
|
+
* @public
|
|
629
|
+
*/
|
|
630
|
+
declare function deleteApp(app: FirebaseApp): Promise<void>;
|
|
631
|
+
/**
|
|
632
|
+
* Registers a library's name and version for platform logging purposes.
|
|
633
|
+
* @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
|
|
634
|
+
* @param version - Current version of that library.
|
|
635
|
+
* @param variant - Bundle variant, e.g., node, rn, etc.
|
|
636
|
+
*
|
|
637
|
+
* @public
|
|
638
|
+
*/
|
|
639
|
+
declare function registerVersion(libraryKeyOrName: string, version: string, variant?: string): void;
|
|
640
|
+
/**
|
|
641
|
+
* Sets log handler for all Firebase SDKs.
|
|
642
|
+
* @param logCallback - An optional custom log handler that executes user code whenever
|
|
643
|
+
* the Firebase SDK makes a logging call.
|
|
644
|
+
*
|
|
645
|
+
* @public
|
|
646
|
+
*/
|
|
647
|
+
declare function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
|
|
648
|
+
/**
|
|
649
|
+
* Sets log level for all Firebase SDKs.
|
|
650
|
+
*
|
|
651
|
+
* All of the log types above the current log level are captured (i.e. if
|
|
652
|
+
* you set the log level to `info`, errors are logged, but `debug` and
|
|
653
|
+
* `verbose` logs are not).
|
|
654
|
+
*
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
declare function setLogLevel(logLevel: LogLevelString): void;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* @license
|
|
661
|
+
* Copyright 2019 Google LLC
|
|
662
|
+
*
|
|
663
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
664
|
+
* you may not use this file except in compliance with the License.
|
|
665
|
+
* You may obtain a copy of the License at
|
|
666
|
+
*
|
|
667
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
668
|
+
*
|
|
669
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
670
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
671
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
672
|
+
* See the License for the specific language governing permissions and
|
|
673
|
+
* limitations under the License.
|
|
674
|
+
*/
|
|
675
|
+
/**
|
|
676
|
+
* The default app name
|
|
677
|
+
*
|
|
678
|
+
* @internal
|
|
679
|
+
*/
|
|
680
|
+
declare const DEFAULT_ENTRY_NAME = "[DEFAULT]";
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* @license
|
|
684
|
+
* Copyright 2019 Google LLC
|
|
685
|
+
*
|
|
686
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
687
|
+
* you may not use this file except in compliance with the License.
|
|
688
|
+
* You may obtain a copy of the License at
|
|
689
|
+
*
|
|
690
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
691
|
+
*
|
|
692
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
693
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
694
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
695
|
+
* See the License for the specific language governing permissions and
|
|
696
|
+
* limitations under the License.
|
|
697
|
+
*/
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* @internal
|
|
701
|
+
*/
|
|
702
|
+
declare const _apps: Map<string, FirebaseApp>;
|
|
703
|
+
/**
|
|
704
|
+
* Registered components.
|
|
705
|
+
*
|
|
706
|
+
* @internal
|
|
707
|
+
*/
|
|
708
|
+
declare const _components: Map<string, Component<any>>;
|
|
709
|
+
/**
|
|
710
|
+
* @param component - the component being added to this app's container
|
|
711
|
+
*
|
|
712
|
+
* @internal
|
|
713
|
+
*/
|
|
714
|
+
declare function _addComponent<T extends Name>(app: FirebaseApp, component: Component<T>): void;
|
|
715
|
+
/**
|
|
716
|
+
*
|
|
717
|
+
* @internal
|
|
718
|
+
*/
|
|
719
|
+
declare function _addOrOverwriteComponent(app: FirebaseApp, component: Component): void;
|
|
720
|
+
/**
|
|
721
|
+
*
|
|
722
|
+
* @param component - the component to register
|
|
723
|
+
* @returns whether or not the component is registered successfully
|
|
724
|
+
*
|
|
725
|
+
* @internal
|
|
726
|
+
*/
|
|
727
|
+
declare function _registerComponent<T extends Name>(component: Component<T>): boolean;
|
|
728
|
+
/**
|
|
729
|
+
*
|
|
730
|
+
* @param app - FirebaseApp instance
|
|
731
|
+
* @param name - service name
|
|
732
|
+
*
|
|
733
|
+
* @returns the provider for the service with the matching name
|
|
734
|
+
*
|
|
735
|
+
* @internal
|
|
736
|
+
*/
|
|
737
|
+
declare function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provider<T>;
|
|
738
|
+
/**
|
|
739
|
+
*
|
|
740
|
+
* @param app - FirebaseApp instance
|
|
741
|
+
* @param name - service name
|
|
742
|
+
* @param instanceIdentifier - service instance identifier in case the service supports multiple instances
|
|
743
|
+
*
|
|
744
|
+
* @internal
|
|
745
|
+
*/
|
|
746
|
+
declare function _removeServiceInstance<T extends Name>(app: FirebaseApp, name: T, instanceIdentifier?: string): void;
|
|
747
|
+
/**
|
|
748
|
+
* Test only
|
|
749
|
+
*
|
|
750
|
+
* @internal
|
|
751
|
+
*/
|
|
752
|
+
declare function _clearComponents(): void;
|
|
753
|
+
|
|
754
|
+
export { FirebaseApp, FirebaseAppSettings, FirebaseError, FirebaseOptions, SDK_VERSION, DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME, _FirebaseAppInternal, _FirebaseService, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _registerComponent, _removeServiceInstance, deleteApp, getApp, getApps, initializeApp, onLog, registerVersion, setLogLevel };
|
|
@@ -58,7 +58,7 @@ function isVersionServiceProvider(provider) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
const name$o = "@firebase/app";
|
|
61
|
-
const version$1 = "0.9.
|
|
61
|
+
const version$1 = "0.9.14";
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* @license
|
|
@@ -125,7 +125,7 @@ const name$2 = "@firebase/firestore";
|
|
|
125
125
|
const name$1 = "@firebase/firestore-compat";
|
|
126
126
|
|
|
127
127
|
const name = "firebase";
|
|
128
|
-
const version = "
|
|
128
|
+
const version = "10.0.0";
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* @license
|
package/dist/esm/index.esm5.js
CHANGED
|
@@ -60,7 +60,7 @@ function isVersionServiceProvider(provider) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
var name$o = "@firebase/app";
|
|
63
|
-
var version$1 = "0.9.
|
|
63
|
+
var version$1 = "0.9.14";
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* @license
|
|
@@ -127,7 +127,7 @@ var name$2 = "@firebase/firestore";
|
|
|
127
127
|
var name$1 = "@firebase/firestore-compat";
|
|
128
128
|
|
|
129
129
|
var name = "firebase";
|
|
130
|
-
var version = "
|
|
130
|
+
var version = "10.0.0";
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* @license
|
package/dist/index.cjs.js
CHANGED
|
@@ -63,7 +63,7 @@ function isVersionServiceProvider(provider) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
var name$o = "@firebase/app";
|
|
66
|
-
var version$1 = "0.9.
|
|
66
|
+
var version$1 = "0.9.14";
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* @license
|
|
@@ -130,7 +130,7 @@ var name$2 = "@firebase/firestore";
|
|
|
130
130
|
var name$1 = "@firebase/firestore-compat";
|
|
131
131
|
|
|
132
132
|
var name = "firebase";
|
|
133
|
-
var version = "
|
|
133
|
+
var version = "10.0.0";
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
* @license
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/app",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.14",
|
|
4
4
|
"description": "The primary entrypoint to the Firebase JS SDK",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"rollup": "2.79.1",
|
|
51
51
|
"rollup-plugin-replace": "2.2.0",
|
|
52
52
|
"rollup-plugin-typescript2": "0.31.2",
|
|
53
|
+
"rollup-plugin-dts": "5.3.0",
|
|
53
54
|
"typescript": "4.7.4"
|
|
54
55
|
},
|
|
55
56
|
"repository": {
|