@react-native-firebase/remote-config 25.1.0 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/RNFBRemoteConfig.podspec +7 -6
  3. package/android/build.gradle +19 -0
  4. package/android/src/reactnative/java/io/invertase/firebase/config/{ReactNativeFirebaseConfigModule.java → NativeRNFBTurboConfig.java} +53 -40
  5. package/android/src/reactnative/java/io/invertase/firebase/config/ReactNativeFirebaseConfigPackage.java +1 -1
  6. package/android/src/reactnative/java/io/invertase/firebase/config/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboConfigSpec.java +115 -0
  7. package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/CMakeLists.txt +36 -0
  8. package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules-generated.cpp +98 -0
  9. package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules.h +31 -0
  10. package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
  11. package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI.h +471 -0
  12. package/dist/module/index.js +499 -5
  13. package/dist/module/index.js.map +1 -1
  14. package/dist/module/version.js +1 -1
  15. package/dist/typescript/lib/index.d.ts +83 -5
  16. package/dist/typescript/lib/index.d.ts.map +1 -1
  17. package/dist/typescript/lib/types/internal.d.ts +25 -24
  18. package/dist/typescript/lib/types/internal.d.ts.map +1 -1
  19. package/dist/typescript/lib/types/remote-config.d.ts +24 -3
  20. package/dist/typescript/lib/types/remote-config.d.ts.map +1 -1
  21. package/dist/typescript/lib/version.d.ts +1 -1
  22. package/ios/RNFBConfig/RNFBConfigModule.h +3 -2
  23. package/ios/RNFBConfig/{RNFBConfigModule.m → RNFBConfigModule.mm} +137 -93
  24. package/ios/RNFBConfig.xcodeproj/project.pbxproj +8 -8
  25. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  26. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  27. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  28. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  29. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  30. package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  31. package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules-generated.mm +121 -0
  32. package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules.h +172 -0
  33. package/ios/generated/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
  34. package/ios/generated/RNFBRemoteConfigTurboModulesJSI.h +471 -0
  35. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  36. package/lib/index.ts +683 -8
  37. package/lib/types/internal.ts +25 -44
  38. package/lib/types/remote-config.ts +28 -3
  39. package/lib/version.ts +1 -1
  40. package/package.json +23 -5
  41. package/react-native.config.js +10 -0
  42. package/specs/NativeRNFBTurboConfig.ts +60 -0
  43. package/typedoc.json +1 -1
  44. package/dist/module/modular.js +0 -155
  45. package/dist/module/modular.js.map +0 -1
  46. package/dist/module/namespaced.js +0 -400
  47. package/dist/module/namespaced.js.map +0 -1
  48. package/dist/module/types/namespaced.js +0 -24
  49. package/dist/module/types/namespaced.js.map +0 -1
  50. package/dist/typescript/lib/modular.d.ts +0 -76
  51. package/dist/typescript/lib/modular.d.ts.map +0 -1
  52. package/dist/typescript/lib/namespaced.d.ts +0 -11
  53. package/dist/typescript/lib/namespaced.d.ts.map +0 -1
  54. package/dist/typescript/lib/types/namespaced.d.ts +0 -124
  55. package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
  56. package/lib/modular.ts +0 -197
  57. package/lib/namespaced.ts +0 -552
  58. package/lib/types/namespaced.ts +0 -163
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
5
+ * you may not use this library except in compliance with the License.
6
6
  * You may obtain a copy of the License at
7
7
  *
8
8
  * http://www.apache.org/licenses/LICENSE-2.0
@@ -24,21 +24,17 @@ import type {
24
24
  Value,
25
25
  ValueSource,
26
26
  } from './remote-config';
27
- import type { FirebaseRemoteConfigTypes } from './namespaced';
28
27
 
29
28
  export type ConfigValueSourceInternal = ValueSource;
30
29
 
31
30
  export type LastFetchStatusInternal = FetchStatus;
32
31
 
33
- export type RemoteConfigModularDeprecationArg = string;
32
+ export type OnConfigUpdatedListenerCallback = (
33
+ event?: { updatedKeys: string[] },
34
+ error?: RemoteConfigUpdateErrorInternal,
35
+ ) => void;
34
36
 
35
- export type WithRemoteConfigDeprecationArg<F> = F extends (...args: infer P) => infer R
36
- ? (...args: [...P, RemoteConfigModularDeprecationArg?]) => R
37
- : never;
38
-
39
- export interface AppWithRemoteConfigInternal {
40
- remoteConfig(deprecationArg?: RemoteConfigModularDeprecationArg): RemoteConfig;
41
- }
37
+ export type CallbackOrObserver<T extends (...args: any[]) => any> = T | { next: T };
42
38
 
43
39
  export interface ConfigSettingsStateInternal {
44
40
  fetchTimeoutMillis: number;
@@ -79,6 +75,7 @@ export interface RemoteConfigUpdateErrorEventInternal extends RemoteConfigUpdate
79
75
  }
80
76
 
81
77
  export interface RNFBConfigModule {
78
+ getConstants(): NativeRemoteConfigConstants;
82
79
  activate(): Promise<NativeRemoteConfigResult<boolean>>;
83
80
  setConfigSettings(settings: {
84
81
  fetchTimeout: number;
@@ -106,19 +103,16 @@ export interface RemoteConfigInternal extends RemoteConfig {
106
103
  defaultConfig: {
107
104
  [key: string]: string | number | boolean;
108
105
  };
109
- activate(deprecationArg?: RemoteConfigModularDeprecationArg): Promise<boolean>;
110
- ensureInitialized(deprecationArg?: RemoteConfigModularDeprecationArg): Promise<void>;
111
- fetchAndActivate(deprecationArg?: RemoteConfigModularDeprecationArg): Promise<boolean>;
112
- fetch(
113
- expirationDurationSeconds?: number,
114
- deprecationArg?: RemoteConfigModularDeprecationArg,
115
- ): Promise<void>;
116
- getAll(deprecationArg?: RemoteConfigModularDeprecationArg): Record<string, Value>;
117
- getBoolean(key: string, deprecationArg?: RemoteConfigModularDeprecationArg): boolean;
118
- getNumber(key: string, deprecationArg?: RemoteConfigModularDeprecationArg): number;
119
- getString(key: string, deprecationArg?: RemoteConfigModularDeprecationArg): string;
120
- getValue(key: string, deprecationArg?: RemoteConfigModularDeprecationArg): Value;
121
- reset(deprecationArg?: RemoteConfigModularDeprecationArg): Promise<void>;
106
+ activate(): Promise<boolean>;
107
+ ensureInitialized(): Promise<void>;
108
+ fetchAndActivate(): Promise<boolean>;
109
+ fetch(expirationDurationSeconds?: number): Promise<void>;
110
+ getAll(): Record<string, Value>;
111
+ getBoolean(key: string): boolean;
112
+ getNumber(key: string): number;
113
+ getString(key: string): string;
114
+ getValue(key: string): Value;
115
+ reset(): Promise<void>;
122
116
  setConfigSettings(
123
117
  settings:
124
118
  | RemoteConfigSettings
@@ -127,39 +121,26 @@ export interface RemoteConfigInternal extends RemoteConfig {
127
121
  fetchTimeMillis?: number;
128
122
  fetchTimeoutMillis?: number;
129
123
  },
130
- deprecationArg?: RemoteConfigModularDeprecationArg,
124
+ fromSettingsSetter?: boolean,
131
125
  ): Promise<void>;
132
126
  setDefaults(
133
127
  defaults: {
134
128
  [key: string]: string | number | boolean;
135
129
  },
136
- deprecationArg?: RemoteConfigModularDeprecationArg,
130
+ fromDefaultConfigSetter?: boolean,
137
131
  ): Promise<null>;
138
- setDefaultsFromResource(
139
- resourceName: string,
140
- deprecationArg?: RemoteConfigModularDeprecationArg,
141
- ): Promise<null>;
142
- onConfigUpdate(
143
- observer: ConfigUpdateObserver,
144
- deprecationArg?: RemoteConfigModularDeprecationArg,
145
- ): Unsubscribe;
132
+ setDefaultsFromResource(resourceName: string): Promise<null>;
133
+ onConfigUpdate(observer: ConfigUpdateObserver): Unsubscribe;
146
134
  onConfigUpdated(
147
- listenerOrObserver: FirebaseRemoteConfigTypes.CallbackOrObserver<FirebaseRemoteConfigTypes.OnConfigUpdatedListenerCallback>,
148
- deprecationArg?: RemoteConfigModularDeprecationArg,
135
+ listenerOrObserver: CallbackOrObserver<OnConfigUpdatedListenerCallback>,
149
136
  ): Unsubscribe;
150
137
  readonly native: RNFBConfigModule;
151
- _promiseWithConstants(
152
- promise: Promise<NativeRemoteConfigResult<void>>,
153
- deprecationArg?: RemoteConfigModularDeprecationArg,
154
- ): Promise<void>;
155
- _promiseWithConstants<T>(
156
- promise: Promise<NativeRemoteConfigResult<T>>,
157
- deprecationArg?: RemoteConfigModularDeprecationArg,
158
- ): Promise<T>;
138
+ _promiseWithConstants(promise: Promise<NativeRemoteConfigResult<void>>): Promise<void>;
139
+ _promiseWithConstants<T>(promise: Promise<NativeRemoteConfigResult<T>>): Promise<T>;
159
140
  }
160
141
 
161
142
  declare module '@react-native-firebase/app/dist/module/internal/NativeModules' {
162
143
  interface ReactNativeFirebaseNativeModules {
163
- RNFBConfigModule: RNFBConfigModule;
144
+ NativeRNFBTurboConfig: RNFBConfigModule;
164
145
  }
165
146
  }
@@ -15,8 +15,7 @@
15
15
  *
16
16
  */
17
17
 
18
- import type { FirebaseApp } from '@firebase/app';
19
- import type { ReactNativeFirebase } from '@react-native-firebase/app';
18
+ import type { FirebaseApp, FirebaseError } from '@firebase/app';
20
19
 
21
20
  export type LogLevel = 'debug' | 'error' | 'silent';
22
21
 
@@ -24,6 +23,32 @@ export type FetchStatus = 'success' | 'failure' | 'no_fetch_yet' | 'throttled';
24
23
 
25
24
  export type ValueSource = 'static' | 'default' | 'remote';
26
25
 
26
+ export interface FirebaseRemoteConfigObject {
27
+ [key: string]: string;
28
+ }
29
+
30
+ export interface FirebaseExperimentDescription {
31
+ experimentId: string;
32
+ variantId: string;
33
+ experimentStartTime: string;
34
+ triggerTimeoutMillis: string;
35
+ timeToLiveMillis: string;
36
+ affectedParameterKeys?: string[];
37
+ }
38
+
39
+ export interface FetchResponse {
40
+ status: number;
41
+ eTag?: string;
42
+ config?: FirebaseRemoteConfigObject;
43
+ templateVersion?: number;
44
+ experiments?: FirebaseExperimentDescription[];
45
+ }
46
+
47
+ export interface RemoteConfigOptions {
48
+ templateId?: string;
49
+ initialFetchResponse?: FetchResponse;
50
+ }
51
+
27
52
  export interface Value {
28
53
  getSource(): ValueSource;
29
54
  asBoolean(): boolean;
@@ -42,7 +67,7 @@ export interface ConfigUpdate {
42
67
 
43
68
  export interface ConfigUpdateObserver {
44
69
  next: (configUpdate: ConfigUpdate) => void;
45
- error: (error: ReactNativeFirebase.NativeFirebaseError) => void;
70
+ error: (error: FirebaseError) => void;
46
71
  complete: () => void;
47
72
  }
48
73
 
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '25.1.0';
2
+ export const version = '26.0.0';
package/package.json CHANGED
@@ -1,15 +1,32 @@
1
1
  {
2
2
  "name": "@react-native-firebase/remote-config",
3
- "version": "25.1.0",
3
+ "version": "26.0.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - React Native Firebase provides native integration with Remote Config, allowing you to change the appearance and/or functionality of your app without requiring an app update.",
6
6
  "main": "./dist/module/index.js",
7
7
  "types": "./dist/typescript/lib/index.d.ts",
8
+ "codegenConfig": {
9
+ "name": "RNFBRemoteConfigTurboModules",
10
+ "type": "modules",
11
+ "jsSrcsDir": "specs",
12
+ "includesGeneratedCode": true,
13
+ "android": {
14
+ "javaPackageName": "io.invertase.firebase.config"
15
+ },
16
+ "ios": {
17
+ "modulesProvider": {
18
+ "NativeRNFBTurboConfig": "RNFBConfigModule"
19
+ }
20
+ }
21
+ },
8
22
  "scripts": {
9
23
  "build": "genversion --esm --semi lib/version.ts",
10
24
  "build:clean": "rimraf android/build && rimraf ios/build",
11
25
  "compile": "bob build",
12
- "prepare": "yarn run build && yarn compile"
26
+ "prepare": "yarn run build && yarn compile",
27
+ "codegen": "yarn android:codegen && yarn ios:codegen",
28
+ "android:codegen": "npx @react-native-community/cli codegen --platform android --outputPath=./android/src/reactnative/java/io/invertase/firebase/config/generated",
29
+ "ios:codegen": "npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated"
13
30
  },
14
31
  "repository": {
15
32
  "type": "git",
@@ -25,8 +42,8 @@
25
42
  "remote-config"
26
43
  ],
27
44
  "peerDependencies": {
28
- "@react-native-firebase/analytics": "25.1.0",
29
- "@react-native-firebase/app": "25.1.0"
45
+ "@react-native-firebase/analytics": "26.0.0",
46
+ "@react-native-firebase/app": "26.0.0"
30
47
  },
31
48
  "publishConfig": {
32
49
  "access": "public",
@@ -38,6 +55,7 @@
38
55
  "web-streams-polyfill": "^4.2.0"
39
56
  },
40
57
  "devDependencies": {
58
+ "@react-native-firebase/app": "26.0.0",
41
59
  "@types/text-encoding": "^0.0.40",
42
60
  "react-native-builder-bob": "^0.41.0",
43
61
  "typescript": "^6.0.3"
@@ -72,5 +90,5 @@
72
90
  "node_modules/",
73
91
  "dist/"
74
92
  ],
75
- "gitHead": "e0a565d8a73a9b103d140ffacfb8876b30d8bdc5"
93
+ "gitHead": "2a360acb2aebdd39dd40e31be386b30697270626"
76
94
  }
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ dependency: {
3
+ platforms: {
4
+ android: {
5
+ cmakeListsPath:
6
+ './src/reactnative/java/io/invertase/firebase/config/generated/jni/CMakeLists.txt',
7
+ },
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,60 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export type LastFetchStatus = 'success' | 'failure' | 'no_fetch_yet' | 'throttled' | 'unknown';
5
+
6
+ export interface StoredConfigValue {
7
+ value: string | number | boolean;
8
+ source: 'default' | 'remote' | 'static' | 'unknown';
9
+ }
10
+
11
+ export interface RemoteConfigConstants {
12
+ fetchTimeout: number;
13
+ minimumFetchInterval: number;
14
+ lastFetchTime: number;
15
+ lastFetchStatus: LastFetchStatus;
16
+ values: { [key: string]: StoredConfigValue };
17
+ }
18
+
19
+ export interface BooleanRemoteConfigResult {
20
+ result: boolean;
21
+ constants: RemoteConfigConstants;
22
+ }
23
+
24
+ export interface NullRemoteConfigResult {
25
+ result: string | null;
26
+ constants: RemoteConfigConstants;
27
+ }
28
+
29
+ export interface VoidRemoteConfigResult {
30
+ constants: RemoteConfigConstants;
31
+ }
32
+
33
+ export interface ConfigSettings {
34
+ fetchTimeout: number;
35
+ minimumFetchInterval: number;
36
+ }
37
+
38
+ export interface Spec extends TurboModule {
39
+ getConstants(): RemoteConfigConstants;
40
+
41
+ activate(appName: string): Promise<BooleanRemoteConfigResult>;
42
+ setConfigSettings(appName: string, settings: ConfigSettings): Promise<VoidRemoteConfigResult>;
43
+ fetch(appName: string, expirationDurationSeconds: number): Promise<VoidRemoteConfigResult>;
44
+ fetchAndActivate(appName: string): Promise<BooleanRemoteConfigResult>;
45
+ ensureInitialized(appName: string): Promise<VoidRemoteConfigResult>;
46
+ setDefaults(
47
+ appName: string,
48
+ defaults: { [key: string]: string | number | boolean },
49
+ ): Promise<NullRemoteConfigResult>;
50
+ setDefaultsFromResource(appName: string, resourceName: string): Promise<NullRemoteConfigResult>;
51
+ reset(appName: string): Promise<VoidRemoteConfigResult>;
52
+ onConfigUpdated(appName: string): void;
53
+ removeConfigUpdateRegistration(appName: string): void;
54
+ setCustomSignals(
55
+ appName: string,
56
+ customSignals: { [key: string]: string | number | null },
57
+ ): Promise<VoidRemoteConfigResult>;
58
+ }
59
+
60
+ export default TurboModuleRegistry.getEnforcing<Spec>('NativeRNFBTurboConfig');
package/typedoc.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["lib/modular.ts", "lib/types/remote-config.ts"],
3
+ "entryPoints": ["lib/index.ts", "lib/types/remote-config.ts"],
4
4
  "tsconfig": "tsconfig.json"
5
5
  }
@@ -1,155 +0,0 @@
1
- "use strict";
2
-
3
- /*
4
- * Copyright (c) 2016-present Invertase Limited & Contributors
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this library except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- */
19
-
20
- import { getApp } from '@react-native-firebase/app';
21
- import { MODULAR_DEPRECATION_ARG, withModularFlag } from '@react-native-firebase/app/dist/module/common';
22
- function rc(remoteConfig) {
23
- return remoteConfig;
24
- }
25
- /**
26
- * Returns a RemoteConfig instance for the given app.
27
- * @param app - FirebaseApp. Optional.
28
- */
29
- export function getRemoteConfig(app) {
30
- if (app) {
31
- return withModularFlag(() => getApp(app.name).remoteConfig(MODULAR_DEPRECATION_ARG));
32
- }
33
- return withModularFlag(() => getApp().remoteConfig(MODULAR_DEPRECATION_ARG));
34
- }
35
-
36
- /**
37
- * Returns a Boolean which resolves to true if the current call
38
- * activated the fetched configs.
39
- */
40
- export function activate(remoteConfig) {
41
- return rc(remoteConfig).activate.call(remoteConfig, MODULAR_DEPRECATION_ARG);
42
- }
43
-
44
- /**
45
- * Ensures the last activated config are available to the getters.
46
- */
47
- export function ensureInitialized(remoteConfig) {
48
- return rc(remoteConfig).ensureInitialized.call(remoteConfig, MODULAR_DEPRECATION_ARG);
49
- }
50
-
51
- /**
52
- * Performs a fetch and returns a Boolean which resolves to true
53
- * if the current call activated the fetched configs.
54
- */
55
- export function fetchAndActivate(remoteConfig) {
56
- return rc(remoteConfig).fetchAndActivate.call(remoteConfig, MODULAR_DEPRECATION_ARG);
57
- }
58
-
59
- /**
60
- * Fetches and caches configuration from the Remote Config service.
61
- */
62
- export function fetchConfig(remoteConfig) {
63
- return rc(remoteConfig).fetch.call(remoteConfig, undefined, MODULAR_DEPRECATION_ARG);
64
- }
65
-
66
- /**
67
- * Gets all config.
68
- */
69
- export function getAll(remoteConfig) {
70
- return rc(remoteConfig).getAll.call(remoteConfig, MODULAR_DEPRECATION_ARG);
71
- }
72
-
73
- /**
74
- * Gets the value for the given key as a boolean.
75
- */
76
- export function getBoolean(remoteConfig, key) {
77
- return rc(remoteConfig).getBoolean.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
78
- }
79
-
80
- /**
81
- * Gets the value for the given key as a number.
82
- */
83
- export function getNumber(remoteConfig, key) {
84
- return rc(remoteConfig).getNumber.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
85
- }
86
-
87
- /**
88
- * Gets the value for the given key as a string.
89
- */
90
- export function getString(remoteConfig, key) {
91
- return rc(remoteConfig).getString.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
92
- }
93
-
94
- /**
95
- * Gets the value for the given key.
96
- */
97
- export function getValue(remoteConfig, key) {
98
- return rc(remoteConfig).getValue.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
99
- }
100
-
101
- /**
102
- * Defines the log level to use.
103
- */
104
- export function setLogLevel(remoteConfig, logLevel) {
105
- void remoteConfig;
106
- void logLevel;
107
- // Intentionally ignored on native. The modular API matches the JS SDK and returns void.
108
- }
109
-
110
- /**
111
- * Checks two different things.
112
- * 1. Check if IndexedDB exists in the browser environment.
113
- * 2. Check if the current browser context allows IndexedDB open() calls.
114
- */
115
- export function isSupported() {
116
- // always return "true" for now. Web only.
117
- return Promise.resolve(true);
118
- }
119
-
120
- /**
121
- * Deletes all activated, fetched and defaults configs and
122
- * resets all Firebase Remote Config settings.
123
- * Android only. iOS does not reset anything.
124
- */
125
- export function reset(remoteConfig) {
126
- return rc(remoteConfig).reset.call(remoteConfig, MODULAR_DEPRECATION_ARG);
127
- }
128
-
129
- /**
130
- * Sets defaults based on a native resource.
131
- */
132
- export function setDefaultsFromResource(remoteConfig, resourceName) {
133
- return rc(remoteConfig).setDefaultsFromResource.call(remoteConfig, resourceName, MODULAR_DEPRECATION_ARG);
134
- }
135
-
136
- /**
137
- * Registers a listener to changes in the configuration.
138
- *
139
- */
140
- export function onConfigUpdate(remoteConfig, observer) {
141
- return rc(remoteConfig).onConfigUpdate.call(remoteConfig, observer, MODULAR_DEPRECATION_ARG);
142
- }
143
-
144
- /**
145
- * Sets the custom signals for the app instance.
146
- */
147
- export async function setCustomSignals(remoteConfig, customSignals) {
148
- for (const [key, value] of Object.entries(customSignals)) {
149
- if (typeof value !== 'string' && typeof value !== 'number' && value !== null) {
150
- throw new Error(`firebase.remoteConfig().setCustomSignals(): Invalid type for custom signal '${key}': ${typeof value}. Expected 'string', 'number', or 'null'.`);
151
- }
152
- }
153
- return withModularFlag(() => rc(remoteConfig)._promiseWithConstants(rc(remoteConfig).native.setCustomSignals(customSignals), MODULAR_DEPRECATION_ARG));
154
- }
155
- //# sourceMappingURL=modular.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getApp","MODULAR_DEPRECATION_ARG","withModularFlag","rc","remoteConfig","getRemoteConfig","app","name","activate","call","ensureInitialized","fetchAndActivate","fetchConfig","fetch","undefined","getAll","getBoolean","key","getNumber","getString","getValue","setLogLevel","logLevel","isSupported","Promise","resolve","reset","setDefaultsFromResource","resourceName","onConfigUpdate","observer","setCustomSignals","customSignals","value","Object","entries","Error","_promiseWithConstants","native"],"sourceRoot":"../../lib","sources":["modular.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,MAAM,QAAQ,4BAA4B;AACnD,SACEC,uBAAuB,EACvBC,eAAe,QACV,+CAA+C;AAWtD,SAASC,EAAEA,CAACC,YAA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