@danielsimonjr/mathts-core 0.14.3 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/arithmetic/scalar.d.ts +56 -0
  2. package/dist/arithmetic/scalar.d.ts.map +1 -0
  3. package/dist/array.d.ts +265 -0
  4. package/dist/array.d.ts.map +1 -0
  5. package/dist/bignumber-formatter.d.ts +135 -0
  6. package/dist/bignumber-formatter.d.ts.map +1 -0
  7. package/dist/collection.d.ts +67 -0
  8. package/dist/collection.d.ts.map +1 -0
  9. package/dist/config.d.ts +20 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/constants.d.ts +30 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/customs.d.ts +44 -0
  14. package/dist/customs.d.ts.map +1 -0
  15. package/dist/error/DimensionError.d.ts +28 -0
  16. package/dist/error/DimensionError.d.ts.map +1 -0
  17. package/dist/error/IndexError.d.ts +41 -0
  18. package/dist/error/IndexError.d.ts.map +1 -0
  19. package/dist/error/MathjsError.d.ts +13 -0
  20. package/dist/error/MathjsError.d.ts.map +1 -0
  21. package/dist/factory/factory.d.ts +154 -0
  22. package/dist/factory/factory.d.ts.map +1 -0
  23. package/dist/factory/index.d.ts +6 -0
  24. package/dist/factory/index.d.ts.map +1 -0
  25. package/dist/factory.d.ts +122 -0
  26. package/dist/factory.d.ts.map +1 -0
  27. package/dist/index.d.ts +24 -2593
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +36 -18
  30. package/dist/internal.d.ts +33 -1344
  31. package/dist/internal.d.ts.map +1 -0
  32. package/dist/internal.js +36 -6
  33. package/dist/is.d.ts +256 -0
  34. package/dist/is.d.ts.map +1 -0
  35. package/dist/map.d.ts +147 -0
  36. package/dist/map.d.ts.map +1 -0
  37. package/dist/number.d.ts +314 -0
  38. package/dist/number.d.ts.map +1 -0
  39. package/dist/numeric/stable.d.ts +130 -0
  40. package/dist/numeric/stable.d.ts.map +1 -0
  41. package/dist/object.d.ts +119 -0
  42. package/dist/object.d.ts.map +1 -0
  43. package/dist/shared.d.ts +41 -0
  44. package/dist/shared.d.ts.map +1 -0
  45. package/dist/string.d.ts +70 -0
  46. package/dist/string.d.ts.map +1 -0
  47. package/dist/switch.d.ts +9 -0
  48. package/dist/switch.d.ts.map +1 -0
  49. package/dist/typed/index.d.ts +7 -0
  50. package/dist/typed/index.d.ts.map +1 -0
  51. package/dist/typed/mathts-typed.d.ts +246 -0
  52. package/dist/typed/mathts-typed.d.ts.map +1 -0
  53. package/dist/typed/type-bridge.d.ts +9 -0
  54. package/dist/typed/type-bridge.d.ts.map +1 -0
  55. package/dist/types/bignumber.d.ts +370 -0
  56. package/dist/types/bignumber.d.ts.map +1 -0
  57. package/dist/types/complex.d.ts +284 -0
  58. package/dist/types/complex.d.ts.map +1 -0
  59. package/dist/types/dual-rules.d.ts +129 -0
  60. package/dist/types/dual-rules.d.ts.map +1 -0
  61. package/dist/types/dual.d.ts +39 -0
  62. package/dist/types/dual.d.ts.map +1 -0
  63. package/dist/types/fraction.d.ts +215 -0
  64. package/dist/types/fraction.d.ts.map +1 -0
  65. package/dist/types/interfaces.d.ts +143 -0
  66. package/dist/types/interfaces.d.ts.map +1 -0
  67. package/dist/types/matrix/Range.d.ts +767 -0
  68. package/dist/types/matrix/Range.d.ts.map +1 -0
  69. package/dist/types/unit/Unit.d.ts +3 -0
  70. package/dist/types/unit/Unit.d.ts.map +1 -0
  71. package/dist/types/unit/dependencies.d.ts +4 -0
  72. package/dist/types/unit/dependencies.d.ts.map +1 -0
  73. package/dist/types/unit/errors.d.ts +18 -0
  74. package/dist/types/unit/errors.d.ts.map +1 -0
  75. package/dist/types/unit/index.d.ts +7 -0
  76. package/dist/types/unit/index.d.ts.map +1 -0
  77. package/dist/types/unit/unit-types.d.ts +231 -0
  78. package/dist/types/unit/unit-types.d.ts.map +1 -0
  79. package/dist/types/unit-definitions.d.ts +79 -0
  80. package/dist/types/unit-definitions.d.ts.map +1 -0
  81. package/dist/types/unit-prefixes.d.ts +29 -0
  82. package/dist/types/unit-prefixes.d.ts.map +1 -0
  83. package/dist/types/unit.d.ts +28 -0
  84. package/dist/types/unit.d.ts.map +1 -0
  85. package/dist/types/wasm-loader.d.ts +35 -0
  86. package/dist/types/wasm-loader.d.ts.map +1 -0
  87. package/dist/wasm-loader.d.ts +97 -0
  88. package/dist/wasm-loader.d.ts.map +1 -0
  89. package/package.json +8 -8
  90. package/dist/index-B4LIOfHN.d.ts +0 -449
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,YAAY,EACV,WAAW,EACX,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,SAAS,EACT,CAAC,EACD,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,GACV,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG9E,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG3F,OAAO,EACL,QAAQ,EACR,UAAU,EACV,aA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aAAa,EACb,aAAa,EACb,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAW5B,eAAO,MAAM,OAAO,EAAE,MAAwB,CAAC;AAI/C,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,GACrB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -75,12 +75,30 @@ var createRangeClass = /* @__PURE__ */ factory(
75
75
  */
76
76
  step;
77
77
  /**
78
- * Cached primitive array representation
78
+ * Cached primitive array representation.
79
+ *
80
+ * @internal Not part of the public API.
81
+ *
82
+ * These four were ES-private (`#cache`) until TypeScript 7. This class is
83
+ * returned from a `factory()` call, so declaration emit describes it as an
84
+ * ANONYMOUS class type -- and TS4094 forbids private or protected members
85
+ * there, because an anonymous type has no name to refer them to. The
86
+ * underscore prefix keeps the "do not touch" signal without the emit
87
+ * failure. Restore `#` if the class is ever hoisted out of the factory.
88
+ */
89
+ _cache = null;
90
+ _cacheStart;
91
+ _cacheEnd;
92
+ _cacheStep;
93
+ /**
94
+ * Create a range from start to end with a step.
95
+ *
96
+ * @param start - Included lower bound. Default is 0.
97
+ * @param end - Excluded upper bound. Default is 0.
98
+ * @param step - Optional step size. Default is 1.
99
+ * @throws TypeError when start, end or step is not a number, bigint or BigNumber.
100
+ * @throws Error when step is zero.
79
101
  */
80
- #cache = null;
81
- #cacheStart;
82
- #cacheEnd;
83
- #cacheStep;
84
102
  constructor(start, end, step) {
85
103
  if (!(this instanceof Range2)) {
86
104
  throw new SyntaxError("Constructor must be called with the new operator");
@@ -131,7 +149,7 @@ var createRangeClass = /* @__PURE__ */ factory(
131
149
  * If the string does not contain a valid range, null is returned.
132
150
  * For example str='0:2:11'.
133
151
  * @memberof Range
134
- * @param {string} str
152
+ * @param str
135
153
  * @return {Range | null} range
136
154
  */
137
155
  static parse(str) {
@@ -223,7 +241,7 @@ var createRangeClass = /* @__PURE__ */ factory(
223
241
  /**
224
242
  * Execute a callback function for each value in the range.
225
243
  * @memberof Range
226
- * @param {function} callback The callback method is invoked with three
244
+ * @param callback - The callback method is invoked with three
227
245
  * parameters: the value of the element, the index
228
246
  * of the element, and the Range being traversed.
229
247
  */
@@ -250,7 +268,7 @@ var createRangeClass = /* @__PURE__ */ factory(
250
268
  * Execute a callback function for each value in the Range, and return the
251
269
  * results as an array
252
270
  * @memberof Range
253
- * @param {function} callback The callback method is invoked with three
271
+ * @param callback - The callback method is invoked with three
254
272
  * parameters: the value of the element, the index
255
273
  * of the element, and the Matrix being traversed.
256
274
  * @returns {Array} array
@@ -280,20 +298,20 @@ var createRangeClass = /* @__PURE__ */ factory(
280
298
  * @returns {Array} array
281
299
  */
282
300
  valueOf() {
283
- if (this.#cache !== null && this.start === this.#cacheStart && this.end === this.#cacheEnd && this.step === this.#cacheStep) {
284
- return this.#cache;
301
+ if (this._cache !== null && this.start === this._cacheStart && this.end === this._cacheEnd && this.step === this._cacheStep) {
302
+ return this._cache;
285
303
  }
286
- this.#cache = this.toArray();
287
- this.#cacheStart = this.start;
288
- this.#cacheEnd = this.end;
289
- this.#cacheStep = this.step;
290
- return this.#cache;
304
+ this._cache = this.toArray();
305
+ this._cacheStart = this.start;
306
+ this._cacheEnd = this.end;
307
+ this._cacheStep = this.step;
308
+ return this._cache;
291
309
  }
292
310
  /**
293
311
  * Get a string representation of the range, with optional formatting options.
294
312
  * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11'
295
313
  * @memberof Range
296
- * @param {Object | number | function} [options] Formatting options. See
314
+ * @param options - Optional. Formatting options. See
297
315
  * lib/utils/number:format for a
298
316
  * description of the available
299
317
  * options.
@@ -332,7 +350,7 @@ var createRangeClass = /* @__PURE__ */ factory(
332
350
  /**
333
351
  * Instantiate a Range from a JSON object
334
352
  * @memberof Range
335
- * @param {Object} json A JSON object structured as:
353
+ * @param json - A JSON object structured as:
336
354
  * `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}`
337
355
  * @return {Range}
338
356
  */
@@ -1368,7 +1386,7 @@ function neumaierCumsum(xs, out) {
1368
1386
  }
1369
1387
 
1370
1388
  // src/index.ts
1371
- var VERSION = "0.14.3";
1389
+ var VERSION = "0.15.1";
1372
1390
  export {
1373
1391
  ALL_UNITS,
1374
1392
  BASE_UNITS,