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

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