Skip to content

Commit 21b3f73

Browse files
committed
fix: expose setConnectionMode publicly with FDv2 overloads as @internal
The public API shows setConnectionMode(mode: ConnectionMode) and getConnectionMode(): ConnectionMode. The FDv2-specific overloads accepting FDv2ConnectionMode and undefined are stripped from declarations via @internal + stripInternal.
1 parent ca00a4f commit 21b3f73

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

packages/sdk/react-native/src/ReactNativeLDClient.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,26 +201,30 @@ export default class ReactNativeLDClient extends LDClientImpl {
201201
);
202202
}
203203

204+
/**
205+
* Sets the SDK connection mode.
206+
*
207+
* @param mode The connection mode to use (`'streaming'`, `'polling'`, or `'offline'`).
208+
*/
209+
async setConnectionMode(mode: ConnectionMode): Promise<void>;
204210
/**
205211
* @internal
206212
*
207-
* This feature is experimental and should NOT be considered ready for
213+
* This overload is experimental and should NOT be considered ready for
208214
* production use. It may change or be removed without notice and is not
209215
* subject to backwards compatibility guarantees.
210216
*
211-
* Sets the connection mode for the SDK's data system.
217+
* Sets the connection mode for the FDv2 data system.
212218
*
213219
* When the FDv2 data system is enabled (`dataSystem` option), this method
214-
* accepts FDv2 connection modes (`'streaming'`, `'polling'`, `'offline'`,
215-
* `'one-shot'`, `'background'`). Pass `undefined` to clear an explicit
216-
* override and return to automatic mode selection.
217-
*
218-
* Without FDv2, this method accepts FDv1 connection modes
219-
* (`'streaming'`, `'polling'`, `'offline'`).
220+
* additionally accepts `'one-shot'` and `'background'` modes. Pass
221+
* `undefined` to clear an explicit override and return to automatic mode
222+
* selection.
220223
*
221224
* @param mode The connection mode to use, or `undefined` to clear the
222225
* override (FDv2 only).
223226
*/
227+
async setConnectionMode(mode?: FDv2ConnectionMode): Promise<void>;
224228
async setConnectionMode(mode?: ConnectionMode | FDv2ConnectionMode): Promise<void> {
225229
if (this._connectionManager) {
226230
// FDv1 path
@@ -250,6 +254,11 @@ export default class ReactNativeLDClient extends LDClientImpl {
250254
/**
251255
* Gets the SDK connection mode.
252256
*/
257+
getConnectionMode(): ConnectionMode;
258+
/**
259+
* @internal
260+
*/
261+
getConnectionMode(): FDv2ConnectionMode;
253262
getConnectionMode(): ConnectionMode | FDv2ConnectionMode {
254263
if (this._connectionManager) {
255264
return (this.dataManager as MobileDataManager).getConnectionMode();

0 commit comments

Comments
 (0)