@ricsam/formula-engine 0.0.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 +100 -0
- package/dist/cjs/core/ast-traverser.cjs +124 -0
- package/dist/cjs/core/ast-traverser.cjs.map +10 -0
- package/dist/cjs/core/autofill-utils.cjs +304 -0
- package/dist/cjs/core/autofill-utils.cjs.map +10 -0
- package/dist/cjs/core/engine.cjs +390 -0
- package/dist/cjs/core/engine.cjs.map +10 -0
- package/dist/cjs/core/managers/cache-manager.cjs +58 -0
- package/dist/cjs/core/managers/cache-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/dependency-manager.cjs +620 -0
- package/dist/cjs/core/managers/dependency-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/dependency-node.cjs +24 -0
- package/dist/cjs/core/managers/dependency-node.cjs.map +9 -0
- package/dist/cjs/core/managers/evaluation-manager.cjs +433 -0
- package/dist/cjs/core/managers/evaluation-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/event-manager.cjs +49 -0
- package/dist/cjs/core/managers/event-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/frontier-dependency-manager.cjs +181 -0
- package/dist/cjs/core/managers/frontier-dependency-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/index.cjs +49 -0
- package/dist/cjs/core/managers/index.cjs.map +10 -0
- package/dist/cjs/core/managers/isDependencyNode.cjs +44 -0
- package/dist/cjs/core/managers/isDependencyNode.cjs.map +10 -0
- package/dist/cjs/core/managers/named-expression-manager.cjs +379 -0
- package/dist/cjs/core/managers/named-expression-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/range-eval-order-builder.cjs +644 -0
- package/dist/cjs/core/managers/range-eval-order-builder.cjs.map +10 -0
- package/dist/cjs/core/managers/table-manager.cjs +254 -0
- package/dist/cjs/core/managers/table-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/workbook-manager.cjs +474 -0
- package/dist/cjs/core/managers/workbook-manager.cjs.map +10 -0
- package/dist/cjs/core/map-serializer.cjs +69 -0
- package/dist/cjs/core/map-serializer.cjs.map +10 -0
- package/dist/cjs/core/named-expression-renamer.cjs +88 -0
- package/dist/cjs/core/named-expression-renamer.cjs.map +10 -0
- package/dist/cjs/core/sheet-renamer.cjs +89 -0
- package/dist/cjs/core/sheet-renamer.cjs.map +10 -0
- package/dist/cjs/core/sheet-utils.cjs +39 -0
- package/dist/cjs/core/sheet-utils.cjs.map +10 -0
- package/dist/cjs/core/table-renamer.cjs +88 -0
- package/dist/cjs/core/table-renamer.cjs.map +10 -0
- package/dist/cjs/core/types.cjs +48 -0
- package/dist/cjs/core/types.cjs.map +10 -0
- package/dist/cjs/core/utils/range-serializer.cjs +65 -0
- package/dist/cjs/core/utils/range-serializer.cjs.map +10 -0
- package/dist/cjs/core/utils/spreadsheet-visualizer.cjs +142 -0
- package/dist/cjs/core/utils/spreadsheet-visualizer.cjs.map +10 -0
- package/dist/cjs/core/utils.cjs +434 -0
- package/dist/cjs/core/utils.cjs.map +10 -0
- package/dist/cjs/core/workbook-renamer.cjs +106 -0
- package/dist/cjs/core/workbook-renamer.cjs.map +10 -0
- package/dist/cjs/debug/flags.cjs +47 -0
- package/dist/cjs/debug/flags.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/add/add.cjs +82 -0
- package/dist/cjs/evaluator/arithmetic/add/add.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/divide/divide.cjs +107 -0
- package/dist/cjs/evaluator/arithmetic/divide/divide.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs +93 -0
- package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/power/power.cjs +125 -0
- package/dist/cjs/evaluator/arithmetic/power/power.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs +84 -0
- package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/equals.cjs +64 -0
- package/dist/cjs/evaluator/comparison/equals.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs +61 -0
- package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/greater-than.cjs +61 -0
- package/dist/cjs/evaluator/comparison/greater-than.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs +69 -0
- package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/less-than.cjs +68 -0
- package/dist/cjs/evaluator/comparison/less-than.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/not-equals.cjs +53 -0
- package/dist/cjs/evaluator/comparison/not-equals.cjs.map +10 -0
- package/dist/cjs/evaluator/concatenation/concatenate.cjs +72 -0
- package/dist/cjs/evaluator/concatenation/concatenate.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs +58 -0
- package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs +112 -0
- package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs +54 -0
- package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs +108 -0
- package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs +50 -0
- package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs.map +10 -0
- package/dist/cjs/evaluator/evaluate-scalar-operator.cjs +254 -0
- package/dist/cjs/evaluator/evaluate-scalar-operator.cjs.map +10 -0
- package/dist/cjs/evaluator/evaluation-context.cjs +154 -0
- package/dist/cjs/evaluator/evaluation-context.cjs.map +10 -0
- package/dist/cjs/evaluator/evaluation-error.cjs +75 -0
- package/dist/cjs/evaluator/evaluation-error.cjs.map +10 -0
- package/dist/cjs/evaluator/formula-evaluator.cjs +797 -0
- package/dist/cjs/evaluator/formula-evaluator.cjs.map +10 -0
- package/dist/cjs/evaluator/range-evaluation-node.cjs +88 -0
- package/dist/cjs/evaluator/range-evaluation-node.cjs.map +10 -0
- package/dist/cjs/functions/_template/template.cjs +42 -0
- package/dist/cjs/functions/_template/template.cjs.map +10 -0
- package/dist/cjs/functions/array/sequence/sequence.cjs +315 -0
- package/dist/cjs/functions/array/sequence/sequence.cjs.map +10 -0
- package/dist/cjs/functions/criteria-parser.cjs +217 -0
- package/dist/cjs/functions/criteria-parser.cjs.map +10 -0
- package/dist/cjs/functions/criteria-utils.cjs +291 -0
- package/dist/cjs/functions/criteria-utils.cjs.map +10 -0
- package/dist/cjs/functions/function-utils.cjs +63 -0
- package/dist/cjs/functions/function-utils.cjs.map +10 -0
- package/dist/cjs/functions/index.cjs +125 -0
- package/dist/cjs/functions/index.cjs.map +10 -0
- package/dist/cjs/functions/information/cell/cell.cjs +196 -0
- package/dist/cjs/functions/information/cell/cell.cjs.map +10 -0
- package/dist/cjs/functions/information/column/column.cjs +144 -0
- package/dist/cjs/functions/information/column/column.cjs.map +10 -0
- package/dist/cjs/functions/information/row/row.cjs +150 -0
- package/dist/cjs/functions/information/row/row.cjs.map +10 -0
- package/dist/cjs/functions/logical/and/and.cjs +112 -0
- package/dist/cjs/functions/logical/and/and.cjs.map +10 -0
- package/dist/cjs/functions/logical/if/if.cjs +195 -0
- package/dist/cjs/functions/logical/if/if.cjs.map +10 -0
- package/dist/cjs/functions/logical/iferror/iferror.cjs +126 -0
- package/dist/cjs/functions/logical/iferror/iferror.cjs.map +10 -0
- package/dist/cjs/functions/logical/or/or.cjs +112 -0
- package/dist/cjs/functions/logical/or/or.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/count-utils.cjs +65 -0
- package/dist/cjs/functions/lookup/count/count-utils.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/count.cjs +48 -0
- package/dist/cjs/functions/lookup/count/count.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/countif.cjs +94 -0
- package/dist/cjs/functions/lookup/count/countif.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/countifs.cjs +63 -0
- package/dist/cjs/functions/lookup/count/countifs.cjs.map +10 -0
- package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs +187 -0
- package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs.map +10 -0
- package/dist/cjs/functions/lookup/match/match.cjs +168 -0
- package/dist/cjs/functions/lookup/match/match.cjs.map +10 -0
- package/dist/cjs/functions/lookup/xlookup/xlookup.cjs +410 -0
- package/dist/cjs/functions/lookup/xlookup/xlookup.cjs.map +10 -0
- package/dist/cjs/functions/math/average/average-utils.cjs +72 -0
- package/dist/cjs/functions/math/average/average-utils.cjs.map +10 -0
- package/dist/cjs/functions/math/average/average.cjs +48 -0
- package/dist/cjs/functions/math/average/average.cjs.map +10 -0
- package/dist/cjs/functions/math/average/averageif.cjs +83 -0
- package/dist/cjs/functions/math/average/averageif.cjs.map +10 -0
- package/dist/cjs/functions/math/average/averageifs.cjs +61 -0
- package/dist/cjs/functions/math/average/averageifs.cjs.map +10 -0
- package/dist/cjs/functions/math/ceiling/ceiling.cjs +219 -0
- package/dist/cjs/functions/math/ceiling/ceiling.cjs.map +10 -0
- package/dist/cjs/functions/math/max/max-utils.cjs +71 -0
- package/dist/cjs/functions/math/max/max-utils.cjs.map +10 -0
- package/dist/cjs/functions/math/max/max.cjs +48 -0
- package/dist/cjs/functions/math/max/max.cjs.map +10 -0
- package/dist/cjs/functions/math/max/maxif.cjs +83 -0
- package/dist/cjs/functions/math/max/maxif.cjs.map +10 -0
- package/dist/cjs/functions/math/max/maxifs.cjs +61 -0
- package/dist/cjs/functions/math/max/maxifs.cjs.map +10 -0
- package/dist/cjs/functions/math/min/min-utils.cjs +71 -0
- package/dist/cjs/functions/math/min/min-utils.cjs.map +10 -0
- package/dist/cjs/functions/math/min/min.cjs +48 -0
- package/dist/cjs/functions/math/min/min.cjs.map +10 -0
- package/dist/cjs/functions/math/min/minif.cjs +83 -0
- package/dist/cjs/functions/math/min/minif.cjs.map +10 -0
- package/dist/cjs/functions/math/min/minifs.cjs +61 -0
- package/dist/cjs/functions/math/min/minifs.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/sum.cjs +48 -0
- package/dist/cjs/functions/math/sum/sum.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/sumif.cjs +83 -0
- package/dist/cjs/functions/math/sum/sumif.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/sumifs.cjs +60 -0
- package/dist/cjs/functions/math/sum/sumifs.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/summation-utils.cjs +57 -0
- package/dist/cjs/functions/math/sum/summation-utils.cjs.map +10 -0
- package/dist/cjs/functions/reference/address/address.cjs +163 -0
- package/dist/cjs/functions/reference/address/address.cjs.map +10 -0
- package/dist/cjs/functions/reference/indirect/indirect.cjs +102 -0
- package/dist/cjs/functions/reference/indirect/indirect.cjs.map +10 -0
- package/dist/cjs/functions/reference/offset/offset.cjs +233 -0
- package/dist/cjs/functions/reference/offset/offset.cjs.map +10 -0
- package/dist/cjs/functions/text/concatenate/concatenate.cjs +167 -0
- package/dist/cjs/functions/text/concatenate/concatenate.cjs.map +10 -0
- package/dist/cjs/functions/text/exact/exact.cjs +171 -0
- package/dist/cjs/functions/text/exact/exact.cjs.map +10 -0
- package/dist/cjs/functions/text/find/find.cjs +397 -0
- package/dist/cjs/functions/text/find/find.cjs.map +10 -0
- package/dist/cjs/functions/text/left/left.cjs +109 -0
- package/dist/cjs/functions/text/left/left.cjs.map +10 -0
- package/dist/cjs/functions/text/len/len.cjs +119 -0
- package/dist/cjs/functions/text/len/len.cjs.map +10 -0
- package/dist/cjs/functions/text/mid/mid.cjs +103 -0
- package/dist/cjs/functions/text/mid/mid.cjs.map +10 -0
- package/dist/cjs/functions/text/right/right.cjs +167 -0
- package/dist/cjs/functions/text/right/right.cjs.map +10 -0
- package/dist/cjs/functions/text/text-helpers.cjs +179 -0
- package/dist/cjs/functions/text/text-helpers.cjs.map +10 -0
- package/dist/cjs/functions/text/textjoin/textjoin.cjs +173 -0
- package/dist/cjs/functions/text/textjoin/textjoin.cjs.map +10 -0
- package/dist/cjs/package.json +5 -0
- package/dist/cjs/parser/ast.cjs +175 -0
- package/dist/cjs/parser/ast.cjs.map +10 -0
- package/dist/cjs/parser/formatter.cjs +319 -0
- package/dist/cjs/parser/formatter.cjs.map +10 -0
- package/dist/cjs/parser/grammar.cjs +375 -0
- package/dist/cjs/parser/grammar.cjs.map +10 -0
- package/dist/cjs/parser/lexer.cjs +443 -0
- package/dist/cjs/parser/lexer.cjs.map +10 -0
- package/dist/cjs/parser/parser.cjs +1700 -0
- package/dist/cjs/parser/parser.cjs.map +10 -0
- package/dist/cjs/react/hooks.cjs +59 -0
- package/dist/cjs/react/hooks.cjs.map +10 -0
- package/dist/mjs/core/ast-traverser.mjs +94 -0
- package/dist/mjs/core/ast-traverser.mjs.map +10 -0
- package/dist/mjs/core/autofill-utils.mjs +274 -0
- package/dist/mjs/core/autofill-utils.mjs.map +10 -0
- package/dist/mjs/core/engine.mjs +366 -0
- package/dist/mjs/core/engine.mjs.map +10 -0
- package/dist/mjs/core/managers/cache-manager.mjs +27 -0
- package/dist/mjs/core/managers/cache-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/dependency-manager.mjs +593 -0
- package/dist/mjs/core/managers/dependency-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/dependency-node.mjs +2 -0
- package/dist/mjs/core/managers/dependency-node.mjs.map +9 -0
- package/dist/mjs/core/managers/evaluation-manager.mjs +415 -0
- package/dist/mjs/core/managers/evaluation-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/event-manager.mjs +18 -0
- package/dist/mjs/core/managers/event-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/frontier-dependency-manager.mjs +151 -0
- package/dist/mjs/core/managers/frontier-dependency-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/index.mjs +21 -0
- package/dist/mjs/core/managers/index.mjs.map +10 -0
- package/dist/mjs/core/managers/isDependencyNode.mjs +14 -0
- package/dist/mjs/core/managers/isDependencyNode.mjs.map +10 -0
- package/dist/mjs/core/managers/named-expression-manager.mjs +348 -0
- package/dist/mjs/core/managers/named-expression-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/range-eval-order-builder.mjs +618 -0
- package/dist/mjs/core/managers/range-eval-order-builder.mjs.map +10 -0
- package/dist/mjs/core/managers/table-manager.mjs +224 -0
- package/dist/mjs/core/managers/table-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/workbook-manager.mjs +447 -0
- package/dist/mjs/core/managers/workbook-manager.mjs.map +10 -0
- package/dist/mjs/core/map-serializer.mjs +39 -0
- package/dist/mjs/core/map-serializer.mjs.map +10 -0
- package/dist/mjs/core/named-expression-renamer.mjs +58 -0
- package/dist/mjs/core/named-expression-renamer.mjs.map +10 -0
- package/dist/mjs/core/sheet-renamer.mjs +59 -0
- package/dist/mjs/core/sheet-renamer.mjs.map +10 -0
- package/dist/mjs/core/sheet-utils.mjs +8 -0
- package/dist/mjs/core/sheet-utils.mjs.map +10 -0
- package/dist/mjs/core/table-renamer.mjs +58 -0
- package/dist/mjs/core/table-renamer.mjs.map +10 -0
- package/dist/mjs/core/types.mjs +18 -0
- package/dist/mjs/core/types.mjs.map +10 -0
- package/dist/mjs/core/utils/range-serializer.mjs +35 -0
- package/dist/mjs/core/utils/range-serializer.mjs.map +10 -0
- package/dist/mjs/core/utils/spreadsheet-visualizer.mjs +112 -0
- package/dist/mjs/core/utils/spreadsheet-visualizer.mjs.map +10 -0
- package/dist/mjs/core/utils.mjs +409 -0
- package/dist/mjs/core/utils.mjs.map +10 -0
- package/dist/mjs/core/workbook-renamer.mjs +76 -0
- package/dist/mjs/core/workbook-renamer.mjs.map +10 -0
- package/dist/mjs/debug/flags.mjs +17 -0
- package/dist/mjs/debug/flags.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/add/add.mjs +52 -0
- package/dist/mjs/evaluator/arithmetic/add/add.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/divide/divide.mjs +77 -0
- package/dist/mjs/evaluator/arithmetic/divide/divide.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/multiply/multiply.mjs +63 -0
- package/dist/mjs/evaluator/arithmetic/multiply/multiply.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/power/power.mjs +95 -0
- package/dist/mjs/evaluator/arithmetic/power/power.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/subtract/subtract.mjs +54 -0
- package/dist/mjs/evaluator/arithmetic/subtract/subtract.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/equals.mjs +34 -0
- package/dist/mjs/evaluator/comparison/equals.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/greater-than-or-equal.mjs +31 -0
- package/dist/mjs/evaluator/comparison/greater-than-or-equal.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/greater-than.mjs +31 -0
- package/dist/mjs/evaluator/comparison/greater-than.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/less-than-or-equal.mjs +39 -0
- package/dist/mjs/evaluator/comparison/less-than-or-equal.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/less-than.mjs +38 -0
- package/dist/mjs/evaluator/comparison/less-than.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/not-equals.mjs +23 -0
- package/dist/mjs/evaluator/comparison/not-equals.mjs.map +10 -0
- package/dist/mjs/evaluator/concatenation/concatenate.mjs +42 -0
- package/dist/mjs/evaluator/concatenation/concatenate.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/ast-evaluation-node.mjs +28 -0
- package/dist/mjs/evaluator/dependency-nodes/ast-evaluation-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs +81 -0
- package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs +24 -0
- package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs +78 -0
- package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/spill-meta-node.mjs +20 -0
- package/dist/mjs/evaluator/dependency-nodes/spill-meta-node.mjs.map +10 -0
- package/dist/mjs/evaluator/evaluate-scalar-operator.mjs +226 -0
- package/dist/mjs/evaluator/evaluate-scalar-operator.mjs.map +10 -0
- package/dist/mjs/evaluator/evaluation-context.mjs +123 -0
- package/dist/mjs/evaluator/evaluation-context.mjs.map +10 -0
- package/dist/mjs/evaluator/evaluation-error.mjs +44 -0
- package/dist/mjs/evaluator/evaluation-error.mjs.map +10 -0
- package/dist/mjs/evaluator/formula-evaluator.mjs +780 -0
- package/dist/mjs/evaluator/formula-evaluator.mjs.map +10 -0
- package/dist/mjs/evaluator/range-evaluation-node.mjs +58 -0
- package/dist/mjs/evaluator/range-evaluation-node.mjs.map +10 -0
- package/dist/mjs/functions/_template/template.mjs +12 -0
- package/dist/mjs/functions/_template/template.mjs.map +10 -0
- package/dist/mjs/functions/array/sequence/sequence.mjs +287 -0
- package/dist/mjs/functions/array/sequence/sequence.mjs.map +10 -0
- package/dist/mjs/functions/criteria-parser.mjs +187 -0
- package/dist/mjs/functions/criteria-parser.mjs.map +10 -0
- package/dist/mjs/functions/criteria-utils.mjs +268 -0
- package/dist/mjs/functions/criteria-utils.mjs.map +10 -0
- package/dist/mjs/functions/function-utils.mjs +33 -0
- package/dist/mjs/functions/function-utils.mjs.map +10 -0
- package/dist/mjs/functions/index.mjs +95 -0
- package/dist/mjs/functions/index.mjs.map +10 -0
- package/dist/mjs/functions/information/cell/cell.mjs +168 -0
- package/dist/mjs/functions/information/cell/cell.mjs.map +10 -0
- package/dist/mjs/functions/information/column/column.mjs +120 -0
- package/dist/mjs/functions/information/column/column.mjs.map +10 -0
- package/dist/mjs/functions/information/row/row.mjs +126 -0
- package/dist/mjs/functions/information/row/row.mjs.map +10 -0
- package/dist/mjs/functions/logical/and/and.mjs +84 -0
- package/dist/mjs/functions/logical/and/and.mjs.map +10 -0
- package/dist/mjs/functions/logical/if/if.mjs +167 -0
- package/dist/mjs/functions/logical/if/if.mjs.map +10 -0
- package/dist/mjs/functions/logical/iferror/iferror.mjs +98 -0
- package/dist/mjs/functions/logical/iferror/iferror.mjs.map +10 -0
- package/dist/mjs/functions/logical/or/or.mjs +84 -0
- package/dist/mjs/functions/logical/or/or.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/count-utils.mjs +35 -0
- package/dist/mjs/functions/lookup/count/count-utils.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/count.mjs +18 -0
- package/dist/mjs/functions/lookup/count/count.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/countif.mjs +68 -0
- package/dist/mjs/functions/lookup/count/countif.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/countifs.mjs +37 -0
- package/dist/mjs/functions/lookup/count/countifs.mjs.map +10 -0
- package/dist/mjs/functions/lookup/index-lookup/index-lookup.mjs +159 -0
- package/dist/mjs/functions/lookup/index-lookup/index-lookup.mjs.map +10 -0
- package/dist/mjs/functions/lookup/match/match.mjs +140 -0
- package/dist/mjs/functions/lookup/match/match.mjs.map +10 -0
- package/dist/mjs/functions/lookup/xlookup/xlookup.mjs +382 -0
- package/dist/mjs/functions/lookup/xlookup/xlookup.mjs.map +10 -0
- package/dist/mjs/functions/math/average/average-utils.mjs +44 -0
- package/dist/mjs/functions/math/average/average-utils.mjs.map +10 -0
- package/dist/mjs/functions/math/average/average.mjs +18 -0
- package/dist/mjs/functions/math/average/average.mjs.map +10 -0
- package/dist/mjs/functions/math/average/averageif.mjs +58 -0
- package/dist/mjs/functions/math/average/averageif.mjs.map +10 -0
- package/dist/mjs/functions/math/average/averageifs.mjs +35 -0
- package/dist/mjs/functions/math/average/averageifs.mjs.map +10 -0
- package/dist/mjs/functions/math/ceiling/ceiling.mjs +191 -0
- package/dist/mjs/functions/math/ceiling/ceiling.mjs.map +10 -0
- package/dist/mjs/functions/math/max/max-utils.mjs +43 -0
- package/dist/mjs/functions/math/max/max-utils.mjs.map +10 -0
- package/dist/mjs/functions/math/max/max.mjs +18 -0
- package/dist/mjs/functions/math/max/max.mjs.map +10 -0
- package/dist/mjs/functions/math/max/maxif.mjs +58 -0
- package/dist/mjs/functions/math/max/maxif.mjs.map +10 -0
- package/dist/mjs/functions/math/max/maxifs.mjs +35 -0
- package/dist/mjs/functions/math/max/maxifs.mjs.map +10 -0
- package/dist/mjs/functions/math/min/min-utils.mjs +43 -0
- package/dist/mjs/functions/math/min/min-utils.mjs.map +10 -0
- package/dist/mjs/functions/math/min/min.mjs +18 -0
- package/dist/mjs/functions/math/min/min.mjs.map +10 -0
- package/dist/mjs/functions/math/min/minif.mjs +58 -0
- package/dist/mjs/functions/math/min/minif.mjs.map +10 -0
- package/dist/mjs/functions/math/min/minifs.mjs +35 -0
- package/dist/mjs/functions/math/min/minifs.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/sum.mjs +18 -0
- package/dist/mjs/functions/math/sum/sum.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/sumif.mjs +58 -0
- package/dist/mjs/functions/math/sum/sumif.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/sumifs.mjs +34 -0
- package/dist/mjs/functions/math/sum/sumifs.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/summation-utils.mjs +27 -0
- package/dist/mjs/functions/math/sum/summation-utils.mjs.map +10 -0
- package/dist/mjs/functions/reference/address/address.mjs +135 -0
- package/dist/mjs/functions/reference/address/address.mjs.map +10 -0
- package/dist/mjs/functions/reference/indirect/indirect.mjs +74 -0
- package/dist/mjs/functions/reference/indirect/indirect.mjs.map +10 -0
- package/dist/mjs/functions/reference/offset/offset.mjs +205 -0
- package/dist/mjs/functions/reference/offset/offset.mjs.map +10 -0
- package/dist/mjs/functions/text/concatenate/concatenate.mjs +139 -0
- package/dist/mjs/functions/text/concatenate/concatenate.mjs.map +10 -0
- package/dist/mjs/functions/text/exact/exact.mjs +143 -0
- package/dist/mjs/functions/text/exact/exact.mjs.map +10 -0
- package/dist/mjs/functions/text/find/find.mjs +369 -0
- package/dist/mjs/functions/text/find/find.mjs.map +10 -0
- package/dist/mjs/functions/text/left/left.mjs +81 -0
- package/dist/mjs/functions/text/left/left.mjs.map +10 -0
- package/dist/mjs/functions/text/len/len.mjs +91 -0
- package/dist/mjs/functions/text/len/len.mjs.map +10 -0
- package/dist/mjs/functions/text/mid/mid.mjs +75 -0
- package/dist/mjs/functions/text/mid/mid.mjs.map +10 -0
- package/dist/mjs/functions/text/right/right.mjs +143 -0
- package/dist/mjs/functions/text/right/right.mjs.map +10 -0
- package/dist/mjs/functions/text/text-helpers.mjs +151 -0
- package/dist/mjs/functions/text/text-helpers.mjs.map +10 -0
- package/dist/mjs/functions/text/textjoin/textjoin.mjs +145 -0
- package/dist/mjs/functions/text/textjoin/textjoin.mjs.map +10 -0
- package/dist/mjs/package.json +5 -0
- package/dist/mjs/parser/ast.mjs +145 -0
- package/dist/mjs/parser/ast.mjs.map +10 -0
- package/dist/mjs/parser/formatter.mjs +289 -0
- package/dist/mjs/parser/formatter.mjs.map +10 -0
- package/dist/mjs/parser/grammar.mjs +345 -0
- package/dist/mjs/parser/grammar.mjs.map +10 -0
- package/dist/mjs/parser/lexer.mjs +412 -0
- package/dist/mjs/parser/lexer.mjs.map +10 -0
- package/dist/mjs/parser/parser.mjs +1692 -0
- package/dist/mjs/parser/parser.mjs.map +10 -0
- package/dist/mjs/react/hooks.mjs +16 -0
- package/dist/mjs/react/hooks.mjs.map +10 -0
- package/dist/types/core/ast-traverser.d.ts +28 -0
- package/dist/types/core/autofill-utils.d.ts +32 -0
- package/dist/types/core/engine.d.ts +184 -0
- package/dist/types/core/managers/cache-manager.d.ts +14 -0
- package/dist/types/core/managers/dependency-manager.d.ts +147 -0
- package/dist/types/core/managers/dependency-node.d.ts +13 -0
- package/dist/types/core/managers/evaluation-manager.d.ts +30 -0
- package/dist/types/core/managers/event-manager.d.ts +8 -0
- package/dist/types/core/managers/frontier-dependency-manager.d.ts +69 -0
- package/dist/types/core/managers/index.d.ts +7 -0
- package/dist/types/core/managers/isDependencyNode.d.ts +2 -0
- package/dist/types/core/managers/named-expression-manager.d.ts +101 -0
- package/dist/types/core/managers/range-eval-order-builder.d.ts +33 -0
- package/dist/types/core/managers/table-manager.d.ts +84 -0
- package/dist/types/core/managers/workbook-manager.d.ts +136 -0
- package/dist/types/core/map-serializer.d.ts +4 -0
- package/dist/types/core/named-expression-renamer.d.ts +21 -0
- package/dist/types/core/sheet-renamer.d.ts +28 -0
- package/dist/types/core/sheet-utils.d.ts +2 -0
- package/dist/types/core/table-renamer.d.ts +21 -0
- package/dist/types/core/types.d.ts +272 -0
- package/dist/types/core/utils/cell-address-parsing.test.d.ts +1 -0
- package/dist/types/core/utils/range-serializer.d.ts +22 -0
- package/dist/types/core/utils/range-serializer.test.d.ts +1 -0
- package/dist/types/core/utils/spreadsheet-visualizer.d.ts +30 -0
- package/dist/types/core/utils.d.ts +48 -0
- package/dist/types/core/workbook-renamer.d.ts +28 -0
- package/dist/types/debug/flags.d.ts +11 -0
- package/dist/types/evaluator/arithmetic/add/add.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/add/add.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/divide/divide.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/divide/divide.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/multiply/multiply.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/multiply/multiply.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/power/power.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/power/power.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/subtract/subtract.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/subtract/subtract.test.d.ts +1 -0
- package/dist/types/evaluator/comparison/comparison-operators.test.d.ts +1 -0
- package/dist/types/evaluator/comparison/equals.d.ts +6 -0
- package/dist/types/evaluator/comparison/greater-than-or-equal.d.ts +6 -0
- package/dist/types/evaluator/comparison/greater-than.d.ts +6 -0
- package/dist/types/evaluator/comparison/less-than-or-equal.d.ts +6 -0
- package/dist/types/evaluator/comparison/less-than.d.ts +6 -0
- package/dist/types/evaluator/comparison/not-equals.d.ts +6 -0
- package/dist/types/evaluator/concatenation/concatenate.d.ts +6 -0
- package/dist/types/evaluator/concatenation/concatenate.test.d.ts +1 -0
- package/dist/types/evaluator/dependency-nodes/ast-evaluation-node.d.ts +12 -0
- package/dist/types/evaluator/dependency-nodes/base-eval-node.d.ts +31 -0
- package/dist/types/evaluator/dependency-nodes/cell-value-node.d.ts +10 -0
- package/dist/types/evaluator/dependency-nodes/empty-cell-evaluation-node.d.ts +17 -0
- package/dist/types/evaluator/dependency-nodes/spill-meta-node.d.ts +7 -0
- package/dist/types/evaluator/evaluate-scalar-operator.d.ts +12 -0
- package/dist/types/evaluator/evaluation-context.d.ts +66 -0
- package/dist/types/evaluator/evaluation-error.d.ts +20 -0
- package/dist/types/evaluator/formula-evaluator.d.ts +67 -0
- package/dist/types/evaluator/open-range-evaluator.test.d.ts +1 -0
- package/dist/types/evaluator/range-evaluation-node.d.ts +16 -0
- package/dist/types/functions/_template/template.d.ts +5 -0
- package/dist/types/functions/_template/template.test.d.ts +1 -0
- package/dist/types/functions/array/sequence/performance-test.d.ts +1 -0
- package/dist/types/functions/array/sequence/sequence.d.ts +14 -0
- package/dist/types/functions/array/sequence/sequence.test.d.ts +1 -0
- package/dist/types/functions/criteria-parser.d.ts +27 -0
- package/dist/types/functions/criteria-utils.d.ts +61 -0
- package/dist/types/functions/function-utils.d.ts +21 -0
- package/dist/types/functions/index.d.ts +2 -0
- package/dist/types/functions/information/cell/cell.d.ts +24 -0
- package/dist/types/functions/information/cell/cell.test.d.ts +1 -0
- package/dist/types/functions/information/column/column.d.ts +14 -0
- package/dist/types/functions/information/column/column.test.d.ts +1 -0
- package/dist/types/functions/information/row/row.d.ts +14 -0
- package/dist/types/functions/information/row/row.test.d.ts +1 -0
- package/dist/types/functions/logical/and/and.d.ts +5 -0
- package/dist/types/functions/logical/and/and.test.d.ts +1 -0
- package/dist/types/functions/logical/if/if.d.ts +5 -0
- package/dist/types/functions/logical/if/if.test.d.ts +1 -0
- package/dist/types/functions/logical/iferror/iferror.d.ts +5 -0
- package/dist/types/functions/logical/iferror/iferror.test.d.ts +1 -0
- package/dist/types/functions/logical/or/or.d.ts +5 -0
- package/dist/types/functions/logical/or/or.test.d.ts +1 -0
- package/dist/types/functions/lookup/count/count-utils.d.ts +14 -0
- package/dist/types/functions/lookup/count/count.d.ts +21 -0
- package/dist/types/functions/lookup/count/count.test.d.ts +1 -0
- package/dist/types/functions/lookup/count/countif.d.ts +26 -0
- package/dist/types/functions/lookup/count/countif.test.d.ts +1 -0
- package/dist/types/functions/lookup/count/countifs.d.ts +21 -0
- package/dist/types/functions/lookup/count/countifs.test.d.ts +1 -0
- package/dist/types/functions/lookup/index-lookup/index-lookup.d.ts +2 -0
- package/dist/types/functions/lookup/index-lookup/index-lookup.test.d.ts +1 -0
- package/dist/types/functions/lookup/match/match.d.ts +2 -0
- package/dist/types/functions/lookup/match/match.test.d.ts +1 -0
- package/dist/types/functions/lookup/xlookup/xlookup.d.ts +2 -0
- package/dist/types/functions/lookup/xlookup/xlookup.test.d.ts +1 -0
- package/dist/types/functions/math/average/average-utils.d.ts +10 -0
- package/dist/types/functions/math/average/average.d.ts +18 -0
- package/dist/types/functions/math/average/average.test.d.ts +1 -0
- package/dist/types/functions/math/average/averageif.d.ts +23 -0
- package/dist/types/functions/math/average/averageif.test.d.ts +1 -0
- package/dist/types/functions/math/average/averageifs.d.ts +21 -0
- package/dist/types/functions/math/average/averageifs.test.d.ts +1 -0
- package/dist/types/functions/math/ceiling/ceiling.d.ts +5 -0
- package/dist/types/functions/math/ceiling/ceiling.test.d.ts +1 -0
- package/dist/types/functions/math/max/max-utils.d.ts +20 -0
- package/dist/types/functions/math/max/max.d.ts +18 -0
- package/dist/types/functions/math/max/max.test.d.ts +1 -0
- package/dist/types/functions/math/max/maxif.d.ts +23 -0
- package/dist/types/functions/math/max/maxif.test.d.ts +1 -0
- package/dist/types/functions/math/max/maxifs.d.ts +21 -0
- package/dist/types/functions/math/max/maxifs.test.d.ts +1 -0
- package/dist/types/functions/math/min/min-utils.d.ts +20 -0
- package/dist/types/functions/math/min/min.d.ts +5 -0
- package/dist/types/functions/math/min/min.test.d.ts +1 -0
- package/dist/types/functions/math/min/minif.d.ts +23 -0
- package/dist/types/functions/math/min/minif.test.d.ts +1 -0
- package/dist/types/functions/math/min/minifs.d.ts +21 -0
- package/dist/types/functions/math/min/minifs.test.d.ts +1 -0
- package/dist/types/functions/math/sum/sum.d.ts +5 -0
- package/dist/types/functions/math/sum/sum.test.d.ts +1 -0
- package/dist/types/functions/math/sum/sumif.d.ts +23 -0
- package/dist/types/functions/math/sum/sumif.test.d.ts +1 -0
- package/dist/types/functions/math/sum/sumifs.d.ts +21 -0
- package/dist/types/functions/math/sum/sumifs.test.d.ts +1 -0
- package/dist/types/functions/math/sum/summation-utils.d.ts +19 -0
- package/dist/types/functions/reference/address/address.d.ts +18 -0
- package/dist/types/functions/reference/address/address.test.d.ts +1 -0
- package/dist/types/functions/reference/indirect/indirect.d.ts +20 -0
- package/dist/types/functions/reference/indirect/indirect.test.d.ts +1 -0
- package/dist/types/functions/reference/offset/offset.d.ts +23 -0
- package/dist/types/functions/reference/offset/offset.test.d.ts +1 -0
- package/dist/types/functions/text/concatenate/concatenate.d.ts +5 -0
- package/dist/types/functions/text/concatenate/concatenate.test.d.ts +1 -0
- package/dist/types/functions/text/exact/exact.d.ts +5 -0
- package/dist/types/functions/text/exact/exact.test.d.ts +1 -0
- package/dist/types/functions/text/find/find.d.ts +20 -0
- package/dist/types/functions/text/find/find.test.d.ts +1 -0
- package/dist/types/functions/text/left/left.d.ts +19 -0
- package/dist/types/functions/text/left/left.test.d.ts +1 -0
- package/dist/types/functions/text/len/len.d.ts +16 -0
- package/dist/types/functions/text/len/len.test.d.ts +1 -0
- package/dist/types/functions/text/mid/mid.d.ts +20 -0
- package/dist/types/functions/text/mid/mid.test.d.ts +1 -0
- package/dist/types/functions/text/right/right.d.ts +2 -0
- package/dist/types/functions/text/right/right.test.d.ts +1 -0
- package/dist/types/functions/text/text-helpers.d.ts +27 -0
- package/dist/types/functions/text/textjoin/textjoin.d.ts +5 -0
- package/dist/types/functions/text/textjoin/textjoin.test.d.ts +1 -0
- package/dist/types/parser/ast.d.ts +275 -0
- package/dist/types/parser/formatter.d.ts +6 -0
- package/dist/types/parser/grammar.d.ts +203 -0
- package/dist/types/parser/lexer.d.ts +144 -0
- package/dist/types/parser/parser.d.ts +159 -0
- package/dist/types/react/hooks.d.ts +5 -0
- package/package.json +41 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FormulaEvaluator } from "src/evaluator/formula-evaluator";
|
|
2
|
+
import { type ArethmeticEvaluator, type FunctionEvaluationResult } from "../core/types";
|
|
3
|
+
import type { EvaluationContext } from "./evaluation-context";
|
|
4
|
+
export type EvaluateScalarOperatorOptions = {
|
|
5
|
+
evaluateScalar: ArethmeticEvaluator;
|
|
6
|
+
context: EvaluationContext;
|
|
7
|
+
/**
|
|
8
|
+
* for debugging messages
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function evaluateScalarOperator(this: FormulaEvaluator, left: FunctionEvaluationResult, right: FunctionEvaluationResult, options: EvaluateScalarOperatorOptions): FunctionEvaluationResult;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { TableManager } from "src/core/managers";
|
|
2
|
+
import type { DependencyNode } from "src/core/managers/dependency-node";
|
|
3
|
+
import type { CellAddress } from "src/core/types";
|
|
4
|
+
export declare class EvaluationContext {
|
|
5
|
+
private _cellAddress;
|
|
6
|
+
private _tableName;
|
|
7
|
+
/**
|
|
8
|
+
* Can be a range or a cell
|
|
9
|
+
*/
|
|
10
|
+
private _dependencyNode;
|
|
11
|
+
constructor(tableManager: TableManager, dependencyNode: DependencyNode, cellAddress: CellAddress);
|
|
12
|
+
get dependencyNode(): DependencyNode;
|
|
13
|
+
private _contextDependency;
|
|
14
|
+
getContextDependency(): ContextDependency;
|
|
15
|
+
/**
|
|
16
|
+
* The cell context, the address of the cell being evaluated
|
|
17
|
+
* and the context in which results should be stored
|
|
18
|
+
*/
|
|
19
|
+
get cellAddress(): CellAddress;
|
|
20
|
+
get tableName(): string | undefined;
|
|
21
|
+
addContextDependency(...types: ContextDependencyType[]): void;
|
|
22
|
+
/**
|
|
23
|
+
* When evaluating an AST node,
|
|
24
|
+
* we need to append the subtree context
|
|
25
|
+
* dependencies to the current context dependency
|
|
26
|
+
*/
|
|
27
|
+
appendContextDependency(contextDependency: ContextDependency): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Each value has the same value as the origin cell
|
|
31
|
+
* the defined keys are the ones the ast node is dependent on
|
|
32
|
+
* e.g. A3=ROW() will have a context dependency of { rowIndex: 3 }
|
|
33
|
+
*
|
|
34
|
+
* The keys are ANDed together, e.g. { workbookName: "Sheet1", sheetName: "Sheet2" }
|
|
35
|
+
* means the ast node is dependent on the workbook "Sheet1" and the sheet "Sheet2"
|
|
36
|
+
*/
|
|
37
|
+
export type ContextDependency = {
|
|
38
|
+
workbookName?: string;
|
|
39
|
+
sheetName?: string;
|
|
40
|
+
tableName?: string;
|
|
41
|
+
rowIndex?: number;
|
|
42
|
+
colIndex?: number;
|
|
43
|
+
};
|
|
44
|
+
export declare const contextDependencyKeys: readonly ["workbookName", "sheetName", "tableName", "rowIndex", "colIndex"];
|
|
45
|
+
/**
|
|
46
|
+
* These are some distinct scenarios where context dependencies are added
|
|
47
|
+
*/
|
|
48
|
+
export type ContextDependencyType = "row" | "col" | "workbook" | "sheet" | "table";
|
|
49
|
+
/** Build the canonical cache key string for a dependency. */
|
|
50
|
+
export declare function keyFromDependency(dep: ContextDependency): string;
|
|
51
|
+
type Context = {
|
|
52
|
+
workbookName: string;
|
|
53
|
+
sheetName: string;
|
|
54
|
+
tableName?: string;
|
|
55
|
+
rowIndex: number;
|
|
56
|
+
colIndex: number;
|
|
57
|
+
};
|
|
58
|
+
/** True if `dep` matches `ctx` (i.e., every specified field equals the context’s field). */
|
|
59
|
+
export declare function dependencyMatchesContext(ctx: Context, dep: ContextDependency): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Generate every cache key that would be eligible for `ctx`.
|
|
62
|
+
* By default returns keys ordered from most-specific to least-specific.
|
|
63
|
+
*/
|
|
64
|
+
export declare function eligibleKeysForContext(ctx: Context): string[];
|
|
65
|
+
export declare function getContextDependencyKey(contextDependency: ContextDependency): string;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DependencyNode } from "src/core/managers/dependency-node";
|
|
2
|
+
import type { FormulaError } from "src/core/types";
|
|
3
|
+
export declare class EvaluationError extends Error {
|
|
4
|
+
readonly type: FormulaError;
|
|
5
|
+
readonly errAddress?: DependencyNode | undefined;
|
|
6
|
+
constructor(type: FormulaError, message: string, errAddress?: DependencyNode | undefined);
|
|
7
|
+
}
|
|
8
|
+
export declare class AwaitingEvaluationError extends Error {
|
|
9
|
+
readonly errAddress: DependencyNode;
|
|
10
|
+
readonly waitingFor: DependencyNode;
|
|
11
|
+
constructor(errAddress: DependencyNode, waitingFor: DependencyNode);
|
|
12
|
+
}
|
|
13
|
+
export declare class SheetNotFoundError extends Error {
|
|
14
|
+
readonly sheetName: string;
|
|
15
|
+
constructor(sheetName: string);
|
|
16
|
+
}
|
|
17
|
+
export declare class WorkbookNotFoundError extends Error {
|
|
18
|
+
readonly workbookName: string;
|
|
19
|
+
constructor(workbookName: string);
|
|
20
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type CellAddress, type CellValue, type FunctionEvaluationResult, type SpreadsheetRange } from "../core/types";
|
|
2
|
+
import type { DependencyManager } from "src/core/managers/dependency-manager";
|
|
3
|
+
import type { TableManager } from "src/core/managers/table-manager";
|
|
4
|
+
import { type EvaluateScalarOperatorOptions } from "src/evaluator/evaluate-scalar-operator";
|
|
5
|
+
import type { ArrayNode, ASTNode, BinaryOpNode, FunctionNode, NamedExpressionNode, RangeNode, ReferenceNode, StructuredReferenceNode, ThreeDRangeNode, UnaryOpNode, ValueNode } from "src/parser/ast";
|
|
6
|
+
import type { NamedExpressionManager } from "src/core/managers/named-expression-manager";
|
|
7
|
+
import { EvaluationContext } from "./evaluation-context";
|
|
8
|
+
export declare class FormulaEvaluator {
|
|
9
|
+
private tableManager;
|
|
10
|
+
private dependencyManager;
|
|
11
|
+
private namedExpressionManager;
|
|
12
|
+
constructor(tableManager: TableManager, dependencyManager: DependencyManager, namedExpressionManager: NamedExpressionManager);
|
|
13
|
+
evaluateFormula(
|
|
14
|
+
/**
|
|
15
|
+
* formula is the formula to evaluate, without the leading =
|
|
16
|
+
*/
|
|
17
|
+
formula: string, context: EvaluationContext): FunctionEvaluationResult;
|
|
18
|
+
evaluateNode(node: ASTNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
19
|
+
evaluateStructuredReference(node: StructuredReferenceNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
20
|
+
/**
|
|
21
|
+
* Evaluates a value node
|
|
22
|
+
*/
|
|
23
|
+
evaluateValue(node: ValueNode): CellValue;
|
|
24
|
+
evaluate3DRange(node: ThreeDRangeNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
25
|
+
evaluateRange(node: RangeNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
26
|
+
evaluateArray(node: ArrayNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
27
|
+
/**
|
|
28
|
+
* Evaluates a unary operation
|
|
29
|
+
*/
|
|
30
|
+
evaluateUnaryOp(node: UnaryOpNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
31
|
+
/**
|
|
32
|
+
* Evaluates a unary scalar operation
|
|
33
|
+
*/
|
|
34
|
+
private evaluateUnaryScalar;
|
|
35
|
+
/**
|
|
36
|
+
* Evaluates a binary operation
|
|
37
|
+
*/
|
|
38
|
+
evaluateBinaryOp(node: BinaryOpNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
39
|
+
/**
|
|
40
|
+
* Evaluates a reference node
|
|
41
|
+
*/
|
|
42
|
+
evaluateReference(node: ReferenceNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
43
|
+
/**
|
|
44
|
+
* Evaluates a named expression node
|
|
45
|
+
*/
|
|
46
|
+
evaluateNamedExpression(node: NamedExpressionNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
47
|
+
/**
|
|
48
|
+
* Binary scalar operations
|
|
49
|
+
*/
|
|
50
|
+
evaluateBinaryScalar(operator: string, left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
51
|
+
evaluateFunction(node: FunctionNode, context: EvaluationContext): FunctionEvaluationResult;
|
|
52
|
+
add(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
53
|
+
multiply(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
54
|
+
divide(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
55
|
+
evaluateScalarOperator(left: FunctionEvaluationResult, right: FunctionEvaluationResult, options: EvaluateScalarOperatorOptions): FunctionEvaluationResult;
|
|
56
|
+
subtract(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
57
|
+
power(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
58
|
+
equalsOp(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
59
|
+
notEqualsOp(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
60
|
+
lessThanOp(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
61
|
+
lessThanOrEqualOp(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
62
|
+
greaterThanOp(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
63
|
+
greaterThanOrEqualOp(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
64
|
+
concatenateOp(left: FunctionEvaluationResult, right: FunctionEvaluationResult, context: EvaluationContext): FunctionEvaluationResult;
|
|
65
|
+
projectRange(range: SpreadsheetRange, originCellAddress: CellAddress): SpreadsheetRange;
|
|
66
|
+
unionRanges(range1: SpreadsheetRange, range2: SpreadsheetRange): SpreadsheetRange;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DependencyManager } from "src/core/managers/dependency-manager";
|
|
2
|
+
import { FrontierDependencyManager } from "src/core/managers/frontier-dependency-manager";
|
|
3
|
+
import type { WorkbookManager } from "src/core/managers/workbook-manager";
|
|
4
|
+
import type { EvaluateAllCellsResult, RangeAddress } from "src/core/types";
|
|
5
|
+
export declare class RangeEvaluationNode extends FrontierDependencyManager {
|
|
6
|
+
rangeKey: string;
|
|
7
|
+
key: string;
|
|
8
|
+
address: RangeAddress;
|
|
9
|
+
private _result;
|
|
10
|
+
constructor(rangeKey: string, dependencyManager: DependencyManager, workbookManager: WorkbookManager);
|
|
11
|
+
setResult(result: EvaluateAllCellsResult): void;
|
|
12
|
+
get result(): EvaluateAllCellsResult;
|
|
13
|
+
canResolve(): boolean;
|
|
14
|
+
toJSON(visitor?: Set<string>): any;
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* SEQUENCE(rows, [columns], [start], [step])
|
|
4
|
+
* Generates a sequence of numbers in an array.
|
|
5
|
+
*
|
|
6
|
+
* @param rows - The number of rows to return (can be array - uses origin value)
|
|
7
|
+
* @param columns - [Optional] The number of columns to return (default: 1, can be array - uses origin value)
|
|
8
|
+
* @param start - [Optional] The first number in the sequence (default: 1, can be array - uses origin value)
|
|
9
|
+
* @param step - [Optional] The amount to increment each subsequent value (default: 1, can be array - uses origin value)
|
|
10
|
+
*
|
|
11
|
+
* Returns a spilled array of sequential numbers.
|
|
12
|
+
* When any argument is an array, the result is broadcast over the largest input spill area.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SEQUENCE: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CellValue } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* Parsed criteria result
|
|
4
|
+
*/
|
|
5
|
+
export type ParsedCriteria = {
|
|
6
|
+
type: "exact";
|
|
7
|
+
value: CellValue;
|
|
8
|
+
} | {
|
|
9
|
+
type: "comparison";
|
|
10
|
+
operator: ">" | "<" | ">=" | "<=" | "<>";
|
|
11
|
+
value: CellValue;
|
|
12
|
+
} | {
|
|
13
|
+
type: "wildcard";
|
|
14
|
+
pattern: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: "error";
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Simple criteria parser for COUNTIF
|
|
21
|
+
* Handles: exact values, comparisons (>5, <=10, <>0), and wildcards (*app, ?at)
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseCriteria(criteria: CellValue): ParsedCriteria;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a cell value matches the parsed criteria
|
|
26
|
+
*/
|
|
27
|
+
export declare function matchesParsedCriteria(cellValue: CellValue, parsedCriteria: ParsedCriteria): boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type FunctionEvaluationResult, type SingleEvaluationResult, type CellInfinity, type ErrorEvaluationResult } from "src/core/types";
|
|
2
|
+
import type { EvaluationContext } from "src/evaluator/evaluation-context";
|
|
3
|
+
import type { FormulaEvaluator } from "src/evaluator/formula-evaluator";
|
|
4
|
+
import type { FunctionNode, ASTNode } from "src/parser/ast";
|
|
5
|
+
import { type ParsedCriteria } from "./criteria-parser";
|
|
6
|
+
import type { LookupOrder } from "src/core/managers";
|
|
7
|
+
/**
|
|
8
|
+
* Criteria pair for criteria-based functions
|
|
9
|
+
*/
|
|
10
|
+
export interface CriteriaPair {
|
|
11
|
+
rangeResult: FunctionEvaluationResult;
|
|
12
|
+
parsedCriteria: ParsedCriteria;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse criteria pairs from function arguments
|
|
16
|
+
* @param node - The function node
|
|
17
|
+
* @param context - Evaluation context
|
|
18
|
+
* @param evaluateNode - Node evaluation function
|
|
19
|
+
* @param startIndex - Index to start parsing criteria pairs from (1 for IFS functions, 0 for COUNTIFS)
|
|
20
|
+
* @returns Array of criteria pairs or error
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseCriteriaPairs(this: FormulaEvaluator, node: FunctionNode, context: EvaluationContext, evaluateNode: (node: ASTNode, context: EvaluationContext) => FunctionEvaluationResult, startIndex?: number): CriteriaPair[] | ErrorEvaluationResult;
|
|
23
|
+
/**
|
|
24
|
+
* Check if any criteria involves empty/non-empty cell matching
|
|
25
|
+
*/
|
|
26
|
+
export declare function hasEmptyCriteria(criteriaPairs: CriteriaPair[]): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Returns matching values from ranges based on criteria
|
|
29
|
+
* @param evaluator - The function evaluator context
|
|
30
|
+
* @param valueRangeResult - The range of values to process
|
|
31
|
+
* @param criteriaPairs - Array of criteria pairs to match against
|
|
32
|
+
* @param context - Evaluation context
|
|
33
|
+
* @returns Array of SingleEvaluationResult for each matching cell - includes both values and errors
|
|
34
|
+
* Consuming functions decide whether to skip errors or propagate them
|
|
35
|
+
*/
|
|
36
|
+
export declare function processMultiCriteriaValues(evaluator: FormulaEvaluator, valueRangeResult: FunctionEvaluationResult, criteriaPairs: CriteriaPair[], context: EvaluationContext, lookupOrder: LookupOrder): {
|
|
37
|
+
type: "values";
|
|
38
|
+
values: SingleEvaluationResult[];
|
|
39
|
+
} | ErrorEvaluationResult;
|
|
40
|
+
/**
|
|
41
|
+
* Validate multi-criteria function arguments (odd number, min 3)
|
|
42
|
+
*/
|
|
43
|
+
export declare function validateMultiCriteriaArgs(functionName: string, argCount: number, context: EvaluationContext): ErrorEvaluationResult | null;
|
|
44
|
+
/**
|
|
45
|
+
* Validate COUNTIFS function arguments (even number, min 2)
|
|
46
|
+
*/
|
|
47
|
+
export declare function validateCountifsArgs(argCount: number, context: EvaluationContext): ErrorEvaluationResult | null;
|
|
48
|
+
/**
|
|
49
|
+
* Validate single criteria function arguments (2 or 3)
|
|
50
|
+
*/
|
|
51
|
+
export declare function validateSingleCriteriaArgs(functionName: string, argCount: number, context: EvaluationContext): ErrorEvaluationResult | null;
|
|
52
|
+
/**
|
|
53
|
+
* Result type for processInfinity - either return infinity immediately or continue with updated state
|
|
54
|
+
*/
|
|
55
|
+
export type ProcessInfinityResult<T> = {
|
|
56
|
+
type: "infinity";
|
|
57
|
+
infinity: CellInfinity;
|
|
58
|
+
} | {
|
|
59
|
+
type: "state";
|
|
60
|
+
state: T;
|
|
61
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LookupOrder } from "src/core/managers";
|
|
2
|
+
import { type ErrorEvaluationResult, type SingleEvaluationResult } from "src/core/types";
|
|
3
|
+
import type { EvaluationContext } from "src/evaluator/evaluation-context";
|
|
4
|
+
import type { FormulaEvaluator } from "src/evaluator/formula-evaluator";
|
|
5
|
+
import type { FunctionNode } from "src/parser/ast";
|
|
6
|
+
/**
|
|
7
|
+
* Creates an array of all values from arguments of a function node
|
|
8
|
+
* Returns SingleEvaluationResult for each value found in the arguments
|
|
9
|
+
*
|
|
10
|
+
* This is a shared utility used by all basic aggregation functions (SUM, MIN, MAX, AVERAGE)
|
|
11
|
+
* to iterate over their arguments in a consistent way.
|
|
12
|
+
*
|
|
13
|
+
* @param evaluator - The formula evaluator instance
|
|
14
|
+
* @param node - The function node containing arguments
|
|
15
|
+
* @param context - The evaluation context
|
|
16
|
+
* @returns Array of SingleEvaluationResult for each value in the arguments
|
|
17
|
+
*/
|
|
18
|
+
export declare function createArgumentIterator(evaluator: FormulaEvaluator, node: FunctionNode, context: EvaluationContext, lookupOrder: LookupOrder): {
|
|
19
|
+
type: "values";
|
|
20
|
+
values: SingleEvaluationResult[];
|
|
21
|
+
} | ErrorEvaluationResult;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* CELL function - Returns information about the formatting, location, or contents of a cell
|
|
4
|
+
*
|
|
5
|
+
* Usage: CELL(info_type, [reference])
|
|
6
|
+
*
|
|
7
|
+
* info_type: Text value that specifies what type of cell information you want
|
|
8
|
+
* reference: The cell or range to get information about (defaults to current cell if omitted)
|
|
9
|
+
*
|
|
10
|
+
* Supported info_types:
|
|
11
|
+
* - "address" - Returns the reference of the first cell in reference, as text
|
|
12
|
+
* - "col" - Returns the column number of the cell
|
|
13
|
+
* - "row" - Returns the row number of the cell
|
|
14
|
+
* - "contents" - Returns the value of the upper-left cell
|
|
15
|
+
* - "type" - Returns "b" for blank, "l" for label (text), "v" for value (number)
|
|
16
|
+
* - "width" - Returns the column width
|
|
17
|
+
* - "filename" - Returns the filename (including full path) of the file
|
|
18
|
+
*
|
|
19
|
+
* Examples:
|
|
20
|
+
* - CELL("address", A1) returns "$A$1"
|
|
21
|
+
* - CELL("row", B5) returns 5
|
|
22
|
+
* - CELL("col", C3) returns 3
|
|
23
|
+
*/
|
|
24
|
+
export declare const CELL: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* COLUMN function - Returns the column number of a reference
|
|
4
|
+
*
|
|
5
|
+
* Usage: COLUMN([reference])
|
|
6
|
+
*
|
|
7
|
+
* If reference is omitted, returns the column number of the cell in which the formula appears.
|
|
8
|
+
*
|
|
9
|
+
* Examples:
|
|
10
|
+
* - COLUMN() returns the column number of the current cell
|
|
11
|
+
* - COLUMN(C5) returns 3
|
|
12
|
+
* - COLUMN(A1:E1) returns an array of column numbers {1,2,3,4,5}
|
|
13
|
+
*/
|
|
14
|
+
export declare const COLUMN: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* ROW function - Returns the row number of a reference
|
|
4
|
+
*
|
|
5
|
+
* Usage: ROW([reference])
|
|
6
|
+
*
|
|
7
|
+
* If reference is omitted, returns the row number of the cell in which the formula appears.
|
|
8
|
+
*
|
|
9
|
+
* Examples:
|
|
10
|
+
* - ROW() returns the row number of the current cell
|
|
11
|
+
* - ROW(A5) returns 5
|
|
12
|
+
* - ROW(A5:A10) returns an array of row numbers {5;6;7;8;9;10}
|
|
13
|
+
*/
|
|
14
|
+
export declare const ROW: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CellAddress, type FunctionEvaluationResult, type SingleEvaluationResult } from "src/core/types";
|
|
2
|
+
import type { ParsedCriteria } from "src/functions/criteria-parser";
|
|
3
|
+
/**
|
|
4
|
+
* Performs counting of numeric values from an iterable of SingleEvaluationResult values
|
|
5
|
+
* Handles numbers and infinities according to Excel's COUNT behavior
|
|
6
|
+
* - Propagates errors immediately
|
|
7
|
+
* - Only counts numeric values (numbers and infinities)
|
|
8
|
+
* - Ignores non-numeric values (strings, booleans, empty cells)
|
|
9
|
+
*
|
|
10
|
+
* @param results - Iterable of SingleEvaluationResult to count
|
|
11
|
+
* @returns FunctionEvaluationResult with the count
|
|
12
|
+
*/
|
|
13
|
+
export declare function performCount(results: Iterable<SingleEvaluationResult>): FunctionEvaluationResult;
|
|
14
|
+
export declare function countEmptyCells(criteriaRangeResult: FunctionEvaluationResult, parsedCriteria: ParsedCriteria, currentCell: CellAddress): FunctionEvaluationResult | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* COUNT function - Counts the number of cells that contain numbers
|
|
4
|
+
*
|
|
5
|
+
* Usage: COUNT(value1, [value2], ...)
|
|
6
|
+
*
|
|
7
|
+
* Examples:
|
|
8
|
+
* COUNT(1, 2, 3) - returns 3
|
|
9
|
+
* COUNT(A1:A10) - counts numeric values in the range A1:A10
|
|
10
|
+
* COUNT(A1:A5, B1:B5) - counts numeric values in both ranges
|
|
11
|
+
*
|
|
12
|
+
* Note:
|
|
13
|
+
* - Only numeric values are counted (numbers and infinities)
|
|
14
|
+
* - Text, logical values, and empty cells are ignored
|
|
15
|
+
* - Errors propagate immediately
|
|
16
|
+
*
|
|
17
|
+
* From Excel documentation:
|
|
18
|
+
* "The COUNT function counts the number of cells that contain numbers,
|
|
19
|
+
* and counts numbers within the list of arguments."
|
|
20
|
+
*/
|
|
21
|
+
export declare const COUNT: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* COUNTIF function - Counts cells in a range that meet a criteria
|
|
4
|
+
*
|
|
5
|
+
* Usage: COUNTIF(range, criteria)
|
|
6
|
+
*
|
|
7
|
+
* range: The range of cells to evaluate
|
|
8
|
+
* criteria: The criteria to match against. Can be:
|
|
9
|
+
* - Exact value: "Apple", 42
|
|
10
|
+
* - Comparison: ">10", "<=5", "<>0"
|
|
11
|
+
* - Wildcards: "App*", "?ruit"
|
|
12
|
+
*
|
|
13
|
+
* Examples:
|
|
14
|
+
* COUNTIF(A1:A10, "Apple") - counts cells containing "Apple"
|
|
15
|
+
* COUNTIF(B1:B10, ">10") - counts cells with values greater than 10
|
|
16
|
+
* COUNTIF(C1:C10, "App*") - counts cells starting with "App"
|
|
17
|
+
*
|
|
18
|
+
* Note:
|
|
19
|
+
* - Supports type coercion for comparisons
|
|
20
|
+
* - Case-sensitive string matching
|
|
21
|
+
* - Wildcards: * matches any sequence, ? matches any single character
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* COUNTIF function implementation
|
|
25
|
+
*/
|
|
26
|
+
export declare const COUNTIF: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* COUNTIFS function - Counts cells that meet multiple criteria
|
|
4
|
+
*
|
|
5
|
+
* Usage: COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
|
|
6
|
+
*
|
|
7
|
+
* criteria_range1: The first range to evaluate against criteria1
|
|
8
|
+
* criteria1: The first criteria to match against
|
|
9
|
+
* criteria_range2, criteria2: Optional additional criteria pairs
|
|
10
|
+
*
|
|
11
|
+
* Examples:
|
|
12
|
+
* COUNTIFS(A1:A10, "Apple") - counts cells in A1:A10 that equal "Apple"
|
|
13
|
+
* COUNTIFS(A1:A10, "Apple", B1:B10, ">10") - counts where A1:A10 = "Apple" AND B1:B10 > 10
|
|
14
|
+
*
|
|
15
|
+
* Note:
|
|
16
|
+
* - All criteria must be satisfied for a cell to be counted
|
|
17
|
+
* - Counts all matching cells, not just numeric ones
|
|
18
|
+
* - Returns 0 if no cells match all criteria
|
|
19
|
+
* - Unlike other IFS functions, COUNTIFS counts the first criteria range itself
|
|
20
|
+
*/
|
|
21
|
+
export declare const COUNTIFS: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FunctionEvaluationResult, type SingleEvaluationResult } from "src/core/types";
|
|
2
|
+
import type { EvaluationContext } from "src/evaluator/evaluation-context";
|
|
3
|
+
/**
|
|
4
|
+
* Performs averaging of an iterable of SingleEvaluationResult values
|
|
5
|
+
* Handles numbers, infinities, and errors according to Excel's AVERAGE behavior
|
|
6
|
+
*
|
|
7
|
+
* @param results - Iterable of SingleEvaluationResult to average
|
|
8
|
+
* @returns FunctionEvaluationResult with the average or appropriate error
|
|
9
|
+
*/
|
|
10
|
+
export declare function performAverage(results: SingleEvaluationResult[], context: EvaluationContext): FunctionEvaluationResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* AVERAGE function - Calculates the arithmetic mean of all numbers in the arguments
|
|
4
|
+
*
|
|
5
|
+
* Usage: AVERAGE(value1, [value2], ...)
|
|
6
|
+
*
|
|
7
|
+
* Examples:
|
|
8
|
+
* AVERAGE(1, 2, 3) - returns 2
|
|
9
|
+
* AVERAGE(A1:A10) - averages all numbers in the range A1:A10
|
|
10
|
+
* AVERAGE(A1:A5, B1:B5) - averages all numbers in both ranges
|
|
11
|
+
*
|
|
12
|
+
* Note:
|
|
13
|
+
* - Only numeric values are included in the calculation
|
|
14
|
+
* - Text, logical values, and empty cells are ignored in ranges
|
|
15
|
+
* - Direct text/logical arguments cause errors
|
|
16
|
+
* - Returns #DIV/0! if no numeric values are found
|
|
17
|
+
*/
|
|
18
|
+
export declare const AVERAGE: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type FunctionDefinition } from "src/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* AVERAGEIF function - Calculates the average of cells in a range that meet a criteria
|
|
4
|
+
*
|
|
5
|
+
* Usage: AVERAGEIF(range, criteria, [average_range])
|
|
6
|
+
*
|
|
7
|
+
* range: The range of cells to evaluate against the criteria
|
|
8
|
+
* criteria: The criteria to match against. Can be:
|
|
9
|
+
* - Exact value: "Apple", 42
|
|
10
|
+
* - Comparison: ">10", "<=5", "<>0"
|
|
11
|
+
* - Wildcards: "App*", "?ruit"
|
|
12
|
+
* average_range: Optional. The range to average. If omitted, uses the range parameter
|
|
13
|
+
*
|
|
14
|
+
* Examples:
|
|
15
|
+
* AVERAGEIF(A1:A10, "Apple") - averages cells in A1:A10 that contain "Apple"
|
|
16
|
+
* AVERAGEIF(B1:B10, ">10") - averages cells in B1:B10 with values greater than 10
|
|
17
|
+
* AVERAGEIF(A1:A10, "Apple", B1:B10) - averages B1:B10 where A1:A10 contains "Apple"
|
|
18
|
+
*
|
|
19
|
+
* Note:
|
|
20
|
+
* - Only numeric values are included in the average calculation
|
|
21
|
+
* - Returns error if no values match the criteria
|
|
22
|
+
*/
|
|
23
|
+
export declare const AVERAGEIF: FunctionDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|