@daiso-tech/core 0.15.0 → 0.17.4

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 (494) hide show
  1. package/dist/cjs/_module.js +2 -2
  2. package/dist/cjs/_module.js.map +1 -1
  3. package/dist/cjs/async/_module.js +1 -1
  4. package/dist/cjs/async/_module.js.map +1 -1
  5. package/dist/cjs/async/backof-policies/_module.js +1 -0
  6. package/dist/cjs/async/backof-policies/_module.js.map +1 -1
  7. package/dist/cjs/async/utilities/_module.js +3 -0
  8. package/dist/cjs/async/utilities/_module.js.map +1 -1
  9. package/dist/cjs/async/utilities/lazy-promise/lazy-promise.js +21 -12
  10. package/dist/cjs/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
  11. package/dist/cjs/cache/contracts/cache.events.js +168 -0
  12. package/dist/cjs/cache/contracts/cache.events.js.map +1 -1
  13. package/dist/cjs/cache/implementations/_shared/_module.js +1 -0
  14. package/dist/cjs/cache/implementations/_shared/_module.js.map +1 -1
  15. package/dist/cjs/cache/implementations/_shared/cache-adapter.test-suite.js +256 -177
  16. package/dist/cjs/cache/implementations/_shared/cache-adapter.test-suite.js.map +1 -1
  17. package/dist/cjs/cache/implementations/_shared/cache.test-suite.js +23 -2
  18. package/dist/cjs/cache/implementations/_shared/cache.test-suite.js.map +1 -1
  19. package/dist/cjs/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +63 -20
  20. package/dist/cjs/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +1 -1
  21. package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/_module.js +2 -1
  22. package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/_module.js.map +1 -1
  23. package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter-settings.js +56 -0
  24. package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter-settings.js.map +1 -0
  25. package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +30 -16
  26. package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
  27. package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/_module.js +1 -0
  28. package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/_module.js.map +1 -1
  29. package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter-settings.js +26 -0
  30. package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter-settings.js.map +1 -0
  31. package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +66 -39
  32. package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
  33. package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/_module.js +2 -1
  34. package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/_module.js.map +1 -1
  35. package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-settings.js +44 -0
  36. package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-settings.js.map +1 -0
  37. package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +78 -28
  38. package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
  39. package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +10 -1
  40. package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
  41. package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/_module.js +1 -0
  42. package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/_module.js.map +1 -1
  43. package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-settings.js +32 -0
  44. package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-settings.js.map +1 -0
  45. package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +55 -23
  46. package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
  47. package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/_module.js +1 -0
  48. package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/_module.js.map +1 -1
  49. package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter-settings.js +56 -0
  50. package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter-settings.js.map +1 -0
  51. package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +31 -17
  52. package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
  53. package/dist/cjs/cache/implementations/derivables/_module.js +3 -2
  54. package/dist/cjs/cache/implementations/derivables/_module.js.map +1 -1
  55. package/dist/cjs/cache/implementations/derivables/cache-factory-settings.js +65 -0
  56. package/dist/cjs/cache/implementations/derivables/cache-factory-settings.js.map +1 -0
  57. package/dist/cjs/cache/implementations/derivables/cache-factory.js +29 -18
  58. package/dist/cjs/cache/implementations/derivables/cache-factory.js.map +1 -1
  59. package/dist/cjs/cache/implementations/derivables/cache-settings.js +56 -0
  60. package/dist/cjs/cache/implementations/derivables/cache-settings.js.map +1 -0
  61. package/dist/cjs/cache/implementations/derivables/cache.js +334 -79
  62. package/dist/cjs/cache/implementations/derivables/cache.js.map +1 -1
  63. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js +14 -7
  64. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  65. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +1 -1
  66. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +1 -1
  67. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +1 -1
  68. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +1 -1
  69. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +1 -1
  70. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +1 -1
  71. package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js +62 -41
  72. package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  73. package/dist/cjs/collection/implementations/iterable-collection/_shared/merge-iterable.js +6 -7
  74. package/dist/cjs/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
  75. package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js +11 -2
  76. package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
  77. package/dist/cjs/collection/implementations/list-collection/list-collection.js +13 -0
  78. package/dist/cjs/collection/implementations/list-collection/list-collection.js.map +1 -1
  79. package/dist/cjs/event-bus/contracts/_module.js +2 -2
  80. package/dist/cjs/event-bus/contracts/_module.js.map +1 -1
  81. package/dist/cjs/event-bus/contracts/_shared.js +7 -0
  82. package/dist/cjs/event-bus/contracts/_shared.js.map +1 -1
  83. package/dist/cjs/event-bus/implementations/_shared/event-bus-adapter.test-suite.js +98 -38
  84. package/dist/cjs/event-bus/implementations/_shared/event-bus-adapter.test-suite.js.map +1 -1
  85. package/dist/cjs/event-bus/implementations/_shared/event-bus.test-suite.js +197 -125
  86. package/dist/cjs/event-bus/implementations/_shared/event-bus.test-suite.js.map +1 -1
  87. package/dist/cjs/event-bus/implementations/adapters/_module.js +1 -1
  88. package/dist/cjs/event-bus/implementations/adapters/_module.js.map +1 -1
  89. package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/_module.js +2 -1
  90. package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/_module.js.map +1 -1
  91. package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter-settings.js +26 -0
  92. package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter-settings.js.map +1 -0
  93. package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +29 -11
  94. package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
  95. package/dist/cjs/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +9 -3
  96. package/dist/cjs/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
  97. package/dist/cjs/{serializer/implementations/_shared/test-utilities → event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter}/_module.js +2 -1
  98. package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.js.map +1 -0
  99. package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter-settings.js +38 -0
  100. package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter-settings.js.map +1 -0
  101. package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +56 -0
  102. package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -0
  103. package/dist/cjs/event-bus/implementations/derivables/_module.js +3 -1
  104. package/dist/cjs/event-bus/implementations/derivables/_module.js.map +1 -1
  105. package/dist/cjs/event-bus/implementations/derivables/event-bus-factory-settings.js +59 -0
  106. package/dist/cjs/event-bus/implementations/derivables/event-bus-factory-settings.js.map +1 -0
  107. package/dist/cjs/event-bus/implementations/derivables/event-bus-factory.js +28 -17
  108. package/dist/cjs/event-bus/implementations/derivables/event-bus-factory.js.map +1 -1
  109. package/dist/cjs/event-bus/implementations/derivables/event-bus-settings.js +56 -0
  110. package/dist/cjs/event-bus/implementations/derivables/event-bus-settings.js.map +1 -0
  111. package/dist/cjs/event-bus/implementations/derivables/event-bus.js +106 -37
  112. package/dist/cjs/event-bus/implementations/derivables/event-bus.js.map +1 -1
  113. package/dist/cjs/serde/contracts/_module.js +23 -0
  114. package/dist/cjs/serde/contracts/_module.js.map +1 -0
  115. package/dist/cjs/serde/contracts/deserializer.contract.js +3 -0
  116. package/dist/cjs/serde/contracts/deserializer.contract.js.map +1 -0
  117. package/dist/cjs/serde/contracts/flexible-serde.contract.js +3 -0
  118. package/dist/cjs/serde/contracts/flexible-serde.contract.js.map +1 -0
  119. package/dist/cjs/serde/contracts/serde.contract.js +3 -0
  120. package/dist/cjs/serde/contracts/serde.contract.js.map +1 -0
  121. package/dist/cjs/{serializer/contracts/serializer.errors.js → serde/contracts/serde.errors.js} +7 -7
  122. package/dist/cjs/serde/contracts/serde.errors.js.map +1 -0
  123. package/dist/cjs/serde/contracts/serializable.contract.js +3 -0
  124. package/dist/cjs/serde/contracts/serializable.contract.js.map +1 -0
  125. package/dist/cjs/serde/contracts/serializer.contract.js.map +1 -0
  126. package/dist/cjs/{serializer → serde}/implementations/_module.js +6 -5
  127. package/dist/cjs/serde/implementations/_module.js.map +1 -0
  128. package/dist/cjs/{serializer/contracts → serde/implementations/_shared/test-utilities}/_module.js +2 -2
  129. package/dist/cjs/serde/implementations/_shared/test-utilities/_module.js.map +1 -0
  130. package/dist/cjs/serde/implementations/_shared/test-utilities/flexible-serde.test-suite.js +53 -0
  131. package/dist/cjs/serde/implementations/_shared/test-utilities/flexible-serde.test-suite.js.map +1 -0
  132. package/dist/cjs/{serializer/implementations/_shared/test-utilities/serializer.test-suite.js → serde/implementations/_shared/test-utilities/serde.test-suite.js} +68 -93
  133. package/dist/cjs/serde/implementations/_shared/test-utilities/serde.test-suite.js.map +1 -0
  134. package/dist/cjs/{serializer/implementations/sql-serializer → serde/implementations/mongodb-serde}/_module.js +1 -1
  135. package/dist/cjs/serde/implementations/mongodb-serde/_module.js.map +1 -0
  136. package/dist/cjs/serde/implementations/mongodb-serde/mongodb-serde.js +36 -0
  137. package/dist/cjs/serde/implementations/mongodb-serde/mongodb-serde.js.map +1 -0
  138. package/dist/cjs/{serializer/implementations/redis-serializer → serde/implementations/no-op-serde}/_module.js +1 -1
  139. package/dist/cjs/serde/implementations/no-op-serde/_module.js.map +1 -0
  140. package/dist/cjs/serde/implementations/no-op-serde/no-op-serde.js +16 -0
  141. package/dist/cjs/serde/implementations/no-op-serde/no-op-serde.js.map +1 -0
  142. package/dist/cjs/{serializer/implementations/mongodb-serializer → serde/implementations/redis-serde}/_module.js +1 -1
  143. package/dist/cjs/serde/implementations/redis-serde/_module.js.map +1 -0
  144. package/dist/cjs/serde/implementations/redis-serde/redis-serde.js +37 -0
  145. package/dist/cjs/serde/implementations/redis-serde/redis-serde.js.map +1 -0
  146. package/dist/cjs/{event-bus/implementations/adapters/redis-event-bus-adapter → serde/implementations/sql-serde}/_module.js +1 -1
  147. package/dist/cjs/serde/implementations/sql-serde/_module.js.map +1 -0
  148. package/dist/cjs/serde/implementations/sql-serde/sql-serde.js +37 -0
  149. package/dist/cjs/serde/implementations/sql-serde/sql-serde.js.map +1 -0
  150. package/dist/cjs/serde/implementations/super-json-serde/_module.js +18 -0
  151. package/dist/cjs/serde/implementations/super-json-serde/_module.js.map +1 -0
  152. package/dist/cjs/{serializer/implementations/super-json-serializer/super-json-serializer.js → serde/implementations/super-json-serde/super-json-serde.js} +77 -100
  153. package/dist/cjs/serde/implementations/super-json-serde/super-json-serde.js.map +1 -0
  154. package/dist/cjs/utilities/contracts/_module.js +1 -0
  155. package/dist/cjs/utilities/contracts/_module.js.map +1 -1
  156. package/dist/cjs/utilities/contracts/buildable.contract.js +3 -0
  157. package/dist/cjs/utilities/contracts/buildable.contract.js.map +1 -0
  158. package/dist/cjs/utilities/errors.js +10 -10
  159. package/dist/cjs/utilities/errors.js.map +1 -1
  160. package/dist/cjs/utilities/functions.js +9 -5
  161. package/dist/cjs/utilities/functions.js.map +1 -1
  162. package/dist/cjs/utilities/time-span/time-span.js +8 -0
  163. package/dist/cjs/utilities/time-span/time-span.js.map +1 -1
  164. package/dist/esm/_module.js +2 -2
  165. package/dist/esm/_module.js.map +1 -1
  166. package/dist/esm/async/_module.js +1 -1
  167. package/dist/esm/async/_module.js.map +1 -1
  168. package/dist/esm/async/backof-policies/_module.js +1 -0
  169. package/dist/esm/async/backof-policies/_module.js.map +1 -1
  170. package/dist/esm/async/utilities/_module.js +3 -0
  171. package/dist/esm/async/utilities/_module.js.map +1 -1
  172. package/dist/esm/async/utilities/lazy-promise/lazy-promise.js +21 -12
  173. package/dist/esm/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
  174. package/dist/esm/cache/contracts/cache.events.js +158 -0
  175. package/dist/esm/cache/contracts/cache.events.js.map +1 -1
  176. package/dist/esm/cache/implementations/_shared/_module.js +1 -0
  177. package/dist/esm/cache/implementations/_shared/_module.js.map +1 -1
  178. package/dist/esm/cache/implementations/_shared/cache-adapter.test-suite.js +256 -177
  179. package/dist/esm/cache/implementations/_shared/cache-adapter.test-suite.js.map +1 -1
  180. package/dist/esm/cache/implementations/_shared/cache.test-suite.js +23 -2
  181. package/dist/esm/cache/implementations/_shared/cache.test-suite.js.map +1 -1
  182. package/dist/esm/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +64 -21
  183. package/dist/esm/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +1 -1
  184. package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/_module.js +2 -1
  185. package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/_module.js.map +1 -1
  186. package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter-settings.js +52 -0
  187. package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter-settings.js.map +1 -0
  188. package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +29 -15
  189. package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
  190. package/dist/esm/cache/implementations/adapters/memory-cache-adapter/_module.js +1 -0
  191. package/dist/esm/cache/implementations/adapters/memory-cache-adapter/_module.js.map +1 -1
  192. package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter-settings.js +22 -0
  193. package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter-settings.js.map +1 -0
  194. package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +66 -39
  195. package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
  196. package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/_module.js +2 -1
  197. package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/_module.js.map +1 -1
  198. package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-settings.js +40 -0
  199. package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-settings.js.map +1 -0
  200. package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +78 -25
  201. package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
  202. package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +10 -1
  203. package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
  204. package/dist/esm/cache/implementations/adapters/redis-cache-adapter/_module.js +1 -0
  205. package/dist/esm/cache/implementations/adapters/redis-cache-adapter/_module.js.map +1 -1
  206. package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-settings.js +28 -0
  207. package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-settings.js.map +1 -0
  208. package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +55 -23
  209. package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
  210. package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/_module.js +1 -0
  211. package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/_module.js.map +1 -1
  212. package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter-settings.js +52 -0
  213. package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter-settings.js.map +1 -0
  214. package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +29 -15
  215. package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
  216. package/dist/esm/cache/implementations/derivables/_module.js +3 -2
  217. package/dist/esm/cache/implementations/derivables/_module.js.map +1 -1
  218. package/dist/esm/cache/implementations/derivables/cache-factory-settings.js +61 -0
  219. package/dist/esm/cache/implementations/derivables/cache-factory-settings.js.map +1 -0
  220. package/dist/esm/cache/implementations/derivables/cache-factory.js +30 -19
  221. package/dist/esm/cache/implementations/derivables/cache-factory.js.map +1 -1
  222. package/dist/esm/cache/implementations/derivables/cache-settings.js +52 -0
  223. package/dist/esm/cache/implementations/derivables/cache-settings.js.map +1 -0
  224. package/dist/esm/cache/implementations/derivables/cache.js +333 -78
  225. package/dist/esm/cache/implementations/derivables/cache.js.map +1 -1
  226. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js +14 -7
  227. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  228. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +1 -1
  229. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +1 -1
  230. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +1 -1
  231. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +1 -1
  232. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +1 -1
  233. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +1 -1
  234. package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js +62 -41
  235. package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  236. package/dist/esm/collection/implementations/iterable-collection/_shared/merge-iterable.js +6 -7
  237. package/dist/esm/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
  238. package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js +11 -2
  239. package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
  240. package/dist/esm/collection/implementations/list-collection/list-collection.js +13 -0
  241. package/dist/esm/collection/implementations/list-collection/list-collection.js.map +1 -1
  242. package/dist/esm/event-bus/contracts/_module.js +2 -2
  243. package/dist/esm/event-bus/contracts/_module.js.map +1 -1
  244. package/dist/esm/event-bus/contracts/_shared.js +5 -0
  245. package/dist/esm/event-bus/contracts/_shared.js.map +1 -1
  246. package/dist/esm/event-bus/implementations/_shared/event-bus-adapter.test-suite.js +96 -36
  247. package/dist/esm/event-bus/implementations/_shared/event-bus-adapter.test-suite.js.map +1 -1
  248. package/dist/esm/event-bus/implementations/_shared/event-bus.test-suite.js +195 -123
  249. package/dist/esm/event-bus/implementations/_shared/event-bus.test-suite.js.map +1 -1
  250. package/dist/esm/event-bus/implementations/adapters/_module.js +1 -1
  251. package/dist/esm/event-bus/implementations/adapters/_module.js.map +1 -1
  252. package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/_module.js +2 -1
  253. package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/_module.js.map +1 -1
  254. package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter-settings.js +22 -0
  255. package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter-settings.js.map +1 -0
  256. package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +29 -11
  257. package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
  258. package/dist/esm/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +9 -3
  259. package/dist/esm/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
  260. package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.js +3 -0
  261. package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.js.map +1 -0
  262. package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter-settings.js +34 -0
  263. package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter-settings.js.map +1 -0
  264. package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +52 -0
  265. package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -0
  266. package/dist/esm/event-bus/implementations/derivables/_module.js +3 -1
  267. package/dist/esm/event-bus/implementations/derivables/_module.js.map +1 -1
  268. package/dist/esm/event-bus/implementations/derivables/event-bus-factory-settings.js +55 -0
  269. package/dist/esm/event-bus/implementations/derivables/event-bus-factory-settings.js.map +1 -0
  270. package/dist/esm/event-bus/implementations/derivables/event-bus-factory.js +29 -18
  271. package/dist/esm/event-bus/implementations/derivables/event-bus-factory.js.map +1 -1
  272. package/dist/esm/event-bus/implementations/derivables/event-bus-settings.js +52 -0
  273. package/dist/esm/event-bus/implementations/derivables/event-bus-settings.js.map +1 -0
  274. package/dist/esm/event-bus/implementations/derivables/event-bus.js +108 -39
  275. package/dist/esm/event-bus/implementations/derivables/event-bus.js.map +1 -1
  276. package/dist/esm/serde/contracts/_module.js +7 -0
  277. package/dist/esm/serde/contracts/_module.js.map +1 -0
  278. package/dist/esm/serde/contracts/deserializer.contract.js +1 -0
  279. package/dist/esm/serde/contracts/deserializer.contract.js.map +1 -0
  280. package/dist/esm/serde/contracts/flexible-serde.contract.js +1 -0
  281. package/dist/esm/serde/contracts/flexible-serde.contract.js.map +1 -0
  282. package/dist/esm/serde/contracts/serde.contract.js +1 -0
  283. package/dist/esm/serde/contracts/serde.contract.js.map +1 -0
  284. package/dist/esm/{serializer/contracts/serializer.errors.js → serde/contracts/serde.errors.js} +5 -5
  285. package/dist/esm/serde/contracts/serde.errors.js.map +1 -0
  286. package/dist/esm/serde/contracts/serializable.contract.js +1 -0
  287. package/dist/esm/serde/contracts/serializable.contract.js.map +1 -0
  288. package/dist/esm/serde/contracts/serializer.contract.js.map +1 -0
  289. package/dist/esm/serde/implementations/_module.js +7 -0
  290. package/dist/esm/serde/implementations/_module.js.map +1 -0
  291. package/dist/esm/serde/implementations/_shared/test-utilities/_module.js +3 -0
  292. package/dist/esm/serde/implementations/_shared/test-utilities/_module.js.map +1 -0
  293. package/dist/esm/serde/implementations/_shared/test-utilities/flexible-serde.test-suite.js +50 -0
  294. package/dist/esm/serde/implementations/_shared/test-utilities/flexible-serde.test-suite.js.map +1 -0
  295. package/dist/esm/{serializer/implementations/_shared/test-utilities/serializer.test-suite.js → serde/implementations/_shared/test-utilities/serde.test-suite.js} +67 -92
  296. package/dist/esm/serde/implementations/_shared/test-utilities/serde.test-suite.js.map +1 -0
  297. package/dist/esm/serde/implementations/mongodb-serde/_module.js +2 -0
  298. package/dist/esm/serde/implementations/mongodb-serde/_module.js.map +1 -0
  299. package/dist/esm/{serializer/implementations/mongodb-serializer/mongodb-serializer.js → serde/implementations/mongodb-serde/mongodb-serde.js} +10 -10
  300. package/dist/esm/serde/implementations/mongodb-serde/mongodb-serde.js.map +1 -0
  301. package/dist/esm/serde/implementations/no-op-serde/_module.js +2 -0
  302. package/dist/esm/serde/implementations/no-op-serde/_module.js.map +1 -0
  303. package/dist/esm/serde/implementations/no-op-serde/no-op-serde.js +12 -0
  304. package/dist/esm/serde/implementations/no-op-serde/no-op-serde.js.map +1 -0
  305. package/dist/esm/serde/implementations/redis-serde/_module.js +2 -0
  306. package/dist/esm/serde/implementations/redis-serde/_module.js.map +1 -0
  307. package/dist/esm/{serializer/implementations/sql-serializer/sql-serializer.js → serde/implementations/redis-serde/redis-serde.js} +10 -10
  308. package/dist/esm/serde/implementations/redis-serde/redis-serde.js.map +1 -0
  309. package/dist/esm/serde/implementations/sql-serde/_module.js +2 -0
  310. package/dist/esm/serde/implementations/sql-serde/_module.js.map +1 -0
  311. package/dist/esm/{serializer/implementations/redis-serializer/redis-serializer.js → serde/implementations/sql-serde/sql-serde.js} +10 -10
  312. package/dist/esm/serde/implementations/sql-serde/sql-serde.js.map +1 -0
  313. package/dist/esm/serde/implementations/super-json-serde/_module.js +2 -0
  314. package/dist/esm/serde/implementations/super-json-serde/_module.js.map +1 -0
  315. package/dist/esm/{serializer/implementations/super-json-serializer/super-json-serializer.js → serde/implementations/super-json-serde/super-json-serde.js} +55 -55
  316. package/dist/esm/serde/implementations/super-json-serde/super-json-serde.js.map +1 -0
  317. package/dist/esm/utilities/contracts/_module.js +1 -0
  318. package/dist/esm/utilities/contracts/_module.js.map +1 -1
  319. package/dist/esm/utilities/contracts/buildable.contract.js +1 -0
  320. package/dist/esm/utilities/contracts/buildable.contract.js.map +1 -0
  321. package/dist/esm/utilities/errors.js +7 -7
  322. package/dist/esm/utilities/errors.js.map +1 -1
  323. package/dist/esm/utilities/functions.js +7 -4
  324. package/dist/esm/utilities/functions.js.map +1 -1
  325. package/dist/esm/utilities/time-span/time-span.js +8 -0
  326. package/dist/esm/utilities/time-span/time-span.js.map +1 -1
  327. package/dist/types/_module.d.ts +2 -2
  328. package/dist/types/async/_module.d.ts +1 -1
  329. package/dist/types/async/backof-policies/_module.d.ts +1 -1
  330. package/dist/types/async/utilities/_module.d.ts +3 -0
  331. package/dist/types/async/utilities/lazy-promise/lazy-promise.d.ts +66 -39
  332. package/dist/types/cache/contracts/cache-adapter.contract.d.ts +20 -6
  333. package/dist/types/cache/contracts/cache-factory.contract.d.ts +12 -25
  334. package/dist/types/cache/contracts/cache.contract.d.ts +382 -22
  335. package/dist/types/cache/contracts/cache.events.d.ts +156 -42
  336. package/dist/types/cache/implementations/_shared/_module.d.ts +1 -0
  337. package/dist/types/cache/implementations/_shared/cache-adapter.test-suite.d.ts +21 -12
  338. package/dist/types/cache/implementations/_shared/cache.test-suite.d.ts +21 -15
  339. package/dist/types/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +15 -8
  340. package/dist/types/cache/implementations/adapters/libsql-cache-adapter/_module.d.ts +2 -1
  341. package/dist/types/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter-settings.d.ts +48 -0
  342. package/dist/types/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +54 -36
  343. package/dist/types/cache/implementations/adapters/memory-cache-adapter/_module.d.ts +1 -0
  344. package/dist/types/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter-settings.d.ts +27 -0
  345. package/dist/types/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +50 -20
  346. package/dist/types/cache/implementations/adapters/mongodb-cache-adapter/_module.d.ts +2 -1
  347. package/dist/types/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-settings.d.ts +51 -0
  348. package/dist/types/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +66 -41
  349. package/dist/types/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +6 -3
  350. package/dist/types/cache/implementations/adapters/redis-cache-adapter/_module.d.ts +1 -0
  351. package/dist/types/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-settings.d.ts +32 -0
  352. package/dist/types/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +51 -29
  353. package/dist/types/cache/implementations/adapters/sqlite-cache-adapter/_module.d.ts +1 -0
  354. package/dist/types/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter-settings.d.ts +48 -0
  355. package/dist/types/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +54 -34
  356. package/dist/types/cache/implementations/derivables/_module.d.ts +3 -2
  357. package/dist/types/cache/implementations/derivables/cache-factory-settings.d.ts +77 -0
  358. package/dist/types/cache/implementations/derivables/cache-factory.d.ts +59 -45
  359. package/dist/types/cache/implementations/derivables/cache-settings.d.ts +68 -0
  360. package/dist/types/cache/implementations/derivables/cache.d.ts +83 -62
  361. package/dist/types/collection/contracts/async-collection.contract.d.ts +1247 -666
  362. package/dist/types/collection/contracts/collection.contract.d.ts +1195 -638
  363. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.d.ts +4 -5
  364. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.d.ts +1 -1
  365. package/dist/types/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +194 -3
  366. package/dist/types/collection/implementations/iterable-collection/_shared/merge-iterable.d.ts +4 -5
  367. package/dist/types/collection/implementations/iterable-collection/iterable-collection.d.ts +141 -1
  368. package/dist/types/collection/implementations/list-collection/list-collection.d.ts +141 -1
  369. package/dist/types/event-bus/contracts/_module.d.ts +2 -2
  370. package/dist/types/event-bus/contracts/_shared.d.ts +11 -0
  371. package/dist/types/event-bus/contracts/event-bus-adapter.contract.d.ts +9 -8
  372. package/dist/types/event-bus/contracts/event-bus-factory.contract.d.ts +38 -32
  373. package/dist/types/event-bus/contracts/event-bus.contract.d.ts +52 -37
  374. package/dist/types/event-bus/implementations/_shared/event-bus-adapter.test-suite.d.ts +22 -10
  375. package/dist/types/event-bus/implementations/_shared/event-bus.test-suite.d.ts +16 -13
  376. package/dist/types/event-bus/implementations/adapters/_module.d.ts +1 -1
  377. package/dist/types/event-bus/implementations/adapters/memory-event-bus-adapter/_module.d.ts +2 -1
  378. package/dist/types/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter-settings.d.ts +28 -0
  379. package/dist/types/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +53 -22
  380. package/dist/types/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +7 -4
  381. package/dist/types/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.d.ts +2 -0
  382. package/dist/types/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter-settings.d.ts +36 -0
  383. package/dist/types/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +62 -0
  384. package/dist/types/event-bus/implementations/derivables/_module.d.ts +3 -1
  385. package/dist/types/event-bus/implementations/derivables/event-bus-factory-settings.d.ts +70 -0
  386. package/dist/types/event-bus/implementations/derivables/event-bus-factory.d.ts +40 -24
  387. package/dist/types/event-bus/implementations/derivables/event-bus-settings.d.ts +58 -0
  388. package/dist/types/event-bus/implementations/derivables/event-bus.d.ts +31 -45
  389. package/dist/types/serde/contracts/_module.d.ts +6 -0
  390. package/dist/types/serde/contracts/deserializer.contract.d.ts +13 -0
  391. package/dist/types/serde/contracts/flexible-serde.contract.d.ts +56 -0
  392. package/dist/types/serde/contracts/serde.contract.d.ts +10 -0
  393. package/dist/types/{serializer/contracts/serializer.errors.d.ts → serde/contracts/serde.errors.d.ts} +4 -4
  394. package/dist/types/serde/contracts/serializable.contract.d.ts +10 -0
  395. package/dist/types/serde/contracts/serializer.contract.d.ts +10 -0
  396. package/dist/types/serde/implementations/_module.d.ts +6 -0
  397. package/dist/types/serde/implementations/_shared/test-utilities/_module.d.ts +2 -0
  398. package/dist/types/serde/implementations/_shared/test-utilities/flexible-serde.test-suite.d.ts +17 -0
  399. package/dist/types/serde/implementations/_shared/test-utilities/serde.test-suite.d.ts +17 -0
  400. package/dist/types/serde/implementations/mongodb-serde/_module.d.ts +1 -0
  401. package/dist/types/serde/implementations/mongodb-serde/mongodb-serde.d.ts +13 -0
  402. package/dist/types/serde/implementations/no-op-serde/_module.d.ts +1 -0
  403. package/dist/types/serde/implementations/no-op-serde/no-op-serde.d.ts +13 -0
  404. package/dist/types/serde/implementations/redis-serde/_module.d.ts +1 -0
  405. package/dist/types/serde/implementations/redis-serde/redis-serde.d.ts +13 -0
  406. package/dist/types/serde/implementations/sql-serde/_module.d.ts +1 -0
  407. package/dist/types/serde/implementations/sql-serde/sql-serde.d.ts +13 -0
  408. package/dist/types/serde/implementations/super-json-serde/_module.d.ts +1 -0
  409. package/dist/types/serde/implementations/super-json-serde/super-json-serde.d.ts +25 -0
  410. package/dist/types/utilities/contracts/_module.d.ts +1 -0
  411. package/dist/types/utilities/contracts/buildable.contract.d.ts +9 -0
  412. package/dist/types/utilities/errors.d.ts +3 -3
  413. package/dist/types/utilities/functions.d.ts +5 -1
  414. package/dist/types/utilities/time-span/time-span.d.ts +10 -1
  415. package/dist/types/utilities/types.d.ts +0 -1
  416. package/package.json +3 -9
  417. package/dist/cjs/cache/implementations/derivables/base-cache.js +0 -270
  418. package/dist/cjs/cache/implementations/derivables/base-cache.js.map +0 -1
  419. package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/_module.js.map +0 -1
  420. package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js +0 -44
  421. package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js.map +0 -1
  422. package/dist/cjs/event-bus/implementations/derivables/base-event-bus.js +0 -47
  423. package/dist/cjs/event-bus/implementations/derivables/base-event-bus.js.map +0 -1
  424. package/dist/cjs/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js +0 -42
  425. package/dist/cjs/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js.map +0 -1
  426. package/dist/cjs/serializer/contracts/_module.js.map +0 -1
  427. package/dist/cjs/serializer/contracts/serializer.contract.js.map +0 -1
  428. package/dist/cjs/serializer/contracts/serializer.errors.js.map +0 -1
  429. package/dist/cjs/serializer/implementations/_module.js.map +0 -1
  430. package/dist/cjs/serializer/implementations/_shared/test-utilities/_module.js.map +0 -1
  431. package/dist/cjs/serializer/implementations/_shared/test-utilities/serializer.test-suite.js.map +0 -1
  432. package/dist/cjs/serializer/implementations/mongodb-serializer/_module.js.map +0 -1
  433. package/dist/cjs/serializer/implementations/mongodb-serializer/mongodb-serializer.js +0 -36
  434. package/dist/cjs/serializer/implementations/mongodb-serializer/mongodb-serializer.js.map +0 -1
  435. package/dist/cjs/serializer/implementations/redis-serializer/_module.js.map +0 -1
  436. package/dist/cjs/serializer/implementations/redis-serializer/redis-serializer.js +0 -37
  437. package/dist/cjs/serializer/implementations/redis-serializer/redis-serializer.js.map +0 -1
  438. package/dist/cjs/serializer/implementations/sql-serializer/_module.js.map +0 -1
  439. package/dist/cjs/serializer/implementations/sql-serializer/sql-serializer.js +0 -37
  440. package/dist/cjs/serializer/implementations/sql-serializer/sql-serializer.js.map +0 -1
  441. package/dist/cjs/serializer/implementations/super-json-serializer/_module.js +0 -18
  442. package/dist/cjs/serializer/implementations/super-json-serializer/_module.js.map +0 -1
  443. package/dist/cjs/serializer/implementations/super-json-serializer/super-json-serializer.js.map +0 -1
  444. package/dist/esm/cache/implementations/derivables/base-cache.js +0 -266
  445. package/dist/esm/cache/implementations/derivables/base-cache.js.map +0 -1
  446. package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/_module.js +0 -2
  447. package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/_module.js.map +0 -1
  448. package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js +0 -40
  449. package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js.map +0 -1
  450. package/dist/esm/event-bus/implementations/derivables/base-event-bus.js +0 -43
  451. package/dist/esm/event-bus/implementations/derivables/base-event-bus.js.map +0 -1
  452. package/dist/esm/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js +0 -38
  453. package/dist/esm/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js.map +0 -1
  454. package/dist/esm/serializer/contracts/_module.js +0 -3
  455. package/dist/esm/serializer/contracts/_module.js.map +0 -1
  456. package/dist/esm/serializer/contracts/serializer.contract.js.map +0 -1
  457. package/dist/esm/serializer/contracts/serializer.errors.js.map +0 -1
  458. package/dist/esm/serializer/implementations/_module.js +0 -6
  459. package/dist/esm/serializer/implementations/_module.js.map +0 -1
  460. package/dist/esm/serializer/implementations/_shared/test-utilities/_module.js +0 -2
  461. package/dist/esm/serializer/implementations/_shared/test-utilities/_module.js.map +0 -1
  462. package/dist/esm/serializer/implementations/_shared/test-utilities/serializer.test-suite.js.map +0 -1
  463. package/dist/esm/serializer/implementations/mongodb-serializer/_module.js +0 -2
  464. package/dist/esm/serializer/implementations/mongodb-serializer/_module.js.map +0 -1
  465. package/dist/esm/serializer/implementations/mongodb-serializer/mongodb-serializer.js.map +0 -1
  466. package/dist/esm/serializer/implementations/redis-serializer/_module.js +0 -2
  467. package/dist/esm/serializer/implementations/redis-serializer/_module.js.map +0 -1
  468. package/dist/esm/serializer/implementations/redis-serializer/redis-serializer.js.map +0 -1
  469. package/dist/esm/serializer/implementations/sql-serializer/_module.js +0 -2
  470. package/dist/esm/serializer/implementations/sql-serializer/_module.js.map +0 -1
  471. package/dist/esm/serializer/implementations/sql-serializer/sql-serializer.js.map +0 -1
  472. package/dist/esm/serializer/implementations/super-json-serializer/_module.js +0 -2
  473. package/dist/esm/serializer/implementations/super-json-serializer/_module.js.map +0 -1
  474. package/dist/esm/serializer/implementations/super-json-serializer/super-json-serializer.js.map +0 -1
  475. package/dist/types/cache/implementations/derivables/base-cache.d.ts +0 -58
  476. package/dist/types/event-bus/implementations/adapters/redis-event-bus-adapter/_module.d.ts +0 -1
  477. package/dist/types/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.d.ts +0 -43
  478. package/dist/types/event-bus/implementations/derivables/base-event-bus.d.ts +0 -23
  479. package/dist/types/event-bus/implementations/derivables/with-namespace-event-bus-adapter.d.ts +0 -16
  480. package/dist/types/serializer/contracts/_module.d.ts +0 -2
  481. package/dist/types/serializer/contracts/serializer.contract.d.ts +0 -16
  482. package/dist/types/serializer/implementations/_module.d.ts +0 -5
  483. package/dist/types/serializer/implementations/_shared/test-utilities/_module.d.ts +0 -1
  484. package/dist/types/serializer/implementations/_shared/test-utilities/serializer.test-suite.d.ts +0 -18
  485. package/dist/types/serializer/implementations/mongodb-serializer/_module.d.ts +0 -1
  486. package/dist/types/serializer/implementations/mongodb-serializer/mongodb-serializer.d.ts +0 -13
  487. package/dist/types/serializer/implementations/redis-serializer/_module.d.ts +0 -1
  488. package/dist/types/serializer/implementations/redis-serializer/redis-serializer.d.ts +0 -13
  489. package/dist/types/serializer/implementations/sql-serializer/_module.d.ts +0 -1
  490. package/dist/types/serializer/implementations/sql-serializer/sql-serializer.d.ts +0 -13
  491. package/dist/types/serializer/implementations/super-json-serializer/_module.d.ts +0 -1
  492. package/dist/types/serializer/implementations/super-json-serializer/super-json-serializer.d.ts +0 -37
  493. /package/dist/cjs/{serializer → serde}/contracts/serializer.contract.js +0 -0
  494. /package/dist/esm/{serializer → serde}/contracts/serializer.contract.js +0 -0
@@ -31,12 +31,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
31
31
  * The <i>filter</i> method filters the collection using <i>predicateFn</i>, keeping only those items that pass <i>predicateFn</i>.
32
32
  * @example
33
33
  * ```ts
34
- * import { ListCollection } from "@daiso-tech/core";;
35
- *
36
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
37
- * const filtered = collection.filter(item => 2 < item && item < 5);
38
- * filtered.toArray();
39
- * // [3, 4]
34
+ * import type { ICollection } from "@daiso-tech/core";
35
+ *
36
+ * // Assume the inputed collection is empty.
37
+ * function main(collection: ICollection<number>): void {
38
+ * collection
39
+ * .append([1, 2, 3, 4, 5, 6])
40
+ * .filter(item => 2 < item && item < 5)
41
+ * .toArray();
42
+ * // [3, 4]
43
+ * }
40
44
  * ```
41
45
  */
42
46
  filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
@@ -44,12 +48,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
44
48
  * The <i>reject</i> method filters the collection using <i>predicateFn</i>, keeping only those items that not pass <i>predicateFn</i>.
45
49
  * @example
46
50
  * ```ts
47
- * import { ListCollection } from "@daiso-tech/core";;
51
+ * import type { ICollection } from "@daiso-tech/core";
48
52
  *
49
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
50
- * const filtered = collection.reject(item => 2 < item && item < 5);
51
- * filtered.toArray();
52
- * // [1, 2, 5, 6]
53
+ * // Assume the inputed collection is empty.
54
+ * function main(collection: ICollection<number>): void {
55
+ * collection
56
+ * .append([1, 2, 3, 4, 5, 6])
57
+ * .reject(item => 2 < item && item < 5)
58
+ * .toArray();
59
+ * // [1, 2, 5, 6]
60
+ * }
53
61
  * ```
54
62
  */
55
63
  reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
@@ -58,12 +66,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
58
66
  * The <i>mapFn</i> is free to modify the item and return it, thus forming a new collection of modified items.
59
67
  * @example
60
68
  * ```ts
61
- * import { ListCollection } from "@daiso-tech/core";;
69
+ * import type { ICollection } from "@daiso-tech/core";
62
70
  *
63
- * const collection = new ListCollection([1, 2, 3, 4, 5]);
64
- * const mapped = collection.map(item => item * 2);
65
- * mapped.toArray();
66
- * // [2, 4, 6, 8, 10]
71
+ * // Assume the inputed collection is empty.
72
+ * function main(collection: ICollection<number>): void {
73
+ * collection
74
+ * .append([1, 2, 3, 4, 5])
75
+ * .map(item => item * 2)
76
+ * .toArray();
77
+ * // [2, 4, 6, 8, 10]
78
+ * }
67
79
  * ```
68
80
  */
69
81
  map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
@@ -72,25 +84,34 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
72
84
  * The final result of running the reducer across all items of the array is a single value.
73
85
  * @example
74
86
  * ```ts
75
- * import { ListCollection } from "@daiso-tech/core";;
87
+ * import type { ICollection } from "@daiso-tech/core";
76
88
  *
77
- * const collection = new ListCollection([1, 2, 3]);
78
- * collection.reduce((sum, item) => sum + item);
79
- * // 6
89
+ * // Assume the inputed collection is empty.
90
+ * function main(collection: ICollection<number>): void {
91
+ * collection
92
+ * .append([1, 2, 3]);
93
+ * .reduce((sum, item) => sum + item);
94
+ * // 6
95
+ * }
80
96
  * ```
81
97
  * @example
82
98
  * ```ts
83
- * import { ListCollection } from "@daiso-tech/core";;
99
+ * import type { ICollection } from "@daiso-tech/core";
84
100
  *
85
- * const collection = new ListCollection(["a", "b", "c"]);
86
- * collection.entries().reduce(
87
- * (record, [key, value]) => ({
88
- * ...record,
89
- * [key]: value
90
- * }),
91
- * {} as Record<number, string>
92
- * );
93
- * // { 0: "a", 1: "b", 2: "c" }
101
+ * // Assume the inputed collection is empty.
102
+ * function main(collection: ICollection<string>): void {
103
+ * collection
104
+ * .append(["a", "b", "c"])
105
+ * .entries()
106
+ * .reduce(
107
+ * (record, [key, value]) => ({
108
+ * ...record,
109
+ * [key]: value
110
+ * }),
111
+ * {} as Record<number, string>
112
+ * );
113
+ * // { 0: "a", 1: "b", 2: "c" }
114
+ * }
94
115
  * ```
95
116
  */
96
117
  reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>): TInput;
@@ -101,19 +122,28 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
101
122
  * @throws {TypeCollectionError}
102
123
  * @example
103
124
  * ```ts
104
- * import { ListCollection } from "@daiso-tech/core";;
125
+ * import type { ICollection } from "@daiso-tech/core";
105
126
  *
106
- * const collection = new ListCollection([1, 2, 3, 4]);
107
- * collection.map(item => item.toString()).join();
108
- * // "1,2,3,4"
109
- * @example
127
+ * // Assume the inputed collection is empty.
128
+ * function main(collection: ICollection<number>): void {
129
+ * collection
130
+ * .append([1, 2, 3, 4])
131
+ * .map(item => item.toString())
132
+ * .join();
133
+ * // "1,2,3,4"
134
+ * }
110
135
  * ```
111
136
  * ```ts
112
- * import { ListCollection } from "@daiso-tech/core";;
137
+ * import type { ICollection } from "@daiso-tech/core";
113
138
  *
114
- * const collection = new ListCollection([1, 2, 3, 4]);
115
- * collection.map(item => item.toString()).join("_");
116
- * // "1_2_3_4"
139
+ * // Assume the inputed collection is empty.
140
+ * function main(collection: ICollection<number>): void {
141
+ * collection
142
+ * .append([1, 2, 3, 4])
143
+ * .map(item => item.toString())
144
+ * .join("_");
145
+ * // "1_2_3_4"
146
+ * }
117
147
  * ```
118
148
  */
119
149
  join(separator?: string): Extract<TInput, string>;
@@ -121,12 +151,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
121
151
  * The <i>collapse</i> method collapses a collection of iterables into a single, flat collection.
122
152
  * @example
123
153
  * ```ts
124
- * import { ListCollection } from "@daiso-tech/core";;
154
+ * import type { ICollection } from "@daiso-tech/core";
125
155
  *
126
- * const collection = new ListCollection([[1, 2], [3, 4]]);
127
- * const collapsed = collection.collapse();
128
- * collapsed.toArray();
129
- * // [1, 2, 3, 4]
156
+ * // Assume the inputed collection is empty.
157
+ * function main(collection: ICollection<number[]>): void {
158
+ * collection
159
+ * .append([[1, 2], [3, 4]])
160
+ * .collapse()
161
+ * .toArray();
162
+ * // [1, 2, 3, 4]
163
+ * }
130
164
  * ```
131
165
  */
132
166
  collapse(): ICollection<Collapse<TInput>>;
@@ -135,11 +169,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
135
169
  * It is identical to a <i>map</i> method followed by a <i>collapse</i> method.
136
170
  * @example
137
171
  * ```ts
138
- * import { ListCollection } from "@daiso-tech/core";;
172
+ * import type { ICollection } from "@daiso-tech/core";
139
173
  *
140
- * const collection = new ListCollection([["a", "b"], ["c", "d"]]).flatMap(item => [item.length, ...item]);
141
- * collection.toArray();
142
- * // [2, "a", "b", 2, "c", "d"]
174
+ * // Assume the inputed collection is empty.
175
+ * function main(collection: ICollection<string[]>): void {
176
+ * collection
177
+ * .append([["a", "b"], ["c", "d"]])
178
+ * .flatMap(item => [item.length, ...item])
179
+ * .toArray();
180
+ * // [2, "a", "b", 2, "c", "d"]
181
+ * }
143
182
  * ```
144
183
  */
145
184
  flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>): ICollection<TOutput>;
@@ -147,12 +186,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
147
186
  * The <i>change</i> method changes only the items that passes <i>predicateFn</i> using <i>mapFn</i>.
148
187
  * @example
149
188
  * ```ts
150
- * import { ListCollection } from "@daiso-tech/core";;
189
+ * import type { ICollection } from "@daiso-tech/core";
151
190
  *
152
- * const collection = new ListCollection([1, 2, 3, 4, 5]);
153
- * const newCollection = collection.change(item => item % 2 === 0, item => item * 2);
154
- * newCollection.toArray();
155
- * // [1, 4, 3, 8, 5]
191
+ * // Assume the inputed collection is empty.
192
+ * function main(collection: ICollection<number>): void {
193
+ * collection
194
+ * .append([1, 2, 3, 4, 5])
195
+ * .change(item => item % 2 === 0, item => item * 2)
196
+ * .toArray();
197
+ * // [1, 4, 3, 8, 5]
198
+ * }
156
199
  * ```
157
200
  */
158
201
  change<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<TInput | TFilterOutput | TMapOutput>;
@@ -160,21 +203,29 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
160
203
  * The <i>set</i> method changes a item by i>index</i> using <i>value</i>.
161
204
  * @example
162
205
  * ```ts
163
- * import { ListCollection } from "@daiso-tech/core";;
206
+ * import type { ICollection } from "@daiso-tech/core";
164
207
  *
165
- * const collection = new ListCollection([1, 2, 3, 4, 5]);
166
- * const newCollection = collection.set(1, -1);
167
- * newCollection.toArray();
168
- * // [1, -1, 3, 4, 5]
208
+ * // Assume the inputed collection is empty.
209
+ * function main(collection: ICollection<number>): void {
210
+ * collection
211
+ * .append([1, 2, 3, 4, 5])
212
+ * .set(1, -1)
213
+ * .toArray();
214
+ * // [1, -1, 3, 4, 5]
215
+ * }
169
216
  * ```
170
217
  * @example
171
218
  * ```ts
172
- * import { ListCollection } from "@daiso-tech/core";;
219
+ * import type { ICollection } from "@daiso-tech/core";
173
220
  *
174
- * const collection = new ListCollection([1, 2, 3, 4, 5]);
175
- * const newCollection = collection.set(1, (prevValue) => prevValue - 2);
176
- * newCollection.toArray();
177
- * // [1, 0, 3, 4, 5]
221
+ * // Assume the inputed collection is empty.
222
+ * function main(collection: ICollection<number>): void {
223
+ * collection
224
+ * .append([1, 2, 3, 4, 5])
225
+ * .set(1, (prevValue) => prevValue - 2)
226
+ * .toArray();
227
+ * // [1, 0, 3, 4, 5]
228
+ * }
178
229
  * ```
179
230
  */
180
231
  set(index: number, value: TInput | Map<TInput, ICollection<TInput>, TInput>): ICollection<TInput>;
@@ -182,14 +233,18 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
182
233
  * The <i>get</i> method returns the item by index. If the item is not found null will returned.
183
234
  * @example
184
235
  * ```ts
185
- * import { ListCollection } from "@daiso-tech/core";;
236
+ * import type { ICollection } from "@daiso-tech/core";
186
237
  *
187
- * const collection = new ListCollection([1, 4, 2, 8, -2]);
188
- * // Will be 2
189
- * collection.get(2);
238
+ * // Assume the inputed collection is empty.
239
+ * function main(collection: ICollection<number>): void {
240
+ * collection = collection.append([1, 4, 2, 8, -2]);
190
241
  *
191
- * // Will be null
192
- * collection.get(5);
242
+ * // Will be 2
243
+ * collection.get(2);
244
+ *
245
+ * // Will be null
246
+ * collection.get(5);
247
+ * }
193
248
  * ```
194
249
  */
195
250
  get(index: number): TInput | null;
@@ -198,14 +253,18 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
198
253
  * @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
199
254
  * @example
200
255
  * ```ts
201
- * import { ListCollection } from "@daiso-tech/core";;
256
+ * import type { ICollection } from "@daiso-tech/core";
257
+ *
258
+ * // Assume the inputed collection is empty.
259
+ * function main(collection: ICollection<number>): void {
260
+ * collection = collection.append([1, 4, 2, 8, -2]);
202
261
  *
203
- * const collection = new ListCollection([1, 4, 2, 8, -2]);
204
- * // Will be 2
205
- * collection.getOrFail(2);
262
+ * // Will be 2
263
+ * collection.getOrFail(2);
206
264
  *
207
- * // An error will thrown
208
- * collection.getOrFail(5);
265
+ * // An error will thrown
266
+ * collection.getOrFail(5);
267
+ * }
209
268
  * ```
210
269
  */
211
270
  getOrFail(index: number): TInput;
@@ -213,12 +272,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
213
272
  * The <i>page</i> method returns a new collection containing the items that would be present on <i> page </i> with custom <i> pageSize </i>.
214
273
  * @example
215
274
  * ```ts
216
- * import { ListCollection } from "@daiso-tech/core";;
275
+ * import type { ICollection } from "@daiso-tech/core";
217
276
  *
218
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7, 8, 9]);
219
- * const page = collection.page(2, 3);
220
- * page.toArray();
221
- * // [4, 5, 6]
277
+ * // Assume the inputed collection is empty.
278
+ * function main(collection: ICollection<number>): void {
279
+ * collection
280
+ * .append([1, 2, 3, 4, 5, 6, 7, 8, 9])
281
+ * .page(2, 3)
282
+ * .toArray()
283
+ * // [4, 5, 6]
284
+ * }
222
285
  * ```
223
286
  */
224
287
  page(page: number, pageSize: number): ICollection<TInput>;
@@ -229,11 +292,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
229
292
  * @throws {EmptyCollectionError} {@link EmptyCollectionError}
230
293
  * @example
231
294
  * ```ts
232
- * import { ListCollection } from "@daiso-tech/core";;
295
+ * import type { ICollection } from "@daiso-tech/core";
233
296
  *
234
- * const collection = new ListCollection([1, 2, 3]);
235
- * collection.sum();
236
- * // 6
297
+ * // Assume the inputed collection is empty.
298
+ * function main(collection: ICollection<number>): void {
299
+ * collection
300
+ * .append([1, 2, 3])
301
+ * .sum();
302
+ * // 6
303
+ * }
237
304
  * ```
238
305
  */
239
306
  sum(): Extract<TInput, number>;
@@ -244,11 +311,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
244
311
  * @throws {EmptyCollectionError} {@link EmptyCollectionError}
245
312
  * @example
246
313
  * ```ts
247
- * import { ListCollection } from "@daiso-tech/core";;
314
+ * import type { ICollection } from "@daiso-tech/core";
248
315
  *
249
- * const collection = new ListCollection([1, 2, 3]);
250
- * collection.average();
251
- * // 2
316
+ * // Assume the inputed collection is empty.
317
+ * function main(collection: ICollection<number>): void {
318
+ * collection
319
+ * .append([1, 2, 3])
320
+ * .average()
321
+ * // 2
322
+ * }
252
323
  * ```
253
324
  */
254
325
  average(): Extract<TInput, number>;
@@ -259,11 +330,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
259
330
  * @throws {EmptyCollectionError} {@link EmptyCollectionError}
260
331
  * @example
261
332
  * ```ts
262
- * import { ListCollection } from "@daiso-tech/core";;
333
+ * import type { ICollection } from "@daiso-tech/core";
263
334
  *
264
- * const collection = new ListCollection([1, 2, 3]);
265
- * collection.median();
266
- * // 2
335
+ * // Assume the inputed collection is empty.
336
+ * function main(collection: ICollection<number>): void {
337
+ * collection
338
+ * .append([1, 2, 3])
339
+ * .median();
340
+ * // 2
341
+ * }
267
342
  * ```
268
343
  */
269
344
  median(): Extract<TInput, number>;
@@ -274,11 +349,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
274
349
  * @throws {EmptyCollectionError} {@link EmptyCollectionError}
275
350
  * @example
276
351
  * ```ts
277
- * import { ListCollection } from "@daiso-tech/core";;
352
+ * import type { ICollection } from "@daiso-tech/core";
278
353
  *
279
- * const collection = new ListCollection([1, 2, 3]);
280
- * collection.min();
281
- * // 1
354
+ * // Assume the inputed collection is empty.
355
+ * function main(collection: ICollection<number>): void {
356
+ * collection
357
+ * .append([1, 2, 3])
358
+ * .min();
359
+ * // 1
360
+ * }
282
361
  * ```
283
362
  */
284
363
  min(): Extract<TInput, number>;
@@ -289,11 +368,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
289
368
  * @throws {EmptyCollectionError} {@link EmptyCollectionError}
290
369
  * @example
291
370
  * ```ts
292
- * import { ListCollection } from "@daiso-tech/core";;
371
+ * import type { ICollection } from "@daiso-tech/core";
293
372
  *
294
- * const collection = new ListCollection([1, 2, 3]);
295
- * collection.max();
296
- * // 3
373
+ * // Assume the inputed collection is empty.
374
+ * function main(collection: ICollection<number>): void {
375
+ * collection
376
+ * .append([1, 2, 3])
377
+ * .max();
378
+ * // 3
379
+ * }
297
380
  * ```
298
381
  */
299
382
  max(): Extract<TInput, number>;
@@ -303,11 +386,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
303
386
  * @throws {EmptyCollectionError} {@link EmptyCollectionError}
304
387
  * @example
305
388
  * ```ts
306
- * import { ListCollection } from "@daiso-tech/core";;
389
+ * import type { ICollection } from "@daiso-tech/core";
307
390
  *
308
- * const collection = new ListCollection([1, 1, 2, 2, 2, 3]);
309
- * collection.percentage(value => value === 1);
310
- * // 33.333
391
+ * // Assume the inputed collection is empty.
392
+ * function main(collection: ICollection<number>): void {
393
+ * collection
394
+ * .append([1, 1, 2, 2, 2, 3])
395
+ * .percentage(value => value === 1);
396
+ * // 33.333
397
+ * }
311
398
  * ```
312
399
  */
313
400
  percentage(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
@@ -315,11 +402,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
315
402
  * The <i>some</i> method determines whether at least one item in the collection matches <i>predicateFn</i>.
316
403
  * @example
317
404
  * ```ts
318
- * import { ListCollection } from "@daiso-tech/core";;
405
+ * import type { ICollection } from "@daiso-tech/core";
319
406
  *
320
- * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
321
- * collection.some(item => item === 1);
322
- * // true
407
+ * // Assume the inputed collection is empty.
408
+ * function main(collection: ICollection<number>): void {
409
+ * collection
410
+ * .append([0, 1, 2, 3, 4, 5])
411
+ * .some(item => item === 1);
412
+ * // true
413
+ * }
323
414
  * ```
324
415
  */
325
416
  some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
@@ -327,11 +418,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
327
418
  * The <i>every</i> method determines whether all items in the collection matches <i>predicateFn</i>.
328
419
  * @example
329
420
  * ```ts
330
- * import { ListCollection } from "@daiso-tech/core";;
421
+ * import type { ICollection } from "@daiso-tech/core";
331
422
  *
332
- * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
333
- * collection.every(item => item < 6);
334
- * // true
423
+ * // Assume the inputed collection is empty.
424
+ * function main(collection: ICollection<number>): void {
425
+ * collection
426
+ * .append([0, 1, 2, 3, 4, 5])
427
+ * .every(item => item < 6);
428
+ * // true
429
+ * }
335
430
  * ```
336
431
  */
337
432
  every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
@@ -339,21 +434,30 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
339
434
  * The <i>take</i> method takes the first <i>limit</i> items.
340
435
  * @example
341
436
  * ```ts
342
- * import { ListCollection } from "@daiso-tech/core";;
437
+ * import type { ICollection } from "@daiso-tech/core";
343
438
  *
344
- * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
345
- * const chunk = collection.take(3);
346
- * chunk.toArray();
347
- * // [0, 1, 2]
439
+ * // Assume the inputed collection is empty.
440
+ * function main(collection: ICollection<number>): void {
441
+ * collection
442
+ * .append([0, 1, 2, 3, 4, 5])
443
+ * .take(3)
444
+ * .toArray();
445
+ * // [0, 1, 2]
446
+ * }
348
447
  * ```
448
+ *
349
449
  * @example
350
450
  * ```ts
351
- * import { ListCollection } from "@daiso-tech/core";;
451
+ * import type { ICollection } from "@daiso-tech/core";
352
452
  *
353
- * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
354
- * const chunk = collection.take(-2);
355
- * chunk.toArray();
356
- * // [0, 1, 2, 3]
453
+ * // Assume the inputed collection is empty.
454
+ * function main(collection: ICollection<number>): void {
455
+ * collection
456
+ * .append([0, 1, 2, 3, 4, 5])
457
+ * .take(-2)
458
+ * .toArray();
459
+ * // [0, 1, 2, 3]
460
+ * }
357
461
  * ```
358
462
  */
359
463
  take(limit: number): ICollection<TInput>;
@@ -361,12 +465,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
361
465
  * The <i>takeUntil</i> method takes items until <i>predicateFn</i> returns true.
362
466
  * @example
363
467
  * ```ts
364
- * import { ListCollection } from "@daiso-tech/core";;
468
+ * import type { ICollection } from "@daiso-tech/core";
365
469
  *
366
- * const collection = new ListCollection([1, 2, 3, 4]);
367
- * const chunk = collection.takeUntil(item => item >= 3);
368
- * chunk.toArray();
369
- * // [1, 2]
470
+ * // Assume the inputed collection is empty.
471
+ * function main(collection: ICollection<number>): void {
472
+ * collection
473
+ * .append([1, 2, 3, 4])
474
+ * .takeUntil(item => item >= 3)
475
+ * .toArray();
476
+ * // [1, 2]
477
+ * }
370
478
  * ```
371
479
  */
372
480
  takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
@@ -374,12 +482,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
374
482
  * The <i>takeWhile</i> method takes items until <i>predicateFn</i> returns false.
375
483
  * @example
376
484
  * ```ts
377
- * import { ListCollection } from "@daiso-tech/core";;
485
+ * import type { ICollection } from "@daiso-tech/core";
378
486
  *
379
- * const collection = new ListCollection([1, 2, 3, 4]);
380
- * const chunk = collection.takeWhile(item => item < 4);
381
- * chunk.toArray();
382
- * // [1, 2, 3]
487
+ * // Assume the inputed collection is empty.
488
+ * function main(collection: ICollection<number>): void {
489
+ * collection
490
+ * .append([1, 2, 3, 4])
491
+ * .takeWhile(item => item < 4)
492
+ * .toArray();
493
+ * // [1, 2, 3]
494
+ * }
383
495
  * ```
384
496
  */
385
497
  takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
@@ -387,11 +499,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
387
499
  * The <i>skip</i> method skips the first <i>offset</i> items.
388
500
  * @example
389
501
  * ```ts
390
- * import { ListCollection } from "@daiso-tech/core";;
502
+ * import type { ICollection } from "@daiso-tech/core";
391
503
  *
392
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).skip(4);
393
- * collection.toArray();
394
- * // [5, 6, 7, 8, 9, 10]
504
+ * // Assume the inputed collection is empty.
505
+ * function main(collection: ICollection<number>): void {
506
+ * collection
507
+ * .append([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
508
+ * .skip(4)
509
+ * .toArray();
510
+ * // [5, 6, 7, 8, 9, 10]
511
+ * }
395
512
  * ```
396
513
  */
397
514
  skip(offset: number): ICollection<TInput>;
@@ -399,11 +516,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
399
516
  * The <i>skipUntil</i> method skips items until <i>predicateFn</i> returns true.
400
517
  * @example
401
518
  * ```ts
402
- * import { ListCollection } from "@daiso-tech/core";;
519
+ * import type { ICollection } from "@daiso-tech/core";
403
520
  *
404
- * const collection = new ListCollection([1, 2, 3, 4]).skipUntil(item => item >= 3);
405
- * collection.toArray();
406
- * // [3, 4]
521
+ * // Assume the inputed collection is empty.
522
+ * function main(collection: ICollection<number>): void {
523
+ * collection
524
+ * .apppend([1, 2, 3, 4])
525
+ * .skipUntil(item => item >= 3)
526
+ * .toArray();
527
+ * // [3, 4]
528
+ * }
407
529
  * ```
408
530
  */
409
531
  skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
@@ -411,11 +533,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
411
533
  * The <i>skipWhile</i> method skips items until <i>predicateFn</i> returns false.
412
534
  * @example
413
535
  * ```ts
414
- * import { ListCollection } from "@daiso-tech/core";;
536
+ * import type { ICollection } from "@daiso-tech/core";
415
537
  *
416
- * const collection = new ListCollection([1, 2, 3, 4]).skipWhile(item => item <= 3);
417
- * collection.toArray();
418
- * // [4]
538
+ * // Assume the inputed collection is empty.
539
+ * function main(collection: ICollection<number>): void {
540
+ * collection
541
+ * .apppend([1, 2, 3, 4])
542
+ * .skipWhile(item => item <= 3)
543
+ * .toArray();
544
+ * // [4]
545
+ * }
419
546
  * ```
420
547
  */
421
548
  skipWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
@@ -423,13 +550,17 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
423
550
  * The <i>when</i> method will execute <i>callback</i> when <i>condition</i> evaluates to true.
424
551
  * @example
425
552
  * ```ts
426
- * import { ListCollection } from "@daiso-tech/core";;
553
+ * import type { ICollection } from "@daiso-tech/core";
427
554
  *
428
- * const collection = new ListCollection([1, 2, 3, 4])
429
- * .when(true, collection => collection.append([-3]))
430
- * .when(false, collection => collection.append([20]));
431
- * collection.toArray();
432
- * // [1, 2, 3, 4, -3]
555
+ * // Assume the inputed collection is empty.
556
+ * function main(collection: ICollection<number>): void {
557
+ * collection
558
+ * .apppend([1, 2, 3, 4])
559
+ * .when(true, collection => collection.append([-3]))
560
+ * .when(false, collection => collection.append([20]))
561
+ * .toArray();
562
+ * // [1, 2, 3, 4, -3]
563
+ * }
433
564
  * ```
434
565
  */
435
566
  when<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
@@ -437,21 +568,29 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
437
568
  * The <i>whenEmpty</i> method will execute <i>callback</i> when the collection is empty.
438
569
  * @example
439
570
  * ```ts
440
- * import { ListCollection } from "@daiso-tech/core";;
571
+ * import type { ICollection } from "@daiso-tech/core";
441
572
  *
442
- * const collection = new ListCollection([])
443
- * .whenEmpty(collection => collection.append([-3]))
444
- * collection.toArray();
445
- * // [-3]
573
+ * // Assume the inputed collection is empty.
574
+ * function main(collection: ICollection<number>): void {
575
+ * collection
576
+ * .apppend([])
577
+ * .whenEmpty(collection => collection.append([-3]))
578
+ * .toArray();
579
+ * // [-3]
580
+ * }
446
581
  * ```
447
582
  * @example
448
583
  * ```ts
449
- * import { ListCollection } from "@daiso-tech/core";;
584
+ * import type { ICollection } from "@daiso-tech/core";
450
585
  *
451
- * const collection = new ListCollection([1])
452
- * .whenEmpty(collection => collection.append([-3]))
453
- * collection.toArray();
454
- * // [1]
586
+ * // Assume the inputed collection is empty.
587
+ * function main(collection: ICollection<number>): void {
588
+ * collection
589
+ * .apppend([1])
590
+ * .whenEmpty(collection => collection.append([-3]))
591
+ * .toArray();
592
+ * // [1]
593
+ * }
455
594
  * ```
456
595
  */
457
596
  whenEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
@@ -459,13 +598,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
459
598
  * The <i>whenNot</i> method will execute <i>callback</i> when <i>condition</i> evaluates to false.
460
599
  * @example
461
600
  * ```ts
462
- * import { ListCollection } from "@daiso-tech/core";;
601
+ * import type { ICollection } from "@daiso-tech/core";
463
602
  *
464
- * const collection = new ListCollection([1, 2, 3, 4])
465
- * .whenNot(true, collection => collection.append([-3]))
466
- * .whenNot(false, collection => collection.append([20]));
467
- * collection.toArray();
468
- * // [1, 2, 3, 4, 20]
603
+ * // Assume the inputed collection is empty.
604
+ * function main(collection: ICollection<number>): void {
605
+ * collection.apppend([1, 2, 3, 4])
606
+ * .whenNot(true, collection => collection.append([-3]))
607
+ * .whenNot(false, collection => collection.append([20]))
608
+ * .toArray();
609
+ * // [1, 2, 3, 4, 20]
610
+ * }
469
611
  * ```
470
612
  */
471
613
  whenNot<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
@@ -473,21 +615,28 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
473
615
  * The <i>whenNotEmpty</i> method will execute <i>callback</i> when the collection is not empty.
474
616
  * @example
475
617
  * ```ts
476
- * import { ListCollection } from "@daiso-tech/core";;
618
+ * import type { ICollection } from "@daiso-tech/core";
477
619
  *
478
- * const collection = new ListCollection([])
479
- * .whenNotEmpty(collection => collection.append([-3]))
480
- * collection.toArray();
481
- * // []
620
+ * // Assume the inputed collection is empty.
621
+ * function main(collection: ICollection<number>): void {
622
+ * collection.apppend([])
623
+ * .whenNotEmpty(collection => collection.append([-3]))
624
+ * .toArray();
625
+ * // []
626
+ * }
482
627
  * ```
483
628
  * @example
484
629
  * ```ts
485
- * import { ListCollection } from "@daiso-tech/core";;
630
+ * import type { ICollection } from "@daiso-tech/core";
486
631
  *
487
- * const collection = new ListCollection([1])
488
- * .whenNotEmpty(collection => collection.append([-3]))
489
- * collection.toArray();
490
- * // [1, -3]
632
+ * // Assume the inputed collection is empty.
633
+ * function main(collection: ICollection<number>): void {
634
+ * collection = collection
635
+ * .apppend([1])
636
+ * .whenNotEmpty(collection => collection.append([-3]))
637
+ * .toArray();
638
+ * // [1, -3]
639
+ * }
491
640
  * ```
492
641
  */
493
642
  whenNotEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
@@ -496,22 +645,28 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
496
645
  * This method is useful when you want compose multiple smaller functions.
497
646
  * @example
498
647
  * ```ts
499
- * import { ListCollection } from "@daiso-tech/core";;
648
+ * import type { ICollection } from "@daiso-tech/core";
500
649
  *
501
- * const collection = new ListCollection([1, "2", "a", 1, 3, {}]);
502
- * function toNbrs<TInput>(
503
- * collection: ICollection<TInput>,
504
- * ): ICollection<number> {
505
- * return collection
506
- * .map((item) => Number(item))
507
- * .reject((nbr) => Number.isNaN(nbr));
508
- * }
509
- * function nbrToStr(collection: ICollection<number>): number[] {
510
- * return collection.repeat(2).toArray();
650
+ * // Assume the inputed collection is empty.
651
+ * function main(collection: ICollection<number>): void {
652
+ * function toNbrs<TInput>(
653
+ * collection: ICollection<TInput>,
654
+ * ): ICollection<number> {
655
+ * return collection
656
+ * .map((item) => Number(item))
657
+ * .reject((nbr) => Number.isNaN(nbr));
658
+ * }
659
+ *
660
+ * function nbrToStr(collection: ICollection<number>): number[] {
661
+ * return collection.repeat(2).toArray();
662
+ * }
663
+ *
664
+ * const piped = collection
665
+ * .apppend([1, "2", "a", 1, 3, {}])
666
+ * .pipe(toNbrs)
667
+ * .pipe(nbrToStr);
668
+ * // [ 1, 2, 1, 3 ]
511
669
  * }
512
- * const piped = collection.pipe(toNbrs).pipe(nbrToStr);
513
- * console.log(piped);
514
- * // [ 1, 2, 1, 3 ]
515
670
  * ```
516
671
  */
517
672
  pipe<TOutput = TInput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
@@ -519,16 +674,19 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
519
674
  * The <i>tap</i> method passes a copy of the original collection to <i>callback</i>, allowing you to do something with the items while not affecting the original collection.
520
675
  * @example
521
676
  * ```ts
522
- * import { ListCollection } from "@daiso-tech/core";;
677
+ * import type { ICollection } from "@daiso-tech/core";
523
678
  *
524
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6])
525
- * .tap(collection => {
526
- * collection
527
- * .filter(value => value % 2 === 0)
528
- * .forEach(value => console.log(value))
529
- * })
530
- * .toArray();
531
- * // [1, 2, 3, 4, 5, 6]
679
+ * // Assume the inputed collection is empty.
680
+ * function main(collection: ICollection<number>): void {
681
+ * collection.apppend([1, 2, 3, 4, 5, 6])
682
+ * .tap(collection => {
683
+ * collection
684
+ * .filter(value => value % 2 === 0)
685
+ * .forEach(value => console.log(value))
686
+ * })
687
+ * .toArray();
688
+ * // [1, 2, 3, 4, 5, 6]
689
+ * }
532
690
  * ```
533
691
  */
534
692
  tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
@@ -537,12 +695,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
537
695
  * If <i>chunkSize</i> is not divisible with total number of items then the last chunk will contain the remaining items.
538
696
  * @example
539
697
  * ```ts
540
- * import { ListCollection } from "@daiso-tech/core";;
698
+ * import type { ICollection } from "@daiso-tech/core";
541
699
  *
542
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7]);
543
- * const chunks = collection.chunk(4);
544
- * chunks.map(chunk => chunk.toArray()).toArray();
545
- * // [[1, 2, 3, 4], [5, 6, 7]]
700
+ * // Assume the inputed collection is empty.
701
+ * function main(collection: ICollection<number>): void {
702
+ * collection.apppend([1, 2, 3, 4, 5, 6, 7]);
703
+ * const chunks = collection.chunk(4);
704
+ * chunks.map(chunk => chunk.toArray()).toArray();
705
+ * // [[1, 2, 3, 4], [5, 6, 7]]
706
+ * }
546
707
  * ```
547
708
  */
548
709
  chunk(chunkSize: number): ICollection<ICollection<TInput>>;
@@ -551,14 +712,19 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
551
712
  * The chunk variable passed to the <i>predicateFn</i> may be used to inspect the previous item.
552
713
  * @example
553
714
  * ```ts
554
- * import { ListCollection } from "@daiso-tech/core";;
715
+ * import type { ICollection } from "@daiso-tech/core";
555
716
  *
556
- * const collection = new ListCollection("AABBCCCD");
557
- * const chunks = collection.chunkWhile((value, index, chunk) => {
558
- * return value === chunk.last();
559
- * });
560
- * chunks.map(chunk => chunk.toArray()).toArray();
561
- * // [["A", "A"], ["B", "B"], ["C", "C", "C"], ["D"]]
717
+ * // Assume the inputed collection is empty.
718
+ * function main(collection: ICollection<string>): void {
719
+ * collection
720
+ * .apppend("AABBCCCD")
721
+ * .chunkWhile((value, index, chunk) => {
722
+ * return value === chunk.last();
723
+ * })
724
+ * .map(chunk => chunk.toArray())
725
+ * .toArray();
726
+ * // [["A", "A"], ["B", "B"], ["C", "C", "C"], ["D"]]
727
+ * }
562
728
  * ```
563
729
  */
564
730
  chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
@@ -566,30 +732,45 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
566
732
  * The <i>split</i> method breaks a collection evenly into <i>chunkAmount</i> of chunks.
567
733
  * @example
568
734
  * ```ts
569
- * import { ListCollection } from "@daiso-tech/core";;
735
+ * import type { ICollection } from "@daiso-tech/core";
570
736
  *
571
- * const collection = new ListCollection([1, 2, 3, 4, 5]);
572
- * const chunks = collection.split(3);
573
- * chunks.map(chunk => chunk.toArray()).toArray();
574
- * // [[1, 2], [3, 4], [5]]
737
+ * // Assume the inputed collection is empty.
738
+ * function main(collection: ICollection<number>): void {
739
+ * collection
740
+ * .apppend([1, 2, 3, 4, 5])
741
+ * .split(3)
742
+ * .map(chunk => chunk.toArray())
743
+ * .toArray();
744
+ * // [[1, 2], [3, 4], [5]]
745
+ * }
575
746
  * ```
576
747
  * @example
577
748
  * ```ts
578
- * import { ListCollection } from "@daiso-tech/core";;
749
+ * import type { ICollection } from "@daiso-tech/core";
579
750
  *
580
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
581
- * const chunks = collection.split(3);
582
- * chunks.map(chunk => chunk.toArray()).toArray();
583
- * // [[1, 2], [3, 4], [5, 6]]
751
+ * // Assume the inputed collection is empty.
752
+ * function main(collection: ICollection<number>): void {
753
+ * collection
754
+ * .apppend([1, 2, 3, 4, 5, 6])
755
+ * .split(3)
756
+ * .map(chunk => chunk.toArray())
757
+ * .toArray()
758
+ * // [[1, 2], [3, 4], [5, 6]]
759
+ * }
584
760
  * ```
585
761
  * @example
586
762
  * ```ts
587
- * import { ListCollection } from "@daiso-tech/core";;
763
+ * import type { ICollection } from "@daiso-tech/core";
588
764
  *
589
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7]);
590
- * const chunks = collection.split(3);
591
- * chunks.map(chunk => chunk.toArray()).toArray();
592
- * // [[1, 2, 7], [3, 4], [5, 6]]
765
+ * // Assume the inputed collection is empty.
766
+ * function main(collection: ICollection<number>): void {
767
+ * collection
768
+ * .apppend([1, 2, 3, 4, 5, 6, 7])
769
+ * .split(3)
770
+ * .map(chunk => chunk.toArray())
771
+ * .toArray();
772
+ * // [[1, 2, 7], [3, 4], [5, 6]]
773
+ * }
593
774
  * ```
594
775
  */
595
776
  split(chunkAmount: number): ICollection<ICollection<TInput>>;
@@ -597,12 +778,17 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
597
778
  * The <i>partition</i> method is used to separate items that pass <i>predicateFn</i> from those that do not.
598
779
  * @example
599
780
  * ```ts
600
- * import { ListCollection } from "@daiso-tech/core";;
781
+ * import type { ICollection } from "@daiso-tech/core";
601
782
  *
602
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
603
- * const chunks = collection.partition(item => item < 3);
604
- * chunks.map(chunk => chunk.toArray()).toArray();
605
- * // [[1, 2], [3, 4, 5, 6]]
783
+ * // Assume the inputed collection is empty.
784
+ * function main(collection: ICollection<number>): void {
785
+ * collection
786
+ * .apppend([1, 2, 3, 4, 5, 6])
787
+ * .partition(item => item < 3)
788
+ * .map(chunk => chunk.toArray())
789
+ * .toArray();
790
+ * // [[1, 2], [3, 4, 5, 6]]
791
+ * }
606
792
  * ```
607
793
  */
608
794
  partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
@@ -610,12 +796,17 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
610
796
  * The <i>sliding</i> method returns a new collection of chunks representing a "sliding window" view of the items in the collection.
611
797
  * @example
612
798
  * ```ts
613
- * import { ListCollection } from "@daiso-tech/core";;
799
+ * import type { ICollection } from "@daiso-tech/core";
614
800
  *
615
- * const collection = new ListCollection([1, 2, 3, 4, 5])
616
- * const chunks = collection.sliding(2);
617
- * chunks.map(chunk => chunk.toArray()).toArray();
618
- * // [[1, 2], [2, 3], [3, 4], [4, 5]]
801
+ * // Assume the inputed collection is empty.
802
+ * function main(collection: ICollection<number>): void {
803
+ * collection
804
+ * .apppend([1, 2, 3, 4, 5])
805
+ * .sliding(2)
806
+ * .map(chunk => chunk.toArray())
807
+ * .toArray();
808
+ * // [[1, 2], [2, 3], [3, 4], [4, 5]]
809
+ * }
619
810
  * ```
620
811
  */
621
812
  sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
@@ -624,47 +815,53 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
624
815
  * By default the equality check occurs on the item.
625
816
  * @example
626
817
  * ```ts
627
- * import { ListCollection } from "@daiso-tech/core";;
628
- *
629
- * const collection = new ListCollection(["a", "a", "a", "b", "b", "c"]);
630
- * const group = collection
631
- * .groupBy()
632
- * .map(([key, collection]) => [key, collection.toArray()])
633
- * .toArray();
634
- * // [
635
- * // [
636
- * // "a",
637
- * // ["a", "a", "a"]
638
- * // ],
639
- * // [
640
- * // "b",
641
- * // ["b", "b"]
642
- * // ],
643
- * // [
644
- * // "c",
645
- * // ["c"]
646
- * // ]
647
- * // ]
648
- * ```
649
- * @example
650
- * ```ts
651
- * import { ListCollection } from "@daiso-tech/core";;
652
- *
653
- * const collection = new ListCollection(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"]);
654
- * const group = collection
655
- * .groupBy(item => item.split("@")[1])
656
- * .map(([key, collection]) => [key, collection.toArray()])
657
- * .toArray();
658
- * // [
659
- * // [
660
- * // "gmail.com",
661
- * // ["alice@gmail.com", "carlos@gmail.com"]
662
- * // ],
663
- * // [
664
- * // "yahoo.com",
665
- * // ["bob@yahoo.com"]
666
- * // ]
667
- * // ]
818
+ * import type { ICollection } from "@daiso-tech/core";
819
+ *
820
+ * // Assume the inputed collection is empty.
821
+ * function main(collection: ICollection<string>): void {
822
+ * collection
823
+ * .apppend(["a", "a", "a", "b", "b", "c"])
824
+ * .groupBy()
825
+ * .map(([key, collection]) => [key, .toArray()])
826
+ * .toArray();
827
+ * // [
828
+ * // [
829
+ * // "a",
830
+ * // ["a", "a", "a"]
831
+ * // ],
832
+ * // [
833
+ * // "b",
834
+ * // ["b", "b"]
835
+ * // ],
836
+ * // [
837
+ * // "c",
838
+ * // ["c"]
839
+ * // ]
840
+ * // ]
841
+ * }
842
+ * ```
843
+ * @example
844
+ * ```ts
845
+ * import type { ICollection } from "@daiso-tech/core";
846
+ *
847
+ * // Assume the inputed collection is empty.
848
+ * function main(collection: ICollection<string>): void {
849
+ * collection.apppend(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"]);
850
+ * const group = collection
851
+ * .groupBy(item => item.split("@")[1])
852
+ * .map(([key, collection]) => [key, .toArray()])
853
+ * .toArray();
854
+ * // [
855
+ * // [
856
+ * // "gmail.com",
857
+ * // ["alice@gmail.com", "carlos@gmail.com"]
858
+ * // ],
859
+ * // [
860
+ * // "yahoo.com",
861
+ * // ["bob@yahoo.com"]
862
+ * // ]
863
+ * // ]
864
+ * }
668
865
  * ```
669
866
  */
670
867
  groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<[TOutput, ICollection<TInput>]>;
@@ -673,31 +870,37 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
673
870
  * By default the equality check occurs on the item.
674
871
  * @example
675
872
  * ```ts
676
- * import { ListCollection } from "@daiso-tech/core";;
677
- *
678
- * const collection = new ListCollection(["a", "a", "a", "b", "b", "c"]);
679
- * const count = collection
680
- * .countBy()
681
- * .map(([key, collection]) => [key, collection.toArray()])
682
- * .toArray();
683
- * // [
684
- * // ["a", 3],
685
- * // ["b", 2],
686
- * // ["c", 1]
687
- * // ]
873
+ * import type { ICollection } from "@daiso-tech/core";
874
+ *
875
+ * // Assume the inputed collection is empty.
876
+ * function main(collection: ICollection<string>): void {
877
+ * collection
878
+ * .apppend(["a", "a", "a", "b", "b", "c"])
879
+ * .countBy()
880
+ * .map(([key, collection]) => [key, .toArray()])
881
+ * .toArray();
882
+ * // [
883
+ * // ["a", 3],
884
+ * // ["b", 2],
885
+ * // ["c", 1]
886
+ * // ]
887
+ * }
688
888
  * ```
689
889
  * @example
690
890
  * ```ts
691
- * import { ListCollection } from "@daiso-tech/core";;
891
+ * import type { ICollection } from "@daiso-tech/core";
692
892
  *
693
- * const collection = new ListCollection(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"]);
694
- * const count = collection
695
- * .countBy(item => item.split("@")[1])
696
- * .toArray();
697
- * // [
698
- * // ["gmail.com", 2],
699
- * // ["yahoo.com", 1]
700
- * // ]
893
+ * // Assume the inputed collection is empty.
894
+ * function main(collection: ICollection<string>): void {
895
+ * collection
896
+ * .apppend(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"])
897
+ * .countBy(item => item.split("@")[1])
898
+ * .toArray();
899
+ * // [
900
+ * // ["gmail.com", 2],
901
+ * // ["yahoo.com", 1]
902
+ * // ]
903
+ * }
701
904
  * ```
702
905
  */
703
906
  countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<[TOutput, number]>;
@@ -706,30 +909,44 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
706
909
  * By default the equality check occurs on the item.
707
910
  * @example
708
911
  * ```ts
709
- * import { ListCollection } from "@daiso-tech/core";;
912
+ * import type { ICollection } from "@daiso-tech/core";
710
913
  *
711
- * const collection = new ListCollection([1, 1, 2, 2, 3, 4, 2]);
712
- * collection.unique().toArray();
713
- * // [1, 2, 3, 4]
914
+ * // Assume the inputed collection is empty.
915
+ * function main(collection: ICollection<number>): void {
916
+ * collection
917
+ * .apppend([1, 1, 2, 2, 3, 4, 2])
918
+ * .unique()
919
+ * .toArray();
920
+ * // [1, 2, 3, 4]
921
+ * }
714
922
  * ```
715
923
  * @example
716
924
  * ```ts
717
- * import { ListCollection } from "@daiso-tech/core";;
718
- *
719
- * const collection = new ListCollection([
720
- * { name: "iPhone 6", brand: "Apple", type: "phone" },
721
- * { name: "iPhone 5", brand: "Apple", type: "phone" },
722
- * { name: "Apple Watch", brand: "Apple", type: "watch" },
723
- * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
724
- * { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
725
- * ]);
726
- * const unique = collection.unique({
727
- * selectFn: item => item.brand
728
- * }).toArray();
729
- * // [
730
- * // { name: "iPhone 6", brand: "Apple", type: "phone" },
731
- * // { name: "Galaxy S6", brand: "Samsung", type: "phone" },
732
- * // ]
925
+ * import type { ICollection } from "@daiso-tech/core";
926
+ *
927
+ * type Phone = {
928
+ * name: string;
929
+ * brand: string;
930
+ * type: string;
931
+ * };
932
+ *
933
+ * // Assume the inputed collection is empty.
934
+ * function main(collection: ICollection<Phone>): void {
935
+ * collection
936
+ * .apppend([
937
+ * { name: "iPhone 6", brand: "Apple", type: "phone" },
938
+ * { name: "iPhone 5", brand: "Apple", type: "phone" },
939
+ * { name: "Apple Watch", brand: "Apple", type: "watch" },
940
+ * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
941
+ * { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
942
+ * ])
943
+ * .unique(item => item.brand)
944
+ * .toArray();
945
+ * // [
946
+ * // { name: "iPhone 6", brand: "Apple", type: "phone" },
947
+ * // { name: "Galaxy S6", brand: "Samsung", type: "phone" },
948
+ * // ]
949
+ * }
733
950
  * ```
734
951
  */
735
952
  unique<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
@@ -738,36 +955,50 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
738
955
  * By default the equality check occurs on the item.
739
956
  * @example
740
957
  * ```ts
741
- * import { ListCollection } from "@daiso-tech/core";;
958
+ * import type { ICollection } from "@daiso-tech/core";
742
959
  *
743
- * const collection = new ListCollection([1, 2, 2, 3, 4, 5]);
744
- * const difference = collection.difference([2, 4, 6, 8]);
745
- * difference.toArray();
746
- * // [1, 3, 5]
960
+ * // Assume the inputed collection is empty.
961
+ * function main(collection: ICollection<number>): void {
962
+ * collection
963
+ * .apppend([1, 2, 2, 3, 4, 5])
964
+ * .difference([2, 4, 6, 8])
965
+ * .toArray();
966
+ * // [1, 3, 5]
967
+ * }
747
968
  * ```
748
969
  * @example
749
970
  * ```ts
750
- * import { ListCollection } from "@daiso-tech/core";;
751
- *
752
- * const collection = new ListCollection([
753
- * { name: "iPhone 6", brand: "Apple", type: "phone" },
754
- * { name: "iPhone 5", brand: "Apple", type: "phone" },
755
- * { name: "Apple Watch", brand: "Apple", type: "watch" },
756
- * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
757
- * { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
758
- * ]);
759
- * const difference = collection.difference(
760
- * [
761
- * { name: "Apple Watch", brand: "Apple", type: "watch" },
762
- * ],
763
- * (product) => product.type
764
- * );
765
- * difference.toArray();
766
- * // [
767
- * // { name: "iPhone 6", brand: "Apple", type: "phone" },
768
- * // { name: "iPhone 5", brand: "Apple", type: "phone" },
769
- * // { name: "Galaxy S6", brand: "Samsung", type: "phone" },
770
- * // ]
971
+ * import type { ICollection } from "@daiso-tech/core";
972
+ *
973
+ * type Phone = {
974
+ * name: string;
975
+ * brand: string;
976
+ * type: string;
977
+ * };
978
+ *
979
+ * // Assume the inputed collection is empty.
980
+ * function main(collection: ICollection<Phone>): void {
981
+ * collection
982
+ * .apppend([
983
+ * { name: "iPhone 6", brand: "Apple", type: "phone" },
984
+ * { name: "iPhone 5", brand: "Apple", type: "phone" },
985
+ * { name: "Apple Watch", brand: "Apple", type: "watch" },
986
+ * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
987
+ * { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
988
+ * ])
989
+ * .difference(
990
+ * [
991
+ * { name: "Apple Watch", brand: "Apple", type: "watch" },
992
+ * ],
993
+ * (product) => product.type
994
+ * )
995
+ * .toArray();
996
+ * // [
997
+ * // { name: "iPhone 6", brand: "Apple", type: "phone" },
998
+ * // { name: "iPhone 5", brand: "Apple", type: "phone" },
999
+ * // { name: "Galaxy S6", brand: "Samsung", type: "phone" },
1000
+ * // ]
1001
+ * }
771
1002
  * ```
772
1003
  */
773
1004
  difference<TOutput = TInput>(iterable: Iterable<TInput>, selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
@@ -775,12 +1006,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
775
1006
  * The <i>repeat</i> method will repeat the original collection <i>amount</i> times.
776
1007
  * @example
777
1008
  * ```ts
778
- * import { ListCollection } from "@daiso-tech/core";;
1009
+ * import type { ICollection } from "@daiso-tech/core";
779
1010
  *
780
- * const collection = new ListCollection([1, 2, 3]);
781
- * const newCollection = collection.repeat(3);
782
- * newCollection.toArray();
783
- * // [1, 2, 3, 1, 2, 3, 1, 2, 3]
1011
+ * // Assume the inputed collection is empty.
1012
+ * function main(collection: ICollection<number>): void {
1013
+ * collection
1014
+ * .apppend([1, 2, 3])
1015
+ * .repeat(3)
1016
+ * .toArray();
1017
+ * // [1, 2, 3, 1, 2, 3, 1, 2, 3]
1018
+ * }
784
1019
  * ```
785
1020
  */
786
1021
  repeat(amount: number): ICollection<TInput>;
@@ -789,19 +1024,46 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
789
1024
  * The padding is applied from the start of this collection.
790
1025
  * @example
791
1026
  * ```ts
792
- * import { ListCollection } from "@daiso-tech/core";;
793
- *
794
- * new ListCollection("abc").padStart(10, "foo").join("");
795
- * // "foofoofabc"
1027
+ * import type { ICollection } from "@daiso-tech/core";
796
1028
  *
797
- * new ListCollection("abc").padStart(6, "123465").join("");
798
- * // "123abc"
799
- *
800
- * new ListCollection("abc").padStart(8, "0").join("");
801
- * // "00000abc"
802
- *
803
- * new ListCollection("abc").padStart(1, "_").join("");
804
- * // "abc"
1029
+ * // Assume the inputed collection is empty.
1030
+ * function main(collection: ICollection<string>): void {
1031
+ * collection
1032
+ * .append("abc")
1033
+ * .padStart(10, "foo")
1034
+ * .join("");
1035
+ * // "foofoofabc"
1036
+ * }
1037
+ * ```
1038
+ * @example
1039
+ * ```ts
1040
+ * function main(collection: ICollection<string>): void {
1041
+ * collection
1042
+ * .append("abc")
1043
+ * .padStart(6, "123465")
1044
+ * .join("");
1045
+ * // "123abc"
1046
+ * }
1047
+ * ```
1048
+ * @example
1049
+ * ```ts
1050
+ * function main(collection: ICollection<string>): void {
1051
+ * collection
1052
+ * .append("abc")
1053
+ * .padStart(8, "0")
1054
+ * .join("");
1055
+ * // "00000abc"
1056
+ * }
1057
+ * ```
1058
+ * @example
1059
+ * ```ts
1060
+ * function main(collection: ICollection<string>): void {
1061
+ * collection
1062
+ * .append("abc")
1063
+ * .padStart(1, "_")
1064
+ * .join("");
1065
+ * // "abc"
1066
+ * }
805
1067
  * ```
806
1068
  */
807
1069
  padStart<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
@@ -810,19 +1072,56 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
810
1072
  * The padding is applied from the end of this collection.
811
1073
  * @example
812
1074
  * ```ts
813
- * import { ListCollection } from "@daiso-tech/core";;
1075
+ * import type { ICollection } from "@daiso-tech/core";
814
1076
  *
815
- * new ListCollection("abc").padEnd(10, "foo").join("");
816
- * // "abcfoofoof"
1077
+ * // Assume the inputed collection is empty.
1078
+ * function main(collection: ICollection<string>): void {
1079
+ * collection
1080
+ * .append("abc")
1081
+ * .padEnd(10, "foo")
1082
+ * .join("");
1083
+ * // "abcfoofoof"
1084
+ * }
1085
+ * ```
1086
+ * @example
1087
+ * ```ts
1088
+ * import type { ICollection } from "@daiso-tech/core";
817
1089
  *
818
- * new ListCollection("abc").padEnd(6, "123465").join("");
819
- * // "abc123"
1090
+ * // Assume the inputed collection is empty.
1091
+ * function main(collection: ICollection<string>): void {
1092
+ * collection
1093
+ * .append("abc")
1094
+ * .padEnd(6, "123465")
1095
+ * .join("");
1096
+ * // "abc123"
1097
+ * }
1098
+ * ```
1099
+ * @example
1100
+ * ```ts
1101
+ * import type { ICollection } from "@daiso-tech/core";
820
1102
  *
821
- * new ListCollection("abc").padEnd(8, "0").join("");
822
- * // "abc00000"
1103
+ * // Assume the inputed collection is empty.
1104
+ * function main(collection: ICollection<string>): void {
1105
+ * collection
1106
+ * .append("abc")
1107
+ * .padEnd(8, "0")
1108
+ * .join("");
1109
+ * // "abc00000"
823
1110
  *
824
- * new ListCollection("abc").padEnd(1, "_").join("");
825
- * // "abc"
1111
+ * }
1112
+ * ```
1113
+ * @example
1114
+ * ```ts
1115
+ * import type { ICollection } from "@daiso-tech/core";
1116
+ *
1117
+ * // Assume the inputed collection is empty.
1118
+ * function main(collection: ICollection<string>): void {
1119
+ * collection
1120
+ * .append("abc")
1121
+ * .padEnd(1, "_")
1122
+ * .join("");
1123
+ * // "abc"
1124
+ * }
826
1125
  * ```
827
1126
  */
828
1127
  padEnd<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
@@ -831,51 +1130,81 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
831
1130
  * where <i>start</i> and <i>end</i> (end not included) represent the index of items in the collection.
832
1131
  * @example
833
1132
  * ```ts
834
- * import { ListCollection } from "@daiso-tech/core";;
1133
+ * import type { ICollection } from "@daiso-tech/core";
835
1134
  *
836
- * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
837
- * collection.slice(3).toArray();
838
- * // ["d", "e", "f"]
1135
+ * // Assume the inputed collection is empty.
1136
+ * function main(collection: ICollection<string>): void {
1137
+ * collection
1138
+ * .apppend(["a", "b", "c", "d", "e", "f"])
1139
+ * .slice(3)
1140
+ * .toArray();
1141
+ * // ["d", "e", "f"]
1142
+ * }
839
1143
  * ```
840
1144
  * @example
841
1145
  * ```ts
842
- * import { ListCollection } from "@daiso-tech/core";;
1146
+ * import type { ICollection } from "@daiso-tech/core";
843
1147
  *
844
- * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
845
- * collection.slice(undefined, 2).toArray();
846
- * // ["a", "b"]
1148
+ * // Assume the inputed collection is empty.
1149
+ * function main(collection: ICollection<string>): void {
1150
+ * collection
1151
+ * .apppend(["a", "b", "c", "d", "e", "f"])
1152
+ * .slice(undefined, 2)
1153
+ * .toArray()
1154
+ * // ["a", "b"]
1155
+ * }
847
1156
  * ```
848
1157
  * @example
849
1158
  * ```ts
850
- * import { ListCollection } from "@daiso-tech/core";;
1159
+ * import type { ICollection } from "@daiso-tech/core";
851
1160
  *
852
- * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
853
- * collection.slice(2, 5).toArray();
854
- * // ["c", "d", "e"]
1161
+ * // Assume the inputed collection is empty.
1162
+ * function main(collection: ICollection<string>): void {
1163
+ * collection
1164
+ * .apppend(["a", "b", "c", "d", "e", "f"])
1165
+ * .slice(2, 5)
1166
+ * .toArray()
1167
+ * // ["c", "d", "e"]
1168
+ * }
855
1169
  * ```
856
1170
  * @example
857
1171
  * ```ts
858
- * import { ListCollection } from "@daiso-tech/core";;
1172
+ * import type { ICollection } from "@daiso-tech/core";
859
1173
  *
860
- * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
861
- * collection.slice(-2).toArray();
862
- * // ["e", "f"]
1174
+ * // Assume the inputed collection is empty.
1175
+ * function main(collection: ICollection<string>): void {
1176
+ * collection
1177
+ * .apppend(["a", "b", "c", "d", "e", "f"])
1178
+ * .slice(-2)
1179
+ * .toArray();
1180
+ * // ["e", "f"]
1181
+ * }
863
1182
  * ```
864
1183
  * @example
865
1184
  * ```ts
866
- * import { ListCollection } from "@daiso-tech/core";;
1185
+ * import type { ICollection } from "@daiso-tech/core";
867
1186
  *
868
- * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
869
- * collection.slice(undefined, -2).toArray();
870
- * // ["a", "b", "c", "d"]
1187
+ * // Assume the inputed collection is empty.
1188
+ * function main(collection: ICollection<string>): void {
1189
+ * collection
1190
+ * .apppend(["a", "b", "c", "d", "e", "f"])
1191
+ * .slice(undefined, -2)
1192
+ * .toArray()
1193
+ * // ["a", "b", "c", "d"]
1194
+ * }
871
1195
  * ```
872
1196
  * @example
873
1197
  * ```ts
874
- * import { ListCollection } from "@daiso-tech/core";;
1198
+ * import type { ICollection } from "@daiso-tech/core";
875
1199
  *
876
- * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
877
- * collection.slice(-4, -2).toArray();
878
- * // ["c", "d"]
1200
+ * // Assume the inputed collection is empty.
1201
+ * function main(collection: ICollection<string>): void {
1202
+ * collection
1203
+ * .apppend(["a", "b", "c", "d", "e", "f"])
1204
+ * .slice(-4, -2)
1205
+ * .toArray();
1206
+ * // ["c", "d"]
1207
+ * }
879
1208
  * ```
880
1209
  */
881
1210
  slice(start?: number, end?: number): ICollection<TInput>;
@@ -883,11 +1212,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
883
1212
  * The <i>prepend</i> method adds <i>iterable</i> to the beginning of the collection.
884
1213
  * @example
885
1214
  * ```ts
886
- * import { ListCollection } from "@daiso-tech/core";;
1215
+ * import type { ICollection } from "@daiso-tech/core";
887
1216
  *
888
- * const collection = new ListCollection([1, 2, 3, 4, 5]).prepend([-1, 20]);
889
- * collection.toArray();
890
- * // [-1, 20, 1, 2, 3, 4, 5]
1217
+ * // Assume the inputed collection is empty.
1218
+ * function main(collection: ICollection<number>): void {
1219
+ * collection
1220
+ * .apppend([1, 2, 3, 4, 5])
1221
+ * .prepend([-1, 20])
1222
+ * .toArray();
1223
+ * // [-1, 20, 1, 2, 3, 4, 5]
1224
+ * }
891
1225
  * ```
892
1226
  */
893
1227
  prepend<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
@@ -895,11 +1229,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
895
1229
  * The <i>append</i> method adds <i>iterable</i> to the end of the collection.
896
1230
  * @example
897
1231
  * ```ts
898
- * import { ListCollection } from "@daiso-tech/core";;
1232
+ * import type { ICollection } from "@daiso-tech/core";
899
1233
  *
900
- * const collection = new ListCollection([1, 2, 3, 4, 5]).append([-1, -2]);
901
- * collection.toArray();
902
- * // [1, 2, 3, 4, 5, -1, -2,]
1234
+ * // Assume the inputed collection is empty.
1235
+ * function main(collection: ICollection<number>): void {
1236
+ * collection
1237
+ * .apppend([1, 2, 3, 4, 5])
1238
+ * .append([-1, -2])
1239
+ * .toArray();
1240
+ * // [1, 2, 3, 4, 5, -1, -2,]
1241
+ * }
903
1242
  * ```
904
1243
  */
905
1244
  append<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
@@ -907,11 +1246,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
907
1246
  * The <i>insertBefore</i> method adds <i>iterable</i> before the first item that matches <i>predicateFn</i>.
908
1247
  * @example
909
1248
  * ```ts
910
- * import { ListCollection } from "@daiso-tech/core";;
1249
+ * import type { ICollection } from "@daiso-tech/core";
911
1250
  *
912
- * const collection = new ListCollection([1, 2, 2, 3, 4, 5]).insertBefore(item => item === 2, [-1, 20]);
913
- * collection.toArray();
914
- * // [1, -1, 20, 2, 2, 3, 4, 5]
1251
+ * // Assume the inputed collection is empty.
1252
+ * function main(collection: ICollection<number>): void {
1253
+ * collection
1254
+ * .apppend([1, 2, 2, 3, 4, 5])
1255
+ * .insertBefore(item => item === 2, [-1, 20])
1256
+ * .toArray();
1257
+ * // [1, -1, 20, 2, 2, 3, 4, 5]
1258
+ * }
915
1259
  * ```
916
1260
  */
917
1261
  insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
@@ -919,11 +1263,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
919
1263
  * The <i>insertAfter</i> method adds <i>iterable</i> after the first item that matches <i>predicateFn</i>.
920
1264
  * @example
921
1265
  * ```ts
922
- * import { ListCollection } from "@daiso-tech/core";;
1266
+ * import type { ICollection } from "@daiso-tech/core";
923
1267
  *
924
- * const collection = new ListCollection([1, 2, 2, 3, 4, 5]).insertAfter(item => item === 2, [-1, 20]);
925
- * collection.toArray();
926
- * // [1, 2, -1, 20, 2, 3, 4, 5]
1268
+ * // Assume the inputed collection is empty.
1269
+ * function main(collection: ICollection<number>): void {
1270
+ * collection
1271
+ * .apppend([1, 2, 2, 3, 4, 5])
1272
+ * .insertAfter(item => item === 2, [-1, 20])
1273
+ * .toArray();
1274
+ * // [1, 2, -1, 20, 2, 3, 4, 5]
1275
+ * }
927
1276
  * ```
928
1277
  */
929
1278
  insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
@@ -931,35 +1280,44 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
931
1280
  * The <i>crossJoin</i> method cross joins the collection's values among <i>iterables</i>, returning a Cartesian product with all possible permutations.
932
1281
  * @example
933
1282
  * ```ts
934
- * import { ListCollection } from "@daiso-tech/core";;
935
- *
936
- * const collection = new ListCollection([1, 2]);
937
- * const matrix = collection.cross(["a", "b"]);
938
- * matrix.toArray();
939
- * // [
940
- * // [1, "a"],
941
- * // [1, "b"],
942
- * // [2, "a"],
943
- * // [2, "b"],
944
- * // ]
1283
+ * import type { ICollection } from "@daiso-tech/core";
1284
+ *
1285
+ * // Assume the inputed collection is empty.
1286
+ * function main(collection: ICollection<number>): void {
1287
+ * collection
1288
+ * .apppend([1, 2])
1289
+ * .cross(["a", "b"])
1290
+ * .toArray();
1291
+ * // [
1292
+ * // [1, "a"],
1293
+ * // [1, "b"],
1294
+ * // [2, "a"],
1295
+ * // [2, "b"],
1296
+ * // ]
1297
+ * }
945
1298
  * ```
946
1299
  * @example
947
1300
  * ```ts
948
- * import { ListCollection } from "@daiso-tech/core";;
949
- *
950
- * const collection = new ListCollection([1, 2]);
951
- * const matrix = collection.cross(["a", "b"]).cross(["I", "II"]);
952
- * matrix.toArray();
953
- * // [
954
- * // [1, "a", "I"],
955
- * // [1, "a", "II"],
956
- * // [1, "b", "I"],
957
- * // [1, "b", "II"],
958
- * // [2, "a", "I"],
959
- * // [2, "a", "II"],
960
- * // [2, "b", "I"],
961
- * // [2, "b", "II"],
962
- * // ]
1301
+ * import type { ICollection } from "@daiso-tech/core";
1302
+ *
1303
+ * // Assume the inputed collection is empty.
1304
+ * function main(collection: ICollection<number>): void {
1305
+ * collection
1306
+ * .apppend([1, 2])
1307
+ * .cross(["a", "b"])
1308
+ * .cross(["I", "II"])
1309
+ * .toArray();
1310
+ * // [
1311
+ * // [1, "a", "I"],
1312
+ * // [1, "a", "II"],
1313
+ * // [1, "b", "I"],
1314
+ * // [1, "b", "II"],
1315
+ * // [2, "a", "I"],
1316
+ * // [2, "a", "II"],
1317
+ * // [2, "b", "I"],
1318
+ * // [2, "b", "II"],
1319
+ * // ]
1320
+ * }
963
1321
  * ```
964
1322
  */
965
1323
  crossJoin<TExtended>(iterable: Iterable<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
@@ -968,30 +1326,42 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
968
1326
  * The returned collection has size of the shortest collection.
969
1327
  * @example
970
1328
  * ```ts
971
- * import { ListCollection } from "@daiso-tech/core";;
1329
+ * import type { ICollection } from "@daiso-tech/core";
972
1330
  *
973
- * const collection = new ListCollection(["Chair", "Desk"]);
974
- * const zipped = collection.zip([100, 200]);
975
- * zipped.toArray();
976
- * // [["Chair", 100], ["Desk", 200]]
1331
+ * // Assume the inputed collection is empty.
1332
+ * function main(collection: ICollection<string>): void {
1333
+ * collection
1334
+ * .apppend(["Chair", "Desk"]);
1335
+ * .zip([100, 200]);
1336
+ * .toArray();
1337
+ * // [["Chair", 100], ["Desk", 200]]
1338
+ * }
977
1339
  * ```
978
1340
  * @example
979
1341
  * ```ts
980
- * import { ListCollection } from "@daiso-tech/core";;
1342
+ * import type { ICollection } from "@daiso-tech/core";
981
1343
  *
982
- * const collection = new ListCollection(["Chair", "Desk", "Couch"]);
983
- * const zipped = collection.zip([100, 200]);
984
- * zipped.toArray();
985
- * // [["Chair", 100], ["Desk", 200]]
1344
+ * // Assume the inputed collection is empty.
1345
+ * function main(collection: ICollection<string>): void {
1346
+ * collection
1347
+ * .apppend(["Chair", "Desk", "Couch"])
1348
+ * .zip([100, 200])
1349
+ * .toArray();
1350
+ * // [["Chair", 100], ["Desk", 200]]
1351
+ * }
986
1352
  * ```
987
1353
  * @example
988
1354
  * ```ts
989
- * import { ListCollection } from "@daiso-tech/core";;
1355
+ * import type { ICollection } from "@daiso-tech/core";
990
1356
  *
991
- * const collection = new ListCollection(["Chair", "Desk"]);
992
- * const zipped = collection.zip([100, 200, 300]);
993
- * zipped.toArray();
994
- * // [["Chair", 100], ["Desk", 200]]
1357
+ * // Assume the inputed collection is empty.
1358
+ * function main(collection: ICollection<string>): void {
1359
+ * collection
1360
+ * .apppend(["Chair", "Desk"])
1361
+ * .zip([100, 200, 300])
1362
+ * .toArray();
1363
+ * // [["Chair", 100], ["Desk", 200]]
1364
+ * }
995
1365
  * ```
996
1366
  */
997
1367
  zip<TExtended>(iterable: Iterable<TExtended>): ICollection<[TInput, TExtended]>;
@@ -999,29 +1369,44 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
999
1369
  * The <i>sort</i> method sorts the collection. You can provide a <i>comparator</i> function.
1000
1370
  * @example
1001
1371
  * ```ts
1002
- * import { ListCollection } from "@daiso-tech/core";;
1372
+ * import type { ICollection } from "@daiso-tech/core";
1003
1373
  *
1004
- * const collection = new ListCollection([-1, 2, 4, 3]);
1005
- * collection.sort().toArray();
1006
- * // [-1, 2, 3, 4]
1374
+ * // Assume the inputed collection is empty.
1375
+ * function main(collection: ICollection<number>): void {
1376
+ * collection
1377
+ * .apppend([-1, 2, 4, 3])
1378
+ * .sort()
1379
+ * .toArray()
1380
+ * // [-1, 2, 3, 4]
1381
+ * }
1007
1382
  * ```
1008
1383
  * @example
1009
1384
  * ```ts
1010
- * import { ListCollection } from "@daiso-tech/core";;
1011
- *
1012
- * const collection = new ListCollection([
1013
- * { name: "Anders", age: 30 },
1014
- * { name: "Joe", age: 20 },
1015
- * { name: "Hasan", age: 25 },
1016
- * { name: "Linda", age: 19 }
1017
- * ]);
1018
- * collection.sort(({ age: ageA }, { age: ageB }) => ageA - ageB).toArray();
1019
- * // [
1020
- * // { name: "Linda", age: 19 }
1021
- * // { name: "Joe", age: 20 },
1022
- * // { name: "Hasan", age: 25 },
1023
- * // { name: "Anders", age: 30 },
1024
- * // ]
1385
+ * import type { ICollection } from "@daiso-tech/core";
1386
+ *
1387
+ * type Person = {
1388
+ * name: string;
1389
+ * age: number;
1390
+ * };
1391
+ *
1392
+ * // Assume the inputed collection is empty.
1393
+ * function main(collection: ICollection<Person>): void {
1394
+ * collection
1395
+ * .apppend([
1396
+ * { name: "Anders", age: 30 },
1397
+ * { name: "Joe", age: 20 },
1398
+ * { name: "Hasan", age: 25 },
1399
+ * { name: "Linda", age: 19 }
1400
+ * ])
1401
+ * .sort(({ age: ageA }, { age: ageB }) => ageA - ageB)
1402
+ * .toArray();
1403
+ * // [
1404
+ * // { name: "Linda", age: 19 }
1405
+ * // { name: "Joe", age: 20 },
1406
+ * // { name: "Hasan", age: 25 },
1407
+ * // { name: "Anders", age: 30 },
1408
+ * // ]
1409
+ * }
1025
1410
  * ```
1026
1411
  */
1027
1412
  sort(comparator?: Comparator<TInput>): ICollection<TInput>;
@@ -1030,11 +1415,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1030
1415
  * The reversing of the collection will be applied in chunks that are the size of <i> chunkSize </i>.
1031
1416
  * @example
1032
1417
  * ```ts
1033
- * import { ListCollection } from "@daiso-tech/core";;
1418
+ * import type { ICollection } from "@daiso-tech/core";
1034
1419
  *
1035
- * const collection = new ListCollection([-1, 2, 4, 3]);
1036
- * collection.reverse().toArray();
1037
- * // [3, 4, 2, -1]
1420
+ * // Assume the inputed collection is empty.
1421
+ * function main(collection: ICollection<number>): void {
1422
+ * collection
1423
+ * .apppend([-1, 2, 4, 3])
1424
+ * .reverse()
1425
+ * .toArray();
1426
+ * // [3, 4, 2, -1]
1427
+ * }
1038
1428
  * ```
1039
1429
  */
1040
1430
  reverse(chunkSize?: number): ICollection<TInput>;
@@ -1047,26 +1437,39 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1047
1437
  * By default it will get the first item. If the collection is empty or no items passes <i> predicateFn </i> than null i returned.
1048
1438
  * @example
1049
1439
  * ```ts
1050
- * import { ListCollection } from "@daiso-tech/core";;
1440
+ * import type { ICollection } from "@daiso-tech/core";
1051
1441
  *
1052
- * const collection = new ListCollection([1, 2, 3, 4]);
1053
- * collection.first();
1054
- * // 1
1442
+ * // Assume the inputed collection is empty.
1443
+ * function main(collection: ICollection<number>): void {
1444
+ * collection
1445
+ * .apppend([1, 2, 3, 4])
1446
+ * .first();
1447
+ * // 1
1448
+ * }
1449
+ * ```
1055
1450
  * @example
1056
1451
  * ```ts
1057
- * import { ListCollection } from "@daiso-tech/core";;
1452
+ * import type { ICollection } from "@daiso-tech/core";
1058
1453
  *
1059
- * const collection = new ListCollection([1, 2, 3, 4]);
1060
- * collection.first(item => item > 2);
1061
- * // 3
1454
+ * // Assume the inputed collection is empty.
1455
+ * function main(collection: ICollection<number>): void {
1456
+ * collection
1457
+ * .apppend([1, 2, 3, 4])
1458
+ * .first(item => item > 2);
1459
+ * // 3
1460
+ * }
1062
1461
  * ```
1063
1462
  * @example
1064
1463
  * ```ts
1065
- * import { ListCollection } from "@daiso-tech/core";;
1464
+ * import type { ICollection } from "@daiso-tech/core";
1066
1465
  *
1067
- * const collection = new ListCollection([1, 2, 3, 4]);
1068
- * collection.first(item => item > 10);
1069
- * // null
1466
+ * // Assume the inputed collection is empty.
1467
+ * function main(collection: ICollection<number>): void {
1468
+ * collection
1469
+ * .apppend([1, 2, 3, 4])
1470
+ * .first(item => item > 10);
1471
+ * // null
1472
+ * }
1070
1473
  * ```
1071
1474
  * // 3
1072
1475
  */
@@ -1076,35 +1479,51 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1076
1479
  * By default it will get the first item. If the collection is empty or no items passes <i> predicateFn </i> than <i> defaultValue </i>.
1077
1480
  * @example
1078
1481
  * ```ts
1079
- * import { ListCollection } from "@daiso-tech/core";;
1482
+ * import type { ICollection } from "@daiso-tech/core";
1080
1483
  *
1081
- * const collection = new ListCollection([1, 2, 3, 4]);
1082
- * collection.firstOr(-1);
1083
- * // 1
1484
+ * // Assume the inputed collection is empty.
1485
+ * function main(collection: ICollection<number>): void {
1486
+ * collection
1487
+ * .apppend([1, 2, 3, 4])
1488
+ * .firstOr(-1);
1489
+ * // 1
1490
+ * }
1084
1491
  * ```
1085
1492
  * @example
1086
1493
  * ```ts
1087
- * import { ListCollection } from "@daiso-tech/core";;
1494
+ * import type { ICollection } from "@daiso-tech/core";
1088
1495
  *
1089
- * const collection = new ListCollection([1, 2, 3, 4]);
1090
- * collection.firstOr(-1, item => item > 2);
1091
- * // 3
1496
+ * // Assume the inputed collection is empty.
1497
+ * function main(collection: ICollection<number>): void {
1498
+ * collection
1499
+ * .apppend([1, 2, 3, 4])
1500
+ * .firstOr(-1, item => item > 2);
1501
+ * // 3
1502
+ * }
1092
1503
  * ```
1093
1504
  * @example
1094
1505
  * ```ts
1095
- * import { ListCollection } from "@daiso-tech/core";;
1506
+ * import type { ICollection } from "@daiso-tech/core";
1096
1507
  *
1097
- * const collection = new ListCollection([1, 2, 3, 4]);
1098
- * collection.firstOr(-1, item => item > 10);
1099
- * // -1
1508
+ * // Assume the inputed collection is empty.
1509
+ * function main(collection: ICollection<number>): void {
1510
+ * collection
1511
+ * .apppend([1, 2, 3, 4])
1512
+ * .firstOr(-1, item => item > 10);
1513
+ * // -1
1514
+ * }
1100
1515
  * ```
1101
1516
  * @example
1102
1517
  * ```ts
1103
- * import { ListCollection } from "@daiso-tech/core";;
1518
+ * import type { ICollection } from "@daiso-tech/core";
1104
1519
  *
1105
- * const collection = new ListCollection([1, 2, 3, 4]);
1106
- * collection.firstOr(() => -1, item => item > 10);
1107
- * // -1
1520
+ * // Assume the inputed collection is empty.
1521
+ * function main(collection: ICollection<number>): void {
1522
+ * collection
1523
+ * .apppend([1, 2, 3, 4])
1524
+ * .firstOr(() => -1, item => item > 10);
1525
+ * // -1
1526
+ * }
1108
1527
  * ```
1109
1528
  */
1110
1529
  firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
@@ -1114,27 +1533,39 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1114
1533
  * @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
1115
1534
  * @example
1116
1535
  * ```ts
1117
- * import { ListCollection } from "@daiso-tech/core";;
1536
+ * import type { ICollection } from "@daiso-tech/core";
1118
1537
  *
1119
- * const collection = new ListCollection([1, 2, 3, 4]);
1120
- * collection.firstOrFail();
1121
- * // 1
1538
+ * // Assume the inputed collection is empty.
1539
+ * function main(collection: ICollection<number>): void {
1540
+ * collection
1541
+ * .apppend([1, 2, 3, 4])
1542
+ * .firstOrFail();
1543
+ * // 1
1544
+ * }
1122
1545
  * ```
1123
1546
  * @example
1124
1547
  * ```ts
1125
- * import { ListCollection } from "@daiso-tech/core";;
1548
+ * import type { ICollection } from "@daiso-tech/core";
1126
1549
  *
1127
- * const collection = new ListCollection([1, 2, 3, 4]);
1128
- * collection.firstOrFail(item => item > 2);
1129
- * // 3
1550
+ * // Assume the inputed collection is empty.
1551
+ * function main(collection: ICollection<number>): void {
1552
+ * collection
1553
+ * .apppend([1, 2, 3, 4])
1554
+ * .firstOrFail(item => item > 2);
1555
+ * // 3
1556
+ * }
1130
1557
  * ```
1131
1558
  * @example
1132
1559
  * ```ts
1133
- * import { ListCollection } from "@daiso-tech/core";;
1560
+ * import type { ICollection } from "@daiso-tech/core";
1134
1561
  *
1135
- * const collection = new ListCollection([1, 2, 3, 4]);
1136
- * collection.firstOrFail(item => item > 10);
1137
- * // throws an error
1562
+ * // Assume the inputed collection is empty.
1563
+ * function main(collection: ICollection<number>): void {
1564
+ * collection
1565
+ * .apppend([1, 2, 3, 4])
1566
+ * .firstOrFail(item => item > 10);
1567
+ * // throws an error
1568
+ * }
1138
1569
  * ```
1139
1570
  */
1140
1571
  firstOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
@@ -1143,29 +1574,40 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1143
1574
  * By default it will get the last item. If the collection is empty or no items passes <i> predicateFn </i> than null i returned.
1144
1575
  * @example
1145
1576
  * ```ts
1146
- * import { ListCollection } from "@daiso-tech/core";;
1577
+ * import type { ICollection } from "@daiso-tech/core";
1147
1578
  *
1148
- * const collection = new ListCollection([1, 2, 3, 4]);
1149
- * collection.last();
1150
- * // 4
1579
+ * // Assume the inputed collection is empty.
1580
+ * function main(collection: ICollection<number>): void {
1581
+ * collection
1582
+ * .apppend([1, 2, 3, 4])
1583
+ * .last();
1584
+ * // 4
1585
+ * }
1151
1586
  * ```
1152
1587
  * @example
1153
1588
  * ```ts
1154
- * import { ListCollection } from "@daiso-tech/core";;
1589
+ * import type { ICollection } from "@daiso-tech/core";
1155
1590
  *
1156
- * const collection = new ListCollection([1, 2, 3, 4]);
1157
- * collection.last(item => item < 4);
1158
- * // 3
1591
+ * // Assume the inputed collection is empty.
1592
+ * function main(collection: ICollection<number>): void {
1593
+ * collection
1594
+ * .apppend([1, 2, 3, 4])
1595
+ * .last(item => item < 4);
1596
+ * // 3
1597
+ * }
1159
1598
  * ```
1160
1599
  * @example
1161
1600
  * ```ts
1162
- * import { ListCollection } from "@daiso-tech/core";;
1601
+ * import type { ICollection } from "@daiso-tech/core";
1163
1602
  *
1164
- * const collection = new ListCollection([1, 2, 3, 4]);
1165
- * collection.last(item => item > 10);
1166
- * // null
1603
+ * // Assume the inputed collection is empty.
1604
+ * function main(collection: ICollection<number>): void {
1605
+ * collection
1606
+ * .apppend([1, 2, 3, 4])
1607
+ * .last(item => item > 10);
1608
+ * // null
1609
+ * }
1167
1610
  * ```
1168
- * // 3
1169
1611
  */
1170
1612
  last<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
1171
1613
  /**
@@ -1173,35 +1615,51 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1173
1615
  * By default it will get the last item. If the collection is empty or no items passes <i> predicateFn </i> than <i> defaultValue </i>.
1174
1616
  * @example
1175
1617
  * ```ts
1176
- * import { ListCollection } from "@daiso-tech/core";;
1618
+ * import type { ICollection } from "@daiso-tech/core";
1177
1619
  *
1178
- * const collection = new ListCollection([1, 2, 3, 4]);
1179
- * collection.lastOr(-1);
1180
- * // 4
1620
+ * // Assume the inputed collection is empty.
1621
+ * function main(collection: ICollection<number>): void {
1622
+ * collection
1623
+ * .apppend([1, 2, 3, 4])
1624
+ * .lastOr(-1);
1625
+ * // 4
1626
+ * }
1181
1627
  * ```
1182
1628
  * @example
1183
1629
  * ```ts
1184
- * import { ListCollection } from "@daiso-tech/core";;
1630
+ * import type { ICollection } from "@daiso-tech/core";
1185
1631
  *
1186
- * const collection = new ListCollection([1, 2, 3, 4]);
1187
- * collection.lastOr(-1, item => item < 4);
1188
- * // 3
1632
+ * // Assume the inputed collection is empty.
1633
+ * function main(collection: ICollection<number>): void {
1634
+ * collection
1635
+ * .apppend([1, 2, 3, 4])
1636
+ * .lastOr(-1, item => item < 4);
1637
+ * // 3
1638
+ * }
1189
1639
  * ```
1190
1640
  * @example
1191
1641
  * ```ts
1192
- * import { ListCollection } from "@daiso-tech/core";;
1642
+ * import type { ICollection } from "@daiso-tech/core";
1193
1643
  *
1194
- * const collection = new ListCollection([1, 2, 3, 4]);
1195
- * collection.lastOr(-1, item => item > 10);
1196
- * // -1
1644
+ * // Assume the inputed collection is empty.
1645
+ * function main(collection: ICollection<number>): void {
1646
+ * collection
1647
+ * .apppend([1, 2, 3, 4])
1648
+ * .lastOr(-1, item => item > 10);
1649
+ * // -1
1650
+ * }
1197
1651
  * ```
1198
1652
  * @example
1199
1653
  * ```ts
1200
- * import { ListCollection } from "@daiso-tech/core";;
1654
+ * import type { ICollection } from "@daiso-tech/core";
1201
1655
  *
1202
- * const collection = new ListCollection([1, 2, 3, 4]);
1203
- * collection.lastOr(() => -1, item => item > 10);
1204
- * // -1
1656
+ * // Assume the inputed collection is empty.
1657
+ * function main(collection: ICollection<number>): void {
1658
+ * collection
1659
+ * .apppend([1, 2, 3, 4])
1660
+ * .lastOr(() => -1, item => item > 10);
1661
+ * // -1
1662
+ * }
1205
1663
  * ```
1206
1664
  */
1207
1665
  lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
@@ -1211,27 +1669,39 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1211
1669
  * @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
1212
1670
  * @example
1213
1671
  * ```ts
1214
- * import { ListCollection } from "@daiso-tech/core";;
1672
+ * import type { ICollection } from "@daiso-tech/core";
1215
1673
  *
1216
- * const collection = new ListCollection([1, 2, 3, 4]);
1217
- * collection.lastOrFail();
1218
- * // 4
1674
+ * // Assume the inputed collection is empty.
1675
+ * function main(collection: ICollection<number>): void {
1676
+ * collection
1677
+ * .apppend([1, 2, 3, 4])
1678
+ * .lastOrFail();
1679
+ * // 4
1680
+ * }
1219
1681
  * ```
1220
1682
  * @example
1221
1683
  * ```ts
1222
- * import { ListCollection } from "@daiso-tech/core";;
1684
+ * import type { ICollection } from "@daiso-tech/core";
1223
1685
  *
1224
- * const collection = new ListCollection([1, 2, 3, 4]);
1225
- * collection.lastOrFail(item => item < 4);
1226
- * // 3
1686
+ * // Assume the inputed collection is empty.
1687
+ * function main(collection: ICollection<number>): void {
1688
+ * collection
1689
+ * .apppend([1, 2, 3, 4])
1690
+ * .lastOrFail(item => item < 4);
1691
+ * // 3
1692
+ * }
1227
1693
  * ```
1228
1694
  * @example
1229
1695
  * ```ts
1230
- * import { ListCollection } from "@daiso-tech/core";;
1696
+ * import type { ICollection } from "@daiso-tech/core";
1231
1697
  *
1232
- * const collection = new ListCollection([1, 2, 3, 4]);
1233
- * collection.lastOrFail(item => item > 10);
1234
- * // throws an error
1698
+ * // Assume the inputed collection is empty.
1699
+ * function main(collection: ICollection<number>): void {
1700
+ * collection
1701
+ * .lastOrFail(item => item > 10);
1702
+ * .apppend([1, 2, 3, 4])
1703
+ * // throws an error
1704
+ * }
1235
1705
  * ```
1236
1706
  */
1237
1707
  lastOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
@@ -1240,19 +1710,27 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1240
1710
  * If the <i>predicateFn</i> does not match or matches the first item then null is returned.
1241
1711
  * @example
1242
1712
  * ```ts
1243
- * import { ListCollection } from "@daiso-tech/core";;
1713
+ * import type { ICollection } from "@daiso-tech/core";
1244
1714
  *
1245
- * const collection = new ListCollection([1, 2, 3, 4]);
1246
- * collection.before(item => item === 2);
1247
- * // 1
1715
+ * // Assume the inputed collection is empty.
1716
+ * function main(collection: ICollection<number>): void {
1717
+ * collection
1718
+ * .apppend([1, 2, 3, 4])
1719
+ * .before(item => item === 2);
1720
+ * // 1
1721
+ * }
1248
1722
  * ```
1249
1723
  * @example
1250
1724
  * ```ts
1251
- * import { ListCollection } from "@daiso-tech/core";;
1725
+ * import type { ICollection } from "@daiso-tech/core";
1252
1726
  *
1253
- * const collection = new ListCollection([1, 2, 3, 4]);
1254
- * collection.before(item => item === 1);
1255
- * // null
1727
+ * // Assume the inputed collection is empty.
1728
+ * function main(collection: ICollection<number>): void {
1729
+ * collection
1730
+ * .apppend([1, 2, 3, 4])
1731
+ * .before(item => item === 1);
1732
+ * // null
1733
+ * }
1256
1734
  * ```
1257
1735
  */
1258
1736
  before(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
@@ -1261,27 +1739,39 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1261
1739
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the first item then <i>defaultValue</i> is returned.
1262
1740
  * @example
1263
1741
  * ```ts
1264
- * import { ListCollection } from "@daiso-tech/core";;
1742
+ * import type { ICollection } from "@daiso-tech/core";
1265
1743
  *
1266
- * const collection = new ListCollection([1, 2, 3, 4]);
1267
- * collection.beforeOr(-1, item => item === 2);
1268
- * // 1
1744
+ * // Assume the inputed collection is empty.
1745
+ * function main(collection: ICollection<number>): void {
1746
+ * collection
1747
+ * .apppend([1, 2, 3, 4])
1748
+ * .beforeOr(-1, item => item === 2);
1749
+ * // 1
1750
+ * }
1269
1751
  * ```
1270
1752
  * @example
1271
1753
  * ```ts
1272
- * import { ListCollection } from "@daiso-tech/core";;
1754
+ * import type { ICollection } from "@daiso-tech/core";
1273
1755
  *
1274
- * const collection = new ListCollection([1, 2, 3, 4]);
1275
- * collection.beforeOr(-1, item => item === 1);
1276
- * // -1
1756
+ * // Assume the inputed collection is empty.
1757
+ * function main(collection: ICollection<number>): void {
1758
+ * collection
1759
+ * .apppend([1, 2, 3, 4])
1760
+ * .beforeOr(-1, item => item === 1);
1761
+ * // -1
1762
+ * }
1277
1763
  * ```
1278
1764
  * @example
1279
1765
  * ```ts
1280
- * import { ListCollection } from "@daiso-tech/core";;
1766
+ * import type { ICollection } from "@daiso-tech/core";
1281
1767
  *
1282
- * const collection = new ListCollection([1, 2, 3, 4]);
1283
- * collection.beforeOr(() => -1, item => item === 1);
1284
- * // -1
1768
+ * // Assume the inputed collection is empty.
1769
+ * function main(collection: ICollection<number>): void {
1770
+ * collection
1771
+ * .apppend([1, 2, 3, 4])
1772
+ * .beforeOr(() => -1, item => item === 1);
1773
+ * // -1
1774
+ * }
1285
1775
  * ```
1286
1776
  */
1287
1777
  beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
@@ -1291,19 +1781,27 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1291
1781
  * @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
1292
1782
  * @example
1293
1783
  * ```ts
1294
- * import { ListCollection } from "@daiso-tech/core";;
1784
+ * import type { ICollection } from "@daiso-tech/core";
1295
1785
  *
1296
- * const collection = new ListCollection([1, 2, 3, 4]);
1297
- * collection.beforeOrFail(item => item === 2);
1298
- * // 1
1786
+ * // Assume the inputed collection is empty.
1787
+ * function main(collection: ICollection<number>): void {
1788
+ * collection
1789
+ * .apppend([1, 2, 3, 4])
1790
+ * .beforeOrFail(item => item === 2);
1791
+ * // 1
1792
+ * }
1299
1793
  * ```
1300
1794
  * @example
1301
1795
  * ```ts
1302
- * import { ListCollection } from "@daiso-tech/core";;
1796
+ * import type { ICollection } from "@daiso-tech/core";
1303
1797
  *
1304
- * const collection = new ListCollection([1, 2, 3, 4]);
1305
- * collection.beforeOrFail(item => item === 1);
1798
+ * // Assume the inputed collection is empty.
1799
+ * function main(collection: ICollection<number>): void {
1800
+ * collection
1801
+ * .apppend([1, 2, 3, 4])
1802
+ * .beforeOrFail(item => item === 1);
1306
1803
  * // error is thrown
1804
+ * }
1307
1805
  * ```
1308
1806
  */
1309
1807
  beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
@@ -1312,19 +1810,27 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1312
1810
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then null is returned.
1313
1811
  * @example
1314
1812
  * ```ts
1315
- * import { ListCollection } from "@daiso-tech/core";;
1813
+ * import type { ICollection } from "@daiso-tech/core";
1316
1814
  *
1317
- * const collection = new ListCollection([1, 2, 3, 4]);
1318
- * collection.after(item => item === 2);
1319
- * // 3
1815
+ * // Assume the inputed collection is empty.
1816
+ * function main(collection: ICollection<number>): void {
1817
+ * collection
1818
+ * .apppend([1, 2, 3, 4])
1819
+ * .after(item => item === 2);
1820
+ * // 3
1821
+ * }
1320
1822
  * ```
1321
1823
  * @example
1322
1824
  * ```ts
1323
- * import { ListCollection } from "@daiso-tech/core";;
1825
+ * import type { ICollection } from "@daiso-tech/core";
1324
1826
  *
1325
- * const collection = new ListCollection([1, 2, 3, 4]);
1326
- * collection.after(item => item === 4);
1327
- * // null
1827
+ * // Assume the inputed collection is empty.
1828
+ * function main(collection: ICollection<number>): void {
1829
+ * collection
1830
+ * .apppend([1, 2, 3, 4])
1831
+ * .after(item => item === 4);
1832
+ * // null
1833
+ * }
1328
1834
  * ```
1329
1835
  */
1330
1836
  after(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
@@ -1333,27 +1839,39 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1333
1839
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then <i>defaultValue</i> is returned.
1334
1840
  * @example
1335
1841
  * ```ts
1336
- * import { ListCollection } from "@daiso-tech/core";;
1842
+ * import type { ICollection } from "@daiso-tech/core";
1337
1843
  *
1338
- * const collection = new ListCollection([1, 2, 3, 4]);
1339
- * collection.afterOr(-1, item => item === 2);
1340
- * // 3
1844
+ * // Assume the inputed collection is empty.
1845
+ * function main(collection: ICollection<number>): void {
1846
+ * collection
1847
+ * .apppend([1, 2, 3, 4])
1848
+ * .afterOr(-1, item => item === 2);
1849
+ * // 3
1850
+ * }
1341
1851
  * ```
1342
1852
  * @example
1343
1853
  * ```ts
1344
- * import { ListCollection } from "@daiso-tech/core";;
1854
+ * import type { ICollection } from "@daiso-tech/core";
1345
1855
  *
1346
- * const collection = new ListCollection([1, 2, 3, 4]);
1347
- * collection.afterOr(-1, item => item === 4);
1348
- * // -1
1856
+ * // Assume the inputed collection is empty.
1857
+ * function main(collection: ICollection<number>): void {
1858
+ * collection
1859
+ * .apppend([1, 2, 3, 4])
1860
+ * .afterOr(-1, item => item === 4);
1861
+ * // -1
1862
+ * }
1349
1863
  * ```
1350
1864
  * @example
1351
1865
  * ```ts
1352
- * import { ListCollection } from "@daiso-tech/core";;
1866
+ * import type { ICollection } from "@daiso-tech/core";
1353
1867
  *
1354
- * const collection = new ListCollection([1, 2, 3, 4]);
1355
- * collection.afterOr(() => -1, item => item === 4);
1356
- * // -1
1868
+ * // Assume the inputed collection is empty.
1869
+ * function main(collection: ICollection<number>): void {
1870
+ * collection
1871
+ * .apppend([1, 2, 3, 4])
1872
+ * .afterOr(() => -1, item => item === 4);
1873
+ * // -1
1874
+ * }
1357
1875
  * ```
1358
1876
  */
1359
1877
  afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
@@ -1363,19 +1881,27 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1363
1881
  * @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
1364
1882
  * @example
1365
1883
  * ```ts
1366
- * import { ListCollection } from "@daiso-tech/core";;
1884
+ * import type { ICollection } from "@daiso-tech/core";
1367
1885
  *
1368
- * const collection = new ListCollection([1, 2, 3, 4]);
1369
- * collection.afterOrFail(item => item === 2);
1370
- * // 3
1886
+ * // Assume the inputed collection is empty.
1887
+ * function main(collection: ICollection<number>): void {
1888
+ * collection
1889
+ * .apppend([1, 2, 3, 4])
1890
+ * .afterOrFail(item => item === 2);
1891
+ * // 3
1892
+ * }
1371
1893
  * ```
1372
1894
  * @example
1373
1895
  * ```ts
1374
- * import { ListCollection } from "@daiso-tech/core";;
1896
+ * import type { ICollection } from "@daiso-tech/core";
1375
1897
  *
1376
- * const collection = new ListCollection([1, 2, 3, 4]);
1377
- * collection.afterOrFail(item => item === 4);
1378
- * // error is thrown
1898
+ * // Assume the inputed collection is empty.
1899
+ * function main(collection: ICollection<number>): void {
1900
+ * collection
1901
+ * .apppend([1, 2, 3, 4])
1902
+ * .afterOrFail(item => item === 4);
1903
+ * // error is thrown
1904
+ * }
1379
1905
  * ```
1380
1906
  */
1381
1907
  afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
@@ -1386,27 +1912,39 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1386
1912
  * @throws {MultipleItemsFoundCollectionError} {@link MultipleItemsFoundCollectionError}
1387
1913
  * @example
1388
1914
  * ```ts
1389
- * import { ListCollection } from "@daiso-tech/core";;
1915
+ * import type { ICollection } from "@daiso-tech/core";
1390
1916
  *
1391
- * const collection = new ListCollection([1, 2, 3, 4, 5]);
1392
- * collection.sole(item => item === 4);
1393
- * // 4
1917
+ * // Assume the inputed collection is empty.
1918
+ * function main(collection: ICollection<number>): void {
1919
+ * collection
1920
+ * .apppend([1, 2, 3, 4, 5])
1921
+ * .sole(item => item === 4);
1922
+ * // 4
1923
+ * }
1394
1924
  * ```
1395
1925
  * @example
1396
1926
  * ```ts
1397
- * import { ListCollection } from "@daiso-tech/core";;
1927
+ * import type { ICollection } from "@daiso-tech/core";
1398
1928
  *
1399
- * const collection = new ListCollection([1, 2, 3, 4, 4, 5]);
1400
- * collection.sole(item => item === 4);
1401
- * // error is thrown
1929
+ * // Assume the inputed collection is empty.
1930
+ * function main(collection: ICollection<number>): void {
1931
+ * collection
1932
+ * .apppend([1, 2, 3, 4, 4, 5])
1933
+ * .sole(item => item === 4);
1934
+ * // error is thrown
1935
+ * }
1402
1936
  * ```
1403
1937
  * @example
1404
1938
  * ```ts
1405
- * import { ListCollection } from "@daiso-tech/core";;
1939
+ * import type { ICollection } from "@daiso-tech/core";
1406
1940
  *
1407
- * const collection = new ListCollection([1, 2, 3, 5]);
1408
- * collection.sole(item => item === 4);
1409
- * // error is thrown
1941
+ * // Assume the inputed collection is empty.
1942
+ * function main(collection: ICollection<number>): void {
1943
+ * collection
1944
+ * .apppend([1, 2, 3, 5])
1945
+ * .sole(item => item === 4);
1946
+ * // error is thrown
1947
+ * }
1410
1948
  * ```
1411
1949
  */
1412
1950
  sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
@@ -1414,11 +1952,16 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1414
1952
  * The <i>nth</i> method creates a new collection consisting of every n-th item.
1415
1953
  * @example
1416
1954
  * ```ts
1417
- * import { ListCollection } from "@daiso-tech/core";;
1955
+ * import type { ICollection } from "@daiso-tech/core";
1418
1956
  *
1419
- * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]).nth(4);
1420
- * collection.toArray();
1421
- * // ["a", "e"]
1957
+ * // Assume the inputed collection is empty.
1958
+ * function main(collection: ICollection<string>): void {
1959
+ * collection
1960
+ * .apppend(["a", "b", "c", "d", "e", "f"])
1961
+ * .nth(4)
1962
+ * .toArray();
1963
+ * // ["a", "e"]
1964
+ * }
1422
1965
  * ```
1423
1966
  */
1424
1967
  nth(step: number): ICollection<TInput>;
@@ -1426,11 +1969,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1426
1969
  * The <i>count</i> method returns the total number of items in the collection that passes <i>predicateFn</i>.
1427
1970
  * @example
1428
1971
  * ```ts
1429
- * import { ListCollection } from "@daiso-tech/core";;
1972
+ * import type { ICollection } from "@daiso-tech/core";
1430
1973
  *
1431
- * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
1432
- * collection.count(value => value % 2 === 0);
1433
- * // 3
1974
+ * // Assume the inputed collection is empty.
1975
+ * function main(collection: ICollection<number>): void {
1976
+ * collection
1977
+ * .apppend([1, 2, 3, 4, 5, 6])
1978
+ * .count(value => value % 2 === 0);
1979
+ * // 3
1980
+ * }
1434
1981
  * ```
1435
1982
  */
1436
1983
  count(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
@@ -1450,11 +1997,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1450
1997
  * The <i>searchFirst</i> return the index of the first item that matches <i>predicateFn</i>.
1451
1998
  * @example
1452
1999
  * ```ts
1453
- * import { ListCollection } from "@daiso-tech/core";;
2000
+ * import type { ICollection } from "@daiso-tech/core";
1454
2001
  *
1455
- * const collection = new ListCollection(["a", "b", "b", "c"]);
1456
- * collection.searchFirst(item => item === "b");
1457
- * // 1
2002
+ * // Assume the inputed collection is empty.
2003
+ * function main(collection: ICollection<string>): void {
2004
+ * collection
2005
+ * .apppend(["a", "b", "b", "c"])
2006
+ * .searchFirst(item => item === "b");
2007
+ * // 1
2008
+ * }
1458
2009
  * ```
1459
2010
  */
1460
2011
  searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
@@ -1462,11 +2013,15 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1462
2013
  * The <i>searchLast</i> return the index of the last item that matches <i>predicateFn</i>.
1463
2014
  * @example
1464
2015
  * ```ts
1465
- * import { ListCollection } from "@daiso-tech/core";;
2016
+ * import type { ICollection } from "@daiso-tech/core";
1466
2017
  *
1467
- * const collection = new ListCollection(["a", "b", "b", "c"]);
1468
- * collection.searchLast(item => item === "b");
1469
- * // 2
2018
+ * // Assume the inputed collection is empty.
2019
+ * function main(collection: ICollection<string>): void {
2020
+ * collection
2021
+ * .apppend(["a", "b", "b", "c"])
2022
+ * .searchLast(item => item === "b");
2023
+ * // 2
2024
+ * }
1470
2025
  * ```
1471
2026
  */
1472
2027
  searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
@@ -1480,11 +2035,13 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & {
1480
2035
  toArray(): TInput[];
1481
2036
  /**
1482
2037
  * The <i>toRecord</i> method converts the collection to a new <i>{@link Record}</i>.
2038
+ * An error will be thrown if item is not a tuple of size 2 where the first element is a string or a number.
1483
2039
  * @throws {TypeCollectionError} {@link TypeCollectionError}
1484
2040
  */
1485
2041
  toRecord(): EnsureRecord<TInput>;
1486
2042
  /**
1487
2043
  * The <i>toMap</i> method converts the collection to a new <i>{@link Map}</i>.
2044
+ * An error will be thrown if item is not a tuple of size 2.
1488
2045
  * @throws {TypeCollectionError} {@link TypeCollectionError}
1489
2046
  */
1490
2047
  toMap(): EnsureMap<TInput>;