Skip to content

Commit 08e2aa3

Browse files
authored
Remove remote-config-types-exp (#4496)
* remove remote-config-types exp * fix remote-config-compat * remove api report for types * correct d.ts path
1 parent 04b4986 commit 08e2aa3

File tree

22 files changed

+62
-134
lines changed

22 files changed

+62
-134
lines changed

.changeset/config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@firebase/performance-exp",
2929
"@firebase/performance-types-exp",
3030
"@firebase/remote-config-exp",
31-
"@firebase/remote-config-types-exp",
3231
"@firebase/remote-config-compat",
3332
"firebase-exp",
3433
"@firebase/app-compat",

common/api-review/remote-config-exp.api.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
```ts
66

77
import { FirebaseApp } from '@firebase/app-exp';
8-
import { RemoteConfig } from '@firebase/remote-config-types-exp';
9-
import { LogLevel as RemoteConfigLogLevel } from '@firebase/remote-config-types-exp';
10-
import { Value as ValueType } from '@firebase/remote-config-types-exp';
118

129
// @public
1310
export function activate(remoteConfig: RemoteConfig): Promise<boolean>;
@@ -22,7 +19,10 @@ export function fetchAndActivate(remoteConfig: RemoteConfig): Promise<boolean>;
2219
export function fetchConfig(remoteConfig: RemoteConfig): Promise<void>;
2320

2421
// @public
25-
export function getAll(remoteConfig: RemoteConfig): Record<string, ValueType>;
22+
export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
23+
24+
// @public
25+
export function getAll(remoteConfig: RemoteConfig): Record<string, Value>;
2626

2727
// @public
2828
export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean;
@@ -37,16 +37,40 @@ export function getRemoteConfig(app: FirebaseApp): RemoteConfig;
3737
export function getString(remoteConfig: RemoteConfig, key: string): string;
3838

3939
// @public
40-
export function getValue(remoteConfig: RemoteConfig, key: string): ValueType;
40+
export function getValue(remoteConfig: RemoteConfig, key: string): Value;
4141

42-
export { RemoteConfig }
42+
// @public
43+
export type LogLevel = 'debug' | 'error' | 'silent';
4344

44-
export { RemoteConfigLogLevel }
45+
// @public
46+
export interface RemoteConfig {
47+
defaultConfig: {
48+
[key: string]: string | number | boolean;
49+
};
50+
fetchTimeMillis: number;
51+
lastFetchStatus: FetchStatus;
52+
settings: Settings;
53+
}
4554

4655
// @public
47-
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: RemoteConfigLogLevel): void;
56+
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;
4857

49-
export { ValueType }
58+
// @public
59+
export interface Settings {
60+
fetchTimeoutMillis: number;
61+
minimumFetchIntervalMillis: number;
62+
}
63+
64+
// @public
65+
export interface Value {
66+
asBoolean(): boolean;
67+
asNumber(): number;
68+
asString(): string;
69+
getSource(): ValueSource;
70+
}
71+
72+
// @public
73+
export type ValueSource = 'static' | 'default' | 'remote';
5074

5175

5276
// (No @packageDocumentation comment for this package)

common/api-review/remote-config-types-exp.api.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

packages-exp/auth-exp/test/helpers/integration/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import { deleteApp, initializeApp } from '@firebase/app-exp';
1919
import { Auth, User } from '@firebase/auth-types-exp';
2020

21-
import { getAuth } from '../../../'; // Use browser OR node dist entrypoint depending on test env.
21+
import { getAuth } from '../../../'; // Use browser OR node dist entrypoint depending on test env.
2222
import { _generateEventId } from '../../../src/core/util/event_id';
2323

2424
// eslint-disable-next-line @typescript-eslint/no-require-imports

packages-exp/remote-config-compat/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"@firebase/app-compat": "0.x"
3030
},
3131
"dependencies": {
32-
"@firebase/remote-config-exp": "0.0.900",
33-
"@firebase/remote-config-types-exp": "0.0.900",
32+
"@firebase/remote-config-exp": "0.0.900",
3433
"@firebase/util": "0.3.4",
3534
"@firebase/logger": "0.2.6",
3635
"@firebase/component": "0.2.0",

packages-exp/remote-config-compat/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { RemoteConfigCompatImpl } from './remoteConfig';
2525
import { name as packageName, version } from '../package.json';
2626
import { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
2727

28-
// TODO: move it to the future remote-config-compat-types package
28+
// TODO: move it to remote-config-types package
2929
declare module '@firebase/component' {
3030
interface NameServiceMapping {
3131
'remote-config-compat': RemoteConfigCompat;

packages-exp/remote-config-compat/src/remoteConfig.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { stub } from 'sinon';
2121
import { RemoteConfigCompatImpl } from './remoteConfig';
2222
import { getFakeApp, getFakeModularRemoteConfig } from '../test/util';
2323
import * as modularApi from '@firebase/remote-config-exp';
24-
import { Value } from '@firebase/remote-config-types-exp';
2524

2625
describe('Remote Config Compat', () => {
2726
let remoteConfig!: RemoteConfigCompatImpl;
@@ -134,7 +133,7 @@ describe('Remote Config Compat', () => {
134133
});
135134

136135
it('getValue() calls modular getValue()', () => {
137-
const fakeValue = {} as Value;
136+
const fakeValue = {} as modularApi.Value;
138137
const modularGetValue = stub(modularApi, 'getValue').callsFake(
139138
() => fakeValue
140139
);

packages-exp/remote-config-compat/src/remoteConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
import { FirebaseApp, _FirebaseService } from '@firebase/app-compat';
19-
import { RemoteConfig } from '@firebase/remote-config-types-exp';
2019
import {
2120
Value as ValueCompat,
2221
FetchStatus as FetchSTatusCompat,
@@ -25,6 +24,7 @@ import {
2524
RemoteConfig as RemoteConfigCompat
2625
} from '@firebase/remote-config-types';
2726
import {
27+
RemoteConfig,
2828
setLogLevel,
2929
activate,
3030
ensureInitialized,

packages-exp/remote-config-compat/test/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
import { FirebaseApp } from '@firebase/app-compat';
19-
import { RemoteConfig } from '@firebase/remote-config-types-exp';
19+
import { RemoteConfig } from '@firebase/remote-config-exp';
2020

2121
export function getFakeApp(): FirebaseApp {
2222
return {

packages-exp/remote-config-exp/api-extractor.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// Point it to your entry point d.ts file.
44
"mainEntryPointFilePath": "<projectFolder>/dist/src/index.d.ts",
55
"dtsRollup": {
6-
"enabled": true
6+
"enabled": true,
7+
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
8+
"publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts"
79
}
810
}

0 commit comments

Comments
 (0)