UNPKG

2.31 kBTypeScriptView Raw
1/*! firebase-admin v10.0.0 */
2/*!
3 * @license
4 * Copyright 2021 Google Inc.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18import { App, AppOptions } from './core';
19export declare class AppStore {
20 private readonly appStore;
21 initializeApp(options?: AppOptions, appName?: string): App;
22 getApp(appName?: string): App;
23 getApps(): App[];
24 deleteApp(app: App): Promise<void>;
25 clearAllApps(): Promise<void>;
26 /**
27 * Removes the specified App instance from the store. This is currently called by the
28 * {@link FirebaseApp.delete} method. Can be removed once the app deletion is handled
29 * entirely by the {@link deleteApp} top-level function.
30 */
31 removeApp(appName: string): void;
32}
33export declare const defaultAppStore: AppStore;
34export declare function initializeApp(options?: AppOptions, appName?: string): App;
35export declare function getApp(appName?: string): App;
36export declare function getApps(): App[];
37/**
38 * Renders this given `App` unusable and frees the resources of
39 * all associated services (though it does *not* clean up any backend
40 * resources). When running the SDK locally, this method
41 * must be called to ensure graceful termination of the process.
42 *
43 * @example
44 * ```javascript
45 * deleteApp(app)
46 * .then(function() {
47 * console.log("App deleted successfully");
48 * })
49 * .catch(function(error) {
50 * console.log("Error deleting app:", error);
51 * });
52 * ```
53 */
54export declare function deleteApp(app: App): Promise<void>;
55/**
56 * Constant holding the environment variable name with the default config.
57 * If the environment variable contains a string that starts with '{' it will be parsed as JSON,
58 * otherwise it will be assumed to be pointing to a file.
59 */
60export declare const FIREBASE_CONFIG_VAR = "FIREBASE_CONFIG";