@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,288 @@
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
+ import { FinancialBondHelpers } from './financial-bond-helpers';
18
+ /**
19
+ * ECMA amortization and odd-period bond pricing/yield functions for European accounting conventions.
20
+ *
21
+ * Registered functions: AMORDEGRC, AMORLINC, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD.
22
+ *
23
+ * @hidden
24
+ */
25
+ var FinancialAmortizationEcmaFormulas = /** @class */ (function (_super) {
26
+ __extends(FinancialAmortizationEcmaFormulas, _super);
27
+ /**
28
+ * @hidden
29
+ * @param {FormulaOwner} owner - Formula registration owner ({@link BasicFormulas}).
30
+ */
31
+ function FinancialAmortizationEcmaFormulas(owner) {
32
+ var _this = _super.call(this, owner) || this;
33
+ /** Formula definitions registered with {@link BasicFormulas}. */
34
+ _this.formulas = [
35
+ { formulaName: 'AMORDEGRC', category: 'Financial', description: 'Returns the depreciation for each accounting period using a depreciation coefficient.' },
36
+ { formulaName: 'AMORLINC', category: 'Financial', description: 'Returns the depreciation for each accounting period.' },
37
+ { formulaName: 'ODDFPRICE', category: 'Financial', description: 'Returns the price per $100 face value of a security with an odd first period.' },
38
+ { formulaName: 'ODDFYIELD', category: 'Financial', description: 'Returns the yield of a security with an odd first period.' },
39
+ { formulaName: 'ODDLPRICE', category: 'Financial', description: 'Returns the price per $100 face value of a security with an odd last period.' },
40
+ { formulaName: 'ODDLYIELD', category: 'Financial', description: 'Returns the yield of a security with an odd last period.' }
41
+ ];
42
+ _this.bond = new FinancialBondHelpers(_this.parent);
43
+ return _this;
44
+ }
45
+ /**
46
+ * Returns the depreciation for each accounting period.
47
+ *
48
+ * Excel: `AMORLINC(...)`.
49
+ *
50
+ * @hidden
51
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
52
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * engine.computeFormula('=AMORLINC(1)');
57
+ * ```
58
+ */
59
+ FinancialAmortizationEcmaFormulas.prototype.ComputeAMORLINC = function () {
60
+ var args = [];
61
+ for (var _i = 0; _i < arguments.length; _i++) {
62
+ args[_i] = arguments[_i];
63
+ }
64
+ var errCollection = this.parent.getErrorStrings();
65
+ if (isNullOrUndefined(args) || args.length < 6 || args.length > 7) {
66
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
67
+ }
68
+ var cost = this.resolveNumberArg(args[0]);
69
+ var purchased = this.resolveNumberArg(args[1]);
70
+ var firstPeriod = this.resolveNumberArg(args[2]);
71
+ var salvage = this.resolveNumberArg(args[3]);
72
+ var period = this.resolveNumberArg(args[4]);
73
+ var rate = this.resolveNumberArg(args[5]);
74
+ if (typeof cost === 'string') {
75
+ return cost;
76
+ }
77
+ if (typeof purchased === 'string') {
78
+ return purchased;
79
+ }
80
+ if (typeof firstPeriod === 'string') {
81
+ return firstPeriod;
82
+ }
83
+ if (typeof salvage === 'string') {
84
+ return salvage;
85
+ }
86
+ if (typeof period === 'string') {
87
+ return period;
88
+ }
89
+ if (typeof rate === 'string') {
90
+ return rate;
91
+ }
92
+ var p = Math.floor(period);
93
+ if (p < 0) {
94
+ return errCollection[CommonErrors.Num];
95
+ }
96
+ var dep = Math.min((cost - salvage) * rate * (p + 1), cost - salvage);
97
+ return dep.toString();
98
+ };
99
+ /**
100
+ * Returns the depreciation for each accounting period using a depreciation coefficient.
101
+ *
102
+ * Excel: `AMORDEGRC(...)`.
103
+ *
104
+ * @hidden
105
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
106
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
107
+ */
108
+ FinancialAmortizationEcmaFormulas.prototype.ComputeAMORDEGRC = function () {
109
+ var args = [];
110
+ for (var _i = 0; _i < arguments.length; _i++) {
111
+ args[_i] = arguments[_i];
112
+ }
113
+ if (isNullOrUndefined(args) || args.length < 7 || args.length > 8) {
114
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
115
+ }
116
+ var cost = this.resolveNumberArg(args[0]);
117
+ var purchased = this.resolveNumberArg(args[1]);
118
+ var firstPeriod = this.resolveNumberArg(args[2]);
119
+ var salvage = this.resolveNumberArg(args[3]);
120
+ var period = this.resolveNumberArg(args[4]);
121
+ var rate = this.resolveNumberArg(args[5]);
122
+ var basis = args.length >= 8 ? this.resolveNumberArg(args[7]) : 0;
123
+ if (typeof cost === 'string') {
124
+ return cost;
125
+ }
126
+ if (typeof purchased === 'string') {
127
+ return purchased;
128
+ }
129
+ if (typeof firstPeriod === 'string') {
130
+ return firstPeriod;
131
+ }
132
+ if (typeof salvage === 'string') {
133
+ return salvage;
134
+ }
135
+ if (typeof period === 'string') {
136
+ return period;
137
+ }
138
+ if (typeof rate === 'string') {
139
+ return rate;
140
+ }
141
+ if (typeof basis === 'string') {
142
+ return basis;
143
+ }
144
+ var coef = rate < 0.03 ? 1 : rate < 0.05 ? 1.5 : rate < 0.1 ? 2 : 2.5;
145
+ var linear = this.ComputeAMORLINC(args[0], args[1], args[2], args[3], args[4], (rate * coef).toString());
146
+ return linear;
147
+ };
148
+ FinancialAmortizationEcmaFormulas.prototype.oddBondPrice = function (args, oddFirst) {
149
+ if (isNullOrUndefined(args) || args.length < 7 || args.length > 9) {
150
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
151
+ }
152
+ var settlement = this.resolveNumberArg(args[0]);
153
+ var maturity = this.resolveNumberArg(args[1]);
154
+ var issue = this.resolveNumberArg(args[2]);
155
+ var firstCoupon = this.resolveNumberArg(args[3]);
156
+ var rate = this.resolveNumberArg(args[4]);
157
+ var yld = this.resolveNumberArg(args[5]);
158
+ var redemption = this.resolveNumberArg(args[6]);
159
+ if (typeof settlement === 'string') {
160
+ return settlement;
161
+ }
162
+ if (typeof maturity === 'string') {
163
+ return maturity;
164
+ }
165
+ if (typeof issue === 'string') {
166
+ return issue;
167
+ }
168
+ if (typeof firstCoupon === 'string') {
169
+ return firstCoupon;
170
+ }
171
+ if (typeof rate === 'string') {
172
+ return rate;
173
+ }
174
+ if (typeof yld === 'string') {
175
+ return yld;
176
+ }
177
+ if (typeof redemption === 'string') {
178
+ return redemption;
179
+ }
180
+ var freq = args.length >= 8 && args[7] !== '' ? this.resolveNumberArg(args[7]) : 2;
181
+ var basis = args.length >= 9 && args[8] !== '' ? this.resolveNumberArg(args[8]) : 0;
182
+ if (typeof freq === 'string') {
183
+ return freq;
184
+ }
185
+ if (typeof basis === 'string') {
186
+ return basis;
187
+ }
188
+ var n = this.bond.coupNum(settlement, maturity, freq, basis);
189
+ var coupon = 100 * rate / freq;
190
+ var refDate = oddFirst ? firstCoupon : maturity;
191
+ var days = this.bond.daysBetween(settlement, refDate, basis);
192
+ var periodDays = this.bond.coupDays(settlement, maturity, freq, basis) || 180;
193
+ var price = redemption / Math.pow(1 + yld / freq, n + days / periodDays);
194
+ price += coupon * days / periodDays;
195
+ for (var k = 1; k <= n; k++) {
196
+ price += coupon / Math.pow(1 + yld / freq, k - 1 + days / periodDays);
197
+ }
198
+ return price.toString();
199
+ };
200
+ /**
201
+ * Returns the price per $100 face value of a security with an odd first period.
202
+ *
203
+ * Excel: `ODDFPRICE(...)`.
204
+ *
205
+ * @hidden
206
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
207
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
208
+ */
209
+ FinancialAmortizationEcmaFormulas.prototype.ComputeODDFPRICE = function () {
210
+ var args = [];
211
+ for (var _i = 0; _i < arguments.length; _i++) {
212
+ args[_i] = arguments[_i];
213
+ }
214
+ return this.oddBondPrice(args, true);
215
+ };
216
+ /**
217
+ * Returns the price per $100 face value of a security with an odd last period.
218
+ *
219
+ * Excel: `ODDLPRICE(...)`.
220
+ *
221
+ * @hidden
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
+ FinancialAmortizationEcmaFormulas.prototype.ComputeODDLPRICE = function () {
226
+ var args = [];
227
+ for (var _i = 0; _i < arguments.length; _i++) {
228
+ args[_i] = arguments[_i];
229
+ }
230
+ return this.oddBondPrice(args, false);
231
+ };
232
+ FinancialAmortizationEcmaFormulas.prototype.oddBondYield = function (computePrice, args) {
233
+ var priceArg = args[6];
234
+ var yldGuess = 0.05;
235
+ var yld = yldGuess;
236
+ var target = this.parent.parseFloat(this.resolveNumberArg(priceArg));
237
+ for (var iter = 0; iter < 50; iter++) {
238
+ var trialArgs = args.slice(0, 6).concat([yld.toString()], args.slice(7));
239
+ var p = this.parent.parseFloat(computePrice.apply(void 0, trialArgs));
240
+ var diff = p - target;
241
+ if (Math.abs(diff) < 1e-6) {
242
+ return yld.toString();
243
+ }
244
+ yld -= diff * 0.0001;
245
+ }
246
+ return yld.toString();
247
+ };
248
+ /**
249
+ * Returns the yield of a security with an odd first period.
250
+ *
251
+ * Excel: `ODDFYIELD(...)`.
252
+ *
253
+ * @hidden
254
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
255
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
256
+ */
257
+ FinancialAmortizationEcmaFormulas.prototype.ComputeODDFYIELD = function () {
258
+ var args = [];
259
+ for (var _i = 0; _i < arguments.length; _i++) {
260
+ args[_i] = arguments[_i];
261
+ }
262
+ if (isNullOrUndefined(args) || args.length < 8 || args.length > 9) {
263
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
264
+ }
265
+ return this.oddBondYield(this.ComputeODDFPRICE.bind(this), args);
266
+ };
267
+ /**
268
+ * Returns the yield of a security with an odd last period.
269
+ *
270
+ * Excel: `ODDLYIELD(...)`.
271
+ *
272
+ * @hidden
273
+ * @param {string[]} args - Formula argument tokens from the Calculate engine.
274
+ * @returns {string | number} - Computed Excel-compatible numeric or text result, or an error token such as `#VALUE!`, `#NUM!`, `#N/A`.
275
+ */
276
+ FinancialAmortizationEcmaFormulas.prototype.ComputeODDLYIELD = function () {
277
+ var args = [];
278
+ for (var _i = 0; _i < arguments.length; _i++) {
279
+ args[_i] = arguments[_i];
280
+ }
281
+ if (isNullOrUndefined(args) || args.length < 8 || args.length > 9) {
282
+ return this.parent.formulaErrorStrings[FormulasErrorsStrings.WrongNumberArguments];
283
+ }
284
+ return this.oddBondYield(this.ComputeODDLPRICE.bind(this), args);
285
+ };
286
+ return FinancialAmortizationEcmaFormulas;
287
+ }(FormulaModuleBase));
288
+ export { FinancialAmortizationEcmaFormulas };
@@ -0,0 +1,104 @@
1
+ import { IBasicFormula } from '../common/index';
2
+ import { FormulaOwner } from './formula-owner';
3
+ import { FormulaModuleBase } from './formula-module-base';
4
+ /**
5
+ * Annuity and payment functions: present/future value, payment amount, periods, and interest rate.
6
+ *
7
+ * Registered functions: FV, PV, PMT, NPER, IPMT, PPMT, NPV, RATE.
8
+ *
9
+ * @hidden
10
+ */
11
+ export declare class FinancialAnnuityFormulas 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
+ private resolveOptional;
20
+ /**
21
+ * Returns the future value of an investment.
22
+ *
23
+ * Excel: `FV(...)`.
24
+ *
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('=FV(1)');
31
+ * ```
32
+ */
33
+ ComputeFV(...args: string[]): string | number;
34
+ /**
35
+ * Returns the present value of an investment.
36
+ *
37
+ * Excel: `PV(...)`.
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
+ ComputePV(...args: string[]): string | number;
44
+ /**
45
+ * Returns the periodic payment for an annuity.
46
+ *
47
+ * Excel: `PMT(...)`.
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
+ ComputePMT(...args: string[]): string | number;
54
+ /**
55
+ * Returns the number of periods for an investment.
56
+ *
57
+ * Excel: `NPER(...)`.
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
+ ComputeNPER(...args: string[]): string | number;
64
+ /**
65
+ * Returns the interest payment for an investment for a given period.
66
+ *
67
+ * Excel: `IPMT(...)`.
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
+ ComputeIPMT(...args: string[]): string | number;
74
+ /**
75
+ * Returns the payment on the principal for an investment for a given period.
76
+ *
77
+ * Excel: `PPMT(...)`.
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
+ ComputePPMT(...args: string[]): string | number;
84
+ /**
85
+ * Returns the net present value of an investment based on periodic cash flows.
86
+ *
87
+ * Excel: `NPV(...)`.
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
+ ComputeNPV(...args: string[]): string | number;
94
+ /**
95
+ * Returns the interest rate per period of an annuity.
96
+ *
97
+ * Excel: `RATE(...)`.
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
+ ComputeRATE(...args: string[]): string | number;
104
+ }