@cortex-js/compute-engine 0.19.0 → 0.20.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 +1219 -484
- package/dist/compute-engine.js +1219 -484
- package/dist/compute-engine.min.esm.js +10 -9
- package/dist/compute-engine.min.js +10 -9
- 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/ansi-codes.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/signals.d.ts +4 -4
- 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 -3
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +7 -3
- package/dist/types/compute-engine/collection-utils.d.ts +1 -1
- package/dist/types/compute-engine/compile.d.ts +1 -1
- package/dist/types/compute-engine/compute-engine.d.ts +1 -1
- 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/function-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 +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +25 -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 +1 -1
- 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 +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -23
- package/dist/types/compute-engine/latex-syntax/public.d.ts +11 -24
- 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 +1 -1
- 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 +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- 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/linear-algebra.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 +1 -1
- 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 +3 -2
- 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/numerics/richardson.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/derivative.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 -3
- 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 +1 -4
- 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.20.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.20.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.20.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.20.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.20.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.20.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.20.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
|
-
var MathJson=(()=>{var f=Object.defineProperty;var
|
|
3
|
+
var MathJson=(()=>{var f=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var D=(n,t)=>{for(var e in t)f(n,e,{get:t[e],enumerable:!0})},R=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!k.call(n,r)&&r!==e&&f(n,r,{get:()=>t[r],enumerable:!(i=T(t,r))||i.enumerable});return n};var _=n=>R(f({},"__esModule",{value:!0}),n);var z={};D(z,{applyRecursively:()=>J,getDictionary:()=>y,getStringValue:()=>m,head:()=>o,headName:()=>I,isDictionaryObject:()=>M,isFunctionObject:()=>u,isStringObject:()=>S,isSymbolObject:()=>d,mapArgs:()=>$,nops:()=>E,op:()=>s,symbol:()=>A,version:()=>X});function d(n){return n!==null&&typeof n=="object"&&"sym"in n}function S(n){return n!==null&&typeof n=="object"&&"str"in n}function u(n){return n!==null&&typeof n=="object"&&"fn"in n}function M(n){return n!==null&&typeof n=="object"&&"dict"in n}var c;function N(n){if(!c){let e=`^[${["Zyyy","Zinh","Arab","Armn","Beng","Bopo","Cyrl","Deva","Ethi","Geor","Grek","Gujr","Guru","Hang","Hani","Hebr","Hira","Kana","Knda","Khmr","Laoo","Latn","Mlym","Mymr","Orya","Sinh","Taml","Telu","Thaa","Thai","Tibt"].map(i=>`\\p{Script=${i}}`).join("")}]*$`;c=new RegExp(e,"u")}return c.test(n)}function a(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||O.test(n)?!0:N(n)?/^[\p{XIDS}_]\p{XIDC}*$/u.test(n):!1}var F="\\u{FE0F}",V="\\u{20E3}",L="\\u{200D}",P="\\p{RI}\\p{RI}",w="(?:[\\u{E0020}-\\u{E007E}]+\\u{E007F})",b=`(?:\\p{EMod}|${F}${V}?|${w})`,C="(?:(?=\\P{XIDC})\\p{Emoji})",h=`(?:${C}${b}*|\\p{Emoji}${b}+|${P})`,j=`(?:${h})(${L}${h})*`,G=new RegExp(`(?:${j})+`,"u"),O=new RegExp(`^(?:${j})+$`,"u");function q(n){return typeof n!="string"?"not-a-string":n===""?"empty-string":n.normalize()!==n?"expected-nfc":/[\u200E\u200F\u2066-\u2069\u202A-\u202E]/.test(n)?"unexpected-bidi-marker":O.test(n)?"valid":/\p{XIDC}/u.test(n)&&G.test(n)?"unexpected-mixed-emoji":N(n)?a(n)?"valid":a(n[0])?"invalid-char":"invalid-first-char":"unexpected-script"}function m(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"||n.length<2||n[0]!=="'"||n[n.length-1]!=="'"?null:n.substring(1,n.length-1)}function o(n){return n==null?null:Array.isArray(n)?typeof n[0]=="string"&&!a(n[0])?(console.error(`Invalid identifier "${n[0]}": ${q(n[0])}`),null):n[0]:u(n)?n.fn[0]:null}function I(n){let t=o(n);return typeof t=="string"?t:""}function K(n){return n==null?null:Array.isArray(n)?n.slice(1):u(n)?n.fn.slice(1):null}function s(n,t){return n==null?null:Array.isArray(n)?n[t]??null:u(n)?n.fn[t]??null:null}function Z(n){return s(n,1)}function H(n){return s(n,2)}function E(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):u(n)?Math.max(0,n.fn.length-1):0}function A(n){if(n==null||typeof n=="string"&&(/^[+\-\.0-9]/.test(n)||n.length>=2&&n[0]==="'"&&n[n.length-1]==="'"))return null;let t=d(n)?n.sym:n;return typeof t!="string"?null:t}function p(n){let t=o(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let e=m(Z(n));return e?[e,H(n)??"Nothing"]:null}return null}function y(n){if(n===null)return null;if(typeof n=="object"&&"dict"in n)return n.dict;let t=p(n);if(t)return{[t[0]]:t[1]};if(o(n)==="Dictionary"){let i={};for(let r=1;r<E(n);r++){let l=p(s(n,r));l&&(i[l[0]]=l[1])}return i}return null}function J(n,t){let e=o(n);if(e!==null)return[t(e),...(K(n)??[]).map(t)];let i=y(n);if(i!==null){let r=Object.keys(i),l={};for(let g of r)l[g]=t(i[g]);return{dict:l}}return t(n)}function $(n,t){let e=null;if(Array.isArray(n)&&(e=n),u(n)&&(e=n.fn),e===null)return[];let i=1,r=[];for(;i<e.length;)r.push(t(e[i])),i+=1;return r}var X="0.20.0";return _(z);})();
|
|
4
4
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.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 = {
|
|
@@ -60,9 +60,9 @@ export type WarningSignalHandler = (warnings: WarningSignal[]) => void;
|
|
|
60
60
|
* do expected a subscript.
|
|
61
61
|
*
|
|
62
62
|
* * `unexpected-sequence`: some adjacent elements were encountered (for
|
|
63
|
-
* example `xy`), but
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
* example `xy`), but the elements could not be combined. By default, adjacent
|
|
64
|
+
* symbols are combined with `Multiply`, but adjacent numbers or adjacent
|
|
65
|
+
* operators are not combined.
|
|
66
66
|
*
|
|
67
67
|
* * `expected-argument`: a LaTeX command that requires one or more argument
|
|
68
68
|
* was encountered without the required arguments.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import type { Decimal } from 'decimal.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, SimplifyOptions, Substitution, RuntimeScope, DomainCompatibility, DomainLiteral, BoxedBaseDefinition, Rational, BoxedSubstitution } from '../public';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { BoxedExpression, IComputeEngine, EvaluateOptions, NOptions, BoxedRuleSet, SemiBoxedExpression, SimplifyOptions, ReplaceOptions, Substitution, Metadata, PatternMatchOptions, BoxedDomain, BoxedSubstitution } from '../public';
|
|
3
3
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { BoxedDomain, BoxedExpression, BoxedSubstitution, DomainCompatibility, DomainConstructor, DomainExpression, DomainLiteral, IComputeEngine, Metadata, PatternMatchOptions } from '../public';
|
|
3
3
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.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, BoxedBaseDefinition, Hold } from '../public';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { Decimal } from 'decimal.js';
|
|
3
3
|
import { Expression } from '../../math-json/math-json-format';
|
|
4
4
|
import { BoxedExpression, BoxedDomain, IComputeEngine, Metadata, NOptions, PatternMatchOptions, Rational, SimplifyOptions, BoxedSubstitution, EvaluateOptions } from '../public';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { _BoxedExpression } 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 _BoxedExpression implements Pattern {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { Expression } from '../../math-json/math-json-format';
|
|
3
3
|
import { BoxedExpression, IComputeEngine } from '../public';
|
|
4
4
|
export declare function isLatexString(s: unknown): s is string;
|
|
@@ -66,8 +66,6 @@ export declare function isDictionaryLike(expr: BoxedExpression): boolean;
|
|
|
66
66
|
export declare function getDictionaryLike(expr: BoxedExpression): {
|
|
67
67
|
[key: string]: BoxedExpression;
|
|
68
68
|
};
|
|
69
|
-
export declare function isListLike(expr: BoxedExpression): boolean;
|
|
70
|
-
export declare function getListLike(expr: BoxedExpression): BoxedExpression[];
|
|
71
69
|
/**
|
|
72
70
|
* If `expr` is a number, return it as a Decimal (it might be
|
|
73
71
|
* in the machine value range or not). Use `isInMachineRange()` to check.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
/**
|
|
3
3
|
* Check that the number of arguments is as expected.
|
|
4
4
|
*
|
|
@@ -28,8 +28,12 @@ export declare function checkNumericArgs(ce: IComputeEngine, ops: BoxedExpressio
|
|
|
28
28
|
*
|
|
29
29
|
* Converts the arguments to canonical
|
|
30
30
|
*/
|
|
31
|
-
export declare function
|
|
32
|
-
|
|
31
|
+
export declare function checkDomain(ce: IComputeEngine, arg: BoxedExpression | undefined | null, dom: BoxedDomain | DomainLiteral | undefined): BoxedExpression;
|
|
32
|
+
/**
|
|
33
|
+
* Check that the argument is pure.
|
|
34
|
+
*/
|
|
35
|
+
export declare function checkPure(ce: IComputeEngine, arg: BoxedExpression | BoxedExpression | undefined | null): BoxedExpression;
|
|
36
|
+
export declare function checkDomains(ce: IComputeEngine, args: BoxedExpression[], doms: (BoxedDomain | DomainLiteral)[]): BoxedExpression[];
|
|
33
37
|
/**
|
|
34
38
|
*
|
|
35
39
|
* If the arguments match the parameters, return null.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { Decimal } from 'decimal.js';
|
|
3
3
|
import { Expression, MathJsonNumber } from '../math-json/math-json-format';
|
|
4
4
|
import type { LibraryCategory, LatexDictionaryEntry, LatexString, NumberFormattingOptions, ParseLatexOptions, SerializeLatexOptions } from './latex-syntax/public';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_ALGEBRA: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_ARITHMETIC: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_CALCULUS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_COMPLEX: LatexDictionary;
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_CORE: LatexDictionary;
|
|
3
|
+
export declare const DELIMITERS_SHORTHAND: {
|
|
4
|
+
'(': string;
|
|
5
|
+
')': string;
|
|
6
|
+
'[': string;
|
|
7
|
+
'\u27E6': string;
|
|
8
|
+
'\u27E7': string;
|
|
9
|
+
']': string;
|
|
10
|
+
'{': string;
|
|
11
|
+
'}': string;
|
|
12
|
+
'<': string;
|
|
13
|
+
'>': string;
|
|
14
|
+
'\u2016': string;
|
|
15
|
+
'\\': string;
|
|
16
|
+
'\u2308': string;
|
|
17
|
+
'\u2309': string;
|
|
18
|
+
'\u230A': string;
|
|
19
|
+
'\u230B': string;
|
|
20
|
+
'\u231C': string;
|
|
21
|
+
'\u231D': string;
|
|
22
|
+
'\u231E': string;
|
|
23
|
+
'\u231F': string;
|
|
24
|
+
'\u23B0': string;
|
|
25
|
+
'\u23B1': string;
|
|
26
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_INEQUALITIES: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_LOGIC: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_OTHERS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_SETS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_STATISTICS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const DEFINITIONS_TRIGONOMETRY: LatexDictionary;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.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';
|
|
@@ -210,28 +210,6 @@ export declare class _Parser implements Parser {
|
|
|
210
210
|
* command. See `matchChar()` instead.
|
|
211
211
|
*/
|
|
212
212
|
private parseStringGroupContent;
|
|
213
|
-
/**
|
|
214
|
-
* Apply an invisible operator between two expressions.
|
|
215
|
-
*
|
|
216
|
-
* If the `lhs` is an literal integer and the `rhs` is a literal rational
|
|
217
|
-
* -> 'invisible plus'
|
|
218
|
-
*
|
|
219
|
-
* That is '2 3/4' -> ['Add', 2, ['Rational', 3, 4]]
|
|
220
|
-
*
|
|
221
|
-
* If `lhs` is a number and `rhs` is a number but not a literal -> 'invisible multiply'.
|
|
222
|
-
* - 2x
|
|
223
|
-
* - 2(x+1)
|
|
224
|
-
* - x(x+1)
|
|
225
|
-
* - f(x)g(y)
|
|
226
|
-
* - 2 sin(x)
|
|
227
|
-
* - 2 f(x)
|
|
228
|
-
* - x f(x)
|
|
229
|
-
* - (x-1)(x+1)
|
|
230
|
-
* - (x+1)2 -> no
|
|
231
|
-
* - x2 -> no
|
|
232
|
-
* => lhs is a number, rhs is a number, but not a literal
|
|
233
|
-
*/
|
|
234
|
-
private applyInvisibleOperator;
|
|
235
213
|
/**
|
|
236
214
|
* This method can be invoked when we know we're in an error situation.
|
|
237
215
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { Expression } from '../../math-json/math-json-format';
|
|
3
3
|
import type { IComputeEngine } from '../public';
|
|
4
4
|
/**
|
|
@@ -266,24 +266,6 @@ export declare function isPostfixEntry(entry: LatexDictionaryEntry): entry is Po
|
|
|
266
266
|
export declare function isEnvironmentEntry(entry: LatexDictionaryEntry): entry is EnvironmentEntry;
|
|
267
267
|
export type LatexDictionary = Array<object>;
|
|
268
268
|
export type ParseLatexOptions = {
|
|
269
|
-
/**
|
|
270
|
-
* This function is invoked when a number is followed by a symbol,
|
|
271
|
-
* an open delimiter or a function.
|
|
272
|
-
*
|
|
273
|
-
* If this function is set to `null`, the lhs and rhs are joined as a
|
|
274
|
-
* `Sequence`.
|
|
275
|
-
*
|
|
276
|
-
* If this function is set to `undefined` it behaves in the following way:
|
|
277
|
-
* - a number followed by a numeric expression is considered as separated
|
|
278
|
-
* with an invisible multiplication sign, and the two are joined as
|
|
279
|
-
* ['Multiply', lhs, rhs].
|
|
280
|
-
* - a number followed by a rational number is considered to be separated
|
|
281
|
-
* with an invisible plus, and the two are joined as ['Add', lhs,
|
|
282
|
-
*
|
|
283
|
-
* For example with `2\frac{3}{4}`: `["Add", 2, ["Divide", 3, 4]]`
|
|
284
|
-
*
|
|
285
|
-
*/
|
|
286
|
-
applyInvisibleOperator: 'auto' | null | ((parser: Parser, lhs: Expression, rhs: Expression) => Expression | null);
|
|
287
269
|
/**
|
|
288
270
|
* If true, ignore space characters in math mode.
|
|
289
271
|
*
|
|
@@ -354,17 +336,22 @@ export type ParseLatexOptions = {
|
|
|
354
336
|
export type SerializeLatexOptions = {
|
|
355
337
|
/**
|
|
356
338
|
* LaTeX string used to render an invisible multiply, e.g. in '2x'.
|
|
357
|
-
*
|
|
358
|
-
*
|
|
339
|
+
*
|
|
340
|
+
* Leave it empty to join the adjacent terms, i.e. `2x`.
|
|
341
|
+
*
|
|
342
|
+
* Use `\cdot` to insert a `\cdot` operator between them, i.e. `2\cdot x`.
|
|
359
343
|
*
|
|
360
344
|
* Empty by default.
|
|
361
345
|
*/
|
|
362
346
|
invisibleMultiply: LatexString;
|
|
363
347
|
/**
|
|
364
|
-
* LaTeX string used for an invisible plus
|
|
348
|
+
* LaTeX string used for an invisible plus with mixed numbers e.g. in '1 3/4'.
|
|
349
|
+
*
|
|
365
350
|
* Leave it empty to join the main number and the fraction, i.e. render it
|
|
366
|
-
* as `1\frac{3}{4}
|
|
367
|
-
*
|
|
351
|
+
* as `1\frac{3}{4}`.
|
|
352
|
+
*
|
|
353
|
+
* Use `+` to insert an explicit `+` operator between them,
|
|
354
|
+
* i.e. `1+\frac{3}{4}`
|
|
368
355
|
*
|
|
369
356
|
* Empty by default.
|
|
370
357
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.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.20.0 */
|
|
2
2
|
import { WarningSignalHandler } from '../../common/signals';
|
|
3
3
|
import { NumberFormattingOptions, LatexString, SerializeLatexOptions } from './public';
|
|
4
4
|
import { IndexedLatexDictionary, IndexedLatexDictionaryEntry } from './dictionary/definitions';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const CALCULUS_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const COMPLEX_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const CONTROL_STRUCTURES_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
export declare const CORE_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.20.0 */
|
|
2
2
|
import { FunctionDefinition, IComputeEngine, IdentifierDefinitions, SymbolDefinition } from '../public';
|
|
3
3
|
export declare function getStandardLibrary(categories: LibraryCategory[] | LibraryCategory | 'all'): readonly IdentifierDefinitions[];
|
|
4
4
|
export declare const LIBRARIES: {
|