@mojir/lits 2.2.4 → 2.3.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 +2 -1
- package/dist/cli/cli.js +1471 -1126
- package/dist/cli/reference/api.d.ts +5 -5
- package/dist/cli/reference/index.d.ts +8 -2
- package/dist/cli/src/Lits/Lits.d.ts +8 -2
- package/dist/cli/src/builtin/bindingNode.d.ts +2 -1
- package/dist/cli/src/builtin/interface.d.ts +3 -2
- package/dist/cli/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/cli/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/cli/src/evaluator/index.d.ts +3 -2
- package/dist/cli/src/evaluator/interface.d.ts +3 -2
- package/dist/cli/src/tokenizer/operators.d.ts +2 -2
- package/dist/cli/src/utils/maybePromise.d.ts +54 -0
- 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/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/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/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/reference/api.d.ts +5 -5
- package/dist/modules/reference/index.d.ts +8 -2
- 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 +8 -2
- package/dist/modules/src/builtin/bindingNode.d.ts +2 -1
- package/dist/modules/src/builtin/interface.d.ts +3 -2
- package/dist/modules/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/modules/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/modules/src/evaluator/index.d.ts +3 -2
- package/dist/modules/src/evaluator/interface.d.ts +3 -2
- package/dist/modules/src/tokenizer/operators.d.ts +2 -2
- package/dist/modules/src/utils/maybePromise.d.ts +54 -0
- 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 +5 -5
- package/dist/reference/index.d.ts +8 -2
- package/dist/src/Lits/Lits.d.ts +8 -2
- package/dist/src/builtin/bindingNode.d.ts +2 -1
- package/dist/src/builtin/interface.d.ts +3 -2
- package/dist/src/builtin/modules/number-theory/sequences/index.d.ts +2 -1
- package/dist/src/evaluator/functionExecutors.d.ts +2 -1
- package/dist/src/evaluator/index.d.ts +3 -2
- package/dist/src/evaluator/interface.d.ts +3 -2
- package/dist/src/tokenizer/operators.d.ts +2 -2
- package/dist/src/utils/maybePromise.d.ts +54 -0
- 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 +1 -1
|
@@ -4,14 +4,14 @@ export declare const api: {
|
|
|
4
4
|
readonly collection: readonly ["filter", "map", "reduce", "count", "get", "contains?", "assoc", "++"];
|
|
5
5
|
readonly collectionUtils: readonly ["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?"];
|
|
6
6
|
readonly array: readonly ["range", "repeat", "flatten", "mapcat", "moving-fn", "running-fn"];
|
|
7
|
-
readonly sequence: readonly ["nth", "push", "pop", "index-of", "some", "reverse", "first", "second", "last", "rest", "next", "sort", "slice"];
|
|
8
|
-
readonly sequenceUtils: readonly ["sequence.position", "sequence.last-index-of", "sequence.shift", "sequence.unshift", "sequence.splice", "sequence.sort-by", "sequence.
|
|
7
|
+
readonly sequence: readonly ["nth", "push", "pop", "index-of", "some", "reverse", "first", "second", "last", "rest", "next", "sort", "slice", "take", "take-last", "drop", "drop-last", "take-while", "drop-while"];
|
|
8
|
+
readonly sequenceUtils: readonly ["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"];
|
|
9
9
|
readonly math: readonly ["+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign"];
|
|
10
10
|
readonly mathUtils: readonly ["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"];
|
|
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 ["
|
|
14
|
+
readonly misc: readonly ["!=", "==", "<", ">", "<=", ">=", "not", "write!", "iso-date->epoch", "epoch->iso-date", "boolean", "compare", "identical?", "import", "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", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "|>", "apply", "identity", "comp", "constantly", "doc", "arity", "
|
|
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", "+", "-", "*", "/", "mod", "%", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "|>", "apply", "identity", "comp", "constantly", "doc", "arity", "≠", "==", "<", ">", "<=", ">=", "!", "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.take", "sequence.take-last", "sequence.take-while", "sequence.drop", "sequence.drop-last", "sequence.drop-while", "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?", "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", "-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?", "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"];
|
|
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;
|
|
@@ -61,7 +61,7 @@ export declare const functionReference: {
|
|
|
61
61
|
">": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
62
62
|
">=": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
63
63
|
"==": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
64
|
-
"
|
|
64
|
+
"!=": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
65
65
|
"&": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
66
66
|
xor: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
67
67
|
"|": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
@@ -125,7 +125,7 @@ export declare const functionReference: {
|
|
|
125
125
|
arity: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
126
126
|
"identical?": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
127
127
|
compare: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
128
|
-
|
|
128
|
+
not: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
129
129
|
"epoch->iso-date": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
130
130
|
"iso-date->epoch": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
131
131
|
"write!": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
@@ -165,6 +165,12 @@ export declare const functionReference: {
|
|
|
165
165
|
"replace-all": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
166
166
|
last: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
167
167
|
next: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
168
|
+
take: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
169
|
+
drop: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
170
|
+
"take-last": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
171
|
+
"take-while": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
172
|
+
"drop-last": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
173
|
+
"drop-while": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
168
174
|
"lower-case": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
169
175
|
"upper-case": FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
170
176
|
sum: FunctionReference<"string" | "object" | "array" | "vector" | "matrix" | "grid" | "collection" | "sequence" | "special-expression" | "predicate" | "math" | "functional" | "regular-expression" | "bitwise" | "misc" | "meta" | "assert" | "linear-algebra" | "number-theory" | "random" | "shorthand" | "datatype">;
|
|
@@ -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 { MaybePromise } from '../utils/maybePromise';
|
|
8
9
|
import { Cache } from './Cache';
|
|
9
10
|
export interface LitsRuntimeInfo {
|
|
10
11
|
astCache: Cache | null;
|
|
@@ -42,15 +43,20 @@ export declare class Lits {
|
|
|
42
43
|
private modules;
|
|
43
44
|
constructor(config?: LitsConfig);
|
|
44
45
|
getRuntimeInfo(): LitsRuntimeInfo;
|
|
46
|
+
readonly async: {
|
|
47
|
+
run: (program: string, params?: ContextParams & FilePathParams) => Promise<unknown>;
|
|
48
|
+
context: (programOrAst: string | Ast, params?: ContextParams & FilePathParams) => Promise<Context>;
|
|
49
|
+
apply: (fn: LitsFunction, fnParams: unknown[], params?: ContextParams) => Promise<unknown>;
|
|
50
|
+
};
|
|
45
51
|
run(program: string, params?: ContextParams & FilePathParams): unknown;
|
|
46
52
|
context(programOrAst: string | Ast, params?: ContextParams & FilePathParams): Context;
|
|
47
53
|
getUndefinedSymbols(programOrAst: string | Ast, params?: ContextParams): Set<string>;
|
|
48
54
|
tokenize(program: string, tokenizeParams?: FilePathParams & MinifyParams): TokenStream;
|
|
49
55
|
parse(tokenStream: TokenStream): Ast;
|
|
50
|
-
evaluate(ast: Ast, params: ContextParams): Any
|
|
56
|
+
evaluate(ast: Ast, params: ContextParams): MaybePromise<Any>;
|
|
51
57
|
transformSymbols(tokenStream: TokenStream, transformer: (symbol: string) => string): TokenStream;
|
|
52
58
|
untokenize(tokenStream: TokenStream): string;
|
|
53
|
-
apply(fn: LitsFunction, fnParams: unknown[], params?: ContextParams): Any
|
|
59
|
+
apply(fn: LitsFunction, fnParams: unknown[], params?: ContextParams): MaybePromise<Any>;
|
|
54
60
|
private generateApplyFunctionCall;
|
|
55
61
|
private generateAst;
|
|
56
62
|
getAutoCompleter(program: string, position: number, params?: ContextParams): AutoCompleter;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Any } from '../interface';
|
|
2
2
|
import { type AstNode, type BindingTarget } from '../parser/types';
|
|
3
|
+
import type { MaybePromise } from '../utils/maybePromise';
|
|
3
4
|
export declare function walkDefaults(bindingTarget: BindingTarget, onDefault: (Node: AstNode) => void): void;
|
|
4
|
-
export declare function evaluateBindingNodeValues(target: BindingTarget, value: Any, evaluate: (Node: AstNode) => Any): Record<string, Any
|
|
5
|
+
export declare function evaluateBindingNodeValues(target: BindingTarget, value: Any, evaluate: (Node: AstNode) => MaybePromise<Any>): MaybePromise<Record<string, Any>>;
|
|
5
6
|
export declare function getAllBindingTargetNames(bindingTarget: BindingTarget): Record<string, true>;
|
|
@@ -4,6 +4,7 @@ import type { GetUndefinedSymbols, UndefinedSymbols } from '../getUndefinedSymbo
|
|
|
4
4
|
import type { Any, Arr } from '../interface';
|
|
5
5
|
import type { SpecialExpressionNode } from '../parser/types';
|
|
6
6
|
import type { SourceCodeInfo } from '../tokenizer/token';
|
|
7
|
+
import type { MaybePromise } from '../utils/maybePromise';
|
|
7
8
|
import type { SpecialExpressions } from '.';
|
|
8
9
|
export type Arity = {
|
|
9
10
|
min?: number;
|
|
@@ -76,7 +77,7 @@ export type SpecialExpressionDocs = FunctionDocs | CustomDocs;
|
|
|
76
77
|
export declare function isFunctionDocs(docs: SpecialExpressionDocs): docs is FunctionDocs;
|
|
77
78
|
type NormalExpressionEvaluator<T> = (params: Arr, sourceCodeInfo: SourceCodeInfo | undefined, contextStack: ContextStack, { executeFunction }: {
|
|
78
79
|
executeFunction: ExecuteFunction;
|
|
79
|
-
}) => T
|
|
80
|
+
}) => MaybePromise<T>;
|
|
80
81
|
export interface BuiltinNormalExpression<T> {
|
|
81
82
|
evaluate: NormalExpressionEvaluator<T>;
|
|
82
83
|
name?: string;
|
|
@@ -91,7 +92,7 @@ interface EvaluateHelpers {
|
|
|
91
92
|
getUndefinedSymbols: GetUndefinedSymbols;
|
|
92
93
|
}
|
|
93
94
|
export interface BuiltinSpecialExpression<T, N extends SpecialExpressionNode> {
|
|
94
|
-
evaluate: (node: N, contextStack: ContextStack, helpers: EvaluateHelpers) => T
|
|
95
|
+
evaluate: (node: N, contextStack: ContextStack, helpers: EvaluateHelpers) => MaybePromise<T>;
|
|
95
96
|
evaluateAsNormalExpression?: NormalExpressionEvaluator<T>;
|
|
96
97
|
arity: Arity;
|
|
97
98
|
docs?: SpecialExpressionDocs;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { SourceCodeInfo } from '../../../../tokenizer/token';
|
|
2
|
+
import type { MaybePromise } from '../../../../utils/maybePromise';
|
|
2
3
|
import type { BuiltinNormalExpression, BuiltinNormalExpressions } from '../../../../builtin/interface';
|
|
3
4
|
type SeqKey<T extends string> = `${T}-seq`;
|
|
4
5
|
type TakeWhileKey<T extends string> = `${T}-take-while`;
|
|
5
6
|
type NthKey<T extends string> = `${T}-nth`;
|
|
6
7
|
type PredKey<T extends string> = `${T}?`;
|
|
7
8
|
type SeqFunction<Type extends number | string> = (length: number, sourceCodeInfo: SourceCodeInfo | undefined) => Type[];
|
|
8
|
-
type TakeWhileFunction<Type extends number | string> = (pred: (value: Type, index: number) => boolean
|
|
9
|
+
type TakeWhileFunction<Type extends number | string> = (pred: (value: Type, index: number) => MaybePromise<boolean>, sourceCodeInfo: SourceCodeInfo | undefined) => MaybePromise<Type[]>;
|
|
9
10
|
type PredFunction<Type extends number | string> = (n: Type, sourceCodeInfo: SourceCodeInfo | undefined) => boolean;
|
|
10
11
|
export type SequenceKeys<T extends string> = SeqKey<T> | TakeWhileKey<T> | NthKey<T> | PredKey<T>;
|
|
11
12
|
export type SequenceDefinition<T extends string, Type extends number | string = number> = {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Any, Arr } from '../interface';
|
|
2
2
|
import type { LitsFunctionType } from '../parser/types';
|
|
3
3
|
import type { SourceCodeInfo } from '../tokenizer/token';
|
|
4
|
+
import type { MaybePromise } from '../utils/maybePromise';
|
|
4
5
|
import type { ContextStack } from './ContextStack';
|
|
5
6
|
import type { EvaluateNode, ExecuteFunction } from './interface';
|
|
6
7
|
type FunctionExecutors = Record<LitsFunctionType, (fn: any, params: Arr, sourceCodeInfo: SourceCodeInfo | undefined, contextStack: ContextStack, helpers: {
|
|
7
8
|
evaluateNode: EvaluateNode;
|
|
8
9
|
executeFunction: ExecuteFunction;
|
|
9
|
-
}) => Any
|
|
10
|
+
}) => MaybePromise<Any>>;
|
|
10
11
|
export declare const functionExecutors: FunctionExecutors;
|
|
11
12
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Any } from '../interface';
|
|
2
2
|
import type { Ast, AstNode } from '../parser/types';
|
|
3
|
+
import type { MaybePromise } from '../utils/maybePromise';
|
|
3
4
|
import type { ContextStack } from './ContextStack';
|
|
4
|
-
export declare function evaluate(ast: Ast, contextStack: ContextStack): Any
|
|
5
|
-
export declare function evaluateNode(node: AstNode, contextStack: ContextStack): Any
|
|
5
|
+
export declare function evaluate(ast: Ast, contextStack: ContextStack): MaybePromise<Any>;
|
|
6
|
+
export declare function evaluateNode(node: AstNode, contextStack: ContextStack): MaybePromise<Any>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Any, Arr } from '../interface';
|
|
2
2
|
import type { AstNode, FunctionLike } from '../parser/types';
|
|
3
3
|
import type { SourceCodeInfo } from '../tokenizer/token';
|
|
4
|
+
import type { MaybePromise } from '../utils/maybePromise';
|
|
4
5
|
import type { ContextStack } from './ContextStack';
|
|
5
6
|
interface ContextEntry {
|
|
6
7
|
value: Any;
|
|
7
8
|
}
|
|
8
9
|
export type Context = Record<string, ContextEntry>;
|
|
9
|
-
export type EvaluateNode = (node: AstNode, contextStack: ContextStack) => Any
|
|
10
|
-
export type ExecuteFunction = (fn: FunctionLike, params: Arr, contextStack: ContextStack, sourceCodeInfo?: SourceCodeInfo) => Any
|
|
10
|
+
export type EvaluateNode = (node: AstNode, contextStack: ContextStack) => MaybePromise<Any>;
|
|
11
|
+
export type ExecuteFunction = (fn: FunctionLike, params: Arr, contextStack: ContextStack, sourceCodeInfo?: SourceCodeInfo) => MaybePromise<Any>;
|
|
11
12
|
export type LookUpResult = ContextEntry | null;
|
|
12
13
|
export declare function isContextEntry(value: unknown): value is ContextEntry;
|
|
13
14
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const binaryOperators: readonly ["^", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", "≤", ">", ">=", "≥", "==", "!=", "
|
|
2
|
-
declare const symbolicOperators: readonly ["^", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", "≤", ">", ">=", "≥", "==", "!=", "
|
|
1
|
+
declare const binaryOperators: readonly ["^", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", "≤", ">", ">=", "≥", "==", "!=", "!=", "&", "xor", "|", "&&", "||", "??", "|>"];
|
|
2
|
+
declare const symbolicOperators: readonly ["^", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "++", "<", "<=", "≤", ">", ">=", "≥", "==", "!=", "!=", "&", "xor", "|", "&&", "||", "??", "|>", "?", ":", "->", "...", ".", ",", "=", ":", ";"];
|
|
3
3
|
export declare function isFunctionOperator(operator: string): boolean;
|
|
4
4
|
export type SymbolicBinaryOperator = typeof binaryOperators[number];
|
|
5
5
|
export type SymbolicOperator = typeof symbolicOperators[number];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MaybePromise utilities for transparent async support.
|
|
3
|
+
*
|
|
4
|
+
* The sync path stays zero-overhead — when no async JS functions are involved,
|
|
5
|
+
* everything runs synchronously with only `instanceof Promise` checks as overhead.
|
|
6
|
+
* When an async value is detected, the evaluation chain switches to Promise-based
|
|
7
|
+
* execution for the remainder.
|
|
8
|
+
*/
|
|
9
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Chain a value that might be a Promise. If the value is sync, calls fn synchronously.
|
|
12
|
+
* If it's a Promise, chains with .then().
|
|
13
|
+
*/
|
|
14
|
+
export declare function chain<T, U>(value: MaybePromise<T>, fn: (v: T) => MaybePromise<U>): MaybePromise<U>;
|
|
15
|
+
/**
|
|
16
|
+
* Like Array.map but handles MaybePromise callbacks sequentially.
|
|
17
|
+
* In the sync case, runs as a simple loop. Switches to async only when needed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function mapSequential<T, U>(arr: readonly T[], fn: (elem: T, index: number) => MaybePromise<U>): MaybePromise<U[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Like Array.reduce but handles MaybePromise callbacks sequentially.
|
|
22
|
+
* In the sync case, runs as a simple loop. Switches to async only when needed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function reduceSequential<T, U>(arr: readonly T[], fn: (acc: U, elem: T, index: number) => MaybePromise<U>, initial: U): MaybePromise<U>;
|
|
25
|
+
/**
|
|
26
|
+
* Like Array.forEach but handles MaybePromise callbacks sequentially.
|
|
27
|
+
* In the sync case, runs as a simple loop. Switches to async only when needed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function forEachSequential<T>(arr: readonly T[], fn: (elem: T, index: number) => MaybePromise<void>): MaybePromise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Try/catch that handles MaybePromise values correctly.
|
|
32
|
+
* If tryFn returns a Promise, catches both sync throws and Promise rejections.
|
|
33
|
+
*/
|
|
34
|
+
export declare function tryCatch<T>(tryFn: () => MaybePromise<T>, catchFn: (error: unknown) => MaybePromise<T>): MaybePromise<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Like Array.some but handles MaybePromise callbacks sequentially.
|
|
37
|
+
* Returns the first truthy MaybePromise result, or false.
|
|
38
|
+
*/
|
|
39
|
+
export declare function someSequential<T>(arr: readonly T[], fn: (elem: T, index: number) => MaybePromise<unknown>): MaybePromise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Like Array.every but handles MaybePromise callbacks sequentially.
|
|
42
|
+
* Returns false as soon as a falsy result is found.
|
|
43
|
+
*/
|
|
44
|
+
export declare function everySequential<T>(arr: readonly T[], fn: (elem: T, index: number) => MaybePromise<unknown>): MaybePromise<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Like Array.filter but handles MaybePromise callbacks sequentially.
|
|
47
|
+
* Returns the filtered array.
|
|
48
|
+
*/
|
|
49
|
+
export declare function filterSequential<T>(arr: readonly T[], fn: (elem: T, index: number) => MaybePromise<unknown>): MaybePromise<T[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Like Array.findIndex but handles MaybePromise callbacks sequentially.
|
|
52
|
+
* Returns -1 if no element matches.
|
|
53
|
+
*/
|
|
54
|
+
export declare function findIndexSequential<T>(arr: readonly T[], fn: (elem: T, index: number) => MaybePromise<unknown>): MaybePromise<number>;
|