@sheetxl/formulas 0.8.0-beta.11 → 0.8.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{node/esm/DatkcV-D0mA7WYmb.mjs → browser/esm/3WuDomWmdEKeZbbG.mjs} +1 -1
- package/browser/esm/{LWIfDqgl4BWsGN40.mjs → BR0hfMJeizGLzQyZ.mjs} +1 -1
- package/browser/esm/{D5lfhEj0O0vGXGIU.mjs → BSbkSGYSUJNq_hqv.mjs} +1 -1
- package/browser/esm/{Cm5b94jC90pgvgEQ.mjs → BTtjJHW0OffnZJzw.mjs} +1 -1
- package/{node/esm/DY3Yp4g7FpjDC4Ux.mjs → browser/esm/BgSZby_sWDnOsdXg.mjs} +1 -1
- package/browser/esm/{BL5O9xv74605fjZ0.mjs → BmaRiVdIUgF4vbLG.mjs} +13 -7
- package/browser/esm/{zNQMTF4Mftkd8m3i.mjs → BnFUk4nDKrwcn2lh.mjs} +1 -1
- package/{node/esm/qzngIvn0BfOU7J6v.mjs → browser/esm/Bp5Bu5Mlbs1dO6WO.mjs} +1 -1
- package/browser/esm/{BAu7VttBhgl5A9Ux.mjs → BvKsdIEViy4fMwhf.mjs} +1 -1
- package/browser/esm/{CpyKqbMxs8fgNUrm.mjs → C5TC2uUvcVuVyXHL.mjs} +1 -1
- package/browser/esm/{CCTNn0CmYTRTR9uu.mjs → CKI92sNkVKkaDqNh.mjs} +1 -1
- package/{node/esm/BL3CLO1ngbZPNUSj.mjs → browser/esm/CNEodHdQn14H1-5Y.mjs} +1 -1
- package/browser/esm/{D0PDit-Emky4tG76.mjs → CUusMzsATShxE804.mjs} +1 -1
- package/browser/esm/{CkvBF6_lFpJ8lzWn.mjs → Cg0aJ8YiUob7UwB0.mjs} +1 -1
- package/browser/esm/{Bjdqhk-JMohE4sBN.mjs → D-wDBNKAgLWkLGin.mjs} +104 -32
- package/{node/esm/nW1VYp24XfapwOYa.mjs → browser/esm/D1nqrNVXoLdxOcgY.mjs} +1 -1
- package/browser/esm/{CS2YxGzDK80pF1TP.mjs → D9fexU1-mdcSP2iQ.mjs} +1 -1
- package/browser/esm/{CpKG2VMt7bLP4_Az.mjs → DNDB1mXiSsh0bafX.mjs} +1 -1
- package/browser/esm/DV-ZFUlItxUMktFi.mjs +30 -0
- package/{node/esm/BTOiKBFUYxECGgpN.mjs → browser/esm/DZpOzJdF5Aq0XKsk.mjs} +1 -1
- package/{node/esm/CJVp8EBHRn_OMdXr.mjs → browser/esm/DjyHh018kLhr0Mei.mjs} +1 -1
- package/browser/esm/{Dz2Vh5VXT4u2caUb.mjs → DoskhFg8-rD--hBe.mjs} +1 -1
- package/{node/esm/DE0FWfy3dgRhUs6j.mjs → browser/esm/DuXvjmotXWlE-MjK.mjs} +1 -1
- package/browser/esm/{_haW8KO4uxcUjPNq.mjs → aC8_V2oEKhP24LGQ.mjs} +1 -1
- package/browser/esm/declarations.mjs +35 -31
- package/browser/esm/{TdOBTLcfAEs2lvw1.mjs → fXwy-eKzVb7M6AyK.mjs} +1 -1
- package/browser/esm/index.mjs +2161 -1876
- package/node/esm/{D0jAK0A5JwzRhV5i.mjs → -G_Hzhf2rR28IBi2.mjs} +1 -1
- package/{browser/esm/DatkcV-D0mA7WYmb.mjs → node/esm/3WuDomWmdEKeZbbG.mjs} +1 -1
- package/node/esm/{DgrvMX5JkTolu68g.mjs → B3NIBuFdxhYgtm0v.mjs} +1 -1
- package/node/esm/{CI_lC0jwf_Z5jdqc.mjs → BFejh_-BKH7d4VU_.mjs} +1 -1
- package/node/esm/{LWIfDqgl4BWsGN40.mjs → BR0hfMJeizGLzQyZ.mjs} +1 -1
- package/{browser/esm/DY3Yp4g7FpjDC4Ux.mjs → node/esm/BgSZby_sWDnOsdXg.mjs} +1 -1
- package/node/esm/{zNQMTF4Mftkd8m3i.mjs → BnFUk4nDKrwcn2lh.mjs} +1 -1
- package/{browser/esm/qzngIvn0BfOU7J6v.mjs → node/esm/Bp5Bu5Mlbs1dO6WO.mjs} +1 -1
- package/node/esm/{CpyKqbMxs8fgNUrm.mjs → C5TC2uUvcVuVyXHL.mjs} +1 -1
- package/node/esm/{qFHh9pVgQa0ZMumi.mjs → CCK3HvWAkhoPqNVn.mjs} +13 -7
- package/node/esm/{BBP--4zd6B0_Rt4G.mjs → CE015xqWfBU0RDwN.mjs} +1 -1
- package/{browser/esm/BL3CLO1ngbZPNUSj.mjs → node/esm/CNEodHdQn14H1-5Y.mjs} +1 -1
- package/{browser/esm/nW1VYp24XfapwOYa.mjs → node/esm/D1nqrNVXoLdxOcgY.mjs} +1 -1
- package/node/esm/{CS2YxGzDK80pF1TP.mjs → D9fexU1-mdcSP2iQ.mjs} +1 -1
- package/node/esm/{CpKG2VMt7bLP4_Az.mjs → DNDB1mXiSsh0bafX.mjs} +1 -1
- package/node/esm/DV-ZFUlItxUMktFi.mjs +30 -0
- package/{browser/esm/BTOiKBFUYxECGgpN.mjs → node/esm/DZpOzJdF5Aq0XKsk.mjs} +1 -1
- package/{browser/esm/CJVp8EBHRn_OMdXr.mjs → node/esm/DjyHh018kLhr0Mei.mjs} +1 -1
- package/node/esm/{Dz2Vh5VXT4u2caUb.mjs → DoskhFg8-rD--hBe.mjs} +1 -1
- package/{browser/esm/DE0FWfy3dgRhUs6j.mjs → node/esm/DuXvjmotXWlE-MjK.mjs} +1 -1
- package/node/esm/{euzKAV6QFwFyMtRz.mjs → DzwnOmlnm63qulqP.mjs} +1 -1
- package/node/esm/{BjhGKO4xoRsWtL_b.mjs → FET0QZ4bmHRpACHN.mjs} +1 -1
- package/node/esm/{515xLSpvB54fgWJI.mjs → Sa4BQzT3nmlBqF85.mjs} +104 -32
- package/node/esm/{_haW8KO4uxcUjPNq.mjs → aC8_V2oEKhP24LGQ.mjs} +1 -1
- package/node/esm/declarations.mjs +35 -31
- package/node/esm/{TdOBTLcfAEs2lvw1.mjs → fXwy-eKzVb7M6AyK.mjs} +1 -1
- package/node/esm/index.mjs +3634 -3346
- package/package.json +3 -3
- package/types/src/.generated/decl/financial/MarketHistory.decl.d.ts +4 -0
- package/types/src/.generated/desc/financial/MarketHistory.desc.d.ts +4 -0
- package/types/src/_utils/Arithmetic.d.ts +16 -0
- package/types/src/financial/MarketHistory.d.ts +40 -0
- package/types/src/lookupReference/Reference.d.ts +35 -6
- package/types/src/testing/Testing.d.ts +2 -2
- package/types/src/web/FilterXML.d.ts +1 -1
- package/types/src/web/Web.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/formulas",
|
|
3
3
|
"description": "Formulas - TypeScript formulas compatible with Excel built-ins.",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.12",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"formulas"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@sheetxl/primitives": "^0.8.0-beta.
|
|
46
|
-
"@sheetxl/scripting": "^0.8.0-beta.
|
|
45
|
+
"@sheetxl/primitives": "^0.8.0-beta.12",
|
|
46
|
+
"@sheetxl/scripting": "^0.8.0-beta.12",
|
|
47
47
|
"bahttext": "^2.4.0",
|
|
48
48
|
"bessel": "^1.0.2"
|
|
49
49
|
}
|
|
@@ -12,6 +12,22 @@
|
|
|
12
12
|
* the arctangent.
|
|
13
13
|
*/
|
|
14
14
|
export declare const flushSubnormal: (value: number) => number;
|
|
15
|
+
/**
|
|
16
|
+
* The shift Excel adds to a count or position argument before truncating it.
|
|
17
|
+
*
|
|
18
|
+
* It is a small ABSOLUTE constant, so a value just under an integer counts as that integer at any
|
|
19
|
+
* magnitude: `LEFT("hello",0.9999999)` is "h" and `LEFT("hello",0.999999)` — one digit less — is
|
|
20
|
+
* the empty string.
|
|
21
|
+
*
|
|
22
|
+
* Which functions shift is a PER-FUNCTION fact, not an engine one, and the family is split down
|
|
23
|
+
* the middle: LEFT, RIGHT, FIND, SEARCH, REPLACE, SUBSTITUTE, CHAR, INDEX and ROUND shift, while
|
|
24
|
+
* MID, REPT and UNICHAR truncate the double as it stands (`MID("hello",0.9999999,1)` is #VALUE!
|
|
25
|
+
* and `UNICHAR(0.9999999)` is too). So this is applied per call site rather than in the
|
|
26
|
+
* declaration.
|
|
27
|
+
*/
|
|
28
|
+
export declare const COUNT_EPSILON: number;
|
|
29
|
+
/** A count or position argument, shifted by {@link COUNT_EPSILON} and truncated. */
|
|
30
|
+
export declare const excelCount: (count: number) => number;
|
|
15
31
|
/**
|
|
16
32
|
* The inverse hyperbolic tangent, decomposed the way a C library does it — the log form above
|
|
17
33
|
* half and `log1p` below — rather than through the platform's `Math.atanh`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Scalar, Flatten, Omittable } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an array of historical quote data for a symbol and date range you specify.
|
|
4
|
+
* @param stock the ticker symbol of the financial instrument (`"IBM"`).
|
|
5
|
+
* @param startDate the first date to return data from.
|
|
6
|
+
* @param endDate the last date to return data from. Default is the start date.
|
|
7
|
+
* @param interval the granularity of the data: `0` daily, `1` weekly, `2` monthly. Default is `0`.
|
|
8
|
+
* @param headers whether to add column headers: `0` none, `1` a header row, `2` the instrument identifier and a header row. Default is `1`.
|
|
9
|
+
* @param properties the columns to return, each a number: `0` Date, `1` Close, `2` Open, `3` High, `4` Low, `5` Volume. Default is Date and Close.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* * The cell shows `#BUSY!` until the quotes arrive, then spills one row per bar, ascending.
|
|
13
|
+
* * Quotes come from [Alpha Vantage](https://www.alphavantage.co), which needs an API key:
|
|
14
|
+
* `ALPHAVANTAGE_API_KEY` on the global object or in the environment. Without one the service's
|
|
15
|
+
* `demo` key is used, which answers for `IBM` only. A free key allows 25 requests a day.
|
|
16
|
+
* * An unknown symbol is `#N/A`. A spent request budget is `#VALUE!` carrying the service's notice.
|
|
17
|
+
* * A recalculation does not ask again; the quotes are kept with the cell. Reopening the file does.
|
|
18
|
+
* * Excel accepts a Stock data type for `stock`; here it is the ticker text.
|
|
19
|
+
*/
|
|
20
|
+
export declare function STOCKHISTORY(stock: string, startDate: number, endDate?: Omittable<number>, interval?: Omittable<number>, headers?: Omittable<number>, properties?: Flatten<Scalar>): Scalar[][];
|
|
21
|
+
/**
|
|
22
|
+
* Returns the daily exchange rate of one currency in another over a period, from the European
|
|
23
|
+
* Central Bank's reference rates.
|
|
24
|
+
* @param from the currency to convert from, as an ISO code (`"USD"`).
|
|
25
|
+
* @param to the currency to convert to, as an ISO code (`"EUR"`).
|
|
26
|
+
* @param startDate the first date of the period.
|
|
27
|
+
* @param endDate the last date of the period. Default is the start date.
|
|
28
|
+
* @param headers whether to add column headers: `0` none, `1` a header row, `2` the pair and a header row. Default is `1`.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* * Spills one row per business day in the period, with the date and the rate. The cell shows
|
|
32
|
+
* `#BUSY!` until the rates arrive.
|
|
33
|
+
* * Rates are the ECB's daily reference rates (about 16:00 CET), published on TARGET business
|
|
34
|
+
* days; weekends and holidays have no row.
|
|
35
|
+
* * Both currencies must be among the roughly thirty the ECB publishes; another is `#N/A`.
|
|
36
|
+
* * A recalculation does not ask again; the rates are kept with the cell. Reopening the file does.
|
|
37
|
+
* * Data by [Frankfurter](https://frankfurter.dev), a free service with no key. Please do not abuse it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function FXHISTORY(from: string, to: string, startDate: number, endDate?: Omittable<number>, headers?: Omittable<number>): Scalar[][];
|
|
40
|
+
//# sourceMappingURL=MarketHistory.d.ts.map
|
|
@@ -70,11 +70,10 @@ export declare function DROP(array: IRange, row: number, columns?: Omittable<num
|
|
|
70
70
|
export declare function EXPAND(array: IRange | Scalar, row: Omittable<number>, columns?: Omittable<number>, padWith?: NoLift<Omittable<AcceptError<Scalar>>>): IRange;
|
|
71
71
|
/**
|
|
72
72
|
* Extracts a value from a field of a given record.
|
|
73
|
-
* @hidden Unimplemented RichData
|
|
74
73
|
* @param value The record from which you want to extract the field.
|
|
75
74
|
* @param fieldName The names of the field or fields that you want to extract.
|
|
76
75
|
*/
|
|
77
|
-
export declare function FIELDVALUE(value: AcceptError<IRichData>, fieldName: string): Scalar
|
|
76
|
+
export declare function FIELDVALUE(value: AcceptError<IRichData>, fieldName: string): Scalar | IRange;
|
|
78
77
|
/**
|
|
79
78
|
* Filter a range or array.
|
|
80
79
|
* @param array the range or array to filter.
|
|
@@ -112,21 +111,51 @@ export declare function HLOOKUP(lookupValue: Scalar, tableArray: Flatten<IRange>
|
|
|
112
111
|
export declare function HSTACK(array: Repeating<IRange, 254>): IRange;
|
|
113
112
|
/**
|
|
114
113
|
* Creates a shortcut or jump that opens a document stored on your hard drive, a network server, or on the Internet.
|
|
115
|
-
* @hidden Unimplemented RichData
|
|
116
114
|
* @param linkLocation is the text giving the path and file name to the document to be opened, a hard drive location, UNC address, or URL path.
|
|
117
115
|
* @param friendlyName is text or a number that is displayed in the cell. If omitted, the cell displays the linkLocation text.
|
|
116
|
+
* @returns A link that reads as its friendly name; a reference to it is a link too.
|
|
118
117
|
*/
|
|
119
|
-
export declare function HYPERLINK(linkLocation: string, friendlyName?:
|
|
118
|
+
export declare function HYPERLINK(linkLocation: string, friendlyName?: Scalar): IRichData;
|
|
119
|
+
/**
|
|
120
|
+
* How IMAGE sizes the picture in its cell.
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* Declared `ReportType`: the body truncates the argument and refuses one outside 0-3.
|
|
124
|
+
*/
|
|
125
|
+
declare enum ImageSizing {
|
|
126
|
+
/**
|
|
127
|
+
* Fits the picture in the cell, keeping its aspect ratio.
|
|
128
|
+
* @name Fit to cell
|
|
129
|
+
*/
|
|
130
|
+
Fit = 0,
|
|
131
|
+
/**
|
|
132
|
+
* Fills the cell, ignoring the picture's aspect ratio.
|
|
133
|
+
* @name Fill cell
|
|
134
|
+
*/
|
|
135
|
+
Fill = 1,
|
|
136
|
+
/**
|
|
137
|
+
* Keeps the picture's own size, which may overflow the cell.
|
|
138
|
+
* @name Original size
|
|
139
|
+
*/
|
|
140
|
+
Original = 2,
|
|
141
|
+
/**
|
|
142
|
+
* Uses the height and width given.
|
|
143
|
+
* @name Custom size
|
|
144
|
+
*/
|
|
145
|
+
Custom = 3
|
|
146
|
+
}
|
|
120
147
|
/**
|
|
121
148
|
* Returns an image from a given source.
|
|
122
|
-
* @hidden Unimplemented RichData
|
|
123
149
|
* @param source The path of the source that points to the image.
|
|
124
150
|
* @param alternateText The alternative text that describes the image for accessibility.
|
|
125
151
|
* @param sizing The setting that determines the dimensions in which the image will be rendered in the cell.
|
|
126
152
|
* @param height The custom height of the image in pixels.
|
|
127
153
|
* @param width The custom width of the image in pixels.
|
|
154
|
+
* @returns The image, once it has loaded; `#BUSY!` until then, or the image it showed when a
|
|
155
|
+
* recalculation loads it again. A source that cannot be loaded is
|
|
156
|
+
* `#VALUE!`, or `#CONNECT!` when the server answers with an error.
|
|
128
157
|
*/
|
|
129
|
-
export declare function IMAGE(source: string, alternateText?: string
|
|
158
|
+
export declare function IMAGE(source: string, alternateText?: Omittable<string>, sizing?: Omittable<ReportType<ImageSizing>>, height?: Omittable<number>, width?: Omittable<number>): IRichData;
|
|
130
159
|
/**
|
|
131
160
|
* Returns a value or reference of the cell at the intersection of a particular row and column, in a given range.
|
|
132
161
|
* @param array is a range of cells or an array constant.
|
|
@@ -7,7 +7,7 @@ import { Scalar, IRange } from '@sheetxl/primitives';
|
|
|
7
7
|
* @param label optional label for the delay function.
|
|
8
8
|
* @category SheetXL
|
|
9
9
|
*/
|
|
10
|
-
export declare function DELAY(time: number, input: Scalar, label?: string):
|
|
10
|
+
export declare function DELAY(time: number, input: Scalar, label?: string): Scalar;
|
|
11
11
|
declare global {
|
|
12
12
|
var debugEventTarget: EventTarget | undefined;
|
|
13
13
|
}
|
|
@@ -24,5 +24,5 @@ declare global {
|
|
|
24
24
|
* (e.g. globalThis.debugEventTarget.dispatchEvent(new CustomEvent('test', { detail: "ping" }));
|
|
25
25
|
* @category SheetXL
|
|
26
26
|
*/
|
|
27
|
-
export declare function WAIT(type: string, input?: IRange):
|
|
27
|
+
export declare function WAIT(type: string, input?: IRange): string;
|
|
28
28
|
//# sourceMappingURL=Testing.d.ts.map
|
|
@@ -4,5 +4,5 @@ import { Scalar } from '@sheetxl/primitives';
|
|
|
4
4
|
* @param xml is a string in valid XML format.
|
|
5
5
|
* @param xpath is a string in standard XPath format.
|
|
6
6
|
*/
|
|
7
|
-
export declare function FILTERXML(xml: string, xpath: string):
|
|
7
|
+
export declare function FILTERXML(xml: string, xpath: string): Scalar[][];
|
|
8
8
|
//# sourceMappingURL=FilterXML.d.ts.map
|
package/types/src/web/Web.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export declare function ENCODEURL(text: string): string;
|
|
|
7
7
|
* Retrieves data from a web service.
|
|
8
8
|
* @param url is the URL of the web service.
|
|
9
9
|
*/
|
|
10
|
-
export declare function WEBSERVICE(url: string):
|
|
10
|
+
export declare function WEBSERVICE(url: string): string;
|
|
11
11
|
//# sourceMappingURL=Web.d.ts.map
|