1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | import { FirebaseApp } from '@firebase/app';
|
21 | import { DynamicConfig, ThrottleMetadata, MinimalDynamicConfig } from './types';
|
22 | export interface AppFields {
|
23 | appId: string;
|
24 | apiKey: string;
|
25 | measurementId?: string;
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare const LONG_RETRY_FACTOR = 30;
|
34 |
|
35 |
|
36 |
|
37 | declare class RetryData {
|
38 | throttleMetadata: {
|
39 | [appId: string]: ThrottleMetadata;
|
40 | };
|
41 | intervalMillis: number;
|
42 | constructor(throttleMetadata?: {
|
43 | [appId: string]: ThrottleMetadata;
|
44 | }, intervalMillis?: number);
|
45 | getThrottleMetadata(appId: string): ThrottleMetadata;
|
46 | setThrottleMetadata(appId: string, metadata: ThrottleMetadata): void;
|
47 | deleteThrottleMetadata(appId: string): void;
|
48 | }
|
49 | /**
|
50 | * Fetches dynamic config from backend.
|
51 | * @param app Firebase app to fetch config for.
|
52 | */
|
53 | export declare function fetchDynamicConfig(appFields: AppFields): Promise<DynamicConfig>;
|
54 | /**
|
55 | * Fetches dynamic config from backend, retrying if failed.
|
56 | * @param app Firebase app to fetch config for.
|
57 | */
|
58 | export declare function fetchDynamicConfigWithRetry(app: FirebaseApp, retryData?: RetryData, timeoutMillis?: number): Promise<DynamicConfig | MinimalDynamicConfig>;
|
59 | /**
|
60 | * Shims a minimal AbortSignal (copied from Remote Config).
|
61 | *
|
62 | * <p>AbortController's AbortSignal conveniently decouples fetch timeout logic from other aspects
|
63 | * of networking, such as retries. Firebase doesn't use AbortController enough to justify a
|
64 | * polyfill recommendation, like we do with the Fetch API, but this minimal shim can easily be
|
65 | * swapped out if/when we do.
|
66 | */
|
67 | export declare class AnalyticsAbortSignal {
|
68 | listeners: Array<() => void>;
|
69 | addEventListener(listener: () => void): void;
|
70 | abort(): void;
|
71 | }
|
72 | export {};
|