@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,89 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 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
+ import { ComponentContainer } from '@firebase/component';
18
+ import { FirebaseApp } from './public-types';
19
+ import { HeartbeatsByUserAgent, HeartbeatService, HeartbeatsInIndexedDB, HeartbeatStorage, SingleDateHeartbeat } from './types';
20
+ export declare const MAX_NUM_STORED_HEARTBEATS = 30;
21
+ export declare class HeartbeatServiceImpl implements HeartbeatService {
22
+ private readonly container;
23
+ /**
24
+ * The persistence layer for heartbeats
25
+ * Leave public for easier testing.
26
+ */
27
+ _storage: HeartbeatStorageImpl;
28
+ /**
29
+ * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate
30
+ * the header string.
31
+ * Stores one record per date. This will be consolidated into the standard
32
+ * format of one record per user agent string before being sent as a header.
33
+ * Populated from indexedDB when the controller is instantiated and should
34
+ * be kept in sync with indexedDB.
35
+ * Leave public for easier testing.
36
+ */
37
+ _heartbeatsCache: HeartbeatsInIndexedDB | null;
38
+ /**
39
+ * the initialization promise for populating heartbeatCache.
40
+ * If getHeartbeatsHeader() is called before the promise resolves
41
+ * (heartbeatsCache == null), it should wait for this promise
42
+ * Leave public for easier testing.
43
+ */
44
+ _heartbeatsCachePromise: Promise<HeartbeatsInIndexedDB>;
45
+ constructor(container: ComponentContainer);
46
+ /**
47
+ * Called to report a heartbeat. The function will generate
48
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
49
+ * to IndexedDB.
50
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
51
+ * already logged, subsequent calls to this function in the same day will be ignored.
52
+ */
53
+ triggerHeartbeat(): Promise<void>;
54
+ /**
55
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
56
+ * It also clears all heartbeats from memory as well as in IndexedDB.
57
+ *
58
+ * NOTE: Consuming product SDKs should not send the header if this method
59
+ * returns an empty string.
60
+ */
61
+ getHeartbeatsHeader(): Promise<string>;
62
+ }
63
+ export declare function extractHeartbeatsForHeader(heartbeatsCache: SingleDateHeartbeat[], maxSize?: number): {
64
+ heartbeatsToSend: HeartbeatsByUserAgent[];
65
+ unsentEntries: SingleDateHeartbeat[];
66
+ };
67
+ export declare class HeartbeatStorageImpl implements HeartbeatStorage {
68
+ app: FirebaseApp;
69
+ private _canUseIndexedDBPromise;
70
+ constructor(app: FirebaseApp);
71
+ runIndexedDBEnvironmentCheck(): Promise<boolean>;
72
+ /**
73
+ * Read all heartbeats.
74
+ */
75
+ read(): Promise<HeartbeatsInIndexedDB>;
76
+ overwrite(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void>;
77
+ add(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void>;
78
+ }
79
+ /**
80
+ * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped
81
+ * in a platform logging header JSON object, stringified, and converted
82
+ * to base 64.
83
+ */
84
+ export declare function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number;
85
+ /**
86
+ * Returns the index of the heartbeat with the earliest date.
87
+ * If the heartbeats array is empty, -1 is returned.
88
+ */
89
+ export declare function getEarliestHeartbeatIdx(heartbeats: SingleDateHeartbeat[]): number;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Firebase App
3
+ *
4
+ * @remarks This package coordinates the communication between the different Firebase components
5
+ * @packageDocumentation
6
+ */
7
+ export * from './api';
8
+ export * from './internal';
9
+ export * from './public-types';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 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
+ import { FirebaseApp } from './public-types';
18
+ import { HeartbeatsInIndexedDB } from './types';
19
+ export declare function readHeartbeatsFromIndexedDB(app: FirebaseApp): Promise<HeartbeatsInIndexedDB | undefined>;
20
+ export declare function writeHeartbeatsToIndexedDB(app: FirebaseApp, heartbeatObject: HeartbeatsInIndexedDB): Promise<void>;
@@ -0,0 +1,108 @@
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
+ import { FirebaseApp, FirebaseAppSettings, FirebaseServerAppSettings, FirebaseOptions, FirebaseServerApp } from './public-types';
18
+ import { Component, Provider, Name } from '@firebase/component';
19
+ import { DEFAULT_ENTRY_NAME } from './constants';
20
+ /**
21
+ * @internal
22
+ */
23
+ export declare const _apps: Map<string, FirebaseApp>;
24
+ /**
25
+ * @internal
26
+ */
27
+ export declare const _serverApps: Map<string, FirebaseServerApp>;
28
+ /**
29
+ * Registered components.
30
+ *
31
+ * @internal
32
+ */
33
+ export declare const _components: Map<string, Component<any>>;
34
+ /**
35
+ * @param component - the component being added to this app's container
36
+ *
37
+ * @internal
38
+ */
39
+ export declare function _addComponent<T extends Name>(app: FirebaseApp, component: Component<T>): void;
40
+ /**
41
+ *
42
+ * @internal
43
+ */
44
+ export declare function _addOrOverwriteComponent(app: FirebaseApp, component: Component): void;
45
+ /**
46
+ *
47
+ * @param component - the component to register
48
+ * @returns whether or not the component is registered successfully
49
+ *
50
+ * @internal
51
+ */
52
+ export declare function _registerComponent<T extends Name>(component: Component<T>): boolean;
53
+ /**
54
+ *
55
+ * @param app - FirebaseApp instance
56
+ * @param name - service name
57
+ *
58
+ * @returns the provider for the service with the matching name
59
+ *
60
+ * @internal
61
+ */
62
+ export declare function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provider<T>;
63
+ /**
64
+ *
65
+ * @param app - FirebaseApp instance
66
+ * @param name - service name
67
+ * @param instanceIdentifier - service instance identifier in case the service supports multiple instances
68
+ *
69
+ * @internal
70
+ */
71
+ export declare function _removeServiceInstance<T extends Name>(app: FirebaseApp, name: T, instanceIdentifier?: string): void;
72
+ /**
73
+ *
74
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
75
+ *
76
+ * @returns true if the provide object is of type FirebaseApp.
77
+ *
78
+ * @internal
79
+ */
80
+ export declare function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseApp;
81
+ /**
82
+ *
83
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
84
+ *
85
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
86
+ *
87
+ * @internal
88
+ */
89
+ export declare function _isFirebaseServerAppSettings(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseServerAppSettings;
90
+ /**
91
+ *
92
+ * @param obj - an object of type FirebaseApp.
93
+ *
94
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
95
+ *
96
+ * @internal
97
+ */
98
+ export declare function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp;
99
+ /**
100
+ * Test only
101
+ *
102
+ * @internal
103
+ */
104
+ export declare function _clearComponents(): void;
105
+ /**
106
+ * Exported in order to be used in app-compat package
107
+ */
108
+ export { DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME };
@@ -0,0 +1,18 @@
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
+ import { Logger } from '@firebase/logger';
18
+ export declare const logger: Logger;
@@ -0,0 +1,23 @@
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
+ import { ComponentContainer } from '@firebase/component';
18
+ import { PlatformLoggerService } from './types';
19
+ export declare class PlatformLoggerServiceImpl implements PlatformLoggerService {
20
+ private readonly container;
21
+ constructor(container: ComponentContainer);
22
+ getPlatformInfoString(): string;
23
+ }
@@ -0,0 +1,241 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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
+ import { ComponentContainer } from '@firebase/component';
18
+ import { PlatformLoggerService, VersionService, HeartbeatService } from './types';
19
+ /**
20
+ * A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
21
+ * services.
22
+ *
23
+ * Do not call this constructor directly. Instead, use
24
+ * {@link (initializeApp:1) | initializeApp()} to create an app.
25
+ *
26
+ * @public
27
+ */
28
+ export interface FirebaseApp {
29
+ /**
30
+ * The (read-only) name for this app.
31
+ *
32
+ * The default app's name is `"[DEFAULT]"`.
33
+ *
34
+ * @example
35
+ * ```javascript
36
+ * // The default app's name is "[DEFAULT]"
37
+ * const app = initializeApp(defaultAppConfig);
38
+ * console.log(app.name); // "[DEFAULT]"
39
+ * ```
40
+ *
41
+ * @example
42
+ * ```javascript
43
+ * // A named app's name is what you provide to initializeApp()
44
+ * const otherApp = initializeApp(otherAppConfig, "other");
45
+ * console.log(otherApp.name); // "other"
46
+ * ```
47
+ */
48
+ readonly name: string;
49
+ /**
50
+ * The (read-only) configuration options for this app. These are the original
51
+ * parameters given in {@link (initializeApp:1) | initializeApp()}.
52
+ *
53
+ * @example
54
+ * ```javascript
55
+ * const app = initializeApp(config);
56
+ * console.log(app.options.databaseURL === config.databaseURL); // true
57
+ * ```
58
+ */
59
+ readonly options: FirebaseOptions;
60
+ /**
61
+ * The settable config flag for GDPR opt-in/opt-out
62
+ */
63
+ automaticDataCollectionEnabled: boolean;
64
+ }
65
+ /**
66
+ * A {@link @firebase/app#FirebaseServerApp} holds the initialization information
67
+ * for a collection of services running in server environments.
68
+ *
69
+ * Do not call this constructor directly. Instead, use
70
+ * {@link (initializeServerApp:1) | initializeServerApp()} to create
71
+ * an app.
72
+ *
73
+ * @public
74
+ */
75
+ export interface FirebaseServerApp extends FirebaseApp {
76
+ /**
77
+ * There is no `getApp()` operation for `FirebaseServerApp`, so the name is not relevant for
78
+ * applications. However, it may be used internally, and is declared here so that
79
+ * `FirebaseServerApp` conforms to the `FirebaseApp` interface.
80
+ */
81
+ name: string;
82
+ /**
83
+ * The (read-only) configuration settings for this server app. These are the original
84
+ * parameters given in {@link (initializeServerApp:1) | initializeServerApp()}.
85
+ *
86
+ * @example
87
+ * ```javascript
88
+ * const app = initializeServerApp(settings);
89
+ * console.log(app.settings.authIdToken === options.authIdToken); // true
90
+ * ```
91
+ */
92
+ readonly settings: FirebaseServerAppSettings;
93
+ }
94
+ /**
95
+ * @public
96
+ *
97
+ * Firebase configuration object. Contains a set of parameters required by
98
+ * services in order to successfully communicate with Firebase server APIs
99
+ * and to associate client data with your Firebase project and
100
+ * Firebase application. Typically this object is populated by the Firebase
101
+ * console at project setup. See also:
102
+ * {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
103
+ */
104
+ export interface FirebaseOptions {
105
+ /**
106
+ * An encrypted string used when calling certain APIs that don't need to
107
+ * access private user data
108
+ * (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
109
+ */
110
+ apiKey?: string;
111
+ /**
112
+ * Auth domain for the project ID.
113
+ */
114
+ authDomain?: string;
115
+ /**
116
+ * Default Realtime Database URL.
117
+ */
118
+ databaseURL?: string;
119
+ /**
120
+ * The unique identifier for the project across all of Firebase and
121
+ * Google Cloud.
122
+ */
123
+ projectId?: string;
124
+ /**
125
+ * The default Cloud Storage bucket name.
126
+ */
127
+ storageBucket?: string;
128
+ /**
129
+ * Unique numerical value used to identify each sender that can send
130
+ * Firebase Cloud Messaging messages to client apps.
131
+ */
132
+ messagingSenderId?: string;
133
+ /**
134
+ * Unique identifier for the app.
135
+ */
136
+ appId?: string;
137
+ /**
138
+ * An ID automatically created when you enable Analytics in your
139
+ * Firebase project and register a web app. In versions 7.20.0
140
+ * and higher, this parameter is optional.
141
+ */
142
+ measurementId?: string;
143
+ }
144
+ /**
145
+ * @public
146
+ *
147
+ * Configuration options given to {@link (initializeApp:1) | initializeApp()}
148
+ */
149
+ export interface FirebaseAppSettings {
150
+ /**
151
+ * custom name for the Firebase App.
152
+ * The default value is `"[DEFAULT]"`.
153
+ */
154
+ name?: string;
155
+ /**
156
+ * The settable config flag for GDPR opt-in/opt-out. Defaults to true.
157
+ */
158
+ automaticDataCollectionEnabled?: boolean;
159
+ }
160
+ /**
161
+ * @public
162
+ *
163
+ * Configuration options given to {@link (initializeServerApp:1) | initializeServerApp()}
164
+ */
165
+ export interface FirebaseServerAppSettings extends Omit<FirebaseAppSettings, 'name'> {
166
+ /**
167
+ * An optional Auth ID token used to resume a signed in user session from a client
168
+ * runtime environment.
169
+ *
170
+ * Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken`
171
+ * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token
172
+ * needs to have been recently minted for this operation to succeed.
173
+ *
174
+ * If the token fails local verification due to expiration or parsing errors, then a console error
175
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
176
+ *
177
+ * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an
178
+ * warning is logged to the console and the Auth SDK will not sign in a user on initialization.
179
+ *
180
+ * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback
181
+ * is invoked with the `User` object as per standard Auth flows. However, `User` objects
182
+ * created via an `authIdToken` do not have a refresh token. Attempted `refreshToken`
183
+ * operations fail.
184
+ */
185
+ authIdToken?: string;
186
+ /**
187
+ * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize
188
+ * this App Check token in place of requiring an instance of App Check to be initialized.
189
+ *
190
+ * If the token fails local verification due to expiration or parsing errors, then a console error
191
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
192
+ */
193
+ appCheckToken?: string;
194
+ /**
195
+ * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry`
196
+ * object to monitor the garbage collection status of the provided object. The
197
+ * Firebase SDK releases its reference on the `FirebaseServerApp` instance when the
198
+ * provided `releaseOnDeref` object is garbage collected.
199
+ *
200
+ * You can use this field to reduce memory management overhead for your application.
201
+ * If provided, an app running in a SSR pass does not need to perform
202
+ * `FirebaseServerApp` cleanup, so long as the reference object is deleted (by falling out of
203
+ * SSR scope, for instance.)
204
+ *
205
+ * If an object is not provided then the application must clean up the `FirebaseServerApp`
206
+ * instance by invoking `deleteApp`.
207
+ *
208
+ * If the application provides an object in this parameter, but the application is
209
+ * executed in a JavaScript engine that predates the support of `FinalizationRegistry`
210
+ * (introduced in node v14.6.0, for instance), then an error is thrown at `FirebaseServerApp`
211
+ * initialization.
212
+ */
213
+ releaseOnDeref?: object;
214
+ }
215
+ /**
216
+ * @internal
217
+ */
218
+ export interface _FirebaseService {
219
+ app: FirebaseApp;
220
+ /**
221
+ * Delete the service and free it's resources - called from
222
+ * {@link @firebase/app#deleteApp | deleteApp()}
223
+ */
224
+ _delete(): Promise<void>;
225
+ }
226
+ /**
227
+ * @internal
228
+ */
229
+ export interface _FirebaseAppInternal extends FirebaseApp {
230
+ container: ComponentContainer;
231
+ isDeleted: boolean;
232
+ checkDestroyed(): void;
233
+ }
234
+ declare module '@firebase/component' {
235
+ interface NameServiceMapping {
236
+ 'app': FirebaseApp;
237
+ 'app-version': VersionService;
238
+ 'heartbeat': HeartbeatService;
239
+ 'platform-logger': PlatformLoggerService;
240
+ }
241
+ }
@@ -0,0 +1,17 @@
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
+ export declare function registerCoreComponents(variant?: string): void;
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "0.1.2"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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
+ export interface VersionService {
18
+ library: string;
19
+ version: string;
20
+ }
21
+ export interface PlatformLoggerService {
22
+ getPlatformInfoString(): string;
23
+ }
24
+ export interface HeartbeatService {
25
+ /**
26
+ * Called to report a heartbeat. The function will generate
27
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
28
+ * to IndexedDB.
29
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
30
+ * already logged, subsequent calls to this function in the same day will be ignored.
31
+ */
32
+ triggerHeartbeat(): Promise<void>;
33
+ /**
34
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
35
+ * It also clears all heartbeats from memory as well as in IndexedDB.
36
+ */
37
+ getHeartbeatsHeader(): Promise<string>;
38
+ }
39
+ export interface HeartbeatsByUserAgent {
40
+ agent: string;
41
+ dates: string[];
42
+ }
43
+ export interface SingleDateHeartbeat {
44
+ agent: string;
45
+ date: string;
46
+ }
47
+ export interface HeartbeatStorage {
48
+ overwrite(heartbeats: HeartbeatsInIndexedDB): Promise<void>;
49
+ add(heartbeats: HeartbeatsInIndexedDB): Promise<void>;
50
+ read(): Promise<HeartbeatsInIndexedDB>;
51
+ }
52
+ export interface HeartbeatsInIndexedDB {
53
+ lastSentHeartbeatDate?: string;
54
+ heartbeats: SingleDateHeartbeat[];
55
+ }
@@ -0,0 +1,17 @@
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
+ export {};
@@ -0,0 +1,26 @@
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
+ import { FirebaseApp, _FirebaseService } from '../src/public-types';
18
+ import { ComponentType, Component } from '@firebase/component';
19
+ export declare class TestService implements _FirebaseService {
20
+ private app_;
21
+ instanceIdentifier?: string | undefined;
22
+ constructor(app_: FirebaseApp, instanceIdentifier?: string | undefined);
23
+ get app(): FirebaseApp;
24
+ _delete(): Promise<void>;
25
+ }
26
+ export declare function createTestComponent(name: string, multiInstances?: boolean, type?: ComponentType): Component;