@zengrid/core 1.0.1 → 1.0.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 (276) hide show
  1. package/dist/index.cjs.js +43 -55
  2. package/dist/index.esm.js +2 -14
  3. package/dist/package.json +5 -5
  4. package/dist/src/a11y/aria-manager.d.ts.map +1 -1
  5. package/dist/src/a11y/focus-manager.d.ts.map +1 -1
  6. package/dist/src/a11y/index.d.ts.map +1 -1
  7. package/dist/src/data/data-accessor/array-accessor.d.ts.map +1 -1
  8. package/dist/src/data/data-accessor/column-store-accessor.d.ts.map +1 -1
  9. package/dist/src/data/data-accessor/data-accessor.interface.d.ts.map +1 -1
  10. package/dist/src/data/data-accessor/index.d.ts.map +1 -1
  11. package/dist/src/data/data-accessor/sparse-matrix-accessor.d.ts.map +1 -1
  12. package/dist/src/data/data-manager.d.ts.map +1 -1
  13. package/dist/src/data/data-source.interface.d.ts.map +1 -1
  14. package/dist/src/data/grid-data-model.d.ts +2 -2
  15. package/dist/src/data/grid-data-model.d.ts.map +1 -1
  16. package/dist/src/data/index-map/index-map.d.ts.map +1 -1
  17. package/dist/src/data/index-map/index-map.interface.d.ts.map +1 -1
  18. package/dist/src/data/index-map/index.d.ts.map +1 -1
  19. package/dist/src/data/index.d.ts.map +1 -1
  20. package/dist/src/editing/cell-editor.interface.d.ts.map +1 -1
  21. package/dist/src/editing/date-editor.d.ts.map +1 -1
  22. package/dist/src/editing/editor-manager.d.ts.map +1 -1
  23. package/dist/src/editing/index.d.ts.map +1 -1
  24. package/dist/src/editing/number-editor.d.ts.map +1 -1
  25. package/dist/src/editing/select-editor.d.ts.map +1 -1
  26. package/dist/src/editing/text-editor.d.ts.map +1 -1
  27. package/dist/src/events/event-emitter.d.ts.map +1 -1
  28. package/dist/src/events/grid-events.d.ts.map +1 -1
  29. package/dist/src/events/index.d.ts.map +1 -1
  30. package/dist/src/features/autofill/autofill-manager.d.ts +1 -1
  31. package/dist/src/features/autofill/autofill-manager.d.ts.map +1 -1
  32. package/dist/src/features/autofill/index.d.ts.map +1 -1
  33. package/dist/src/features/column-resize/auto-fit-calculator.d.ts.map +1 -1
  34. package/dist/src/features/column-resize/column-resize-manager.d.ts.map +1 -1
  35. package/dist/src/features/column-resize/column-resize-manager.interface.d.ts.map +1 -1
  36. package/dist/src/features/column-resize/index.d.ts.map +1 -1
  37. package/dist/src/features/column-resize/resize-constraint-manager.d.ts.map +1 -1
  38. package/dist/src/features/column-resize/resize-handle-renderer.d.ts.map +1 -1
  39. package/dist/src/features/column-resize/resize-preview.d.ts.map +1 -1
  40. package/dist/src/features/column-resize/resize-state-manager.d.ts.map +1 -1
  41. package/dist/src/features/column-resize/resize-strategies.d.ts.map +1 -1
  42. package/dist/src/features/column-resize/resize-test-helper.d.ts.map +1 -1
  43. package/dist/src/features/column-resize/resize-zone-detector.d.ts.map +1 -1
  44. package/dist/src/features/copy-paste/clipboard-manager.d.ts.map +1 -1
  45. package/dist/src/features/copy-paste/index.d.ts.map +1 -1
  46. package/dist/src/features/filtering/adapters/adapter.interface.d.ts.map +1 -1
  47. package/dist/src/features/filtering/adapters/graphql-adapter.d.ts.map +1 -1
  48. package/dist/src/features/filtering/adapters/index.d.ts.map +1 -1
  49. package/dist/src/features/filtering/adapters/rest-adapter.d.ts.map +1 -1
  50. package/dist/src/features/filtering/adapters/sql-adapter.d.ts.map +1 -1
  51. package/dist/src/features/filtering/adapters/types.d.ts.map +1 -1
  52. package/dist/src/features/filtering/column-filter.d.ts.map +1 -1
  53. package/dist/src/features/filtering/filter-autocomplete.d.ts.map +1 -1
  54. package/dist/src/features/filtering/filter-cache.d.ts.map +1 -1
  55. package/dist/src/features/filtering/filter-compiler.d.ts.map +1 -1
  56. package/dist/src/features/filtering/filter-export-manager.d.ts.map +1 -1
  57. package/dist/src/features/filtering/filter-index-manager.d.ts +1 -1
  58. package/dist/src/features/filtering/filter-index-manager.d.ts.map +1 -1
  59. package/dist/src/features/filtering/filter-manager.d.ts +1 -1
  60. package/dist/src/features/filtering/filter-manager.d.ts.map +1 -1
  61. package/dist/src/features/filtering/filter-optimizer.d.ts.map +1 -1
  62. package/dist/src/features/filtering/filter-query-parser.d.ts.map +1 -1
  63. package/dist/src/features/filtering/index.d.ts.map +1 -1
  64. package/dist/src/features/filtering/range-filter-optimizer.d.ts.map +1 -1
  65. package/dist/src/features/filtering/substring-filter.d.ts.map +1 -1
  66. package/dist/src/features/filtering/types.d.ts.map +1 -1
  67. package/dist/src/features/formulas/formula-calculator.d.ts.map +1 -1
  68. package/dist/src/features/formulas/index.d.ts.map +1 -1
  69. package/dist/src/features/hit-testing/index.d.ts.map +1 -1
  70. package/dist/src/features/hit-testing/spatial-hit-tester.d.ts +1 -1
  71. package/dist/src/features/hit-testing/spatial-hit-tester.d.ts.map +1 -1
  72. package/dist/src/features/loading/index.d.ts.map +1 -1
  73. package/dist/src/features/loading/loading-indicator.d.ts.map +1 -1
  74. package/dist/src/features/pagination/index.d.ts.map +1 -1
  75. package/dist/src/features/pagination/paginator.d.ts.map +1 -1
  76. package/dist/src/features/selection/index.d.ts.map +1 -1
  77. package/dist/src/features/selection/selection-manager.d.ts.map +1 -1
  78. package/dist/src/features/sorting/index.d.ts.map +1 -1
  79. package/dist/src/features/sorting/row-sorter.interface.d.ts.map +1 -1
  80. package/dist/src/features/sorting/single-column-sorter.d.ts.map +1 -1
  81. package/dist/src/features/sorting/sort-manager.d.ts.map +1 -1
  82. package/dist/src/features/undo-redo/index.d.ts.map +1 -1
  83. package/dist/src/features/undo-redo/undo-redo-manager.d.ts.map +1 -1
  84. package/dist/src/grid.d.ts.map +1 -1
  85. package/dist/src/i18n/index.d.ts.map +1 -1
  86. package/dist/src/i18n/locale-manager.d.ts.map +1 -1
  87. package/dist/src/i18n/rtl-support.d.ts.map +1 -1
  88. package/dist/src/index.d.ts +4 -4
  89. package/dist/src/index.d.ts.map +1 -1
  90. package/dist/src/keyboard/index.d.ts.map +1 -1
  91. package/dist/src/keyboard/keyboard-navigator.d.ts.map +1 -1
  92. package/dist/src/rendering/cache/index.d.ts.map +1 -1
  93. package/dist/src/rendering/cache/renderer-cache.d.ts.map +1 -1
  94. package/dist/src/rendering/cache/renderer-cache.interface.d.ts.map +1 -1
  95. package/dist/src/rendering/cell-pool/cell-pool.d.ts.map +1 -1
  96. package/dist/src/rendering/cell-pool/cell-pool.interface.d.ts.map +1 -1
  97. package/dist/src/rendering/cell-pool/index.d.ts.map +1 -1
  98. package/dist/src/rendering/cell-positioner/cell-positioner.d.ts.map +1 -1
  99. package/dist/src/rendering/cell-positioner/cell-positioner.interface.d.ts.map +1 -1
  100. package/dist/src/rendering/cell-positioner/index.d.ts.map +1 -1
  101. package/dist/src/rendering/height-provider/height-provider.interface.d.ts.map +1 -1
  102. package/dist/src/rendering/height-provider/index.d.ts.map +1 -1
  103. package/dist/src/rendering/height-provider/uniform-height-provider.d.ts.map +1 -1
  104. package/dist/src/rendering/height-provider/variable-height-provider.d.ts.map +1 -1
  105. package/dist/src/rendering/renderers/advanced-cell-renderer.d.ts.map +1 -1
  106. package/dist/src/rendering/renderers/image-renderer.d.ts.map +1 -1
  107. package/dist/src/rendering/renderers/index.d.ts.map +1 -1
  108. package/dist/src/rendering/renderers/number-renderer.d.ts.map +1 -1
  109. package/dist/src/rendering/renderers/renderer-registry.d.ts.map +1 -1
  110. package/dist/src/rendering/renderers/renderer.interface.d.ts.map +1 -1
  111. package/dist/src/rendering/renderers/text-renderer.d.ts.map +1 -1
  112. package/dist/src/rendering/spatial-hit-tester.d.ts +1 -1
  113. package/dist/src/rendering/spatial-hit-tester.d.ts.map +1 -1
  114. package/dist/src/rendering/virtual-scroller/index.d.ts.map +1 -1
  115. package/dist/src/rendering/virtual-scroller/virtual-scroller.d.ts.map +1 -1
  116. package/dist/src/rendering/virtual-scroller/virtual-scroller.interface.d.ts.map +1 -1
  117. package/dist/src/rendering/width-provider/index.d.ts.map +1 -1
  118. package/dist/src/rendering/width-provider/uniform-width-provider.d.ts.map +1 -1
  119. package/dist/src/rendering/width-provider/variable-width-provider.d.ts.map +1 -1
  120. package/dist/src/rendering/width-provider/width-provider.interface.d.ts.map +1 -1
  121. package/dist/src/selection/hit-tester.d.ts.map +1 -1
  122. package/dist/src/selection/hit-tester.interface.d.ts.map +1 -1
  123. package/dist/src/selection/index.d.ts.map +1 -1
  124. package/dist/src/selection/range-utils.d.ts.map +1 -1
  125. package/dist/src/selection/range-utils.interface.d.ts.map +1 -1
  126. package/dist/src/shared/algorithms/filter/bloom-filter.d.ts +120 -0
  127. package/dist/src/shared/algorithms/filter/bloom-filter.d.ts.map +1 -0
  128. package/dist/src/shared/algorithms/filter/index.d.ts +7 -0
  129. package/dist/src/shared/algorithms/filter/index.d.ts.map +1 -0
  130. package/dist/src/shared/algorithms/graph/bfs.d.ts +71 -0
  131. package/dist/src/shared/algorithms/graph/bfs.d.ts.map +1 -0
  132. package/dist/src/shared/algorithms/graph/dfs.d.ts +62 -0
  133. package/dist/src/shared/algorithms/graph/dfs.d.ts.map +1 -0
  134. package/dist/src/shared/algorithms/graph/graph.interface.d.ts +63 -0
  135. package/dist/src/shared/algorithms/graph/graph.interface.d.ts.map +1 -0
  136. package/dist/src/shared/algorithms/graph/index.d.ts +9 -0
  137. package/dist/src/shared/algorithms/graph/index.d.ts.map +1 -0
  138. package/dist/src/shared/algorithms/index.d.ts +11 -0
  139. package/dist/src/shared/algorithms/index.d.ts.map +1 -0
  140. package/dist/src/shared/algorithms/pattern/index.d.ts +8 -0
  141. package/dist/src/shared/algorithms/pattern/index.d.ts.map +1 -0
  142. package/dist/src/shared/algorithms/pattern/sequence-detector.d.ts +62 -0
  143. package/dist/src/shared/algorithms/pattern/sequence-detector.d.ts.map +1 -0
  144. package/dist/src/shared/algorithms/search/binary-search.d.ts +86 -0
  145. package/dist/src/shared/algorithms/search/binary-search.d.ts.map +1 -0
  146. package/dist/src/shared/algorithms/search/index.d.ts +6 -0
  147. package/dist/src/shared/algorithms/search/index.d.ts.map +1 -0
  148. package/dist/src/shared/algorithms/sorting/comparators.d.ts +126 -0
  149. package/dist/src/shared/algorithms/sorting/comparators.d.ts.map +1 -0
  150. package/dist/src/shared/algorithms/sorting/index.d.ts +9 -0
  151. package/dist/src/shared/algorithms/sorting/index.d.ts.map +1 -0
  152. package/dist/src/shared/algorithms/sorting/sorting.interface.d.ts +38 -0
  153. package/dist/src/shared/algorithms/sorting/sorting.interface.d.ts.map +1 -0
  154. package/dist/src/shared/algorithms/sorting/timsort.d.ts +55 -0
  155. package/dist/src/shared/algorithms/sorting/timsort.d.ts.map +1 -0
  156. package/dist/src/shared/data-structures/column-store/column-store.d.ts +52 -0
  157. package/dist/src/shared/data-structures/column-store/column-store.d.ts.map +1 -0
  158. package/dist/src/shared/data-structures/column-store/column-store.interface.d.ts +155 -0
  159. package/dist/src/shared/data-structures/column-store/column-store.interface.d.ts.map +1 -0
  160. package/dist/src/shared/data-structures/column-store/index.d.ts +6 -0
  161. package/dist/src/shared/data-structures/column-store/index.d.ts.map +1 -0
  162. package/dist/src/shared/data-structures/command-stack/command-stack.d.ts +61 -0
  163. package/dist/src/shared/data-structures/command-stack/command-stack.d.ts.map +1 -0
  164. package/dist/src/shared/data-structures/command-stack/command-stack.interface.d.ts +80 -0
  165. package/dist/src/shared/data-structures/command-stack/command-stack.interface.d.ts.map +1 -0
  166. package/dist/src/shared/data-structures/command-stack/index.d.ts +3 -0
  167. package/dist/src/shared/data-structures/command-stack/index.d.ts.map +1 -0
  168. package/dist/src/shared/data-structures/dependency-graph/dependency-graph.d.ts +147 -0
  169. package/dist/src/shared/data-structures/dependency-graph/dependency-graph.d.ts.map +1 -0
  170. package/dist/src/shared/data-structures/dependency-graph/dependency-graph.interface.d.ts +161 -0
  171. package/dist/src/shared/data-structures/dependency-graph/dependency-graph.interface.d.ts.map +1 -0
  172. package/dist/src/shared/data-structures/dependency-graph/index.d.ts +8 -0
  173. package/dist/src/shared/data-structures/dependency-graph/index.d.ts.map +1 -0
  174. package/dist/src/shared/data-structures/disjoint-set/disjoint-set.d.ts +84 -0
  175. package/dist/src/shared/data-structures/disjoint-set/disjoint-set.d.ts.map +1 -0
  176. package/dist/src/shared/data-structures/disjoint-set/disjoint-set.interface.d.ts +185 -0
  177. package/dist/src/shared/data-structures/disjoint-set/disjoint-set.interface.d.ts.map +1 -0
  178. package/dist/src/shared/data-structures/disjoint-set/index.d.ts +7 -0
  179. package/dist/src/shared/data-structures/disjoint-set/index.d.ts.map +1 -0
  180. package/dist/src/shared/data-structures/index-map/index-map.d.ts +150 -0
  181. package/dist/src/shared/data-structures/index-map/index-map.d.ts.map +1 -0
  182. package/dist/src/shared/data-structures/index-map/index-map.interface.d.ts +186 -0
  183. package/dist/src/shared/data-structures/index-map/index-map.interface.d.ts.map +1 -0
  184. package/dist/src/shared/data-structures/index-map/index.d.ts +6 -0
  185. package/dist/src/shared/data-structures/index-map/index.d.ts.map +1 -0
  186. package/dist/src/shared/data-structures/index.d.ts +36 -0
  187. package/dist/src/shared/data-structures/index.d.ts.map +1 -0
  188. package/dist/src/shared/data-structures/interval-tree/index.d.ts +7 -0
  189. package/dist/src/shared/data-structures/interval-tree/index.d.ts.map +1 -0
  190. package/dist/src/shared/data-structures/interval-tree/interval-tree.d.ts +141 -0
  191. package/dist/src/shared/data-structures/interval-tree/interval-tree.d.ts.map +1 -0
  192. package/dist/src/shared/data-structures/interval-tree/interval-tree.interface.d.ts +212 -0
  193. package/dist/src/shared/data-structures/interval-tree/interval-tree.interface.d.ts.map +1 -0
  194. package/dist/src/shared/data-structures/lru-cache/index.d.ts +3 -0
  195. package/dist/src/shared/data-structures/lru-cache/index.d.ts.map +1 -0
  196. package/dist/src/shared/data-structures/lru-cache/lru-cache.d.ts +134 -0
  197. package/dist/src/shared/data-structures/lru-cache/lru-cache.d.ts.map +1 -0
  198. package/dist/src/shared/data-structures/lru-cache/lru-cache.interface.d.ts +173 -0
  199. package/dist/src/shared/data-structures/lru-cache/lru-cache.interface.d.ts.map +1 -0
  200. package/dist/src/shared/data-structures/prefix-sum-array/index.d.ts +6 -0
  201. package/dist/src/shared/data-structures/prefix-sum-array/index.d.ts.map +1 -0
  202. package/dist/src/shared/data-structures/prefix-sum-array/prefix-sum-array.d.ts +63 -0
  203. package/dist/src/shared/data-structures/prefix-sum-array/prefix-sum-array.d.ts.map +1 -0
  204. package/dist/src/shared/data-structures/prefix-sum-array/prefix-sum-array.interface.d.ts +80 -0
  205. package/dist/src/shared/data-structures/prefix-sum-array/prefix-sum-array.interface.d.ts.map +1 -0
  206. package/dist/src/shared/data-structures/rtree/index.d.ts +8 -0
  207. package/dist/src/shared/data-structures/rtree/index.d.ts.map +1 -0
  208. package/dist/src/shared/data-structures/rtree/rtree.d.ts +81 -0
  209. package/dist/src/shared/data-structures/rtree/rtree.d.ts.map +1 -0
  210. package/dist/src/shared/data-structures/rtree/rtree.interface.d.ts +143 -0
  211. package/dist/src/shared/data-structures/rtree/rtree.interface.d.ts.map +1 -0
  212. package/dist/src/shared/data-structures/segment-tree/index.d.ts +4 -0
  213. package/dist/src/shared/data-structures/segment-tree/index.d.ts.map +1 -0
  214. package/dist/src/shared/data-structures/segment-tree/segment-tree.d.ts +134 -0
  215. package/dist/src/shared/data-structures/segment-tree/segment-tree.d.ts.map +1 -0
  216. package/dist/src/shared/data-structures/segment-tree/segment-tree.interface.d.ts +202 -0
  217. package/dist/src/shared/data-structures/segment-tree/segment-tree.interface.d.ts.map +1 -0
  218. package/dist/src/shared/data-structures/skip-list/index.d.ts +4 -0
  219. package/dist/src/shared/data-structures/skip-list/index.d.ts.map +1 -0
  220. package/dist/src/shared/data-structures/skip-list/skip-list.d.ts +137 -0
  221. package/dist/src/shared/data-structures/skip-list/skip-list.d.ts.map +1 -0
  222. package/dist/src/shared/data-structures/skip-list/skip-list.interface.d.ts +223 -0
  223. package/dist/src/shared/data-structures/skip-list/skip-list.interface.d.ts.map +1 -0
  224. package/dist/src/shared/data-structures/sparse-matrix/index.d.ts +6 -0
  225. package/dist/src/shared/data-structures/sparse-matrix/index.d.ts.map +1 -0
  226. package/dist/src/shared/data-structures/sparse-matrix/sparse-matrix.d.ts +44 -0
  227. package/dist/src/shared/data-structures/sparse-matrix/sparse-matrix.d.ts.map +1 -0
  228. package/dist/src/shared/data-structures/sparse-matrix/sparse-matrix.interface.d.ts +105 -0
  229. package/dist/src/shared/data-structures/sparse-matrix/sparse-matrix.interface.d.ts.map +1 -0
  230. package/dist/src/shared/data-structures/suffix-array/index.d.ts +3 -0
  231. package/dist/src/shared/data-structures/suffix-array/index.d.ts.map +1 -0
  232. package/dist/src/shared/data-structures/suffix-array/suffix-array.d.ts +102 -0
  233. package/dist/src/shared/data-structures/suffix-array/suffix-array.d.ts.map +1 -0
  234. package/dist/src/shared/data-structures/suffix-array/suffix-array.interface.d.ts +117 -0
  235. package/dist/src/shared/data-structures/suffix-array/suffix-array.interface.d.ts.map +1 -0
  236. package/dist/src/shared/data-structures/trie/index.d.ts +8 -0
  237. package/dist/src/shared/data-structures/trie/index.d.ts.map +1 -0
  238. package/dist/src/shared/data-structures/trie/trie.d.ts +205 -0
  239. package/dist/src/shared/data-structures/trie/trie.d.ts.map +1 -0
  240. package/dist/src/shared/data-structures/trie/trie.interface.d.ts +117 -0
  241. package/dist/src/shared/data-structures/trie/trie.interface.d.ts.map +1 -0
  242. package/dist/src/shared/index.d.ts +47 -0
  243. package/dist/src/shared/index.d.ts.map +1 -0
  244. package/dist/src/shared/patterns/coordinator.d.ts +90 -0
  245. package/dist/src/shared/patterns/coordinator.d.ts.map +1 -0
  246. package/dist/src/shared/patterns/event-emitter.d.ts +106 -0
  247. package/dist/src/shared/patterns/event-emitter.d.ts.map +1 -0
  248. package/dist/src/shared/patterns/factory.d.ts +120 -0
  249. package/dist/src/shared/patterns/factory.d.ts.map +1 -0
  250. package/dist/src/shared/patterns/index.d.ts +21 -0
  251. package/dist/src/shared/patterns/index.d.ts.map +1 -0
  252. package/dist/src/shared/patterns/mediator.d.ts +116 -0
  253. package/dist/src/shared/patterns/mediator.d.ts.map +1 -0
  254. package/dist/src/shared/patterns/object-pool.d.ts +178 -0
  255. package/dist/src/shared/patterns/object-pool.d.ts.map +1 -0
  256. package/dist/src/shared/patterns/observer.d.ts +89 -0
  257. package/dist/src/shared/patterns/observer.d.ts.map +1 -0
  258. package/dist/src/shared/patterns/operation-mode.d.ts +75 -0
  259. package/dist/src/shared/patterns/operation-mode.d.ts.map +1 -0
  260. package/dist/src/shared/patterns/state-machine.d.ts +122 -0
  261. package/dist/src/shared/patterns/state-machine.d.ts.map +1 -0
  262. package/dist/src/shared/types/common.d.ts +56 -0
  263. package/dist/src/shared/types/common.d.ts.map +1 -0
  264. package/dist/src/shared/types/index.d.ts +5 -0
  265. package/dist/src/shared/types/index.d.ts.map +1 -0
  266. package/dist/src/shared/utils/index.d.ts +7 -0
  267. package/dist/src/shared/utils/index.d.ts.map +1 -0
  268. package/dist/src/shared/utils/timing.d.ts +104 -0
  269. package/dist/src/shared/utils/timing.d.ts.map +1 -0
  270. package/dist/src/shared/utils/timing.interface.d.ts +96 -0
  271. package/dist/src/shared/utils/timing.interface.d.ts.map +1 -0
  272. package/dist/src/touch/index.d.ts.map +1 -1
  273. package/dist/src/touch/touch-handler.d.ts.map +1 -1
  274. package/dist/src/types/index.d.ts.map +1 -1
  275. package/dist/src/types.d.ts.map +1 -1
  276. package/package.json +47 -47
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Graph algorithm interfaces and types
3
+ */
4
+ /**
5
+ * Generic graph representation (adjacency list)
6
+ */
7
+ export type AdjacencyList<T = any> = Map<T, Set<T>>;
8
+ /**
9
+ * Weighted edge
10
+ */
11
+ export interface WeightedEdge<T> {
12
+ from: T;
13
+ to: T;
14
+ weight: number;
15
+ }
16
+ /**
17
+ * DFS traversal options
18
+ */
19
+ export interface DFSOptions<T> {
20
+ /**
21
+ * Callback when visiting a node
22
+ */
23
+ onVisit?: (node: T, depth: number) => void;
24
+ /**
25
+ * Callback when backtracking from a node
26
+ */
27
+ onBacktrack?: (node: T) => void;
28
+ /**
29
+ * Callback when detecting a back edge (cycle)
30
+ */
31
+ onBackEdge?: (from: T, to: T) => void;
32
+ }
33
+ /**
34
+ * BFS traversal options
35
+ */
36
+ export interface BFSOptions<T> {
37
+ /**
38
+ * Callback when visiting a node
39
+ */
40
+ onVisit?: (node: T, level: number) => void;
41
+ /**
42
+ * Maximum depth to traverse
43
+ */
44
+ maxDepth?: number;
45
+ }
46
+ /**
47
+ * Path result
48
+ */
49
+ export interface PathResult<T> {
50
+ /**
51
+ * Nodes in the path
52
+ */
53
+ path: T[];
54
+ /**
55
+ * Total cost/distance
56
+ */
57
+ cost: number;
58
+ /**
59
+ * Whether a path was found
60
+ */
61
+ found: boolean;
62
+ }
63
+ //# sourceMappingURL=graph.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.interface.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/graph/graph.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,EAAE,CAAC,CAAC;IACN,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE3C;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAEhC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,CAAC,EAAE,CAAC;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Graph Algorithms
3
+ *
4
+ * Efficient algorithms for graph traversal, path finding, and analysis.
5
+ */
6
+ export { dfs, dfsPath, hasCycle, stronglyConnectedComponents, } from './dfs';
7
+ export { bfs, bfsShortestPath, nodesAtDistance, connectedComponent, allConnectedComponents, } from './bfs';
8
+ export type { AdjacencyList, WeightedEdge, DFSOptions, BFSOptions, PathResult, } from './graph.interface';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/graph/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,GAAG,EACH,OAAO,EACP,QAAQ,EACR,2BAA2B,GAC5B,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,GAAG,EACH,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,OAAO,CAAC;AAGf,YAAY,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Algorithms for ZenGrid
3
+ */
4
+ export { binarySearch, binarySearchLeft, binarySearchRight, } from './search';
5
+ export type { BinarySearchOptions, BinarySearchResult, } from './search';
6
+ export { dfs, dfsPath, hasCycle, stronglyConnectedComponents, bfs, bfsShortestPath, nodesAtDistance, connectedComponent, allConnectedComponents, } from './graph';
7
+ export type { AdjacencyList, WeightedEdge, DFSOptions, BFSOptions, PathResult, } from './graph';
8
+ export { BloomFilter } from './filter';
9
+ export { detectSequence, generateSequence, autofill, } from './pattern';
10
+ export type { SequenceType, SequencePattern, } from './pattern';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/algorithms/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,GAAG,EACH,OAAO,EACP,QAAQ,EACR,2BAA2B,EAC3B,GAAG,EACH,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,YAAY,EACZ,eAAe,GAChB,MAAM,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Pattern Detection Algorithms
3
+ *
4
+ * Algorithms for detecting patterns in data sequences and autofill.
5
+ */
6
+ export { detectSequence, generateSequence, autofill, } from './sequence-detector';
7
+ export type { SequenceType, SequencePattern, } from './sequence-detector';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/pattern/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,YAAY,EACZ,eAAe,GAChB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Sequence Detection for Autofill
3
+ *
4
+ * Detects patterns in data sequences for intelligent autofill.
5
+ *
6
+ * **Supported Patterns:**
7
+ * - Arithmetic sequences: 1, 2, 3, 4, ...
8
+ * - Geometric sequences: 2, 4, 8, 16, ...
9
+ * - Date sequences: Jan 1, Jan 2, Jan 3, ...
10
+ * - Day sequences: Mon, Tue, Wed, ...
11
+ * - Text patterns: Item 1, Item 2, Item 3, ...
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // Detect arithmetic sequence
16
+ * const pattern = detectSequence([1, 2, 3, 4]);
17
+ * // pattern: { type: 'arithmetic', step: 1 }
18
+ *
19
+ * // Generate next values
20
+ * const next = generateSequence(pattern, 5, 3);
21
+ * // next: [5, 6, 7]
22
+ * ```
23
+ */
24
+ /**
25
+ * Sequence pattern types
26
+ */
27
+ export type SequenceType = 'arithmetic' | 'geometric' | 'date' | 'text' | 'constant' | 'none';
28
+ /**
29
+ * Detected sequence pattern
30
+ */
31
+ export interface SequencePattern {
32
+ type: SequenceType;
33
+ step?: number;
34
+ ratio?: number;
35
+ template?: string;
36
+ confidence: number;
37
+ }
38
+ /**
39
+ * Detect sequence pattern from an array of values
40
+ *
41
+ * @param values - Array of values (at least 2 required)
42
+ * @returns Detected pattern
43
+ */
44
+ export declare function detectSequence(values: any[]): SequencePattern;
45
+ /**
46
+ * Generate next values in a sequence
47
+ *
48
+ * @param pattern - Detected sequence pattern
49
+ * @param startValue - Starting value
50
+ * @param count - Number of values to generate
51
+ * @returns Array of generated values
52
+ */
53
+ export declare function generateSequence(pattern: SequencePattern, startValue: any, count: number): any[];
54
+ /**
55
+ * Autofill a range based on detected pattern
56
+ *
57
+ * @param source - Source values to detect pattern from
58
+ * @param targetLength - Desired length of result
59
+ * @returns Autofilled array
60
+ */
61
+ export declare function autofill(source: any[], targetLength: number): any[];
62
+ //# sourceMappingURL=sequence-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequence-detector.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/pattern/sequence-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,WAAW,GACX,MAAM,GACN,MAAM,GACN,UAAU,GACV,MAAM,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,eAAe,CAkC7D;AAoGD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,CAsDhG;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,GAAG,EAAE,CAqBnE"}
@@ -0,0 +1,86 @@
1
+ import type { Comparator } from '../../types';
2
+ /**
3
+ * Options for binary search
4
+ */
5
+ export interface BinarySearchOptions<T> {
6
+ /**
7
+ * Custom comparator function
8
+ * @default (a, b) => a - b for numbers
9
+ */
10
+ comparator?: Comparator<T>;
11
+ /**
12
+ * If true, returns insertion point when not found
13
+ * Insertion point is the index where the target should be inserted
14
+ * @default false
15
+ */
16
+ returnInsertionPoint?: boolean;
17
+ }
18
+ /**
19
+ * Result of binary search
20
+ */
21
+ export interface BinarySearchResult {
22
+ /**
23
+ * Whether the target was found
24
+ */
25
+ found: boolean;
26
+ /**
27
+ * Index where target was found, or -1 if not found
28
+ * If returnInsertionPoint is true and not found, returns insertion index
29
+ */
30
+ index: number;
31
+ }
32
+ /**
33
+ * Performs binary search on a sorted array
34
+ *
35
+ * @param array - Sorted array to search
36
+ * @param target - Value to find
37
+ * @param options - Search options
38
+ * @returns Search result with found status and index
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * const result = binarySearch([1, 3, 5, 7, 9], 5);
43
+ * // { found: true, index: 2 }
44
+ *
45
+ * const result2 = binarySearch([1, 3, 5, 7], 4, { returnInsertionPoint: true });
46
+ * // { found: false, index: 2 } - insert at index 2 to maintain order
47
+ * ```
48
+ *
49
+ * @complexity O(log n) where n = array.length
50
+ */
51
+ export declare function binarySearch<T>(array: ReadonlyArray<T>, target: T, options?: BinarySearchOptions<T>): BinarySearchResult;
52
+ /**
53
+ * Find the leftmost (first) occurrence of target in sorted array
54
+ *
55
+ * @param array - Sorted array (may have duplicates)
56
+ * @param target - Value to find
57
+ * @param comparator - Custom comparator
58
+ * @returns Index of first occurrence, or -1 if not found
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * const index = binarySearchLeft([1, 2, 2, 2, 3], 2);
63
+ * // 1 (first occurrence of 2)
64
+ * ```
65
+ *
66
+ * @complexity O(log n)
67
+ */
68
+ export declare function binarySearchLeft<T>(array: ReadonlyArray<T>, target: T, comparator?: Comparator<T>): number;
69
+ /**
70
+ * Find the rightmost (last) occurrence of target in sorted array
71
+ *
72
+ * @param array - Sorted array (may have duplicates)
73
+ * @param target - Value to find
74
+ * @param comparator - Custom comparator
75
+ * @returns Index of last occurrence, or -1 if not found
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * const index = binarySearchRight([1, 2, 2, 2, 3], 2);
80
+ * // 3 (last occurrence of 2)
81
+ * ```
82
+ *
83
+ * @complexity O(log n)
84
+ */
85
+ export declare function binarySearchRight<T>(array: ReadonlyArray<T>, target: T, comparator?: Comparator<T>): number;
86
+ //# sourceMappingURL=binary-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/search/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAE3B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAOD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,MAAM,EAAE,CAAC,EACT,OAAO,GAAE,mBAAmB,CAAC,CAAC,CAAM,GACnC,kBAAkB,CA+BpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,MAAM,EAAE,CAAC,EACT,UAAU,GAAE,UAAU,CAAC,CAAC,CAAsC,GAC7D,MAAM,CAqBR;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,MAAM,EAAE,CAAC,EACT,UAAU,GAAE,UAAU,CAAC,CAAC,CAAsC,GAC7D,MAAM,CAqBR"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Search algorithms
3
+ */
4
+ export { binarySearch, binarySearchLeft, binarySearchRight, } from './binary-search';
5
+ export type { BinarySearchOptions, BinarySearchResult, } from './binary-search';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/search/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,126 @@
1
+ import type { Comparator } from '../../types/common';
2
+ import type { NullPosition } from './sorting.interface';
3
+ /**
4
+ * Options for string comparator
5
+ */
6
+ export interface StringComparatorOptions {
7
+ /** Case-insensitive comparison */
8
+ caseInsensitive?: boolean;
9
+ /** Use locale-aware comparison */
10
+ localeCompare?: boolean;
11
+ /** Locale for comparison (e.g., 'en-US') */
12
+ locale?: string;
13
+ /** Where to place null/undefined values */
14
+ nullPosition?: NullPosition;
15
+ }
16
+ /**
17
+ * Create a numeric comparator
18
+ *
19
+ * @param nullPosition - Where to place null values in sort order
20
+ * @returns Comparator function
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const numbers = [3, null, 1, undefined, 2];
25
+ * numbers.sort(numericComparator('last'));
26
+ * // [1, 2, 3, null, undefined]
27
+ * ```
28
+ */
29
+ export declare function numericComparator(nullPosition?: NullPosition): Comparator<any>;
30
+ /**
31
+ * Create a string comparator
32
+ *
33
+ * @param options - Comparator options
34
+ * @returns Comparator function
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * const names = ['Bob', 'alice', 'Charlie'];
39
+ * names.sort(stringComparator({ caseInsensitive: true }));
40
+ * // ['alice', 'Bob', 'Charlie']
41
+ * ```
42
+ */
43
+ export declare function stringComparator(options?: StringComparatorOptions): Comparator<any>;
44
+ /**
45
+ * Create a date comparator
46
+ *
47
+ * @param nullPosition - Where to place null values
48
+ * @returns Comparator function
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * const dates = [new Date('2023-01-15'), null, new Date('2023-01-01')];
53
+ * dates.sort(dateComparator('last'));
54
+ * // [2023-01-01, 2023-01-15, null]
55
+ * ```
56
+ */
57
+ export declare function dateComparator(nullPosition?: NullPosition): Comparator<any>;
58
+ /**
59
+ * Create a boolean comparator (false < true)
60
+ *
61
+ * @param nullPosition - Where to place null values
62
+ * @returns Comparator function
63
+ *
64
+ * @example
65
+ * ```typescript
66
+ * const values = [true, null, false, true];
67
+ * values.sort(booleanComparator('last'));
68
+ * // [false, true, true, null]
69
+ * ```
70
+ */
71
+ export declare function booleanComparator(nullPosition?: NullPosition): Comparator<any>;
72
+ /**
73
+ * Auto-detect type and create appropriate comparator
74
+ *
75
+ * @param sampleValues - Sample values to detect type from
76
+ * @param options - Options for the comparator
77
+ * @returns Comparator function
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * const data = [3, 1, 4, 1, 5];
82
+ * data.sort(autoComparator(data));
83
+ * // [1, 1, 3, 4, 5] - numeric comparison
84
+ * ```
85
+ */
86
+ export declare function autoComparator(sampleValues: any[], options?: {
87
+ nullPosition?: NullPosition;
88
+ }): Comparator<any>;
89
+ /**
90
+ * Reverse a comparator (ascending to descending)
91
+ *
92
+ * @param comparator - Comparator to reverse
93
+ * @returns Reversed comparator
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const desc = reverseComparator(numericComparator());
98
+ * [1, 2, 3].sort(desc);
99
+ * // [3, 2, 1]
100
+ * ```
101
+ */
102
+ export declare function reverseComparator<T>(comparator: Comparator<T>): Comparator<T>;
103
+ /**
104
+ * Chain multiple comparators (for multi-column sort)
105
+ *
106
+ * @param comparators - Comparators in priority order
107
+ * @returns Chained comparator
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * // Sort by age, then by name
112
+ * const data = [
113
+ * { age: 30, name: 'Bob' },
114
+ * { age: 25, name: 'Alice' },
115
+ * { age: 30, name: 'Charlie' }
116
+ * ];
117
+ *
118
+ * data.sort(chainComparators(
119
+ * (a, b) => a.age - b.age,
120
+ * (a, b) => a.name.localeCompare(b.name)
121
+ * ));
122
+ * // Alice (25), Bob (30), Charlie (30)
123
+ * ```
124
+ */
125
+ export declare function chainComparators<T>(...comparators: Comparator<T>[]): Comparator<T>;
126
+ //# sourceMappingURL=comparators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparators.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/sorting/comparators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,kCAAkC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AA2BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,GAAE,YAAqB,GAClC,UAAU,CAAC,GAAG,CAAC,CAajB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,uBAA4B,GACpC,UAAU,CAAC,GAAG,CAAC,CAyBjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,YAAY,GAAE,YAAqB,GAClC,UAAU,CAAC,GAAG,CAAC,CAgBjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,GAAE,YAAqB,GAClC,UAAU,CAAC,GAAG,CAAC,CAQjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,GAAG,EAAE,EACnB,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,YAAY,CAAA;CAAO,GAC5C,UAAU,CAAC,GAAG,CAAC,CA2BjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GACxB,UAAU,CAAC,CAAC,CAAC,CAEf;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,GAAG,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,GAC9B,UAAU,CAAC,CAAC,CAAC,CAUf"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Sorting algorithms and comparators
3
+ * @packageDocumentation
4
+ */
5
+ export type { NullPosition, TimsortOptions, SortMetadata, } from './sorting.interface';
6
+ export { numericComparator, stringComparator, dateComparator, booleanComparator, autoComparator, reverseComparator, chainComparators, } from './comparators';
7
+ export type { StringComparatorOptions } from './comparators';
8
+ export { timsort, timsortIndices, isSorted } from './timsort';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/sorting/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACV,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Position for null/undefined values in sort order
3
+ */
4
+ export type NullPosition = 'first' | 'last' | 'natural';
5
+ /**
6
+ * Options for Timsort algorithm
7
+ */
8
+ export interface TimsortOptions {
9
+ /**
10
+ * Minimum run length for merge sort
11
+ * Smaller values = more merges, larger values = more insertions
12
+ * Default: 32 (optimal for most cases)
13
+ */
14
+ minRun?: number;
15
+ /**
16
+ * Whether to use stable sorting
17
+ * Default: true
18
+ */
19
+ stable?: boolean;
20
+ }
21
+ /**
22
+ * Result of a sort operation with metadata
23
+ */
24
+ export interface SortMetadata {
25
+ /**
26
+ * Time taken in milliseconds
27
+ */
28
+ duration: number;
29
+ /**
30
+ * Number of comparisons performed
31
+ */
32
+ comparisons?: number;
33
+ /**
34
+ * Number of swaps/moves performed
35
+ */
36
+ swaps?: number;
37
+ }
38
+ //# sourceMappingURL=sorting.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sorting.interface.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/sorting/sorting.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,55 @@
1
+ import type { Comparator } from '../../types/common';
2
+ import type { TimsortOptions } from './sorting.interface';
3
+ /**
4
+ * Timsort - Production-grade stable O(n log n) sorting algorithm
5
+ *
6
+ * This is a full implementation of Timsort with all optimizations:
7
+ * - Natural run detection (finds already-sorted sequences)
8
+ * - Galloping mode (binary search optimization during merges)
9
+ * - Stack-based merge strategy (maintains merge invariants)
10
+ * - Reusable temporary buffer (reduces allocations)
11
+ *
12
+ * Used by Python, Java, and V8's Array.sort().
13
+ *
14
+ * @param array - Array to sort (modified in-place)
15
+ * @param comparator - Comparison function
16
+ * @param options - Timsort options
17
+ * @returns The sorted array
18
+ *
19
+ * @complexity
20
+ * - Time: O(n log n) worst case, O(n) best case (already sorted)
21
+ * - Space: O(n) for temporary merge buffer
22
+ */
23
+ export declare function timsort<T>(array: T[], comparator: Comparator<T>, options?: TimsortOptions): T[];
24
+ /**
25
+ * Sort indices based on values without modifying the values
26
+ *
27
+ * @param indices - Array of indices to sort
28
+ * @param getValue - Function to get value at an index
29
+ * @param comparator - Comparison function for values
30
+ * @param options - Timsort options
31
+ * @returns Sorted array of indices
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const values = ['Charlie', 'Alice', 'Bob'];
36
+ * const indices = [0, 1, 2];
37
+ *
38
+ * const sorted = timsortIndices(
39
+ * indices,
40
+ * (i) => values[i],
41
+ * (a, b) => a.localeCompare(b)
42
+ * );
43
+ * // sorted = [1, 2, 0] (Alice, Bob, Charlie)
44
+ * ```
45
+ */
46
+ export declare function timsortIndices<T>(indices: number[], getValue: (index: number) => T, comparator: Comparator<T>, options?: TimsortOptions): number[];
47
+ /**
48
+ * Check if an array is sorted
49
+ *
50
+ * @param array - Array to check
51
+ * @param comparator - Comparison function
52
+ * @returns True if sorted
53
+ */
54
+ export declare function isSorted<T>(array: readonly T[], comparator: Comparator<T>): boolean;
55
+ //# sourceMappingURL=timsort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timsort.d.ts","sourceRoot":"","sources":["../../../../../src/shared/algorithms/sorting/timsort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAyB1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,CAAC,EAAE,EACV,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,OAAO,GAAE,cAAmB,GAC3B,CAAC,EAAE,CAUL;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,EAC9B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,OAAO,GAAE,cAAmB,GAC3B,MAAM,EAAE,CAOV;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GACxB,OAAO,CAOT"}
@@ -0,0 +1,52 @@
1
+ import type { ColumnStore as IColumnStore, ColumnStoreOptions, ColumnDefinition, AggregateOperation, AggregationResult } from './column-store.interface';
2
+ /**
3
+ * ColumnStore implementation using typed arrays
4
+ *
5
+ * Column-oriented storage for dense grid data.
6
+ * Uses typed arrays for numeric columns for better performance and memory efficiency.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const store = new ColumnStore({
11
+ * rowCount: 1000,
12
+ * columns: [
13
+ * { name: 'id', type: 'int32' },
14
+ * { name: 'value', type: 'float64' },
15
+ * { name: 'label', type: 'string' }
16
+ * ]
17
+ * });
18
+ *
19
+ * store.setValue(0, 'id', 1);
20
+ * store.setValue(0, 'value', 99.5);
21
+ * store.setValue(0, 'label', 'Item 1');
22
+ *
23
+ * const sum = store.aggregate('value', 'sum');
24
+ * ```
25
+ */
26
+ export declare class ColumnStore implements IColumnStore {
27
+ private data;
28
+ private columnTypes;
29
+ private rows;
30
+ private autoGrow;
31
+ constructor(options?: ColumnStoreOptions);
32
+ addColumn(definition: ColumnDefinition): void;
33
+ private createColumn;
34
+ private fillColumn;
35
+ removeColumn(columnName: string): boolean;
36
+ hasColumn(columnName: string): boolean;
37
+ getValue(row: number, columnName: string): any;
38
+ setValue(row: number, columnName: string, value: any): void;
39
+ private coerceValue;
40
+ getRow(row: number): Record<string, any>;
41
+ setRow(row: number, values: Record<string, any>): void;
42
+ getColumn(columnName: string): any[];
43
+ setColumn(columnName: string, values: any[]): void;
44
+ aggregate(columnName: string, operation: AggregateOperation): AggregationResult;
45
+ addRows(count: number): void;
46
+ clear(): void;
47
+ private ensureRowExists;
48
+ get rowCount(): number;
49
+ get columnCount(): number;
50
+ get columns(): ReadonlyArray<string>;
51
+ }
52
+ //# sourceMappingURL=column-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-store.d.ts","sourceRoot":"","sources":["../../../../../src/shared/data-structures/column-store/column-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,IAAI,YAAY,EAC3B,kBAAkB,EAClB,gBAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,WAAY,YAAW,YAAY;IAC9C,OAAO,CAAC,IAAI,CAAiD;IAC7D,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAU;gBAEd,OAAO,GAAE,kBAAuB;IAc5C,SAAS,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI;IAgB7C,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,UAAU;IAalB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAQzC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAItC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,GAAG;IAW9C,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAY3D,OAAO,CAAC,WAAW;IA8BnB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAUxC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAUtD,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,EAAE;IASpC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAmBlD,SAAS,CACP,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,kBAAkB,GAC5B,iBAAiB;IA+FpB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAiC5B,KAAK,IAAI,IAAI;IAYb,OAAO,CAAC,eAAe;IAgBvB,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAEnC;CACF"}