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