@launchdarkly/js-client-sdk-common 1.20.0 → 1.22.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 (162) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cjs/LDClientImpl.d.ts.map +1 -1
  3. package/dist/cjs/api/LDOptions.d.ts +8 -0
  4. package/dist/cjs/api/LDOptions.d.ts.map +1 -1
  5. package/dist/cjs/api/datasource/DataSourceEntry.d.ts +45 -0
  6. package/dist/cjs/api/datasource/DataSourceEntry.d.ts.map +1 -0
  7. package/dist/cjs/api/datasource/FDv2ConnectionMode.d.ts +30 -0
  8. package/dist/cjs/api/datasource/FDv2ConnectionMode.d.ts.map +1 -0
  9. package/dist/cjs/api/datasource/LDClientDataSystemOptions.d.ts +75 -0
  10. package/dist/cjs/api/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
  11. package/dist/cjs/api/datasource/ModeDefinition.d.ts +21 -0
  12. package/dist/cjs/api/datasource/ModeDefinition.d.ts.map +1 -0
  13. package/dist/cjs/api/datasource/ModeResolution.d.ts +75 -0
  14. package/dist/cjs/api/datasource/ModeResolution.d.ts.map +1 -0
  15. package/dist/cjs/api/datasource/index.d.ts +6 -0
  16. package/dist/cjs/api/datasource/index.d.ts.map +1 -0
  17. package/dist/cjs/api/index.d.ts +1 -0
  18. package/dist/cjs/api/index.d.ts.map +1 -1
  19. package/dist/cjs/configuration/Configuration.d.ts +6 -1
  20. package/dist/cjs/configuration/Configuration.d.ts.map +1 -1
  21. package/dist/cjs/configuration/validateOptions.d.ts +95 -0
  22. package/dist/cjs/configuration/validateOptions.d.ts.map +1 -0
  23. package/dist/cjs/configuration/validators.d.ts +5 -2
  24. package/dist/cjs/configuration/validators.d.ts.map +1 -1
  25. package/dist/cjs/datasource/ConnectionModeConfig.d.ts +19 -0
  26. package/dist/cjs/datasource/ConnectionModeConfig.d.ts.map +1 -0
  27. package/dist/cjs/datasource/LDClientDataSystemOptions.d.ts +20 -0
  28. package/dist/cjs/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
  29. package/dist/cjs/datasource/ModeResolver.d.ts +30 -0
  30. package/dist/cjs/datasource/ModeResolver.d.ts.map +1 -0
  31. package/dist/cjs/datasource/StateDebounceManager.d.ts +92 -0
  32. package/dist/cjs/datasource/StateDebounceManager.d.ts.map +1 -0
  33. package/dist/cjs/datasource/fdv2/AsyncQueue.d.ts +2 -0
  34. package/dist/cjs/datasource/fdv2/AsyncQueue.d.ts.map +1 -0
  35. package/dist/cjs/datasource/fdv2/CacheInitializer.d.ts +17 -0
  36. package/dist/cjs/datasource/fdv2/CacheInitializer.d.ts.map +1 -0
  37. package/dist/cjs/datasource/fdv2/Conditions.d.ts +73 -0
  38. package/dist/cjs/datasource/fdv2/Conditions.d.ts.map +1 -0
  39. package/dist/cjs/datasource/fdv2/FDv1PollingSynchronizer.d.ts +2 -0
  40. package/dist/cjs/datasource/fdv2/FDv1PollingSynchronizer.d.ts.map +1 -0
  41. package/dist/cjs/datasource/fdv2/FDv2DataSource.d.ts +52 -0
  42. package/dist/cjs/datasource/fdv2/FDv2DataSource.d.ts.map +1 -0
  43. package/dist/cjs/datasource/fdv2/FDv2Requestor.d.ts +45 -0
  44. package/dist/cjs/datasource/fdv2/FDv2Requestor.d.ts.map +1 -0
  45. package/dist/cjs/datasource/fdv2/FDv2SourceResult.d.ts +84 -0
  46. package/dist/cjs/datasource/fdv2/FDv2SourceResult.d.ts.map +1 -0
  47. package/dist/cjs/datasource/fdv2/Initializer.d.ts +40 -0
  48. package/dist/cjs/datasource/fdv2/Initializer.d.ts.map +1 -0
  49. package/dist/cjs/datasource/fdv2/PollingBase.d.ts +2 -0
  50. package/dist/cjs/datasource/fdv2/PollingBase.d.ts.map +1 -0
  51. package/dist/cjs/datasource/fdv2/PollingInitializer.d.ts +2 -0
  52. package/dist/cjs/datasource/fdv2/PollingInitializer.d.ts.map +1 -0
  53. package/dist/cjs/datasource/fdv2/PollingSynchronizer.d.ts +2 -0
  54. package/dist/cjs/datasource/fdv2/PollingSynchronizer.d.ts.map +1 -0
  55. package/dist/cjs/datasource/fdv2/SourceManager.d.ts +88 -0
  56. package/dist/cjs/datasource/fdv2/SourceManager.d.ts.map +1 -0
  57. package/dist/cjs/datasource/fdv2/StreamingFDv2Base.d.ts +11 -0
  58. package/dist/cjs/datasource/fdv2/StreamingFDv2Base.d.ts.map +1 -0
  59. package/dist/cjs/datasource/fdv2/StreamingInitializerFDv2.d.ts +2 -0
  60. package/dist/cjs/datasource/fdv2/StreamingInitializerFDv2.d.ts.map +1 -0
  61. package/dist/cjs/datasource/fdv2/StreamingSynchronizerFDv2.d.ts +2 -0
  62. package/dist/cjs/datasource/fdv2/StreamingSynchronizerFDv2.d.ts.map +1 -0
  63. package/dist/cjs/datasource/fdv2/Synchronizer.d.ts +49 -0
  64. package/dist/cjs/datasource/fdv2/Synchronizer.d.ts.map +1 -0
  65. package/dist/cjs/datasource/fdv2/calculatePollDelay.d.ts +2 -0
  66. package/dist/cjs/datasource/fdv2/calculatePollDelay.d.ts.map +1 -0
  67. package/dist/cjs/datasource/fdv2/index.d.ts +20 -0
  68. package/dist/cjs/datasource/fdv2/index.d.ts.map +1 -0
  69. package/dist/cjs/datasource/flagEvalMapper.d.ts +3 -3
  70. package/dist/cjs/flag-manager/FlagManager.d.ts +2 -1
  71. package/dist/cjs/flag-manager/FlagManager.d.ts.map +1 -1
  72. package/dist/cjs/flag-manager/FlagPersistence.d.ts +8 -1
  73. package/dist/cjs/flag-manager/FlagPersistence.d.ts.map +1 -1
  74. package/dist/cjs/index.cjs +411 -100
  75. package/dist/cjs/index.cjs.map +1 -1
  76. package/dist/cjs/index.d.ts +5 -0
  77. package/dist/cjs/index.d.ts.map +1 -1
  78. package/dist/cjs/storage/freshness.d.ts +27 -0
  79. package/dist/cjs/storage/freshness.d.ts.map +1 -0
  80. package/dist/cjs/storage/loadCachedFlags.d.ts +25 -0
  81. package/dist/cjs/storage/loadCachedFlags.d.ts.map +1 -0
  82. package/dist/esm/LDClientImpl.d.ts.map +1 -1
  83. package/dist/esm/api/LDOptions.d.ts +8 -0
  84. package/dist/esm/api/LDOptions.d.ts.map +1 -1
  85. package/dist/esm/api/datasource/DataSourceEntry.d.ts +45 -0
  86. package/dist/esm/api/datasource/DataSourceEntry.d.ts.map +1 -0
  87. package/dist/esm/api/datasource/FDv2ConnectionMode.d.ts +30 -0
  88. package/dist/esm/api/datasource/FDv2ConnectionMode.d.ts.map +1 -0
  89. package/dist/esm/api/datasource/LDClientDataSystemOptions.d.ts +75 -0
  90. package/dist/esm/api/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
  91. package/dist/esm/api/datasource/ModeDefinition.d.ts +21 -0
  92. package/dist/esm/api/datasource/ModeDefinition.d.ts.map +1 -0
  93. package/dist/esm/api/datasource/ModeResolution.d.ts +75 -0
  94. package/dist/esm/api/datasource/ModeResolution.d.ts.map +1 -0
  95. package/dist/esm/api/datasource/index.d.ts +6 -0
  96. package/dist/esm/api/datasource/index.d.ts.map +1 -0
  97. package/dist/esm/api/index.d.ts +1 -0
  98. package/dist/esm/api/index.d.ts.map +1 -1
  99. package/dist/esm/configuration/Configuration.d.ts +6 -1
  100. package/dist/esm/configuration/Configuration.d.ts.map +1 -1
  101. package/dist/esm/configuration/validateOptions.d.ts +95 -0
  102. package/dist/esm/configuration/validateOptions.d.ts.map +1 -0
  103. package/dist/esm/configuration/validators.d.ts +5 -2
  104. package/dist/esm/configuration/validators.d.ts.map +1 -1
  105. package/dist/esm/datasource/ConnectionModeConfig.d.ts +19 -0
  106. package/dist/esm/datasource/ConnectionModeConfig.d.ts.map +1 -0
  107. package/dist/esm/datasource/LDClientDataSystemOptions.d.ts +20 -0
  108. package/dist/esm/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
  109. package/dist/esm/datasource/ModeResolver.d.ts +30 -0
  110. package/dist/esm/datasource/ModeResolver.d.ts.map +1 -0
  111. package/dist/esm/datasource/StateDebounceManager.d.ts +92 -0
  112. package/dist/esm/datasource/StateDebounceManager.d.ts.map +1 -0
  113. package/dist/esm/datasource/fdv2/AsyncQueue.d.ts +2 -0
  114. package/dist/esm/datasource/fdv2/AsyncQueue.d.ts.map +1 -0
  115. package/dist/esm/datasource/fdv2/CacheInitializer.d.ts +17 -0
  116. package/dist/esm/datasource/fdv2/CacheInitializer.d.ts.map +1 -0
  117. package/dist/esm/datasource/fdv2/Conditions.d.ts +73 -0
  118. package/dist/esm/datasource/fdv2/Conditions.d.ts.map +1 -0
  119. package/dist/esm/datasource/fdv2/FDv1PollingSynchronizer.d.ts +2 -0
  120. package/dist/esm/datasource/fdv2/FDv1PollingSynchronizer.d.ts.map +1 -0
  121. package/dist/esm/datasource/fdv2/FDv2DataSource.d.ts +52 -0
  122. package/dist/esm/datasource/fdv2/FDv2DataSource.d.ts.map +1 -0
  123. package/dist/esm/datasource/fdv2/FDv2Requestor.d.ts +45 -0
  124. package/dist/esm/datasource/fdv2/FDv2Requestor.d.ts.map +1 -0
  125. package/dist/esm/datasource/fdv2/FDv2SourceResult.d.ts +84 -0
  126. package/dist/esm/datasource/fdv2/FDv2SourceResult.d.ts.map +1 -0
  127. package/dist/esm/datasource/fdv2/Initializer.d.ts +40 -0
  128. package/dist/esm/datasource/fdv2/Initializer.d.ts.map +1 -0
  129. package/dist/esm/datasource/fdv2/PollingBase.d.ts +2 -0
  130. package/dist/esm/datasource/fdv2/PollingBase.d.ts.map +1 -0
  131. package/dist/esm/datasource/fdv2/PollingInitializer.d.ts +2 -0
  132. package/dist/esm/datasource/fdv2/PollingInitializer.d.ts.map +1 -0
  133. package/dist/esm/datasource/fdv2/PollingSynchronizer.d.ts +2 -0
  134. package/dist/esm/datasource/fdv2/PollingSynchronizer.d.ts.map +1 -0
  135. package/dist/esm/datasource/fdv2/SourceManager.d.ts +88 -0
  136. package/dist/esm/datasource/fdv2/SourceManager.d.ts.map +1 -0
  137. package/dist/esm/datasource/fdv2/StreamingFDv2Base.d.ts +11 -0
  138. package/dist/esm/datasource/fdv2/StreamingFDv2Base.d.ts.map +1 -0
  139. package/dist/esm/datasource/fdv2/StreamingInitializerFDv2.d.ts +2 -0
  140. package/dist/esm/datasource/fdv2/StreamingInitializerFDv2.d.ts.map +1 -0
  141. package/dist/esm/datasource/fdv2/StreamingSynchronizerFDv2.d.ts +2 -0
  142. package/dist/esm/datasource/fdv2/StreamingSynchronizerFDv2.d.ts.map +1 -0
  143. package/dist/esm/datasource/fdv2/Synchronizer.d.ts +49 -0
  144. package/dist/esm/datasource/fdv2/Synchronizer.d.ts.map +1 -0
  145. package/dist/esm/datasource/fdv2/calculatePollDelay.d.ts +2 -0
  146. package/dist/esm/datasource/fdv2/calculatePollDelay.d.ts.map +1 -0
  147. package/dist/esm/datasource/fdv2/index.d.ts +20 -0
  148. package/dist/esm/datasource/fdv2/index.d.ts.map +1 -0
  149. package/dist/esm/datasource/flagEvalMapper.d.ts +3 -3
  150. package/dist/esm/flag-manager/FlagManager.d.ts +2 -1
  151. package/dist/esm/flag-manager/FlagManager.d.ts.map +1 -1
  152. package/dist/esm/flag-manager/FlagPersistence.d.ts +8 -1
  153. package/dist/esm/flag-manager/FlagPersistence.d.ts.map +1 -1
  154. package/dist/esm/index.d.ts +5 -0
  155. package/dist/esm/index.d.ts.map +1 -1
  156. package/dist/esm/index.mjs +404 -102
  157. package/dist/esm/index.mjs.map +1 -1
  158. package/dist/esm/storage/freshness.d.ts +27 -0
  159. package/dist/esm/storage/freshness.d.ts.map +1 -0
  160. package/dist/esm/storage/loadCachedFlags.d.ts +25 -0
  161. package/dist/esm/storage/loadCachedFlags.d.ts.map +1 -0
  162. package/package.json +2 -2
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Connection modes for the FDv2 data system.
3
+ *
4
+ * This defines the full set of named connection modes available in FDv2.
5
+ * Each mode maps to a specific initializer/synchronizer pipeline via the
6
+ * mode table.
7
+ *
8
+ * @remarks
9
+ * The following connection modes are supported:
10
+ *
11
+ * streaming - Initializes from cache then polling. Synchronizes via streaming
12
+ * with polling fallback. Designed for mobile foreground and desktop use.
13
+ *
14
+ * polling - Initializes from cache. Synchronizes via polling at the configured
15
+ * interval.
16
+ *
17
+ * offline - Initializes from cache only. No synchronizers run. The SDK will not
18
+ * receive updates or send analytic/diagnostic events.
19
+ *
20
+ * one-shot - Initializes from cache, then polling, then streaming. No
21
+ * synchronizers run after initialization. Designed for browser SDKs where
22
+ * a single flag fetch at page load is sufficient.
23
+ *
24
+ * background - Initializes from cache. Synchronizes via polling at a reduced
25
+ * frequency (1 hour by default). Designed for mobile SDKs when the application
26
+ * is in the background.
27
+ */
28
+ type FDv2ConnectionMode = 'streaming' | 'polling' | 'offline' | 'one-shot' | 'background';
29
+ export default FDv2ConnectionMode;
30
+ //# sourceMappingURL=FDv2ConnectionMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FDv2ConnectionMode.d.ts","sourceRoot":"","sources":["../../../src/api/datasource/FDv2ConnectionMode.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,KAAK,kBAAkB,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,CAAC;AAE1F,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,75 @@
1
+ import FDv2ConnectionMode from './FDv2ConnectionMode';
2
+ /**
3
+ * Configuration for the FDv2 client-side data system.
4
+ */
5
+ export interface LDClientDataSystemOptions {
6
+ /**
7
+ * The initial connection mode the SDK should use.
8
+ *
9
+ * If not specified, the platform SDK provides a default:
10
+ * - Browser: 'one-shot'
11
+ * - React Native: 'streaming'
12
+ * - Electron: 'streaming'
13
+ *
14
+ * See {@link FDv2ConnectionMode} for the available modes.
15
+ */
16
+ initialConnectionMode?: FDv2ConnectionMode;
17
+ /**
18
+ * The connection mode to use when the application transitions to the background.
19
+ *
20
+ * This is primarily used by mobile SDKs (React Native). When the application
21
+ * enters the background, the SDK switches to this mode. When returning to
22
+ * the foreground, it switches back to the foreground mode.
23
+ *
24
+ * Set to undefined or omit to disable automatic background mode switching.
25
+ * Set to 'background' to use the built-in background mode (polling @ 1hr).
26
+ * Set to 'offline' to stop all connections in the background.
27
+ */
28
+ backgroundConnectionMode?: FDv2ConnectionMode;
29
+ /**
30
+ * Controls automatic mode switching in response to platform events.
31
+ *
32
+ * - `true` — enable all automatic switching (lifecycle + network)
33
+ * - `false` — disable all automatic switching; the user manages modes manually
34
+ * - `{ lifecycle?: boolean, network?: boolean }` — granular control over
35
+ * which platform events trigger automatic mode switches
36
+ *
37
+ * `lifecycle` controls foreground/background transitions (mobile) and
38
+ * visibility changes (browser). `network` controls pause/resume of data
39
+ * sources when network availability changes.
40
+ *
41
+ * Default is true for mobile SDKs, false/ignored for browser.
42
+ */
43
+ automaticModeSwitching?: boolean | AutomaticModeSwitchingConfig;
44
+ }
45
+ /**
46
+ * Granular control over which platform events trigger automatic mode switches.
47
+ */
48
+ export interface AutomaticModeSwitchingConfig {
49
+ /**
50
+ * Whether to automatically switch modes in response to application lifecycle
51
+ * events (foreground/background on mobile, visibility changes on browser).
52
+ *
53
+ * @defaultValue true on mobile, false on browser/desktop
54
+ */
55
+ readonly lifecycle?: boolean;
56
+ /**
57
+ * Whether to automatically pause/resume data sources in response to
58
+ * network availability changes.
59
+ *
60
+ * @defaultValue true on mobile, false on desktop
61
+ */
62
+ readonly network?: boolean;
63
+ }
64
+ /**
65
+ * Platform-specific default configuration for the FDv2 data system.
66
+ */
67
+ export interface PlatformDataSystemDefaults {
68
+ /** The default initial connection mode for this platform. */
69
+ readonly initialConnectionMode: FDv2ConnectionMode;
70
+ /** The default background connection mode, if any. */
71
+ readonly backgroundConnectionMode?: FDv2ConnectionMode;
72
+ /** Whether automatic mode switching is enabled by default. */
73
+ readonly automaticModeSwitching: boolean | AutomaticModeSwitchingConfig;
74
+ }
75
+ //# sourceMappingURL=LDClientDataSystemOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LDClientDataSystemOptions.d.ts","sourceRoot":"","sources":["../../../src/api/datasource/LDClientDataSystemOptions.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAKtD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;OASG;IACH,qBAAqB,CAAC,EAAE,kBAAkB,CAAC;IAE3C;;;;;;;;;;OAUG;IACH,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;IAE9C;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,EAAE,OAAO,GAAG,4BAA4B,CAAC;CAIjE;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,6DAA6D;IAC7D,QAAQ,CAAC,qBAAqB,EAAE,kBAAkB,CAAC;IACnD,sDAAsD;IACtD,QAAQ,CAAC,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;IACvD,8DAA8D;IAC9D,QAAQ,CAAC,sBAAsB,EAAE,OAAO,GAAG,4BAA4B,CAAC;CACzE"}
@@ -0,0 +1,21 @@
1
+ import { DataSourceEntry } from './DataSourceEntry';
2
+ /**
3
+ * Defines the data pipeline for a connection mode: which data sources
4
+ * are used during initialization and which are used for ongoing synchronization.
5
+ */
6
+ export interface ModeDefinition {
7
+ /**
8
+ * Ordered list of data sources to attempt during initialization.
9
+ * Sources are tried in order; the first that successfully provides a full
10
+ * data set transitions the SDK out of the initialization phase.
11
+ */
12
+ readonly initializers: ReadonlyArray<DataSourceEntry>;
13
+ /**
14
+ * Ordered list of data sources for ongoing synchronization after
15
+ * initialization completes. Sources are in priority order with automatic
16
+ * failover to the next source if the primary fails.
17
+ * An empty array means no synchronization occurs (e.g., offline, one-shot).
18
+ */
19
+ readonly synchronizers: ReadonlyArray<DataSourceEntry>;
20
+ }
21
+ //# sourceMappingURL=ModeDefinition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModeDefinition.d.ts","sourceRoot":"","sources":["../../../src/api/datasource/ModeDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAEtD;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACxD"}
@@ -0,0 +1,75 @@
1
+ import type FDv2ConnectionMode from './FDv2ConnectionMode';
2
+ /**
3
+ * The lifecycle state of the application.
4
+ *
5
+ * - `'foreground'` — The application is in the foreground (visible, active).
6
+ * Browser and desktop platforms always use this value.
7
+ * - `'background'` — The application is in the background (not visible).
8
+ * Only applicable to mobile platforms.
9
+ */
10
+ type LifecycleState = 'foreground' | 'background';
11
+ /**
12
+ * Input state used by the mode resolution table to determine the connection
13
+ * mode. The caller is responsible for computing the effective `foregroundMode`
14
+ * before consulting the table — for example, browser listener-driven streaming
15
+ * logic modifies `foregroundMode` externally.
16
+ */
17
+ export interface ModeState {
18
+ /** Application lifecycle state. */
19
+ readonly lifecycle: LifecycleState;
20
+ /** Whether the device has network connectivity. */
21
+ readonly networkAvailable: boolean;
22
+ /**
23
+ * The effective foreground connection mode. This is the mode the SDK should
24
+ * use when in the foreground and online. The caller computes this from
25
+ * user configuration, platform defaults, and any platform-specific logic
26
+ * (e.g., browser listener-driven streaming promotion).
27
+ */
28
+ readonly foregroundMode: FDv2ConnectionMode;
29
+ /**
30
+ * The effective background connection mode. This is the mode the SDK should
31
+ * use when in the background and online. Only meaningful on mobile platforms.
32
+ */
33
+ readonly backgroundMode: FDv2ConnectionMode;
34
+ }
35
+ /**
36
+ * A reference to a configured mode slot in the {@link ModeState}. Used in
37
+ * table entries to defer the mode decision to the caller's configuration.
38
+ *
39
+ * - `{ configured: 'foreground' }` — Resolve to `input.foregroundMode`.
40
+ * - `{ configured: 'background' }` — Resolve to `input.backgroundMode`.
41
+ */
42
+ export interface ConfiguredMode {
43
+ readonly configured: 'foreground' | 'background';
44
+ }
45
+ /**
46
+ * The result of a mode resolution entry. Either:
47
+ * - A literal {@link FDv2ConnectionMode} string (e.g., `'offline'`).
48
+ * - A {@link ConfiguredMode} object referencing a configured mode slot.
49
+ */
50
+ type ModeResolution = FDv2ConnectionMode | ConfiguredMode;
51
+ /**
52
+ * A single entry in a mode resolution table. Entries are evaluated in order;
53
+ * the first entry whose conditions all match the input state determines the
54
+ * connection mode.
55
+ */
56
+ export interface ModeResolutionEntry {
57
+ /**
58
+ * Conditions to match against the input state. All specified fields must
59
+ * match for this entry to apply. Unspecified fields match any value. An
60
+ * empty object matches all inputs (catch-all).
61
+ */
62
+ readonly conditions: Partial<ModeState>;
63
+ /**
64
+ * The mode to resolve to when this entry matches.
65
+ */
66
+ readonly mode: ModeResolution;
67
+ }
68
+ /**
69
+ * An ordered list of mode resolution entries. The first matching entry
70
+ * determines the connection mode. Tables should end with a catch-all
71
+ * entry (empty conditions) to guarantee a match.
72
+ */
73
+ type ModeResolutionTable = ReadonlyArray<ModeResolutionEntry>;
74
+ export type { LifecycleState, ModeResolution, ModeResolutionTable };
75
+ //# sourceMappingURL=ModeResolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModeResolution.d.ts","sourceRoot":"","sources":["../../../src/api/datasource/ModeResolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;GAOG;AACH,KAAK,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IAEnC,mDAAmD;IACnD,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,YAAY,GAAG,YAAY,CAAC;CAClD;AAED;;;;GAIG;AACH,KAAK,cAAc,GAAG,kBAAkB,GAAG,cAAc,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B;AAED;;;;GAIG;AACH,KAAK,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAE9D,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type { default as FDv2ConnectionMode } from './FDv2ConnectionMode';
2
+ export type { EndpointConfig, CacheDataSourceEntry, PollingDataSourceEntry, StreamingDataSourceEntry, DataSourceEntry, } from './DataSourceEntry';
3
+ export type { ModeDefinition } from './ModeDefinition';
4
+ export type { LDClientDataSystemOptions, AutomaticModeSwitchingConfig, PlatformDataSystemDefaults, } from './LDClientDataSystemOptions';
5
+ export type { LifecycleState, ModeState, ConfiguredMode, ModeResolution, ModeResolutionEntry, ModeResolutionTable, } from './ModeResolution';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/datasource/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EACV,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
@@ -10,4 +10,5 @@ export * from './LDIdentifyResult';
10
10
  export * from './LDPlugin';
11
11
  export * from './LDWaitForInitialization';
12
12
  export * from './LDContext';
13
+ export * from './datasource';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -1,15 +1,18 @@
1
1
  import { ApplicationTags, internal, LDFlagSet, LDLogger, LDPluginEnvironmentMetadata, ServiceEndpoints } from '@launchdarkly/js-sdk-common';
2
2
  import { Hook, type LDOptions } from '../api';
3
+ import type { LDClientDataSystemOptions, PlatformDataSystemDefaults } from '../api/datasource/LDClientDataSystemOptions';
3
4
  import { LDInspection } from '../api/LDInspection';
4
5
  export interface LDClientInternalOptions extends internal.LDInternalOptions {
5
6
  trackEventModifier?: (event: internal.InputCustomEvent) => internal.InputCustomEvent;
6
7
  getImplementationHooks: (environmentMetadata: LDPluginEnvironmentMetadata) => Hook[];
7
8
  credentialType: 'clientSideId' | 'mobileKey';
8
9
  getLegacyStorageKeys?: () => string[];
10
+ dataSystemDefaults?: PlatformDataSystemDefaults;
9
11
  }
10
12
  export interface Configuration {
11
13
  readonly logger: LDLogger;
12
14
  readonly maxCachedContexts: number;
15
+ readonly disableCache?: boolean;
13
16
  readonly capacity: number;
14
17
  readonly diagnosticRecordingInterval: number;
15
18
  readonly flushInterval: number;
@@ -43,6 +46,7 @@ export interface Configuration {
43
46
  readonly inspectors: LDInspection[];
44
47
  readonly credentialType: 'clientSideId' | 'mobileKey';
45
48
  readonly getImplementationHooks: (environmentMetadata: LDPluginEnvironmentMetadata) => Hook[];
49
+ readonly dataSystem?: LDClientDataSystemOptions;
46
50
  }
47
51
  declare const DEFAULT_POLLING: string;
48
52
  declare const DEFAULT_STREAM: string;
@@ -53,6 +57,7 @@ export default class ConfigurationImpl implements Configuration {
53
57
  private readonly eventsUri;
54
58
  private readonly streamUri;
55
59
  readonly maxCachedContexts = 5;
60
+ readonly disableCache: boolean;
56
61
  readonly capacity = 100;
57
62
  readonly diagnosticRecordingInterval = 900;
58
63
  readonly flushInterval = 30;
@@ -86,8 +91,8 @@ export default class ConfigurationImpl implements Configuration {
86
91
  readonly trackEventModifier: (event: internal.InputCustomEvent) => internal.InputCustomEvent;
87
92
  readonly credentialType: 'clientSideId' | 'mobileKey';
88
93
  readonly getImplementationHooks: (environmentMetadata: LDPluginEnvironmentMetadata) => Hook[];
94
+ readonly dataSystem?: LDClientDataSystemOptions;
89
95
  [index: string]: any;
90
96
  constructor(pristineOptions?: LDOptions, internalOptions?: LDClientInternalOptions);
91
- private _validateTypesAndNames;
92
97
  }
93
98
  //# sourceMappingURL=Configuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/configuration/Configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,2BAA2B,EAI3B,gBAAgB,EAEjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKnD,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,CAAC,iBAAiB;IACzE,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,KAAK,QAAQ,CAAC,gBAAgB,CAAC;IACrF,sBAAsB,EAAE,CAAC,mBAAmB,EAAE,2BAA2B,KAAK,IAAI,EAAE,CAAC;IACrF,cAAc,EAAE,cAAc,GAAG,WAAW,CAAC;IAC7C,oBAAoB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,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,MAAM,EAAE,MAAM,CAAC,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/F,SAAgB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjC,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAgB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrC,SAAgB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExC,SAAgB,gBAAgB,EAAE,gBAAgB,CAAC;IAEnD,SAAgB,YAAY,EAAE,MAAM,CAA4B;IAEhE,SAAgB,mBAAmB,EAAE,YAAY,GAAG,2BAA2B,CAAC;IAEhF,SAAgB,KAAK,EAAE,IAAI,EAAE,CAAM;IAEnC,SAAgB,UAAU,EAAE,YAAY,EAAE,CAAM;IAEhD,SAAgB,kBAAkB,EAAE,CAClC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,KAC7B,QAAQ,CAAC,gBAAgB,CAAC;IAE/B,SAAgB,cAAc,EAAE,cAAc,GAAG,WAAW,CAAC;IAC7D,SAAgB,sBAAsB,EAAE,CACtC,mBAAmB,EAAE,2BAA2B,KAC7C,IAAI,EAAE,CAAC;IACZ,SAAgB,UAAU,CAAC,EAAE,yBAAyB,CAAC;IAGvD,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;gBAGnB,eAAe,GAAE,SAAc,EAC/B,eAAe,GAAE,uBAGhB;CAoCJ"}
@@ -0,0 +1,95 @@
1
+ import { LDLogger, TypeValidator } from '@launchdarkly/js-sdk-common';
2
+ /**
3
+ * A validator that performs structured validation on compound values
4
+ * (objects, arrays, records, or union types). Returns the validated value
5
+ * on success, or undefined to preserve the default.
6
+ *
7
+ * @param defaults - The current default value for this field, passed from
8
+ * `validateOptions` so nested defaults propagate without hand-written wrappers.
9
+ */
10
+ export interface CompoundValidator extends TypeValidator {
11
+ validate(value: unknown, name: string, logger?: LDLogger, defaults?: unknown): {
12
+ value: unknown;
13
+ } | undefined;
14
+ }
15
+ /**
16
+ * Validates an options object against a map of validators and defaults.
17
+ *
18
+ * If `input` is null, undefined, or not an object the defaults are returned
19
+ * (with a warning for non-nullish non-objects).
20
+ *
21
+ * Supports special validator types created by:
22
+ * - {@link validatorOf}: recursively validates nested objects
23
+ * - {@link arrayOf}: validates arrays with per-item validation
24
+ * - {@link anyOf}: accepts the first matching validator from a list
25
+ * - {@link recordOf}: validates objects with dynamic keys
26
+ */
27
+ export default function validateOptions(input: unknown, validatorMap: Record<string, TypeValidator>, defaults: Record<string, unknown>, logger?: LDLogger, prefix?: string): Record<string, unknown>;
28
+ /**
29
+ * Creates a validator for nested objects. When used in a validator map,
30
+ * `validateOptions` will recursively validate the nested object's properties.
31
+ * Defaults for nested fields are passed through from the parent.
32
+ */
33
+ export declare function validatorOf(validators: Record<string, TypeValidator>, builtInDefaults?: Record<string, unknown>): CompoundValidator;
34
+ /**
35
+ * Creates a validator for arrays of discriminated objects. Each item in the
36
+ * array must be an object containing a `discriminant` field whose value
37
+ * selects which validator map to apply. The valid discriminant values are
38
+ * the keys of `validatorsByType`. Items that are not objects, or whose
39
+ * discriminant value is missing or unrecognized, are filtered out with a
40
+ * warning.
41
+ *
42
+ * @param discriminant - The field name used to determine each item's type.
43
+ * @param validatorsByType - A mapping from discriminant values to the
44
+ * validator maps used to validate items of that type. Each validator map
45
+ * should include a validator for the discriminant field itself.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * // Validates an array like:
50
+ * // [{ type: 'polling', pollInterval: 60 }, { type: 'cache' }]
51
+ *
52
+ * const validator = arrayOf('type', {
53
+ * cache: { type: TypeValidators.String },
54
+ * polling: { type: TypeValidators.String, pollInterval: TypeValidators.numberWithMin(30) },
55
+ * streaming: { type: TypeValidators.String, initialReconnectDelay: TypeValidators.numberWithMin(1) },
56
+ * });
57
+ * ```
58
+ */
59
+ export declare function arrayOf(discriminant: string, validatorsByType: Record<string, Record<string, TypeValidator>>): CompoundValidator;
60
+ /**
61
+ * Creates a validator that tries each provided validator in order and uses the
62
+ * first one whose `is()` check passes. For compound validators the value is
63
+ * processed through `validate()`; for simple validators the value is accepted
64
+ * as-is. If no validator matches, a warning is logged and the default is
65
+ * preserved.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * // Accepts either a boolean or a nested object with specific fields:
70
+ * anyOf(TypeValidators.Boolean, validatorOf({ lifecycle: TypeValidators.Boolean }))
71
+ * ```
72
+ */
73
+ export declare function anyOf(...validators: TypeValidator[]): CompoundValidator;
74
+ /**
75
+ * Creates a validator for objects with dynamic keys. Each key in the input
76
+ * object is checked against `keyValidator`; unrecognized keys produce a
77
+ * warning. Each value is validated by `valueValidator`. Defaults for
78
+ * individual entries are passed through from the parent so partial overrides
79
+ * preserve non-overridden entries.
80
+ *
81
+ * @param keyValidator - Validates that each key is an allowed value.
82
+ * @param valueValidator - Validates each value in the record.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * // Validates a record like { streaming: { ... }, polling: { ... } }
87
+ * // where keys must be valid connection modes:
88
+ * recordOf(
89
+ * TypeValidators.oneOf('streaming', 'polling', 'offline'),
90
+ * validatorOf({ initializers: arrayValidator, synchronizers: arrayValidator }),
91
+ * )
92
+ * ```
93
+ */
94
+ export declare function recordOf(keyValidator: TypeValidator, valueValidator: TypeValidator): CompoundValidator;
95
+ //# sourceMappingURL=validateOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateOptions.d.ts","sourceRoot":"","sources":["../../src/configuration/validateOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,aAAa,EAEd,MAAM,6BAA6B,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,QAAQ,CACN,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,QAAQ,EACjB,QAAQ,CAAC,EAAE,OAAO,GACjB;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACnC;AAMD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAC3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,MAAM,CAAC,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0DzB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACzC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACxC,iBAAiB,CAsBnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,OAAO,CACrB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,GAC9D,iBAAiB,CAuCnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,GAAG,UAAU,EAAE,aAAa,EAAE,GAAG,iBAAiB,CAevE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CACtB,YAAY,EAAE,aAAa,EAC3B,cAAc,EAAE,aAAa,GAC5B,iBAAiB,CAkCnB"}
@@ -1,5 +1,8 @@
1
1
  import { TypeValidator } from '@launchdarkly/js-sdk-common';
2
2
  import { type LDOptions } from '../api';
3
- declare const validators: Record<keyof LDOptions, TypeValidator>;
4
- export default validators;
3
+ import type { PlatformDataSystemDefaults } from '../api/datasource/LDClientDataSystemOptions';
4
+ export interface ValidatorOptions {
5
+ dataSystemDefaults?: PlatformDataSystemDefaults;
6
+ }
7
+ export default function createValidators(options?: ValidatorOptions): Record<keyof LDOptions, TypeValidator>;
5
8
  //# sourceMappingURL=validators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/configuration/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,QAAA,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,aAAa,CAgCtD,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/configuration/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAI9F,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;CACjD;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,SAAS,EAAE,aAAa,CAAC,CAyCxC"}
@@ -0,0 +1,19 @@
1
+ import type { FDv2ConnectionMode, ModeDefinition } from '../api/datasource';
2
+ /**
3
+ * A read-only mapping from each FDv2ConnectionMode to its ModeDefinition.
4
+ */
5
+ type ModeTable = {
6
+ readonly [K in FDv2ConnectionMode]: ModeDefinition;
7
+ };
8
+ declare const BACKGROUND_POLL_INTERVAL_SECONDS = 3600;
9
+ declare const connectionModeValidator: import("@launchdarkly/js-sdk-common").OneOf;
10
+ declare const modeDefinitionValidators: {
11
+ initializers: import("../configuration/validateOptions").CompoundValidator;
12
+ synchronizers: import("../configuration/validateOptions").CompoundValidator;
13
+ };
14
+ declare const MODE_DEFINITION_DEFAULTS: Record<string, unknown>;
15
+ declare const connectionModesValidator: import("../configuration/validateOptions").CompoundValidator;
16
+ declare const MODE_TABLE: ModeTable;
17
+ export type { ModeTable };
18
+ export { MODE_TABLE, MODE_DEFINITION_DEFAULTS, BACKGROUND_POLL_INTERVAL_SECONDS, connectionModeValidator, modeDefinitionValidators, connectionModesValidator, };
19
+ //# sourceMappingURL=ConnectionModeConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionModeConfig.d.ts","sourceRoot":"","sources":["../../src/datasource/ConnectionModeConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG5E;;GAEG;AACH,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,CAAC,IAAI,kBAAkB,GAAG,cAAc;CACnD,CAAC;AAEF,QAAA,MAAM,gCAAgC,OAAO,CAAC;AAG9C,QAAA,MAAM,uBAAuB,6CAM5B,CAAC;AA6BF,QAAA,MAAM,wBAAwB;;;CAG7B,CAAC;AAEF,QAAA,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAGrD,CAAC;AAEF,QAAA,MAAM,wBAAwB,8DAG7B,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,SAqBjB,CAAC;AAEF,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,wBAAwB,EACxB,gCAAgC,EAChC,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,GACzB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { PlatformDataSystemDefaults } from '../api/datasource';
2
+ declare const dataSystemValidators: {
3
+ initialConnectionMode: import("@launchdarkly/js-sdk-common").OneOf;
4
+ backgroundConnectionMode: import("@launchdarkly/js-sdk-common").OneOf;
5
+ automaticModeSwitching: import("../configuration/validateOptions").CompoundValidator;
6
+ };
7
+ /**
8
+ * Default FDv2 data system configuration for browser SDKs.
9
+ */
10
+ declare const BROWSER_DATA_SYSTEM_DEFAULTS: PlatformDataSystemDefaults;
11
+ /**
12
+ * Default FDv2 data system configuration for mobile (React Native) SDKs.
13
+ */
14
+ declare const MOBILE_DATA_SYSTEM_DEFAULTS: PlatformDataSystemDefaults;
15
+ /**
16
+ * Default FDv2 data system configuration for desktop SDKs (Electron, etc.).
17
+ */
18
+ declare const DESKTOP_DATA_SYSTEM_DEFAULTS: PlatformDataSystemDefaults;
19
+ export { dataSystemValidators, BROWSER_DATA_SYSTEM_DEFAULTS, MOBILE_DATA_SYSTEM_DEFAULTS, DESKTOP_DATA_SYSTEM_DEFAULTS, };
20
+ //# sourceMappingURL=LDClientDataSystemOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LDClientDataSystemOptions.d.ts","sourceRoot":"","sources":["../../src/datasource/LDClientDataSystemOptions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AASpE,QAAA,MAAM,oBAAoB;;;;CAIzB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,4BAA4B,EAAE,0BAInC,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,2BAA2B,EAAE,0BAIlC,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,4BAA4B,EAAE,0BAInC,CAAC;AAEF,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,GAC7B,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { FDv2ConnectionMode, ModeResolutionTable, ModeState } from '../api/datasource';
2
+ declare function resolveConnectionMode(table: ModeResolutionTable, input: ModeState): FDv2ConnectionMode;
3
+ /**
4
+ * Mode resolution table for mobile platforms (React Native, etc.).
5
+ *
6
+ * - No network → offline.
7
+ * - Background → configured background mode.
8
+ * - Foreground → configured foreground mode.
9
+ */
10
+ declare const MOBILE_TRANSITION_TABLE: ModeResolutionTable;
11
+ /**
12
+ * Mode resolution table for browser platforms.
13
+ *
14
+ * - No network → offline.
15
+ * - Otherwise → configured foreground mode.
16
+ *
17
+ * Browser listener-driven streaming (auto-promotion to streaming when change
18
+ * listeners are registered) is handled externally by the caller modifying
19
+ * `foregroundMode` before consulting this table.
20
+ */
21
+ declare const BROWSER_TRANSITION_TABLE: ModeResolutionTable;
22
+ /**
23
+ * Mode resolution table for desktop platforms (Electron, etc.).
24
+ *
25
+ * - No network → offline.
26
+ * - Otherwise → configured foreground mode.
27
+ */
28
+ declare const DESKTOP_TRANSITION_TABLE: ModeResolutionTable;
29
+ export { resolveConnectionMode, MOBILE_TRANSITION_TABLE, BROWSER_TRANSITION_TABLE, DESKTOP_TRANSITION_TABLE, };
30
+ //# sourceMappingURL=ModeResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModeResolver.d.ts","sourceRoot":"","sources":["../../src/datasource/ModeResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACV,MAAM,mBAAmB,CAAC;AAqB3B,iBAAS,qBAAqB,CAAC,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,SAAS,GAAG,kBAAkB,CAU/F;AAED;;;;;;GAMG;AACH,QAAA,MAAM,uBAAuB,EAAE,mBAI9B,CAAC;AAEF;;;;;;;;;GASG;AACH,QAAA,MAAM,wBAAwB,EAAE,mBAG/B,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,wBAAwB,EAAE,mBAG/B,CAAC;AAEF,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,GACzB,CAAC"}
@@ -0,0 +1,92 @@
1
+ import FDv2ConnectionMode from '../api/datasource/FDv2ConnectionMode';
2
+ /**
3
+ * Network availability as reported by the platform.
4
+ * - `'available'`: network is reachable
5
+ * - `'unavailable'`: network is not reachable
6
+ */
7
+ export type NetworkState = 'available' | 'unavailable';
8
+ /**
9
+ * Application lifecycle state as reported by the platform.
10
+ * - `'foreground'`: application is in the foreground / visible
11
+ * - `'background'`: application is in the background / hidden
12
+ */
13
+ export type LifecycleState = 'foreground' | 'background';
14
+ /**
15
+ * The composite pending state tracked by the debounce manager.
16
+ * Each field represents one dimension of state that can change
17
+ * independently. This state accumulates during the debounce window
18
+ * and is delivered to the reconciliation callback when the timer fires.
19
+ */
20
+ export interface PendingState {
21
+ readonly networkState: NetworkState;
22
+ readonly lifecycleState: LifecycleState;
23
+ readonly requestedMode: FDv2ConnectionMode;
24
+ }
25
+ /**
26
+ * Callback invoked when the debounce timer fires. Receives the
27
+ * final accumulated pending state after the debounce window closes.
28
+ */
29
+ export type ReconciliationCallback = (pendingState: PendingState) => void;
30
+ /** Default debounce window duration in milliseconds. */
31
+ export declare const DEFAULT_DEBOUNCE_MS = 1000;
32
+ /**
33
+ * Manages debouncing of network availability, lifecycle, and
34
+ * connection mode change events. Each event updates the relevant
35
+ * component of the pending state and resets the debounce timer.
36
+ * When the timer fires, the reconciliation callback is invoked
37
+ * with the final combined pending state.
38
+ *
39
+ * `identify()` does NOT participate in the debounce window
40
+ * (CONNMODE spec 3.5.6). Consumers must handle identify separately.
41
+ */
42
+ export interface StateDebounceManager {
43
+ /**
44
+ * Update the pending network state. Resets the debounce timer.
45
+ */
46
+ setNetworkState(state: NetworkState): void;
47
+ /**
48
+ * Update the pending lifecycle state. Resets the debounce timer.
49
+ */
50
+ setLifecycleState(state: LifecycleState): void;
51
+ /**
52
+ * Update the pending connection mode. Resets the debounce timer.
53
+ * This is how `setConnectionMode()` participates in debouncing
54
+ * (CONNMODE spec 3.5.5).
55
+ */
56
+ setRequestedMode(mode: FDv2ConnectionMode): void;
57
+ /**
58
+ * Cancel any pending debounce timer and release resources.
59
+ * After close(), further calls to set* methods will not
60
+ * trigger reconciliation.
61
+ */
62
+ close(): void;
63
+ }
64
+ /**
65
+ * Configuration for creating a {@link StateDebounceManager}.
66
+ */
67
+ export interface StateDebounceManagerConfig {
68
+ /** The initial pending state at construction time. */
69
+ initialState: PendingState;
70
+ /**
71
+ * Callback invoked when the debounce timer fires with the
72
+ * final resolved pending state.
73
+ */
74
+ onReconcile: ReconciliationCallback;
75
+ /**
76
+ * Debounce window duration in milliseconds.
77
+ * @default 1000 (1 second, per CONNMODE spec 3.5.4)
78
+ */
79
+ debounceMs?: number;
80
+ }
81
+ /**
82
+ * Creates a {@link StateDebounceManager}.
83
+ *
84
+ * The manager accumulates state changes from network, lifecycle, and
85
+ * connection mode events. Each event updates the relevant component
86
+ * of the pending state and resets the debounce timer. When the timer
87
+ * fires, the reconciliation callback receives the final combined state.
88
+ *
89
+ * @param config Configuration for the debounce manager.
90
+ */
91
+ export declare function createStateDebounceManager(config: StateDebounceManagerConfig): StateDebounceManager;
92
+ //# sourceMappingURL=StateDebounceManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateDebounceManager.d.ts","sourceRoot":"","sources":["../../src/datasource/StateDebounceManager.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,aAAa,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;AAE1E,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAE/C;;;;OAIG;IACH,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEjD;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,sDAAsD;IACtD,YAAY,EAAE,YAAY,CAAC;IAE3B;;;OAGG;IACH,WAAW,EAAE,sBAAsB,CAAC;IAEpC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,0BAA0B,GACjC,oBAAoB,CA8DtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AsyncQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncQueue.d.ts","sourceRoot":"","sources":["../../../src/datasource/fdv2/AsyncQueue.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { Context, Crypto, LDLogger, Storage } from '@launchdarkly/js-sdk-common';
2
+ /**
3
+ * Configuration for creating a cache initializer.
4
+ */
5
+ export interface CacheInitializerConfig {
6
+ /** Platform storage for reading cached data. */
7
+ storage: Storage | undefined;
8
+ /** Platform crypto for computing storage keys. */
9
+ crypto: Crypto;
10
+ /** Environment namespace (hashed SDK key). */
11
+ environmentNamespace: string;
12
+ /** The context to load cached data for. */
13
+ context: Context;
14
+ /** Optional logger. */
15
+ logger?: LDLogger;
16
+ }
17
+ //# sourceMappingURL=CacheInitializer.d.ts.map