@mojir/lits 2.3.1 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -26
- package/dist/bundler.esm.js +2 -0
- package/dist/bundler.esm.js.map +1 -0
- package/dist/bundler.js +2 -0
- package/dist/bundler.js.map +1 -0
- package/dist/cli/cli/src/js-interop/Cli/Fs/index.d.ts +2 -2
- package/dist/cli/cli/src/js-interop/Cli/Proc/index.d.ts +2 -2
- package/dist/cli/cli/src/js-interop/Cli/index.d.ts +2 -3
- package/dist/cli/cli.js +2672 -2316
- package/dist/cli/reference/api.d.ts +3 -3
- package/dist/cli/reference/examples.d.ts +2 -2
- package/dist/cli/reference/index.d.ts +0 -1
- package/dist/cli/src/Lits/Lits.d.ts +6 -7
- package/dist/cli/src/builtin/index.d.ts +1 -1
- package/dist/cli/src/builtin/specialExpressionTypes.d.ts +15 -15
- package/dist/cli/src/builtin/specialExpressions/import.d.ts +6 -0
- package/dist/cli/src/bundler/index.d.ts +9 -0
- package/dist/cli/src/bundler/interface.d.ts +15 -0
- package/dist/cli/src/bundler.d.ts +3 -0
- package/dist/cli/src/evaluator/ContextStack.d.ts +10 -4
- package/dist/cli/src/index.d.ts +2 -0
- package/dist/cli/src/js-interop/Cli/Fs/index.d.ts +2 -2
- package/dist/cli/src/js-interop/Cli/Proc/index.d.ts +2 -2
- package/dist/cli/src/js-interop/Cli/index.d.ts +2 -3
- package/dist/cli/src/parser/ParserContext.d.ts +1 -1
- package/dist/cli/src/parser/getPrecedence.d.ts +3 -0
- package/dist/cli/src/parser/index.d.ts +2 -0
- package/dist/cli/src/parser/subParsers/parseExpression.d.ts +5 -0
- package/dist/cli/src/parser/types.d.ts +0 -3
- package/dist/cli/src/tokenizer/reservedNames.d.ts +0 -1
- package/dist/full.esm.js +1 -1
- package/dist/full.esm.js.map +1 -1
- package/dist/full.js +1 -1
- package/dist/full.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +1 -1
- package/dist/lits.iife.js.map +1 -1
- package/dist/modules/assert.esm.js +1 -1
- package/dist/modules/assert.esm.js.map +1 -1
- package/dist/modules/assert.js +1 -1
- package/dist/modules/assert.js.map +1 -1
- package/dist/modules/bitwise.esm.js +1 -1
- package/dist/modules/bitwise.esm.js.map +1 -1
- package/dist/modules/bitwise.js +1 -1
- package/dist/modules/bitwise.js.map +1 -1
- package/dist/modules/cli/src/js-interop/Cli/Fs/index.d.ts +2 -2
- package/dist/modules/cli/src/js-interop/Cli/Proc/index.d.ts +2 -2
- package/dist/modules/cli/src/js-interop/Cli/index.d.ts +2 -3
- package/dist/modules/collection.esm.js +1 -1
- package/dist/modules/collection.esm.js.map +1 -1
- package/dist/modules/collection.js +1 -1
- package/dist/modules/collection.js.map +1 -1
- package/dist/modules/functional.esm.js +1 -1
- package/dist/modules/functional.esm.js.map +1 -1
- package/dist/modules/functional.js +1 -1
- package/dist/modules/functional.js.map +1 -1
- package/dist/modules/grid.esm.js +1 -1
- package/dist/modules/grid.esm.js.map +1 -1
- package/dist/modules/grid.js +1 -1
- package/dist/modules/grid.js.map +1 -1
- package/dist/modules/linear-algebra.esm.js +1 -1
- package/dist/modules/linear-algebra.esm.js.map +1 -1
- package/dist/modules/linear-algebra.js +1 -1
- package/dist/modules/linear-algebra.js.map +1 -1
- package/dist/modules/math.esm.js +1 -1
- package/dist/modules/math.esm.js.map +1 -1
- package/dist/modules/math.js +1 -1
- package/dist/modules/math.js.map +1 -1
- package/dist/modules/matrix.esm.js +1 -1
- package/dist/modules/matrix.esm.js.map +1 -1
- package/dist/modules/matrix.js +1 -1
- package/dist/modules/matrix.js.map +1 -1
- package/dist/modules/number-theory.esm.js +1 -1
- package/dist/modules/number-theory.esm.js.map +1 -1
- package/dist/modules/number-theory.js +1 -1
- package/dist/modules/number-theory.js.map +1 -1
- package/dist/modules/random.esm.js +1 -1
- package/dist/modules/random.esm.js.map +1 -1
- package/dist/modules/random.js +1 -1
- package/dist/modules/random.js.map +1 -1
- package/dist/modules/reference/api.d.ts +3 -3
- package/dist/modules/reference/index.d.ts +0 -1
- package/dist/modules/sequence.esm.js +1 -1
- package/dist/modules/sequence.esm.js.map +1 -1
- package/dist/modules/sequence.js +1 -1
- package/dist/modules/sequence.js.map +1 -1
- package/dist/modules/src/Lits/Lits.d.ts +6 -7
- package/dist/modules/src/builtin/index.d.ts +1 -1
- package/dist/modules/src/builtin/specialExpressionTypes.d.ts +15 -15
- package/dist/modules/src/builtin/specialExpressions/import.d.ts +6 -0
- package/dist/modules/src/bundler/index.d.ts +9 -0
- package/dist/modules/src/bundler/interface.d.ts +15 -0
- package/dist/modules/src/bundler.d.ts +3 -0
- package/dist/modules/src/evaluator/ContextStack.d.ts +10 -4
- package/dist/modules/src/index.d.ts +2 -0
- package/dist/modules/src/parser/ParserContext.d.ts +1 -1
- package/dist/modules/src/parser/getPrecedence.d.ts +3 -0
- package/dist/modules/src/parser/index.d.ts +2 -0
- package/dist/modules/src/parser/subParsers/parseExpression.d.ts +5 -0
- package/dist/modules/src/parser/types.d.ts +0 -3
- package/dist/modules/src/tokenizer/reservedNames.d.ts +0 -1
- package/dist/modules/string.esm.js +1 -1
- package/dist/modules/string.esm.js.map +1 -1
- package/dist/modules/string.js +1 -1
- package/dist/modules/string.js.map +1 -1
- package/dist/modules/vector.esm.js +1 -1
- package/dist/modules/vector.esm.js.map +1 -1
- package/dist/modules/vector.js +1 -1
- package/dist/modules/vector.js.map +1 -1
- package/dist/reference/api.d.ts +3 -3
- package/dist/reference/index.d.ts +0 -1
- package/dist/src/Lits/Lits.d.ts +6 -7
- package/dist/src/builtin/index.d.ts +1 -1
- package/dist/src/builtin/specialExpressionTypes.d.ts +15 -15
- package/dist/src/builtin/specialExpressions/import.d.ts +6 -0
- package/dist/src/bundler/index.d.ts +9 -0
- package/dist/src/bundler/interface.d.ts +15 -0
- package/dist/src/bundler.d.ts +3 -0
- package/dist/src/evaluator/ContextStack.d.ts +10 -4
- package/dist/src/index.d.ts +2 -0
- package/dist/src/parser/ParserContext.d.ts +1 -1
- package/dist/src/parser/getPrecedence.d.ts +3 -0
- package/dist/src/parser/index.d.ts +2 -0
- package/dist/src/parser/subParsers/parseExpression.d.ts +5 -0
- package/dist/src/parser/types.d.ts +0 -3
- package/dist/src/tokenizer/reservedNames.d.ts +0 -1
- package/dist/testFramework.esm.js +1 -1
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +1 -1
- package/dist/testFramework.js.map +1 -1
- package/package.json +6 -1
- package/dist/cli/cli/src/js-interop/utils.d.ts +0 -2
- package/dist/cli/src/builtin/specialExpressions/def.d.ts +0 -6
- package/dist/cli/src/js-interop/utils.d.ts +0 -2
- package/dist/cli/src/parser/subParsers/getPrecedence.d.ts +0 -3
- package/dist/modules/cli/src/js-interop/utils.d.ts +0 -2
- package/dist/modules/src/builtin/specialExpressions/def.d.ts +0 -6
- package/dist/modules/src/parser/subParsers/getPrecedence.d.ts +0 -3
- package/dist/src/builtin/specialExpressions/def.d.ts +0 -6
- package/dist/src/parser/subParsers/getPrecedence.d.ts +0 -3
package/dist/reference/api.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const api: {
|
|
|
11
11
|
readonly functional: readonly ["|>", "apply", "identity", "comp", "constantly"];
|
|
12
12
|
readonly functionalUtils: readonly ["functional.juxt", "functional.complement", "functional.every-pred", "functional.some-pred", "functional.fnull"];
|
|
13
13
|
readonly meta: readonly ["doc", "arity"];
|
|
14
|
-
readonly misc: readonly ["!=", "==", "<", ">", "<=", ">=", "not", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "
|
|
14
|
+
readonly misc: readonly ["!=", "==", "<", ">", "<=", ">=", "not", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "json-parse", "json-stringify"];
|
|
15
15
|
readonly object: readonly ["dissoc", "keys", "vals", "entries", "find", "merge", "merge-with", "zipmap", "select-keys"];
|
|
16
16
|
readonly predicate: readonly ["boolean?", "null?", "number?", "string?", "function?", "integer?", "array?", "object?", "collection?", "sequence?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?", "vector?", "grid?", "matrix?"];
|
|
17
17
|
readonly regularExpression: readonly ["regexp", "match", "replace", "replace-all"];
|
|
@@ -63,8 +63,8 @@ export type NormalExpressionName = CoreNormalExpressionName | ModuleExpressionNa
|
|
|
63
63
|
export type FunctionName = NormalExpressionName | SpecialExpressionsApiName;
|
|
64
64
|
export type ShorthandName = typeof api.shorthand[number];
|
|
65
65
|
export type DatatypeName = typeof api.datatype[number];
|
|
66
|
-
declare const coreApiNames: readonly ["filter", "map", "reduce", "count", "get", "contains?", "assoc", "++", "range", "repeat", "flatten", "mapcat", "moving-fn", "running-fn", "nth", "push", "pop", "index-of", "some", "reverse", "first", "second", "last", "rest", "next", "sort", "slice", "take", "take-last", "drop", "drop-last", "take-while", "drop-while", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "|>", "apply", "identity", "comp", "constantly", "doc", "arity", "!=", "==", "<", ">", "<=", ">=", "not", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "
|
|
67
|
-
declare const apiNames: readonly ["filter", "map", "reduce", "count", "get", "contains?", "assoc", "++", "range", "repeat", "flatten", "mapcat", "moving-fn", "running-fn", "nth", "push", "pop", "index-of", "some", "reverse", "first", "second", "last", "rest", "next", "sort", "slice", "take", "take-last", "drop", "drop-last", "take-while", "drop-while", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "|>", "apply", "identity", "comp", "constantly", "doc", "arity", "!=", "==", "<", ">", "<=", ">=", "not", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "import", "json-parse", "json-stringify", "dissoc", "keys", "vals", "entries", "find", "merge", "merge-with", "zipmap", "select-keys", "boolean?", "null?", "number?", "string?", "function?", "integer?", "array?", "object?", "collection?", "sequence?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?", "vector?", "grid?", "matrix?", "regexp", "match", "replace", "replace-all", "str", "number", "lower-case", "upper-case", "trim", "split", "join", "blank?", "<<", ">>", ">>>", "&", "|", "xor", "sum", "mean", "median", "prod", "matrix.mul", "matrix.det", "matrix.inv", "matrix.adj", "matrix.cofactor", "matrix.minor", "matrix.trace", "matrix.symmetric?", "matrix.triangular?", "matrix.upper-triangular?", "matrix.lower-triangular?", "matrix.diagonal?", "matrix.square?", "matrix.orthogonal?", "matrix.identity?", "matrix.invertible?", "matrix.hilbert", "matrix.vandermonde", "matrix.band", "matrix.banded?", "matrix.rank", "matrix.frobenius-norm", "matrix.one-norm", "matrix.inf-norm", "matrix.max-norm", "vector.monotonic?", "vector.strictly-monotonic?", "vector.increasing?", "vector.decreasing?", "vector.strictly-increasing?", "vector.strictly-decreasing?", "vector.median", "vector.mode", "vector.min-index", "vector.max-index", "vector.sort-indices", "vector.count-values", "vector.linspace", "vector.ones", "vector.zeros", "vector.fill", "vector.generate", "vector.cumsum", "vector.cumprod", "vector.quartiles", "vector.percentile", "vector.quantile", "vector.histogram", "vector.ecdf", "vector.outliers?", "vector.outliers", "vector.bincount", "vector.winsorize", "vector.mse", "vector.mae", "vector.rmse", "vector.smape", "vector.mean", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.median", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.variance", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-variance", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sum", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.prod", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.stdev", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-stdev", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.iqr", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.span", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.geometric-mean", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.harmonic-mean", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.skewness", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-skewness", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.excess-kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-excess-kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.rms", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.mad", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.medad", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.gini-coefficient", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.entropy", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.skewness", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "linear-algebra.reflect", "linear-algebra.refract", "linear-algebra.lerp", "linear-algebra.rotate2d", "linear-algebra.rotate3d", "linear-algebra.dot", "linear-algebra.cross", "linear-algebra.normalize-minmax", "linear-algebra.normalize-zscore", "linear-algebra.normalize-robust", "linear-algebra.normalize-l1", "linear-algebra.normalize-l2", "linear-algebra.normalize-log", "linear-algebra.angle", "linear-algebra.projection", "linear-algebra.orthogonal?", "linear-algebra.parallel?", "linear-algebra.collinear?", "linear-algebra.cosine-similarity", "linear-algebra.euclidean-distance", "linear-algebra.euclidean-norm", "linear-algebra.manhattan-distance", "linear-algebra.manhattan-norm", "linear-algebra.hamming-distance", "linear-algebra.hamming-norm", "linear-algebra.chebyshev-distance", "linear-algebra.chebyshev-norm", "linear-algebra.minkowski-distance", "linear-algebra.minkowski-norm", "linear-algebra.cov", "linear-algebra.corr", "linear-algebra.spearman-corr", "linear-algebra.pearson-corr", "linear-algebra.kendall-tau", "linear-algebra.autocorrelation", "linear-algebra.cross-correlation", "linear-algebra.rref", "linear-algebra.solve", "linear-algebra.to-polar", "linear-algebra.from-polar", "grid.every?", "grid.some?", "grid.every-row?", "grid.some-row?", "grid.every-col?", "grid.some-col?", "grid.row", "grid.col", "grid.shape", "grid.fill", "grid.generate", "grid.reshape", "grid.transpose", "grid.flip-h", "grid.flip-v", "grid.rotate", "grid.reverse-rows", "grid.reverse-cols", "grid.slice", "grid.slice-rows", "grid.slice-cols", "grid.splice-rows", "grid.splice-cols", "grid.concat-rows", "grid.concat-cols", "grid.map", "grid.mapi", "grid.reduce", "grid.reducei", "grid.push-rows", "grid.unshift-rows", "grid.pop-row", "grid.shift-row", "grid.push-cols", "grid.unshift-cols", "grid.pop-col", "grid.shift-col", "grid.from-array", "number-theory.abundant-seq", "number-theory.abundant-nth", "number-theory.abundant-take-while", "number-theory.abundant?", "number-theory.arithmetic-seq", "number-theory.arithmetic-nth", "number-theory.arithmetic-take-while", "number-theory.arithmetic?", "number-theory.bell-seq", "number-theory.bell-nth", "number-theory.bell-take-while", "number-theory.bell?", "number-theory.catalan-seq", "number-theory.catalan-nth", "number-theory.catalan-take-while", "number-theory.catalan?", "number-theory.composite-seq", "number-theory.composite-nth", "number-theory.composite-take-while", "number-theory.composite?", "number-theory.deficient-seq", "number-theory.deficient-nth", "number-theory.deficient-take-while", "number-theory.deficient?", "number-theory.factorial-seq", "number-theory.factorial-nth", "number-theory.factorial-take-while", "number-theory.factorial?", "number-theory.fibonacci-seq", "number-theory.fibonacci-nth", "number-theory.fibonacci-take-while", "number-theory.fibonacci?", "number-theory.geometric-seq", "number-theory.geometric-nth", "number-theory.geometric-take-while", "number-theory.geometric?", "number-theory.golomb-seq", "number-theory.golomb-nth", "number-theory.golomb-take-while", "number-theory.golomb?", "number-theory.happy-seq", "number-theory.happy-nth", "number-theory.happy-take-while", "number-theory.happy?", "number-theory.look-and-say-seq", "number-theory.look-and-say-nth", "number-theory.look-and-say-take-while", "number-theory.look-and-say?", "number-theory.lucas-seq", "number-theory.lucas-nth", "number-theory.lucas-take-while", "number-theory.lucas?", "number-theory.lucky-seq", "number-theory.lucky-nth", "number-theory.lucky-take-while", "number-theory.lucky?", "number-theory.mersenne-seq", "number-theory.mersenne-nth", "number-theory.mersenne-take-while", "number-theory.mersenne?", "number-theory.padovan-seq", "number-theory.padovan-nth", "number-theory.padovan-take-while", "number-theory.padovan?", "number-theory.partition-seq", "number-theory.partition-nth", "number-theory.partition-take-while", "number-theory.partition?", "number-theory.pell-seq", "number-theory.pell-nth", "number-theory.pell-take-while", "number-theory.pell?", "number-theory.perfect-seq", "number-theory.perfect-nth", "number-theory.perfect-take-while", "number-theory.perfect?", "number-theory.perfect-cube-seq", "number-theory.perfect-cube-nth", "number-theory.perfect-cube-take-while", "number-theory.perfect-cube?", "number-theory.perfect-power-seq", "number-theory.perfect-power-nth", "number-theory.perfect-power-take-while", "number-theory.perfect-power?", "number-theory.perfect-square-seq", "number-theory.perfect-square-nth", "number-theory.perfect-square-take-while", "number-theory.perfect-square?", "number-theory.polygonal-seq", "number-theory.polygonal-nth", "number-theory.polygonal-take-while", "number-theory.polygonal?", "number-theory.prime-seq", "number-theory.prime-nth", "number-theory.prime-take-while", "number-theory.prime?", "number-theory.recaman-seq", "number-theory.recaman-nth", "number-theory.recaman-take-while", "number-theory.recaman?", "number-theory.sylvester-seq", "number-theory.sylvester-nth", "number-theory.sylvester-take-while", "number-theory.sylvester?", "number-theory.thue-morse-seq", "number-theory.thue-morse-nth", "number-theory.thue-morse-take-while", "number-theory.thue-morse?", "number-theory.tribonacci-seq", "number-theory.tribonacci-nth", "number-theory.tribonacci-take-while", "number-theory.tribonacci?", "number-theory.collatz-seq", "number-theory.juggler-seq", "number-theory.bernoulli-seq", "number-theory.bernoulli-take-while", "number-theory.bernoulli-nth", "number-theory.combinations", "number-theory.count-combinations", "number-theory.derangements", "number-theory.count-derangements", "number-theory.divisors", "number-theory.count-divisors", "number-theory.proper-divisors", "number-theory.count-proper-divisors", "number-theory.prime-factors", "number-theory.count-prime-factors", "number-theory.distinct-prime-factors", "number-theory.count-distinct-prime-factors", "number-theory.factorial", "number-theory.partitions", "number-theory.count-partitions", "number-theory.permutations", "number-theory.count-permutations", "number-theory.power-set", "number-theory.count-power-set", "number-theory.coprime?", "number-theory.divisible-by?", "number-theory.gcd", "number-theory.lcm", "number-theory.multinomial", "number-theory.amicable?", "number-theory.euler-totient", "number-theory.mobius", "number-theory.mertens", "number-theory.sigma", "number-theory.carmichael-lambda", "number-theory.cartesian-product", "number-theory.perfect-power", "number-theory.mod-exp", "number-theory.mod-inv", "number-theory.extended-gcd", "number-theory.chinese-remainder", "number-theory.stirling-first", "number-theory.stirling-second", "random.random!", "random.random-int!", "random.random-int-inclusive!", "random.random-float!", "random.random-boolean!", "random.random-item!", "random.random-sample!", "random.random-sample-unique!", "random.shuffle!", "random.random-normal!", "random.random-exponential!", "random.random-binomial!", "random.random-poisson!", "random.random-gamma!", "random.random-pareto!", "random.uuid!", "random.random-char!", "random.random-string!", "random.random-id!", "random.random-color!", "math.ln", "math.log2", "math.log10", "math.sin", "math.cos", "math.tan", "math.asin", "math.acos", "math.atan", "math.sinh", "math.cosh", "math.tanh", "math.asinh", "math.acosh", "math.atanh", "math.to-rad", "math.to-deg", "functional.juxt", "functional.complement", "functional.every-pred", "functional.some-pred", "functional.fnull", "assert.assert", "assert.assert=", "assert.assert!=", "assert.assert-gt", "assert.assert-lt", "assert.assert-gte", "assert.assert-lte", "assert.assert-true", "assert.assert-false", "assert.assert-truthy", "assert.assert-falsy", "assert.assert-null", "assert.assert-throws", "assert.assert-throws-error", "assert.assert-not-throws", "assert.assert-array", "assert.assert-boolean", "assert.assert-collection", "assert.assert-function", "assert.assert-grid", "assert.assert-integer", "assert.assert-matrix", "assert.assert-number", "assert.assert-object", "assert.assert-regexp", "assert.assert-sequence", "assert.assert-string", "assert.assert-vector", "string.string-repeat", "string.from-char-code", "string.to-char-code", "string.trim-left", "string.trim-right", "string.pad-left", "string.pad-right", "string.split-lines", "string.template", "string.encode-base64", "string.decode-base64", "string.encode-uri-component", "string.decode-uri-component", "string.capitalize", "collection.filteri", "collection.mapi", "collection.reducei", "collection.reduce-right", "collection.reducei-right", "collection.reductions", "collection.reductionsi", "collection.get-in", "collection.assoc-in", "collection.update", "collection.update-in", "collection.not-empty", "collection.every?", "collection.not-every?", "collection.any?", "collection.not-any?", "sequence.position", "sequence.last-index-of", "sequence.shift", "sequence.unshift", "sequence.splice", "sequence.sort-by", "sequence.distinct", "sequence.remove", "sequence.remove-at", "sequence.split-at", "sequence.split-with", "sequence.frequencies", "sequence.group-by", "sequence.partition", "sequence.partition-all", "sequence.partition-by", "sequence.starts-with?", "sequence.ends-with?", "sequence.interleave", "sequence.interpose", "bitwise.bit-not", "bitwise.bit-and-not", "bitwise.bit-flip", "bitwise.bit-clear", "bitwise.bit-set", "bitwise.bit-test", "-short-regexp", "-short-fn", "-type-number", "-type-string", "-type-object", "-type-array", "-type-vector", "-type-matrix", "-type-grid", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-null", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"];
|
|
66
|
+
declare const coreApiNames: readonly ["filter", "map", "reduce", "count", "get", "contains?", "assoc", "++", "range", "repeat", "flatten", "mapcat", "moving-fn", "running-fn", "nth", "push", "pop", "index-of", "some", "reverse", "first", "second", "last", "rest", "next", "sort", "slice", "take", "take-last", "drop", "drop-last", "take-while", "drop-while", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "|>", "apply", "identity", "comp", "constantly", "doc", "arity", "!=", "==", "<", ">", "<=", ">=", "not", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "json-parse", "json-stringify", "dissoc", "keys", "vals", "entries", "find", "merge", "merge-with", "zipmap", "select-keys", "boolean?", "null?", "number?", "string?", "function?", "integer?", "array?", "object?", "collection?", "sequence?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?", "vector?", "grid?", "matrix?", "regexp", "match", "replace", "replace-all", "str", "number", "lower-case", "upper-case", "trim", "split", "join", "blank?", "<<", ">>", ">>>", "&", "|", "xor", "sum", "mean", "median", "prod", "-short-regexp", "-short-fn", "-type-number", "-type-string", "-type-object", "-type-array", "-type-vector", "-type-matrix", "-type-grid", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-null", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"];
|
|
67
|
+
declare const apiNames: readonly ["filter", "map", "reduce", "count", "get", "contains?", "assoc", "++", "range", "repeat", "flatten", "mapcat", "moving-fn", "running-fn", "nth", "push", "pop", "index-of", "some", "reverse", "first", "second", "last", "rest", "next", "sort", "slice", "take", "take-last", "drop", "drop-last", "take-while", "drop-while", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "|>", "apply", "identity", "comp", "constantly", "doc", "arity", "!=", "==", "<", ">", "<=", ">=", "not", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "json-parse", "json-stringify", "dissoc", "keys", "vals", "entries", "find", "merge", "merge-with", "zipmap", "select-keys", "boolean?", "null?", "number?", "string?", "function?", "integer?", "array?", "object?", "collection?", "sequence?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?", "vector?", "grid?", "matrix?", "regexp", "match", "replace", "replace-all", "str", "number", "lower-case", "upper-case", "trim", "split", "join", "blank?", "<<", ">>", ">>>", "&", "|", "xor", "sum", "mean", "median", "prod", "matrix.mul", "matrix.det", "matrix.inv", "matrix.adj", "matrix.cofactor", "matrix.minor", "matrix.trace", "matrix.symmetric?", "matrix.triangular?", "matrix.upper-triangular?", "matrix.lower-triangular?", "matrix.diagonal?", "matrix.square?", "matrix.orthogonal?", "matrix.identity?", "matrix.invertible?", "matrix.hilbert", "matrix.vandermonde", "matrix.band", "matrix.banded?", "matrix.rank", "matrix.frobenius-norm", "matrix.one-norm", "matrix.inf-norm", "matrix.max-norm", "vector.monotonic?", "vector.strictly-monotonic?", "vector.increasing?", "vector.decreasing?", "vector.strictly-increasing?", "vector.strictly-decreasing?", "vector.median", "vector.mode", "vector.min-index", "vector.max-index", "vector.sort-indices", "vector.count-values", "vector.linspace", "vector.ones", "vector.zeros", "vector.fill", "vector.generate", "vector.cumsum", "vector.cumprod", "vector.quartiles", "vector.percentile", "vector.quantile", "vector.histogram", "vector.ecdf", "vector.outliers?", "vector.outliers", "vector.bincount", "vector.winsorize", "vector.mse", "vector.mae", "vector.rmse", "vector.smape", "vector.mean", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.median", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.variance", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-variance", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sum", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.prod", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.stdev", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-stdev", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.iqr", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.span", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.geometric-mean", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.harmonic-mean", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.skewness", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-skewness", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.excess-kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.sample-excess-kurtosis", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.rms", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.mad", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.medad", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.gini-coefficient", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.entropy", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "vector.skewness", `vector.moving-${string}`, `vector.centered-moving-${string}`, `vector.running-${string}`, "linear-algebra.reflect", "linear-algebra.refract", "linear-algebra.lerp", "linear-algebra.rotate2d", "linear-algebra.rotate3d", "linear-algebra.dot", "linear-algebra.cross", "linear-algebra.normalize-minmax", "linear-algebra.normalize-zscore", "linear-algebra.normalize-robust", "linear-algebra.normalize-l1", "linear-algebra.normalize-l2", "linear-algebra.normalize-log", "linear-algebra.angle", "linear-algebra.projection", "linear-algebra.orthogonal?", "linear-algebra.parallel?", "linear-algebra.collinear?", "linear-algebra.cosine-similarity", "linear-algebra.euclidean-distance", "linear-algebra.euclidean-norm", "linear-algebra.manhattan-distance", "linear-algebra.manhattan-norm", "linear-algebra.hamming-distance", "linear-algebra.hamming-norm", "linear-algebra.chebyshev-distance", "linear-algebra.chebyshev-norm", "linear-algebra.minkowski-distance", "linear-algebra.minkowski-norm", "linear-algebra.cov", "linear-algebra.corr", "linear-algebra.spearman-corr", "linear-algebra.pearson-corr", "linear-algebra.kendall-tau", "linear-algebra.autocorrelation", "linear-algebra.cross-correlation", "linear-algebra.rref", "linear-algebra.solve", "linear-algebra.to-polar", "linear-algebra.from-polar", "grid.every?", "grid.some?", "grid.every-row?", "grid.some-row?", "grid.every-col?", "grid.some-col?", "grid.row", "grid.col", "grid.shape", "grid.fill", "grid.generate", "grid.reshape", "grid.transpose", "grid.flip-h", "grid.flip-v", "grid.rotate", "grid.reverse-rows", "grid.reverse-cols", "grid.slice", "grid.slice-rows", "grid.slice-cols", "grid.splice-rows", "grid.splice-cols", "grid.concat-rows", "grid.concat-cols", "grid.map", "grid.mapi", "grid.reduce", "grid.reducei", "grid.push-rows", "grid.unshift-rows", "grid.pop-row", "grid.shift-row", "grid.push-cols", "grid.unshift-cols", "grid.pop-col", "grid.shift-col", "grid.from-array", "number-theory.abundant-seq", "number-theory.abundant-nth", "number-theory.abundant-take-while", "number-theory.abundant?", "number-theory.arithmetic-seq", "number-theory.arithmetic-nth", "number-theory.arithmetic-take-while", "number-theory.arithmetic?", "number-theory.bell-seq", "number-theory.bell-nth", "number-theory.bell-take-while", "number-theory.bell?", "number-theory.catalan-seq", "number-theory.catalan-nth", "number-theory.catalan-take-while", "number-theory.catalan?", "number-theory.composite-seq", "number-theory.composite-nth", "number-theory.composite-take-while", "number-theory.composite?", "number-theory.deficient-seq", "number-theory.deficient-nth", "number-theory.deficient-take-while", "number-theory.deficient?", "number-theory.factorial-seq", "number-theory.factorial-nth", "number-theory.factorial-take-while", "number-theory.factorial?", "number-theory.fibonacci-seq", "number-theory.fibonacci-nth", "number-theory.fibonacci-take-while", "number-theory.fibonacci?", "number-theory.geometric-seq", "number-theory.geometric-nth", "number-theory.geometric-take-while", "number-theory.geometric?", "number-theory.golomb-seq", "number-theory.golomb-nth", "number-theory.golomb-take-while", "number-theory.golomb?", "number-theory.happy-seq", "number-theory.happy-nth", "number-theory.happy-take-while", "number-theory.happy?", "number-theory.look-and-say-seq", "number-theory.look-and-say-nth", "number-theory.look-and-say-take-while", "number-theory.look-and-say?", "number-theory.lucas-seq", "number-theory.lucas-nth", "number-theory.lucas-take-while", "number-theory.lucas?", "number-theory.lucky-seq", "number-theory.lucky-nth", "number-theory.lucky-take-while", "number-theory.lucky?", "number-theory.mersenne-seq", "number-theory.mersenne-nth", "number-theory.mersenne-take-while", "number-theory.mersenne?", "number-theory.padovan-seq", "number-theory.padovan-nth", "number-theory.padovan-take-while", "number-theory.padovan?", "number-theory.partition-seq", "number-theory.partition-nth", "number-theory.partition-take-while", "number-theory.partition?", "number-theory.pell-seq", "number-theory.pell-nth", "number-theory.pell-take-while", "number-theory.pell?", "number-theory.perfect-seq", "number-theory.perfect-nth", "number-theory.perfect-take-while", "number-theory.perfect?", "number-theory.perfect-cube-seq", "number-theory.perfect-cube-nth", "number-theory.perfect-cube-take-while", "number-theory.perfect-cube?", "number-theory.perfect-power-seq", "number-theory.perfect-power-nth", "number-theory.perfect-power-take-while", "number-theory.perfect-power?", "number-theory.perfect-square-seq", "number-theory.perfect-square-nth", "number-theory.perfect-square-take-while", "number-theory.perfect-square?", "number-theory.polygonal-seq", "number-theory.polygonal-nth", "number-theory.polygonal-take-while", "number-theory.polygonal?", "number-theory.prime-seq", "number-theory.prime-nth", "number-theory.prime-take-while", "number-theory.prime?", "number-theory.recaman-seq", "number-theory.recaman-nth", "number-theory.recaman-take-while", "number-theory.recaman?", "number-theory.sylvester-seq", "number-theory.sylvester-nth", "number-theory.sylvester-take-while", "number-theory.sylvester?", "number-theory.thue-morse-seq", "number-theory.thue-morse-nth", "number-theory.thue-morse-take-while", "number-theory.thue-morse?", "number-theory.tribonacci-seq", "number-theory.tribonacci-nth", "number-theory.tribonacci-take-while", "number-theory.tribonacci?", "number-theory.collatz-seq", "number-theory.juggler-seq", "number-theory.bernoulli-seq", "number-theory.bernoulli-take-while", "number-theory.bernoulli-nth", "number-theory.combinations", "number-theory.count-combinations", "number-theory.derangements", "number-theory.count-derangements", "number-theory.divisors", "number-theory.count-divisors", "number-theory.proper-divisors", "number-theory.count-proper-divisors", "number-theory.prime-factors", "number-theory.count-prime-factors", "number-theory.distinct-prime-factors", "number-theory.count-distinct-prime-factors", "number-theory.factorial", "number-theory.partitions", "number-theory.count-partitions", "number-theory.permutations", "number-theory.count-permutations", "number-theory.power-set", "number-theory.count-power-set", "number-theory.coprime?", "number-theory.divisible-by?", "number-theory.gcd", "number-theory.lcm", "number-theory.multinomial", "number-theory.amicable?", "number-theory.euler-totient", "number-theory.mobius", "number-theory.mertens", "number-theory.sigma", "number-theory.carmichael-lambda", "number-theory.cartesian-product", "number-theory.perfect-power", "number-theory.mod-exp", "number-theory.mod-inv", "number-theory.extended-gcd", "number-theory.chinese-remainder", "number-theory.stirling-first", "number-theory.stirling-second", "random.random!", "random.random-int!", "random.random-int-inclusive!", "random.random-float!", "random.random-boolean!", "random.random-item!", "random.random-sample!", "random.random-sample-unique!", "random.shuffle!", "random.random-normal!", "random.random-exponential!", "random.random-binomial!", "random.random-poisson!", "random.random-gamma!", "random.random-pareto!", "random.uuid!", "random.random-char!", "random.random-string!", "random.random-id!", "random.random-color!", "math.ln", "math.log2", "math.log10", "math.sin", "math.cos", "math.tan", "math.asin", "math.acos", "math.atan", "math.sinh", "math.cosh", "math.tanh", "math.asinh", "math.acosh", "math.atanh", "math.to-rad", "math.to-deg", "functional.juxt", "functional.complement", "functional.every-pred", "functional.some-pred", "functional.fnull", "assert.assert", "assert.assert=", "assert.assert!=", "assert.assert-gt", "assert.assert-lt", "assert.assert-gte", "assert.assert-lte", "assert.assert-true", "assert.assert-false", "assert.assert-truthy", "assert.assert-falsy", "assert.assert-null", "assert.assert-throws", "assert.assert-throws-error", "assert.assert-not-throws", "assert.assert-array", "assert.assert-boolean", "assert.assert-collection", "assert.assert-function", "assert.assert-grid", "assert.assert-integer", "assert.assert-matrix", "assert.assert-number", "assert.assert-object", "assert.assert-regexp", "assert.assert-sequence", "assert.assert-string", "assert.assert-vector", "string.string-repeat", "string.from-char-code", "string.to-char-code", "string.trim-left", "string.trim-right", "string.pad-left", "string.pad-right", "string.split-lines", "string.template", "string.encode-base64", "string.decode-base64", "string.encode-uri-component", "string.decode-uri-component", "string.capitalize", "collection.filteri", "collection.mapi", "collection.reducei", "collection.reduce-right", "collection.reducei-right", "collection.reductions", "collection.reductionsi", "collection.get-in", "collection.assoc-in", "collection.update", "collection.update-in", "collection.not-empty", "collection.every?", "collection.not-every?", "collection.any?", "collection.not-any?", "sequence.position", "sequence.last-index-of", "sequence.shift", "sequence.unshift", "sequence.splice", "sequence.sort-by", "sequence.distinct", "sequence.remove", "sequence.remove-at", "sequence.split-at", "sequence.split-with", "sequence.frequencies", "sequence.group-by", "sequence.partition", "sequence.partition-all", "sequence.partition-by", "sequence.starts-with?", "sequence.ends-with?", "sequence.interleave", "sequence.interpose", "bitwise.bit-not", "bitwise.bit-and-not", "bitwise.bit-flip", "bitwise.bit-clear", "bitwise.bit-set", "bitwise.bit-test", "-short-regexp", "-short-fn", "-type-number", "-type-string", "-type-object", "-type-array", "-type-vector", "-type-matrix", "-type-grid", "-type-boolean", "-type-function", "-type-integer", "-type-any", "-type-null", "-type-collection", "-type-sequence", "-type-regexp", "-type-never"];
|
|
68
68
|
export type CoreApiName = typeof coreApiNames[number];
|
|
69
69
|
export type ApiName = typeof apiNames[number];
|
|
70
70
|
export declare function isApiName(arg: string): arg is ApiName;
|
|
@@ -132,7 +132,6 @@ export declare const functionReference: {
|
|
|
132
132
|
"epoch->iso-date": FunctionReference<"string" | "object" | "array" | "special-expression" | "predicate" | "sequence" | "collection" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "vector" | "linear-algebra" | "matrix" | "grid" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
133
133
|
compare: FunctionReference<"string" | "object" | "array" | "special-expression" | "predicate" | "sequence" | "collection" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "vector" | "linear-algebra" | "matrix" | "grid" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
134
134
|
"identical?": FunctionReference<"string" | "object" | "array" | "special-expression" | "predicate" | "sequence" | "collection" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "vector" | "linear-algebra" | "matrix" | "grid" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
135
|
-
import: FunctionReference<"string" | "object" | "array" | "special-expression" | "predicate" | "sequence" | "collection" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "vector" | "linear-algebra" | "matrix" | "grid" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
136
135
|
"json-parse": FunctionReference<"string" | "object" | "array" | "special-expression" | "predicate" | "sequence" | "collection" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "vector" | "linear-algebra" | "matrix" | "grid" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
137
136
|
"json-stringify": FunctionReference<"string" | "object" | "array" | "special-expression" | "predicate" | "sequence" | "collection" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "vector" | "linear-algebra" | "matrix" | "grid" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
138
137
|
dissoc: FunctionReference<"string" | "object" | "array" | "special-expression" | "predicate" | "sequence" | "collection" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "vector" | "linear-algebra" | "matrix" | "grid" | "number-theory" | "random" | "shorthand" | "datatype">;
|
package/dist/src/Lits/Lits.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { TokenStream } from '../tokenizer/tokenize';
|
|
|
5
5
|
import { AutoCompleter } from '../AutoCompleter/AutoCompleter';
|
|
6
6
|
import type { Arity } from '../builtin/interface';
|
|
7
7
|
import type { LitsModule } from '../builtin/modules/interface';
|
|
8
|
+
import type { LitsBundle } from '../bundler/interface';
|
|
8
9
|
import type { MaybePromise } from '../utils/maybePromise';
|
|
9
10
|
import { Cache } from './Cache';
|
|
10
11
|
export interface LitsRuntimeInfo {
|
|
@@ -20,8 +21,7 @@ export interface JsFunction {
|
|
|
20
21
|
export interface ContextParams {
|
|
21
22
|
globalContext?: Context;
|
|
22
23
|
contexts?: Context[];
|
|
23
|
-
|
|
24
|
-
jsFunctions?: Record<string, unknown>;
|
|
24
|
+
bindings?: Record<string, unknown>;
|
|
25
25
|
globalModuleScope?: boolean;
|
|
26
26
|
}
|
|
27
27
|
export interface MinifyParams {
|
|
@@ -44,16 +44,15 @@ export declare class Lits {
|
|
|
44
44
|
constructor(config?: LitsConfig);
|
|
45
45
|
getRuntimeInfo(): LitsRuntimeInfo;
|
|
46
46
|
readonly async: {
|
|
47
|
-
run: (
|
|
48
|
-
context: (programOrAst: string | Ast, params?: ContextParams & FilePathParams) => Promise<Context>;
|
|
47
|
+
run: (programOrBundle: string | LitsBundle, params?: ContextParams & FilePathParams) => Promise<unknown>;
|
|
49
48
|
apply: (fn: LitsFunction, fnParams: unknown[], params?: ContextParams) => Promise<unknown>;
|
|
50
49
|
};
|
|
51
|
-
run(
|
|
52
|
-
|
|
50
|
+
run(programOrBundle: string | LitsBundle, params?: ContextParams & FilePathParams): unknown;
|
|
51
|
+
private runBundle;
|
|
53
52
|
getUndefinedSymbols(programOrAst: string | Ast, params?: ContextParams): Set<string>;
|
|
54
53
|
tokenize(program: string, tokenizeParams?: FilePathParams & MinifyParams): TokenStream;
|
|
55
54
|
parse(tokenStream: TokenStream): Ast;
|
|
56
|
-
evaluate
|
|
55
|
+
private evaluate;
|
|
57
56
|
transformSymbols(tokenStream: TokenStream, transformer: (symbol: string) => string): TokenStream;
|
|
58
57
|
untokenize(tokenStream: TokenStream): string;
|
|
59
58
|
apply(fn: LitsFunction, fnParams: unknown[], params?: ContextParams): MaybePromise<Any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Builtin } from './interface';
|
|
2
2
|
import { specialExpressionTypes } from './specialExpressionTypes';
|
|
3
|
-
export declare const specialExpressions: readonly [import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/qq").QqNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/and").AndNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/or").OrNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/array").ArrayNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/cond").CondNode>, import("./interface").BuiltinSpecialExpression<
|
|
3
|
+
export declare const specialExpressions: readonly [import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/qq").QqNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/and").AndNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/or").OrNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/array").ArrayNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/cond").CondNode>, import("./interface").BuiltinSpecialExpression<boolean, import("./specialExpressions/defined").DefinedNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/block").DoNode>, import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/loops").DoSeqNode>, import("./interface").BuiltinSpecialExpression<import("..").LitsFunction, import("./specialExpressions/functions").LambdaNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/loops").ForNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/if").IfNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/let").LetNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/loop").LoopNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/object").ObjectNode>, import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/recur").RecurNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/switch").SwitchNode>, import("./interface").BuiltinSpecialExpression<null, import("./specialExpressions/throw").ThrowNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/try").TryNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/unless").UnlessNode>, import("./interface").BuiltinSpecialExpression<import("../interface").Any, import("./specialExpressions/import").ImportNode>];
|
|
4
4
|
export type SpecialExpressions = typeof specialExpressions;
|
|
5
5
|
export type SpecialExpression = SpecialExpressions[number];
|
|
6
6
|
export type SpecialExpressionName = keyof typeof specialExpressionTypes;
|
|
@@ -4,19 +4,19 @@ export declare const specialExpressionTypes: {
|
|
|
4
4
|
readonly '||': 2;
|
|
5
5
|
readonly array: 3;
|
|
6
6
|
readonly cond: 4;
|
|
7
|
-
readonly '
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
7
|
+
readonly 'defined?': 5;
|
|
8
|
+
readonly block: 6;
|
|
9
|
+
readonly doseq: 7;
|
|
10
|
+
readonly '0_lambda': 8;
|
|
11
|
+
readonly for: 9;
|
|
12
|
+
readonly if: 10;
|
|
13
|
+
readonly let: 11;
|
|
14
|
+
readonly loop: 12;
|
|
15
|
+
readonly object: 13;
|
|
16
|
+
readonly recur: 14;
|
|
17
|
+
readonly switch: 15;
|
|
18
|
+
readonly throw: 16;
|
|
19
|
+
readonly try: 17;
|
|
20
|
+
readonly unless: 18;
|
|
21
|
+
readonly import: 19;
|
|
22
22
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Any } from '../../interface';
|
|
2
|
+
import type { SpecialExpressionNode } from '../../parser/types';
|
|
3
|
+
import type { BuiltinSpecialExpression } from '../interface';
|
|
4
|
+
import type { specialExpressionTypes } from '../specialExpressionTypes';
|
|
5
|
+
export type ImportNode = SpecialExpressionNode<[typeof specialExpressionTypes['import'], string]>;
|
|
6
|
+
export declare const importSpecialExpression: BuiltinSpecialExpression<Any, ImportNode>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LitsBundle } from './interface';
|
|
2
|
+
/**
|
|
3
|
+
* Bundles a Lits entry file and all its file imports into a LitsBundle.
|
|
4
|
+
*
|
|
5
|
+
* Resolves all `import("./path/to/file.lits")` calls recursively,
|
|
6
|
+
* deduplicates, detects circular dependencies, topologically sorts,
|
|
7
|
+
* and rewrites file imports to bare symbol imports.
|
|
8
|
+
*/
|
|
9
|
+
export declare function bundle(entryPath: string): LitsBundle;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A bundle produced by the bundler. Contains the main program source
|
|
3
|
+
* with file imports rewritten to canonical module names, plus an ordered
|
|
4
|
+
* array of file module sources keyed by canonical name.
|
|
5
|
+
*
|
|
6
|
+
* The bundle is pure JSON — fully serializable and portable
|
|
7
|
+
* (e.g., build on a server, run in a browser).
|
|
8
|
+
*/
|
|
9
|
+
export interface LitsBundle {
|
|
10
|
+
/** The main program source, with file imports rewritten to bare symbols. */
|
|
11
|
+
program: string;
|
|
12
|
+
/** Ordered array of [canonicalName, source] pairs. Dependencies come before dependents. */
|
|
13
|
+
fileModules: [string, string][];
|
|
14
|
+
}
|
|
15
|
+
export declare function isLitsBundle(value: unknown): value is LitsBundle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Any } from '../interface';
|
|
2
2
|
import type { ContextParams } from '../Lits/Lits';
|
|
3
3
|
import type { LitsModule } from '../builtin/modules/interface';
|
|
4
|
-
import { type
|
|
4
|
+
import { type NativeJsFunction, type SymbolNode, type UserDefinedSymbolNode } from '../parser/types';
|
|
5
5
|
import type { SourceCodeInfo } from '../tokenizer/token';
|
|
6
6
|
import type { Context, LookUpResult } from './interface';
|
|
7
7
|
export type ContextStack = ContextStackImpl;
|
|
@@ -11,16 +11,22 @@ export declare class ContextStackImpl {
|
|
|
11
11
|
private values?;
|
|
12
12
|
private nativeJsFunctions?;
|
|
13
13
|
private modules;
|
|
14
|
-
|
|
14
|
+
private valueModules;
|
|
15
|
+
constructor({ contexts, values: hostValues, nativeJsFunctions, modules, valueModules, }: {
|
|
15
16
|
contexts: Context[];
|
|
16
17
|
values?: Record<string, unknown>;
|
|
17
|
-
nativeJsFunctions?:
|
|
18
|
+
nativeJsFunctions?: Record<string, NativeJsFunction>;
|
|
18
19
|
modules?: Map<string, LitsModule>;
|
|
20
|
+
valueModules?: Map<string, unknown>;
|
|
19
21
|
});
|
|
20
22
|
getModule(name: string): LitsModule | undefined;
|
|
23
|
+
getValueModule(name: string): {
|
|
24
|
+
value: unknown;
|
|
25
|
+
found: boolean;
|
|
26
|
+
};
|
|
27
|
+
registerValueModule(name: string, value: unknown): void;
|
|
21
28
|
create(context: Context): ContextStack;
|
|
22
29
|
new(context: Context): ContextStack;
|
|
23
|
-
exportValues(values: Record<string, Any>, sourceCodeInfo: SourceCodeInfo | undefined): void;
|
|
24
30
|
addValues(values: Record<string, Any>, sourceCodeInfo: SourceCodeInfo | undefined): void;
|
|
25
31
|
getValue(name: string): unknown;
|
|
26
32
|
lookUp(node: UserDefinedSymbolNode): LookUpResult;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type { Token, TokenType } from './tokenizer/token';
|
|
|
8
8
|
export { normalExpressionKeys, specialExpressionKeys } from './builtin';
|
|
9
9
|
export { Lits } from './Lits/Lits';
|
|
10
10
|
export type { LitsModule } from './builtin/modules/interface';
|
|
11
|
+
export type { LitsBundle } from './bundler/interface';
|
|
12
|
+
export { isLitsBundle } from './bundler/interface';
|
|
11
13
|
export { type LitsError, isLitsError } from './errors';
|
|
12
14
|
export type { ContextParams, FilePathParams, MinifyParams, LitsRuntimeInfo, JsFunction } from './Lits/Lits';
|
|
13
15
|
export { isGrid, isMatrix, isVector } from './typeGuards/annotatedArrays';
|
|
@@ -5,7 +5,7 @@ export declare class ParserContext {
|
|
|
5
5
|
private readonly tokens;
|
|
6
6
|
private position;
|
|
7
7
|
private storedPosition;
|
|
8
|
-
parseExpression: (precedence?: number
|
|
8
|
+
parseExpression: (precedence?: number) => AstNode;
|
|
9
9
|
constructor(tokenStream: TokenStream);
|
|
10
10
|
advance(): void;
|
|
11
11
|
tryPeek(): Token | undefined;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { TokenStream } from '../tokenizer/tokenize';
|
|
2
2
|
import type { AstNode } from './types';
|
|
3
|
+
import { createParserContext, parseExpression } from './subParsers/parseExpression';
|
|
4
|
+
export { createParserContext, parseExpression };
|
|
3
5
|
export declare function parse(tokenStream: TokenStream): AstNode[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TokenStream } from '../../tokenizer/tokenize';
|
|
2
|
+
import { ParserContext } from '../ParserContext';
|
|
3
|
+
import type { AstNode } from '../types';
|
|
4
|
+
export declare function createParserContext(tokenStream: TokenStream): ParserContext;
|
|
5
|
+
export declare function parseExpression(ctx: ParserContext, precedence?: number): AstNode;
|
|
@@ -29,9 +29,6 @@ export interface NativeJsFunction extends GenericLitsFunction {
|
|
|
29
29
|
}
|
|
30
30
|
export declare function isJsFunction(fn: unknown): fn is JsFunction;
|
|
31
31
|
export declare function assertJsFunction(fn: unknown): asserts fn is JsFunction;
|
|
32
|
-
export interface NativeJsModule {
|
|
33
|
-
[key: string]: NativeJsFunction | NativeJsModule;
|
|
34
|
-
}
|
|
35
32
|
export interface UserDefinedFunction extends GenericLitsFunction {
|
|
36
33
|
functionType: 'UserDefined';
|
|
37
34
|
name: string | undefined;
|