@daiso-tech/core 0.1.0 → 0.1.1

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 (422) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/_module.js +19 -0
  3. package/dist/cjs/_module.js.map +1 -0
  4. package/dist/cjs/collection/_module.js +21 -0
  5. package/dist/cjs/collection/_module.js.map +1 -0
  6. package/dist/cjs/collection/_shared.js +28 -0
  7. package/dist/cjs/collection/_shared.js.map +1 -0
  8. package/dist/cjs/collection/async-iterable-collection/_module.js +18 -0
  9. package/dist/cjs/collection/async-iterable-collection/_module.js.map +1 -0
  10. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +678 -0
  11. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -0
  12. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/_module.js +52 -0
  13. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/_module.js.map +1 -0
  14. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js +25 -0
  15. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js.map +1 -0
  16. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js +43 -0
  17. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js.map +1 -0
  18. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js +43 -0
  19. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js.map +1 -0
  20. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js +32 -0
  21. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js.map +1 -0
  22. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js +39 -0
  23. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js.map +1 -0
  24. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js +43 -0
  25. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js.map +1 -0
  26. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js +19 -0
  27. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +1 -0
  28. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js +24 -0
  29. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js.map +1 -0
  30. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js +32 -0
  31. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js.map +1 -0
  32. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js +30 -0
  33. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js.map +1 -0
  34. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js +30 -0
  35. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js.map +1 -0
  36. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js +43 -0
  37. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js.map +1 -0
  38. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js +43 -0
  39. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js.map +1 -0
  40. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js +30 -0
  41. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js.map +1 -0
  42. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js +27 -0
  43. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js.map +1 -0
  44. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js +34 -0
  45. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js.map +1 -0
  46. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js +34 -0
  47. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js.map +1 -0
  48. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js +45 -0
  49. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js.map +1 -0
  50. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js +32 -0
  51. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js.map +1 -0
  52. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js +28 -0
  53. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js.map +1 -0
  54. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js +25 -0
  55. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js.map +1 -0
  56. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js +33 -0
  57. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js.map +1 -0
  58. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js +41 -0
  59. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js.map +1 -0
  60. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js +36 -0
  61. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js.map +1 -0
  62. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js +45 -0
  63. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js.map +1 -0
  64. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js +16 -0
  65. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js.map +1 -0
  66. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js +49 -0
  67. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js.map +1 -0
  68. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js +33 -0
  69. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js.map +1 -0
  70. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js +33 -0
  71. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js.map +1 -0
  72. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js +27 -0
  73. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js.map +1 -0
  74. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js +21 -0
  75. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js.map +1 -0
  76. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js +35 -0
  77. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js.map +1 -0
  78. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js +37 -0
  79. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js.map +1 -0
  80. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js +32 -0
  81. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js.map +1 -0
  82. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js +37 -0
  83. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js.map +1 -0
  84. package/dist/cjs/collection/iterable-collection/_module.js +18 -0
  85. package/dist/cjs/collection/iterable-collection/_module.js.map +1 -0
  86. package/dist/cjs/collection/iterable-collection/iterable-collection.js +758 -0
  87. package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -0
  88. package/dist/cjs/collection/iterable-collection/iterable-helpers/_module.js +49 -0
  89. package/dist/cjs/collection/iterable-collection/iterable-helpers/_module.js.map +1 -0
  90. package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-iterable.js +43 -0
  91. package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-iterable.js.map +1 -0
  92. package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js +43 -0
  93. package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js.map +1 -0
  94. package/dist/cjs/collection/iterable-collection/iterable-helpers/collapse-iterable.js +32 -0
  95. package/dist/cjs/collection/iterable-collection/iterable-helpers/collapse-iterable.js.map +1 -0
  96. package/dist/cjs/collection/iterable-collection/iterable-helpers/count-by-iterable.js +39 -0
  97. package/dist/cjs/collection/iterable-collection/iterable-helpers/count-by-iterable.js.map +1 -0
  98. package/dist/cjs/collection/iterable-collection/iterable-helpers/cross-join-iterable.js +43 -0
  99. package/dist/cjs/collection/iterable-collection/iterable-helpers/cross-join-iterable.js.map +1 -0
  100. package/dist/cjs/collection/iterable-collection/iterable-helpers/entries-iterable.js +34 -0
  101. package/dist/cjs/collection/iterable-collection/iterable-helpers/entries-iterable.js.map +1 -0
  102. package/dist/cjs/collection/iterable-collection/iterable-helpers/filter-iterable.js +32 -0
  103. package/dist/cjs/collection/iterable-collection/iterable-helpers/filter-iterable.js.map +1 -0
  104. package/dist/cjs/collection/iterable-collection/iterable-helpers/flat-map-iterable.js +30 -0
  105. package/dist/cjs/collection/iterable-collection/iterable-helpers/flat-map-iterable.js.map +1 -0
  106. package/dist/cjs/collection/iterable-collection/iterable-helpers/group-by-iterable.js +40 -0
  107. package/dist/cjs/collection/iterable-collection/iterable-helpers/group-by-iterable.js.map +1 -0
  108. package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-after-iterable.js +37 -0
  109. package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-after-iterable.js.map +1 -0
  110. package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-before-iterable.js +37 -0
  111. package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-before-iterable.js.map +1 -0
  112. package/dist/cjs/collection/iterable-collection/iterable-helpers/map-iterable.js +30 -0
  113. package/dist/cjs/collection/iterable-collection/iterable-helpers/map-iterable.js.map +1 -0
  114. package/dist/cjs/collection/iterable-collection/iterable-helpers/merge-iterable.js +27 -0
  115. package/dist/cjs/collection/iterable-collection/iterable-helpers/merge-iterable.js.map +1 -0
  116. package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-end-iterable.js +44 -0
  117. package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-end-iterable.js.map +1 -0
  118. package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-start-iterable.js +44 -0
  119. package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-start-iterable.js.map +1 -0
  120. package/dist/cjs/collection/iterable-collection/iterable-helpers/partion-iterable.js +40 -0
  121. package/dist/cjs/collection/iterable-collection/iterable-helpers/partion-iterable.js.map +1 -0
  122. package/dist/cjs/collection/iterable-collection/iterable-helpers/repeat-iterable.js +32 -0
  123. package/dist/cjs/collection/iterable-collection/iterable-helpers/repeat-iterable.js.map +1 -0
  124. package/dist/cjs/collection/iterable-collection/iterable-helpers/reverse-iterable.js +38 -0
  125. package/dist/cjs/collection/iterable-collection/iterable-helpers/reverse-iterable.js.map +1 -0
  126. package/dist/cjs/collection/iterable-collection/iterable-helpers/shuffle-iterable.js +35 -0
  127. package/dist/cjs/collection/iterable-collection/iterable-helpers/shuffle-iterable.js.map +1 -0
  128. package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-iterable.js +32 -0
  129. package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-iterable.js.map +1 -0
  130. package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-until-iterable.js +36 -0
  131. package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-until-iterable.js.map +1 -0
  132. package/dist/cjs/collection/iterable-collection/iterable-helpers/slice-iterable.js +46 -0
  133. package/dist/cjs/collection/iterable-collection/iterable-helpers/slice-iterable.js.map +1 -0
  134. package/dist/cjs/collection/iterable-collection/iterable-helpers/sliding-iterable.js +45 -0
  135. package/dist/cjs/collection/iterable-collection/iterable-helpers/sliding-iterable.js.map +1 -0
  136. package/dist/cjs/collection/iterable-collection/iterable-helpers/sort-iterable.js +26 -0
  137. package/dist/cjs/collection/iterable-collection/iterable-helpers/sort-iterable.js.map +1 -0
  138. package/dist/cjs/collection/iterable-collection/iterable-helpers/split-iterable.js +49 -0
  139. package/dist/cjs/collection/iterable-collection/iterable-helpers/split-iterable.js.map +1 -0
  140. package/dist/cjs/collection/iterable-collection/iterable-helpers/take-iterable.js +32 -0
  141. package/dist/cjs/collection/iterable-collection/iterable-helpers/take-iterable.js.map +1 -0
  142. package/dist/cjs/collection/iterable-collection/iterable-helpers/take-until-iterable.js +33 -0
  143. package/dist/cjs/collection/iterable-collection/iterable-helpers/take-until-iterable.js.map +1 -0
  144. package/dist/cjs/collection/iterable-collection/iterable-helpers/tap-iterable.js +27 -0
  145. package/dist/cjs/collection/iterable-collection/iterable-helpers/tap-iterable.js.map +1 -0
  146. package/dist/cjs/collection/iterable-collection/iterable-helpers/unique-iterable.js +35 -0
  147. package/dist/cjs/collection/iterable-collection/iterable-helpers/unique-iterable.js.map +1 -0
  148. package/dist/cjs/collection/iterable-collection/iterable-helpers/update-iterable.js +37 -0
  149. package/dist/cjs/collection/iterable-collection/iterable-helpers/update-iterable.js.map +1 -0
  150. package/dist/cjs/collection/iterable-collection/iterable-helpers/when-iterable.js +32 -0
  151. package/dist/cjs/collection/iterable-collection/iterable-helpers/when-iterable.js.map +1 -0
  152. package/dist/cjs/collection/iterable-collection/iterable-helpers/zip-iterable.js +33 -0
  153. package/dist/cjs/collection/iterable-collection/iterable-helpers/zip-iterable.js.map +1 -0
  154. package/dist/cjs/collection/list-collection/_module.js +18 -0
  155. package/dist/cjs/collection/list-collection/_module.js.map +1 -0
  156. package/dist/cjs/collection/list-collection/list-collection.js +1264 -0
  157. package/dist/cjs/collection/list-collection/list-collection.js.map +1 -0
  158. package/dist/cjs/contracts/_module.js +18 -0
  159. package/dist/cjs/contracts/_module.js.map +1 -0
  160. package/dist/cjs/contracts/collection/_module.js +20 -0
  161. package/dist/cjs/contracts/collection/_module.js.map +1 -0
  162. package/dist/cjs/contracts/collection/_shared.js +39 -0
  163. package/dist/cjs/contracts/collection/_shared.js.map +1 -0
  164. package/dist/cjs/contracts/collection/async-collection.contract.js +3 -0
  165. package/dist/cjs/contracts/collection/async-collection.contract.js.map +1 -0
  166. package/dist/cjs/contracts/collection/collection.contract.js +3 -0
  167. package/dist/cjs/contracts/collection/collection.contract.js.map +1 -0
  168. package/dist/cjs/types.js +3 -0
  169. package/dist/cjs/types.js.map +1 -0
  170. package/dist/esm/_module.js +3 -0
  171. package/dist/esm/_module.js.map +1 -0
  172. package/dist/esm/collection/_module.js +5 -0
  173. package/dist/esm/collection/_module.js.map +1 -0
  174. package/dist/esm/collection/_shared.js +23 -0
  175. package/dist/esm/collection/_shared.js.map +1 -0
  176. package/dist/esm/collection/async-iterable-collection/_module.js +2 -0
  177. package/dist/esm/collection/async-iterable-collection/_module.js.map +1 -0
  178. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +674 -0
  179. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -0
  180. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/_module.js +36 -0
  181. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/_module.js.map +1 -0
  182. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js +21 -0
  183. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js.map +1 -0
  184. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js +39 -0
  185. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js.map +1 -0
  186. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js +39 -0
  187. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js.map +1 -0
  188. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js +28 -0
  189. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js.map +1 -0
  190. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js +35 -0
  191. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js.map +1 -0
  192. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js +39 -0
  193. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js.map +1 -0
  194. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js +15 -0
  195. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +1 -0
  196. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js +20 -0
  197. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js.map +1 -0
  198. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js +28 -0
  199. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js.map +1 -0
  200. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js +26 -0
  201. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js.map +1 -0
  202. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js +26 -0
  203. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js.map +1 -0
  204. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js +39 -0
  205. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js.map +1 -0
  206. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js +39 -0
  207. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js.map +1 -0
  208. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js +26 -0
  209. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js.map +1 -0
  210. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js +23 -0
  211. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js.map +1 -0
  212. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js +30 -0
  213. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js.map +1 -0
  214. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js +30 -0
  215. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js.map +1 -0
  216. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js +41 -0
  217. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js.map +1 -0
  218. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js +28 -0
  219. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js.map +1 -0
  220. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js +24 -0
  221. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js.map +1 -0
  222. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js +21 -0
  223. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js.map +1 -0
  224. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js +29 -0
  225. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js.map +1 -0
  226. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js +37 -0
  227. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js.map +1 -0
  228. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js +32 -0
  229. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js.map +1 -0
  230. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js +41 -0
  231. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js.map +1 -0
  232. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js +12 -0
  233. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js.map +1 -0
  234. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js +45 -0
  235. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js.map +1 -0
  236. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js +29 -0
  237. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js.map +1 -0
  238. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js +29 -0
  239. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js.map +1 -0
  240. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js +23 -0
  241. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js.map +1 -0
  242. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js +17 -0
  243. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js.map +1 -0
  244. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js +31 -0
  245. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js.map +1 -0
  246. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js +33 -0
  247. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js.map +1 -0
  248. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js +28 -0
  249. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js.map +1 -0
  250. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js +33 -0
  251. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js.map +1 -0
  252. package/dist/esm/collection/iterable-collection/_module.js +2 -0
  253. package/dist/esm/collection/iterable-collection/_module.js.map +1 -0
  254. package/dist/esm/collection/iterable-collection/iterable-collection.js +754 -0
  255. package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -0
  256. package/dist/esm/collection/iterable-collection/iterable-helpers/_module.js +33 -0
  257. package/dist/esm/collection/iterable-collection/iterable-helpers/_module.js.map +1 -0
  258. package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-iterable.js +39 -0
  259. package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-iterable.js.map +1 -0
  260. package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js +39 -0
  261. package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js.map +1 -0
  262. package/dist/esm/collection/iterable-collection/iterable-helpers/collapse-iterable.js +28 -0
  263. package/dist/esm/collection/iterable-collection/iterable-helpers/collapse-iterable.js.map +1 -0
  264. package/dist/esm/collection/iterable-collection/iterable-helpers/count-by-iterable.js +35 -0
  265. package/dist/esm/collection/iterable-collection/iterable-helpers/count-by-iterable.js.map +1 -0
  266. package/dist/esm/collection/iterable-collection/iterable-helpers/cross-join-iterable.js +39 -0
  267. package/dist/esm/collection/iterable-collection/iterable-helpers/cross-join-iterable.js.map +1 -0
  268. package/dist/esm/collection/iterable-collection/iterable-helpers/entries-iterable.js +30 -0
  269. package/dist/esm/collection/iterable-collection/iterable-helpers/entries-iterable.js.map +1 -0
  270. package/dist/esm/collection/iterable-collection/iterable-helpers/filter-iterable.js +28 -0
  271. package/dist/esm/collection/iterable-collection/iterable-helpers/filter-iterable.js.map +1 -0
  272. package/dist/esm/collection/iterable-collection/iterable-helpers/flat-map-iterable.js +26 -0
  273. package/dist/esm/collection/iterable-collection/iterable-helpers/flat-map-iterable.js.map +1 -0
  274. package/dist/esm/collection/iterable-collection/iterable-helpers/group-by-iterable.js +36 -0
  275. package/dist/esm/collection/iterable-collection/iterable-helpers/group-by-iterable.js.map +1 -0
  276. package/dist/esm/collection/iterable-collection/iterable-helpers/insert-after-iterable.js +33 -0
  277. package/dist/esm/collection/iterable-collection/iterable-helpers/insert-after-iterable.js.map +1 -0
  278. package/dist/esm/collection/iterable-collection/iterable-helpers/insert-before-iterable.js +33 -0
  279. package/dist/esm/collection/iterable-collection/iterable-helpers/insert-before-iterable.js.map +1 -0
  280. package/dist/esm/collection/iterable-collection/iterable-helpers/map-iterable.js +26 -0
  281. package/dist/esm/collection/iterable-collection/iterable-helpers/map-iterable.js.map +1 -0
  282. package/dist/esm/collection/iterable-collection/iterable-helpers/merge-iterable.js +23 -0
  283. package/dist/esm/collection/iterable-collection/iterable-helpers/merge-iterable.js.map +1 -0
  284. package/dist/esm/collection/iterable-collection/iterable-helpers/pad-end-iterable.js +40 -0
  285. package/dist/esm/collection/iterable-collection/iterable-helpers/pad-end-iterable.js.map +1 -0
  286. package/dist/esm/collection/iterable-collection/iterable-helpers/pad-start-iterable.js +40 -0
  287. package/dist/esm/collection/iterable-collection/iterable-helpers/pad-start-iterable.js.map +1 -0
  288. package/dist/esm/collection/iterable-collection/iterable-helpers/partion-iterable.js +36 -0
  289. package/dist/esm/collection/iterable-collection/iterable-helpers/partion-iterable.js.map +1 -0
  290. package/dist/esm/collection/iterable-collection/iterable-helpers/repeat-iterable.js +28 -0
  291. package/dist/esm/collection/iterable-collection/iterable-helpers/repeat-iterable.js.map +1 -0
  292. package/dist/esm/collection/iterable-collection/iterable-helpers/reverse-iterable.js +34 -0
  293. package/dist/esm/collection/iterable-collection/iterable-helpers/reverse-iterable.js.map +1 -0
  294. package/dist/esm/collection/iterable-collection/iterable-helpers/shuffle-iterable.js +31 -0
  295. package/dist/esm/collection/iterable-collection/iterable-helpers/shuffle-iterable.js.map +1 -0
  296. package/dist/esm/collection/iterable-collection/iterable-helpers/skip-iterable.js +28 -0
  297. package/dist/esm/collection/iterable-collection/iterable-helpers/skip-iterable.js.map +1 -0
  298. package/dist/esm/collection/iterable-collection/iterable-helpers/skip-until-iterable.js +32 -0
  299. package/dist/esm/collection/iterable-collection/iterable-helpers/skip-until-iterable.js.map +1 -0
  300. package/dist/esm/collection/iterable-collection/iterable-helpers/slice-iterable.js +42 -0
  301. package/dist/esm/collection/iterable-collection/iterable-helpers/slice-iterable.js.map +1 -0
  302. package/dist/esm/collection/iterable-collection/iterable-helpers/sliding-iterable.js +41 -0
  303. package/dist/esm/collection/iterable-collection/iterable-helpers/sliding-iterable.js.map +1 -0
  304. package/dist/esm/collection/iterable-collection/iterable-helpers/sort-iterable.js +22 -0
  305. package/dist/esm/collection/iterable-collection/iterable-helpers/sort-iterable.js.map +1 -0
  306. package/dist/esm/collection/iterable-collection/iterable-helpers/split-iterable.js +45 -0
  307. package/dist/esm/collection/iterable-collection/iterable-helpers/split-iterable.js.map +1 -0
  308. package/dist/esm/collection/iterable-collection/iterable-helpers/take-iterable.js +28 -0
  309. package/dist/esm/collection/iterable-collection/iterable-helpers/take-iterable.js.map +1 -0
  310. package/dist/esm/collection/iterable-collection/iterable-helpers/take-until-iterable.js +29 -0
  311. package/dist/esm/collection/iterable-collection/iterable-helpers/take-until-iterable.js.map +1 -0
  312. package/dist/esm/collection/iterable-collection/iterable-helpers/tap-iterable.js +23 -0
  313. package/dist/esm/collection/iterable-collection/iterable-helpers/tap-iterable.js.map +1 -0
  314. package/dist/esm/collection/iterable-collection/iterable-helpers/unique-iterable.js +31 -0
  315. package/dist/esm/collection/iterable-collection/iterable-helpers/unique-iterable.js.map +1 -0
  316. package/dist/esm/collection/iterable-collection/iterable-helpers/update-iterable.js +33 -0
  317. package/dist/esm/collection/iterable-collection/iterable-helpers/update-iterable.js.map +1 -0
  318. package/dist/esm/collection/iterable-collection/iterable-helpers/when-iterable.js +28 -0
  319. package/dist/esm/collection/iterable-collection/iterable-helpers/when-iterable.js.map +1 -0
  320. package/dist/esm/collection/iterable-collection/iterable-helpers/zip-iterable.js +29 -0
  321. package/dist/esm/collection/iterable-collection/iterable-helpers/zip-iterable.js.map +1 -0
  322. package/dist/esm/collection/list-collection/_module.js +2 -0
  323. package/dist/esm/collection/list-collection/_module.js.map +1 -0
  324. package/dist/esm/collection/list-collection/list-collection.js +1260 -0
  325. package/dist/esm/collection/list-collection/list-collection.js.map +1 -0
  326. package/dist/esm/contracts/_module.js +2 -0
  327. package/dist/esm/contracts/_module.js.map +1 -0
  328. package/dist/esm/contracts/collection/_module.js +4 -0
  329. package/dist/esm/contracts/collection/_module.js.map +1 -0
  330. package/dist/esm/contracts/collection/_shared.js +31 -0
  331. package/dist/esm/contracts/collection/_shared.js.map +1 -0
  332. package/dist/esm/contracts/collection/async-collection.contract.js +1 -0
  333. package/dist/esm/contracts/collection/async-collection.contract.js.map +1 -0
  334. package/dist/esm/contracts/collection/collection.contract.js +1 -0
  335. package/dist/esm/contracts/collection/collection.contract.js.map +1 -0
  336. package/dist/esm/types.js +1 -0
  337. package/dist/esm/types.js.map +1 -0
  338. package/dist/types/_module.d.ts +2 -0
  339. package/dist/types/collection/_module.d.ts +4 -0
  340. package/dist/types/collection/_shared.d.ts +16 -0
  341. package/dist/types/collection/async-iterable-collection/_module.d.ts +1 -0
  342. package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +92 -0
  343. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/_module.d.ts +35 -0
  344. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.d.ts +10 -0
  345. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.d.ts +11 -0
  346. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.d.ts +12 -0
  347. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.d.ts +9 -0
  348. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.d.ts +11 -0
  349. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.d.ts +11 -0
  350. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.d.ts +10 -0
  351. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.d.ts +11 -0
  352. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.d.ts +11 -0
  353. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.d.ts +11 -0
  354. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.d.ts +12 -0
  355. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.d.ts +12 -0
  356. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.d.ts +12 -0
  357. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.d.ts +11 -0
  358. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.d.ts +10 -0
  359. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.d.ts +12 -0
  360. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.d.ts +12 -0
  361. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.d.ts +12 -0
  362. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.d.ts +11 -0
  363. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.d.ts +12 -0
  364. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.d.ts +9 -0
  365. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.d.ts +11 -0
  366. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.d.ts +11 -0
  367. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.d.ts +12 -0
  368. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.d.ts +12 -0
  369. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.d.ts +10 -0
  370. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.d.ts +12 -0
  371. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.d.ts +11 -0
  372. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.d.ts +11 -0
  373. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.d.ts +10 -0
  374. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.d.ts +10 -0
  375. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.d.ts +11 -0
  376. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.d.ts +12 -0
  377. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.d.ts +11 -0
  378. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.d.ts +10 -0
  379. package/dist/types/collection/iterable-collection/_module.d.ts +1 -0
  380. package/dist/types/collection/iterable-collection/iterable-collection.d.ts +89 -0
  381. package/dist/types/collection/iterable-collection/iterable-helpers/_module.d.ts +32 -0
  382. package/dist/types/collection/iterable-collection/iterable-helpers/chunk-iterable.d.ts +8 -0
  383. package/dist/types/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.d.ts +9 -0
  384. package/dist/types/collection/iterable-collection/iterable-helpers/collapse-iterable.d.ts +6 -0
  385. package/dist/types/collection/iterable-collection/iterable-helpers/count-by-iterable.d.ts +8 -0
  386. package/dist/types/collection/iterable-collection/iterable-helpers/cross-join-iterable.d.ts +8 -0
  387. package/dist/types/collection/iterable-collection/iterable-helpers/entries-iterable.d.ts +7 -0
  388. package/dist/types/collection/iterable-collection/iterable-helpers/filter-iterable.d.ts +8 -0
  389. package/dist/types/collection/iterable-collection/iterable-helpers/flat-map-iterable.d.ts +8 -0
  390. package/dist/types/collection/iterable-collection/iterable-helpers/group-by-iterable.d.ts +9 -0
  391. package/dist/types/collection/iterable-collection/iterable-helpers/insert-after-iterable.d.ts +9 -0
  392. package/dist/types/collection/iterable-collection/iterable-helpers/insert-before-iterable.d.ts +9 -0
  393. package/dist/types/collection/iterable-collection/iterable-helpers/map-iterable.d.ts +8 -0
  394. package/dist/types/collection/iterable-collection/iterable-helpers/merge-iterable.d.ts +6 -0
  395. package/dist/types/collection/iterable-collection/iterable-helpers/pad-end-iterable.d.ts +9 -0
  396. package/dist/types/collection/iterable-collection/iterable-helpers/pad-start-iterable.d.ts +9 -0
  397. package/dist/types/collection/iterable-collection/iterable-helpers/partion-iterable.d.ts +9 -0
  398. package/dist/types/collection/iterable-collection/iterable-helpers/repeat-iterable.d.ts +8 -0
  399. package/dist/types/collection/iterable-collection/iterable-helpers/reverse-iterable.d.ts +9 -0
  400. package/dist/types/collection/iterable-collection/iterable-helpers/shuffle-iterable.d.ts +5 -0
  401. package/dist/types/collection/iterable-collection/iterable-helpers/skip-iterable.d.ts +8 -0
  402. package/dist/types/collection/iterable-collection/iterable-helpers/skip-until-iterable.d.ts +8 -0
  403. package/dist/types/collection/iterable-collection/iterable-helpers/slice-iterable.d.ts +9 -0
  404. package/dist/types/collection/iterable-collection/iterable-helpers/sliding-iterable.d.ts +9 -0
  405. package/dist/types/collection/iterable-collection/iterable-helpers/sort-iterable.d.ts +7 -0
  406. package/dist/types/collection/iterable-collection/iterable-helpers/split-iterable.d.ts +9 -0
  407. package/dist/types/collection/iterable-collection/iterable-helpers/take-iterable.d.ts +8 -0
  408. package/dist/types/collection/iterable-collection/iterable-helpers/take-until-iterable.d.ts +8 -0
  409. package/dist/types/collection/iterable-collection/iterable-helpers/tap-iterable.d.ts +7 -0
  410. package/dist/types/collection/iterable-collection/iterable-helpers/unique-iterable.d.ts +8 -0
  411. package/dist/types/collection/iterable-collection/iterable-helpers/update-iterable.d.ts +9 -0
  412. package/dist/types/collection/iterable-collection/iterable-helpers/when-iterable.d.ts +8 -0
  413. package/dist/types/collection/iterable-collection/iterable-helpers/zip-iterable.d.ts +7 -0
  414. package/dist/types/collection/list-collection/_module.d.ts +1 -0
  415. package/dist/types/collection/list-collection/list-collection.d.ts +86 -0
  416. package/dist/types/contracts/_module.d.ts +1 -0
  417. package/dist/types/contracts/collection/_module.d.ts +3 -0
  418. package/dist/types/contracts/collection/_shared.d.ts +259 -0
  419. package/dist/types/contracts/collection/async-collection.contract.d.ts +731 -0
  420. package/dist/types/contracts/collection/collection.contract.d.ts +723 -0
  421. package/dist/types/types.d.ts +1 -0
  422. package/package.json +2 -2
@@ -0,0 +1,723 @@
1
+ import { type SliceSettings, type SlidingSettings, type Comparator, type Filter, type FindOrSettings, type FindSettings, type ForEach, type GroupBySettings, type JoinSettings, type Lazyable, type Map, type Modifier, type PageSettings, type RecordItem, type ReduceSettings, type ReverseSettings, type Tap, type Transform, type UpdatedItem } from "../../contracts/collection/_shared";
2
+ import { type EnsureType } from "../../types";
3
+ /**
4
+ * @group Collections
5
+ */
6
+ export type Collapse<TValue> = TValue extends Array<infer TItem> | Iterable<infer TItem> | ICollection<infer TItem> ? TItem : TValue;
7
+ /**
8
+ * ICollection is immutable and all the methods return new copies
9
+ * @throws {CollectionError}
10
+ * @throws {UnexpectedCollectionError}
11
+ * @throws {IndexOverflowError}
12
+ * @throws {ItemNotFoundError}
13
+ * @throws {MultipleItemsFoundError}
14
+ * @throws {TypeError}
15
+ * @group Collections
16
+ */
17
+ export type ICollection<TInput> = Iterable<TInput> & {
18
+ iterator(): Iterator<TInput, void>;
19
+ entries(throwOnNumberLimit?: boolean): ICollection<RecordItem<number, TInput>>;
20
+ keys(throwOnNumberLimit?: boolean): ICollection<number>;
21
+ values(): ICollection<TInput>;
22
+ /**
23
+ * The filter method filters the collection using the given callback, keeping only those items that pass a given truth test:
24
+ * @example
25
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
26
+ * const filtered = collection.filter(item => 2 < item && item < 5);
27
+ * filtered.toArray();
28
+ * // [3, 4]
29
+ */
30
+ filter<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): ICollection<TOutput>;
31
+ /**
32
+ * The map method iterates through the collection and passes each value to the given callback.
33
+ * The mapFunction is free to modify the item and return it, thus forming a new collection of modified items:
34
+ * @example
35
+ * const collection = new ListCollection([1, 2, 3, 4, 5]);
36
+ * const mapped = collection.map(item => item * 2);
37
+ * mapped.toArray();
38
+ * // [2, 4, 6, 8, 10]
39
+ */
40
+ map<TOutput>(map: Map<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): ICollection<TOutput>;
41
+ reduce<TOutput = TInput>(settings: ReduceSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
42
+ /**
43
+ * @throws {TypeError}
44
+ */
45
+ join(settings?: JoinSettings): string;
46
+ /**
47
+ * The collapse method collapses a collection of arrays into a single, flat collection:
48
+ * @example
49
+ * const collection = new ListCollection([[1, 2], [3, 4]]);
50
+ * const collapsed = collection.collapse();
51
+ * collapsed.toArray();
52
+ * // [1, 2, 3, 4]
53
+ */
54
+ collapse(): ICollection<Collapse<TInput>>;
55
+ /**
56
+ * The flatMap method returns a new array formed by applying a given callback function to each element of the array, and then collapses the result by one level.
57
+ * It is identical to a map() followed by a collapse()
58
+ * @example
59
+ * const collection = new ListCollection([["a", "b"], ["c", "d"]]).flatMap(item => [item.length, ...item]);
60
+ * collection.toArray();
61
+ * // [2, "a", "b", 2, "c", "d"]
62
+ */
63
+ flatMap<TOutput>(map: Map<TInput, ICollection<TInput>, Iterable<TOutput>>, throwOnNumberLimit?: boolean): ICollection<TOutput>;
64
+ /**
65
+ * The update method filters the collection using the given callback, keeping only those items that pass a given truth test and thereafter updates the filtered items:
66
+ * @example
67
+ * const collection = new ListCollection([1, 2, 3, 4, 5]);
68
+ * const updateCollection = collection.update(item => item % 2 === 0, item => item * 2);
69
+ * updateCollection.toArray();
70
+ * // [1, 4, 3, 8, 5]
71
+ */
72
+ update<TFilterOutput extends TInput, TMapOutput>(filter: Filter<TInput, ICollection<TInput>, TFilterOutput>, map: Map<TFilterOutput, ICollection<TInput>, TMapOutput>, throwOnNumberLimit?: boolean): ICollection<UpdatedItem<TInput, TFilterOutput, TMapOutput>>;
73
+ /**
74
+ * The page method returns a new collection containing the items that would be present on a given page number.
75
+ * The method accepts the page number as its first argument and the number of items to show per page as its second argument:
76
+ * @example
77
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7, 8, 9]);
78
+ * const page = collection.page({
79
+ * page: 2,
80
+ * pageSize: 3
81
+ * });
82
+ * page.toArray();
83
+ * // [4, 5, 6]
84
+ */
85
+ page(settings: PageSettings): ICollection<TInput>;
86
+ /**
87
+ * The sum method returns the sum of all items in the collection. If the collection contains nested arrays or objects,
88
+ * you should pass a map function that returns a number to be used in sum calculation.
89
+ * You can only pass filter to filter out the items you want:
90
+ * @example
91
+ * const collection = new ListCollection([1, 2, 3]);
92
+ * collection.sum();
93
+ * // 6
94
+ * @throws {CollectionError} {@link CollectionError}
95
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
96
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
97
+ * @throws {TypeError} {@link TypeError}
98
+ */
99
+ sum(throwOnNumberLimit?: boolean): EnsureType<TInput, number>;
100
+ /**
101
+ * The average method returns the average of all items in the collection. If the collection contains nested arrays or objects,
102
+ * you should pass a map function that returns a number to be used in average calculation.
103
+ * You can only pass filter to filter out the items you want:
104
+ * @example
105
+ * const collection = new ListCollection([1, 2, 3]);
106
+ * collection.average();
107
+ * // 2
108
+ * @throws {CollectionError} {@link CollectionError}
109
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
110
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
111
+ * @throws {TypeError} {@link TypeError}
112
+ */
113
+ average(throwOnNumberLimit?: boolean): EnsureType<TInput, number>;
114
+ /**
115
+ * The median method returns the median of all items in the collection. If the collection contains nested arrays or objects,
116
+ * you should pass a map function that returns a number to be used in median calculation.
117
+ * You can only pass filter to filter out the items you want:
118
+ * @example
119
+ * const collection = new ListCollection([1, 2, 3]);
120
+ * collection.median();
121
+ * // 2
122
+ * @throws {CollectionError} {@link CollectionError}
123
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
124
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
125
+ * @throws {TypeError} {@link TypeError}
126
+ */
127
+ median(throwOnNumberLimit?: boolean): EnsureType<TInput, number>;
128
+ /**
129
+ * The min method returns the min of all items in the collection. If the collection contains nested arrays or objects,
130
+ * you should pass a map function that returns a number to be used in min calculation.
131
+ * You can only pass filter to filter out the items you want:
132
+ * @example
133
+ * const collection = new ListCollection([1, 2, 3]);
134
+ * collection.min();
135
+ * // 1
136
+ * @throws {CollectionError} {@link CollectionError}
137
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
138
+ * @throws {TypeError} {@link TypeError}
139
+ */
140
+ min(): EnsureType<TInput, number>;
141
+ /**
142
+ * The max method returns the max of all items in the collection. If the collection contains nested arrays or objects,
143
+ * you should pass a map function that returns a number to be used in max calculation.
144
+ * You can only pass filter to filter out the items you want:
145
+ * @example
146
+ * const collection = new ListCollection([1, 2, 3]);
147
+ * collection.max();
148
+ * // 3
149
+ * @throws {CollectionError} {@link CollectionError}
150
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
151
+ * @throws {TypeError} {@link TypeError}
152
+ */
153
+ max(): EnsureType<TInput, number>;
154
+ /**
155
+ * The percentage method may be used to quickly determine the percentage of items in the collection that pass a given truth test
156
+ * @example
157
+ * const collection = new ListCollection([1, 1, 2, 2, 2, 3]);
158
+ * collection.percentage(value => value === 1);
159
+ * // 33.333
160
+ * @throws {CollectionError} {@link CollectionError}
161
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
162
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
163
+ */
164
+ percentage(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): number;
165
+ /**
166
+ * The some method determines whether the collection has a given item.
167
+ * You must pass a closure to the some method to determine if an element exists in the collection matching a given truth test:
168
+ * @example
169
+ * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
170
+ * collection.some(item => item === 1);
171
+ * // true
172
+ * @throws {CollectionError} {@link CollectionError}
173
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
174
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
175
+ */
176
+ some<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): boolean;
177
+ /**
178
+ * The every method may be used to verify that all elements of a collection pass a given truth test:
179
+ * @example
180
+ * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
181
+ * collection.every(item => item < 6);
182
+ * // true
183
+ * @throws {CollectionError} {@link CollectionError}
184
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
185
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
186
+ */
187
+ every<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): boolean;
188
+ /**
189
+ * The take method returns items in the collection until the given callback returns true:
190
+ * @example
191
+ * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
192
+ * const chunk = collection.take(3);
193
+ * chunk.toArray();
194
+ * // [0, 1, 2]
195
+ * @example
196
+ * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
197
+ * const chunk = collection.take(-2);
198
+ * chunk.toArray();
199
+ * // [4, 5]
200
+ */
201
+ take(limit: number, throwOnNumberLimit?: boolean): ICollection<TInput>;
202
+ /**
203
+ * The takeUntil method returns items in the collection until the given callback returns true:
204
+ * @example
205
+ * const collection = new ListCollection([1, 2, 3, 4]);
206
+ * const chunk = collection.takeUntil(item => item >= 3);
207
+ * chunk.toArray();
208
+ * // [1, 2]
209
+ */
210
+ takeUntil(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
211
+ /**
212
+ * The takeWhile method returns items in the collection until the given callback returns false:
213
+ * @example
214
+ * const collection = new ListCollection([1, 2, 3, 4]);
215
+ * const chunk = collection.takeWhile(item => item < 3);
216
+ * chunk.toArray();
217
+ * // [1, 2]
218
+ */
219
+ takeWhile(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
220
+ /**
221
+ * The skip method returns a new collection, with the given number of elements removed from the beginning of the collection:
222
+ * @example
223
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).skip(4);
224
+ * collection.toArray();
225
+ * // [5, 6, 7, 8, 9, 10]
226
+ */
227
+ skip(offset: number, throwOnNumberLimit?: boolean): ICollection<TInput>;
228
+ /**
229
+ * The skipUntil method skips over items from the collection until the given callback returns true
230
+ * and then returns the remaining items in the collection as a new collection instance:
231
+ * @example
232
+ * const collection = new ListCollection([1, 2, 3, 4]).skipUntil(item => item >= 3);
233
+ * collection.toArray();
234
+ * // [3, 4]
235
+ */
236
+ skipUntil(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
237
+ /**
238
+ * The skipWhile method skips over items from the collection while the given callback returns false and then returns the remaining items in the collection as a new collection:
239
+ * @example
240
+ * const collection = new ListCollection([1, 2, 3, 4]).skipWhile(item => item <= 3);
241
+ * collection.toArray();
242
+ * // [4]
243
+ */
244
+ skipWhile(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
245
+ /**
246
+ * The when method will execute the given callback when the first argument given to the method evaluates to true:
247
+ * @example
248
+ * const collection = new ListCollection([1, 2, 3, 4])
249
+ * .when(true, collection => collection.append([-3]))
250
+ * .when(false, collection => collection.append([20]));
251
+ * collection.toArray();
252
+ * // [1, 2, 3, 4, -3]
253
+ */
254
+ when<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
255
+ /**
256
+ * The whenEmpty method will execute the given callback when the collection is empty:
257
+ * @example
258
+ * const collection = new ListCollection([])
259
+ * .whenEmpty(collection => collection.append([-3]))
260
+ * collection.toArray();
261
+ * // [-3]
262
+ * @example
263
+ * const collection = new ListCollection([1])
264
+ * .whenEmpty(collection => collection.append([-3]))
265
+ * collection.toArray();
266
+ * // [1]
267
+ */
268
+ whenEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
269
+ /**
270
+ * The whenNot method will execute the given callback when the first argument given to the method evaluates to false:
271
+ * @example
272
+ * const collection = new ListCollection([1, 2, 3, 4])
273
+ * .whenNot(true, collection => collection.append([-3]))
274
+ * .whenNot(false, collection => collection.append([20]));
275
+ * collection.toArray();
276
+ * // [1, 2, 3, 4, 20]
277
+ */
278
+ whenNot<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
279
+ /**
280
+ * The whenNotEmpty method will execute the given callback when the collection is empty:
281
+ * @example
282
+ * const collection = new ListCollection([])
283
+ * .whenNotEmpty(collection => collection.append([-3]))
284
+ * collection.toArray();
285
+ * // []
286
+ * @example
287
+ * const collection = new ListCollection([1])
288
+ * .whenNotEmpty(collection => collection.append([-3]))
289
+ * collection.toArray();
290
+ * // [1, -3]
291
+ */
292
+ whenNotEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
293
+ /**
294
+ * The pipe method passes the collection to the given closure and returns the result of the executed closure:
295
+ * @example
296
+ * const collection = new ListCollection([1, 2, 3]);
297
+ * const piped = collection.pipe(collection => collection.sum());
298
+ * // 6
299
+ */
300
+ pipe<TOutput = TInput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
301
+ /**
302
+ * The tap method passes the collection to the given callback, allowing you to "tap" into the collection at a specific point
303
+ * and do something with the items while not affecting the collection itself.The collection is then returned by the tap method:
304
+ * @example
305
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6])
306
+ * .tap(collection => {
307
+ * collection
308
+ * .filter(value => value % 2 === 0)
309
+ * .forEach(value => console.log(value))
310
+ * })
311
+ * .toArray();
312
+ * // [1, 2, 3, 4, 5, 6]
313
+ */
314
+ tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
315
+ /**
316
+ * The chunk method breaks the collection into multiple, smaller collections of a given size:
317
+ * @example
318
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7]);
319
+ * const chunks = collection.chunk(4);
320
+ * chunks.toArray();
321
+ * // [[1, 2, 3, 4], [5, 6, 7]]
322
+ */
323
+ chunk(chunkSize: number): ICollection<ICollection<TInput>>;
324
+ /**
325
+ * The chunkWhile method breaks the collection into multiple, smaller collections based on the evaluation of the given callback.
326
+ * The chunk variable passed to the closure may be used to inspect the previous element:
327
+ * @example
328
+ * const collection = new ListCollection("AABBCCCD");
329
+ * const chunks = collection.chunkWhile((value, index, chunk) => {
330
+ * return value === chunk.last();
331
+ * });
332
+ * chunks.toArray();
333
+ * // [["A", "A"], ["B", "B"], ["C", "C", "C"], ["D"]]
334
+ */
335
+ chunkWhile(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<ICollection<TInput>>;
336
+ /**
337
+ * The split method breaks a collection into the given number of groups:
338
+ * @example
339
+ * const collection = new ListCollection([1, 2, 3, 4, 5]);
340
+ * const chunks = collection.split(3);
341
+ * chunks.toArray();
342
+ * // [[1, 2], [3, 4], [5]]
343
+ */
344
+ split(chunkAmount: number, throwOnNumberLimit?: boolean): ICollection<ICollection<TInput>>;
345
+ /**
346
+ * The partition method is used to separate elements that pass a given truth test from those that do not:
347
+ * @example
348
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
349
+ * collection.partition(item => item < 3);
350
+ * // [[1, 2], [3, 4, 5, 6]]
351
+ */
352
+ partition(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<ICollection<TInput>>;
353
+ /**
354
+ * The sliding method returns a new collection of chunks representing a "sliding window" view of the items in the collection:
355
+ * @experimental
356
+ * @example
357
+ * const collection = new ListCollection([1, 2, 3, 4, 5]).sliding(2);
358
+ * collection.toArray();
359
+ * // [[1, 2], [2, 3], [3, 4], [4, 5]]
360
+ */
361
+ sliding(settings: SlidingSettings): ICollection<ICollection<TInput>>;
362
+ /**
363
+ * The groupBy method groups the collection's items by a given map function:
364
+ * @example
365
+ * const collection = new ListCollection(["a", "a", "a", "b", "b", "c"]);
366
+ * const group = collection
367
+ * .groupBy()
368
+ * .map(([key, value]) => [key, value.toArray()]);
369
+ * // [["a", ["a", "a", "a"]], ["b", ["b", "b", "b"]], ["c", ["c"]]]
370
+ * @example
371
+ * const collection = new ListCollection(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"]);
372
+ * const group = collection
373
+ * .groupBy(item => item.split("@")[1])
374
+ * .map(([key, value]) => [key, value.toArray()]);
375
+ * // [["gmail.com", ["alice@gmail.com", "carlos@gmail.com"]], ["yahoo.com", ["bob@yahoo.com"]]]
376
+ */
377
+ groupBy<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
378
+ /**
379
+ * The countBy method counts the occurrences of values in the collection.
380
+ * By default, the method counts the occurrences of every element, allowing you to count certain "types" of elements in the collection:
381
+ * @example
382
+ * const collection = new ListCollection(["a", "a", "a", "b", "b", "c"]);
383
+ * const count = collection.countBy();
384
+ * // [["a", 3], ["b", 2], ["c", 1]]
385
+ * @example
386
+ * const collection = new ListCollection(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"]);
387
+ * const count = collection.countBy(item => item.split("@")[1])
388
+ * // [["gmail.com", 2], ["yahoo.com", 1]]
389
+ */
390
+ countBy<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
391
+ /**
392
+ * The unique method removes all duplicate values from the collection:
393
+ * @example
394
+ * const collection = new ListCollection([1, 1, 2, 2, 3, 4, 2]);
395
+ * collection.unique().toArray();
396
+ * // [1, 2, 3, 4]
397
+ * @example
398
+ * const collection = new ListCollection([
399
+ * { name: "iPhone 6", brand: "Apple", type: "phone" },
400
+ * { name: "iPhone 5", brand: "Apple", type: "phone" },
401
+ * { name: "Apple Watch", brand: "Apple", type: "watch" },
402
+ * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
403
+ * { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
404
+ * ]);
405
+ * const unique = collection.unique(item => item.brand);
406
+ * unique.toArray();
407
+ * // [
408
+ * { name: "iPhone 6", brand: "Apple", type: "phone" },
409
+ * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
410
+ * ]
411
+ */
412
+ unique<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
413
+ /**
414
+ * The diff method will return the values in the original collection that are not present in the given iterable:
415
+ * @example
416
+ * const collection = new ListCollection([1, 2, 3, 4, 5]);
417
+ * const difference = collection.difference([2, 4, 6, 8]);
418
+ * difference.toArray();
419
+ * // [1, 3, 5]
420
+ */
421
+ difference<TOutput = TInput>(iterable: Iterable<TInput>, map?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
422
+ /**
423
+ * The repeat method will repat the current collection given amount
424
+ * @example
425
+ * const collection = new ListCollection([1, 2, 3]);
426
+ * const newCollection = collection.repeat(3);
427
+ * newCollection.toArray();
428
+ * // [1, 2, 3, 1, 2, 3, 1, 2, 3]
429
+ */
430
+ repeat(amount: number): ICollection<TInput>;
431
+ /**
432
+ * The padStart method pads this collection with another item (multiple times, if needed) until the resulting collection reaches the given length.
433
+ * The padding is applied from the start of this collection:
434
+ * @example
435
+ * new ListCollection("abc").padStart(10, "foo").join({ seperator: ""});
436
+ * // "foofoofabc"
437
+ *
438
+ * new ListCollection("abc").padStart(6, "123465").join({ seperator: ""});
439
+ * // "123abc"
440
+ *
441
+ * new ListCollection("abc").padStart(8, "0").join({ seperator: ""});
442
+ * // "00000abc"
443
+ *
444
+ * new ListCollection("abc").padStart(1, "_").join({ seperator: ""});
445
+ * // "abc"
446
+ */
447
+ padStart<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
448
+ /**
449
+ * The padEnd method pads this collection with another item (multiple times, if needed) until the resulting collection reaches the given length.
450
+ * The padding is applied from the end of this collection:
451
+ * @example
452
+ * new ListCollection("abc").padEnd(10, "foo").join({ seperator: ""});
453
+ * // "abcfoofoof"
454
+ *
455
+ * new ListCollection("abc").padEnd(6, "123465").join({ seperator: ""});
456
+ * // "abc123"
457
+ *
458
+ * new ListCollection("abc").padEnd(8, "0").join({ seperator: ""});
459
+ * // "abc00000"
460
+ *
461
+ * new ListCollection("abc").padEnd(1, "_").join({ seperator: ""});
462
+ * // "abc"
463
+ */
464
+ padEnd<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
465
+ /**
466
+ * The slice is the same as Array.slice method. Se documentation on mdn:
467
+ * @link {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice}
468
+ */
469
+ slice(settings?: SliceSettings): ICollection<TInput>;
470
+ /**
471
+ * The prepend method adds items to the beginning of the collection:
472
+ * @example
473
+ * const collection = new ListCollection([1, 2, 3, 4, 5]).prepend([-1, 20]);
474
+ * collection.toArray();
475
+ * // [-1, 20, 1, 2, 3, 4, 5]
476
+ */
477
+ prepend<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
478
+ /**
479
+ * The append method adds items to the end of the collection:
480
+ * @example
481
+ * const collection = new ListCollection([1, 2, 3, 4, 5]).append([-1, -2]);
482
+ * collection.toArray();
483
+ * // [1, 2, 3, 4, 5, -1, -2,]
484
+ */
485
+ append<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
486
+ /**
487
+ * The insertBefore method adds items before a specific filtered item:
488
+ * @example
489
+ * const collection = new ListCollection([1, 2, 2, 3, 4, 5]).insertBefore(item => item === 2, [-1, 20]);
490
+ * collection.toArray();
491
+ * // [1, -1, 20, 2, 2, 3, 4, 5]
492
+ */
493
+ insertBefore<TExtended = TInput>(filter: Filter<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnNumberLimit?: boolean): ICollection<TInput | TExtended>;
494
+ /**
495
+ * The insertAfter method adds items after a specific filtered item:
496
+ * @example
497
+ * const collection = new ListCollection([1, 2, 2, 3, 4, 5]).insertAfter(item => item === 2, [-1, 20]);
498
+ * collection.toArray();
499
+ * // [1, 2, -1, 20, 2, 3, 4, 5]
500
+ */
501
+ insertAfter<TExtended = TInput>(filter: Filter<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnNumberLimit?: boolean): ICollection<TInput | TExtended>;
502
+ /**
503
+ * The crossJoin method cross joins the collection's values among the given arrays or collections, returning a Cartesian product with all possible permutations:
504
+ * @example
505
+ * const collection = new ListCollection([1, 2]);
506
+ * const matrix = collection.crossJoin(["a", "b"]);
507
+ * matrix.map(collection => collection.toArray()).toArray();
508
+ * // [
509
+ * // [1, "a"],
510
+ * // [1, "b"],
511
+ * // [2, "a"],
512
+ * // [2, "b"],
513
+ * // ]
514
+ * @example
515
+ * const collection = new ListCollection([1, 2]);
516
+ * const matrix = collection.crossJoin(["a", "b"], ["I", "II"]);
517
+ * matrix.map(collection => collection.toArray()).toArray();
518
+ * // [
519
+ * // [1, "a", "I"],
520
+ * // [1, "a", "II"],
521
+ * // [1, "b", "I"],
522
+ * // [1, "b", "II"],
523
+ * // [2, "a", "I"],
524
+ * // [2, "a", "II"],
525
+ * // [2, "b", "I"],
526
+ * // [2, "b", "II"],
527
+ * // ]
528
+ */
529
+ crossJoin<TExtended = TInput>(...iterables: Array<Iterable<TExtended>>): ICollection<ICollection<TInput | TExtended>>;
530
+ /**
531
+ * The zip method merges together the values of the given array with the values of the original collection at their corresponding index:
532
+ * @example
533
+ * const collection = new ListCollection(["Chair", "Desk"]);
534
+ * const zipped = collection.zip([100, 200]);
535
+ * zipped.toArray();
536
+ * // [["Chari", 100], ["Desk", 200]]
537
+ */
538
+ zip<TExtended>(iterable: Iterable<TExtended>): ICollection<RecordItem<TInput, TExtended>>;
539
+ sort(compare?: Comparator<TInput>): ICollection<TInput>;
540
+ reverse(settings?: ReverseSettings): ICollection<TInput>;
541
+ shuffle(): ICollection<TInput>;
542
+ /**
543
+ * The first method returns the first element in the collection that passes a given truth test. By default it will get the first element:
544
+ * @example
545
+ * const collection = new ListCollection([1, 2, 3, 4]);
546
+ * collection.first({ filter: item => item > 2 });
547
+ * @throws {CollectionError} {@link CollectionError}
548
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
549
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
550
+ * // 3
551
+ */
552
+ first<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
553
+ /**
554
+ * The firstOr method is the same as first method but will return a provided default value if not found
555
+ * @throws {CollectionError} {@link CollectionError}
556
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
557
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
558
+ */
559
+ firstOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
560
+ /**
561
+ * The firstOrFail method is the same as first method but will throw an Error if not found
562
+ * @throws {CollectionError} {@link CollectionError}
563
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
564
+ * @throws {ItemNotFoundError} {@link ItemNotFoundError}
565
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
566
+ */
567
+ firstOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
568
+ /**
569
+ * The last method returns the last element in the collection that passes a given truth test. By default it will get the last element:
570
+ * @example
571
+ * const collection = new ListCollection([1, 2, 3, 4]);
572
+ * collection.last({ filter: item => item > 2 });
573
+ * // 4
574
+ * @throws {CollectionError} {@link CollectionError}
575
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
576
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
577
+ */
578
+ last<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
579
+ /**
580
+ * The lastOr method is the same as last method but will return a provided default value if not found
581
+ * @throws {CollectionError} {@link CollectionError}
582
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
583
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
584
+ */
585
+ lastOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
586
+ /**
587
+ * The lastOrFail method is the same as last method but will throw an Error if not found
588
+ * @throws {CollectionError} {@link CollectionError}
589
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
590
+ * @throws {ItemNotFoundError} {@link ItemNotFoundError}
591
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
592
+ */
593
+ lastOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
594
+ /**
595
+ * The before method is the opposite of the after method. It returns the item before the given item. null is returned if the given item is not found or is the first item:
596
+ * @example
597
+ * const collection = new ListCollection([1, 2, 3, 4]);
598
+ * collection.before(item => item === 2);
599
+ * // 1
600
+ * @example
601
+ * const collection = new ListCollection([1, 2, 3, 4]);
602
+ * collection.before(item => item === 1);
603
+ * // null
604
+ * @throws {CollectionError} {@link CollectionError}
605
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
606
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
607
+ */
608
+ before(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | null;
609
+ /**
610
+ * The beforeOr method is the same as before method but will return a provided default value if not found
611
+ * @throws {CollectionError} {@link CollectionError}
612
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
613
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
614
+ */
615
+ beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | TExtended;
616
+ /**
617
+ * The beforeOrFail method is the same as before method but will throw an Error if not found
618
+ * @throws {CollectionError} {@link CollectionError}
619
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
620
+ * @throws {ItemNotFoundError} {@link ItemNotFoundError}
621
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
622
+ */
623
+ beforeOrFail(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput;
624
+ /**
625
+ * The after method returns the item after the given item. null is returned if the given item is not found or is the last item:
626
+ * @example
627
+ * const collection = new ListCollection([1, 2, 3, 4]);
628
+ * collection.after(item => item === 2);
629
+ * // 3
630
+ * @example
631
+ * const collection = new ListCollection([1, 2, 3, 4]);
632
+ * collection.after(item => item === 4);
633
+ * // null
634
+ * @throws {CollectionError} {@link CollectionError}
635
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
636
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
637
+ */
638
+ after(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | null;
639
+ /**
640
+ * The afterOr method is the same as after method but will return a provided default value if not found
641
+ * @throws {CollectionError} {@link CollectionError}
642
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
643
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
644
+ */
645
+ afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | TExtended;
646
+ /**
647
+ * The afterOrFail method is the same as after method but will throw an Error if not found
648
+ * @throws {CollectionError} {@link CollectionError}
649
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
650
+ * @throws {ItemNotFoundError} {@link ItemNotFoundError}
651
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
652
+ */
653
+ afterOrFail(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput;
654
+ /**
655
+ * The sole method returns the first element in the collection that passes a given truth test, but only if the truth test matches exactly one element:
656
+ * @example
657
+ * const collection = new ListCollection([1, 2, 3, 4, 5]);
658
+ * collection.sole(item => item === 4);
659
+ * // 4
660
+ * @throws {CollectionError} {@link CollectionError}
661
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
662
+ * @throws {ItemNotFoundError} {@link ItemNotFoundError}
663
+ * @throws {MultipleItemsFoundError} {@link MultipleItemsFoundError}
664
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
665
+ */
666
+ sole<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): TOutput;
667
+ /**
668
+ * The nth method creates a new collection consisting of every n-th element:
669
+ * @example
670
+ * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]).nth(4);
671
+ * collection.toArray();
672
+ * // ["a", "e"]
673
+ */
674
+ nth(step: number): ICollection<TInput>;
675
+ /**
676
+ * The count method returns the total number of items in the collection:
677
+ * @example
678
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
679
+ * collection.count(value => value % 2 === 0);
680
+ * // 3
681
+ * @throws {CollectionError} {@link CollectionError}
682
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
683
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
684
+ */
685
+ count(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): number;
686
+ /**
687
+ * @throws {CollectionError} {@link CollectionError}
688
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
689
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
690
+ */
691
+ size(throwOnNumberLimit?: boolean): number;
692
+ /**
693
+ * @throws {CollectionError} {@link CollectionError}
694
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
695
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
696
+ */
697
+ empty(): boolean;
698
+ /**
699
+ * @throws {CollectionError} {@link CollectionError}
700
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
701
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
702
+ */
703
+ notEmpty(): boolean;
704
+ /**
705
+ * The search method searches the collection for the given value and returns its index if found. If the item is not found, -1 is returned:
706
+ * @throws {CollectionError} {@link CollectionError}
707
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
708
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
709
+ */
710
+ search(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): number;
711
+ /**
712
+ * @throws {CollectionError} {@link CollectionError}
713
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
714
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
715
+ */
716
+ forEach(callback: ForEach<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): void;
717
+ /**
718
+ * @throws {CollectionError} {@link CollectionError}
719
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
720
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
721
+ */
722
+ toArray(): TInput[];
723
+ };