forked from NativeScript/firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.ts
33 lines (30 loc) · 1004 Bytes
/
common.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
export interface IConfigValue {
asBoolean(): boolean;
asNumber(): number;
asString(): string;
getSource(): 'default' | 'static' | 'remote';
}
export class IConfigSettings {
fetchTimeMillis: number;
minimumFetchIntervalMillis: number;
}
export interface ConfigDefaults {
[key: string]: number | string | boolean;
}
export interface IRemoteConfig {
readonly fetchTimeMillis: number;
readonly lastFetchStatus: 'success' | 'failure' | 'no_fetch_yet' | 'throttled';
settings: IConfigSettings;
activate(): Promise<boolean>;
ensureInitialized(): Promise<void>;
fetch(expirationDurationSeconds?: undefined | number): Promise<void>;
fetchAndActivate(): Promise<boolean>;
getAll(): Record<string, IConfigValue>;
getBoolean(key: string): boolean;
getNumber(key: string): number;
getString(key: string): string;
getValue(key: string): IConfigValue;
reset(): Promise<void>;
setDefaults(defaults: ConfigDefaults): Promise<void>;
setDefaultsFromResource(resourceName: string): Promise<void>;
}