@danielsimonjr/mathts-expression 0.8.0 → 0.8.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.
- package/README.md +42 -42
- package/dist/index.js +261 -333
- package/dist/node/AccessorNode.d.ts +121 -132
- package/dist/node/AccessorNode.d.ts.map +1 -1
- package/dist/node/ArrayNode.d.ts +25 -30
- package/dist/node/ArrayNode.d.ts.map +1 -1
- package/dist/node/AssignmentNode.d.ts +19 -32
- package/dist/node/AssignmentNode.d.ts.map +1 -1
- package/dist/node/BlockNode.d.ts +121 -126
- package/dist/node/BlockNode.d.ts.map +1 -1
- package/dist/node/ConditionalNode.d.ts +25 -30
- package/dist/node/ConditionalNode.d.ts.map +1 -1
- package/dist/node/ConstantNode.d.ts +93 -100
- package/dist/node/ConstantNode.d.ts.map +1 -1
- package/dist/node/FunctionAssignmentNode.d.ts +25 -30
- package/dist/node/FunctionAssignmentNode.d.ts.map +1 -1
- package/dist/node/FunctionNode.d.ts +32 -43
- package/dist/node/FunctionNode.d.ts.map +1 -1
- package/dist/node/IndexNode.d.ts +25 -34
- package/dist/node/IndexNode.d.ts.map +1 -1
- package/dist/node/Node.d.ts +41 -38
- package/dist/node/Node.d.ts.map +1 -1
- package/dist/node/ObjectNode.d.ts +25 -30
- package/dist/node/ObjectNode.d.ts.map +1 -1
- package/dist/node/OperatorNode.d.ts +29 -42
- package/dist/node/OperatorNode.d.ts.map +1 -1
- package/dist/node/ParenthesisNode.d.ts +27 -34
- package/dist/node/ParenthesisNode.d.ts.map +1 -1
- package/dist/node/RangeNode.d.ts +23 -30
- package/dist/node/RangeNode.d.ts.map +1 -1
- package/dist/node/RelationalNode.d.ts +25 -32
- package/dist/node/RelationalNode.d.ts.map +1 -1
- package/dist/node/SymbolNode.d.ts +26 -33
- package/dist/node/SymbolNode.d.ts.map +1 -1
- package/dist/node/utils/access.d.ts +7 -0
- package/dist/node/utils/access.d.ts.map +1 -1
- package/dist/node/utils/assign.d.ts +8 -0
- package/dist/node/utils/assign.d.ts.map +1 -1
- package/dist/node/utils/stringSubset.d.ts +8 -8
- package/dist/operators.d.ts +12 -15
- package/dist/operators.d.ts.map +1 -1
- package/dist/parse.d.ts.map +1 -1
- package/dist/transform/utils/dimToZeroBase.d.ts +4 -0
- package/dist/transform/utils/dimToZeroBase.d.ts.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/is.d.ts +273 -3
- package/dist/utils/is.d.ts.map +1 -1
- package/dist/utils/latex.d.ts +12 -0
- package/dist/utils/latex.d.ts.map +1 -1
- package/package.json +59 -59
package/dist/node/Node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/node/Node.ts"],"names":[],"mappings":"AAeA,KAAK,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;CACxD;AAED,KAAK,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;AAElG,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EACJ,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,CAAC,GACrD,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;IACxE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,CAAC,GAAG,EAAE,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AAO,CAAA;SAAE,GAAG,aAAa,GAAG,MAAM;QAKlE;;;;;WAKG;wBACa;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,MAAM;QAkB1C;;;;;WAKG;oBACS,MAAM;QAQlB;;;;WAIG;qBACU,MAAM;QAInB;;;;;;WAMG;0BACe,aAAa,GAAG,MAAM;QAKxC;;WAEG;mCACwB,aAAa,GAAG,MAAM,GAAG,SAAS;QAe7D;;WAEG;yBACc,MAAM;QAIvB;;;YAGI;;;EAST,CAAC;AAGF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC"}
|
|
@@ -21,56 +21,54 @@ export declare const createObjectNode: import("../utils/factory.js").FactoryFunc
|
|
|
21
21
|
* Compile a node into a JavaScript function.
|
|
22
22
|
* This basically pre-calculates as much as possible and only leaves open
|
|
23
23
|
* calculations which depend on a dynamic scope with variables.
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
24
|
+
* @param math - Math.js namespace with functions and constants.
|
|
25
|
+
* @param argNames - An object with argument names as key and `true`
|
|
26
26
|
* as value. Used in the SymbolNode to optimize
|
|
27
27
|
* for arguments from user assigned functions
|
|
28
28
|
* (see FunctionAssignmentNode) or special symbols
|
|
29
29
|
* like `end` (see IndexNode).
|
|
30
|
-
* @
|
|
30
|
+
* @returns Returns a function which can be called like:
|
|
31
31
|
* evalNode(scope: Object, args: Object, context: *)
|
|
32
32
|
*/
|
|
33
33
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
|
|
34
34
|
/**
|
|
35
35
|
* Execute a callback for each of the child nodes of this node
|
|
36
|
-
* @param
|
|
36
|
+
* @param callback
|
|
37
37
|
*/
|
|
38
38
|
forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
|
|
39
39
|
/**
|
|
40
40
|
* Create a new ObjectNode whose children are the results of calling
|
|
41
41
|
* the provided callback function for each child of the original node.
|
|
42
|
-
* @param
|
|
43
|
-
* @returns
|
|
42
|
+
* @param callback
|
|
43
|
+
* @returns Returns a transformed copy of the node
|
|
44
44
|
*/
|
|
45
45
|
map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
|
|
46
46
|
/**
|
|
47
47
|
* Create a clone of this node, a shallow copy
|
|
48
|
-
* @return {ObjectNode}
|
|
49
48
|
*/
|
|
50
49
|
clone(): /*elided*/ any;
|
|
51
50
|
/**
|
|
52
51
|
* Get string representation
|
|
53
|
-
* @param
|
|
54
|
-
* @
|
|
52
|
+
* @param options
|
|
53
|
+
* @returns str
|
|
55
54
|
* @override
|
|
56
55
|
*/
|
|
57
56
|
_toString(options?: StringOptions): string;
|
|
58
57
|
/**
|
|
59
58
|
* Get a JSON representation of the node
|
|
60
|
-
* @returns {Object}
|
|
61
59
|
*/
|
|
62
60
|
toJSON(): Record<string, unknown>;
|
|
63
61
|
/**
|
|
64
62
|
* Get HTML representation
|
|
65
|
-
* @param
|
|
66
|
-
* @
|
|
63
|
+
* @param options
|
|
64
|
+
* @returns str
|
|
67
65
|
* @override
|
|
68
66
|
*/
|
|
69
67
|
_toHTML(options?: StringOptions): string;
|
|
70
68
|
/**
|
|
71
69
|
* Get LaTeX representation
|
|
72
|
-
* @param
|
|
73
|
-
* @
|
|
70
|
+
* @param options
|
|
71
|
+
* @returns str
|
|
74
72
|
*/
|
|
75
73
|
_toTex(options?: StringOptions): string;
|
|
76
74
|
_ifNode: (node: unknown) => Node;
|
|
@@ -81,10 +79,9 @@ export declare const createObjectNode: import("../utils/factory.js").FactoryFunc
|
|
|
81
79
|
name: string;
|
|
82
80
|
/**
|
|
83
81
|
* Instantiate an OperatorNode from its JSON representation
|
|
84
|
-
* @param
|
|
82
|
+
* @param json - An object structured like
|
|
85
83
|
* `{"mathjs": "ObjectNode", "properties": {...}}`,
|
|
86
84
|
* where mathjs is optional
|
|
87
|
-
* @returns {ObjectNode}
|
|
88
85
|
*/
|
|
89
86
|
fromJSON(json: {
|
|
90
87
|
properties: Record<string, Node>;
|
|
@@ -96,56 +93,54 @@ export declare const createObjectNode: import("../utils/factory.js").FactoryFunc
|
|
|
96
93
|
* Compile a node into a JavaScript function.
|
|
97
94
|
* This basically pre-calculates as much as possible and only leaves open
|
|
98
95
|
* calculations which depend on a dynamic scope with variables.
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
96
|
+
* @param math - Math.js namespace with functions and constants.
|
|
97
|
+
* @param argNames - An object with argument names as key and `true`
|
|
101
98
|
* as value. Used in the SymbolNode to optimize
|
|
102
99
|
* for arguments from user assigned functions
|
|
103
100
|
* (see FunctionAssignmentNode) or special symbols
|
|
104
101
|
* like `end` (see IndexNode).
|
|
105
|
-
* @
|
|
102
|
+
* @returns Returns a function which can be called like:
|
|
106
103
|
* evalNode(scope: Object, args: Object, context: *)
|
|
107
104
|
*/
|
|
108
105
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
|
|
109
106
|
/**
|
|
110
107
|
* Execute a callback for each of the child nodes of this node
|
|
111
|
-
* @param
|
|
108
|
+
* @param callback
|
|
112
109
|
*/
|
|
113
110
|
forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
|
|
114
111
|
/**
|
|
115
112
|
* Create a new ObjectNode whose children are the results of calling
|
|
116
113
|
* the provided callback function for each child of the original node.
|
|
117
|
-
* @param
|
|
118
|
-
* @returns
|
|
114
|
+
* @param callback
|
|
115
|
+
* @returns Returns a transformed copy of the node
|
|
119
116
|
*/
|
|
120
117
|
map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
|
|
121
118
|
/**
|
|
122
119
|
* Create a clone of this node, a shallow copy
|
|
123
|
-
* @return {ObjectNode}
|
|
124
120
|
*/
|
|
125
121
|
clone(): /*elided*/ any;
|
|
126
122
|
/**
|
|
127
123
|
* Get string representation
|
|
128
|
-
* @param
|
|
129
|
-
* @
|
|
124
|
+
* @param options
|
|
125
|
+
* @returns str
|
|
130
126
|
* @override
|
|
131
127
|
*/
|
|
132
128
|
_toString(options?: StringOptions): string;
|
|
133
129
|
/**
|
|
134
130
|
* Get a JSON representation of the node
|
|
135
|
-
* @returns {Object}
|
|
136
131
|
*/
|
|
137
132
|
toJSON(): Record<string, unknown>;
|
|
138
133
|
/**
|
|
139
134
|
* Get HTML representation
|
|
140
|
-
* @param
|
|
141
|
-
* @
|
|
135
|
+
* @param options
|
|
136
|
+
* @returns str
|
|
142
137
|
* @override
|
|
143
138
|
*/
|
|
144
139
|
_toHTML(options?: StringOptions): string;
|
|
145
140
|
/**
|
|
146
141
|
* Get LaTeX representation
|
|
147
|
-
* @param
|
|
148
|
-
* @
|
|
142
|
+
* @param options
|
|
143
|
+
* @returns str
|
|
149
144
|
*/
|
|
150
145
|
_toTex(options?: StringOptions): string;
|
|
151
146
|
_ifNode: (node: unknown) => Node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/node/ObjectNode.ts"],"names":[],"mappings":"AAOA,UAAU,IAAI;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,eAAe,CAAC;IAChG,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,CAAC;IAC9C,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM,CAAC;CAC5C;AAED,KAAK,eAAe,GAAG,CACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAA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UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;KAAE;oBA7J9C,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;oBAyBpB,MAAM;4BAGE,OAAO;QAI3B;;;;;;;;;;;;WAYG;uBAEY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe;QAoC3F;;;WAGG;0BACe,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAY,KAAK,IAAI,GAAG,IAAI;QAQhF;;;;;WAKG;sBACW,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAY,KAAK,IAAI;QAYrE;;WAEG;;QAWH;;;;;WAKG;4BACiB,aAAa,GAAG,MAAM;QAU1C;;WAEG;kBACO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QAiBjC;;;;;WAKG;0BACe,aAAa,GAAG,MAAM;QAsBxC;;;;WAIG;yBACc,aAAa,GAAG,MAAM;iBA9NlC,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;kBACtB,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM;gBACrC,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM;eACpC,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM;;EA4O3C,CAAC"}
|
|
@@ -32,74 +32,68 @@ export declare const createOperatorNode: import("../utils/factory.js").FactoryFu
|
|
|
32
32
|
* Compile a node into a JavaScript function.
|
|
33
33
|
* This basically pre-calculates as much as possible and only leaves open
|
|
34
34
|
* calculations which depend on a dynamic scope with variables.
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
35
|
+
* @param math - Math.js namespace with functions and constants.
|
|
36
|
+
* @param argNames - An object with argument names as key and `true`
|
|
37
37
|
* as value. Used in the SymbolNode to optimize
|
|
38
38
|
* for arguments from user assigned functions
|
|
39
39
|
* (see FunctionAssignmentNode) or special symbols
|
|
40
40
|
* like `end` (see IndexNode).
|
|
41
|
-
* @
|
|
41
|
+
* @returns Returns a function which can be called like:
|
|
42
42
|
* evalNode(scope: Object, args: Object, context: *)
|
|
43
43
|
*/
|
|
44
44
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
|
|
45
45
|
/**
|
|
46
46
|
* Execute a callback for each of the child nodes of this node
|
|
47
|
-
* @param
|
|
47
|
+
* @param callback
|
|
48
48
|
*/
|
|
49
49
|
forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
|
|
50
50
|
/**
|
|
51
51
|
* Create a new OperatorNode whose children are the results of calling
|
|
52
52
|
* the provided callback function for each child of the original node.
|
|
53
|
-
* @param
|
|
54
|
-
* @returns
|
|
53
|
+
* @param callback
|
|
54
|
+
* @returns Returns a transformed copy of the node
|
|
55
55
|
*/
|
|
56
56
|
map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
|
|
57
57
|
/**
|
|
58
58
|
* Create a clone of this node, a shallow copy
|
|
59
|
-
* @return {OperatorNode}
|
|
60
59
|
*/
|
|
61
60
|
clone(): /*elided*/ any;
|
|
62
61
|
/**
|
|
63
62
|
* Check whether this is an unary OperatorNode:
|
|
64
63
|
* has exactly one argument, like `-a`.
|
|
65
|
-
* @
|
|
66
|
-
* Returns true when an unary operator node, false otherwise.
|
|
64
|
+
* @returns `true` when an unary operator node, `false` otherwise.
|
|
67
65
|
*/
|
|
68
66
|
isUnary(): boolean;
|
|
69
67
|
/**
|
|
70
68
|
* Check whether this is a binary OperatorNode:
|
|
71
69
|
* has exactly two arguments, like `a + b`.
|
|
72
|
-
* @
|
|
73
|
-
* Returns true when a binary operator node, false otherwise.
|
|
70
|
+
* @returns `true` when a binary operator node, `false` otherwise.
|
|
74
71
|
*/
|
|
75
72
|
isBinary(): boolean;
|
|
76
73
|
/**
|
|
77
74
|
* Get string representation.
|
|
78
|
-
* @param
|
|
79
|
-
* @
|
|
75
|
+
* @param options
|
|
76
|
+
* @returns str
|
|
80
77
|
*/
|
|
81
78
|
_toString(options?: StringOptions): string;
|
|
82
79
|
/**
|
|
83
80
|
* Get a JSON representation of the node
|
|
84
|
-
* @returns {Object}
|
|
85
81
|
*/
|
|
86
82
|
toJSON(): Record<string, unknown>;
|
|
87
83
|
/**
|
|
88
84
|
* Get HTML representation.
|
|
89
|
-
* @param
|
|
90
|
-
* @
|
|
85
|
+
* @param options
|
|
86
|
+
* @returns str
|
|
91
87
|
*/
|
|
92
88
|
_toHTML(options?: StringOptions): string;
|
|
93
89
|
/**
|
|
94
|
-
* Get
|
|
95
|
-
* @
|
|
96
|
-
* @return {string} str
|
|
90
|
+
* Get the MathML representation of this node.
|
|
91
|
+
* @returns str
|
|
97
92
|
*/
|
|
98
93
|
_toMathML(): string;
|
|
99
94
|
_toTex(options?: StringOptions): string;
|
|
100
95
|
/**
|
|
101
96
|
* Get identifier.
|
|
102
|
-
* @return {string}
|
|
103
97
|
*/
|
|
104
98
|
getIdentifier(): string;
|
|
105
99
|
_ifNode: (node: unknown) => Node;
|
|
@@ -113,7 +107,7 @@ export declare const createOperatorNode: import("../utils/factory.js").FactoryFu
|
|
|
113
107
|
name: string;
|
|
114
108
|
/**
|
|
115
109
|
* Instantiate an OperatorNode from its JSON representation
|
|
116
|
-
* @param
|
|
110
|
+
* @param json
|
|
117
111
|
* An object structured like
|
|
118
112
|
* ```
|
|
119
113
|
* {"mathjs": "OperatorNode",
|
|
@@ -122,7 +116,6 @@ export declare const createOperatorNode: import("../utils/factory.js").FactoryFu
|
|
|
122
116
|
* "isPercentage":false}
|
|
123
117
|
* ```
|
|
124
118
|
* where mathjs is optional
|
|
125
|
-
* @returns {OperatorNode}
|
|
126
119
|
*/
|
|
127
120
|
fromJSON(json: {
|
|
128
121
|
op: string;
|
|
@@ -142,74 +135,68 @@ export declare const createOperatorNode: import("../utils/factory.js").FactoryFu
|
|
|
142
135
|
* Compile a node into a JavaScript function.
|
|
143
136
|
* This basically pre-calculates as much as possible and only leaves open
|
|
144
137
|
* calculations which depend on a dynamic scope with variables.
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
138
|
+
* @param math - Math.js namespace with functions and constants.
|
|
139
|
+
* @param argNames - An object with argument names as key and `true`
|
|
147
140
|
* as value. Used in the SymbolNode to optimize
|
|
148
141
|
* for arguments from user assigned functions
|
|
149
142
|
* (see FunctionAssignmentNode) or special symbols
|
|
150
143
|
* like `end` (see IndexNode).
|
|
151
|
-
* @
|
|
144
|
+
* @returns Returns a function which can be called like:
|
|
152
145
|
* evalNode(scope: Object, args: Object, context: *)
|
|
153
146
|
*/
|
|
154
147
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
|
|
155
148
|
/**
|
|
156
149
|
* Execute a callback for each of the child nodes of this node
|
|
157
|
-
* @param
|
|
150
|
+
* @param callback
|
|
158
151
|
*/
|
|
159
152
|
forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
|
|
160
153
|
/**
|
|
161
154
|
* Create a new OperatorNode whose children are the results of calling
|
|
162
155
|
* the provided callback function for each child of the original node.
|
|
163
|
-
* @param
|
|
164
|
-
* @returns
|
|
156
|
+
* @param callback
|
|
157
|
+
* @returns Returns a transformed copy of the node
|
|
165
158
|
*/
|
|
166
159
|
map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
|
|
167
160
|
/**
|
|
168
161
|
* Create a clone of this node, a shallow copy
|
|
169
|
-
* @return {OperatorNode}
|
|
170
162
|
*/
|
|
171
163
|
clone(): /*elided*/ any;
|
|
172
164
|
/**
|
|
173
165
|
* Check whether this is an unary OperatorNode:
|
|
174
166
|
* has exactly one argument, like `-a`.
|
|
175
|
-
* @
|
|
176
|
-
* Returns true when an unary operator node, false otherwise.
|
|
167
|
+
* @returns `true` when an unary operator node, `false` otherwise.
|
|
177
168
|
*/
|
|
178
169
|
isUnary(): boolean;
|
|
179
170
|
/**
|
|
180
171
|
* Check whether this is a binary OperatorNode:
|
|
181
172
|
* has exactly two arguments, like `a + b`.
|
|
182
|
-
* @
|
|
183
|
-
* Returns true when a binary operator node, false otherwise.
|
|
173
|
+
* @returns `true` when a binary operator node, `false` otherwise.
|
|
184
174
|
*/
|
|
185
175
|
isBinary(): boolean;
|
|
186
176
|
/**
|
|
187
177
|
* Get string representation.
|
|
188
|
-
* @param
|
|
189
|
-
* @
|
|
178
|
+
* @param options
|
|
179
|
+
* @returns str
|
|
190
180
|
*/
|
|
191
181
|
_toString(options?: StringOptions): string;
|
|
192
182
|
/**
|
|
193
183
|
* Get a JSON representation of the node
|
|
194
|
-
* @returns {Object}
|
|
195
184
|
*/
|
|
196
185
|
toJSON(): Record<string, unknown>;
|
|
197
186
|
/**
|
|
198
187
|
* Get HTML representation.
|
|
199
|
-
* @param
|
|
200
|
-
* @
|
|
188
|
+
* @param options
|
|
189
|
+
* @returns str
|
|
201
190
|
*/
|
|
202
191
|
_toHTML(options?: StringOptions): string;
|
|
203
192
|
/**
|
|
204
|
-
* Get
|
|
205
|
-
* @
|
|
206
|
-
* @return {string} str
|
|
193
|
+
* Get the MathML representation of this node.
|
|
194
|
+
* @returns str
|
|
207
195
|
*/
|
|
208
196
|
_toMathML(): string;
|
|
209
197
|
_toTex(options?: StringOptions): string;
|
|
210
198
|
/**
|
|
211
199
|
* Get identifier.
|
|
212
|
-
* @return {string}
|
|
213
200
|
*/
|
|
214
201
|
getIdentifier(): string;
|
|
215
202
|
_ifNode: (node: unknown) => Node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperatorNode.d.ts","sourceRoot":"","sources":["../../src/node/OperatorNode.ts"],"names":[],"mappings":"AAWA,UAAU,IAAI;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,eAAe,CAAC;IAChG,OAAO,EAA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CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe;QA8D3F;;;WAGG;0BACe,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAc,KAAK,IAAI,GAAG,IAAI;QAMlF;;;;;WAKG;sBACW,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAc,KAAK,IAAI;QAQvE;;WAEG;;QAWH;;;;WAIG;mBACQ,OAAO;QAIlB;;;;WAIG;oBACS,OAAO;QAInB;;;;WAIG;4BACiB,aAAa,GAAG,MAAM;QA+E1C;;WAEG;kBACO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QAiCjC;;;;WAIG;0BACe,aAAa,GAAG,MAAM;QA+HxC;;;WAGG;qBACU,MAAM;yBAqCF,aAAa,GAAG,MAAM;QA6GvC;;WAEG;yBAEc,MAAM;iBAj5BlB,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;gBACxB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,KAAK,IAAI,EAAE;oBACzC,MAAM,IAAI;kBAEZ,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM;gBACrC,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM;eACpC,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,MAAM;kBAChC,MAAM,MAAM;;EAk5BvB,CAAC"}
|
|
@@ -23,62 +23,59 @@ export declare const createParenthesisNode: import("../utils/factory.js").Factor
|
|
|
23
23
|
* Compile a node into a JavaScript function.
|
|
24
24
|
* This basically pre-calculates as much as possible and only leaves open
|
|
25
25
|
* calculations which depend on a dynamic scope with variables.
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
26
|
+
* @param math - Math.js namespace with functions and constants.
|
|
27
|
+
* @param argNames - An object with argument names as key and `true`
|
|
28
28
|
* as value. Used in the SymbolNode to optimize
|
|
29
29
|
* for arguments from user assigned functions
|
|
30
30
|
* (see FunctionAssignmentNode) or special symbols
|
|
31
31
|
* like `end` (see IndexNode).
|
|
32
|
-
* @
|
|
32
|
+
* @returns Returns a function which can be called like:
|
|
33
33
|
* evalNode(scope: Object, args: Object, context: *)
|
|
34
34
|
*/
|
|
35
35
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
|
|
36
36
|
/**
|
|
37
37
|
* Get the content of the current Node.
|
|
38
|
-
* @
|
|
38
|
+
* @returns content
|
|
39
39
|
* @override
|
|
40
40
|
**/
|
|
41
41
|
getContent(): Node;
|
|
42
42
|
/**
|
|
43
43
|
* Execute a callback for each of the child nodes of this node
|
|
44
|
-
* @param
|
|
44
|
+
* @param callback
|
|
45
45
|
*/
|
|
46
46
|
forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
|
|
47
47
|
/**
|
|
48
48
|
* Create a new ParenthesisNode whose child is the result of calling
|
|
49
49
|
* the provided callback function on the child of this node.
|
|
50
|
-
* @param
|
|
51
|
-
* @returns
|
|
50
|
+
* @param callback
|
|
51
|
+
* @returns Returns a clone of the node
|
|
52
52
|
*/
|
|
53
53
|
map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
|
|
54
54
|
/**
|
|
55
55
|
* Create a clone of this node, a shallow copy
|
|
56
|
-
* @return {ParenthesisNode}
|
|
57
56
|
*/
|
|
58
57
|
clone(): /*elided*/ any;
|
|
59
58
|
/**
|
|
60
59
|
* Get string representation
|
|
61
|
-
* @param
|
|
62
|
-
* @
|
|
60
|
+
* @param options
|
|
61
|
+
* @returns str
|
|
63
62
|
* @override
|
|
64
63
|
*/
|
|
65
64
|
_toString(options?: StringOptions): string;
|
|
66
65
|
/**
|
|
67
66
|
* Get a JSON representation of the node
|
|
68
|
-
* @returns {Object}
|
|
69
67
|
*/
|
|
70
68
|
toJSON(): Record<string, unknown>;
|
|
71
69
|
/**
|
|
72
70
|
* Get HTML representation
|
|
73
|
-
* @param
|
|
74
|
-
* @
|
|
71
|
+
* @param options
|
|
72
|
+
* @returns str
|
|
75
73
|
* @override
|
|
76
74
|
*/
|
|
77
75
|
_toHTML(options?: StringOptions): string;
|
|
78
76
|
/**
|
|
79
|
-
* Get
|
|
80
|
-
* @
|
|
81
|
-
* @return {string} str
|
|
77
|
+
* Get the MathML representation of this node.
|
|
78
|
+
* @returns str
|
|
82
79
|
* @override
|
|
83
80
|
*/
|
|
84
81
|
_toMathML(): string;
|
|
@@ -91,10 +88,9 @@ export declare const createParenthesisNode: import("../utils/factory.js").Factor
|
|
|
91
88
|
name: string;
|
|
92
89
|
/**
|
|
93
90
|
* Instantiate an ParenthesisNode from its JSON representation
|
|
94
|
-
* @param
|
|
91
|
+
* @param json - An object structured like
|
|
95
92
|
* `{"mathjs": "ParenthesisNode", "content": ...}`,
|
|
96
93
|
* where mathjs is optional
|
|
97
|
-
* @returns {ParenthesisNode}
|
|
98
94
|
*/
|
|
99
95
|
fromJSON(json: {
|
|
100
96
|
content: Node;
|
|
@@ -106,62 +102,59 @@ export declare const createParenthesisNode: import("../utils/factory.js").Factor
|
|
|
106
102
|
* Compile a node into a JavaScript function.
|
|
107
103
|
* This basically pre-calculates as much as possible and only leaves open
|
|
108
104
|
* calculations which depend on a dynamic scope with variables.
|
|
109
|
-
* @param
|
|
110
|
-
* @param
|
|
105
|
+
* @param math - Math.js namespace with functions and constants.
|
|
106
|
+
* @param argNames - An object with argument names as key and `true`
|
|
111
107
|
* as value. Used in the SymbolNode to optimize
|
|
112
108
|
* for arguments from user assigned functions
|
|
113
109
|
* (see FunctionAssignmentNode) or special symbols
|
|
114
110
|
* like `end` (see IndexNode).
|
|
115
|
-
* @
|
|
111
|
+
* @returns Returns a function which can be called like:
|
|
116
112
|
* evalNode(scope: Object, args: Object, context: *)
|
|
117
113
|
*/
|
|
118
114
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
|
|
119
115
|
/**
|
|
120
116
|
* Get the content of the current Node.
|
|
121
|
-
* @
|
|
117
|
+
* @returns content
|
|
122
118
|
* @override
|
|
123
119
|
**/
|
|
124
120
|
getContent(): Node;
|
|
125
121
|
/**
|
|
126
122
|
* Execute a callback for each of the child nodes of this node
|
|
127
|
-
* @param
|
|
123
|
+
* @param callback
|
|
128
124
|
*/
|
|
129
125
|
forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
|
|
130
126
|
/**
|
|
131
127
|
* Create a new ParenthesisNode whose child is the result of calling
|
|
132
128
|
* the provided callback function on the child of this node.
|
|
133
|
-
* @param
|
|
134
|
-
* @returns
|
|
129
|
+
* @param callback
|
|
130
|
+
* @returns Returns a clone of the node
|
|
135
131
|
*/
|
|
136
132
|
map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
|
|
137
133
|
/**
|
|
138
134
|
* Create a clone of this node, a shallow copy
|
|
139
|
-
* @return {ParenthesisNode}
|
|
140
135
|
*/
|
|
141
136
|
clone(): /*elided*/ any;
|
|
142
137
|
/**
|
|
143
138
|
* Get string representation
|
|
144
|
-
* @param
|
|
145
|
-
* @
|
|
139
|
+
* @param options
|
|
140
|
+
* @returns str
|
|
146
141
|
* @override
|
|
147
142
|
*/
|
|
148
143
|
_toString(options?: StringOptions): string;
|
|
149
144
|
/**
|
|
150
145
|
* Get a JSON representation of the node
|
|
151
|
-
* @returns {Object}
|
|
152
146
|
*/
|
|
153
147
|
toJSON(): Record<string, unknown>;
|
|
154
148
|
/**
|
|
155
149
|
* Get HTML representation
|
|
156
|
-
* @param
|
|
157
|
-
* @
|
|
150
|
+
* @param options
|
|
151
|
+
* @returns str
|
|
158
152
|
* @override
|
|
159
153
|
*/
|
|
160
154
|
_toHTML(options?: StringOptions): string;
|
|
161
155
|
/**
|
|
162
|
-
* Get
|
|
163
|
-
* @
|
|
164
|
-
* @return {string} str
|
|
156
|
+
* Get the MathML representation of this node.
|
|
157
|
+
* @returns str
|
|
165
158
|
* @override
|
|
166
159
|
*/
|
|
167
160
|
_toMathML(): string;
|
|
@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