@danielsimonjr/mathts-expression 0.8.0 → 0.8.2

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 (52) hide show
  1. package/README.md +42 -42
  2. package/dist/index.js +276 -347
  3. package/dist/node/AccessorNode.d.ts +121 -132
  4. package/dist/node/AccessorNode.d.ts.map +1 -1
  5. package/dist/node/ArrayNode.d.ts +25 -30
  6. package/dist/node/ArrayNode.d.ts.map +1 -1
  7. package/dist/node/AssignmentNode.d.ts +19 -32
  8. package/dist/node/AssignmentNode.d.ts.map +1 -1
  9. package/dist/node/BlockNode.d.ts +121 -126
  10. package/dist/node/BlockNode.d.ts.map +1 -1
  11. package/dist/node/ConditionalNode.d.ts +25 -30
  12. package/dist/node/ConditionalNode.d.ts.map +1 -1
  13. package/dist/node/ConstantNode.d.ts +93 -100
  14. package/dist/node/ConstantNode.d.ts.map +1 -1
  15. package/dist/node/FunctionAssignmentNode.d.ts +93 -98
  16. package/dist/node/FunctionAssignmentNode.d.ts.map +1 -1
  17. package/dist/node/FunctionNode.d.ts +32 -43
  18. package/dist/node/FunctionNode.d.ts.map +1 -1
  19. package/dist/node/IndexNode.d.ts +949 -72
  20. package/dist/node/IndexNode.d.ts.map +1 -1
  21. package/dist/node/Node.d.ts +43 -39
  22. package/dist/node/Node.d.ts.map +1 -1
  23. package/dist/node/ObjectNode.d.ts +947 -56
  24. package/dist/node/ObjectNode.d.ts.map +1 -1
  25. package/dist/node/OperatorNode.d.ts +955 -79
  26. package/dist/node/OperatorNode.d.ts.map +1 -1
  27. package/dist/node/ParenthesisNode.d.ts +881 -63
  28. package/dist/node/ParenthesisNode.d.ts.map +1 -1
  29. package/dist/node/RangeNode.d.ts +955 -71
  30. package/dist/node/RangeNode.d.ts.map +1 -1
  31. package/dist/node/RelationalNode.d.ts +947 -61
  32. package/dist/node/RelationalNode.d.ts.map +1 -1
  33. package/dist/node/SymbolNode.d.ts +942 -43
  34. package/dist/node/SymbolNode.d.ts.map +1 -1
  35. package/dist/node/utils/access.d.ts +8 -1
  36. package/dist/node/utils/access.d.ts.map +1 -1
  37. package/dist/node/utils/assign.d.ts +9 -1
  38. package/dist/node/utils/assign.d.ts.map +1 -1
  39. package/dist/node/utils/stringSubset.d.ts +8 -8
  40. package/dist/operators.d.ts +12 -15
  41. package/dist/operators.d.ts.map +1 -1
  42. package/dist/parse.d.ts +2 -0
  43. package/dist/parse.d.ts.map +1 -1
  44. package/dist/transform/utils/dimToZeroBase.d.ts +4 -0
  45. package/dist/transform/utils/dimToZeroBase.d.ts.map +1 -1
  46. package/dist/types.d.ts +8 -0
  47. package/dist/types.d.ts.map +1 -1
  48. package/dist/utils/is.d.ts +275 -3
  49. package/dist/utils/is.d.ts.map +1 -1
  50. package/dist/utils/latex.d.ts +12 -0
  51. package/dist/utils/latex.d.ts.map +1 -1
  52. package/package.json +59 -59
@@ -1,25 +1,352 @@
1
- interface Node {
2
- _compile: (math: Record<string, unknown>, argNames: Record<string, boolean>) => CompileFunction;
3
- _ifNode: (node: unknown) => Node;
4
- filter: (callback: (node: Node) => boolean) => Node[];
5
- isSymbolNode?: boolean;
6
- name?: string;
7
- value?: unknown;
8
- toHTML: (options?: StringOptions) => string;
9
- toTex: (options?: StringOptions) => string;
10
- toString: (options?: StringOptions) => string;
11
- }
1
+ import type { MathNode } from './Node.js';
12
2
  type CompileFunction = (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
13
3
  interface StringOptions {
14
4
  [key: string]: unknown;
15
5
  }
16
6
  interface Dependencies {
17
- Node: new (...args: unknown[]) => Node;
7
+ Node: new (...args: unknown[]) => MathNode;
18
8
  size: (value: unknown) => number[];
19
9
  }
20
10
  export declare const createIndexNode: import("../utils/factory.js").FactoryFunction<Dependencies, {
21
- new (dimensions: Node[], dotNotation?: boolean): {
22
- dimensions: Node[];
11
+ new (dimensions: MathNode[], dotNotation?: boolean): {
12
+ get isNode(): boolean;
13
+ evaluate(scope?: Record<string, unknown>): unknown;
14
+ compile(): import("./Node.js").CompiledExpression;
15
+ _ifNode(node: unknown): {
16
+ get type(): string;
17
+ get isNode(): boolean;
18
+ evaluate(scope?: Record<string, unknown>): unknown;
19
+ compile(): import("./Node.js").CompiledExpression;
20
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
21
+ forEach(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => void): void;
22
+ map(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => /*elided*/ any): /*elided*/ any;
23
+ _ifNode(node: unknown): /*elided*/ any;
24
+ traverse(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => void): void;
25
+ transform(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => /*elided*/ any): /*elided*/ any;
26
+ filter(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => boolean): /*elided*/ any[];
27
+ clone(): /*elided*/ any;
28
+ cloneDeep(): /*elided*/ any;
29
+ equals(other: /*elided*/ any | null | undefined): boolean;
30
+ toString(options?: import("./Node.js").StringOptions): string;
31
+ _toString(_options?: import("./Node.js").StringOptions): string;
32
+ toJSON(): Record<string, unknown>;
33
+ toHTML(options?: import("./Node.js").StringOptions): string;
34
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
35
+ toTex(options?: import("./Node.js").StringOptions): string;
36
+ toMarkdown(options?: {
37
+ inline?: boolean;
38
+ } & import("./Node.js").StringOptions): string;
39
+ toDOT(options?: {
40
+ name?: string;
41
+ }): string;
42
+ toMathML(): string;
43
+ _toMathML(): string;
44
+ _toTex(_options?: import("./Node.js").StringOptions): string;
45
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
46
+ getIdentifier(): string;
47
+ getContent(): /*elided*/ any;
48
+ };
49
+ traverse(callback: (node: {
50
+ get type(): string;
51
+ get isNode(): boolean;
52
+ evaluate(scope?: Record<string, unknown>): unknown;
53
+ compile(): import("./Node.js").CompiledExpression;
54
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
55
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
56
+ map(_callback: (child: any, path: string, parent: any) => any): any;
57
+ _ifNode(node: unknown): any;
58
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
59
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
60
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
61
+ clone(): any;
62
+ cloneDeep(): any;
63
+ equals(other: any | null | undefined): boolean;
64
+ toString(options?: import("./Node.js").StringOptions): string;
65
+ _toString(_options?: import("./Node.js").StringOptions): string;
66
+ toJSON(): Record<string, unknown>;
67
+ toHTML(options?: import("./Node.js").StringOptions): string;
68
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
69
+ toTex(options?: import("./Node.js").StringOptions): string;
70
+ toMarkdown(options?: {
71
+ inline?: boolean;
72
+ } & import("./Node.js").StringOptions): string;
73
+ toDOT(options?: {
74
+ name?: string;
75
+ }): string;
76
+ toMathML(): string;
77
+ _toMathML(): string;
78
+ _toTex(_options?: import("./Node.js").StringOptions): string;
79
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
80
+ getIdentifier(): string;
81
+ getContent(): any;
82
+ }, path: string | null, parent: {
83
+ get type(): string;
84
+ get isNode(): boolean;
85
+ evaluate(scope?: Record<string, unknown>): unknown;
86
+ compile(): import("./Node.js").CompiledExpression;
87
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
88
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
89
+ map(_callback: (child: any, path: string, parent: any) => any): any;
90
+ _ifNode(node: unknown): any;
91
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
92
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
93
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
94
+ clone(): any;
95
+ cloneDeep(): any;
96
+ equals(other: any | null | undefined): boolean;
97
+ toString(options?: import("./Node.js").StringOptions): string;
98
+ _toString(_options?: import("./Node.js").StringOptions): string;
99
+ toJSON(): Record<string, unknown>;
100
+ toHTML(options?: import("./Node.js").StringOptions): string;
101
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
102
+ toTex(options?: import("./Node.js").StringOptions): string;
103
+ toMarkdown(options?: {
104
+ inline?: boolean;
105
+ } & import("./Node.js").StringOptions): string;
106
+ toDOT(options?: {
107
+ name?: string;
108
+ }): string;
109
+ toMathML(): string;
110
+ _toMathML(): string;
111
+ _toTex(_options?: import("./Node.js").StringOptions): string;
112
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
113
+ getIdentifier(): string;
114
+ getContent(): any;
115
+ } | null) => void): void;
116
+ transform(callback: (node: {
117
+ get type(): string;
118
+ get isNode(): boolean;
119
+ evaluate(scope?: Record<string, unknown>): unknown;
120
+ compile(): import("./Node.js").CompiledExpression;
121
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
122
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
123
+ map(_callback: (child: any, path: string, parent: any) => any): any;
124
+ _ifNode(node: unknown): any;
125
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
126
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
127
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
128
+ clone(): any;
129
+ cloneDeep(): any;
130
+ equals(other: any | null | undefined): boolean;
131
+ toString(options?: import("./Node.js").StringOptions): string;
132
+ _toString(_options?: import("./Node.js").StringOptions): string;
133
+ toJSON(): Record<string, unknown>;
134
+ toHTML(options?: import("./Node.js").StringOptions): string;
135
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
136
+ toTex(options?: import("./Node.js").StringOptions): string;
137
+ toMarkdown(options?: {
138
+ inline?: boolean;
139
+ } & import("./Node.js").StringOptions): string;
140
+ toDOT(options?: {
141
+ name?: string;
142
+ }): string;
143
+ toMathML(): string;
144
+ _toMathML(): string;
145
+ _toTex(_options?: import("./Node.js").StringOptions): string;
146
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
147
+ getIdentifier(): string;
148
+ getContent(): any;
149
+ }, path: string | null, parent: {
150
+ get type(): string;
151
+ get isNode(): boolean;
152
+ evaluate(scope?: Record<string, unknown>): unknown;
153
+ compile(): import("./Node.js").CompiledExpression;
154
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
155
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
156
+ map(_callback: (child: any, path: string, parent: any) => any): any;
157
+ _ifNode(node: unknown): any;
158
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
159
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
160
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
161
+ clone(): any;
162
+ cloneDeep(): any;
163
+ equals(other: any | null | undefined): boolean;
164
+ toString(options?: import("./Node.js").StringOptions): string;
165
+ _toString(_options?: import("./Node.js").StringOptions): string;
166
+ toJSON(): Record<string, unknown>;
167
+ toHTML(options?: import("./Node.js").StringOptions): string;
168
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
169
+ toTex(options?: import("./Node.js").StringOptions): string;
170
+ toMarkdown(options?: {
171
+ inline?: boolean;
172
+ } & import("./Node.js").StringOptions): string;
173
+ toDOT(options?: {
174
+ name?: string;
175
+ }): string;
176
+ toMathML(): string;
177
+ _toMathML(): string;
178
+ _toTex(_options?: import("./Node.js").StringOptions): string;
179
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
180
+ getIdentifier(): string;
181
+ getContent(): any;
182
+ } | null) => {
183
+ get type(): string;
184
+ get isNode(): boolean;
185
+ evaluate(scope?: Record<string, unknown>): unknown;
186
+ compile(): import("./Node.js").CompiledExpression;
187
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
188
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
189
+ map(_callback: (child: any, path: string, parent: any) => any): any;
190
+ _ifNode(node: unknown): any;
191
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
192
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
193
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
194
+ clone(): any;
195
+ cloneDeep(): any;
196
+ equals(other: any | null | undefined): boolean;
197
+ toString(options?: import("./Node.js").StringOptions): string;
198
+ _toString(_options?: import("./Node.js").StringOptions): string;
199
+ toJSON(): Record<string, unknown>;
200
+ toHTML(options?: import("./Node.js").StringOptions): string;
201
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
202
+ toTex(options?: import("./Node.js").StringOptions): string;
203
+ toMarkdown(options?: {
204
+ inline?: boolean;
205
+ } & import("./Node.js").StringOptions): string;
206
+ toDOT(options?: {
207
+ name?: string;
208
+ }): string;
209
+ toMathML(): string;
210
+ _toMathML(): string;
211
+ _toTex(_options?: import("./Node.js").StringOptions): string;
212
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
213
+ getIdentifier(): string;
214
+ getContent(): any;
215
+ }): {
216
+ get type(): string;
217
+ get isNode(): boolean;
218
+ evaluate(scope?: Record<string, unknown>): unknown;
219
+ compile(): import("./Node.js").CompiledExpression;
220
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
221
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
222
+ map(_callback: (child: any, path: string, parent: any) => any): any;
223
+ _ifNode(node: unknown): any;
224
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
225
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
226
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
227
+ clone(): any;
228
+ cloneDeep(): any;
229
+ equals(other: any | null | undefined): boolean;
230
+ toString(options?: import("./Node.js").StringOptions): string;
231
+ _toString(_options?: import("./Node.js").StringOptions): string;
232
+ toJSON(): Record<string, unknown>;
233
+ toHTML(options?: import("./Node.js").StringOptions): string;
234
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
235
+ toTex(options?: import("./Node.js").StringOptions): string;
236
+ toMarkdown(options?: {
237
+ inline?: boolean;
238
+ } & import("./Node.js").StringOptions): string;
239
+ toDOT(options?: {
240
+ name?: string;
241
+ }): string;
242
+ toMathML(): string;
243
+ _toMathML(): string;
244
+ _toTex(_options?: import("./Node.js").StringOptions): string;
245
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
246
+ getIdentifier(): string;
247
+ getContent(): any;
248
+ };
249
+ filter(callback: (node: {
250
+ get type(): string;
251
+ get isNode(): boolean;
252
+ evaluate(scope?: Record<string, unknown>): unknown;
253
+ compile(): import("./Node.js").CompiledExpression;
254
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
255
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
256
+ map(_callback: (child: any, path: string, parent: any) => any): any;
257
+ _ifNode(node: unknown): any;
258
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
259
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
260
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
261
+ clone(): any;
262
+ cloneDeep(): any;
263
+ equals(other: any | null | undefined): boolean;
264
+ toString(options?: import("./Node.js").StringOptions): string;
265
+ _toString(_options?: import("./Node.js").StringOptions): string;
266
+ toJSON(): Record<string, unknown>;
267
+ toHTML(options?: import("./Node.js").StringOptions): string;
268
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
269
+ toTex(options?: import("./Node.js").StringOptions): string;
270
+ toMarkdown(options?: {
271
+ inline?: boolean;
272
+ } & import("./Node.js").StringOptions): string;
273
+ toDOT(options?: {
274
+ name?: string;
275
+ }): string;
276
+ toMathML(): string;
277
+ _toMathML(): string;
278
+ _toTex(_options?: import("./Node.js").StringOptions): string;
279
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
280
+ getIdentifier(): string;
281
+ getContent(): any;
282
+ }, path: string | null, parent: {
283
+ get type(): string;
284
+ get isNode(): boolean;
285
+ evaluate(scope?: Record<string, unknown>): unknown;
286
+ compile(): import("./Node.js").CompiledExpression;
287
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
288
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
289
+ map(_callback: (child: any, path: string, parent: any) => any): any;
290
+ _ifNode(node: unknown): any;
291
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
292
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
293
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
294
+ clone(): any;
295
+ cloneDeep(): any;
296
+ equals(other: any | null | undefined): boolean;
297
+ toString(options?: import("./Node.js").StringOptions): string;
298
+ _toString(_options?: import("./Node.js").StringOptions): string;
299
+ toJSON(): Record<string, unknown>;
300
+ toHTML(options?: import("./Node.js").StringOptions): string;
301
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
302
+ toTex(options?: import("./Node.js").StringOptions): string;
303
+ toMarkdown(options?: {
304
+ inline?: boolean;
305
+ } & import("./Node.js").StringOptions): string;
306
+ toDOT(options?: {
307
+ name?: string;
308
+ }): string;
309
+ toMathML(): string;
310
+ _toMathML(): string;
311
+ _toTex(_options?: import("./Node.js").StringOptions): string;
312
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
313
+ getIdentifier(): string;
314
+ getContent(): any;
315
+ } | null) => boolean): {
316
+ get type(): string;
317
+ get isNode(): boolean;
318
+ evaluate(scope?: Record<string, unknown>): unknown;
319
+ compile(): import("./Node.js").CompiledExpression;
320
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
321
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
322
+ map(_callback: (child: any, path: string, parent: any) => any): any;
323
+ _ifNode(node: unknown): any;
324
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
325
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
326
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
327
+ clone(): any;
328
+ cloneDeep(): any;
329
+ equals(other: any | null | undefined): boolean;
330
+ toString(options?: import("./Node.js").StringOptions): string;
331
+ _toString(_options?: import("./Node.js").StringOptions): string;
332
+ toJSON(): Record<string, unknown>;
333
+ toHTML(options?: import("./Node.js").StringOptions): string;
334
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
335
+ toTex(options?: import("./Node.js").StringOptions): string;
336
+ toMarkdown(options?: {
337
+ inline?: boolean;
338
+ } & import("./Node.js").StringOptions): string;
339
+ toDOT(options?: {
340
+ name?: string;
341
+ }): string;
342
+ toMathML(): string;
343
+ _toMathML(): string;
344
+ _toTex(_options?: import("./Node.js").StringOptions): string;
345
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
346
+ getIdentifier(): string;
347
+ getContent(): any;
348
+ }[];
349
+ dimensions: MathNode[];
23
350
  dotNotation: boolean;
24
351
  get type(): string;
25
352
  get isIndexNode(): boolean;
@@ -27,90 +354,533 @@ export declare const createIndexNode: import("../utils/factory.js").FactoryFunct
27
354
  * Compile a node into a JavaScript function.
28
355
  * This basically pre-calculates as much as possible and only leaves open
29
356
  * calculations which depend on a dynamic scope with variables.
30
- * @param {Object} math Math.js namespace with functions and constants.
31
- * @param {Object} argNames An object with argument names as key and `true`
357
+ * @param math - Math.js namespace with functions and constants.
358
+ * @param argNames - An object with argument names as key and `true`
32
359
  * as value. Used in the SymbolNode to optimize
33
360
  * for arguments from user assigned functions
34
361
  * (see FunctionAssignmentNode) or special symbols
35
362
  * like `end` (see IndexNode).
36
- * @return {function} Returns a function which can be called like:
363
+ * @returns Returns a function which can be called like:
37
364
  * evalNode(scope: Object, args: Object, context: *)
38
365
  */
39
366
  _compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
40
367
  /**
41
368
  * Execute a callback for each of the child nodes of this node
42
- * @param {function(child: Node, path: string, parent: Node)} callback
369
+ * @param callback
43
370
  */
44
- forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
371
+ forEach(callback: (child: MathNode, path: string, parent: /*elided*/ any) => void): void;
45
372
  /**
46
373
  * Create a new IndexNode whose children are the results of calling
47
374
  * the provided callback function for each child of the original node.
48
- * @param {function(child: Node, path: string, parent: Node): Node} callback
49
- * @returns {IndexNode} Returns a transformed copy of the node
375
+ * @param callback
376
+ * @returns Returns a transformed copy of the node
50
377
  */
51
- map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
378
+ map(callback: (child: MathNode, path: string, parent: /*elided*/ any) => MathNode): /*elided*/ any;
52
379
  /**
53
380
  * Create a clone of this node, a shallow copy
54
- * @return {IndexNode}
55
381
  */
56
382
  clone(): /*elided*/ any;
57
383
  /**
58
384
  * Test whether this IndexNode contains a single property name
59
- * @return {boolean}
60
385
  */
61
386
  isObjectProperty(): boolean;
62
387
  /**
63
388
  * Returns the property name if IndexNode contains a property.
64
389
  * If not, returns null.
65
- * @return {string | null}
66
390
  */
67
391
  getObjectProperty(): string | null;
68
392
  /**
69
393
  * Get string representation
70
- * @param {Object} options
71
- * @return {string} str
394
+ * @param _options
395
+ * @returns str
72
396
  */
73
397
  _toString(_options?: StringOptions): string;
74
398
  /**
75
399
  * Get a JSON representation of the node
76
- * @returns {Object}
77
400
  */
78
- toJSON(): Record<string, unknown>;
401
+ toJSON(): {
402
+ mathjs: string;
403
+ dimensions: MathNode[];
404
+ dotNotation: boolean;
405
+ };
79
406
  /**
80
407
  * Get HTML representation
81
- * @param {Object} options
82
- * @return {string} str
408
+ * @param _options
409
+ * @returns str
83
410
  */
84
411
  _toHTML(_options?: StringOptions): string;
85
412
  /**
86
413
  * Get LaTeX representation
87
- * @param {Object} options
88
- * @return {string} str
414
+ * @param options
415
+ * @returns str
89
416
  */
90
417
  _toTex(options?: StringOptions): string;
91
- _ifNode: (node: unknown) => Node;
92
- filter: (callback: (node: Node) => boolean) => Node[];
93
- isSymbolNode?: boolean;
94
- name?: string;
95
- value?: unknown;
96
- toHTML: (options?: StringOptions) => string;
97
- toTex: (options?: StringOptions) => string;
98
- toString: (options?: StringOptions) => string;
418
+ cloneDeep(): {
419
+ get type(): string;
420
+ get isNode(): boolean;
421
+ evaluate(scope?: Record<string, unknown>): unknown;
422
+ compile(): import("./Node.js").CompiledExpression;
423
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
424
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
425
+ map(_callback: (child: any, path: string, parent: any) => any): any;
426
+ _ifNode(node: unknown): any;
427
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
428
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
429
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
430
+ clone(): any;
431
+ cloneDeep(): any;
432
+ equals(other: any | null | undefined): boolean;
433
+ toString(options?: import("./Node.js").StringOptions): string;
434
+ _toString(_options?: import("./Node.js").StringOptions): string;
435
+ toJSON(): Record<string, unknown>;
436
+ toHTML(options?: import("./Node.js").StringOptions): string;
437
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
438
+ toTex(options?: import("./Node.js").StringOptions): string;
439
+ toMarkdown(options?: {
440
+ inline?: boolean;
441
+ } & import("./Node.js").StringOptions): string;
442
+ toDOT(options?: {
443
+ name?: string;
444
+ }): string;
445
+ toMathML(): string;
446
+ _toMathML(): string;
447
+ _toTex(_options?: import("./Node.js").StringOptions): string;
448
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
449
+ getIdentifier(): string;
450
+ getContent(): any;
451
+ };
452
+ equals(other: {
453
+ get type(): string;
454
+ get isNode(): boolean;
455
+ evaluate(scope?: Record<string, unknown>): unknown;
456
+ compile(): import("./Node.js").CompiledExpression;
457
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
458
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
459
+ map(_callback: (child: any, path: string, parent: any) => any): any;
460
+ _ifNode(node: unknown): any;
461
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
462
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
463
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
464
+ clone(): any;
465
+ cloneDeep(): any;
466
+ equals(other: any | null | undefined): boolean;
467
+ toString(options?: import("./Node.js").StringOptions): string;
468
+ _toString(_options?: import("./Node.js").StringOptions): string;
469
+ toJSON(): Record<string, unknown>;
470
+ toHTML(options?: import("./Node.js").StringOptions): string;
471
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
472
+ toTex(options?: import("./Node.js").StringOptions): string;
473
+ toMarkdown(options?: {
474
+ inline?: boolean;
475
+ } & import("./Node.js").StringOptions): string;
476
+ toDOT(options?: {
477
+ name?: string;
478
+ }): string;
479
+ toMathML(): string;
480
+ _toMathML(): string;
481
+ _toTex(_options?: import("./Node.js").StringOptions): string;
482
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
483
+ getIdentifier(): string;
484
+ getContent(): any;
485
+ } | null | undefined): boolean;
486
+ toString(options?: import("./Node.js").StringOptions): string;
487
+ toHTML(options?: import("./Node.js").StringOptions): string;
488
+ toTex(options?: import("./Node.js").StringOptions): string;
489
+ toMarkdown(options?: {
490
+ inline?: boolean;
491
+ } & import("./Node.js").StringOptions): string;
492
+ toDOT(options?: {
493
+ name?: string;
494
+ }): string;
495
+ toMathML(): string;
496
+ _toMathML(): string;
497
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
498
+ getIdentifier(): string;
499
+ getContent(): {
500
+ get type(): string;
501
+ get isNode(): boolean;
502
+ evaluate(scope?: Record<string, unknown>): unknown;
503
+ compile(): import("./Node.js").CompiledExpression;
504
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
505
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
506
+ map(_callback: (child: any, path: string, parent: any) => any): any;
507
+ _ifNode(node: unknown): any;
508
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
509
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
510
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
511
+ clone(): any;
512
+ cloneDeep(): any;
513
+ equals(other: any | null | undefined): boolean;
514
+ toString(options?: import("./Node.js").StringOptions): string;
515
+ _toString(_options?: import("./Node.js").StringOptions): string;
516
+ toJSON(): Record<string, unknown>;
517
+ toHTML(options?: import("./Node.js").StringOptions): string;
518
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
519
+ toTex(options?: import("./Node.js").StringOptions): string;
520
+ toMarkdown(options?: {
521
+ inline?: boolean;
522
+ } & import("./Node.js").StringOptions): string;
523
+ toDOT(options?: {
524
+ name?: string;
525
+ }): string;
526
+ toMathML(): string;
527
+ _toMathML(): string;
528
+ _toTex(_options?: import("./Node.js").StringOptions): string;
529
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
530
+ getIdentifier(): string;
531
+ getContent(): any;
532
+ };
99
533
  };
100
534
  name: string;
101
535
  /**
102
536
  * Instantiate an IndexNode from its JSON representation
103
- * @param {Object} json
537
+ * @param json
104
538
  * An object structured like
105
539
  * `{"mathjs": "IndexNode", dimensions: [...], dotNotation: false}`,
106
540
  * where mathjs is optional
107
- * @returns {IndexNode}
108
541
  */
109
542
  fromJSON(json: {
110
- dimensions: Node[];
543
+ dimensions: MathNode[];
111
544
  dotNotation: boolean;
112
545
  }): {
113
- dimensions: Node[];
546
+ get isNode(): boolean;
547
+ evaluate(scope?: Record<string, unknown>): unknown;
548
+ compile(): import("./Node.js").CompiledExpression;
549
+ _ifNode(node: unknown): {
550
+ get type(): string;
551
+ get isNode(): boolean;
552
+ evaluate(scope?: Record<string, unknown>): unknown;
553
+ compile(): import("./Node.js").CompiledExpression;
554
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
555
+ forEach(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => void): void;
556
+ map(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => /*elided*/ any): /*elided*/ any;
557
+ _ifNode(node: unknown): /*elided*/ any;
558
+ traverse(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => void): void;
559
+ transform(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => /*elided*/ any): /*elided*/ any;
560
+ filter(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => boolean): /*elided*/ any[];
561
+ clone(): /*elided*/ any;
562
+ cloneDeep(): /*elided*/ any;
563
+ equals(other: /*elided*/ any | null | undefined): boolean;
564
+ toString(options?: import("./Node.js").StringOptions): string;
565
+ _toString(_options?: import("./Node.js").StringOptions): string;
566
+ toJSON(): Record<string, unknown>;
567
+ toHTML(options?: import("./Node.js").StringOptions): string;
568
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
569
+ toTex(options?: import("./Node.js").StringOptions): string;
570
+ toMarkdown(options?: {
571
+ inline?: boolean;
572
+ } & import("./Node.js").StringOptions): string;
573
+ toDOT(options?: {
574
+ name?: string;
575
+ }): string;
576
+ toMathML(): string;
577
+ _toMathML(): string;
578
+ _toTex(_options?: import("./Node.js").StringOptions): string;
579
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
580
+ getIdentifier(): string;
581
+ getContent(): /*elided*/ any;
582
+ };
583
+ traverse(callback: (node: {
584
+ get type(): string;
585
+ get isNode(): boolean;
586
+ evaluate(scope?: Record<string, unknown>): unknown;
587
+ compile(): import("./Node.js").CompiledExpression;
588
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
589
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
590
+ map(_callback: (child: any, path: string, parent: any) => any): any;
591
+ _ifNode(node: unknown): any;
592
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
593
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
594
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
595
+ clone(): any;
596
+ cloneDeep(): any;
597
+ equals(other: any | null | undefined): boolean;
598
+ toString(options?: import("./Node.js").StringOptions): string;
599
+ _toString(_options?: import("./Node.js").StringOptions): string;
600
+ toJSON(): Record<string, unknown>;
601
+ toHTML(options?: import("./Node.js").StringOptions): string;
602
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
603
+ toTex(options?: import("./Node.js").StringOptions): string;
604
+ toMarkdown(options?: {
605
+ inline?: boolean;
606
+ } & import("./Node.js").StringOptions): string;
607
+ toDOT(options?: {
608
+ name?: string;
609
+ }): string;
610
+ toMathML(): string;
611
+ _toMathML(): string;
612
+ _toTex(_options?: import("./Node.js").StringOptions): string;
613
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
614
+ getIdentifier(): string;
615
+ getContent(): any;
616
+ }, path: string | null, parent: {
617
+ get type(): string;
618
+ get isNode(): boolean;
619
+ evaluate(scope?: Record<string, unknown>): unknown;
620
+ compile(): import("./Node.js").CompiledExpression;
621
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
622
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
623
+ map(_callback: (child: any, path: string, parent: any) => any): any;
624
+ _ifNode(node: unknown): any;
625
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
626
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
627
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
628
+ clone(): any;
629
+ cloneDeep(): any;
630
+ equals(other: any | null | undefined): boolean;
631
+ toString(options?: import("./Node.js").StringOptions): string;
632
+ _toString(_options?: import("./Node.js").StringOptions): string;
633
+ toJSON(): Record<string, unknown>;
634
+ toHTML(options?: import("./Node.js").StringOptions): string;
635
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
636
+ toTex(options?: import("./Node.js").StringOptions): string;
637
+ toMarkdown(options?: {
638
+ inline?: boolean;
639
+ } & import("./Node.js").StringOptions): string;
640
+ toDOT(options?: {
641
+ name?: string;
642
+ }): string;
643
+ toMathML(): string;
644
+ _toMathML(): string;
645
+ _toTex(_options?: import("./Node.js").StringOptions): string;
646
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
647
+ getIdentifier(): string;
648
+ getContent(): any;
649
+ } | null) => void): void;
650
+ transform(callback: (node: {
651
+ get type(): string;
652
+ get isNode(): boolean;
653
+ evaluate(scope?: Record<string, unknown>): unknown;
654
+ compile(): import("./Node.js").CompiledExpression;
655
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
656
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
657
+ map(_callback: (child: any, path: string, parent: any) => any): any;
658
+ _ifNode(node: unknown): any;
659
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
660
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
661
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
662
+ clone(): any;
663
+ cloneDeep(): any;
664
+ equals(other: any | null | undefined): boolean;
665
+ toString(options?: import("./Node.js").StringOptions): string;
666
+ _toString(_options?: import("./Node.js").StringOptions): string;
667
+ toJSON(): Record<string, unknown>;
668
+ toHTML(options?: import("./Node.js").StringOptions): string;
669
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
670
+ toTex(options?: import("./Node.js").StringOptions): string;
671
+ toMarkdown(options?: {
672
+ inline?: boolean;
673
+ } & import("./Node.js").StringOptions): string;
674
+ toDOT(options?: {
675
+ name?: string;
676
+ }): string;
677
+ toMathML(): string;
678
+ _toMathML(): string;
679
+ _toTex(_options?: import("./Node.js").StringOptions): string;
680
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
681
+ getIdentifier(): string;
682
+ getContent(): any;
683
+ }, path: string | null, parent: {
684
+ get type(): string;
685
+ get isNode(): boolean;
686
+ evaluate(scope?: Record<string, unknown>): unknown;
687
+ compile(): import("./Node.js").CompiledExpression;
688
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
689
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
690
+ map(_callback: (child: any, path: string, parent: any) => any): any;
691
+ _ifNode(node: unknown): any;
692
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
693
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
694
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
695
+ clone(): any;
696
+ cloneDeep(): any;
697
+ equals(other: any | null | undefined): boolean;
698
+ toString(options?: import("./Node.js").StringOptions): string;
699
+ _toString(_options?: import("./Node.js").StringOptions): string;
700
+ toJSON(): Record<string, unknown>;
701
+ toHTML(options?: import("./Node.js").StringOptions): string;
702
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
703
+ toTex(options?: import("./Node.js").StringOptions): string;
704
+ toMarkdown(options?: {
705
+ inline?: boolean;
706
+ } & import("./Node.js").StringOptions): string;
707
+ toDOT(options?: {
708
+ name?: string;
709
+ }): string;
710
+ toMathML(): string;
711
+ _toMathML(): string;
712
+ _toTex(_options?: import("./Node.js").StringOptions): string;
713
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
714
+ getIdentifier(): string;
715
+ getContent(): any;
716
+ } | null) => {
717
+ get type(): string;
718
+ get isNode(): boolean;
719
+ evaluate(scope?: Record<string, unknown>): unknown;
720
+ compile(): import("./Node.js").CompiledExpression;
721
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
722
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
723
+ map(_callback: (child: any, path: string, parent: any) => any): any;
724
+ _ifNode(node: unknown): any;
725
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
726
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
727
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
728
+ clone(): any;
729
+ cloneDeep(): any;
730
+ equals(other: any | null | undefined): boolean;
731
+ toString(options?: import("./Node.js").StringOptions): string;
732
+ _toString(_options?: import("./Node.js").StringOptions): string;
733
+ toJSON(): Record<string, unknown>;
734
+ toHTML(options?: import("./Node.js").StringOptions): string;
735
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
736
+ toTex(options?: import("./Node.js").StringOptions): string;
737
+ toMarkdown(options?: {
738
+ inline?: boolean;
739
+ } & import("./Node.js").StringOptions): string;
740
+ toDOT(options?: {
741
+ name?: string;
742
+ }): string;
743
+ toMathML(): string;
744
+ _toMathML(): string;
745
+ _toTex(_options?: import("./Node.js").StringOptions): string;
746
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
747
+ getIdentifier(): string;
748
+ getContent(): any;
749
+ }): {
750
+ get type(): string;
751
+ get isNode(): boolean;
752
+ evaluate(scope?: Record<string, unknown>): unknown;
753
+ compile(): import("./Node.js").CompiledExpression;
754
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
755
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
756
+ map(_callback: (child: any, path: string, parent: any) => any): any;
757
+ _ifNode(node: unknown): any;
758
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
759
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
760
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
761
+ clone(): any;
762
+ cloneDeep(): any;
763
+ equals(other: any | null | undefined): boolean;
764
+ toString(options?: import("./Node.js").StringOptions): string;
765
+ _toString(_options?: import("./Node.js").StringOptions): string;
766
+ toJSON(): Record<string, unknown>;
767
+ toHTML(options?: import("./Node.js").StringOptions): string;
768
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
769
+ toTex(options?: import("./Node.js").StringOptions): string;
770
+ toMarkdown(options?: {
771
+ inline?: boolean;
772
+ } & import("./Node.js").StringOptions): string;
773
+ toDOT(options?: {
774
+ name?: string;
775
+ }): string;
776
+ toMathML(): string;
777
+ _toMathML(): string;
778
+ _toTex(_options?: import("./Node.js").StringOptions): string;
779
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
780
+ getIdentifier(): string;
781
+ getContent(): any;
782
+ };
783
+ filter(callback: (node: {
784
+ get type(): string;
785
+ get isNode(): boolean;
786
+ evaluate(scope?: Record<string, unknown>): unknown;
787
+ compile(): import("./Node.js").CompiledExpression;
788
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
789
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
790
+ map(_callback: (child: any, path: string, parent: any) => any): any;
791
+ _ifNode(node: unknown): any;
792
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
793
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
794
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
795
+ clone(): any;
796
+ cloneDeep(): any;
797
+ equals(other: any | null | undefined): boolean;
798
+ toString(options?: import("./Node.js").StringOptions): string;
799
+ _toString(_options?: import("./Node.js").StringOptions): string;
800
+ toJSON(): Record<string, unknown>;
801
+ toHTML(options?: import("./Node.js").StringOptions): string;
802
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
803
+ toTex(options?: import("./Node.js").StringOptions): string;
804
+ toMarkdown(options?: {
805
+ inline?: boolean;
806
+ } & import("./Node.js").StringOptions): string;
807
+ toDOT(options?: {
808
+ name?: string;
809
+ }): string;
810
+ toMathML(): string;
811
+ _toMathML(): string;
812
+ _toTex(_options?: import("./Node.js").StringOptions): string;
813
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
814
+ getIdentifier(): string;
815
+ getContent(): any;
816
+ }, path: string | null, parent: {
817
+ get type(): string;
818
+ get isNode(): boolean;
819
+ evaluate(scope?: Record<string, unknown>): unknown;
820
+ compile(): import("./Node.js").CompiledExpression;
821
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
822
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
823
+ map(_callback: (child: any, path: string, parent: any) => any): any;
824
+ _ifNode(node: unknown): any;
825
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
826
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
827
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
828
+ clone(): any;
829
+ cloneDeep(): any;
830
+ equals(other: any | null | undefined): boolean;
831
+ toString(options?: import("./Node.js").StringOptions): string;
832
+ _toString(_options?: import("./Node.js").StringOptions): string;
833
+ toJSON(): Record<string, unknown>;
834
+ toHTML(options?: import("./Node.js").StringOptions): string;
835
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
836
+ toTex(options?: import("./Node.js").StringOptions): string;
837
+ toMarkdown(options?: {
838
+ inline?: boolean;
839
+ } & import("./Node.js").StringOptions): string;
840
+ toDOT(options?: {
841
+ name?: string;
842
+ }): string;
843
+ toMathML(): string;
844
+ _toMathML(): string;
845
+ _toTex(_options?: import("./Node.js").StringOptions): string;
846
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
847
+ getIdentifier(): string;
848
+ getContent(): any;
849
+ } | null) => boolean): {
850
+ get type(): string;
851
+ get isNode(): boolean;
852
+ evaluate(scope?: Record<string, unknown>): unknown;
853
+ compile(): import("./Node.js").CompiledExpression;
854
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
855
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
856
+ map(_callback: (child: any, path: string, parent: any) => any): any;
857
+ _ifNode(node: unknown): any;
858
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
859
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
860
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
861
+ clone(): any;
862
+ cloneDeep(): any;
863
+ equals(other: any | null | undefined): boolean;
864
+ toString(options?: import("./Node.js").StringOptions): string;
865
+ _toString(_options?: import("./Node.js").StringOptions): string;
866
+ toJSON(): Record<string, unknown>;
867
+ toHTML(options?: import("./Node.js").StringOptions): string;
868
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
869
+ toTex(options?: import("./Node.js").StringOptions): string;
870
+ toMarkdown(options?: {
871
+ inline?: boolean;
872
+ } & import("./Node.js").StringOptions): string;
873
+ toDOT(options?: {
874
+ name?: string;
875
+ }): string;
876
+ toMathML(): string;
877
+ _toMathML(): string;
878
+ _toTex(_options?: import("./Node.js").StringOptions): string;
879
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
880
+ getIdentifier(): string;
881
+ getContent(): any;
882
+ }[];
883
+ dimensions: MathNode[];
114
884
  dotNotation: boolean;
115
885
  get type(): string;
116
886
  get isIndexNode(): boolean;
@@ -118,75 +888,182 @@ export declare const createIndexNode: import("../utils/factory.js").FactoryFunct
118
888
  * Compile a node into a JavaScript function.
119
889
  * This basically pre-calculates as much as possible and only leaves open
120
890
  * calculations which depend on a dynamic scope with variables.
121
- * @param {Object} math Math.js namespace with functions and constants.
122
- * @param {Object} argNames An object with argument names as key and `true`
891
+ * @param math - Math.js namespace with functions and constants.
892
+ * @param argNames - An object with argument names as key and `true`
123
893
  * as value. Used in the SymbolNode to optimize
124
894
  * for arguments from user assigned functions
125
895
  * (see FunctionAssignmentNode) or special symbols
126
896
  * like `end` (see IndexNode).
127
- * @return {function} Returns a function which can be called like:
897
+ * @returns Returns a function which can be called like:
128
898
  * evalNode(scope: Object, args: Object, context: *)
129
899
  */
130
900
  _compile(math: Record<string, unknown>, argNames: Record<string, boolean>): CompileFunction;
131
901
  /**
132
902
  * Execute a callback for each of the child nodes of this node
133
- * @param {function(child: Node, path: string, parent: Node)} callback
903
+ * @param callback
134
904
  */
135
- forEach(callback: (child: Node, path: string, parent: /*elided*/ any) => void): void;
905
+ forEach(callback: (child: MathNode, path: string, parent: /*elided*/ any) => void): void;
136
906
  /**
137
907
  * Create a new IndexNode whose children are the results of calling
138
908
  * the provided callback function for each child of the original node.
139
- * @param {function(child: Node, path: string, parent: Node): Node} callback
140
- * @returns {IndexNode} Returns a transformed copy of the node
909
+ * @param callback
910
+ * @returns Returns a transformed copy of the node
141
911
  */
142
- map(callback: (child: Node, path: string, parent: /*elided*/ any) => Node): /*elided*/ any;
912
+ map(callback: (child: MathNode, path: string, parent: /*elided*/ any) => MathNode): /*elided*/ any;
143
913
  /**
144
914
  * Create a clone of this node, a shallow copy
145
- * @return {IndexNode}
146
915
  */
147
916
  clone(): /*elided*/ any;
148
917
  /**
149
918
  * Test whether this IndexNode contains a single property name
150
- * @return {boolean}
151
919
  */
152
920
  isObjectProperty(): boolean;
153
921
  /**
154
922
  * Returns the property name if IndexNode contains a property.
155
923
  * If not, returns null.
156
- * @return {string | null}
157
924
  */
158
925
  getObjectProperty(): string | null;
159
926
  /**
160
927
  * Get string representation
161
- * @param {Object} options
162
- * @return {string} str
928
+ * @param _options
929
+ * @returns str
163
930
  */
164
931
  _toString(_options?: StringOptions): string;
165
932
  /**
166
933
  * Get a JSON representation of the node
167
- * @returns {Object}
168
934
  */
169
- toJSON(): Record<string, unknown>;
935
+ toJSON(): {
936
+ mathjs: string;
937
+ dimensions: MathNode[];
938
+ dotNotation: boolean;
939
+ };
170
940
  /**
171
941
  * Get HTML representation
172
- * @param {Object} options
173
- * @return {string} str
942
+ * @param _options
943
+ * @returns str
174
944
  */
175
945
  _toHTML(_options?: StringOptions): string;
176
946
  /**
177
947
  * Get LaTeX representation
178
- * @param {Object} options
179
- * @return {string} str
948
+ * @param options
949
+ * @returns str
180
950
  */
181
951
  _toTex(options?: StringOptions): string;
182
- _ifNode: (node: unknown) => Node;
183
- filter: (callback: (node: Node) => boolean) => Node[];
184
- isSymbolNode?: boolean;
185
- name?: string;
186
- value?: unknown;
187
- toHTML: (options?: StringOptions) => string;
188
- toTex: (options?: StringOptions) => string;
189
- toString: (options?: StringOptions) => string;
952
+ cloneDeep(): {
953
+ get type(): string;
954
+ get isNode(): boolean;
955
+ evaluate(scope?: Record<string, unknown>): unknown;
956
+ compile(): import("./Node.js").CompiledExpression;
957
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
958
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
959
+ map(_callback: (child: any, path: string, parent: any) => any): any;
960
+ _ifNode(node: unknown): any;
961
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
962
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
963
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
964
+ clone(): any;
965
+ cloneDeep(): any;
966
+ equals(other: any | null | undefined): boolean;
967
+ toString(options?: import("./Node.js").StringOptions): string;
968
+ _toString(_options?: import("./Node.js").StringOptions): string;
969
+ toJSON(): Record<string, unknown>;
970
+ toHTML(options?: import("./Node.js").StringOptions): string;
971
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
972
+ toTex(options?: import("./Node.js").StringOptions): string;
973
+ toMarkdown(options?: {
974
+ inline?: boolean;
975
+ } & import("./Node.js").StringOptions): string;
976
+ toDOT(options?: {
977
+ name?: string;
978
+ }): string;
979
+ toMathML(): string;
980
+ _toMathML(): string;
981
+ _toTex(_options?: import("./Node.js").StringOptions): string;
982
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
983
+ getIdentifier(): string;
984
+ getContent(): any;
985
+ };
986
+ equals(other: {
987
+ get type(): string;
988
+ get isNode(): boolean;
989
+ evaluate(scope?: Record<string, unknown>): unknown;
990
+ compile(): import("./Node.js").CompiledExpression;
991
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
992
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
993
+ map(_callback: (child: any, path: string, parent: any) => any): any;
994
+ _ifNode(node: unknown): any;
995
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
996
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
997
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
998
+ clone(): any;
999
+ cloneDeep(): any;
1000
+ equals(other: any | null | undefined): boolean;
1001
+ toString(options?: import("./Node.js").StringOptions): string;
1002
+ _toString(_options?: import("./Node.js").StringOptions): string;
1003
+ toJSON(): Record<string, unknown>;
1004
+ toHTML(options?: import("./Node.js").StringOptions): string;
1005
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
1006
+ toTex(options?: import("./Node.js").StringOptions): string;
1007
+ toMarkdown(options?: {
1008
+ inline?: boolean;
1009
+ } & import("./Node.js").StringOptions): string;
1010
+ toDOT(options?: {
1011
+ name?: string;
1012
+ }): string;
1013
+ toMathML(): string;
1014
+ _toMathML(): string;
1015
+ _toTex(_options?: import("./Node.js").StringOptions): string;
1016
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
1017
+ getIdentifier(): string;
1018
+ getContent(): any;
1019
+ } | null | undefined): boolean;
1020
+ toString(options?: import("./Node.js").StringOptions): string;
1021
+ toHTML(options?: import("./Node.js").StringOptions): string;
1022
+ toTex(options?: import("./Node.js").StringOptions): string;
1023
+ toMarkdown(options?: {
1024
+ inline?: boolean;
1025
+ } & import("./Node.js").StringOptions): string;
1026
+ toDOT(options?: {
1027
+ name?: string;
1028
+ }): string;
1029
+ toMathML(): string;
1030
+ _toMathML(): string;
1031
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
1032
+ getIdentifier(): string;
1033
+ getContent(): {
1034
+ get type(): string;
1035
+ get isNode(): boolean;
1036
+ evaluate(scope?: Record<string, unknown>): unknown;
1037
+ compile(): import("./Node.js").CompiledExpression;
1038
+ _compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
1039
+ forEach(_callback: (child: any, path: string, parent: any) => void): void;
1040
+ map(_callback: (child: any, path: string, parent: any) => any): any;
1041
+ _ifNode(node: unknown): any;
1042
+ traverse(callback: (node: any, path: string | null, parent: any | null) => void): void;
1043
+ transform(callback: (node: any, path: string | null, parent: any | null) => any): any;
1044
+ filter(callback: (node: any, path: string | null, parent: any | null) => boolean): any[];
1045
+ clone(): any;
1046
+ cloneDeep(): any;
1047
+ equals(other: any | null | undefined): boolean;
1048
+ toString(options?: import("./Node.js").StringOptions): string;
1049
+ _toString(_options?: import("./Node.js").StringOptions): string;
1050
+ toJSON(): Record<string, unknown>;
1051
+ toHTML(options?: import("./Node.js").StringOptions): string;
1052
+ _toHTML(_options?: import("./Node.js").StringOptions): string;
1053
+ toTex(options?: import("./Node.js").StringOptions): string;
1054
+ toMarkdown(options?: {
1055
+ inline?: boolean;
1056
+ } & import("./Node.js").StringOptions): string;
1057
+ toDOT(options?: {
1058
+ name?: string;
1059
+ }): string;
1060
+ toMathML(): string;
1061
+ _toMathML(): string;
1062
+ _toTex(_options?: import("./Node.js").StringOptions): string;
1063
+ _getCustomString(options?: import("./Node.js").StringOptions): string | undefined;
1064
+ getIdentifier(): string;
1065
+ getContent(): any;
1066
+ };
190
1067
  };
191
1068
  }>;
192
1069
  export {};