commit
message
Merge pull request #1 from twobit/master
TypeScript declaration files
author
Ben V <[email protected]>
date
2018-07-23 13:08:44
stats
52 file(s) changed,
3440 insertions(+),
42 deletions(-)
files
dist/Cell.d.ts
dist/Cell.js
dist/Errors.d.ts
dist/Errors.js
dist/Formulas.d.ts
dist/Formulas/AllFormulas.d.ts
dist/Formulas/Convert.d.ts
dist/Formulas/Date.d.ts
dist/Formulas/Date.js
dist/Formulas/Engineering.d.ts
dist/Formulas/Financial.d.ts
dist/Formulas/Info.d.ts
dist/Formulas/Logical.d.ts
dist/Formulas/Lookup.d.ts
dist/Formulas/Math.d.ts
dist/Formulas/Math.js
dist/Formulas/Range.d.ts
dist/Formulas/Statistical.d.ts
dist/Formulas/Text.d.ts
dist/Formulas/Text.js
dist/Parser/DataStore.d.ts
dist/Parser/DataStore.js
dist/Parser/Parser.d.ts
dist/Parser/Parser.js
dist/Parser/ParserConstants.d.ts
dist/Parser/ReduceActions.d.ts
dist/Parser/ReductionPair.d.ts
dist/Parser/ReductionPair.js
dist/Parser/RuleIndex.d.ts
dist/Parser/Rules.d.ts
dist/Parser/Symbols.d.ts
dist/Sheet.d.ts
dist/Sheet.js
dist/Utilities/ArgsChecker.d.ts
dist/Utilities/ArgsChecker.js
dist/Utilities/CriteriaFunctionFactory.d.ts
dist/Utilities/CriteriaFunctionFactory.js
dist/Utilities/DateRegExBuilder.d.ts
dist/Utilities/DateRegExBuilder.js
dist/Utilities/Filter.d.ts
dist/Utilities/Filter.js
dist/Utilities/MathHelpers.d.ts
dist/Utilities/MoreUtils.d.ts
dist/Utilities/MoreUtils.js
dist/Utilities/ObjectBuilder.d.ts
dist/Utilities/ObjectBuilder.js
dist/Utilities/Serializer.d.ts
dist/Utilities/Serializer.js
dist/Utilities/TypeConverter.d.ts
dist/Utilities/TypeConverter.js
package.json
tsconfig.json
1diff --git a/dist/Cell.d.ts b/dist/Cell.d.ts
2new file mode 100644
3index 0000000..236395f
4--- /dev/null
5+++ b/dist/Cell.d.ts
6@@ -0,0 +1,126 @@
7+declare const CELL_ID_ERROR = "CELL_ID_ERROR";
8+/**
9+ * Represents a cell id error, and is thrown when a cells id does not conform to A1 notation.
10+ */
11+declare class CellIdError extends Error {
12+ constructor(msg: string);
13+}
14+/**
15+ * Cell represents a cell in the spreadsheet. It contains a nullable rawFormulaText, and a value, which is not nullable unless
16+ * the parsing of the rawFormulaText results in an error.
17+ */
18+declare class Cell {
19+ /**
20+ * The raw formula text that can be parse, excluding the proceeding =
21+ * E.g: SUM(A2:A4, 10)
22+ */
23+ private rawFormulaText;
24+ private typedValue;
25+ private dependencies;
26+ private error;
27+ private id;
28+ private row;
29+ private col;
30+ /**
31+ * Creates an empty cell with an id.
32+ * @param id key of the cell in A1-format.
33+ */
34+ constructor(id: string);
35+ /**
36+ * Update this cell's dependencies, where `dependencies` is a unique list of A1-format cell IDs.
37+ * @param dependencies to merge with existing dependencies.
38+ */
39+ updateDependencies(dependencies: Array<string>): void;
40+ /**
41+ * Return a list of dependencies in A1-format cell IDs, in no particular order, but likely in order of occurrence in
42+ * rawFormulaText.
43+ * @returns {Array<string>} list of dependencies in A1-format
44+ */
45+ getDependencies(): Array<string>;
46+ /**
47+ * Return the zero-indexed column number of this cell.
48+ * @returns {number} column
49+ */
50+ getColumn(): number;
51+ /**
52+ * Return the zero-indexed row number of this cell.
53+ * @returns {number} row
54+ */
55+ getRow(): number;
56+ /**
57+ * Get the A1-format ID of this cell.
58+ * @returns {string} cell ID
59+ */
60+ getId(): string;
61+ /**
62+ * Get the rawFormulaText of this cell if set. Defaults to null, so should be used in combination with hasFormula().
63+ * @returns {string} rawFormulaText of this cell, if set. Nullable.
64+ */
65+ getFormula(): string;
66+ /**
67+ * Returns true if this cell has a formula to be parsed.
68+ * @returns {boolean}
69+ */
70+ hasFormula(): boolean;
71+ /**
72+ * Sets the value or rawFormulaText for this cell. If the input begins with =, then it is considered to be a rawFormulaText. If it
73+ * is not, then it is a value, and set as the raw value for this cell.
74+ * @param rawFormula
75+ */
76+ setValue(rawFormula: string): void;
77+ /**
78+ * Gets the rawFormulaText for this cell, which is either null or a string.
79+ * @returns {string}
80+ */
81+ getRawFormulaText(): string | null;
82+ /**
83+ * Get the value of this cell if a value is present. If this cell was given a formula but not a value, this may return
84+ * null.
85+ * @returns {any}
86+ */
87+ getValue(): any;
88+ /**
89+ * CLears a cells value.
90+ */
91+ clearValue(): void;
92+ /**
93+ * Set error for this cell. Usually in the case of a parse error when parsing the rawFormulaText.
94+ * @param error to set.
95+ */
96+ setError(error: Error): void;
97+ /**
98+ * Get the error for this cell. If the rawFormulaText is not parsed properly, or is null, this could be null.
99+ * @returns {Error} error to return, could be null.
100+ */
101+ getError(): Error;
102+ /**
103+ * Easier way to check if this cell has an error.
104+ * @returns {boolean}
105+ */
106+ hasError(): boolean;
107+ /**
108+ * A cell is deemed blank if it contains no value, no error, and no typed value.
109+ * @returns {boolean}
110+ */
111+ isBlank(): boolean;
112+ /**
113+ * Returns the human-readable string representation of this cell, omitting some obvious fields.
114+ * @returns {string}
115+ */
116+ toString(): string;
117+ /**
118+ * Comparing two cells.
119+ * @param other
120+ * @returns {boolean}
121+ */
122+ equals(other: Cell): boolean;
123+ /**
124+ * Build a cell with an id and value.
125+ * @param id - A1-notation id or key.
126+ * @param value - value of the cell as a string
127+ * @returns {Cell}
128+ * @constructor
129+ */
130+ static BuildFrom(id: string, value: any): Cell;
131+}
132+export { Cell, CellIdError, CELL_ID_ERROR };
133diff --git a/dist/Cell.js b/dist/Cell.js
134index c88c5b9..ee91a8b 100644
135--- a/dist/Cell.js
136+++ b/dist/Cell.js
137@@ -15,7 +15,7 @@ exports.CELL_ID_ERROR = CELL_ID_ERROR;
138 /**
139 * Represents a cell id error, and is thrown when a cells id does not conform to A1 notation.
140 */
141-var CellIdError = (function (_super) {
142+var CellIdError = /** @class */ (function (_super) {
143 __extends(CellIdError, _super);
144 function CellIdError(msg) {
145 var _this = _super.call(this) || this;
146@@ -30,7 +30,7 @@ exports.CellIdError = CellIdError;
147 * Cell represents a cell in the spreadsheet. It contains a nullable rawFormulaText, and a value, which is not nullable unless
148 * the parsing of the rawFormulaText results in an error.
149 */
150-var Cell = (function () {
151+var Cell = /** @class */ (function () {
152 /**
153 * Creates an empty cell with an id.
154 * @param id key of the cell in A1-format.
155diff --git a/dist/Errors.d.ts b/dist/Errors.d.ts
156new file mode 100644
157index 0000000..c469777
158--- /dev/null
159+++ b/dist/Errors.d.ts
160@@ -0,0 +1,65 @@
161+declare let NULL_ERROR: string;
162+declare let DIV_ZERO_ERROR: string;
163+declare let VALUE_ERROR: string;
164+declare let REF_ERROR: string;
165+declare let NAME_ERROR: string;
166+declare let NUM_ERROR: string;
167+declare let NA_ERROR: string;
168+declare let PARSE_ERROR: string;
169+/**
170+ * Execution or parsing produced a null value, or intersection of ranges produced zero cells.
171+ */
172+declare class NullError extends Error {
173+ constructor(message: string);
174+}
175+/**
176+ * Attempt to divide by zero, including division by an empty cell.
177+ */
178+declare class DivZeroError extends Error {
179+ constructor(message: string);
180+}
181+/**
182+ * Parameter is wrong type, or value is incompatible, or cannot be parsed, converted, or manipulated.
183+ */
184+declare class ValueError extends Error {
185+ constructor(message: string);
186+}
187+/**
188+ * Reference to invalid cell, range, or empty range.
189+ */
190+declare class RefError extends Error {
191+ constructor(message: string);
192+}
193+/**
194+ * Unrecognized/deleted name.
195+ */
196+declare class NameError extends Error {
197+ constructor(message: string);
198+}
199+/**
200+ * Failed to meet domain constraints (e.g., input number too high or too low).
201+ */
202+declare class NumError extends Error {
203+ constructor(message: string);
204+}
205+/**
206+ * Lookup functions which failed and NA() return this value.
207+ */
208+declare class NAError extends Error {
209+ constructor(message: string);
210+}
211+/**
212+ * Input could not be parsed.
213+ */
214+declare class ParseError extends Error {
215+ constructor(message: string);
216+}
217+/**
218+ * Constructs an error by error name.
219+ * @param {string} name - Name of error. If not one of DIV_ZERO_ERROR, NULL_ERROR, VALUE_ERROR, REF_ERROR, NAME_ERROR,
220+ * NUM_ERROR,NA_ERROR, or PARSE_ERROR, will default to ParseError.
221+ * @param {string} msg - Message for error, will default to empty string.
222+ * @returns {Error}
223+ */
224+declare function constructErrorByName(name: string, msg?: string): Error;
225+export { DIV_ZERO_ERROR, NULL_ERROR, VALUE_ERROR, REF_ERROR, NAME_ERROR, NUM_ERROR, NA_ERROR, PARSE_ERROR, DivZeroError, NullError, ValueError, RefError, NameError, NumError, NAError, ParseError, constructErrorByName };
226diff --git a/dist/Errors.js b/dist/Errors.js
227index dae35e3..7d92a71 100644
228--- a/dist/Errors.js
229+++ b/dist/Errors.js
230@@ -29,7 +29,7 @@ exports.PARSE_ERROR = PARSE_ERROR;
231 /**
232 * Execution or parsing produced a null value, or intersection of ranges produced zero cells.
233 */
234-var NullError = (function (_super) {
235+var NullError = /** @class */ (function (_super) {
236 __extends(NullError, _super);
237 function NullError(message) {
238 var _this = _super.call(this, message) || this;
239@@ -42,7 +42,7 @@ exports.NullError = NullError;
240 /**
241 * Attempt to divide by zero, including division by an empty cell.
242 */
243-var DivZeroError = (function (_super) {
244+var DivZeroError = /** @class */ (function (_super) {
245 __extends(DivZeroError, _super);
246 function DivZeroError(message) {
247 var _this = _super.call(this, message) || this;
248@@ -55,7 +55,7 @@ exports.DivZeroError = DivZeroError;
249 /**
250 * Parameter is wrong type, or value is incompatible, or cannot be parsed, converted, or manipulated.
251 */
252-var ValueError = (function (_super) {
253+var ValueError = /** @class */ (function (_super) {
254 __extends(ValueError, _super);
255 function ValueError(message) {
256 var _this = _super.call(this, message) || this;
257@@ -68,7 +68,7 @@ exports.ValueError = ValueError;
258 /**
259 * Reference to invalid cell, range, or empty range.
260 */
261-var RefError = (function (_super) {
262+var RefError = /** @class */ (function (_super) {
263 __extends(RefError, _super);
264 function RefError(message) {
265 var _this = _super.call(this, message) || this;
266@@ -81,7 +81,7 @@ exports.RefError = RefError;
267 /**
268 * Unrecognized/deleted name.
269 */
270-var NameError = (function (_super) {
271+var NameError = /** @class */ (function (_super) {
272 __extends(NameError, _super);
273 function NameError(message) {
274 var _this = _super.call(this, message) || this;
275@@ -94,7 +94,7 @@ exports.NameError = NameError;
276 /**
277 * Failed to meet domain constraints (e.g., input number too high or too low).
278 */
279-var NumError = (function (_super) {
280+var NumError = /** @class */ (function (_super) {
281 __extends(NumError, _super);
282 function NumError(message) {
283 var _this = _super.call(this, message) || this;
284@@ -107,7 +107,7 @@ exports.NumError = NumError;
285 /**
286 * Lookup functions which failed and NA() return this value.
287 */
288-var NAError = (function (_super) {
289+var NAError = /** @class */ (function (_super) {
290 __extends(NAError, _super);
291 function NAError(message) {
292 var _this = _super.call(this, message) || this;
293@@ -120,7 +120,7 @@ exports.NAError = NAError;
294 /**
295 * Input could not be parsed.
296 */
297-var ParseError = (function (_super) {
298+var ParseError = /** @class */ (function (_super) {
299 __extends(ParseError, _super);
300 function ParseError(message) {
301 var _this = _super.call(this, message) || this;
302diff --git a/dist/Formulas.d.ts b/dist/Formulas.d.ts
303new file mode 100644
304index 0000000..4847415
305--- /dev/null
306+++ b/dist/Formulas.d.ts
307@@ -0,0 +1,6 @@
308+declare let Formulas: {
309+ exists: (fn: string) => boolean;
310+ get: (fn: string) => any;
311+ isTryCatchFormula: (fn: string) => boolean;
312+};
313+export { Formulas };
314diff --git a/dist/Formulas/AllFormulas.d.ts b/dist/Formulas/AllFormulas.d.ts
315new file mode 100644
316index 0000000..76c4fc9
317--- /dev/null
318+++ b/dist/Formulas/AllFormulas.d.ts
319@@ -0,0 +1,24 @@
320+import { ABS, ACOS, ACOSH, ACOTH, ASIN, ASINH, ATAN, ATAN2, ATANH, COT, COTH, COSH, COS, COUNTUNIQUE, EVEN, ERF, ERFC, INT, ISEVEN, ISODD, MOD, ODD, SIN, SINH, SUM, SQRT, SQRTPI, PI, POWER, LOG, LOG10, LN, TAN, TANH, ROUND, ROUNDDOWN, ROUNDUP, SUMPRODUCT, SUMIF, SUMSQ, SUMX2MY2, SUMX2PY2, FLOOR, IF, COUNTIF, COUNTIFS, CEILING, TRUNC, RADIANS, DEGREES, COMBIN, MULTIPLY, MINUS, RAND, RANDBETWEEN, SIGN, DIVIDE, EQ, GT, GTE, LT, LTE, NE, GCD, LCM, GAMMALN, PRODUCT, QUOTIENT, UPLUS, UMINUS, MROUND, FACTDOUBLE, UNARY_PERCENT, MULTINOMIAL, SERIESSUM, SUBTOTAL } from "./Math";
321+import { FREQUENCY, GROWTH, LINEST } from "./Range";
322+import { NA, ISTEXT, ISLOGICAL, ISNUMBER, ISNONTEXT, ISEMAIL, ISURL, N, ISREF, ERRORTYPE, ISBLANK, ISERR, ISERROR, ISNA, IFERROR, TYPE, COLUMN, ROW, ISFORMULA } from "./Info";
323+import { CHOOSE, ADDRESS, COLUMNS, ROWS } from "./Lookup";
324+import { TO_DATE, TO_DOLLARS, TO_PERCENT, TO_TEXT } from "./Convert";
325+import { AND, EXACT, TRUE, FALSE, NOT, OR, XOR } from "./Logical";
326+import { BIN2DEC, BIN2HEX, BIN2OCT, DEC2BIN, DEC2HEX, DEC2OCT, DELTA } from "./Engineering";
327+import { ACCRINT, CUMPRINC, CUMIPMT, DB, DDB, DOLLAR, DOLLARDE, DOLLARFR, EFFECT, SYD, SLN, NPV, NPER, NOMINAL, MIRR, IRR, IPMT, FV, PPMT, FVSCHEDULE, PV, RATE } from "./Financial";
328+import { AVERAGE, AVERAGEA, AVERAGEIF, AVEDEV, CORREL, COUNT, COUNTA, PEARSON, MEDIAN, DEVSQ, EXPONDIST, FINV, FISHER, FISHERINV, MAX, MAXA, MIN, MINA, QUARTILE, PERCENTILE, STDEV, STDEVA, STDEVP, STDEVPA, TRIMMEAN, SLOPE, STANDARDIZE, SMALL, LARGE, KURT, INTERCEPT, FORECAST, POISSON, PERCENTRANK, PERCENTRANK$EXC, NORMSINV, NORMSDIST, NORMDIST, NORMINV, NEGBINOMDIST, GEOMEAN, HARMEAN, CONFIDENCE, BINOMDIST, COVAR, WEIBULL, VARPA, VARP, VARA, VAR, PERMUT, RSQ, SKEW, STEYX, PROB, MODE, RANK, RANK$AVG, RANK$EQ, LOGNORMDIST, TDIST, HYPGEOMDIST, ZTEST } from "./Statistical";
329+import { ARABIC, CHAR, CODE, SPLIT, CONCATENATE, CONVERT, TRIM, LOWER, UPPER, T, ROMAN, TEXT, FIND, JOIN, LEN, LEFT, RIGHT, SEARCH, REPT, VALUE, CLEAN, MID, PROPER, REPLACE, SUBSTITUTE } from "./Text";
330+import { DATE, DATEVALUE, DATEDIF, DAYS, DAY, DAYS360, EDATE, EOMONTH, MONTH, YEAR, WEEKDAY, WEEKNUM, YEARFRAC, TIMEVALUE, HOUR, MINUTE, SECOND, NETWORKDAYS, NETWORKDAYS$INTL, NOW, TODAY, TIME, WORKDAY, WORKDAY$INTL } from "./Date";
331+declare const __COMPLEX: {
332+ "F.DIST": (x: any, degreesFreedom1: any, degreesFreedom2: any, cumulative: any) => number | boolean;
333+ "NETWORKDAYS.INTL": (startDate: any, endDate: any, weekend?: any, holidays?: any) => number;
334+ "WORKDAY.INTL": (startDate: any, numberOfDays: any, weekend?: any, holidays?: any) => number;
335+ "POISSON.DIST": (x: any, meanValue: any, cumulative?: any) => number;
336+ "PERCENTRANK.INC": (data: any, x: any, significance?: any) => number;
337+ "PERCENTRANK.EXC": (data: any, x: any, significance?: any) => number;
338+ "ERROR.TYPE": (value: any) => 1 | 2 | 6 | 7 | 8 | 3 | 5 | 4;
339+ "RANK.AVG": (value: any, data: any, isAscending?: any) => number;
340+ "RANK.EQ": (value: any, data: any, isAscending?: any) => number;
341+};
342+declare const __TRY_CATCH_FORMULAS: Object;
343+export { __COMPLEX, __TRY_CATCH_FORMULAS, ABS, ACOS, ACCRINT, ACOSH, ACOTH, AND, ARABIC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, BIN2DEC, BIN2HEX, BIN2OCT, CEILING, CHAR, CODE, COMBIN, CONCATENATE, CONVERT, CORREL, PEARSON, COS, PI, COSH, COT, COTH, COUNT, COUNTA, COUNTIF, COUNTIFS, COUNTUNIQUE, CUMIPMT, CUMPRINC, DATE, DATEVALUE, DAY, DAYS, DAYS360, DB, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DEGREES, DELTA, DEVSQ, DOLLAR, DOLLARDE, DOLLARFR, EDATE, EFFECT, EOMONTH, ERF, ERFC, EVEN, EXACT, EXPONDIST, FALSE, FINV, FISHER, FISHERINV, FLOOR, IF, INT, ISEVEN, ISODD, LN, LOG, LOG10, MAX, MAXA, MEDIAN, MIN, MINA, MOD, TRUE, NOT, ODD, OR, POWER, ROUND, ROUNDDOWN, ROUNDUP, SIN, SINH, SPLIT, SQRT, SQRTPI, SUM, SUMIF, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, TAN, TANH, TRUNC, XOR, YEARFRAC, RADIANS, MONTH, YEAR, WEEKDAY, WEEKNUM, DATEDIF, TIMEVALUE, HOUR, MINUTE, SECOND, NETWORKDAYS, NETWORKDAYS$INTL, NOW, TODAY, TIME, WORKDAY, WORKDAY$INTL, MULTIPLY, MINUS, RAND, RANDBETWEEN, SIGN, DIVIDE, EQ, GT, GTE, LT, LTE, NE, NA, CHOOSE, GCD, TRIM, LCM, GAMMALN, QUARTILE, PERCENTILE, PRODUCT, QUOTIENT, UPLUS, UMINUS, STDEV, STDEVA, STDEVP, STDEVPA, ISTEXT, ISLOGICAL, ISNUMBER, ISNONTEXT, MROUND, FACTDOUBLE, FREQUENCY, GROWTH, TRIMMEAN, SLOPE, LOWER, UPPER, STANDARDIZE, SMALL, LARGE, KURT, INTERCEPT, FORECAST, SYD, SLN, NPV, NPER, NOMINAL, MIRR, IRR, IPMT, FV, ISEMAIL, ISURL, LINEST, POISSON, PERCENTRANK, PERCENTRANK$EXC, NORMSINV, NORMSDIST, NORMDIST, NORMINV, NEGBINOMDIST, GEOMEAN, HARMEAN, CONFIDENCE, N, UNARY_PERCENT, MULTINOMIAL, BINOMDIST, COVAR, ISREF, ERRORTYPE, ISBLANK, ISERR, ISERROR, ISNA, IFERROR, TYPE, COLUMN, ROW, T, PPMT, WEIBULL, VARPA, VARP, VARA, VAR, PERMUT, RSQ, SKEW, STEYX, PROB, MODE, RANK, RANK$AVG, RANK$EQ, LOGNORMDIST, TDIST, TO_DATE, TO_DOLLARS, TO_PERCENT, TO_TEXT, ISFORMULA, ADDRESS, COLUMNS, ROWS, SERIESSUM, ROMAN, TEXT, FVSCHEDULE, PV, RATE, SUBTOTAL, HYPGEOMDIST, ZTEST, FIND, JOIN, LEN, LEFT, RIGHT, SEARCH, REPT, VALUE, CLEAN, MID, PROPER, REPLACE, SUBSTITUTE };
344diff --git a/dist/Formulas/Convert.d.ts b/dist/Formulas/Convert.d.ts
345new file mode 100644
346index 0000000..551db02
347--- /dev/null
348+++ b/dist/Formulas/Convert.d.ts
349@@ -0,0 +1,32 @@
350+/**
351+ * Converts a number to a Date.
352+ * @param value - Value to convert. If the input is a number, will convert to a date. If value is non-numeric, will
353+ * return value unchanged.
354+ * @returns {any}
355+ * @constructor
356+ */
357+declare let TO_DATE: (value: any) => any;
358+/**
359+ * Converts a number to a Dollar value.
360+ * @param value - Value to convert. If the input is a number, will return as a dollar value. If value is non-numeric,
361+ * will return value unchanged.
362+ * @returns {any}
363+ * @constructor
364+ */
365+declare let TO_DOLLARS: (value: any) => any;
366+/**
367+ * Converts a number to a percent value where 1 = 100 percent.
368+ * @param value - Value to convert. If the input is a number, will return as a percent value. If value is non-numeric,
369+ * will return value unchanged.
370+ * @returns {any}
371+ * @constructor
372+ */
373+declare let TO_PERCENT: (value: any) => any;
374+/**
375+ * Converts a number to a text value
376+ * @param value - Value to convert. If the input is a text, will return as a text value.
377+ * @returns {any}
378+ * @constructor
379+ */
380+declare let TO_TEXT: (value: any) => string;
381+export { TO_DATE, TO_DOLLARS, TO_PERCENT, TO_TEXT };
382diff --git a/dist/Formulas/Date.d.ts b/dist/Formulas/Date.d.ts
383new file mode 100644
384index 0000000..d2b907a
385--- /dev/null
386+++ b/dist/Formulas/Date.d.ts
387@@ -0,0 +1,266 @@
388+/// <reference path="../../node_modules/moment/moment.d.ts" />
389+/**
390+ * Converts a provided year, month, and day into a date.
391+ * @param year - The year component of the date.
392+ * @param month - The month component of the date.
393+ * @param day - The day component of the date.
394+ * @returns {number} newly created date.
395+ * @constructor
396+ */
397+declare let DATE: (year: any, month: any, day: any) => number;
398+/**
399+ * Converts a provided date string in a known format to a date value.
400+ * @param dateString - The string representing the date. Understood formats include any date format which is
401+ * normally auto-converted when entered, without quotation marks, directly into a cell. Understood formats may depend on
402+ * region and language settings.
403+ * @returns {number} of days since 1900/1/1, inclusively.
404+ * @constructor
405+ */
406+declare let DATEVALUE: (dateString: any) => number;
407+/**
408+ * Returns a date a specified number of months before or after another date.
409+ * @param startDate - The date from which to calculate the result.
410+ * @param months - The number of months before (negative) or after (positive) start_date to calculate.
411+ * @returns {number} date a specified number of months before or after another date
412+ * @constructor
413+ */
414+declare let EDATE: (startDate: any, months: any) => number;
415+/**
416+ * Returns a date representing the last day of a month which falls a specified number of months before or after another
417+ * date.
418+ * @param startDate - The date from which to calculate the the result.
419+ * @param months - The number of months before (negative) or after (positive) start_date to consider. The last
420+ * calendar day of the calculated month is returned.
421+ * @returns {number} the last day of a month
422+ * @constructor
423+ */
424+declare let EOMONTH: (startDate: any, months: any) => number;
425+/**
426+ * Returns the day of the month that a specific date falls on, in numeric format.
427+ * @param date - The date from which to extract the day. Must be a reference to a cell containing a date, a
428+ * function returning a date type, or a number.
429+ * @returns {number} day of the month
430+ * @constructor
431+ */
432+declare let DAY: (date: any) => number;
433+/**
434+ * Returns the number of days between two dates.
435+ * @param endDate most recently occurring
436+ * @param startDate not most recently occurring
437+ * @returns {number} of days between start_date and end_date
438+ * @constructor
439+ */
440+declare let DAYS: (endDate: any, startDate: any) => number;
441+/**
442+ * Returns the difference between two days based on the 360 day year used in some financial interest calculations.
443+ * @param startDate - The start date to consider in the calculation. Must be a reference to a cell containing
444+ * a date, a function returning a date type, or a number.
445+ * @param endDate - The end date to consider in the calculation. Must be a reference to a cell containing a
446+ * date, a function returning a date type, or a number.
447+ * @param methodToUse - [ OPTIONAL - 0 by default ] - An indicator of what day count method to use.
448+ * 0 indicates the US method - Under the US method, if start_date is the last day of a month, the day of month of
449+ * start_date is changed to 30 for the purposes of the calculation. Furthermore if end_date is the last day of a month
450+ * and the day of the month of start_date is earlier than the 30th, end_date is changed to the first day of the month
451+ * following end_date, otherwise the day of month of end_date is changed to 30.
452+ * Any other value indicates the European method - Under the European method, any start_date or end_date that falls on
453+ * the 31st of a month has its day of month changed to 30.
454+ * @returns {number} of days between two dates
455+ * @constructor
456+ */
457+declare let DAYS360: (startDate: any, endDate: any, methodToUse?: any) => number;
458+/**
459+ * Returns the month of the year a specific date falls in, in numeric format.
460+ * @param date - The date from which to extract the month. Must be a reference to a cell containing a date, a
461+ * function returning a date type, or a number.
462+ * @returns {number} month of the year that the input date falls on.
463+ * @constructor
464+ */
465+declare let MONTH: (date: any) => number;
466+/**
467+ * Returns the year specified by a given date.
468+ * @param date - The date from which to calculate the year. Must be a cell reference to a cell containing a
469+ * date, a function returning a date type, or a number.
470+ * @returns {number} year of the input date
471+ * @constructor
472+ */
473+declare let YEAR: (date: any) => number;
474+/**
475+ * Returns a number representing the day of the week of the date provided.
476+ * @param date - The date for which to determine the day of the week. Must be a reference to a cell containing
477+ * a date, a function returning a date type, or a number.
478+ * @param offsetType - [ OPTIONAL - 1 by default ] - A number indicating which numbering system to use to represent
479+ * weekdays. By default counts starting with Sunday = 1. If type is 1, days are counted from Sunday and the value of
480+ * Sunday is 1, therefore the value of Saturday is 7. If type is 2, days are counted from Monday and the value of Monday
481+ * is 1, therefore the value of Sunday is 7. If type is 3, days are counted from Monday and the value of Monday is 0,
482+ * therefore the value of Sunday is 6.
483+ * @returns {number} day of week
484+ * @constructor
485+ */
486+declare let WEEKDAY: (date: any, offsetType?: any) => number;
487+/**
488+ * Returns a number representing the week of the year where the provided date falls. When inputting the date, it is best
489+ * to use the DATE function, as text values may return errors.
490+ *
491+ * Behind the scenes, there are two week numbering "systems" used for this function: System 1 - The first week of the
492+ * year is considered to be the week containing January 1, which is numbered week 1. System 2 - The first week of the
493+ * year is considered to be the week containing the first Thursday of the year, which is numbered as week 1. System 2 is
494+ * the approach specified in ISO 8601, also known as the European system for numbering weeks.
495+ *
496+ * @param date - The date for which to determine the week number. Must be a reference to a cell containing a
497+ * date, a function returning a date type, or a number.
498+ * @param shiftType - [ OPTIONAL - default is 1 ] - A number representing the day that a week starts on as well as
499+ * the system used for determining the first week of the year (1=Sunday, 2=Monday).
500+ * @returns {number} representing week number of year.
501+ * @constructor
502+ */
503+declare let WEEKNUM: (date: any, shiftType?: any) => number;
504+/**
505+ * Calculates the number of days, months, or years between two dates.
506+ * @param startDate - The start date to consider in the calculation. Must be a reference to a cell containing
507+ * a DATE, a function returning a DATE type, or a number.
508+ * @param endDate - The end date to consider in the calculation. Must be a reference to a cell containing a
509+ * DATE, a function returning a DATE type, or a number.
510+ * @param unit - A text abbreviation for unit of time. For example,"M" for month. Accepted values are "Y": the
511+ * number of whole years between start_date and end_date, "M": the number of whole months between start_date and
512+ * end_date, "D": the number of days between start_date and end_date, "MD": the number of days between start_date and
513+ * end_date after subtracting whole months, "YM": the number of whole months between start_date and end_date after
514+ * subtracting whole years, "YD": the number of days between start_date and end_date, assuming start_date and end_date
515+ * were no more than one year apart.
516+ * @returns {number} number of days, months, or years between two dates.
517+ * @constructor
518+ */
519+declare let DATEDIF: (startDate: any, endDate: any, unit: any) => number;
520+/**
521+ * Returns the number of years, including fractional years, between two dates using a specified day count convention.
522+ *
523+ * Further reading:
524+ *
525+ * * http://christian-fries.de/blog/files/2013-yearfrac.html
526+ *
527+ * * http://finmath.net/finmath-lib/
528+ *
529+ * @param startDate - The start date to consider in the calculation. Must be a reference to a cell
530+ * containing a date, a function returning a date type, or a number.
531+ * @param endDate - The end date to consider in the calculation. Must be a reference to a cell containing
532+ * a date, a function returning a date type, or a number.
533+ * @param dayCountConvention - [ OPTIONAL - 0 by default ] - An indicator of what day count method to
534+ * use.
535+ * @returns {number}the number of years, including fractional years, between two dates
536+ * @constructor
537+ */
538+declare let YEARFRAC: (startDate: any, endDate: any, dayCountConvention?: any) => number;
539+/**
540+ * Returns the fraction of a 24-hour day the time represents.
541+ * @param timeString - The string that holds the time representation. Eg: "10am", "10:10", "10:10am", "10:10:11",
542+ * or "10:10:11am".
543+ * @returns {number} representing the fraction of a 24-hour day
544+ * @constructor
545+ */
546+declare let TIMEVALUE: (timeString: any) => number;
547+/**
548+ * Returns the hour component of a specific time, in numeric format.
549+ * @param time - The time from which to calculate the hour component. Must be a reference to a cell containing
550+ * a date/time, a function returning a date/time type, or a number.
551+ * @returns {number}
552+ * @constructor
553+ */
554+declare let HOUR: (time: any) => number;
555+/**
556+ * Returns the minute component of a specific time, in numeric format.
557+ * @param time - The time from which to calculate the minute component. Must be a reference to a cell
558+ * containing a date/time, a function returning a date/time type, or a number.
559+ * @returns {number} minute of the time passed in.
560+ * @constructor
561+ */
562+declare let MINUTE: (time: any) => number;
563+/**
564+ * Returns the second component of a specific time, in numeric format.
565+ * @param time - The time from which to calculate the second component. Must be a reference to a cell
566+ * containing a date/time, a function returning a date/time type, or a number.
567+ * @returns {number} second component of a specific time.
568+ * @constructor
569+ */
570+declare let SECOND: (time: any) => number;
571+/**
572+ * Returns the number of net working days between two provided days.
573+ * @param startDate - The start date of the period from which to calculate the number of net working days.
574+ * @param endDate - The end date of the period from which to calculate the number of net working days.
575+ * @param holidays - [ OPTIONAL ] - A range or array constant containing the date serial numbers to consider
576+ * holidays. The values provided within an array for holidays must be date serial number values, as returned by N or
577+ * date values, as returned by DATE, DATEVALUE or TO_DATE. Values specified by a range should be standard date values or
578+ * date serial numbers.
579+ * @returns {number} the number of net working days between two provided dates.
580+ * @constructor
581+ */
582+declare let NETWORKDAYS: (startDate: any, endDate: any, holidays?: any) => number;
583+/**
584+ * Returns the number of networking days between two provided days excluding specified weekend days and holidays.
585+ * @param startDate - The start date of the period from which to calculate the number of net working days.
586+ * @param endDate - The end date of the period from which to calculate the number of net working days.
587+ * @param weekend - [ OPTIONAL - 1 by default ] - A number or string representing which days of the week are
588+ * considered weekends. String method: weekends can be specified using seven 0’s and 1’s, where the first number in the
589+ * set represents Monday and the last number is for Sunday. A zero means that the day is a work day, a 1 means that the
590+ * day is a weekend. For example, “0000011” would mean Saturday and Sunday are weekends. Number method: instead of using
591+ * the string method above, a single number can be used. 1 = Saturday/Sunday are weekends, 2 = Sunday/Monday, and this
592+ * pattern repeats until 7 = Friday/Saturday. 11 = Sunday is the only weekend, 12 = Monday is the only weekend, and this
593+ * pattern repeats until 17 = Saturday is the only weekend.
594+ * @param holidays - [ OPTIONAL ] - A range or array constant containing the dates to consider as holidays.
595+ * The values provided within an array for holidays must be date serial number values, as returned by N or date values,
596+ * as returned by DATE, DATEVALUE or TO_DATE. Values specified by a range should be standard date values or date serial
597+ * numbers.
598+ * @returns {number} of networking days between two provided days
599+ * @constructor
600+ */
601+declare let NETWORKDAYS$INTL: (startDate: any, endDate: any, weekend?: any, holidays?: any) => number;
602+/**
603+ * Returns the current date and time as a date value.
604+ * @returns {number} representing the current date and time.
605+ * @constructor
606+ */
607+declare let NOW: () => number;
608+/**
609+ * Returns the current date as a date value.
610+ * @returns {number} today
611+ * @constructor
612+ */
613+declare let TODAY: () => number;
614+/**
615+ * Converts a provided hour, minute, and second into a time. Will silently recalculate numeric time values which fall
616+ * outside of valid ranges. Eg: TIME(24, 0, 0) is the same as TIME(0, 0, 0).
617+ * @param hours - The hour component of the time.
618+ * @param minutes - The minute component of the time.
619+ * @param seconds - The second component of the time.
620+ * @returns {number} time of day
621+ * @constructor
622+ */
623+declare let TIME: (hours: any, minutes: any, seconds: any) => number;
624+/**
625+ * Calculates the end date after a specified number of working days.
626+ * @param startDate - The date from which to begin counting.
627+ * @param numberOfDays - The number of working days to advance from start_date. If negative, counts backwards. If
628+ * not an integer, truncate.
629+ * @param holidays - [ OPTIONAL ] - A range or array constant containing the dates to consider holidays. The
630+ * values provided within an array for holidays must be date serial number values, as returned by N or date values, as
631+ * returned by DATE, DATEVALUE or TO_DATE. Values specified by a range should be standard date values or date serial
632+ * numbers.
633+ * @returns {number} end date after a specified number of working days.
634+ * @constructor
635+ */
636+declare let WORKDAY: (startDate: any, numberOfDays: any, holidays?: any) => number;
637+/**
638+ * Calculates the date after a specified number of workdays excluding specified weekend days and holidays.
639+ * @param startDate - The date from which to begin counting.
640+ * @param numberOfDays - The number of working days to advance from start_date. If negative, counts backwards.
641+ * @param weekend - [ OPTIONAL - 1 by default ] - A number or string representing which days of the week are
642+ * considered weekends. String method: weekends can be specified using seven 0’s and 1’s, where the first number in the
643+ * set represents Monday and the last number is for Sunday. A zero means that the day is a work day, a 1 means that the
644+ * day is a weekend. For example, “0000011” would mean Saturday and Sunday are weekends. Number method: instead of using
645+ * the string method above, a single number can be used. 1 = Saturday/Sunday are weekends, 2 = Sunday/Monday, and this
646+ * pattern repeats until 7 = Friday/Saturday. 11 = Sunday is the only weekend, 12 = Monday is the only weekend, and this
647+ * pattern repeats until 17 = Saturday is the only weekend.
648+ * @param holidays - [ OPTIONAL ] - A range or array constant containing the dates to consider holidays.
649+ * @returns {number}
650+ * @constructor
651+ */
652+declare let WORKDAY$INTL: (startDate: any, numberOfDays: any, weekend?: any, holidays?: any) => number;
653+export { DATE, DATEVALUE, DATEDIF, DAYS, DAY, DAYS360, EDATE, EOMONTH, MONTH, YEAR, WEEKDAY, WEEKNUM, YEARFRAC, TIMEVALUE, HOUR, MINUTE, SECOND, NETWORKDAYS, NETWORKDAYS$INTL, NOW, TODAY, TIME, WORKDAY, WORKDAY$INTL };
654diff --git a/dist/Formulas/Date.js b/dist/Formulas/Date.js
655index 934aa36..93b14ba 100644
656--- a/dist/Formulas/Date.js
657+++ b/dist/Formulas/Date.js
658@@ -290,7 +290,7 @@ var WEEKNUM = function (date, shiftType) {
659 if (dm.weekYear() !== dm.year()) {
660 week = dm.weeksInYear() + 1;
661 }
662- if (dayOfWeek === 0) {
663+ if (dayOfWeek === 0) { // sunday shift back
664 return week - 1;
665 }
666 return week;
667@@ -299,7 +299,7 @@ var WEEKNUM = function (date, shiftType) {
668 if (dm.weekYear() !== dm.year()) {
669 week = dm.weeksInYear() + 1;
670 }
671- if (dayOfWeek <= 1) {
672+ if (dayOfWeek <= 1) { // sunday, monday shift back
673 return week - 1;
674 }
675 return week;
676@@ -308,7 +308,7 @@ var WEEKNUM = function (date, shiftType) {
677 if (dm.weekYear() !== dm.year()) {
678 week = dm.weeksInYear() + 1;
679 }
680- if (dayOfWeek <= 2) {
681+ if (dayOfWeek <= 2) { // sunday, monday, tuesday shift back
682 return week - 1;
683 }
684 return week;
685diff --git a/dist/Formulas/Engineering.d.ts b/dist/Formulas/Engineering.d.ts
686new file mode 100644
687index 0000000..4ff6133
688--- /dev/null
689+++ b/dist/Formulas/Engineering.d.ts
690@@ -0,0 +1,73 @@
691+/**
692+ * Converts a signed binary number to decimal format.
693+ * @param signedBinaryNumber - The signed 10-bit binary value to be converted to decimal, provided as a
694+ * string. The most significant bit of signed_binary_number is the sign bit; that is, negative numbers are represented
695+ * in two's complement format.
696+ * @returns {number}
697+ * @constructor
698+ */
699+declare let BIN2DEC: (signedBinaryNumber: any) => number;
700+/**
701+ * Converts a signed binary number to signed hexadecimal format.
702+ * @param signedBinaryNumber - The signed 10-bit binary value to be converted to signed hexadecimal,
703+ * provided as a string. The most significant bit of signed_binary_number is the sign bit; that is, negative numbers are
704+ * represented in two's complement format.
705+ * @param significantDigits - [ OPTIONAL ] - The number of significant digits to ensure in the result.
706+ * @returns {string} string representation of a signed hexadecimal
707+ * @constructor
708+ */
709+declare let BIN2HEX: (signedBinaryNumber: any, significantDigits?: any) => string;
710+/**
711+ * Converts a signed binary number to signed octal format.
712+ * @param signedBinaryNumber - The signed 10-bit binary value to be converted to signed octal, provided as a
713+ * string. The most significant bit of signed_binary_number is the sign bit; that is, negative numbers are represented
714+ * in two's complement format.
715+ * @param significantDigits - [ OPTIONAL ] - The number of significant digits to ensure in the result. If
716+ * this is greater than the number of significant digits in the result, the result is left-padded with zeros until the
717+ * total number of digits reaches significant_digits.
718+ * @returns {string} number in octal format
719+ * @constructor
720+ */
721+declare let BIN2OCT: (signedBinaryNumber: any, significantDigits?: any) => string;
722+/**
723+ * Converts a decimal number to signed octal format.
724+ * @param decimalDumber - The decimal value to be converted to signed octal,provided as a string. For this
725+ * function, this value has a maximum of 536870911 if positive, and a minimum of -53687092 if negative.
726+ * @param significantDigits - [ OPTIONAL ] The number of significant digits to ensure in the result. If this
727+ * is greater than the number of significant digits in the result, the result is left-padded with zeros until the total
728+ * number of digits reaches significant_digits.
729+ * @returns {string} octal string representation of the decimal number
730+ * @constructor
731+ */
732+declare let DEC2OCT: (decimalDumber: any, significantDigits?: any) => string;
733+/**
734+ * Converts a decimal number to signed hexadecimal format.
735+ * @param decimalDumber - The decimal value to be converted to signed hexadecimal, provided as a string. This
736+ * value has a maximum of 549755813887 if positive, and a minimum of -549755814888 if negative.
737+ * @param significantDigits - [ OPTIONAL ] - The number of significant digits to ensure in the result. If
738+ * this is greater than the number of significant digits in the result, the result is left-padded with zeros until the
739+ * total number of digits reaches significant_digits. This value is ignored if decimal_number is negative.
740+ * @returns {string} hexadecimal string representation of the decimal number
741+ * @constructor
742+ */
743+declare let DEC2HEX: (decimalDumber: any, significantDigits?: any) => string;
744+/**
745+ * Converts a decimal number to signed binary format.
746+ * @param decimalDumber - The decimal value to be converted to signed binary, provided as a string. For this
747+ * function, this value has a maximum of 511 if positive, and a minimum of -512 if negative.
748+ * @param significantDigits - [ OPTIONAL ] The number of significant digits to ensure in the result. If this
749+ * is greater than the number of significant digits in the result, the result is left-padded with zeros until the total
750+ * number of digits reaches significant_digits.
751+ * @returns {string} signed binary string representation of the input decimal number.
752+ * @constructor
753+ */
754+declare let DEC2BIN: (decimalDumber: any, significantDigits?: any) => string;
755+/**
756+ * Compare two numeric values, returning 1 if they're equal.
757+ * @param one - The first number to compare.
758+ * @param two - The second number to compare.
759+ * @returns {number} 1 if they're equal, 0 if they're not equal.
760+ * @constructor
761+ */
762+declare let DELTA: (one: any, two?: any) => number;
763+export { BIN2DEC, BIN2HEX, BIN2OCT, DEC2BIN, DEC2HEX, DEC2OCT, DELTA };
764diff --git a/dist/Formulas/Financial.d.ts b/dist/Formulas/Financial.d.ts
765new file mode 100644
766index 0000000..f8c4d56
767--- /dev/null
768+++ b/dist/Formulas/Financial.d.ts
769@@ -0,0 +1,263 @@
770+/**
771+ * Calculates the depreciation of an asset for a specified period using the double-declining balance method.
772+ * @param cost - The initial cost of the asset.
773+ * @param salvage - The value of the asset at the end of depreciation.
774+ * @param life - The number of periods over which the asset is depreciated.
775+ * @param period - The single period within life for which to calculate depreciation.
776+ * @param factor - [ OPTIONAL - 2 by default ] - The factor by which depreciation decreases.
777+ * @returns {number} depreciation of an asset for a specified period
778+ * @constructor
779+ */
780+declare let DDB: (cost: any, salvage: any, life: any, period: any, factor?: any) => number;
781+/**
782+ * Calculates the depreciation of an asset for a specified period using the arithmetic declining balance method.
783+ * @param cost - The initial cost of the asset.
784+ * @param salvage - The value of the asset at the end of depreciation.
785+ * @param life - The number of periods over which the asset is depreciated.
786+ * @param period - The single period within life for which to calculate depreciation.
787+ * @param month - [ OPTIONAL - 12 by default ] - The number of months in the first year of depreciation.
788+ * @returns {number} depreciated value
789+ * @constructor
790+ */
791+declare let DB: (cost: any, salvage: any, life: any, period: any, month: any) => number;
792+/**
793+ * Formats a number into the locale-specific currency format. WARNING: Currently the equivalent of TRUNC, since this
794+ * returns numbers
795+ * @param number - The value to be formatted.
796+ * @param places - [ OPTIONAL - 2 by default ] - The number of decimal places to display.
797+ * @returns {number} dollars
798+ * @constructor
799+ */
800+declare let DOLLAR: (number: any, places?: any) => number;
801+/**
802+ * Converts a price quotation given as a decimal fraction into a decimal value.
803+ * @param fractionalPrice - The price quotation given using fractional decimal conventions.
804+ * @param unit - The units of the fraction, e.g. 8 for 1/8ths or 32 for 1/32nds.
805+ * @returns {number} decimal value.
806+ * @constructor
807+ */
808+declare let DOLLARDE: (fractionalPrice: any, unit: any) => number;
809+/**
810+ * Converts a price quotation given as a decimal value into a decimal fraction.
811+ * @param decimalPrice - The price quotation given as a decimal value.
812+ * @param unit - The units of the desired fraction, e.g. 8 for 1/8ths or 32 for 1/32nds
813+ * @returns {number} price quotation as decimal fraction.
814+ * @constructor
815+ */
816+declare let DOLLARFR: (decimalPrice: any, unit: any) => number;
817+/**
818+ * Calculates the annual effective interest rate given the nominal rate and number of compounding periods per year.
819+ * @param nominalRate - The nominal interest rate per year.
820+ * @param periodsPerYear - The number of compounding periods per year.
821+ * @returns {number} annual effective interest rate
822+ * @constructor
823+ */
824+declare let EFFECT: (nominalRate: any, periodsPerYear: any) => number;
825+/**
826+ * Calculates the periodic payment for an annuity investment based on constant-amount periodic payments and a constant
827+ * interest rate.
828+ * @param rate - The interest rate.
829+ * @param periods - The number of payments to be made.
830+ * @param presentValue - The current value of the annuity.
831+ * @param futureValue [ OPTIONAL ] - The future value remaining after the final payment has been made.
832+ * @param endOrBeginning [ OPTIONAL - 0 by default ] - Whether payments are due at the end (0) or beginning (1) of each
833+ * period.
834+ * @returns {number}
835+ * @constructor
836+ */
837+declare let PMT: (rate: any, periods: any, presentValue: any, futureValue?: any, endOrBeginning?: any) => number;
838+/**
839+ * Returns the future value of an investment based on periodic, constant payments and a constant interest rate.
840+ * @param rate - The rate of periodic interest.
841+ * @param periods - The total number of periods.
842+ * @param payment - The annuity paid regularly per period
843+ * @param value - [OPTIONAL] - The present cash value of an investment.
844+ * @param type - [OPTIONAL] - Defines whether the payment is due at the beginning (1) or the end (0) of a period.
845+ * @returns {number}
846+ * @constructor
847+ */
848+declare let FV: (rate: any, periods: any, payment: any, value?: any, type?: any) => number;
849+/**
850+ * Calculates the cumulative principal paid over a range of payment periods for an investment based on constant-amount
851+ * periodic payments and a constant interest rate.
852+ * @param rate - The interest rate.
853+ * @param numberOfPeriods - The number of payments to be made.
854+ * @param presentValue - The current value of the annuity.
855+ * @param firstPeriod - The number of the payment period to begin the cumulative calculation. must be greater
856+ * than or equal to 1.
857+ * @param lastPeriod - The number of the payment period to end the cumulative calculation, must be greater
858+ * than first_period.
859+ * @param endOrBeginning - Whether payments are due at the end (0) or beginning (1) of each period
860+ * @returns {number} cumulative principal
861+ * @constructor
862+ */
863+declare let CUMPRINC: (rate: any, numberOfPeriods: any, presentValue: any, firstPeriod: any, lastPeriod: any, endOrBeginning: any) => number;
864+/**
865+ * Calculates the cumulative interest over a range of payment periods for an investment based on constant-amount
866+ * periodic payments and a constant interest rate.
867+ * @param rate - The interest rate.
868+ * @param numberOfPeriods - The number of payments to be made.
869+ * @param presentValue - The current value of the annuity.
870+ * @param firstPeriod - The number of the payment period to begin the cumulative calculation, must be greater
871+ * than or equal to 1.
872+ * @param lastPeriod - The number of the payment period to end the cumulative calculation, must be greater
873+ * than first_period.
874+ * @param endOrBeginning - Whether payments are due at the end (0) or beginning (1) of each period.
875+ * @returns {number} cumulative interest
876+ * @constructor
877+ */
878+declare let CUMIPMT: (rate: any, numberOfPeriods: any, presentValue: any, firstPeriod: any, lastPeriod: any, endOrBeginning: any) => number;
879+/**
880+ * Calculates the accrued interest of a security that has periodic payments.
881+ * WARNING: This function has been implemented to specifications as outlined in Google Spreadsheets, LibreOffice, and
882+ * OpenOffice. It functions much the same as MSExcel's ACCRINT, but there are several key differences. Below are links
883+ * to illustrate the differences. Please see the source code for more information on differences. Links: https://quant.stackexchange.com/questions/7040/whats-the-algorithm-behind-excels-accrint, https://support.office.com/en-us/article/ACCRINT-function-fe45d089-6722-4fb3-9379-e1f911d8dc74, https://quant.stackexchange.com/questions/7040/whats-the-algorithm-behind-excels-accrint, https://support.google.com/docs/answer/3093200 .
884+ * @param issue - The date the security was initially issued.
885+ * @param firstPayment - The first date interest will be paid.
886+ * @param settlement - The settlement date of the security, the date after issuance when the security is
887+ * delivered to the buyer. Is the maturity date of the security if it is held until maturity rather than sold.
888+ * @param rate - The annualized rate of interest.
889+ * @param redemption - The redemption amount per 100 face value, or par.
890+ * @param frequency - The number of coupon payments per year. For annual payments, frequency = 1; for
891+ * semiannual, frequency = 2; for quarterly, frequency = 4.
892+ * @param dayCountConvention - [ OPTIONAL - 0 by default ] - An indicator of what day count method to use.
893+ * 0 or omitted = US (NASD) 30/360, 1 = Actual/actual, 2 = Actual/360, 3 = Actual/365, 4 = European 30/360.
894+ * @returns {number}
895+ * @constructor
896+ * TODO: This function is based off of the open-source versions I was able to dig up online. We should implement a
897+ * TODO: second version that is closer to what MSExcel does and is named something like `ACCRINT.MS`.
898+ */
899+declare let ACCRINT: (issue: any, firstPayment: any, settlement: any, rate: any, redemption: any, frequency: any, dayCountConvention?: any) => number;
900+/**
901+ * Returns the arithmetic-declining depreciation rate. Use this function to calculate the depreciation amount for one
902+ * period of the total depreciation span of an object. Arithmetic declining depreciation reduces the depreciation amount
903+ * from period to period by a fixed sum.
904+ * @param cost - The initial cost of an asset.
905+ * @param salvage - the value of an asset after depreciation.
906+ * @param life - The period fixing the time span over which an asset is depreciated.
907+ * @param period - The period for which the depreciation is to be calculated.
908+ * @returns {number}
909+ * @constructor
910+ */
911+declare let SYD: (cost: any, salvage: any, life: any, period: any) => number;
912+/**
913+ * Returns the straight-line depreciation of an asset for one period. The amount of the depreciation is constant during
914+ * the depreciation period.
915+ * @param cost - The initial cost of the asset.
916+ * @param salvage - The value of an asset at the end of the depreciation.
917+ * @param life - The depreciation period determining the number of periods in the deprecation of the asset.
918+ * @returns {number}
919+ * @constructor
920+ */
921+declare let SLN: (cost: any, salvage: any, life: any) => number;
922+/**
923+ * Returns the net present value of an investment based on a series of periodic cash flows and a discount rate.
924+ * @param rate - The discount rate for a period.
925+ * @param values - The values representing deposits or withdrawals.
926+ * @returns {number}
927+ * @constructor
928+ * TODO: This function can return results that are prone to floating point precision errors.
929+ */
930+declare let NPV: (rate: any, ...values: any[]) => number;
931+/**
932+ * Returns the number of payment for an investment. Number is based on constant-amount payments made periodically and a
933+ * constant interest rate.
934+ * @param rate - The interest rate.
935+ * @param payment - The amount of each payment.
936+ * @param present - THe current value.
937+ * @param future - [OPTIONAL] - The future value remaining after the final payment has been made.
938+ * @param type [OPTIONAL 0 by default] - 1 indicates payments are due at the beginning of each period. 0 indicates
939+ * payments are due at the end of each period.
940+ * @returns {number}
941+ * @constructor
942+ */
943+declare let NPER: (rate: any, payment: any, present: any, future?: any, type?: any) => number;
944+/**
945+ * Calculates the yearly nominal interest rate, given the effective rate and the number of compounding periods per year.
946+ * @param rate - The effective interest rate.
947+ * @param periods - The number of periodic interest payments per year.
948+ * @returns {number}
949+ * @constructor
950+ */
951+declare let NOMINAL: (rate: any, periods: any) => number;
952+/**
953+ * Calculates the modified internal rate of return of a series of investments.
954+ * @param values - Range or values of payments. Ignores text values.
955+ * @param financeRate - The rate of interest of the investments.
956+ * @param reinvestRate - The rate of interest of the reinvestment.
957+ * @returns {number}
958+ * @constructor
959+ * TODO: This relies on NPV and will therefore be prone to floating-point errors.
960+ */
961+declare let MIRR: (values: any, financeRate: any, reinvestRate: any) => number;
962+/**
963+ * Calculates the internal rate of return for an investment. The values represent cash flow values at regular intervals;
964+ * at least one value must be negative (payments), and at least one value must be positive (income).
965+ *
966+ * Relevant StackOverflow discussion: https://stackoverflow.com/questions/15089151/javascript-irr-internal-rate-of-return-formula-accuracy
967+ *
968+ * @param values - Range containing values. Ignores text values.
969+ * @param guess - [OPTIONAL] - The estimated value. Defaults to 0.01.
970+ * @returns {number}
971+ * @constructor
972+ */
973+declare let IRR: (values: any, guess?: any) => any;
974+/**
975+ * Calculates the periodic amortization for an investment with regular payments and a constant interest rate.
976+ * @param rate - The periodic interest rate.
977+ * @param period - The period for which the compound interest is calculated.
978+ * @param periods - The total number of periods during which the annuity is paid.
979+ * @param present - The present cash value in sequence of payments.
980+ * @param future - [OPTIONAL] - The desired value (future value) at the end of the periods.
981+ * @param type - [OPTIONAL] - Defines whether the payment is due at the beginning (1) or the end (0) of a period.
982+ * @returns {number}
983+ * @constructor
984+ */
985+declare let IPMT: (rate: any, period: any, periods: any, present: any, future?: any, type?: any) => number;
986+/**
987+ * Returns for a given period the payment on the principal for an investment that is based on periodic and constant
988+ * payments and a constant interest rate.
989+ * @param rate - The periodic interest rate.
990+ * @param period - The amortization period.
991+ * @param periods - The total number of periods during which the annuity is paid.
992+ * @param present - The present value in the sequence of payments.
993+ * @param future - [OPTIONAL] - The desired future value. Defaults to 0.
994+ * @param type - [OPTIONAL] - Indicates how the year is to be calculated. 0 indicates payments are due at end of
995+ * period, 1 indicates payments are due at beginning of period. Defaults to 0.
996+ * @returns {number}
997+ * @constructor
998+ */
999+declare let PPMT: (rate: any, period: any, periods: any, present: any, future?: any, type?: any) => number;
1000+/**
1001+ * Calculates the accumulated value of the starting capital for a series of periodically varying interest rates.
1002+ * @param principal - The starting capital.
1003+ * @param rateSchedule - Range or Array that is a series of interest rates.
1004+ * @returns {number}
1005+ * @constructor
1006+ */
1007+declare let FVSCHEDULE: (principal: any, rateSchedule: any) => number;
1008+/**
1009+ * Returns the present value of an investment resulting from a series of regular payments.
1010+ * @param rate - The interest rate per period.
1011+ * @param periods - The total number of payment periods
1012+ * @param paymentPerPeriod - The regular payment made per period.
1013+ * @param future - [OPTIONAL defaults to 0] The future value remaining after the final installment has been made
1014+ * @param type - [OPTIONAL defaults to 0] Defines whether the payment is due at the beginning (1) or the end (0) of a
1015+ * period.
1016+ * @constructor
1017+ */
1018+declare let PV: (rate: any, periods: any, paymentPerPeriod: any, future?: any, type?: any) => number;
1019+/**
1020+ * Returns the constant interest rate per period of an annuity.
1021+ * @param periods - The total number of periods, during which payments are made (payment period).
1022+ * @param paymentPerPeriod - The constant payment (annuity) paid during each period.
1023+ * @param presentValue - The cash value in the sequence of payments
1024+ * @param futureValue - [OPTIONAL defaults to 0] The future value, which is reached at the end of the periodic payments.
1025+ * @param beginningOrEnd - [OPTIONAL defaults to 0] Defines whether the payment is due at the beginning (1) or the end
1026+ * (0) of a period.
1027+ * @param guessRate - [OPTIONAL] - Determines the estimated value of the interest with iterative
1028+ * calculation.
1029+ * @constructor
1030+ */
1031+declare let RATE: (periods: any, paymentPerPeriod: any, presentValue: any, futureValue?: any, beginningOrEnd?: any, guessRate?: any) => any;
1032+export { ACCRINT, CUMPRINC, CUMIPMT, DB, DDB, DOLLAR, DOLLARDE, DOLLARFR, EFFECT, PMT, SYD, SLN, NPV, NPER, NOMINAL, MIRR, IRR, IPMT, FV, PPMT, FVSCHEDULE, PV, RATE };
1033diff --git a/dist/Formulas/Info.d.ts b/dist/Formulas/Info.d.ts
1034new file mode 100644
1035index 0000000..48d6c5c
1036--- /dev/null
1037+++ b/dist/Formulas/Info.d.ts
1038@@ -0,0 +1,142 @@
1039+/**
1040+ * Returns the "value not available" error, "#N/A".
1041+ * @constructor
1042+ */
1043+declare let NA: () => never;
1044+/**
1045+ * Returns true if a value is text.
1046+ * @param value - value or reference to check.
1047+ * @returns {boolean}.
1048+ * @constructor
1049+ */
1050+declare let ISTEXT: (value: any) => boolean;
1051+/**
1052+ * Returns true if a value is not text.
1053+ * @param value - value or reference to check.
1054+ * @returns {boolean}.
1055+ * @constructor
1056+ */
1057+declare let ISNONTEXT: (value: any) => boolean;
1058+/**
1059+ * Returns true if value is a boolean (FALSE, or TRUE). Numerical and text values return false.
1060+ * @param value - value or reference to check.
1061+ * @returns {boolean}
1062+ * @constructor
1063+ */
1064+declare let ISLOGICAL: (value: any) => boolean;
1065+/**
1066+ * Returns true if value or reference is a number.
1067+ * @param value - value or reference to check.
1068+ * @returns {boolean}
1069+ * @constructor
1070+ */
1071+declare let ISNUMBER: (value: any) => boolean;
1072+/**
1073+ * Returns true if input is a valid email. Valid domains are Original top-level domains and Country code top-level
1074+ * domains.
1075+ * @param value - Value to check whether it is an email or not.
1076+ * @returns {boolean}
1077+ * @constructor
1078+ */
1079+declare let ISEMAIL: (value: any) => boolean;
1080+/**
1081+ * Returns true if the input is a valid URL.
1082+ * @param value - Value to check
1083+ * @returns {boolean}
1084+ * @constructor
1085+ */
1086+declare let ISURL: (value: any) => boolean;
1087+/**
1088+ * Returns the value as a number.
1089+ * @param value - value to return.
1090+ * @returns {number}
1091+ * @constructor
1092+ */
1093+declare let N: (value: any) => number;
1094+/**
1095+ * Tests if the content of one or several cells is a reference. Verifies the type of references in a cell or a range of
1096+ * cells. If an error occurs, the function returns a logical or numerical value.
1097+ * @param value - The value to be tested, to determine whether it is a reference.
1098+ * @returns {boolean}
1099+ * @constructor
1100+ */
1101+declare let ISREF: (value: any) => boolean;
1102+/**
1103+ * Returns the number corresponding to an error value occurring in a different cell. With the aid of this number, an
1104+ * error message text can be generated. If an error occurs, the function returns a logical or numerical value.
1105+ * @param value - Contains either the address/reference of the cell in which the error occurs, or the error directly.
1106+ * Eg: `=ERRORTYPE(NA())`
1107+ * @constructor
1108+ */
1109+declare let ERRORTYPE: (value: any) => 1 | 2 | 6 | 7 | 8 | 3 | 5 | 4;
1110+/**
1111+ * Returns TRUE if the reference to a cell is blank. This function is used to determine if the content of a cell is
1112+ * empty. A cell with a formula inside is not empty. If an error occurs, the function returns a logical or numerical
1113+ * value.
1114+ * @param value - The content to be tested.
1115+ * @returns {boolean}
1116+ * @constructor
1117+ */
1118+declare let ISBLANK: (value: any) => boolean;
1119+/**
1120+ * Returns TRUE if the value refers to any error value except #N/A. You can use this function to control error values
1121+ * in certain cells. If an error occurs, the function returns a logical or numerical value.
1122+ * @param value - Any value or expression in which a test is performed to determine whether an error value not equal to
1123+ * #N/A is present.
1124+ * @returns {boolean}
1125+ * @constructor
1126+ */
1127+declare let ISERR: (value: any) => boolean;
1128+/**
1129+ * Tests if the cells contain general error values. ISERROR recognizes the #N/A error value. If an error occurs, the
1130+ * function returns a logical or numerical value.
1131+ * @param value - is any value where a test is performed to determine whether it is an error value.
1132+ * @returns {boolean}
1133+ * @constructor
1134+ */
1135+declare let ISERROR: (value: any) => boolean;
1136+/**
1137+ * Returns TRUE if a cell contains the #N/A (value not available) error value. If an error occurs, the function returns
1138+ * a logical or numerical value.
1139+ * @param value - The value or expression to be tested.
1140+ * @returns {boolean}
1141+ * @constructor
1142+ */
1143+declare let ISNA: (value: any) => boolean;
1144+/**
1145+ * Returns the first argument if no error value is present, otherwise returns the second argument if provided, or a
1146+ * blank if the second argument is absent. Blank value is `null`.
1147+ * @param value - Value to check for error.
1148+ * @param valueIfError - [OPTIONAL] - Value to return if no error is present in the first argument.
1149+ * @returns {any}
1150+ * @constructor
1151+ */
1152+declare let IFERROR: (value: any, valueIfError?: any) => any;
1153+/**
1154+ * Returns a number corresponding to the type of data passed into the function. 1 = number, 2 = text, 4 = boolean,
1155+ * 16 = error, 64 = array/range, 128 = any other type of cell.
1156+ * @param value - Value for which the type will be determined.
1157+ * @returns {number}
1158+ * @constructor
1159+ */
1160+declare let TYPE: (value: any) => 1 | 2 | 16 | 4 | 64 | 128;
1161+/**
1162+ * Returns the column number of a specified cell, starting with column 1 for A.
1163+ * @param cell - Cell, defaults to the cell calling this formula, when used in the context of a spreadsheet.
1164+ * @constructor
1165+ */
1166+declare let COLUMN: (cell: any) => number;
1167+/**
1168+ * Returns the row number of a specified cell, starting with row 1 for A1.
1169+ * @param cell - Cell, defaults to the cell calling this formula, when used in the context of a spreadsheet.
1170+ * @constructor
1171+ */
1172+declare let ROW: (cell: any) => number;
1173+/**
1174+ * Returns TRUE if a cell is a formula cell. Must be given a reference.
1175+ * @param value - To check.
1176+ * @returns {boolean}
1177+ * @constructor
1178+ */
1179+declare let ISFORMULA: (value: any) => boolean;
1180+export { NA, ISTEXT, ISLOGICAL, ISNUMBER, ISNONTEXT, ISEMAIL, ISURL, N, ISREF, ERRORTYPE, ISBLANK, ISERR, ISERROR, ISNA, IFERROR, TYPE, COLUMN, ROW, ISFORMULA };
1181diff --git a/dist/Formulas/Logical.d.ts b/dist/Formulas/Logical.d.ts
1182new file mode 100644
1183index 0000000..f9c99dd
1184--- /dev/null
1185+++ b/dist/Formulas/Logical.d.ts
1186@@ -0,0 +1,53 @@
1187+/**
1188+ * Returns true if all of the provided arguments are logically true, and false if any of the provided arguments are
1189+ * logically false.
1190+ * @param values At least one expression or reference to a cell containing an expression that represents some logical
1191+ * value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.
1192+ * @returns {boolean} if all values are logically true.
1193+ * @constructor
1194+ */
1195+declare let AND: (...values: any[]) => boolean;
1196+/**
1197+ * Tests whether two strings are identical, returning true if they are.
1198+ * @param one - The first string to compare
1199+ * @param two - The second string to compare
1200+ * @returns {boolean}
1201+ * @constructor
1202+ */
1203+declare let EXACT: (one: any, two: any) => boolean;
1204+/**
1205+ * Returns true.
1206+ * @returns {boolean} true boolean
1207+ * @constructor
1208+ */
1209+declare let TRUE: () => boolean;
1210+/**
1211+ * Returns false.
1212+ * @returns {boolean} false boolean
1213+ * @constructor
1214+ */
1215+declare let FALSE: () => boolean;
1216+/**
1217+ * Returns the opposite of a logical value - NOT(TRUE) returns FALSE; NOT(FALSE) returns TRUE.
1218+ * @param value - An expression or reference to a cell holding an expression that represents some logical value.
1219+ * @returns {boolean} opposite of a logical value input
1220+ * @constructor
1221+ */
1222+declare let NOT: (value: any) => boolean;
1223+/**
1224+ * Returns true if any of the provided arguments are logically true, and false if all of the provided arguments are
1225+ * logically false.
1226+ * @param values An expression or reference to a cell containing an expression that represents some logical value, i.e.
1227+ * TRUE or FALSE, or an expression that can be coerced to a logical value.
1228+ * @returns {boolean}
1229+ * @constructor
1230+ */
1231+declare let OR: (...values: any[]) => boolean;
1232+/**
1233+ * Exclusive or or exclusive disjunction is a logical operation that outputs true only when inputs differ.
1234+ * @param values to check for exclusivity.
1235+ * @returns {boolean} returns true if only one input is considered logically true.
1236+ * @constructor
1237+ */
1238+declare let XOR: (...values: any[]) => boolean;
1239+export { AND, EXACT, TRUE, FALSE, NOT, OR, XOR };
1240diff --git a/dist/Formulas/Lookup.d.ts b/dist/Formulas/Lookup.d.ts
1241new file mode 100644
1242index 0000000..fed5789
1243--- /dev/null
1244+++ b/dist/Formulas/Lookup.d.ts
1245@@ -0,0 +1,29 @@
1246+/**
1247+ * Returns an element from a list of choices based on index.
1248+ * @param index - Which choice to return. Index starts at 1.
1249+ * @param values - Array of potential value to return. Required. May be a reference to a cell or an individual value.
1250+ * @constructor
1251+ */
1252+declare let CHOOSE: (index: any, ...values: any[]) => any;
1253+/**
1254+ * Returns a text representation of a cell address based on the row, column, and sheet.
1255+ * @param row - Row of cell address.
1256+ * @param column - Column of cell address
1257+ * @param {number} absoluteVsRelativeMode - [OPTIONAL - default is 1] Should return a relative(A1, vs $A$1) or absolute address. 1 is row and
1258+ * column absolute (e.g. $A$1), 2 is row absolute and column relative (e.g. A$1), 3 is row relative and column absolute
1259+ * (e.g. $A1), 4 is row and column relative (e.g. A1).
1260+ * @param {boolean} useA1Notation - [OPTIONAL - default is TRUE] Should use A1 notation.
1261+ * @param sheet - [OPTIONAL] Sheet name to use in address.
1262+ * @returns {string}
1263+ * @constructor
1264+ */
1265+declare let ADDRESS: (row: any, column: any, absoluteVsRelativeMode?: number, useA1Notation?: boolean, sheet?: any) => string;
1266+/**
1267+ * Gets the number of columns in a specified array or range.
1268+ * @param value - The array of range to consider.
1269+ * @returns {number}
1270+ * @constructor
1271+ */
1272+declare let COLUMNS: (value: any) => number;
1273+declare let ROWS: (value: any) => number;
1274+export { CHOOSE, ADDRESS, COLUMNS, ROWS };
1275diff --git a/dist/Formulas/Math.d.ts b/dist/Formulas/Math.d.ts
1276new file mode 100644
1277index 0000000..f025f31
1278--- /dev/null
1279+++ b/dist/Formulas/Math.d.ts
1280@@ -0,0 +1,590 @@
1281+/**
1282+ * Returns the greatest common divisor of one or more integers.
1283+ * @param values - The values or ranges whose factors to consider in a calculation to find the greatest common divisor.
1284+ * @returns {number} greatest common divisor.
1285+ * @constructor
1286+ */
1287+declare let GCD: (...values: any[]) => any;
1288+/**
1289+ * Returns the least common multiple of one or more integers.
1290+ * @param values - The values or range whose factors to consider in a calculation to find the least common multiple.
1291+ * @returns {number}
1292+ * @constructor
1293+ */
1294+declare let LCM: (...values: any[]) => number;
1295+/**
1296+ * Returns the the logarithm of a specified Gamma function, base e (Euler's number).
1297+ * @param value - The input number. The natural logarithm of Gamma (value) will be returned. Must be positive.
1298+ * @returns {number}
1299+ * @constructor
1300+ */
1301+declare let GAMMALN: (value: any) => number;
1302+/**
1303+ * Returns the absolute value of a number.
1304+ * @param value to get the absolute value of.
1305+ * @returns {number} absolute value
1306+ * @constructor
1307+ */
1308+declare let ABS: (value: any) => number;
1309+/**
1310+ * Returns the inverse cosine of a value, in radians.
1311+ * @param value The value for which to calculate the inverse cosine. Must be between -1 and 1, inclusive.
1312+ * @returns {number} inverse cosine of value
1313+ * @constructor
1314+ */
1315+declare let ACOS: (value: any) => number;
1316+/**
1317+ * Returns the inverse hyperbolic cosine of a number.
1318+ * @param value The value for which to calculate the inverse hyperbolic cosine. Must be greater than or equal to 1.
1319+ * @returns {number} to find the inverse hyperbolic cosine for.
1320+ * @constructor
1321+ */
1322+declare let ACOSH: (value: any) => number;
1323+/**
1324+ * Calculate the hyperbolic arc-cotangent of a value
1325+ * @param value number not between -1 and 1 inclusively.
1326+ * @returns {number} hyperbolic arc-cotangent
1327+ * @constructor
1328+ */
1329+declare let ACOTH: (value: any) => number;
1330+/**
1331+ * Returns the inverse sine of a value, in radians.
1332+ * @param value The value for which to calculate the inverse sine. Must be between -1 and 1, inclusive.
1333+ * @returns {number} inverse sine of input value
1334+ * @constructor
1335+ */
1336+declare let ASIN: (value: any) => number;
1337+/**
1338+ * Returns the inverse hyperbolic sine of a number.
1339+ * @param value The value for which to calculate the inverse hyperbolic sine.
1340+ * @returns {number} inverse hyperbolic sine of input
1341+ * @constructor
1342+ */
1343+declare let ASINH: (value: any) => number;
1344+/**
1345+ * Returns the inverse tangent of a value, in radians.
1346+ * @param value The value for which to calculate the inverse tangent.
1347+ * @returns {number} inverse tangent of input value
1348+ * @constructor
1349+ */
1350+declare let ATAN: (value: any) => number;
1351+/**
1352+ * Returns the angle between the x-axis and a line segment from the origin (0,0) to specified coordinate pair (x,y), in radians.
1353+ * @param x The x coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.
1354+ * @param y The y coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.
1355+ * @returns {number} angle in radians
1356+ * @constructor
1357+ */
1358+declare let ATAN2: (x: any, y: any) => number;
1359+/**
1360+ * Returns the inverse hyperbolic tangent of a number.
1361+ * @param value The value for which to calculate the inverse hyperbolic tangent. Must be between -1 and 1, exclusive.
1362+ * @returns {number} inverse hyperbolic tangent of input
1363+ * @constructor
1364+ */
1365+declare let ATANH: (value: any) => number;
1366+/**
1367+ * Rounds a number up to the nearest even integer.
1368+ * @param value The value to round to the next greatest even number.
1369+ * @returns {number} next greatest even number
1370+ * @constructor
1371+ */
1372+declare let EVEN: (value: any) => number;
1373+/**
1374+ * Returns the result of the modulo operator, the remainder after a division operation.
1375+ * @param dividend The number to be divided to find the remainder.
1376+ * @param divisor The number to divide by.
1377+ * @returns {number}
1378+ * @constructor
1379+ */
1380+declare let MOD: (dividend: any, divisor: any) => number;
1381+/**
1382+ * Rounds a number up to the nearest odd integer.
1383+ * @param value The value to round to the next greatest odd number.
1384+ * @returns {number} value to round up to next greatest odd number.
1385+ * @constructor
1386+ */
1387+declare let ODD: (value: any) => number;
1388+/**
1389+ * Returns a number raised to a power.
1390+ * @param base - The number to raise to the exponent power.
1391+ * @param exponent - The exponent to raise base to.
1392+ * @returns {number} resulting number
1393+ * @constructor
1394+ */
1395+declare let POWER: (base: any, exponent: any) => number;
1396+/**
1397+ * Returns the sum of a series of numbers and/or cells.
1398+ * @param values The first number or range to add together.
1399+ * @returns {number} The sum of the series
1400+ * @constructor
1401+ */
1402+declare let SUM: (...values: any[]) => number;
1403+/**
1404+ * Returns the positive square root of a positive number.
1405+ * @param value - The number for which to calculate the positive square root.
1406+ * @returns {number} square root
1407+ * @constructor
1408+ */
1409+declare let SQRT: (value: any) => number;
1410+/**
1411+ * Returns the positive square root of the product of Pi and the given positive number.
1412+ * @param value - The number which will be multiplied by Pi and have the product's square root returned
1413+ * @returns {number} the positive square root of the product of Pi and the given positive number.
1414+ * @constructor
1415+ */
1416+declare let SQRTPI: (value: any) => number;
1417+/**
1418+ * Returns the cosine of an angle provided in radians.
1419+ * @param value - The angle to find the cosine of, in radians.
1420+ * @returns {number} cosine of angle
1421+ * @constructor
1422+ */
1423+declare let COS: (value: any) => number;
1424+/**
1425+ * Returns the hyperbolic cosine of any real number.
1426+ * @param value - Any real value to calculate the hyperbolic cosine of.
1427+ * @returns {number} the hyperbolic cosine of the input
1428+ * @constructor
1429+ */
1430+declare let COSH: (value: any) => number;
1431+/**
1432+ * Returns the cotangent of any real number. Defined as cot(x) = 1 / tan(x).
1433+ * @param value - number to calculate the cotangent for
1434+ * @returns {number} cotangent
1435+ * @constructor
1436+ */
1437+declare let COT: (value: any) => number;
1438+/**
1439+ * Return the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x).
1440+ * @param value - value to calculate the hyperbolic cotangent value of
1441+ * @returns {number} hyperbolic cotangent
1442+ * @constructor
1443+ */
1444+declare let COTH: (value: any) => number;
1445+/**
1446+ * Rounds a number down to the nearest integer that is less than or equal to it.
1447+ * @param value - The value to round down to the nearest integer.
1448+ * @returns {number} Rounded number
1449+ * @constructor
1450+ */
1451+declare let INT: (value: any) => number;
1452+/**
1453+ * Checks whether the provided value is even.
1454+ * @param value - The value to be verified as even.
1455+ * @returns {boolean} whether this value is even or not
1456+ * @constructor
1457+ */
1458+declare let ISEVEN: (value: any) => boolean;
1459+/**
1460+ * Checks whether the provided value is odd.
1461+ * @param value - The value to be verified as odd.
1462+ * @returns {boolean} whether this value is odd or not
1463+ * @constructor
1464+ */
1465+declare let ISODD: (value: any) => boolean;
1466+/**
1467+ * Returns the sine of an angle provided in radians.
1468+ * @param value - The angle to find the sine of, in radians.
1469+ * @returns {number} Sine of angle.
1470+ * @constructor
1471+ */
1472+declare let SIN: (value: any) => number;
1473+/**
1474+ * Returns the hyperbolic sine of any real number.
1475+ * @param value - real number to find the hyperbolic sine of
1476+ * @returns {number} hyperbolic sine
1477+ * @constructor
1478+ */
1479+declare let SINH: (value: any) => number;
1480+/**
1481+ * The value Pi.
1482+ * @returns {number} Pi.
1483+ * @constructor
1484+ */
1485+declare let PI: () => number;
1486+/**
1487+ * Returns the the logarithm of a number, base 10.
1488+ * @param value - The value for which to calculate the logarithm, base 10.
1489+ * @returns {number} logarithm of the number, in base 10.
1490+ * @constructor
1491+ */
1492+declare let LOG10: (value: any) => number;
1493+/**
1494+ * Returns the the logarithm of a number given a base.
1495+ * @param value - The value for which to calculate the logarithm given base.
1496+ * @param base - The base to use for calculation of the logarithm. Defaults to 10.
1497+ * @returns {number}
1498+ * @constructor
1499+ */
1500+declare let LOG: (value: any, base: any) => number;
1501+/**
1502+ * Returns the logarithm of a number, base e (Euler's number).
1503+ * @param value - The value for which to calculate the logarithm, base e.
1504+ * @returns {number} logarithm calculated
1505+ * @constructor
1506+ */
1507+declare let LN: (value: any) => number;
1508+/**
1509+ * Returns the tangent of an angle provided in radians.
1510+ * @param value - The angle to find the tangent of, in radians.
1511+ * @returns {number} tangent in radians
1512+ * @constructor
1513+ */
1514+declare let TAN: (value: any) => number;
1515+/**
1516+ * Returns the hyperbolic tangent of any real number.
1517+ * @param value - Any real value to calculate the hyperbolic tangent of.
1518+ * @returns {number} hyperbolic tangent
1519+ * @constructor
1520+ */
1521+declare let TANH: (value: any) => number;
1522+/**
1523+ * Rounds a number up to the nearest integer multiple of specified significance.
1524+ * @param value The value to round up to the nearest integer multiple of factor.
1525+ * @param factor - [ OPTIONAL ] The number to whose multiples value will be rounded.
1526+ * @returns {number}
1527+ * @constructor
1528+ */
1529+declare let CEILING: (value: any, factor?: any) => number;
1530+/**
1531+ * Rounds a number down to the nearest integer multiple of specified significance.
1532+ * @param value - The value to round down to the nearest integer multiple of factor.
1533+ * @param factor - The number to whose multiples value will be rounded.
1534+ * @returns {number}
1535+ * @constructor
1536+ */
1537+declare let FLOOR: (value: any, factor?: any) => number;
1538+/**
1539+ * Returns one value if a logical expression is TRUE and another if it is FALSE.
1540+ * @param logicalExpression - An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE.
1541+ * @param valueIfTrue - The value the function returns if logical_expression is TRUE
1542+ * @param valueIfFalse - The value the function returns if logical_expression is FALSE.
1543+ * @returns one value if a logical expression is TRUE and another if it is FALSE.
1544+ * @constructor
1545+ */
1546+declare let IF: (logicalExpression: any, valueIfTrue: any, valueIfFalse: any) => any;
1547+/**
1548+ * Returns a conditional count across a range.
1549+ * @param range - The range that is tested against criterion., value[1];
1550+ * @param criteria - The pattern or test to apply to range. If the range to check against contains text,
1551+ * this must be a string. It can be a comparison based string (e.g. "=1", "<1", ">=1") or it can be a wild-card string,
1552+ * in which * matches any number of characters, and ? matches the next character. Both ? and * can be escaped by placing
1553+ * a ~ in front of them. If it is neither, it will compared with values in the range using equality comparison.
1554+ * @returns {number}
1555+ * @constructor
1556+ */
1557+declare let COUNTIF: (range: any, criteria: any) => number;
1558+/**
1559+ * Returns the count of a range depending on multiple criteria.
1560+ * @param values[0] criteria_range1 - The range to check against criterion1.
1561+ * @param values[1] criterion1 - The pattern or test to apply to criteria_range1.
1562+ * @param values[2...N] Repeated sets of ranges and criterion to check.
1563+ * @returns {number} count
1564+ * @constructor
1565+ */
1566+declare let COUNTIFS: (...values: any[]) => number;
1567+/**
1568+ * Rounds a number to a certain number of decimal places according to standard rules.
1569+ * @param value - The value to round to places number of places.
1570+ * @param places - The number of decimal places to which to round.
1571+ * @returns {number}
1572+ * @constructor
1573+ */
1574+declare let ROUND: (value: any, places: any) => number;
1575+/**
1576+ * Rounds a number to a certain number of decimal places, always rounding down to the next valid increment.
1577+ * @param value - The value to round to places number of places, always rounding down.
1578+ * @param places - (optional) The number of decimal places to which to round.
1579+ * @returns {number}
1580+ * @constructor
1581+ */
1582+declare let ROUNDDOWN: (value: any, places?: any) => number;
1583+/**
1584+ * Rounds a number to a certain number of decimal places, always rounding up to the next valid increment.
1585+ * @param value - The value to round to places number of places, always rounding up.
1586+ * @param places - (optional) The number of decimal places to which to round.
1587+ * @returns {number}
1588+ * @constructor
1589+ */
1590+declare let ROUNDUP: (value: any, places?: any) => number;
1591+/**
1592+ * Returns a conditional sum across a range.
1593+ * @param range - The range which is tested against criterion.
1594+ * @param criteria - The pattern or test to apply to range. If the range to check against contains text, this must be a
1595+ * string. It can be a comparison based string (e.g. "=1", "<1", ">=1") or it can be a wild-card string, in which *
1596+ * matches any number of characters, and ? matches the next character. Both ? and * can be escaped by placing a ~ in
1597+ * front of them.
1598+ * @param sumRange - (optional) The range to be summed, if different from range.
1599+ * @returns {number}
1600+ * @constructor
1601+ */
1602+declare let SUMIF: (range: any, criteria: any, sumRange?: any) => number;
1603+/**
1604+ * Returns the sum of the squares of a series of numbers and/or cells.
1605+ * @param values The values or range(s) whose squares to add together.
1606+ * @returns {number} the sum of the squares if the input.
1607+ * @constructor
1608+ */
1609+declare let SUMSQ: (...values: any[]) => number;
1610+/**
1611+ * Returns the product of two numbers. Equivalent to the `*` operator.
1612+ * @param factor1 - The first multiplicand.
1613+ * @param factor2 - The second multiplicand.
1614+ * @constructor
1615+ */
1616+declare let MULTIPLY: (factor1: any, factor2: any) => number;
1617+/**
1618+ * Returns the result of the first number minus the second number. Equivalent to the `-` operator.
1619+ * @param one - The first number.
1620+ * @param two - the second number.
1621+ * @returns {number}
1622+ * @constructor
1623+ */
1624+declare let MINUS: (one: any, two: any) => number;
1625+/**
1626+ * Returns true if two specified values are equal and true otherwise. Equivalent to the "=" operator.
1627+ * @param one - First value to check.
1628+ * @param two - Second value to check.
1629+ * @returns {boolean} true if values are equal, false if they are not equal.
1630+ * @constructor
1631+ */
1632+declare let EQ: (one: any, two: any) => boolean;
1633+/**
1634+ * Returns true if the first argument is strictly greater than the second, and false otherwise. Equivalent to the `>`
1635+ * operator.
1636+ * @param one - The value to test as being greater than `two`.
1637+ * @param two - The second value.
1638+ * @returns {boolean}
1639+ * @constructor
1640+ */
1641+declare let GT: (one: any, two: any) => boolean;
1642+/**
1643+ * Returns true if the first argument is greater than or equal to the second, and false otherwise. Equivalent to the
1644+ * `>=` operator.
1645+ * @param one - The value to test as being greater than or equal to `two`.
1646+ * @param two -The second value.
1647+ * @returns {boolean}
1648+ * @constructor
1649+ */
1650+declare let GTE: (one: any, two: any) => boolean;
1651+/**
1652+ * Returns true if the first argument is strictly less than the second, and false otherwise. Equivalent to the `<`
1653+ * operator.
1654+ * @param one - The value to test as being less than `two`.
1655+ * @param two - The second value.
1656+ * @returns {boolean}
1657+ * @constructor
1658+ */
1659+declare let LT: (one: any, two: any) => boolean;
1660+/**
1661+ * Returns true if the first argument is less than or equal to the second, and true otherwise. Equivalent to the
1662+ * `<=` operator.
1663+ * @param one - The value to test as being less than or equal to `two`.
1664+ * @param two - The second value.
1665+ * @constructor
1666+ */
1667+declare let LTE: (one: any, two: any) => boolean;
1668+/**
1669+ * Returns "TRUE" if two specified values are not equal and "FALSE" otherwise. Equivalent to the "<>" operator.
1670+ * @param one - The value to test as being not equal to `two`.
1671+ * @param two - The second valud.
1672+ * @returns {boolean}
1673+ * @constructor
1674+ */
1675+declare let NE: (one: any, two: any) => boolean;
1676+/**
1677+ * Returns one number divided by another. Equivalent to the `/` operator.
1678+ * @param dividend - The number to be divided.
1679+ * @param divisor - The number to divide by, cannot be 0.
1680+ * @returns {number} result of dividend / divisor.
1681+ * @constructor
1682+ */
1683+declare let DIVIDE: (dividend: any, divisor: any) => number;
1684+/**
1685+ * Returns a random number between 0 inclusive and 1 exclusive.
1686+ * @returns {number}
1687+ * @constructor
1688+ */
1689+declare let RAND: () => number;
1690+/**
1691+ * Returns a uniformly random integer between two values, inclusive on high and low. Values with decimal parts may be
1692+ * used for low and/or high; this will cause the least and greatest possible values to be the next integer greater than
1693+ * low and/or the next integer less than high, respectively.
1694+ * @param low - lowest value
1695+ * @param high - highest value
1696+ * @returns {number} between low and high.
1697+ * @constructor
1698+ */
1699+declare let RANDBETWEEN: (low: any, high: any) => number;
1700+/**
1701+ * Given an input number, returns `-1` if it is negative, `1` if positive, and `0` if it is zero.
1702+ * @param value - The value to check the sign for
1703+ * @returns {number} `-1` if it is negative, `1` if positive, and `0` if it is zero.
1704+ * @constructor
1705+ */
1706+declare let SIGN: (value: any) => 0 | 1 | -1;
1707+/**
1708+ * Truncates a number to a certain number of significant digits by omitting less significant digits.
1709+ * @param value - The value to be truncated.
1710+ * @param places - [ OPTIONAL - 0 by default ] - The number of significant digits to the right of the decimal point to
1711+ * retain. If places is greater than the number of significant digits in value, value is returned without modification.
1712+ * places may be negative, in which case the specified number of digits to the left of the decimal place are changed to
1713+ * zero. All digits to the right of the decimal place are discarded. If all digits of value are changed to zero, TRUNC
1714+ * simply returns 0.
1715+ * @returns {number} after truncation
1716+ * @constructor
1717+ */
1718+declare let TRUNC: (value: any, places?: any) => number;
1719+/**
1720+ * Converts an angle value in degrees to radians.
1721+ * @param angle - The angle to convert from degrees to radians.
1722+ * @returns {number} radians
1723+ * @constructor
1724+ */
1725+declare let RADIANS: (angle: any) => number;
1726+/**
1727+ * Converts an angle value in radians to degrees.
1728+ * @param angle - The angle to convert from radians to degrees.
1729+ * @returns {number} degrees
1730+ * @constructor
1731+ */
1732+declare let DEGREES: (angle: any) => number;
1733+/**
1734+ * Returns the complementary Gauss error function of a value.
1735+ * @param value - The number for which to calculate the complementary Gauss error function.
1736+ * @returns {number} complementary Gauss error function of a value
1737+ * @constructor
1738+ */
1739+declare let ERFC: (value: any) => number;
1740+/**
1741+ * Returns the error function integrated between lower_limit and upper_limit.
1742+ * @param lowerLimit - The lower bound for integrating ERF.
1743+ * @param upperLimit - [Optional]. The upper bound for integrating ERF. If omitted, ERF integrates between
1744+ * zero and lower_limit.
1745+ * @returns {number} error function integrated between lower_limit and upper_limit
1746+ * @constructor
1747+ */
1748+declare let ERF: (lowerLimit: any, upperLimit?: any) => number;
1749+/**
1750+ * Calculates the sum of the sums of the squares of values in two arrays.
1751+ * @param arrayX - The array or range of values whose squares will be added to the squares of corresponding
1752+ * entries in arrayY and added together.
1753+ * @param arrayY - The array or range of values whose squares will be added to the squares of corresponding
1754+ * entries in arrayX and added together.
1755+ * @returns {number} sum of the sums of the squares
1756+ * @constructor
1757+ */
1758+declare let SUMX2PY2: (arrayX: any, arrayY: any) => number;
1759+/**
1760+ * Calculates the sum of the differences of the squares of values in two arrays.
1761+ * @param arrayX - The array or range of values whose squares will be reduced by the squares of corresponding
1762+ * entries in array_y and added together.
1763+ * @param arrayY - The array or range of values whose squares will be subtracted from the squares of
1764+ * corresponding entries in array_x and added together.
1765+ * @returns {number} sum of the differences of the squares
1766+ * @constructor
1767+ */
1768+declare let SUMX2MY2: (arrayX: any, arrayY: any) => number;
1769+/**
1770+ * Counts the number of unique values in a list of specified values and ranges.
1771+ * @param values The values or ranges to consider for uniqueness. Supports an arbitrary number of arguments for this
1772+ * function.
1773+ * @returns {number} of unique values passed in.
1774+ * @constructor
1775+ */
1776+declare let COUNTUNIQUE: (...values: any[]) => number;
1777+/**
1778+ * Calculates the sum of the products of corresponding entries in two equal-sized arrays or ranges.
1779+ * @param values Arrays or ranges whose entries will be multiplied with corresponding entries in the second such array
1780+ * or range.
1781+ * @returns {number} sum of the products
1782+ * @constructor
1783+ */
1784+declare let SUMPRODUCT: (...values: any[]) => number;
1785+/**
1786+ * Returns the number of ways to choose some number of objects from a pool of a given size of objects.
1787+ * @param m - The size of the pool of objects to choose from.
1788+ * @param k - The number of objects to choose.
1789+ * @returns {number} number of ways
1790+ * @constructor
1791+ */
1792+declare let COMBIN: (m: any, k: any) => number;
1793+/**
1794+ * Multiply a series of numbers together.
1795+ * @param values - values or range of values to multiply by each other.
1796+ * @constructor
1797+ */
1798+declare let PRODUCT: (...values: any[]) => number;
1799+/**
1800+ * Divide one number by another
1801+ * @param dividend - number to be divided by the divisor.
1802+ * @param divisor - number to divide the dividend.
1803+ * @returns {number}
1804+ * @constructor
1805+ */
1806+declare let QUOTIENT: (dividend: any, divisor: any) => number;
1807+/**
1808+ * Returns a value, but does nothing to it. If given a range, will return first value.
1809+ * @param value to return
1810+ * @returns any value
1811+ * @constructor
1812+ */
1813+declare let UPLUS: (value: any) => any;
1814+/**
1815+ * Returns the same number, but with the sign reversed.
1816+ * @param value to reverse the sign on
1817+ * @returns {number}
1818+ * @constructor
1819+ */
1820+declare let UMINUS: (value: any) => number;
1821+/**
1822+ * Rounds a number to the nearest integer multiple of another.
1823+ * @param value - value to round.
1824+ * @param factor - multiple.
1825+ * @returns {number}
1826+ * @constructor
1827+ */
1828+declare let MROUND: (value: any, factor: any) => number;
1829+/**
1830+ * Calculates the double-factorial of a number.
1831+ * @param value - value or reference to calculate.
1832+ * @returns {number}
1833+ * @constructor
1834+ */
1835+declare let FACTDOUBLE: (value: any) => any;
1836+/**
1837+ * Returns a value as a percentage where 100 is 1.0, and 0 is 0.
1838+ * @param value - To convert.
1839+ * @returns {number}
1840+ * @constructor
1841+ */
1842+declare let UNARY_PERCENT: (value: any) => number;
1843+/**
1844+ * Returns the factorial of the sum of the arguments divided by the product of the factorials of the arguments.
1845+ * @param values - Range of numbers.
1846+ * @returns {number}
1847+ * @constructor
1848+ */
1849+declare let MULTINOMIAL: (...values: any[]) => number;
1850+/**
1851+ * Returns a sum of powers of the number x in accordance with the following formula.
1852+ * @param x - The number as an independent variable.
1853+ * @param n - The starting power.
1854+ * @param m - The number to increment by
1855+ * @param coefficients - A series of coefficients. For each coefficient the series sum is extended by one section. You
1856+ * can only enter coefficients using cell references.
1857+ * @returns {number}
1858+ * @constructor
1859+ */
1860+declare let SERIESSUM: (x: any, n: any, m: any, coefficients: any) => number;
1861+/**
1862+ * Calculates subtotals. If a range already contains subtotals, these are not used for further calculations.
1863+ * @param functionCode - A value that stands for another function: 1=AVERAGE, 2=COUNT, 3=COUNTA, 4=MAX, 5=MIN,
1864+ * 6=PRODUCT, 7=STDEV, 8=STDEVP, 9=SUM, 10=VAR, 11=VARP.
1865+ * @param values - The ranges whose cells are included.
1866+ * @returns {Array}
1867+ * @constructor
1868+ */
1869+declare let SUBTOTAL: (functionCode: any, ...values: any[][]) => any;
1870+export { ABS, ACOS, ACOSH, ACOTH, ASIN, ASINH, ATAN, ATAN2, ATANH, COT, COTH, COSH, COS, COUNTUNIQUE, EVEN, ERF, ERFC, INT, ISEVEN, ISODD, MOD, ODD, SIN, SINH, SUM, SQRT, SQRTPI, PI, POWER, LOG, LOG10, LN, MULTIPLY, MINUS, TAN, TANH, ROUND, ROUNDDOWN, ROUNDUP, SUMPRODUCT, SUMIF, SUMSQ, SUMX2MY2, SUMX2PY2, FLOOR, IF, COUNTIF, COUNTIFS, CEILING, TRUNC, RADIANS, DEGREES, COMBIN, RAND, RANDBETWEEN, SIGN, DIVIDE, EQ, GT, GTE, LT, LTE, NE, GCD, LCM, GAMMALN, PRODUCT, QUOTIENT, UPLUS, UMINUS, MROUND, FACTDOUBLE, UNARY_PERCENT, MULTINOMIAL, SERIESSUM, SUBTOTAL };
1871diff --git a/dist/Formulas/Math.js b/dist/Formulas/Math.js
1872index e082514..7eae70d 100644
1873--- a/dist/Formulas/Math.js
1874+++ b/dist/Formulas/Math.js
1875@@ -684,7 +684,7 @@ var COUNTIFS = function () {
1876 }
1877 var criteriaEvaluation = criteriaEvaluationFunctions[x + 1];
1878 if (otherCriteriaEvaluationSuccessfulSoFar) {
1879- if (!criteriaEvaluation(filteredValues[x][i])) {
1880+ if (!criteriaEvaluation(filteredValues[x][i])) { // evaluate THIS value with x+1 index, which is criteria.
1881 otherCriteriaEvaluationSuccessfulSoFar = false;
1882 }
1883 }
1884diff --git a/dist/Formulas/Range.d.ts b/dist/Formulas/Range.d.ts
1885new file mode 100644
1886index 0000000..4d50241
1887--- /dev/null
1888+++ b/dist/Formulas/Range.d.ts
1889@@ -0,0 +1,32 @@
1890+/**
1891+ * Calculates the frequency distribution of a range into specified classes or "bins".
1892+ * @param range - to get frequency for.
1893+ * @param bins - or classes.
1894+ * @returns {Array<number>}
1895+ * @constructor
1896+ * TODO: Returns ColumnArray (values stacked in Y-direction)
1897+ */
1898+declare let FREQUENCY: (range: any, bins: any) => number[];
1899+/**
1900+ * Given partial data with exponential growth, fits and ideal exponential growth trend, and predicts future values. For
1901+ * more information see: https://xkcd.com/1102/
1902+ * @param knownY - The range or array containing the dependent, y, values that are known, and will be used to fit an
1903+ * ideal exponential growth curve.
1904+ * @param knownX - OPTIONAL - The range or values of the independent variables that correspond to knownY.
1905+ * @param newX - OPTIONAL - The range, values, or data-points to return the y-values on the ideal curve fit.
1906+ * @param shouldUseConstant - OPTIONAL - True by default. Given an exponential function y = b*m^x, should this function
1907+ * calculate b?
1908+ * @returns {Array}
1909+ * @constructor
1910+ * TODO: Returns RowArray (values stacked in X-direction)
1911+ */
1912+declare let GROWTH: (knownY: any, knownX?: any, newX?: any, shouldUseConstant?: any) => any[];
1913+/**
1914+ * Returns the parameters of a linear trend.
1915+ * @param dataY - The range of data representing Y values.
1916+ * @param dataX - The range of data representing X values.
1917+ * @returns {number[]}
1918+ * @constructor
1919+ */
1920+declare let LINEST: (dataY: any, dataX: any) => number[];
1921+export { FREQUENCY, GROWTH, LINEST };
1922diff --git a/dist/Formulas/Statistical.d.ts b/dist/Formulas/Statistical.d.ts
1923new file mode 100644
1924index 0000000..4107e57
1925--- /dev/null
1926+++ b/dist/Formulas/Statistical.d.ts
1927@@ -0,0 +1,536 @@
1928+/**
1929+ * Calculates the sum of squares of deviations based on a sample.
1930+ * @param values - The values or ranges of the sample.
1931+ * @returns {number} sum of squares of deviations
1932+ * @constructor
1933+ */
1934+declare let DEVSQ: (...values: any[]) => number;
1935+/**
1936+ * Returns the median value in a numeric dataset.
1937+ * @param values - The value(s) or range(s) to consider when calculating the median value.
1938+ * @returns {number} the median value of the dataset
1939+ * @constructor
1940+ */
1941+declare let MEDIAN: (...values: any[]) => number;
1942+/**
1943+ * Returns the numerical average value in a dataset, ignoring text.
1944+ * @param values - The values or ranges to consider when calculating the average value.
1945+ * @returns {number} the average value of this dataset.
1946+ * @constructor
1947+ */
1948+declare let AVERAGE: (...values: any[]) => number;
1949+/**
1950+ * Calculates the average of the magnitudes of deviations of data from a dataset's mean.
1951+ * @param values - The value(s) or range(s)
1952+ * @returns {number} average of the magnitudes of deviations of data from a dataset's mean
1953+ * @constructor
1954+ */
1955+declare let AVEDEV: (...values: any[]) => number;
1956+/**
1957+ * Returns the numerical average value in a dataset, coercing text values in ranges to 0 values.
1958+ * @param values - value(s) or range(s) to consider when calculating the average value.
1959+ * @returns {number} the numerical average value in a dataset
1960+ * @constructor
1961+ */
1962+declare let AVERAGEA: (...values: any[]) => number;
1963+/**
1964+ * Calculates r, the Pearson product-moment correlation coefficient of a dataset. Any text encountered in the arguments
1965+ * will be ignored. CORREL is synonymous with PEARSON.
1966+ * @param dataY - The range representing the array or matrix of dependent data.
1967+ * @param dataX - The range representing the array or matrix of independent data.
1968+ * @returns {number} the Pearson product-moment correlation coefficient.
1969+ * @constructor
1970+ */
1971+declare let CORREL: (dataY: any, dataX: any) => number;
1972+/**
1973+ * Calculates r, the Pearson product-moment correlation coefficient of a dataset. Any text encountered in the arguments
1974+ * will be ignored. PEARSON is synonymous with CORREL.
1975+ * @param dataY - The range representing the array or matrix of dependent data.
1976+ * @param dataX - The range representing the array or matrix of independent data.
1977+ * @returns {number} the Pearson product-moment correlation coefficient.
1978+ * @constructor
1979+ */
1980+declare let PEARSON: (dataY: any, dataX: any) => any;
1981+/**
1982+ * Returns the value of the exponential distribution function with a specified lambda at a specified value.
1983+ * @param x - The input to the exponential distribution function. If cumulative is TRUE then EXPONDIST returns
1984+ * the cumulative probability of all values up to x.
1985+ * @param lambda - The lambda to specify the exponential distribution function.
1986+ * @param cumulative - Whether to use the exponential cumulative distribution.
1987+ * @returns {number} value of the exponential distribution function.
1988+ * @constructor
1989+ */
1990+declare let EXPONDIST: (x: any, lambda: any, cumulative: any) => number;
1991+/**
1992+ * Calculates the left-tailed F probability distribution (degree of diversity) for two data sets with given input x.
1993+ * Alternately called Fisher-Snedecor distribution or Snecdor's F distribution.
1994+ * @param x - The input to the F probability distribution function. The value at which to evaluate the function.
1995+ * Must be a positive number.
1996+ * @param degreesFreedom1 - The numerator degrees of freedom.
1997+ * @param degreesFreedom2 - The denominator degrees of freedom.
1998+ * @param cumulative - Logical value that determines the form of the function. If true returns the cumulative
1999+ * distribution function. If false returns the probability density function.
2000+ * @returns {number|boolean} left-tailed F probability distribution
2001+ * @constructor
2002+ * TODO: This function should be stricter in its return type.
2003+ */
2004+declare let FDIST$LEFTTAILED: (x: any, degreesFreedom1: any, degreesFreedom2: any, cumulative: any) => number | boolean;
2005+/**
2006+ * Returns the inverse of the (right-tailed) F probability distribution. If p = FDIST(x,...), then FINV(p,...) = x. The
2007+ * F distribution can be used in an F-test that compares the degree of variability in two data sets.
2008+ * @param probability - A probability associated with the F cumulative distribution.
2009+ * @param degFreedom1 - Required. The numerator degrees of freedom.
2010+ * @param degFreedom2 - Required. The denominator degrees of freedom.
2011+ * @returns {number} inverse of the (right-tailed) F probability distribution
2012+ * @constructor
2013+ */
2014+declare let FINV: (probability: any, degFreedom1: any, degFreedom2: any) => number;
2015+/**
2016+ * Returns the Fisher transformation of a specified value.
2017+ * @param value - The value for which to calculate the Fisher transformation.
2018+ * @returns {number} Fisher transformation
2019+ * @constructor
2020+ */
2021+declare let FISHER: (value: any) => number;
2022+/**
2023+ * Returns the inverse Fisher transformation of a specified value.
2024+ * @param value - The value for which to calculate the inverse Fisher transformation.
2025+ * @returns {number} inverse Fisher transformation
2026+ * @constructor
2027+ */
2028+declare let FISHERINV: (value: any) => number;
2029+/**
2030+ * Returns the maximum value in a numeric dataset.
2031+ * @param values - The values or range(s) to consider when calculating the maximum value.
2032+ * @returns {number} the maximum value of the dataset
2033+ * @constructor
2034+ */
2035+declare let MAX: (...values: any[]) => number;
2036+/**
2037+ * Returns the maximum numeric value in a dataset.
2038+ * @param values - The value(s) or range(s) to consider when calculating the maximum value.
2039+ * @returns {number} maximum value of the dataset
2040+ * @constructor
2041+ */
2042+declare let MAXA: (...values: any[]) => number;
2043+/**
2044+ * Returns the minimum value in a numeric dataset.
2045+ * @param values - The value(s) or range(s) to consider when calculating the minimum value.
2046+ * @returns {number} the minimum value of the dataset
2047+ * @constructor
2048+ */
2049+declare let MIN: (...values: any[]) => number;
2050+/**
2051+ * Returns the minimum numeric value in a dataset.
2052+ * @param values - The value(s) or range(s) to consider when calculating the minimum value.
2053+ * @returns {number} the minimum value in the dataset
2054+ * @constructor
2055+ */
2056+declare let MINA: (...values: any[]) => number;
2057+/**
2058+ * Returns the average of a range depending on criteria.
2059+ * @param criteriaRange - The range to check against criterion.
2060+ * @param criterion - The pattern or test to apply to criteria_range.
2061+ * @param averageRange - [optional] The range to average. If not included, criteria_range is used for the
2062+ * average instead.
2063+ * @returns {number}
2064+ * @constructor
2065+ * TODO: This needs to also accept a third parameter "average_range"
2066+ */
2067+declare let AVERAGEIF: (criteriaRange: any, criterion: any, averageRange?: any) => number;
2068+/**
2069+ * Returns the a count of the number of numeric values in a dataset.
2070+ * @param values - The values or ranges to consider when counting.
2071+ * @returns {number} number of numeric values in a dataset.
2072+ * @constructor
2073+ */
2074+declare let COUNT: (...values: any[]) => number;
2075+/**
2076+ * Returns the a count of the number of values in a dataset.
2077+ * @param values - The values or ranges to consider when counting.
2078+ * @returns {number} number of values in a dataset.
2079+ * @constructor
2080+ */
2081+declare let COUNTA: (...values: any[]) => number;
2082+/**
2083+ * Returns the value at a given percentile of a set of data.
2084+ * @param data - The array or range containing the dataset to consider.
2085+ * @param percent - percentile to be calculated and returned.
2086+ * @returns {number}
2087+ * @constructor
2088+ */
2089+declare let PERCENTILE: (data: any, percent: any) => number;
2090+/**
2091+ * Returns a value nearest to a specified quartile of a set of data.
2092+ * @param data - The array or range containing the set of data to consider.
2093+ * @param quartile - Which quartile value to return. 0 returns 0 percent mark, 1 returns 25 percent mark, 2 returns 50
2094+ * percent mark, 3 returns 75 percent mark, 4 returns 100 percent mark.
2095+ * @constructor
2096+ */
2097+declare let QUARTILE: (data: any, quartile: any) => number;
2098+/**
2099+ * Calculates the standard deviation of a range, ignoring string values, regardless of whether they can be converted to
2100+ * numbers.
2101+ * @param values - Range of sample.
2102+ * @returns {number}
2103+ * @constructor
2104+ */
2105+declare let STDEV: (...values: any[]) => number;
2106+/**
2107+ * Calculates the standard deviation of a range, converting string values to numbers, if possible. If a value cannot
2108+ * be converted to a number, formula will throw a value error.
2109+ * @param values - Range of sample.
2110+ * @returns {number}
2111+ * @constructor
2112+ */
2113+declare let STDEVA: (...values: any[]) => number;
2114+/**
2115+ * Calculates the standard deviation of an entire population, ignoring string values, regardless of whether they can be
2116+ * converted to numbers.
2117+ * @param values - Entire sample.
2118+ * @returns {number}
2119+ * @constructor
2120+ */
2121+declare let STDEVP: (...values: any[]) => number;
2122+/**
2123+ * Calculates the standard deviation of an entire population, including text and boolean values, if possible. If a value
2124+ * cannot be converted to a number, formula will throw a value error.
2125+ * @param values - Entire sample.
2126+ * @returns {number}
2127+ * @constructor
2128+ */
2129+declare let STDEVPA: (...values: any[]) => number;
2130+/**
2131+ * Returns the mean value of a range excluding some percentage of the range on the high and low ends of the range.
2132+ * @param range - Array or range to consider.
2133+ * @param percent - The portion of the data to exclude on both ends of the range.
2134+ * @returns {number}
2135+ * @constructor
2136+ */
2137+declare let TRIMMEAN: (range: any, percent: any) => number;
2138+/**
2139+ * Returns the slope of the line calculated from linear regression of a range. Any text values passed in will be ignored
2140+ * @param rangeY - The range or array representing the dependent data.
2141+ * @param rangeX - The range or array representing the independent data.
2142+ * @constructor
2143+ */
2144+declare let SLOPE: (rangeY: any, rangeX: any) => number;
2145+/**
2146+ * Returns the normalized equivalent of a random variable given mean and standard deviation of the distribution.
2147+ * @param value - Value to be standardized.
2148+ * @param meanValue - Arithmetic mean of the distribution
2149+ * @param std - The standard deviation of the distribution or range.
2150+ * @returns {number}
2151+ * @constructor
2152+ */
2153+declare let STANDARDIZE: (value: any, meanValue: any, std: any) => number;
2154+/**
2155+ * Returns the Nth smallest value in the range, ignoring text values.
2156+ * @param range - Range or data-set to consider.
2157+ * @param n - N in 'Nth'.
2158+ * @constructor
2159+ */
2160+declare let SMALL: (range: any, n: any) => number;
2161+/**
2162+ * Returns the Nth largest value in the range, ignoring text values.
2163+ * @param range - Range or data-set to consider.
2164+ * @param n - N in 'Nth'.
2165+ * @constructor
2166+ */
2167+declare let LARGE: (range: any, n: any) => number;
2168+/**
2169+ * Returns the kurtosis of a data set or range. Ignores text values.
2170+ * @param values - data set or range to calculate. Must be at least 4 values.
2171+ * @returns {number}
2172+ * @constructor
2173+ */
2174+declare let KURT: (...values: any[]) => number;
2175+/**
2176+ * Calculates the y-value at which a line will intersect the y-axis by using known x-values and y-values. Any text
2177+ * values will be ignored.
2178+ * @param rangeY - Dependent range of values.
2179+ * @param rangeX - Independent range of values.
2180+ * @returns {number}
2181+ * @constructor
2182+ */
2183+declare let INTERCEPT: (rangeY: any, rangeX: any) => number;
2184+/**
2185+ * Calculates the a future value using existing x-values and y-values. Any text values will be ignored.
2186+ * @param x - The data point for which you would like to predict the value.
2187+ * @param rangeY - Dependent range of values.
2188+ * @param rangeX - Independent range of values.
2189+ * @returns {number}
2190+ * @constructor
2191+ * TODO: This formula will fail to parse since the first argument is followed by an argument that is an array.
2192+ * TODO (continued) This is a known issue.
2193+ */
2194+declare let FORECAST: (x: any, rangeY: any, rangeX: any) => number;
2195+/**
2196+ * Returns the Poisson distribution for the given number. Functions the same as POISSON.DIST.
2197+ * @param x - Number to use.
2198+ * @param meanValue - The middle value for the Poisson distribution.
2199+ * @param cumulative - [OPTIONAL] - 0 calculates the density function, 1 calculates the distribution. Defaults to 0.
2200+ * @returns {number}
2201+ * @constructor
2202+ */
2203+declare let POISSON: (x: any, meanValue: any, cumulative?: any) => number;
2204+/**
2205+ * Returns the percentage rank (percentile) of the given value in a sample. Functions the same as PERCENTRANK.INC.
2206+ * @param data - The array or range of data in the sample.
2207+ * @param x - The value.
2208+ * @param significance - [OPTIONAL] - The number of significant digits to use in the calculation. Defaults to 3.
2209+ * @returns {number}
2210+ * @constructor
2211+ */
2212+declare let PERCENTRANK: (data: any, x: any, significance?: any) => number;
2213+/**
2214+ * Returns the percentage rank (percentile) from 0 to 1 exclusive for a value in a sample.
2215+ * @param data - The array or range of data in the sample.
2216+ * @param x - The value
2217+ * @param significance - [OPTIONAL] - The number of significant digits to use in the calculation. Defaults to 3.
2218+ * @returns {number}
2219+ * @constructor
2220+ */
2221+declare let PERCENTRANK$EXC: (data: any, x: any, significance?: any) => number;
2222+/**
2223+ * Returns the inverse of the standard normal distribution for the given number.
2224+ * @param probability - The probability value.
2225+ * @returns {number}
2226+ * @constructor
2227+ */
2228+declare let NORMSINV: (probability: any) => any;
2229+/**
2230+ * Returns the standard normal cumulative distribution for the given number.
2231+ * @param z - Value to use in calculation.
2232+ * @returns {number}
2233+ * @constructor
2234+ */
2235+declare let NORMSDIST: (z: any) => number;
2236+/**
2237+ * Returns the normal distribution for the given number in the distribution.
2238+ * @param x - Value to use.
2239+ * @param meanValue - The mean value of the distribution.
2240+ * @param standDev - The standard deviation of the distribution.
2241+ * @param cumulative - 0 calculates the density function, 1 calculates the distribution.
2242+ * @returns {number}
2243+ * @constructor
2244+ */
2245+declare let NORMDIST: (x: any, meanValue: any, standDev: any, cumulative: any) => number;
2246+/**
2247+ * Returns the inverse of the normal distribution for the given number in the distribution.
2248+ * @param probability - Number in the distribution.
2249+ * @param meanVal - The mean value in the normal distribution.
2250+ * @param standDev - The standard deviation of the normal distribution.
2251+ * @returns {number}
2252+ * @constructor
2253+ */
2254+declare let NORMINV: (probability: any, meanVal: any, standDev: any) => any;
2255+/**
2256+ * Returns the negative binomial distribution.
2257+ * @param k - The value returned for unsuccessful tests.
2258+ * @param r - The value returned for successful tests.
2259+ * @param p - The probability of the success of an attempt, between 0 and 1 inclusively.
2260+ * @returns {number}
2261+ * @constructor
2262+ */
2263+declare let NEGBINOMDIST: (k: any, r: any, p: any) => number;
2264+/**
2265+ * Returns the geometric mean of a sample.
2266+ * @param values - The numerical arguments or ranges that represent a random sample.
2267+ * @returns {number}
2268+ * @constructor
2269+ */
2270+declare let GEOMEAN: (...values: any[]) => number;
2271+/**
2272+ * Returns the harmonic mean of a data set.
2273+ * @param values - The numerical arguments or ranges that represent a sample.
2274+ * @returns {number}
2275+ * @constructor
2276+ */
2277+declare let HARMEAN: (...values: any[]) => number;
2278+/**
2279+ * Returns the (1-alpha) confidence interval for a normal distribution.
2280+ * @param alpha - The level of the confidence interval
2281+ * @param standDev - The standard deviation for the total population
2282+ * @param size - The size of the population.
2283+ * @returns {number}
2284+ * @constructor
2285+ */
2286+declare let CONFIDENCE: (alpha: any, standDev: any, size: any) => number;
2287+/**
2288+ * Returns the individual term binomial distribution probability.
2289+ * @param successes - The number of successes in a set of trials.
2290+ * @param trials - The number of independent trials.
2291+ * @param probability - The probability of success on each trial.
2292+ * @param cumulative - 0 calculates the probability of a single event, 1 calculates the cumulative probability.
2293+ * @returns {number}
2294+ * @constructor
2295+ */
2296+declare let BINOMDIST: (successes: any, trials: any, probability: any, cumulative: any) => number;
2297+/**
2298+ * Returns the covariance of the product of paired deviations.
2299+ * @param dataY - The first range of data.
2300+ * @param dataX - The second range of data.
2301+ * @returns {number}
2302+ * @constructor
2303+ */
2304+declare let COVAR: (dataY: any, dataX: any) => number;
2305+/**
2306+ * Returns the values of the Weibull distribution for the given number.
2307+ * @param x - Number to use in calculation.
2308+ * @param shape - The Alpha parameter of the Weibull distribution. Should be greater than 0.
2309+ * @param scale - The Beta parameter of the Weibull distribution. Should be greater than 0.
2310+ * @param cumulative - Indicates the type of function: If 0 the form of the function is calculated, if 1 then the
2311+ * distribution is calculated.
2312+ * @returns {number}
2313+ * @constructor
2314+ */
2315+declare let WEIBULL: (x: any, shape: any, scale: any, cumulative: any) => number;
2316+/**
2317+ * Estimate the variance based on the entire population. Text will be converted to numbers, if possible.
2318+ * @param values - Values of population.
2319+ * @returns {number}
2320+ * @constructor
2321+ */
2322+declare let VARPA: (...values: any[]) => number;
2323+/**
2324+ * Estimate the variance based on the entire population.
2325+ * @param values - Values of entire population.
2326+ * @returns {number}
2327+ * @constructor
2328+ */
2329+declare let VARP: (...values: any[]) => number;
2330+/**
2331+ * Estimate the variance based on a sample.
2332+ * @param values
2333+ * @returns {number}
2334+ * @constructor
2335+ */
2336+declare let VARA: (...values: any[]) => number;
2337+/**
2338+ * Estimate the variance based on a sample.
2339+ * @param values - Values in sample.
2340+ * @constructor
2341+ */
2342+declare let VAR: (...values: any[]) => number;
2343+/**
2344+ * Returns the number of permutations for a given number of objects.
2345+ * @param total - The total number of objects
2346+ * @param objects - The number of objects in each permutation.
2347+ * @returns {number}
2348+ * @constructor
2349+ */
2350+declare let PERMUT: (total: any, objects: any) => number;
2351+/**
2352+ * Returns the square of the Pearson correlation coefficient based on the given values.
2353+ * @param rangeY - An array or range of data points.
2354+ * @param rangeX - An array or range of data points.
2355+ * @returns {number}
2356+ * @constructor
2357+ */
2358+declare let RSQ: (rangeY: any, rangeX: any) => number;
2359+/**
2360+ * Returns the skewness of a distribution.
2361+ * @param values - The numerical values or range.
2362+ * @returns {number}
2363+ * @constructor
2364+ */
2365+declare let SKEW: (...values: any[]) => number;
2366+/**
2367+ * Returns the standard error of the predicted y value for each x in the regression. Text values will be ignored.
2368+ * @param rangeY - An array or range of data points.
2369+ * @param rangeX - An array or range of data points.
2370+ * @returns {number}
2371+ * @constructor
2372+ */
2373+declare let STEYX: (rangeY: any, rangeX: any) => number;
2374+/**
2375+ * Returns the probability that values in a range are between two limits. Data is the array or range of data in the
2376+ * sample.
2377+ * @param range - The array or range of data in the sample.
2378+ * @param probability - The array or range of the corresponding probabilities
2379+ * @param start - The start value of the interval whose probabilities are to be summed.
2380+ * @param end - [OPTIONAL] - The end value of the interval whose probabilities are to be summed. If this parameter is
2381+ * missing, the probability for the start value is calculated
2382+ * @returns {number}
2383+ * @constructor
2384+ */
2385+declare let PROB: (range: any, probability: any, start: any, end?: any) => any;
2386+/**
2387+ * Returns the most commonly occurring value in a range.
2388+ * @param values - Range(s) or values to consider.
2389+ * @returns {number}
2390+ * @constructor
2391+ */
2392+declare let MODE: (...values: any[]) => any;
2393+/**
2394+ * Returns the position of a given entry in the entire list, measured either from top to bottom or bottom to top.
2395+ * @param value - Value to find the rank of.
2396+ * @param data - Values or range of the data-set.
2397+ * @param isAscending - [OPTIONAL] The type of rank: 0 to rank from the highest, 1 to rank from the lowest. Defaults to
2398+ * 0.
2399+ * @returns {number}
2400+ * @constructor
2401+ */
2402+declare let RANK: (value: any, data: any, isAscending?: any) => number;
2403+/**
2404+ * Returns the position of a given entry in the entire list, measured either from top to bottom or bottom to top. If
2405+ * more than one value exists in the same data-set, the average range of the values will be returned.
2406+ * @param value - Value to find the rank of.
2407+ * @param data - Values or range of the data-set.
2408+ * @param isAscending - [OPTIONAL] The type of rank: 0 to rank from the highest, 1 to rank from the lowest. Defaults to
2409+ * 0.
2410+ * @returns {number}
2411+ * @constructor
2412+ */
2413+declare let RANK$AVG: (value: any, data: any, isAscending?: any) => number;
2414+/**
2415+ * Returns the position of a given entry in the entire list, measured either from top to bottom or bottom to top. If
2416+ * there is more than one entry of the same value in the dataset, the top rank of the entries will be returned.
2417+ * @param value - Value to find the rank of.
2418+ * @param data - Values or range of the data-set.
2419+ * @param isAscending - [OPTIONAL] The type of rank: 0 to rank from the highest, 1 to rank from the lowest. Defaults to
2420+ * 0.
2421+ * @returns {number}
2422+ * @constructor
2423+ */
2424+declare let RANK$EQ: (value: any, data: any, isAscending?: any) => number;
2425+/**
2426+ * Returns the cumulative lognormal distribution for the given number.
2427+ * @param x - The probability value.
2428+ * @param meanValue - The mean value of the standard logarithmic distribution.
2429+ * @param standardDev - The standard deviation of the standard logarithmic distribution.
2430+ * @returns {number}
2431+ * @constructor
2432+ */
2433+declare let LOGNORMDIST: (x: any, meanValue: any, standardDev: any) => number;
2434+/**
2435+ * Returns the t-distribution for the given number.
2436+ * @param x - Value to use in calculation.
2437+ * @param degreesOfFreedom - The number of degrees of freedom for the t-distribution.
2438+ * @param tails - 1 returns the one-tailed test, 2 returns the two-tailed test.
2439+ * @returns {number}
2440+ * @constructor
2441+ */
2442+declare let TDIST: (x: any, degreesOfFreedom: any, tails: any) => number;
2443+/**
2444+ * Returns the hypergeometric distribution. X is the number of results achieved in the random sample.
2445+ * @param numberOfSuccesses - The number of results achieved in the random sample.
2446+ * @param numberOfDraws - The size of the random sample.
2447+ * @param successesInPop - The number of possible results in the total population.
2448+ * @param populationSize - The size of the total population.
2449+ * @returns {number}
2450+ * @constructor
2451+ */
2452+declare let HYPGEOMDIST: (numberOfSuccesses: any, numberOfDraws: any, successesInPop: any, populationSize: any) => number;
2453+/**
2454+ * Returns the two-tailed P value of a z test with standard distribution.
2455+ * @param range - Te array of the data.
2456+ * @param value - The value to be tested.
2457+ * @param stdDev - [OPTIONAL] The standard deviation of the total population. If this argument is missing, the standard
2458+ * deviation of the sample is processed.
2459+ * @returns {number}
2460+ * @constructor
2461+ */
2462+declare let ZTEST: (range: any, value: any, stdDev?: any) => number;
2463+export { AVERAGE, AVERAGEA, AVERAGEIF, AVEDEV, CORREL, COUNT, COUNTA, PEARSON, MEDIAN, DEVSQ, EXPONDIST, FDIST$LEFTTAILED, FINV, FISHER, FISHERINV, MAX, MAXA, MIN, MINA, QUARTILE, PERCENTILE, STDEV, STDEVA, STDEVP, STDEVPA, TRIMMEAN, SLOPE, STANDARDIZE, SMALL, LARGE, KURT, INTERCEPT, FORECAST, POISSON, PERCENTRANK, PERCENTRANK$EXC, NORMSINV, NORMSDIST, NORMDIST, NORMINV, NEGBINOMDIST, GEOMEAN, HARMEAN, CONFIDENCE, BINOMDIST, COVAR, WEIBULL, VARPA, VARP, VARA, VAR, PERMUT, RSQ, SKEW, STEYX, PROB, MODE, RANK, RANK$AVG, RANK$EQ, LOGNORMDIST, TDIST, HYPGEOMDIST, ZTEST };
2464diff --git a/dist/Formulas/Text.d.ts b/dist/Formulas/Text.d.ts
2465new file mode 100644
2466index 0000000..b5089d7
2467--- /dev/null
2468+++ b/dist/Formulas/Text.d.ts
2469@@ -0,0 +1,205 @@
2470+/**
2471+ * Computes the value of a Roman numeral.
2472+ * @param text - The Roman numeral to format, whose value must be between 1 and 3999, inclusive.
2473+ * @returns {number} value in integer format
2474+ * @constructor
2475+ */
2476+declare let ARABIC: (text?: any) => number;
2477+/**
2478+ * Convert a number into a character according to the current Unicode table.
2479+ * @param value - The number of the character to look up from the current Unicode table in decimal format.
2480+ * @returns {string} character corresponding to Unicode number
2481+ * @constructor
2482+ */
2483+declare let CHAR: (value: any) => string;
2484+/**
2485+ * Returns the numeric Unicode map value of the first character in the string provided.
2486+ * @param value - The string whose first character's Unicode map value will be returned.
2487+ * @returns {number} number of the first character's Unicode value
2488+ * @constructor
2489+ */
2490+declare let CODE: (value: any) => number;
2491+/**
2492+ * Divides text around a specified character or string, and puts each fragment into a separate cell in the row.
2493+ * @param text - The text to divide.
2494+ * @param delimiter - The character or characters to use to split text.
2495+ * @param splitByEach - [optional] Whether or not to divide text around each character contained in
2496+ * delimiter.
2497+ * @returns {Array<string>} containing the split
2498+ * @constructor
2499+ * TODO: At some point this needs to return a more complex type than Array. Needs to return a type that has a dimension.
2500+ */
2501+declare let SPLIT: (text: any, delimiter: any, splitByEach?: any) => string[];
2502+/**
2503+ * Appends strings to one another.
2504+ * @param values - to append to one another. Must contain at least one value
2505+ * @returns {string} concatenated string
2506+ * @constructor
2507+ */
2508+declare let CONCATENATE: (...values: any[]) => string;
2509+/**
2510+ * Converts a numeric value to a different unit of measure.
2511+ * @param value - the numeric value in start_unit to convert to end_unit.
2512+ * @param startUnit - The starting unit, the unit currently assigned to value.
2513+ * @param endUnit - The unit of measure into which to convert value.
2514+ * @returns {number}
2515+ * @constructor
2516+ * TODO: Looking up units is not efficient at all. We should use an object instead of iterating through an array.
2517+ */
2518+declare let CONVERT: (value: any, startUnit: any, endUnit: any) => number;
2519+/**
2520+ * Removes leading and trailing spaces in a specified string.
2521+ * @param value - The string or reference to a cell containing a string to be trimmed.
2522+ * @returns {string}
2523+ * @constructor
2524+ */
2525+declare let TRIM: (value: any) => string;
2526+/**
2527+ * Converts text to lowercase.
2528+ * @param value - Text to convert.
2529+ * @constructor
2530+ */
2531+declare let LOWER: (value: any) => string;
2532+/**
2533+ * Converts text to uppercase.
2534+ * @param value - Text to convert.
2535+ * @constructor
2536+ */
2537+declare let UPPER: (value: any) => string;
2538+/**
2539+ * Returns string arguments as text, or the empty string if the value is not text.
2540+ * @param value - Value to return.
2541+ * @constructor
2542+ */
2543+declare let T: (value: any) => string;
2544+/**
2545+ * Converts a number into a Roman numeral.
2546+ * @param value - The value to convert. Must be between 0 and 3999.
2547+ * @constructor
2548+ * TODO: Second parameter should be 'rule_relaxation'.
2549+ */
2550+declare let ROMAN: (value: any) => string;
2551+/**
2552+ * Converts a number into text according to a given format.
2553+ * @param value - The value to be converted.
2554+ * @param format - Text which defines the format. "0" forces the display of zeros, while "#" suppresses the display of
2555+ * zeros. For example TEXT(22.1,"000.00") produces 022.10, while TEXT(22.1,"###.##") produces 22.1, and
2556+ * TEXT(22.405,"00.00") results in 22.41. To format days: "dddd" indicates full name of the day of the week, "ddd"
2557+ * short name of the day of the week, "dd" indicates the day of the month as two digits, "d" indicates day of the month
2558+ * as one or two digits, "mmmmm" indicates the first letter in the month of the year, "mmmm" indicates the full name of
2559+ * the month of the year, "mmm" indicates short name of the month of the year, "mm" indicates month of the year as two
2560+ * digits or the number of minutes in a time, depending on whether it follows yy or dd, or if it follows hh, "m" month
2561+ * of the year as one or two digits or the number of minutes in a time, depending on whether it follows yy or dd, or if
2562+ * it follows hh, "yyyy" indicates year as four digits, "yy" and "y" indicate year as two digits, "hh" indicates hour
2563+ * on a 24-hour clock, "h" indicates hour on a 12-hour clock, "ss.000" indicates milliseconds in a time, "ss" indicates
2564+ * seconds in a time, "AM/PM" or "A/P" indicate displaying hours based on a 12-hour clock and showing AM or PM
2565+ * depending on the time of day. Eg: `TEXT("01/09/2012 10:04:33AM", "mmmm-dd-yyyy, hh:mm AM/PM")` would result in
2566+ * "January-09-2012, 10:04 AM".
2567+ * @constructor
2568+ */
2569+declare let TEXT: (value: any, format: any) => string;
2570+/**
2571+ * Looks for a string of text within another string. Where to begin the search can also be defined. The search term can
2572+ * be a number or any string of characters. The search is case-sensitive.
2573+ * @param searchFor - The text to be found.
2574+ * @param searchIn - The text where the search takes place.
2575+ * @param startAt - [OPTIONAL defaults to 1] - The position in the text from which the search starts.
2576+ * @returns {number}
2577+ * @constructor
2578+ */
2579+declare let FIND: (searchFor: any, searchIn: any, startAt?: any) => any;
2580+/**
2581+ * Concatenates the values of one or more arrays using a specified delimiter.
2582+ * @param delimiter - The string to place between the values.
2583+ * @param values - The values to be appended using the delimiter.
2584+ * @returns {string}
2585+ * @constructor
2586+ */
2587+declare let JOIN: (delimiter: any, ...values: any[]) => string;
2588+/**
2589+ * Returns the length of a string including spaces.
2590+ * @param value - The text whose length is to be determined.
2591+ * @constructor
2592+ */
2593+declare let LEN: (value: any) => any;
2594+/**
2595+ * Returns the first character or characters in a text string.
2596+ * @param text - The text where the initial partial words are to be determined.
2597+ * @param numberOfCharacters [OPTIONAL] - The number of characters for the start text. If this parameter is not defined,
2598+ * one character is returned.
2599+ * @returns {string}
2600+ * @constructor
2601+ */
2602+declare let LEFT: (text: any, numberOfCharacters?: any) => any;
2603+/**
2604+ * Defines the last character or characters in a text string.
2605+ * @param text - The text where the initial partial words are to be determined.
2606+ * @param numberOfCharacters [OPTIONAL] - The number of characters for the start text. If this parameter is not defined,
2607+ * one character is returned.
2608+ * @returns {string}
2609+ * @constructor
2610+ */
2611+declare let RIGHT: (text: any, numberOfCharacters?: any) => any;
2612+/**
2613+ * Returns the position of a text segment within a character string. The start of the search can be set as an option.
2614+ * The search text can be a number or any sequence of characters. The search is not case-sensitive.
2615+ * @param findText - The text to be searched for.
2616+ * @param withinText - The text where the search will take place
2617+ * @param position - [OPTIONAL default 1] The position in the text where the search is to start.
2618+ * @constructor
2619+ */
2620+declare let SEARCH: (findText: any, withinText: any, position?: any) => any;
2621+/**
2622+ * Repeats a character string by the given number of copies.
2623+ * @param text - The text to be repeated.
2624+ * @param numberOfReps - The number of repetitions
2625+ * @constructor
2626+ */
2627+declare let REPT: (text: any, numberOfReps: any) => string;
2628+/**
2629+ * Converts a value into a number if possible.
2630+ * @param value - The value to convert to a number.
2631+ * @returns {number}
2632+ * @constructor
2633+ */
2634+declare let VALUE: (value: any) => number;
2635+/**
2636+ * Removes all non-printing characters from the string.
2637+ * @param text - The text from which to remove all non-printable characters.
2638+ * @returns {string}
2639+ * @constructor
2640+ */
2641+declare let CLEAN: (text: any) => any;
2642+/**
2643+ * Returns a text segment of a character string. The parameters specify the starting position and the number of
2644+ * characters.
2645+ * @param text - The text containing the characters to extract.
2646+ * @param start - The position of the first character in the text to extract.
2647+ * @param number - The number of characters in the part of the text.
2648+ * @returns {string}
2649+ * @constructor
2650+ */
2651+declare let MID: (text: any, start: any, number: any) => any;
2652+declare let PROPER: (text: any) => any;
2653+/**
2654+ * Replaces part of a text string with a different text string. This function can be used to replace both characters and
2655+ * numbers (which are automatically converted to text). The result of the function is always displayed as text.
2656+ * @param text - The text of which a part will be replaced.
2657+ * @param position - The position within the text where the replacement will begin.
2658+ * @param length - The number of characters in text to be replaced.
2659+ * @param newText - The text which replaces text.
2660+ * @constructor
2661+ */
2662+declare let REPLACE: (text: any, position: any, length: any, newText: any) => any;
2663+/**
2664+ * Substitutes new text for old text in a string.
2665+ * @param text - The text in which text segments are to be exchanged.
2666+ * @param searchFor - The text segment that is to be replaced (a number of times)
2667+ * @param replaceWith - The text that is to replace the text segment.
2668+ * @param occurrence - [OPTIONAL] - Indicates how many occurrences of the search text are to be replaced. If this
2669+ * parameter is missing, the search text is replaced throughout.
2670+ * @returns {string}
2671+ * @constructor
2672+ */
2673+declare let SUBSTITUTE: (text: any, searchFor: any, replaceWith: any, occurrence?: any) => any;
2674+export { ARABIC, CHAR, CODE, SPLIT, CONCATENATE, CONVERT, TRIM, LOWER, UPPER, T, ROMAN, TEXT, FIND, JOIN, LEN, LEFT, RIGHT, SEARCH, REPT, VALUE, CLEAN, MID, PROPER, REPLACE, SUBSTITUTE };
2675diff --git a/dist/Formulas/Text.js b/dist/Formulas/Text.js
2676index 141bd6c..0e7801a 100644
2677--- a/dist/Formulas/Text.js
2678+++ b/dist/Formulas/Text.js
2679@@ -44,7 +44,7 @@ exports.ARABIC = ARABIC;
2680 var CHAR = function (value) {
2681 ArgsChecker_1.ArgsChecker.checkLength(arguments, 1, "CHAR");
2682 var n = TypeConverter_1.TypeConverter.firstValueAsNumber(value);
2683- if (n < 1 || n > 1114112) {
2684+ if (n < 1 || n > 1114112) { //limit
2685 throw new Errors_1.NumError("Function CHAR parameter 1 value " + n + " is out of range.");
2686 }
2687 return String.fromCharCode(n);
2688diff --git a/dist/Parser/DataStore.d.ts b/dist/Parser/DataStore.d.ts
2689new file mode 100644
2690index 0000000..a3fc3bc
2691--- /dev/null
2692+++ b/dist/Parser/DataStore.d.ts
2693@@ -0,0 +1,17 @@
2694+/**
2695+ * Holds cell values, and allows for the updating and manipulation of those cells.
2696+ */
2697+import { Cell } from "../Cell";
2698+/**
2699+ * Cell DataStore that stores cells in memory.
2700+ */
2701+declare class DataStore {
2702+ /**
2703+ * Holds cells inside an object for quick access.
2704+ */
2705+ data: Object;
2706+ getCell(key: string): Cell;
2707+ addCell(cell: Cell): Cell;
2708+ getDependencies(id: string): any[];
2709+}
2710+export { DataStore };
2711diff --git a/dist/Parser/DataStore.js b/dist/Parser/DataStore.js
2712index 3a3c5bc..8aae0a4 100644
2713--- a/dist/Parser/DataStore.js
2714+++ b/dist/Parser/DataStore.js
2715@@ -7,7 +7,7 @@ var Cell_1 = require("../Cell");
2716 /**
2717 * Cell DataStore that stores cells in memory.
2718 */
2719-var DataStore = (function () {
2720+var DataStore = /** @class */ (function () {
2721 function DataStore() {
2722 /**
2723 * Holds cells inside an object for quick access.
2724diff --git a/dist/Parser/Parser.d.ts b/dist/Parser/Parser.d.ts
2725new file mode 100644
2726index 0000000..e63dbc7
2727--- /dev/null
2728+++ b/dist/Parser/Parser.d.ts
2729@@ -0,0 +1,10 @@
2730+/**
2731+ * Creates a new FormulaParser, which parses formulas, and does minimal error handling.
2732+ *
2733+ * @param handler should be a Sheet, since the parser needs access to fixedCellValue, cellValue, cellRangeValue, and
2734+ * fixedCellRangeValue
2735+ * @returns formula parser instance for use with parser.js
2736+ * @constructor
2737+ */
2738+declare let FormulaParser: (handler: any) => any;
2739+export { FormulaParser };
2740diff --git a/dist/Parser/Parser.js b/dist/Parser/Parser.js
2741index 78513a8..5497377 100644
2742--- a/dist/Parser/Parser.js
2743+++ b/dist/Parser/Parser.js
2744@@ -427,7 +427,7 @@ var Parser = (function () {
2745 // Reduce: enough tokens have been gathered to reduce input through evaluation.
2746 // Accept: return.
2747 switch (action[0]) {
2748- case ParserConstants_1.SHIFT:
2749+ case ParserConstants_1.SHIFT: // Shift
2750 stack.push(symbol);
2751 semanticValueStack.push(lexer.yytext);
2752 locationStack.push(lexer.yylloc);
2753@@ -438,7 +438,7 @@ var Parser = (function () {
2754 if (Formulas_1.Formulas.isTryCatchFormula(lexer.yytext)) {
2755 catchFailuresOn = true;
2756 }
2757- if (!preErrorSymbol) {
2758+ if (!preErrorSymbol) { // normal execution/no error
2759 yyleng = lexer.yyleng;
2760 yytext = lexer.yytext;
2761 yylineno = lexer.yylineno;
2762@@ -453,7 +453,7 @@ var Parser = (function () {
2763 preErrorSymbol = null;
2764 }
2765 break;
2766- case ParserConstants_1.REDUCE:
2767+ case ParserConstants_1.REDUCE: // Reduce
2768 // console.log("REDUCE", "literal", lexer.yytext, " symbol", symbol, " symbol name", SYMBOL_INDEX_TO_NAME[symbol], " action", action,
2769 // " stack", stack, " semanticValueStack", semanticValueStack);
2770 var currentProduction = ParserConstants_1.PRODUCTIONS[action[1]];
2771@@ -754,7 +754,11 @@ var Parser = (function () {
2772 return this.conditions.INITIAL.rules;
2773 }
2774 },
2775- options: {},
2776+ options: {
2777+ // backtrack_lexer?
2778+ // ranges?
2779+ // flex?
2780+ },
2781 mapRuleIndexToSymbolEnumeration: function (ruleIndex) {
2782 switch (ruleIndex) {
2783 case 0 /* WhiteSpace */:
2784diff --git a/dist/Parser/ParserConstants.d.ts b/dist/Parser/ParserConstants.d.ts
2785new file mode 100644
2786index 0000000..0162cd8
2787--- /dev/null
2788+++ b/dist/Parser/ParserConstants.d.ts
2789@@ -0,0 +1,51 @@
2790+import { Symbol } from "./Symbols";
2791+import { ReductionPair } from "./ReductionPair";
2792+import { RULES } from "./Rules";
2793+/**
2794+ * Actions to take when processing tokens one by one. We're always either taking the next token, reducing our current
2795+ * tokens, or accepting and returning.
2796+ */
2797+declare const SHIFT = 1;
2798+declare const REDUCE = 2;
2799+declare const ACCEPT = 3;
2800+declare const PRODUCTIONS: ReductionPair[];
2801+declare const SYMBOL_NAME_TO_INDEX: {
2802+ "$accept": Symbol;
2803+ "$end": Symbol;
2804+ "error": Symbol;
2805+ "expressions": Symbol;
2806+ "expression": Symbol;
2807+ "EOF": Symbol;
2808+ "variableSequence": Symbol;
2809+ "number": Symbol;
2810+ "STRING": Symbol;
2811+ "&": Symbol;
2812+ "=": Symbol;
2813+ "+": Symbol;
2814+ "(": Symbol;
2815+ ")": Symbol;
2816+ "<": Symbol;
2817+ ">": Symbol;
2818+ "-": Symbol;
2819+ "*": Symbol;
2820+ "/": Symbol;
2821+ "^": Symbol;
2822+ "FUNCTION": Symbol;
2823+ "expseq": Symbol;
2824+ "cell": Symbol;
2825+ "FIXEDCELL": Symbol;
2826+ ":": Symbol;
2827+ "CELL": Symbol;
2828+ "ARRAY": Symbol;
2829+ ";": Symbol;
2830+ ",": Symbol;
2831+ "VARIABLE": Symbol;
2832+ "DECIMAL": Symbol;
2833+ "NUMBER": Symbol;
2834+ "%": Symbol;
2835+ "#": Symbol;
2836+ "!": Symbol;
2837+};
2838+declare const SYMBOL_INDEX_TO_NAME: {};
2839+declare const ACTION_TABLE: any[];
2840+export { ACTION_TABLE, RULES, REDUCE, ACCEPT, SHIFT, SYMBOL_INDEX_TO_NAME, SYMBOL_NAME_TO_INDEX, PRODUCTIONS };
2841diff --git a/dist/Parser/ReduceActions.d.ts b/dist/Parser/ReduceActions.d.ts
2842new file mode 100644
2843index 0000000..e8e7964
2844--- /dev/null
2845+++ b/dist/Parser/ReduceActions.d.ts
2846@@ -0,0 +1,44 @@
2847+declare const enum ReduceActions {
2848+ NoAction = 0,
2849+ ReturnLast = 1,
2850+ CallVariable = 2,
2851+ AsNumber = 5,
2852+ AsString = 6,
2853+ Ampersand = 7,
2854+ Equals = 8,
2855+ Plus = 9,
2856+ LastExpression = 10,
2857+ LTE = 11,
2858+ GTE = 12,
2859+ NotEqual = 13,
2860+ GT = 15,
2861+ LT = 16,
2862+ Minus = 17,
2863+ Multiply = 18,
2864+ Divide = 19,
2865+ ToPower = 20,
2866+ InvertNumber = 21,
2867+ ToNumberNANAsZero = 22,
2868+ CallFunctionLastBlank = 23,
2869+ CallFunctionLastTwoInStack = 24,
2870+ CellValueAsExpression = 25,
2871+ ErrorAndContinue = 26,
2872+ ErrorAndContinueWithOtherErrors = 27,
2873+ FixedCellValue = 28,
2874+ FixedCellRangeValue = 29,
2875+ CellValue = 30,
2876+ CellRangeValue = 31,
2877+ EnsureIsArray = 32,
2878+ EnsureYYTextIsArray = 33,
2879+ ReduceInt = 34,
2880+ ReducePercent = 35,
2881+ WrapCurrentTokenAsArray = 36,
2882+ EnsureLastTwoINArrayAndPush = 37,
2883+ ReflexiveReduce = 38,
2884+ ReduceFloat = 39,
2885+ ReducePrevAsPercent = 40,
2886+ ReduceLastThreeA = 41,
2887+ ReduceLastThreeB = 42,
2888+ AsError = 43,
2889+}
2890+export { ReduceActions };
2891diff --git a/dist/Parser/ReductionPair.d.ts b/dist/Parser/ReductionPair.d.ts
2892new file mode 100644
2893index 0000000..da3ee86
2894--- /dev/null
2895+++ b/dist/Parser/ReductionPair.d.ts
2896@@ -0,0 +1,19 @@
2897+/**
2898+ * Represents the length to reduce the stack by, and the replacement symbol that will replace those tokens in the stack.
2899+ */
2900+declare class ReductionPair {
2901+ private lengthToReduceStackBy;
2902+ private replacementSymbol;
2903+ constructor(replacementSymbol: number, length: number);
2904+ /**
2905+ * Get the number representing the length to reduce the stack by.
2906+ * @returns {number}
2907+ */
2908+ getLengthToReduceStackBy(): number;
2909+ /**
2910+ * Get the replacement token index.
2911+ * @returns {number}
2912+ */
2913+ getReplacementSymbol(): number;
2914+}
2915+export { ReductionPair };
2916diff --git a/dist/Parser/ReductionPair.js b/dist/Parser/ReductionPair.js
2917index ce872ec..b82afd0 100644
2918--- a/dist/Parser/ReductionPair.js
2919+++ b/dist/Parser/ReductionPair.js
2920@@ -3,7 +3,7 @@ exports.__esModule = true;
2921 /**
2922 * Represents the length to reduce the stack by, and the replacement symbol that will replace those tokens in the stack.
2923 */
2924-var ReductionPair = (function () {
2925+var ReductionPair = /** @class */ (function () {
2926 function ReductionPair(replacementSymbol, length) {
2927 this.lengthToReduceStackBy = length;
2928 this.replacementSymbol = replacementSymbol;
2929diff --git a/dist/Parser/RuleIndex.d.ts b/dist/Parser/RuleIndex.d.ts
2930new file mode 100644
2931index 0000000..49aa888
2932--- /dev/null
2933+++ b/dist/Parser/RuleIndex.d.ts
2934@@ -0,0 +1,37 @@
2935+declare const enum RuleIndex {
2936+ WhiteSpace = 0,
2937+ DoubleQuotes = 1,
2938+ SingleQuotes = 2,
2939+ FormulaName = 3,
2940+ $A1Cell = 6,
2941+ A1Cell = 7,
2942+ FormulaNameSimple = 8,
2943+ Variable = 9,
2944+ SimpleVariable = 10,
2945+ Integer = 11,
2946+ SelfContainedArray = 12,
2947+ DollarSign = 13,
2948+ Ampersand = 14,
2949+ SingleWhitespace = 15,
2950+ Period = 16,
2951+ Colon = 17,
2952+ Semicolon = 18,
2953+ Comma = 19,
2954+ Asterisk = 20,
2955+ ForwardSlash = 21,
2956+ Minus = 22,
2957+ Plus = 23,
2958+ Caret = 24,
2959+ OpenParen = 25,
2960+ CloseParen = 26,
2961+ GreaterThan = 27,
2962+ LessThanSign = 28,
2963+ OpenDoubleQuote = 30,
2964+ OpenSingleQuote = 31,
2965+ ExclamationPoint = 32,
2966+ Equals = 33,
2967+ Percent = 34,
2968+ FullError = 35,
2969+ EndOfString = 36,
2970+}
2971+export { RuleIndex };
2972diff --git a/dist/Parser/Rules.d.ts b/dist/Parser/Rules.d.ts
2973new file mode 100644
2974index 0000000..24bfc04
2975--- /dev/null
2976+++ b/dist/Parser/Rules.d.ts
2977@@ -0,0 +1,2 @@
2978+declare let RULES: any[];
2979+export { RULES };
2980diff --git a/dist/Parser/Symbols.d.ts b/dist/Parser/Symbols.d.ts
2981new file mode 100644
2982index 0000000..0a29106
2983--- /dev/null
2984+++ b/dist/Parser/Symbols.d.ts
2985@@ -0,0 +1,39 @@
2986+declare enum Symbol {
2987+ Accept = 0,
2988+ End = 1,
2989+ Error = 2,
2990+ Expressions = 3,
2991+ Expression = 4,
2992+ EOF = 5,
2993+ VariableSeq = 6,
2994+ Number = 9,
2995+ String = 10,
2996+ Ampersand = 11,
2997+ Equals = 12,
2998+ Plus = 13,
2999+ LeftParen = 14,
3000+ RightParen = 15,
3001+ LessThan = 16,
3002+ GreaterThan = 17,
3003+ Minus = 19,
3004+ Asterisk = 20,
3005+ Divide = 21,
3006+ Carrot = 22,
3007+ Function = 23,
3008+ ExpressionSeq = 24,
3009+ Cell = 25,
3010+ FixedCell = 26,
3011+ Colon = 27,
3012+ CellUpper = 28,
3013+ Array = 29,
3014+ Semicolon = 30,
3015+ Comma = 31,
3016+ Variable = 32,
3017+ Decimal = 33,
3018+ NumberUpper = 34,
3019+ Percent = 35,
3020+ FullError = 36,
3021+ ExclamationPoint = 37,
3022+ ReflexiveReduce = 38,
3023+}
3024+export { Symbol };
3025diff --git a/dist/Sheet.d.ts b/dist/Sheet.d.ts
3026new file mode 100644
3027index 0000000..13519e1
3028--- /dev/null
3029+++ b/dist/Sheet.d.ts
3030@@ -0,0 +1,107 @@
3031+import { Cell } from "./Cell";
3032+/**
3033+ * Represents a spreadsheet parser and data-store that act together as a functional spreadsheet.
3034+ */
3035+declare class Sheet {
3036+ private parser;
3037+ private dataStore;
3038+ constructor();
3039+ /**
3040+ * Iterate through cells in the data-store, returning the collected cells in the range.
3041+ * @param origin
3042+ * @param startCell
3043+ * @param endCell
3044+ * @returns {{index: Array; value: Array}}
3045+ */
3046+ iterateCells(origin: any, startCell: any, endCell: any): {
3047+ index: any[];
3048+ value: any[];
3049+ };
3050+ /**
3051+ * Call function with given arguments. Used for calling formulas.
3052+ * @param fn
3053+ * @param args
3054+ * @returns {any}
3055+ */
3056+ callFunction(fn: any, args: any): any;
3057+ /**
3058+ * Call variable, which could include calling a function.
3059+ * @param args
3060+ * @returns {any}
3061+ */
3062+ callVariable(args: any): any;
3063+ /**
3064+ * Fetch cell, updating dependencies in process.
3065+ * @param origin
3066+ * @param cellId
3067+ * @returns {Cell}
3068+ */
3069+ cellValue(origin: any, cellId: any): Cell;
3070+ /**
3071+ * Get a range of cells.
3072+ * @param origin - the cell id in A1 notation from which this range is being referenced.
3073+ * @param {string} start - first cell coordinate (in A1 notation) in iteration
3074+ * @param {string} end - final cell coordinate (in A1 notation) in iteration
3075+ * @returns {Array}
3076+ */
3077+ cellRangeValue(origin: any, start: string, end: string): any[];
3078+ /**
3079+ * Get a fixed cell value.
3080+ * @param origin
3081+ * @param id
3082+ * @returns {Cell}
3083+ */
3084+ fixedCellValue(origin: any, id: any): Cell;
3085+ /**
3086+ * Get a fixed cell value range.
3087+ * @param origin
3088+ * @param start
3089+ * @param end
3090+ * @returns {Array}
3091+ */
3092+ fixedCellRangeValue(origin: any, start: any, end: any): any[];
3093+ /**
3094+ * Recalculate dependencies for a cell.
3095+ * @param {Cell} cell
3096+ */
3097+ private recalculateCellDependencies(cell);
3098+ /**
3099+ * Executes the formula in a cell.
3100+ * @param {Cell} cell
3101+ * @returns {{error: Error; result: any} | {error: any; result: any}}
3102+ */
3103+ private calculateCellFormula(cell);
3104+ /**
3105+ * Add a cell to the data-store, recording and updating dependencies if necessary.
3106+ * @param {Cell} cell
3107+ */
3108+ private registerCellInDataStore(cell);
3109+ /**
3110+ * Parse a formula for a given cellId. This involves all calculations and look-ups.
3111+ * @param formula
3112+ * @param cellId
3113+ * @returns {any}
3114+ */
3115+ parse(formula: any, cellId: any): {
3116+ error: any;
3117+ result: any;
3118+ };
3119+ /**
3120+ * Set a cell's value, by id.
3121+ * @param {string} id
3122+ * @param {string} value
3123+ */
3124+ setCell(id: string, value: string): void;
3125+ /**
3126+ * Get a cell from the data-store, returning null if a cell is undefined.
3127+ * @param {string} id
3128+ * @returns {Cell}
3129+ */
3130+ getCell(id: string): Cell;
3131+ /**
3132+ * Load an a matrix of cells into the data-store.
3133+ * @param {Array<Array<any>>} input
3134+ */
3135+ load(input: Array<Array<any>>): void;
3136+}
3137+export { Sheet };
3138diff --git a/dist/Sheet.js b/dist/Sheet.js
3139index f0027c6..a14720e 100644
3140--- a/dist/Sheet.js
3141+++ b/dist/Sheet.js
3142@@ -9,7 +9,7 @@ var MoreUtils_1 = require("./Utilities/MoreUtils");
3143 /**
3144 * Represents a spreadsheet parser and data-store that act together as a functional spreadsheet.
3145 */
3146-var Sheet = (function () {
3147+var Sheet = /** @class */ (function () {
3148 function Sheet() {
3149 this.parser = Parser_1.FormulaParser(this);
3150 this.dataStore = new DataStore_1.DataStore();
3151diff --git a/dist/Utilities/ArgsChecker.d.ts b/dist/Utilities/ArgsChecker.d.ts
3152new file mode 100644
3153index 0000000..f4dacc4
3154--- /dev/null
3155+++ b/dist/Utilities/ArgsChecker.d.ts
3156@@ -0,0 +1,28 @@
3157+/**
3158+ * Static class to check argument length within expected ranges when calling functions.
3159+ */
3160+declare class ArgsChecker {
3161+ /**
3162+ * Checks to see if the arguments are of the correct length.
3163+ * @param args to check length of
3164+ * @param length expected length
3165+ * @param caller name of the function calling this function, for use in error message formatting
3166+ */
3167+ static checkLength(args: Array<any> | IArguments, length: number, caller?: string): void;
3168+ /**
3169+ * Checks to see if the arguments are at least a certain length.
3170+ * @param args to check length of
3171+ * @param length expected length
3172+ * @param caller name of the function calling this function, for use in error message formatting
3173+ */
3174+ static checkAtLeastLength(args: any, length: number, caller?: string): void;
3175+ /**
3176+ * Checks to see if the arguments are within a max and min, inclusively
3177+ * @param args to check length of
3178+ * @param low least number of arguments
3179+ * @param high max number of arguments
3180+ * @param caller name of the function calling this function, for use in error message formatting
3181+ */
3182+ static checkLengthWithin(args: any, low: number, high: number, caller?: string): void;
3183+}
3184+export { ArgsChecker };
3185diff --git a/dist/Utilities/ArgsChecker.js b/dist/Utilities/ArgsChecker.js
3186index ff7c368..c7e9bb6 100644
3187--- a/dist/Utilities/ArgsChecker.js
3188+++ b/dist/Utilities/ArgsChecker.js
3189@@ -4,7 +4,7 @@ var Errors_1 = require("../Errors");
3190 /**
3191 * Static class to check argument length within expected ranges when calling functions.
3192 */
3193-var ArgsChecker = (function () {
3194+var ArgsChecker = /** @class */ (function () {
3195 function ArgsChecker() {
3196 }
3197 /**
3198diff --git a/dist/Utilities/CriteriaFunctionFactory.d.ts b/dist/Utilities/CriteriaFunctionFactory.d.ts
3199new file mode 100644
3200index 0000000..d3be549
3201--- /dev/null
3202+++ b/dist/Utilities/CriteriaFunctionFactory.d.ts
3203@@ -0,0 +1,16 @@
3204+/**
3205+ * Creates a criteria function to evaluate elements in a range in an *IF function.
3206+ */
3207+declare class CriteriaFunctionFactory {
3208+ /**
3209+ * If the criteria is a number, use strict equality checking.
3210+ * If the criteria is a string, check to see if it is a comparator.
3211+ * If the criteria is a string, and it is not a comparator, check for regex.
3212+ * If the criteria is a string and has not matched the above, finally use strict equality checking as a fallback.
3213+ * If the criteria has not been set, default to false-returning criteria function.
3214+ * @param criteria
3215+ * @returns {(x:any)=>boolean}
3216+ */
3217+ static createCriteriaFunction(criteria: string): Function;
3218+}
3219+export { CriteriaFunctionFactory };
3220diff --git a/dist/Utilities/CriteriaFunctionFactory.js b/dist/Utilities/CriteriaFunctionFactory.js
3221index a1519ca..e2651ff 100644
3222--- a/dist/Utilities/CriteriaFunctionFactory.js
3223+++ b/dist/Utilities/CriteriaFunctionFactory.js
3224@@ -23,7 +23,7 @@ function wildCardRegex(c) {
3225 /**
3226 * Creates a criteria function to evaluate elements in a range in an *IF function.
3227 */
3228-var CriteriaFunctionFactory = (function () {
3229+var CriteriaFunctionFactory = /** @class */ (function () {
3230 function CriteriaFunctionFactory() {
3231 }
3232 /**
3233diff --git a/dist/Utilities/DateRegExBuilder.d.ts b/dist/Utilities/DateRegExBuilder.d.ts
3234new file mode 100644
3235index 0000000..03ebc2f
3236--- /dev/null
3237+++ b/dist/Utilities/DateRegExBuilder.d.ts
3238@@ -0,0 +1,123 @@
3239+/**
3240+ * Build a regular expression step by step, to make it easier to build and read the resulting regular expressions.
3241+ */
3242+declare class DateRegExBuilder {
3243+ private regexString;
3244+ private static ZERO_OR_MORE_SPACES;
3245+ static DateRegExBuilder(): DateRegExBuilder;
3246+ /**
3247+ * Start the regular expression builder by matching the start of a line and zero or more spaces.
3248+ * @returns {DateRegExBuilder} builder
3249+ */
3250+ start(): DateRegExBuilder;
3251+ /**
3252+ * End the regular expression builder by matching the end of the line.
3253+ * @returns {DateRegExBuilder} builder
3254+ */
3255+ end(): DateRegExBuilder;
3256+ /**
3257+ * Capture all month full name and short names to the regular expression.
3258+ * @returns {DateRegExBuilder} builder
3259+ */
3260+ MONTHNAME(): DateRegExBuilder;
3261+ /**
3262+ * Capture all month full name and short names to the regular expression, in addition to any followed by one or more
3263+ * spaces.
3264+ * @returns {DateRegExBuilder} builder
3265+ * @constructor
3266+ */
3267+ MONTHNAME_W_SPACE(): DateRegExBuilder;
3268+ /**
3269+ * Add capture group for optionally capturing day names.
3270+ * @returns {DateRegExBuilder} builder
3271+ * @constructor
3272+ */
3273+ OPTIONAL_DAYNAME(): DateRegExBuilder;
3274+ /**
3275+ * Add capture group for optionally capturing a comma followed by one or more spaces.
3276+ * @returns {DateRegExBuilder} builder
3277+ * @constructor
3278+ */
3279+ OPTIONAL_COMMA(): DateRegExBuilder;
3280+ /**
3281+ * Add capture group for capturing month digits between 01 and 12, inclusively.
3282+ * @returns {DateRegExBuilder} builder
3283+ * @constructor
3284+ */
3285+ MM(): DateRegExBuilder;
3286+ /**
3287+ * Add capture group for capturing month digits between 01 and 12, inclusively, in addition to any followed by one or
3288+ * more spaces.
3289+ * @returns {DateRegExBuilder} builder
3290+ * @constructor
3291+ */
3292+ MM_W_SPACE(): DateRegExBuilder;
3293+ /**
3294+ * Add capture group for capturing day digits between 01 and 31, inclusively.
3295+ * @returns {DateRegExBuilder} builder
3296+ * @constructor
3297+ */
3298+ DD(): DateRegExBuilder;
3299+ /**
3300+ * Add capture group for capturing day digits between 01 and 31, inclusively, in addition to any followed by one or
3301+ * more spaces.
3302+ * @returns {DateRegExBuilder} builder
3303+ * @constructor
3304+ */
3305+ DD_W_SPACE(): DateRegExBuilder;
3306+ /**
3307+ * Add capture group for capturing 4 digits or 3 digits starting with 0-9.
3308+ * @returns {DateRegExBuilder} builder
3309+ * @constructor
3310+ */
3311+ YYYY(): DateRegExBuilder;
3312+ /**
3313+ * Add capture group for capturing 1 through 4 digits.
3314+ * @returns {DateRegExBuilder} builder
3315+ * @constructor
3316+ */
3317+ YYYY14(): DateRegExBuilder;
3318+ /**
3319+ * Add capture group for capturing 1 through 4 digits, in addition to any followed by one or more spaces.
3320+ * @returns {DateRegExBuilder} builder
3321+ * @constructor
3322+ */
3323+ YYYY14_W_SPACE(): DateRegExBuilder;
3324+ YYYY2_OR_4_W_SPACE(): DateRegExBuilder;
3325+ /**
3326+ * Add capture group for a flexible delimiter, including ", ", " ", ". ", "\", "-".
3327+ * @returns {DateRegExBuilder} builder
3328+ * @constructor
3329+ */
3330+ FLEX_DELIMITER(): DateRegExBuilder;
3331+ /**
3332+ * Add capture group for a flexible delimiter, including ", ", " ", ".", "\", "-". Different from FLEX_DELIMITER
3333+ * in that it will match periods with zero or more spaces on either side.
3334+ * For reference: https://regex101.com/r/q1fp1z/1/
3335+ * @returns {DateRegExBuilder} builder
3336+ * @constructor
3337+ */
3338+ FLEX_DELIMITER_LOOSEDOT(): DateRegExBuilder;
3339+ /**
3340+ * Add an optional capture group for capturing timestamps including: "10am", "10:10", "10:10pm", "10:10:10",
3341+ * "10:10:10am", along with zero or more spaces after semi colons, AM or PM, and unlimited number of digits per unit.
3342+ * @returns {DateRegExBuilder} builder
3343+ * @constructor
3344+ */
3345+ OPTIONAL_TIMESTAMP_CAPTURE_GROUP(): DateRegExBuilder;
3346+ /**
3347+ * Add a capture group for capturing timestamps including: "10am", "10:10", "10:10pm", "10:10:10",
3348+ * "10:10:10am", along with zero or more spaces after semi colons, AM or PM, and unlimited number of digits per unit.
3349+ * See https://regex101.com/r/0bmj5n/1/ for more information of 9-digit maximum. One series, "12:00001989198298am",
3350+ * has a maximum of 10 digits: "0*(?:[1-9]{1}[0-9]{0,9})?"
3351+ * @returns {DateRegExBuilder} builder
3352+ * @constructor
3353+ */
3354+ TIMESTAMP_UNITS_CAPTURE_GROUP(): DateRegExBuilder;
3355+ /**
3356+ * Build the regular expression and ignore case.
3357+ * @returns {RegExp}
3358+ */
3359+ build(): RegExp;
3360+}
3361+export { DateRegExBuilder };
3362diff --git a/dist/Utilities/DateRegExBuilder.js b/dist/Utilities/DateRegExBuilder.js
3363index 33f8a2b..46385ef 100644
3364--- a/dist/Utilities/DateRegExBuilder.js
3365+++ b/dist/Utilities/DateRegExBuilder.js
3366@@ -3,7 +3,7 @@ exports.__esModule = true;
3367 /**
3368 * Build a regular expression step by step, to make it easier to build and read the resulting regular expressions.
3369 */
3370-var DateRegExBuilder = (function () {
3371+var DateRegExBuilder = /** @class */ (function () {
3372 function DateRegExBuilder() {
3373 this.regexString = "";
3374 }
3375@@ -182,7 +182,7 @@ var DateRegExBuilder = (function () {
3376 DateRegExBuilder.prototype.build = function () {
3377 return new RegExp(this.regexString, 'i');
3378 };
3379+ DateRegExBuilder.ZERO_OR_MORE_SPACES = "\\s*";
3380 return DateRegExBuilder;
3381 }());
3382-DateRegExBuilder.ZERO_OR_MORE_SPACES = "\\s*";
3383 exports.DateRegExBuilder = DateRegExBuilder;
3384diff --git a/dist/Utilities/Filter.d.ts b/dist/Utilities/Filter.d.ts
3385new file mode 100644
3386index 0000000..e832218
3387--- /dev/null
3388+++ b/dist/Utilities/Filter.d.ts
3389@@ -0,0 +1,42 @@
3390+/**
3391+ * Static class to help filter down Arrays
3392+ */
3393+declare class Filter {
3394+ /**
3395+ * Converts string values in array to 0
3396+ * @param arr to convert
3397+ * @returns {Array} array in which all string values have been converted to 0.
3398+ */
3399+ static stringValuesToZeros(arr: Array<any>): Array<any>;
3400+ /**
3401+ * Flatten an array of arrays of ...etc.
3402+ * @param values array of values
3403+ * @returns {Array} flattened array
3404+ */
3405+ static flatten(values: Array<any>): Array<any>;
3406+ /**
3407+ * Flatten an array of arrays of... etc, but throw an error if any are empty references.
3408+ * @param values array of values
3409+ * @returns {Array} flattened array
3410+ */
3411+ static flattenAndThrow(values: Array<any>): Array<any>;
3412+ /**
3413+ * Filter out all strings from an array.
3414+ * @param arr to filter
3415+ * @returns {Array} filtered array
3416+ */
3417+ static filterOutStringValues(arr: Array<any>): Array<any>;
3418+ /**
3419+ * Filters out non number values.
3420+ * @param arr to filter
3421+ * @returns {Array} filtered array
3422+ */
3423+ static filterOutNonNumberValues(arr: Array<any>): Array<any>;
3424+ /**
3425+ * Returns an array as unique values.
3426+ * @param arr - to filter down to uniques.
3427+ * @returns {Array}
3428+ */
3429+ static unique(arr: Array<any>): Array<any>;
3430+}
3431+export { Filter };
3432diff --git a/dist/Utilities/Filter.js b/dist/Utilities/Filter.js
3433index 48ce227..4560421 100644
3434--- a/dist/Utilities/Filter.js
3435+++ b/dist/Utilities/Filter.js
3436@@ -4,7 +4,7 @@ var Errors_1 = require("../Errors");
3437 /**
3438 * Static class to help filter down Arrays
3439 */
3440-var Filter = (function () {
3441+var Filter = /** @class */ (function () {
3442 function Filter() {
3443 }
3444 /**
3445diff --git a/dist/Utilities/MathHelpers.d.ts b/dist/Utilities/MathHelpers.d.ts
3446new file mode 100644
3447index 0000000..17a706e
3448--- /dev/null
3449+++ b/dist/Utilities/MathHelpers.d.ts
3450@@ -0,0 +1,90 @@
3451+/**
3452+ * Returns the continued fraction for the incomplete Beta function with parameters a and b modified by Lentz's method
3453+ * evaluated at x. For more information see http://jstat.github.io/special-functions.html#betacf
3454+ */
3455+declare function betacf(x: any, a: any, b: any): any;
3456+/**
3457+ * Returns the incomplete Beta function evaluated at (x,a,b). See http://jstat.github.io/special-functions.html#ibeta
3458+ * for more information.
3459+ */
3460+declare function ibeta(x: any, a: any, b: any): number;
3461+/**
3462+ * Returns the inverse of the incomplete Beta function evaluated at (p,a,b). For more information see
3463+ * http://jstat.github.io/special-functions.html#ibetainv
3464+ */
3465+declare function ibetainv(p: any, a: any, b: any): any;
3466+/**
3467+ * http://jstat.github.io/distributions.html
3468+ */
3469+declare function inv(x: any, df1: any, df2: any): number;
3470+/**
3471+ * Return the standard deviation of a vector. By defaut, the population standard deviation is returned. Passing true
3472+ * for the flag parameter returns the sample standard deviation. See http://jstat.github.io/vector.html#stdev for
3473+ * more information.
3474+ */
3475+declare function stdev(arr: any, flag: any): number;
3476+/**
3477+ * Return the variance of a vector. By default, the population variance is calculated. Passing true as the flag
3478+ * indicates computes the sample variance instead. See http://jstat.github.io/vector.html#variance for more
3479+ * information.
3480+ */
3481+declare function variance(arr: any, flag: any): number;
3482+/**
3483+ * Return the sum of a vector. See http://jstat.github.io/vector.html#sum for more information.
3484+ */
3485+declare function sum(arr: any): number;
3486+/**
3487+ * Return the mean of a vector. See http://jstat.github.io/vector.html#mean for more information.
3488+ */
3489+declare function mean(arr: any): number;
3490+/**
3491+ * Return the sum of squared errors of prediction of a vector. See http://jstat.github.io/vector.html#sumsqerr for
3492+ * more information.
3493+ */
3494+declare function sumsqerr(arr: any): number;
3495+/**
3496+ * Return the covariance of two vectors. See http://jstat.github.io/vector.html#covariance for more information.
3497+ */
3498+declare function covariance(arr1: any, arr2: any): number;
3499+/**
3500+ * Returns the Log-Gamma function evaluated at x. See http://jstat.github.io/special-functions.html#gammaln for more
3501+ * information.
3502+ */
3503+declare function gammaln(x: any): number;
3504+/**
3505+ * Returns the Gamma function evaluated at x. This is sometimes called the 'complete' gamma function. See
3506+ * http://jstat.github.io/special-functions.html#gammafn for more information.
3507+ */
3508+declare function gammafn(x: any): any;
3509+/**
3510+ * Returns the value of x in the cdf of the Gamma distribution with the parameters shape (k) and scale (theta). Notice
3511+ * that if using the alpha beta convention, scale = 1/beta. For more information see
3512+ * http://jstat.github.io/distributions.html#jStat.gamma.cdf
3513+ */
3514+declare function cdf(x: any, df1: any, df2: any): number;
3515+/**
3516+ * Returns the error function evaluated at x. See also:
3517+ *
3518+ * * http://jstat.github.io/special-functions.html#erf
3519+ *
3520+ * * https://github.com/jstat/jstat/search?utf8=%E2%9C%93&q=erf&type=
3521+ *
3522+ * @param x to evaluate
3523+ * @returns {number} error
3524+ */
3525+declare function erf(x: any): number;
3526+/**
3527+ * Returns the value of x in the pdf of the Gamma distribution with the parameters shape (k) and scale (theta). Notice
3528+ * that if using the alpha beta convention, scale = 1/beta. For more information see
3529+ * http://jstat.github.io/distributions.html#jStat.gamma.pdf
3530+ */
3531+declare function pdf(x: any, df1: any, df2: any): number;
3532+declare function betaln(x: any, y: any): number;
3533+declare function betafn(x: any, y: any): number;
3534+/**
3535+ * Cleans a float number.
3536+ * @param n - number to clean
3537+ * @returns {number} - clean number
3538+ */
3539+declare function cleanFloat(n: any): number;
3540+export { betacf, betafn, betaln, cdf, covariance, erf, gammafn, gammaln, ibeta, ibetainv, inv, mean, pdf, stdev, sum, sumsqerr, variance, cleanFloat };
3541diff --git a/dist/Utilities/MoreUtils.d.ts b/dist/Utilities/MoreUtils.d.ts
3542new file mode 100644
3543index 0000000..f9e7612
3544--- /dev/null
3545+++ b/dist/Utilities/MoreUtils.d.ts
3546@@ -0,0 +1,134 @@
3547+/**
3548+ * If the value is UNDEFINED, return true.
3549+ * @param value - Value to check if undefined.
3550+ * @returns {boolean}
3551+ */
3552+declare function isUndefined(value: any): boolean;
3553+/**
3554+ * If the value is DEFINED, return true.
3555+ * @param value - Value to check if is defined.
3556+ * @returns {boolean}
3557+ */
3558+declare function isDefined(value: any): boolean;
3559+/**
3560+ * Returns true if value is an instance of a Array.
3561+ * @param value
3562+ * @returns {boolean}
3563+ */
3564+declare function isArray(value: any): boolean;
3565+/**
3566+ * Alphabetical character to number.
3567+ * @param chr
3568+ * @returns {number}
3569+ */
3570+declare function characterToNumber(chr: any): number;
3571+/**
3572+ * Converts a number to an alphabetical character.
3573+ * @param num
3574+ * @returns {string}
3575+ */
3576+declare function numberToCharacter(num: any): string;
3577+/**
3578+ * Converts a quoted string to an un-quoted string: `"hey"` to `hey`
3579+ * @param str
3580+ * @returns {string}
3581+ */
3582+declare function string(str: any): any;
3583+/**
3584+ * Converts XY coordinates (eg {0, 0}) to A1 coordinates (eg {A1}).
3585+ * @param x
3586+ * @param y
3587+ * @returns {string}
3588+ */
3589+declare function convertXYtoA1Coordinates(x: any, y: any): any;
3590+/**
3591+ * Returns RowCol coordinates of an A1 cellId
3592+ * @param cellId
3593+ * @returns {Object}
3594+ */
3595+declare function A1toRowColCoordinates(cellId: any): {
3596+ row: number;
3597+ col: number;
3598+};
3599+/**
3600+ * Class for building formatted strings with commas, forced number of leading and trailing zeros, and arbitrary leading
3601+ * and trailing strings.
3602+ */
3603+declare class NumberStringBuilder {
3604+ private n;
3605+ private shouldUseComma;
3606+ private integerZeroCount;
3607+ private decimalZeroCount;
3608+ private maxDecimalPlaces;
3609+ private headString;
3610+ private tailString;
3611+ /**
3612+ * Static builder, easier than `new`.
3613+ * @returns {NumberStringBuilder}
3614+ */
3615+ static start(): NumberStringBuilder;
3616+ /**
3617+ * Pads a given string with "0" on the right or left side until it is a certain width.
3618+ * @param {string} str - String to pad.
3619+ * @param {number} width - Width to pad to. If this is less than the strings length, will do nothing.
3620+ * @param {string} type - "right" or "left" side to append zeroes.
3621+ * @returns {string}
3622+ */
3623+ private static pad(str, width, type);
3624+ /**
3625+ * Rounds a number n to a certain number of digits.
3626+ * @param n - Number to round.
3627+ * @param digits - Digits to round to.
3628+ * @returns {number}
3629+ */
3630+ private static round(n, digits);
3631+ /**
3632+ * Set the number that we'll be formatting.
3633+ * @param {number} n - Number.
3634+ * @returns {NumberStringBuilder}
3635+ */
3636+ number(n: number): NumberStringBuilder;
3637+ /**
3638+ * The number of zeros to force on the left side of the decimal.
3639+ * @param {number} zeros
3640+ * @returns {NumberStringBuilder}
3641+ */
3642+ integerZeros(zeros: number): NumberStringBuilder;
3643+ /**
3644+ * The number of zeros to force on the right side of the decimal.
3645+ * @param {number} zeros
3646+ * @returns {NumberStringBuilder}
3647+ */
3648+ decimalZeros(zeros: number): NumberStringBuilder;
3649+ /**
3650+ * If you would like to force the maximum number of decimal places, without padding with zeros, set this.
3651+ * WARNING: Should not be used in conjunction with decimalZeros().
3652+ * @param {number} maxDecimalPlaces
3653+ * @returns {NumberStringBuilder}
3654+ */
3655+ maximumDecimalPlaces(maxDecimalPlaces: number): NumberStringBuilder;
3656+ /**
3657+ * Should digits to the left side of the decimal use comma-notation?
3658+ * @param {boolean} shouldUseComma
3659+ * @returns {NumberStringBuilder}
3660+ */
3661+ commafy(shouldUseComma: boolean): NumberStringBuilder;
3662+ /**
3663+ * String to append to the beginning of the final formatted number.
3664+ * @param {string} head
3665+ * @returns {NumberStringBuilder}
3666+ */
3667+ head(head: string): NumberStringBuilder;
3668+ /**
3669+ * String to append to the end of the final formatted number.
3670+ * @param {string} tail
3671+ * @returns {NumberStringBuilder}
3672+ */
3673+ tail(tail: string): NumberStringBuilder;
3674+ /**
3675+ * Building the string using the rules set in this builder.
3676+ * @returns {string}
3677+ */
3678+ build(): string;
3679+}
3680+export { isDefined, isUndefined, isArray, string, numberToCharacter, convertXYtoA1Coordinates, A1toRowColCoordinates, characterToNumber, NumberStringBuilder };
3681diff --git a/dist/Utilities/MoreUtils.js b/dist/Utilities/MoreUtils.js
3682index 4daf968..c9c8639 100644
3683--- a/dist/Utilities/MoreUtils.js
3684+++ b/dist/Utilities/MoreUtils.js
3685@@ -98,7 +98,7 @@ exports.A1toRowColCoordinates = A1toRowColCoordinates;
3686 * Class for building formatted strings with commas, forced number of leading and trailing zeros, and arbitrary leading
3687 * and trailing strings.
3688 */
3689-var NumberStringBuilder = (function () {
3690+var NumberStringBuilder = /** @class */ (function () {
3691 function NumberStringBuilder() {
3692 this.shouldUseComma = false;
3693 this.integerZeroCount = 1; // e.g. default to "0.1"
3694diff --git a/dist/Utilities/ObjectBuilder.d.ts b/dist/Utilities/ObjectBuilder.d.ts
3695new file mode 100644
3696index 0000000..c293175
3697--- /dev/null
3698+++ b/dist/Utilities/ObjectBuilder.d.ts
3699@@ -0,0 +1,11 @@
3700+/**
3701+ * Utility class to help build objects programmatically. Basically this allows me to have source code where constants
3702+ * are keys in objects.
3703+ */
3704+declare class ObjectBuilder {
3705+ o: Object;
3706+ static add(k: any, v: any): ObjectBuilder;
3707+ add(k: any, v: any): ObjectBuilder;
3708+ build(): Object;
3709+}
3710+export { ObjectBuilder };
3711diff --git a/dist/Utilities/ObjectBuilder.js b/dist/Utilities/ObjectBuilder.js
3712index 195367a..261aecc 100644
3713--- a/dist/Utilities/ObjectBuilder.js
3714+++ b/dist/Utilities/ObjectBuilder.js
3715@@ -4,7 +4,7 @@ exports.__esModule = true;
3716 * Utility class to help build objects programmatically. Basically this allows me to have source code where constants
3717 * are keys in objects.
3718 */
3719-var ObjectBuilder = (function () {
3720+var ObjectBuilder = /** @class */ (function () {
3721 function ObjectBuilder() {
3722 this.o = {};
3723 }
3724diff --git a/dist/Utilities/Serializer.d.ts b/dist/Utilities/Serializer.d.ts
3725new file mode 100644
3726index 0000000..2c13229
3727--- /dev/null
3728+++ b/dist/Utilities/Serializer.d.ts
3729@@ -0,0 +1,7 @@
3730+/**
3731+ * Class to hold static methods for serialization.
3732+ */
3733+declare class Serializer {
3734+ static serialize(value: any): string;
3735+}
3736+export { Serializer };
3737diff --git a/dist/Utilities/Serializer.js b/dist/Utilities/Serializer.js
3738index 7028479..733122d 100644
3739--- a/dist/Utilities/Serializer.js
3740+++ b/dist/Utilities/Serializer.js
3741@@ -3,7 +3,7 @@ exports.__esModule = true;
3742 /**
3743 * Class to hold static methods for serialization.
3744 */
3745-var Serializer = (function () {
3746+var Serializer = /** @class */ (function () {
3747 function Serializer() {
3748 }
3749 Serializer.serialize = function (value) {
3750diff --git a/dist/Utilities/TypeConverter.d.ts b/dist/Utilities/TypeConverter.d.ts
3751new file mode 100644
3752index 0000000..8384beb
3753--- /dev/null
3754+++ b/dist/Utilities/TypeConverter.d.ts
3755@@ -0,0 +1,171 @@
3756+import * as moment from "moment";
3757+/**
3758+ * Static class of helpers used to convert let ious types to each other.
3759+ */
3760+declare class TypeConverter {
3761+ static ORIGIN_MOMENT: moment.Moment;
3762+ private static SECONDS_IN_DAY;
3763+ /**
3764+ * Converts a datetime string to a moment object. Will return undefined if the string can't be converted.
3765+ * @param {string} timeString - string to parse and convert.
3766+ * @returns {moment.Moment}
3767+ */
3768+ static stringToMoment(timeString: string): moment.Moment;
3769+ /**
3770+ * Converts a time-formatted string to a number between 0 and 1, exclusive on 1.
3771+ * @param timeString
3772+ * @returns {number} representing time of day
3773+ */
3774+ static stringToTimeNumber(timeString: string): number;
3775+ /**
3776+ * Parses a string returning a moment that is either valid, invalid or undefined.
3777+ * @param dateString to parse.
3778+ * @returns {moment}
3779+ */
3780+ private static parseStringToMoment(dateString);
3781+ /**
3782+ * Parses a string as a date number. Throws error if parsing not possible.
3783+ * @param dateString to parse
3784+ * @returns {number} resulting date
3785+ */
3786+ static stringToDateNumber(dateString: string): number;
3787+ /**
3788+ * Converts strings to numbers, returning undefined if string cannot be parsed to number. Examples: "100", "342424",
3789+ * "10%", "33.213131", "41.1231", "10e+1", "10E-1", "10.44E1", "-$9.29", "+$9.29", "1,000.1", "2000,000,000".
3790+ * For reference see: https://regex101.com/r/PwghnF/9/
3791+ * @param value to parse.
3792+ * @returns {number} or undefined
3793+ */
3794+ static stringToNumber(value: string): number;
3795+ /**
3796+ * Converts any value to an inverted number or throws an error if it cannot coerce it to the number type
3797+ * @param value to convert
3798+ * @returns {number} to return. Will always return a number or throw an error. Never returns undefined.
3799+ */
3800+ static valueToInvertedNumber(value: any): number;
3801+ /**
3802+ * Converts any value to a number or throws an error if it cannot coerce it to the number type
3803+ * @param value to convert
3804+ * @returns {number} to return. Will always return a number or throw an error. Never returns undefined.
3805+ */
3806+ static valueToNumber(value: any): number;
3807+ /**
3808+ * Converts any value to a number, defaulting to 0 value in cases in which it cannot coerce it to a number type
3809+ * @param value to conver
3810+ * @returns {number} to return. Will always return a number or 0.
3811+ */
3812+ static valueToNumberGracefully(value: any): number;
3813+ /**
3814+ * Converts any value to a boolean or throws an error if it cannot coerce it to the boolean type.
3815+ * @param value to convert
3816+ * @returns {boolean} to return.
3817+ */
3818+ static valueToBoolean(value: any): boolean;
3819+ /**
3820+ * Convert a value to string.
3821+ * @param value of any type, including array. array cannot be empty.
3822+ * @returns {string} string representation of value
3823+ */
3824+ static valueToString(value: any): string;
3825+ /**
3826+ * Converts a value to a time number; a value between 0 and 1, exclusive on 1.
3827+ * @param value to convert
3828+ * @returns {number} representing a time value
3829+ */
3830+ static valueToTimestampNumber(value: any): number;
3831+ /**
3832+ * Returns true if string is number format.
3833+ * @param str to check
3834+ * @returns {boolean}
3835+ */
3836+ static isNumber(str: string): boolean;
3837+ /**
3838+ * Returns true if we can coerce it to the number type.
3839+ * @param value to coerce
3840+ * @returns {boolean} if could be coerced to a number
3841+ */
3842+ static canCoerceToNumber(value: any): boolean;
3843+ /**
3844+ * Takes any input type and will throw a REF_ERROR or coerce it into a number.
3845+ * @param input to attempt to coerce into a number
3846+ * @returns {number} number representation of the input
3847+ */
3848+ static firstValueAsNumber(input: any): number;
3849+ /**
3850+ * Takes any input type and will throw a REF_ERROR or coerce it into a string.
3851+ * @param input to attempt to coerce into a string
3852+ * @returns {number} number representation of the input
3853+ */
3854+ static firstValueAsString(input: any): string;
3855+ /**
3856+ * Returns the first value that is not of the type array. Will throw RefError if any empty arrays are passed in.
3857+ * @param input to retrieve first value of
3858+ * @returns {any} any non-array value.
3859+ */
3860+ static firstValue(input: any): any;
3861+ /**
3862+ * Takes any input type and will throw a REF_ERROR or coerce it into a string.
3863+ * @param input to attempt to coerce into a string
3864+ * @returns {number} number representation of the input
3865+ */
3866+ static firstValueAsBoolean(input: any): boolean;
3867+ /**
3868+ * Takes the input type and will throw a REF_ERROR or coerce it into a date number
3869+ * @param input input to attempt to coerce to a date number
3870+ * @param coerceBoolean should a boolean be converted
3871+ * @returns {number} representing a date
3872+ */
3873+ static firstValueAsDateNumber(input: any, coerceBoolean?: boolean): number;
3874+ /**
3875+ * Takes the input type and will throw a REF_ERROR or coerce it into a time number
3876+ * @param input input to attempt to coerce to a time number
3877+ * @returns {number} representing time of day
3878+ */
3879+ static firstValueAsTimestampNumber(input: any): number;
3880+ /**
3881+ * Convert a value to date number if possible.
3882+ * @param value to convert
3883+ * @param coerceBoolean should a boolean be converted
3884+ * @returns {number} date
3885+ */
3886+ static valueToDateNumber(value: any, coerceBoolean?: boolean): number;
3887+ /**
3888+ * Converts a moment to a date number.
3889+ * @param m to convert
3890+ * @returns {number} date
3891+ */
3892+ static momentToNumber(m: moment.Moment): number;
3893+ /**
3894+ * Converts a moment to a date number, floored to the whole day date.
3895+ * @param m to convert
3896+ * @returns {number} date
3897+ */
3898+ static momentToDayNumber(m: moment.Moment): number;
3899+ /**
3900+ * Converts a number to moment.
3901+ * @param n to convert
3902+ * @returns {Moment} date
3903+ */
3904+ static numberToMoment(n: number): moment.Moment;
3905+ /**
3906+ * Converts a number to moment while preserving the decimal part of the number.
3907+ * @param n to convert
3908+ * @returns {Moment} date
3909+ */
3910+ static decimalNumberToMoment(n: number): moment.Moment;
3911+ /**
3912+ * Using timestamp units, create a time number between 0 and 1, exclusive on end.
3913+ * @param hours
3914+ * @param minutes
3915+ * @param seconds
3916+ * @returns {number} representing time of day between 0 and 1, exclusive on end.
3917+ */
3918+ static unitsToTimeNumber(hours: number, minutes: number, seconds: number): number;
3919+}
3920+/**
3921+ * Catches divide by zero situations and throws them as errors
3922+ * @param n number to check
3923+ * @returns {number} n as long as it's not zero.
3924+ */
3925+declare let checkForDevideByZero: (n: number) => number;
3926+export { TypeConverter, checkForDevideByZero };
3927diff --git a/dist/Utilities/TypeConverter.js b/dist/Utilities/TypeConverter.js
3928index f539e0a..f181698 100644
3929--- a/dist/Utilities/TypeConverter.js
3930+++ b/dist/Utilities/TypeConverter.js
3931@@ -73,19 +73,19 @@ function isDefined(x) {
3932 */
3933 function matchTimestampAndMutateMoment(timestampString, momentToMutate) {
3934 var matches = timestampString.match(TIMESTAMP);
3935- if (matches && matches[1] !== undefined) {
3936+ if (matches && matches[1] !== undefined) { // 10am
3937 var hours = parseInt(matches[2]);
3938 if (hours > 12) {
3939 throw new Error();
3940 }
3941 momentToMutate.add(hours, 'hours');
3942 }
3943- else if (matches && matches[6] !== undefined) {
3944+ else if (matches && matches[6] !== undefined) { // 10:10
3945 var hours = parseInt(matches[7]);
3946 var minutes = parseInt(matches[8]);
3947 momentToMutate.add(hours, 'hours').add(minutes, 'minutes');
3948 }
3949- else if (matches && matches[11] !== undefined) {
3950+ else if (matches && matches[11] !== undefined) { // 10:10am
3951 var hours = parseInt(matches[13]);
3952 var minutes = parseInt(matches[14]);
3953 var pmTrue = (matches[16].toLowerCase() === "pm");
3954@@ -103,13 +103,13 @@ function matchTimestampAndMutateMoment(timestampString, momentToMutate) {
3955 }
3956 momentToMutate.add(minutes, 'minutes');
3957 }
3958- else if (matches && matches[17] !== undefined) {
3959+ else if (matches && matches[17] !== undefined) { // 10:10:10
3960 var hours = parseInt(matches[19]);
3961 var minutes = parseInt(matches[20]);
3962 var seconds = parseInt(matches[21]);
3963 momentToMutate.add(hours, 'hours').add(minutes, 'minutes').add(seconds, 'seconds');
3964 }
3965- else if (matches && matches[23] !== undefined) {
3966+ else if (matches && matches[23] !== undefined) { // // 10:10:10am
3967 var hours = parseInt(matches[25]);
3968 var minutes = parseInt(matches[26]);
3969 var seconds = parseInt(matches[27]);
3970@@ -136,7 +136,7 @@ function matchTimestampAndMutateMoment(timestampString, momentToMutate) {
3971 /**
3972 * Static class of helpers used to convert let ious types to each other.
3973 */
3974-var TypeConverter = (function () {
3975+var TypeConverter = /** @class */ (function () {
3976 function TypeConverter() {
3977 }
3978 /**
3979@@ -782,10 +782,10 @@ var TypeConverter = (function () {
3980 var v = (((hours % 24) * 60 * 60) + ((minutes) * 60) + (seconds)) / 86400;
3981 return v % 1;
3982 };
3983+ TypeConverter.ORIGIN_MOMENT = moment.utc([1899, 11, 30]).startOf("day");
3984+ TypeConverter.SECONDS_IN_DAY = 86400;
3985 return TypeConverter;
3986 }());
3987-TypeConverter.ORIGIN_MOMENT = moment.utc([1899, 11, 30]).startOf("day");
3988-TypeConverter.SECONDS_IN_DAY = 86400;
3989 exports.TypeConverter = TypeConverter;
3990 /**
3991 * Catches divide by zero situations and throws them as errors
3992@@ -794,7 +794,7 @@ exports.TypeConverter = TypeConverter;
3993 */
3994 var checkForDevideByZero = function (n) {
3995 n = +n; // Coerce to number.
3996- if (!n) {
3997+ if (!n) { // Matches +0, -0, NaN
3998 throw new Errors_1.DivZeroError("Evaluation of function caused a divide by zero error.");
3999 }
4000 return n;
4001diff --git a/package.json b/package.json
4002index 6593bf3..404994a 100644
4003--- a/package.json
4004+++ b/package.json
4005@@ -17,5 +17,6 @@
4006 },
4007 "devDependencies": {
4008 "typescript": "^2.3.2"
4009- }
4010+ },
4011+ "types": "./dist/Sheet.d.ts"
4012 }
4013diff --git a/tsconfig.json b/tsconfig.json
4014index 7396082..e76ee65 100644
4015--- a/tsconfig.json
4016+++ b/tsconfig.json
4017@@ -1,10 +1,10 @@
4018 {
4019 "compilerOptions": {
4020- "allowJs": true,
4021 "allowUnreachableCode": true,
4022 "allowUnusedLabels": true,
4023 "outDir": "dist",
4024- "sourceMap": false
4025+ "sourceMap": false,
4026+ "declaration": true
4027 },
4028 "files": [
4029 "src/Sheet.ts"