1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | import { AppStore } from './lifecycle';
|
19 | import { app, appCheck, auth, messaging, machineLearning, storage, firestore, database, instanceId, installations, projectManagement, securityRules, remoteConfig, AppOptions } from '../firebase-namespace-api';
|
20 | import { cert, refreshToken, applicationDefault } from './credential-factory';
|
21 | import App = app.App;
|
22 | import AppCheck = appCheck.AppCheck;
|
23 | import Auth = auth.Auth;
|
24 | import Database = database.Database;
|
25 | import Firestore = firestore.Firestore;
|
26 | import Installations = installations.Installations;
|
27 | import InstanceId = instanceId.InstanceId;
|
28 | import MachineLearning = machineLearning.MachineLearning;
|
29 | import Messaging = messaging.Messaging;
|
30 | import ProjectManagement = projectManagement.ProjectManagement;
|
31 | import RemoteConfig = remoteConfig.RemoteConfig;
|
32 | import SecurityRules = securityRules.SecurityRules;
|
33 | import Storage = storage.Storage;
|
34 | export interface FirebaseServiceNamespace<T> {
|
35 | (app?: App): T;
|
36 | [key: string]: any;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | export declare class FirebaseNamespaceInternals {
|
42 | private readonly appStore;
|
43 | constructor(appStore: AppStore);
|
44 | /**
|
45 | * Initializes the App instance.
|
46 | *
|
47 | * @param options - Optional options for the App instance. If none present will try to initialize
|
48 | * from the FIREBASE_CONFIG environment variable. If the environment variable contains a string
|
49 | * that starts with '{' it will be parsed as JSON, otherwise it will be assumed to be pointing
|
50 | * to a file.
|
51 | * @param appName - Optional name of the FirebaseApp instance.
|
52 | *
|
53 | * @returns A new App instance.
|
54 | */
|
55 | initializeApp(options?: AppOptions, appName?: string): App;
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | app(appName?: string): App;
|
64 | get apps(): App[];
|
65 | }
|
66 |
|
67 |
|
68 |
|
69 | export declare class FirebaseNamespace {
|
70 | __esModule: boolean;
|
71 | credential: {
|
72 | cert: typeof cert;
|
73 | refreshToken: typeof refreshToken;
|
74 | applicationDefault: typeof applicationDefault;
|
75 | };
|
76 | SDK_VERSION: string;
|
77 | INTERNAL: FirebaseNamespaceInternals;
|
78 | Promise: any;
|
79 | constructor(appStore?: AppStore);
|
80 | /**
|
81 | * Gets the `Auth` service namespace. The returned namespace can be used to get the
|
82 | * `Auth` service for the default app or an explicitly specified app.
|
83 | */
|
84 | get auth(): FirebaseServiceNamespace<Auth>;
|
85 | /**
|
86 | * Gets the `Database` service namespace. The returned namespace can be used to get the
|
87 | * `Database` service for the default app or an explicitly specified app.
|
88 | */
|
89 | get database(): FirebaseServiceNamespace<Database>;
|
90 | /**
|
91 | * Gets the `Messaging` service namespace. The returned namespace can be used to get the
|
92 | * `Messaging` service for the default app or an explicitly specified app.
|
93 | */
|
94 | get messaging(): FirebaseServiceNamespace<Messaging>;
|
95 | /**
|
96 | * Gets the `Storage` service namespace. The returned namespace can be used to get the
|
97 | * `Storage` service for the default app or an explicitly specified app.
|
98 | */
|
99 | get storage(): FirebaseServiceNamespace<Storage>;
|
100 | /**
|
101 | * Gets the `Firestore` service namespace. The returned namespace can be used to get the
|
102 | * `Firestore` service for the default app or an explicitly specified app.
|
103 | */
|
104 | get firestore(): FirebaseServiceNamespace<Firestore>;
|
105 | /**
|
106 | * Gets the `MachineLearning` service namespace. The returned namespace can be
|
107 | * used to get the `MachineLearning` service for the default app or an
|
108 | * explicityly specified app.
|
109 | */
|
110 | get machineLearning(): FirebaseServiceNamespace<MachineLearning>;
|
111 | /**
|
112 | * Gets the `Installations` service namespace. The returned namespace can be used to get the
|
113 | * `Installations` service for the default app or an explicitly specified app.
|
114 | */
|
115 | get installations(): FirebaseServiceNamespace<Installations>;
|
116 | /**
|
117 | * Gets the `InstanceId` service namespace. The returned namespace can be used to get the
|
118 | * `Instance` service for the default app or an explicitly specified app.
|
119 | */
|
120 | get instanceId(): FirebaseServiceNamespace<InstanceId>;
|
121 | /**
|
122 | * Gets the `ProjectManagement` service namespace. The returned namespace can be used to get the
|
123 | * `ProjectManagement` service for the default app or an explicitly specified app.
|
124 | */
|
125 | get projectManagement(): FirebaseServiceNamespace<ProjectManagement>;
|
126 | /**
|
127 | * Gets the `SecurityRules` service namespace. The returned namespace can be used to get the
|
128 | * `SecurityRules` service for the default app or an explicitly specified app.
|
129 | */
|
130 | get securityRules(): FirebaseServiceNamespace<SecurityRules>;
|
131 | /**
|
132 | * Gets the `RemoteConfig` service namespace. The returned namespace can be used to get the
|
133 | * `RemoteConfig` service for the default app or an explicitly specified app.
|
134 | */
|
135 | get remoteConfig(): FirebaseServiceNamespace<RemoteConfig>;
|
136 | /**
|
137 | * Gets the `AppCheck` service namespace. The returned namespace can be used to get the
|
138 | * `AppCheck` service for the default app or an explicitly specified app.
|
139 | */
|
140 | get appCheck(): FirebaseServiceNamespace<AppCheck>;
|
141 | /**
|
142 | * Initializes the FirebaseApp instance.
|
143 | *
|
144 | * @param options - Optional options for the FirebaseApp instance.
|
145 | * If none present will try to initialize from the FIREBASE_CONFIG environment variable.
|
146 | * If the environment variable contains a string that starts with '{' it will be parsed as JSON,
|
147 | * otherwise it will be assumed to be pointing to a file.
|
148 | * @param appName - Optional name of the FirebaseApp instance.
|
149 | *
|
150 | * @returns A new FirebaseApp instance.
|
151 | */
|
152 | initializeApp(options?: AppOptions, appName?: string): App;
|
153 | |
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 | app(appName?: string): App;
|
161 | get apps(): App[];
|
162 | private ensureApp;
|
163 | }
|