@daiso-tech/core 0.26.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/README.md +13 -3
  2. package/dist/async/utilities/delay/delay.d.ts +1 -12
  3. package/dist/async/utilities/delay/delay.js +1 -12
  4. package/dist/async/utilities/delay/delay.js.map +1 -1
  5. package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +143 -71
  6. package/dist/async/utilities/lazy-promise/lazy-promise.js +223 -142
  7. package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
  8. package/dist/async/utilities/retry/retry-or-fail.d.ts +2 -0
  9. package/dist/async/utilities/retry/retry-or-fail.js.map +1 -1
  10. package/dist/cache/contracts/_module-exports.d.ts +1 -0
  11. package/dist/cache/contracts/_module-exports.js +1 -0
  12. package/dist/cache/contracts/_module-exports.js.map +1 -1
  13. package/dist/cache/contracts/cache-adapter.contract.d.ts +19 -21
  14. package/dist/cache/contracts/cache-adapter.contract.js +1 -4
  15. package/dist/cache/contracts/cache-adapter.contract.js.map +1 -1
  16. package/dist/cache/contracts/cache-factory.contract.d.ts +1 -1
  17. package/dist/cache/contracts/cache.contract.d.ts +144 -96
  18. package/dist/cache/contracts/cache.contract.js +1 -2
  19. package/dist/cache/contracts/cache.contract.js.map +1 -1
  20. package/dist/cache/contracts/cache.errors.js +2 -5
  21. package/dist/cache/contracts/cache.errors.js.map +1 -1
  22. package/dist/cache/contracts/cache.events.d.ts +10 -10
  23. package/dist/cache/contracts/cache.events.js +2 -5
  24. package/dist/cache/contracts/cache.events.js.map +1 -1
  25. package/dist/cache/contracts/database-cache-adapter.contract.d.ts +89 -0
  26. package/dist/cache/contracts/database-cache-adapter.contract.js +5 -0
  27. package/dist/cache/contracts/database-cache-adapter.contract.js.map +1 -0
  28. package/dist/cache/implementations/adapters/{kysely-sqlite-cache-adapter → kysely-cache-adapter}/_module.d.ts +1 -1
  29. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js +2 -0
  30. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js.map +1 -0
  31. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +73 -0
  32. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +224 -0
  33. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -0
  34. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +29 -39
  35. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +45 -54
  36. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
  37. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +17 -33
  38. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +43 -52
  39. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
  40. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.d.ts +13 -0
  41. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js +38 -0
  42. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js.map +1 -0
  43. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +27 -33
  44. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +145 -197
  45. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
  46. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +14 -13
  47. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +19 -17
  48. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
  49. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.d.ts +13 -0
  50. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js +39 -0
  51. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js.map +1 -0
  52. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +16 -22
  53. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +51 -132
  54. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
  55. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.d.ts +13 -0
  56. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js +69 -0
  57. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js.map +1 -0
  58. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +29 -41
  59. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +46 -55
  60. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
  61. package/dist/cache/implementations/derivables/_module-exports.d.ts +1 -1
  62. package/dist/cache/implementations/derivables/_module-exports.js +1 -1
  63. package/dist/cache/implementations/derivables/_module-exports.js.map +1 -1
  64. package/dist/cache/implementations/derivables/cache/_module.d.ts +1 -0
  65. package/dist/cache/implementations/derivables/cache/_module.js +1 -0
  66. package/dist/cache/implementations/derivables/cache/_module.js.map +1 -1
  67. package/dist/cache/implementations/derivables/cache/cache.d.ts +269 -507
  68. package/dist/cache/implementations/derivables/cache/cache.js +538 -822
  69. package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
  70. package/dist/cache/implementations/derivables/cache/database-cache-adapter.d.ts +21 -0
  71. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +110 -0
  72. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -0
  73. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.d.ts +9 -0
  74. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js +20 -0
  75. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js.map +1 -0
  76. package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +69 -105
  77. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +117 -87
  78. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
  79. package/dist/cache/implementations/test-utilities/_module-exports.d.ts +1 -0
  80. package/dist/cache/implementations/test-utilities/_module-exports.js +1 -0
  81. package/dist/cache/implementations/test-utilities/_module-exports.js.map +1 -1
  82. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +9 -11
  83. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +246 -247
  84. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
  85. package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +16 -30
  86. package/dist/cache/implementations/test-utilities/cache.test-suite.js +271 -996
  87. package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
  88. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +60 -0
  89. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +698 -0
  90. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -0
  91. package/dist/collection/contracts/async-collection.contract.d.ts +2 -3
  92. package/dist/collection/contracts/async-collection.contract.js +1 -12
  93. package/dist/collection/contracts/async-collection.contract.js.map +1 -1
  94. package/dist/collection/contracts/collection.contract.d.ts +1 -1
  95. package/dist/collection/contracts/collection.errors.d.ts +1 -1
  96. package/dist/collection/contracts/collection.errors.js +3 -6
  97. package/dist/collection/contracts/collection.errors.js.map +1 -1
  98. package/dist/collection/implementations/_shared.d.ts +4 -4
  99. package/dist/collection/implementations/_shared.js +6 -9
  100. package/dist/collection/implementations/_shared.js.map +1 -1
  101. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +2 -2
  102. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -1
  103. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +5 -21
  104. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +12 -8
  105. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  106. package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +1 -1
  107. package/dist/collection/implementations/iterable-collection/iterable-collection.js +1 -1
  108. package/dist/collection/implementations/list-collection/list-collection.d.ts +1 -1
  109. package/dist/collection/implementations/list-collection/list-collection.js +1 -1
  110. package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +0 -9
  111. package/dist/event-bus/contracts/event-bus.contract.d.ts +5 -5
  112. package/dist/event-bus/contracts/event-bus.contract.js.map +1 -1
  113. package/dist/event-bus/contracts/event-bus.errors.js +2 -5
  114. package/dist/event-bus/contracts/event-bus.errors.js.map +1 -1
  115. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +9 -29
  116. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +14 -35
  117. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
  118. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +2 -4
  119. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +2 -8
  120. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
  121. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +8 -15
  122. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +15 -34
  123. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
  124. package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +85 -289
  125. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +128 -325
  126. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
  127. package/dist/event-bus/implementations/derivables/event-bus/listener-store.d.ts +13 -0
  128. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +42 -0
  129. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js.map +1 -0
  130. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +103 -86
  131. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +135 -77
  132. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
  133. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.d.ts +2 -48
  134. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +31 -122
  135. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
  136. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.d.ts +2 -50
  137. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +41 -89
  138. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
  139. package/dist/lock/contracts/database-lock-adapter.contract.d.ts +0 -9
  140. package/dist/lock/contracts/lock-adapter.contract.d.ts +0 -9
  141. package/dist/lock/contracts/lock-provider.contract.d.ts +20 -6
  142. package/dist/lock/contracts/lock.contract.d.ts +37 -8
  143. package/dist/lock/contracts/lock.errors.js +2 -5
  144. package/dist/lock/contracts/lock.errors.js.map +1 -1
  145. package/dist/lock/contracts/lock.events.js +2 -5
  146. package/dist/lock/contracts/lock.events.js.map +1 -1
  147. package/dist/lock/implementations/adapters/_module-exports.d.ts +1 -0
  148. package/dist/lock/implementations/adapters/_module-exports.js +1 -0
  149. package/dist/lock/implementations/adapters/_module-exports.js.map +1 -1
  150. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +0 -5
  151. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +2 -21
  152. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
  153. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +11 -16
  154. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +11 -20
  155. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js.map +1 -1
  156. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +7 -26
  157. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +7 -35
  158. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
  159. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +13 -20
  160. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +13 -37
  161. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
  162. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.d.ts +1 -0
  163. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js +2 -0
  164. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js.map +1 -0
  165. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +17 -0
  166. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +24 -0
  167. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js.map +1 -0
  168. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +4 -22
  169. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +4 -31
  170. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
  171. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +14 -20
  172. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +12 -21
  173. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js.map +1 -1
  174. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +0 -2
  175. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +2 -8
  176. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
  177. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +1 -5
  178. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -1
  179. package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +181 -369
  180. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +259 -407
  181. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
  182. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +15 -17
  183. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +42 -40
  184. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
  185. package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +3 -3
  186. package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +1 -1
  187. package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +194 -680
  188. package/dist/lock/implementations/derivables/lock-provider/lock.js +284 -744
  189. package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
  190. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +106 -143
  191. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +173 -101
  192. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
  193. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +4 -5
  194. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +172 -247
  195. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
  196. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +5 -8
  197. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +93 -98
  198. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
  199. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +15 -20
  200. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +295 -145
  201. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
  202. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js +1 -2
  203. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js.map +1 -1
  204. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +3 -2
  205. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +2 -1
  206. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js.map +1 -1
  207. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js +1 -2
  208. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js.map +1 -1
  209. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js +1 -2
  210. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js.map +1 -1
  211. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +2 -2
  212. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +2 -2
  213. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
  214. package/dist/serde/implementations/derivables/serde.d.ts +14 -14
  215. package/dist/serde/implementations/derivables/serde.js +14 -15
  216. package/dist/serde/implementations/derivables/serde.js.map +1 -1
  217. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +4 -4
  218. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +3 -3
  219. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +5 -5
  220. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +4 -4
  221. package/dist/utilities/_module-exports.d.ts +2 -3
  222. package/dist/utilities/_module-exports.js +2 -3
  223. package/dist/utilities/_module-exports.js.map +1 -1
  224. package/dist/utilities/classes/_module.d.ts +4 -0
  225. package/dist/utilities/classes/_module.js +5 -0
  226. package/dist/utilities/classes/_module.js.map +1 -0
  227. package/dist/utilities/classes/key-prefixer/_module.d.ts +2 -0
  228. package/dist/utilities/classes/key-prefixer/_module.js +3 -0
  229. package/dist/utilities/classes/key-prefixer/_module.js.map +1 -0
  230. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.d.ts +28 -0
  231. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js +5 -0
  232. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js.map +1 -0
  233. package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +73 -0
  234. package/dist/utilities/classes/key-prefixer/key-prefixer.js +135 -0
  235. package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -0
  236. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.d.ts +1 -0
  237. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js +2 -0
  238. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js.map +1 -0
  239. package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +1 -0
  240. package/dist/utilities/classes/pipeline/_module.d.ts +1 -0
  241. package/dist/utilities/classes/pipeline/_module.js +2 -0
  242. package/dist/utilities/classes/pipeline/_module.js.map +1 -0
  243. package/dist/utilities/{pipeline → classes/pipeline}/pipeline.d.ts +3 -2
  244. package/dist/utilities/{pipeline → classes/pipeline}/pipeline.js +3 -2
  245. package/dist/utilities/classes/pipeline/pipeline.js.map +1 -0
  246. package/dist/utilities/classes/time-span/_module.d.ts +1 -0
  247. package/dist/utilities/classes/time-span/_module.js +2 -0
  248. package/dist/utilities/classes/time-span/_module.js.map +1 -0
  249. package/dist/utilities/{time-span → classes/time-span}/time-span.d.ts +2 -1
  250. package/dist/utilities/{time-span → classes/time-span}/time-span.js +1 -0
  251. package/dist/utilities/classes/time-span/time-span.js.map +1 -0
  252. package/dist/utilities/{_constants.d.ts → constants.d.ts} +0 -3
  253. package/dist/utilities/constants.js +5 -0
  254. package/dist/utilities/constants.js.map +1 -0
  255. package/dist/utilities/contracts/_module.d.ts +3 -1
  256. package/dist/utilities/contracts/_module.js +3 -1
  257. package/dist/utilities/contracts/_module.js.map +1 -1
  258. package/dist/utilities/contracts/prunable.contract.d.ts +11 -0
  259. package/dist/utilities/contracts/prunable.contract.js +5 -0
  260. package/dist/utilities/contracts/prunable.contract.js.map +1 -0
  261. package/dist/utilities/contracts/sqlite-database.contract.d.ts +26 -0
  262. package/dist/utilities/contracts/sqlite-database.contract.js +5 -0
  263. package/dist/utilities/contracts/sqlite-database.contract.js.map +1 -0
  264. package/dist/utilities/functions.d.ts +34 -2
  265. package/dist/utilities/functions.js +72 -4
  266. package/dist/utilities/functions.js.map +1 -1
  267. package/dist/utilities/types.d.ts +49 -16
  268. package/package.json +14 -13
  269. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js +0 -2
  270. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js.map +0 -1
  271. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +0 -61
  272. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +0 -318
  273. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +0 -1
  274. package/dist/utilities/_constants.js +0 -8
  275. package/dist/utilities/_constants.js.map +0 -1
  276. package/dist/utilities/kysely/_module.d.ts +0 -1
  277. package/dist/utilities/kysely/_module.js +0 -2
  278. package/dist/utilities/kysely/_module.js.map +0 -1
  279. package/dist/utilities/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
  280. package/dist/utilities/pipeline/_module.d.ts +0 -1
  281. package/dist/utilities/pipeline/_module.js +0 -2
  282. package/dist/utilities/pipeline/_module.js.map +0 -1
  283. package/dist/utilities/pipeline/pipeline.js.map +0 -1
  284. package/dist/utilities/time-span/_module.d.ts +0 -1
  285. package/dist/utilities/time-span/_module.js +0 -2
  286. package/dist/utilities/time-span/_module.js.map +0 -1
  287. package/dist/utilities/time-span/time-span.js.map +0 -1
  288. /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.d.ts +0 -0
  289. /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.js +0 -0
package/README.md CHANGED
@@ -28,8 +28,18 @@ The library provides modular solutions for the essential features needed in mode
28
28
  - Notification component
29
29
  - Abstract file system component
30
30
 
31
- This library is heavily inspired laravel but built in modular way where you can choose which part to use.
32
-
33
31
  #### NOTE: This library only supports ESM (ecmascript) module.
34
32
 
35
- ### Visit the [docs](https://yousif-khalil-abdulkarim.github.io/daiso-core/) for more information!
33
+ ### Inspiration
34
+ This library is inspired by [Laravel](https://laravel.com/docs/11.x/readme) and built with a modular design, so you can use only the parts you need.
35
+
36
+ It also integrates ideas from other libraries:
37
+ - [Symfony components](https://symfony.com/components), PHP
38
+ - [Verrou](https://verrou.dev/docs/introduction), TypeScript
39
+ - [Distributed lock](https://github.com/ZiggyCreatures/FusionCache), C#
40
+ - [Bento cache](https://bentocache.dev/docs/introduction), TypeScript
41
+ - [Fusion cache](https://github.com/ZiggyCreatures/FusionCache), C#
42
+ - [Polly](https://www.pollydocs.org/), C#
43
+
44
+
45
+ ### Visit the [docs](https://yousif-khalil-abdulkarim.github.io/daiso-core/) for more information!
@@ -3,19 +3,8 @@
3
3
  */
4
4
  import { type TimeSpan } from "../../../utilities/_module-exports.js";
5
5
  /**
6
- * The <i>delay</i> function creates a promise that will be fulfilled after given <i>time</i> and can be aborted by providing <i>abortSignal</i>.
7
- *
8
- * IMPORT_PATH: ```"@daiso-tech/core/async"```
9
- * @group Utilities
6
+ * @internal
10
7
  * @throws {AsyncError} {@link AsyncError}
11
8
  * @throws {AbortAsyncError} {@link AbortAsyncError}
12
- * @example
13
- * ```ts
14
- * import { delay, TimeSpan } from "@daiso-tech/core";
15
- * (async () => {
16
- * console.log("a");
17
- * await delay(TimeSpan.fromSeconds(2));
18
- * console.log("b");
19
- * })();
20
9
  */
21
10
  export declare function delay(time: TimeSpan, abortSignal?: AbortSignal): Promise<void>;
@@ -9,20 +9,9 @@ AsyncError,
9
9
  AbortAsyncError, } from "../../../async/async.errors.js";
10
10
  import { abortAndFail } from "../../../async/utilities/abort/_module.js";
11
11
  /**
12
- * The <i>delay</i> function creates a promise that will be fulfilled after given <i>time</i> and can be aborted by providing <i>abortSignal</i>.
13
- *
14
- * IMPORT_PATH: ```"@daiso-tech/core/async"```
15
- * @group Utilities
12
+ * @internal
16
13
  * @throws {AsyncError} {@link AsyncError}
17
14
  * @throws {AbortAsyncError} {@link AbortAsyncError}
18
- * @example
19
- * ```ts
20
- * import { delay, TimeSpan } from "@daiso-tech/core";
21
- * (async () => {
22
- * console.log("a");
23
- * await delay(TimeSpan.fromSeconds(2));
24
- * console.log("b");
25
- * })();
26
15
  */
27
16
  export async function delay(time, abortSignal = new AbortController().signal) {
28
17
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"file":"delay.js","sourceRoot":"","sources":["../../../../src/async/utilities/delay/delay.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO;AACH,6DAA6D;AAC7D,UAAU;AACV,6DAA6D;AAC7D,eAAe,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CACvB,IAAc,EACd,cAA2B,IAAI,eAAe,EAAE,CAAC,MAAM;IAEvD,8DAA8D;IAC9D,IAAI,SAAS,GAAQ,IAAI,CAAC;IAC1B,IAAI,CAAC;QACD,2DAA2D;QAC3D,OAAO,YAAY,CACf,GAAG,EAAE,CACD,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC1B,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBACxB,OAAO,EAAE,CAAC;YACd,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC9B,CAAC,CAAC,EACN,WAAW,CACd,CAAC;IACN,CAAC;YAAS,CAAC;QACP,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACrB,iEAAiE;YACjE,YAAY,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"delay.js","sourceRoot":"","sources":["../../../../src/async/utilities/delay/delay.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO;AACH,6DAA6D;AAC7D,UAAU;AACV,6DAA6D;AAC7D,eAAe,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CACvB,IAAc,EACd,cAA2B,IAAI,eAAe,EAAE,CAAC,MAAM;IAEvD,8DAA8D;IAC9D,IAAI,SAAS,GAAQ,IAAI,CAAC;IAC1B,IAAI,CAAC;QACD,2DAA2D;QAC3D,OAAO,YAAY,CACf,GAAG,EAAE,CACD,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC1B,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBACxB,OAAO,EAAE,CAAC;YACd,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC9B,CAAC,CAAC,EACN,WAAW,CACd,CAAC;IACN,CAAC;YAAS,CAAC;QACP,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACrB,iEAAiE;YACjE,YAAY,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -6,13 +6,52 @@ import type { LazyPromiseable, Promisable, TimeSpan } from "../../../utilities/_
6
6
  import type { RetryPolicy } from "../../../async/utilities/retry/_module.js";
7
7
  import { type Func } from "../../../utilities/_module-exports.js";
8
8
  /**
9
+ *
10
+ * IMPORT_PATH: ```"@daiso-tech/core/async"```
11
+ * @group Utilities
12
+ */
13
+ export type LazyPromiseOnFinally = () => Promisable<void>;
14
+ /**
15
+ *
16
+ * IMPORT_PATH: ```"@daiso-tech/core/async"```
17
+ * @group Utilities
18
+ */
19
+ export type LazyPromiseOnSuccess<TValue> = (value: TValue) => Promisable<void>;
20
+ /**
21
+ *
9
22
  * IMPORT_PATH: ```"@daiso-tech/core/async"```
10
23
  * @group Utilities
11
24
  */
12
- export type DeferSettings<TValue> = {
13
- onSucces?: (value: TValue) => Promisable<void>;
14
- onError?: (error: unknown) => Promisable<void>;
15
- onFinally?: () => Promisable<void>;
25
+ export type LazyPromiseOnError = (error: unknown) => Promisable<void>;
26
+ /**
27
+ *
28
+ * IMPORT_PATH: ```"@daiso-tech/core/async"```
29
+ * @group Utilities
30
+ */
31
+ export type LazyPromiseCallbacks<TValue = unknown> = {
32
+ onFinally?: LazyPromiseOnFinally;
33
+ onSuccess?: LazyPromiseOnSuccess<TValue>;
34
+ onError?: LazyPromiseOnError;
35
+ };
36
+ /**
37
+ *
38
+ * IMPORT_PATH: ```"@daiso-tech/core/async"```
39
+ * @group Utilities
40
+ */
41
+ export type LazyPromiseSettingsBase = {
42
+ backoffPolicy?: BackoffPolicy | null;
43
+ retryAttempts?: number | null;
44
+ retryPolicy?: RetryPolicy | null;
45
+ retryTimeout?: TimeSpan | null;
46
+ totalTimeout?: TimeSpan | null;
47
+ };
48
+ /**
49
+ *
50
+ * IMPORT_PATH: ```"@daiso-tech/core/async"```
51
+ * @group Utilities
52
+ */
53
+ export type LazyPromiseSettings<TValue = unknown> = LazyPromiseCallbacks<TValue> & LazyPromiseSettingsBase & {
54
+ abortSignal?: AbortSignal | null;
16
55
  };
17
56
  /**
18
57
  * The <i>LazyPromise</i> class is used for creating lazy <i>{@link PromiseLike}<i> object that will only execute when awaited or when then method is called.
@@ -40,19 +79,33 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
40
79
  * The <i>wrapFn</i> is convience method used for wrapping a async method with a <i>LazyPromise</i>.
41
80
  * @example
42
81
  * ```ts
43
- * import { LazyPromise, TimeSpan } from "@daiso-tech/core";
82
+ * import { LazyPromise } from "@daiso-tech/core/async";
83
+ * import { TimeSpan } from "@daiso-tech/core/utilities";
44
84
  * import { readFile as readFileNodeJs } from "node:fs/promises";
45
85
  *
46
- * const readFile = LazyPromise.wrapFn(readFileNodeJs, {
47
- * retryAttempts: 3
48
- * });
86
+ * const readFile = LazyPromise.wrapFn(readFileNodeJs);
49
87
  *
50
- * (async () => {
51
- * await readFile("none_existing_file.txt").timeout(TimeSpan.fromMinutes(1));
52
- * })();
88
+ * const file = await readFile("none_existing_file.txt")
89
+ * .setRetryAttempts(4)
90
+ * .timeout(TimeSpan.fromMinutes(1));
53
91
  * ```
54
92
  */
55
- static wrapFn<TParameters extends unknown[], TReturn>(fn: Func<TParameters, PromiseLike<TReturn>>): Func<TParameters, LazyPromise<TReturn>>;
93
+ static wrapFn<TParameters extends unknown[], TReturn>(fn: Func<TParameters, PromiseLike<TReturn>>, settings?: LazyPromiseSettings<TReturn>): Func<TParameters, LazyPromise<TReturn>>;
94
+ /**
95
+ * The <i>delay</i> method creates a <i>{@link LazyPromise}</i> that will be fulfilled after given <i>time</i>.
96
+ *
97
+ * @throws {AsyncError} {@link AsyncError}
98
+ * @throws {AbortAsyncError} {@link AbortAsyncError}
99
+ * @example
100
+ * ```ts
101
+ * import { LazyPromise } from "@daiso-tech/core/async";
102
+ * import { TimeSpan } from "@daiso-tech/core/utilities";
103
+ *
104
+ * console.log("a");
105
+ * await LazyPromise.delay(TimeSpan.fromSeconds(2));
106
+ * console.log("b");
107
+ */
108
+ static delay(time: TimeSpan): LazyPromise<void>;
56
109
  /**
57
110
  * The <i>all<i> method works similarly to <i>{@link Promise.all}</i> with the key distinction that it operates lazily.
58
111
  */
@@ -70,28 +123,24 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
70
123
  */
71
124
  static any<TValue>(promises: LazyPromise<TValue>[]): LazyPromise<TValue>;
72
125
  private promise;
73
- private attempts;
74
- private backoffPolicy_;
75
- private retryPolicy_;
76
- private abortSignal;
77
- private time;
78
126
  private asyncFn;
127
+ private readonly settings;
79
128
  /**
80
129
  * @example
81
130
  * ```ts
82
- * import { LazyPromise } from "@daiso-tech/core";
131
+ * import { LazyPromise } from "@daiso-tech/core/async";
83
132
  *
84
- * (async () => {
85
- * const promise = new LazyPromise(async () => {
86
- * console.log("I am lazy");
87
- * });
88
- * // "I am lazy" will only logged when awaited or then method i called.
89
- * await promise;
90
- * })();
133
+ * const promise = new LazyPromise(async () => {
134
+ * console.log("I am lazy");
135
+ * });
136
+ *
137
+ * // "I am lazy" will only logged when awaited or then method i called.
138
+ * await promise;
91
139
  */
92
- constructor(asyncFn: LazyPromiseable<TValue>);
93
- private applyTimeout;
140
+ constructor(asyncFn: LazyPromiseable<TValue>, settings?: LazyPromiseSettings<TValue>);
141
+ private applyRetryTimeout;
94
142
  private applyRetry;
143
+ private applyTotalTimeout;
95
144
  private applyAbort;
96
145
  private applySettings;
97
146
  /**
@@ -101,10 +150,10 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
101
150
  */
102
151
  then<TResult1 = TValue, TResult2 = never>(onfulfilled?: ((value: TValue) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
103
152
  /**
104
- * The <i>setRetryAttempts</i> method is used for setting max retry attempts.
105
- * @example
153
+ * The <i>setBackoffPolicy</i> method is used for setting a custom <i>{@link BackoffPolicy}</i>.
106
154
  * ```ts
107
- * import { LazyPromise } from "@daiso-tech/core";
155
+ * import { LazyPromise, linearBackoffPolicy } from "@daiso-tech/core/async";
156
+ * import { TimeSpan } from "@daiso-tech/core/utilities";
108
157
  *
109
158
  * const promise =
110
159
  * new LazyPromise(async () => {
@@ -112,18 +161,18 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
112
161
  * throw new Error("Error occured!");
113
162
  * })
114
163
  * .setRetryAttempts(3)
115
- * (async () => {
116
- * // Will log "A" 3 times and then retry error will be thrown.
117
- * await promise;
118
- * })();
164
+ * .setBackoffPolicy(linearBackoffPolicy())
165
+ *
166
+ * // Will log "A" 3 times and then retry error will be thrown.
167
+ * await promise;
119
168
  * ```
120
169
  */
121
- setRetryAttempts(attempts: number | null): this;
170
+ setBackoffPolicy(policy: BackoffPolicy | null): LazyPromise<TValue>;
122
171
  /**
123
- * The <i>setBackoffPolicy</i> method is used for setting a custom <i>{@link BackoffPolicy}</i>.
172
+ * The <i>setRetryAttempts</i> method is used for setting max retry attempts.
124
173
  * @example
125
174
  * ```ts
126
- * import { LazyPromise, linearBackoffPolicy } from "@daiso-tech/core";
175
+ * import { LazyPromise } from "@daiso-tech/core/async";
127
176
  *
128
177
  * const promise =
129
178
  * new LazyPromise(async () => {
@@ -131,19 +180,17 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
131
180
  * throw new Error("Error occured!");
132
181
  * })
133
182
  * .setRetryAttempts(3)
134
- * .setBackoffPolicy(linearBackoffPolicy())
135
- * (async () => {
136
- * // Will log "A" 3 times and then retry error will be thrown.
137
- * await promise;
138
- * })();
183
+ *
184
+ * // Will log "A" 3 times and then retry error will be thrown.
185
+ * await promise;
139
186
  * ```
140
187
  */
141
- setBackoffPolicy(policy: BackoffPolicy | null): this;
188
+ setRetryAttempts(attempts: number | null): LazyPromise<TValue>;
142
189
  /**
143
190
  * The <i>setRetryPolicy</i> method is used for setting a custom <i>{@link BackoffPolicy}</i>.
144
191
  * @example
145
192
  * ```ts
146
- * import { LazyPromise } from "@daiso-tech/core";
193
+ * import { LazyPromise } from "@daiso-tech/core/async";
147
194
  *
148
195
  * class ErrorA extends Error {}
149
196
  *
@@ -155,69 +202,94 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
155
202
  * .setRetryAttempts(3)
156
203
  * // Will only retry an error that is instance ErrorA
157
204
  * .setRetryPolicy(error => error instanceof ErrorA)
158
- * (async () => {
159
- * // Will log "A" 1 time and then error will be thrown.
160
- * await promise;
161
- * })();
205
+ *
206
+ * // Will log "A" 1 time and then error will be thrown.
207
+ * await promise;
162
208
  * ```
163
209
  */
164
- setRetryPolicy(policy: RetryPolicy | null): this;
210
+ setRetryPolicy(policy: RetryPolicy | null): LazyPromise<TValue>;
165
211
  /**
166
- * The <i>setTimeout</i> method aborts the <i>LazyPromise</i> if it exceeds the given <i>time</i> by throwning an error.
212
+ * The <i>setRetryTimeout</i> method aborts the each retry if it exceeds the given <i>time</i>.
167
213
  * @example
168
214
  * ```ts
169
- * import { LazyPromise, delay, TimeSpan } from "@daiso-tech/core";
215
+ * import { LazyPromise } from "@daiso-tech/core/async";
216
+ * import { TimeSpan } from "@daiso-tech/core/utilities";
170
217
  *
171
218
  * const promise =
172
219
  * new LazyPromise(async () => {
173
- * await delay(TimeSpan.fromMinutes(1));
220
+ * await LazyPromise.delay(TimeSpan.fromMinutes(1));
174
221
  * })
175
- * .setTimeout(TimeSpan.fromSeconds(1));
176
- * (async () => {
177
- * // An timeout error will be thrown.
178
- * await promise;
179
- * })();
222
+ * .setRetryTimeout(TimeSpan.fromSeconds(1));
223
+ *
224
+ * // An timeout error will be thrown.
225
+ * await promise;
180
226
  * ```
181
227
  */
182
- setTimeout(time: TimeSpan | null): this;
228
+ setRetryTimeout(time: TimeSpan | null): LazyPromise<TValue>;
229
+ /**
230
+ * The <i>setTotalTimeout</i> method aborts the <i>LazyPromise</i> if it exceeds the given <i>time</i> by throwning an error.
231
+ * @example
232
+ * ```ts
233
+ * import { LazyPromise } from "@daiso-tech/core/async";
234
+ * import { TimeSpan } from "@daiso-tech/core/utilities";
235
+ *
236
+ * const promise =
237
+ * new LazyPromise(async () => {
238
+ * await LazyPromise.delay(TimeSpan.fromMinutes(1));
239
+ * })
240
+ * .setRetryTimeout(TimeSpan.fromSeconds(1));
241
+ *
242
+ * // An timeout error will be thrown.
243
+ * await promise;
244
+ * ```
245
+ */
246
+ setTotalTimeout(time: TimeSpan | null): LazyPromise<TValue>;
183
247
  /**
184
248
  * The <i>setAbortSignal</i> method aborts the <i>LazyPromise</i> by the passed in <i>abortSignal</i>.
185
249
  * @example
186
250
  * ```ts
187
- * import { LazyPromise, delay, TimeSpan } from "@daiso-tech/core";
251
+ * import { LazyPromise } from "@daiso-tech/core";
252
+ * import { TimeSpan } from "@daiso-tech/core/utilities";
188
253
  *
189
254
  * const abortController = new AbortController();
190
255
  * const promise =
191
256
  * new LazyPromise(async () => {
192
- * await delay(TimeSpan.fromMinutes(1));
257
+ * await LazyPromise.delay(TimeSpan.fromMinutes(1));
193
258
  * })
194
259
  * .setAbortSignal(abortController.signal);
195
- * (async () => {
196
- * setTimeout(() => {
197
- * abortController.abort();
198
- * }, 1000);
199
- * // An timeout error will be thrown.
200
- * await promise;
201
- * })();
260
+ *
261
+ * setTimeout(() => {
262
+ * abortController.abort();
263
+ * }, 1000);
264
+ *
265
+ * // An timeout error will be thrown.
266
+ * await promise;
202
267
  * ```
203
268
  */
204
- setAbortSignal(abortSignal: AbortSignal | null): this;
269
+ setAbortSignal(abortSignal: AbortSignal | null): LazyPromise<TValue>;
270
+ onFinally(cb: LazyPromiseOnFinally): LazyPromise<TValue>;
271
+ onSuccess(cb: LazyPromiseOnSuccess<TValue>): LazyPromise<TValue>;
272
+ onError(cb: LazyPromiseOnError): LazyPromise<TValue>;
205
273
  /**
206
274
  * The <i>defer</i> method executes the <i>LazyPromise</i> without awaiting it.
207
275
  * @example
208
276
  * ```ts
209
- * import { LazyPromise, delay, TimeSpan } from "@daiso-tech/core";
277
+ * import { LazyPromise } from "@daiso-tech/core";
278
+ * import { TimeSpan } from "@daiso-tech/core/utilities";
210
279
  *
211
280
  * const promise =
212
281
  * new LazyPromise(async () => {
213
- * await delay(TimeSpan.fromSeconds(1));
282
+ * await LazyPromise.delay(TimeSpan.fromSeconds(1));
214
283
  * // Will be loged after one second
215
284
  * console.log("Done !");
216
285
  * });
286
+ *
217
287
  * promise.defer();
288
+ *
218
289
  * // Will be logged immediately
219
290
  * console.log("Hello");
291
+ * await LazyPromise.delay(TimeSpan.fromSeconds(2));
220
292
  * ```
221
293
  */
222
- defer(callbacks?: DeferSettings<TValue>): void;
294
+ defer(): void;
223
295
  }