@mojir/lits 2.1.7 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/cli/cli.js +382 -30
  2. package/dist/cli/reference/api.d.ts +3 -3
  3. package/dist/cli/reference/index.d.ts +6 -0
  4. package/dist/cli/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/dot.d.ts +1 -0
  5. package/dist/cli/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/getUnit.d.ts +2 -0
  6. package/dist/cli/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/scale.d.ts +1 -0
  7. package/dist/cli/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/subtract.d.ts +1 -0
  8. package/dist/cli/src/typeGuards/annotatedArrays.d.ts +4 -0
  9. package/dist/cli/src/utils/index.d.ts +1 -1
  10. package/dist/index.esm.js +381 -29
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist/index.js +381 -29
  13. package/dist/index.js.map +1 -1
  14. package/dist/lits.iife.js +381 -29
  15. package/dist/lits.iife.js.map +1 -1
  16. package/dist/reference/api.d.ts +3 -3
  17. package/dist/reference/index.d.ts +6 -0
  18. package/dist/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/dot.d.ts +1 -0
  19. package/dist/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/getUnit.d.ts +2 -0
  20. package/dist/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/scale.d.ts +1 -0
  21. package/dist/src/builtin/normalExpressions/categories/namespaces/linearAlgebra/helpers/subtract.d.ts +1 -0
  22. package/dist/src/typeGuards/annotatedArrays.d.ts +4 -0
  23. package/dist/src/utils/index.d.ts +1 -1
  24. package/dist/testFramework.esm.js +194 -28
  25. package/dist/testFramework.esm.js.map +1 -1
  26. package/dist/testFramework.js +194 -28
  27. package/dist/testFramework.js.map +1 -1
  28. package/package.json +1 -1
@@ -12,10 +12,10 @@ export declare const api: {
12
12
  readonly string: readonly ["string-repeat", "str", "number", "lower-case", "upper-case", "trim", "trim-left", "trim-right", "pad-left", "pad-right", "split", "split-lines", "template", "to-char-code", "from-char-code", "encode-base64", "decode-base64", "encode-uri-component", "decode-uri-component", "join", "capitalize", "blank?"];
13
13
  readonly bitwise: readonly ["<<", ">>", ">>>", "bit-not", "&", "bit-and-not", "|", "xor", "bit-flip", "bit-clear", "bit-set", "bit-test"];
14
14
  readonly assert: readonly ["assert", "assert=", "assert!=", "assert-gt", "assert-lt", "assert-gte", "assert-lte", "assert-true", "assert-false", "assert-truthy", "assert-falsy", "assert-null", "assert-throws", "assert-throws-error", "assert-not-throws"];
15
- readonly grid: readonly ["grid:every?", "grid:some?", "grid:every-row?", "grid:some-row?", "grid:every-col?", "grid:some-col?", "grid:row", "grid:col", "grid:shape", "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"];
15
+ readonly grid: readonly ["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"];
16
16
  readonly matrix: readonly ["mat:mul", "mat:det", "mat:inv", "mat:adj", "mat:cofactor", "mat:minor", "mat:trace", "mat:symmetric?", "mat:triangular?", "mat:upper-triangular?", "mat:lower-triangular?", "mat:diagonal?", "mat:square?", "mat:orthogonal?", "mat:identity?", "mat:invertible?", "mat:hilbert", "mat:vandermonde", "mat:band", "mat:banded?", "mat:rank", "mat:frobenius-norm", "mat:1-norm", "mat:inf-norm", "mat:max-norm"];
17
17
  readonly vector: readonly ["vec:monotonic?", "vec:strictly-monotonic?", "vec:increasing?", "vec:decreasing?", "vec:strictly-increasing?", "vec:strictly-decreasing?", "vec:median", "vec:mode", "vec:min-index", "vec:max-index", "vec:sort-indices", "vec:count-values", "vec:linspace", "vec:ones", "vec:zeros", "vec:fill", "vec:generate", "vec:cumsum", "vec:cumprod", "vec:quartiles", "vec:percentile", "vec:quantile", "vec:histogram", "vec:ecdf", "vec:outliers?", "vec:outliers", "vec:bincount", "vec:winsorize", "vec:mse", "vec:mae", "vec:rmse", "vec:smape", "vec:mean", "vec:moving-mean", "vec:centered-moving-mean", "vec:running-mean", "vec:median", "vec:moving-median", "vec:centered-moving-median", "vec:running-median", "vec:variance", "vec:moving-variance", "vec:centered-moving-variance", "vec:running-variance", "vec:sample-variance", "vec:moving-sample-variance", "vec:centered-moving-sample-variance", "vec:running-sample-variance", "vec:sum", "vec:moving-sum", "vec:centered-moving-sum", "vec:running-sum", "vec:prod", "vec:moving-prod", "vec:centered-moving-prod", "vec:running-prod", "vec:min", "vec:moving-min", "vec:centered-moving-min", "vec:running-min", "vec:max", "vec:moving-max", "vec:centered-moving-max", "vec:running-max", "vec:stdev", "vec:moving-stdev", "vec:centered-moving-stdev", "vec:running-stdev", "vec:sample-stdev", "vec:moving-sample-stdev", "vec:centered-moving-sample-stdev", "vec:running-sample-stdev", "vec:iqr", "vec:moving-iqr", "vec:centered-moving-iqr", "vec:running-iqr", "vec:span", "vec:moving-span", "vec:centered-moving-span", "vec:running-span", "vec:geometric-mean", "vec:moving-geometric-mean", "vec:centered-moving-geometric-mean", "vec:running-geometric-mean", "vec:harmonic-mean", "vec:moving-harmonic-mean", "vec:centered-moving-harmonic-mean", "vec:running-harmonic-mean", "vec:skewness", "vec:moving-skewness", "vec:centered-moving-skewness", "vec:running-skewness", "vec:sample-skewness", "vec:moving-sample-skewness", "vec:centered-moving-sample-skewness", "vec:running-sample-skewness", "vec:kurtosis", "vec:moving-kurtosis", "vec:centered-moving-kurtosis", "vec:running-kurtosis", "vec:sample-kurtosis", "vec:moving-sample-kurtosis", "vec:centered-moving-sample-kurtosis", "vec:running-sample-kurtosis", "vec:excess-kurtosis", "vec:moving-excess-kurtosis", "vec:centered-moving-excess-kurtosis", "vec:running-excess-kurtosis", "vec:sample-excess-kurtosis", "vec:moving-sample-excess-kurtosis", "vec:centered-moving-sample-excess-kurtosis", "vec:running-sample-excess-kurtosis", "vec:rms", "vec:moving-rms", "vec:centered-moving-rms", "vec:running-rms", "vec:mad", "vec:moving-mad", "vec:centered-moving-mad", "vec:running-mad", "vec:medad", "vec:moving-medad", "vec:centered-moving-medad", "vec:running-medad", "vec:gini-coefficient", "vec:moving-gini-coefficient", "vec:centered-moving-gini-coefficient", "vec:running-gini-coefficient", "vec:entropy", "vec:moving-entropy", "vec:centered-moving-entropy", "vec:running-entropy", "vec:skewness", "vec:moving-skewness", "vec:centered-moving-skewness", "vec:running-skewness"];
18
- readonly linAlg: readonly ["lin:dot", "lin:cross", "lin:normalize-minmax", "lin:normalize-zscore", "lin:normalize-robust", "lin:normalize-l1", "lin:normalize-l2", "lin:normalize-log", "lin:angle", "lin:projection", "lin:orthogonal?", "lin:parallel?", "lin:collinear?", "lin:cosine-similarity", "lin:euclidean-distance", "lin:euclidean-norm", "lin:manhattan-distance", "lin:manhattan-norm", "lin:hamming-distance", "lin:hamming-norm", "lin:chebyshev-distance", "lin:chebyshev-norm", "lin:minkowski-distance", "lin:minkowski-norm", "lin:cov", "lin:corr", "lin:spearman-corr", "lin:pearson-corr", "lin:kendall-tau", "lin:autocorrelation", "lin:cross-correlation", "lin:rref", "lin:solve"];
18
+ readonly linAlg: readonly ["lin:reflect", "lin:refract", "lin:lerp", "lin:rotate2d", "lin:rotate3d", "lin:dot", "lin:cross", "lin:normalize-minmax", "lin:normalize-zscore", "lin:normalize-robust", "lin:normalize-l1", "lin:normalize-l2", "lin:normalize-log", "lin:angle", "lin:projection", "lin:orthogonal?", "lin:parallel?", "lin:collinear?", "lin:cosine-similarity", "lin:euclidean-distance", "lin:euclidean-norm", "lin:manhattan-distance", "lin:manhattan-norm", "lin:hamming-distance", "lin:hamming-norm", "lin:chebyshev-distance", "lin:chebyshev-norm", "lin:minkowski-distance", "lin:minkowski-norm", "lin:cov", "lin:corr", "lin:spearman-corr", "lin:pearson-corr", "lin:kendall-tau", "lin:autocorrelation", "lin:cross-correlation", "lin:rref", "lin:solve"];
19
19
  readonly numberTheory: readonly ["nth:abundant-seq", "nth:abundant-nth", "nth:abundant-take-while", "nth:abundant?", "nth:bell-seq", "nth:bell-nth", "nth:bell-take-while", "nth:bell?", "nth:catalan-seq", "nth:catalan-nth", "nth:catalan-take-while", "nth:catalan?", "nth:composite-seq", "nth:composite-nth", "nth:composite-take-while", "nth:composite?", "nth:factorial-seq", "nth:factorial-nth", "nth:factorial-take-while", "nth:factorial?", "nth:fibonacci-seq", "nth:fibonacci-nth", "nth:fibonacci-take-while", "nth:fibonacci?", "nth:geometric-seq", "nth:geometric-nth", "nth:geometric-take-while", "nth:geometric?", "nth:golomb-seq", "nth:golomb-nth", "nth:golomb-take-while", "nth:golomb?", "nth:happy-seq", "nth:happy-nth", "nth:happy-take-while", "nth:happy?", "nth:look-and-say-seq", "nth:look-and-say-nth", "nth:look-and-say-take-while", "nth:look-and-say?", "nth:lucas-seq", "nth:lucas-nth", "nth:lucas-take-while", "nth:lucas?", "nth:lucky-seq", "nth:lucky-nth", "nth:lucky-take-while", "nth:lucky?", "nth:mersenne-seq", "nth:mersenne-nth", "nth:mersenne-take-while", "nth:mersenne?", "nth:padovan-seq", "nth:padovan-nth", "nth:padovan-take-while", "nth:padovan?", "nth:partition-seq", "nth:partition-nth", "nth:partition-take-while", "nth:partition?", "nth:pell-seq", "nth:pell-nth", "nth:pell-take-while", "nth:pell?", "nth:perfect-seq", "nth:perfect-nth", "nth:perfect-take-while", "nth:perfect?", "nth:perfect-cube-seq", "nth:perfect-cube-nth", "nth:perfect-cube-take-while", "nth:perfect-cube?", "nth:perfect-power-seq", "nth:perfect-power-nth", "nth:perfect-power-take-while", "nth:perfect-power?", "nth:perfect-square-seq", "nth:perfect-square-nth", "nth:perfect-square-take-while", "nth:perfect-square?", "nth:polygonal-seq", "nth:polygonal-nth", "nth:polygonal-take-while", "nth:polygonal?", "nth:prime-seq", "nth:prime-nth", "nth:prime-take-while", "nth:prime?", "nth:recaman-seq", "nth:recaman-nth", "nth:recaman-take-while", "nth:recaman?", "nth:sylvester-seq", "nth:sylvester-nth", "nth:sylvester-take-while", "nth:sylvester?", "nth:thue-morse-seq", "nth:thue-morse-nth", "nth:thue-morse-take-while", "nth:thue-morse?", "nth:tribonacci-seq", "nth:tribonacci-nth", "nth:tribonacci-take-while", "nth:tribonacci?", "nth:collatz-seq", "nth:juggler-seq", "nth:bernoulli-seq", "nth:bernoulli-take-while", "nth:bernoulli-nth", "nth:combinations", "nth:count-combinations", "nth:derangements", "nth:count-derangements", "nth:divisors", "nth:count-divisors", "nth:proper-divisors", "nth:count-proper-divisors", "nth:prime-factors", "nth:count-prime-factors", "nth:distinct-prime-factors", "nth:count-distinct-prime-factors", "nth:factorial", "nth:partitions", "nth:count-partitions", "nth:permutations", "nth:count-permutations", "nth:power-set", "nth:count-power-set", "nth:coprime?", "nth:divisible-by?", "nth:gcd", "nth:lcm", "nth:multinomial", "nth:amicable?", "nth:euler-totient", "nth:mobius", "nth:mertens", "nth:sigma", "nth:carmichael-lambda", "nth:cartesian-product", "nth:perfect-power", "nth:mod-exp", "nth:mod-inv", "nth:extended-gcd", "nth:chinese-remainder", "nth:stirling-first", "nth:stirling-second"];
20
20
  readonly random: readonly ["!:random", "!:random-int", "!:random-int-inclusive", "!:random-float", "!:random-boolean", "!:random-item", "!:random-sample", "!:random-sample-unique", "!:shuffle", "!:random-normal", "!:random-exponential", "!:random-binomial", "!:random-poisson", "!:random-gamma", "!:random-pareto", "!:uuid", "!:random-char", "!:random-string", "!:random-id", "!:random-color"];
21
21
  readonly shorthand: ["-short-regexp", "-short-fn"];
@@ -44,7 +44,7 @@ export type NormalExpressionName = CollectionApiName | ArrayApiName | SequenceAp
44
44
  export type FunctionName = NormalExpressionName | SpecialExpressionsApiName;
45
45
  export type ShorthandName = typeof api.shorthand[number];
46
46
  export type DatatypeName = typeof api.datatype[number];
47
- declare const apiNames: readonly ["filter", "map", "reduce", "reduce-right", "reductions", "count", "get", "get-in", "contains?", "assoc", "assoc-in", "++", "not-empty", "every?", "not-every?", "any?", "not-any?", "update", "update-in", "range", "repeat", "flatten", "mapcat", "nth", "push", "pop", "unshift", "shift", "slice", "splice", "position", "index-of", "last-index-of", "some", "reverse", "first", "second", "last", "rest", "next", "take", "take-last", "take-while", "drop", "drop-last", "drop-while", "sort", "sort-by", "distinct", "remove", "remove-at", "split-at", "split-with", "frequencies", "group-by", "partition", "partition-all", "partition-by", "starts-with?", "ends-with?", "interleave", "interpose", "+", "-", "*", "/", "~", "mod", "rem", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "ln", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "|>", "apply", "identity", "comp", "constantly", "juxt", "complement", "every-pred", "some-pred", "fnull", "≠", "=", "<", ">", "≤", "≥", "!", "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?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?", "vector?", "grid?", "matrix?", "regexp", "match", "replace", "replace-all", "string-repeat", "str", "number", "lower-case", "upper-case", "trim", "trim-left", "trim-right", "pad-left", "pad-right", "split", "split-lines", "template", "to-char-code", "from-char-code", "encode-base64", "decode-base64", "encode-uri-component", "decode-uri-component", "join", "capitalize", "blank?", "<<", ">>", ">>>", "bit-not", "&", "bit-and-not", "|", "xor", "bit-flip", "bit-clear", "bit-set", "bit-test", "assert", "assert=", "assert!=", "assert-gt", "assert-lt", "assert-gte", "assert-lte", "assert-true", "assert-false", "assert-truthy", "assert-falsy", "assert-null", "assert-throws", "assert-throws-error", "assert-not-throws", "mat:mul", "mat:det", "mat:inv", "mat:adj", "mat:cofactor", "mat:minor", "mat:trace", "mat:symmetric?", "mat:triangular?", "mat:upper-triangular?", "mat:lower-triangular?", "mat:diagonal?", "mat:square?", "mat:orthogonal?", "mat:identity?", "mat:invertible?", "mat:hilbert", "mat:vandermonde", "mat:band", "mat:banded?", "mat:rank", "mat:frobenius-norm", "mat:1-norm", "mat:inf-norm", "mat:max-norm", "vec:monotonic?", "vec:strictly-monotonic?", "vec:increasing?", "vec:decreasing?", "vec:strictly-increasing?", "vec:strictly-decreasing?", "vec:median", "vec:mode", "vec:min-index", "vec:max-index", "vec:sort-indices", "vec:count-values", "vec:linspace", "vec:ones", "vec:zeros", "vec:fill", "vec:generate", "vec:cumsum", "vec:cumprod", "vec:quartiles", "vec:percentile", "vec:quantile", "vec:histogram", "vec:ecdf", "vec:outliers?", "vec:outliers", "vec:bincount", "vec:winsorize", "vec:mse", "vec:mae", "vec:rmse", "vec:smape", "vec:mean", "vec:moving-mean", "vec:centered-moving-mean", "vec:running-mean", "vec:median", "vec:moving-median", "vec:centered-moving-median", "vec:running-median", "vec:variance", "vec:moving-variance", "vec:centered-moving-variance", "vec:running-variance", "vec:sample-variance", "vec:moving-sample-variance", "vec:centered-moving-sample-variance", "vec:running-sample-variance", "vec:sum", "vec:moving-sum", "vec:centered-moving-sum", "vec:running-sum", "vec:prod", "vec:moving-prod", "vec:centered-moving-prod", "vec:running-prod", "vec:min", "vec:moving-min", "vec:centered-moving-min", "vec:running-min", "vec:max", "vec:moving-max", "vec:centered-moving-max", "vec:running-max", "vec:stdev", "vec:moving-stdev", "vec:centered-moving-stdev", "vec:running-stdev", "vec:sample-stdev", "vec:moving-sample-stdev", "vec:centered-moving-sample-stdev", "vec:running-sample-stdev", "vec:iqr", "vec:moving-iqr", "vec:centered-moving-iqr", "vec:running-iqr", "vec:span", "vec:moving-span", "vec:centered-moving-span", "vec:running-span", "vec:geometric-mean", "vec:moving-geometric-mean", "vec:centered-moving-geometric-mean", "vec:running-geometric-mean", "vec:harmonic-mean", "vec:moving-harmonic-mean", "vec:centered-moving-harmonic-mean", "vec:running-harmonic-mean", "vec:skewness", "vec:moving-skewness", "vec:centered-moving-skewness", "vec:running-skewness", "vec:sample-skewness", "vec:moving-sample-skewness", "vec:centered-moving-sample-skewness", "vec:running-sample-skewness", "vec:kurtosis", "vec:moving-kurtosis", "vec:centered-moving-kurtosis", "vec:running-kurtosis", "vec:sample-kurtosis", "vec:moving-sample-kurtosis", "vec:centered-moving-sample-kurtosis", "vec:running-sample-kurtosis", "vec:excess-kurtosis", "vec:moving-excess-kurtosis", "vec:centered-moving-excess-kurtosis", "vec:running-excess-kurtosis", "vec:sample-excess-kurtosis", "vec:moving-sample-excess-kurtosis", "vec:centered-moving-sample-excess-kurtosis", "vec:running-sample-excess-kurtosis", "vec:rms", "vec:moving-rms", "vec:centered-moving-rms", "vec:running-rms", "vec:mad", "vec:moving-mad", "vec:centered-moving-mad", "vec:running-mad", "vec:medad", "vec:moving-medad", "vec:centered-moving-medad", "vec:running-medad", "vec:gini-coefficient", "vec:moving-gini-coefficient", "vec:centered-moving-gini-coefficient", "vec:running-gini-coefficient", "vec:entropy", "vec:moving-entropy", "vec:centered-moving-entropy", "vec:running-entropy", "vec:skewness", "vec:moving-skewness", "vec:centered-moving-skewness", "vec:running-skewness", "lin:dot", "lin:cross", "lin:normalize-minmax", "lin:normalize-zscore", "lin:normalize-robust", "lin:normalize-l1", "lin:normalize-l2", "lin:normalize-log", "lin:angle", "lin:projection", "lin:orthogonal?", "lin:parallel?", "lin:collinear?", "lin:cosine-similarity", "lin:euclidean-distance", "lin:euclidean-norm", "lin:manhattan-distance", "lin:manhattan-norm", "lin:hamming-distance", "lin:hamming-norm", "lin:chebyshev-distance", "lin:chebyshev-norm", "lin:minkowski-distance", "lin:minkowski-norm", "lin:cov", "lin:corr", "lin:spearman-corr", "lin:pearson-corr", "lin:kendall-tau", "lin:autocorrelation", "lin:cross-correlation", "lin:rref", "lin:solve", "grid:every?", "grid:some?", "grid:every-row?", "grid:some-row?", "grid:every-col?", "grid:some-col?", "grid:row", "grid:col", "grid:shape", "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", "nth:abundant-seq", "nth:abundant-nth", "nth:abundant-take-while", "nth:abundant?", "nth:bell-seq", "nth:bell-nth", "nth:bell-take-while", "nth:bell?", "nth:catalan-seq", "nth:catalan-nth", "nth:catalan-take-while", "nth:catalan?", "nth:composite-seq", "nth:composite-nth", "nth:composite-take-while", "nth:composite?", "nth:factorial-seq", "nth:factorial-nth", "nth:factorial-take-while", "nth:factorial?", "nth:fibonacci-seq", "nth:fibonacci-nth", "nth:fibonacci-take-while", "nth:fibonacci?", "nth:geometric-seq", "nth:geometric-nth", "nth:geometric-take-while", "nth:geometric?", "nth:golomb-seq", "nth:golomb-nth", "nth:golomb-take-while", "nth:golomb?", "nth:happy-seq", "nth:happy-nth", "nth:happy-take-while", "nth:happy?", "nth:look-and-say-seq", "nth:look-and-say-nth", "nth:look-and-say-take-while", "nth:look-and-say?", "nth:lucas-seq", "nth:lucas-nth", "nth:lucas-take-while", "nth:lucas?", "nth:lucky-seq", "nth:lucky-nth", "nth:lucky-take-while", "nth:lucky?", "nth:mersenne-seq", "nth:mersenne-nth", "nth:mersenne-take-while", "nth:mersenne?", "nth:padovan-seq", "nth:padovan-nth", "nth:padovan-take-while", "nth:padovan?", "nth:partition-seq", "nth:partition-nth", "nth:partition-take-while", "nth:partition?", "nth:pell-seq", "nth:pell-nth", "nth:pell-take-while", "nth:pell?", "nth:perfect-seq", "nth:perfect-nth", "nth:perfect-take-while", "nth:perfect?", "nth:perfect-cube-seq", "nth:perfect-cube-nth", "nth:perfect-cube-take-while", "nth:perfect-cube?", "nth:perfect-power-seq", "nth:perfect-power-nth", "nth:perfect-power-take-while", "nth:perfect-power?", "nth:perfect-square-seq", "nth:perfect-square-nth", "nth:perfect-square-take-while", "nth:perfect-square?", "nth:polygonal-seq", "nth:polygonal-nth", "nth:polygonal-take-while", "nth:polygonal?", "nth:prime-seq", "nth:prime-nth", "nth:prime-take-while", "nth:prime?", "nth:recaman-seq", "nth:recaman-nth", "nth:recaman-take-while", "nth:recaman?", "nth:sylvester-seq", "nth:sylvester-nth", "nth:sylvester-take-while", "nth:sylvester?", "nth:thue-morse-seq", "nth:thue-morse-nth", "nth:thue-morse-take-while", "nth:thue-morse?", "nth:tribonacci-seq", "nth:tribonacci-nth", "nth:tribonacci-take-while", "nth:tribonacci?", "nth:collatz-seq", "nth:juggler-seq", "nth:bernoulli-seq", "nth:bernoulli-take-while", "nth:bernoulli-nth", "nth:combinations", "nth:count-combinations", "nth:derangements", "nth:count-derangements", "nth:divisors", "nth:count-divisors", "nth:proper-divisors", "nth:count-proper-divisors", "nth:prime-factors", "nth:count-prime-factors", "nth:distinct-prime-factors", "nth:count-distinct-prime-factors", "nth:factorial", "nth:partitions", "nth:count-partitions", "nth:permutations", "nth:count-permutations", "nth:power-set", "nth:count-power-set", "nth:coprime?", "nth:divisible-by?", "nth:gcd", "nth:lcm", "nth:multinomial", "nth:amicable?", "nth:euler-totient", "nth:mobius", "nth:mertens", "nth:sigma", "nth:carmichael-lambda", "nth:cartesian-product", "nth:perfect-power", "nth:mod-exp", "nth:mod-inv", "nth:extended-gcd", "nth:chinese-remainder", "nth:stirling-first", "nth:stirling-second", "!:random", "!:random-int", "!:random-int-inclusive", "!:random-float", "!:random-boolean", "!:random-item", "!:random-sample", "!:random-sample-unique", "!:shuffle", "!:random-normal", "!:random-exponential", "!:random-binomial", "!:random-poisson", "!:random-gamma", "!:random-pareto", "!:uuid", "!:random-char", "!:random-string", "!:random-id", "!:random-color", "-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"];
47
+ declare const apiNames: readonly ["filter", "map", "reduce", "reduce-right", "reductions", "count", "get", "get-in", "contains?", "assoc", "assoc-in", "++", "not-empty", "every?", "not-every?", "any?", "not-any?", "update", "update-in", "range", "repeat", "flatten", "mapcat", "nth", "push", "pop", "unshift", "shift", "slice", "splice", "position", "index-of", "last-index-of", "some", "reverse", "first", "second", "last", "rest", "next", "take", "take-last", "take-while", "drop", "drop-last", "drop-while", "sort", "sort-by", "distinct", "remove", "remove-at", "split-at", "split-with", "frequencies", "group-by", "partition", "partition-all", "partition-by", "starts-with?", "ends-with?", "interleave", "interpose", "+", "-", "*", "/", "~", "mod", "rem", "quot", "inc", "dec", "sqrt", "cbrt", "^", "round", "trunc", "floor", "ceil", "min", "max", "abs", "sign", "ln", "log2", "log10", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "|>", "apply", "identity", "comp", "constantly", "juxt", "complement", "every-pred", "some-pred", "fnull", "≠", "=", "<", ">", "≤", "≥", "!", "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?", "coll?", "seq?", "regexp?", "zero?", "pos?", "neg?", "even?", "odd?", "finite?", "nan?", "negative-infinity?", "positive-infinity?", "false?", "true?", "empty?", "not-empty?", "vector?", "grid?", "matrix?", "regexp", "match", "replace", "replace-all", "string-repeat", "str", "number", "lower-case", "upper-case", "trim", "trim-left", "trim-right", "pad-left", "pad-right", "split", "split-lines", "template", "to-char-code", "from-char-code", "encode-base64", "decode-base64", "encode-uri-component", "decode-uri-component", "join", "capitalize", "blank?", "<<", ">>", ">>>", "bit-not", "&", "bit-and-not", "|", "xor", "bit-flip", "bit-clear", "bit-set", "bit-test", "assert", "assert=", "assert!=", "assert-gt", "assert-lt", "assert-gte", "assert-lte", "assert-true", "assert-false", "assert-truthy", "assert-falsy", "assert-null", "assert-throws", "assert-throws-error", "assert-not-throws", "mat:mul", "mat:det", "mat:inv", "mat:adj", "mat:cofactor", "mat:minor", "mat:trace", "mat:symmetric?", "mat:triangular?", "mat:upper-triangular?", "mat:lower-triangular?", "mat:diagonal?", "mat:square?", "mat:orthogonal?", "mat:identity?", "mat:invertible?", "mat:hilbert", "mat:vandermonde", "mat:band", "mat:banded?", "mat:rank", "mat:frobenius-norm", "mat:1-norm", "mat:inf-norm", "mat:max-norm", "vec:monotonic?", "vec:strictly-monotonic?", "vec:increasing?", "vec:decreasing?", "vec:strictly-increasing?", "vec:strictly-decreasing?", "vec:median", "vec:mode", "vec:min-index", "vec:max-index", "vec:sort-indices", "vec:count-values", "vec:linspace", "vec:ones", "vec:zeros", "vec:fill", "vec:generate", "vec:cumsum", "vec:cumprod", "vec:quartiles", "vec:percentile", "vec:quantile", "vec:histogram", "vec:ecdf", "vec:outliers?", "vec:outliers", "vec:bincount", "vec:winsorize", "vec:mse", "vec:mae", "vec:rmse", "vec:smape", "vec:mean", "vec:moving-mean", "vec:centered-moving-mean", "vec:running-mean", "vec:median", "vec:moving-median", "vec:centered-moving-median", "vec:running-median", "vec:variance", "vec:moving-variance", "vec:centered-moving-variance", "vec:running-variance", "vec:sample-variance", "vec:moving-sample-variance", "vec:centered-moving-sample-variance", "vec:running-sample-variance", "vec:sum", "vec:moving-sum", "vec:centered-moving-sum", "vec:running-sum", "vec:prod", "vec:moving-prod", "vec:centered-moving-prod", "vec:running-prod", "vec:min", "vec:moving-min", "vec:centered-moving-min", "vec:running-min", "vec:max", "vec:moving-max", "vec:centered-moving-max", "vec:running-max", "vec:stdev", "vec:moving-stdev", "vec:centered-moving-stdev", "vec:running-stdev", "vec:sample-stdev", "vec:moving-sample-stdev", "vec:centered-moving-sample-stdev", "vec:running-sample-stdev", "vec:iqr", "vec:moving-iqr", "vec:centered-moving-iqr", "vec:running-iqr", "vec:span", "vec:moving-span", "vec:centered-moving-span", "vec:running-span", "vec:geometric-mean", "vec:moving-geometric-mean", "vec:centered-moving-geometric-mean", "vec:running-geometric-mean", "vec:harmonic-mean", "vec:moving-harmonic-mean", "vec:centered-moving-harmonic-mean", "vec:running-harmonic-mean", "vec:skewness", "vec:moving-skewness", "vec:centered-moving-skewness", "vec:running-skewness", "vec:sample-skewness", "vec:moving-sample-skewness", "vec:centered-moving-sample-skewness", "vec:running-sample-skewness", "vec:kurtosis", "vec:moving-kurtosis", "vec:centered-moving-kurtosis", "vec:running-kurtosis", "vec:sample-kurtosis", "vec:moving-sample-kurtosis", "vec:centered-moving-sample-kurtosis", "vec:running-sample-kurtosis", "vec:excess-kurtosis", "vec:moving-excess-kurtosis", "vec:centered-moving-excess-kurtosis", "vec:running-excess-kurtosis", "vec:sample-excess-kurtosis", "vec:moving-sample-excess-kurtosis", "vec:centered-moving-sample-excess-kurtosis", "vec:running-sample-excess-kurtosis", "vec:rms", "vec:moving-rms", "vec:centered-moving-rms", "vec:running-rms", "vec:mad", "vec:moving-mad", "vec:centered-moving-mad", "vec:running-mad", "vec:medad", "vec:moving-medad", "vec:centered-moving-medad", "vec:running-medad", "vec:gini-coefficient", "vec:moving-gini-coefficient", "vec:centered-moving-gini-coefficient", "vec:running-gini-coefficient", "vec:entropy", "vec:moving-entropy", "vec:centered-moving-entropy", "vec:running-entropy", "vec:skewness", "vec:moving-skewness", "vec:centered-moving-skewness", "vec:running-skewness", "lin:reflect", "lin:refract", "lin:lerp", "lin:rotate2d", "lin:rotate3d", "lin:dot", "lin:cross", "lin:normalize-minmax", "lin:normalize-zscore", "lin:normalize-robust", "lin:normalize-l1", "lin:normalize-l2", "lin:normalize-log", "lin:angle", "lin:projection", "lin:orthogonal?", "lin:parallel?", "lin:collinear?", "lin:cosine-similarity", "lin:euclidean-distance", "lin:euclidean-norm", "lin:manhattan-distance", "lin:manhattan-norm", "lin:hamming-distance", "lin:hamming-norm", "lin:chebyshev-distance", "lin:chebyshev-norm", "lin:minkowski-distance", "lin:minkowski-norm", "lin:cov", "lin:corr", "lin:spearman-corr", "lin:pearson-corr", "lin:kendall-tau", "lin:autocorrelation", "lin:cross-correlation", "lin:rref", "lin:solve", "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", "nth:abundant-seq", "nth:abundant-nth", "nth:abundant-take-while", "nth:abundant?", "nth:bell-seq", "nth:bell-nth", "nth:bell-take-while", "nth:bell?", "nth:catalan-seq", "nth:catalan-nth", "nth:catalan-take-while", "nth:catalan?", "nth:composite-seq", "nth:composite-nth", "nth:composite-take-while", "nth:composite?", "nth:factorial-seq", "nth:factorial-nth", "nth:factorial-take-while", "nth:factorial?", "nth:fibonacci-seq", "nth:fibonacci-nth", "nth:fibonacci-take-while", "nth:fibonacci?", "nth:geometric-seq", "nth:geometric-nth", "nth:geometric-take-while", "nth:geometric?", "nth:golomb-seq", "nth:golomb-nth", "nth:golomb-take-while", "nth:golomb?", "nth:happy-seq", "nth:happy-nth", "nth:happy-take-while", "nth:happy?", "nth:look-and-say-seq", "nth:look-and-say-nth", "nth:look-and-say-take-while", "nth:look-and-say?", "nth:lucas-seq", "nth:lucas-nth", "nth:lucas-take-while", "nth:lucas?", "nth:lucky-seq", "nth:lucky-nth", "nth:lucky-take-while", "nth:lucky?", "nth:mersenne-seq", "nth:mersenne-nth", "nth:mersenne-take-while", "nth:mersenne?", "nth:padovan-seq", "nth:padovan-nth", "nth:padovan-take-while", "nth:padovan?", "nth:partition-seq", "nth:partition-nth", "nth:partition-take-while", "nth:partition?", "nth:pell-seq", "nth:pell-nth", "nth:pell-take-while", "nth:pell?", "nth:perfect-seq", "nth:perfect-nth", "nth:perfect-take-while", "nth:perfect?", "nth:perfect-cube-seq", "nth:perfect-cube-nth", "nth:perfect-cube-take-while", "nth:perfect-cube?", "nth:perfect-power-seq", "nth:perfect-power-nth", "nth:perfect-power-take-while", "nth:perfect-power?", "nth:perfect-square-seq", "nth:perfect-square-nth", "nth:perfect-square-take-while", "nth:perfect-square?", "nth:polygonal-seq", "nth:polygonal-nth", "nth:polygonal-take-while", "nth:polygonal?", "nth:prime-seq", "nth:prime-nth", "nth:prime-take-while", "nth:prime?", "nth:recaman-seq", "nth:recaman-nth", "nth:recaman-take-while", "nth:recaman?", "nth:sylvester-seq", "nth:sylvester-nth", "nth:sylvester-take-while", "nth:sylvester?", "nth:thue-morse-seq", "nth:thue-morse-nth", "nth:thue-morse-take-while", "nth:thue-morse?", "nth:tribonacci-seq", "nth:tribonacci-nth", "nth:tribonacci-take-while", "nth:tribonacci?", "nth:collatz-seq", "nth:juggler-seq", "nth:bernoulli-seq", "nth:bernoulli-take-while", "nth:bernoulli-nth", "nth:combinations", "nth:count-combinations", "nth:derangements", "nth:count-derangements", "nth:divisors", "nth:count-divisors", "nth:proper-divisors", "nth:count-proper-divisors", "nth:prime-factors", "nth:count-prime-factors", "nth:distinct-prime-factors", "nth:count-distinct-prime-factors", "nth:factorial", "nth:partitions", "nth:count-partitions", "nth:permutations", "nth:count-permutations", "nth:power-set", "nth:count-power-set", "nth:coprime?", "nth:divisible-by?", "nth:gcd", "nth:lcm", "nth:multinomial", "nth:amicable?", "nth:euler-totient", "nth:mobius", "nth:mertens", "nth:sigma", "nth:carmichael-lambda", "nth:cartesian-product", "nth:perfect-power", "nth:mod-exp", "nth:mod-inv", "nth:extended-gcd", "nth:chinese-remainder", "nth:stirling-first", "nth:stirling-second", "!:random", "!:random-int", "!:random-int-inclusive", "!:random-float", "!:random-boolean", "!:random-item", "!:random-sample", "!:random-sample-unique", "!:shuffle", "!:random-normal", "!:random-exponential", "!:random-binomial", "!:random-poisson", "!:random-gamma", "!:random-pareto", "!:uuid", "!:random-char", "!:random-string", "!:random-id", "!:random-color", "-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"];
48
48
  export type ApiName = typeof apiNames[number];
49
49
  export declare function isApiName(arg: string): arg is ApiName;
50
50
  export declare const categoryRecord: {
@@ -268,6 +268,7 @@ export declare const functionReference: {
268
268
  "grid:row": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
269
269
  "grid:col": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
270
270
  "grid:shape": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
271
+ "grid:fill": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
271
272
  "grid:generate": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
272
273
  "grid:reshape": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
273
274
  "grid:transpose": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
@@ -352,6 +353,11 @@ export declare const functionReference: {
352
353
  "vec:rmse": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
353
354
  "vec:mae": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
354
355
  "vec:smape": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
356
+ "lin:rotate2d": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
357
+ "lin:rotate3d": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
358
+ "lin:reflect": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
359
+ "lin:refract": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
360
+ "lin:lerp": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
355
361
  "lin:dot": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
356
362
  "lin:cross": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
357
363
  "lin:normalize-minmax": FunctionReference<"String" | "Array" | "Special expression" | "Predicate" | "Sequence" | "Collection" | "Object" | "Math" | "Functional" | "Regular expression" | "Bitwise" | "Misc" | "Assert" | "Vector" | "Linear Algebra" | "Matrix" | "Grid" | "Number Theory" | "Random" | "Shorthand" | "Datatype">;
@@ -0,0 +1 @@
1
+ export declare function dot(vector1: number[], vector2: number[]): number;
@@ -0,0 +1,2 @@
1
+ import type { SourceCodeInfo } from '../../../../../../tokenizer/token';
2
+ export declare function getUnit<T extends number[]>(value: T, sourceCodeInfo: SourceCodeInfo | undefined): T;
@@ -0,0 +1 @@
1
+ export declare function scale(vector: number[], scalar: number): number[];
@@ -0,0 +1 @@
1
+ export declare function subtract(vector1: number[], vector2: number[]): number[];
@@ -3,6 +3,10 @@ import type { SourceCodeInfo } from '../tokenizer/token';
3
3
  export declare function annotate<T>(value: T): T;
4
4
  export declare function isVector(vector: unknown): vector is number[];
5
5
  export declare function assertVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[];
6
+ export declare function is2dVector(vector: unknown): vector is [number, number];
7
+ export declare function assert2dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number];
8
+ export declare function is3dVector(vector: unknown): vector is [number, number, number];
9
+ export declare function assert3dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number, number];
6
10
  export declare function assertNonEmptyVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[];
7
11
  export declare function isGrid(grid: unknown): grid is unknown[][];
8
12
  export declare function assertGrid(grid: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts grid is Any[][];
@@ -3,7 +3,7 @@ import type { NativeJsFunction } from '../parser/types';
3
3
  import type { SourceCodeInfo } from '../tokenizer/token';
4
4
  export declare function collHasKey(coll: unknown, key: string | number): boolean;
5
5
  export declare function compare<T extends string | number>(a: T, b: T, sourceCodeInfo: SourceCodeInfo | undefined): number;
6
- export declare function deepEqual(a: Any, b: Any, sourceCodeInfo?: SourceCodeInfo): boolean;
6
+ export declare function deepEqual(a: unknown, b: unknown, sourceCodeInfo?: SourceCodeInfo): boolean;
7
7
  export declare function toNonNegativeInteger(num: number): number;
8
8
  export declare function toAny(value: unknown): Any;
9
9
  export declare function cloneColl<T extends Coll>(value: T): T;
@@ -802,7 +802,7 @@ function deepEqual(a, b, sourceCodeInfo) {
802
802
  if (a === b)
803
803
  return true;
804
804
  if (typeof a === 'number' && typeof b === 'number')
805
- return Math.abs(a - b) < Number.EPSILON;
805
+ return Math.abs(a - b) < 1e-10;
806
806
  if (Array.isArray(a) && Array.isArray(b)) {
807
807
  if (a.length !== b.length)
808
808
  return false;
@@ -821,7 +821,7 @@ function deepEqual(a, b, sourceCodeInfo) {
821
821
  return false;
822
822
  for (var i = 0; i < aKeys.length; i += 1) {
823
823
  var key = asString(aKeys[i], sourceCodeInfo);
824
- if (!deepEqual(toAny(a[key]), toAny(b[key]), sourceCodeInfo))
824
+ if (!deepEqual(a[key], b[key], sourceCodeInfo))
825
825
  return false;
826
826
  }
827
827
  return true;
@@ -2286,6 +2286,28 @@ function assertVector(vector, sourceCodeInfo) {
2286
2286
  throw new LitsError("Expected a vector, but got ".concat(vector), sourceCodeInfo);
2287
2287
  }
2288
2288
  }
2289
+ function is2dVector(vector) {
2290
+ if (!isVector(vector)) {
2291
+ return false;
2292
+ }
2293
+ return vector.length === 2;
2294
+ }
2295
+ function assert2dVector(vector, sourceCodeInfo) {
2296
+ if (!is2dVector(vector)) {
2297
+ throw new LitsError("Expected a 2d vector, but got ".concat(vector), sourceCodeInfo);
2298
+ }
2299
+ }
2300
+ function is3dVector(vector) {
2301
+ if (!isVector(vector)) {
2302
+ return false;
2303
+ }
2304
+ return vector.length === 3;
2305
+ }
2306
+ function assert3dVector(vector, sourceCodeInfo) {
2307
+ if (!is3dVector(vector)) {
2308
+ throw new LitsError("Expected a 3d vector, but got ".concat(vector), sourceCodeInfo);
2309
+ }
2310
+ }
2289
2311
  function assertNonEmptyVector(vector, sourceCodeInfo) {
2290
2312
  assertVector(vector, sourceCodeInfo);
2291
2313
  if (vector.length === 0) {
@@ -4666,6 +4688,24 @@ var gridNormalExpression = {
4666
4688
  },
4667
4689
  paramCount: 1,
4668
4690
  },
4691
+ 'grid:fill': {
4692
+ evaluate: function (_a, sourceCodeInfo) {
4693
+ var _b = __read(_a, 3), rows = _b[0], cols = _b[1], value = _b[2];
4694
+ assertNumber(rows, sourceCodeInfo, { integer: true, positive: true });
4695
+ assertNumber(cols, sourceCodeInfo, { integer: true, positive: true });
4696
+ assertAny(value, sourceCodeInfo);
4697
+ var result = [];
4698
+ for (var i = 0; i < rows; i += 1) {
4699
+ var row = [];
4700
+ for (var j = 0; j < cols; j += 1) {
4701
+ row.push(value);
4702
+ }
4703
+ result.push(row);
4704
+ }
4705
+ return result;
4706
+ },
4707
+ paramCount: 3,
4708
+ },
4669
4709
  'grid:generate': {
4670
4710
  evaluate: function (_a, sourceCodeInfo, contextStack, _b) {
4671
4711
  var _c = __read(_a, 3), rows = _c[0], cols = _c[1], generator = _c[2];
@@ -4716,6 +4756,7 @@ var gridNormalExpression = {
4716
4756
  return transpose(grid);
4717
4757
  },
4718
4758
  paramCount: 1,
4759
+ aliases: ['grid:tr'],
4719
4760
  },
4720
4761
  'grid:flip-h': {
4721
4762
  evaluate: function (_a, sourceCodeInfo) {
@@ -6609,7 +6650,137 @@ function extractOverlappingSegments(vectorA, vectorB, lag) {
6609
6650
  return [segmentA, segmentB];
6610
6651
  }
6611
6652
 
6653
+ function getUnit(value, sourceCodeInfo) {
6654
+ if (value.length === 0) {
6655
+ return value;
6656
+ }
6657
+ var length = Math.sqrt(value.reduce(function (acc, item) { return acc + Math.pow(item, 2); }, 0));
6658
+ if (approxZero(length)) {
6659
+ throw new LitsError('The vector must not be zero', sourceCodeInfo);
6660
+ }
6661
+ return value.map(function (item) { return item / length; });
6662
+ }
6663
+
6664
+ function dot(vector1, vector2) {
6665
+ return vector1.reduce(function (acc, item, index) { return acc + item * vector2[index]; }, 0);
6666
+ }
6667
+
6668
+ function subtract(vector1, vector2) {
6669
+ return vector1.map(function (item, index) { return item - vector2[index]; });
6670
+ }
6671
+
6672
+ function scale(vector, scalar) {
6673
+ return vector.map(function (item) { return item * scalar; });
6674
+ }
6675
+
6612
6676
  var linearAlgebraNormalExpression = {
6677
+ 'lin:rotate2d': {
6678
+ evaluate: function (_a, sourceCodeInfo) {
6679
+ var _b = __read(_a, 2), vector = _b[0], radians = _b[1];
6680
+ assert2dVector(vector, sourceCodeInfo);
6681
+ if (isZeroVector(vector)) {
6682
+ return vector;
6683
+ }
6684
+ assertNumber(radians, sourceCodeInfo, { finite: true });
6685
+ var cosTheta = Math.cos(radians);
6686
+ var sinTheta = Math.sin(radians);
6687
+ return [
6688
+ vector[0] * cosTheta - vector[1] * sinTheta,
6689
+ vector[0] * sinTheta + vector[1] * cosTheta,
6690
+ ];
6691
+ },
6692
+ paramCount: 2,
6693
+ },
6694
+ 'lin:rotate3d': {
6695
+ evaluate: function (_a, sourceCodeInfo) {
6696
+ var _b = __read(_a, 3), vector = _b[0], axis = _b[1], radians = _b[2];
6697
+ assert3dVector(vector, sourceCodeInfo);
6698
+ if (isZeroVector(vector)) {
6699
+ return vector;
6700
+ }
6701
+ assertNumber(radians, sourceCodeInfo, { finite: true });
6702
+ assert3dVector(axis, sourceCodeInfo);
6703
+ if (isZeroVector(axis)) {
6704
+ throw new LitsError('Rotation axis must not be zero', sourceCodeInfo);
6705
+ }
6706
+ var cosTheta = Math.cos(radians);
6707
+ var sinTheta = Math.sin(radians);
6708
+ var _c = __read(getUnit(axis, sourceCodeInfo), 3), u = _c[0], v = _c[1], w = _c[2];
6709
+ var dotProduct = vector[0] * u + vector[1] * v + vector[2] * w;
6710
+ return [
6711
+ dotProduct * u * (1 - cosTheta) + vector[0] * cosTheta + (-w * vector[1] + v * vector[2]) * sinTheta,
6712
+ dotProduct * v * (1 - cosTheta) + vector[1] * cosTheta + (w * vector[0] - u * vector[2]) * sinTheta,
6713
+ dotProduct * w * (1 - cosTheta) + vector[2] * cosTheta + (-v * vector[0] + u * vector[1]) * sinTheta,
6714
+ ];
6715
+ },
6716
+ paramCount: 3,
6717
+ },
6718
+ 'lin:reflect': {
6719
+ evaluate: function (_a, sourceCodeInfo) {
6720
+ var _b = __read(_a, 2), vector = _b[0], normal = _b[1];
6721
+ assertVector(vector, sourceCodeInfo);
6722
+ assertVector(normal, sourceCodeInfo);
6723
+ if (vector.length !== normal.length) {
6724
+ throw new LitsError('Vectors must be of the same length', sourceCodeInfo);
6725
+ }
6726
+ if (isZeroVector(normal)) {
6727
+ throw new LitsError('Reflection normal must not be zero', sourceCodeInfo);
6728
+ }
6729
+ if (isZeroVector(vector)) {
6730
+ return vector;
6731
+ }
6732
+ var unitNormal = getUnit(normal, sourceCodeInfo);
6733
+ var doubleDot = 2 * dot(vector, unitNormal);
6734
+ return subtract(vector, scale(unitNormal, doubleDot));
6735
+ },
6736
+ paramCount: 2,
6737
+ },
6738
+ 'lin:refract': {
6739
+ evaluate: function (_a, sourceCodeInfo) {
6740
+ var _b = __read(_a, 3), vector = _b[0], normal = _b[1], eta = _b[2];
6741
+ assertVector(vector, sourceCodeInfo);
6742
+ assertVector(normal, sourceCodeInfo);
6743
+ assertNumber(eta, sourceCodeInfo, { finite: true, positive: true });
6744
+ if (vector.length !== normal.length) {
6745
+ throw new LitsError('Vectors must be of the same length', sourceCodeInfo);
6746
+ }
6747
+ if (isZeroVector(normal)) {
6748
+ throw new LitsError('Refraction normal must not be zero', sourceCodeInfo);
6749
+ }
6750
+ if (isZeroVector(vector)) {
6751
+ return vector;
6752
+ }
6753
+ // Make sure vectors are normalized
6754
+ var normalizedV = getUnit(vector, sourceCodeInfo);
6755
+ var normalizedNormal = getUnit(normal, sourceCodeInfo);
6756
+ // Calculate dot product between incident vector and normal
6757
+ var dotProduct = dot(normalizedV, normalizedNormal);
6758
+ // Calculate discriminant
6759
+ var discriminant = 1 - eta * eta * (1 - dotProduct * dotProduct);
6760
+ // Check for total internal reflection
6761
+ if (discriminant < 0) {
6762
+ return vector; // Total internal reflection occurs
6763
+ }
6764
+ // Calculate the refracted vector
6765
+ var scaledIncident = scale(normalizedV, eta);
6766
+ var scaledNormal = scale(normalizedNormal, eta * dotProduct + Math.sqrt(discriminant));
6767
+ return subtract(scaledIncident, scaledNormal);
6768
+ },
6769
+ paramCount: 3,
6770
+ },
6771
+ 'lin:lerp': {
6772
+ evaluate: function (_a, sourceCodeInfo) {
6773
+ var _b = __read(_a, 3), vectorA = _b[0], vectorB = _b[1], t = _b[2];
6774
+ assertVector(vectorA, sourceCodeInfo);
6775
+ assertVector(vectorB, sourceCodeInfo);
6776
+ assertNumber(t, sourceCodeInfo, { finite: true });
6777
+ if (vectorA.length !== vectorB.length) {
6778
+ throw new LitsError('Vectors must be of the same length', sourceCodeInfo);
6779
+ }
6780
+ return vectorA.map(function (val, i) { return val + (vectorB[i] - val) * t; });
6781
+ },
6782
+ paramCount: 3,
6783
+ },
6613
6784
  'lin:dot': {
6614
6785
  evaluate: function (_a, sourceCodeInfo) {
6615
6786
  var _b = __read(_a, 2), vectorA = _b[0], vectorB = _b[1];
@@ -6618,7 +6789,7 @@ var linearAlgebraNormalExpression = {
6618
6789
  if (vectorA.length !== vectorB.length) {
6619
6790
  throw new LitsError('Vectors must be of the same length', sourceCodeInfo);
6620
6791
  }
6621
- return vectorA.reduce(function (acc, val, i) { return acc + val * vectorB[i]; }, 0);
6792
+ return dot(vectorA, vectorB);
6622
6793
  },
6623
6794
  paramCount: 2,
6624
6795
  },
@@ -6699,16 +6870,10 @@ var linearAlgebraNormalExpression = {
6699
6870
  evaluate: function (_a, sourceCodeInfo) {
6700
6871
  var _b = __read(_a, 1), vector = _b[0];
6701
6872
  assertVector(vector, sourceCodeInfo);
6702
- if (vector.length === 0) {
6703
- return [];
6704
- }
6705
- var norm = Math.sqrt(vector.reduce(function (acc, val) { return acc + Math.pow(val, 2); }, 0));
6706
- if (norm === 0) {
6707
- return vector.map(function () { return 0; });
6708
- }
6709
- return vector.map(function (val) { return val / norm; });
6873
+ return getUnit(vector, sourceCodeInfo);
6710
6874
  },
6711
6875
  paramCount: 1,
6876
+ aliases: ['lin:unit', 'lin:normalize'],
6712
6877
  },
6713
6878
  'lin:normalize-log': {
6714
6879
  evaluate: function (_a, sourceCodeInfo) {
@@ -6835,7 +7000,7 @@ var linearAlgebraNormalExpression = {
6835
7000
  return Math.sqrt(vector.reduce(function (acc, val) { return acc + val * val; }, 0));
6836
7001
  },
6837
7002
  paramCount: 1,
6838
- aliases: ['lin:l2-norm', 'lin:magnitude'],
7003
+ aliases: ['lin:l2-norm', 'lin:length'],
6839
7004
  },
6840
7005
  'lin:manhattan-distance': {
6841
7006
  evaluate: function (_a, sourceCodeInfo) {
@@ -12305,6 +12470,7 @@ function evaluateReservedSymbol(node) {
12305
12470
  return asNonUndefined(value, node[2]);
12306
12471
  }
12307
12472
  function evaluateNormalExpression(node, contextStack) {
12473
+ var _a, _b;
12308
12474
  var sourceCodeInfo = node[2];
12309
12475
  var paramNodes = node[1][1];
12310
12476
  var params = [];
@@ -12330,14 +12496,14 @@ function evaluateNormalExpression(node, contextStack) {
12330
12496
  var nameSymbol = node[1][0];
12331
12497
  if (placeholders.length > 0) {
12332
12498
  var fn = evaluateNode(nameSymbol, contextStack);
12333
- var partialFunction = {
12334
- '^^fn^^': true,
12335
- 'function': asFunctionLike(fn, sourceCodeInfo),
12336
- 'functionType': 'Partial',
12337
- params: params,
12338
- placeholders: placeholders,
12339
- sourceCodeInfo: sourceCodeInfo,
12340
- };
12499
+ var partialFunction = (_a = {},
12500
+ _a[FUNCTION_SYMBOL] = true,
12501
+ _a.function = asFunctionLike(fn, sourceCodeInfo),
12502
+ _a.functionType = 'Partial',
12503
+ _a.params = params,
12504
+ _a.placeholders = placeholders,
12505
+ _a.sourceCodeInfo = sourceCodeInfo,
12506
+ _a);
12341
12507
  return partialFunction;
12342
12508
  }
12343
12509
  if (isNormalBuiltinSymbolNode(nameSymbol)) {
@@ -12357,14 +12523,14 @@ function evaluateNormalExpression(node, contextStack) {
12357
12523
  var fnNode = node[1][0];
12358
12524
  var fn = asFunctionLike(evaluateNode(fnNode, contextStack), sourceCodeInfo);
12359
12525
  if (placeholders.length > 0) {
12360
- var partialFunction = {
12361
- '^^fn^^': true,
12362
- 'function': asFunctionLike(fn, sourceCodeInfo),
12363
- 'functionType': 'Partial',
12364
- params: params,
12365
- placeholders: placeholders,
12366
- sourceCodeInfo: sourceCodeInfo,
12367
- };
12526
+ var partialFunction = (_b = {},
12527
+ _b[FUNCTION_SYMBOL] = true,
12528
+ _b.function = asFunctionLike(fn, sourceCodeInfo),
12529
+ _b.functionType = 'Partial',
12530
+ _b.params = params,
12531
+ _b.placeholders = placeholders,
12532
+ _b.sourceCodeInfo = sourceCodeInfo,
12533
+ _b);
12368
12534
  return partialFunction;
12369
12535
  }
12370
12536
  return executeFunction(fn, params, contextStack, sourceCodeInfo);