@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/engine-formula",
3
- "version": "0.4.2",
3
+ "version": "0.5.0-alpha.0",
4
4
  "private": false,
5
5
  "description": "UniverSheet normal base-formula-engine",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -31,10 +31,14 @@
31
31
  "require": "./lib/cjs/*",
32
32
  "types": "./lib/types/index.d.ts"
33
33
  },
34
+ "./facade": {
35
+ "import": "./lib/es/facade.js",
36
+ "require": "./lib/cjs/facade.js",
37
+ "types": "./lib/types/facade/index.d.ts"
38
+ },
34
39
  "./lib/*": "./lib/*"
35
40
  },
36
- "main": "./lib/cjs/index.js",
37
- "module": "./lib/es/index.js",
41
+ "main": "./lib/es/index.js",
38
42
  "types": "./lib/types/index.d.ts",
39
43
  "publishConfig": {
40
44
  "access": "public"
@@ -52,17 +56,17 @@
52
56
  "@flatten-js/interval-tree": "^1.1.3",
53
57
  "decimal.js": "^10.4.3",
54
58
  "numfmt": "^2.5.2",
55
- "@univerjs/core": "0.4.2",
56
- "@univerjs/rpc": "0.4.2"
59
+ "@univerjs/core": "0.5.0-alpha.0",
60
+ "@univerjs/rpc": "0.5.0-alpha.0"
57
61
  },
58
62
  "devDependencies": {
59
63
  "rxjs": "^7.8.1",
60
64
  "typescript": "^5.6.3",
61
- "vite": "^5.4.8",
62
- "vitest": "^2.1.2",
63
- "@univerjs-infra/shared": "0.4.2"
65
+ "vite": "^5.4.10",
66
+ "vitest": "^2.1.4",
67
+ "@univerjs-infra/shared": "0.5.0-alpha.0"
64
68
  },
65
- "univerSpace": {
69
+ "space": {
66
70
  ".": {
67
71
  "import": "./lib/es/index.js",
68
72
  "require": "./lib/cjs/index.js",
@@ -73,6 +77,11 @@
73
77
  "require": "./lib/cjs/*",
74
78
  "types": "./lib/types/index.d.ts"
75
79
  },
80
+ "./facade": {
81
+ "import": "./lib/es/facade.js",
82
+ "require": "./lib/cjs/facade.js",
83
+ "types": "./lib/types/facade/index.d.ts"
84
+ },
76
85
  "./lib/*": "./lib/*"
77
86
  },
78
87
  "scripts": {
@@ -80,6 +89,7 @@
80
89
  "test:watch": "vitest",
81
90
  "coverage": "vitest run --coverage",
82
91
  "lint:types": "tsc --noEmit",
83
- "build": "tsc && vite build"
84
- }
92
+ "build": "tsx build.ts"
93
+ },
94
+ "module": "./lib/es/index.js"
85
95
  }