numpy-ts 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/README.md +3 -11
  2. package/dist/esm/common/broadcasting.js +1 -1
  3. package/dist/esm/common/dtype.js +1 -1
  4. package/dist/esm/common/float16-conv.js +1 -0
  5. package/dist/esm/common/internal/compute.js +1 -1
  6. package/dist/esm/common/internal/indexing.js +1 -1
  7. package/dist/esm/common/ndarray-core.js +1 -1
  8. package/dist/esm/common/ops/advanced.js +1 -1
  9. package/dist/esm/common/ops/arithmetic.js +1 -1
  10. package/dist/esm/common/ops/bitwise.js +1 -1
  11. package/dist/esm/common/ops/comparison.js +1 -1
  12. package/dist/esm/common/ops/complex.js +1 -1
  13. package/dist/esm/common/ops/exponential.js +1 -1
  14. package/dist/esm/common/ops/fft.js +1 -1
  15. package/dist/esm/common/ops/formatting.js +1 -1
  16. package/dist/esm/common/ops/gradient.js +1 -1
  17. package/dist/esm/common/ops/hyperbolic.js +1 -1
  18. package/dist/esm/common/ops/linalg.js +2 -2
  19. package/dist/esm/common/ops/logic.js +1 -1
  20. package/dist/esm/common/ops/random.js +1 -1
  21. package/dist/esm/common/ops/reduction.js +1 -1
  22. package/dist/esm/common/ops/rounding.js +1 -1
  23. package/dist/esm/common/ops/sets.js +1 -1
  24. package/dist/esm/common/ops/shape.js +1 -1
  25. package/dist/esm/common/ops/sorting.js +1 -1
  26. package/dist/esm/common/ops/statistics.js +1 -1
  27. package/dist/esm/common/ops/trig.js +1 -1
  28. package/dist/esm/common/storage.js +1 -1
  29. package/dist/esm/common/wasm/abs.js +1 -1
  30. package/dist/esm/common/wasm/add.js +1 -1
  31. package/dist/esm/common/wasm/all_finite.js +1 -0
  32. package/dist/esm/common/wasm/arccos.js +1 -1
  33. package/dist/esm/common/wasm/arcsin.js +1 -1
  34. package/dist/esm/common/wasm/arctan.js +1 -1
  35. package/dist/esm/common/wasm/arctan2.js +1 -0
  36. package/dist/esm/common/wasm/argpartition.js +1 -1
  37. package/dist/esm/common/wasm/argsort.js +1 -1
  38. package/dist/esm/common/wasm/bins/abs.wasm.js +1 -1
  39. package/dist/esm/common/wasm/bins/add.wasm.js +1 -1
  40. package/dist/esm/common/wasm/bins/all_finite.wasm.js +1 -0
  41. package/dist/esm/common/wasm/bins/alloc.wasm.js +1 -0
  42. package/dist/esm/common/wasm/bins/arccos.wasm.js +1 -1
  43. package/dist/esm/common/wasm/bins/arcsin.wasm.js +1 -1
  44. package/dist/esm/common/wasm/bins/arctan.wasm.js +1 -1
  45. package/dist/esm/common/wasm/bins/arctan2.wasm.js +1 -0
  46. package/dist/esm/common/wasm/bins/argpartition.wasm.js +1 -1
  47. package/dist/esm/common/wasm/bins/argsort.wasm.js +1 -1
  48. package/dist/esm/common/wasm/bins/bitwise_and.wasm.js +1 -1
  49. package/dist/esm/common/wasm/bins/bitwise_count.wasm.js +1 -1
  50. package/dist/esm/common/wasm/bins/bitwise_not.wasm.js +1 -1
  51. package/dist/esm/common/wasm/bins/bitwise_or.wasm.js +1 -1
  52. package/dist/esm/common/wasm/bins/bitwise_xor.wasm.js +1 -1
  53. package/dist/esm/common/wasm/bins/cholesky.wasm.js +1 -1
  54. package/dist/esm/common/wasm/bins/clip.wasm.js +1 -1
  55. package/dist/esm/common/wasm/bins/convolve.wasm.js +1 -1
  56. package/dist/esm/common/wasm/bins/copysign.wasm.js +1 -1
  57. package/dist/esm/common/wasm/bins/correlate.wasm.js +1 -1
  58. package/dist/esm/common/wasm/bins/cos.wasm.js +1 -1
  59. package/dist/esm/common/wasm/bins/cosh.wasm.js +1 -1
  60. package/dist/esm/common/wasm/bins/cross.wasm.js +1 -1
  61. package/dist/esm/common/wasm/bins/diff.wasm.js +1 -1
  62. package/dist/esm/common/wasm/bins/divide.wasm.js +1 -1
  63. package/dist/esm/common/wasm/bins/divmod.wasm.js +1 -0
  64. package/dist/esm/common/wasm/bins/dot_float-relaxed.wasm.js +1 -0
  65. package/dist/esm/common/wasm/bins/dot_float.wasm.js +1 -0
  66. package/dist/esm/common/wasm/bins/dot_int.wasm.js +1 -0
  67. package/dist/esm/common/wasm/bins/exp.wasm.js +1 -1
  68. package/dist/esm/common/wasm/bins/exp2.wasm.js +1 -1
  69. package/dist/esm/common/wasm/bins/fft.wasm.js +1 -1
  70. package/dist/esm/common/wasm/bins/frexp.wasm.js +1 -1
  71. package/dist/esm/common/wasm/bins/gather.wasm.js +1 -1
  72. package/dist/esm/common/wasm/bins/gcd.wasm.js +1 -1
  73. package/dist/esm/common/wasm/bins/gradient.wasm.js +1 -1
  74. package/dist/esm/common/wasm/bins/heaviside.wasm.js +1 -1
  75. package/dist/esm/common/wasm/bins/hypot.wasm.js +1 -1
  76. package/dist/esm/common/wasm/bins/indices.wasm.js +1 -1
  77. package/dist/esm/common/wasm/bins/inner_float-relaxed.wasm.js +1 -0
  78. package/dist/esm/common/wasm/bins/inner_float.wasm.js +1 -0
  79. package/dist/esm/common/wasm/bins/inner_int.wasm.js +1 -0
  80. package/dist/esm/common/wasm/bins/isfinite.wasm.js +1 -0
  81. package/dist/esm/common/wasm/bins/isnan.wasm.js +1 -0
  82. package/dist/esm/common/wasm/bins/kron.wasm.js +1 -1
  83. package/dist/esm/common/wasm/bins/ldexp.wasm.js +1 -1
  84. package/dist/esm/common/wasm/bins/left_shift.wasm.js +1 -1
  85. package/dist/esm/common/wasm/bins/lexsort.wasm.js +1 -1
  86. package/dist/esm/common/wasm/bins/logaddexp.wasm.js +1 -1
  87. package/dist/esm/common/wasm/bins/logical_and.wasm.js +1 -1
  88. package/dist/esm/common/wasm/bins/logical_not.wasm.js +1 -1
  89. package/dist/esm/common/wasm/bins/logical_or.wasm.js +1 -1
  90. package/dist/esm/common/wasm/bins/logical_xor.wasm.js +1 -1
  91. package/dist/esm/common/wasm/bins/lu.wasm.js +1 -0
  92. package/dist/esm/common/wasm/bins/matmul_float-relaxed.wasm.js +1 -0
  93. package/dist/esm/common/wasm/bins/matmul_float.wasm.js +1 -0
  94. package/dist/esm/common/wasm/bins/matmul_int.wasm.js +1 -0
  95. package/dist/esm/common/wasm/bins/matvec_float-relaxed.wasm.js +1 -0
  96. package/dist/esm/common/wasm/bins/matvec_float.wasm.js +1 -0
  97. package/dist/esm/common/wasm/bins/matvec_int.wasm.js +1 -0
  98. package/dist/esm/common/wasm/bins/max.wasm.js +1 -1
  99. package/dist/esm/common/wasm/bins/min.wasm.js +1 -1
  100. package/dist/esm/common/wasm/bins/mul.wasm.js +1 -1
  101. package/dist/esm/common/wasm/bins/neg.wasm.js +1 -1
  102. package/dist/esm/common/wasm/bins/outer.wasm.js +1 -1
  103. package/dist/esm/common/wasm/bins/pad.wasm.js +1 -1
  104. package/dist/esm/common/wasm/bins/partition.wasm.js +1 -1
  105. package/dist/esm/common/wasm/bins/power.wasm.js +1 -1
  106. package/dist/esm/common/wasm/bins/qr.wasm.js +1 -1
  107. package/dist/esm/common/wasm/bins/reciprocal.wasm.js +1 -1
  108. package/dist/esm/common/wasm/bins/reduce_all.wasm.js +1 -1
  109. package/dist/esm/common/wasm/bins/reduce_any.wasm.js +1 -1
  110. package/dist/esm/common/wasm/bins/reduce_argmax.wasm.js +1 -1
  111. package/dist/esm/common/wasm/bins/reduce_argmin.wasm.js +1 -1
  112. package/dist/esm/common/wasm/bins/reduce_count_nz.wasm.js +1 -1
  113. package/dist/esm/common/wasm/bins/reduce_max.wasm.js +1 -1
  114. package/dist/esm/common/wasm/bins/reduce_mean.wasm.js +1 -1
  115. package/dist/esm/common/wasm/bins/reduce_min.wasm.js +1 -1
  116. package/dist/esm/common/wasm/bins/reduce_nanmax.wasm.js +1 -1
  117. package/dist/esm/common/wasm/bins/reduce_nanmin.wasm.js +1 -1
  118. package/dist/esm/common/wasm/bins/reduce_nansum.wasm.js +1 -1
  119. package/dist/esm/common/wasm/bins/reduce_prod.wasm.js +1 -1
  120. package/dist/esm/common/wasm/bins/reduce_std.wasm.js +1 -1
  121. package/dist/esm/common/wasm/bins/reduce_sum.wasm.js +1 -1
  122. package/dist/esm/common/wasm/bins/reduce_var.wasm.js +1 -1
  123. package/dist/esm/common/wasm/bins/repeat.wasm.js +1 -1
  124. package/dist/esm/common/wasm/bins/right_shift.wasm.js +1 -1
  125. package/dist/esm/common/wasm/bins/rng.wasm.js +1 -0
  126. package/dist/esm/common/wasm/bins/roll.wasm.js +1 -1
  127. package/dist/esm/common/wasm/bins/searchsorted.wasm.js +1 -1
  128. package/dist/esm/common/wasm/bins/sign.wasm.js +1 -1
  129. package/dist/esm/common/wasm/bins/signbit.wasm.js +1 -0
  130. package/dist/esm/common/wasm/bins/sin.wasm.js +1 -0
  131. package/dist/esm/common/wasm/bins/sinh.wasm.js +1 -1
  132. package/dist/esm/common/wasm/bins/sort.wasm.js +1 -1
  133. package/dist/esm/common/wasm/bins/sqrt.wasm.js +1 -1
  134. package/dist/esm/common/wasm/bins/square.wasm.js +1 -1
  135. package/dist/esm/common/wasm/bins/sub.wasm.js +1 -1
  136. package/dist/esm/common/wasm/bins/svd.wasm.js +1 -1
  137. package/dist/esm/common/wasm/bins/tan.wasm.js +1 -1
  138. package/dist/esm/common/wasm/bins/tanh.wasm.js +1 -1
  139. package/dist/esm/common/wasm/bins/tile.wasm.js +1 -1
  140. package/dist/esm/common/wasm/bins/unravel_index.wasm.js +1 -0
  141. package/dist/esm/common/wasm/bins/vdot.wasm.js +1 -1
  142. package/dist/esm/common/wasm/bins/vecdot_float-relaxed.wasm.js +1 -0
  143. package/dist/esm/common/wasm/bins/vecdot_float.wasm.js +1 -0
  144. package/dist/esm/common/wasm/bins/vecdot_int.wasm.js +1 -0
  145. package/dist/esm/common/wasm/bins/vecmat_float-relaxed.wasm.js +1 -0
  146. package/dist/esm/common/wasm/bins/vecmat_float.wasm.js +1 -0
  147. package/dist/esm/common/wasm/bins/vecmat_int.wasm.js +1 -0
  148. package/dist/esm/common/wasm/bins/vector_norm-relaxed.wasm.js +1 -0
  149. package/dist/esm/common/wasm/bins/vector_norm.wasm.js +1 -0
  150. package/dist/esm/common/wasm/bitwise_and.js +1 -1
  151. package/dist/esm/common/wasm/bitwise_count.js +1 -1
  152. package/dist/esm/common/wasm/bitwise_not.js +1 -1
  153. package/dist/esm/common/wasm/bitwise_or.js +1 -1
  154. package/dist/esm/common/wasm/bitwise_xor.js +1 -1
  155. package/dist/esm/common/wasm/cholesky.js +1 -1
  156. package/dist/esm/common/wasm/clip.js +1 -1
  157. package/dist/esm/common/wasm/config.js +1 -1
  158. package/dist/esm/common/wasm/convolve.js +1 -1
  159. package/dist/esm/common/wasm/copysign.js +1 -1
  160. package/dist/esm/common/wasm/correlate.js +1 -1
  161. package/dist/esm/common/wasm/cos.js +1 -1
  162. package/dist/esm/common/wasm/cosh.js +1 -1
  163. package/dist/esm/common/wasm/cross.js +1 -1
  164. package/dist/esm/common/wasm/detect.js +1 -0
  165. package/dist/esm/common/wasm/diff.js +1 -1
  166. package/dist/esm/common/wasm/divide.js +1 -1
  167. package/dist/esm/common/wasm/divmod.js +1 -0
  168. package/dist/esm/common/wasm/dot.js +1 -1
  169. package/dist/esm/common/wasm/exp.js +1 -1
  170. package/dist/esm/common/wasm/exp2.js +1 -1
  171. package/dist/esm/common/wasm/fft.js +1 -1
  172. package/dist/esm/common/wasm/frexp.js +1 -1
  173. package/dist/esm/common/wasm/gather.js +1 -1
  174. package/dist/esm/common/wasm/gcd.js +1 -1
  175. package/dist/esm/common/wasm/gradient.js +1 -1
  176. package/dist/esm/common/wasm/heaviside.js +1 -1
  177. package/dist/esm/common/wasm/hypot.js +1 -1
  178. package/dist/esm/common/wasm/indices.js +1 -1
  179. package/dist/esm/common/wasm/inner.js +1 -1
  180. package/dist/esm/common/wasm/isfinite.js +1 -0
  181. package/dist/esm/common/wasm/isnan.js +1 -0
  182. package/dist/esm/common/wasm/kron.js +1 -1
  183. package/dist/esm/common/wasm/ldexp.js +1 -1
  184. package/dist/esm/common/wasm/left_shift.js +1 -1
  185. package/dist/esm/common/wasm/lexsort.js +1 -1
  186. package/dist/esm/common/wasm/logaddexp.js +1 -1
  187. package/dist/esm/common/wasm/logical_and.js +1 -1
  188. package/dist/esm/common/wasm/logical_not.js +1 -1
  189. package/dist/esm/common/wasm/logical_or.js +1 -1
  190. package/dist/esm/common/wasm/logical_xor.js +1 -1
  191. package/dist/esm/common/wasm/lu.js +1 -0
  192. package/dist/esm/common/wasm/matmul.js +1 -1
  193. package/dist/esm/common/wasm/matvec.js +1 -1
  194. package/dist/esm/common/wasm/max.js +1 -1
  195. package/dist/esm/common/wasm/min.js +1 -1
  196. package/dist/esm/common/wasm/mul.js +1 -1
  197. package/dist/esm/common/wasm/neg.js +1 -1
  198. package/dist/esm/common/wasm/outer.js +1 -1
  199. package/dist/esm/common/wasm/pad.js +1 -1
  200. package/dist/esm/common/wasm/partition.js +1 -1
  201. package/dist/esm/common/wasm/power.js +1 -1
  202. package/dist/esm/common/wasm/qr.js +1 -1
  203. package/dist/esm/common/wasm/reciprocal.js +1 -1
  204. package/dist/esm/common/wasm/reduce_all.js +1 -1
  205. package/dist/esm/common/wasm/reduce_any.js +1 -1
  206. package/dist/esm/common/wasm/reduce_argmax.js +1 -1
  207. package/dist/esm/common/wasm/reduce_argmin.js +1 -1
  208. package/dist/esm/common/wasm/reduce_count_nz.js +1 -1
  209. package/dist/esm/common/wasm/reduce_max.js +1 -1
  210. package/dist/esm/common/wasm/reduce_mean.js +1 -1
  211. package/dist/esm/common/wasm/reduce_min.js +1 -1
  212. package/dist/esm/common/wasm/reduce_nanmax.js +1 -1
  213. package/dist/esm/common/wasm/reduce_nanmin.js +1 -1
  214. package/dist/esm/common/wasm/reduce_nansum.js +1 -1
  215. package/dist/esm/common/wasm/reduce_prod.js +1 -1
  216. package/dist/esm/common/wasm/reduce_quantile.js +1 -1
  217. package/dist/esm/common/wasm/reduce_std.js +1 -1
  218. package/dist/esm/common/wasm/reduce_sum.js +1 -1
  219. package/dist/esm/common/wasm/reduce_var.js +1 -1
  220. package/dist/esm/common/wasm/repeat.js +1 -1
  221. package/dist/esm/common/wasm/right_shift.js +1 -1
  222. package/dist/esm/common/wasm/rng.js +1 -0
  223. package/dist/esm/common/wasm/roll.js +1 -1
  224. package/dist/esm/common/wasm/runtime.js +1 -1
  225. package/dist/esm/common/wasm/searchsorted.js +1 -1
  226. package/dist/esm/common/wasm/sign.js +1 -1
  227. package/dist/esm/common/wasm/signbit.js +1 -0
  228. package/dist/esm/common/wasm/sin.js +1 -0
  229. package/dist/esm/common/wasm/sinh.js +1 -1
  230. package/dist/esm/common/wasm/sort.js +1 -1
  231. package/dist/esm/common/wasm/sqrt.js +1 -1
  232. package/dist/esm/common/wasm/square.js +1 -1
  233. package/dist/esm/common/wasm/sub.js +1 -1
  234. package/dist/esm/common/wasm/svd.js +1 -1
  235. package/dist/esm/common/wasm/tan.js +1 -1
  236. package/dist/esm/common/wasm/tanh.js +1 -1
  237. package/dist/esm/common/wasm/tile.js +1 -1
  238. package/dist/esm/common/wasm/unravel_index.js +1 -0
  239. package/dist/esm/common/wasm/vdot.js +1 -1
  240. package/dist/esm/common/wasm/vecdot.js +1 -1
  241. package/dist/esm/common/wasm/vecmat.js +1 -1
  242. package/dist/esm/common/wasm/vector_norm.js +1 -0
  243. package/dist/esm/core/advanced.js +1 -1
  244. package/dist/esm/core/arithmetic.js +1 -1
  245. package/dist/esm/core/bitwise.js +1 -1
  246. package/dist/esm/core/complex.js +1 -1
  247. package/dist/esm/core/creation.js +1 -1
  248. package/dist/esm/core/formatting.js +1 -1
  249. package/dist/esm/core/gradient.js +1 -1
  250. package/dist/esm/core/index.js +1 -1
  251. package/dist/esm/core/linalg.js +1 -1
  252. package/dist/esm/core/logic.js +1 -1
  253. package/dist/esm/core/polynomial.js +1 -1
  254. package/dist/esm/core/reduction.js +1 -1
  255. package/dist/esm/core/rounding.js +1 -1
  256. package/dist/esm/core/sets.js +1 -1
  257. package/dist/esm/core/shape-extra.js +1 -1
  258. package/dist/esm/core/shape.js +1 -1
  259. package/dist/esm/core/sorting.js +1 -1
  260. package/dist/esm/core/statistics.js +1 -1
  261. package/dist/esm/core/trig.js +1 -1
  262. package/dist/esm/core/typechecking.js +1 -1
  263. package/dist/esm/core/types.js +1 -1
  264. package/dist/esm/core/utility.js +1 -1
  265. package/dist/esm/core.js +1 -1
  266. package/dist/esm/full/index.js +1 -1
  267. package/dist/esm/full/ndarray.js +1 -1
  268. package/dist/esm/index.js +1 -1
  269. package/dist/esm/io/file-ops.js +1 -0
  270. package/dist/esm/io/filesystem.js +1 -0
  271. package/dist/esm/io/index.js +1 -1
  272. package/dist/esm/io/npy/format.js +1 -1
  273. package/dist/esm/io/npy/index.js +1 -1
  274. package/dist/esm/io/npy/parser.js +1 -1
  275. package/dist/esm/io/npy/serializer.js +2 -2
  276. package/dist/esm/io/npz/index.js +1 -1
  277. package/dist/esm/io/npz/parser.js +1 -1
  278. package/dist/esm/io/npz/serializer.js +1 -1
  279. package/dist/esm/io/txt/index.js +1 -1
  280. package/dist/esm/io/txt/parser.js +1 -1
  281. package/dist/esm/io/zip/index.js +1 -1
  282. package/dist/esm/io/zip/reader.js +1 -1
  283. package/dist/esm/io/zip/writer.js +1 -1
  284. package/dist/esm/node.js +1 -1
  285. package/dist/numpy-ts.browser.js +6 -6
  286. package/dist/types/common/dtype.d.ts +55 -4
  287. package/dist/types/common/float16-conv.d.ts +27 -0
  288. package/dist/types/common/internal/indexing.d.ts +9 -21
  289. package/dist/types/common/ndarray-core.d.ts +20 -0
  290. package/dist/types/common/ops/advanced.d.ts +17 -2
  291. package/dist/types/common/ops/complex.d.ts +19 -1
  292. package/dist/types/common/ops/linalg.d.ts +1 -1
  293. package/dist/types/common/ops/random.d.ts +10 -5
  294. package/dist/types/common/ops/reduction.d.ts +2 -2
  295. package/dist/types/common/ops/sets.d.ts +2 -1
  296. package/dist/types/common/ops/shape.d.ts +2 -2
  297. package/dist/types/common/ops/statistics.d.ts +2 -1
  298. package/dist/types/common/storage.d.ts +54 -2
  299. package/dist/types/common/wasm/all_finite.d.ts +8 -0
  300. package/dist/types/common/wasm/arccos.d.ts +4 -2
  301. package/dist/types/common/wasm/arcsin.d.ts +4 -2
  302. package/dist/types/common/wasm/arctan.d.ts +4 -2
  303. package/dist/types/common/wasm/arctan2.d.ts +17 -0
  304. package/dist/types/common/wasm/argpartition.d.ts +8 -3
  305. package/dist/types/common/wasm/argsort.d.ts +8 -3
  306. package/dist/types/common/wasm/bins/abs.wasm.d.ts +1 -0
  307. package/dist/types/common/wasm/bins/all_finite.wasm.d.ts +4 -0
  308. package/dist/types/common/wasm/bins/alloc.wasm.d.ts +6 -0
  309. package/dist/types/common/wasm/bins/arccos.wasm.d.ts +8 -2
  310. package/dist/types/common/wasm/bins/arcsin.wasm.d.ts +8 -2
  311. package/dist/types/common/wasm/bins/arctan.wasm.d.ts +8 -2
  312. package/dist/types/common/wasm/bins/arctan2.wasm.d.ts +11 -0
  313. package/dist/types/common/wasm/bins/convolve.wasm.d.ts +6 -0
  314. package/dist/types/common/wasm/bins/copysign.wasm.d.ts +2 -0
  315. package/dist/types/common/wasm/bins/correlate.wasm.d.ts +6 -0
  316. package/dist/types/common/wasm/bins/cos.wasm.d.ts +8 -0
  317. package/dist/types/common/wasm/bins/cosh.wasm.d.ts +8 -2
  318. package/dist/types/common/wasm/bins/divmod.wasm.d.ts +11 -0
  319. package/dist/types/common/wasm/bins/dot_float-relaxed.wasm.d.ts +5 -0
  320. package/dist/types/common/wasm/bins/dot_float.wasm.d.ts +5 -0
  321. package/dist/types/common/wasm/bins/dot_int.wasm.d.ts +5 -0
  322. package/dist/types/common/wasm/bins/exp.wasm.d.ts +8 -2
  323. package/dist/types/common/wasm/bins/exp2.wasm.d.ts +8 -2
  324. package/dist/types/common/wasm/bins/fft.wasm.d.ts +11 -0
  325. package/dist/types/common/wasm/bins/frexp.wasm.d.ts +1 -0
  326. package/dist/types/common/wasm/bins/gather.wasm.d.ts +0 -1
  327. package/dist/types/common/wasm/bins/gcd.wasm.d.ts +8 -0
  328. package/dist/types/common/wasm/bins/indices.wasm.d.ts +6 -2
  329. package/dist/types/common/wasm/bins/inner_float-relaxed.wasm.d.ts +5 -0
  330. package/dist/types/common/wasm/bins/inner_float.wasm.d.ts +5 -0
  331. package/dist/types/common/wasm/bins/inner_int.wasm.d.ts +5 -0
  332. package/dist/types/common/wasm/bins/isfinite.wasm.d.ts +4 -0
  333. package/dist/types/common/wasm/bins/isnan.wasm.d.ts +4 -0
  334. package/dist/types/common/wasm/bins/lexsort.wasm.d.ts +4 -4
  335. package/dist/types/common/wasm/bins/logical_and.wasm.d.ts +2 -0
  336. package/dist/types/common/wasm/bins/logical_not.wasm.d.ts +1 -0
  337. package/dist/types/common/wasm/bins/logical_or.wasm.d.ts +2 -0
  338. package/dist/types/common/wasm/bins/logical_xor.wasm.d.ts +2 -0
  339. package/dist/types/common/wasm/bins/lu.wasm.d.ts +7 -0
  340. package/dist/types/common/wasm/bins/matmul_float-relaxed.wasm.d.ts +5 -0
  341. package/dist/types/common/wasm/bins/matmul_float.wasm.d.ts +5 -0
  342. package/dist/types/common/wasm/bins/matmul_int.wasm.d.ts +5 -0
  343. package/dist/types/common/wasm/bins/matvec_float-relaxed.wasm.d.ts +5 -0
  344. package/dist/types/common/wasm/bins/matvec_float.wasm.d.ts +5 -0
  345. package/dist/types/common/wasm/bins/matvec_int.wasm.d.ts +5 -0
  346. package/dist/types/common/wasm/bins/neg.wasm.d.ts +1 -0
  347. package/dist/types/common/wasm/bins/qr.wasm.d.ts +0 -1
  348. package/dist/types/common/wasm/bins/reciprocal.wasm.d.ts +8 -4
  349. package/dist/types/common/wasm/bins/reduce_argmax.wasm.d.ts +8 -0
  350. package/dist/types/common/wasm/bins/reduce_argmin.wasm.d.ts +8 -0
  351. package/dist/types/common/wasm/bins/reduce_max.wasm.d.ts +1 -0
  352. package/dist/types/common/wasm/bins/reduce_min.wasm.d.ts +1 -0
  353. package/dist/types/common/wasm/bins/reduce_prod.wasm.d.ts +2 -0
  354. package/dist/types/common/wasm/bins/reduce_sum.wasm.d.ts +8 -2
  355. package/dist/types/common/wasm/bins/rng.wasm.d.ts +57 -0
  356. package/dist/types/common/wasm/bins/sign.wasm.d.ts +1 -0
  357. package/dist/types/common/wasm/bins/signbit.wasm.d.ts +8 -0
  358. package/dist/types/common/wasm/bins/sin.wasm.d.ts +11 -0
  359. package/dist/types/common/wasm/bins/sinh.wasm.d.ts +8 -2
  360. package/dist/types/common/wasm/bins/sort.wasm.d.ts +6 -4
  361. package/dist/types/common/wasm/bins/sqrt.wasm.d.ts +2 -2
  362. package/dist/types/common/wasm/bins/svd.wasm.d.ts +1 -0
  363. package/dist/types/common/wasm/bins/tan.wasm.d.ts +8 -0
  364. package/dist/types/common/wasm/bins/tanh.wasm.d.ts +8 -2
  365. package/dist/types/common/wasm/bins/unravel_index.wasm.d.ts +4 -0
  366. package/dist/types/common/wasm/bins/vecdot_float-relaxed.wasm.d.ts +5 -0
  367. package/dist/types/common/wasm/bins/vecdot_float.wasm.d.ts +5 -0
  368. package/dist/types/common/wasm/bins/vecdot_int.wasm.d.ts +5 -0
  369. package/dist/types/common/wasm/bins/vecmat_float-relaxed.wasm.d.ts +5 -0
  370. package/dist/types/common/wasm/bins/vecmat_float.wasm.d.ts +5 -0
  371. package/dist/types/common/wasm/bins/vecmat_int.wasm.d.ts +5 -0
  372. package/dist/types/common/wasm/bins/vector_norm-relaxed.wasm.d.ts +3 -0
  373. package/dist/types/common/wasm/bins/vector_norm.wasm.d.ts +3 -0
  374. package/dist/types/common/wasm/config.d.ts +25 -0
  375. package/dist/types/common/wasm/convolve.d.ts +1 -1
  376. package/dist/types/common/wasm/cos.d.ts +4 -2
  377. package/dist/types/common/wasm/cosh.d.ts +4 -2
  378. package/dist/types/common/wasm/detect.d.ts +17 -0
  379. package/dist/types/common/wasm/divide.d.ts +4 -0
  380. package/dist/types/common/wasm/divmod.d.ts +13 -0
  381. package/dist/types/common/wasm/exp.d.ts +4 -2
  382. package/dist/types/common/wasm/exp2.d.ts +4 -2
  383. package/dist/types/common/wasm/fft.d.ts +36 -0
  384. package/dist/types/common/wasm/frexp.d.ts +1 -0
  385. package/dist/types/common/wasm/gather.d.ts +4 -0
  386. package/dist/types/common/wasm/gcd.d.ts +1 -0
  387. package/dist/types/common/wasm/heaviside.d.ts +2 -2
  388. package/dist/types/common/wasm/hypot.d.ts +4 -2
  389. package/dist/types/common/wasm/indices.d.ts +2 -1
  390. package/dist/types/common/wasm/isfinite.d.ts +7 -0
  391. package/dist/types/common/wasm/isnan.d.ts +7 -0
  392. package/dist/types/common/wasm/lexsort.d.ts +3 -1
  393. package/dist/types/common/wasm/logaddexp.d.ts +4 -2
  394. package/dist/types/common/wasm/lu.d.ts +27 -0
  395. package/dist/types/common/wasm/partition.d.ts +3 -1
  396. package/dist/types/common/wasm/reduce_argmax.d.ts +5 -0
  397. package/dist/types/common/wasm/reduce_argmin.d.ts +5 -0
  398. package/dist/types/common/wasm/reduce_prod.d.ts +4 -0
  399. package/dist/types/common/wasm/reduce_quantile.d.ts +11 -3
  400. package/dist/types/common/wasm/reduce_sum.d.ts +10 -0
  401. package/dist/types/common/wasm/rng.d.ts +75 -0
  402. package/dist/types/common/wasm/runtime.d.ts +117 -23
  403. package/dist/types/common/wasm/searchsorted.d.ts +3 -1
  404. package/dist/types/common/wasm/signbit.d.ts +14 -0
  405. package/dist/types/common/wasm/sin.d.ts +17 -0
  406. package/dist/types/common/wasm/sinh.d.ts +4 -2
  407. package/dist/types/common/wasm/sort.d.ts +4 -1
  408. package/dist/types/common/wasm/sqrt.d.ts +4 -2
  409. package/dist/types/common/wasm/svd.d.ts +6 -0
  410. package/dist/types/common/wasm/tan.d.ts +4 -2
  411. package/dist/types/common/wasm/tanh.d.ts +4 -2
  412. package/dist/types/common/wasm/unravel_index.d.ts +12 -0
  413. package/dist/types/common/wasm/vector_norm.d.ts +11 -0
  414. package/dist/types/core/advanced.d.ts +10 -2
  415. package/dist/types/core/creation.d.ts +1 -1
  416. package/dist/types/core/index.d.ts +96 -2
  417. package/dist/types/core/linalg.d.ts +1 -1
  418. package/dist/types/core/rounding.d.ts +0 -2
  419. package/dist/types/core/sets.d.ts +4 -1
  420. package/dist/types/core/statistics.d.ts +2 -1
  421. package/dist/types/full/index.d.ts +19 -6
  422. package/dist/types/index.d.ts +20 -4
  423. package/dist/types/io/file-ops.d.ts +269 -0
  424. package/dist/types/io/filesystem.d.ts +21 -0
  425. package/dist/types/node.d.ts +3 -275
  426. package/package.json +52 -62
  427. package/dist/esm/common/wasm/bins/dot.wasm.js +0 -1
  428. package/dist/esm/common/wasm/bins/flip.wasm.js +0 -1
  429. package/dist/esm/common/wasm/bins/inner.wasm.js +0 -1
  430. package/dist/esm/common/wasm/bins/matmul.wasm.js +0 -1
  431. package/dist/esm/common/wasm/bins/matvec.wasm.js +0 -1
  432. package/dist/esm/common/wasm/bins/reduce_quantile.wasm.js +0 -1
  433. package/dist/esm/common/wasm/bins/rot90.wasm.js +0 -1
  434. package/dist/esm/common/wasm/bins/vecdot.wasm.js +0 -1
  435. package/dist/esm/common/wasm/bins/vecmat.wasm.js +0 -1
  436. package/dist/esm/common/wasm/flip.js +0 -1
  437. package/dist/esm/common/wasm/lstsq.js +0 -1
  438. package/dist/esm/common/wasm/rot90.js +0 -1
  439. package/dist/numpy-ts.node-io.cjs +0 -8
  440. package/dist/numpy-ts.node-io.cjs.map +0 -7
  441. package/dist/numpy-ts.node-io.mjs +0 -8
  442. package/dist/numpy-ts.node-io.mjs.map +0 -7
  443. package/dist/numpy-ts.node.cjs +0 -8
  444. package/dist/numpy-ts.node.cjs.map +0 -7
  445. package/dist/types/common/wasm/bins/dot.wasm.d.ts +0 -9
  446. package/dist/types/common/wasm/bins/flip.wasm.d.ts +0 -7
  447. package/dist/types/common/wasm/bins/inner.wasm.d.ts +0 -9
  448. package/dist/types/common/wasm/bins/matmul.wasm.d.ts +0 -9
  449. package/dist/types/common/wasm/bins/matvec.wasm.d.ts +0 -9
  450. package/dist/types/common/wasm/bins/reduce_quantile.wasm.d.ts +0 -2
  451. package/dist/types/common/wasm/bins/rot90.wasm.d.ts +0 -7
  452. package/dist/types/common/wasm/bins/vecdot.wasm.d.ts +0 -9
  453. package/dist/types/common/wasm/bins/vecmat.wasm.d.ts +0 -9
  454. package/dist/types/common/wasm/flip.d.ts +0 -13
  455. package/dist/types/common/wasm/lstsq.d.ts +0 -14
  456. package/dist/types/common/wasm/rot90.d.ts +0 -14
@@ -3,6 +3,7 @@ import { NDArrayCore } from '../common/ndarray-core';
3
3
  import { Complex } from '../common/complex';
4
4
  import type { DType, TypedArray } from '../core/types';
5
5
  export type { DType, TypedArray } from '../core/types';
6
+ export type { NDIndex } from '../core/advanced';
6
7
  export { NDArray, meshgrid } from './ndarray';
7
8
  export { NDArrayCore } from '../common/ndarray-core';
8
9
  export { Complex } from '../common/complex';
@@ -25,7 +26,7 @@ export declare function iindex(a: NDArrayCore, indices: NDArrayCore | number[] |
25
26
  */
26
27
  export declare function bindex(a: NDArrayCore, mask: NDArrayCore, axis?: number): NDArray;
27
28
  export declare function select(condlist: NDArrayCore[], choicelist: NDArrayCore[], defaultVal?: number): NDArray;
28
- export declare function indices(dimensions: number[], dtype?: 'int32' | 'int64' | 'float64'): NDArray;
29
+ export declare function indices(dimensions: number[], dtype?: string): NDArray;
29
30
  export declare function ravel_multi_index(multi_index: NDArrayCore[], dims: number[], mode?: 'raise' | 'wrap' | 'clip'): NDArray;
30
31
  export declare function unravel_index(indices: NDArrayCore | number, shape: number[]): NDArray[];
31
32
  export declare function diag_indices(n: number, ndim?: number): NDArray[];
@@ -34,9 +35,16 @@ export declare function tril_indices(n: number, k?: number, m?: number): NDArray
34
35
  export declare function tril_indices_from(a: NDArrayCore, k?: number): NDArray[];
35
36
  export declare function triu_indices(n: number, k?: number, m?: number): NDArray[];
36
37
  export declare function triu_indices_from(a: NDArrayCore, k?: number): NDArray[];
37
- export declare function mask_indices(n: number, mask_func: (n: number, k: number) => NDArrayCore, k?: number): NDArray[];
38
+ export declare function mask_indices(n: number, mask_func: (m: NDArrayCore, k: number) => NDArrayCore, k?: number): NDArray[];
38
39
  export declare function apply_along_axis(func1d: (arr: NDArrayCore) => NDArrayCore | number, axis: number, arr: NDArrayCore): NDArray;
39
40
  export declare function apply_over_axes(func: (arr: NDArrayCore, axis: number) => NDArrayCore, a: NDArrayCore, axes: number[]): NDArray;
41
+ /**
42
+ * Vectorized multi-dimensional indexing (dask.vindex semantics).
43
+ *
44
+ * Integer-array subspace dimensions come first in the output, followed by
45
+ * slice dimensions in their original order.
46
+ */
47
+ export declare function vindex(a: NDArrayCore, ...indices: (number | string | number[] | NDArrayCore)[]): NDArray;
40
48
  /** Add arguments element-wise */
41
49
  export declare function add(x1: NDArrayCore, x2: NDArrayCore | number): NDArray;
42
50
  /** Subtract arguments element-wise */
@@ -170,7 +178,7 @@ export declare function zeros(shape: number[], dtype?: DType): NDArray;
170
178
  */
171
179
  export declare function ones(shape: number[], dtype?: DType): NDArray;
172
180
  /**
173
- * Create an uninitialized array (zeros in JS)
181
+ * Create an uninitialized array
174
182
  */
175
183
  export declare function empty(shape: number[], dtype?: DType): NDArray;
176
184
  /**
@@ -449,7 +457,10 @@ export declare function floor(x: NDArrayCore): NDArray;
449
457
  export declare function rint(x: NDArrayCore): NDArray;
450
458
  /** Truncate toward zero */
451
459
  export declare function trunc(x: NDArrayCore): NDArray;
452
- /** Test if elements in ar1 are in ar2 (deprecated, use isin) */
460
+ /**
461
+ * Test if elements in ar1 are in ar2.
462
+ * @deprecated Use {@link isin} instead. `in1d` follows NumPy's deprecation and will be removed in a future release.
463
+ */
453
464
  export declare function in1d(ar1: NDArrayCore, ar2: NDArrayCore): NDArray;
454
465
  /** Find intersection of two arrays */
455
466
  export declare function intersect1d(ar1: NDArrayCore, ar2: NDArrayCore): NDArray;
@@ -564,7 +575,7 @@ export declare function cov(m: NDArrayCore, y?: NDArrayCore, rowvar?: boolean, b
564
575
  /** Correlation coefficients */
565
576
  export declare function corrcoef(x: NDArrayCore, y?: NDArrayCore, rowvar?: boolean): NDArray;
566
577
  /** Integrate using trapezoidal rule */
567
- export declare function trapezoid(y: NDArrayCore, x?: NDArrayCore, dx?: number, axis?: number): NDArray | number;
578
+ export declare function trapezoid(y: NDArrayCore, x?: NDArrayCore, dx?: number, axis?: number): NDArray | number | Complex;
568
579
  /** Sine of array elements */
569
580
  export declare function sin(x: NDArrayCore): NDArray;
570
581
  /** Cosine of array elements */
@@ -601,5 +612,7 @@ export declare function arcsinh(x: NDArrayCore): NDArray;
601
612
  export declare function arccosh(x: NDArrayCore): NDArray;
602
613
  /** Inverse hyperbolic tangent */
603
614
  export declare function arctanh(x: NDArrayCore): NDArray;
604
- export { broadcast_arrays, broadcast_shapes, put, put_along_axis, place, putmask, copyto, ix_, fill_diagonal, array_equal, array_equiv, may_share_memory, shares_memory, geterr, seterr, pow, abs, true_divide, conjugate, array2string, array_repr, array_str, set_printoptions, get_printoptions, printoptions, format_float_positional, format_float_scientific, base_repr, binary_repr, gradient, einsum, einsum_path, vdot, linalg, iscomplexobj, isrealobj, isfortran, isscalar, iterable, isdtype, promote_types, allclose, amax, amin, var_, cumulative_sum, cumulative_prod, round_, unique, unique_all, unique_counts, unique_inverse, split, array_split, vsplit, hsplit, dsplit, atleast_1d, atleast_2d, atleast_3d, row_stack, where, searchsorted, count_nonzero, histogram, histogram2d, histogramdd, histogram_bin_edges, asin, acos, atan, atan2, asinh, acosh, atanh, can_cast, common_type, result_type, min_scalar_type, issubdtype, typename, mintypecode, ndim, shape, size, item, tolist, tobytes, byteswap, view, tofile, fill, } from '../core';
615
+ export { broadcast_arrays, broadcast_shapes, put, put_along_axis, place, putmask, copyto, ix_, fill_diagonal, array_equal, array_equiv, may_share_memory, shares_memory, geterr, seterr, pow, abs, true_divide, conjugate, array2string, array_repr, array_str, set_printoptions, get_printoptions, printoptions, format_float_positional, format_float_scientific, base_repr, binary_repr, gradient, einsum, einsum_path, vdot, linalg, iscomplexobj, isrealobj, isfortran, isscalar, iterable, isdtype, promote_types, allclose, amax, amin, var_, cumulative_sum, cumulative_prod, unique, unique_all, unique_counts, unique_inverse, split, array_split, vsplit, hsplit, dsplit, atleast_1d, atleast_2d, atleast_3d, row_stack, where, searchsorted, count_nonzero, histogram, histogram2d, histogramdd, histogram_bin_edges, asin, acos, atan, atan2, asinh, acosh, atanh, can_cast, common_type, result_type, min_scalar_type, issubdtype, typename, mintypecode, ndim, shape, size, item, tolist, tobytes, byteswap, view, tofile, fill, } from '../core';
616
+ export { wasmConfig } from '../common/wasm/config';
617
+ export { configureWasm } from '../common/wasm/runtime';
605
618
  //# sourceMappingURL=index.d.ts.map
@@ -22,6 +22,7 @@
22
22
  export { Complex, type ComplexInput } from './common/complex';
23
23
  export { NDArray } from './full';
24
24
  export { NDArrayCore } from './common/ndarray-core';
25
+ export { hasFloat16 } from './common/dtype';
25
26
  export { zeros, ones, empty, full, array, arange, linspace, logspace, geomspace, eye, identity, asarray, zeros_like, ones_like, empty_like, full_like, copy, asanyarray, asarray_chkfinite, ascontiguousarray, asfortranarray, require, diag, diagflat, frombuffer, fromfile, fromfunction, fromiter, fromstring, meshgrid, tri, tril, triu, vander, } from './full';
26
27
  export { add, subtract, multiply, divide, true_divide, floor_divide, mod, sqrt, power, exp, exp2, expm1, log, log2, log10, log1p, logaddexp, logaddexp2, absolute, negative, sign, positive, reciprocal, cbrt, fabs, divmod, square, remainder, heaviside, float_power, fmod, frexp, gcd, lcm, ldexp, modf, clip, maximum, minimum, fmax, fmin, nan_to_num, interp, unwrap, sinc, i0, } from './full';
27
28
  export { power as pow, absolute as abs } from './full';
@@ -36,14 +37,15 @@ export { logical_and, logical_or, logical_not, logical_xor, isfinite, isinf, isn
36
37
  export { sort, argsort, lexsort, partition, argpartition, sort_complex, nonzero, argwhere, flatnonzero, where, searchsorted, extract, count_nonzero, } from './full';
37
38
  export { bitwise_and, bitwise_or, bitwise_xor, bitwise_not, invert, left_shift, right_shift, packbits, unpackbits, bitwise_count, } from './full';
38
39
  export { bitwise_not as bitwise_invert, left_shift as bitwise_left_shift, right_shift as bitwise_right_shift, } from './full';
39
- export { around, round_, ceil, fix, floor, rint, trunc } from './full';
40
+ export { around, ceil, fix, floor, rint, trunc } from './full';
40
41
  export { around as round } from './full';
41
42
  export { unique, in1d, intersect1d, isin, setdiff1d, setxor1d, union1d, trim_zeros, unique_all, unique_counts, unique_inverse, unique_values, } from './full';
42
43
  export { bincount, digitize, histogram, histogram2d, histogramdd, correlate, convolve, cov, corrcoef, histogram_bin_edges, trapezoid, } from './full';
43
44
  export { diff, ediff1d, gradient } from './full';
44
45
  export { real, imag, conj, angle } from './full';
45
46
  export { conj as conjugate } from './full';
46
- export { broadcast_to, broadcast_arrays, broadcast_shapes, take, put, iindex, bindex, copyto, choose, array_equal, array_equiv, take_along_axis, put_along_axis, putmask, compress, select, place, fill_diagonal, diag_indices, diag_indices_from, tril_indices, tril_indices_from, triu_indices, triu_indices_from, mask_indices, indices, ix_, ravel_multi_index, unravel_index, fill, item, tolist, tobytes, byteswap, view, tofile, } from './full';
47
+ export { broadcast_to, broadcast_arrays, broadcast_shapes, take, put, iindex, bindex, vindex, copyto, choose, array_equal, array_equiv, take_along_axis, put_along_axis, putmask, compress, select, place, fill_diagonal, diag_indices, diag_indices_from, tril_indices, tril_indices_from, triu_indices, triu_indices_from, mask_indices, indices, ix_, ravel_multi_index, unravel_index, fill, item, tolist, tobytes, byteswap, view, tofile, } from './full';
48
+ export type { NDIndex } from './full';
47
49
  export { apply_along_axis, apply_over_axes, may_share_memory, shares_memory, ndim, shape, size, geterr, seterr, } from './full';
48
50
  export { array2string, array_repr, array_str, base_repr, binary_repr, format_float_positional, format_float_scientific, get_printoptions, set_printoptions, printoptions, } from './full';
49
51
  export { can_cast, common_type, result_type, min_scalar_type, issubdtype, typename, mintypecode, } from './full';
@@ -54,6 +56,7 @@ export type { NpzSerializeOptions } from './io/npz/serializer';
54
56
  export type { ParseTxtOptions } from './io/txt/parser';
55
57
  export type { SerializeTxtOptions } from './io/txt/serializer';
56
58
  export { wasmConfig } from './common/wasm/config';
59
+ export { configureWasm } from './common/wasm/runtime';
57
60
  export { serializeNpy } from './io/npy/serializer';
58
61
  export { serializeNpz, serializeNpzSync } from './io/npz/serializer';
59
62
  export { serializeTxt } from './io/txt/serializer';
@@ -78,6 +81,7 @@ export declare function loadNpzSync(buffer: ArrayBuffer | Uint8Array, options?:
78
81
  export declare function parseTxt(text: string, options?: ParseTxtOptionsType): NDArrayClass;
79
82
  export declare function genfromtxt(text: string, options?: ParseTxtOptionsType): NDArrayClass;
80
83
  export declare function fromregex(text: string, regexp: RegExp | string, dtype?: DTypeIO): NDArrayClass;
84
+ export { type LoadOptions, type SaveNpzOptions, type LoadTxtOptions, type SaveTxtOptions, loadNpy, loadNpySync, saveNpy, saveNpySync, loadNpzFile, loadNpzFileSync, saveNpz as saveNpzFile, saveNpzSync as saveNpzFileSync, savez, savez_compressed, load, loadSync, save, saveSync, loadtxt, loadtxtSync, savetxt, savetxtSync, genfromtxt as genfromtxtFile, genfromtxtSync as genfromtxtFileSync, fromregex as fromregexFile, fromregexSync as fromregexFileSync, } from './io/file-ops';
81
85
  import * as randomOps from './common/ops/random';
82
86
  import { ArrayStorage } from './common/storage';
83
87
  import { NDArray as NDArrayClass } from './full';
@@ -88,7 +92,19 @@ export declare const random: {
88
92
  set_state: typeof randomOps.set_state;
89
93
  get_bit_generator: typeof randomOps.get_bit_generator;
90
94
  set_bit_generator: typeof randomOps.set_bit_generator;
91
- default_rng: typeof randomOps.default_rng;
95
+ default_rng: (seedValue?: number) => {
96
+ random: (size?: number | number[]) => number | ArrayStorage | NDArrayClass;
97
+ integers: (low: number, high?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
98
+ standard_normal: (size?: number | number[]) => number | ArrayStorage | NDArrayClass;
99
+ normal: (loc?: number, scale?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
100
+ uniform: (low?: number, high?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
101
+ choice: (a: number | (ArrayStorage | NDArrayCore | NDArrayClass), size?: number | number[], replace?: boolean, p?: (ArrayStorage | NDArrayCore | NDArrayClass) | number[]) => number | ArrayStorage | NDArrayClass;
102
+ permutation: (x: number | (ArrayStorage | NDArrayCore | NDArrayClass)) => ArrayStorage | NDArrayClass;
103
+ shuffle: (x: ArrayStorage | NDArrayCore | NDArrayClass) => void;
104
+ exponential: (scale?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
105
+ poisson: (lam?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
106
+ binomial: (n: number, p: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
107
+ };
92
108
  Generator: typeof randomOps.Generator;
93
109
  random: (size?: number | number[]) => number | ArrayStorage | NDArrayClass;
94
110
  rand: (...shape: number[]) => number | ArrayStorage | NDArrayClass;
@@ -136,7 +152,7 @@ export declare const random: {
136
152
  vonmises: (mu: number, kappa: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
137
153
  choice: (a: number | ArrayStorage, size?: number | number[], replace?: boolean, p?: ArrayStorage | number[]) => number | ArrayStorage | NDArrayClass;
138
154
  permutation: (x: number | ArrayStorage) => ArrayStorage | NDArrayClass;
139
- shuffle: typeof randomOps.shuffle;
155
+ shuffle: (x: NDArrayClass | NDArrayCore | ArrayStorage) => void;
140
156
  };
141
157
  import { NDArrayCore } from './common/ndarray-core';
142
158
  type ArrayInput = NDArrayClass | NDArrayCore | ArrayStorage;
@@ -0,0 +1,269 @@
1
+ /**
2
+ * File IO operations for numpy-ts.
3
+ *
4
+ * These functions read/write files using the runtime fs abstraction from filesystem.ts.
5
+ * They work in Node.js, Bun, and Deno, and throw clear errors in the browser.
6
+ */
7
+ import { NDArray } from '../full/ndarray';
8
+ import type { NpzParseOptions } from './npz/parser';
9
+ import { type NpzSerializeOptions, type NpzArraysInput } from './npz/serializer';
10
+ import { type ParseTxtOptions, type SerializeTxtOptions } from './txt';
11
+ import type { DType } from '../common/dtype';
12
+ interface NpzParseResultNDArray {
13
+ arrays: Map<string, NDArray>;
14
+ skipped: string[];
15
+ errors: Map<string, string>;
16
+ }
17
+ /**
18
+ * Options for loading NPY/NPZ files
19
+ */
20
+ export interface LoadOptions extends NpzParseOptions {
21
+ /**
22
+ * If true, allow loading .npy files.
23
+ * Default: true
24
+ */
25
+ allowNpy?: boolean;
26
+ }
27
+ /**
28
+ * Options for saving NPZ files
29
+ */
30
+ export type SaveNpzOptions = NpzSerializeOptions;
31
+ /**
32
+ * Options for loadtxt
33
+ */
34
+ export type LoadTxtOptions = ParseTxtOptions;
35
+ /**
36
+ * Options for savetxt
37
+ */
38
+ export type SaveTxtOptions = SerializeTxtOptions;
39
+ /**
40
+ * Load an NDArray from a .npy file
41
+ *
42
+ * @param path - Path to the .npy file
43
+ * @returns The loaded NDArray
44
+ */
45
+ export declare function loadNpy(path: string): Promise<NDArray>;
46
+ /**
47
+ * Synchronously load an NDArray from a .npy file
48
+ *
49
+ * @param path - Path to the .npy file
50
+ * @returns The loaded NDArray
51
+ */
52
+ export declare function loadNpySync(path: string): NDArray;
53
+ /**
54
+ * Save an NDArray to a .npy file
55
+ *
56
+ * @param path - Path to save the .npy file
57
+ * @param arr - The NDArray to save
58
+ */
59
+ export declare function saveNpy(path: string, arr: NDArray): Promise<void>;
60
+ /**
61
+ * Synchronously save an NDArray to a .npy file
62
+ *
63
+ * @param path - Path to save the .npy file
64
+ * @param arr - The NDArray to save
65
+ */
66
+ export declare function saveNpySync(path: string, arr: NDArray): void;
67
+ /**
68
+ * Load arrays from a .npz file
69
+ *
70
+ * @param path - Path to the .npz file
71
+ * @param options - Load options
72
+ * @returns Object with array names as keys
73
+ */
74
+ export declare function loadNpzFile(path: string, options?: NpzParseOptions): Promise<NpzParseResultNDArray>;
75
+ /**
76
+ * Synchronously load arrays from a .npz file
77
+ *
78
+ * Note: Only works if the NPZ file is not DEFLATE compressed.
79
+ *
80
+ * @param path - Path to the .npz file
81
+ * @param options - Load options
82
+ * @returns Object with array names as keys
83
+ */
84
+ export declare function loadNpzFileSync(path: string, options?: NpzParseOptions): NpzParseResultNDArray;
85
+ /**
86
+ * Save arrays to a .npz file
87
+ *
88
+ * @param path - Path to save the .npz file
89
+ * @param arrays - Arrays to save:
90
+ * - Array of NDArrays (positional, named arr_0, arr_1, etc.)
91
+ * - Map of names to NDArrays
92
+ * - Object with names as keys
93
+ * @param options - Save options
94
+ */
95
+ export declare function saveNpz(path: string, arrays: NpzArraysInput, options?: SaveNpzOptions): Promise<void>;
96
+ /**
97
+ * Synchronously save arrays to a .npz file (no compression)
98
+ *
99
+ * @param path - Path to save the .npz file
100
+ * @param arrays - Arrays to save (same types as saveNpz)
101
+ */
102
+ export declare function saveNpzSync(path: string, arrays: NpzArraysInput): void;
103
+ /**
104
+ * Load an array or arrays from a .npy or .npz file
105
+ *
106
+ * This is a convenience function that auto-detects the file format based on extension.
107
+ *
108
+ * @param path - Path to the file
109
+ * @param options - Load options
110
+ * @returns NDArray for .npy files, or NpzParseResult for .npz files
111
+ */
112
+ export declare function load(path: string, options?: LoadOptions): Promise<NDArray | NpzParseResultNDArray>;
113
+ /**
114
+ * Synchronously load an array or arrays from a .npy or .npz file
115
+ *
116
+ * @param path - Path to the file
117
+ * @param options - Load options
118
+ * @returns NDArray for .npy files, or NpzParseResult for .npz files
119
+ */
120
+ export declare function loadSync(path: string, options?: LoadOptions): NDArray | NpzParseResultNDArray;
121
+ /**
122
+ * Save an array to a .npy file
123
+ *
124
+ * @param path - Path to save the file (should end with .npy)
125
+ * @param arr - The NDArray to save
126
+ */
127
+ export declare function save(path: string, arr: NDArray): Promise<void>;
128
+ /**
129
+ * Synchronously save an array to a .npy file
130
+ *
131
+ * @param path - Path to save the file (should end with .npy)
132
+ * @param arr - The NDArray to save
133
+ */
134
+ export declare function saveSync(path: string, arr: NDArray): void;
135
+ /**
136
+ * Save multiple arrays to a .npz file (like np.savez)
137
+ *
138
+ * @param path - Path to save the .npz file
139
+ * @param arrays - Arrays to save:
140
+ * - Array of NDArrays: named arr_0, arr_1, etc. (like np.savez positional args)
141
+ * - Object/Map with names as keys (like np.savez keyword args)
142
+ *
143
+ * @example
144
+ * // Positional arrays
145
+ * await savez('data.npz', [arr1, arr2]) // saved as arr_0, arr_1
146
+ *
147
+ * // Named arrays
148
+ * await savez('data.npz', { x: arr1, y: arr2 })
149
+ */
150
+ export declare function savez(path: string, arrays: NpzArraysInput): Promise<void>;
151
+ /**
152
+ * Save multiple arrays to a compressed .npz file (like np.savez_compressed)
153
+ *
154
+ * @param path - Path to save the .npz file
155
+ * @param arrays - Arrays to save (same input types as savez)
156
+ */
157
+ export declare function savez_compressed(path: string, arrays: NpzArraysInput): Promise<void>;
158
+ /**
159
+ * Load data from a text file.
160
+ *
161
+ * Each row in the text file must have the same number of values.
162
+ *
163
+ * @param path - Path to the text file
164
+ * @param options - Load options
165
+ * @returns NDArray with the loaded data
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * // Load a CSV file
170
+ * const arr = await loadtxt('data.csv', { delimiter: ',' });
171
+ *
172
+ * // Load with specific columns
173
+ * const arr = await loadtxt('data.txt', { usecols: [0, 2] });
174
+ *
175
+ * // Skip header rows
176
+ * const arr = await loadtxt('data.txt', { skiprows: 1 });
177
+ * ```
178
+ */
179
+ export declare function loadtxt(path: string, options?: LoadTxtOptions): Promise<NDArray>;
180
+ /**
181
+ * Synchronously load data from a text file.
182
+ *
183
+ * @param path - Path to the text file
184
+ * @param options - Load options
185
+ * @returns NDArray with the loaded data
186
+ */
187
+ export declare function loadtxtSync(path: string, options?: LoadTxtOptions): NDArray;
188
+ /**
189
+ * Save an array to a text file.
190
+ *
191
+ * @param path - Path to save the text file
192
+ * @param arr - The array to save (must be 1D or 2D)
193
+ * @param options - Save options
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * // Save as CSV
198
+ * await savetxt('data.csv', arr, { delimiter: ',' });
199
+ *
200
+ * // Save with custom format
201
+ * await savetxt('data.txt', arr, { fmt: '%.2f', delimiter: '\t' });
202
+ *
203
+ * // Save with header
204
+ * await savetxt('data.txt', arr, { header: 'x y z' });
205
+ * ```
206
+ */
207
+ export declare function savetxt(path: string, arr: NDArray, options?: SaveTxtOptions): Promise<void>;
208
+ /**
209
+ * Synchronously save an array to a text file.
210
+ *
211
+ * @param path - Path to save the text file
212
+ * @param arr - The array to save (must be 1D or 2D)
213
+ * @param options - Save options
214
+ */
215
+ export declare function savetxtSync(path: string, arr: NDArray, options?: SaveTxtOptions): void;
216
+ /**
217
+ * Load data from a text file with more flexible handling.
218
+ *
219
+ * Similar to loadtxt but handles missing values more gracefully.
220
+ *
221
+ * @param path - Path to the text file
222
+ * @param options - Load options
223
+ * @returns NDArray with the loaded data
224
+ *
225
+ * @example
226
+ * ```typescript
227
+ * // Load file with missing values
228
+ * const arr = await genfromtxt('data.csv', {
229
+ * delimiter: ',',
230
+ * missing_values: ['NA', ''],
231
+ * filling_values: 0
232
+ * });
233
+ * ```
234
+ */
235
+ export declare function genfromtxt(path: string, options?: LoadTxtOptions): Promise<NDArray>;
236
+ /**
237
+ * Synchronously load data from a text file with more flexible handling.
238
+ *
239
+ * @param path - Path to the text file
240
+ * @param options - Load options
241
+ * @returns NDArray with the loaded data
242
+ */
243
+ export declare function genfromtxtSync(path: string, options?: LoadTxtOptions): NDArray;
244
+ /**
245
+ * Load data from a text file using regular expressions.
246
+ *
247
+ * @param path - Path to the text file
248
+ * @param regexp - Regular expression with capture groups for extracting values
249
+ * @param dtype - Data type of the resulting array (default: 'float64')
250
+ * @returns NDArray with the extracted data
251
+ *
252
+ * @example
253
+ * ```typescript
254
+ * // Extract x,y pairs from "Point: x=1.0, y=2.0" format
255
+ * const arr = await fromregex('points.txt', /x=([\d.]+), y=([\d.]+)/);
256
+ * ```
257
+ */
258
+ export declare function fromregex(path: string, regexp: RegExp | string, dtype?: DType): Promise<NDArray>;
259
+ /**
260
+ * Synchronously load data from a text file using regular expressions.
261
+ *
262
+ * @param path - Path to the text file
263
+ * @param regexp - Regular expression with capture groups for extracting values
264
+ * @param dtype - Data type of the resulting array (default: 'float64')
265
+ * @returns NDArray with the extracted data
266
+ */
267
+ export declare function fromregexSync(path: string, regexp: RegExp | string, dtype?: DType): NDArray;
268
+ export {};
269
+ //# sourceMappingURL=file-ops.d.ts.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Runtime filesystem abstraction for cross-platform file IO.
3
+ *
4
+ * Pre-loads `node:fs` and `node:fs/promises` asynchronously at module load
5
+ * in Node-like environments. Both getFs() and getFsSync() read from this cache.
6
+ * In browsers, all IO functions throw a helpful error.
7
+ */
8
+ type FsPromises = typeof import('node:fs/promises');
9
+ type FsSync = typeof import('node:fs');
10
+ /**
11
+ * Get the async fs module (`node:fs/promises`).
12
+ * Caches the result after the first successful resolution.
13
+ */
14
+ export declare function getFs(): Promise<FsPromises>;
15
+ /**
16
+ * Get the sync fs module (`node:fs`).
17
+ * Reads from the cache populated at module load time or by a prior getFs() call.
18
+ */
19
+ export declare function getFsSync(): FsSync;
20
+ export {};
21
+ //# sourceMappingURL=filesystem.d.ts.map