@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.
- package/CHANGELOG.md +32 -0
- package/RNFBRemoteConfig.podspec +7 -6
- package/android/build.gradle +19 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/{ReactNativeFirebaseConfigModule.java → NativeRNFBTurboConfig.java} +53 -40
- package/android/src/reactnative/java/io/invertase/firebase/config/ReactNativeFirebaseConfigPackage.java +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboConfigSpec.java +115 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/CMakeLists.txt +36 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules-generated.cpp +98 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules.h +31 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI.h +471 -0
- package/dist/module/index.js +499 -5
- package/dist/module/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/index.d.ts +83 -5
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +25 -24
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/types/remote-config.d.ts +24 -3
- package/dist/typescript/lib/types/remote-config.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBConfig/RNFBConfigModule.h +3 -2
- package/ios/RNFBConfig/{RNFBConfigModule.m → RNFBConfigModule.mm} +137 -93
- package/ios/RNFBConfig.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules-generated.mm +121 -0
- package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules.h +172 -0
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI.h +471 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/index.ts +683 -8
- package/lib/types/internal.ts +25 -44
- package/lib/types/remote-config.ts +28 -3
- package/lib/version.ts +1 -1
- package/package.json +23 -5
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboConfig.ts +60 -0
- package/typedoc.json +1 -1
- package/dist/module/modular.js +0 -155
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -400
- package/dist/module/namespaced.js.map +0 -1
- package/dist/module/types/namespaced.js +0 -24
- package/dist/module/types/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -76
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -11
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/dist/typescript/lib/types/namespaced.d.ts +0 -124
- package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
- package/lib/modular.ts +0 -197
- package/lib/namespaced.ts +0 -552
- package/lib/types/namespaced.ts +0 -163
|
@@ -1,400 +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 { hasOwnProperty, isFunction, isIOS, isNumber, isObject, isString, isUndefined, parseListenerOrObserver } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
-
import { createModuleNamespace, FirebaseModule, getFirebaseRoot } from '@react-native-firebase/app/dist/module/internal';
|
|
22
|
-
import NativeFirebaseError from '@react-native-firebase/app/dist/module/internal/NativeFirebaseError';
|
|
23
|
-
import { setReactNativeModule } from '@react-native-firebase/app/dist/module/internal/nativeModule';
|
|
24
|
-
import RemoteConfigValue from "./RemoteConfigValue.js";
|
|
25
|
-
import { LastFetchStatus, ValueSource } from "./statics.js";
|
|
26
|
-
import { version } from "./version.js";
|
|
27
|
-
import fallBackModule from './web/RNFBConfigModule';
|
|
28
|
-
function isSuccessEvent(event) {
|
|
29
|
-
return event.resultType === 'success';
|
|
30
|
-
}
|
|
31
|
-
function toConfigUpdate(updatedKeys) {
|
|
32
|
-
return {
|
|
33
|
-
getUpdatedKeys: () => new Set(updatedKeys)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function toNativeFirebaseError(errorEvent) {
|
|
37
|
-
return NativeFirebaseError.fromEvent(errorEvent, namespace);
|
|
38
|
-
}
|
|
39
|
-
const statics = {
|
|
40
|
-
LastFetchStatus,
|
|
41
|
-
ValueSource
|
|
42
|
-
};
|
|
43
|
-
const namespace = 'remoteConfig';
|
|
44
|
-
const nativeModuleName = 'RNFBConfigModule';
|
|
45
|
-
class FirebaseConfigModule extends FirebaseModule {
|
|
46
|
-
constructor(app, config, customUrlOrRegion) {
|
|
47
|
-
super(app, config, customUrlOrRegion);
|
|
48
|
-
this._settings = {
|
|
49
|
-
// defaults to 1 minute.
|
|
50
|
-
fetchTimeoutMillis: 60000,
|
|
51
|
-
// defaults to 12 hours.
|
|
52
|
-
minimumFetchIntervalMillis: 43200000
|
|
53
|
-
};
|
|
54
|
-
this._lastFetchTime = -1;
|
|
55
|
-
this._lastFetchStatus = 'no_fetch_yet';
|
|
56
|
-
this._values = {};
|
|
57
|
-
this._configUpdateListenerCount = 0;
|
|
58
|
-
this._nativeMutationQueue = Promise.resolve();
|
|
59
|
-
}
|
|
60
|
-
get defaultConfig() {
|
|
61
|
-
const updatedDefaultConfig = {};
|
|
62
|
-
Object.keys(this._values).forEach(key => {
|
|
63
|
-
// Need to make it an object with key and literal value. Not `Value` instance.
|
|
64
|
-
const configValue = this._values[key];
|
|
65
|
-
if (configValue) {
|
|
66
|
-
updatedDefaultConfig[key] = configValue.value;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return updatedDefaultConfig;
|
|
70
|
-
}
|
|
71
|
-
set defaultConfig(defaults) {
|
|
72
|
-
if (!isObject(defaults)) {
|
|
73
|
-
throw new Error("firebase.remoteConfig().defaultConfig: 'defaults' must be an object.");
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// To make Firebase web v9 API compatible, we update the config first so it immediately
|
|
77
|
-
// updates defaults on the instance. We then pass to underlying SDK to update. We do this because
|
|
78
|
-
// there is no way to "await" a setter.
|
|
79
|
-
const nonDefaultValues = Object.fromEntries(Object.entries(this._values).filter(([, configValue]) => configValue?.source !== 'default'));
|
|
80
|
-
this._values = Object.freeze({
|
|
81
|
-
...Object.fromEntries(Object.entries(defaults).map(([key, value]) => [key, {
|
|
82
|
-
value,
|
|
83
|
-
source: 'default'
|
|
84
|
-
}])),
|
|
85
|
-
...nonDefaultValues
|
|
86
|
-
});
|
|
87
|
-
void this.setDefaults(defaults, true);
|
|
88
|
-
}
|
|
89
|
-
get settings() {
|
|
90
|
-
return {
|
|
91
|
-
minimumFetchIntervalMillis: this._settings.minimumFetchIntervalMillis,
|
|
92
|
-
fetchTimeoutMillis: this._settings.fetchTimeoutMillis,
|
|
93
|
-
fetchTimeMillis: this._settings.fetchTimeoutMillis
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
set settings(settings) {
|
|
97
|
-
// To make Firebase web v9 API compatible, we update the settings first so it immediately
|
|
98
|
-
// updates settings on the instance. We then pass to underlying SDK to update. We do this because
|
|
99
|
-
// there is no way to "await" a setter. We can't delegate to `setConfigSettings()` as it is setup
|
|
100
|
-
// for native.
|
|
101
|
-
this._settings = {
|
|
102
|
-
minimumFetchIntervalMillis: settings.minimumFetchIntervalMillis ?? this._settings.minimumFetchIntervalMillis,
|
|
103
|
-
fetchTimeoutMillis: ('fetchTimeoutMillis' in settings ? settings.fetchTimeoutMillis : undefined) ?? ('fetchTimeMillis' in settings ? settings.fetchTimeMillis : undefined) ?? this._settings.fetchTimeoutMillis
|
|
104
|
-
};
|
|
105
|
-
void this.setConfigSettings(settings, true);
|
|
106
|
-
}
|
|
107
|
-
getValue(key) {
|
|
108
|
-
if (!isString(key)) {
|
|
109
|
-
throw new Error("firebase.remoteConfig().getValue(): 'key' must be a string value.");
|
|
110
|
-
}
|
|
111
|
-
if (typeof this._values === 'undefined' || !hasOwnProperty(this._values, key)) {
|
|
112
|
-
return new RemoteConfigValue({
|
|
113
|
-
value: '',
|
|
114
|
-
source: 'static'
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
const configValue = this._values[key];
|
|
118
|
-
return new RemoteConfigValue({
|
|
119
|
-
value: `${configValue.value}`,
|
|
120
|
-
source: configValue.source
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
getBoolean(key) {
|
|
124
|
-
return this.getValue(key).asBoolean();
|
|
125
|
-
}
|
|
126
|
-
getNumber(key) {
|
|
127
|
-
return this.getValue(key).asNumber();
|
|
128
|
-
}
|
|
129
|
-
getString(key) {
|
|
130
|
-
return this.getValue(key).asString();
|
|
131
|
-
}
|
|
132
|
-
getAll() {
|
|
133
|
-
const values = {};
|
|
134
|
-
Object.keys(this._values).forEach(key => {
|
|
135
|
-
values[key] = this.getValue(key);
|
|
136
|
-
});
|
|
137
|
-
return values;
|
|
138
|
-
}
|
|
139
|
-
get fetchTimeMillis() {
|
|
140
|
-
// android returns -1 if no fetch yet and iOS returns 0
|
|
141
|
-
return this._lastFetchTime;
|
|
142
|
-
}
|
|
143
|
-
get lastFetchStatus() {
|
|
144
|
-
return this._lastFetchStatus;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Deletes all activated, fetched and defaults configs and resets all Firebase Remote Config settings.
|
|
149
|
-
* @returns {Promise<void>}
|
|
150
|
-
*/
|
|
151
|
-
reset() {
|
|
152
|
-
if (isIOS) {
|
|
153
|
-
return Promise.resolve();
|
|
154
|
-
}
|
|
155
|
-
return this._enqueueNativeMutation(() => this._promiseWithConstants(this.native.reset()));
|
|
156
|
-
}
|
|
157
|
-
setConfigSettings(settings, fromSettingsSetter = false) {
|
|
158
|
-
const updatedSettings = {
|
|
159
|
-
fetchTimeout: this._settings.fetchTimeoutMillis / 1000,
|
|
160
|
-
minimumFetchInterval: this._settings.minimumFetchIntervalMillis / 1000
|
|
161
|
-
};
|
|
162
|
-
const apiCalled = fromSettingsSetter ? 'settings' : 'setConfigSettings';
|
|
163
|
-
if (!isObject(settings)) {
|
|
164
|
-
throw new Error(`firebase.remoteConfig().${apiCalled}(*): settings must set an object.`);
|
|
165
|
-
}
|
|
166
|
-
if (hasOwnProperty(settings, 'minimumFetchIntervalMillis')) {
|
|
167
|
-
if (!isNumber(settings.minimumFetchIntervalMillis)) {
|
|
168
|
-
throw new Error(`firebase.remoteConfig().${apiCalled}(): 'settings.minimumFetchIntervalMillis' must be a number type in milliseconds.`);
|
|
169
|
-
} else {
|
|
170
|
-
updatedSettings.minimumFetchInterval = settings.minimumFetchIntervalMillis / 1000;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (hasOwnProperty(settings, 'fetchTimeMillis')) {
|
|
174
|
-
if (!isNumber(settings.fetchTimeMillis)) {
|
|
175
|
-
throw new Error(`firebase.remoteConfig().${apiCalled}(): 'settings.fetchTimeMillis' must be a number type in milliseconds.`);
|
|
176
|
-
}
|
|
177
|
-
updatedSettings.fetchTimeout = settings.fetchTimeMillis / 1000;
|
|
178
|
-
} else if (hasOwnProperty(settings, 'fetchTimeoutMillis')) {
|
|
179
|
-
if (!isNumber(settings.fetchTimeoutMillis)) {
|
|
180
|
-
throw new Error(`firebase.remoteConfig().${apiCalled}(): 'settings.fetchTimeoutMillis' must be a number type in milliseconds.`);
|
|
181
|
-
}
|
|
182
|
-
updatedSettings.fetchTimeout = settings.fetchTimeoutMillis / 1000;
|
|
183
|
-
}
|
|
184
|
-
const nextSettings = {
|
|
185
|
-
fetchTimeoutMillis: updatedSettings.fetchTimeout * 1000,
|
|
186
|
-
minimumFetchIntervalMillis: updatedSettings.minimumFetchInterval * 1000
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
// Keep JS reads in sync immediately. Native can report stale settings constants
|
|
190
|
-
// for this call because native setConfigSettingsAsync completes after the bridge resolves.
|
|
191
|
-
this._settings = nextSettings;
|
|
192
|
-
return this._enqueueNativeMutation(() => this.native.setConfigSettings(updatedSettings).then(({
|
|
193
|
-
result,
|
|
194
|
-
constants
|
|
195
|
-
}) => {
|
|
196
|
-
// Preserve the eagerly computed settings above and only refresh the rest of the cache.
|
|
197
|
-
this._updateFromConstants({
|
|
198
|
-
...constants,
|
|
199
|
-
fetchTimeout: undefined,
|
|
200
|
-
minimumFetchInterval: undefined
|
|
201
|
-
});
|
|
202
|
-
return result;
|
|
203
|
-
}));
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Activates the Fetched RemoteConfig, so that the fetched key-values take effect.
|
|
208
|
-
* @returns {Promise<boolean>}
|
|
209
|
-
*/
|
|
210
|
-
activate() {
|
|
211
|
-
return this._promiseWithConstants(this.native.activate());
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Fetches parameter values for your app.
|
|
216
|
-
*
|
|
217
|
-
* @param expirationDurationSeconds
|
|
218
|
-
* @returns {Promise}
|
|
219
|
-
*/
|
|
220
|
-
fetch(expirationDurationSeconds) {
|
|
221
|
-
if (!isUndefined(expirationDurationSeconds) && !isNumber(expirationDurationSeconds)) {
|
|
222
|
-
throw new Error("firebase.remoteConfig().fetch(): 'expirationDurationSeconds' must be a number value.");
|
|
223
|
-
}
|
|
224
|
-
return this._promiseWithConstants(this.native.fetch(expirationDurationSeconds !== undefined ? expirationDurationSeconds : -1));
|
|
225
|
-
}
|
|
226
|
-
fetchAndActivate() {
|
|
227
|
-
return this._promiseWithConstants(this.native.fetchAndActivate());
|
|
228
|
-
}
|
|
229
|
-
ensureInitialized() {
|
|
230
|
-
return this._promiseWithConstants(this.native.ensureInitialized());
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Sets defaults.
|
|
235
|
-
*
|
|
236
|
-
* @param defaults
|
|
237
|
-
*/
|
|
238
|
-
setDefaults(defaults, fromDefaultConfigSetter = false) {
|
|
239
|
-
const apiCalled = fromDefaultConfigSetter ? 'defaultConfig' : 'setDefaults';
|
|
240
|
-
if (!isObject(defaults)) {
|
|
241
|
-
throw new Error(`firebase.remoteConfig().${apiCalled}(): 'defaults' must be an object.`);
|
|
242
|
-
}
|
|
243
|
-
return this._enqueueNativeMutation(() => this._promiseWithConstants(this.native.setDefaults(defaults)));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Sets defaults based on resource.
|
|
248
|
-
* @param resourceName
|
|
249
|
-
*/
|
|
250
|
-
setDefaultsFromResource(resourceName) {
|
|
251
|
-
if (!isString(resourceName)) {
|
|
252
|
-
throw new Error("firebase.remoteConfig().setDefaultsFromResource(): 'resourceName' must be a string value.");
|
|
253
|
-
}
|
|
254
|
-
return this._enqueueNativeMutation(() => this._promiseWithConstants(this.native.setDefaultsFromResource(resourceName)));
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Registers an observer to changes in the configuration.
|
|
259
|
-
*
|
|
260
|
-
* @param observer - The observer to be notified of config updates.
|
|
261
|
-
* @returns An unsubscribe function to remove the listener.
|
|
262
|
-
*/
|
|
263
|
-
onConfigUpdate(observer) {
|
|
264
|
-
if (!isObject(observer) || !isFunction(observer.next) || !isFunction(observer.error)) {
|
|
265
|
-
throw new Error("'observer' expected an object with 'next' and 'error' functions.");
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// We maintaine our pre-web-support native interface but bend it to match
|
|
269
|
-
// the official JS SDK API by assuming the callback is an Observer, and sending it a ConfigUpdate
|
|
270
|
-
// compatible parameter that implements the `getUpdatedKeys` method
|
|
271
|
-
let unsubscribed = false;
|
|
272
|
-
const subscription = this.emitter.addListener(this.eventNameForApp('on_config_updated'), event => {
|
|
273
|
-
if (isSuccessEvent(event)) {
|
|
274
|
-
observer.next(toConfigUpdate(event.updatedKeys));
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
observer.error(toNativeFirebaseError(event));
|
|
278
|
-
});
|
|
279
|
-
if (this._configUpdateListenerCount === 0) {
|
|
280
|
-
this.native.onConfigUpdated();
|
|
281
|
-
}
|
|
282
|
-
this._configUpdateListenerCount++;
|
|
283
|
-
return () => {
|
|
284
|
-
if (unsubscribed) {
|
|
285
|
-
// there is no harm in calling this multiple times to unsubscribe,
|
|
286
|
-
// but anything after the first call is a no-op
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
unsubscribed = true;
|
|
290
|
-
subscription.remove();
|
|
291
|
-
this._configUpdateListenerCount--;
|
|
292
|
-
if (this._configUpdateListenerCount === 0) {
|
|
293
|
-
this.native.removeConfigUpdateRegistration();
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Registers a listener to changes in the configuration.
|
|
300
|
-
*
|
|
301
|
-
* @param listenerOrObserver - function called on config change
|
|
302
|
-
* @returns unsubscribe listener
|
|
303
|
-
* @deprecated use official firebase-js-sdk onConfigUpdate now that web supports realtime
|
|
304
|
-
*/
|
|
305
|
-
onConfigUpdated(listenerOrObserver) {
|
|
306
|
-
const listener = parseListenerOrObserver(listenerOrObserver);
|
|
307
|
-
let unsubscribed = false;
|
|
308
|
-
const subscription = this.emitter.addListener(this.eventNameForApp('on_config_updated'), event => {
|
|
309
|
-
if (isSuccessEvent(event)) {
|
|
310
|
-
listener({
|
|
311
|
-
updatedKeys: event.updatedKeys
|
|
312
|
-
}, undefined);
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
listener(undefined, {
|
|
316
|
-
code: event.code,
|
|
317
|
-
message: event.message,
|
|
318
|
-
nativeErrorMessage: event.nativeErrorMessage
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
if (this._configUpdateListenerCount === 0) {
|
|
322
|
-
this.native.onConfigUpdated();
|
|
323
|
-
}
|
|
324
|
-
this._configUpdateListenerCount++;
|
|
325
|
-
return () => {
|
|
326
|
-
if (unsubscribed) {
|
|
327
|
-
// there is no harm in calling this multiple times to unsubscribe,
|
|
328
|
-
// but anything after the first call is a no-op
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
unsubscribed = true;
|
|
332
|
-
subscription.remove();
|
|
333
|
-
this._configUpdateListenerCount--;
|
|
334
|
-
if (this._configUpdateListenerCount === 0) {
|
|
335
|
-
this.native.removeConfigUpdateRegistration();
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
_updateFromConstants(constants) {
|
|
340
|
-
// Wrapped this as we update using sync getters initially for `defaultConfig` & `settings`
|
|
341
|
-
if (constants.lastFetchTime !== undefined) {
|
|
342
|
-
this._lastFetchTime = constants.lastFetchTime;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// Wrapped this as we update using sync getters initially for `defaultConfig` & `settings`
|
|
346
|
-
if (constants.lastFetchStatus !== undefined) {
|
|
347
|
-
this._lastFetchStatus = constants.lastFetchStatus;
|
|
348
|
-
}
|
|
349
|
-
if (constants.fetchTimeout !== undefined && constants.minimumFetchInterval !== undefined) {
|
|
350
|
-
this._settings = {
|
|
351
|
-
fetchTimeoutMillis: constants.fetchTimeout * 1000,
|
|
352
|
-
minimumFetchIntervalMillis: constants.minimumFetchInterval * 1000
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
if (constants.values !== undefined) {
|
|
356
|
-
this._values = Object.freeze(constants.values);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
_promiseWithConstants(promise) {
|
|
360
|
-
return promise.then(({
|
|
361
|
-
result,
|
|
362
|
-
constants
|
|
363
|
-
}) => {
|
|
364
|
-
this._updateFromConstants(constants);
|
|
365
|
-
return result;
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
_enqueueNativeMutation(task) {
|
|
369
|
-
// Some callers (like property setters) discard the returned promise; serialize all mutations
|
|
370
|
-
// so later writes like reset() cannot be overwritten by an earlier async completion.
|
|
371
|
-
const next = this._nativeMutationQueue.then(task, task);
|
|
372
|
-
this._nativeMutationQueue = next.then(() => undefined, () => undefined);
|
|
373
|
-
return next;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// import { SDK_VERSION } from '@react-native-firebase/remote-config';
|
|
378
|
-
export const SDK_VERSION = version;
|
|
379
|
-
const remoteConfigNamespace = createModuleNamespace({
|
|
380
|
-
statics,
|
|
381
|
-
version,
|
|
382
|
-
namespace,
|
|
383
|
-
nativeModuleName,
|
|
384
|
-
nativeEvents: ['on_config_updated'],
|
|
385
|
-
hasMultiAppSupport: true,
|
|
386
|
-
hasCustomUrlOrRegionSupport: false,
|
|
387
|
-
ModuleClass: FirebaseConfigModule
|
|
388
|
-
});
|
|
389
|
-
// import remoteConfig from '@react-native-firebase/remote-config';
|
|
390
|
-
// remoteConfig().X(...);
|
|
391
|
-
export default remoteConfigNamespace;
|
|
392
|
-
|
|
393
|
-
// import remoteConfig, { firebase } from '@react-native-firebase/remote-config';
|
|
394
|
-
// remoteConfig().X(...);
|
|
395
|
-
// firebase.remoteConfig().X(...);
|
|
396
|
-
export const firebase = getFirebaseRoot();
|
|
397
|
-
|
|
398
|
-
// Register the interop module for non-native platforms.
|
|
399
|
-
setReactNativeModule(nativeModuleName, fallBackModule);
|
|
400
|
-
//# sourceMappingURL=namespaced.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["hasOwnProperty","isFunction","isIOS","isNumber","isObject","isString","isUndefined","parseListenerOrObserver","createModuleNamespace","FirebaseModule","getFirebaseRoot","NativeFirebaseError","setReactNativeModule","RemoteConfigValue","LastFetchStatus","ValueSource","version","fallBackModule","isSuccessEvent","event","resultType","toConfigUpdate","updatedKeys","getUpdatedKeys","Set","toNativeFirebaseError","errorEvent","fromEvent","namespace","statics","nativeModuleName","FirebaseConfigModule","constructor","app","config","customUrlOrRegion","_settings","fetchTimeoutMillis","minimumFetchIntervalMillis","_lastFetchTime","_lastFetchStatus","_values","_configUpdateListenerCount","_nativeMutationQueue","Promise","resolve","defaultConfig","updatedDefaultConfig","Object","keys","forEach","key","configValue","value","defaults","Error","nonDefaultValues","fromEntries","entries","filter","source","freeze","map","setDefaults","settings","fetchTimeMillis","undefined","setConfigSettings","getValue","getBoolean","asBoolean","getNumber","asNumber","getString","asString","getAll","values","lastFetchStatus","reset","_enqueueNativeMutation","_promiseWithConstants","native","fromSettingsSetter","updatedSettings","fetchTimeout","minimumFetchInterval","apiCalled","nextSettings","then","result","constants","_updateFromConstants","activate","fetch","expirationDurationSeconds","fetchAndActivate","ensureInitialized","fromDefaultConfigSetter","setDefaultsFromResource","resourceName","onConfigUpdate","observer","next","error","unsubscribed","subscription","emitter","addListener","eventNameForApp","onConfigUpdated","remove","removeConfigUpdateRegistration","listenerOrObserver","listener","code","message","nativeErrorMessage","lastFetchTime","promise","task","SDK_VERSION","remoteConfigNamespace","nativeEvents","hasMultiAppSupport","hasCustomUrlOrRegionSupport","ModuleClass","firebase"],"sourceRoot":"../../lib","sources":["namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,cAAc,EACdC,UAAU,EACVC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,uBAAuB,QAClB,+CAA+C;AACtD,SACEC,qBAAqB,EACrBC,cAAc,EACdC,eAAe,QAEV,iDAAiD;AACxD,OAAOC,mBAAmB,MAAM,qEAAqE;AACrG,SAASC,oBAAoB,QAAQ,8DAA8D;AAEnG,OAAOC,iBAAiB,MAAM,wBAAqB;AACnD,SAASC,eAAe,EAAEC,WAAW,QAAQ,cAAW;AAiBxD,SAASC,OAAO,QAAQ,cAAW;AACnC,OAAOC,cAAc,MAAM,wBAAwB;AAQnD,SAASC,cAAcA,CACrBC,KAAoF,EACnC;EACjD,OAAOA,KAAK,CAACC,UAAU,KAAK,SAAS;AACvC;AAEA,SAASC,cAAcA,CAACC,WAAqB,EAAgB;EAC3D,OAAO;IACLC,cAAc,EAAEA,CAAA,KAAM,IAAIC,GAAG,CAACF,WAAW;EAC3C,CAAC;AACH;AAEA,SAASG,qBAAqBA,CAC5BC,UAA2C,EACF;EACzC,OAAOf,mBAAmB,CAACgB,SAAS,CAClCD,UAAU,EACVE,SACF,CAAC;AACH;AAEA,MAAMC,OAAO,GAAG;EACdf,eAAe;EACfC;AACF,CAAC;AAED,MAAMa,SAAS,GAAG,cAAc;AACh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licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file 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 { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
21
|
-
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
23
|
-
export let FirebaseRemoteConfigTypes;
|
|
24
|
-
//# sourceMappingURL=namespaced.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ReactNativeFirebase","FirebaseRemoteConfigTypes"],"sourceRoot":"../../../lib","sources":["types/namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,4BAA4B;;AAEhE;AAAA,WACiBC,yBAAyB","ignoreList":[]}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { FirebaseApp } from '@firebase/app';
|
|
2
|
-
import type { ConfigUpdateObserver, CustomSignals, LogLevel, RemoteConfig, Unsubscribe, Value } from './types/remote-config';
|
|
3
|
-
export type { CustomSignals } from './types/remote-config';
|
|
4
|
-
/**
|
|
5
|
-
* Returns a RemoteConfig instance for the given app.
|
|
6
|
-
* @param app - FirebaseApp. Optional.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getRemoteConfig(app?: FirebaseApp): RemoteConfig;
|
|
9
|
-
/**
|
|
10
|
-
* Returns a Boolean which resolves to true if the current call
|
|
11
|
-
* activated the fetched configs.
|
|
12
|
-
*/
|
|
13
|
-
export declare function activate(remoteConfig: RemoteConfig): Promise<boolean>;
|
|
14
|
-
/**
|
|
15
|
-
* Ensures the last activated config are available to the getters.
|
|
16
|
-
*/
|
|
17
|
-
export declare function ensureInitialized(remoteConfig: RemoteConfig): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Performs a fetch and returns a Boolean which resolves to true
|
|
20
|
-
* if the current call activated the fetched configs.
|
|
21
|
-
*/
|
|
22
|
-
export declare function fetchAndActivate(remoteConfig: RemoteConfig): Promise<boolean>;
|
|
23
|
-
/**
|
|
24
|
-
* Fetches and caches configuration from the Remote Config service.
|
|
25
|
-
*/
|
|
26
|
-
export declare function fetchConfig(remoteConfig: RemoteConfig): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Gets all config.
|
|
29
|
-
*/
|
|
30
|
-
export declare function getAll(remoteConfig: RemoteConfig): Record<string, Value>;
|
|
31
|
-
/**
|
|
32
|
-
* Gets the value for the given key as a boolean.
|
|
33
|
-
*/
|
|
34
|
-
export declare function getBoolean(remoteConfig: RemoteConfig, key: string): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Gets the value for the given key as a number.
|
|
37
|
-
*/
|
|
38
|
-
export declare function getNumber(remoteConfig: RemoteConfig, key: string): number;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the value for the given key as a string.
|
|
41
|
-
*/
|
|
42
|
-
export declare function getString(remoteConfig: RemoteConfig, key: string): string;
|
|
43
|
-
/**
|
|
44
|
-
* Gets the value for the given key.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getValue(remoteConfig: RemoteConfig, key: string): Value;
|
|
47
|
-
/**
|
|
48
|
-
* Defines the log level to use.
|
|
49
|
-
*/
|
|
50
|
-
export declare function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;
|
|
51
|
-
/**
|
|
52
|
-
* Checks two different things.
|
|
53
|
-
* 1. Check if IndexedDB exists in the browser environment.
|
|
54
|
-
* 2. Check if the current browser context allows IndexedDB open() calls.
|
|
55
|
-
*/
|
|
56
|
-
export declare function isSupported(): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* Deletes all activated, fetched and defaults configs and
|
|
59
|
-
* resets all Firebase Remote Config settings.
|
|
60
|
-
* Android only. iOS does not reset anything.
|
|
61
|
-
*/
|
|
62
|
-
export declare function reset(remoteConfig: RemoteConfig): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Sets defaults based on a native resource.
|
|
65
|
-
*/
|
|
66
|
-
export declare function setDefaultsFromResource(remoteConfig: RemoteConfig, resourceName: string): Promise<null>;
|
|
67
|
-
/**
|
|
68
|
-
* Registers a listener to changes in the configuration.
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
export declare function onConfigUpdate(remoteConfig: RemoteConfig, observer: ConfigUpdateObserver): Unsubscribe;
|
|
72
|
-
/**
|
|
73
|
-
* Sets the custom signals for the app instance.
|
|
74
|
-
*/
|
|
75
|
-
export declare function setCustomSignals(remoteConfig: RemoteConfig, customSignals: CustomSignals): Promise<void>;
|
|
76
|
-
//# sourceMappingURL=modular.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../../../lib/modular.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMjD,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,KAAK,EACN,MAAM,uBAAuB,CAAC;AAO/B,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,YAAY,CAY/D;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAErE;AAED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AQ,EAAE,oBAAoB,GAC7B,WAAW,CAEb;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,IAAI,CAAC,CAef"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
2
|
-
import type { FirebaseRemoteConfigTypes } from './types/namespaced';
|
|
3
|
-
export declare const SDK_VERSION = "25.1.0";
|
|
4
|
-
type RemoteConfigNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<FirebaseRemoteConfigTypes.Module, FirebaseRemoteConfigTypes.Statics> & {
|
|
5
|
-
firebase: ReactNativeFirebase.Module;
|
|
6
|
-
app(name?: string): ReactNativeFirebase.FirebaseApp;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: RemoteConfigNamespace;
|
|
9
|
-
export default _default;
|
|
10
|
-
export declare const firebase: ReactNativeFirebase.FirebaseNamespacedExport<"remoteConfig", FirebaseRemoteConfigTypes.Module, FirebaseRemoteConfigTypes.Statics, false>;
|
|
11
|
-
//# sourceMappingURL=namespaced.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"namespaced.d.ts","sourceRoot":"","sources":["../../../lib/namespaced.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAsdpE,eAAO,MAAM,WAAW,WAAU,CAAC;AAanC,KAAK,qBAAqB,GAAG,mBAAmB,CAAC,+BAA+B,CAC9E,yBAAyB,CAAC,MAAM,EAChC,yBAAyB,CAAC,OAAO,CAClC,GAAG;IACF,QAAQ,EAAE,mBAAmB,CAAC,MAAM,CAAC;IACrC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC,WAAW,CAAC;CACrD,CAAC;wBAIiD,qBAAqB;AAAxE,wBAAyE;AAKzE,eAAO,MAAM,QAAQ,EACa,mBAAmB,CAAC,wBAAwB,CAC1E,cAAc,EACd,yBAAyB,CAAC,MAAM,EAChC,yBAAyB,CAAC,OAAO,EACjC,KAAK,CACN,CAAC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
2
|
-
export declare namespace FirebaseRemoteConfigTypes {
|
|
3
|
-
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Use modular log-level types instead.
|
|
6
|
-
*/
|
|
7
|
-
type RemoteConfigLogLevel = 'debug' | 'error' | 'silent';
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Use modular constants instead.
|
|
10
|
-
*/
|
|
11
|
-
interface LastFetchStatus {
|
|
12
|
-
SUCCESS: 'success';
|
|
13
|
-
FAILURE: 'failure';
|
|
14
|
-
THROTTLED: 'throttled';
|
|
15
|
-
NO_FETCH_YET: 'no_fetch_yet';
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use modular constants instead.
|
|
19
|
-
*/
|
|
20
|
-
interface ValueSource {
|
|
21
|
-
REMOTE: 'remote';
|
|
22
|
-
DEFAULT: 'default';
|
|
23
|
-
STATIC: 'static';
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Namespaced statics remain for backwards compatibility.
|
|
27
|
-
*/
|
|
28
|
-
interface Statics {
|
|
29
|
-
ValueSource: ValueSource;
|
|
30
|
-
LastFetchStatus: LastFetchStatus;
|
|
31
|
-
SDK_VERSION: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated Use modular `Value` access patterns instead.
|
|
35
|
-
*/
|
|
36
|
-
interface ConfigValue {
|
|
37
|
-
getSource(): 'remote' | 'default' | 'static';
|
|
38
|
-
asBoolean(): true | false;
|
|
39
|
-
asNumber(): number;
|
|
40
|
-
asString(): string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated Use modular APIs instead.
|
|
44
|
-
*/
|
|
45
|
-
interface ConfigValues {
|
|
46
|
-
[key: string]: ConfigValue;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Use modular APIs instead.
|
|
50
|
-
*/
|
|
51
|
-
interface ConfigSettings {
|
|
52
|
-
minimumFetchIntervalMillis?: number;
|
|
53
|
-
fetchTimeMillis?: number;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated Use modular APIs instead.
|
|
57
|
-
*/
|
|
58
|
-
interface ConfigDefaults {
|
|
59
|
-
[key: string]: number | string | boolean;
|
|
60
|
-
}
|
|
61
|
-
type LastFetchStatusType = 'success' | 'failure' | 'no_fetch_yet' | 'throttled';
|
|
62
|
-
interface ConfigUpdate {
|
|
63
|
-
getUpdatedKeys(): Set<string>;
|
|
64
|
-
}
|
|
65
|
-
interface ConfigUpdateObserver {
|
|
66
|
-
next: (configUpdate: ConfigUpdate) => void;
|
|
67
|
-
error: (error: ReactNativeFirebase.NativeFirebaseError) => void;
|
|
68
|
-
complete: () => void;
|
|
69
|
-
}
|
|
70
|
-
type Unsubscribe = () => void;
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated Use the package default export or modular APIs instead.
|
|
73
|
-
*/
|
|
74
|
-
class Module extends FirebaseModule {
|
|
75
|
-
app: ReactNativeFirebase.FirebaseApp;
|
|
76
|
-
fetchTimeMillis: number;
|
|
77
|
-
lastFetchStatus: LastFetchStatusType;
|
|
78
|
-
settings: ConfigSettings;
|
|
79
|
-
defaultConfig: ConfigDefaults;
|
|
80
|
-
setConfigSettings(configSettings: ConfigSettings): Promise<void>;
|
|
81
|
-
setDefaults(defaults: ConfigDefaults): Promise<null>;
|
|
82
|
-
setDefaultsFromResource(resourceName: string): Promise<null>;
|
|
83
|
-
onConfigUpdate(observer: ConfigUpdateObserver): Unsubscribe;
|
|
84
|
-
onConfigUpdated(listener: CallbackOrObserver<OnConfigUpdatedListenerCallback>): () => void;
|
|
85
|
-
activate(): Promise<boolean>;
|
|
86
|
-
ensureInitialized(): Promise<void>;
|
|
87
|
-
fetch(expirationDurationSeconds?: number): Promise<void>;
|
|
88
|
-
fetchAndActivate(): Promise<boolean>;
|
|
89
|
-
getAll(): ConfigValues;
|
|
90
|
-
getValue(key: string): ConfigValue;
|
|
91
|
-
getBoolean(key: string): boolean;
|
|
92
|
-
getString(key: string): string;
|
|
93
|
-
getNumber(key: string): number;
|
|
94
|
-
reset(): Promise<void>;
|
|
95
|
-
}
|
|
96
|
-
type CallbackOrObserver<T extends (...args: any[]) => any> = T | {
|
|
97
|
-
next: T;
|
|
98
|
-
};
|
|
99
|
-
type OnConfigUpdatedListenerCallback = (event?: {
|
|
100
|
-
updatedKeys: string[];
|
|
101
|
-
}, error?: {
|
|
102
|
-
code: string;
|
|
103
|
-
message: string;
|
|
104
|
-
nativeErrorMessage: string;
|
|
105
|
-
}) => void;
|
|
106
|
-
}
|
|
107
|
-
declare module '@react-native-firebase/app' {
|
|
108
|
-
namespace ReactNativeFirebase {
|
|
109
|
-
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
|
|
110
|
-
interface Module {
|
|
111
|
-
/**
|
|
112
|
-
* @deprecated Use the package default export or modular APIs instead.
|
|
113
|
-
*/
|
|
114
|
-
remoteConfig: FirebaseModuleWithStatics<FirebaseRemoteConfigTypes.Module, FirebaseRemoteConfigTypes.Statics>;
|
|
115
|
-
}
|
|
116
|
-
interface FirebaseApp {
|
|
117
|
-
/**
|
|
118
|
-
* @deprecated Use the package default export or modular APIs instead.
|
|
119
|
-
*/
|
|
120
|
-
remoteConfig(): FirebaseRemoteConfigTypes.Module;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=namespaced.d.ts.map
|