@cortex-js/compute-engine 0.32.0 → 0.32.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/dist/compute-engine.esm.js +42905 -0
- package/dist/compute-engine.min.esm.js +125 -0
- package/dist/compute-engine.min.umd.js +127 -0
- package/dist/compute-engine.umd.js +42930 -0
- package/dist/math-json.esm.js +130 -0
- package/dist/math-json.min.esm.js +130 -0
- package/dist/math-json.min.umd.js +4 -0
- package/dist/math-json.umd.js +155 -0
- package/dist/types/common/ansi-codes.d.ts +41 -0
- package/dist/types/common/configuration-change.d.ts +28 -0
- package/dist/types/common/fuzzy-string-match.d.ts +2 -0
- package/dist/types/common/grapheme-splitter.d.ts +15 -0
- package/dist/types/common/interruptible.d.ts +20 -0
- package/dist/types/common/one-of.d.ts +10 -0
- package/dist/types/common/signals.d.ts +96 -0
- package/dist/types/common/type/ast-nodes.d.ts +146 -0
- package/dist/types/common/type/boxed-type.d.ts +30 -0
- package/dist/types/common/type/lexer.d.ts +51 -0
- package/dist/types/common/type/parse.d.ts +211 -0
- package/dist/types/common/type/parser.d.ts +45 -0
- package/dist/types/common/type/primitive.d.ts +10 -0
- package/dist/types/common/type/serialize.d.ts +2 -0
- package/dist/types/common/type/subtype.d.ts +6 -0
- package/dist/types/common/type/type-builder.d.ts +32 -0
- package/dist/types/common/type/types.d.ts +300 -0
- package/dist/types/common/type/utils.d.ts +36 -0
- package/dist/types/common/utils.d.ts +23 -0
- package/dist/types/compute-engine/assume.d.ts +26 -0
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +165 -0
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +5 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +16 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +27 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +38 -0
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +11 -0
- package/dist/types/compute-engine/boxed-expression/box.d.ts +47 -0
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +44 -0
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +136 -0
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +103 -0
- package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +53 -0
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +107 -0
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +27 -0
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +170 -0
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +83 -0
- package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +46 -0
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +7 -0
- package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +5 -0
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +2 -0
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +13 -0
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +20 -0
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +12 -0
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +10 -0
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +25 -0
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +10 -0
- package/dist/types/compute-engine/boxed-expression/match.d.ts +41 -0
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +11 -0
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +34 -0
- package/dist/types/compute-engine/boxed-expression/order.d.ts +71 -0
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +105 -0
- package/dist/types/compute-engine/boxed-expression/product.d.ts +66 -0
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +129 -0
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +3 -0
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +46 -0
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +6 -0
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +20 -0
- package/dist/types/compute-engine/boxed-expression/terms.d.ts +10 -0
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +9 -0
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +64 -0
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +58 -0
- package/dist/types/compute-engine/collection-utils.d.ts +35 -0
- package/dist/types/compute-engine/compilation/base-compiler.d.ts +31 -0
- package/dist/types/compute-engine/compilation/javascript-target.d.ts +68 -0
- package/dist/types/compute-engine/compilation/types.d.ts +83 -0
- package/dist/types/compute-engine/cost-function.d.ts +13 -0
- package/dist/types/compute-engine/function-utils.d.ts +120 -0
- package/dist/types/compute-engine/global-types.d.ts +2930 -0
- package/dist/types/compute-engine/index.d.ts +660 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +2 -0
- 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 +27 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +2 -0
- 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 +3 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +2 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +88 -0
- package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +21 -0
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +316 -0
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +29 -0
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +10 -0
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +37 -0
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +18 -0
- package/dist/types/compute-engine/latex-syntax/types.d.ts +896 -0
- package/dist/types/compute-engine/latex-syntax/utils.d.ts +5 -0
- package/dist/types/compute-engine/library/arithmetic.d.ts +4 -0
- package/dist/types/compute-engine/library/calculus.d.ts +2 -0
- package/dist/types/compute-engine/library/collections.d.ts +27 -0
- package/dist/types/compute-engine/library/combinatorics.d.ts +2 -0
- package/dist/types/compute-engine/library/complex.d.ts +2 -0
- package/dist/types/compute-engine/library/control-structures.d.ts +2 -0
- package/dist/types/compute-engine/library/core.d.ts +2 -0
- package/dist/types/compute-engine/library/invisible-operator.d.ts +4 -0
- package/dist/types/compute-engine/library/library.d.ts +17 -0
- package/dist/types/compute-engine/library/linear-algebra.d.ts +2 -0
- package/dist/types/compute-engine/library/logic-analysis.d.ts +64 -0
- package/dist/types/compute-engine/library/logic-utils.d.ts +58 -0
- package/dist/types/compute-engine/library/logic.d.ts +7 -0
- package/dist/types/compute-engine/library/number-theory.d.ts +2 -0
- package/dist/types/compute-engine/library/polynomials.d.ts +2 -0
- package/dist/types/compute-engine/library/random-expression.d.ts +2 -0
- package/dist/types/compute-engine/library/relational-operator.d.ts +2 -0
- package/dist/types/compute-engine/library/sets.d.ts +2 -0
- package/dist/types/compute-engine/library/statistics.d.ts +2 -0
- package/dist/types/compute-engine/library/trigonometry.d.ts +2 -0
- package/dist/types/compute-engine/library/utils.d.ts +77 -0
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +57 -0
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +75 -0
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +56 -0
- package/dist/types/compute-engine/numeric-value/types.d.ts +116 -0
- package/dist/types/compute-engine/numerics/bigint.d.ts +2 -0
- package/dist/types/compute-engine/numerics/expression.d.ts +4 -0
- package/dist/types/compute-engine/numerics/interval.d.ts +12 -0
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +4 -0
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +18 -0
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +9 -0
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +3 -0
- package/dist/types/compute-engine/numerics/numeric.d.ts +60 -0
- package/dist/types/compute-engine/numerics/primes.d.ts +7 -0
- package/dist/types/compute-engine/numerics/rationals.d.ts +43 -0
- package/dist/types/compute-engine/numerics/richardson.d.ts +80 -0
- package/dist/types/compute-engine/numerics/special-functions.d.ts +28 -0
- package/dist/types/compute-engine/numerics/statistics.d.ts +24 -0
- package/dist/types/compute-engine/numerics/strings.d.ts +2 -0
- package/dist/types/compute-engine/numerics/types.d.ts +30 -0
- package/dist/types/compute-engine/symbolic/antiderivative.d.ts +3 -0
- package/dist/types/compute-engine/symbolic/derivative.d.ts +18 -0
- package/dist/types/compute-engine/symbolic/distribute.d.ts +5 -0
- package/dist/types/compute-engine/symbolic/simplify-product.d.ts +6 -0
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +27 -0
- package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +6 -0
- package/dist/types/compute-engine/tensor/tensor-fields.d.ts +128 -0
- package/dist/types/compute-engine/tensor/tensors.d.ts +93 -0
- package/dist/types/compute-engine/types.d.ts +8 -0
- package/dist/types/compute-engine.d.ts +3 -0
- package/dist/types/math-json/symbols.d.ts +11 -0
- package/dist/types/math-json/types.d.ts +122 -0
- package/dist/types/math-json/utils.d.ts +87 -0
- package/dist/types/math-json.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
/* 0.32.1 */
|
|
2
|
+
import { Decimal } from 'decimal.js';
|
|
3
|
+
import { Type, TypeResolver, TypeString } from '../common/type/types';
|
|
4
|
+
import { BoxedType } from '../common/type/boxed-type';
|
|
5
|
+
import type { OneOf } from '../common/one-of';
|
|
6
|
+
import { ConfigurationChangeListener } from '../common/configuration-change';
|
|
7
|
+
import type { Expression, MathJsonSymbol, MathJsonNumberObject } from '../math-json/types';
|
|
8
|
+
import type { ValueDefinition, OperatorDefinition, AngularUnit, AssignValue, AssumeResult, BoxedExpression, BoxedRule, BoxedRuleSet, BoxedSubstitution, CanonicalOptions, SymbolDefinitions, Metadata, Rule, Scope, EvalContext, SemiBoxedExpression, ComputeEngine as IComputeEngine, BoxedDefinition, SymbolDefinition } from './global-types';
|
|
9
|
+
import type { LatexDictionaryEntry, LatexString, LibraryCategory, ParseLatexOptions } from './latex-syntax/types';
|
|
10
|
+
import { type IndexedLatexDictionary } from './latex-syntax/dictionary/definitions';
|
|
11
|
+
import type { BigNum, Rational } from './numerics/types';
|
|
12
|
+
import { ExactNumericValueData, NumericValue, NumericValueData } from './numeric-value/types';
|
|
13
|
+
import { validatePattern } from './boxed-expression/boxed-patterns';
|
|
14
|
+
import './boxed-expression/serialize';
|
|
15
|
+
export * from './global-types';
|
|
16
|
+
export { validatePattern };
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* To use the Compute Engine, create a `ComputeEngine` instance:
|
|
20
|
+
*
|
|
21
|
+
* ```js
|
|
22
|
+
* ce = new ComputeEngine();
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* If using a mathfield, use the default Compute Engine instance from the
|
|
26
|
+
* `MathfieldElement` class:
|
|
27
|
+
*
|
|
28
|
+
* ```js
|
|
29
|
+
* ce = MathfieldElement.computeEngine
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* Use the instance to create boxed expressions with `ce.parse()` and `ce.box()`.
|
|
33
|
+
*
|
|
34
|
+
* ```js
|
|
35
|
+
* const ce = new ComputeEngine();
|
|
36
|
+
*
|
|
37
|
+
* let expr = ce.parse("e^{i\\pi}");
|
|
38
|
+
* console.log(expr.N().latex);
|
|
39
|
+
* // ➔ "-1"
|
|
40
|
+
*
|
|
41
|
+
* expr = ce.box(["Expand", ["Power", ["Add", "a", "b"], 2]]);
|
|
42
|
+
* console.log(expr.evaluate().latex);
|
|
43
|
+
* // ➔ "a^2 + 2ab + b^2"
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @category Compute Engine
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
export declare class ComputeEngine implements IComputeEngine {
|
|
50
|
+
readonly True: BoxedExpression;
|
|
51
|
+
readonly False: BoxedExpression;
|
|
52
|
+
readonly Pi: BoxedExpression;
|
|
53
|
+
readonly E: BoxedExpression;
|
|
54
|
+
readonly Nothing: BoxedExpression;
|
|
55
|
+
readonly Zero: BoxedExpression;
|
|
56
|
+
readonly One: BoxedExpression;
|
|
57
|
+
readonly Half: BoxedExpression;
|
|
58
|
+
readonly NegativeOne: BoxedExpression;
|
|
59
|
+
readonly Two: BoxedExpression;
|
|
60
|
+
readonly I: BoxedExpression;
|
|
61
|
+
readonly NaN: BoxedExpression;
|
|
62
|
+
readonly PositiveInfinity: BoxedExpression;
|
|
63
|
+
readonly NegativeInfinity: BoxedExpression;
|
|
64
|
+
readonly ComplexInfinity: BoxedExpression;
|
|
65
|
+
/** The symbol separating the whole part of a number from its fractional
|
|
66
|
+
* part in a LaTeX string.
|
|
67
|
+
*
|
|
68
|
+
* Commonly a period (`.`) in English, but a comma (`,`) in many European
|
|
69
|
+
* languages. For the comma, use `"{,}"` so that the spacing is correct.
|
|
70
|
+
*
|
|
71
|
+
* Note that this is a LaTeX string and is used when parsing or serializing
|
|
72
|
+
* LaTeX. MathJSON always uses a period.
|
|
73
|
+
*
|
|
74
|
+
* */
|
|
75
|
+
decimalSeparator: LatexString;
|
|
76
|
+
/** @internal */
|
|
77
|
+
_BIGNUM_NAN: Decimal;
|
|
78
|
+
/** @internal */
|
|
79
|
+
_BIGNUM_ZERO: Decimal;
|
|
80
|
+
/** @internal */
|
|
81
|
+
_BIGNUM_ONE: Decimal;
|
|
82
|
+
/** @internal */
|
|
83
|
+
_BIGNUM_TWO: Decimal;
|
|
84
|
+
/** @internal */
|
|
85
|
+
_BIGNUM_HALF: Decimal;
|
|
86
|
+
/** @internal */
|
|
87
|
+
_BIGNUM_PI: Decimal;
|
|
88
|
+
/** @internal */
|
|
89
|
+
_BIGNUM_NEGATIVE_ONE: Decimal;
|
|
90
|
+
/** @internal */
|
|
91
|
+
private _precision;
|
|
92
|
+
/** @ internal */
|
|
93
|
+
private _angularUnit;
|
|
94
|
+
/** @internal */
|
|
95
|
+
private _tolerance;
|
|
96
|
+
/** @internal */
|
|
97
|
+
private _bignumTolerance;
|
|
98
|
+
private _negBignumTolerance;
|
|
99
|
+
/** @internal */
|
|
100
|
+
private __cache;
|
|
101
|
+
private _configurationChangeTracker;
|
|
102
|
+
/** @internal */
|
|
103
|
+
private _cost?;
|
|
104
|
+
/** @internal */
|
|
105
|
+
private _commonSymbols;
|
|
106
|
+
/** @internal */
|
|
107
|
+
private _commonNumbers;
|
|
108
|
+
/**
|
|
109
|
+
* The stack of evaluation contexts.
|
|
110
|
+
*
|
|
111
|
+
* An **evaluation context** contains bindings of symbols to their
|
|
112
|
+
* values, assumptions, and the matching scope.
|
|
113
|
+
*
|
|
114
|
+
*/
|
|
115
|
+
_evalContextStack: EvalContext[];
|
|
116
|
+
/** The current evaluation context */
|
|
117
|
+
get context(): EvalContext;
|
|
118
|
+
get contextStack(): ReadonlyArray<EvalContext>;
|
|
119
|
+
set contextStack(stack: ReadonlyArray<EvalContext>);
|
|
120
|
+
/** @internal */
|
|
121
|
+
get _typeResolver(): TypeResolver;
|
|
122
|
+
/**
|
|
123
|
+
* Declare a new type in the current scope.
|
|
124
|
+
*
|
|
125
|
+
* By default, types are nominal. To declare a structural type, set
|
|
126
|
+
* `alias` to `true`.
|
|
127
|
+
*/
|
|
128
|
+
declareType(name: string, type: BoxedType | Type | TypeString, { alias }?: {
|
|
129
|
+
alias?: boolean;
|
|
130
|
+
}): void;
|
|
131
|
+
/**
|
|
132
|
+
* A list of the function calls to the current evaluation context,
|
|
133
|
+
* most recent first.
|
|
134
|
+
*/
|
|
135
|
+
get trace(): ReadonlyArray<string>;
|
|
136
|
+
/**
|
|
137
|
+
* The generation is incremented each time the context changes.
|
|
138
|
+
* It is used to invalidate caches.
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
141
|
+
_generation: number;
|
|
142
|
+
/** In strict mode (the default) the Compute Engine performs
|
|
143
|
+
* validation of domains and signature and may report errors.
|
|
144
|
+
*
|
|
145
|
+
* These checks may impact performance
|
|
146
|
+
*
|
|
147
|
+
* When strict mode is off, results may be incorrect or generate JavaScript
|
|
148
|
+
* errors if the input is not valid.
|
|
149
|
+
*
|
|
150
|
+
*/
|
|
151
|
+
strict: boolean;
|
|
152
|
+
/** Absolute time beyond which evaluation should not proceed.
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
deadline?: number;
|
|
156
|
+
/**
|
|
157
|
+
* Return symbol tables suitable for the specified categories, or `"all"`
|
|
158
|
+
* for all categories (`"arithmetic"`, `"algebra"`, etc...).
|
|
159
|
+
*
|
|
160
|
+
* A symbol table defines how to evaluate and manipulate symbols.
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
/** @internal */
|
|
164
|
+
private _latexDictionaryInput;
|
|
165
|
+
/** @internal */
|
|
166
|
+
__indexedLatexDictionary: IndexedLatexDictionary;
|
|
167
|
+
/** @internal */
|
|
168
|
+
_bignum: Decimal.Constructor;
|
|
169
|
+
static getStandardLibrary(categories?: LibraryCategory[] | LibraryCategory | 'all'): readonly SymbolDefinitions[];
|
|
170
|
+
/**
|
|
171
|
+
* Return a LaTeX dictionary suitable for the specified category, or `"all"`
|
|
172
|
+
* for all categories (`"arithmetic"`, `"algebra"`, etc...).
|
|
173
|
+
*
|
|
174
|
+
* A LaTeX dictionary is needed to translate between LaTeX and MathJSON.
|
|
175
|
+
*
|
|
176
|
+
* Each entry in the dictionary indicate how a LaTeX token (or string of
|
|
177
|
+
* tokens) should be parsed into a MathJSON expression.
|
|
178
|
+
*
|
|
179
|
+
* For example an entry can define that the `\pi` LaTeX token should map to the
|
|
180
|
+
* symbol `"Pi"`, or that the token `-` should map to the function
|
|
181
|
+
* `["Negate",...]` when in a prefix position and to the function
|
|
182
|
+
* `["Subtract", ...]` when in an infix position.
|
|
183
|
+
*
|
|
184
|
+
* Furthermore, the information in each dictionary entry is used to serialize
|
|
185
|
+
* the LaTeX string corresponding to a MathJSON expression.
|
|
186
|
+
*
|
|
187
|
+
* Use with `ce.latexDictionary` to set the dictionary. You can complement
|
|
188
|
+
* it with your own definitions, for example with:
|
|
189
|
+
*
|
|
190
|
+
* ```ts
|
|
191
|
+
* ce.latexDictionary = [
|
|
192
|
+
* ...ce.getLatexDictionary("all"),
|
|
193
|
+
* {
|
|
194
|
+
* kind: "function",
|
|
195
|
+
* symbolTrigger: "concat",
|
|
196
|
+
* parse: "Concatenate"
|
|
197
|
+
* }
|
|
198
|
+
* ];
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
static getLatexDictionary(domain?: LibraryCategory | 'all'): readonly Readonly<LatexDictionaryEntry>[];
|
|
202
|
+
/**
|
|
203
|
+
* Construct a new `ComputeEngine` instance.
|
|
204
|
+
*
|
|
205
|
+
* Symbols tables define functions, constants and variables (in `options.ids`).
|
|
206
|
+
* If no table is provided the MathJSON Standard Library is used (`ComputeEngine.getStandardLibrary()`)
|
|
207
|
+
*
|
|
208
|
+
* The LaTeX syntax dictionary is defined in `options.latexDictionary`.
|
|
209
|
+
*
|
|
210
|
+
* The order of the dictionaries matter: the definitions from the later ones
|
|
211
|
+
* override the definitions from earlier ones. The first dictionary should
|
|
212
|
+
* be the `'core'` dictionary which include basic definitions that are used
|
|
213
|
+
* by later dictionaries.
|
|
214
|
+
*
|
|
215
|
+
*
|
|
216
|
+
* @param options.precision Specific how many digits of precision
|
|
217
|
+
* for the numeric calculations. Default is 300.
|
|
218
|
+
*
|
|
219
|
+
* @param options.tolerance If the absolute value of the difference of two
|
|
220
|
+
* numbers is less than `tolerance`, they are considered equal. Used by
|
|
221
|
+
* `chop()` as well.
|
|
222
|
+
*/
|
|
223
|
+
constructor(options?: {
|
|
224
|
+
ids?: readonly SymbolDefinitions[];
|
|
225
|
+
precision?: number | 'machine';
|
|
226
|
+
tolerance?: number | 'auto';
|
|
227
|
+
});
|
|
228
|
+
toJSON(): string;
|
|
229
|
+
[Symbol.toStringTag]: string;
|
|
230
|
+
get latexDictionary(): Readonly<LatexDictionaryEntry[]>;
|
|
231
|
+
set latexDictionary(dic: Readonly<LatexDictionaryEntry[]>);
|
|
232
|
+
get _indexedLatexDictionary(): IndexedLatexDictionary;
|
|
233
|
+
/** After the configuration of the engine has changed, clear the caches
|
|
234
|
+
* so that new values can be recalculated.
|
|
235
|
+
*
|
|
236
|
+
* This needs to happen for example when the numeric precision changes.
|
|
237
|
+
*
|
|
238
|
+
* @internal
|
|
239
|
+
*/
|
|
240
|
+
_reset(): void;
|
|
241
|
+
/** @internal */
|
|
242
|
+
listenToConfigurationChange(tracker: ConfigurationChangeListener): () => void;
|
|
243
|
+
get precision(): number;
|
|
244
|
+
/** The precision, or number of significant digits, of numeric
|
|
245
|
+
* calculations.
|
|
246
|
+
*
|
|
247
|
+
* To make calculations using more digits, at the cost of expanded memory
|
|
248
|
+
* usage and slower computations, set the `precision` higher.
|
|
249
|
+
*
|
|
250
|
+
* Trigonometric operations are accurate for precision up to 1,000.
|
|
251
|
+
*
|
|
252
|
+
* If the precision is set to `machine`, floating point numbers
|
|
253
|
+
* are represented internally as a 64-bit floating point number (as
|
|
254
|
+
* per IEEE 754-2008), with a 52-bit mantissa, which gives about 15
|
|
255
|
+
* digits of precision.
|
|
256
|
+
*
|
|
257
|
+
* If the precision is set to `auto`, the precision is set to a default value.
|
|
258
|
+
*
|
|
259
|
+
*/
|
|
260
|
+
set precision(p: number | 'machine' | 'auto');
|
|
261
|
+
/**
|
|
262
|
+
* The unit used for unitless angles in trigonometric functions.
|
|
263
|
+
*
|
|
264
|
+
* - `rad`: radian, $2\pi$ radians is a full circle
|
|
265
|
+
* - `deg`: degree, 360 degrees is a full circle
|
|
266
|
+
* - `grad`: gradians, 400 gradians is a full circle
|
|
267
|
+
* - `turn`: turn, 1 turn is a full circle
|
|
268
|
+
*
|
|
269
|
+
* Default is `"rad"` (radians).
|
|
270
|
+
*/
|
|
271
|
+
get angularUnit(): AngularUnit;
|
|
272
|
+
set angularUnit(u: AngularUnit);
|
|
273
|
+
/** Throw a `CancellationError` when the duration of an evaluation exceeds
|
|
274
|
+
* the time limit.
|
|
275
|
+
*
|
|
276
|
+
* Time in milliseconds, default 2000 ms = 2 seconds.
|
|
277
|
+
*
|
|
278
|
+
*/
|
|
279
|
+
get timeLimit(): number;
|
|
280
|
+
set timeLimit(t: number);
|
|
281
|
+
private _timeLimit;
|
|
282
|
+
/** The time after which the time limit has been exceeded */
|
|
283
|
+
_deadline: number | undefined;
|
|
284
|
+
get _timeRemaining(): number;
|
|
285
|
+
/** Throw `CancellationError` `iteration-limit-exceeded` when the iteration limit
|
|
286
|
+
* in a loop is exceeded. Default: no limits.
|
|
287
|
+
*
|
|
288
|
+
* @experimental
|
|
289
|
+
*/
|
|
290
|
+
get iterationLimit(): number;
|
|
291
|
+
set iterationLimit(t: number);
|
|
292
|
+
private _iterationLimit;
|
|
293
|
+
/** Signal `recursion-depth-exceeded` when the recursion depth for this
|
|
294
|
+
* scope is exceeded.
|
|
295
|
+
*
|
|
296
|
+
* @experimental
|
|
297
|
+
*/
|
|
298
|
+
get recursionLimit(): number;
|
|
299
|
+
set recursionLimit(t: number);
|
|
300
|
+
private _recursionLimit;
|
|
301
|
+
get tolerance(): number;
|
|
302
|
+
/**
|
|
303
|
+
* Values smaller than the tolerance are considered to be zero for the
|
|
304
|
+
* purpose of comparison, i.e. if `|b - a| <= tolerance`, `b` is considered
|
|
305
|
+
* equal to `a`.
|
|
306
|
+
*/
|
|
307
|
+
set tolerance(val: number | 'auto');
|
|
308
|
+
/** Replace a number that is close to 0 with the exact integer 0.
|
|
309
|
+
*
|
|
310
|
+
* How close to 0 the number has to be to be considered 0 is determined by {@linkcode tolerance}.
|
|
311
|
+
*/
|
|
312
|
+
chop(n: number): number;
|
|
313
|
+
chop(n: Decimal): Decimal | 0;
|
|
314
|
+
chop(n: Complex): Complex | 0;
|
|
315
|
+
/** Create an arbitrary precision number.
|
|
316
|
+
*
|
|
317
|
+
* The return value is an object with methods to perform arithmetic
|
|
318
|
+
* operations:
|
|
319
|
+
* - `toNumber()`: convert to a JavaScript `number` with potential loss of precision
|
|
320
|
+
* - `add()`
|
|
321
|
+
* - `sub()`
|
|
322
|
+
* - `neg()` (unary minus)
|
|
323
|
+
* - `mul()`
|
|
324
|
+
* - `div()`
|
|
325
|
+
* - `pow()`
|
|
326
|
+
* - `sqrt()` (square root)
|
|
327
|
+
* - `cbrt()` (cube root)
|
|
328
|
+
* - `exp()` (e^x)
|
|
329
|
+
* - `log()`
|
|
330
|
+
* - `ln()` (natural logarithm)
|
|
331
|
+
* - `mod()`
|
|
332
|
+
|
|
333
|
+
* - `abs()`
|
|
334
|
+
* - `ceil()`
|
|
335
|
+
* - `floor()`
|
|
336
|
+
* - `round()`
|
|
337
|
+
|
|
338
|
+
* - `equals()`
|
|
339
|
+
* - `gt()`
|
|
340
|
+
* - `gte()`
|
|
341
|
+
* - `lt()`
|
|
342
|
+
* - `lte()`
|
|
343
|
+
*
|
|
344
|
+
* - `cos()`
|
|
345
|
+
* - `sin()`
|
|
346
|
+
* - `tanh()`
|
|
347
|
+
* - `acos()`
|
|
348
|
+
* - `asin()`
|
|
349
|
+
* - `atan()`
|
|
350
|
+
* - `cosh()`
|
|
351
|
+
* - `sinh()`
|
|
352
|
+
* - `acosh()`
|
|
353
|
+
* - `asinh()`
|
|
354
|
+
* - `atanh()`
|
|
355
|
+
*
|
|
356
|
+
* - `isFinite()`
|
|
357
|
+
* - `isInteger()`
|
|
358
|
+
* - `isNaN()`
|
|
359
|
+
* - `isNegative()`
|
|
360
|
+
* - `isPositive()`
|
|
361
|
+
* - `isZero()`
|
|
362
|
+
* - `sign()` (1, 0 or -1)
|
|
363
|
+
*
|
|
364
|
+
*/
|
|
365
|
+
bignum(a: Decimal.Value | bigint): Decimal;
|
|
366
|
+
/** Create a complex number.
|
|
367
|
+
* The return value is an object with methods to perform arithmetic
|
|
368
|
+
* operations:
|
|
369
|
+
* - `re` (real part, as a JavaScript `number`)
|
|
370
|
+
* - `im` (imaginary part, as a JavaScript `number`)
|
|
371
|
+
* - `add()`
|
|
372
|
+
* - `sub()`
|
|
373
|
+
* - `neg()` (unary minus)
|
|
374
|
+
* - `mul()`
|
|
375
|
+
* - `div()`
|
|
376
|
+
* - `pow()`
|
|
377
|
+
* - `sqrt()` (square root)
|
|
378
|
+
* - `exp()` (e^x)
|
|
379
|
+
* - `log()`
|
|
380
|
+
* - `ln()` (natural logarithm)
|
|
381
|
+
* - `mod()`
|
|
382
|
+
|
|
383
|
+
* - `abs()`
|
|
384
|
+
* - `ceil()`
|
|
385
|
+
* - `floor()`
|
|
386
|
+
* - `round()`
|
|
387
|
+
|
|
388
|
+
* - `arg()` the angle of the complex number
|
|
389
|
+
* - `inverse()` the inverse of the complex number 1/z
|
|
390
|
+
* - `conjugate()` the conjugate of the complex number
|
|
391
|
+
|
|
392
|
+
* - `equals()`
|
|
393
|
+
*
|
|
394
|
+
* - `cos()`
|
|
395
|
+
* - `sin()`
|
|
396
|
+
* - `tanh()`
|
|
397
|
+
* - `acos()`
|
|
398
|
+
* - `asin()`
|
|
399
|
+
* - `atan()`
|
|
400
|
+
* - `cosh()`
|
|
401
|
+
* - `sinh()`
|
|
402
|
+
* - `acosh()`
|
|
403
|
+
* - `asinh()`
|
|
404
|
+
* - `atanh()`
|
|
405
|
+
*
|
|
406
|
+
* - `isFinite()`
|
|
407
|
+
* - `isNaN()`
|
|
408
|
+
* - `isZero()`
|
|
409
|
+
* - `sign()` (1, 0 or -1)
|
|
410
|
+
*/
|
|
411
|
+
complex(a: number | Decimal | Complex, b?: number | Decimal): Complex;
|
|
412
|
+
/**
|
|
413
|
+
*
|
|
414
|
+
* Create a Numeric Value.
|
|
415
|
+
*
|
|
416
|
+
* @internal
|
|
417
|
+
*/
|
|
418
|
+
_numericValue(value: number | bigint | Complex | OneOf<[BigNum | NumericValueData | ExactNumericValueData]>): NumericValue;
|
|
419
|
+
/**
|
|
420
|
+
* The cost function is used to determine the "cost" of an expression. For example, when simplifying an expression, the simplification that results in the lowest cost is chosen.
|
|
421
|
+
*/
|
|
422
|
+
get costFunction(): (expr: BoxedExpression) => number;
|
|
423
|
+
set costFunction(fn: ((expr: BoxedExpression) => number) | undefined);
|
|
424
|
+
/**
|
|
425
|
+
* Return definition matching the symbol, starting with the current
|
|
426
|
+
* lexical scope and going up the scope chain.
|
|
427
|
+
*/
|
|
428
|
+
lookupDefinition(id: MathJsonSymbol): undefined | BoxedDefinition;
|
|
429
|
+
/**
|
|
430
|
+
* Associate a new definition to a symbol in the current context.
|
|
431
|
+
*
|
|
432
|
+
* For internal use. Use `ce.declare()` instead.
|
|
433
|
+
*
|
|
434
|
+
* @internal
|
|
435
|
+
*/
|
|
436
|
+
_declareSymbolValue(name: MathJsonSymbol, def: Partial<ValueDefinition>, scope?: Scope): BoxedDefinition;
|
|
437
|
+
/**
|
|
438
|
+
* Associate a new OperatorDefinition to a function in the current context.
|
|
439
|
+
*
|
|
440
|
+
* For internal use. Use `ce.declare()` instead.
|
|
441
|
+
*
|
|
442
|
+
* @internal
|
|
443
|
+
*/
|
|
444
|
+
_declareSymbolOperator(name: string, def: OperatorDefinition, scope?: Scope): BoxedDefinition;
|
|
445
|
+
/**
|
|
446
|
+
*
|
|
447
|
+
* Create a new lexical scope and matching evaluation context and add it
|
|
448
|
+
* to the evaluation context stack.
|
|
449
|
+
*
|
|
450
|
+
*/
|
|
451
|
+
pushScope(scope?: Scope, name?: string): void;
|
|
452
|
+
/**
|
|
453
|
+
* Remove the most recent scope from the scope stack.
|
|
454
|
+
*/
|
|
455
|
+
popScope(): void;
|
|
456
|
+
/** @internal */
|
|
457
|
+
_pushEvalContext(scope: Scope, name?: string): void;
|
|
458
|
+
/** @internal */
|
|
459
|
+
_popEvalContext(): void;
|
|
460
|
+
/** @internal */
|
|
461
|
+
_inScope<T>(scope: Scope | undefined, f: () => T): T;
|
|
462
|
+
/** @internal */
|
|
463
|
+
_printStack(options?: {
|
|
464
|
+
details?: boolean;
|
|
465
|
+
maxDepth?: number;
|
|
466
|
+
}): void;
|
|
467
|
+
/**
|
|
468
|
+
* Use `ce.box(name)` instead
|
|
469
|
+
* @internal */
|
|
470
|
+
_getSymbolValue(id: MathJsonSymbol): BoxedExpression | undefined;
|
|
471
|
+
/**
|
|
472
|
+
* For internal use. Use `ce.assign(name, value)` instead.
|
|
473
|
+
* @internal
|
|
474
|
+
*/
|
|
475
|
+
_setSymbolValue(id: MathJsonSymbol, value: BoxedExpression | boolean | number | undefined): void;
|
|
476
|
+
/**
|
|
477
|
+
* Declare a symbol in the current lexical scope: specify their type and
|
|
478
|
+
* other attributes, including optionally a value.
|
|
479
|
+
*
|
|
480
|
+
* Once the type of a symbol has been declared, it cannot be changed.
|
|
481
|
+
* The type information is used to calculate the canonical form of
|
|
482
|
+
* expressions and ensure they are valid. If the type could be changed
|
|
483
|
+
* after the fact, previously valid expressions could become invalid.
|
|
484
|
+
*
|
|
485
|
+
* Set the type to `unknown` if the type is not known yet: it will be
|
|
486
|
+
* inferred based on usage. Use `any` for a very generic type.
|
|
487
|
+
*
|
|
488
|
+
*
|
|
489
|
+
*/
|
|
490
|
+
declare(id: string, def: Type | TypeString | Partial<SymbolDefinition>, scope?: Scope): IComputeEngine;
|
|
491
|
+
declare(symbols: {
|
|
492
|
+
[id: string]: Type | TypeString | Partial<SymbolDefinition>;
|
|
493
|
+
}): IComputeEngine;
|
|
494
|
+
/**
|
|
495
|
+
* Return an evaluation context in which the symbol is defined.
|
|
496
|
+
*/
|
|
497
|
+
lookupContext(id: MathJsonSymbol): EvalContext | undefined;
|
|
498
|
+
/** Find the context in the stack frame, and set the stack frame to
|
|
499
|
+
* it. This is used to evaluate expressions in the context of
|
|
500
|
+
* a different scope.
|
|
501
|
+
*/
|
|
502
|
+
_swapContext(context: EvalContext): void;
|
|
503
|
+
/**
|
|
504
|
+
* Assign a value to a symbol in the current scope.
|
|
505
|
+
* Use `undefined` to reset the symbol to no value.
|
|
506
|
+
*
|
|
507
|
+
* The symbol should be a valid MathJSON symbol not a LaTeX string.
|
|
508
|
+
*
|
|
509
|
+
* If the symbol was not previously declared, it will be declared as a
|
|
510
|
+
* symbol of a type inferred from its value.
|
|
511
|
+
*
|
|
512
|
+
* To more precisely define the type of the symbol, use `ce.declare()`
|
|
513
|
+
* instead, which allows you to specify the type, value and other
|
|
514
|
+
* attributes of the symbol.
|
|
515
|
+
*/
|
|
516
|
+
assign(id: string, value: AssignValue): IComputeEngine;
|
|
517
|
+
assign(ids: {
|
|
518
|
+
[id: string]: AssignValue;
|
|
519
|
+
}): IComputeEngine;
|
|
520
|
+
/**
|
|
521
|
+
* Return false if the execution should stop.
|
|
522
|
+
*
|
|
523
|
+
* This can occur if:
|
|
524
|
+
* - an error has been signaled
|
|
525
|
+
* - the time limit or memory limit has been exceeded
|
|
526
|
+
*
|
|
527
|
+
* @internal
|
|
528
|
+
*/
|
|
529
|
+
_shouldContinueExecution(): boolean;
|
|
530
|
+
/** @internal */
|
|
531
|
+
_checkContinueExecution(): void;
|
|
532
|
+
/** @internal */
|
|
533
|
+
_cache<T>(cacheName: string, build: () => T, purge?: (t: T) => T | undefined): T;
|
|
534
|
+
/** Return a boxed expression from a number, string or semiboxed expression.
|
|
535
|
+
* Calls `ce.function()`, `ce.number()` or `ce.symbol()` as appropriate.
|
|
536
|
+
*/
|
|
537
|
+
box(expr: NumericValue | SemiBoxedExpression, options?: {
|
|
538
|
+
canonical?: CanonicalOptions;
|
|
539
|
+
structural?: boolean;
|
|
540
|
+
scope?: Scope | undefined;
|
|
541
|
+
}): BoxedExpression;
|
|
542
|
+
function(name: string, ops: ReadonlyArray<BoxedExpression> | ReadonlyArray<Expression>, options?: {
|
|
543
|
+
metadata?: Metadata;
|
|
544
|
+
canonical?: CanonicalOptions;
|
|
545
|
+
structural?: boolean;
|
|
546
|
+
scope?: Scope | undefined;
|
|
547
|
+
}): BoxedExpression;
|
|
548
|
+
/**
|
|
549
|
+
*
|
|
550
|
+
* Shortcut for `this.box(["Error",...])`.
|
|
551
|
+
*
|
|
552
|
+
* The result is canonical.
|
|
553
|
+
*/
|
|
554
|
+
error(message: string | string[], where?: string): BoxedExpression;
|
|
555
|
+
typeError(expected: Type, actual: undefined | Type | BoxedType, where?: string): BoxedExpression;
|
|
556
|
+
/**
|
|
557
|
+
* Add a `["Hold"]` wrapper to `expr`.
|
|
558
|
+
*/
|
|
559
|
+
hold(expr: SemiBoxedExpression): BoxedExpression;
|
|
560
|
+
/** Shortcut for `this.box(["Tuple", ...])`
|
|
561
|
+
*
|
|
562
|
+
* The result is canonical.
|
|
563
|
+
*/
|
|
564
|
+
tuple(...elements: ReadonlyArray<number>): BoxedExpression;
|
|
565
|
+
tuple(...elements: ReadonlyArray<BoxedExpression>): BoxedExpression;
|
|
566
|
+
type(type: Type | TypeString | BoxedType): BoxedType;
|
|
567
|
+
string(s: string, metadata?: Metadata): BoxedExpression;
|
|
568
|
+
/** Create a boxed symbol */
|
|
569
|
+
symbol(name: string, options?: {
|
|
570
|
+
canonical?: CanonicalOptions;
|
|
571
|
+
metadata?: Metadata;
|
|
572
|
+
}): BoxedExpression;
|
|
573
|
+
/**
|
|
574
|
+
* This function tries to avoid creating a boxed number if `num` corresponds
|
|
575
|
+
* to a common value for which we have a shared instance (-1, 0, NaN, etc...)
|
|
576
|
+
*/
|
|
577
|
+
number(value: number | bigint | string | NumericValue | MathJsonNumberObject | Decimal | Complex | Rational, options?: {
|
|
578
|
+
metadata: Metadata;
|
|
579
|
+
canonical: CanonicalOptions;
|
|
580
|
+
}): BoxedExpression;
|
|
581
|
+
rules(rules: Rule | ReadonlyArray<Rule | BoxedRule> | BoxedRuleSet | undefined | null, options?: {
|
|
582
|
+
canonical?: boolean;
|
|
583
|
+
}): BoxedRuleSet;
|
|
584
|
+
/**
|
|
585
|
+
* Return a set of built-in rules.
|
|
586
|
+
*/
|
|
587
|
+
getRuleSet(id?: string): BoxedRuleSet | undefined;
|
|
588
|
+
/**
|
|
589
|
+
* Return a function expression, but the caller is responsible for making
|
|
590
|
+
* sure that the arguments are canonical.
|
|
591
|
+
*
|
|
592
|
+
* Unlike `ce.function()`, the operator of the result is the name argument.
|
|
593
|
+
* Calling this function directly is potentially unsafe, as it bypasses
|
|
594
|
+
* the canonicalization of the arguments.
|
|
595
|
+
*
|
|
596
|
+
* For example:
|
|
597
|
+
*
|
|
598
|
+
* - `ce._fn('Multiply', [1, 'x'])` returns `['Multiply', 1, 'x']` as a
|
|
599
|
+
* canonical expression, even though it doesn't follow the canonical form
|
|
600
|
+
* - `ce.function('Multiply', [1, 'x']` returns `'x'` which is the correct
|
|
601
|
+
* canonical form
|
|
602
|
+
*
|
|
603
|
+
* @internal */
|
|
604
|
+
_fn(name: MathJsonSymbol, ops: ReadonlyArray<BoxedExpression>, options?: {
|
|
605
|
+
metadata?: Metadata;
|
|
606
|
+
canonical?: boolean;
|
|
607
|
+
scope?: Scope;
|
|
608
|
+
}): BoxedExpression;
|
|
609
|
+
/**
|
|
610
|
+
* Parse a string of LaTeX and return a corresponding `BoxedExpression`.
|
|
611
|
+
*
|
|
612
|
+
* If the `canonical` option is set to `true`, the result will be canonical
|
|
613
|
+
*
|
|
614
|
+
*/
|
|
615
|
+
parse(latex: null, options?: Partial<ParseLatexOptions> & {
|
|
616
|
+
canonical?: CanonicalOptions;
|
|
617
|
+
}): null;
|
|
618
|
+
parse(latex: LatexString, options?: Partial<ParseLatexOptions> & {
|
|
619
|
+
canonical?: CanonicalOptions;
|
|
620
|
+
}): BoxedExpression;
|
|
621
|
+
/**
|
|
622
|
+
* Return a list of all the assumptions that match a pattern.
|
|
623
|
+
*
|
|
624
|
+
* ```js
|
|
625
|
+
* ce.assume(['Element', 'x', 'PositiveIntegers');
|
|
626
|
+
* ce.ask(['Greater', 'x', '_val'])
|
|
627
|
+
* // -> [{'val': 0}]
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
ask(pattern: BoxedExpression): BoxedSubstitution[];
|
|
631
|
+
/**
|
|
632
|
+
* Answer a query based on the current assumptions.
|
|
633
|
+
*
|
|
634
|
+
*/
|
|
635
|
+
verify(_query: BoxedExpression): boolean;
|
|
636
|
+
/**
|
|
637
|
+
* Add an assumption.
|
|
638
|
+
*
|
|
639
|
+
* Note that the assumption is put into canonical form before being added.
|
|
640
|
+
*
|
|
641
|
+
* Returns:
|
|
642
|
+
* - `contradiction` if the new assumption is incompatible with previous
|
|
643
|
+
* ones.
|
|
644
|
+
* - `tautology` if the new assumption is redundant with previous ones.
|
|
645
|
+
* - `ok` if the assumption was successfully added to the assumption set.
|
|
646
|
+
*
|
|
647
|
+
*
|
|
648
|
+
*/
|
|
649
|
+
assume(predicate: BoxedExpression): AssumeResult;
|
|
650
|
+
/**
|
|
651
|
+
* Remove all assumptions about one or more symbols.
|
|
652
|
+
*
|
|
653
|
+
* `ce.forget()` will remove all assumptions.
|
|
654
|
+
*
|
|
655
|
+
* Note that assumptions are scoped, so when exiting the current lexical
|
|
656
|
+
* scope, the previous assumptions will be restored.
|
|
657
|
+
*
|
|
658
|
+
* */
|
|
659
|
+
forget(symbol: undefined | MathJsonSymbol | MathJsonSymbol[]): void;
|
|
660
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* 0.32.1 */
|
|
2
|
+
export declare const DEFINITIONS_CORE: LatexDictionary;
|
|
3
|
+
export declare const DELIMITERS_SHORTHAND: {
|
|
4
|
+
'(': string;
|
|
5
|
+
')': string;
|
|
6
|
+
'[': string;
|
|
7
|
+
']': string;
|
|
8
|
+
'\u27E6': string;
|
|
9
|
+
'\u27E7': 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
|
+
};
|
|
27
|
+
export declare function latexToDelimiterShorthand(s: string): string | undefined;
|