@sheetxl/primitives 0.7.28-beta.4 → 0.8.0-beta.2
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 -1
- package/browser/esm/index.mjs +95 -53
- package/node/esm/index.mjs +109 -67
- package/package.json +1 -1
- package/types/src/ErrorPolicy.d.ts +48 -57
- package/types/src/Flatten.d.ts +6 -3
- package/types/src/FormulaContext.d.ts +36 -5
- package/types/src/IFormulaContext.d.ts +101 -7
- package/types/src/IFunction.d.ts +339 -29
- package/types/src/IFunctionArguments.d.ts +192 -0
- package/types/src/IRange.d.ts +181 -40
- package/types/src/IRangeStats.d.ts +32 -2
- package/types/src/IRuntime.d.ts +24 -1
- package/types/src/Lazy.d.ts +76 -0
- package/types/src/NoFilter.d.ts +34 -0
- package/types/src/NoLift.d.ts +31 -0
- package/types/src/Repeating.d.ts +24 -4
- package/types/src/ReportType.d.ts +42 -0
- package/types/src/Scalar.d.ts +1 -1
- package/types/src/ValueKind.d.ts +43 -0
- package/types/src/Volatile.d.ts +12 -0
- package/types/src/WildCard.d.ts +13 -9
- package/types/src/index.d.ts +7 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The KIND of one value — the total discriminator over {@link IFunctionArguments.RawArg}, and the
|
|
3
|
+
* vocabulary a RETURN declaration speaks ({@link IFunction.IReturnType.getKind}).
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A value's kind and its extent are different axes: `{10}`, `A1` and a bare `10` all reach a
|
|
7
|
+
* range-typed parameter as a 1x1 container, yet Excel separates them:
|
|
8
|
+
* `VLOOKUP(10,10,1,TRUE)` is `#N/A` while `VLOOKUP(10,{10},1,TRUE)` is 10, and `TYPE` answers
|
|
9
|
+
* 1 vs 64. The kind is what the CALLER supplied; the extent is merely its size.
|
|
10
|
+
*
|
|
11
|
+
* The scalar kinds ARE {@link ScalarType} values — one vocabulary, so
|
|
12
|
+
* `getKindAt(i) === ScalarType.Boolean` reads naturally — extended with the four kinds only an
|
|
13
|
+
* argument can be: a reference, a non-reference array, a callable, and no argument at all. As an
|
|
14
|
+
* argument kind, {@link ScalarType.Null} means a BLANK value.
|
|
15
|
+
*
|
|
16
|
+
* The names and values are ours. The numeric codes Excel's `TYPE` function answers are a
|
|
17
|
+
* PROJECTION of this kind (see `TYPE`'s implementation), not the kind itself.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link IFunctionArguments.getKindAt}
|
|
20
|
+
*/
|
|
21
|
+
export declare const ValueKind: {
|
|
22
|
+
/** A reference — `A1`, `A1:B3`, or a reference-returning call (`INDEX`, `OFFSET`, `TAKE`). */
|
|
23
|
+
readonly Reference: "reference";
|
|
24
|
+
/** An ARRAY that is not a reference — `{1,2}`, or a computed one (`SEQUENCE`, `TRANSPOSE(…)`). */
|
|
25
|
+
readonly Array: "array";
|
|
26
|
+
/** A callable — `LAMBDA(…)`, an eta-reduced function name, or a lambda-valued binding. */
|
|
27
|
+
readonly Lambda: "lambda";
|
|
28
|
+
/**
|
|
29
|
+
* OMITTED — nothing at this position: the empty comma of `CUMIPMT(,120,…)`, or a position
|
|
30
|
+
* past what the caller wrote. A blank CELL is a `Reference` (blankness is the cell's value).
|
|
31
|
+
* ABSENT-vs-omitted — whether the position exists in the call at all — is not a kind; it is
|
|
32
|
+
* `index >= getLength()`.
|
|
33
|
+
*/
|
|
34
|
+
readonly Omitted: "omitted";
|
|
35
|
+
readonly Number: "number";
|
|
36
|
+
readonly String: "string";
|
|
37
|
+
readonly Boolean: "boolean";
|
|
38
|
+
readonly Error: "error";
|
|
39
|
+
readonly RichData: "richData";
|
|
40
|
+
readonly Null: "null";
|
|
41
|
+
};
|
|
42
|
+
export type ValueKind = typeof ValueKind[keyof typeof ValueKind];
|
|
43
|
+
//# sourceMappingURL=ValueKind.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declares that a function's RESULT can change with nothing dirty, so a cell naming it
|
|
3
|
+
* recalculates on every pass.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* export function NOW(): Volatile<number> { ... }
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* @see {@link IFunction.ReturnTypeJSON.volatile}
|
|
10
|
+
*/
|
|
11
|
+
export type Volatile<T> = T;
|
|
12
|
+
//# sourceMappingURL=Volatile.d.ts.map
|
package/types/src/WildCard.d.ts
CHANGED
|
@@ -10,17 +10,21 @@ export declare const WildCard: {
|
|
|
10
10
|
/**
|
|
11
11
|
* Compiles Excel wildcard text into a regex.
|
|
12
12
|
*
|
|
13
|
-
* @param anchor
|
|
14
|
-
*
|
|
13
|
+
* @param anchor Where the pattern has to line up: `true` for the WHOLE string, `'start'` for a
|
|
14
|
+
* PREFIX, `false` for anywhere in it. Excel matches a whole cell, so every lookup and criteria
|
|
15
|
+
* caller anchors; `SEARCH`, which looks for a substring, does not; and a `D` function's criteria
|
|
16
|
+
* table is the prefix form — `DSUM` with the criterion `appl` takes the row whose value is
|
|
17
|
+
* `Apple`, where `COUNTIF` with the same criterion takes none.
|
|
15
18
|
*
|
|
16
19
|
* @remarks
|
|
17
|
-
* `~` escapes the next `*`, `?` or `~`;
|
|
18
|
-
* "
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* `~` escapes the next `*`, `?` or `~`; before anything else it is dropped, not kept —
|
|
21
|
+
* `SEARCH("~b","abc")` is 2 and `MATCH("a~b",…)` finds the text `ab`. A caller that reaches this
|
|
22
|
+
* compiler only when the pattern holds a `*` or `?` — which is what COUNTIF and its family do —
|
|
23
|
+
* therefore still compares `"a~b"` literally, because that criteria never becomes a pattern.
|
|
24
|
+
*
|
|
25
|
+
* One left-to-right pass; chained replaces cannot express the escape, since by the time a pass
|
|
26
|
+
* could unescape `~*` the `*` has already become `.*`.
|
|
23
27
|
*/
|
|
24
|
-
toRegex: (lookupText: string, flags?: any, anchor?: boolean) => RegExp;
|
|
28
|
+
toRegex: (lookupText: string, flags?: any, anchor?: boolean | "start") => RegExp;
|
|
25
29
|
};
|
|
26
30
|
//# sourceMappingURL=WildCard.d.ts.map
|
package/types/src/index.d.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
export * from './Scalar';
|
|
2
2
|
export * from './ScalarType';
|
|
3
|
+
export * from './ValueKind';
|
|
3
4
|
export * from './WildCard';
|
|
4
5
|
export * from './Lambda';
|
|
5
6
|
export * from './ErrorPolicy';
|
|
6
7
|
export * from './Repeating';
|
|
7
8
|
export * from './Flatten';
|
|
9
|
+
export * from './NoLift';
|
|
10
|
+
export * from './NoFilter';
|
|
11
|
+
export * from './ReportType';
|
|
8
12
|
export * from './Omittable';
|
|
13
|
+
export * from './Lazy';
|
|
14
|
+
export * from './Volatile';
|
|
9
15
|
export * from './IRange';
|
|
10
16
|
export * from './IReferenceRange';
|
|
11
17
|
export * from './IRichData';
|
|
12
18
|
export * from './IFunction';
|
|
13
19
|
export * from './IFormulaContext';
|
|
20
|
+
export * from './IFunctionArguments';
|
|
14
21
|
export * from './LocaleProfile';
|
|
15
22
|
export * from './IRuntime';
|
|
16
23
|
export * from './IRangeStats';
|