Skip to content

Commit 722387b

Browse files
committed
fix(remote-config-typescript): extra type definitions
1 parent cf88e38 commit 722387b

4 files changed

Lines changed: 6 additions & 27 deletions

File tree

.github/scripts/compare-types/packages/remote-config/config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ const config: PackageConfig = {
4343
'compatibility with the class-based (namespaced) API. Not part of ' +
4444
'the firebase-js-sdk modular API.',
4545
},
46-
{
47-
name: 'settings',
48-
reason:
49-
'Getter function returning the current `ConfigSettings`. In the ' +
50-
'firebase-js-sdk settings are accessed via the `settings` property ' +
51-
'on the `RemoteConfig` object rather than a standalone function.',
52-
},
5346
{
5447
name: 'onConfigUpdated',
5548
reason:

packages/remote-config/__tests__/remote-config.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
getValue,
3131
setLogLevel,
3232
isSupported,
33-
settings,
3433
reset,
3534
setConfigSettings,
3635
setDefaults,
@@ -201,16 +200,15 @@ describe('remoteConfig()', function () {
201200
expect(isSupported).toBeDefined();
202201
});
203202

204-
it('`fetchTimeMillis` and `lastFetchStatus` are on RemoteConfig instance (firebase-js-sdk shape)', function () {
203+
it('`fetchTimeMillis`, `lastFetchStatus` and `settings` are on RemoteConfig instance (firebase-js-sdk shape)', function () {
205204
const rc = getRemoteConfig();
206205
expect(rc.fetchTimeMillis).toBeDefined();
207206
expect(typeof rc.fetchTimeMillis).toBe('number');
208207
expect(rc.lastFetchStatus).toBeDefined();
209208
expect(typeof rc.lastFetchStatus).toBe('string');
210-
});
211-
212-
it('`settings` function is properly exposed to end user', function () {
213-
expect(settings).toBeDefined();
209+
expect(rc.settings).toBeDefined();
210+
expect(rc.settings.minimumFetchIntervalMillis).toBeDefined();
211+
expect(rc.settings.fetchTimeoutMillis).toBeDefined();
214212
});
215213

216214
it('`reset` function is properly exposed to end user', function () {

packages/remote-config/lib/modular.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type {
1313
} from './types/modular';
1414
import type {
1515
ConfigDefaults,
16-
ConfigSettings,
1716
RemoteConfigWithDeprecationArg,
1817
RemoteConfigWithSetCustomSignalsNative,
1918
} from './types/internal';
@@ -163,16 +162,6 @@ export function isSupported(): Promise<boolean> {
163162
return Promise.resolve(true);
164163
}
165164

166-
/**
167-
* Returns a ConfigSettings object which provides the properties `minimumFetchIntervalMillis` & `fetchTimeMillis` if they have been set
168-
* using setConfigSettings({ fetchTimeMillis: number, minimumFetchIntervalMillis: number }).
169-
* @param remoteConfig - RemoteConfig instance
170-
* @returns ConfigSettings
171-
*/
172-
export function settings(remoteConfig: RemoteConfig): ConfigSettings {
173-
return remoteConfig.settings;
174-
}
175-
176165
/**
177166
* Deletes all activated, fetched and defaults configs and resets all Firebase Remote Config settings.
178167
* Android only. iOS does not reset anything.
@@ -186,7 +175,7 @@ export function reset(remoteConfig: RemoteConfig): Promise<void> {
186175
/**
187176
* Set the Remote Config settings, currently able to set `fetchTimeMillis` & `minimumFetchIntervalMillis`.
188177
* @param remoteConfig - RemoteConfig instance
189-
* @param settings - ConfigSettings instance
178+
* @param settings - RemoteConfigSettings instance
190179
* @returns Promise<void>
191180
*/
192181
export function setConfigSettings(

packages/remote-config/type-test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import remoteConfig, {
1818
getValue,
1919
setLogLevel,
2020
isSupported,
21-
settings,
2221
reset,
2322
setConfigSettings,
2423
setDefaults,
@@ -200,7 +199,7 @@ isSupported().then((supported: boolean) => {
200199
});
201200

202201
console.log(modularRemoteConfig1.fetchTimeMillis);
203-
console.log(settings(modularRemoteConfig1));
202+
console.log(modularRemoteConfig1.settings);
204203
console.log(modularRemoteConfig1.lastFetchStatus);
205204

206205
reset(modularRemoteConfig1).then(() => {

0 commit comments

Comments
 (0)