@univerjs/engine-formula 0.4.2 → 0.5.0-alpha.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 (183) hide show
  1. package/lib/cjs/facade.js +1 -0
  2. package/lib/cjs/index.js +2 -2
  3. package/lib/es/facade.js +79 -0
  4. package/lib/es/index.js +23862 -21567
  5. package/lib/types/basics/common.d.ts +6 -2
  6. package/lib/types/basics/format.d.ts +2 -15
  7. package/lib/types/basics/math.d.ts +3 -0
  8. package/lib/types/basics/statistical.d.ts +19 -3
  9. package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +2 -2
  10. package/lib/types/controller/calculate.controller.d.ts +2 -2
  11. package/lib/types/engine/analysis/parser.d.ts +0 -2
  12. package/lib/types/engine/ast-node/base-ast-node.d.ts +1 -0
  13. package/lib/types/engine/ast-node/function-node.d.ts +5 -2
  14. package/lib/types/engine/ast-node/operator-node.d.ts +1 -2
  15. package/lib/types/engine/ast-node/prefix-node.d.ts +6 -5
  16. package/lib/types/engine/ast-node/reference-node.d.ts +8 -10
  17. package/lib/types/engine/ast-node/suffix-node.d.ts +8 -5
  18. package/lib/types/engine/ast-node/union-node.d.ts +1 -2
  19. package/lib/types/engine/ast-node/value-node.d.ts +1 -2
  20. package/lib/types/engine/dependency/dependency-tree.d.ts +85 -38
  21. package/lib/types/engine/dependency/formula-dependency.d.ts +45 -36
  22. package/lib/types/engine/interpreter/interpreter.d.ts +3 -3
  23. package/lib/types/engine/utils/array-object.d.ts +1 -1
  24. package/lib/types/engine/utils/ast-node-tool.d.ts +1 -1
  25. package/lib/types/engine/utils/generate-ast-node.d.ts +8 -0
  26. package/lib/types/engine/utils/prefixHandler.d.ts +3 -2
  27. package/lib/types/engine/utils/value-object.d.ts +9 -1
  28. package/lib/types/engine/value-object/__tests__/array-inverted-index-cache.spec.d.ts +16 -0
  29. package/lib/types/engine/value-object/__tests__/array-inverted-index-cache2.spec.d.ts +16 -0
  30. package/lib/types/engine/value-object/cube-value-object.d.ts +1 -0
  31. package/lib/types/engine/value-object/lambda-value-object.d.ts +3 -1
  32. package/lib/types/engine/value-object/primitive-object.d.ts +0 -1
  33. package/lib/types/facade/f-formula.d.ts +31 -0
  34. package/lib/types/facade/f-univer.d.ts +9 -0
  35. package/lib/types/facade/index.d.ts +17 -0
  36. package/lib/types/functions/base-function.d.ts +7 -0
  37. package/lib/types/functions/compatibility/hypgeomdist/__tests__/index.spec.d.ts +16 -0
  38. package/lib/types/functions/compatibility/hypgeomdist/index.d.ts +8 -0
  39. package/lib/types/functions/compatibility/lognormdist/__tests__/index.spec.d.ts +16 -0
  40. package/lib/types/functions/compatibility/lognormdist/index.d.ts +8 -0
  41. package/lib/types/functions/compatibility/negbinomdist/__tests__/index.spec.d.ts +16 -0
  42. package/lib/types/functions/compatibility/negbinomdist/index.d.ts +8 -0
  43. package/lib/types/functions/compatibility/tdist/__tests__/index.spec.d.ts +16 -0
  44. package/lib/types/functions/compatibility/tdist/index.d.ts +8 -0
  45. package/lib/types/functions/financial/fv/index.d.ts +1 -1
  46. package/lib/types/functions/financial/ipmt/index.d.ts +1 -1
  47. package/lib/types/functions/financial/pmt/index.d.ts +1 -1
  48. package/lib/types/functions/financial/ppmt/index.d.ts +1 -1
  49. package/lib/types/functions/financial/pv/index.d.ts +1 -1
  50. package/lib/types/functions/lookup/formulatext/__tests__/index.spec.d.ts +16 -0
  51. package/lib/types/functions/lookup/formulatext/index.d.ts +10 -0
  52. package/lib/types/functions/lookup/lookup/index.d.ts +1 -1
  53. package/lib/types/functions/math/mmult/index.d.ts +0 -1
  54. package/lib/types/functions/statistical/frequency/__tests__/index.spec.d.ts +16 -0
  55. package/lib/types/functions/statistical/frequency/index.d.ts +9 -0
  56. package/lib/types/functions/statistical/gamma/__tests__/index.spec.d.ts +16 -0
  57. package/lib/types/functions/statistical/gamma/index.d.ts +8 -0
  58. package/lib/types/functions/statistical/gamma-dist/__tests__/index.spec.d.ts +16 -0
  59. package/lib/types/functions/statistical/gamma-dist/index.d.ts +8 -0
  60. package/lib/types/functions/statistical/gamma-inv/__tests__/index.spec.d.ts +16 -0
  61. package/lib/types/functions/statistical/gamma-inv/index.d.ts +8 -0
  62. package/lib/types/functions/statistical/gammaln/__tests__/index.spec.d.ts +16 -0
  63. package/lib/types/functions/statistical/gammaln/index.d.ts +8 -0
  64. package/lib/types/functions/statistical/gauss/__tests__/index.spec.d.ts +16 -0
  65. package/lib/types/functions/statistical/gauss/index.d.ts +8 -0
  66. package/lib/types/functions/statistical/geomean/__tests__/index.spec.d.ts +16 -0
  67. package/lib/types/functions/statistical/geomean/index.d.ts +7 -0
  68. package/lib/types/functions/statistical/growth/__tests__/index.spec.d.ts +16 -0
  69. package/lib/types/functions/statistical/growth/index.d.ts +16 -0
  70. package/lib/types/functions/statistical/harmean/__tests__/index.spec.d.ts +16 -0
  71. package/lib/types/functions/statistical/harmean/index.d.ts +7 -0
  72. package/lib/types/functions/statistical/hypgeom-dist/__tests__/index.spec.d.ts +16 -0
  73. package/lib/types/functions/statistical/hypgeom-dist/index.d.ts +8 -0
  74. package/lib/types/functions/statistical/kurt/__tests__/index.spec.d.ts +16 -0
  75. package/lib/types/functions/statistical/kurt/index.d.ts +8 -0
  76. package/lib/types/functions/statistical/large/__tests__/index.spec.d.ts +16 -0
  77. package/lib/types/functions/statistical/large/index.d.ts +9 -0
  78. package/lib/types/functions/statistical/lognorm-dist/__tests__/index.spec.d.ts +16 -0
  79. package/lib/types/functions/statistical/lognorm-dist/index.d.ts +8 -0
  80. package/lib/types/functions/statistical/lognorm-inv/__tests__/index.spec.d.ts +16 -0
  81. package/lib/types/functions/statistical/lognorm-inv/index.d.ts +8 -0
  82. package/lib/types/functions/statistical/median/__tests__/index.spec.d.ts +16 -0
  83. package/lib/types/functions/statistical/median/index.d.ts +8 -0
  84. package/lib/types/functions/statistical/mode-mult/__tests__/index.spec.d.ts +16 -0
  85. package/lib/types/functions/statistical/mode-mult/index.d.ts +8 -0
  86. package/lib/types/functions/statistical/mode-sngl/__tests__/index.spec.d.ts +16 -0
  87. package/lib/types/functions/statistical/mode-sngl/index.d.ts +8 -0
  88. package/lib/types/functions/statistical/negbinom-dist/__tests__/index.spec.d.ts +16 -0
  89. package/lib/types/functions/statistical/negbinom-dist/index.d.ts +8 -0
  90. package/lib/types/functions/statistical/pearson/__tests__/index.spec.d.ts +16 -0
  91. package/lib/types/functions/statistical/pearson/index.d.ts +8 -0
  92. package/lib/types/functions/statistical/percentile-exc/__tests__/index.spec.d.ts +16 -0
  93. package/lib/types/functions/statistical/percentile-exc/index.d.ts +9 -0
  94. package/lib/types/functions/statistical/percentile-inc/__tests__/index.spec.d.ts +16 -0
  95. package/lib/types/functions/statistical/percentile-inc/index.d.ts +9 -0
  96. package/lib/types/functions/statistical/percentrank-exc/__tests__/index.spec.d.ts +16 -0
  97. package/lib/types/functions/statistical/percentrank-exc/index.d.ts +9 -0
  98. package/lib/types/functions/statistical/percentrank-inc/__tests__/index.spec.d.ts +16 -0
  99. package/lib/types/functions/statistical/percentrank-inc/index.d.ts +9 -0
  100. package/lib/types/functions/statistical/permut/__tests__/index.spec.d.ts +16 -0
  101. package/lib/types/functions/statistical/permut/index.d.ts +7 -0
  102. package/lib/types/functions/statistical/permutationa/__tests__/index.spec.d.ts +16 -0
  103. package/lib/types/functions/statistical/permutationa/index.d.ts +7 -0
  104. package/lib/types/functions/statistical/phi/__tests__/index.spec.d.ts +16 -0
  105. package/lib/types/functions/statistical/phi/index.d.ts +8 -0
  106. package/lib/types/functions/statistical/poisson-dist/__tests__/index.spec.d.ts +16 -0
  107. package/lib/types/functions/statistical/poisson-dist/index.d.ts +8 -0
  108. package/lib/types/functions/statistical/prob/__tests__/index.spec.d.ts +16 -0
  109. package/lib/types/functions/statistical/prob/index.d.ts +9 -0
  110. package/lib/types/functions/statistical/quartile-exc/__tests__/index.spec.d.ts +16 -0
  111. package/lib/types/functions/statistical/quartile-exc/index.d.ts +9 -0
  112. package/lib/types/functions/statistical/quartile-inc/__tests__/index.spec.d.ts +16 -0
  113. package/lib/types/functions/statistical/quartile-inc/index.d.ts +9 -0
  114. package/lib/types/functions/statistical/rsq/__tests__/index.spec.d.ts +16 -0
  115. package/lib/types/functions/statistical/rsq/index.d.ts +8 -0
  116. package/lib/types/functions/statistical/skew/__tests__/index.spec.d.ts +16 -0
  117. package/lib/types/functions/statistical/skew/index.d.ts +8 -0
  118. package/lib/types/functions/statistical/skew-p/__tests__/index.spec.d.ts +16 -0
  119. package/lib/types/functions/statistical/skew-p/index.d.ts +8 -0
  120. package/lib/types/functions/statistical/slope/__tests__/index.spec.d.ts +16 -0
  121. package/lib/types/functions/statistical/slope/index.d.ts +8 -0
  122. package/lib/types/functions/statistical/small/__tests__/index.spec.d.ts +16 -0
  123. package/lib/types/functions/statistical/small/index.d.ts +9 -0
  124. package/lib/types/functions/statistical/standardize/__tests__/index.spec.d.ts +16 -0
  125. package/lib/types/functions/statistical/standardize/index.d.ts +8 -0
  126. package/lib/types/functions/statistical/steyx/__tests__/index.spec.d.ts +16 -0
  127. package/lib/types/functions/statistical/steyx/index.d.ts +8 -0
  128. package/lib/types/functions/statistical/t-dist/__tests__/index.spec.d.ts +16 -0
  129. package/lib/types/functions/statistical/t-dist/index.d.ts +8 -0
  130. package/lib/types/functions/statistical/t-dist-2t/__tests__/index.spec.d.ts +16 -0
  131. package/lib/types/functions/statistical/t-dist-2t/index.d.ts +8 -0
  132. package/lib/types/functions/statistical/t-dist-rt/__tests__/index.spec.d.ts +16 -0
  133. package/lib/types/functions/statistical/t-dist-rt/index.d.ts +8 -0
  134. package/lib/types/functions/statistical/t-inv/__tests__/index.spec.d.ts +16 -0
  135. package/lib/types/functions/statistical/t-inv/index.d.ts +8 -0
  136. package/lib/types/functions/statistical/t-inv-2t/__tests__/index.spec.d.ts +16 -0
  137. package/lib/types/functions/statistical/t-inv-2t/index.d.ts +8 -0
  138. package/lib/types/functions/statistical/t-test/__tests__/index.spec.d.ts +16 -0
  139. package/lib/types/functions/statistical/t-test/index.d.ts +14 -0
  140. package/lib/types/functions/statistical/trimmean/__tests__/index.spec.d.ts +16 -0
  141. package/lib/types/functions/statistical/trimmean/index.d.ts +9 -0
  142. package/lib/types/functions/statistical/weibull-dist/__tests__/index.spec.d.ts +16 -0
  143. package/lib/types/functions/statistical/weibull-dist/index.d.ts +8 -0
  144. package/lib/types/functions/statistical/z-test/__tests__/index.spec.d.ts +16 -0
  145. package/lib/types/functions/statistical/z-test/index.d.ts +9 -0
  146. package/lib/types/functions/text/exact/index.d.ts +1 -1
  147. package/lib/types/functions/text/find/__test__/index.spec.d.ts +16 -0
  148. package/lib/types/functions/text/find/index.d.ts +8 -0
  149. package/lib/types/functions/text/findb/__test__/index.spec.d.ts +16 -0
  150. package/lib/types/functions/text/findb/index.d.ts +8 -0
  151. package/lib/types/functions/text/function-map.d.ts +1 -2
  152. package/lib/types/functions/text/left/__test__/index.spec.d.ts +16 -0
  153. package/lib/types/functions/text/left/index.d.ts +8 -0
  154. package/lib/types/functions/text/lower/index.d.ts +2 -3
  155. package/lib/types/functions/text/mid/index.d.ts +2 -2
  156. package/lib/types/functions/text/midb/__test__/index.spec.d.ts +16 -0
  157. package/lib/types/functions/text/midb/index.d.ts +8 -0
  158. package/lib/types/functions/text/proper/index.d.ts +1 -1
  159. package/lib/types/functions/text/replace/__test__/index.spec.d.ts +16 -0
  160. package/lib/types/functions/text/replace/index.d.ts +8 -0
  161. package/lib/types/functions/text/replaceb/__test__/index.spec.d.ts +16 -0
  162. package/lib/types/functions/text/replaceb/index.d.ts +8 -0
  163. package/lib/types/functions/text/search/__test__/index.spec.d.ts +16 -0
  164. package/lib/types/functions/text/search/index.d.ts +8 -0
  165. package/lib/types/functions/text/searchb/__test__/index.spec.d.ts +16 -0
  166. package/lib/types/functions/text/searchb/index.d.ts +8 -0
  167. package/lib/types/functions/text/t/index.d.ts +1 -1
  168. package/lib/types/functions/text/textjoin/__test__/index.spec.d.ts +16 -0
  169. package/lib/types/functions/text/textjoin/index.d.ts +10 -0
  170. package/lib/types/functions/text/trim/__test__/index.spec.d.ts +16 -0
  171. package/lib/types/functions/text/trim/index.d.ts +8 -0
  172. package/lib/types/functions/text/upper/__test__/index.spec.d.ts +16 -0
  173. package/lib/types/functions/text/upper/index.d.ts +8 -0
  174. package/lib/types/index.d.ts +13 -2
  175. package/lib/types/models/formula-data.model.d.ts +6 -1
  176. package/lib/types/plugin.d.ts +3 -2
  177. package/lib/types/services/calculate-formula.service.d.ts +25 -14
  178. package/lib/types/services/dependency-manager.service.d.ts +70 -69
  179. package/lib/types/services/other-formula-manager.service.d.ts +4 -4
  180. package/lib/types/services/runtime.service.d.ts +2 -2
  181. package/lib/umd/facade.js +1 -0
  182. package/lib/umd/index.js +2 -2
  183. package/package.json +21 -11
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@univerjs/core"),i=require("@univerjs/engine-formula");var s=Object.defineProperty,m=Object.getOwnPropertyDescriptor,d=(r,t,e,a)=>{for(var o=a>1?void 0:a?m(t,e):t,c=r.length-1,u;c>=0;c--)(u=r[c])&&(o=(a?u(t,e,o):u(o))||o);return a&&o&&s(t,e,o),o},l=(r,t)=>(e,a)=>t(e,a,r);exports.FFormula=class extends n.FBase{constructor(t,e){super(),this._commandService=t,this._injector=e}executeCalculation(){this._commandService.executeCommand(i.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})}stopCalculation(){this._commandService.executeCommand(i.SetFormulaCalculationStopMutation.id,{})}calculationStart(t){return this._commandService.onCommandExecuted(e=>{if(e.id===i.SetFormulaCalculationStartMutation.id){const a=e.params;t(a.forceCalculation)}})}calculationEnd(t){return this._commandService.onCommandExecuted(e=>{if(e.id!==i.SetFormulaCalculationNotificationMutation.id)return;const a=e.params;a.functionsExecutedState!==void 0&&t(a.functionsExecutedState)})}onCalculationEnd(){return new Promise((t,e)=>{const a=setTimeout(()=>{e(new Error("Calculation end timeout"))},3e4),o=this.calculationEnd(()=>{clearTimeout(a),o.dispose(),t()})})}calculationProcessing(t){return this._commandService.onCommandExecuted(e=>{if(e.id!==i.SetFormulaCalculationNotificationMutation.id)return;const a=e.params;a.stageInfo!==void 0&&t(a.stageInfo)})}};exports.FFormula=d([l(0,n.Inject(n.ICommandService)),l(1,n.Inject(n.Injector))],exports.FFormula);class F extends n.FUniver{getFormula(){return this._injector.createInstance(exports.FFormula)}}n.FUniver.extend(F);