@depup/firebase__app 0.14.9-depup.0

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.
Files changed (44) hide show
  1. package/README.md +32 -0
  2. package/changes.json +14 -0
  3. package/dist/app/src/api.d.ts +235 -0
  4. package/dist/app/src/constants.d.ts +26 -0
  5. package/dist/app/src/errors.d.ts +67 -0
  6. package/dist/app/src/firebaseApp.d.ts +46 -0
  7. package/dist/app/src/firebaseServerApp.d.ts +36 -0
  8. package/dist/app/src/global_index.d.ts +939 -0
  9. package/dist/app/src/heartbeatService.d.ts +89 -0
  10. package/dist/app/src/index.d.ts +9 -0
  11. package/dist/app/src/indexeddb.d.ts +20 -0
  12. package/dist/app/src/internal.d.ts +108 -0
  13. package/dist/app/src/logger.d.ts +18 -0
  14. package/dist/app/src/platformLoggerService.d.ts +23 -0
  15. package/dist/app/src/public-types.d.ts +241 -0
  16. package/dist/app/src/registerCoreComponents.d.ts +17 -0
  17. package/dist/app/src/tsdoc-metadata.json +11 -0
  18. package/dist/app/src/types.d.ts +55 -0
  19. package/dist/app/test/setup.d.ts +17 -0
  20. package/dist/app/test/util.d.ts +26 -0
  21. package/dist/app-public.d.ts +477 -0
  22. package/dist/app.d.ts +572 -0
  23. package/dist/esm/app/src/api.d.ts +235 -0
  24. package/dist/esm/app/src/constants.d.ts +26 -0
  25. package/dist/esm/app/src/errors.d.ts +67 -0
  26. package/dist/esm/app/src/firebaseApp.d.ts +46 -0
  27. package/dist/esm/app/src/firebaseServerApp.d.ts +36 -0
  28. package/dist/esm/app/src/heartbeatService.d.ts +89 -0
  29. package/dist/esm/app/src/index.d.ts +9 -0
  30. package/dist/esm/app/src/indexeddb.d.ts +20 -0
  31. package/dist/esm/app/src/internal.d.ts +108 -0
  32. package/dist/esm/app/src/logger.d.ts +18 -0
  33. package/dist/esm/app/src/platformLoggerService.d.ts +23 -0
  34. package/dist/esm/app/src/public-types.d.ts +241 -0
  35. package/dist/esm/app/src/registerCoreComponents.d.ts +17 -0
  36. package/dist/esm/app/src/types.d.ts +55 -0
  37. package/dist/esm/app/test/setup.d.ts +17 -0
  38. package/dist/esm/app/test/util.d.ts +26 -0
  39. package/dist/esm/index.esm.js +1237 -0
  40. package/dist/esm/index.esm.js.map +1 -0
  41. package/dist/esm/package.json +1 -0
  42. package/dist/index.cjs.js +1265 -0
  43. package/dist/index.cjs.js.map +1 -0
  44. package/package.json +100 -0
@@ -0,0 +1,477 @@
1
+ /**
2
+ * Firebase App
3
+ *
4
+ * @remarks This package coordinates the communication between the different Firebase components
5
+ * @packageDocumentation
6
+ */
7
+
8
+ import { Component } from '@firebase/component';
9
+ import { ComponentContainer } from '@firebase/component';
10
+ import { FirebaseError } from '@firebase/util';
11
+ import { LogCallback } from '@firebase/logger';
12
+ import { LogLevelString } from '@firebase/logger';
13
+ import { LogOptions } from '@firebase/logger';
14
+ import { Name } from '@firebase/component';
15
+ import { Provider } from '@firebase/component';
16
+
17
+ /* Excluded from this release type: _addComponent */
18
+
19
+ /* Excluded from this release type: _addOrOverwriteComponent */
20
+
21
+ /* Excluded from this release type: _apps */
22
+
23
+ /* Excluded from this release type: _clearComponents */
24
+
25
+ /* Excluded from this release type: _components */
26
+
27
+ /* Excluded from this release type: _DEFAULT_ENTRY_NAME */
28
+
29
+ /**
30
+ * Renders this app unusable and frees the resources of all associated
31
+ * services.
32
+ *
33
+ * @example
34
+ * ```javascript
35
+ * deleteApp(app)
36
+ * .then(function() {
37
+ * console.log("App deleted successfully");
38
+ * })
39
+ * .catch(function(error) {
40
+ * console.log("Error deleting app:", error);
41
+ * });
42
+ * ```
43
+ *
44
+ * @public
45
+ */
46
+ export declare function deleteApp(app: FirebaseApp): Promise<void>;
47
+
48
+ /**
49
+ * A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
50
+ * services.
51
+ *
52
+ * Do not call this constructor directly. Instead, use
53
+ * {@link (initializeApp:1) | initializeApp()} to create an app.
54
+ *
55
+ * @public
56
+ */
57
+ export declare interface FirebaseApp {
58
+ /**
59
+ * The (read-only) name for this app.
60
+ *
61
+ * The default app's name is `"[DEFAULT]"`.
62
+ *
63
+ * @example
64
+ * ```javascript
65
+ * // The default app's name is "[DEFAULT]"
66
+ * const app = initializeApp(defaultAppConfig);
67
+ * console.log(app.name); // "[DEFAULT]"
68
+ * ```
69
+ *
70
+ * @example
71
+ * ```javascript
72
+ * // A named app's name is what you provide to initializeApp()
73
+ * const otherApp = initializeApp(otherAppConfig, "other");
74
+ * console.log(otherApp.name); // "other"
75
+ * ```
76
+ */
77
+ readonly name: string;
78
+ /**
79
+ * The (read-only) configuration options for this app. These are the original
80
+ * parameters given in {@link (initializeApp:1) | initializeApp()}.
81
+ *
82
+ * @example
83
+ * ```javascript
84
+ * const app = initializeApp(config);
85
+ * console.log(app.options.databaseURL === config.databaseURL); // true
86
+ * ```
87
+ */
88
+ readonly options: FirebaseOptions;
89
+ /**
90
+ * The settable config flag for GDPR opt-in/opt-out
91
+ */
92
+ automaticDataCollectionEnabled: boolean;
93
+ }
94
+
95
+ /* Excluded from this release type: _FirebaseAppInternal */
96
+
97
+ /**
98
+ * @public
99
+ *
100
+ * Configuration options given to {@link (initializeApp:1) | initializeApp()}
101
+ */
102
+ export declare interface FirebaseAppSettings {
103
+ /**
104
+ * custom name for the Firebase App.
105
+ * The default value is `"[DEFAULT]"`.
106
+ */
107
+ name?: string;
108
+ /**
109
+ * The settable config flag for GDPR opt-in/opt-out. Defaults to true.
110
+ */
111
+ automaticDataCollectionEnabled?: boolean;
112
+ }
113
+ export { FirebaseError }
114
+
115
+ /**
116
+ * @public
117
+ *
118
+ * Firebase configuration object. Contains a set of parameters required by
119
+ * services in order to successfully communicate with Firebase server APIs
120
+ * and to associate client data with your Firebase project and
121
+ * Firebase application. Typically this object is populated by the Firebase
122
+ * console at project setup. See also:
123
+ * {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
124
+ */
125
+ export declare interface FirebaseOptions {
126
+ /**
127
+ * An encrypted string used when calling certain APIs that don't need to
128
+ * access private user data
129
+ * (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
130
+ */
131
+ apiKey?: string;
132
+ /**
133
+ * Auth domain for the project ID.
134
+ */
135
+ authDomain?: string;
136
+ /**
137
+ * Default Realtime Database URL.
138
+ */
139
+ databaseURL?: string;
140
+ /**
141
+ * The unique identifier for the project across all of Firebase and
142
+ * Google Cloud.
143
+ */
144
+ projectId?: string;
145
+ /**
146
+ * The default Cloud Storage bucket name.
147
+ */
148
+ storageBucket?: string;
149
+ /**
150
+ * Unique numerical value used to identify each sender that can send
151
+ * Firebase Cloud Messaging messages to client apps.
152
+ */
153
+ messagingSenderId?: string;
154
+ /**
155
+ * Unique identifier for the app.
156
+ */
157
+ appId?: string;
158
+ /**
159
+ * An ID automatically created when you enable Analytics in your
160
+ * Firebase project and register a web app. In versions 7.20.0
161
+ * and higher, this parameter is optional.
162
+ */
163
+ measurementId?: string;
164
+ }
165
+
166
+ /**
167
+ * A {@link @firebase/app#FirebaseServerApp} holds the initialization information
168
+ * for a collection of services running in server environments.
169
+ *
170
+ * Do not call this constructor directly. Instead, use
171
+ * {@link (initializeServerApp:1) | initializeServerApp()} to create
172
+ * an app.
173
+ *
174
+ * @public
175
+ */
176
+ export declare interface FirebaseServerApp extends FirebaseApp {
177
+ /**
178
+ * There is no `getApp()` operation for `FirebaseServerApp`, so the name is not relevant for
179
+ * applications. However, it may be used internally, and is declared here so that
180
+ * `FirebaseServerApp` conforms to the `FirebaseApp` interface.
181
+ */
182
+ name: string;
183
+ /**
184
+ * The (read-only) configuration settings for this server app. These are the original
185
+ * parameters given in {@link (initializeServerApp:1) | initializeServerApp()}.
186
+ *
187
+ * @example
188
+ * ```javascript
189
+ * const app = initializeServerApp(settings);
190
+ * console.log(app.settings.authIdToken === options.authIdToken); // true
191
+ * ```
192
+ */
193
+ readonly settings: FirebaseServerAppSettings;
194
+ }
195
+
196
+ /**
197
+ * @public
198
+ *
199
+ * Configuration options given to {@link (initializeServerApp:1) | initializeServerApp()}
200
+ */
201
+ export declare interface FirebaseServerAppSettings extends Omit<FirebaseAppSettings, 'name'> {
202
+ /**
203
+ * An optional Auth ID token used to resume a signed in user session from a client
204
+ * runtime environment.
205
+ *
206
+ * Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken`
207
+ * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token
208
+ * needs to have been recently minted for this operation to succeed.
209
+ *
210
+ * If the token fails local verification due to expiration or parsing errors, then a console error
211
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
212
+ *
213
+ * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an
214
+ * warning is logged to the console and the Auth SDK will not sign in a user on initialization.
215
+ *
216
+ * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback
217
+ * is invoked with the `User` object as per standard Auth flows. However, `User` objects
218
+ * created via an `authIdToken` do not have a refresh token. Attempted `refreshToken`
219
+ * operations fail.
220
+ */
221
+ authIdToken?: string;
222
+ /**
223
+ * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize
224
+ * this App Check token in place of requiring an instance of App Check to be initialized.
225
+ *
226
+ * If the token fails local verification due to expiration or parsing errors, then a console error
227
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
228
+ */
229
+ appCheckToken?: string;
230
+ /**
231
+ * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry`
232
+ * object to monitor the garbage collection status of the provided object. The
233
+ * Firebase SDK releases its reference on the `FirebaseServerApp` instance when the
234
+ * provided `releaseOnDeref` object is garbage collected.
235
+ *
236
+ * You can use this field to reduce memory management overhead for your application.
237
+ * If provided, an app running in a SSR pass does not need to perform
238
+ * `FirebaseServerApp` cleanup, so long as the reference object is deleted (by falling out of
239
+ * SSR scope, for instance.)
240
+ *
241
+ * If an object is not provided then the application must clean up the `FirebaseServerApp`
242
+ * instance by invoking `deleteApp`.
243
+ *
244
+ * If the application provides an object in this parameter, but the application is
245
+ * executed in a JavaScript engine that predates the support of `FinalizationRegistry`
246
+ * (introduced in node v14.6.0, for instance), then an error is thrown at `FirebaseServerApp`
247
+ * initialization.
248
+ */
249
+ releaseOnDeref?: object;
250
+ }
251
+
252
+ /* Excluded from this release type: _FirebaseService */
253
+
254
+ /**
255
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
256
+ *
257
+ * When called with no arguments, the default app is returned. When an app name
258
+ * is provided, the app corresponding to that name is returned.
259
+ *
260
+ * An exception is thrown if the app being retrieved has not yet been
261
+ * initialized.
262
+ *
263
+ * @example
264
+ * ```javascript
265
+ * // Return the default app
266
+ * const app = getApp();
267
+ * ```
268
+ *
269
+ * @example
270
+ * ```javascript
271
+ * // Return a named app
272
+ * const otherApp = getApp("otherApp");
273
+ * ```
274
+ *
275
+ * @param name - Optional name of the app to return. If no name is
276
+ * provided, the default is `"[DEFAULT]"`.
277
+ *
278
+ * @returns The app corresponding to the provided app name.
279
+ * If no app name is provided, the default app is returned.
280
+ *
281
+ * @public
282
+ */
283
+ export declare function getApp(name?: string): FirebaseApp;
284
+
285
+ /**
286
+ * A (read-only) array of all initialized apps.
287
+ * @public
288
+ */
289
+ export declare function getApps(): FirebaseApp[];
290
+
291
+ /* Excluded from this release type: _getProvider */
292
+
293
+ /**
294
+ * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.
295
+ *
296
+ * See
297
+ * {@link
298
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
299
+ * | Add Firebase to your app} and
300
+ * {@link
301
+ * https://firebase.google.com/docs/web/setup#multiple-projects
302
+ * | Initialize multiple projects} for detailed documentation.
303
+ *
304
+ * @example
305
+ * ```javascript
306
+ *
307
+ * // Initialize default app
308
+ * // Retrieve your own options values by adding a web app on
309
+ * // https://console.firebase.google.com
310
+ * initializeApp({
311
+ * apiKey: "AIza....", // Auth / General Use
312
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
313
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
314
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
315
+ * messagingSenderId: "123456789" // Cloud Messaging
316
+ * });
317
+ * ```
318
+ *
319
+ * @example
320
+ * ```javascript
321
+ *
322
+ * // Initialize another app
323
+ * const otherApp = initializeApp({
324
+ * databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
325
+ * storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
326
+ * }, "otherApp");
327
+ * ```
328
+ *
329
+ * @param options - Options to configure the app's services.
330
+ * @param name - Optional name of the app to initialize. If no name
331
+ * is provided, the default is `"[DEFAULT]"`.
332
+ *
333
+ * @returns The initialized app.
334
+ *
335
+ * @throws If the optional `name` parameter is malformed or empty.
336
+ *
337
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
338
+ *
339
+ * @public
340
+ */
341
+ export declare function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
342
+
343
+ /**
344
+ * Creates and initializes a FirebaseApp instance.
345
+ *
346
+ * @param options - Options to configure the app's services.
347
+ * @param config - FirebaseApp Configuration
348
+ *
349
+ * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.
350
+ *
351
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
352
+ * @public
353
+ */
354
+ export declare function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
355
+
356
+ /**
357
+ * Creates and initializes a FirebaseApp instance.
358
+ *
359
+ * @public
360
+ */
361
+ export declare function initializeApp(): FirebaseApp;
362
+
363
+ /**
364
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
365
+ *
366
+ * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in
367
+ * server side rendering environments only. Initialization will fail if invoked from a
368
+ * browser environment.
369
+ *
370
+ * See
371
+ * {@link
372
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
373
+ * | Add Firebase to your app} and
374
+ * {@link
375
+ * https://firebase.google.com/docs/web/setup#multiple-projects
376
+ * | Initialize multiple projects} for detailed documentation.
377
+ *
378
+ * @example
379
+ * ```javascript
380
+ *
381
+ * // Initialize an instance of `FirebaseServerApp`.
382
+ * // Retrieve your own options values by adding a web app on
383
+ * // https://console.firebase.google.com
384
+ * initializeServerApp({
385
+ * apiKey: "AIza....", // Auth / General Use
386
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
387
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
388
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
389
+ * messagingSenderId: "123456789" // Cloud Messaging
390
+ * },
391
+ * {
392
+ * authIdToken: "Your Auth ID Token"
393
+ * });
394
+ * ```
395
+ *
396
+ * @param options - `Firebase.AppOptions` to configure the app's services, or a
397
+ * a `FirebaseApp` instance which contains the `AppOptions` within.
398
+ * @param config - Optional `FirebaseServerApp` settings.
399
+ *
400
+ * @returns The initialized `FirebaseServerApp`.
401
+ *
402
+ * @throws If invoked in an unsupported non-server environment such as a browser.
403
+ *
404
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
405
+ * provide Finalization Registry support.
406
+ *
407
+ * @public
408
+ */
409
+ export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
410
+
411
+ /**
412
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
413
+ *
414
+ * @param config - Optional `FirebaseServerApp` settings.
415
+ *
416
+ * @returns The initialized `FirebaseServerApp`.
417
+ *
418
+ * @throws If invoked in an unsupported non-server environment such as a browser.
419
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
420
+ * provide Finalization Registry support.
421
+ * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project
422
+ * configuration required for auto-initialization.
423
+ *
424
+ * @public
425
+ */
426
+ export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
427
+
428
+ /* Excluded from this release type: _isFirebaseApp */
429
+
430
+ /* Excluded from this release type: _isFirebaseServerApp */
431
+
432
+ /* Excluded from this release type: _isFirebaseServerAppSettings */
433
+
434
+ /**
435
+ * Sets log handler for all Firebase SDKs.
436
+ * @param logCallback - An optional custom log handler that executes user code whenever
437
+ * the Firebase SDK makes a logging call.
438
+ *
439
+ * @public
440
+ */
441
+ export declare function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
442
+
443
+ /* Excluded from this release type: _registerComponent */
444
+
445
+ /**
446
+ * Registers a library's name and version for platform logging purposes.
447
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
448
+ * @param version - Current version of that library.
449
+ * @param variant - Bundle variant, e.g., node, rn, etc.
450
+ *
451
+ * @public
452
+ */
453
+ export declare function registerVersion(libraryKeyOrName: string, version: string, variant?: string): void;
454
+
455
+ /* Excluded from this release type: _removeServiceInstance */
456
+
457
+ /**
458
+ * The current SDK version.
459
+ *
460
+ * @public
461
+ */
462
+ export declare const SDK_VERSION: string;
463
+
464
+ /* Excluded from this release type: _serverApps */
465
+
466
+ /**
467
+ * Sets log level for all Firebase SDKs.
468
+ *
469
+ * All of the log types above the current log level are captured (i.e. if
470
+ * you set the log level to `info`, errors are logged, but `debug` and
471
+ * `verbose` logs are not).
472
+ *
473
+ * @public
474
+ */
475
+ export declare function setLogLevel(logLevel: LogLevelString): void;
476
+
477
+ export { }