mathjs 11.3.1 → 11.3.3
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.
- package/HISTORY.md +17 -0
- package/README.md +1 -1
- package/lib/browser/math.js +1 -1
- package/lib/browser/math.js.LICENSE.txt +2 -2
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js +1 -1
- package/lib/cjs/function/matrix/sqrtm.js +1 -1
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/type/matrix/SparseMatrix.js +4 -2
- package/lib/cjs/type/unit/Unit.js +8 -8
- package/lib/cjs/utils/map.js +8 -6
- package/lib/cjs/version.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js +1 -1
- package/lib/esm/function/matrix/sqrtm.js +1 -1
- package/lib/esm/type/matrix/SparseMatrix.js +4 -2
- package/lib/esm/type/unit/Unit.js +8 -8
- package/lib/esm/version.js +1 -1
- package/package.json +14 -14
- package/types/index.d.ts +104 -49
@@ -9,7 +9,7 @@ var sqrtmDocs = {
|
|
9
9
|
category: 'Arithmetic',
|
10
10
|
syntax: ['sqrtm(x)'],
|
11
11
|
description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',
|
12
|
-
examples: ['sqrtm([[
|
12
|
+
examples: ['sqrtm([[33, 24], [48, 57]])'],
|
13
13
|
seealso: ['sqrt', 'abs', 'square', 'multiply']
|
14
14
|
};
|
15
15
|
exports.sqrtmDocs = sqrtmDocs;
|
@@ -63,7 +63,7 @@ var createSqrtm = /* #__PURE__ */(0, _factory.factory)(name, dependencies, funct
|
|
63
63
|
*
|
64
64
|
* Examples:
|
65
65
|
*
|
66
|
-
* math.sqrtm([[
|
66
|
+
* math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]]
|
67
67
|
*
|
68
68
|
* See also:
|
69
69
|
*
|
package/lib/cjs/header.js
CHANGED
@@ -6,8 +6,8 @@
|
|
6
6
|
* It features real and complex numbers, units, matrices, a large set of
|
7
7
|
* mathematical functions, and a flexible expression parser.
|
8
8
|
*
|
9
|
-
* @version 11.3.
|
10
|
-
* @date 2022-
|
9
|
+
* @version 11.3.3
|
10
|
+
* @date 2022-11-07
|
11
11
|
*
|
12
12
|
* @license
|
13
13
|
* Copyright (C) 2013-2022 Jos de Jong <wjosdejong@gmail.com>
|
@@ -532,8 +532,10 @@ var createSparseMatrixClass = /* #__PURE__ */(0, _factory.factory)(name, depende
|
|
532
532
|
_remove(k, j, this._values, this._index, this._ptr);
|
533
533
|
}
|
534
534
|
} else {
|
535
|
-
|
536
|
-
|
535
|
+
if (!eq(v, zero)) {
|
536
|
+
// insert value @ (i, j)
|
537
|
+
_insert(k, i, j, v, this._values, this._index, this._ptr);
|
538
|
+
}
|
537
539
|
}
|
538
540
|
return this;
|
539
541
|
};
|
@@ -2753,56 +2753,56 @@ var createUnitClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, f
|
|
2753
2753
|
K: {
|
2754
2754
|
name: 'K',
|
2755
2755
|
base: BASE_UNITS.TEMPERATURE,
|
2756
|
-
prefixes: PREFIXES.
|
2756
|
+
prefixes: PREFIXES.SHORT,
|
2757
2757
|
value: 1,
|
2758
2758
|
offset: 0
|
2759
2759
|
},
|
2760
2760
|
degC: {
|
2761
2761
|
name: 'degC',
|
2762
2762
|
base: BASE_UNITS.TEMPERATURE,
|
2763
|
-
prefixes: PREFIXES.
|
2763
|
+
prefixes: PREFIXES.SHORT,
|
2764
2764
|
value: 1,
|
2765
2765
|
offset: 273.15
|
2766
2766
|
},
|
2767
2767
|
degF: {
|
2768
2768
|
name: 'degF',
|
2769
2769
|
base: BASE_UNITS.TEMPERATURE,
|
2770
|
-
prefixes: PREFIXES.
|
2770
|
+
prefixes: PREFIXES.SHORT,
|
2771
2771
|
value: 1 / 1.8,
|
2772
2772
|
offset: 459.67
|
2773
2773
|
},
|
2774
2774
|
degR: {
|
2775
2775
|
name: 'degR',
|
2776
2776
|
base: BASE_UNITS.TEMPERATURE,
|
2777
|
-
prefixes: PREFIXES.
|
2777
|
+
prefixes: PREFIXES.SHORT,
|
2778
2778
|
value: 1 / 1.8,
|
2779
2779
|
offset: 0
|
2780
2780
|
},
|
2781
2781
|
kelvin: {
|
2782
2782
|
name: 'kelvin',
|
2783
2783
|
base: BASE_UNITS.TEMPERATURE,
|
2784
|
-
prefixes: PREFIXES.
|
2784
|
+
prefixes: PREFIXES.LONG,
|
2785
2785
|
value: 1,
|
2786
2786
|
offset: 0
|
2787
2787
|
},
|
2788
2788
|
celsius: {
|
2789
2789
|
name: 'celsius',
|
2790
2790
|
base: BASE_UNITS.TEMPERATURE,
|
2791
|
-
prefixes: PREFIXES.
|
2791
|
+
prefixes: PREFIXES.LONG,
|
2792
2792
|
value: 1,
|
2793
2793
|
offset: 273.15
|
2794
2794
|
},
|
2795
2795
|
fahrenheit: {
|
2796
2796
|
name: 'fahrenheit',
|
2797
2797
|
base: BASE_UNITS.TEMPERATURE,
|
2798
|
-
prefixes: PREFIXES.
|
2798
|
+
prefixes: PREFIXES.LONG,
|
2799
2799
|
value: 1 / 1.8,
|
2800
2800
|
offset: 459.67
|
2801
2801
|
},
|
2802
2802
|
rankine: {
|
2803
2803
|
name: 'rankine',
|
2804
2804
|
base: BASE_UNITS.TEMPERATURE,
|
2805
|
-
prefixes: PREFIXES.
|
2805
|
+
prefixes: PREFIXES.LONG,
|
2806
2806
|
value: 1 / 1.8,
|
2807
2807
|
offset: 0
|
2808
2808
|
},
|
package/lib/cjs/utils/map.js
CHANGED
@@ -24,7 +24,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
24
24
|
* forwarding on to the SafeProperty functions. Over time, the codebase
|
25
25
|
* will stop using this method, as all objects will be Maps, rather than
|
26
26
|
* more security prone objects.
|
27
|
-
*/
|
27
|
+
*/
|
28
|
+
var ObjectWrappingMap = /*#__PURE__*/function () {
|
28
29
|
function ObjectWrappingMap(object) {
|
29
30
|
(0, _classCallCheck2["default"])(this, ObjectWrappingMap);
|
30
31
|
this.wrappedObject = object;
|
@@ -52,11 +53,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
52
53
|
}
|
53
54
|
}]);
|
54
55
|
return ObjectWrappingMap;
|
55
|
-
}();
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
}();
|
57
|
+
/**
|
58
|
+
* Creates an empty map, or whatever your platform's polyfill is.
|
59
|
+
*
|
60
|
+
* @returns an empty Map or Map like object.
|
61
|
+
*/
|
60
62
|
exports.ObjectWrappingMap = ObjectWrappingMap;
|
61
63
|
function createEmptyMap() {
|
62
64
|
return new Map();
|
package/lib/cjs/version.js
CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.version = void 0;
|
7
|
-
var version = '11.3.
|
7
|
+
var version = '11.3.3';
|
8
8
|
// Note: This file is automatically generated when building math.js.
|
9
9
|
// Changes made in this file will be overwritten.
|
10
10
|
exports.version = version;
|
@@ -3,6 +3,6 @@ export var sqrtmDocs = {
|
|
3
3
|
category: 'Arithmetic',
|
4
4
|
syntax: ['sqrtm(x)'],
|
5
5
|
description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',
|
6
|
-
examples: ['sqrtm([[
|
6
|
+
examples: ['sqrtm([[33, 24], [48, 57]])'],
|
7
7
|
seealso: ['sqrt', 'abs', 'square', 'multiply']
|
8
8
|
};
|
@@ -59,7 +59,7 @@ export var createSqrtm = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
59
59
|
*
|
60
60
|
* Examples:
|
61
61
|
*
|
62
|
-
* math.sqrtm([[
|
62
|
+
* math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]]
|
63
63
|
*
|
64
64
|
* See also:
|
65
65
|
*
|
@@ -526,8 +526,10 @@ export var createSparseMatrixClass = /* #__PURE__ */factory(name, dependencies,
|
|
526
526
|
_remove(k, j, this._values, this._index, this._ptr);
|
527
527
|
}
|
528
528
|
} else {
|
529
|
-
|
530
|
-
|
529
|
+
if (!eq(v, zero)) {
|
530
|
+
// insert value @ (i, j)
|
531
|
+
_insert(k, i, j, v, this._values, this._index, this._ptr);
|
532
|
+
}
|
531
533
|
}
|
532
534
|
return this;
|
533
535
|
};
|
@@ -2739,56 +2739,56 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
2739
2739
|
K: {
|
2740
2740
|
name: 'K',
|
2741
2741
|
base: BASE_UNITS.TEMPERATURE,
|
2742
|
-
prefixes: PREFIXES.
|
2742
|
+
prefixes: PREFIXES.SHORT,
|
2743
2743
|
value: 1,
|
2744
2744
|
offset: 0
|
2745
2745
|
},
|
2746
2746
|
degC: {
|
2747
2747
|
name: 'degC',
|
2748
2748
|
base: BASE_UNITS.TEMPERATURE,
|
2749
|
-
prefixes: PREFIXES.
|
2749
|
+
prefixes: PREFIXES.SHORT,
|
2750
2750
|
value: 1,
|
2751
2751
|
offset: 273.15
|
2752
2752
|
},
|
2753
2753
|
degF: {
|
2754
2754
|
name: 'degF',
|
2755
2755
|
base: BASE_UNITS.TEMPERATURE,
|
2756
|
-
prefixes: PREFIXES.
|
2756
|
+
prefixes: PREFIXES.SHORT,
|
2757
2757
|
value: 1 / 1.8,
|
2758
2758
|
offset: 459.67
|
2759
2759
|
},
|
2760
2760
|
degR: {
|
2761
2761
|
name: 'degR',
|
2762
2762
|
base: BASE_UNITS.TEMPERATURE,
|
2763
|
-
prefixes: PREFIXES.
|
2763
|
+
prefixes: PREFIXES.SHORT,
|
2764
2764
|
value: 1 / 1.8,
|
2765
2765
|
offset: 0
|
2766
2766
|
},
|
2767
2767
|
kelvin: {
|
2768
2768
|
name: 'kelvin',
|
2769
2769
|
base: BASE_UNITS.TEMPERATURE,
|
2770
|
-
prefixes: PREFIXES.
|
2770
|
+
prefixes: PREFIXES.LONG,
|
2771
2771
|
value: 1,
|
2772
2772
|
offset: 0
|
2773
2773
|
},
|
2774
2774
|
celsius: {
|
2775
2775
|
name: 'celsius',
|
2776
2776
|
base: BASE_UNITS.TEMPERATURE,
|
2777
|
-
prefixes: PREFIXES.
|
2777
|
+
prefixes: PREFIXES.LONG,
|
2778
2778
|
value: 1,
|
2779
2779
|
offset: 273.15
|
2780
2780
|
},
|
2781
2781
|
fahrenheit: {
|
2782
2782
|
name: 'fahrenheit',
|
2783
2783
|
base: BASE_UNITS.TEMPERATURE,
|
2784
|
-
prefixes: PREFIXES.
|
2784
|
+
prefixes: PREFIXES.LONG,
|
2785
2785
|
value: 1 / 1.8,
|
2786
2786
|
offset: 459.67
|
2787
2787
|
},
|
2788
2788
|
rankine: {
|
2789
2789
|
name: 'rankine',
|
2790
2790
|
base: BASE_UNITS.TEMPERATURE,
|
2791
|
-
prefixes: PREFIXES.
|
2791
|
+
prefixes: PREFIXES.LONG,
|
2792
2792
|
value: 1 / 1.8,
|
2793
2793
|
offset: 0
|
2794
2794
|
},
|
package/lib/esm/version.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mathjs",
|
3
|
-
"version": "11.3.
|
3
|
+
"version": "11.3.3",
|
4
4
|
"description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.",
|
5
5
|
"author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
|
6
6
|
"homepage": "https://mathjs.org",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"unit"
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
|
-
"@babel/runtime": "^7.
|
28
|
+
"@babel/runtime": "^7.20.1",
|
29
29
|
"complex.js": "^2.1.1",
|
30
30
|
"decimal.js": "^10.4.2",
|
31
31
|
"escape-latex": "^1.2.0",
|
@@ -36,31 +36,31 @@
|
|
36
36
|
"typed-function": "^4.1.0"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@babel/core": "7.
|
39
|
+
"@babel/core": "7.20.2",
|
40
40
|
"@babel/plugin-transform-object-assign": "7.18.6",
|
41
|
-
"@babel/plugin-transform-runtime": "7.19.
|
42
|
-
"@babel/preset-env": "7.
|
41
|
+
"@babel/plugin-transform-runtime": "7.19.6",
|
42
|
+
"@babel/preset-env": "7.20.2",
|
43
43
|
"@babel/register": "7.18.9",
|
44
44
|
"@types/assert": "1.5.6",
|
45
45
|
"@types/mocha": "10.0.0",
|
46
|
-
"@typescript-eslint/eslint-plugin": "5.
|
47
|
-
"@typescript-eslint/parser": "5.
|
46
|
+
"@typescript-eslint/eslint-plugin": "5.42.0",
|
47
|
+
"@typescript-eslint/parser": "5.42.0",
|
48
48
|
"assert": "2.0.0",
|
49
|
-
"babel-loader": "
|
49
|
+
"babel-loader": "9.1.0",
|
50
50
|
"benchmark": "2.1.4",
|
51
51
|
"codecov": "3.8.3",
|
52
|
-
"core-js": "3.
|
52
|
+
"core-js": "3.26.0",
|
53
53
|
"del": "6.1.1",
|
54
54
|
"dtslint": "4.2.1",
|
55
|
-
"eslint": "8.
|
55
|
+
"eslint": "8.27.0",
|
56
56
|
"eslint-config-prettier": "8.5.0",
|
57
57
|
"eslint-config-standard": "17.0.0",
|
58
58
|
"eslint-plugin-import": "2.26.0",
|
59
59
|
"eslint-plugin-mocha": "10.1.0",
|
60
|
-
"eslint-plugin-n": "15.
|
60
|
+
"eslint-plugin-n": "15.5.0",
|
61
61
|
"eslint-plugin-prettier": "4.2.1",
|
62
|
-
"eslint-plugin-promise": "6.1.
|
63
|
-
"expect-type": "0.
|
62
|
+
"eslint-plugin-promise": "6.1.1",
|
63
|
+
"expect-type": "0.15.0",
|
64
64
|
"expr-eval": "2.0.2",
|
65
65
|
"fancy-log": "2.0.0",
|
66
66
|
"glob": "8.0.3",
|
@@ -78,7 +78,7 @@
|
|
78
78
|
"math-expression-evaluator": "1.4.0",
|
79
79
|
"mkdirp": "1.0.4",
|
80
80
|
"mocha": "10.1.0",
|
81
|
-
"mocha-junit-reporter": "2.1.
|
81
|
+
"mocha-junit-reporter": "2.1.1",
|
82
82
|
"ndarray": "1.0.19",
|
83
83
|
"ndarray-determinant": "1.0.0",
|
84
84
|
"ndarray-gemm": "1.0.0",
|
package/types/index.d.ts
CHANGED
@@ -165,121 +165,159 @@ declare namespace math {
|
|
165
165
|
new (): MathNode
|
166
166
|
}
|
167
167
|
|
168
|
-
interface AccessorNode extends MathNode {
|
168
|
+
interface AccessorNode<TObject extends MathNode = MathNode> extends MathNode {
|
169
169
|
type: 'AccessorNode'
|
170
170
|
isAccessorNode: true
|
171
|
-
object:
|
171
|
+
object: TObject
|
172
172
|
index: IndexNode
|
173
173
|
name: string
|
174
174
|
}
|
175
175
|
interface AccessorNodeCtor {
|
176
|
-
new
|
176
|
+
new <TObject extends MathNode = MathNode>(
|
177
|
+
object: TObject,
|
178
|
+
index: IndexNode
|
179
|
+
): AccessorNode<TObject>
|
177
180
|
}
|
178
181
|
|
179
|
-
interface ArrayNode extends MathNode {
|
182
|
+
interface ArrayNode<TItems extends MathNode[] = MathNode[]> extends MathNode {
|
180
183
|
type: 'ArrayNode'
|
181
184
|
isArrayNode: true
|
182
|
-
items:
|
185
|
+
items: TItems
|
183
186
|
}
|
184
187
|
interface ArrayNodeCtor {
|
185
|
-
new
|
188
|
+
new <TItems extends MathNode[] = MathNode[]>(
|
189
|
+
items: MathNode[]
|
190
|
+
): ArrayNode<TItems>
|
186
191
|
}
|
187
192
|
|
188
|
-
interface AssignmentNode extends MathNode
|
193
|
+
interface AssignmentNode<TValue extends MathNode = MathNode>
|
194
|
+
extends MathNode {
|
189
195
|
type: 'AssignmentNode'
|
190
196
|
isAssignmentNode: true
|
191
197
|
object: SymbolNode | AccessorNode
|
192
198
|
index: IndexNode | null
|
193
|
-
value:
|
199
|
+
value: TValue
|
194
200
|
name: string
|
195
201
|
}
|
196
202
|
interface AssignmentNodeCtor {
|
197
|
-
new
|
198
|
-
|
203
|
+
new <TValue extends MathNode = MathNode>(
|
204
|
+
object: SymbolNode,
|
205
|
+
value: TValue
|
206
|
+
): AssignmentNode<TValue>
|
207
|
+
new <TValue extends MathNode = MathNode>(
|
199
208
|
object: SymbolNode | AccessorNode,
|
200
209
|
index: IndexNode,
|
201
|
-
value:
|
202
|
-
): AssignmentNode
|
210
|
+
value: TValue
|
211
|
+
): AssignmentNode<TValue>
|
203
212
|
}
|
204
213
|
|
205
|
-
interface BlockNode extends MathNode {
|
214
|
+
interface BlockNode<TNode extends MathNode = MathNode> extends MathNode {
|
206
215
|
type: 'BlockNode'
|
207
216
|
isBlockNode: true
|
208
|
-
blocks: Array<{ node:
|
217
|
+
blocks: Array<{ node: TNode; visible: boolean }>
|
209
218
|
}
|
210
219
|
interface BlockNodeCtor {
|
211
|
-
new (
|
212
|
-
arr: Array<{ node:
|
220
|
+
new <TNode extends MathNode = MathNode>(
|
221
|
+
arr: Array<{ node: TNode } | { node: TNode; visible: boolean }>
|
213
222
|
): BlockNode
|
214
223
|
}
|
215
224
|
|
216
|
-
interface ConditionalNode
|
225
|
+
interface ConditionalNode<
|
226
|
+
TCond extends MathNode = MathNode,
|
227
|
+
TTrueNode extends MathNode = MathNode,
|
228
|
+
TFalseNode extends MathNode = MathNode
|
229
|
+
> extends MathNode {
|
217
230
|
type: 'ConditionalNode'
|
218
231
|
isConditionalNode: boolean
|
219
|
-
condition:
|
220
|
-
trueExpr:
|
221
|
-
falseExpr:
|
232
|
+
condition: TCond
|
233
|
+
trueExpr: TTrueNode
|
234
|
+
falseExpr: TFalseNode
|
222
235
|
}
|
223
236
|
interface ConditionalNodeCtor {
|
224
|
-
new
|
225
|
-
|
226
|
-
|
227
|
-
|
237
|
+
new <
|
238
|
+
TCond extends MathNode = MathNode,
|
239
|
+
TTrueNode extends MathNode = MathNode,
|
240
|
+
TFalseNode extends MathNode = MathNode
|
241
|
+
>(
|
242
|
+
condition: TCond,
|
243
|
+
trueExpr: TTrueNode,
|
244
|
+
falseExpr: TFalseNode
|
228
245
|
): ConditionalNode
|
229
246
|
}
|
230
247
|
|
231
|
-
interface ConstantNode extends
|
248
|
+
interface ConstantNode<TValue extends string | number = number>
|
249
|
+
extends MathNode {
|
232
250
|
type: 'ConstantNode'
|
233
251
|
isConstantNode: true
|
234
252
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
235
|
-
value:
|
253
|
+
value: TValue
|
236
254
|
}
|
237
255
|
|
238
256
|
interface ConstantNodeCtor {
|
239
|
-
new
|
257
|
+
new <TValue extends string | number = string>(
|
258
|
+
value: TValue
|
259
|
+
): ConstantNode<TValue>
|
240
260
|
}
|
241
261
|
|
242
|
-
interface FunctionAssignmentNode extends MathNode
|
262
|
+
interface FunctionAssignmentNode<TExpr extends MathNode = MathNode>
|
263
|
+
extends MathNode {
|
243
264
|
type: 'FunctionAssignmentNode'
|
244
265
|
isFunctionAssignmentNode: true
|
245
266
|
name: string
|
246
267
|
params: string[]
|
247
|
-
expr:
|
268
|
+
expr: TExpr
|
248
269
|
}
|
249
270
|
interface FunctionAssignmentNodeCtor {
|
250
|
-
new
|
271
|
+
new <TExpr extends MathNode = MathNode>(
|
272
|
+
name: string,
|
273
|
+
params: string[],
|
274
|
+
expr: TExpr
|
275
|
+
): FunctionAssignmentNode<TExpr>
|
251
276
|
}
|
252
277
|
|
253
|
-
interface FunctionNode
|
278
|
+
interface FunctionNode<
|
279
|
+
TFn = SymbolNode,
|
280
|
+
TArgs extends MathNode[] = MathNode[]
|
281
|
+
> extends MathNode {
|
254
282
|
type: 'FunctionNode'
|
255
283
|
isFunctionNode: true
|
256
|
-
fn:
|
257
|
-
args:
|
284
|
+
fn: TFn
|
285
|
+
args: TArgs
|
258
286
|
}
|
259
287
|
interface FunctionNodeCtor {
|
260
|
-
new
|
288
|
+
new <TFn = SymbolNode, TArgs extends MathNode[] = MathNode[]>(
|
289
|
+
fn: TFn,
|
290
|
+
args: TArgs
|
291
|
+
): FunctionNode<TFn, TArgs>
|
261
292
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
262
293
|
onUndefinedFunction: (name: string) => any
|
263
294
|
}
|
264
295
|
|
265
|
-
interface IndexNode extends MathNode {
|
296
|
+
interface IndexNode<TDims extends MathNode[] = MathNode[]> extends MathNode {
|
266
297
|
type: 'IndexNode'
|
267
298
|
isIndexNode: true
|
268
|
-
dimensions:
|
299
|
+
dimensions: TDims
|
269
300
|
dotNotation: boolean
|
270
301
|
}
|
271
302
|
interface IndexNodeCtor {
|
272
|
-
new (dimensions:
|
273
|
-
new
|
303
|
+
new <TDims extends MathNode[] = MathNode[]>(dimensions: TDims): IndexNode
|
304
|
+
new <TDims extends MathNode[] = MathNode[]>(
|
305
|
+
dimensions: TDims,
|
306
|
+
dotNotation: boolean
|
307
|
+
): IndexNode<TDims>
|
274
308
|
}
|
275
309
|
|
276
|
-
interface ObjectNode
|
310
|
+
interface ObjectNode<
|
311
|
+
TProps extends Record<string, MathNode> = Record<string, MathNode>
|
312
|
+
> extends MathNode {
|
277
313
|
type: 'ObjectNode'
|
278
314
|
isObjectNode: true
|
279
|
-
properties:
|
315
|
+
properties: TProps
|
280
316
|
}
|
281
317
|
interface ObjectNodeCtor {
|
282
|
-
new
|
318
|
+
new <TProps extends Record<string, MathNode> = Record<string, MathNode>>(
|
319
|
+
properties: TProps
|
320
|
+
): ObjectNode<TProps>
|
283
321
|
}
|
284
322
|
|
285
323
|
type OperatorNodeMap = {
|
@@ -357,25 +395,41 @@ declare namespace math {
|
|
357
395
|
): ParenthesisNode<TContent>
|
358
396
|
}
|
359
397
|
|
360
|
-
interface RangeNode
|
398
|
+
interface RangeNode<
|
399
|
+
TStart extends MathNode = MathNode,
|
400
|
+
TEnd extends MathNode = MathNode,
|
401
|
+
TStep extends MathNode = MathNode
|
402
|
+
> extends MathNode {
|
361
403
|
type: 'RangeNode'
|
362
404
|
isRangeNode: true
|
363
|
-
start:
|
364
|
-
end:
|
365
|
-
step:
|
405
|
+
start: TStart
|
406
|
+
end: TEnd
|
407
|
+
step: TStep | null
|
366
408
|
}
|
367
409
|
interface RangeNodeCtor {
|
368
|
-
new
|
410
|
+
new <
|
411
|
+
TStart extends MathNode = MathNode,
|
412
|
+
TEnd extends MathNode = MathNode,
|
413
|
+
TStep extends MathNode = MathNode
|
414
|
+
>(
|
415
|
+
start: TStart,
|
416
|
+
end: TEnd,
|
417
|
+
step?: TStep
|
418
|
+
): RangeNode<TStart, TEnd, TStep>
|
369
419
|
}
|
370
420
|
|
371
|
-
interface RelationalNode extends MathNode
|
421
|
+
interface RelationalNode<TParams extends MathNode[] = MathNode[]>
|
422
|
+
extends MathNode {
|
372
423
|
type: 'RelationalNode'
|
373
424
|
isRelationalNode: true
|
374
425
|
conditionals: string[]
|
375
|
-
params:
|
426
|
+
params: TParams
|
376
427
|
}
|
377
428
|
interface RelationalNodeCtor {
|
378
|
-
new
|
429
|
+
new <TParams extends MathNode[] = MathNode[]>(
|
430
|
+
conditionals: string[],
|
431
|
+
params: TParams
|
432
|
+
): RelationalNode<TParams>
|
379
433
|
}
|
380
434
|
|
381
435
|
interface SymbolNode extends MathNode {
|
@@ -3844,6 +3898,7 @@ declare namespace math {
|
|
3844
3898
|
prefixes?: string
|
3845
3899
|
offset?: number
|
3846
3900
|
aliases?: string[]
|
3901
|
+
baseName?: string
|
3847
3902
|
}
|
3848
3903
|
|
3849
3904
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|