@cortex-js/compute-engine 0.27.0 → 0.29.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.
Files changed (151) hide show
  1. package/dist/{compute-engine.js → compute-engine.cjs} +24718 -24251
  2. package/dist/compute-engine.esm.js +24718 -24251
  3. package/dist/compute-engine.min.cjs +129 -0
  4. package/dist/compute-engine.min.esm.js +55 -68
  5. package/dist/math-json.cjs +413 -0
  6. package/dist/math-json.esm.js +287 -7
  7. package/dist/math-json.min.cjs +6 -0
  8. package/dist/math-json.min.esm.js +287 -7
  9. package/dist/types/common/ansi-codes.d.ts +1 -1
  10. package/dist/types/common/fuzzy-string-match.d.ts +2 -0
  11. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  12. package/dist/types/common/interruptible.d.ts +2 -2
  13. package/dist/types/common/json5.d.ts +3 -0
  14. package/dist/types/common/one-of.d.ts +2 -1
  15. package/dist/types/common/signals.d.ts +1 -2
  16. package/dist/types/common/type/boxed-type.d.ts +14 -0
  17. package/dist/types/common/type/parse.d.ts +1 -1
  18. package/dist/types/common/type/primitive.d.ts +2 -1
  19. package/dist/types/common/type/serialize.d.ts +1 -1
  20. package/dist/types/common/type/subtype.d.ts +1 -1
  21. package/dist/types/common/type/types.d.ts +121 -136
  22. package/dist/types/common/type/utils.d.ts +3 -7
  23. package/dist/types/common/utils.d.ts +1 -1
  24. package/dist/types/compute-engine/assume.d.ts +1 -1
  25. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +17 -18
  26. package/dist/types/compute-engine/boxed-expression/apply.d.ts +2 -2
  27. package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +5 -4
  28. package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +27 -0
  29. package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +2 -2
  30. package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
  31. package/dist/types/compute-engine/boxed-expression/box.d.ts +5 -5
  32. package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +20 -14
  33. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +14 -13
  34. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +8 -10
  35. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +2 -2
  36. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +4 -5
  37. package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +6 -5
  38. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +11 -11
  39. package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +7 -10
  40. package/dist/types/compute-engine/boxed-expression/cache.d.ts +2 -1
  41. package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
  42. package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
  43. package/dist/types/compute-engine/boxed-expression/expand.d.ts +3 -3
  44. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
  45. package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -3
  46. package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
  47. package/dist/types/compute-engine/boxed-expression/hold.d.ts +3 -2
  48. package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
  49. package/dist/types/compute-engine/boxed-expression/negate.d.ts +2 -2
  50. package/dist/types/compute-engine/boxed-expression/numerics.d.ts +3 -3
  51. package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
  52. package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
  53. package/dist/types/compute-engine/boxed-expression/product.d.ts +5 -5
  54. package/dist/types/compute-engine/boxed-expression/rules.d.ts +2 -2
  55. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +3 -3
  56. package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
  57. package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
  58. package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -2
  59. package/dist/types/compute-engine/boxed-expression/terms.d.ts +2 -2
  60. package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +2 -9
  61. package/dist/types/compute-engine/boxed-expression/utils.d.ts +13 -4
  62. package/dist/types/compute-engine/boxed-expression/validate.d.ts +9 -10
  63. package/dist/types/compute-engine/collection-utils.d.ts +1 -1
  64. package/dist/types/compute-engine/compile.d.ts +2 -4
  65. package/dist/types/compute-engine/cost-function.d.ts +1 -1
  66. package/dist/types/compute-engine/function-utils.d.ts +1 -1
  67. package/dist/types/compute-engine/{boxed-expression/public.d.ts → global-types.d.ts} +887 -849
  68. package/dist/types/compute-engine/{compute-engine.d.ts → index.d.ts} +29 -19
  69. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  70. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  71. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  72. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
  73. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  74. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
  75. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  76. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  77. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
  78. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  79. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
  80. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  81. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  82. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +2 -2
  83. package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +2 -2
  84. package/dist/types/compute-engine/latex-syntax/parse.d.ts +2 -2
  85. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +2 -2
  86. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +2 -2
  87. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +2 -2
  88. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  89. package/dist/types/compute-engine/latex-syntax/{public.d.ts → types.d.ts} +13 -6
  90. package/dist/types/compute-engine/library/arithmetic.d.ts +1 -2
  91. package/dist/types/compute-engine/library/calculus.d.ts +1 -1
  92. package/dist/types/compute-engine/library/collections.d.ts +3 -2
  93. package/dist/types/compute-engine/library/complex.d.ts +1 -1
  94. package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
  95. package/dist/types/compute-engine/library/core.d.ts +1 -1
  96. package/dist/types/compute-engine/library/invisible-operator.d.ts +2 -2
  97. package/dist/types/compute-engine/library/library.d.ts +3 -3
  98. package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
  99. package/dist/types/compute-engine/library/logic.d.ts +1 -1
  100. package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
  101. package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
  102. package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
  103. package/dist/types/compute-engine/library/sets.d.ts +1 -1
  104. package/dist/types/compute-engine/library/statistics.d.ts +1 -1
  105. package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
  106. package/dist/types/compute-engine/library/utils.d.ts +3 -5
  107. package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +3 -4
  108. package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +3 -5
  109. package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +3 -4
  110. package/dist/types/compute-engine/numeric-value/{public.d.ts → types.d.ts} +9 -5
  111. package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
  112. package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
  113. package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
  114. package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
  115. package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
  116. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
  117. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  118. package/dist/types/compute-engine/numerics/numeric.d.ts +2 -7
  119. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  120. package/dist/types/compute-engine/numerics/rationals.d.ts +1 -5
  121. package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
  122. package/dist/types/compute-engine/numerics/special-functions.d.ts +4 -4
  123. package/dist/types/compute-engine/numerics/statistics.d.ts +2 -2
  124. package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
  125. package/dist/types/compute-engine/numerics/types.d.ts +30 -0
  126. package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
  127. package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
  128. package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
  129. package/dist/types/compute-engine/{boxed-expression → tensor}/tensor-fields.d.ts +19 -18
  130. package/dist/types/compute-engine/tensor/tensors.d.ts +9 -12
  131. package/dist/types/compute-engine/types.d.ts +11 -0
  132. package/dist/types/compute-engine.d.ts +3 -5
  133. package/dist/types/math-json/identifiers.d.ts +1 -1
  134. package/dist/types/math-json/types.d.ts +9 -7
  135. package/dist/types/math-json/utils.d.ts +3 -3
  136. package/dist/types/math-json.d.ts +3 -3
  137. package/package.json +9 -9
  138. package/dist/compute-engine.min.js +0 -142
  139. package/dist/math-json.js +0 -133
  140. package/dist/math-json.min.js +0 -4
  141. package/dist/types/common/buffer.d.ts +0 -9
  142. package/dist/types/common/styled-text.d.ts +0 -28
  143. package/dist/types/common/suggest.d.ts +0 -1
  144. package/dist/types/common/syntax-highlighter.d.ts +0 -40
  145. package/dist/types/common/terminal.d.ts +0 -19
  146. package/dist/types/compute-engine/boxed-expression/arithmetic-divide.d.ts +0 -12
  147. package/dist/types/compute-engine/boxed-expression/arithmetic-multiply.d.ts +0 -16
  148. package/dist/types/compute-engine/debug.d.ts +0 -3
  149. package/dist/types/compute-engine/numerics/bignum.d.ts +0 -12
  150. package/dist/types/compute-engine/private.d.ts +0 -29
  151. package/dist/types/compute-engine/public.d.ts +0 -42
@@ -1,8 +1,4 @@
1
- /* 0.27.0 */
2
- /**
3
- * @category Boxed Expression
4
- */
5
- export type Rational = [SmallInteger, SmallInteger] | [bigint, bigint];
1
+ /* 0.29.0 */
6
2
  export declare function isRational(x: any | null): x is Rational;
7
3
  export declare function isMachineRational(x: any | null): x is [SmallInteger, SmallInteger];
8
4
  export declare function isBigRational(x: any | null): x is [bigint, bigint];
@@ -1,4 +1,4 @@
1
- /* 0.27.0 */
1
+ /* 0.29.0 */
2
2
 
3
3
  Translated from https://github.com/JuliaMath/Richardson.jl/blob/master/src/Richardson.jl
4
4
 
@@ -1,5 +1,5 @@
1
- /* 0.27.0 */
2
- import { BigNum } from './bignum';
1
+ /* 0.29.0 */
2
+ import type { BigNum } from './types';
3
3
  export declare function gammaln(z: number): number;
4
4
  export declare function gamma(z: number): number;
5
5
  /**
@@ -24,5 +24,5 @@ export declare function erfc(x: number): number;
24
24
  * - NIST: https://dlmf.nist.gov/7.24#i
25
25
  */
26
26
  export declare function erf(x: number): number;
27
- export declare function bigGammaln(ce: IComputeEngine, z: BigNum): BigNum;
28
- export declare function bigGamma(ce: IComputeEngine, z: BigNum): BigNum;
27
+ export declare function bigGammaln(ce: ComputeEngine, z: BigNum): BigNum;
28
+ export declare function bigGamma(ce: ComputeEngine, z: BigNum): BigNum;
@@ -1,5 +1,5 @@
1
- /* 0.27.0 */
2
- import { BigNum } from './bignum';
1
+ /* 0.29.0 */
2
+ import type { BigNum } from './types';
3
3
  export declare function mean(values: Iterable<number>): number;
4
4
  export declare function bigMean(bignum: BigNumFactory, values: Iterable<BigNum>): BigNum;
5
5
  export declare function median(values: Iterable<number>): number;
@@ -1,2 +1,2 @@
1
- /* 0.27.0 */
1
+ /* 0.29.0 */
2
2
  export declare function numberToString(num: number | bigint, fractionalDigits?: number | string): string;
@@ -0,0 +1,30 @@
1
+ /* 0.29.0 */
2
+ type IsInteger<N extends number> = `${N}` extends `${string}.${string}` ? never : `${N}` extends `-${string}.${string}` ? never : number;
3
+ /** A `SmallInteger` is an integer < 1e6
4
+ * @category Numerics
5
+ */
6
+ export type SmallInteger = IsInteger<number>;
7
+ /**
8
+ * A rational number is a number that can be expressed as the quotient or fraction p/q of two integers,
9
+ * a numerator p and a non-zero denominator q.
10
+ *
11
+ * A rational can either be represented as a pair of small integers or
12
+ * a pair of big integers.
13
+ *
14
+ * @category Numerics
15
+ */
16
+ export type Rational = [SmallInteger, SmallInteger] | [bigint, bigint];
17
+ /** @category Numerics */
18
+ export type BigNum = Decimal;
19
+ /** @category Numerics */
20
+ export interface IBigNum {
21
+ readonly _BIGNUM_NAN: BigNum;
22
+ readonly _BIGNUM_ZERO: BigNum;
23
+ readonly _BIGNUM_ONE: BigNum;
24
+ readonly _BIGNUM_TWO: BigNum;
25
+ readonly _BIGNUM_HALF: BigNum;
26
+ readonly _BIGNUM_PI: BigNum;
27
+ readonly _BIGNUM_NEGATIVE_ONE: BigNum;
28
+ bignum(value: string | number | bigint | BigNum): BigNum;
29
+ }
30
+ export {};
@@ -1,4 +1,4 @@
1
- /* 0.27.0 */
1
+ /* 0.29.0 */
2
2
  /**
3
3
  *
4
4
  * @param fn The function to differentiate, a `["Function"]` expression or
@@ -1,4 +1,4 @@
1
- /* 0.27.0 */
1
+ /* 0.29.0 */
2
2
  /**
3
3
  *
4
4
  */
@@ -1,4 +1,4 @@
1
- /* 0.27.0 */
1
+ /* 0.29.0 */
2
2
  /**
3
3
  * @todo: a set to "tidy" an expression. Different from a canonical form, but
4
4
  * inline with the user's expectations.
@@ -1,18 +1,8 @@
1
- /* 0.27.0 */
2
- import type { BoxedExpression, IComputeEngine } from '../public';
3
- export type DataTypeMap = {
4
- float64: number;
5
- float32: number;
6
- int32: number;
7
- uint8: number;
8
- complex128: Complex;
9
- complex64: Complex;
10
- bool: boolean;
11
- string: string;
12
- expression: BoxedExpression;
13
- };
14
- export type TensorDataType = keyof DataTypeMap;
15
- export declare function makeTensorField<DT extends keyof DataTypeMap>(ce: IComputeEngine, dtype: DT): TensorField<DataTypeMap[DT]>;
1
+ /* 0.29.0 */
2
+ import { BoxedExpression, ComputeEngine, DataTypeMap, TensorDataType } from '../global-types';
3
+ /** @category Tensors */
4
+ export declare function makeTensorField<DT extends keyof DataTypeMap>(ce: ComputeEngine, dtype: DT): TensorField<DataTypeMap[DT]>;
5
+ /** @category Tensors */
16
6
  export interface TensorField<T extends number | Complex | BoxedExpression | boolean | string = number> {
17
7
  readonly one: T;
18
8
  readonly zero: T;
@@ -50,12 +40,13 @@ export interface TensorField<T extends number | Complex | BoxedExpression | bool
50
40
  pow(rhs: T, n: number): T;
51
41
  conjugate(x: T): T;
52
42
  }
43
+ /** @category Tensors */
53
44
  export declare class TensorFieldNumber implements TensorField<number> {
54
45
  private ce;
55
46
  one: number;
56
47
  zero: number;
57
48
  nan: number;
58
- constructor(ce: IComputeEngine);
49
+ constructor(ce: ComputeEngine);
59
50
  cast(x: number, dtype: 'float64'): undefined | number;
60
51
  cast(x: number, dtype: 'float32'): undefined | number;
61
52
  cast(x: number, dtype: 'int32'): undefined | number;
@@ -88,12 +79,13 @@ export declare class TensorFieldNumber implements TensorField<number> {
88
79
  pow(lhs: number, rhs: number): number;
89
80
  conjugate(x: number): number;
90
81
  }
82
+ /** @category Tensors */
91
83
  export declare class TensorFieldExpression implements TensorField<BoxedExpression> {
92
84
  one: BoxedExpression;
93
85
  zero: BoxedExpression;
94
86
  nan: BoxedExpression;
95
87
  private ce;
96
- constructor(ce: IComputeEngine);
88
+ constructor(ce: ComputeEngine);
97
89
  cast(x: BoxedExpression, dtype: 'float64'): undefined | number;
98
90
  cast(x: BoxedExpression, dtype: 'float32'): undefined | number;
99
91
  cast(x: BoxedExpression, dtype: 'int32'): undefined | number;
@@ -126,12 +118,13 @@ export declare class TensorFieldExpression implements TensorField<BoxedExpressio
126
118
  pow(lhs: BoxedExpression, rhs: number): BoxedExpression;
127
119
  conjugate(x: BoxedExpression): BoxedExpression;
128
120
  }
121
+ /** @category Tensors */
129
122
  export declare class TensorFieldComplex implements TensorField<Complex> {
130
123
  one: Complex;
131
124
  zero: Complex;
132
125
  nan: Complex;
133
126
  private ce;
134
- constructor(ce: IComputeEngine);
127
+ constructor(ce: ComputeEngine);
135
128
  cast(x: Complex, dtype: 'float64'): undefined | number;
136
129
  cast(x: Complex, dtype: 'float32'): undefined | number;
137
130
  cast(x: Complex, dtype: 'int32'): undefined | number;
@@ -164,5 +157,13 @@ export declare class TensorFieldComplex implements TensorField<Complex> {
164
157
  pow(lhs: Complex, rhs: number): Complex;
165
158
  conjugate(z: Complex): Complex;
166
159
  }
160
+ /**
161
+ * @category Tensors
162
+ * @internal
163
+ */
167
164
  export declare function getSupertype(t1: TensorDataType | undefined, t2: TensorDataType): TensorDataType;
165
+ /**
166
+ * @category Tensors
167
+ * @internal
168
+ */
168
169
  export declare function getExpressionDatatype(expr: BoxedExpression): TensorDataType;
@@ -1,15 +1,10 @@
1
- /* 0.27.0 */
2
- import { DataTypeMap, TensorDataType, TensorField } from '../boxed-expression/tensor-fields';
3
- /**
4
- * @noInheritDoc
5
- */
6
- export interface TensorData<DT extends keyof DataTypeMap = 'float64'> {
7
- dtype: DT;
8
- shape: number[];
9
- data: DataTypeMap[DT][];
10
- }
1
+ /* 0.29.0 */
2
+ import type { BoxedExpression, ComputeEngine, DataTypeMap, TensorData, TensorDataType } from '../global-types';
3
+ /** @internal */
11
4
  export type NestedArray<T> = NestedArray_<T>[];
5
+ /** @internal */
12
6
  export type NestedArray_<T> = T | NestedArray_<T>[];
7
+ /** @category Tensors */
13
8
  export declare abstract class AbstractTensor<DT extends keyof DataTypeMap> implements TensorData<DT> {
14
9
  private ce;
15
10
  /**
@@ -40,7 +35,7 @@ export declare abstract class AbstractTensor<DT extends keyof DataTypeMap> imple
40
35
  readonly shape: number[];
41
36
  readonly rank: number;
42
37
  private readonly _strides;
43
- constructor(ce: IComputeEngine, tensorData: TensorData<DT>);
38
+ constructor(ce: ComputeEngine, tensorData: TensorData<DT>);
44
39
  abstract get dtype(): DT;
45
40
  abstract get data(): DataTypeMap[DT][];
46
41
  get expression(): BoxedExpression;
@@ -98,9 +93,11 @@ export declare abstract class AbstractTensor<DT extends keyof DataTypeMap> imple
98
93
  power(rhs: AbstractTensor<DT> | DataTypeMap[DT]): AbstractTensor<DT>;
99
94
  equals(rhs: AbstractTensor<DT>): boolean;
100
95
  }
101
- export declare function makeTensor<T extends TensorDataType>(ce: IComputeEngine, data: TensorData<T> | {
96
+ /** @category Tensors */
97
+ export declare function makeTensor<T extends TensorDataType>(ce: ComputeEngine, data: TensorData<T> | {
102
98
  operator: string;
103
99
  ops: BoxedExpression[];
104
100
  dtype: T;
105
101
  shape: number[];
106
102
  }): AbstractTensor<T>;
103
+ export { TensorData };
@@ -0,0 +1,11 @@
1
+ /* 0.29.0 */
2
+ export * from '../math-json/types';
3
+ export * from '../common/type/boxed-type';
4
+ export * from '../common/type/types';
5
+ export type { LatexString, SerializeLatexOptions, NumberSerializationFormat, DelimiterScale, NumberFormat, } from './latex-syntax/types';
6
+ export * from './latex-syntax/dictionary/definitions';
7
+ export * from './numerics/types';
8
+ export * from './numeric-value/types';
9
+ export * from './tensor/tensors';
10
+ export * from './tensor/tensor-fields';
11
+ export * from './global-types';
@@ -1,5 +1,3 @@
1
- /* 0.27.0 */
2
- export declare const version = "0.27.0";
3
- export { ComputeEngine } from './compute-engine/compute-engine';
4
- export { terminal } from './common/terminal';
5
- export { highlightCodeSpan, highlightCodeBlock, } from './common/syntax-highlighter';
1
+ /* 0.29.0 */
2
+ export { ComputeEngine } from './compute-engine/index';
3
+ export * from './compute-engine/types';
@@ -1,4 +1,4 @@
1
- /* 0.27.0 */
1
+ /* 0.29.0 */
2
2
  * Return true if the string is a valid identifier.
3
3
  *
4
4
  * Check for identifiers matching a profile of [Unicode UAX31](https://unicode.org/reports/tr31/)
@@ -1,6 +1,5 @@
1
- /* 0.27.0 */
2
- /** @category MathJSON */
3
- export type Attributes = {
1
+ /* 0.29.0 */
2
+ export type MathJsonAttributes = {
4
3
  /** A human readable string to annotate this expression, since JSON does not
5
4
  * allow comments in its encoding */
6
5
  comment?: string;
@@ -85,19 +84,22 @@ export type MathJsonIdentifier = string;
85
84
  */
86
85
  export type MathJsonNumber = {
87
86
  num: 'NaN' | '-Infinity' | '+Infinity' | string;
88
- } & Attributes;
87
+ } & MathJsonAttributes;
89
88
  /** @category MathJSON */
90
89
  export type MathJsonSymbol = {
91
90
  sym: MathJsonIdentifier;
92
- } & Attributes;
91
+ } & MathJsonAttributes;
93
92
  /** @category MathJSON */
94
93
  export type MathJsonString = {
95
94
  str: string;
96
- } & Attributes;
95
+ } & MathJsonAttributes;
97
96
  /** @category MathJSON */
98
97
  export type MathJsonFunction = {
99
98
  fn: [MathJsonIdentifier, ...Expression[]];
100
- } & Attributes;
99
+ } & MathJsonAttributes;
100
+ /**
101
+ * @category MathJSON
102
+ */
101
103
  export type ExpressionObject = MathJsonNumber | MathJsonString | MathJsonSymbol | MathJsonFunction;
102
104
  /**
103
105
  * A MathJSON expression is a recursive data structure.
@@ -1,4 +1,4 @@
1
- /* 0.27.0 */
1
+ /* 0.29.0 */
2
2
  export declare const MISSING: Expression;
3
3
  export declare function isNumberExpression(expr: Expression | null): expr is number | string | MathJsonNumber;
4
4
  export declare function isNumberObject(expr: Expression | null): expr is MathJsonNumber;
@@ -31,8 +31,8 @@ export declare function operand(expr: Expression | null, n: 1 | 2 | 3): Expressi
31
31
  export declare function nops(expr: Expression | null | undefined): number;
32
32
  export declare function unhold(expr: Expression | null): Expression | null;
33
33
  export declare function symbol(expr: Expression | null | undefined): string | null;
34
- export declare function dictionary(expr: Expression | null): null | Record<string, Expression>;
35
- export declare function dictionaryFrom(dict: Record<string, Expression>): Expression;
34
+ export declare function dictionaryFromExpression(expr: Expression | null): null | Record<string, Expression>;
35
+ export declare function dictionaryFromEntries(dict: Record<string, Expression>): Expression;
36
36
  /**
37
37
  * CAUTION: `machineValue()` will return a truncated value if the number
38
38
  * has a precision outside of the machine range.
@@ -1,3 +1,3 @@
1
- /* 0.27.0 */
2
- export { isSymbolObject, isStringObject, isFunctionObject, stringValue as getStringValue, operator, operand, symbol, mapArgs, dictionary as getDictionary, } from './math-json/utils';
3
- export declare const version = "0.27.0";
1
+ /* 0.29.0 */
2
+ export { isSymbolObject, isStringObject, isFunctionObject, stringValue, operator, operand, symbol, mapArgs, dictionaryFromExpression, } from './math-json/utils';
3
+ export declare const version = "0.29.0";
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.27.0",
2
+ "version": "0.29.0",
3
3
  "scripts": {
4
4
  "doc": "bash ./scripts/doc.sh",
5
5
  "build": "bash ./scripts/build.sh",
@@ -43,17 +43,17 @@
43
43
  "exports": {
44
44
  ".": {
45
45
  "types": "./dist/types/compute-engine.d.ts",
46
- "require": "./dist/compute-engine.min.js",
46
+ "require": "./dist/compute-engine.min.cjs",
47
47
  "import": "./dist/compute-engine.min.esm.js",
48
- "default": "./dist/compute-engine.min.js"
48
+ "default": "./dist/compute-engine.min.cjs"
49
49
  }
50
50
  },
51
- "main": "./dist/compute-engine.min.js",
51
+ "main": "./dist/compute-engine.min.cjs",
52
52
  "module": "./dist/compute-engine.min.esm.js",
53
53
  "types": "./dist/types/compute-engine.d.ts",
54
54
  "engines": {
55
- "npm": ">=8.5.0",
56
- "node": ">=16.14.2"
55
+ "npm": ">=10.5.0",
56
+ "node": ">=21.7.3"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@cortex-js/prettier-config": "^1.2.0",
@@ -80,9 +80,9 @@
80
80
  "serve-http": "^1.0.7",
81
81
  "ts-jest": "^29.1.1",
82
82
  "ts-node": "^10.9.1",
83
- "typedoc": "^0.26.2",
84
- "typedoc-plugin-markdown": "^4.0.0-next.53",
85
- "typedoc-plugin-no-inherit": "^1.4.0",
83
+ "typedoc": "^0.27.6",
84
+ "typedoc-plugin-markdown": "^4.4.1",
85
+ "typedoc-plugin-no-inherit": "^1.5.0",
86
86
  "typescript": "^5.2.2",
87
87
  "update-notifier": "^7.0.0"
88
88
  },