@cortex-js/compute-engine 0.14.0 → 0.15.0
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/dist/compute-engine.esm.js +730 -131
- package/dist/compute-engine.js +730 -131
- package/dist/compute-engine.min.esm.js +730 -131
- package/dist/compute-engine.min.js +730 -131
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.js +2 -2
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.js +2 -2
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/compile.d.ts +1 -1
- package/dist/types/compute-engine/compute-engine.d.ts +4 -2
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/domain-utils.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-inequalities.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +4 -2
- package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +37 -1
- package/dist/types/compute-engine/latex-syntax/public.d.ts +6 -2
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +5 -2
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-add.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-divide.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +1 -1
- package/dist/types/compute-engine/library/complex.d.ts +2 -0
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/domains.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +2 -0
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +2 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
- package/dist/types/compute-engine/public.d.ts +1 -1
- package/dist/types/compute-engine/rules.d.ts +1 -1
- package/dist/types/compute-engine/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/solve.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/expand.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/flatten.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/negate.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/sum.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/utils.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +2 -2
- package/dist/types/math-json/math-json-format.d.ts +1 -1
- package/dist/types/math-json/utils.d.ts +2 -1
- package/dist/types/math-json.d.ts +2 -2
- package/package.json +1 -1
package/dist/math-json.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS Compute Engine 0.
|
|
1
|
+
/** CortexJS Compute Engine 0.15.0 */
|
|
2
2
|
|
|
3
3
|
// src/math-json/utils.ts
|
|
4
4
|
function isSymbolObject(expr) {
|
|
@@ -239,7 +239,7 @@ function mapArgs(expr, fn) {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
// src/math-json.ts
|
|
242
|
-
var version = "0.
|
|
242
|
+
var version = "0.15.0";
|
|
243
243
|
export {
|
|
244
244
|
applyRecursively,
|
|
245
245
|
dictionary as getDictionary,
|
package/dist/math-json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS MathJSON 0.
|
|
1
|
+
/** CortexJS MathJSON 0.15.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var MathJson = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -277,7 +277,7 @@ var MathJson = (() => {
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// src/math-json.ts
|
|
280
|
-
var version = "0.
|
|
280
|
+
var version = "0.15.0";
|
|
281
281
|
return __toCommonJS(math_json_exports);
|
|
282
282
|
})();
|
|
283
283
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS Compute Engine 0.
|
|
1
|
+
/** CortexJS Compute Engine 0.15.0 */
|
|
2
2
|
|
|
3
3
|
// src/math-json/utils.ts
|
|
4
4
|
function isSymbolObject(expr) {
|
|
@@ -239,7 +239,7 @@ function mapArgs(expr, fn) {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
// src/math-json.ts
|
|
242
|
-
var version = "0.
|
|
242
|
+
var version = "0.15.0";
|
|
243
243
|
export {
|
|
244
244
|
applyRecursively,
|
|
245
245
|
dictionary as getDictionary,
|
package/dist/math-json.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS MathJSON 0.
|
|
1
|
+
/** CortexJS MathJSON 0.15.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var MathJson = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -277,7 +277,7 @@ var MathJson = (() => {
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// src/math-json.ts
|
|
280
|
-
var version = "0.
|
|
280
|
+
var version = "0.15.0";
|
|
281
281
|
return __toCommonJS(math_json_exports);
|
|
282
282
|
})();
|
|
283
283
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export type SignalCode = RuntimeSignalCode | ('invalid-name' | 'expected-predicate' | 'expected-symbol' | 'operator-requires-one-operand' | 'postfix-operator-requires-one-operand' | 'prefix-operator-requires-one-operand' | 'unbalanced-symbols' | 'expected-argument' | 'unexpected-command' | 'cyclic-definition' | 'invalid-supersets' | 'expected-supersets' | 'unknown-domain' | 'duplicate-wikidata' | 'invalid-dictionary-entry' | 'syntax-error');
|
|
3
3
|
export type SignalMessage = SignalCode | [SignalCode, ...any[]];
|
|
4
4
|
export type SignalOrigin = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { Complex } from 'complex.js';
|
|
3
3
|
import { Expression } from '../../math-json/math-json-format';
|
|
4
4
|
import { BoxedExpression, BoxedFunctionDefinition, BoxedRuleSet, BoxedSymbolDefinition, BoxedDomain, EvaluateOptions, IComputeEngine, LatexString, Metadata, NOptions, PatternMatchOptions, SemiBoxedExpression, SimplifyOptions, Substitution, RuntimeScope, DomainCompatibility, DomainLiteral, BoxedBaseDefinition, Rational, BoxedSubstitution } from '../public';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { BoxedExpression, IComputeEngine, EvaluateOptions, NOptions, BoxedRuleSet, SemiBoxedExpression, SimplifyOptions, ReplaceOptions, Substitution, Metadata, PatternMatchOptions, BoxedDomain, BoxedSubstitution } from '../public';
|
|
3
3
|
import { AbstractBoxedExpression } from './abstract-boxed-expression';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { BoxedDomain, BoxedExpression, BoxedSubstitution, DomainCompatibility, DomainConstructor, DomainExpression, DomainLiteral, IComputeEngine, Metadata, PatternMatchOptions } from '../public';
|
|
3
3
|
import { AbstractBoxedExpression } from './abstract-boxed-expression';
|
|
4
4
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare function makeFunctionDefinition(engine: IComputeEngine, name: string, def: FunctionDefinition | BoxedFunctionDefinition): BoxedFunctionDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { Expression } from '../../math-json/math-json-format';
|
|
3
3
|
import { BoxedExpression, BoxedFunctionDefinition, IComputeEngine, NOptions, BoxedRuleSet, SemiBoxedExpression, SimplifyOptions, Substitution, ReplaceOptions, Metadata, PatternMatchOptions, BoxedDomain, RuntimeScope, BoxedSubstitution, EvaluateOptions } from '../public';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { Complex } from 'complex.js';
|
|
3
3
|
import { Expression } from '../../math-json/math-json-format';
|
|
4
4
|
import { BoxedExpression, BoxedDomain, IComputeEngine, Metadata, NOptions, PatternMatchOptions, Rational, SimplifyOptions, BoxedSubstitution } from '../public';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { AbstractBoxedExpression } from './abstract-boxed-expression';
|
|
3
3
|
import { BoxedExpression, BoxedSubstitution, BoxedDomain, IComputeEngine, LatexString, Metadata, Pattern, PatternMatchOptions, SemiBoxedExpression, Substitution } from '../public';
|
|
4
4
|
export declare class BoxedPattern extends AbstractBoxedExpression implements Pattern {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { AbstractBoxedExpression } from './abstract-boxed-expression';
|
|
3
3
|
import { BoxedExpression, BoxedRuleSet, BoxedSymbolDefinition, IComputeEngine, EvaluateOptions, NOptions, ReplaceOptions, SimplifyOptions, Substitution, Metadata, PatternMatchOptions, BoxedDomain, RuntimeScope, BoxedFunctionDefinition, BoxedBaseDefinition, DomainExpression, BoxedSubstitution } from '../public';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { Complex } from 'complex.js';
|
|
3
3
|
import { Expression, MathJsonNumber } from '../math-json/math-json-format';
|
|
4
4
|
import type { LibraryCategory, LatexDictionary, LatexDictionaryEntry, LatexString, NumberFormattingOptions, ParseLatexOptions, SerializeLatexOptions } from './latex-syntax/public';
|
|
@@ -319,7 +319,9 @@ export declare class ComputeEngine implements IComputeEngine {
|
|
|
319
319
|
parse(latex: LatexString | string | null, options?: {
|
|
320
320
|
canonical?: boolean;
|
|
321
321
|
}): null | BoxedExpression;
|
|
322
|
-
serialize(x: Expression | BoxedExpression
|
|
322
|
+
serialize(x: Expression | BoxedExpression, options?: {
|
|
323
|
+
canonical?: boolean;
|
|
324
|
+
}): string;
|
|
323
325
|
get latexOptions(): NumberFormattingOptions & ParseLatexOptions & SerializeLatexOptions;
|
|
324
326
|
set latexOptions(opts: Partial<NumberFormattingOptions> & Partial<ParseLatexOptions> & Partial<SerializeLatexOptions>);
|
|
325
327
|
get jsonSerializationOptions(): Readonly<JsonSerializationOptions>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_ALGEBRA: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_ARITHMETIC: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_CALCULUS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_CORE: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_INEQUALITIES: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_LOGIC: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_OTHERS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_SETS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const DEFINITIONS_TRIGONOMETRY: LatexDictionary;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { Serializer } from './serializer';
|
|
3
3
|
import { Expression } from '../../math-json/math-json-format';
|
|
4
4
|
import { WarningSignalHandler } from '../../common/signals';
|
|
@@ -21,6 +21,8 @@ export declare class LatexSyntax {
|
|
|
21
21
|
updateOptions(opt: Partial<NumberFormattingOptions> & Partial<ParseLatexOptions> & Partial<SerializeLatexOptions>): void;
|
|
22
22
|
static getDictionary(category?: LibraryCategory | 'all'): Readonly<LatexDictionary>;
|
|
23
23
|
parse(latex: LatexString): Expression;
|
|
24
|
-
serialize(expr: Expression
|
|
24
|
+
serialize(expr: Expression, options?: {
|
|
25
|
+
canonical?: boolean;
|
|
26
|
+
}): LatexString;
|
|
25
27
|
get serializer(): Serializer;
|
|
26
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { IndexedLatexDictionary, IndexedLatexDictionaryEntry, IndexedInfixEntry, IndexedPostfixEntry, IndexedPrefixEntry, IndexedSymbolEntry, IndexedExpressionEntry, IndexedFunctionEntry } from './dictionary/definitions';
|
|
3
3
|
import { IComputeEngine } from '../public';
|
|
4
4
|
import { Expression } from '../../math-json/math-json-format';
|
|
@@ -94,6 +94,40 @@ export declare class _Parser implements Parser {
|
|
|
94
94
|
matchAll(tokens: LatexToken[]): boolean;
|
|
95
95
|
matchAny(tokens: LatexToken[]): LatexToken;
|
|
96
96
|
matchChar(): string | null;
|
|
97
|
+
/** If the next token matches the open delimiter, set a boundary with
|
|
98
|
+
* the close token and return true.
|
|
99
|
+
*
|
|
100
|
+
* Note this method handles generic delimiters, i.e. '(' will math both
|
|
101
|
+
* '(', '\left(', '\bigl(', etc...
|
|
102
|
+
*
|
|
103
|
+
* Note that the definitions for matchfix may need to include synonyms
|
|
104
|
+
* for example:
|
|
105
|
+
*
|
|
106
|
+
* {
|
|
107
|
+
* openDelimiter: '(',
|
|
108
|
+
* closeDelimiter: ')'
|
|
109
|
+
* }
|
|
110
|
+
*
|
|
111
|
+
* and
|
|
112
|
+
*
|
|
113
|
+
* {
|
|
114
|
+
* openDelimiter: '\\lparen',
|
|
115
|
+
* closeDelimiter: '\\rparen'
|
|
116
|
+
* }
|
|
117
|
+
*
|
|
118
|
+
* For:
|
|
119
|
+
* - '[': '\\lbrack' and '\\['
|
|
120
|
+
* - ']': '\\rbrack' and '\\]'
|
|
121
|
+
* - '{': '\\lbrace' and '\\}'
|
|
122
|
+
* - '}': '\\rbrace' and '\\}'
|
|
123
|
+
* - '<': '\\langle'
|
|
124
|
+
* - '>': '\\rangle'
|
|
125
|
+
* - '|': '\\vert'
|
|
126
|
+
* - '||': '\\Vert'
|
|
127
|
+
* - '|': '\\lvert' and '\\rvert'
|
|
128
|
+
* - '||': '\\lVert' and '\\rVert'
|
|
129
|
+
*/
|
|
130
|
+
private matchDelimiter;
|
|
97
131
|
parseGroup(): Expression | null;
|
|
98
132
|
parseToken(): Expression | null;
|
|
99
133
|
parseOptionalGroup(): Expression | null;
|
|
@@ -154,6 +188,8 @@ export declare class _Parser implements Parser {
|
|
|
154
188
|
* return `['\right', '\rparen']`, which can be matched with `matchAll()`
|
|
155
189
|
*
|
|
156
190
|
* If you need to match several tokens, use `matchAll()`
|
|
191
|
+
*
|
|
192
|
+
* @internal
|
|
157
193
|
*/
|
|
158
194
|
private matchOpenDelimiter;
|
|
159
195
|
/** For error handling, when there is potentially a mismatched delimiter.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { Expression } from '../../math-json/math-json-format';
|
|
3
3
|
import type { IComputeEngine } from '../public';
|
|
4
4
|
/**
|
|
@@ -18,7 +18,7 @@ export type LatexString = string;
|
|
|
18
18
|
* record to define new LaTeX dictionary entries.
|
|
19
19
|
*/
|
|
20
20
|
export type Delimiter = ')' | '(' | ']' | '[' | '{' /** \lbrace */ | '}' /** \rbrace */ | '<' /** \langle */ | '>' /** \rangle */ | '|' | '||' | '\\lceil' | '\\rceil' | '\\lfloor' | '\\rfloor';
|
|
21
|
-
export type LibraryCategory = 'algebra' | 'arithmetic' | 'calculus' | 'collections' | 'control-structures' | 'combinatorics' | 'core' | 'data-structures' | 'dimensions' | 'domains' | 'linear-algebra' | 'logic' | 'numeric' | 'other' | 'physics' | 'polynomials' | 'relop' | 'sets' | 'statistics' | 'styling' | 'symbols' | 'trigonometry' | 'units';
|
|
21
|
+
export type LibraryCategory = 'algebra' | 'arithmetic' | 'calculus' | 'collections' | 'control-structures' | 'combinatorics' | 'complex' | 'core' | 'data-structures' | 'dimensions' | 'domains' | 'linear-algebra' | 'logic' | 'numeric' | 'other' | 'physics' | 'polynomials' | 'relop' | 'sets' | 'statistics' | 'styling' | 'symbols' | 'trigonometry' | 'units';
|
|
22
22
|
/** Theory of operations:
|
|
23
23
|
*
|
|
24
24
|
* The precedence of an operator is a number that indicates the order in which
|
|
@@ -453,6 +453,10 @@ export interface Serializer {
|
|
|
453
453
|
* for the top level, and `\bigl(` or `(` for others.
|
|
454
454
|
*/
|
|
455
455
|
level: number;
|
|
456
|
+
/** If true, apply transformations to the expression so the output
|
|
457
|
+
* doesn't necesarily match the raw MathJSON, but is more visually pleasing
|
|
458
|
+
* and easier to read. If false, output the raw MathJSON. */
|
|
459
|
+
canonical?: boolean;
|
|
456
460
|
/** Output a LaTeX string representing the expression */
|
|
457
461
|
serialize: (expr: Expression | null) => string;
|
|
458
462
|
wrapString(s: string, style: 'paren' | 'leftright' | 'big' | 'none', fence?: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare function getApplyFunctionStyle(_expr: Expression, _level: number): 'paren' | 'leftright' | 'big' | 'none';
|
|
3
3
|
export declare function getGroupStyle(_expr: Expression, _level: number): 'paren' | 'leftright' | 'big' | 'none';
|
|
4
4
|
export declare function getRootStyle(_expr: Expression | null, level: number): 'radical' | 'quotient' | 'solidus';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import { WarningSignalHandler } from '../../common/signals';
|
|
3
3
|
import { NumberFormattingOptions, LatexString, SerializeLatexOptions } from './public';
|
|
4
4
|
import { IndexedLatexDictionary, IndexedLatexDictionaryEntry } from './dictionary/definitions';
|
|
@@ -7,6 +7,7 @@ export declare class Serializer {
|
|
|
7
7
|
options: NumberFormattingOptions & SerializeLatexOptions;
|
|
8
8
|
readonly dictionary: IndexedLatexDictionary;
|
|
9
9
|
level: number;
|
|
10
|
+
canonical: undefined | boolean;
|
|
10
11
|
constructor(options: NumberFormattingOptions & SerializeLatexOptions, dictionary: IndexedLatexDictionary, onError: WarningSignalHandler);
|
|
11
12
|
updateOptions(opt: Partial<NumberFormattingOptions> & Partial<SerializeLatexOptions>): void;
|
|
12
13
|
/**
|
|
@@ -30,7 +31,9 @@ export declare class Serializer {
|
|
|
30
31
|
serializeDictionary(dict: {
|
|
31
32
|
[key: string]: Expression;
|
|
32
33
|
}): string;
|
|
33
|
-
serialize(expr: Expression | null
|
|
34
|
+
serialize(expr: Expression | null, options?: {
|
|
35
|
+
canonical?: boolean;
|
|
36
|
+
}): LatexString;
|
|
34
37
|
applyFunctionStyle(expr: Expression, level: number): 'paren' | 'leftright' | 'big' | 'none';
|
|
35
38
|
groupStyle(expr: Expression, level: number): 'paren' | 'leftright' | 'big' | 'none';
|
|
36
39
|
rootStyle(expr: Expression, level: number): 'radical' | 'quotient' | 'solidus';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const ARITHMETIC_LIBRARY: IdTable[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const CALCULUS_LIBRARY: IdTable[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const COLLECTIONS_LIBRARY: IdTable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const CORE_LIBRARY: IdTable[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const LOGIC_LIBRARY: IdTable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const POLYNOMIALS_LIBRARY: IdTable[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare function randomExpression(level?: number): Expression;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const RELOP_LIBRARY: IdTable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const SETS_LIBRARY: IdTable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare const TRIGONOMETRY_LIBRARY: IdTable[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
export declare function isSymbolDefinition(def: BoxedSymbolDefinition | BoxedFunctionDefinition | SymbolDefinition | FunctionDefinition | undefined | null): def is BoxedSymbolDefinition;
|
|
3
3
|
export declare function isFunctionDefinition(def: BoxedSymbolDefinition | BoxedFunctionDefinition | SymbolDefinition | FunctionDefinition | undefined | null): def is BoxedFunctionDefinition;
|
|
4
4
|
export declare function normalizeLimits(range: BoxedExpression): [index: string, lower: number, upper: number, isFinite: boolean];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.15.0 */
|
|
2
2
|
import Decimal from 'decimal.js';
|
|
3
3
|
import { BoxedExpression } from '../public';
|
|
4
4
|
export declare const MACHINE_PRECISION_BITS = 53;
|
|
@@ -39,3 +39,4 @@ export declare function asSmallInteger(expr: BoxedExpression): number | null;
|
|
|
39
39
|
export declare function chop(n: number, tolerance: number): number;
|
|
40
40
|
export declare function chop(n: Decimal, tolerance: number): 0 | Decimal;
|
|
41
41
|
export declare function chop(n: Complex, tolerance: number): 0 | Complex;
|
|
42
|
+
export declare function erf(x: number): number;
|