@univerjs/engine-formula 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -656
- package/lib/es/index.js +1 -33445
- package/lib/facade.js +1 -656
- package/lib/index.js +1 -33445
- package/lib/types/basics/cache-lru.d.ts +15 -0
- package/lib/types/basics/calculate.d.ts +15 -0
- package/lib/types/basics/common.d.ts +18 -3
- package/lib/types/basics/database.d.ts +17 -1
- package/lib/types/basics/date.d.ts +17 -1
- package/lib/types/basics/dirty.d.ts +16 -1
- package/lib/types/basics/financial.d.ts +15 -0
- package/lib/types/basics/format.d.ts +16 -1
- package/lib/types/basics/function.d.ts +32 -17
- package/lib/types/basics/inverted-index-cache.d.ts +16 -1
- package/lib/types/basics/is-null-cell.d.ts +16 -1
- package/lib/types/basics/match-token.d.ts +15 -0
- package/lib/types/basics/runtime.d.ts +16 -1
- package/lib/types/basics/statistical.d.ts +20 -4
- package/lib/types/commands/mutations/formula.mutation.d.ts +16 -1
- package/lib/types/commands/mutations/register-function.mutation.d.ts +16 -1
- package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +17 -2
- package/lib/types/commands/mutations/set-defined-name.mutation.d.ts +16 -1
- package/lib/types/commands/mutations/set-feature-calculation.mutation.d.ts +17 -2
- package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +20 -5
- package/lib/types/commands/mutations/set-formula-data.mutation.d.ts +17 -2
- package/lib/types/commands/mutations/set-image-formula-data.mutation.d.ts +17 -2
- package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +17 -2
- package/lib/types/commands/mutations/set-super-table.mutation.d.ts +18 -3
- package/lib/types/config/config.d.ts +18 -3
- package/lib/types/controllers/calculate.controller.d.ts +15 -0
- package/lib/types/controllers/computing-status.controller.d.ts +15 -0
- package/lib/types/controllers/formula.controller.d.ts +15 -0
- package/lib/types/controllers/set-dependency.controller.d.ts +15 -0
- package/lib/types/controllers/set-feature-calculation.controller.d.ts +15 -0
- package/lib/types/controllers/set-other-formula.controller.d.ts +15 -0
- package/lib/types/controllers/set-super-table.controller.d.ts +15 -0
- package/lib/types/engine/analysis/lexer-node.d.ts +17 -2
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +21 -5
- package/lib/types/engine/analysis/lexer.d.ts +16 -1
- package/lib/types/engine/analysis/parser.d.ts +18 -2
- package/lib/types/engine/ast-node/ast-root-node.d.ts +15 -0
- package/lib/types/engine/ast-node/base-ast-node-factory.d.ts +16 -1
- package/lib/types/engine/ast-node/base-ast-node.d.ts +18 -3
- package/lib/types/engine/ast-node/function-node.d.ts +17 -2
- package/lib/types/engine/ast-node/lambda-node.d.ts +15 -0
- package/lib/types/engine/ast-node/lambda-parameter-node.d.ts +17 -1
- package/lib/types/engine/ast-node/null-node.d.ts +15 -0
- package/lib/types/engine/ast-node/operator-node.d.ts +16 -1
- package/lib/types/engine/ast-node/prefix-node.d.ts +17 -2
- package/lib/types/engine/ast-node/reference-node.d.ts +15 -0
- package/lib/types/engine/ast-node/suffix-node.d.ts +16 -1
- package/lib/types/engine/ast-node/union-node.d.ts +15 -0
- package/lib/types/engine/ast-node/value-node.d.ts +15 -0
- package/lib/types/engine/dependency/dependency-tree.d.ts +20 -5
- package/lib/types/engine/dependency/formula-dependency.d.ts +27 -9
- package/lib/types/engine/interpreter/interpreter.d.ts +21 -5
- package/lib/types/engine/reference-object/base-reference-object.d.ts +25 -9
- package/lib/types/engine/reference-object/cell-reference-object.d.ts +16 -1
- package/lib/types/engine/reference-object/column-reference-object.d.ts +15 -0
- package/lib/types/engine/reference-object/multi-area-reference-object.d.ts +21 -6
- package/lib/types/engine/reference-object/range-reference-object.d.ts +16 -1
- package/lib/types/engine/reference-object/row-reference-object.d.ts +15 -0
- package/lib/types/engine/reference-object/table-reference-object.d.ts +18 -2
- package/lib/types/engine/utils/array-object.d.ts +16 -1
- package/lib/types/engine/utils/ast-node-tool.d.ts +17 -2
- package/lib/types/engine/utils/cell.d.ts +18 -3
- package/lib/types/engine/utils/check-variant-error.d.ts +16 -1
- package/lib/types/engine/utils/compare.d.ts +15 -0
- package/lib/types/engine/utils/function-definition.d.ts +15 -0
- package/lib/types/engine/utils/generate-ast-node.d.ts +21 -6
- package/lib/types/engine/utils/get-runtime-feature-cell.d.ts +17 -2
- package/lib/types/engine/utils/node-type.d.ts +19 -4
- package/lib/types/engine/utils/numfmt-kit.d.ts +17 -1
- package/lib/types/engine/utils/object-compare.d.ts +17 -2
- package/lib/types/engine/utils/prefix-handler.d.ts +18 -3
- package/lib/types/engine/utils/r1c1-reference.d.ts +16 -1
- package/lib/types/engine/utils/reference-cache.d.ts +16 -1
- package/lib/types/engine/utils/reference.d.ts +17 -1
- package/lib/types/engine/utils/sequence.d.ts +16 -1
- package/lib/types/engine/utils/update-lambda-statement.d.ts +16 -1
- package/lib/types/engine/utils/value-object.d.ts +19 -3
- package/lib/types/engine/value-object/array-value-object.d.ts +18 -2
- package/lib/types/engine/value-object/base-value-object.d.ts +16 -1
- package/lib/types/engine/value-object/cube-value-object.d.ts +16 -1
- package/lib/types/engine/value-object/lambda-value-object.d.ts +21 -5
- package/lib/types/engine/value-object/primitive-object.d.ts +15 -0
- package/lib/types/facade/f-formula.d.ts +19 -2
- package/lib/types/facade/f-univer.d.ts +15 -0
- package/lib/types/functions/array/array-constrain/index.d.ts +16 -1
- package/lib/types/functions/array/flatten/index.d.ts +16 -1
- package/lib/types/functions/array/function-map.d.ts +15 -0
- package/lib/types/functions/base-function.d.ts +27 -10
- package/lib/types/functions/column-like-functions.d.ts +16 -1
- package/lib/types/functions/compatibility/betadist/index.d.ts +16 -1
- package/lib/types/functions/compatibility/function-map.d.ts +15 -0
- package/lib/types/functions/compatibility/hypgeomdist/index.d.ts +16 -1
- package/lib/types/functions/compatibility/lognormdist/index.d.ts +16 -1
- package/lib/types/functions/compatibility/negbinomdist/index.d.ts +16 -1
- package/lib/types/functions/compatibility/normsdist/index.d.ts +16 -1
- package/lib/types/functions/compatibility/rank/index.d.ts +17 -2
- package/lib/types/functions/compatibility/tdist/index.d.ts +16 -1
- package/lib/types/functions/custom-function.d.ts +15 -0
- package/lib/types/functions/database/daverage/index.d.ts +17 -1
- package/lib/types/functions/database/dcount/index.d.ts +16 -1
- package/lib/types/functions/database/dcounta/index.d.ts +16 -1
- package/lib/types/functions/database/dget/index.d.ts +16 -1
- package/lib/types/functions/database/dmax/index.d.ts +16 -1
- package/lib/types/functions/database/dmin/index.d.ts +16 -1
- package/lib/types/functions/database/dproduct/index.d.ts +16 -1
- package/lib/types/functions/database/dstdev/index.d.ts +17 -1
- package/lib/types/functions/database/dstdevp/index.d.ts +17 -1
- package/lib/types/functions/database/dsum/index.d.ts +16 -1
- package/lib/types/functions/database/dvar/index.d.ts +17 -1
- package/lib/types/functions/database/dvarp/index.d.ts +17 -1
- package/lib/types/functions/database/function-map.d.ts +15 -0
- package/lib/types/functions/date/date/index.d.ts +16 -1
- package/lib/types/functions/date/datedif/index.d.ts +16 -1
- package/lib/types/functions/date/datevalue/index.d.ts +16 -1
- package/lib/types/functions/date/day/index.d.ts +16 -1
- package/lib/types/functions/date/days/index.d.ts +16 -1
- package/lib/types/functions/date/days360/index.d.ts +16 -1
- package/lib/types/functions/date/edate/index.d.ts +16 -1
- package/lib/types/functions/date/eomonth/index.d.ts +16 -1
- package/lib/types/functions/date/epochtodate/index.d.ts +17 -2
- package/lib/types/functions/date/function-map.d.ts +15 -0
- package/lib/types/functions/date/hour/index.d.ts +16 -1
- package/lib/types/functions/date/isoweeknum/index.d.ts +16 -1
- package/lib/types/functions/date/minute/index.d.ts +16 -1
- package/lib/types/functions/date/month/index.d.ts +16 -1
- package/lib/types/functions/date/networkdays/index.d.ts +16 -1
- package/lib/types/functions/date/networkdays-intl/index.d.ts +16 -1
- package/lib/types/functions/date/now/index.d.ts +15 -0
- package/lib/types/functions/date/second/index.d.ts +16 -1
- package/lib/types/functions/date/time/index.d.ts +16 -1
- package/lib/types/functions/date/timevalue/index.d.ts +16 -1
- package/lib/types/functions/date/to-date/index.d.ts +17 -2
- package/lib/types/functions/date/today/index.d.ts +15 -0
- package/lib/types/functions/date/weekday/index.d.ts +16 -1
- package/lib/types/functions/date/weeknum/index.d.ts +16 -1
- package/lib/types/functions/date/workday/index.d.ts +16 -1
- package/lib/types/functions/date/workday-intl/index.d.ts +16 -1
- package/lib/types/functions/date/year/index.d.ts +16 -1
- package/lib/types/functions/date/yearfrac/index.d.ts +16 -1
- package/lib/types/functions/engineering/besseli/index.d.ts +16 -1
- package/lib/types/functions/engineering/besselj/index.d.ts +16 -1
- package/lib/types/functions/engineering/besselk/index.d.ts +16 -1
- package/lib/types/functions/engineering/bessely/index.d.ts +16 -1
- package/lib/types/functions/engineering/bin2dec/index.d.ts +16 -1
- package/lib/types/functions/engineering/bin2hex/index.d.ts +16 -1
- package/lib/types/functions/engineering/bin2oct/index.d.ts +16 -1
- package/lib/types/functions/engineering/bitand/index.d.ts +16 -1
- package/lib/types/functions/engineering/bitlshift/index.d.ts +16 -1
- package/lib/types/functions/engineering/bitor/index.d.ts +16 -1
- package/lib/types/functions/engineering/bitrshift/index.d.ts +16 -1
- package/lib/types/functions/engineering/bitxor/index.d.ts +16 -1
- package/lib/types/functions/engineering/complex/index.d.ts +16 -1
- package/lib/types/functions/engineering/convert/index.d.ts +16 -1
- package/lib/types/functions/engineering/dec2bin/index.d.ts +16 -1
- package/lib/types/functions/engineering/dec2hex/index.d.ts +16 -1
- package/lib/types/functions/engineering/dec2oct/index.d.ts +16 -1
- package/lib/types/functions/engineering/delta/index.d.ts +16 -1
- package/lib/types/functions/engineering/erf/index.d.ts +16 -1
- package/lib/types/functions/engineering/erf-precise/index.d.ts +16 -1
- package/lib/types/functions/engineering/erfc/index.d.ts +16 -1
- package/lib/types/functions/engineering/erfc-precise/index.d.ts +16 -1
- package/lib/types/functions/engineering/function-map.d.ts +15 -0
- package/lib/types/functions/engineering/gestep/index.d.ts +16 -1
- package/lib/types/functions/engineering/hex2bin/index.d.ts +16 -1
- package/lib/types/functions/engineering/hex2dec/index.d.ts +16 -1
- package/lib/types/functions/engineering/hex2oct/index.d.ts +16 -1
- package/lib/types/functions/engineering/imabs/index.d.ts +16 -1
- package/lib/types/functions/engineering/imaginary/index.d.ts +16 -1
- package/lib/types/functions/engineering/imargument/index.d.ts +16 -1
- package/lib/types/functions/engineering/imconjugate/index.d.ts +16 -1
- package/lib/types/functions/engineering/imcos/index.d.ts +16 -1
- package/lib/types/functions/engineering/imcosh/index.d.ts +16 -1
- package/lib/types/functions/engineering/imcot/index.d.ts +16 -1
- package/lib/types/functions/engineering/imcoth/index.d.ts +16 -1
- package/lib/types/functions/engineering/imcsc/index.d.ts +16 -1
- package/lib/types/functions/engineering/imcsch/index.d.ts +16 -1
- package/lib/types/functions/engineering/imdiv/index.d.ts +16 -1
- package/lib/types/functions/engineering/imexp/index.d.ts +16 -1
- package/lib/types/functions/engineering/imln/index.d.ts +16 -1
- package/lib/types/functions/engineering/imlog/index.d.ts +16 -1
- package/lib/types/functions/engineering/imlog10/index.d.ts +16 -1
- package/lib/types/functions/engineering/imlog2/index.d.ts +16 -1
- package/lib/types/functions/engineering/impower/index.d.ts +16 -1
- package/lib/types/functions/engineering/improduct/index.d.ts +16 -1
- package/lib/types/functions/engineering/imreal/index.d.ts +16 -1
- package/lib/types/functions/engineering/imsec/index.d.ts +16 -1
- package/lib/types/functions/engineering/imsech/index.d.ts +16 -1
- package/lib/types/functions/engineering/imsin/index.d.ts +16 -1
- package/lib/types/functions/engineering/imsinh/index.d.ts +16 -1
- package/lib/types/functions/engineering/imsqrt/index.d.ts +16 -1
- package/lib/types/functions/engineering/imsub/index.d.ts +16 -1
- package/lib/types/functions/engineering/imsum/index.d.ts +16 -1
- package/lib/types/functions/engineering/imtan/index.d.ts +16 -1
- package/lib/types/functions/engineering/imtanh/index.d.ts +16 -1
- package/lib/types/functions/engineering/oct2bin/index.d.ts +16 -1
- package/lib/types/functions/engineering/oct2dec/index.d.ts +16 -1
- package/lib/types/functions/engineering/oct2hex/index.d.ts +16 -1
- package/lib/types/functions/financial/accrint/index.d.ts +16 -1
- package/lib/types/functions/financial/accrintm/index.d.ts +16 -1
- package/lib/types/functions/financial/amorlinc/index.d.ts +16 -1
- package/lib/types/functions/financial/coupdaybs/index.d.ts +16 -1
- package/lib/types/functions/financial/coupdays/index.d.ts +16 -1
- package/lib/types/functions/financial/coupdaysnc/index.d.ts +16 -1
- package/lib/types/functions/financial/coupncd/index.d.ts +16 -1
- package/lib/types/functions/financial/coupnum/index.d.ts +16 -1
- package/lib/types/functions/financial/couppcd/index.d.ts +16 -1
- package/lib/types/functions/financial/cumipmt/index.d.ts +16 -1
- package/lib/types/functions/financial/cumprinc/index.d.ts +16 -1
- package/lib/types/functions/financial/db/index.d.ts +16 -1
- package/lib/types/functions/financial/ddb/index.d.ts +16 -1
- package/lib/types/functions/financial/disc/index.d.ts +16 -1
- package/lib/types/functions/financial/dollarde/index.d.ts +16 -1
- package/lib/types/functions/financial/dollarfr/index.d.ts +16 -1
- package/lib/types/functions/financial/duration/index.d.ts +16 -1
- package/lib/types/functions/financial/effect/index.d.ts +16 -1
- package/lib/types/functions/financial/function-map.d.ts +15 -0
- package/lib/types/functions/financial/fv/index.d.ts +16 -1
- package/lib/types/functions/financial/fvschedule/index.d.ts +16 -1
- package/lib/types/functions/financial/intrate/index.d.ts +16 -1
- package/lib/types/functions/financial/ipmt/index.d.ts +16 -1
- package/lib/types/functions/financial/irr/index.d.ts +16 -1
- package/lib/types/functions/financial/ispmt/index.d.ts +16 -1
- package/lib/types/functions/financial/mduration/index.d.ts +16 -1
- package/lib/types/functions/financial/mirr/index.d.ts +16 -1
- package/lib/types/functions/financial/nominal/index.d.ts +16 -1
- package/lib/types/functions/financial/nper/index.d.ts +16 -1
- package/lib/types/functions/financial/npv/index.d.ts +16 -1
- package/lib/types/functions/financial/oddfprice/index.d.ts +16 -1
- package/lib/types/functions/financial/oddfyield/index.d.ts +16 -1
- package/lib/types/functions/financial/oddlprice/index.d.ts +16 -1
- package/lib/types/functions/financial/oddlyield/index.d.ts +16 -1
- package/lib/types/functions/financial/pduration/index.d.ts +16 -1
- package/lib/types/functions/financial/pmt/index.d.ts +16 -1
- package/lib/types/functions/financial/ppmt/index.d.ts +16 -1
- package/lib/types/functions/financial/price/index.d.ts +16 -1
- package/lib/types/functions/financial/pricedisc/index.d.ts +16 -1
- package/lib/types/functions/financial/pricemat/index.d.ts +16 -1
- package/lib/types/functions/financial/pv/index.d.ts +16 -1
- package/lib/types/functions/financial/rate/index.d.ts +16 -1
- package/lib/types/functions/financial/received/index.d.ts +16 -1
- package/lib/types/functions/financial/rri/index.d.ts +16 -1
- package/lib/types/functions/financial/sln/index.d.ts +16 -1
- package/lib/types/functions/financial/syd/index.d.ts +16 -1
- package/lib/types/functions/financial/tbilleq/index.d.ts +16 -1
- package/lib/types/functions/financial/tbillprice/index.d.ts +16 -1
- package/lib/types/functions/financial/tbillyield/index.d.ts +16 -1
- package/lib/types/functions/financial/vdb/index.d.ts +16 -1
- package/lib/types/functions/financial/xirr/index.d.ts +16 -1
- package/lib/types/functions/financial/xnpv/index.d.ts +16 -1
- package/lib/types/functions/financial/yield/index.d.ts +16 -1
- package/lib/types/functions/financial/yielddisc/index.d.ts +16 -1
- package/lib/types/functions/financial/yieldmat/index.d.ts +16 -1
- package/lib/types/functions/information/cell/index.d.ts +16 -1
- package/lib/types/functions/information/error-type/index.d.ts +16 -1
- package/lib/types/functions/information/function-map.d.ts +15 -0
- package/lib/types/functions/information/isbetween/index.d.ts +16 -1
- package/lib/types/functions/information/isblank/index.d.ts +17 -2
- package/lib/types/functions/information/isdate/index.d.ts +16 -1
- package/lib/types/functions/information/isemail/index.d.ts +16 -1
- package/lib/types/functions/information/iserr/index.d.ts +17 -2
- package/lib/types/functions/information/iserror/index.d.ts +17 -2
- package/lib/types/functions/information/iseven/iseven.d.ts +16 -1
- package/lib/types/functions/information/isformula/index.d.ts +17 -2
- package/lib/types/functions/information/islogical/index.d.ts +17 -2
- package/lib/types/functions/information/isna/index.d.ts +17 -2
- package/lib/types/functions/information/isnontext/index.d.ts +17 -2
- package/lib/types/functions/information/isnumber/index.d.ts +17 -2
- package/lib/types/functions/information/isodd/isodd.d.ts +16 -1
- package/lib/types/functions/information/isref/index.d.ts +16 -1
- package/lib/types/functions/information/istext/index.d.ts +17 -2
- package/lib/types/functions/information/isurl/index.d.ts +16 -1
- package/lib/types/functions/information/n/index.d.ts +16 -1
- package/lib/types/functions/information/na/index.d.ts +15 -0
- package/lib/types/functions/information/sheet/index.d.ts +17 -2
- package/lib/types/functions/information/sheets/index.d.ts +16 -1
- package/lib/types/functions/information/type/index.d.ts +16 -1
- package/lib/types/functions/logical/and/index.d.ts +16 -1
- package/lib/types/functions/logical/bycol/index.d.ts +17 -2
- package/lib/types/functions/logical/byrow/index.d.ts +17 -2
- package/lib/types/functions/logical/false/index.d.ts +15 -0
- package/lib/types/functions/logical/function-map.d.ts +15 -0
- package/lib/types/functions/logical/if/index.d.ts +17 -2
- package/lib/types/functions/logical/iferror/index.d.ts +17 -2
- package/lib/types/functions/logical/ifna/index.d.ts +17 -2
- package/lib/types/functions/logical/ifs/index.d.ts +16 -1
- package/lib/types/functions/logical/lambda/index.d.ts +17 -1
- package/lib/types/functions/logical/let/index.d.ts +17 -1
- package/lib/types/functions/logical/makearray/index.d.ts +17 -1
- package/lib/types/functions/logical/map/index.d.ts +17 -2
- package/lib/types/functions/logical/not/index.d.ts +16 -1
- package/lib/types/functions/logical/or/index.d.ts +16 -1
- package/lib/types/functions/logical/reduce/index.d.ts +17 -2
- package/lib/types/functions/logical/scan/index.d.ts +17 -2
- package/lib/types/functions/logical/switch/index.d.ts +16 -1
- package/lib/types/functions/logical/true/index.d.ts +15 -0
- package/lib/types/functions/logical/xor/index.d.ts +16 -1
- package/lib/types/functions/lookup/address/index.d.ts +16 -1
- package/lib/types/functions/lookup/areas/index.d.ts +16 -1
- package/lib/types/functions/lookup/choose/index.d.ts +16 -1
- package/lib/types/functions/lookup/choosecols/index.d.ts +16 -1
- package/lib/types/functions/lookup/chooserows/index.d.ts +16 -1
- package/lib/types/functions/lookup/column/index.d.ts +16 -1
- package/lib/types/functions/lookup/columns/index.d.ts +16 -1
- package/lib/types/functions/lookup/drop/index.d.ts +16 -1
- package/lib/types/functions/lookup/expand/index.d.ts +16 -1
- package/lib/types/functions/lookup/filter/index.d.ts +16 -1
- package/lib/types/functions/lookup/formulatext/index.d.ts +18 -3
- package/lib/types/functions/lookup/function-map.d.ts +15 -0
- package/lib/types/functions/lookup/hlookup/index.d.ts +16 -1
- package/lib/types/functions/lookup/hstack/index.d.ts +16 -1
- package/lib/types/functions/lookup/hyperlink/index.d.ts +16 -1
- package/lib/types/functions/lookup/image/index.d.ts +16 -1
- package/lib/types/functions/lookup/index/index.d.ts +17 -2
- package/lib/types/functions/lookup/indirect/index.d.ts +17 -2
- package/lib/types/functions/lookup/lookup/index.d.ts +17 -2
- package/lib/types/functions/lookup/match/index.d.ts +17 -2
- package/lib/types/functions/lookup/offset/index.d.ts +16 -1
- package/lib/types/functions/lookup/row/index.d.ts +16 -1
- package/lib/types/functions/lookup/rows/index.d.ts +16 -1
- package/lib/types/functions/lookup/sort/index.d.ts +16 -1
- package/lib/types/functions/lookup/sortby/index.d.ts +17 -1
- package/lib/types/functions/lookup/take/index.d.ts +16 -1
- package/lib/types/functions/lookup/tocol/index.d.ts +16 -1
- package/lib/types/functions/lookup/torow/index.d.ts +16 -1
- package/lib/types/functions/lookup/transpose/index.d.ts +17 -2
- package/lib/types/functions/lookup/unique/index.d.ts +16 -1
- package/lib/types/functions/lookup/vlookup/index.d.ts +17 -2
- package/lib/types/functions/lookup/vstack/index.d.ts +16 -1
- package/lib/types/functions/lookup/wrapcols/index.d.ts +16 -1
- package/lib/types/functions/lookup/wraprows/index.d.ts +16 -1
- package/lib/types/functions/lookup/xlookup/index.d.ts +16 -1
- package/lib/types/functions/lookup/xmatch/index.d.ts +16 -1
- package/lib/types/functions/math/abs/index.d.ts +16 -1
- package/lib/types/functions/math/acos/index.d.ts +16 -1
- package/lib/types/functions/math/acosh/index.d.ts +16 -1
- package/lib/types/functions/math/acot/index.d.ts +16 -1
- package/lib/types/functions/math/acoth/index.d.ts +16 -1
- package/lib/types/functions/math/aggregate/index.d.ts +18 -3
- package/lib/types/functions/math/arabic/index.d.ts +16 -1
- package/lib/types/functions/math/asin/index.d.ts +16 -1
- package/lib/types/functions/math/asinh/index.d.ts +16 -1
- package/lib/types/functions/math/atan/index.d.ts +16 -1
- package/lib/types/functions/math/atan2/index.d.ts +16 -1
- package/lib/types/functions/math/atanh/index.d.ts +16 -1
- package/lib/types/functions/math/base/index.d.ts +16 -1
- package/lib/types/functions/math/ceiling/index.d.ts +16 -1
- package/lib/types/functions/math/ceiling-math/index.d.ts +16 -1
- package/lib/types/functions/math/ceiling-precise/index.d.ts +16 -1
- package/lib/types/functions/math/combin/index.d.ts +16 -1
- package/lib/types/functions/math/combina/index.d.ts +16 -1
- package/lib/types/functions/math/cos/index.d.ts +16 -1
- package/lib/types/functions/math/cosh/index.d.ts +16 -1
- package/lib/types/functions/math/cot/index.d.ts +16 -1
- package/lib/types/functions/math/coth/index.d.ts +16 -1
- package/lib/types/functions/math/csc/index.d.ts +16 -1
- package/lib/types/functions/math/csch/index.d.ts +16 -1
- package/lib/types/functions/math/decimal/index.d.ts +16 -1
- package/lib/types/functions/math/degrees/index.d.ts +16 -1
- package/lib/types/functions/math/even/index.d.ts +16 -1
- package/lib/types/functions/math/exp/index.d.ts +16 -1
- package/lib/types/functions/math/fact/index.d.ts +16 -1
- package/lib/types/functions/math/factdouble/index.d.ts +16 -1
- package/lib/types/functions/math/floor/index.d.ts +16 -1
- package/lib/types/functions/math/floor-math/index.d.ts +16 -1
- package/lib/types/functions/math/floor-precise/index.d.ts +16 -1
- package/lib/types/functions/math/function-map.d.ts +15 -0
- package/lib/types/functions/math/gcd/index.d.ts +16 -1
- package/lib/types/functions/math/int/index.d.ts +16 -1
- package/lib/types/functions/math/lcm/index.d.ts +16 -1
- package/lib/types/functions/math/ln/index.d.ts +16 -1
- package/lib/types/functions/math/log/index.d.ts +16 -1
- package/lib/types/functions/math/log10/index.d.ts +16 -1
- package/lib/types/functions/math/mdeterm/index.d.ts +16 -1
- package/lib/types/functions/math/minverse/index.d.ts +16 -1
- package/lib/types/functions/math/mmult/index.d.ts +16 -1
- package/lib/types/functions/math/mod/index.d.ts +16 -1
- package/lib/types/functions/math/mround/index.d.ts +16 -1
- package/lib/types/functions/math/multinomial/index.d.ts +16 -1
- package/lib/types/functions/math/munit/index.d.ts +16 -1
- package/lib/types/functions/math/odd/index.d.ts +16 -1
- package/lib/types/functions/math/pi/index.d.ts +15 -0
- package/lib/types/functions/math/power/index.d.ts +16 -1
- package/lib/types/functions/math/product/index.d.ts +16 -1
- package/lib/types/functions/math/quotient/index.d.ts +16 -1
- package/lib/types/functions/math/radians/index.d.ts +16 -1
- package/lib/types/functions/math/rand/index.d.ts +15 -0
- package/lib/types/functions/math/randarray/index.d.ts +16 -1
- package/lib/types/functions/math/randbetween/index.d.ts +16 -1
- package/lib/types/functions/math/roman/index.d.ts +16 -1
- package/lib/types/functions/math/round/index.d.ts +16 -1
- package/lib/types/functions/math/roundbank/index.d.ts +16 -1
- package/lib/types/functions/math/rounddown/index.d.ts +16 -1
- package/lib/types/functions/math/roundup/index.d.ts +16 -1
- package/lib/types/functions/math/sec/index.d.ts +16 -1
- package/lib/types/functions/math/sech/index.d.ts +16 -1
- package/lib/types/functions/math/sequence/index.d.ts +16 -1
- package/lib/types/functions/math/seriessum/index.d.ts +16 -1
- package/lib/types/functions/math/sign/index.d.ts +16 -1
- package/lib/types/functions/math/sin/index.d.ts +16 -1
- package/lib/types/functions/math/sinh/index.d.ts +16 -1
- package/lib/types/functions/math/sqrt/index.d.ts +16 -1
- package/lib/types/functions/math/sqrtpi/index.d.ts +16 -1
- package/lib/types/functions/math/subtotal/index.d.ts +18 -3
- package/lib/types/functions/math/sum/index.d.ts +16 -1
- package/lib/types/functions/math/sumif/index.d.ts +17 -2
- package/lib/types/functions/math/sumifs/index.d.ts +17 -2
- package/lib/types/functions/math/sumproduct/index.d.ts +16 -1
- package/lib/types/functions/math/sumsq/index.d.ts +16 -1
- package/lib/types/functions/math/sumx2my2/index.d.ts +16 -1
- package/lib/types/functions/math/sumx2py2/index.d.ts +16 -1
- package/lib/types/functions/math/sumxmy2/index.d.ts +16 -1
- package/lib/types/functions/math/tan/index.d.ts +16 -1
- package/lib/types/functions/math/tanh/index.d.ts +16 -1
- package/lib/types/functions/math/trunc/index.d.ts +16 -1
- package/lib/types/functions/meta/compare/index.d.ts +16 -1
- package/lib/types/functions/meta/cube/index.d.ts +16 -1
- package/lib/types/functions/meta/divided/index.d.ts +16 -1
- package/lib/types/functions/meta/function-map.d.ts +15 -0
- package/lib/types/functions/meta/minus/index.d.ts +16 -1
- package/lib/types/functions/meta/multiply/index.d.ts +16 -1
- package/lib/types/functions/meta/plus/index.d.ts +16 -1
- package/lib/types/functions/new-excel-functions.d.ts +16 -1
- package/lib/types/functions/statistical/avedev/index.d.ts +16 -1
- package/lib/types/functions/statistical/average/index.d.ts +16 -1
- package/lib/types/functions/statistical/average-weighted/index.d.ts +16 -1
- package/lib/types/functions/statistical/averagea/index.d.ts +16 -1
- package/lib/types/functions/statistical/averageif/index.d.ts +17 -2
- package/lib/types/functions/statistical/averageifs/index.d.ts +17 -2
- package/lib/types/functions/statistical/beta-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/beta-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/binom-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/binom-dist-range/index.d.ts +16 -1
- package/lib/types/functions/statistical/binom-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/chisq-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/chisq-dist-rt/index.d.ts +16 -1
- package/lib/types/functions/statistical/chisq-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/chisq-inv-rt/index.d.ts +16 -1
- package/lib/types/functions/statistical/chisq-test/index.d.ts +16 -1
- package/lib/types/functions/statistical/confidence-norm/index.d.ts +16 -1
- package/lib/types/functions/statistical/confidence-t/index.d.ts +16 -1
- package/lib/types/functions/statistical/correl/index.d.ts +16 -1
- package/lib/types/functions/statistical/count/index.d.ts +16 -1
- package/lib/types/functions/statistical/counta/index.d.ts +16 -1
- package/lib/types/functions/statistical/countblank/index.d.ts +16 -1
- package/lib/types/functions/statistical/countif/index.d.ts +17 -2
- package/lib/types/functions/statistical/countifs/index.d.ts +17 -2
- package/lib/types/functions/statistical/covariance-p/index.d.ts +16 -1
- package/lib/types/functions/statistical/covariance-s/index.d.ts +16 -1
- package/lib/types/functions/statistical/devsq/index.d.ts +16 -1
- package/lib/types/functions/statistical/expon-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/f-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/f-dist-rt/index.d.ts +16 -1
- package/lib/types/functions/statistical/f-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/f-inv-rt/index.d.ts +16 -1
- package/lib/types/functions/statistical/f-test/index.d.ts +16 -1
- package/lib/types/functions/statistical/fisher/index.d.ts +16 -1
- package/lib/types/functions/statistical/fisherinv/index.d.ts +16 -1
- package/lib/types/functions/statistical/forecast/index.d.ts +16 -1
- package/lib/types/functions/statistical/frequency/index.d.ts +16 -1
- package/lib/types/functions/statistical/function-map.d.ts +15 -0
- package/lib/types/functions/statistical/gamma/index.d.ts +16 -1
- package/lib/types/functions/statistical/gamma-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/gamma-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/gammaln/index.d.ts +16 -1
- package/lib/types/functions/statistical/gauss/index.d.ts +16 -1
- package/lib/types/functions/statistical/geomean/index.d.ts +16 -1
- package/lib/types/functions/statistical/growth/index.d.ts +16 -1
- package/lib/types/functions/statistical/harmean/index.d.ts +16 -1
- package/lib/types/functions/statistical/hypgeom-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/intercept/index.d.ts +16 -1
- package/lib/types/functions/statistical/kurt/index.d.ts +16 -1
- package/lib/types/functions/statistical/large/index.d.ts +16 -1
- package/lib/types/functions/statistical/linest/index.d.ts +16 -1
- package/lib/types/functions/statistical/logest/index.d.ts +16 -1
- package/lib/types/functions/statistical/lognorm-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/lognorm-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/marginoferror/index.d.ts +16 -1
- package/lib/types/functions/statistical/max/index.d.ts +16 -1
- package/lib/types/functions/statistical/maxa/index.d.ts +16 -1
- package/lib/types/functions/statistical/maxifs/index.d.ts +17 -2
- package/lib/types/functions/statistical/median/index.d.ts +16 -1
- package/lib/types/functions/statistical/min/index.d.ts +16 -1
- package/lib/types/functions/statistical/mina/index.d.ts +16 -1
- package/lib/types/functions/statistical/minifs/index.d.ts +17 -2
- package/lib/types/functions/statistical/mode-mult/index.d.ts +16 -1
- package/lib/types/functions/statistical/mode-sngl/index.d.ts +16 -1
- package/lib/types/functions/statistical/negbinom-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/norm-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/norm-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/norm-s-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/norm-s-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/pearson/index.d.ts +16 -1
- package/lib/types/functions/statistical/percentile-exc/index.d.ts +16 -1
- package/lib/types/functions/statistical/percentile-inc/index.d.ts +16 -1
- package/lib/types/functions/statistical/percentrank-exc/index.d.ts +16 -1
- package/lib/types/functions/statistical/percentrank-inc/index.d.ts +16 -1
- package/lib/types/functions/statistical/permut/index.d.ts +16 -1
- package/lib/types/functions/statistical/permutationa/index.d.ts +16 -1
- package/lib/types/functions/statistical/phi/index.d.ts +16 -1
- package/lib/types/functions/statistical/poisson-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/prob/index.d.ts +16 -1
- package/lib/types/functions/statistical/quartile-exc/index.d.ts +16 -1
- package/lib/types/functions/statistical/quartile-inc/index.d.ts +16 -1
- package/lib/types/functions/statistical/rank-avg/index.d.ts +17 -2
- package/lib/types/functions/statistical/rank-eq/index.d.ts +17 -2
- package/lib/types/functions/statistical/rsq/index.d.ts +16 -1
- package/lib/types/functions/statistical/skew/index.d.ts +16 -1
- package/lib/types/functions/statistical/skew-p/index.d.ts +16 -1
- package/lib/types/functions/statistical/slope/index.d.ts +16 -1
- package/lib/types/functions/statistical/small/index.d.ts +16 -1
- package/lib/types/functions/statistical/standardize/index.d.ts +16 -1
- package/lib/types/functions/statistical/stdev-p/index.d.ts +17 -2
- package/lib/types/functions/statistical/stdev-s/index.d.ts +17 -2
- package/lib/types/functions/statistical/stdeva/index.d.ts +17 -2
- package/lib/types/functions/statistical/stdevpa/index.d.ts +17 -2
- package/lib/types/functions/statistical/steyx/index.d.ts +16 -1
- package/lib/types/functions/statistical/t-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/t-dist-2t/index.d.ts +16 -1
- package/lib/types/functions/statistical/t-dist-rt/index.d.ts +16 -1
- package/lib/types/functions/statistical/t-inv/index.d.ts +16 -1
- package/lib/types/functions/statistical/t-inv-2t/index.d.ts +16 -1
- package/lib/types/functions/statistical/t-test/index.d.ts +16 -1
- package/lib/types/functions/statistical/trend/index.d.ts +16 -1
- package/lib/types/functions/statistical/trimmean/index.d.ts +16 -1
- package/lib/types/functions/statistical/var-p/index.d.ts +17 -2
- package/lib/types/functions/statistical/var-s/index.d.ts +17 -2
- package/lib/types/functions/statistical/vara/index.d.ts +17 -2
- package/lib/types/functions/statistical/varpa/index.d.ts +17 -2
- package/lib/types/functions/statistical/weibull-dist/index.d.ts +16 -1
- package/lib/types/functions/statistical/z-test/index.d.ts +16 -1
- package/lib/types/functions/text/arraytotext/index.d.ts +16 -1
- package/lib/types/functions/text/asc/index.d.ts +16 -1
- package/lib/types/functions/text/bahttext/index.d.ts +16 -1
- package/lib/types/functions/text/char/index.d.ts +16 -1
- package/lib/types/functions/text/clean/index.d.ts +16 -1
- package/lib/types/functions/text/code/index.d.ts +16 -1
- package/lib/types/functions/text/concat/index.d.ts +16 -1
- package/lib/types/functions/text/concatenate/index.d.ts +16 -1
- package/lib/types/functions/text/dbcs/index.d.ts +16 -1
- package/lib/types/functions/text/dollar/index.d.ts +16 -1
- package/lib/types/functions/text/exact/index.d.ts +16 -1
- package/lib/types/functions/text/find/index.d.ts +16 -1
- package/lib/types/functions/text/findb/index.d.ts +16 -1
- package/lib/types/functions/text/fixed/index.d.ts +16 -1
- package/lib/types/functions/text/function-map.d.ts +15 -0
- package/lib/types/functions/text/left/index.d.ts +16 -1
- package/lib/types/functions/text/leftb/index.d.ts +16 -1
- package/lib/types/functions/text/len/index.d.ts +16 -1
- package/lib/types/functions/text/lenb/index.d.ts +16 -1
- package/lib/types/functions/text/lower/index.d.ts +16 -1
- package/lib/types/functions/text/mid/index.d.ts +16 -1
- package/lib/types/functions/text/midb/index.d.ts +16 -1
- package/lib/types/functions/text/numberstring/index.d.ts +16 -1
- package/lib/types/functions/text/numbervalue/index.d.ts +16 -1
- package/lib/types/functions/text/proper/index.d.ts +16 -1
- package/lib/types/functions/text/regexextract/index.d.ts +16 -1
- package/lib/types/functions/text/regexmatch/index.d.ts +16 -1
- package/lib/types/functions/text/regexreplace/index.d.ts +16 -1
- package/lib/types/functions/text/replace/index.d.ts +16 -1
- package/lib/types/functions/text/replaceb/index.d.ts +16 -1
- package/lib/types/functions/text/rept/index.d.ts +16 -1
- package/lib/types/functions/text/right/index.d.ts +16 -1
- package/lib/types/functions/text/rightb/index.d.ts +16 -1
- package/lib/types/functions/text/search/index.d.ts +16 -1
- package/lib/types/functions/text/searchb/index.d.ts +16 -1
- package/lib/types/functions/text/substitute/index.d.ts +16 -1
- package/lib/types/functions/text/t/index.d.ts +17 -2
- package/lib/types/functions/text/text/index.d.ts +16 -1
- package/lib/types/functions/text/textafter/index.d.ts +17 -2
- package/lib/types/functions/text/textbefore/index.d.ts +17 -2
- package/lib/types/functions/text/textjoin/index.d.ts +16 -1
- package/lib/types/functions/text/textsplit/index.d.ts +16 -1
- package/lib/types/functions/text/trim/index.d.ts +16 -1
- package/lib/types/functions/text/unichar/index.d.ts +16 -1
- package/lib/types/functions/text/unicode/index.d.ts +16 -1
- package/lib/types/functions/text/upper/index.d.ts +16 -1
- package/lib/types/functions/text/value/index.d.ts +16 -1
- package/lib/types/functions/text/valuetotext/index.d.ts +16 -1
- package/lib/types/functions/util.d.ts +17 -1
- package/lib/types/functions/web/encodeurl/index.d.ts +16 -1
- package/lib/types/functions/web/function-map.d.ts +15 -0
- package/lib/types/models/formula-data.model.d.ts +18 -2
- package/lib/types/models/utils/formula-data-util.d.ts +17 -2
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/active-dirty-manager.service.d.ts +19 -3
- package/lib/types/services/calculate-formula.service.d.ts +25 -7
- package/lib/types/services/current-data.service.d.ts +19 -3
- package/lib/types/services/defined-names.service.d.ts +19 -3
- package/lib/types/services/dependency-manager.service.d.ts +20 -4
- package/lib/types/services/feature-calculation-manager.service.d.ts +23 -7
- package/lib/types/services/formula-common.d.ts +16 -1
- package/lib/types/services/function.service.d.ts +20 -4
- package/lib/types/services/global-computing-status.service.d.ts +18 -2
- package/lib/types/services/hyperlink-engine-formula.service.d.ts +18 -2
- package/lib/types/services/other-formula-manager.service.d.ts +19 -3
- package/lib/types/services/register-other-formula.service.d.ts +20 -4
- package/lib/types/services/runtime.service.d.ts +22 -6
- package/lib/types/services/sheet-row-filtered.service.d.ts +16 -1
- package/lib/types/services/super-table.service.d.ts +21 -4
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +9 -1
- package/package.json +8 -7
- package/lib/types/functions/logical/bycol/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/logical/byrow/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/logical/makearray/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/logical/map/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/logical/reduce/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/logical/scan/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/lookup/index/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/lookup/indirect/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/arraytotext/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/asc/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/bahttext/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/char/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/clean/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/code/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/dbcs/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/dollar/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/exact/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/find/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/findb/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/fixed/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/left/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/leftb/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/len/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/lenb/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/lower/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/mid/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/midb/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/numberstring/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/numbervalue/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/proper/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/regexextract/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/regexmatch/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/regexreplace/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/replace/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/replaceb/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/rept/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/right/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/rightb/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/search/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/searchb/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/substitute/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/t/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/text/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/textafter/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/textbefore/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/textjoin/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/textsplit/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/trim/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/unichar/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/unicode/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/upper/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/value/__test__/index.spec.d.ts +0 -16
- package/lib/types/functions/text/valuetotext/__test__/index.spec.d.ts +0 -16
package/lib/facade.js
CHANGED
|
@@ -1,656 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Inject as c, ICommandService as f, Injector as C, IConfigService as h } from "@univerjs/core";
|
|
3
|
-
import { LexerTreeBuilder as v, IFunctionService as g, IDefinedNamesService as E, ISuperTableService as x, SetTriggerFormulaCalculationStartMutation as F, SetFormulaCalculationStopMutation as T, SetFormulaCalculationStartMutation as y, SetFormulaCalculationNotificationMutation as m, GlobalComputingStatusService as R, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as b, SetFormulaStringBatchCalculationResultMutation as w, SetFormulaStringBatchCalculationMutation as D, SetFormulaDependencyCalculationResultMutation as M, SetFormulaDependencyCalculationMutation as I, SetCellFormulaDependencyCalculationResultMutation as N, SetCellFormulaDependencyCalculationMutation as B, SetQueryFormulaDependencyResultMutation as d, SetQueryFormulaDependencyMutation as p, ENGINE_FORMULA_RETURN_DEPENDENCY_TREE as P, SetQueryFormulaDependencyAllResultMutation as L, SetQueryFormulaDependencyAllMutation as O } from "@univerjs/engine-formula";
|
|
4
|
-
import { firstValueFrom as A, race as U, filter as j, timer as Q, map as G } from "rxjs";
|
|
5
|
-
var q = Object.getOwnPropertyDescriptor, z = (e, t, r, i) => {
|
|
6
|
-
for (var n = i > 1 ? void 0 : i ? q(t, r) : t, a = e.length - 1, o; a >= 0; a--)
|
|
7
|
-
(o = e[a]) && (n = o(n) || n);
|
|
8
|
-
return n;
|
|
9
|
-
}, u = (e, t) => (r, i) => t(r, i, e);
|
|
10
|
-
let l = class extends _ {
|
|
11
|
-
constructor(e, t, r, i, n, a, o) {
|
|
12
|
-
super(), this._commandService = e, this._injector = t, this._lexerTreeBuilder = r, this._configService = i, this._functionService = n, this._definedNamesService = a, this._superTableService = o, this._initialize();
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @ignore
|
|
16
|
-
*/
|
|
17
|
-
_initialize() {
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The tree builder for formula string.
|
|
21
|
-
* @type {LexerTreeBuilder}
|
|
22
|
-
*/
|
|
23
|
-
get lexerTreeBuilder() {
|
|
24
|
-
return this._lexerTreeBuilder;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Offsets the formula
|
|
28
|
-
* @param {string} formulaString - The formula string to offset
|
|
29
|
-
* @param {number} refOffsetX - The offset column
|
|
30
|
-
* @param {number} refOffsetY - The offset row
|
|
31
|
-
* @param {boolean} [ignoreAbsolute] - Whether to ignore the absolute reference
|
|
32
|
-
* @returns {string} The offset formula string
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
37
|
-
* const result = formulaEngine.moveFormulaRefOffset('=SUM(A1,B2)', 1, 1);
|
|
38
|
-
* console.log(result);
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
moveFormulaRefOffset(e, t, r, i) {
|
|
42
|
-
return this._lexerTreeBuilder.moveFormulaRefOffset(e, t, r, i);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Resolves the formula string to a 'node' node
|
|
46
|
-
* @param {string} formulaString - The formula string to resolve
|
|
47
|
-
* @returns {Array<ISequenceNode | string>} The nodes of the formula string
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
52
|
-
* const nodes = formulaEngine.sequenceNodesBuilder('=SUM(A1,B2)');
|
|
53
|
-
* console.log(nodes);
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
sequenceNodesBuilder(e) {
|
|
57
|
-
return this._lexerTreeBuilder.sequenceNodesBuilder(e) || [];
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Start the calculation of the formula.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
65
|
-
* formulaEngine.executeCalculation();
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
executeCalculation() {
|
|
69
|
-
this._commandService.executeCommand(F.id, { commands: [], forceCalculation: !0 }, { onlyLocal: !0 });
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Stop the calculation of the formula.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
77
|
-
* formulaEngine.stopCalculation();
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
stopCalculation() {
|
|
81
|
-
this._commandService.executeCommand(T.id, {});
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Listening calculation starts.
|
|
85
|
-
* @param {Function} callback - The callback function to be called when the formula calculation starts.
|
|
86
|
-
* @returns {IDisposable} The disposable instance.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```ts
|
|
90
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
91
|
-
* formulaEngine.calculationStart((forceCalculation) => {
|
|
92
|
-
* console.log('Calculation start', forceCalculation);
|
|
93
|
-
* });
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
calculationStart(e) {
|
|
97
|
-
return this._commandService.onCommandExecuted((t) => {
|
|
98
|
-
if (t.id === y.id) {
|
|
99
|
-
const r = t.params;
|
|
100
|
-
e(r.forceCalculation);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Listening calculation ends.
|
|
106
|
-
* @param {Function} callback - The callback function to be called when the formula calculation ends.
|
|
107
|
-
* @returns {IDisposable} The disposable instance.
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* ```ts
|
|
111
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
112
|
-
* formulaEngine.calculationEnd((functionsExecutedState) => {
|
|
113
|
-
* console.log('Calculation end', functionsExecutedState);
|
|
114
|
-
* });
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
calculationEnd(e) {
|
|
118
|
-
return this._commandService.onCommandExecuted((t) => {
|
|
119
|
-
if (t.id !== m.id)
|
|
120
|
-
return;
|
|
121
|
-
const r = t.params;
|
|
122
|
-
r.functionsExecutedState !== void 0 && e(r.functionsExecutedState);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* @deprecated Use `onCalculationEnd` instead.
|
|
127
|
-
*/
|
|
128
|
-
whenComputingCompleteAsync(e) {
|
|
129
|
-
const t = this._injector.get(R);
|
|
130
|
-
return t.computingStatus ? Promise.resolve(!0) : A(U(
|
|
131
|
-
t.computingStatus$.pipe(j((r) => r)),
|
|
132
|
-
Q(e != null ? e : 3e4).pipe(G(() => !1))
|
|
133
|
-
));
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Waits for the formula calculation to complete.
|
|
137
|
-
* @returns {Promise<void>} This method returns a promise that resolves when the calculation is complete.
|
|
138
|
-
*/
|
|
139
|
-
onCalculationEnd() {
|
|
140
|
-
return new Promise((e, t) => {
|
|
141
|
-
const r = setTimeout(() => {
|
|
142
|
-
t(new Error("Calculation end timeout"));
|
|
143
|
-
}, 3e4), i = this.calculationEnd(() => {
|
|
144
|
-
clearTimeout(r), i.dispose(), e();
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Listening calculation processing.
|
|
150
|
-
* @param {Function} callback - The callback function to be called when the formula calculation is in progress.
|
|
151
|
-
* @returns {IDisposable} The disposable instance.
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* ```ts
|
|
155
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
156
|
-
* formulaEngine.calculationProcessing((stageInfo) => {
|
|
157
|
-
* console.log('Calculation processing', stageInfo);
|
|
158
|
-
* });
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
calculationProcessing(e) {
|
|
162
|
-
return this._commandService.onCommandExecuted((t) => {
|
|
163
|
-
if (t.id !== m.id)
|
|
164
|
-
return;
|
|
165
|
-
const r = t.params;
|
|
166
|
-
r.stageInfo !== void 0 && e(r.stageInfo);
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* When a formula contains a circular reference, set the maximum number of iterations for the formula calculation.
|
|
171
|
-
* @param {number} maxIteration The maximum number of iterations. The default value is 1.
|
|
172
|
-
*
|
|
173
|
-
* @example
|
|
174
|
-
* ```ts
|
|
175
|
-
* // Set the maximum number of iterations for the formula calculation to 5.
|
|
176
|
-
* // The default value is 1.
|
|
177
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
178
|
-
* formulaEngine.setMaxIteration(5);
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
setMaxIteration(e) {
|
|
182
|
-
this._configService.setConfig(b, e);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Execute a batch of formulas asynchronously and receive computed results.
|
|
186
|
-
*
|
|
187
|
-
* Each formula cell is represented as a string array:
|
|
188
|
-
* [fullFormula, ...subFormulas]
|
|
189
|
-
*
|
|
190
|
-
* Where:
|
|
191
|
-
* - fullFormula (index 0) is the complete formula expression written in the cell.
|
|
192
|
-
* Example: "=SUM(A1:A10) + SQRT(D7)".
|
|
193
|
-
*
|
|
194
|
-
* - subFormulas (index 1+) are **optional decomposed expressions** extracted from
|
|
195
|
-
* the full formula. Each of them can be independently computed by the formula engine.
|
|
196
|
-
*
|
|
197
|
-
* These sub-expressions can include:
|
|
198
|
-
* - Single-cell references: "A2", "B2", "C5"
|
|
199
|
-
* - Range references: "A1:A10"
|
|
200
|
-
* - Function calls: "SQRT(D7)", "ABS(A2-B2)"
|
|
201
|
-
* - Any sub-formula that was parsed out of the original formula and can be
|
|
202
|
-
* evaluated on its own.
|
|
203
|
-
*
|
|
204
|
-
* The batch execution engine may use these sub-formulas for dependency resolution,
|
|
205
|
-
* incremental computation, or performance optimizations.
|
|
206
|
-
*
|
|
207
|
-
* @param {IFormulaStringMap} formulas
|
|
208
|
-
* Nested structure (unit → sheet → row → column) describing formulas and
|
|
209
|
-
* their decomposed sub-expressions.
|
|
210
|
-
*
|
|
211
|
-
* @param {number} [timeout]
|
|
212
|
-
* Optional timeout in milliseconds. If no result is received within this
|
|
213
|
-
* period, the promise will be rejected.
|
|
214
|
-
*
|
|
215
|
-
* @returns {Promise<IFormulaExecuteResultMap>}
|
|
216
|
-
* A promise that resolves with the computed value map mirroring
|
|
217
|
-
* the input structure.
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* ```ts
|
|
221
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
222
|
-
* const formulas = {
|
|
223
|
-
* Book1: {
|
|
224
|
-
* Sheet1: {
|
|
225
|
-
* 2: {
|
|
226
|
-
* 3: [
|
|
227
|
-
* // Full formula:
|
|
228
|
-
* "=SUM(A1:A10) + SQRT(D7)",
|
|
229
|
-
*
|
|
230
|
-
* // Decomposed sub-formulas (each one can be evaluated independently):
|
|
231
|
-
* "SUM(A1:A10)", // sub-formula 1
|
|
232
|
-
* "SQRT(D7)", // sub-formula 2
|
|
233
|
-
* "A1:A10", // range reference
|
|
234
|
-
* "D7", // single-cell reference
|
|
235
|
-
* ],
|
|
236
|
-
* },
|
|
237
|
-
* 4: {
|
|
238
|
-
* 5: [
|
|
239
|
-
* "=A2 + B2 + SQRT(C5)",
|
|
240
|
-
* "A2",
|
|
241
|
-
* "B2",
|
|
242
|
-
* "SQRT(C5)",
|
|
243
|
-
* ],
|
|
244
|
-
* }
|
|
245
|
-
* },
|
|
246
|
-
* },
|
|
247
|
-
* };
|
|
248
|
-
*
|
|
249
|
-
* const result = await formulaEngine.executeFormulas(formulas);
|
|
250
|
-
* console.log(result);
|
|
251
|
-
* ```
|
|
252
|
-
*/
|
|
253
|
-
executeFormulas(e, t = 3e4) {
|
|
254
|
-
return new Promise((r, i) => {
|
|
255
|
-
const n = this._commandService.onCommandExecuted((o) => {
|
|
256
|
-
if (o.id !== w.id)
|
|
257
|
-
return;
|
|
258
|
-
const s = o.params;
|
|
259
|
-
clearTimeout(a), n.dispose(), s.result != null ? r(s.result) : i(new Error("Formula batch calculation returned no result"));
|
|
260
|
-
}), a = setTimeout(() => {
|
|
261
|
-
n.dispose(), i(new Error("Formula batch calculation timeout"));
|
|
262
|
-
}, t);
|
|
263
|
-
this._commandService.executeCommand(
|
|
264
|
-
D.id,
|
|
265
|
-
{ formulas: e },
|
|
266
|
-
{ onlyLocal: !0 }
|
|
267
|
-
);
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Retrieve all formula dependency trees that were produced during the latest
|
|
272
|
-
* dependency-analysis run. This triggers a local dependency-calculation command
|
|
273
|
-
* and returns the complete set of dependency trees once the calculation finishes.
|
|
274
|
-
*
|
|
275
|
-
* @param {number} [timeout]
|
|
276
|
-
* Optional timeout in milliseconds. If no result is received within this
|
|
277
|
-
* period, the promise will be rejected.
|
|
278
|
-
*
|
|
279
|
-
* @returns {Promise<IFormulaDependencyTreeJson[]>}
|
|
280
|
-
* A promise that resolves with the array of dependency trees.
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* ```ts
|
|
284
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
285
|
-
*
|
|
286
|
-
* // Fetch all dependency trees generated for the current workbook.
|
|
287
|
-
* const trees = await formulaEngine.getAllDependencyTrees();
|
|
288
|
-
* console.log('All dependency trees:', trees);
|
|
289
|
-
* ```
|
|
290
|
-
*/
|
|
291
|
-
getAllDependencyTrees(e = 3e4) {
|
|
292
|
-
return new Promise((t, r) => {
|
|
293
|
-
const i = this._commandService.onCommandExecuted((a) => {
|
|
294
|
-
if (a.id !== M.id)
|
|
295
|
-
return;
|
|
296
|
-
const o = a.params;
|
|
297
|
-
clearTimeout(n), i.dispose(), o.result != null ? t(o.result) : t([]);
|
|
298
|
-
}), n = setTimeout(() => {
|
|
299
|
-
i.dispose(), r(new Error("Formula dependency calculation timeout"));
|
|
300
|
-
}, e);
|
|
301
|
-
this._commandService.executeCommand(
|
|
302
|
-
I.id,
|
|
303
|
-
void 0,
|
|
304
|
-
{ onlyLocal: !0 }
|
|
305
|
-
);
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Retrieve the dependency tree of a specific cell. This triggers a local
|
|
310
|
-
* dependency-calculation command for the given unit, sheet, and cell location,
|
|
311
|
-
* and returns the computed dependency tree when the calculation is completed.
|
|
312
|
-
*
|
|
313
|
-
* @param param The target cell location:
|
|
314
|
-
* - `unitId` The workbook ID.
|
|
315
|
-
* - `sheetId` The sheet ID.
|
|
316
|
-
* - `row` The zero-based row index.
|
|
317
|
-
* - `column` The zero-based column index.
|
|
318
|
-
*
|
|
319
|
-
* @param {number} [timeout]
|
|
320
|
-
* Optional timeout in milliseconds. If no result is received within this
|
|
321
|
-
* period, the promise will be rejected.
|
|
322
|
-
*
|
|
323
|
-
* @returns {Promise<IFormulaDependencyTreeFullJson | undefined>}
|
|
324
|
-
* A promise that resolves with the dependency tree or `undefined`
|
|
325
|
-
* if no tree exists for that cell.
|
|
326
|
-
*
|
|
327
|
-
* @example
|
|
328
|
-
* ```ts
|
|
329
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
330
|
-
*
|
|
331
|
-
* // Query the dependency tree for cell B2 in a specific sheet.
|
|
332
|
-
* const tree = await formulaEngine.getCellDependencyTree({
|
|
333
|
-
* unitId: 'workbook1',
|
|
334
|
-
* sheetId: 'sheet1',
|
|
335
|
-
* row: 1,
|
|
336
|
-
* column: 1,
|
|
337
|
-
* });
|
|
338
|
-
*
|
|
339
|
-
* console.log('Cell dependency tree:', tree);
|
|
340
|
-
* ```
|
|
341
|
-
*/
|
|
342
|
-
getCellDependencyTree(e, t = 3e4) {
|
|
343
|
-
return new Promise((r, i) => {
|
|
344
|
-
const n = this._commandService.onCommandExecuted((o) => {
|
|
345
|
-
if (o.id !== N.id)
|
|
346
|
-
return;
|
|
347
|
-
const s = o.params;
|
|
348
|
-
clearTimeout(a), n.dispose(), r(s.result);
|
|
349
|
-
}), a = setTimeout(() => {
|
|
350
|
-
n.dispose(), i(new Error("Cell dependency calculation timeout"));
|
|
351
|
-
}, t);
|
|
352
|
-
this._commandService.executeCommand(
|
|
353
|
-
B.id,
|
|
354
|
-
e,
|
|
355
|
-
{ onlyLocal: !0 }
|
|
356
|
-
);
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Retrieve the full dependency trees for all formulas that *depend on* the
|
|
361
|
-
* specified ranges. This triggers a local dependency-calculation command and
|
|
362
|
-
* resolves once the calculation completes.
|
|
363
|
-
*
|
|
364
|
-
* @param unitRanges An array of workbook/sheet ranges to query. Each range
|
|
365
|
-
* includes:
|
|
366
|
-
* - `unitId` The workbook ID.
|
|
367
|
-
* - `sheetId` The sheet ID.
|
|
368
|
-
* - `range` The row/column boundaries.
|
|
369
|
-
*
|
|
370
|
-
* @param {number} [timeout]
|
|
371
|
-
* Optional timeout in milliseconds. If no result is received within this
|
|
372
|
-
* period, the promise will be rejected.
|
|
373
|
-
*
|
|
374
|
-
* @returns {Promise<IFormulaDependencyTreeJson[]>}
|
|
375
|
-
* A promise that resolves with an array of `IFormulaDependencyTreeJson`
|
|
376
|
-
* representing formulas and their relationships within the dependency graph.
|
|
377
|
-
*
|
|
378
|
-
* @example
|
|
379
|
-
* ```ts
|
|
380
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
381
|
-
*
|
|
382
|
-
* // Query all formulas that depend on A1:B10 in Sheet1.
|
|
383
|
-
* const dependents = await formulaEngine.getRangeDependents([
|
|
384
|
-
* { unitId: 'workbook1', sheetId: 'sheet1', range: { startRow: 0, endRow: 9, startColumn: 0, endColumn: 1 } }
|
|
385
|
-
* ]);
|
|
386
|
-
*
|
|
387
|
-
* console.log('Dependent formulas:', dependents);
|
|
388
|
-
* ```
|
|
389
|
-
*/
|
|
390
|
-
getRangeDependents(e, t = 3e4) {
|
|
391
|
-
return new Promise((r, i) => {
|
|
392
|
-
const n = this._commandService.onCommandExecuted((o) => {
|
|
393
|
-
if (o.id !== d.id)
|
|
394
|
-
return;
|
|
395
|
-
const s = o.params;
|
|
396
|
-
clearTimeout(a), n.dispose(), s.result != null ? r(s.result) : r([]);
|
|
397
|
-
}), a = setTimeout(() => {
|
|
398
|
-
n.dispose(), i(new Error("Range dependents calculation timeout"));
|
|
399
|
-
}, t);
|
|
400
|
-
this._commandService.executeCommand(
|
|
401
|
-
p.id,
|
|
402
|
-
{ unitRanges: e },
|
|
403
|
-
{ onlyLocal: !0 }
|
|
404
|
-
);
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Retrieve the dependency trees of all formulas *inside* the specified ranges.
|
|
409
|
-
* Unlike `getRangeDependents`, this API only returns formulas whose definitions
|
|
410
|
-
* physically reside within the queried ranges.
|
|
411
|
-
*
|
|
412
|
-
* Internally this triggers the same dependency-calculation command but with
|
|
413
|
-
* `isInRange = true`, and the promise resolves when the results are ready.
|
|
414
|
-
*
|
|
415
|
-
* @param unitRanges An array of workbook/sheet ranges defining the lookup
|
|
416
|
-
* boundaries:
|
|
417
|
-
* - `unitId` The workbook ID.
|
|
418
|
-
* - `sheetId` The sheet ID.
|
|
419
|
-
* - `range` The zero-based grid range.
|
|
420
|
-
*
|
|
421
|
-
* @param {number} [timeout]
|
|
422
|
-
* Optional timeout in milliseconds. If no result is received within this
|
|
423
|
-
* period, the promise will be rejected.
|
|
424
|
-
*
|
|
425
|
-
* @returns {Promise<IFormulaDependencyTreeJson[]>}
|
|
426
|
-
* A promise that resolves with an array of `IFormulaDependencyTreeJson`
|
|
427
|
-
* describing every formula found in the provided ranges along with
|
|
428
|
-
* their parent/child relationships.
|
|
429
|
-
*
|
|
430
|
-
* @example
|
|
431
|
-
* ```ts
|
|
432
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
433
|
-
*
|
|
434
|
-
* // Query all formulas that lie within A1:D20 in Sheet1.
|
|
435
|
-
* const formulasInRange = await formulaEngine.getInRangeFormulas([
|
|
436
|
-
* { unitId: 'workbook1', sheetId: 'sheet1', range: { startRow: 0, endRow: 19, startColumn: 0, endColumn: 3 } }
|
|
437
|
-
* ]);
|
|
438
|
-
*
|
|
439
|
-
* console.log('Formulas inside range:', formulasInRange);
|
|
440
|
-
* ```
|
|
441
|
-
*/
|
|
442
|
-
getInRangeFormulas(e, t = 3e4) {
|
|
443
|
-
return new Promise((r, i) => {
|
|
444
|
-
const n = this._commandService.onCommandExecuted((o) => {
|
|
445
|
-
if (o.id !== d.id)
|
|
446
|
-
return;
|
|
447
|
-
const s = o.params;
|
|
448
|
-
clearTimeout(a), n.dispose(), s.result != null ? r(s.result) : r([]);
|
|
449
|
-
}), a = setTimeout(() => {
|
|
450
|
-
n.dispose(), i(new Error("In-range formulas calculation timeout"));
|
|
451
|
-
}, t);
|
|
452
|
-
this._commandService.executeCommand(
|
|
453
|
-
p.id,
|
|
454
|
-
{ unitRanges: e, isInRange: !0 },
|
|
455
|
-
{ onlyLocal: !0 }
|
|
456
|
-
);
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* Enable or disable emitting formula dependency trees after each formula calculation.
|
|
461
|
-
*
|
|
462
|
-
* When enabled, the formula engine will emit the dependency trees produced by
|
|
463
|
-
* each completed formula calculation through the internal command system.
|
|
464
|
-
* Consumers can obtain the result by listening for the corresponding
|
|
465
|
-
* calculation-result command.
|
|
466
|
-
*
|
|
467
|
-
* When disabled, dependency trees will not be emitted.
|
|
468
|
-
*
|
|
469
|
-
* This option only controls whether dependency trees are exposed.
|
|
470
|
-
* It does not affect formula calculation behavior.
|
|
471
|
-
*
|
|
472
|
-
* @param {boolean} value
|
|
473
|
-
* Whether to emit formula dependency trees after calculation.
|
|
474
|
-
* - `true`: Emit dependency trees after each calculation.
|
|
475
|
-
* - `false`: Do not emit dependency trees (default behavior).
|
|
476
|
-
*
|
|
477
|
-
* @example
|
|
478
|
-
* ```ts
|
|
479
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
480
|
-
*
|
|
481
|
-
* // Enable dependency tree emission
|
|
482
|
-
* formulaEngine.setFormulaReturnDependencyTree(true);
|
|
483
|
-
*
|
|
484
|
-
* // Listen for dependency trees produced by formula calculation
|
|
485
|
-
* const trees = await new Promise<IFormulaDependencyTreeJson[]>((resolve, reject) => {
|
|
486
|
-
* const timer = setTimeout(() => {
|
|
487
|
-
* disposable.dispose();
|
|
488
|
-
* reject(new Error('Timeout waiting for formula dependency trees'));
|
|
489
|
-
* }, 30_000);
|
|
490
|
-
*
|
|
491
|
-
* const disposable = commandService.onCommandExecuted((command) => {
|
|
492
|
-
* if (command.id !== SetFormulaDependencyCalculationResultMutation.id) {
|
|
493
|
-
* return;
|
|
494
|
-
* }
|
|
495
|
-
*
|
|
496
|
-
* clearTimeout(timer);
|
|
497
|
-
* disposable.dispose();
|
|
498
|
-
*
|
|
499
|
-
* const params = command.params as ISetFormulaDependencyCalculationResultMutation;
|
|
500
|
-
* resolve(params.result ?? []);
|
|
501
|
-
* });
|
|
502
|
-
* });
|
|
503
|
-
*
|
|
504
|
-
* console.log('Dependency trees:', trees);
|
|
505
|
-
* ```
|
|
506
|
-
*/
|
|
507
|
-
setFormulaReturnDependencyTree(e) {
|
|
508
|
-
this._configService.setConfig(P, e);
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Parse a formula string and return its **formula expression tree**.
|
|
512
|
-
*
|
|
513
|
-
* This API analyzes the syntactic structure of a formula and builds an
|
|
514
|
-
* expression tree that reflects how the formula is composed (functions,
|
|
515
|
-
* operators, ranges, and nested expressions), without performing calculation
|
|
516
|
-
* or dependency evaluation.
|
|
517
|
-
*
|
|
518
|
-
* The returned tree is suitable for:
|
|
519
|
-
* - Formula structure visualization
|
|
520
|
-
* - Explaining complex formulas (e.g. LET / LAMBDA)
|
|
521
|
-
* - Debugging or inspecting formula composition
|
|
522
|
-
* - Building advanced formula tooling
|
|
523
|
-
*
|
|
524
|
-
* ---
|
|
525
|
-
*
|
|
526
|
-
* @example
|
|
527
|
-
* ```ts
|
|
528
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
529
|
-
*
|
|
530
|
-
* const formula = '=LET(x,SUM(A1,B1,A1:B10),y,OFFSET(A1:B10,0,1),SUM(x,y)+x)+1';
|
|
531
|
-
*
|
|
532
|
-
* const exprTree = formulaEngine.getFormulaExpressTree(formula);
|
|
533
|
-
*
|
|
534
|
-
* console.log(exprTree);
|
|
535
|
-
* ```
|
|
536
|
-
*
|
|
537
|
-
* Example output (simplified):
|
|
538
|
-
*
|
|
539
|
-
* ```json
|
|
540
|
-
* {
|
|
541
|
-
* "value": "let(x,sum(A1,B1,A1:B10),y,offset(A1:B10,0,1),sum(x,y)+x)+1",
|
|
542
|
-
* "children": [
|
|
543
|
-
* {
|
|
544
|
-
* "value": "let(x,sum(A1,B1,A1:B10),y,offset(A1:B10,0,1),sum(x,y)+x)",
|
|
545
|
-
* "children": [
|
|
546
|
-
* {
|
|
547
|
-
* "value": "sum(A1,B1,A1:B10)",
|
|
548
|
-
* "children": [
|
|
549
|
-
* {
|
|
550
|
-
* "value": "A1:B10",
|
|
551
|
-
* "children": []
|
|
552
|
-
* }
|
|
553
|
-
* ]
|
|
554
|
-
* },
|
|
555
|
-
* {
|
|
556
|
-
* "value": "offset(A1:B10,0,1)",
|
|
557
|
-
* "children": [
|
|
558
|
-
* {
|
|
559
|
-
* "value": "A1:B10",
|
|
560
|
-
* "children": []
|
|
561
|
-
* }
|
|
562
|
-
* ]
|
|
563
|
-
* }
|
|
564
|
-
* ]
|
|
565
|
-
* }
|
|
566
|
-
* ]
|
|
567
|
-
* }
|
|
568
|
-
* ```
|
|
569
|
-
*
|
|
570
|
-
* @param formulaString The formula string to parse (with or without leading `=`)
|
|
571
|
-
* @returns A formula expression tree describing the hierarchical structure of the formula
|
|
572
|
-
*/
|
|
573
|
-
getFormulaExpressTree(e, t) {
|
|
574
|
-
return this._lexerTreeBuilder.getFormulaExprTree(e, t, this._functionService.hasExecutor.bind(this._functionService), this._definedNamesService.getValueByName.bind(this._definedNamesService), this._superTableService.getTable.bind(this._superTableService));
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* Retrieve **both**:
|
|
578
|
-
* 1) the full dependency trees of all formulas that **depend on** the specified ranges, and
|
|
579
|
-
* 2) the dependency trees of all formulas that **physically reside inside** the specified ranges.
|
|
580
|
-
*
|
|
581
|
-
* This is a convenience API that combines the behaviors of
|
|
582
|
-
* `getRangeDependents` and `getInRangeFormulas` into a single call.
|
|
583
|
-
*
|
|
584
|
-
* Internally, it triggers a local dependency-calculation command once and
|
|
585
|
-
* resolves when both result sets are available, avoiding duplicate
|
|
586
|
-
* calculations and event listeners.
|
|
587
|
-
*
|
|
588
|
-
* @param unitRanges An array of workbook/sheet ranges to query. Each range
|
|
589
|
-
* includes:
|
|
590
|
-
* - `unitId` The workbook ID.
|
|
591
|
-
* - `sheetId` The sheet ID.
|
|
592
|
-
* - `range` The zero-based row/column boundaries.
|
|
593
|
-
*
|
|
594
|
-
* @param {number} [timeout]
|
|
595
|
-
* Optional timeout in milliseconds. If the dependency calculation does
|
|
596
|
-
* not complete within this period, the promise will be rejected.
|
|
597
|
-
*
|
|
598
|
-
* @returns {Promise<IFormulaDependentsAndInRangeResults>}
|
|
599
|
-
* A promise that resolves with an object containing:
|
|
600
|
-
* - `dependents`: Dependency trees of all formulas that depend on the
|
|
601
|
-
* specified ranges (upstream consumers).
|
|
602
|
-
* - `inRanges`: Dependency trees of all formulas whose definitions
|
|
603
|
-
* are located inside the specified ranges.
|
|
604
|
-
*
|
|
605
|
-
* @example
|
|
606
|
-
* ```ts
|
|
607
|
-
* const formulaEngine = univerAPI.getFormula();
|
|
608
|
-
*
|
|
609
|
-
* const result = await formulaEngine.getRangeDependentsAndInRangeFormulas([
|
|
610
|
-
* {
|
|
611
|
-
* unitId: 'workbook1',
|
|
612
|
-
* sheetId: 'sheet1',
|
|
613
|
-
* range: { startRow: 0, endRow: 9, startColumn: 0, endColumn: 1 },
|
|
614
|
-
* },
|
|
615
|
-
* ]);
|
|
616
|
-
*
|
|
617
|
-
* console.log('Dependent formulas:', result.dependents);
|
|
618
|
-
* console.log('Formulas inside range:', result.inRanges);
|
|
619
|
-
* ```
|
|
620
|
-
*/
|
|
621
|
-
getRangeDependentsAndInRangeFormulas(e, t = 3e4) {
|
|
622
|
-
return new Promise((r, i) => {
|
|
623
|
-
const n = this._commandService.onCommandExecuted((o) => {
|
|
624
|
-
if (o.id !== L.id)
|
|
625
|
-
return;
|
|
626
|
-
const s = o.params;
|
|
627
|
-
clearTimeout(a), n.dispose(), s.result != null ? r(s.result) : r({ dependents: [], inRanges: [] });
|
|
628
|
-
}), a = setTimeout(() => {
|
|
629
|
-
n.dispose(), i(new Error("Range dependents calculation timeout"));
|
|
630
|
-
}, t);
|
|
631
|
-
this._commandService.executeCommand(
|
|
632
|
-
O.id,
|
|
633
|
-
{ unitRanges: e },
|
|
634
|
-
{ onlyLocal: !0 }
|
|
635
|
-
);
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
};
|
|
639
|
-
l = z([
|
|
640
|
-
u(0, c(f)),
|
|
641
|
-
u(1, c(C)),
|
|
642
|
-
u(2, c(v)),
|
|
643
|
-
u(3, h),
|
|
644
|
-
u(4, g),
|
|
645
|
-
u(5, E),
|
|
646
|
-
u(6, x)
|
|
647
|
-
], l);
|
|
648
|
-
class V extends S {
|
|
649
|
-
getFormula() {
|
|
650
|
-
return this._injector.createInstance(l);
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
S.extend(V);
|
|
654
|
-
export {
|
|
655
|
-
l as FFormula
|
|
656
|
-
};
|
|
1
|
+
import{FBase as e,FUniver as t}from"@univerjs/core/facade";import{ICommandService as n,IConfigService as r,Inject as i,Injector as a}from"@univerjs/core";import{ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as o,ENGINE_FORMULA_RETURN_DEPENDENCY_TREE as s,GlobalComputingStatusService as c,IDefinedNamesService as l,IFunctionService as u,ISuperTableService as d,LexerTreeBuilder as f,SetCellFormulaDependencyCalculationMutation as p,SetCellFormulaDependencyCalculationResultMutation as m,SetFormulaCalculationNotificationMutation as h,SetFormulaCalculationStartMutation as g,SetFormulaCalculationStopMutation as _,SetFormulaDependencyCalculationMutation as v,SetFormulaDependencyCalculationResultMutation as y,SetFormulaStringBatchCalculationMutation as b,SetFormulaStringBatchCalculationResultMutation as x,SetQueryFormulaDependencyAllMutation as S,SetQueryFormulaDependencyAllResultMutation as C,SetQueryFormulaDependencyMutation as w,SetQueryFormulaDependencyResultMutation as T,SetTriggerFormulaCalculationStartMutation as E}from"@univerjs/engine-formula";import{filter as D,firstValueFrom as O,map as k,race as A,timer as j}from"rxjs";function M(e,t){return function(n,r){t(n,r,e)}}function N(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let P=class extends e{constructor(e,t,n,r,i,a,o){super(),this._commandService=e,this._injector=t,this._lexerTreeBuilder=n,this._configService=r,this._functionService=i,this._definedNamesService=a,this._superTableService=o,this._initialize()}_initialize(){}get lexerTreeBuilder(){return this._lexerTreeBuilder}moveFormulaRefOffset(e,t,n,r){return this._lexerTreeBuilder.moveFormulaRefOffset(e,t,n,r)}sequenceNodesBuilder(e){return this._lexerTreeBuilder.sequenceNodesBuilder(e)||[]}executeCalculation(){this._commandService.executeCommand(E.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})}stopCalculation(){this._commandService.executeCommand(_.id,{})}calculationStart(e){return this._commandService.onCommandExecuted(t=>{if(t.id===g.id){let n=t.params;e(n.forceCalculation)}})}calculationEnd(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==h.id)return;let n=t.params;n.functionsExecutedState!==void 0&&e(n.functionsExecutedState)})}whenComputingCompleteAsync(e){let t=this._injector.get(c);return t.computingStatus?Promise.resolve(!0):O(A(t.computingStatus$.pipe(D(e=>e)),j(e==null?3e4:e).pipe(k(()=>!1))))}onCalculationEnd(){return new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Calculation end timeout`))},3e4),r=this.calculationEnd(()=>{clearTimeout(n),r.dispose(),e()})})}calculationProcessing(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==h.id)return;let n=t.params;n.stageInfo!==void 0&&e(n.stageInfo)})}setMaxIteration(e){this._configService.setConfig(o,e)}executeFormulas(e,t=3e4){return new Promise((n,r)=>{let i=this._commandService.onCommandExecuted(e=>{if(e.id!==x.id)return;let t=e.params;clearTimeout(a),i.dispose(),t.result==null?r(Error(`Formula batch calculation returned no result`)):n(t.result)}),a=setTimeout(()=>{i.dispose(),r(Error(`Formula batch calculation timeout`))},t);this._commandService.executeCommand(b.id,{formulas:e},{onlyLocal:!0})})}getAllDependencyTrees(e=3e4){return new Promise((t,n)=>{let r=this._commandService.onCommandExecuted(e=>{if(e.id!==y.id)return;let n=e.params;clearTimeout(i),r.dispose(),n.result==null?t([]):t(n.result)}),i=setTimeout(()=>{r.dispose(),n(Error(`Formula dependency calculation timeout`))},e);this._commandService.executeCommand(v.id,void 0,{onlyLocal:!0})})}getCellDependencyTree(e,t=3e4){return new Promise((n,r)=>{let i=this._commandService.onCommandExecuted(e=>{if(e.id!==m.id)return;let t=e.params;clearTimeout(a),i.dispose(),n(t.result)}),a=setTimeout(()=>{i.dispose(),r(Error(`Cell dependency calculation timeout`))},t);this._commandService.executeCommand(p.id,e,{onlyLocal:!0})})}getRangeDependents(e,t=3e4){return new Promise((n,r)=>{let i=this._commandService.onCommandExecuted(e=>{if(e.id!==T.id)return;let t=e.params;clearTimeout(a),i.dispose(),t.result==null?n([]):n(t.result)}),a=setTimeout(()=>{i.dispose(),r(Error(`Range dependents calculation timeout`))},t);this._commandService.executeCommand(w.id,{unitRanges:e},{onlyLocal:!0})})}getInRangeFormulas(e,t=3e4){return new Promise((n,r)=>{let i=this._commandService.onCommandExecuted(e=>{if(e.id!==T.id)return;let t=e.params;clearTimeout(a),i.dispose(),t.result==null?n([]):n(t.result)}),a=setTimeout(()=>{i.dispose(),r(Error(`In-range formulas calculation timeout`))},t);this._commandService.executeCommand(w.id,{unitRanges:e,isInRange:!0},{onlyLocal:!0})})}setFormulaReturnDependencyTree(e){this._configService.setConfig(s,e)}getFormulaExpressTree(e,t){return this._lexerTreeBuilder.getFormulaExprTree(e,t,this._functionService.hasExecutor.bind(this._functionService),this._definedNamesService.getValueByName.bind(this._definedNamesService),this._superTableService.getTable.bind(this._superTableService))}getRangeDependentsAndInRangeFormulas(e,t=3e4){return new Promise((n,r)=>{let i=this._commandService.onCommandExecuted(e=>{if(e.id!==C.id)return;let t=e.params;clearTimeout(a),i.dispose(),t.result==null?n({dependents:[],inRanges:[]}):n(t.result)}),a=setTimeout(()=>{i.dispose(),r(Error(`Range dependents calculation timeout`))},t);this._commandService.executeCommand(S.id,{unitRanges:e},{onlyLocal:!0})})}};P=N([M(0,i(n)),M(1,i(a)),M(2,i(f)),M(3,r),M(4,u),M(5,l),M(6,d)],P);var F=class extends t{getFormula(){return this._injector.createInstance(P)}};t.extend(F);export{P as FFormula};
|