@@ -19,13 +19,13 @@ import { _getProvider, FirebaseApp } from '@firebase/app-exp';
19
19
import {
20
20
LogLevel as RemoteConfigLogLevel ,
21
21
RemoteConfig ,
22
- Value as ValueType
23
- } from '@firebase/remote-config-types-exp ' ;
22
+ Value
23
+ } from './public_types ' ;
24
24
import { RemoteConfigAbortSignal } from './client/remote_config_fetch_client' ;
25
25
import { RC_COMPONENT_NAME } from './constants' ;
26
26
import { ErrorCode , hasErrorCode } from './errors' ;
27
27
import { RemoteConfig as RemoteConfigImpl } from './remote_config' ;
28
- import { Value } from './value' ;
28
+ import { Value as ValueImpl } from './value' ;
29
29
import { LogLevel as FirebaseLogLevel } from '@firebase/logger' ;
30
30
31
31
/**
@@ -137,15 +137,15 @@ export async function fetchConfig(remoteConfig: RemoteConfig): Promise<void> {
137
137
*
138
138
* @public
139
139
*/
140
- export function getAll ( remoteConfig : RemoteConfig ) : Record < string , ValueType > {
140
+ export function getAll ( remoteConfig : RemoteConfig ) : Record < string , Value > {
141
141
const rc = remoteConfig as RemoteConfigImpl ;
142
142
return getAllKeys (
143
143
rc . _storageCache . getActiveConfig ( ) ,
144
144
rc . defaultConfig
145
145
) . reduce ( ( allConfigs , key ) => {
146
146
allConfigs [ key ] = getValue ( remoteConfig , key ) ;
147
147
return allConfigs ;
148
- } , { } as Record < string , ValueType > ) ;
148
+ } , { } as Record < string , Value > ) ;
149
149
}
150
150
151
151
/**
@@ -204,7 +204,7 @@ export function getString(remoteConfig: RemoteConfig, key: string): string {
204
204
*
205
205
* @public
206
206
*/
207
- export function getValue ( remoteConfig : RemoteConfig , key : string ) : ValueType {
207
+ export function getValue ( remoteConfig : RemoteConfig , key : string ) : Value {
208
208
const rc = remoteConfig as RemoteConfigImpl ;
209
209
if ( ! rc . _isInitializationComplete ) {
210
210
rc . _logger . debug (
@@ -214,15 +214,15 @@ export function getValue(remoteConfig: RemoteConfig, key: string): ValueType {
214
214
}
215
215
const activeConfig = rc . _storageCache . getActiveConfig ( ) ;
216
216
if ( activeConfig && activeConfig [ key ] !== undefined ) {
217
- return new Value ( 'remote' , activeConfig [ key ] ) ;
217
+ return new ValueImpl ( 'remote' , activeConfig [ key ] ) ;
218
218
} else if ( rc . defaultConfig && rc . defaultConfig [ key ] !== undefined ) {
219
- return new Value ( 'default' , String ( rc . defaultConfig [ key ] ) ) ;
219
+ return new ValueImpl ( 'default' , String ( rc . defaultConfig [ key ] ) ) ;
220
220
}
221
221
rc . _logger . debug (
222
222
`Returning static value for key "${ key } ".` +
223
223
' Define a default or remote value if this is unintentional.'
224
224
) ;
225
- return new Value ( 'static' ) ;
225
+ return new ValueImpl ( 'static' ) ;
226
226
}
227
227
228
228
/**
@@ -256,5 +256,3 @@ export function setLogLevel(
256
256
function getAllKeys ( obj1 : { } = { } , obj2 : { } = { } ) : string [ ] {
257
257
return Object . keys ( { ...obj1 , ...obj2 } ) ;
258
258
}
259
-
260
- export { RemoteConfig , ValueType , RemoteConfigLogLevel } ;
0 commit comments