@sheetxl/primitives 0.7.27 → 0.7.28-beta.1
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/browser/cjs/index.cjs +1 -6
- package/browser/esm/index.mjs +683 -307
- package/node/esm/index.mjs +684 -307
- package/package.json +1 -1
- package/types/index.d.ts +2 -1622
- package/types/src/ErrorPolicy.d.ts +78 -0
- package/types/src/Flatten.d.ts +34 -0
- package/types/src/FormulaContext.d.ts +227 -0
- package/types/src/FormulaError.d.ts +328 -0
- package/types/src/IFormulaContext.d.ts +533 -0
- package/types/src/IFunction.d.ts +608 -0
- package/types/src/IRange.d.ts +1091 -0
- package/types/src/IRangeStats.d.ts +478 -0
- package/types/src/IReferenceRange.d.ts +22 -0
- package/types/src/IRichData.d.ts +37 -0
- package/types/src/IRuntime.d.ts +65 -0
- package/types/src/Lambda.d.ts +17 -0
- package/types/src/LocaleProfile.d.ts +79 -0
- package/types/src/Observable.d.ts +46 -0
- package/types/src/Omittable.d.ts +50 -0
- package/types/src/Repeating.d.ts +66 -0
- package/types/src/Scalar.d.ts +67 -0
- package/types/src/ScalarType.d.ts +109 -0
- package/types/src/WildCard.d.ts +26 -0
- package/types/src/index.d.ts +20 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** 0=Sun..6=Sat */
|
|
2
|
+
export type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
export type CurrencyDisplay = "symbol" | "code" | "name";
|
|
4
|
+
export type CurrencyPosition = "before" | "after";
|
|
5
|
+
export type CurrencySpacing = "tight" | "space";
|
|
6
|
+
/**
|
|
7
|
+
* Everything regional behavior depends on, resolved for a single locale.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is the one source of truth for separators, date patterns, currency, and
|
|
11
|
+
* collation. It is derived data -- the identity is the BCP 47 tag, which is what
|
|
12
|
+
* a workbook persists.
|
|
13
|
+
*/
|
|
14
|
+
export interface LocaleProfile {
|
|
15
|
+
/** The BCP 47 tag this profile was resolved from, e.g. `de-DE`. */
|
|
16
|
+
tag: string;
|
|
17
|
+
numberingSystem: string;
|
|
18
|
+
decimal: string;
|
|
19
|
+
group: string;
|
|
20
|
+
/** e.g. `[3]`, or `[3,2]` for hi-IN. */
|
|
21
|
+
grouping: number[];
|
|
22
|
+
minusSign: string;
|
|
23
|
+
percentSign: string;
|
|
24
|
+
/** usually `‰` */
|
|
25
|
+
permilleSign: string;
|
|
26
|
+
/** ISO 4217 code for the region, e.g. `EUR`. */
|
|
27
|
+
currencyCode: string;
|
|
28
|
+
/** The rendered symbol for {@link LocaleProfile.currencyCode}, e.g. `€`. */
|
|
29
|
+
currencySymbol: string;
|
|
30
|
+
currencyDisplay: CurrencyDisplay;
|
|
31
|
+
currencyPosition: CurrencyPosition;
|
|
32
|
+
currencySpacing: CurrencySpacing;
|
|
33
|
+
date: {
|
|
34
|
+
/** e.g. `gregory` */
|
|
35
|
+
calendar: string;
|
|
36
|
+
/** e.g. `M/d/yy` */
|
|
37
|
+
short: string;
|
|
38
|
+
/** e.g. `MMM d, y` */
|
|
39
|
+
medium: string;
|
|
40
|
+
/** e.g. `MMMM d, y` */
|
|
41
|
+
long: string;
|
|
42
|
+
/** e.g. `h:mm a` or `HH:mm` */
|
|
43
|
+
timeShort: string;
|
|
44
|
+
/** e.g. `h:mm:ss a z` -- note: `z` is a hint only */
|
|
45
|
+
timeLong: string;
|
|
46
|
+
am?: string;
|
|
47
|
+
pm?: string;
|
|
48
|
+
firstDay: DayOfWeek;
|
|
49
|
+
weekend: [DayOfWeek, DayOfWeek];
|
|
50
|
+
monthsWide: string[];
|
|
51
|
+
monthsAbbr: string[];
|
|
52
|
+
weekdaysWide: string[];
|
|
53
|
+
weekdaysAbbr: string[];
|
|
54
|
+
hour12: boolean;
|
|
55
|
+
};
|
|
56
|
+
/** Function/list argument separator, like Excel (`,` or `;`). */
|
|
57
|
+
listSeparator: string;
|
|
58
|
+
csvDelimiter: string;
|
|
59
|
+
rtl: boolean;
|
|
60
|
+
/** Collation defaults for sorting. */
|
|
61
|
+
collator: Intl.CollatorOptions;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A patch over an `Intl`-derived {@link LocaleProfile} — the regional-override escape
|
|
65
|
+
* hatch. Excel/Windows honor OS regional *customizations* (a custom decimal symbol,
|
|
66
|
+
* a different currency) that browser `Intl` cannot see; a workbook may persist
|
|
67
|
+
* `{ tag, overrides? }` to reproduce them.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* Overrides are applied **literally** on top of the derived profile — nothing is
|
|
71
|
+
* re-derived. In particular {@link LocaleProfile.listSeparator} /
|
|
72
|
+
* {@link LocaleProfile.csvDelimiter} are normally derived from `decimal`, so patch
|
|
73
|
+
* them too if you patch `decimal`. The `date` sub-object merges one level deep; the
|
|
74
|
+
* `tag` is the identity and cannot be overridden.
|
|
75
|
+
*/
|
|
76
|
+
export type LocaleProfileOverrides = Partial<Omit<LocaleProfile, 'tag' | 'date'>> & {
|
|
77
|
+
date?: Partial<LocaleProfile['date']>;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=LocaleProfile.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object interface that defines a set of callback functions a user can use to get
|
|
3
|
+
* notified of any set of {@link Observable}.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link https://rxjs.dev/api/index/class/Observable | Observable}
|
|
6
|
+
*/
|
|
7
|
+
export declare class Observable<T = any> {
|
|
8
|
+
protected _subscribeFn: (subscriber: Subscriber<T>) => () => void;
|
|
9
|
+
constructor(subscribeFn: (subscriber: Subscriber<T>) => () => void);
|
|
10
|
+
subscribe(next: any, error: (err: any) => void, complete: () => void): {
|
|
11
|
+
next: any;
|
|
12
|
+
error: any;
|
|
13
|
+
complete: any;
|
|
14
|
+
unsubscribe: () => void;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* An object interface that defines a set of callback functions a user can use to get
|
|
19
|
+
* notified of any set of {@link Observable}.
|
|
20
|
+
*/
|
|
21
|
+
export interface Subscriber<T> {
|
|
22
|
+
/**
|
|
23
|
+
* A callback function that gets called by the producer during the subscription when
|
|
24
|
+
* the producer "has" the `value`. It won't be called if `error` or `complete` callback
|
|
25
|
+
* functions have been called, nor after the consumer has unsubscribed.
|
|
26
|
+
*/
|
|
27
|
+
next: (value: T) => void;
|
|
28
|
+
/**
|
|
29
|
+
* A callback function that gets called by the producer if and when it encountered a
|
|
30
|
+
* problem of any kind. The errored value will be provided through the `err` parameter.
|
|
31
|
+
* This callback can't be called more than one time, it can't be called if the
|
|
32
|
+
* `complete` callback function have been called previously, nor it can't be called if
|
|
33
|
+
* the consumer has unsubscribed.
|
|
34
|
+
*/
|
|
35
|
+
error: (err: any) => void;
|
|
36
|
+
/**
|
|
37
|
+
* A callback function that gets called by the producer if and when it has no more
|
|
38
|
+
* values to provide (by calling `next` callback function). This means that no error
|
|
39
|
+
* has happened. This callback can't be called more than one time, it can't be called
|
|
40
|
+
* if the `error` callback function have been called previously, nor it can't be called
|
|
41
|
+
* if the consumer has unsubscribed.
|
|
42
|
+
*/
|
|
43
|
+
complete: () => void;
|
|
44
|
+
unsubscribe: () => void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=Observable.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declares what a parameter means when the caller supplies it EMPTY — `FIXED(1.5,)`, a comma with
|
|
3
|
+
* nothing before it.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A spreadsheet argument has three positions rather than two, and each carries its own meaning:
|
|
7
|
+
*
|
|
8
|
+
* | call | position | the parameter receives |
|
|
9
|
+
* | --- | --- | --- |
|
|
10
|
+
* | `FIXED(1.5)` | absent | nothing, so the parameter's own initializer applies |
|
|
11
|
+
* | `FIXED(1.5,)` | omitted | whatever this marker declares |
|
|
12
|
+
* | `FIXED(1.5,E1)` | a blank cell | the value `0` / `false` / `""` |
|
|
13
|
+
*
|
|
14
|
+
* The last row is why omission needs a declaration of its own. A blank cell is a VALUE the caller
|
|
15
|
+
* supplied and coerces like any other, so "empty" cannot simply mean "unspecified" everywhere —
|
|
16
|
+
* and functions disagree about which of the two an empty comma resembles.
|
|
17
|
+
*
|
|
18
|
+
* Undeclared, an omitted argument coerces exactly as a blank cell does. Declared, it means `V`
|
|
19
|
+
* where one is given, and otherwise means whatever an absent argument means.
|
|
20
|
+
*
|
|
21
|
+
* @typeParam T - the parameter's type; the marker is otherwise transparent.
|
|
22
|
+
* @typeParam V - what an omitted argument means, where that differs from the absent default.
|
|
23
|
+
*
|
|
24
|
+
* @example An omitted argument means the default, and one initializer serves both positions.
|
|
25
|
+
* ```ts
|
|
26
|
+
* export function FIXED(number: number, decimals: Omittable<number> = 2): string
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example An omitted argument means something else, so both values are spelled out.
|
|
30
|
+
* ```ts
|
|
31
|
+
* // absent is 1 (approximate); omitted is 0 (exact)
|
|
32
|
+
* export function MATCH(lookupValue: IRange, lookupArray: IRange,
|
|
33
|
+
* matchType: Omittable<number, 0> = 1): Scalar
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example An omitted argument is not a value at all, and the body answers for it. Without an
|
|
37
|
+
* initializer to fall back on, the parameter is REQUIRED and the omission reaches it as
|
|
38
|
+
* `undefined` — which is a different thing from the `null` a blank cell coerces to.
|
|
39
|
+
* ```ts
|
|
40
|
+
* export function WEEKNUM(serialNumber: Omittable<Scalar>, returnType: Omittable<Scalar> = 1): number
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Supplying `V` leaves the parameter's type untouched; leaving it off adds `undefined`, so a
|
|
44
|
+
* declaration carrying an initializer sees a plain `T` while one without it is made to handle the
|
|
45
|
+
* omission.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link IFunction.ParameterTypeJSON.omittable}
|
|
48
|
+
*/
|
|
49
|
+
export type Omittable<T, V = never> = [V] extends [never] ? T | undefined : T;
|
|
50
|
+
//# sourceMappingURL=Omittable.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declares a REPEATING PARAMETER GROUP: one declared parameter whose arguments arrive as a
|
|
3
|
+
* fixed-size cycle repeated N times. `SUMIFS(sum, r1, c1, r2, c2, …)` is one `sumRange` followed
|
|
4
|
+
* by a `[criteriaRange, criteria]` group repeated as many times as the caller supplied.
|
|
5
|
+
*
|
|
6
|
+
* At the type level it is `T[]`, so the body reads exactly what it is handed:
|
|
7
|
+
*
|
|
8
|
+
* | declaration | period | body receives |
|
|
9
|
+
* | --- | --- | --- |
|
|
10
|
+
* | `Repeating<[a: IRange, b: Scalar]>` | 2 | `[IRange, Scalar][]` |
|
|
11
|
+
* | `Repeating<IRange>` | 1 | `IRange[]` |
|
|
12
|
+
*
|
|
13
|
+
* **Period 1 is spelled without the tuple** — a one-element tuple is a compiler error, because
|
|
14
|
+
* `[IRange][]` and `IRange[]` would otherwise be two ways to say the same thing. A period-1 group
|
|
15
|
+
* takes its slot name from the parameter itself, so `array: Repeating<IRange>` shows as
|
|
16
|
+
* `array1, array2, …` — the same display a rest parameter gets, and the reason `Repeating` can
|
|
17
|
+
* replace the `first + ...rest` split that reads as `array, rest1, rest2`.
|
|
18
|
+
*
|
|
19
|
+
* ### Why this exists rather than a rest parameter
|
|
20
|
+
*
|
|
21
|
+
* `...rest: T[]` has ONE type for every trailing argument, so a period-2 group has to declare its
|
|
22
|
+
* slots as their union — which makes the criteria slots of pairs 2+ invisible to every consumer
|
|
23
|
+
* that reads the declaration per position. The implicit-intersection site predicate is the one
|
|
24
|
+
* that matters: it saw `SUMIFS`'s criteria as a range parameter and under-marked the formula.
|
|
25
|
+
* A group binds argument `i` to slot `(i − prefix) % period`, so every repetition types the same
|
|
26
|
+
* as the first.
|
|
27
|
+
*
|
|
28
|
+
* A group also carries a real MINIMUM: at least one repetition is required. That is the whole
|
|
29
|
+
* difference from a rest parameter, which is 0-or-more and remains the spelling for it:
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* ...x: T[] // 0 or more
|
|
33
|
+
* x: T[] // 1 or more (a period-1 group; an array IS a repeat of one)
|
|
34
|
+
* x: Repeating<[a: A, b: B]> // 1 or more, period 2+
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* So `x?: T[]` is refused — it would be a second way to say `...x: T[]`.
|
|
38
|
+
*
|
|
39
|
+
* ### Arity is arithmetic, never type-directed
|
|
40
|
+
*
|
|
41
|
+
* `n = (argc − prefix − suffix) / period`, and a non-zero remainder is an error.
|
|
42
|
+
*
|
|
43
|
+
* ### The one short form
|
|
44
|
+
*
|
|
45
|
+
* The LAST slot of a group may be declared optional, which means exactly one thing: it may be
|
|
46
|
+
* omitted when there is a single repetition. `SORTBY`'s legal arities are 2 and 1+2n and nothing
|
|
47
|
+
* else — `SORTBY(array, by1)` is legal, `SORTBY(array, by1, o1, by2)` is not. It is not a general
|
|
48
|
+
* "the final element of the final group may be omitted" rule; that rule would accept a formula
|
|
49
|
+
* Excel refuses. An optional slot anywhere else in the group is a compiler error.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* export function SUMIFS(
|
|
54
|
+
* sumRange: AcceptError<IRange>,
|
|
55
|
+
* criteria: Repeating<[criteriaRange: AcceptError<IReferenceRange>, criteria: AcceptError<IRange>]>
|
|
56
|
+
* ): IRange {
|
|
57
|
+
* for (const [range, test] of criteria) { ... }
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* export function HSTACK(array: Repeating<AcceptError<IRange>>): IRange {
|
|
61
|
+
* return array.reduce((acc, next) => acc.concat(next, IRange.Axis.Column));
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export type Repeating<T> = T[];
|
|
66
|
+
//# sourceMappingURL=Repeating.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { FormulaError } from './FormulaError';
|
|
2
|
+
import { IRichData } from './IRichData';
|
|
3
|
+
/**
|
|
4
|
+
* The fundamental value type of the spreadsheet engine.
|
|
5
|
+
*
|
|
6
|
+
* `Scalar` is what cells hold and what formula functions receive and return.
|
|
7
|
+
* It covers every native spreadsheet type — numbers (including dates, which
|
|
8
|
+
* are stored as serial numbers), strings, booleans, errors, rich data objects,
|
|
9
|
+
* and blank (`null`).
|
|
10
|
+
*
|
|
11
|
+
* Use `Scalar` wherever a value could be any cell-compatible type. When you
|
|
12
|
+
* need to accept a JavaScript `Date` at an API boundary, use {@link InteropScalar}
|
|
13
|
+
* instead.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Dates are not a distinct `Scalar` variant — they are numbers with a format
|
|
17
|
+
* applied. `FormulaContext.parseAsDate` / `toSerialDate` convert between the
|
|
18
|
+
* two representations.
|
|
19
|
+
*
|
|
20
|
+
* @see {@link InteropScalar} for a version that includes `Date`.
|
|
21
|
+
* @see {@link ScalarType} for the companion enum that identifies which variant a value is.
|
|
22
|
+
*/
|
|
23
|
+
export type Scalar = number | boolean | string | FormulaError.Known | IRichData | null;
|
|
24
|
+
export declare namespace Scalar {
|
|
25
|
+
/**
|
|
26
|
+
* The most characters a text scalar (and therefore a cell) can hold.
|
|
27
|
+
*/
|
|
28
|
+
const MAX_TEXT_LENGTH = 32767;
|
|
29
|
+
/**
|
|
30
|
+
* The most significant digits a number parsed FROM TEXT can carry.
|
|
31
|
+
*/
|
|
32
|
+
const MAX_SIGNIFICANT_DIGITS = 15;
|
|
33
|
+
/**
|
|
34
|
+
* Applies Excel's entry rule to numeric text: every significand digit past the
|
|
35
|
+
* 15th becomes `0`, so the text parses to the double Excel would store.
|
|
36
|
+
*
|
|
37
|
+
* @param text Numeric text in any accepted form — signed, grouped, percent,
|
|
38
|
+
* currency-affixed, or scientific. The scan is locale-blind: only digit
|
|
39
|
+
* characters count toward significance (separators pass through untouched),
|
|
40
|
+
* leading zeros carry none, and the scan stops at an exponent marker so `E5`
|
|
41
|
+
* keeps its magnitude. Excess digits are zeroed rather than dropped so the
|
|
42
|
+
* text's shape (decimal places, grouping) survives for format inference.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* Callers apply this to every text→number path and to nothing else — measured
|
|
46
|
+
* truncation, not rounding: `1234567890.123456789` stores `…345`, never `…346`.
|
|
47
|
+
*/
|
|
48
|
+
function truncateNumberText(text: string): string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Represents a cell value in JavaScript, including `Date` for convenience.
|
|
52
|
+
*
|
|
53
|
+
* Extends `Scalar` to support `Date`.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* ** IMPORTANT** Spreadsheets store dates internally as serial numbers (SerialDates) to optimize calculation performance. These are integer values representing
|
|
57
|
+
* the number of days since either January 1, 1900, or January 1, 1904, depending on the container's settings.
|
|
58
|
+
*
|
|
59
|
+
* For type-safe date retrieval consider using the method, which returns null if the cell value is not a valid date.
|
|
60
|
+
*
|
|
61
|
+
* @see
|
|
62
|
+
* Refer to the following resources for more details:
|
|
63
|
+
* * {@link https://support.microsoft.com/en-us/office/date-systems-in-excel-e7fe7167-48a9-4b96-bb53-5612a800b487 | Date systems in Excel}
|
|
64
|
+
* * {@link https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tooadate?view=net-8.0 | DateTime.ToSerialDate Method}
|
|
65
|
+
*/
|
|
66
|
+
export type InteropScalar = Scalar | Date;
|
|
67
|
+
//# sourceMappingURL=Scalar.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifies which variant of {@link Scalar} a cell value is.
|
|
3
|
+
*
|
|
4
|
+
* Because `Scalar` is a union type, `ScalarType` gives you a safe, string-based
|
|
5
|
+
* discriminant for branching on value kind — useful in formula implementations,
|
|
6
|
+
* data-profiling UIs, and type-coercion logic without relying on `typeof` or
|
|
7
|
+
* `instanceof` checks that do not cover all cases (e.g. `null`, `FormulaError`,
|
|
8
|
+
* `IRichData`).
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Dates have no dedicated variant. They are stored as `Number` values with a
|
|
12
|
+
* number format applied. Use `FormulaContext.isValidDate` to distinguish them
|
|
13
|
+
* at runtime. `InteropScalarType` extends this enum with a `Date` variant for
|
|
14
|
+
* API boundaries that accept JavaScript `Date` objects.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link Scalar} for the value type this enum describes.
|
|
17
|
+
* @see {@link InteropScalarType} for the superset that includes `Date`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ScalarType: {
|
|
20
|
+
/**
|
|
21
|
+
* A numeric value.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Dates are expressed as formatted numbers within cells. They are internally stored as
|
|
25
|
+
* serial numbers and can be formatted to display as dates.
|
|
26
|
+
*/
|
|
27
|
+
readonly Number: "number";
|
|
28
|
+
/**
|
|
29
|
+
* A string value.
|
|
30
|
+
*/
|
|
31
|
+
readonly String: "string";
|
|
32
|
+
/**
|
|
33
|
+
* A boolean value (`true` or `false`).
|
|
34
|
+
*/
|
|
35
|
+
readonly Boolean: "boolean";
|
|
36
|
+
/**
|
|
37
|
+
* A cell that contains an error value.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Error cells represent cells where an error occurred during formula evaluation or data processing.
|
|
41
|
+
*/
|
|
42
|
+
readonly Error: "error";
|
|
43
|
+
/**
|
|
44
|
+
* A complex data type represented as {@link IRichData}.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Rich data are objects that have complex structures and can contain data that goes beyond simple strings, numbers,
|
|
48
|
+
* booleans, or error values. For example, hyperlinks and images are represented as rich data.
|
|
49
|
+
*/
|
|
50
|
+
readonly RichData: "richData";
|
|
51
|
+
/**
|
|
52
|
+
* Represents the absence of a value.
|
|
53
|
+
*/
|
|
54
|
+
readonly Null: "null";
|
|
55
|
+
};
|
|
56
|
+
export type ScalarType = typeof ScalarType[keyof typeof ScalarType];
|
|
57
|
+
/**
|
|
58
|
+
* Extends ScalarType to support `Date`.
|
|
59
|
+
*
|
|
60
|
+
* @see {@link InteropScalar | Javascript Dates}
|
|
61
|
+
*/
|
|
62
|
+
export declare const InteropScalarType: {
|
|
63
|
+
/**
|
|
64
|
+
* A date value.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* Dates are represented as serial numbers in the underlying data model but
|
|
68
|
+
* can be identified as dates through formatting. This type is used to indicate that a
|
|
69
|
+
* cell's value should be treated as a date, even though it's stored as a number.
|
|
70
|
+
*/
|
|
71
|
+
readonly Date: "date";
|
|
72
|
+
/**
|
|
73
|
+
* A numeric value.
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* Dates are expressed as formatted numbers within cells. They are internally stored as
|
|
77
|
+
* serial numbers and can be formatted to display as dates.
|
|
78
|
+
*/
|
|
79
|
+
readonly Number: "number";
|
|
80
|
+
/**
|
|
81
|
+
* A string value.
|
|
82
|
+
*/
|
|
83
|
+
readonly String: "string";
|
|
84
|
+
/**
|
|
85
|
+
* A boolean value (`true` or `false`).
|
|
86
|
+
*/
|
|
87
|
+
readonly Boolean: "boolean";
|
|
88
|
+
/**
|
|
89
|
+
* A cell that contains an error value.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* Error cells represent cells where an error occurred during formula evaluation or data processing.
|
|
93
|
+
*/
|
|
94
|
+
readonly Error: "error";
|
|
95
|
+
/**
|
|
96
|
+
* A complex data type represented as {@link IRichData}.
|
|
97
|
+
*
|
|
98
|
+
* @remarks
|
|
99
|
+
* Rich data are objects that have complex structures and can contain data that goes beyond simple strings, numbers,
|
|
100
|
+
* booleans, or error values. For example, hyperlinks and images are represented as rich data.
|
|
101
|
+
*/
|
|
102
|
+
readonly RichData: "richData";
|
|
103
|
+
/**
|
|
104
|
+
* Represents the absence of a value.
|
|
105
|
+
*/
|
|
106
|
+
readonly Null: "null";
|
|
107
|
+
};
|
|
108
|
+
export type InteropScalarType = typeof InteropScalarType[keyof typeof InteropScalarType];
|
|
109
|
+
//# sourceMappingURL=ScalarType.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Scalar } from './Scalar';
|
|
2
|
+
/**
|
|
3
|
+
* Wildcard syntax: `*` for any run of characters, `?` for exactly one, `~` to escape.
|
|
4
|
+
*/
|
|
5
|
+
export declare const WildCard: {
|
|
6
|
+
/**
|
|
7
|
+
* Indicates if the give item is a wildcard string.
|
|
8
|
+
*/
|
|
9
|
+
isWildCard: (obj: Scalar) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Compiles Excel wildcard text into a regex.
|
|
12
|
+
*
|
|
13
|
+
* @param anchor Whether the pattern must match the WHOLE string. Excel matches a whole cell, so
|
|
14
|
+
* every lookup and criteria caller anchors; `SEARCH`, which looks for a substring, does not.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* `~` escapes the next `*`, `?` or `~`; standing alone it is a literal tilde (`COUNTIF(range,
|
|
18
|
+
* "a~b")` finds the text `a~b`). One left-to-right pass, because chained replaces cannot express
|
|
19
|
+
* this: the previous implementation guarded its `*`/`?` rewrites with `([^~]??)`, a lazy OPTIONAL
|
|
20
|
+
* group that matches empty and so guards nothing, and then unescaped `~([?*])` — which could
|
|
21
|
+
* never fire, the `*` and `?` having already become `.*` and `.`. Every escape was silently
|
|
22
|
+
* ignored, so `"~*"` compiled to `~.*`: a literal tilde followed by anything.
|
|
23
|
+
*/
|
|
24
|
+
toRegex: (lookupText: string, flags?: any, anchor?: boolean) => RegExp;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=WildCard.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './Scalar';
|
|
2
|
+
export * from './ScalarType';
|
|
3
|
+
export * from './WildCard';
|
|
4
|
+
export * from './Lambda';
|
|
5
|
+
export * from './ErrorPolicy';
|
|
6
|
+
export * from './Repeating';
|
|
7
|
+
export * from './Flatten';
|
|
8
|
+
export * from './Omittable';
|
|
9
|
+
export * from './IRange';
|
|
10
|
+
export * from './IReferenceRange';
|
|
11
|
+
export * from './IRichData';
|
|
12
|
+
export * from './IFunction';
|
|
13
|
+
export * from './IFormulaContext';
|
|
14
|
+
export * from './LocaleProfile';
|
|
15
|
+
export * from './IRuntime';
|
|
16
|
+
export * from './IRangeStats';
|
|
17
|
+
export * from './FormulaError';
|
|
18
|
+
export * from './Observable';
|
|
19
|
+
export * from './FormulaContext';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|