@syncfusion/ej2-calculate 35.1.37

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 (173) hide show
  1. package/.eslintrc.json +263 -0
  2. package/README.md +132 -0
  3. package/base.d.ts +4 -0
  4. package/base.js +4 -0
  5. package/common.d.ts +4 -0
  6. package/common.js +4 -0
  7. package/dist/ej2-calculate.umd.min.js +11 -0
  8. package/dist/ej2-calculate.umd.min.js.map +1 -0
  9. package/dist/es6/ej2-calculate.es2015.js +24801 -0
  10. package/dist/es6/ej2-calculate.es2015.js.map +1 -0
  11. package/dist/es6/ej2-calculate.es5.js +27229 -0
  12. package/dist/es6/ej2-calculate.es5.js.map +1 -0
  13. package/dist/global/ej2-calculate.min.js +11 -0
  14. package/dist/global/ej2-calculate.min.js.map +1 -0
  15. package/dist/global/index.d.ts +14 -0
  16. package/formulas.d.ts +4 -0
  17. package/formulas.js +4 -0
  18. package/index.d.ts +4 -0
  19. package/index.js +4 -0
  20. package/license +10 -0
  21. package/package.json +30 -0
  22. package/src/base/calculate-model.d.ts +4 -0
  23. package/src/base/calculate-model.js +0 -0
  24. package/src/base/calculate.d.ts +1105 -0
  25. package/src/base/calculate.js +4720 -0
  26. package/src/base/index.d.ts +8 -0
  27. package/src/base/index.js +7 -0
  28. package/src/base/parser.d.ts +208 -0
  29. package/src/base/parser.js +1512 -0
  30. package/src/common/address.d.ts +59 -0
  31. package/src/common/address.js +96 -0
  32. package/src/common/cell-ref.d.ts +32 -0
  33. package/src/common/cell-ref.js +112 -0
  34. package/src/common/common.d.ts +44 -0
  35. package/src/common/common.js +134 -0
  36. package/src/common/enum.d.ts +94 -0
  37. package/src/common/enum.js +97 -0
  38. package/src/common/index.d.ts +9 -0
  39. package/src/common/index.js +8 -0
  40. package/src/common/interface.d.ts +122 -0
  41. package/src/common/interface.js +0 -0
  42. package/src/common/l10n.d.ts +24 -0
  43. package/src/common/l10n.js +54 -0
  44. package/src/common/number-date.d.ts +26 -0
  45. package/src/common/number-date.js +38 -0
  46. package/src/common/sheet-info.d.ts +10 -0
  47. package/src/common/sheet-info.js +17 -0
  48. package/src/common/sort.d.ts +17 -0
  49. package/src/common/sort.js +44 -0
  50. package/src/formulas/array.d.ts +47 -0
  51. package/src/formulas/array.js +718 -0
  52. package/src/formulas/basic.d.ts +47 -0
  53. package/src/formulas/basic.js +181 -0
  54. package/src/formulas/complex-numbers.d.ts +207 -0
  55. package/src/formulas/complex-numbers.js +549 -0
  56. package/src/formulas/database.d.ts +152 -0
  57. package/src/formulas/database.js +579 -0
  58. package/src/formulas/date-time-extra.d.ts +97 -0
  59. package/src/formulas/date-time-extra.js +415 -0
  60. package/src/formulas/date-time-intl.d.ts +57 -0
  61. package/src/formulas/date-time-intl.js +309 -0
  62. package/src/formulas/date-time.d.ts +164 -0
  63. package/src/formulas/date-time.js +1021 -0
  64. package/src/formulas/engineering-base.d.ts +150 -0
  65. package/src/formulas/engineering-base.js +404 -0
  66. package/src/formulas/engineering-bessel.d.ts +65 -0
  67. package/src/formulas/engineering-bessel.js +167 -0
  68. package/src/formulas/engineering-convert.d.ts +35 -0
  69. package/src/formulas/engineering-convert.js +120 -0
  70. package/src/formulas/engineering-misc.d.ts +64 -0
  71. package/src/formulas/engineering-misc.js +168 -0
  72. package/src/formulas/financial-amortization-ecma.d.ts +87 -0
  73. package/src/formulas/financial-amortization-ecma.js +288 -0
  74. package/src/formulas/financial-annuity.d.ts +104 -0
  75. package/src/formulas/financial-annuity.js +419 -0
  76. package/src/formulas/financial-bond-helpers.d.ts +106 -0
  77. package/src/formulas/financial-bond-helpers.js +190 -0
  78. package/src/formulas/financial-cashflow.d.ts +47 -0
  79. package/src/formulas/financial-cashflow.js +203 -0
  80. package/src/formulas/financial-coupons.d.ts +227 -0
  81. package/src/formulas/financial-coupons.js +810 -0
  82. package/src/formulas/financial-depreciation.d.ts +64 -0
  83. package/src/formulas/financial-depreciation.js +247 -0
  84. package/src/formulas/financial-rates.d.ts +54 -0
  85. package/src/formulas/financial-rates.js +140 -0
  86. package/src/formulas/financial-securities.d.ts +126 -0
  87. package/src/formulas/financial-securities.js +488 -0
  88. package/src/formulas/formula-math-helpers.d.ts +212 -0
  89. package/src/formulas/formula-math-helpers.js +599 -0
  90. package/src/formulas/formula-module-base.d.ts +54 -0
  91. package/src/formulas/formula-module-base.js +125 -0
  92. package/src/formulas/formula-owner.d.ts +17 -0
  93. package/src/formulas/formula-owner.js +0 -0
  94. package/src/formulas/index.d.ts +68 -0
  95. package/src/formulas/index.js +67 -0
  96. package/src/formulas/information-advanced.d.ts +44 -0
  97. package/src/formulas/information-advanced.js +157 -0
  98. package/src/formulas/information-ecma.d.ts +33 -0
  99. package/src/formulas/information-ecma.js +88 -0
  100. package/src/formulas/information-extra.d.ts +146 -0
  101. package/src/formulas/information-extra.js +351 -0
  102. package/src/formulas/information.d.ts +34 -0
  103. package/src/formulas/information.js +78 -0
  104. package/src/formulas/logical-extra.d.ts +75 -0
  105. package/src/formulas/logical-extra.js +217 -0
  106. package/src/formulas/logical.d.ts +83 -0
  107. package/src/formulas/logical.js +296 -0
  108. package/src/formulas/lookup-array.d.ts +98 -0
  109. package/src/formulas/lookup-array.js +364 -0
  110. package/src/formulas/lookup-ref-extra.d.ts +64 -0
  111. package/src/formulas/lookup-ref-extra.js +180 -0
  112. package/src/formulas/lookup-ref.d.ts +84 -0
  113. package/src/formulas/lookup-ref.js +263 -0
  114. package/src/formulas/lookup.d.ts +114 -0
  115. package/src/formulas/lookup.js +881 -0
  116. package/src/formulas/math-aggregate.d.ts +74 -0
  117. package/src/formulas/math-aggregate.js +376 -0
  118. package/src/formulas/math-ceiling-ecma.d.ts +42 -0
  119. package/src/formulas/math-ceiling-ecma.js +123 -0
  120. package/src/formulas/math-combinatorics.d.ts +75 -0
  121. package/src/formulas/math-combinatorics.js +290 -0
  122. package/src/formulas/math-misc.d.ts +164 -0
  123. package/src/formulas/math-misc.js +889 -0
  124. package/src/formulas/math-number.d.ts +76 -0
  125. package/src/formulas/math-number.js +261 -0
  126. package/src/formulas/math-rounding.d.ts +115 -0
  127. package/src/formulas/math-rounding.js +728 -0
  128. package/src/formulas/math-trig-hyperbolic.d.ts +55 -0
  129. package/src/formulas/math-trig-hyperbolic.js +113 -0
  130. package/src/formulas/math-trig.d.ts +165 -0
  131. package/src/formulas/math-trig.js +334 -0
  132. package/src/formulas/matrix-base.d.ts +13 -0
  133. package/src/formulas/matrix-base.js +169 -0
  134. package/src/formulas/matrix.d.ts +64 -0
  135. package/src/formulas/matrix.js +161 -0
  136. package/src/formulas/regression-ecma.d.ts +66 -0
  137. package/src/formulas/regression-ecma.js +234 -0
  138. package/src/formulas/statistical-advanced.d.ts +125 -0
  139. package/src/formulas/statistical-advanced.js +756 -0
  140. package/src/formulas/statistical-correlation.d.ts +75 -0
  141. package/src/formulas/statistical-correlation.js +198 -0
  142. package/src/formulas/statistical-dispersion.d.ts +108 -0
  143. package/src/formulas/statistical-dispersion.js +337 -0
  144. package/src/formulas/statistical-distribution-extended.d.ts +176 -0
  145. package/src/formulas/statistical-distribution-extended.js +668 -0
  146. package/src/formulas/statistical-distribution.d.ts +104 -0
  147. package/src/formulas/statistical-distribution.js +368 -0
  148. package/src/formulas/statistical-ecma.d.ts +95 -0
  149. package/src/formulas/statistical-ecma.js +392 -0
  150. package/src/formulas/statistical-extended.d.ts +136 -0
  151. package/src/formulas/statistical-extended.js +340 -0
  152. package/src/formulas/statistical-ifs.d.ts +46 -0
  153. package/src/formulas/statistical-ifs.js +180 -0
  154. package/src/formulas/statistical-moments.d.ts +84 -0
  155. package/src/formulas/statistical-moments.js +269 -0
  156. package/src/formulas/statistical-percentile.d.ts +56 -0
  157. package/src/formulas/statistical-percentile.js +195 -0
  158. package/src/formulas/statistical-sample-base.d.ts +14 -0
  159. package/src/formulas/statistical-sample-base.js +124 -0
  160. package/src/formulas/statistical.d.ts +135 -0
  161. package/src/formulas/statistical.js +542 -0
  162. package/src/formulas/text-advanced.d.ts +64 -0
  163. package/src/formulas/text-advanced.js +222 -0
  164. package/src/formulas/text-ecma.d.ts +54 -0
  165. package/src/formulas/text-ecma.js +106 -0
  166. package/src/formulas/text-extra.d.ts +216 -0
  167. package/src/formulas/text-extra.js +657 -0
  168. package/src/formulas/text.d.ts +125 -0
  169. package/src/formulas/text.js +628 -0
  170. package/src/global.js +1 -0
  171. package/src/index.d.ts +14 -0
  172. package/src/index.js +14 -0
  173. package/tslint.json +111 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,263 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true
5
+ },
6
+ "extends": [
7
+ "eslint:recommended",
8
+ "plugin:@typescript-eslint/recommended",
9
+ "plugin:jsdoc/recommended",
10
+ "plugin:security/recommended"
11
+ ],
12
+ "parser": "@typescript-eslint/parser",
13
+ "parserOptions": {
14
+ "ecmaFeatures": { "js": true },
15
+ "ecmaVersion": 2018,
16
+ "project": "./tsconfig.json",
17
+ "sourceType": "module"
18
+ },
19
+ "ignorePatterns": ["*.d.ts", "*.js"],
20
+ "plugins": [
21
+ "@typescript-eslint",
22
+ "@typescript-eslint/tslint",
23
+ "eslint-plugin-security",
24
+ "jsdoc"
25
+ ],
26
+ "rules": {
27
+ "use-isnan": "error",
28
+ "security/detect-unsafe-regex":"error",
29
+ "security/detect-buffer-noassert":"error",
30
+ "security/detect-child-process":"error",
31
+ "security/detect-disable-mustache-escape":"error",
32
+ "security/detect-eval-with-expression":"error",
33
+ "security/detect-no-csrf-before-method-override":"error",
34
+ "security/detect-non-literal-fs-filename":"error",
35
+ "security/detect-non-literal-regexp":"error",
36
+ "security/detect-non-literal-require":"error",
37
+ "security/detect-object-injection":"error",
38
+ "security/detect-possible-timing-attacks":"error",
39
+ "security/detect-pseudoRandomBytes":"error",
40
+ "security/detect-new-buffer":"error",
41
+ "security/detect-bidi-characters":"error",
42
+ "no-prototype-builtins": "warn",
43
+ "no-extend-native": ["warn"],
44
+ "@typescript-eslint/no-inferrable-types": "off",
45
+ "@typescript-eslint/ban-types": ["warn", {
46
+ "types": {
47
+ "Object": false,
48
+ "object": false,
49
+ "{}": false,
50
+ "Function": false
51
+ }
52
+ }],
53
+ "jsdoc/check-tag-names": 0,
54
+ "@typescript-eslint/tslint/config": [
55
+ "error",
56
+ {
57
+ "rules": {
58
+ "ban": true,
59
+ "chai-vague-errors": true,
60
+ "max-func-body-length": [
61
+ true,
62
+ 120,
63
+ {
64
+ "ignore-parameters-to-function-regex": "describe"
65
+ }
66
+ ],
67
+ "missing-jsdoc": true,
68
+ "no-backbone-get-set-outside-model": false,
69
+ "no-cookies": false,
70
+ "no-delete-expression": false,
71
+ "no-disable-auto-sanitization": true,
72
+ "no-duplicate-case": true,
73
+ "no-duplicate-parameter-names": true,
74
+ "no-empty-interfaces": false,
75
+ "no-exec-script": true,
76
+ "no-function-expression": false,
77
+ "no-multiple-var-decl": false,
78
+ "no-string-based-set-immediate": false,
79
+ "no-string-based-set-interval": false,
80
+ "no-unnecessary-bind": false,
81
+ "no-unused-imports": true,
82
+ "no-with-statement": false,
83
+ "prefer-array-literal": false,
84
+ "typedef": [
85
+ true,
86
+ "call-signature",
87
+ "parameter",
88
+ "property-declaration",
89
+ "variable-declaration",
90
+ "arrow-parameter",
91
+ "member-variable-declaration"
92
+ ],
93
+ "use-named-parameter": false,
94
+ "valid-typeof": true,
95
+ "whitespace": [
96
+ true,
97
+ "check-branch",
98
+ "check-decl",
99
+ "check-operator",
100
+ "check-separator",
101
+ "check-type"
102
+ ]
103
+ }
104
+ }
105
+ ],
106
+ "no-control-regex": "error",
107
+ "no-constant-condition": "error",
108
+ "no-invalid-regexp": "error",
109
+ "curly": "error",
110
+ "eol-last": [
111
+ "error",
112
+ "always"
113
+ ],
114
+ "guard-for-in": "error",
115
+ "no-labels": "error",
116
+ "max-len": [
117
+ "error",
118
+ {
119
+ "code": 140,
120
+ "tabWidth": 4,
121
+ "ignoreComments": true,
122
+ "ignoreStrings": true,
123
+ "ignoreTemplateLiterals": true,
124
+ "ignoreRegExpLiterals": true
125
+ }
126
+ ],
127
+ "no-console": [
128
+ "error",
129
+ {
130
+ "allow": [
131
+ "warn",
132
+ "dir",
133
+ "timeLog",
134
+ "assert",
135
+ "clear",
136
+ "count",
137
+ "countReset",
138
+ "group",
139
+ "groupEnd",
140
+ "table",
141
+ "dirxml",
142
+ "error",
143
+ "groupCollapsed",
144
+ "Console",
145
+ "profile",
146
+ "profileEnd",
147
+ "timeStamp",
148
+ "context"
149
+ ]
150
+ }
151
+ ],
152
+ "no-redeclare": [
153
+ "error",
154
+ {
155
+ "builtinGlobals": true
156
+ }
157
+ ],
158
+ "@typescript-eslint/no-parameter-properties": "error",
159
+ "@typescript-eslint/indent": [
160
+ "error",
161
+ 4,
162
+ {
163
+ "CallExpression": {
164
+ "arguments": "first"
165
+ },
166
+ "FunctionDeclaration": {
167
+ "parameters": "first"
168
+ },
169
+ "FunctionExpression": {
170
+ "parameters": "first"
171
+ }
172
+ }
173
+ ],
174
+ "no-debugger": "error",
175
+ "no-eval": "error",
176
+ "no-extra-semi": "error",
177
+ "no-throw-literal": "error",
178
+ "no-fallthrough": "error",
179
+ "comma-dangle": [
180
+ "error",
181
+ "never"
182
+ ],
183
+ "no-trailing-spaces": "error",
184
+ "@typescript-eslint/no-unused-expressions": "error",
185
+ "@typescript-eslint/no-var-requires": "error",
186
+ "one-var": [
187
+ "error",
188
+ "never"
189
+ ],
190
+ "@typescript-eslint/no-explicit-any": "warn",
191
+ "no-cond-assign": [
192
+ "error",
193
+ "always"
194
+ ],
195
+ "@typescript-eslint/consistent-type-assertions": "off",
196
+ "jsdoc/check-alignment": "error",
197
+ "no-empty": "error",
198
+ "quotes": [
199
+ "error",
200
+ "single"
201
+ ],
202
+ "semi": [
203
+ "error",
204
+ "always"
205
+ ],
206
+ "eqeqeq": [
207
+ "error",
208
+ "smart"
209
+ ],
210
+ "valid-typeof": [
211
+ "error",
212
+ {
213
+ "requireStringLiterals": true
214
+ }
215
+ ],
216
+ "camelcase": [
217
+ "error",
218
+ {
219
+ "properties": "always",
220
+ "ignoreDestructuring": true,
221
+ "ignoreImports": true
222
+ }
223
+ ],
224
+ "no-irregular-whitespace": [
225
+ "error",
226
+ {
227
+ "skipStrings": true,
228
+ "skipComments": true,
229
+ "skipRegExps": true,
230
+ "skipTemplates": true
231
+ }
232
+ ],
233
+ "valid-jsdoc": [
234
+ "error",
235
+ {
236
+ "prefer": {
237
+ "arg": "param",
238
+ "argument": "param",
239
+ "class": "constructor",
240
+ "return": "returns",
241
+ "virtual": "abstract"
242
+ }
243
+ }
244
+ ],
245
+ "no-var": "error",
246
+ "radix": "error"
247
+ },
248
+ "reportUnusedDisableDirectives": true,
249
+ "overrides": [
250
+ {
251
+ "files": [
252
+ "node_modules",
253
+ "dist",
254
+ "public",
255
+ "coverage",
256
+ "test-report"
257
+ ],
258
+ "rules": {
259
+ "no-unused-expressions": "off"
260
+ }
261
+ }
262
+ ]
263
+ }
package/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # JavaScript Calculate Library
2
+
3
+ > **Using this package with an AI coding agent**
4
+ >
5
+ > Before generating Syncfusion code, ask your AI coding agent to run the Syncfusion setup using the following prompt:
6
+ >
7
+ > ```text
8
+ > Set up this project for Syncfusion before generating code. Fetch
9
+ > and follow the official instructions at https://ai.syncfusion.com,
10
+ > then report the detected platform, installed skill pack, MCP
11
+ > status, and any required licensing action.
12
+ > ```
13
+ > The setup detects your project’s platform and loads the appropriate Syncfusion skill pack. No Syncfusion account or MCP key is required to install or read Syncfusion agent skills.
14
+ >
15
+ > **Platform reference:** [https://ai.syncfusion.com/javascript/llms.txt](https://ai.syncfusion.com/javascript/llms.txt)
16
+
17
+ The **JavaScript Calculate** library is an Excel-compatible formula calculation engine that parses and evaluates Excel-like / ECMA-376 formulas in any JavaScript or TypeScript application. It powers the built-in formula support of the [JavaScript Spreadsheet](https://www.syncfusion.com/javascript-ui-controls/js-spreadsheet?utm_source=npm&utm_medium=listing&utm_campaign=javascript-calculate-npm) and can also be used standalone against a simple key/value store or hosted against any workbook / grid model through `ICalculateHost`.
18
+
19
+ ## Setup
20
+
21
+ To install the Calculate library, use the following command.
22
+
23
+ ```sh
24
+ npm install @syncfusion/ej2-calculate
25
+ ```
26
+
27
+ `@syncfusion/ej2-base` is the single runtime dependency and is installed automatically. If you consume the engine through the Spreadsheet, install `@syncfusion/ej2-spreadsheet` instead — the Calculate library ships built in and requires no separate wiring.
28
+
29
+ ## Supported frameworks
30
+
31
+ The Calculate library is headless (UI-independent), so it runs wherever JavaScript or TypeScript runs. It is consumed by the Spreadsheet control across the following framework wrappers.
32
+
33
+ | [<img src="https://ej2.syncfusion.com/github/images/angular-new.svg" height="50" />](https://www.syncfusion.com/angular-ui-components?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Angular](https://www.syncfusion.com/angular-ui-components?utm_medium=listing&utm_source=github)&nbsp;&nbsp;&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/react.svg" height="50" />](https://www.syncfusion.com/react-components?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[React](https://www.syncfusion.com/react-components?utm_medium=listing&utm_source=github)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/vue.svg" height="50" />](https://www.syncfusion.com/vue-components?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Vue](https://www.syncfusion.com/vue-components?utm_medium=listing&utm_source=github)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/netcore.svg" height="50" />](https://www.syncfusion.com/aspnet-core-ui-controls?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;[ASP.NET&nbsp;Core](https://www.syncfusion.com/aspnet-core-ui-controls?utm_medium=listing&utm_source=github)&nbsp;&nbsp; | [<img src="https://ej2.syncfusion.com/github/images/netmvc.svg" height="50" />](https://www.syncfusion.com/aspnet-mvc-ui-controls?utm_medium=listing&utm_source=github)<br/>&nbsp;&nbsp;[ASP.NET&nbsp;MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls?utm_medium=listing&utm_source=github)&nbsp;&nbsp; |
34
+ | :-----: | :-----: | :-----: | :-----: | :-----: |
35
+
36
+ ## Key features
37
+
38
+ * **Built-in formula library** ~367 pre-defined Excel-compatible / ECMA-376 functions across math, trigonometry, statistical, financial, logical, text, date-time, lookup and reference, engineering, database, information, matrix, complex-number, and array categories.
39
+ * **Custom functions** : Register user-defined functions with `defineFunction` and evaluate them alongside the built-in catalog.
40
+ * **Named ranges**: Assign meaningful names to cells or ranges and refer them in formulas.
41
+ * **Dependency tracking and recalculation**: Automatic and Manual calculation modes driven by a cell dependency graph, including volatile functions such as `RAND` and `NOW`.
42
+ * **Culture-aware argument separators**: Evaluate culture-based formulas with locale-specific argument separators and formatted numeric arguments.
43
+ * **Multi-sheet references**: Refer cells and ranges across sheets of the same workbook.
44
+ * **Standard Excel error tokens**: `#DIV/0!`, `#VALUE!`, `#REF!`, `#NAME?`, `#N/A`, `#NULL!`, `#NUM!`, and more.
45
+ * Headless key/value mode: Evaluate formulas against a simple key/value store with no workbook or UI.
46
+ * **Host adapter (`ICalculateHost`)**: Integrate with any workbook / grid / xlsx model — Spreadsheet's `Workbook` implements it out of the box.
47
+
48
+ ## Getting started
49
+
50
+ The engine works with the Spreadsheet out of the box — a `Calculate` instance is created and wired internally. The following snippets cover the standalone and hosted modes.
51
+
52
+ ### Standalone (key / value) — quickest way to try the engine
53
+
54
+ ```ts
55
+ import { Calculate } from '@syncfusion/ej2-calculate';
56
+
57
+ const calculate = new Calculate();
58
+ calculate.setKeyValue('A1', '10');
59
+ calculate.setKeyValue('B1', '20');
60
+ calculate.setKeyValue('C1', '=A1+B1');
61
+
62
+ console.log(calculate.getKeyValue('C1')); // 30
63
+ console.log(calculate.computeExpression('=SUM(1,2,3)')); // 6
64
+
65
+ calculate..destroy(); // clear maps / listeners when finished
66
+ ```
67
+
68
+ ### Custom functions
69
+
70
+ ```ts
71
+ calculate.defineFunction('DOUBLE', (x: string | number) => Number(x) * 2, 'Doubles a number', 'Custom');
72
+ console.log(calculate.computeFormula('=DOUBLE(21)')); // 42
73
+ ```
74
+
75
+ ### Hosted mode (Spreadsheet / workbook / custom grid)
76
+
77
+ Implement `ICalculateHost` and pass the host into the constructor.
78
+
79
+ ```ts
80
+ import { Calculate, ICalculateHost } from '@syncfusion/ej2-calculate';
81
+
82
+ const host: ICalculateHost = {
83
+ getValueRowCol(sheetFamilyID, row, col) {
84
+ /* read cell value for 1-based row/col */
85
+ return '';
86
+ },
87
+ setValueRowCol(sheetFamilyID, value, row, col) {
88
+ /* write calculated value back to the model */
89
+ },
90
+ getSheetInfo() {
91
+ return []; /* { visibleName, sheet }[] */
92
+ },
93
+ parseDate(value) {
94
+ return {}; /* culture-aware date parse result */
95
+ }
96
+ };
97
+
98
+ const calculate = new Calculate(host);
99
+ const familyId = calculate.createSheetFamilyID();
100
+ calculate.registerGridAsSheet('Sheet1', host, familyId);
101
+ ```
102
+
103
+ ## Resources
104
+
105
+ * [What's New](https://www.syncfusion.com/products/whatsnew/essential-js2?utm_medium=listing&utm_source=github)
106
+ * [Road Map](https://www.syncfusion.com/products/roadmap/essential-js2?utm_medium=listing&utm_source=github)
107
+ * [E-Books](https://www.syncfusion.com/ebooks?tag=javascript&utm_medium=listing&utm_source=github)
108
+ * [Source code (GitHub)](https://github.com/syncfusion/ej2-javascript-ui-controls?utm_source=npm&utm_medium=listing&utm_campaign=javascript-calculate-npm)
109
+
110
+ ## Support
111
+
112
+ Product support is available through the following mediums.
113
+
114
+ * [Support ticket](https://support.syncfusion.com/support/tickets/create) - Guaranteed Response in 24 hours | Unlimited tickets | Holiday support
115
+ * [Community forum](https://www.syncfusion.com/forums/essential-js2?utm_source=npm&utm_medium=listing&utm_campaign=javascript-calculate-npm)
116
+ * [GitHub issues](https://github.com/syncfusion/ej2-javascript-ui-controls/issues/new)
117
+ * [Request feature or report bug](https://www.syncfusion.com/feedback/javascript?utm_source=npm&utm_medium=listing&utm_campaign=javascript-calculate-npm)
118
+ * Live chat
119
+
120
+ ## Changelog
121
+
122
+ Check the changelog [here](https://help.syncfusion.com/document-processing/release-notes). Get minor improvements and bug fixes every week to stay up to date with frequent updates.
123
+
124
+ ## License and copyright
125
+
126
+ > This is a commercial product and requires a paid license for possession or use. Syncfusion<sup>®</sup> licensed software, including this library, is subject to the terms and conditions of Syncfusion<sup>®</sup> [EULA](https://www.syncfusion.com/eula/es/). To acquire a license for 140+ [JavaScript UI controls](https://www.syncfusion.com/javascript-ui-controls), you can [purchase](https://www.syncfusion.com/sales/products) or [start a free 30-day trial](https://www.syncfusion.com/account/manage-trials/start-trials).
127
+
128
+ > A [free community license](https://www.syncfusion.com/products/communitylicense) is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue and five or fewer developers.
129
+
130
+ See [LICENSE FILE](https://github.com/syncfusion/ej2-javascript-ui-controls/blob/master/license?utm_source=npm&utm_medium=listing&utm_campaign=javascript-calculate-npm) for more info.
131
+
132
+ © Copyright 2026 Syncfusion<sup>®</sup> Inc. All Rights Reserved. The Syncfusion<sup>®</sup> Essential Studio<sup>®</sup> license and copyright applies to this distribution.
package/base.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * base
3
+ */
4
+ export * from './src/base/index';
package/base.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * base
3
+ */
4
+ export * from './src/base/index';
package/common.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * common
3
+ */
4
+ export * from './src/common/index';
package/common.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * common
3
+ */
4
+ export * from './src/common/index';