@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.
Files changed (661) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/es/facade.js +1 -656
  4. package/lib/es/index.js +1 -33445
  5. package/lib/facade.js +1 -656
  6. package/lib/index.js +1 -33445
  7. package/lib/types/basics/cache-lru.d.ts +15 -0
  8. package/lib/types/basics/calculate.d.ts +15 -0
  9. package/lib/types/basics/common.d.ts +18 -3
  10. package/lib/types/basics/database.d.ts +17 -1
  11. package/lib/types/basics/date.d.ts +17 -1
  12. package/lib/types/basics/dirty.d.ts +16 -1
  13. package/lib/types/basics/financial.d.ts +15 -0
  14. package/lib/types/basics/format.d.ts +16 -1
  15. package/lib/types/basics/function.d.ts +32 -17
  16. package/lib/types/basics/inverted-index-cache.d.ts +16 -1
  17. package/lib/types/basics/is-null-cell.d.ts +16 -1
  18. package/lib/types/basics/match-token.d.ts +15 -0
  19. package/lib/types/basics/runtime.d.ts +16 -1
  20. package/lib/types/basics/statistical.d.ts +20 -4
  21. package/lib/types/commands/mutations/formula.mutation.d.ts +16 -1
  22. package/lib/types/commands/mutations/register-function.mutation.d.ts +16 -1
  23. package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +17 -2
  24. package/lib/types/commands/mutations/set-defined-name.mutation.d.ts +16 -1
  25. package/lib/types/commands/mutations/set-feature-calculation.mutation.d.ts +17 -2
  26. package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +20 -5
  27. package/lib/types/commands/mutations/set-formula-data.mutation.d.ts +17 -2
  28. package/lib/types/commands/mutations/set-image-formula-data.mutation.d.ts +17 -2
  29. package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +17 -2
  30. package/lib/types/commands/mutations/set-super-table.mutation.d.ts +18 -3
  31. package/lib/types/config/config.d.ts +18 -3
  32. package/lib/types/controllers/calculate.controller.d.ts +15 -0
  33. package/lib/types/controllers/computing-status.controller.d.ts +15 -0
  34. package/lib/types/controllers/formula.controller.d.ts +15 -0
  35. package/lib/types/controllers/set-dependency.controller.d.ts +15 -0
  36. package/lib/types/controllers/set-feature-calculation.controller.d.ts +15 -0
  37. package/lib/types/controllers/set-other-formula.controller.d.ts +15 -0
  38. package/lib/types/controllers/set-super-table.controller.d.ts +15 -0
  39. package/lib/types/engine/analysis/lexer-node.d.ts +17 -2
  40. package/lib/types/engine/analysis/lexer-tree-builder.d.ts +21 -5
  41. package/lib/types/engine/analysis/lexer.d.ts +16 -1
  42. package/lib/types/engine/analysis/parser.d.ts +18 -2
  43. package/lib/types/engine/ast-node/ast-root-node.d.ts +15 -0
  44. package/lib/types/engine/ast-node/base-ast-node-factory.d.ts +16 -1
  45. package/lib/types/engine/ast-node/base-ast-node.d.ts +18 -3
  46. package/lib/types/engine/ast-node/function-node.d.ts +17 -2
  47. package/lib/types/engine/ast-node/lambda-node.d.ts +15 -0
  48. package/lib/types/engine/ast-node/lambda-parameter-node.d.ts +17 -1
  49. package/lib/types/engine/ast-node/null-node.d.ts +15 -0
  50. package/lib/types/engine/ast-node/operator-node.d.ts +16 -1
  51. package/lib/types/engine/ast-node/prefix-node.d.ts +17 -2
  52. package/lib/types/engine/ast-node/reference-node.d.ts +15 -0
  53. package/lib/types/engine/ast-node/suffix-node.d.ts +16 -1
  54. package/lib/types/engine/ast-node/union-node.d.ts +15 -0
  55. package/lib/types/engine/ast-node/value-node.d.ts +15 -0
  56. package/lib/types/engine/dependency/dependency-tree.d.ts +20 -5
  57. package/lib/types/engine/dependency/formula-dependency.d.ts +27 -9
  58. package/lib/types/engine/interpreter/interpreter.d.ts +21 -5
  59. package/lib/types/engine/reference-object/base-reference-object.d.ts +25 -9
  60. package/lib/types/engine/reference-object/cell-reference-object.d.ts +16 -1
  61. package/lib/types/engine/reference-object/column-reference-object.d.ts +15 -0
  62. package/lib/types/engine/reference-object/multi-area-reference-object.d.ts +21 -6
  63. package/lib/types/engine/reference-object/range-reference-object.d.ts +16 -1
  64. package/lib/types/engine/reference-object/row-reference-object.d.ts +15 -0
  65. package/lib/types/engine/reference-object/table-reference-object.d.ts +18 -2
  66. package/lib/types/engine/utils/array-object.d.ts +16 -1
  67. package/lib/types/engine/utils/ast-node-tool.d.ts +17 -2
  68. package/lib/types/engine/utils/cell.d.ts +18 -3
  69. package/lib/types/engine/utils/check-variant-error.d.ts +16 -1
  70. package/lib/types/engine/utils/compare.d.ts +15 -0
  71. package/lib/types/engine/utils/function-definition.d.ts +15 -0
  72. package/lib/types/engine/utils/generate-ast-node.d.ts +21 -6
  73. package/lib/types/engine/utils/get-runtime-feature-cell.d.ts +17 -2
  74. package/lib/types/engine/utils/node-type.d.ts +19 -4
  75. package/lib/types/engine/utils/numfmt-kit.d.ts +17 -1
  76. package/lib/types/engine/utils/object-compare.d.ts +17 -2
  77. package/lib/types/engine/utils/prefix-handler.d.ts +18 -3
  78. package/lib/types/engine/utils/r1c1-reference.d.ts +16 -1
  79. package/lib/types/engine/utils/reference-cache.d.ts +16 -1
  80. package/lib/types/engine/utils/reference.d.ts +17 -1
  81. package/lib/types/engine/utils/sequence.d.ts +16 -1
  82. package/lib/types/engine/utils/update-lambda-statement.d.ts +16 -1
  83. package/lib/types/engine/utils/value-object.d.ts +19 -3
  84. package/lib/types/engine/value-object/array-value-object.d.ts +18 -2
  85. package/lib/types/engine/value-object/base-value-object.d.ts +16 -1
  86. package/lib/types/engine/value-object/cube-value-object.d.ts +16 -1
  87. package/lib/types/engine/value-object/lambda-value-object.d.ts +21 -5
  88. package/lib/types/engine/value-object/primitive-object.d.ts +15 -0
  89. package/lib/types/facade/f-formula.d.ts +19 -2
  90. package/lib/types/facade/f-univer.d.ts +15 -0
  91. package/lib/types/functions/array/array-constrain/index.d.ts +16 -1
  92. package/lib/types/functions/array/flatten/index.d.ts +16 -1
  93. package/lib/types/functions/array/function-map.d.ts +15 -0
  94. package/lib/types/functions/base-function.d.ts +27 -10
  95. package/lib/types/functions/column-like-functions.d.ts +16 -1
  96. package/lib/types/functions/compatibility/betadist/index.d.ts +16 -1
  97. package/lib/types/functions/compatibility/function-map.d.ts +15 -0
  98. package/lib/types/functions/compatibility/hypgeomdist/index.d.ts +16 -1
  99. package/lib/types/functions/compatibility/lognormdist/index.d.ts +16 -1
  100. package/lib/types/functions/compatibility/negbinomdist/index.d.ts +16 -1
  101. package/lib/types/functions/compatibility/normsdist/index.d.ts +16 -1
  102. package/lib/types/functions/compatibility/rank/index.d.ts +17 -2
  103. package/lib/types/functions/compatibility/tdist/index.d.ts +16 -1
  104. package/lib/types/functions/custom-function.d.ts +15 -0
  105. package/lib/types/functions/database/daverage/index.d.ts +17 -1
  106. package/lib/types/functions/database/dcount/index.d.ts +16 -1
  107. package/lib/types/functions/database/dcounta/index.d.ts +16 -1
  108. package/lib/types/functions/database/dget/index.d.ts +16 -1
  109. package/lib/types/functions/database/dmax/index.d.ts +16 -1
  110. package/lib/types/functions/database/dmin/index.d.ts +16 -1
  111. package/lib/types/functions/database/dproduct/index.d.ts +16 -1
  112. package/lib/types/functions/database/dstdev/index.d.ts +17 -1
  113. package/lib/types/functions/database/dstdevp/index.d.ts +17 -1
  114. package/lib/types/functions/database/dsum/index.d.ts +16 -1
  115. package/lib/types/functions/database/dvar/index.d.ts +17 -1
  116. package/lib/types/functions/database/dvarp/index.d.ts +17 -1
  117. package/lib/types/functions/database/function-map.d.ts +15 -0
  118. package/lib/types/functions/date/date/index.d.ts +16 -1
  119. package/lib/types/functions/date/datedif/index.d.ts +16 -1
  120. package/lib/types/functions/date/datevalue/index.d.ts +16 -1
  121. package/lib/types/functions/date/day/index.d.ts +16 -1
  122. package/lib/types/functions/date/days/index.d.ts +16 -1
  123. package/lib/types/functions/date/days360/index.d.ts +16 -1
  124. package/lib/types/functions/date/edate/index.d.ts +16 -1
  125. package/lib/types/functions/date/eomonth/index.d.ts +16 -1
  126. package/lib/types/functions/date/epochtodate/index.d.ts +17 -2
  127. package/lib/types/functions/date/function-map.d.ts +15 -0
  128. package/lib/types/functions/date/hour/index.d.ts +16 -1
  129. package/lib/types/functions/date/isoweeknum/index.d.ts +16 -1
  130. package/lib/types/functions/date/minute/index.d.ts +16 -1
  131. package/lib/types/functions/date/month/index.d.ts +16 -1
  132. package/lib/types/functions/date/networkdays/index.d.ts +16 -1
  133. package/lib/types/functions/date/networkdays-intl/index.d.ts +16 -1
  134. package/lib/types/functions/date/now/index.d.ts +15 -0
  135. package/lib/types/functions/date/second/index.d.ts +16 -1
  136. package/lib/types/functions/date/time/index.d.ts +16 -1
  137. package/lib/types/functions/date/timevalue/index.d.ts +16 -1
  138. package/lib/types/functions/date/to-date/index.d.ts +17 -2
  139. package/lib/types/functions/date/today/index.d.ts +15 -0
  140. package/lib/types/functions/date/weekday/index.d.ts +16 -1
  141. package/lib/types/functions/date/weeknum/index.d.ts +16 -1
  142. package/lib/types/functions/date/workday/index.d.ts +16 -1
  143. package/lib/types/functions/date/workday-intl/index.d.ts +16 -1
  144. package/lib/types/functions/date/year/index.d.ts +16 -1
  145. package/lib/types/functions/date/yearfrac/index.d.ts +16 -1
  146. package/lib/types/functions/engineering/besseli/index.d.ts +16 -1
  147. package/lib/types/functions/engineering/besselj/index.d.ts +16 -1
  148. package/lib/types/functions/engineering/besselk/index.d.ts +16 -1
  149. package/lib/types/functions/engineering/bessely/index.d.ts +16 -1
  150. package/lib/types/functions/engineering/bin2dec/index.d.ts +16 -1
  151. package/lib/types/functions/engineering/bin2hex/index.d.ts +16 -1
  152. package/lib/types/functions/engineering/bin2oct/index.d.ts +16 -1
  153. package/lib/types/functions/engineering/bitand/index.d.ts +16 -1
  154. package/lib/types/functions/engineering/bitlshift/index.d.ts +16 -1
  155. package/lib/types/functions/engineering/bitor/index.d.ts +16 -1
  156. package/lib/types/functions/engineering/bitrshift/index.d.ts +16 -1
  157. package/lib/types/functions/engineering/bitxor/index.d.ts +16 -1
  158. package/lib/types/functions/engineering/complex/index.d.ts +16 -1
  159. package/lib/types/functions/engineering/convert/index.d.ts +16 -1
  160. package/lib/types/functions/engineering/dec2bin/index.d.ts +16 -1
  161. package/lib/types/functions/engineering/dec2hex/index.d.ts +16 -1
  162. package/lib/types/functions/engineering/dec2oct/index.d.ts +16 -1
  163. package/lib/types/functions/engineering/delta/index.d.ts +16 -1
  164. package/lib/types/functions/engineering/erf/index.d.ts +16 -1
  165. package/lib/types/functions/engineering/erf-precise/index.d.ts +16 -1
  166. package/lib/types/functions/engineering/erfc/index.d.ts +16 -1
  167. package/lib/types/functions/engineering/erfc-precise/index.d.ts +16 -1
  168. package/lib/types/functions/engineering/function-map.d.ts +15 -0
  169. package/lib/types/functions/engineering/gestep/index.d.ts +16 -1
  170. package/lib/types/functions/engineering/hex2bin/index.d.ts +16 -1
  171. package/lib/types/functions/engineering/hex2dec/index.d.ts +16 -1
  172. package/lib/types/functions/engineering/hex2oct/index.d.ts +16 -1
  173. package/lib/types/functions/engineering/imabs/index.d.ts +16 -1
  174. package/lib/types/functions/engineering/imaginary/index.d.ts +16 -1
  175. package/lib/types/functions/engineering/imargument/index.d.ts +16 -1
  176. package/lib/types/functions/engineering/imconjugate/index.d.ts +16 -1
  177. package/lib/types/functions/engineering/imcos/index.d.ts +16 -1
  178. package/lib/types/functions/engineering/imcosh/index.d.ts +16 -1
  179. package/lib/types/functions/engineering/imcot/index.d.ts +16 -1
  180. package/lib/types/functions/engineering/imcoth/index.d.ts +16 -1
  181. package/lib/types/functions/engineering/imcsc/index.d.ts +16 -1
  182. package/lib/types/functions/engineering/imcsch/index.d.ts +16 -1
  183. package/lib/types/functions/engineering/imdiv/index.d.ts +16 -1
  184. package/lib/types/functions/engineering/imexp/index.d.ts +16 -1
  185. package/lib/types/functions/engineering/imln/index.d.ts +16 -1
  186. package/lib/types/functions/engineering/imlog/index.d.ts +16 -1
  187. package/lib/types/functions/engineering/imlog10/index.d.ts +16 -1
  188. package/lib/types/functions/engineering/imlog2/index.d.ts +16 -1
  189. package/lib/types/functions/engineering/impower/index.d.ts +16 -1
  190. package/lib/types/functions/engineering/improduct/index.d.ts +16 -1
  191. package/lib/types/functions/engineering/imreal/index.d.ts +16 -1
  192. package/lib/types/functions/engineering/imsec/index.d.ts +16 -1
  193. package/lib/types/functions/engineering/imsech/index.d.ts +16 -1
  194. package/lib/types/functions/engineering/imsin/index.d.ts +16 -1
  195. package/lib/types/functions/engineering/imsinh/index.d.ts +16 -1
  196. package/lib/types/functions/engineering/imsqrt/index.d.ts +16 -1
  197. package/lib/types/functions/engineering/imsub/index.d.ts +16 -1
  198. package/lib/types/functions/engineering/imsum/index.d.ts +16 -1
  199. package/lib/types/functions/engineering/imtan/index.d.ts +16 -1
  200. package/lib/types/functions/engineering/imtanh/index.d.ts +16 -1
  201. package/lib/types/functions/engineering/oct2bin/index.d.ts +16 -1
  202. package/lib/types/functions/engineering/oct2dec/index.d.ts +16 -1
  203. package/lib/types/functions/engineering/oct2hex/index.d.ts +16 -1
  204. package/lib/types/functions/financial/accrint/index.d.ts +16 -1
  205. package/lib/types/functions/financial/accrintm/index.d.ts +16 -1
  206. package/lib/types/functions/financial/amorlinc/index.d.ts +16 -1
  207. package/lib/types/functions/financial/coupdaybs/index.d.ts +16 -1
  208. package/lib/types/functions/financial/coupdays/index.d.ts +16 -1
  209. package/lib/types/functions/financial/coupdaysnc/index.d.ts +16 -1
  210. package/lib/types/functions/financial/coupncd/index.d.ts +16 -1
  211. package/lib/types/functions/financial/coupnum/index.d.ts +16 -1
  212. package/lib/types/functions/financial/couppcd/index.d.ts +16 -1
  213. package/lib/types/functions/financial/cumipmt/index.d.ts +16 -1
  214. package/lib/types/functions/financial/cumprinc/index.d.ts +16 -1
  215. package/lib/types/functions/financial/db/index.d.ts +16 -1
  216. package/lib/types/functions/financial/ddb/index.d.ts +16 -1
  217. package/lib/types/functions/financial/disc/index.d.ts +16 -1
  218. package/lib/types/functions/financial/dollarde/index.d.ts +16 -1
  219. package/lib/types/functions/financial/dollarfr/index.d.ts +16 -1
  220. package/lib/types/functions/financial/duration/index.d.ts +16 -1
  221. package/lib/types/functions/financial/effect/index.d.ts +16 -1
  222. package/lib/types/functions/financial/function-map.d.ts +15 -0
  223. package/lib/types/functions/financial/fv/index.d.ts +16 -1
  224. package/lib/types/functions/financial/fvschedule/index.d.ts +16 -1
  225. package/lib/types/functions/financial/intrate/index.d.ts +16 -1
  226. package/lib/types/functions/financial/ipmt/index.d.ts +16 -1
  227. package/lib/types/functions/financial/irr/index.d.ts +16 -1
  228. package/lib/types/functions/financial/ispmt/index.d.ts +16 -1
  229. package/lib/types/functions/financial/mduration/index.d.ts +16 -1
  230. package/lib/types/functions/financial/mirr/index.d.ts +16 -1
  231. package/lib/types/functions/financial/nominal/index.d.ts +16 -1
  232. package/lib/types/functions/financial/nper/index.d.ts +16 -1
  233. package/lib/types/functions/financial/npv/index.d.ts +16 -1
  234. package/lib/types/functions/financial/oddfprice/index.d.ts +16 -1
  235. package/lib/types/functions/financial/oddfyield/index.d.ts +16 -1
  236. package/lib/types/functions/financial/oddlprice/index.d.ts +16 -1
  237. package/lib/types/functions/financial/oddlyield/index.d.ts +16 -1
  238. package/lib/types/functions/financial/pduration/index.d.ts +16 -1
  239. package/lib/types/functions/financial/pmt/index.d.ts +16 -1
  240. package/lib/types/functions/financial/ppmt/index.d.ts +16 -1
  241. package/lib/types/functions/financial/price/index.d.ts +16 -1
  242. package/lib/types/functions/financial/pricedisc/index.d.ts +16 -1
  243. package/lib/types/functions/financial/pricemat/index.d.ts +16 -1
  244. package/lib/types/functions/financial/pv/index.d.ts +16 -1
  245. package/lib/types/functions/financial/rate/index.d.ts +16 -1
  246. package/lib/types/functions/financial/received/index.d.ts +16 -1
  247. package/lib/types/functions/financial/rri/index.d.ts +16 -1
  248. package/lib/types/functions/financial/sln/index.d.ts +16 -1
  249. package/lib/types/functions/financial/syd/index.d.ts +16 -1
  250. package/lib/types/functions/financial/tbilleq/index.d.ts +16 -1
  251. package/lib/types/functions/financial/tbillprice/index.d.ts +16 -1
  252. package/lib/types/functions/financial/tbillyield/index.d.ts +16 -1
  253. package/lib/types/functions/financial/vdb/index.d.ts +16 -1
  254. package/lib/types/functions/financial/xirr/index.d.ts +16 -1
  255. package/lib/types/functions/financial/xnpv/index.d.ts +16 -1
  256. package/lib/types/functions/financial/yield/index.d.ts +16 -1
  257. package/lib/types/functions/financial/yielddisc/index.d.ts +16 -1
  258. package/lib/types/functions/financial/yieldmat/index.d.ts +16 -1
  259. package/lib/types/functions/information/cell/index.d.ts +16 -1
  260. package/lib/types/functions/information/error-type/index.d.ts +16 -1
  261. package/lib/types/functions/information/function-map.d.ts +15 -0
  262. package/lib/types/functions/information/isbetween/index.d.ts +16 -1
  263. package/lib/types/functions/information/isblank/index.d.ts +17 -2
  264. package/lib/types/functions/information/isdate/index.d.ts +16 -1
  265. package/lib/types/functions/information/isemail/index.d.ts +16 -1
  266. package/lib/types/functions/information/iserr/index.d.ts +17 -2
  267. package/lib/types/functions/information/iserror/index.d.ts +17 -2
  268. package/lib/types/functions/information/iseven/iseven.d.ts +16 -1
  269. package/lib/types/functions/information/isformula/index.d.ts +17 -2
  270. package/lib/types/functions/information/islogical/index.d.ts +17 -2
  271. package/lib/types/functions/information/isna/index.d.ts +17 -2
  272. package/lib/types/functions/information/isnontext/index.d.ts +17 -2
  273. package/lib/types/functions/information/isnumber/index.d.ts +17 -2
  274. package/lib/types/functions/information/isodd/isodd.d.ts +16 -1
  275. package/lib/types/functions/information/isref/index.d.ts +16 -1
  276. package/lib/types/functions/information/istext/index.d.ts +17 -2
  277. package/lib/types/functions/information/isurl/index.d.ts +16 -1
  278. package/lib/types/functions/information/n/index.d.ts +16 -1
  279. package/lib/types/functions/information/na/index.d.ts +15 -0
  280. package/lib/types/functions/information/sheet/index.d.ts +17 -2
  281. package/lib/types/functions/information/sheets/index.d.ts +16 -1
  282. package/lib/types/functions/information/type/index.d.ts +16 -1
  283. package/lib/types/functions/logical/and/index.d.ts +16 -1
  284. package/lib/types/functions/logical/bycol/index.d.ts +17 -2
  285. package/lib/types/functions/logical/byrow/index.d.ts +17 -2
  286. package/lib/types/functions/logical/false/index.d.ts +15 -0
  287. package/lib/types/functions/logical/function-map.d.ts +15 -0
  288. package/lib/types/functions/logical/if/index.d.ts +17 -2
  289. package/lib/types/functions/logical/iferror/index.d.ts +17 -2
  290. package/lib/types/functions/logical/ifna/index.d.ts +17 -2
  291. package/lib/types/functions/logical/ifs/index.d.ts +16 -1
  292. package/lib/types/functions/logical/lambda/index.d.ts +17 -1
  293. package/lib/types/functions/logical/let/index.d.ts +17 -1
  294. package/lib/types/functions/logical/makearray/index.d.ts +17 -1
  295. package/lib/types/functions/logical/map/index.d.ts +17 -2
  296. package/lib/types/functions/logical/not/index.d.ts +16 -1
  297. package/lib/types/functions/logical/or/index.d.ts +16 -1
  298. package/lib/types/functions/logical/reduce/index.d.ts +17 -2
  299. package/lib/types/functions/logical/scan/index.d.ts +17 -2
  300. package/lib/types/functions/logical/switch/index.d.ts +16 -1
  301. package/lib/types/functions/logical/true/index.d.ts +15 -0
  302. package/lib/types/functions/logical/xor/index.d.ts +16 -1
  303. package/lib/types/functions/lookup/address/index.d.ts +16 -1
  304. package/lib/types/functions/lookup/areas/index.d.ts +16 -1
  305. package/lib/types/functions/lookup/choose/index.d.ts +16 -1
  306. package/lib/types/functions/lookup/choosecols/index.d.ts +16 -1
  307. package/lib/types/functions/lookup/chooserows/index.d.ts +16 -1
  308. package/lib/types/functions/lookup/column/index.d.ts +16 -1
  309. package/lib/types/functions/lookup/columns/index.d.ts +16 -1
  310. package/lib/types/functions/lookup/drop/index.d.ts +16 -1
  311. package/lib/types/functions/lookup/expand/index.d.ts +16 -1
  312. package/lib/types/functions/lookup/filter/index.d.ts +16 -1
  313. package/lib/types/functions/lookup/formulatext/index.d.ts +18 -3
  314. package/lib/types/functions/lookup/function-map.d.ts +15 -0
  315. package/lib/types/functions/lookup/hlookup/index.d.ts +16 -1
  316. package/lib/types/functions/lookup/hstack/index.d.ts +16 -1
  317. package/lib/types/functions/lookup/hyperlink/index.d.ts +16 -1
  318. package/lib/types/functions/lookup/image/index.d.ts +16 -1
  319. package/lib/types/functions/lookup/index/index.d.ts +17 -2
  320. package/lib/types/functions/lookup/indirect/index.d.ts +17 -2
  321. package/lib/types/functions/lookup/lookup/index.d.ts +17 -2
  322. package/lib/types/functions/lookup/match/index.d.ts +17 -2
  323. package/lib/types/functions/lookup/offset/index.d.ts +16 -1
  324. package/lib/types/functions/lookup/row/index.d.ts +16 -1
  325. package/lib/types/functions/lookup/rows/index.d.ts +16 -1
  326. package/lib/types/functions/lookup/sort/index.d.ts +16 -1
  327. package/lib/types/functions/lookup/sortby/index.d.ts +17 -1
  328. package/lib/types/functions/lookup/take/index.d.ts +16 -1
  329. package/lib/types/functions/lookup/tocol/index.d.ts +16 -1
  330. package/lib/types/functions/lookup/torow/index.d.ts +16 -1
  331. package/lib/types/functions/lookup/transpose/index.d.ts +17 -2
  332. package/lib/types/functions/lookup/unique/index.d.ts +16 -1
  333. package/lib/types/functions/lookup/vlookup/index.d.ts +17 -2
  334. package/lib/types/functions/lookup/vstack/index.d.ts +16 -1
  335. package/lib/types/functions/lookup/wrapcols/index.d.ts +16 -1
  336. package/lib/types/functions/lookup/wraprows/index.d.ts +16 -1
  337. package/lib/types/functions/lookup/xlookup/index.d.ts +16 -1
  338. package/lib/types/functions/lookup/xmatch/index.d.ts +16 -1
  339. package/lib/types/functions/math/abs/index.d.ts +16 -1
  340. package/lib/types/functions/math/acos/index.d.ts +16 -1
  341. package/lib/types/functions/math/acosh/index.d.ts +16 -1
  342. package/lib/types/functions/math/acot/index.d.ts +16 -1
  343. package/lib/types/functions/math/acoth/index.d.ts +16 -1
  344. package/lib/types/functions/math/aggregate/index.d.ts +18 -3
  345. package/lib/types/functions/math/arabic/index.d.ts +16 -1
  346. package/lib/types/functions/math/asin/index.d.ts +16 -1
  347. package/lib/types/functions/math/asinh/index.d.ts +16 -1
  348. package/lib/types/functions/math/atan/index.d.ts +16 -1
  349. package/lib/types/functions/math/atan2/index.d.ts +16 -1
  350. package/lib/types/functions/math/atanh/index.d.ts +16 -1
  351. package/lib/types/functions/math/base/index.d.ts +16 -1
  352. package/lib/types/functions/math/ceiling/index.d.ts +16 -1
  353. package/lib/types/functions/math/ceiling-math/index.d.ts +16 -1
  354. package/lib/types/functions/math/ceiling-precise/index.d.ts +16 -1
  355. package/lib/types/functions/math/combin/index.d.ts +16 -1
  356. package/lib/types/functions/math/combina/index.d.ts +16 -1
  357. package/lib/types/functions/math/cos/index.d.ts +16 -1
  358. package/lib/types/functions/math/cosh/index.d.ts +16 -1
  359. package/lib/types/functions/math/cot/index.d.ts +16 -1
  360. package/lib/types/functions/math/coth/index.d.ts +16 -1
  361. package/lib/types/functions/math/csc/index.d.ts +16 -1
  362. package/lib/types/functions/math/csch/index.d.ts +16 -1
  363. package/lib/types/functions/math/decimal/index.d.ts +16 -1
  364. package/lib/types/functions/math/degrees/index.d.ts +16 -1
  365. package/lib/types/functions/math/even/index.d.ts +16 -1
  366. package/lib/types/functions/math/exp/index.d.ts +16 -1
  367. package/lib/types/functions/math/fact/index.d.ts +16 -1
  368. package/lib/types/functions/math/factdouble/index.d.ts +16 -1
  369. package/lib/types/functions/math/floor/index.d.ts +16 -1
  370. package/lib/types/functions/math/floor-math/index.d.ts +16 -1
  371. package/lib/types/functions/math/floor-precise/index.d.ts +16 -1
  372. package/lib/types/functions/math/function-map.d.ts +15 -0
  373. package/lib/types/functions/math/gcd/index.d.ts +16 -1
  374. package/lib/types/functions/math/int/index.d.ts +16 -1
  375. package/lib/types/functions/math/lcm/index.d.ts +16 -1
  376. package/lib/types/functions/math/ln/index.d.ts +16 -1
  377. package/lib/types/functions/math/log/index.d.ts +16 -1
  378. package/lib/types/functions/math/log10/index.d.ts +16 -1
  379. package/lib/types/functions/math/mdeterm/index.d.ts +16 -1
  380. package/lib/types/functions/math/minverse/index.d.ts +16 -1
  381. package/lib/types/functions/math/mmult/index.d.ts +16 -1
  382. package/lib/types/functions/math/mod/index.d.ts +16 -1
  383. package/lib/types/functions/math/mround/index.d.ts +16 -1
  384. package/lib/types/functions/math/multinomial/index.d.ts +16 -1
  385. package/lib/types/functions/math/munit/index.d.ts +16 -1
  386. package/lib/types/functions/math/odd/index.d.ts +16 -1
  387. package/lib/types/functions/math/pi/index.d.ts +15 -0
  388. package/lib/types/functions/math/power/index.d.ts +16 -1
  389. package/lib/types/functions/math/product/index.d.ts +16 -1
  390. package/lib/types/functions/math/quotient/index.d.ts +16 -1
  391. package/lib/types/functions/math/radians/index.d.ts +16 -1
  392. package/lib/types/functions/math/rand/index.d.ts +15 -0
  393. package/lib/types/functions/math/randarray/index.d.ts +16 -1
  394. package/lib/types/functions/math/randbetween/index.d.ts +16 -1
  395. package/lib/types/functions/math/roman/index.d.ts +16 -1
  396. package/lib/types/functions/math/round/index.d.ts +16 -1
  397. package/lib/types/functions/math/roundbank/index.d.ts +16 -1
  398. package/lib/types/functions/math/rounddown/index.d.ts +16 -1
  399. package/lib/types/functions/math/roundup/index.d.ts +16 -1
  400. package/lib/types/functions/math/sec/index.d.ts +16 -1
  401. package/lib/types/functions/math/sech/index.d.ts +16 -1
  402. package/lib/types/functions/math/sequence/index.d.ts +16 -1
  403. package/lib/types/functions/math/seriessum/index.d.ts +16 -1
  404. package/lib/types/functions/math/sign/index.d.ts +16 -1
  405. package/lib/types/functions/math/sin/index.d.ts +16 -1
  406. package/lib/types/functions/math/sinh/index.d.ts +16 -1
  407. package/lib/types/functions/math/sqrt/index.d.ts +16 -1
  408. package/lib/types/functions/math/sqrtpi/index.d.ts +16 -1
  409. package/lib/types/functions/math/subtotal/index.d.ts +18 -3
  410. package/lib/types/functions/math/sum/index.d.ts +16 -1
  411. package/lib/types/functions/math/sumif/index.d.ts +17 -2
  412. package/lib/types/functions/math/sumifs/index.d.ts +17 -2
  413. package/lib/types/functions/math/sumproduct/index.d.ts +16 -1
  414. package/lib/types/functions/math/sumsq/index.d.ts +16 -1
  415. package/lib/types/functions/math/sumx2my2/index.d.ts +16 -1
  416. package/lib/types/functions/math/sumx2py2/index.d.ts +16 -1
  417. package/lib/types/functions/math/sumxmy2/index.d.ts +16 -1
  418. package/lib/types/functions/math/tan/index.d.ts +16 -1
  419. package/lib/types/functions/math/tanh/index.d.ts +16 -1
  420. package/lib/types/functions/math/trunc/index.d.ts +16 -1
  421. package/lib/types/functions/meta/compare/index.d.ts +16 -1
  422. package/lib/types/functions/meta/cube/index.d.ts +16 -1
  423. package/lib/types/functions/meta/divided/index.d.ts +16 -1
  424. package/lib/types/functions/meta/function-map.d.ts +15 -0
  425. package/lib/types/functions/meta/minus/index.d.ts +16 -1
  426. package/lib/types/functions/meta/multiply/index.d.ts +16 -1
  427. package/lib/types/functions/meta/plus/index.d.ts +16 -1
  428. package/lib/types/functions/new-excel-functions.d.ts +16 -1
  429. package/lib/types/functions/statistical/avedev/index.d.ts +16 -1
  430. package/lib/types/functions/statistical/average/index.d.ts +16 -1
  431. package/lib/types/functions/statistical/average-weighted/index.d.ts +16 -1
  432. package/lib/types/functions/statistical/averagea/index.d.ts +16 -1
  433. package/lib/types/functions/statistical/averageif/index.d.ts +17 -2
  434. package/lib/types/functions/statistical/averageifs/index.d.ts +17 -2
  435. package/lib/types/functions/statistical/beta-dist/index.d.ts +16 -1
  436. package/lib/types/functions/statistical/beta-inv/index.d.ts +16 -1
  437. package/lib/types/functions/statistical/binom-dist/index.d.ts +16 -1
  438. package/lib/types/functions/statistical/binom-dist-range/index.d.ts +16 -1
  439. package/lib/types/functions/statistical/binom-inv/index.d.ts +16 -1
  440. package/lib/types/functions/statistical/chisq-dist/index.d.ts +16 -1
  441. package/lib/types/functions/statistical/chisq-dist-rt/index.d.ts +16 -1
  442. package/lib/types/functions/statistical/chisq-inv/index.d.ts +16 -1
  443. package/lib/types/functions/statistical/chisq-inv-rt/index.d.ts +16 -1
  444. package/lib/types/functions/statistical/chisq-test/index.d.ts +16 -1
  445. package/lib/types/functions/statistical/confidence-norm/index.d.ts +16 -1
  446. package/lib/types/functions/statistical/confidence-t/index.d.ts +16 -1
  447. package/lib/types/functions/statistical/correl/index.d.ts +16 -1
  448. package/lib/types/functions/statistical/count/index.d.ts +16 -1
  449. package/lib/types/functions/statistical/counta/index.d.ts +16 -1
  450. package/lib/types/functions/statistical/countblank/index.d.ts +16 -1
  451. package/lib/types/functions/statistical/countif/index.d.ts +17 -2
  452. package/lib/types/functions/statistical/countifs/index.d.ts +17 -2
  453. package/lib/types/functions/statistical/covariance-p/index.d.ts +16 -1
  454. package/lib/types/functions/statistical/covariance-s/index.d.ts +16 -1
  455. package/lib/types/functions/statistical/devsq/index.d.ts +16 -1
  456. package/lib/types/functions/statistical/expon-dist/index.d.ts +16 -1
  457. package/lib/types/functions/statistical/f-dist/index.d.ts +16 -1
  458. package/lib/types/functions/statistical/f-dist-rt/index.d.ts +16 -1
  459. package/lib/types/functions/statistical/f-inv/index.d.ts +16 -1
  460. package/lib/types/functions/statistical/f-inv-rt/index.d.ts +16 -1
  461. package/lib/types/functions/statistical/f-test/index.d.ts +16 -1
  462. package/lib/types/functions/statistical/fisher/index.d.ts +16 -1
  463. package/lib/types/functions/statistical/fisherinv/index.d.ts +16 -1
  464. package/lib/types/functions/statistical/forecast/index.d.ts +16 -1
  465. package/lib/types/functions/statistical/frequency/index.d.ts +16 -1
  466. package/lib/types/functions/statistical/function-map.d.ts +15 -0
  467. package/lib/types/functions/statistical/gamma/index.d.ts +16 -1
  468. package/lib/types/functions/statistical/gamma-dist/index.d.ts +16 -1
  469. package/lib/types/functions/statistical/gamma-inv/index.d.ts +16 -1
  470. package/lib/types/functions/statistical/gammaln/index.d.ts +16 -1
  471. package/lib/types/functions/statistical/gauss/index.d.ts +16 -1
  472. package/lib/types/functions/statistical/geomean/index.d.ts +16 -1
  473. package/lib/types/functions/statistical/growth/index.d.ts +16 -1
  474. package/lib/types/functions/statistical/harmean/index.d.ts +16 -1
  475. package/lib/types/functions/statistical/hypgeom-dist/index.d.ts +16 -1
  476. package/lib/types/functions/statistical/intercept/index.d.ts +16 -1
  477. package/lib/types/functions/statistical/kurt/index.d.ts +16 -1
  478. package/lib/types/functions/statistical/large/index.d.ts +16 -1
  479. package/lib/types/functions/statistical/linest/index.d.ts +16 -1
  480. package/lib/types/functions/statistical/logest/index.d.ts +16 -1
  481. package/lib/types/functions/statistical/lognorm-dist/index.d.ts +16 -1
  482. package/lib/types/functions/statistical/lognorm-inv/index.d.ts +16 -1
  483. package/lib/types/functions/statistical/marginoferror/index.d.ts +16 -1
  484. package/lib/types/functions/statistical/max/index.d.ts +16 -1
  485. package/lib/types/functions/statistical/maxa/index.d.ts +16 -1
  486. package/lib/types/functions/statistical/maxifs/index.d.ts +17 -2
  487. package/lib/types/functions/statistical/median/index.d.ts +16 -1
  488. package/lib/types/functions/statistical/min/index.d.ts +16 -1
  489. package/lib/types/functions/statistical/mina/index.d.ts +16 -1
  490. package/lib/types/functions/statistical/minifs/index.d.ts +17 -2
  491. package/lib/types/functions/statistical/mode-mult/index.d.ts +16 -1
  492. package/lib/types/functions/statistical/mode-sngl/index.d.ts +16 -1
  493. package/lib/types/functions/statistical/negbinom-dist/index.d.ts +16 -1
  494. package/lib/types/functions/statistical/norm-dist/index.d.ts +16 -1
  495. package/lib/types/functions/statistical/norm-inv/index.d.ts +16 -1
  496. package/lib/types/functions/statistical/norm-s-dist/index.d.ts +16 -1
  497. package/lib/types/functions/statistical/norm-s-inv/index.d.ts +16 -1
  498. package/lib/types/functions/statistical/pearson/index.d.ts +16 -1
  499. package/lib/types/functions/statistical/percentile-exc/index.d.ts +16 -1
  500. package/lib/types/functions/statistical/percentile-inc/index.d.ts +16 -1
  501. package/lib/types/functions/statistical/percentrank-exc/index.d.ts +16 -1
  502. package/lib/types/functions/statistical/percentrank-inc/index.d.ts +16 -1
  503. package/lib/types/functions/statistical/permut/index.d.ts +16 -1
  504. package/lib/types/functions/statistical/permutationa/index.d.ts +16 -1
  505. package/lib/types/functions/statistical/phi/index.d.ts +16 -1
  506. package/lib/types/functions/statistical/poisson-dist/index.d.ts +16 -1
  507. package/lib/types/functions/statistical/prob/index.d.ts +16 -1
  508. package/lib/types/functions/statistical/quartile-exc/index.d.ts +16 -1
  509. package/lib/types/functions/statistical/quartile-inc/index.d.ts +16 -1
  510. package/lib/types/functions/statistical/rank-avg/index.d.ts +17 -2
  511. package/lib/types/functions/statistical/rank-eq/index.d.ts +17 -2
  512. package/lib/types/functions/statistical/rsq/index.d.ts +16 -1
  513. package/lib/types/functions/statistical/skew/index.d.ts +16 -1
  514. package/lib/types/functions/statistical/skew-p/index.d.ts +16 -1
  515. package/lib/types/functions/statistical/slope/index.d.ts +16 -1
  516. package/lib/types/functions/statistical/small/index.d.ts +16 -1
  517. package/lib/types/functions/statistical/standardize/index.d.ts +16 -1
  518. package/lib/types/functions/statistical/stdev-p/index.d.ts +17 -2
  519. package/lib/types/functions/statistical/stdev-s/index.d.ts +17 -2
  520. package/lib/types/functions/statistical/stdeva/index.d.ts +17 -2
  521. package/lib/types/functions/statistical/stdevpa/index.d.ts +17 -2
  522. package/lib/types/functions/statistical/steyx/index.d.ts +16 -1
  523. package/lib/types/functions/statistical/t-dist/index.d.ts +16 -1
  524. package/lib/types/functions/statistical/t-dist-2t/index.d.ts +16 -1
  525. package/lib/types/functions/statistical/t-dist-rt/index.d.ts +16 -1
  526. package/lib/types/functions/statistical/t-inv/index.d.ts +16 -1
  527. package/lib/types/functions/statistical/t-inv-2t/index.d.ts +16 -1
  528. package/lib/types/functions/statistical/t-test/index.d.ts +16 -1
  529. package/lib/types/functions/statistical/trend/index.d.ts +16 -1
  530. package/lib/types/functions/statistical/trimmean/index.d.ts +16 -1
  531. package/lib/types/functions/statistical/var-p/index.d.ts +17 -2
  532. package/lib/types/functions/statistical/var-s/index.d.ts +17 -2
  533. package/lib/types/functions/statistical/vara/index.d.ts +17 -2
  534. package/lib/types/functions/statistical/varpa/index.d.ts +17 -2
  535. package/lib/types/functions/statistical/weibull-dist/index.d.ts +16 -1
  536. package/lib/types/functions/statistical/z-test/index.d.ts +16 -1
  537. package/lib/types/functions/text/arraytotext/index.d.ts +16 -1
  538. package/lib/types/functions/text/asc/index.d.ts +16 -1
  539. package/lib/types/functions/text/bahttext/index.d.ts +16 -1
  540. package/lib/types/functions/text/char/index.d.ts +16 -1
  541. package/lib/types/functions/text/clean/index.d.ts +16 -1
  542. package/lib/types/functions/text/code/index.d.ts +16 -1
  543. package/lib/types/functions/text/concat/index.d.ts +16 -1
  544. package/lib/types/functions/text/concatenate/index.d.ts +16 -1
  545. package/lib/types/functions/text/dbcs/index.d.ts +16 -1
  546. package/lib/types/functions/text/dollar/index.d.ts +16 -1
  547. package/lib/types/functions/text/exact/index.d.ts +16 -1
  548. package/lib/types/functions/text/find/index.d.ts +16 -1
  549. package/lib/types/functions/text/findb/index.d.ts +16 -1
  550. package/lib/types/functions/text/fixed/index.d.ts +16 -1
  551. package/lib/types/functions/text/function-map.d.ts +15 -0
  552. package/lib/types/functions/text/left/index.d.ts +16 -1
  553. package/lib/types/functions/text/leftb/index.d.ts +16 -1
  554. package/lib/types/functions/text/len/index.d.ts +16 -1
  555. package/lib/types/functions/text/lenb/index.d.ts +16 -1
  556. package/lib/types/functions/text/lower/index.d.ts +16 -1
  557. package/lib/types/functions/text/mid/index.d.ts +16 -1
  558. package/lib/types/functions/text/midb/index.d.ts +16 -1
  559. package/lib/types/functions/text/numberstring/index.d.ts +16 -1
  560. package/lib/types/functions/text/numbervalue/index.d.ts +16 -1
  561. package/lib/types/functions/text/proper/index.d.ts +16 -1
  562. package/lib/types/functions/text/regexextract/index.d.ts +16 -1
  563. package/lib/types/functions/text/regexmatch/index.d.ts +16 -1
  564. package/lib/types/functions/text/regexreplace/index.d.ts +16 -1
  565. package/lib/types/functions/text/replace/index.d.ts +16 -1
  566. package/lib/types/functions/text/replaceb/index.d.ts +16 -1
  567. package/lib/types/functions/text/rept/index.d.ts +16 -1
  568. package/lib/types/functions/text/right/index.d.ts +16 -1
  569. package/lib/types/functions/text/rightb/index.d.ts +16 -1
  570. package/lib/types/functions/text/search/index.d.ts +16 -1
  571. package/lib/types/functions/text/searchb/index.d.ts +16 -1
  572. package/lib/types/functions/text/substitute/index.d.ts +16 -1
  573. package/lib/types/functions/text/t/index.d.ts +17 -2
  574. package/lib/types/functions/text/text/index.d.ts +16 -1
  575. package/lib/types/functions/text/textafter/index.d.ts +17 -2
  576. package/lib/types/functions/text/textbefore/index.d.ts +17 -2
  577. package/lib/types/functions/text/textjoin/index.d.ts +16 -1
  578. package/lib/types/functions/text/textsplit/index.d.ts +16 -1
  579. package/lib/types/functions/text/trim/index.d.ts +16 -1
  580. package/lib/types/functions/text/unichar/index.d.ts +16 -1
  581. package/lib/types/functions/text/unicode/index.d.ts +16 -1
  582. package/lib/types/functions/text/upper/index.d.ts +16 -1
  583. package/lib/types/functions/text/value/index.d.ts +16 -1
  584. package/lib/types/functions/text/valuetotext/index.d.ts +16 -1
  585. package/lib/types/functions/util.d.ts +17 -1
  586. package/lib/types/functions/web/encodeurl/index.d.ts +16 -1
  587. package/lib/types/functions/web/function-map.d.ts +15 -0
  588. package/lib/types/models/formula-data.model.d.ts +18 -2
  589. package/lib/types/models/utils/formula-data-util.d.ts +17 -2
  590. package/lib/types/plugin.d.ts +16 -1
  591. package/lib/types/services/active-dirty-manager.service.d.ts +19 -3
  592. package/lib/types/services/calculate-formula.service.d.ts +25 -7
  593. package/lib/types/services/current-data.service.d.ts +19 -3
  594. package/lib/types/services/defined-names.service.d.ts +19 -3
  595. package/lib/types/services/dependency-manager.service.d.ts +20 -4
  596. package/lib/types/services/feature-calculation-manager.service.d.ts +23 -7
  597. package/lib/types/services/formula-common.d.ts +16 -1
  598. package/lib/types/services/function.service.d.ts +20 -4
  599. package/lib/types/services/global-computing-status.service.d.ts +18 -2
  600. package/lib/types/services/hyperlink-engine-formula.service.d.ts +18 -2
  601. package/lib/types/services/other-formula-manager.service.d.ts +19 -3
  602. package/lib/types/services/register-other-formula.service.d.ts +20 -4
  603. package/lib/types/services/runtime.service.d.ts +22 -6
  604. package/lib/types/services/sheet-row-filtered.service.d.ts +16 -1
  605. package/lib/types/services/super-table.service.d.ts +21 -4
  606. package/lib/umd/facade.js +1 -1
  607. package/lib/umd/index.js +9 -1
  608. package/package.json +8 -7
  609. package/lib/types/functions/logical/bycol/__test__/index.spec.d.ts +0 -16
  610. package/lib/types/functions/logical/byrow/__test__/index.spec.d.ts +0 -16
  611. package/lib/types/functions/logical/makearray/__test__/index.spec.d.ts +0 -16
  612. package/lib/types/functions/logical/map/__test__/index.spec.d.ts +0 -16
  613. package/lib/types/functions/logical/reduce/__test__/index.spec.d.ts +0 -16
  614. package/lib/types/functions/logical/scan/__test__/index.spec.d.ts +0 -16
  615. package/lib/types/functions/lookup/index/__test__/index.spec.d.ts +0 -16
  616. package/lib/types/functions/lookup/indirect/__test__/index.spec.d.ts +0 -16
  617. package/lib/types/functions/text/arraytotext/__test__/index.spec.d.ts +0 -16
  618. package/lib/types/functions/text/asc/__test__/index.spec.d.ts +0 -16
  619. package/lib/types/functions/text/bahttext/__test__/index.spec.d.ts +0 -16
  620. package/lib/types/functions/text/char/__test__/index.spec.d.ts +0 -16
  621. package/lib/types/functions/text/clean/__test__/index.spec.d.ts +0 -16
  622. package/lib/types/functions/text/code/__test__/index.spec.d.ts +0 -16
  623. package/lib/types/functions/text/dbcs/__test__/index.spec.d.ts +0 -16
  624. package/lib/types/functions/text/dollar/__test__/index.spec.d.ts +0 -16
  625. package/lib/types/functions/text/exact/__test__/index.spec.d.ts +0 -16
  626. package/lib/types/functions/text/find/__test__/index.spec.d.ts +0 -16
  627. package/lib/types/functions/text/findb/__test__/index.spec.d.ts +0 -16
  628. package/lib/types/functions/text/fixed/__test__/index.spec.d.ts +0 -16
  629. package/lib/types/functions/text/left/__test__/index.spec.d.ts +0 -16
  630. package/lib/types/functions/text/leftb/__test__/index.spec.d.ts +0 -16
  631. package/lib/types/functions/text/len/__test__/index.spec.d.ts +0 -16
  632. package/lib/types/functions/text/lenb/__test__/index.spec.d.ts +0 -16
  633. package/lib/types/functions/text/lower/__test__/index.spec.d.ts +0 -16
  634. package/lib/types/functions/text/mid/__test__/index.spec.d.ts +0 -16
  635. package/lib/types/functions/text/midb/__test__/index.spec.d.ts +0 -16
  636. package/lib/types/functions/text/numberstring/__test__/index.spec.d.ts +0 -16
  637. package/lib/types/functions/text/numbervalue/__test__/index.spec.d.ts +0 -16
  638. package/lib/types/functions/text/proper/__test__/index.spec.d.ts +0 -16
  639. package/lib/types/functions/text/regexextract/__test__/index.spec.d.ts +0 -16
  640. package/lib/types/functions/text/regexmatch/__test__/index.spec.d.ts +0 -16
  641. package/lib/types/functions/text/regexreplace/__test__/index.spec.d.ts +0 -16
  642. package/lib/types/functions/text/replace/__test__/index.spec.d.ts +0 -16
  643. package/lib/types/functions/text/replaceb/__test__/index.spec.d.ts +0 -16
  644. package/lib/types/functions/text/rept/__test__/index.spec.d.ts +0 -16
  645. package/lib/types/functions/text/right/__test__/index.spec.d.ts +0 -16
  646. package/lib/types/functions/text/rightb/__test__/index.spec.d.ts +0 -16
  647. package/lib/types/functions/text/search/__test__/index.spec.d.ts +0 -16
  648. package/lib/types/functions/text/searchb/__test__/index.spec.d.ts +0 -16
  649. package/lib/types/functions/text/substitute/__test__/index.spec.d.ts +0 -16
  650. package/lib/types/functions/text/t/__test__/index.spec.d.ts +0 -16
  651. package/lib/types/functions/text/text/__test__/index.spec.d.ts +0 -16
  652. package/lib/types/functions/text/textafter/__test__/index.spec.d.ts +0 -16
  653. package/lib/types/functions/text/textbefore/__test__/index.spec.d.ts +0 -16
  654. package/lib/types/functions/text/textjoin/__test__/index.spec.d.ts +0 -16
  655. package/lib/types/functions/text/textsplit/__test__/index.spec.d.ts +0 -16
  656. package/lib/types/functions/text/trim/__test__/index.spec.d.ts +0 -16
  657. package/lib/types/functions/text/unichar/__test__/index.spec.d.ts +0 -16
  658. package/lib/types/functions/text/unicode/__test__/index.spec.d.ts +0 -16
  659. package/lib/types/functions/text/upper/__test__/index.spec.d.ts +0 -16
  660. package/lib/types/functions/text/value/__test__/index.spec.d.ts +0 -16
  661. package/lib/types/functions/text/valuetotext/__test__/index.spec.d.ts +0 -16
package/lib/es/facade.js CHANGED
@@ -1,656 +1 @@
1
- import { FBase as _, FUniver as S } from "@univerjs/core/facade";
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};