@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
|
@@ -7,40 +7,6 @@ export declare const createConstantNode: import("../utils/factory.js").FactoryFu
|
|
|
7
7
|
get isNode(): boolean;
|
|
8
8
|
evaluate(scope?: Record<string, unknown>): unknown;
|
|
9
9
|
compile(): import("./Node.js").CompiledExpression;
|
|
10
|
-
_ifNode(node: unknown): {
|
|
11
|
-
get type(): string;
|
|
12
|
-
get isNode(): boolean;
|
|
13
|
-
evaluate(scope?: Record<string, unknown>): unknown;
|
|
14
|
-
compile(): import("./Node.js").CompiledExpression;
|
|
15
|
-
_compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
16
|
-
forEach(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => void): void;
|
|
17
|
-
map(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => /*elided*/ any): /*elided*/ any;
|
|
18
|
-
_ifNode(node: unknown): /*elided*/ any;
|
|
19
|
-
traverse(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => void): void;
|
|
20
|
-
transform(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => /*elided*/ any): /*elided*/ any;
|
|
21
|
-
filter(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => boolean): /*elided*/ any[];
|
|
22
|
-
clone(): /*elided*/ any;
|
|
23
|
-
cloneDeep(): /*elided*/ any;
|
|
24
|
-
equals(other: /*elided*/ any | null | undefined): boolean;
|
|
25
|
-
toString(options?: StringOptions): string;
|
|
26
|
-
_toString(_options?: StringOptions): string;
|
|
27
|
-
toJSON(): Record<string, unknown>;
|
|
28
|
-
toHTML(options?: StringOptions): string;
|
|
29
|
-
_toHTML(_options?: StringOptions): string;
|
|
30
|
-
toTex(options?: StringOptions): string;
|
|
31
|
-
toMarkdown(options?: {
|
|
32
|
-
inline?: boolean;
|
|
33
|
-
} & StringOptions): string;
|
|
34
|
-
toDOT(options?: {
|
|
35
|
-
name?: string;
|
|
36
|
-
}): string;
|
|
37
|
-
toMathML(): string;
|
|
38
|
-
_toMathML(): string;
|
|
39
|
-
_toTex(_options?: StringOptions): string;
|
|
40
|
-
_getCustomString(options?: StringOptions): string | undefined;
|
|
41
|
-
getIdentifier(): string;
|
|
42
|
-
getContent(): /*elided*/ any;
|
|
43
|
-
};
|
|
44
10
|
value: unknown;
|
|
45
11
|
get type(): string;
|
|
46
12
|
get isConstantNode(): boolean;
|
|
@@ -48,60 +14,91 @@ export declare const createConstantNode: import("../utils/factory.js").FactoryFu
|
|
|
48
14
|
* Compile a node into a JavaScript function.
|
|
49
15
|
* This basically pre-calculates as much as possible and only leaves open
|
|
50
16
|
* calculations which depend on a dynamic scope with variables.
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
17
|
+
* @param _math - Math.js namespace with functions and constants.
|
|
18
|
+
* @param _argNames - An object with argument names as key and `true`
|
|
53
19
|
* as value. Used in the SymbolNode to optimize
|
|
54
20
|
* for arguments from user assigned functions
|
|
55
21
|
* (see FunctionAssignmentNode) or special symbols
|
|
56
22
|
* like `end` (see IndexNode).
|
|
57
|
-
* @
|
|
23
|
+
* @returns Returns a function which can be called like:
|
|
58
24
|
* evalNode(scope: Object, args: Object, context: *)
|
|
59
25
|
*/
|
|
60
26
|
_compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
61
27
|
/**
|
|
62
28
|
* Execute a callback for each of the child nodes of this node
|
|
63
|
-
* @param
|
|
29
|
+
* @param _callback
|
|
64
30
|
*/
|
|
65
31
|
forEach(_callback: (child: MathNode, path: string, parent: MathNode) => void): void;
|
|
66
32
|
/**
|
|
67
33
|
* Create a new ConstantNode with children produced by the given callback.
|
|
68
34
|
* Trivial because there are no children.
|
|
69
|
-
* @param
|
|
70
|
-
* @returns
|
|
35
|
+
* @param _callback
|
|
36
|
+
* @returns Returns a clone of the node
|
|
71
37
|
*/
|
|
72
38
|
map(_callback: (child: MathNode, path: string, parent: MathNode) => MathNode): /*elided*/ any;
|
|
73
39
|
/**
|
|
74
40
|
* Create a clone of this node, a shallow copy
|
|
75
|
-
* @return {ConstantNode}
|
|
76
41
|
*/
|
|
77
42
|
clone(): /*elided*/ any;
|
|
78
43
|
/**
|
|
79
44
|
* Get string representation
|
|
80
|
-
* @param
|
|
81
|
-
* @
|
|
45
|
+
* @param options
|
|
46
|
+
* @returns str
|
|
82
47
|
*/
|
|
83
48
|
_toString(options?: StringOptions): string;
|
|
84
49
|
/**
|
|
85
50
|
* Get HTML representation
|
|
86
|
-
* @param
|
|
87
|
-
* @
|
|
51
|
+
* @param options
|
|
52
|
+
* @returns str
|
|
88
53
|
*/
|
|
89
54
|
_toHTML(options?: StringOptions): string;
|
|
90
55
|
/**
|
|
91
56
|
* Get a JSON representation of the node
|
|
92
|
-
* @returns {Object}
|
|
93
57
|
*/
|
|
94
58
|
toJSON(): {
|
|
95
59
|
mathjs: string;
|
|
96
60
|
value: unknown;
|
|
97
61
|
};
|
|
98
62
|
/**
|
|
99
|
-
* Get
|
|
100
|
-
* @
|
|
101
|
-
* @return {string} str
|
|
63
|
+
* Get the MathML representation of this node.
|
|
64
|
+
* @returns str
|
|
102
65
|
*/
|
|
103
66
|
_toMathML(): string;
|
|
104
67
|
_toTex(options?: StringOptions): string;
|
|
68
|
+
_ifNode(node: unknown): {
|
|
69
|
+
get type(): string;
|
|
70
|
+
get isNode(): boolean;
|
|
71
|
+
evaluate(scope?: Record<string, unknown>): unknown;
|
|
72
|
+
compile(): import("./Node.js").CompiledExpression;
|
|
73
|
+
_compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
74
|
+
forEach(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => void): void;
|
|
75
|
+
map(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => /*elided*/ any): /*elided*/ any;
|
|
76
|
+
_ifNode(node: unknown): /*elided*/ any;
|
|
77
|
+
traverse(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => void): void;
|
|
78
|
+
transform(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => /*elided*/ any): /*elided*/ any;
|
|
79
|
+
filter(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => boolean): /*elided*/ any[];
|
|
80
|
+
clone(): /*elided*/ any;
|
|
81
|
+
cloneDeep(): /*elided*/ any;
|
|
82
|
+
equals(other: /*elided*/ any | null | undefined): boolean;
|
|
83
|
+
toString(options?: StringOptions): string;
|
|
84
|
+
_toString(_options?: StringOptions): string;
|
|
85
|
+
toJSON(): Record<string, unknown>;
|
|
86
|
+
toHTML(options?: StringOptions): string;
|
|
87
|
+
_toHTML(_options?: StringOptions): string;
|
|
88
|
+
toTex(options?: StringOptions): string;
|
|
89
|
+
toMarkdown(options?: {
|
|
90
|
+
inline?: boolean;
|
|
91
|
+
} & StringOptions): string;
|
|
92
|
+
toDOT(options?: {
|
|
93
|
+
name?: string;
|
|
94
|
+
}): string;
|
|
95
|
+
toMathML(): string;
|
|
96
|
+
_toMathML(): string;
|
|
97
|
+
_toTex(_options?: StringOptions): string;
|
|
98
|
+
_getCustomString(options?: StringOptions): string | undefined;
|
|
99
|
+
getIdentifier(): string;
|
|
100
|
+
getContent(): /*elided*/ any;
|
|
101
|
+
};
|
|
105
102
|
traverse(callback: (node: {
|
|
106
103
|
get type(): string;
|
|
107
104
|
get isNode(): boolean;
|
|
@@ -520,10 +517,9 @@ export declare const createConstantNode: import("../utils/factory.js").FactoryFu
|
|
|
520
517
|
name: string;
|
|
521
518
|
/**
|
|
522
519
|
* Instantiate a ConstantNode from its JSON representation
|
|
523
|
-
* @param
|
|
520
|
+
* @param json - An object structured like
|
|
524
521
|
* `{"mathjs": "SymbolNode", value: 2.3}`,
|
|
525
522
|
* where mathjs is optional
|
|
526
|
-
* @returns {ConstantNode}
|
|
527
523
|
*/
|
|
528
524
|
fromJSON(json: {
|
|
529
525
|
value: unknown;
|
|
@@ -531,40 +527,6 @@ export declare const createConstantNode: import("../utils/factory.js").FactoryFu
|
|
|
531
527
|
get isNode(): boolean;
|
|
532
528
|
evaluate(scope?: Record<string, unknown>): unknown;
|
|
533
529
|
compile(): import("./Node.js").CompiledExpression;
|
|
534
|
-
_ifNode(node: unknown): {
|
|
535
|
-
get type(): string;
|
|
536
|
-
get isNode(): boolean;
|
|
537
|
-
evaluate(scope?: Record<string, unknown>): unknown;
|
|
538
|
-
compile(): import("./Node.js").CompiledExpression;
|
|
539
|
-
_compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
540
|
-
forEach(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => void): void;
|
|
541
|
-
map(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => /*elided*/ any): /*elided*/ any;
|
|
542
|
-
_ifNode(node: unknown): /*elided*/ any;
|
|
543
|
-
traverse(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => void): void;
|
|
544
|
-
transform(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => /*elided*/ any): /*elided*/ any;
|
|
545
|
-
filter(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => boolean): /*elided*/ any[];
|
|
546
|
-
clone(): /*elided*/ any;
|
|
547
|
-
cloneDeep(): /*elided*/ any;
|
|
548
|
-
equals(other: /*elided*/ any | null | undefined): boolean;
|
|
549
|
-
toString(options?: StringOptions): string;
|
|
550
|
-
_toString(_options?: StringOptions): string;
|
|
551
|
-
toJSON(): Record<string, unknown>;
|
|
552
|
-
toHTML(options?: StringOptions): string;
|
|
553
|
-
_toHTML(_options?: StringOptions): string;
|
|
554
|
-
toTex(options?: StringOptions): string;
|
|
555
|
-
toMarkdown(options?: {
|
|
556
|
-
inline?: boolean;
|
|
557
|
-
} & StringOptions): string;
|
|
558
|
-
toDOT(options?: {
|
|
559
|
-
name?: string;
|
|
560
|
-
}): string;
|
|
561
|
-
toMathML(): string;
|
|
562
|
-
_toMathML(): string;
|
|
563
|
-
_toTex(_options?: StringOptions): string;
|
|
564
|
-
_getCustomString(options?: StringOptions): string | undefined;
|
|
565
|
-
getIdentifier(): string;
|
|
566
|
-
getContent(): /*elided*/ any;
|
|
567
|
-
};
|
|
568
530
|
value: unknown;
|
|
569
531
|
get type(): string;
|
|
570
532
|
get isConstantNode(): boolean;
|
|
@@ -572,60 +534,91 @@ export declare const createConstantNode: import("../utils/factory.js").FactoryFu
|
|
|
572
534
|
* Compile a node into a JavaScript function.
|
|
573
535
|
* This basically pre-calculates as much as possible and only leaves open
|
|
574
536
|
* calculations which depend on a dynamic scope with variables.
|
|
575
|
-
* @param
|
|
576
|
-
* @param
|
|
537
|
+
* @param _math - Math.js namespace with functions and constants.
|
|
538
|
+
* @param _argNames - An object with argument names as key and `true`
|
|
577
539
|
* as value. Used in the SymbolNode to optimize
|
|
578
540
|
* for arguments from user assigned functions
|
|
579
541
|
* (see FunctionAssignmentNode) or special symbols
|
|
580
542
|
* like `end` (see IndexNode).
|
|
581
|
-
* @
|
|
543
|
+
* @returns Returns a function which can be called like:
|
|
582
544
|
* evalNode(scope: Object, args: Object, context: *)
|
|
583
545
|
*/
|
|
584
546
|
_compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
585
547
|
/**
|
|
586
548
|
* Execute a callback for each of the child nodes of this node
|
|
587
|
-
* @param
|
|
549
|
+
* @param _callback
|
|
588
550
|
*/
|
|
589
551
|
forEach(_callback: (child: MathNode, path: string, parent: MathNode) => void): void;
|
|
590
552
|
/**
|
|
591
553
|
* Create a new ConstantNode with children produced by the given callback.
|
|
592
554
|
* Trivial because there are no children.
|
|
593
|
-
* @param
|
|
594
|
-
* @returns
|
|
555
|
+
* @param _callback
|
|
556
|
+
* @returns Returns a clone of the node
|
|
595
557
|
*/
|
|
596
558
|
map(_callback: (child: MathNode, path: string, parent: MathNode) => MathNode): /*elided*/ any;
|
|
597
559
|
/**
|
|
598
560
|
* Create a clone of this node, a shallow copy
|
|
599
|
-
* @return {ConstantNode}
|
|
600
561
|
*/
|
|
601
562
|
clone(): /*elided*/ any;
|
|
602
563
|
/**
|
|
603
564
|
* Get string representation
|
|
604
|
-
* @param
|
|
605
|
-
* @
|
|
565
|
+
* @param options
|
|
566
|
+
* @returns str
|
|
606
567
|
*/
|
|
607
568
|
_toString(options?: StringOptions): string;
|
|
608
569
|
/**
|
|
609
570
|
* Get HTML representation
|
|
610
|
-
* @param
|
|
611
|
-
* @
|
|
571
|
+
* @param options
|
|
572
|
+
* @returns str
|
|
612
573
|
*/
|
|
613
574
|
_toHTML(options?: StringOptions): string;
|
|
614
575
|
/**
|
|
615
576
|
* Get a JSON representation of the node
|
|
616
|
-
* @returns {Object}
|
|
617
577
|
*/
|
|
618
578
|
toJSON(): {
|
|
619
579
|
mathjs: string;
|
|
620
580
|
value: unknown;
|
|
621
581
|
};
|
|
622
582
|
/**
|
|
623
|
-
* Get
|
|
624
|
-
* @
|
|
625
|
-
* @return {string} str
|
|
583
|
+
* Get the MathML representation of this node.
|
|
584
|
+
* @returns str
|
|
626
585
|
*/
|
|
627
586
|
_toMathML(): string;
|
|
628
587
|
_toTex(options?: StringOptions): string;
|
|
588
|
+
_ifNode(node: unknown): {
|
|
589
|
+
get type(): string;
|
|
590
|
+
get isNode(): boolean;
|
|
591
|
+
evaluate(scope?: Record<string, unknown>): unknown;
|
|
592
|
+
compile(): import("./Node.js").CompiledExpression;
|
|
593
|
+
_compile(_math: Record<string, unknown>, _argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
594
|
+
forEach(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => void): void;
|
|
595
|
+
map(_callback: (child: /*elided*/ any, path: string, parent: /*elided*/ any) => /*elided*/ any): /*elided*/ any;
|
|
596
|
+
_ifNode(node: unknown): /*elided*/ any;
|
|
597
|
+
traverse(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => void): void;
|
|
598
|
+
transform(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => /*elided*/ any): /*elided*/ any;
|
|
599
|
+
filter(callback: (node: /*elided*/ any, path: string | null, parent: /*elided*/ any | null) => boolean): /*elided*/ any[];
|
|
600
|
+
clone(): /*elided*/ any;
|
|
601
|
+
cloneDeep(): /*elided*/ any;
|
|
602
|
+
equals(other: /*elided*/ any | null | undefined): boolean;
|
|
603
|
+
toString(options?: StringOptions): string;
|
|
604
|
+
_toString(_options?: StringOptions): string;
|
|
605
|
+
toJSON(): Record<string, unknown>;
|
|
606
|
+
toHTML(options?: StringOptions): string;
|
|
607
|
+
_toHTML(_options?: StringOptions): string;
|
|
608
|
+
toTex(options?: StringOptions): string;
|
|
609
|
+
toMarkdown(options?: {
|
|
610
|
+
inline?: boolean;
|
|
611
|
+
} & StringOptions): string;
|
|
612
|
+
toDOT(options?: {
|
|
613
|
+
name?: string;
|
|
614
|
+
}): string;
|
|
615
|
+
toMathML(): string;
|
|
616
|
+
_toMathML(): string;
|
|
617
|
+
_toTex(_options?: StringOptions): string;
|
|
618
|
+
_getCustomString(options?: StringOptions): string | undefined;
|
|
619
|
+
getIdentifier(): string;
|
|
620
|
+
getContent(): /*elided*/ any;
|
|
621
|
+
};
|
|
629
622
|
traverse(callback: (node: {
|
|
630
623
|
get type(): string;
|
|
631
624
|
get isNode(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantNode.d.ts","sourceRoot":"","sources":["../../src/node/ConstantNode.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAKzD,eAAO,MAAM,kBAAkB;UAOrB,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ;eAC/B,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO;;gBAiBjB,OAAO
|
|
1
|
+
{"version":3,"file":"ConstantNode.d.ts","sourceRoot":"","sources":["../../src/node/ConstantNode.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAKzD,eAAO,MAAM,kBAAkB;UAOrB,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ;eAC/B,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO;;gBAiBjB,OAAO;;;;eAdnB,OAAO;oBAmBF,MAAM;8BAGI,OAAO;QAI7B;;;;;;;;;;;;WAYG;wBAEM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,aACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO;QAQ5F;;;WAGG;2BACgB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;QAInF;;;;;WAKG;uBACY,CAAC,KAAK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5F;;;WAGG;2BACgB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;QAInF;;;;;WAKG;uBACY,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAK,QAAQ;QAI5E;;WAEG;;QAKH;;;;WAIG;4BACiB,aAAa,GAAG,MAAM;QAI1C;;;;WAIG;0BACe,aAAa,GAAG,MAAM;QAuBxC;;WAEG;kBACO;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAE;QAc5C;;;WAGG;qBACU,MAAM;yBAIF,aAAa,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC5C,CAAC"}
|
|
@@ -423,43 +423,41 @@ export declare const createFunctionAssignmentNode: import("../utils/factory.js")
|
|
|
423
423
|
* Compile a node into a JavaScript function.
|
|
424
424
|
* This basically pre-calculates as much as possible and only leaves open
|
|
425
425
|
* calculations which depend on a dynamic scope with variables.
|
|
426
|
-
* @param
|
|
427
|
-
* @param
|
|
426
|
+
* @param math - Math.js namespace with functions and constants.
|
|
427
|
+
* @param argNames - An object with argument names as key and `true`
|
|
428
428
|
* as value. Used in the SymbolNode to optimize
|
|
429
429
|
* for arguments from user assigned functions
|
|
430
430
|
* (see FunctionAssignmentNode) or special symbols
|
|
431
431
|
* like `end` (see IndexNode).
|
|
432
|
-
* @
|
|
432
|
+
* @returns Returns a function which can be called like:
|
|
433
433
|
* evalNode(scope: Object, args: Object, context: *)
|
|
434
434
|
*/
|
|
435
435
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
436
436
|
/**
|
|
437
437
|
* Execute a callback for each of the child nodes of this node
|
|
438
|
-
* @param
|
|
438
|
+
* @param callback
|
|
439
439
|
*/
|
|
440
440
|
forEach(callback: (child: MathNode, path: string, parent: MathNode) => void): void;
|
|
441
441
|
/**
|
|
442
442
|
* Create a new FunctionAssignmentNode whose children are the results of
|
|
443
443
|
* calling the provided callback function for each child of the original
|
|
444
444
|
* node.
|
|
445
|
-
* @param
|
|
446
|
-
* @returns
|
|
445
|
+
* @param callback
|
|
446
|
+
* @returns Returns a transformed copy of the node
|
|
447
447
|
*/
|
|
448
448
|
map(callback: (child: MathNode, path: string, parent: MathNode) => MathNode): /*elided*/ any;
|
|
449
449
|
/**
|
|
450
450
|
* Create a clone of this node, a shallow copy
|
|
451
|
-
* @return {FunctionAssignmentNode}
|
|
452
451
|
*/
|
|
453
452
|
clone(): /*elided*/ any;
|
|
454
453
|
/**
|
|
455
454
|
* get string representation
|
|
456
|
-
* @param
|
|
457
|
-
* @
|
|
455
|
+
* @param options
|
|
456
|
+
* @returns str
|
|
458
457
|
*/
|
|
459
458
|
_toString(options?: StringOptions): string;
|
|
460
459
|
/**
|
|
461
460
|
* Get a JSON representation of the node
|
|
462
|
-
* @returns {Object}
|
|
463
461
|
*/
|
|
464
462
|
toJSON(): {
|
|
465
463
|
mathjs: string;
|
|
@@ -469,14 +467,14 @@ export declare const createFunctionAssignmentNode: import("../utils/factory.js")
|
|
|
469
467
|
};
|
|
470
468
|
/**
|
|
471
469
|
* get HTML representation
|
|
472
|
-
* @param
|
|
473
|
-
* @
|
|
470
|
+
* @param options
|
|
471
|
+
* @returns str
|
|
474
472
|
*/
|
|
475
473
|
_toHTML(options?: StringOptions): string;
|
|
476
474
|
/**
|
|
477
475
|
* get LaTeX representation
|
|
478
|
-
* @param
|
|
479
|
-
* @
|
|
476
|
+
* @param options
|
|
477
|
+
* @returns str
|
|
480
478
|
*/
|
|
481
479
|
_toTex(options?: StringOptions): string;
|
|
482
480
|
toString(options?: StringOptions): string;
|
|
@@ -530,14 +528,13 @@ export declare const createFunctionAssignmentNode: import("../utils/factory.js")
|
|
|
530
528
|
name: string;
|
|
531
529
|
/**
|
|
532
530
|
* Instantiate an FunctionAssignmentNode from its JSON representation
|
|
533
|
-
* @param
|
|
531
|
+
* @param json
|
|
534
532
|
* An object structured like
|
|
535
533
|
* ```
|
|
536
534
|
* {"mathjs": "FunctionAssignmentNode",
|
|
537
535
|
* name: ..., params: ..., expr: ...}
|
|
538
536
|
* ```
|
|
539
537
|
* where mathjs is optional
|
|
540
|
-
* @returns {FunctionAssignmentNode}
|
|
541
538
|
*/
|
|
542
539
|
fromJSON(json: {
|
|
543
540
|
name: string;
|
|
@@ -959,43 +956,41 @@ export declare const createFunctionAssignmentNode: import("../utils/factory.js")
|
|
|
959
956
|
* Compile a node into a JavaScript function.
|
|
960
957
|
* This basically pre-calculates as much as possible and only leaves open
|
|
961
958
|
* calculations which depend on a dynamic scope with variables.
|
|
962
|
-
* @param
|
|
963
|
-
* @param
|
|
959
|
+
* @param math - Math.js namespace with functions and constants.
|
|
960
|
+
* @param argNames - An object with argument names as key and `true`
|
|
964
961
|
* as value. Used in the SymbolNode to optimize
|
|
965
962
|
* for arguments from user assigned functions
|
|
966
963
|
* (see FunctionAssignmentNode) or special symbols
|
|
967
964
|
* like `end` (see IndexNode).
|
|
968
|
-
* @
|
|
965
|
+
* @returns Returns a function which can be called like:
|
|
969
966
|
* evalNode(scope: Object, args: Object, context: *)
|
|
970
967
|
*/
|
|
971
968
|
_compile(math: Record<string, unknown>, argNames: Record<string, boolean>): (scope: Map<string, unknown>, args: Record<string, unknown>, context: unknown) => unknown;
|
|
972
969
|
/**
|
|
973
970
|
* Execute a callback for each of the child nodes of this node
|
|
974
|
-
* @param
|
|
971
|
+
* @param callback
|
|
975
972
|
*/
|
|
976
973
|
forEach(callback: (child: MathNode, path: string, parent: MathNode) => void): void;
|
|
977
974
|
/**
|
|
978
975
|
* Create a new FunctionAssignmentNode whose children are the results of
|
|
979
976
|
* calling the provided callback function for each child of the original
|
|
980
977
|
* node.
|
|
981
|
-
* @param
|
|
982
|
-
* @returns
|
|
978
|
+
* @param callback
|
|
979
|
+
* @returns Returns a transformed copy of the node
|
|
983
980
|
*/
|
|
984
981
|
map(callback: (child: MathNode, path: string, parent: MathNode) => MathNode): /*elided*/ any;
|
|
985
982
|
/**
|
|
986
983
|
* Create a clone of this node, a shallow copy
|
|
987
|
-
* @return {FunctionAssignmentNode}
|
|
988
984
|
*/
|
|
989
985
|
clone(): /*elided*/ any;
|
|
990
986
|
/**
|
|
991
987
|
* get string representation
|
|
992
|
-
* @param
|
|
993
|
-
* @
|
|
988
|
+
* @param options
|
|
989
|
+
* @returns str
|
|
994
990
|
*/
|
|
995
991
|
_toString(options?: StringOptions): string;
|
|
996
992
|
/**
|
|
997
993
|
* Get a JSON representation of the node
|
|
998
|
-
* @returns {Object}
|
|
999
994
|
*/
|
|
1000
995
|
toJSON(): {
|
|
1001
996
|
mathjs: string;
|
|
@@ -1005,14 +1000,14 @@ export declare const createFunctionAssignmentNode: import("../utils/factory.js")
|
|
|
1005
1000
|
};
|
|
1006
1001
|
/**
|
|
1007
1002
|
* get HTML representation
|
|
1008
|
-
* @param
|
|
1009
|
-
* @
|
|
1003
|
+
* @param options
|
|
1004
|
+
* @returns str
|
|
1010
1005
|
*/
|
|
1011
1006
|
_toHTML(options?: StringOptions): string;
|
|
1012
1007
|
/**
|
|
1013
1008
|
* get LaTeX representation
|
|
1014
|
-
* @param
|
|
1015
|
-
* @
|
|
1009
|
+
* @param options
|
|
1010
|
+
* @returns str
|
|
1016
1011
|
*/
|
|
1017
1012
|
_toTex(options?: StringOptions): string;
|
|
1018
1013
|
toString(options?: StringOptions): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionAssignmentNode.d.ts","sourceRoot":"","sources":["../../src/node/FunctionAssignmentNode.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAKzD,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,4BAA4B;WAO9B,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO;UAChC,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ;;eAwCtB,MAAM,UAAU,MAAM,EAAE,GAAG,aAAa,EAAE,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAjBtE,MAAM;gBACJ,MAAM,EAAE;eACT,M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