@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
@@ -0,0 +1,309 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ import { FormulasErrorsStrings, CommonErrors } from '../common/index';
15
+ import { isNullOrUndefined } from '@syncfusion/ej2-base';
16
+ import { FormulaModuleBase } from './formula-module-base';
17
+ /**
18
+ * Locale-aware and ECMA date functions including DATEDIF and custom-weekend WORKDAY/NETWORKDAYS variants.
19
+ *
20
+ * Registered functions: DATEDIF, NETWORKDAYS.INTL, WORKDAY.INTL.
21
+ *
22
+ * @hidden
23
+ */
24
+ var DateTimeIntlFormulas = /** @class */ (function (_super) {
25
+ __extends(DateTimeIntlFormulas, _super);
26
+ /**
27
+ * @hidden
28
+ * @param {FormulaOwner} owner - Formula registration owner ({@link BasicFormulas}).
29
+ */
30
+ function DateTimeIntlFormulas(owner) {
31
+ var _this = _super.call(this, owner) || this;
32
+ /** Formula definitions registered with {@link BasicFormulas}. */
33
+ _this.formulas = [
34
+ { formulaName: 'DATEDIF', category: 'Date & Time', description: 'Calculates the number of days, months, or years between two dates.' },
35
+ { formulaName: 'NETWORKDAYS.INTL', category: 'Date & Time', description: 'Returns workdays between dates for a custom weekend.' },
36
+ { formulaName: 'WORKDAY.INTL', category: 'Date & Time', description: 'Returns the date before or after a number of workdays with a custom weekend.' }
37
+ ];
38
+ return _this;
39
+ }
40
+ DateTimeIntlFormulas.prototype.toSerial = function (arg) {
41
+ var errCollection = this.parent.getErrorStrings();
42
+ var value = this.parent.getValueFromArg(arg);
43
+ if (errCollection.indexOf(value) > -1) {
44
+ return value;
45
+ }
46
+ if (!this.parent.isCellReference(arg)) {
47
+ value = this.parent.removeTics(value);
48
+ }
49
+ if (value === '') {
50
+ return errCollection[CommonErrors.Value];
51
+ }
52
+ if (this.parent.isNumber(value)) {
53
+ return Math.floor(this.parent.parseFloat(value));
54
+ }
55
+ var parsed = this.parent.isDate(new Date(value));
56
+ if (parsed) {
57
+ return Math.floor(this.parent.toOADate(parsed));
58
+ }
59
+ return errCollection[CommonErrors.Value];
60
+ };
61
+ DateTimeIntlFormulas.prototype.holidaySet = function (arg) {
62
+ var set = new Set();
63
+ if (!arg || arg === '') {
64
+ return set;
65
+ }
66
+ var errCollection = this.parent.getErrorStrings();
67
+ if (this.parent.isCellReference(arg) && arg.indexOf(':') > -1) {
68
+ var cells = this.parent.getCellCollection(arg);
69
+ var list = Array.isArray(cells) ? cells : [cells];
70
+ for (var i = 0; i < list.length; i++) {
71
+ var serial = this.toSerial(list[i]);
72
+ if (typeof serial === 'string') {
73
+ if (errCollection.indexOf(serial) > -1) {
74
+ return serial;
75
+ }
76
+ continue;
77
+ }
78
+ set.add(serial);
79
+ }
80
+ }
81
+ else {
82
+ var serial = this.toSerial(arg);
83
+ if (typeof serial === 'string') {
84
+ return serial;
85
+ }
86
+ set.add(serial);
87
+ }
88
+ return set;
89
+ };
90
+ DateTimeIntlFormulas.prototype.weekendMask = function (weekendArg) {
91
+ var defaultMask = [false, false, false, false, false, true, true];
92
+ if (!weekendArg || weekendArg === '') {
93
+ return defaultMask;
94
+ }
95
+ var errCollection = this.parent.getErrorStrings();
96
+ var text = this.resolveTextArg(weekendArg);
97
+ if (errCollection.indexOf(text) > -1) {
98
+ return text;
99
+ }
100
+ if (text.length === 7 && /^[01]+$/.test(text)) {
101
+ var mask = [];
102
+ for (var i = 0; i < 7; i++) {
103
+ mask.push(text.charAt(i) === '1');
104
+ }
105
+ return mask;
106
+ }
107
+ var num = this.resolveNumberArg(weekendArg);
108
+ if (typeof num === 'string') {
109
+ return num;
110
+ }
111
+ var n = Math.floor(num);
112
+ var masks = {
113
+ 1: [false, false, false, false, false, true, true],
114
+ 2: [true, false, false, false, false, false, true],
115
+ 3: [true, true, false, false, false, false, false],
116
+ 4: [false, true, true, false, false, false, false],
117
+ 5: [false, false, true, true, false, false, false],
118
+ 6: [false, false, false, true, true, false, false],
119
+ 7: [false, false, false, false, true, true, false],
120
+ 11: [true, false, false, false, false, false, false],
121
+ 12: [false, true, false, false, false, false, false],
122
+ 13: [false, false, true, false, false, false, false],
123
+ 14: [false, false, false, true, false, false, false],
124
+ 15: [false, false, false, false, true, false, false],
125
+ 16: [false, false, false, false, false, true, false],
126
+ 17: [false, false, false, false, false, false, true]
127
+ };
128
+ // eslint-disable-next-line security/detect-object-injection
129
+ return masks[n] || errCollection[CommonErrors.Num];
130
+ };
131
+ DateTimeIntlFormulas.prototype.isWeekendMask = function (date, mask) {
132
+ var dow = (date.getDay() + 6) % 7;
133
+ return mask[dow];
134
+ };
135
+ /**
136
+ * Calculates the number of days, months, or years between two dates.
137
+ *
138
+ * Excel: `DATEDIF(...)`.
139
+ *
140
+ * @hidden
141
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
142
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * engine.computeFormula('=DATEDIF(DATE(2020,1,1),DATE(2024,1,1),"Y")');
147
+ * ```
148
+ */
149
+ DateTimeIntlFormulas.prototype.ComputeDATEDIF = function () {
150
+ var args = [];
151
+ for (var _i = 0; _i < arguments.length; _i++) {
152
+ args[_i] = arguments[_i];
153
+ }
154
+ var errCollection = this.parent.getErrorStrings();
155
+ if (isNullOrUndefined(args) || args.length !== 3) {
156
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
157
+ }
158
+ var start = this.toSerial(args[0]);
159
+ var end = this.toSerial(args[1]);
160
+ if (typeof start === 'string') {
161
+ return start;
162
+ }
163
+ if (typeof end === 'string') {
164
+ return end;
165
+ }
166
+ var unit = this.resolveTextArg(args[2]).toUpperCase();
167
+ if (start > end) {
168
+ return errCollection[CommonErrors.Num];
169
+ }
170
+ var d1 = this.parent.fromOADate(start);
171
+ var d2 = this.parent.fromOADate(end);
172
+ switch (unit) {
173
+ case 'Y':
174
+ return (d2.getFullYear() - d1.getFullYear() -
175
+ (d2.getMonth() < d1.getMonth() || (d2.getMonth() === d1.getMonth() && d2.getDate() < d1.getDate()) ? 1 : 0)).toString();
176
+ case 'M': {
177
+ var months = (d2.getFullYear() - d1.getFullYear()) * 12 + (d2.getMonth() - d1.getMonth());
178
+ if (d2.getDate() < d1.getDate()) {
179
+ months--;
180
+ }
181
+ return months.toString();
182
+ }
183
+ case 'D':
184
+ return (end - start).toString();
185
+ case 'MD': {
186
+ var md = d2.getDate() - d1.getDate();
187
+ if (md < 0) {
188
+ md += new Date(d2.getFullYear(), d2.getMonth(), 0).getDate();
189
+ }
190
+ return md.toString();
191
+ }
192
+ case 'YM': {
193
+ var ym = d2.getMonth() - d1.getMonth();
194
+ if (d2.getDate() < d1.getDate()) {
195
+ ym--;
196
+ }
197
+ if (ym < 0) {
198
+ ym += 12;
199
+ }
200
+ return ym.toString();
201
+ }
202
+ case 'YD': {
203
+ var anchor = new Date(d2.getFullYear(), d1.getMonth(), d1.getDate());
204
+ var yd = Math.round((d2.getTime() - anchor.getTime()) / 86400000);
205
+ if (yd < 0) {
206
+ yd += this.isLeapYear(d2.getFullYear()) ? 366 : 365;
207
+ }
208
+ return yd.toString();
209
+ }
210
+ default:
211
+ return errCollection[CommonErrors.Num];
212
+ }
213
+ };
214
+ DateTimeIntlFormulas.prototype.isLeapYear = function (year) {
215
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
216
+ };
217
+ /**
218
+ * Returns workdays between dates for a custom weekend.
219
+ *
220
+ * Excel: `NETWORKDAYS.INTL(...)`.
221
+ *
222
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
223
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
224
+ */
225
+ DateTimeIntlFormulas.prototype['ComputeNETWORKDAYS.INTL'] = function () {
226
+ var args = [];
227
+ for (var _i = 0; _i < arguments.length; _i++) {
228
+ args[_i] = arguments[_i];
229
+ }
230
+ if (isNullOrUndefined(args) || args.length < 2 || args.length > 4) {
231
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
232
+ }
233
+ var start = this.toSerial(args[0]);
234
+ var end = this.toSerial(args[1]);
235
+ if (typeof start === 'string') {
236
+ return start;
237
+ }
238
+ if (typeof end === 'string') {
239
+ return end;
240
+ }
241
+ var mask = this.weekendMask(args[2]);
242
+ if (!(mask instanceof Array)) {
243
+ return mask;
244
+ }
245
+ var holidays = this.holidaySet(args[3]);
246
+ if (!(holidays instanceof Set)) {
247
+ return holidays;
248
+ }
249
+ var step = start <= end ? 1 : -1;
250
+ var count = 0;
251
+ for (var s = start; step > 0 ? s <= end : s >= end; s += step) {
252
+ var d = this.parent.fromOADate(s);
253
+ if (!this.isWeekendMask(d, mask) && !holidays.has(s)) {
254
+ count += step;
255
+ }
256
+ }
257
+ return count.toString();
258
+ };
259
+ /**
260
+ * Returns the date before or after a number of workdays with a custom weekend.
261
+ *
262
+ * Excel: `WORKDAY.INTL(...)`.
263
+ *
264
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
265
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
266
+ */
267
+ DateTimeIntlFormulas.prototype['ComputeWORKDAY.INTL'] = function () {
268
+ var args = [];
269
+ for (var _i = 0; _i < arguments.length; _i++) {
270
+ args[_i] = arguments[_i];
271
+ }
272
+ var errCollection = this.parent.getErrorStrings();
273
+ if (isNullOrUndefined(args) || args.length < 2 || args.length > 4) {
274
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
275
+ }
276
+ var start = this.toSerial(args[0]);
277
+ var daysArg = this.resolveNumberArg(args[1]);
278
+ if (typeof start === 'string') {
279
+ return start;
280
+ }
281
+ if (typeof daysArg === 'string') {
282
+ return daysArg;
283
+ }
284
+ var mask = this.weekendMask(args[2]);
285
+ if (!(mask instanceof Array)) {
286
+ return mask;
287
+ }
288
+ var holidays = this.holidaySet(args[3]);
289
+ if (!(holidays instanceof Set)) {
290
+ return holidays;
291
+ }
292
+ var current = start;
293
+ var step = daysArg >= 0 ? 1 : -1;
294
+ var remaining = Math.abs(Math.trunc(daysArg));
295
+ while (remaining > 0) {
296
+ current += step;
297
+ var d = this.parent.fromOADate(current);
298
+ if (!this.isWeekendMask(d, mask) && !holidays.has(current)) {
299
+ remaining--;
300
+ }
301
+ if (current < 0) {
302
+ return errCollection[CommonErrors.Num];
303
+ }
304
+ }
305
+ return current.toString();
306
+ };
307
+ return DateTimeIntlFormulas;
308
+ }(FormulaModuleBase));
309
+ export { DateTimeIntlFormulas };
@@ -0,0 +1,164 @@
1
+ import { IBasicFormula } from '../common/index';
2
+ import { FormulaOwner } from './formula-owner';
3
+ import { FormulaModuleBase } from './formula-module-base';
4
+ /**
5
+ * Date and time construction, extraction, and serial-number conversion for spreadsheet calendars.
6
+ *
7
+ * Registers 14 functions including DATE, DAY, TODAY, DAYS, WEEKDAY, and others.
8
+ *
9
+ * @hidden
10
+ */
11
+ export declare class DateTimeFormulas extends FormulaModuleBase {
12
+ /** Formula definitions registered with {@link BasicFormulas}. */
13
+ formulas: IBasicFormula[];
14
+ /**
15
+ * @hidden
16
+ * @param {FormulaOwner} owner - Formula registration owner ({@link BasicFormulas}).
17
+ */
18
+ constructor(owner: FormulaOwner);
19
+ /**
20
+ * Returns the date, given the year, month and day of the month.
21
+ *
22
+ * Excel: `DATE(...)`.
23
+ *
24
+ * @hidden
25
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
26
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * engine.computeFormula('=DATE(2024,1,15)');
31
+ * ```
32
+ */
33
+ ComputeDATE(...args: string[]): Date | string;
34
+ /**
35
+ * Returns the day of a given date.
36
+ *
37
+ * Excel: `DAY(...)`.
38
+ *
39
+ * @hidden
40
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
41
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
42
+ */
43
+ ComputeDAY(...args: string[]): number | string;
44
+ /**
45
+ * Returns the current date as date value.
46
+ *
47
+ * Excel: `TODAY(...)`.
48
+ *
49
+ * @hidden
50
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
51
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
52
+ */
53
+ ComputeTODAY(...args: string[]): Date | string;
54
+ /**
55
+ * Returns the number of days between two dates.
56
+ *
57
+ * Excel: `DAYS(...)`.
58
+ *
59
+ * @hidden
60
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
61
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
62
+ */
63
+ ComputeDAYS(...args: string[]): number | string;
64
+ /**
65
+ * Returns the day of the week corresponding to a date.
66
+ *
67
+ * Excel: `WEEKDAY(...)`.
68
+ *
69
+ * @hidden
70
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
71
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
72
+ */
73
+ ComputeWEEKDAY(...args: string[]): number | string;
74
+ /**
75
+ * Converts hours, minutes, seconds to the time formatted text.
76
+ *
77
+ * Excel: `TIME(...)`.
78
+ *
79
+ * @hidden
80
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
81
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
82
+ */
83
+ ComputeTIME(...args: string[]): string | number;
84
+ /**
85
+ * Returns a date with given number of months before or after the specified date.
86
+ *
87
+ * Excel: `EDATE(...)`.
88
+ *
89
+ * @hidden
90
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
91
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
92
+ */
93
+ ComputeEDATE(...args: string[]): Date | string;
94
+ /**
95
+ * Returns the last day of the month that is a specified number of months before or after an initially supplied start date.
96
+ *
97
+ * Excel: `EOMONTH(...)`.
98
+ *
99
+ * @hidden
100
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
101
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
102
+ */
103
+ ComputeEOMONTH(...args: string[]): Date | string;
104
+ /**
105
+ * Converts a date string into date value.
106
+ *
107
+ * Excel: `DATEVALUE(...)`.
108
+ *
109
+ * @hidden
110
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
111
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
112
+ */
113
+ ComputeDATEVALUE(...args: string[]): Date | string;
114
+ /**
115
+ * Returns the number of hours in a specified time string.
116
+ *
117
+ * Excel: `HOUR(...)`.
118
+ *
119
+ * @hidden
120
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
121
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
122
+ */
123
+ ComputeHOUR(...args: string[]): number | string;
124
+ /**
125
+ * Returns the number of minutes in a specified time string.
126
+ *
127
+ * Excel: `MINUTE(...)`.
128
+ *
129
+ * @hidden
130
+ * @param {string[]} argArr - Formula argument tokens from the Calculate engine.
131
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
132
+ */
133
+ ComputeMINUTE(...argArr: string[]): number | string;
134
+ /**
135
+ * Returns the number of seconds in a specified time string.
136
+ *
137
+ * Excel: `SECOND(...)`.
138
+ *
139
+ * @hidden
140
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
141
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
142
+ */
143
+ ComputeSECOND(...args: string[]): number | string;
144
+ /**
145
+ * Returns the current date and time.
146
+ *
147
+ * Excel: `NOW(...)`.
148
+ *
149
+ * @hidden
150
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
151
+ * @returns {string | number} - Computed text result or an Excel error token such as `#VALUE!`.
152
+ */
153
+ ComputeNOW(...args: string[]): string;
154
+ /**
155
+ * Returns the number of months in a specified date string.
156
+ *
157
+ * Excel: `MONTH(...)`.
158
+ *
159
+ * @hidden
160
+ * @param {string[]} argsVal - Formula argument tokens from the Calculate engine.
161
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
162
+ */
163
+ ComputeMONTH(...argsVal: string[]): number | string;
164
+ }