@splitsoftware/splitio-commons 1.6.2-rc.3 → 1.6.2-rc.6

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 (272) hide show
  1. package/cjs/evaluator/index.js +10 -11
  2. package/cjs/integrations/ga/GaToSplit.js +8 -5
  3. package/cjs/sdkFactory/index.js +2 -3
  4. package/cjs/sdkManager/index.js +3 -11
  5. package/cjs/services/splitApi.js +0 -1
  6. package/cjs/storages/AbstractSplitsCacheAsync.js +7 -9
  7. package/cjs/storages/AbstractSplitsCacheSync.js +7 -9
  8. package/cjs/storages/dataLoader.js +1 -1
  9. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +5 -6
  10. package/cjs/storages/inMemory/SplitsCacheInMemory.js +7 -10
  11. package/cjs/storages/inRedis/SplitsCacheInRedis.js +15 -9
  12. package/cjs/storages/pluggable/SplitsCachePluggable.js +14 -9
  13. package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
  14. package/cjs/sync/polling/updaters/splitChangesUpdater.js +1 -1
  15. package/cjs/trackers/telemetryTracker.js +6 -0
  16. package/cjs/types.js +2 -0
  17. package/cjs/utils/key/index.js +1 -1
  18. package/cjs/utils/settingsValidation/index.js +0 -1
  19. package/esm/evaluator/index.js +10 -11
  20. package/esm/integrations/ga/GaToSplit.js +8 -5
  21. package/esm/sdkFactory/index.js +2 -3
  22. package/esm/sdkManager/index.js +3 -11
  23. package/esm/services/splitApi.js +0 -1
  24. package/esm/storages/AbstractSplitsCacheAsync.js +7 -9
  25. package/esm/storages/AbstractSplitsCacheSync.js +7 -9
  26. package/esm/storages/dataLoader.js +1 -1
  27. package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +5 -6
  28. package/esm/storages/inMemory/SplitsCacheInMemory.js +7 -10
  29. package/esm/storages/inRedis/SplitsCacheInRedis.js +15 -9
  30. package/esm/storages/pluggable/SplitsCachePluggable.js +14 -9
  31. package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
  32. package/esm/sync/polling/updaters/splitChangesUpdater.js +1 -1
  33. package/esm/trackers/telemetryTracker.js +6 -0
  34. package/esm/types.js +1 -0
  35. package/esm/utils/key/index.js +1 -1
  36. package/esm/utils/settingsValidation/index.js +0 -1
  37. package/package.json +2 -2
  38. package/src/consent/sdkUserConsent.ts +3 -4
  39. package/src/dtos/types.ts +8 -0
  40. package/src/evaluator/Engine.ts +3 -3
  41. package/src/evaluator/combiners/and.ts +1 -1
  42. package/src/evaluator/combiners/ifelseif.ts +3 -3
  43. package/src/evaluator/condition/engineUtils.ts +1 -1
  44. package/src/evaluator/condition/index.ts +6 -6
  45. package/src/evaluator/index.ts +18 -19
  46. package/src/evaluator/matchers/all.ts +1 -1
  47. package/src/evaluator/matchers/between.ts +1 -1
  48. package/src/evaluator/matchers/boolean.ts +1 -1
  49. package/src/evaluator/matchers/cont_all.ts +1 -1
  50. package/src/evaluator/matchers/cont_any.ts +1 -1
  51. package/src/evaluator/matchers/cont_str.ts +1 -1
  52. package/src/evaluator/matchers/dependency.ts +1 -1
  53. package/src/evaluator/matchers/eq.ts +1 -1
  54. package/src/evaluator/matchers/eq_set.ts +1 -1
  55. package/src/evaluator/matchers/ew.ts +1 -1
  56. package/src/evaluator/matchers/gte.ts +1 -1
  57. package/src/evaluator/matchers/index.ts +1 -1
  58. package/src/evaluator/matchers/lte.ts +1 -1
  59. package/src/evaluator/matchers/part_of.ts +1 -1
  60. package/src/evaluator/matchers/segment.ts +1 -1
  61. package/src/evaluator/matchers/string.ts +1 -1
  62. package/src/evaluator/matchers/sw.ts +1 -1
  63. package/src/evaluator/matchers/whitelist.ts +1 -1
  64. package/src/evaluator/parser/index.ts +3 -3
  65. package/src/evaluator/types.ts +6 -6
  66. package/src/evaluator/value/index.ts +4 -4
  67. package/src/evaluator/value/sanitize.ts +4 -4
  68. package/src/integrations/ga/GaToSplit.ts +15 -11
  69. package/src/integrations/ga/SplitToGa.ts +10 -10
  70. package/src/integrations/ga/types.ts +4 -4
  71. package/src/integrations/pluggable.ts +3 -3
  72. package/src/integrations/types.ts +4 -3
  73. package/src/logger/index.ts +3 -3
  74. package/src/logger/sdkLogger.ts +2 -1
  75. package/src/logger/types.ts +16 -0
  76. package/src/readiness/sdkReadinessManager.ts +1 -1
  77. package/src/readiness/types.ts +9 -2
  78. package/src/sdkClient/client.ts +13 -13
  79. package/src/sdkClient/clientAttributesDecoration.ts +9 -9
  80. package/src/sdkClient/clientCS.ts +4 -3
  81. package/src/sdkClient/clientInputValidation.ts +15 -15
  82. package/src/sdkClient/sdkClient.ts +2 -2
  83. package/src/sdkClient/sdkClientMethod.ts +2 -2
  84. package/src/sdkClient/sdkClientMethodCS.ts +9 -9
  85. package/src/sdkClient/sdkClientMethodCSWithTT.ts +9 -9
  86. package/src/sdkFactory/index.ts +4 -5
  87. package/src/sdkFactory/types.ts +4 -4
  88. package/src/sdkManager/index.ts +7 -16
  89. package/src/services/splitApi.ts +0 -1
  90. package/src/storages/AbstractSplitsCacheAsync.ts +13 -14
  91. package/src/storages/AbstractSplitsCacheSync.ts +14 -16
  92. package/src/storages/dataLoader.ts +3 -3
  93. package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +1 -1
  94. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +10 -12
  95. package/src/storages/inLocalStorage/index.ts +2 -3
  96. package/src/storages/inMemory/EventsCacheInMemory.ts +4 -4
  97. package/src/storages/inMemory/SplitsCacheInMemory.ts +10 -14
  98. package/src/storages/inRedis/EventsCacheInRedis.ts +4 -4
  99. package/src/storages/inRedis/ImpressionsCacheInRedis.ts +1 -1
  100. package/src/storages/inRedis/RedisAdapter.ts +1 -1
  101. package/src/storages/inRedis/SegmentsCacheInRedis.ts +1 -1
  102. package/src/storages/inRedis/SplitsCacheInRedis.ts +22 -18
  103. package/src/storages/inRedis/TelemetryCacheInRedis.ts +1 -1
  104. package/src/storages/inRedis/index.ts +2 -3
  105. package/src/storages/pluggable/EventsCachePluggable.ts +4 -4
  106. package/src/storages/pluggable/ImpressionsCachePluggable.ts +1 -1
  107. package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
  108. package/src/storages/pluggable/SplitsCachePluggable.ts +21 -18
  109. package/src/storages/pluggable/TelemetryCachePluggable.ts +1 -1
  110. package/src/storages/pluggable/index.ts +3 -3
  111. package/src/storages/pluggable/wrapperAdapter.ts +1 -1
  112. package/src/storages/types.ts +30 -54
  113. package/src/sync/offline/LocalhostFromObject.ts +4 -4
  114. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +8 -8
  115. package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +5 -6
  116. package/src/sync/polling/updaters/mySegmentsUpdater.ts +1 -1
  117. package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
  118. package/src/sync/polling/updaters/splitChangesUpdater.ts +3 -3
  119. package/src/sync/streaming/SSEHandler/index.ts +1 -1
  120. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
  121. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
  122. package/src/sync/submitters/submitter.ts +1 -1
  123. package/src/sync/submitters/types.ts +2 -2
  124. package/src/sync/syncTask.ts +1 -1
  125. package/src/trackers/eventTracker.ts +3 -3
  126. package/src/trackers/impressionsTracker.ts +3 -3
  127. package/src/trackers/telemetryTracker.ts +7 -2
  128. package/src/trackers/types.ts +8 -4
  129. package/src/types.ts +1263 -0
  130. package/src/utils/constants/index.ts +1 -1
  131. package/src/utils/inputValidation/apiKey.ts +1 -1
  132. package/src/utils/inputValidation/attribute.ts +1 -1
  133. package/src/utils/inputValidation/attributes.ts +3 -3
  134. package/src/utils/inputValidation/event.ts +1 -1
  135. package/src/utils/inputValidation/eventProperties.ts +3 -3
  136. package/src/utils/inputValidation/eventValue.ts +1 -1
  137. package/src/utils/inputValidation/isOperational.ts +1 -1
  138. package/src/utils/inputValidation/key.ts +3 -3
  139. package/src/utils/inputValidation/preloadedData.ts +3 -3
  140. package/src/utils/inputValidation/split.ts +1 -1
  141. package/src/utils/inputValidation/splitExistance.ts +1 -1
  142. package/src/utils/inputValidation/splits.ts +1 -1
  143. package/src/utils/inputValidation/trafficType.ts +1 -1
  144. package/src/utils/inputValidation/trafficTypeExistance.ts +1 -1
  145. package/src/utils/key/index.ts +9 -9
  146. package/src/utils/settingsValidation/consent.ts +2 -1
  147. package/src/utils/settingsValidation/impressionsMode.ts +3 -3
  148. package/src/utils/settingsValidation/index.ts +0 -1
  149. package/src/utils/settingsValidation/integrations/common.ts +1 -1
  150. package/src/utils/settingsValidation/integrations/configurable.ts +1 -1
  151. package/src/utils/settingsValidation/integrations/pluggable.ts +2 -1
  152. package/src/utils/settingsValidation/localhost/builtin.ts +2 -1
  153. package/src/utils/settingsValidation/localhost/pluggable.ts +2 -1
  154. package/src/utils/settingsValidation/logger/builtinLogger.ts +2 -1
  155. package/src/utils/settingsValidation/logger/pluggableLogger.ts +2 -1
  156. package/src/utils/settingsValidation/splitFilters.ts +9 -7
  157. package/src/utils/settingsValidation/storage/storageCS.ts +2 -1
  158. package/types/consent/sdkUserConsent.d.ts +9 -2
  159. package/types/dtos/types.d.ts +6 -0
  160. package/types/evaluator/Engine.d.ts +3 -3
  161. package/types/evaluator/combiners/and.d.ts +1 -1
  162. package/types/evaluator/combiners/ifelseif.d.ts +1 -1
  163. package/types/evaluator/condition/engineUtils.d.ts +1 -1
  164. package/types/evaluator/condition/index.d.ts +1 -1
  165. package/types/evaluator/index.d.ts +4 -4
  166. package/types/evaluator/matchers/all.d.ts +1 -1
  167. package/types/evaluator/matchers/between.d.ts +1 -1
  168. package/types/evaluator/matchers/boolean.d.ts +1 -1
  169. package/types/evaluator/matchers/cont_all.d.ts +1 -1
  170. package/types/evaluator/matchers/cont_any.d.ts +1 -1
  171. package/types/evaluator/matchers/cont_str.d.ts +1 -1
  172. package/types/evaluator/matchers/dependency.d.ts +1 -1
  173. package/types/evaluator/matchers/eq.d.ts +1 -1
  174. package/types/evaluator/matchers/eq_set.d.ts +1 -1
  175. package/types/evaluator/matchers/ew.d.ts +1 -1
  176. package/types/evaluator/matchers/gte.d.ts +1 -1
  177. package/types/evaluator/matchers/index.d.ts +1 -1
  178. package/types/evaluator/matchers/lte.d.ts +1 -1
  179. package/types/evaluator/matchers/part_of.d.ts +1 -1
  180. package/types/evaluator/matchers/segment.d.ts +1 -1
  181. package/types/evaluator/matchers/string.d.ts +1 -1
  182. package/types/evaluator/matchers/sw.d.ts +1 -1
  183. package/types/evaluator/matchers/whitelist.d.ts +1 -1
  184. package/types/evaluator/parser/index.d.ts +1 -1
  185. package/types/evaluator/types.d.ts +6 -6
  186. package/types/evaluator/value/index.d.ts +3 -3
  187. package/types/evaluator/value/sanitize.d.ts +3 -3
  188. package/types/integrations/ga/GaToSplit.d.ts +4 -4
  189. package/types/integrations/ga/SplitToGa.d.ts +4 -4
  190. package/types/integrations/ga/types.d.ts +4 -4
  191. package/types/integrations/types.d.ts +4 -3
  192. package/types/logger/index.d.ts +5 -3
  193. package/types/logger/sdkLogger.d.ts +2 -1
  194. package/types/logger/types.d.ts +11 -0
  195. package/types/readiness/sdkReadinessManager.d.ts +1 -1
  196. package/types/readiness/types.d.ts +8 -2
  197. package/types/sdkClient/client.d.ts +2 -2
  198. package/types/sdkClient/clientAttributesDecoration.d.ts +8 -8
  199. package/types/sdkClient/clientCS.d.ts +3 -2
  200. package/types/sdkClient/clientInputValidation.d.ts +2 -2
  201. package/types/sdkClient/sdkClient.d.ts +2 -2
  202. package/types/sdkClient/sdkClientMethod.d.ts +2 -2
  203. package/types/sdkClient/sdkClientMethodCS.d.ts +2 -2
  204. package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +2 -2
  205. package/types/sdkFactory/index.d.ts +2 -2
  206. package/types/sdkFactory/types.d.ts +6 -6
  207. package/types/sdkManager/index.d.ts +3 -3
  208. package/types/storages/AbstractSplitsCacheAsync.d.ts +6 -5
  209. package/types/storages/AbstractSplitsCacheSync.d.ts +5 -5
  210. package/types/storages/dataLoader.d.ts +2 -2
  211. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +1 -1
  212. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +4 -3
  213. package/types/storages/inLocalStorage/index.d.ts +2 -2
  214. package/types/storages/inMemory/EventsCacheInMemory.d.ts +3 -3
  215. package/types/storages/inMemory/InMemoryStorage.d.ts +1 -1
  216. package/types/storages/inMemory/InMemoryStorageCS.d.ts +1 -1
  217. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +3 -2
  218. package/types/storages/inRedis/EventsCacheInRedis.d.ts +3 -3
  219. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +1 -1
  220. package/types/storages/inRedis/RedisAdapter.d.ts +1 -1
  221. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +1 -1
  222. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +7 -6
  223. package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +1 -1
  224. package/types/storages/inRedis/index.d.ts +2 -2
  225. package/types/storages/pluggable/EventsCachePluggable.d.ts +3 -3
  226. package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +1 -1
  227. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +1 -1
  228. package/types/storages/pluggable/SplitsCachePluggable.d.ts +7 -6
  229. package/types/storages/pluggable/TelemetryCachePluggable.d.ts +1 -1
  230. package/types/storages/pluggable/index.d.ts +2 -3
  231. package/types/storages/pluggable/wrapperAdapter.d.ts +1 -1
  232. package/types/storages/types.d.ts +28 -54
  233. package/types/sync/offline/LocalhostFromObject.d.ts +2 -2
  234. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +1 -1
  235. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +1 -1
  236. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +2 -2
  237. package/types/sync/streaming/SSEHandler/index.d.ts +1 -1
  238. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +1 -1
  239. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +1 -1
  240. package/types/sync/submitters/submitter.d.ts +1 -1
  241. package/types/sync/submitters/types.d.ts +2 -2
  242. package/types/sync/syncTask.d.ts +1 -1
  243. package/types/trackers/types.d.ts +8 -4
  244. package/types/types.d.ts +1261 -0
  245. package/types/utils/constants/index.d.ts +1 -1
  246. package/types/utils/inputValidation/apiKey.d.ts +1 -1
  247. package/types/utils/inputValidation/attribute.d.ts +1 -1
  248. package/types/utils/inputValidation/attributes.d.ts +3 -3
  249. package/types/utils/inputValidation/event.d.ts +1 -1
  250. package/types/utils/inputValidation/eventProperties.d.ts +3 -3
  251. package/types/utils/inputValidation/eventValue.d.ts +1 -1
  252. package/types/utils/inputValidation/isOperational.d.ts +1 -1
  253. package/types/utils/inputValidation/key.d.ts +3 -3
  254. package/types/utils/inputValidation/preloadedData.d.ts +3 -3
  255. package/types/utils/inputValidation/split.d.ts +1 -1
  256. package/types/utils/inputValidation/splitExistance.d.ts +1 -1
  257. package/types/utils/inputValidation/splits.d.ts +1 -1
  258. package/types/utils/inputValidation/trafficType.d.ts +1 -1
  259. package/types/utils/inputValidation/trafficTypeExistance.d.ts +1 -1
  260. package/types/utils/key/index.d.ts +4 -4
  261. package/types/utils/settingsValidation/consent.d.ts +2 -1
  262. package/types/utils/settingsValidation/impressionsMode.d.ts +3 -3
  263. package/types/utils/settingsValidation/integrations/common.d.ts +1 -1
  264. package/types/utils/settingsValidation/integrations/configurable.d.ts +1 -1
  265. package/types/utils/settingsValidation/integrations/pluggable.d.ts +2 -1
  266. package/types/utils/settingsValidation/localhost/builtin.d.ts +2 -1
  267. package/types/utils/settingsValidation/localhost/pluggable.d.ts +2 -1
  268. package/types/utils/settingsValidation/logger/builtinLogger.d.ts +1 -1
  269. package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +1 -1
  270. package/types/utils/settingsValidation/splitFilters.d.ts +2 -1
  271. package/types/utils/settingsValidation/storage/storageCS.d.ts +3 -2
  272. package/src/types.d.ts +0 -1646
@@ -0,0 +1,1261 @@
1
+ import { ISplitFiltersValidation } from './dtos/types';
2
+ import { IIntegration, IIntegrationFactoryParams } from './integrations/types';
3
+ import { ILogger } from './logger/types';
4
+ import { ISdkFactoryContext } from './sdkFactory/types';
5
+ import { IStorageFactoryParams, IStorageSync, IStorageAsync, IStorageSyncFactory, IStorageAsyncFactory } from './storages/types';
6
+ import { ISyncManagerCS } from './sync/types';
7
+ /**
8
+ * Reduced version of NodeJS.EventEmitter interface with the minimal methods used by the SDK
9
+ * @see {@link https://nodejs.org/api/events.html}
10
+ */
11
+ export interface IEventEmitter {
12
+ addListener(event: string, listener: (...args: any[]) => void): this;
13
+ on(event: string, listener: (...args: any[]) => void): this;
14
+ once(event: string, listener: (...args: any[]) => void): this;
15
+ removeListener(event: string, listener: (...args: any[]) => void): this;
16
+ off(event: string, listener: (...args: any[]) => void): this;
17
+ removeAllListeners(event?: string): this;
18
+ emit(event: string, ...args: any[]): boolean;
19
+ }
20
+ /**
21
+ * impression DTO generated by the Sdk client when processing evaluations
22
+ */
23
+ export declare type ImpressionDTO = {
24
+ feature: string;
25
+ keyName: string;
26
+ treatment: string;
27
+ time: number;
28
+ bucketingKey?: string;
29
+ label: string;
30
+ changeNumber: number;
31
+ pt?: number;
32
+ };
33
+ /** splitio.d.ts */
34
+ /**
35
+ * @typedef {Object} EventConsts
36
+ * @property {string} SDK_READY The ready event.
37
+ * @property {string} SDK_READY_FROM_CACHE The ready event when fired with cached data.
38
+ * @property {string} SDK_READY_TIMED_OUT The timeout event.
39
+ * @property {string} SDK_UPDATE The update event.
40
+ */
41
+ declare type EventConsts = {
42
+ SDK_READY: 'init::ready';
43
+ SDK_READY_FROM_CACHE: 'init::cache-ready';
44
+ SDK_READY_TIMED_OUT: 'init::timeout';
45
+ SDK_UPDATE: 'state::update';
46
+ };
47
+ /**
48
+ * SDK Modes.
49
+ * @typedef {string} SDKMode
50
+ */
51
+ export declare type SDKMode = 'standalone' | 'consumer' | 'localhost' | 'consumer_partial';
52
+ /**
53
+ * User consent status.
54
+ * @typedef {string} ConsentStatus
55
+ */
56
+ export declare type ConsentStatus = 'GRANTED' | 'DECLINED' | 'UNKNOWN';
57
+ /**
58
+ * Settings interface. This is a representation of the settings the SDK expose, that's why
59
+ * most of it's props are readonly. Only features should be rewritten when localhost mode is active.
60
+ * @interface ISettings
61
+ *
62
+ * NOTE: same ISettings interface from public type declarations extended with private properties.
63
+ */
64
+ export interface ISettings {
65
+ readonly core: {
66
+ authorizationKey: string;
67
+ key: SplitIO.SplitKey;
68
+ trafficType?: string;
69
+ labelsEnabled: boolean;
70
+ IPAddressesEnabled: boolean;
71
+ };
72
+ readonly mode: SDKMode;
73
+ readonly scheduler: {
74
+ featuresRefreshRate: number;
75
+ impressionsRefreshRate: number;
76
+ impressionsQueueSize: number;
77
+ /**
78
+ * @deprecated
79
+ */
80
+ metricsRefreshRate?: number;
81
+ telemetryRefreshRate: number;
82
+ segmentsRefreshRate: number;
83
+ offlineRefreshRate: number;
84
+ eventsPushRate: number;
85
+ eventsQueueSize: number;
86
+ pushRetryBackoffBase: number;
87
+ };
88
+ readonly startup: {
89
+ readyTimeout: number;
90
+ requestTimeoutBeforeReady: number;
91
+ retriesOnFailureBeforeReady: number;
92
+ eventsFirstPushWindow: number;
93
+ };
94
+ readonly storage: IStorageSyncFactory | IStorageAsyncFactory;
95
+ readonly integrations: Array<{
96
+ readonly type: string;
97
+ (params: IIntegrationFactoryParams): IIntegration | void;
98
+ }>;
99
+ readonly urls: {
100
+ events: string;
101
+ sdk: string;
102
+ auth: string;
103
+ streaming: string;
104
+ telemetry: string;
105
+ };
106
+ readonly debug: boolean | LogLevel | ILogger;
107
+ readonly version: string;
108
+ features: SplitIO.MockedFeaturesFilePath | SplitIO.MockedFeaturesMap;
109
+ readonly streamingEnabled: boolean;
110
+ readonly sync: {
111
+ splitFilters: SplitIO.SplitFilter[];
112
+ impressionsMode: SplitIO.ImpressionsMode;
113
+ __splitFiltersValidation: ISplitFiltersValidation;
114
+ localhostMode?: SplitIO.LocalhostFactory;
115
+ enabled: boolean;
116
+ };
117
+ readonly runtime: {
118
+ ip: string | false;
119
+ hostname: string | false;
120
+ };
121
+ readonly log: ILogger;
122
+ readonly impressionListener?: unknown;
123
+ readonly userConsent?: ConsentStatus;
124
+ }
125
+ /**
126
+ * Log levels.
127
+ * @typedef {string} LogLevel
128
+ */
129
+ export declare type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'NONE';
130
+ /**
131
+ * Logger API
132
+ * @interface ILoggerAPI
133
+ */
134
+ export interface ILoggerAPI {
135
+ /**
136
+ * Enables SDK logging to the console.
137
+ * @function enable
138
+ * @returns {void}
139
+ */
140
+ enable(): void;
141
+ /**
142
+ * Disables SDK logging.
143
+ * @function disable
144
+ * @returns {void}
145
+ */
146
+ disable(): void;
147
+ /**
148
+ * Sets a log level for the SDK logs.
149
+ * @function setLogLevel
150
+ * @returns {void}
151
+ */
152
+ setLogLevel(logLevel: LogLevel): void;
153
+ /**
154
+ * Log level constants. Use this to pass them to setLogLevel function.
155
+ */
156
+ LogLevel: {
157
+ [level: string]: LogLevel;
158
+ };
159
+ }
160
+ /**
161
+ * Common settings between Browser and NodeJS settings interface.
162
+ * @interface ISharedSettings
163
+ */
164
+ interface ISharedSettings {
165
+ /**
166
+ * Whether the logger should be enabled or disabled by default.
167
+ * @property {Boolean} debug
168
+ * @default false
169
+ */
170
+ debug?: boolean;
171
+ /**
172
+ * The impression listener, which is optional. Whatever you provide here needs to comply with the SplitIO.IImpressionListener interface,
173
+ * which will check for the logImpression method.
174
+ * @property {IImpressionListener} impressionListener
175
+ * @default undefined
176
+ */
177
+ impressionListener?: SplitIO.IImpressionListener;
178
+ /**
179
+ * Boolean flag to enable the streaming service as default synchronization mechanism. In the event of any issue with streaming,
180
+ * the SDK would fallback to the polling mechanism. If false, the SDK would poll for changes as usual without attempting to use streaming.
181
+ * @property {boolean} streamingEnabled
182
+ * @default true
183
+ */
184
+ streamingEnabled?: boolean;
185
+ /**
186
+ * SDK synchronization settings.
187
+ * @property {Object} sync
188
+ */
189
+ sync?: {
190
+ /**
191
+ * List of Split filters. These filters are used to fetch a subset of the Splits definitions in your environment, in order to reduce the delay of the SDK to be ready.
192
+ * This configuration is only meaningful when the SDK is working in "standalone" mode.
193
+ *
194
+ * At the moment, two types of split filters are supported: by name and by prefix.
195
+ * Example:
196
+ * `splitFilter: [
197
+ * { type: 'byName', values: ['my_split_1', 'my_split_2'] }, // will fetch splits named 'my_split_1' and 'my_split_2'
198
+ * { type: 'byPrefix', values: ['testing'] } // will fetch splits whose names start with 'testing__' prefix
199
+ * ]`
200
+ * @property {SplitIO.SplitFilter[]} splitFilters
201
+ */
202
+ splitFilters?: SplitIO.SplitFilter[];
203
+ /**
204
+ * Impressions Collection Mode. Option to determine how impressions are going to be sent to Split Servers.
205
+ * Possible values are 'DEBUG' and 'OPTIMIZED'.
206
+ * - DEBUG: will send all the impressions generated (recommended only for debugging purposes).
207
+ * - OPTIMIZED: will send unique impressions to Split Servers avoiding a considerable amount of traffic that duplicated impressions could generate.
208
+ * @property {String} impressionsMode
209
+ * @default 'OPTIMIZED'
210
+ */
211
+ impressionsMode?: SplitIO.ImpressionsMode;
212
+ /**
213
+ * Enables synchronization.
214
+ * @property {boolean} enabled
215
+ */
216
+ enabled: boolean;
217
+ };
218
+ }
219
+ /**
220
+ * Common settings interface for SDK instances on NodeJS.
221
+ * @interface INodeBasicSettings
222
+ * @extends ISharedSettings
223
+ */
224
+ interface INodeBasicSettings extends ISharedSettings {
225
+ /**
226
+ * SDK Startup settings for NodeJS.
227
+ * @property {Object} startup
228
+ */
229
+ startup?: {
230
+ /**
231
+ * Maximum amount of time used before notify a timeout.
232
+ * @property {number} readyTimeout
233
+ * @default 15
234
+ */
235
+ readyTimeout?: number;
236
+ /**
237
+ * Time to wait for a request before the SDK is ready. If this time expires, JS Sdk will retry 'retriesOnFailureBeforeReady' times before notifying its failure to be 'ready'.
238
+ * @property {number} requestTimeoutBeforeReady
239
+ * @default 15
240
+ */
241
+ requestTimeoutBeforeReady?: number;
242
+ /**
243
+ * How many quick retries we will do while starting up the SDK.
244
+ * @property {number} retriesOnFailureBeforeReady
245
+ * @default 1
246
+ */
247
+ retriesOnFailureBeforeReady?: number;
248
+ /**
249
+ * For SDK posts the queued events data in bulks with a given rate, but the first push window is defined separately,
250
+ * to better control on browsers. This number defines that window before the first events push.
251
+ *
252
+ * @property {number} eventsFirstPushWindow
253
+ * @default 0
254
+ */
255
+ eventsFirstPushWindow?: number;
256
+ };
257
+ /**
258
+ * SDK scheduler settings.
259
+ * @property {Object} scheduler
260
+ */
261
+ scheduler?: {
262
+ /**
263
+ * The SDK polls Split servers for changes to feature roll-out plans. This parameter controls this polling period in seconds.
264
+ * @property {number} featuresRefreshRate
265
+ * @default 5
266
+ */
267
+ featuresRefreshRate?: number;
268
+ /**
269
+ * The SDK sends information on who got what treatment at what time back to Split servers to power analytics. This parameter controls how often this data is sent to Split servers. The parameter should be in seconds.
270
+ * @property {number} impressionsRefreshRate
271
+ * @default 300
272
+ */
273
+ impressionsRefreshRate?: number;
274
+ /**
275
+ * The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
276
+ * If you use a 0 here, the queue will have no maximum size.
277
+ * @property {number} impressionsQueueSize
278
+ * @default 30000
279
+ */
280
+ impressionsQueueSize?: number;
281
+ /**
282
+ * The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
283
+ * @property {number} metricsRefreshRate
284
+ * @default 120
285
+ * @deprecated This parameter is ignored now.
286
+ */
287
+ metricsRefreshRate?: number;
288
+ /**
289
+ * The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
290
+ * @property {number} telemetryRefreshRate
291
+ * @default 3600
292
+ */
293
+ telemetryRefreshRate?: number;
294
+ /**
295
+ * The SDK polls Split servers for changes to segment definitions. This parameter controls this polling period in seconds.
296
+ * @property {number} segmentsRefreshRate
297
+ * @default 60
298
+ */
299
+ segmentsRefreshRate?: number;
300
+ /**
301
+ * The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
302
+ * @property {number} eventsPushRate
303
+ * @default 60
304
+ */
305
+ eventsPushRate?: number;
306
+ /**
307
+ * The maximum number of event items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
308
+ * If you use a 0 here, the queue will have no maximum size.
309
+ * @property {number} eventsQueueSize
310
+ * @default 500
311
+ */
312
+ eventsQueueSize?: number;
313
+ /**
314
+ * For mocking/testing only. The SDK will refresh the features mocked data when mode is set to "localhost" by defining the key.
315
+ * For more information @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#localhost-mode}
316
+ * @property {number} offlineRefreshRate
317
+ * @default 15
318
+ */
319
+ offlineRefreshRate?: number;
320
+ /**
321
+ * When using streaming mode, seconds to wait before re attempting to connect for push notifications.
322
+ * Next attempts follow intervals in power of two: base seconds, base x 2 seconds, base x 4 seconds, ...
323
+ * @property {number} pushRetryBackoffBase
324
+ * @default 1
325
+ */
326
+ pushRetryBackoffBase?: number;
327
+ };
328
+ /**
329
+ * SDK Core settings for NodeJS.
330
+ * @property {Object} core
331
+ */
332
+ core: {
333
+ /**
334
+ * Your API key. More information: @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
335
+ * @property {string} authorizationKey
336
+ */
337
+ authorizationKey: string;
338
+ /**
339
+ * Disable labels from being sent to Split backend. Labels may contain sensitive information.
340
+ * @property {boolean} labelsEnabled
341
+ * @default true
342
+ */
343
+ labelsEnabled?: boolean;
344
+ /**
345
+ * Disable machine IP and Name from being sent to Split backend.
346
+ * @property {boolean} IPAddressesEnabled
347
+ * @default true
348
+ */
349
+ IPAddressesEnabled?: boolean;
350
+ };
351
+ /**
352
+ * Defines which kind of storage we should instanciate.
353
+ * @property {Object} storage
354
+ */
355
+ storage?: (params: any) => any;
356
+ /**
357
+ * The SDK mode. Possible values are "standalone" (which is the default) and "consumer". For "localhost" mode, use "localhost" as authorizationKey.
358
+ * @property {SDKMode} mode
359
+ * @default standalone
360
+ */
361
+ mode?: SDKMode;
362
+ /**
363
+ * Mocked features file path. For testing purposses only. For using this you should specify "localhost" as authorizationKey on core settings.
364
+ * @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#localhost-mode}
365
+ * @property {MockedFeaturesFilePath} features
366
+ * @default $HOME/.split
367
+ */
368
+ features?: SplitIO.MockedFeaturesFilePath;
369
+ }
370
+ /**
371
+ * Common API for entities that expose status handlers.
372
+ * @interface IStatusInterface
373
+ * @extends IEventEmitter
374
+ */
375
+ export interface IStatusInterface extends IEventEmitter {
376
+ /**
377
+ * Constant object containing the SDK events for you to use.
378
+ * @property {EventConsts} Event
379
+ */
380
+ Event: EventConsts;
381
+ /**
382
+ * Returns a promise that will be resolved once the SDK has finished loading (SDK_READY event emitted) or rejected if the SDK has timedout (SDK_READY_TIMED_OUT event emitted).
383
+ * As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, calling the `ready` method after the
384
+ * SDK had timed out will return a new promise that should eventually resolve if the SDK gets ready.
385
+ *
386
+ * Caveats: the method was designed to avoid an unhandled Promise rejection if the rejection case is not handled, so that `onRejected` handler is optional when using promises.
387
+ * However, when using async/await syntax, the rejection should be explicitly propagated like in the following example:
388
+ * ```
389
+ * try {
390
+ * await client.ready().catch((e) => { throw e; });
391
+ * // SDK is ready
392
+ * } catch(e) {
393
+ * // SDK has timedout
394
+ * }
395
+ * ```
396
+ *
397
+ * @function ready
398
+ * @returns {Promise<void>}
399
+ */
400
+ ready(): Promise<void>;
401
+ }
402
+ /**
403
+ * Common definitions between clients for different environments interface.
404
+ * @interface IBasicClient
405
+ * @extends IStatusInterface
406
+ */
407
+ interface IBasicClient extends IStatusInterface {
408
+ /**
409
+ * Destroy the client instance.
410
+ * @function destroy
411
+ * @returns {Promise<void>}
412
+ */
413
+ destroy(): Promise<void>;
414
+ isClientSide: boolean;
415
+ }
416
+ /**
417
+ * Common definitions between SDK instances for different environments interface.
418
+ * @interface IBasicSDK
419
+ */
420
+ interface IBasicSDK {
421
+ /**
422
+ * Current settings of the SDK instance.
423
+ * @property settings
424
+ */
425
+ settings: ISettings;
426
+ /**
427
+ * Logger API.
428
+ * @property Logger
429
+ */
430
+ Logger: ILoggerAPI;
431
+ }
432
+ /****** Exposed namespace ******/
433
+ /**
434
+ * Types and interfaces for @splitsoftware/splitio package for usage when integrating javascript sdk on typescript apps.
435
+ * For the SDK package information
436
+ * @see {@link https://www.npmjs.com/package/@splitsoftware/splitio}
437
+ */
438
+ export declare namespace SplitIO {
439
+ /**
440
+ * Split treatment value, returned by getTreatment.
441
+ * @typedef {string} Treatment
442
+ */
443
+ type Treatment = string;
444
+ /**
445
+ * Split treatment promise that will resolve to actual treatment value.
446
+ * @typedef {Promise<string>} AsyncTreatment
447
+ */
448
+ type AsyncTreatment = Promise<string>;
449
+ /**
450
+ * An object with the treatments for a bulk of splits, returned by getTreatments. For example:
451
+ * {
452
+ * feature1: 'on',
453
+ * feature2: 'off
454
+ * }
455
+ * @typedef {Object.<Treatment>} Treatments
456
+ */
457
+ type Treatments = {
458
+ [featureName: string]: Treatment;
459
+ };
460
+ /**
461
+ * Split treatments promise that will resolve to the actual SplitIO.Treatments object.
462
+ * @typedef {Promise<Treatments>} AsyncTreatments
463
+ */
464
+ type AsyncTreatments = Promise<Treatments>;
465
+ /**
466
+ * Split evaluation result with treatment and configuration, returned by getTreatmentWithConfig.
467
+ * @typedef {Object} TreatmentWithConfig
468
+ * @property {string} treatment The treatment result
469
+ * @property {string | null} config The stringified version of the JSON config defined for that treatment, null if there is no config for the resulting treatment.
470
+ */
471
+ type TreatmentWithConfig = {
472
+ treatment: string;
473
+ config: string | null;
474
+ };
475
+ /**
476
+ * Split treatment promise that will resolve to actual treatment with config value.
477
+ * @typedef {Promise<TreatmentWithConfig>} AsyncTreatmentWithConfig
478
+ */
479
+ type AsyncTreatmentWithConfig = Promise<TreatmentWithConfig>;
480
+ /**
481
+ * An object with the treatments with configs for a bulk of splits, returned by getTreatmentsWithConfig.
482
+ * Each existing configuration is a stringified version of the JSON you defined on the Split web console. For example:
483
+ * {
484
+ * feature1: { treatment: 'on', config: null }
485
+ * feature2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
486
+ * }
487
+ * @typedef {Object.<TreatmentWithConfig>} Treatments
488
+ */
489
+ type TreatmentsWithConfig = {
490
+ [featureName: string]: TreatmentWithConfig;
491
+ };
492
+ /**
493
+ * Split treatments promise that will resolve to the actual SplitIO.TreatmentsWithConfig object.
494
+ * @typedef {Promise<TreatmentsWithConfig>} AsyncTreatmentsWithConfig
495
+ */
496
+ type AsyncTreatmentsWithConfig = Promise<TreatmentsWithConfig>;
497
+ /**
498
+ * Possible Split SDK events.
499
+ * @typedef {string} Event
500
+ */
501
+ type Event = 'init::timeout' | 'init::ready' | 'init::cache-ready' | 'state::update';
502
+ /**
503
+ * Split attributes should be on object with values of type string or number (dates should be sent as millis since epoch).
504
+ * @typedef {Object.<number, string, boolean, string[], number[]>} Attributes
505
+ * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#attribute-syntax}
506
+ */
507
+ type Attributes = {
508
+ [attributeName: string]: string | number | boolean | Array<string | number>;
509
+ };
510
+ /**
511
+ * Split properties should be an object with values of type string, number, boolean or null. Size limit of ~31kb.
512
+ * @typedef {Object.<number, string, boolean, null>} Attributes
513
+ * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#track
514
+ */
515
+ type Properties = {
516
+ [propertyName: string]: string | number | boolean | null;
517
+ };
518
+ /**
519
+ * The SplitKey object format.
520
+ * @typedef {Object.<string>} SplitKeyObject
521
+ */
522
+ type SplitKeyObject = {
523
+ matchingKey: string;
524
+ bucketingKey: string;
525
+ };
526
+ /**
527
+ * The customer identifier. Could be a SplitKeyObject or a string.
528
+ * @typedef {SplitKeyObject|string} SplitKey
529
+ */
530
+ type SplitKey = SplitKeyObject | string;
531
+ /**
532
+ * Path to file with mocked features (for node).
533
+ * @typedef {string} MockedFeaturesFilePath
534
+ */
535
+ type MockedFeaturesFilePath = string;
536
+ /**
537
+ * Object with mocked features mapping (for browser). We need to specify the featureName as key, and the mocked treatment as value.
538
+ * @typedef {Object} MockedFeaturesMap
539
+ */
540
+ type MockedFeaturesMap = {
541
+ [featureName: string]: string | TreatmentWithConfig;
542
+ };
543
+ /**
544
+ * Object with information about an impression. It contains the generated impression DTO as well as
545
+ * complementary information around where and how it was generated in that way.
546
+ * @typedef {Object} ImpressionData
547
+ */
548
+ type ImpressionData = {
549
+ impression: ImpressionDTO;
550
+ attributes?: SplitIO.Attributes;
551
+ ip: string | false;
552
+ hostname: string | false;
553
+ sdkLanguageVersion: string;
554
+ };
555
+ /**
556
+ * Data corresponding to one Split view.
557
+ * @typedef {Object} SplitView
558
+ */
559
+ type SplitView = {
560
+ /**
561
+ * The name of the split.
562
+ * @property {string} name
563
+ */
564
+ name: string;
565
+ /**
566
+ * The traffic type of the split.
567
+ * @property {string} trafficType
568
+ */
569
+ trafficType: string;
570
+ /**
571
+ * Whether the split is killed or not.
572
+ * @property {boolean} killed
573
+ */
574
+ killed: boolean;
575
+ /**
576
+ * The list of treatments available for the split.
577
+ * @property {Array<string>} treatments
578
+ */
579
+ treatments: Array<string>;
580
+ /**
581
+ * Current change number of the split.
582
+ * @property {number} changeNumber
583
+ */
584
+ changeNumber: number;
585
+ /**
586
+ * Map of configurations per treatment.
587
+ * Each existing configuration is a stringified version of the JSON you defined on the Split web console.
588
+ * @property {Object.<string>} configs
589
+ */
590
+ configs: {
591
+ [treatmentName: string]: string;
592
+ };
593
+ };
594
+ /**
595
+ * A promise that will be resolved with that SplitView.
596
+ * @typedef {Promise<SplitView>} SplitView
597
+ */
598
+ type SplitViewAsync = Promise<SplitView>;
599
+ /**
600
+ * An array containing the SplitIO.SplitView elements.
601
+ */
602
+ type SplitViews = Array<SplitView>;
603
+ /**
604
+ * A promise that will be resolved with an SplitIO.SplitViews array.
605
+ * @typedef {Promise<SplitViews>} SplitViewsAsync
606
+ */
607
+ type SplitViewsAsync = Promise<SplitViews>;
608
+ /**
609
+ * An array of split names.
610
+ * @typedef {Array<string>} SplitNames
611
+ */
612
+ type SplitNames = Array<string>;
613
+ /**
614
+ * A promise that will be resolved with an array of split names.
615
+ * @typedef {Promise<SplitNames>} SplitNamesAsync
616
+ */
617
+ type SplitNamesAsync = Promise<SplitNames>;
618
+ /**
619
+ * Localhost mode factory.
620
+ */
621
+ type LocalhostFactory = {
622
+ type: 'LocalhostFromObject' | 'LocalhostFromFile';
623
+ (params: ISdkFactoryContext): ISyncManagerCS;
624
+ };
625
+ /**
626
+ * Impression listener interface. This is the interface that needs to be implemented
627
+ * by the element you provide to the SDK as impression listener.
628
+ * @interface IImpressionListener
629
+ * @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#listener}
630
+ */
631
+ interface IImpressionListener {
632
+ logImpression(data: SplitIO.ImpressionData): void;
633
+ }
634
+ /**
635
+ * Object with information about a Split event.
636
+ * @typedef {Object} EventData
637
+ */
638
+ type EventData = {
639
+ eventTypeId: string;
640
+ value?: number;
641
+ properties?: Properties;
642
+ trafficTypeName?: string;
643
+ key?: string;
644
+ timestamp: number;
645
+ };
646
+ /**
647
+ * Object representing the data sent by Split (events and impressions).
648
+ * @typedef {Object} IntegrationData
649
+ * @property {string} type The type of Split data, either 'IMPRESSION' or 'EVENT'.
650
+ * @property {ImpressionData | EventData} payload The data instance itself.
651
+ */
652
+ type IntegrationData = {
653
+ type: 'IMPRESSION';
654
+ payload: SplitIO.ImpressionData;
655
+ } | {
656
+ type: 'EVENT';
657
+ payload: SplitIO.EventData;
658
+ };
659
+ /**
660
+ * Available URL settings for the SDKs.
661
+ */
662
+ type UrlSettings = {
663
+ /**
664
+ * String property to override the base URL where the SDK will get feature flagging related data like a Split rollout plan or segments information.
665
+ * @property {string} sdk
666
+ * @default 'https://sdk.split.io/api'
667
+ */
668
+ sdk?: string;
669
+ /**
670
+ * String property to override the base URL where the SDK will post event-related information like impressions.
671
+ * @property {string} events
672
+ * @default 'https://events.split.io/api'
673
+ */
674
+ events?: string;
675
+ /**
676
+ * String property to override the base URL where the SDK will get authorization tokens to be used with functionality that requires it, like streaming.
677
+ * @property {string} auth
678
+ * @default 'https://auth.split.io/api'
679
+ */
680
+ auth?: string;
681
+ /**
682
+ * String property to override the base URL where the SDK will connect to receive streaming updates.
683
+ * @property {string} streaming
684
+ * @default 'https://streaming.split.io'
685
+ */
686
+ streaming?: string;
687
+ /**
688
+ * String property to override the base URL where the SDK will post telemetry data.
689
+ * @property {string} telemetry
690
+ * @default 'https://telemetry.split.io/api'
691
+ */
692
+ telemetry?: string;
693
+ };
694
+ /**
695
+ * SplitFilter type.
696
+ * @typedef {string} SplitFilterType
697
+ */
698
+ type SplitFilterType = 'byName' | 'byPrefix';
699
+ /**
700
+ * Defines a split filter, described by a type and list of values.
701
+ */
702
+ interface SplitFilter {
703
+ /**
704
+ * Type of the filter.
705
+ * @property {SplitFilterType} type
706
+ */
707
+ type: SplitFilterType;
708
+ /**
709
+ * List of values: split names for 'byName' filter type, and split prefixes for 'byPrefix' type.
710
+ * @property {string[]} values
711
+ */
712
+ values: string[];
713
+ }
714
+ /**
715
+ * ImpressionsMode type
716
+ * @typedef {string} ImpressionsMode
717
+ */
718
+ type ImpressionsMode = 'OPTIMIZED' | 'DEBUG';
719
+ /**
720
+ * Defines the format of Split data to preload on the factory storage (cache).
721
+ */
722
+ interface PreloadedData {
723
+ /**
724
+ * Timestamp of the last moment the data was synchronized with Split servers.
725
+ * If this value is older than 10 days ago (expiration time policy), the data is not used to update the storage content.
726
+ * @TODO configurable expiration time policy?
727
+ */
728
+ lastUpdated: number;
729
+ /**
730
+ * Change number of the preloaded data.
731
+ * If this value is older than the current changeNumber at the storage, the data is not used to update the storage content.
732
+ */
733
+ since: number;
734
+ /**
735
+ * Map of splits to their serialized definitions.
736
+ */
737
+ splitsData: {
738
+ [splitName: string]: string;
739
+ };
740
+ /**
741
+ * Optional map of user keys to their list of segments.
742
+ * @TODO remove when releasing first version
743
+ */
744
+ mySegmentsData?: {
745
+ [key: string]: string[];
746
+ };
747
+ /**
748
+ * Optional map of segments to their serialized definitions.
749
+ * This property is ignored if `mySegmentsData` was provided.
750
+ */
751
+ segmentsData?: {
752
+ [segmentName: string]: string;
753
+ };
754
+ }
755
+ /**
756
+ * Settings interface for SDK instances created on the browser
757
+ * @interface IBrowserSettings
758
+ * @extends ISharedSettings
759
+ * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#configuration}
760
+ */
761
+ interface IBrowserSettings extends ISharedSettings {
762
+ /**
763
+ * SDK Startup settings for the Browser.
764
+ * @property {Object} startup
765
+ */
766
+ startup?: {
767
+ /**
768
+ * Maximum amount of time used before notify a timeout.
769
+ * @property {number} readyTimeout
770
+ * @default 1.5
771
+ */
772
+ readyTimeout?: number;
773
+ /**
774
+ * Time to wait for a request before the SDK is ready. If this time expires, JS Sdk will retry 'retriesOnFailureBeforeReady' times before notifying its failure to be 'ready'.
775
+ * @property {number} requestTimeoutBeforeReady
776
+ * @default 1.5
777
+ */
778
+ requestTimeoutBeforeReady?: number;
779
+ /**
780
+ * How many quick retries we will do while starting up the SDK.
781
+ * @property {number} retriesOnFailureBeforeReady
782
+ * @default 1
783
+ */
784
+ retriesOnFailureBeforeReady?: number;
785
+ /**
786
+ * For SDK posts the queued events data in bulks with a given rate, but the first push window is defined separately,
787
+ * to better control on browsers. This number defines that window before the first events push.
788
+ *
789
+ * @property {number} eventsFirstPushWindow
790
+ * @default 10
791
+ */
792
+ eventsFirstPushWindow?: number;
793
+ };
794
+ /**
795
+ * SDK scheduler settings.
796
+ * @property {Object} scheduler
797
+ */
798
+ scheduler?: {
799
+ /**
800
+ * The SDK polls Split servers for changes to feature roll-out plans. This parameter controls this polling period in seconds.
801
+ * @property {number} featuresRefreshRate
802
+ * @default 30
803
+ */
804
+ featuresRefreshRate?: number;
805
+ /**
806
+ * The SDK sends information on who got what treatment at what time back to Split servers to power analytics. This parameter controls how often this data is sent to Split servers. The parameter should be in seconds.
807
+ * @property {number} impressionsRefreshRate
808
+ * @default 60
809
+ */
810
+ impressionsRefreshRate?: number;
811
+ /**
812
+ * The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
813
+ * If you use a 0 here, the queue will have no maximum size.
814
+ * @property {number} impressionsQueueSize
815
+ * @default 30000
816
+ */
817
+ impressionsQueueSize?: number;
818
+ /**
819
+ * The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
820
+ * @property {number} metricsRefreshRate
821
+ * @default 120
822
+ * @deprecated This parameter is ignored now.
823
+ */
824
+ metricsRefreshRate?: number;
825
+ /**
826
+ * The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
827
+ * @property {number} telemetryRefreshRate
828
+ * @default 3600
829
+ */
830
+ telemetryRefreshRate?: number;
831
+ /**
832
+ * The SDK polls Split servers for changes to segment definitions. This parameter controls this polling period in seconds.
833
+ * @property {number} segmentsRefreshRate
834
+ * @default 60
835
+ */
836
+ segmentsRefreshRate?: number;
837
+ /**
838
+ * The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
839
+ * @property {number} eventsPushRate
840
+ * @default 60
841
+ */
842
+ eventsPushRate?: number;
843
+ /**
844
+ * The maximum number of event items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
845
+ * If you use a 0 here, the queue will have no maximum size.
846
+ * @property {number} eventsQueueSize
847
+ * @default 500
848
+ */
849
+ eventsQueueSize?: number;
850
+ /**
851
+ * For mocking/testing only. The SDK will refresh the features mocked data when mode is set to "localhost" by defining the key.
852
+ * For more information @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#localhost-mode}
853
+ * @property {number} offlineRefreshRate
854
+ * @default 15
855
+ */
856
+ offlineRefreshRate?: number;
857
+ /**
858
+ * When using streaming mode, seconds to wait before re attempting to connect for push notifications.
859
+ * Next attempts follow intervals in power of two: base seconds, base x 2 seconds, base x 4 seconds, ...
860
+ * @property {number} pushRetryBackoffBase
861
+ * @default 1
862
+ */
863
+ pushRetryBackoffBase?: number;
864
+ };
865
+ /**
866
+ * SDK Core settings for the browser.
867
+ * @property {Object} core
868
+ */
869
+ core: {
870
+ /**
871
+ * Your API key. More information: @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
872
+ * @property {string} authorizationKey
873
+ */
874
+ authorizationKey: string;
875
+ /**
876
+ * Customer identifier. Whatever this means to you. @see {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
877
+ * @property {SplitKey} key
878
+ */
879
+ key: SplitKey;
880
+ /**
881
+ * Traffic type associated with the customer identifier. @see {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
882
+ * If no provided as a setting it will be required on the client.track() calls.
883
+ * @property {string} trafficType
884
+ */
885
+ trafficType?: string;
886
+ /**
887
+ * Disable labels from being sent to Split backend. Labels may contain sensitive information.
888
+ * @property {boolean} labelsEnabled
889
+ * @default true
890
+ */
891
+ labelsEnabled?: boolean;
892
+ };
893
+ /**
894
+ * Mocked features map. For testing purposses only. For using this you should specify "localhost" as authorizationKey on core settings.
895
+ * @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#localhost-mode}
896
+ */
897
+ features?: MockedFeaturesMap;
898
+ /**
899
+ * Defines which kind of storage we should instanciate.
900
+ * @property {Object} storage
901
+ */
902
+ storage?: (params: IStorageFactoryParams) => IStorageSync | IStorageAsync;
903
+ /**
904
+ * List of URLs that the SDK will use as base for it's synchronization functionalities, applicable only when running as standalone.
905
+ * Do not change these settings unless you're working an advanced use case, like connecting to the Split proxy.
906
+ * @property {Object} urls
907
+ */
908
+ urls?: UrlSettings;
909
+ }
910
+ /**
911
+ * Settings interface for SDK instances created on NodeJS.
912
+ * If your storage is asynchronous (Redis for example) use SplitIO.INodeAsyncSettings instead.
913
+ * @interface INodeSettings
914
+ * @extends INodeBasicSettings
915
+ * @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#configuration}
916
+ */
917
+ interface INodeSettings extends INodeBasicSettings {
918
+ /**
919
+ * List of URLs that the SDK will use as base for it's synchronization functionalities, applicable only when running as standalone.
920
+ * Do not change these settings unless you're working an advanced use case, like connecting to the Split proxy.
921
+ * @property {Object} urls
922
+ */
923
+ urls?: UrlSettings;
924
+ /**
925
+ * Defines which kind of storage we should instanciate.
926
+ * @property {Object} storage
927
+ */
928
+ storage?: (params: IStorageFactoryParams) => IStorageSync;
929
+ }
930
+ /**
931
+ * Settings interface with async storage for SDK instances created on NodeJS.
932
+ * If your storage is synchronous (by defaut we use memory, which is sync) use SplitIO.INodeSyncSettings instead.
933
+ * @interface INodeAsyncSettings
934
+ * @extends INodeBasicSettings
935
+ * @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#configuration}
936
+ */
937
+ interface INodeAsyncSettings extends INodeBasicSettings {
938
+ storage?: (params: IStorageFactoryParams) => IStorageAsync;
939
+ }
940
+ /**
941
+ * This represents the interface for the Server-side SDK instance with synchronous storage.
942
+ * @interface ISDK
943
+ * @extends IBasicSDK
944
+ */
945
+ interface ISDK extends IBasicSDK {
946
+ /**
947
+ * Returns the client instance of the SDK.
948
+ * @function client
949
+ * @returns {IClient} The client instance.
950
+ */
951
+ client(): IClient;
952
+ /**
953
+ * Returns a manager instance of the SDK to explore available information.
954
+ * @function manager
955
+ * @returns {IManager} The manager instance.
956
+ */
957
+ manager(): IManager;
958
+ }
959
+ /**
960
+ * This represents the interface for the Server-side SDK instance with asynchronous storage.
961
+ * @interface IAsyncSDK
962
+ * @extends IBasicSDK
963
+ */
964
+ interface IAsyncSDK extends IBasicSDK {
965
+ /**
966
+ * Returns the default client instance of the SDK.
967
+ * @function client
968
+ * @returns {IAsyncClient} The asynchronous client instance.
969
+ */
970
+ client(): IAsyncClient;
971
+ /**
972
+ * Returns a manager instance of the SDK to explore available information.
973
+ * @function manager
974
+ * @returns {IManager} The manager instance.
975
+ */
976
+ manager(): IAsyncManager;
977
+ }
978
+ /**
979
+ * This represents the interface for the Client-side SDK instance with synchronous storage.
980
+ * @interface ICsSDK
981
+ * @extends IBasicSDK
982
+ */
983
+ interface ICsSDK extends IBasicSDK {
984
+ /**
985
+ * Returns the default client instance of the SDK, with the key and optional traffic type from settings.
986
+ * @function client
987
+ * @returns {ICsClient} The client instance.
988
+ */
989
+ client(): ICsClient;
990
+ /**
991
+ * Returns a shared client of the SDK, with the given key and optional traffic type.
992
+ * @function client
993
+ * @param {SplitKey} key The key for the new client instance.
994
+ * @param {string=} trafficType The traffic type of the provided key.
995
+ * @returns {ICsClient} The client instance.
996
+ */
997
+ client(key: SplitKey, trafficType?: string): ICsClient;
998
+ /**
999
+ * Returns a manager instance of the SDK to explore available information.
1000
+ * @function manager
1001
+ * @returns {IManager} The manager instance.
1002
+ */
1003
+ manager(): IManager;
1004
+ }
1005
+ /**
1006
+ * This represents the interface for the Client instance with synchronous storage for server-side SDK, where we don't have only one key.
1007
+ * @interface IClient
1008
+ * @extends IBasicClient
1009
+ */
1010
+ interface IClient extends IBasicClient {
1011
+ /**
1012
+ * Returns a Treatment value, which will be (or eventually be) the treatment string for the given feature.
1013
+ * @function getTreatment
1014
+ * @param {string} key - The string key representing the consumer.
1015
+ * @param {string} splitName - The string that represents the split we wan't to get the treatment.
1016
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1017
+ * @returns {Treatment} The treatment or treatment promise which will resolve to the treatment string.
1018
+ */
1019
+ getTreatment(key: SplitKey, splitName: string, attributes?: Attributes): Treatment;
1020
+ /**
1021
+ * Returns a TreatmentWithConfig value (a map of treatment and config), which will be (or eventually be) the map with treatment and config for the given feature.
1022
+ * @function getTreatmentWithConfig
1023
+ * @param {string} key - The string key representing the consumer.
1024
+ * @param {string} splitName - The string that represents the split we wan't to get the treatment.
1025
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1026
+ * @returns {TreatmentWithConfig} The TreatmentWithConfig or TreatmentWithConfig promise which will resolve to the map containing
1027
+ * the treatment and the configuration stringified JSON (or null if there was no config for that treatment).
1028
+ */
1029
+ getTreatmentWithConfig(key: SplitKey, splitName: string, attributes?: Attributes): TreatmentWithConfig;
1030
+ /**
1031
+ * Returns a Treatments value, whick will be (or eventually be) an object with the treatments for the given features.
1032
+ * @function getTreatments
1033
+ * @param {string} key - The string key representing the consumer.
1034
+ * @param {Array<string>} splitNames - An array of the split names we wan't to get the treatments.
1035
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1036
+ * @returns {Treatments} The treatments or treatments promise which will resolve to the treatments object.
1037
+ */
1038
+ getTreatments(key: SplitKey, splitNames: string[], attributes?: Attributes): Treatments;
1039
+ /**
1040
+ * Returns a TreatmentsWithConfig value, whick will be an object with the TreatmentWithConfig (a map with both treatment and config string) for the given features.
1041
+ * @function getTreatmentsWithConfig
1042
+ * @param {string} key - The string key representing the consumer.
1043
+ * @param {Array<string>} splitNames - An array of the split names we wan't to get the treatments.
1044
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1045
+ * @returns {TreatmentsWithConfig} The map with all the TreatmentWithConfig objects
1046
+ */
1047
+ getTreatmentsWithConfig(key: SplitKey, splitNames: string[], attributes?: Attributes): TreatmentsWithConfig;
1048
+ /**
1049
+ * Tracks an event to be fed to the results product on Split Webconsole.
1050
+ * @function track
1051
+ * @param {SplitKey} key - The key that identifies the entity related to this event.
1052
+ * @param {string} trafficType - The traffic type of the entity related to this event.
1053
+ * @param {string} eventType - The event type corresponding to this event.
1054
+ * @param {number=} value - The value of this event.
1055
+ * @param {Properties=} properties - The properties of this event. Values can be string, number, boolean or null.
1056
+ * @returns {boolean} Whether the event was added to the queue succesfully or not.
1057
+ */
1058
+ track(key: SplitIO.SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): boolean;
1059
+ }
1060
+ /**
1061
+ * This represents the interface for the Client instance with asynchronous storage for server-side SDK, where we don't have only one key.
1062
+ * @interface IAsyncClient
1063
+ * @extends IBasicClient
1064
+ */
1065
+ interface IAsyncClient extends IBasicClient {
1066
+ /**
1067
+ * Returns a Treatment value, which will be (or eventually be) the treatment string for the given feature.
1068
+ * For usage on NodeJS as we don't have only one key.
1069
+ * NOTE: Treatment will be a promise only in async storages, like REDIS.
1070
+ * @function getTreatment
1071
+ * @param {string} key - The string key representing the consumer.
1072
+ * @param {string} splitName - The string that represents the split we wan't to get the treatment.
1073
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1074
+ * @returns {AsyncTreatment} Treatment promise which will resolve to the treatment string.
1075
+ */
1076
+ getTreatment(key: SplitKey, splitName: string, attributes?: Attributes): AsyncTreatment;
1077
+ /**
1078
+ * Returns a TreatmentWithConfig value, which will be (or eventually be) a map with both treatment and config string for the given feature.
1079
+ * For usage on NodeJS as we don't have only one key.
1080
+ * NOTE: Treatment will be a promise only in async storages, like REDIS.
1081
+ * @function getTreatmentWithConfig
1082
+ * @param {string} key - The string key representing the consumer.
1083
+ * @param {string} splitName - The string that represents the split we wan't to get the treatment.
1084
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1085
+ * @returns {AsyncTreatmentWithConfig} TreatmentWithConfig promise which will resolve to the TreatmentWithConfig object.
1086
+ */
1087
+ getTreatmentWithConfig(key: SplitKey, splitName: string, attributes?: Attributes): AsyncTreatmentWithConfig;
1088
+ /**
1089
+ * Returns a Treatments value, whick will be (or eventually be) an object with the treatments for the given features.
1090
+ * For usage on NodeJS as we don't have only one key.
1091
+ * @function getTreatments
1092
+ * @param {string} key - The string key representing the consumer.
1093
+ * @param {Array<string>} splitNames - An array of the split names we wan't to get the treatments.
1094
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1095
+ * @returns {AsyncTreatments} Treatments promise which will resolve to the treatments object.
1096
+ */
1097
+ getTreatments(key: SplitKey, splitNames: string[], attributes?: Attributes): AsyncTreatments;
1098
+ /**
1099
+ * Returns a Treatments value, whick will be (or eventually be) an object with all the maps of treatment and config string for the given features.
1100
+ * For usage on NodeJS as we don't have only one key.
1101
+ * @function getTreatmentsWithConfig
1102
+ * @param {string} key - The string key representing the consumer.
1103
+ * @param {Array<string>} splitNames - An array of the split names we wan't to get the treatments.
1104
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1105
+ * @returns {AsyncTreatmentsWithConfig} TreatmentsWithConfig promise which will resolve to the map of TreatmentsWithConfig objects.
1106
+ */
1107
+ getTreatmentsWithConfig(key: SplitKey, splitNames: string[], attributes?: Attributes): AsyncTreatmentsWithConfig;
1108
+ /**
1109
+ * Tracks an event to be fed to the results product on Split Webconsole and returns a promise to signal when the event was successfully queued (or not).
1110
+ * @function track
1111
+ * @param {SplitKey} key - The key that identifies the entity related to this event.
1112
+ * @param {string} trafficType - The traffic type of the entity related to this event.
1113
+ * @param {string} eventType - The event type corresponding to this event.
1114
+ * @param {number=} value - The value of this event.
1115
+ * @param {Properties=} properties - The properties of this event. Values can be string, number, boolean or null.
1116
+ * @returns {Promise<boolean>} A promise that resolves to a boolean indicating if the event was added to the queue succesfully or not.
1117
+ */
1118
+ track(key: SplitIO.SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): Promise<boolean>;
1119
+ }
1120
+ /**
1121
+ * This represents the interface for the Client instance with synchronous storage for client-side SDK, where each client has associated a key and optionally a traffic type.
1122
+ * @interface IClient
1123
+ * @extends IBasicClient
1124
+ */
1125
+ interface ICsClient extends IBasicClient {
1126
+ /**
1127
+ * Returns a Treatment value, which will be the treatment string for the given feature.
1128
+ * @function getTreatment
1129
+ * @param {string} splitName - The string that represents the split we wan't to get the treatment.
1130
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1131
+ * @returns {Treatment} The treatment result.
1132
+ */
1133
+ getTreatment(splitName: string, attributes?: Attributes): Treatment;
1134
+ /**
1135
+ * Returns a TreatmentWithConfig value, which will be a map of treatment and the config for that treatment.
1136
+ * @function getTreatment
1137
+ * @param {string} splitName - The string that represents the split we wan't to get the treatment.
1138
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1139
+ * @returns {TreatmentWithConfig} The treatment or treatment promise which will resolve to the treatment string.
1140
+ */
1141
+ getTreatmentWithConfig(splitName: string, attributes?: Attributes): TreatmentWithConfig;
1142
+ /**
1143
+ * Returns a Treatments value, whick will be (or eventually be) an object with the treatments for the given features.
1144
+ * @function getTreatments
1145
+ * @param {Array<string>} splitNames - An array of the split names we wan't to get the treatments.
1146
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1147
+ * @returns {Treatments} The treatments or treatments promise which will resolve to the treatments object.
1148
+ */
1149
+ getTreatments(splitNames: string[], attributes?: Attributes): Treatments;
1150
+ /**
1151
+ * Returns a TreatmentsWithConfig value, whick will be an object with the TreatmentWithConfig (a map with both treatment and config string) for the given features.
1152
+ * @function getTreatmentsWithConfig
1153
+ * @param {Array<string>} splitNames - An array of the split names we wan't to get the treatments.
1154
+ * @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
1155
+ * @returns {TreatmentsWithConfig} The map with all the TreatmentWithConfig objects
1156
+ */
1157
+ getTreatmentsWithConfig(splitNames: string[], attributes?: Attributes): TreatmentsWithConfig;
1158
+ /**
1159
+ * Tracks an event to be fed to the results product on Split Webconsole.
1160
+ * @function track
1161
+ * @param {string} trafficType - The traffic type of the entity related to this event. NOTE: only has to be provided if the client doesn't have a traffic type
1162
+ * @param {string} eventType - The event type corresponding to this event.
1163
+ * @param {number=} value - The value of this event.
1164
+ * @param {Properties=} properties - The properties of this event. Values can be string, number, boolean or null.
1165
+ * @returns {boolean} Whether the event was added to the queue succesfully or not.
1166
+ */
1167
+ track(...args: [trafficType: string, eventType: string, value?: number, properties?: Properties] | [eventType: string, value?: number, properties?: Properties]): boolean;
1168
+ /**
1169
+ * Add an attribute to client's in memory attributes storage
1170
+ * @function setAttribute
1171
+ * @param {string} attributeName Attrinute name
1172
+ * @param {string, number, boolean, list} attributeValue Attribute value
1173
+ * @returns {boolean} true if the attribute was stored and false otherways
1174
+ */
1175
+ setAttribute(attributeName: string, attributeValue: Object): boolean;
1176
+ /**
1177
+ * Returns the attribute with the given key
1178
+ * @function getAttribute
1179
+ * @param {string} attributeName Attribute name
1180
+ * @returns {Object} Attribute with the given key
1181
+ */
1182
+ getAttribute(attributeName: string): Object;
1183
+ /**
1184
+ * Add to client's in memory attributes storage the attributes in 'attributes'
1185
+ * @function setAttributes
1186
+ * @param {Object} attributes Object with attributes to store
1187
+ * @returns true if attributes were stored an false otherways
1188
+ */
1189
+ setAttributes(attributes: Record<string, Object>): boolean;
1190
+ /**
1191
+ * Return all the attributes stored in client's in memory attributes storage
1192
+ * @function getAttributes
1193
+ * @returns {Object} returns all the stored attributes
1194
+ */
1195
+ getAttributes(): Record<string, Object>;
1196
+ /**
1197
+ * Removes from client's in memory attributes storage the attribute with the given key
1198
+ * @function removeAttribute
1199
+ * @param {string} attributeName
1200
+ * @returns {boolean} true if attribute was removed and false otherways
1201
+ */
1202
+ removeAttribute(attributeName: string): boolean;
1203
+ /**
1204
+ * Remove all the stored attributes in the client's in memory attribute storage
1205
+ */
1206
+ clearAttributes(): boolean;
1207
+ }
1208
+ /**
1209
+ * Representation of a manager instance with synchronous storage of the SDK.
1210
+ * @interface IManager
1211
+ * @extends IStatusInterface
1212
+ */
1213
+ interface IManager extends IStatusInterface {
1214
+ /**
1215
+ * Get the array of Split names.
1216
+ * @function names
1217
+ * @returns {SplitNames} The lists of Split names.
1218
+ */
1219
+ names(): SplitNames;
1220
+ /**
1221
+ * Get the array of splits data in SplitView format.
1222
+ * @function splits
1223
+ * @returns {SplitViews} The list of SplitIO.SplitView.
1224
+ */
1225
+ splits(): SplitViews;
1226
+ /**
1227
+ * Get the data of a split in SplitView format.
1228
+ * @function split
1229
+ * @param {string} splitName The name of the split we wan't to get info of.
1230
+ * @returns {SplitView} The SplitIO.SplitView of the given split.
1231
+ */
1232
+ split(splitName: string): SplitView;
1233
+ }
1234
+ /**
1235
+ * Representation of a manager instance with asynchronous storage of the SDK.
1236
+ * @interface IAsyncManager
1237
+ * @extends IStatusInterface
1238
+ */
1239
+ interface IAsyncManager extends IStatusInterface {
1240
+ /**
1241
+ * Get the array of Split names.
1242
+ * @function names
1243
+ * @returns {SplitNamesAsync} A promise that will resolve to the array of Splitio.SplitNames.
1244
+ */
1245
+ names(): SplitNamesAsync;
1246
+ /**
1247
+ * Get the array of splits data in SplitView format.
1248
+ * @function splits
1249
+ * @returns {SplitViewsAsync} A promise that will resolve to the SplitIO.SplitView list.
1250
+ */
1251
+ splits(): SplitViewsAsync;
1252
+ /**
1253
+ * Get the data of a split in SplitView format.
1254
+ * @function split
1255
+ * @param {string} splitName The name of the split we wan't to get info of.
1256
+ * @returns {SplitViewAsync} A promise that will resolve to the SplitIO.SplitView value.
1257
+ */
1258
+ split(splitName: string): SplitViewAsync;
1259
+ }
1260
+ }
1261
+ export {};