@sheetxl/sdk 0.7.28-beta.4 → 0.8.0-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/{CD2RXdnfqSYNc6gX.cjs → BatsV2UUraVDCRXm.cjs} +1 -1
- package/browser/cjs/CUz53T65cRGQRgvv.cjs +33 -0
- package/browser/cjs/{BXtvdT1Z-MsB_o5F.cjs → DU0kYUtdFa3jK-im.cjs} +1 -1
- package/browser/cjs/{DcLpXGexEtOxi-dD.cjs → Dv4yIPLV98M5zLHa.cjs} +1 -1
- package/browser/cjs/a0Z-SXs_N71CtqYb.cjs +1 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{CoA-sUxjiIUIpTUF.mjs → 6JKSOvc5czaQB2Bj.mjs} +3 -3
- package/browser/esm/{DBIu6NUHIcxOOBQp.mjs → B0HS42a7lga1k1U_.mjs} +1 -1
- package/browser/esm/{Dy4Sdpju1T2icURu.mjs → BtuJ9AGzeURtAsGo.mjs} +5797 -5410
- package/browser/esm/{0Mj5WKM362q6CECb.mjs → DGU6sM25u0EWCKl1.mjs} +3 -3
- package/browser/esm/{CKk58ZLcrllMzfou.mjs → DlPMeIyxT9tG_WDk.mjs} +2 -2
- package/browser/esm/{CPTtL2f6_4iblmFM.mjs → f2G3QRgEbvFJcoa2.mjs} +2 -2
- package/browser/esm/index.mjs +6 -6
- package/browser/esm/{CHSahmMFYNB0Ajkf.mjs → uyWBMSIxMlt8n5Z3.mjs} +2 -2
- package/node/esm/{DqgWsVXROpSgKq6c.mjs → -pxdn3M3tc6PLHs7.mjs} +20 -20
- package/node/esm/{BtGxbEbBm79YvF_k.mjs → 0n5bslM9jhO1JnI2.mjs} +1 -1
- package/node/esm/{DUYP6faJJHCaW1Xf.mjs → Cku7XiUvw1xrRasi.mjs} +1 -1
- package/node/esm/index.mjs +8279 -7901
- package/package.json +6 -6
- package/types/scripting-enums.json +4 -0
- package/types/scripting.d.ts +321 -19
- package/types/src/calculation/Calculation.d.ts +5 -0
- package/types/src/calculation/executor/CalcExecutor.d.ts +112 -3
- package/types/src/calculation/state/CalcNode.d.ts +20 -0
- package/types/src/calculation/state/CalculationContext.d.ts +3 -1
- package/types/src/calculation/state/IContextContainer.d.ts +31 -0
- package/types/src/cellRange/ICellRange.d.ts +39 -18
- package/types/src/lib/utils/_Utils.d.ts +7 -0
- package/types/src/primitives/PrimitiveUtils.d.ts +4 -2
- package/types/src/primitives/Range.d.ts +3 -1
- package/types/src/scripting/FunctionArguments.d.ts +22 -0
- package/types/src/scripting/TypedFunction.d.ts +60 -0
- package/types/src/sheet/Sheet.d.ts +8 -0
- package/types/src/sheet/SheetRange.d.ts +3 -0
- package/types/src/sheet/_SheetAutoFitUtils.d.ts +28 -0
- package/browser/cjs/BF14ZEAnaqxXroSj.cjs +0 -1
- package/browser/cjs/Bc4JjVVZfFo3R4He.cjs +0 -33
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRange, ScalarType, FormulaError, Scalar, IReferenceRange, IFunction, IFormulaContext, IRuntime } from '@sheetxl/primitives';
|
|
1
|
+
import { IRange, ScalarType, FormulaError, Scalar, IReferenceRange, IFunction, IFormulaContext, IFunctionArguments, IRuntime } from '@sheetxl/primitives';
|
|
2
2
|
import { FunctionProvider } from '@sheetxl/scripting';
|
|
3
3
|
import { ITransaction } from '../../transaction';
|
|
4
4
|
import { IFunctionCollection } from '../../scripting';
|
|
@@ -158,6 +158,8 @@ export declare class CalculationContext implements IFormulaContext {
|
|
|
158
158
|
toText(value: Scalar | undefined): string;
|
|
159
159
|
/** @inheritdoc IFormulaContext.getRuntime */
|
|
160
160
|
getRuntime(): IRuntime;
|
|
161
|
+
/** @inheritdoc IFormulaContext.getArgs */
|
|
162
|
+
getArgs(): IFunctionArguments;
|
|
161
163
|
get [Symbol.toStringTag](): string;
|
|
162
164
|
toString(): string;
|
|
163
165
|
}
|
|
@@ -156,6 +156,37 @@ export interface IContextContainer {
|
|
|
156
156
|
* still carry, and the "already visited this cycle" guards would skip their re-evaluation.
|
|
157
157
|
*/
|
|
158
158
|
getCycleId(): number;
|
|
159
|
+
/**
|
|
160
|
+
* The graph-version counters the executor's plan caches key on (CALC-PERFORMANCE-PLAN.md §1.1).
|
|
161
|
+
*
|
|
162
|
+
* `staticEpoch` advances whenever the static edges may have changed — formula block
|
|
163
|
+
* register/unregister/edit, structural shift, sheet add/remove, undo/redo state swap — and
|
|
164
|
+
* governs order-stamp validity. `precedentEpoch` advances whenever `staticEpoch` does, plus on
|
|
165
|
+
* dynamic-precedent commits (spill/INDIRECT watchers), and governs `CalcNode.dependents`
|
|
166
|
+
* validity. The split is load-bearing: a dynamic commit changes who is affected, never the
|
|
167
|
+
* static topological constraints, so a sheet with a spill keeps a valid order cache.
|
|
168
|
+
*
|
|
169
|
+
* READING is what synchronizes: the implementation compares the identities of the spatial maps
|
|
170
|
+
* it last saw and advances the counters when a clone-then-swap happened (edits, shifts, undo/
|
|
171
|
+
* redo, pass-end dynamic commits all publish fresh maps). Sites that mutate the CURRENT maps in
|
|
172
|
+
* place — `CalcGrid.fromJSON` loads, an un-cloned `shift` — must call {@link bumpCalcEpochs}
|
|
173
|
+
* explicitly, because no identity changes there.
|
|
174
|
+
*
|
|
175
|
+
* Both counters are monotonic and deliberately NOT transactional, for the same reason as
|
|
176
|
+
* {@link getCycleId}: they are compared against stamps on plain mutable graph objects that
|
|
177
|
+
* undo/redo never rewinds, so rewinding a counter would re-validate stale stamps.
|
|
178
|
+
*/
|
|
179
|
+
getCalcEpochs(): {
|
|
180
|
+
staticEpoch: number;
|
|
181
|
+
precedentEpoch: number;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Advances the epoch counters for an IN-PLACE mutation of the current spatial maps — the paths
|
|
185
|
+
* identity comparison in {@link getCalcEpochs} cannot see. `includeStatic: true` advances both
|
|
186
|
+
* counters (a formula/structure change); `false` advances only `precedentEpoch` (a
|
|
187
|
+
* dynamic-precedent-only change).
|
|
188
|
+
*/
|
|
189
|
+
bumpCalcEpochs(includeStatic: boolean): void;
|
|
159
190
|
/**
|
|
160
191
|
* Returns the committed or in-progress scalar values for the given grid.
|
|
161
192
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormulaError, IRange, Scalar, InteropScalar, IRangeStats } from '@sheetxl/primitives';
|
|
2
|
-
import { Bounds, ReferenceableClipboard } from '@sheetxl/utils';
|
|
2
|
+
import { Bounds, Size, ReferenceableClipboard } from '@sheetxl/utils';
|
|
3
3
|
import { ITypes } from '../type';
|
|
4
4
|
import { IListener } from '../listener';
|
|
5
5
|
import { ITransaction } from '../transaction';
|
|
@@ -1102,6 +1102,22 @@ export interface ICellRange {
|
|
|
1102
1102
|
* Returns the absolute bounds for the range.
|
|
1103
1103
|
*/
|
|
1104
1104
|
getBounds(): Bounds;
|
|
1105
|
+
/**
|
|
1106
|
+
* The size this range's content needs — what {@link getBounds} would report if the range had
|
|
1107
|
+
* been {@link autoFit}. A pure query: nothing is measured onto the model and nothing is committed.
|
|
1108
|
+
*
|
|
1109
|
+
* @param options Measurement options. Default `{ axes: IRange.AxisSelection.Both }`.
|
|
1110
|
+
*
|
|
1111
|
+
* @remarks
|
|
1112
|
+
* - The width is the sum of the per-column best fits and the height the sum of the per-row best
|
|
1113
|
+
* fits, so a single-column range answers "how wide must this list be" directly.
|
|
1114
|
+
* - An axis left out of {@link BestFitOptions.axes} reports its current size.
|
|
1115
|
+
* - Only the range's own content is measured, so the answer never depends on cells outside it.
|
|
1116
|
+
* (`autoFit` also scans outside the range, to prove a shrink is safe.)
|
|
1117
|
+
* - Sheet protection is not consulted: reading a size cannot violate it, and a protected sheet
|
|
1118
|
+
* answers the same as an unprotected one.
|
|
1119
|
+
*/
|
|
1120
|
+
getBestFit(options?: ICellRange.BestFitOptions): Size;
|
|
1105
1121
|
/**
|
|
1106
1122
|
* Indicates if the range is readonly only.
|
|
1107
1123
|
*
|
|
@@ -1613,9 +1629,9 @@ export declare namespace ICellRange {
|
|
|
1613
1629
|
includeMergeOverflow?: boolean;
|
|
1614
1630
|
}
|
|
1615
1631
|
/**
|
|
1616
|
-
* Options for {@link ICellRange.
|
|
1632
|
+
* Options for {@link ICellRange.getBestFit} — measurement only.
|
|
1617
1633
|
*/
|
|
1618
|
-
interface
|
|
1634
|
+
interface BestFitOptions {
|
|
1619
1635
|
/**
|
|
1620
1636
|
* Best fit using the minimum amount of space required.
|
|
1621
1637
|
*
|
|
@@ -1626,21 +1642,6 @@ export declare namespace ICellRange {
|
|
|
1626
1642
|
* For example allowing numbers to round or use scientific notation.
|
|
1627
1643
|
*/
|
|
1628
1644
|
minContent?: boolean;
|
|
1629
|
-
/**
|
|
1630
|
-
* Restricts autoFit to only grow, never shrink.
|
|
1631
|
-
*
|
|
1632
|
-
* @defaultValue false - adjust in both directions.
|
|
1633
|
-
*
|
|
1634
|
-
* @remarks
|
|
1635
|
-
* This is useful when adjusting fonts and wan the columns to resize but not the rows.
|
|
1636
|
-
*/
|
|
1637
|
-
expandOnly?: boolean | IRange.Axis;
|
|
1638
|
-
/**
|
|
1639
|
-
* If this is set to `true` then any headers that have custom sizes will be ignored.
|
|
1640
|
-
*
|
|
1641
|
-
* @defaultValue false
|
|
1642
|
-
*/
|
|
1643
|
-
skipCustomSize?: boolean;
|
|
1644
1645
|
/**
|
|
1645
1646
|
* The axes to autoFit.
|
|
1646
1647
|
*
|
|
@@ -1662,6 +1663,26 @@ export declare namespace ICellRange {
|
|
|
1662
1663
|
*/
|
|
1663
1664
|
formulaView?: boolean;
|
|
1664
1665
|
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Options for {@link ICellRange.autoFit}.
|
|
1668
|
+
*/
|
|
1669
|
+
interface AutoFitOptions extends BestFitOptions, ITransaction.OperationOptions {
|
|
1670
|
+
/**
|
|
1671
|
+
* Restricts autoFit to only grow, never shrink.
|
|
1672
|
+
*
|
|
1673
|
+
* @defaultValue false - adjust in both directions.
|
|
1674
|
+
*
|
|
1675
|
+
* @remarks
|
|
1676
|
+
* This is useful when adjusting fonts and wan the columns to resize but not the rows.
|
|
1677
|
+
*/
|
|
1678
|
+
expandOnly?: boolean | IRange.Axis;
|
|
1679
|
+
/**
|
|
1680
|
+
* If this is set to `true` then any headers that have custom sizes will be ignored.
|
|
1681
|
+
*
|
|
1682
|
+
* @defaultValue false
|
|
1683
|
+
*/
|
|
1684
|
+
skipCustomSize?: boolean;
|
|
1685
|
+
}
|
|
1665
1686
|
/**
|
|
1666
1687
|
* Options for {@link ICellRanges.getFlattened}.
|
|
1667
1688
|
*/
|
|
@@ -15,6 +15,13 @@ export interface HostDetails {
|
|
|
15
15
|
domain?: string | null;
|
|
16
16
|
fingerprint?: NodeFingerprint;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* A placeholder license key: the "evaluation" spellings a caller may pass to
|
|
20
|
+
* `LicenseManager.setLicenseKey` to run unlicensed on purpose (`eval`, `trial`, or the
|
|
21
|
+
* `visit …`/`email …` pointer text a starter template ships with). These select an evaluation
|
|
22
|
+
* license; they are never keys, so the persistent key store ignores them.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isPlaceholderLicenseKey(key: string | null | undefined): boolean;
|
|
18
25
|
export declare function getBuildVersion(): string;
|
|
19
26
|
export declare function getBuildDate(): string;
|
|
20
27
|
//# sourceMappingURL=_Utils.d.ts.map
|
|
@@ -127,7 +127,8 @@ export declare function isMultiAreaValue(value: any): boolean;
|
|
|
127
127
|
export declare function countArgDepth(value: any): number;
|
|
128
128
|
export declare function flattenToScalarArray(context: IFormulaContext, coercedArr: FixedPackedArray | Scalar[], currentArg: any, isDirect: boolean | undefined, rangeType: string | null, // the range preference for dims higher than 2 (if not specified then will materialize to array values
|
|
129
129
|
scalarType: ScalarType | null, // the scalar preference. If not specified no coercion will occur.
|
|
130
|
-
errors?: 'reject' | 'accept' | null
|
|
130
|
+
errors?: 'reject' | 'accept' | null, // effective error policy (TypedFunction resolves the default)
|
|
131
|
+
noMemberFilter?: boolean): void | FormulaError.Known;
|
|
131
132
|
/**
|
|
132
133
|
* Returns a 2d shape. Either a reference.
|
|
133
134
|
*/
|
|
@@ -168,7 +169,8 @@ isDirect: boolean, errors?: 'reject' | 'accept' | null): IRange | any[][] | Form
|
|
|
168
169
|
*/
|
|
169
170
|
export declare function addCoercedValue(context: IFormulaContext, coercedArr: FixedPackedArray | Scalar[], currentArg: any, isDirect: boolean, rangeType: 'p' | 'r' | 'm' | null, scalarType: ScalarType | null, // the scalar preference. If not specified then no coercion will occur.
|
|
170
171
|
allowError: boolean, flatten: boolean, // indicates we should flatten
|
|
171
|
-
errors?: 'reject' | 'accept' | null
|
|
172
|
+
errors?: 'reject' | 'accept' | null, // effective error policy (TypedFunction resolves the default)
|
|
173
|
+
noMemberFilter?: boolean): FormulaError.Known | void;
|
|
172
174
|
/**
|
|
173
175
|
* Minimal validation used from the return value of functions.
|
|
174
176
|
*/
|
|
@@ -58,7 +58,9 @@ export declare class Range<T extends Scalar = Scalar> implements IRange<T> {
|
|
|
58
58
|
/** @inheritdoc IRange.filter */
|
|
59
59
|
filter<TS extends Scalar = T>(callbackFn: (value: TS, coords: IRange.CellCoords, range: IRange<T>) => boolean, options?: IRange.IteratorOptions): this;
|
|
60
60
|
/** @inheritdoc IRange.flatten */
|
|
61
|
-
flatten
|
|
61
|
+
flatten(options?: IRange.IteratorOptions): this;
|
|
62
|
+
/** @inheritdoc IRange.getValuesFlat */
|
|
63
|
+
getValuesFlat<TS extends Scalar = T>(options?: IRange.IteratorOptions): TS[];
|
|
62
64
|
/** @inheritdoc IRange.forEach */
|
|
63
65
|
forEach<TS extends Scalar = T, B = any>(callbackFn: (value: TS, coords: IRange.CellCoords, range: IRange<T>) => {
|
|
64
66
|
break: B;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IFunction, IFunctionArguments } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* A bound view, as the marshaller holds it.
|
|
4
|
+
*
|
|
5
|
+
* @internal The public half is {@link IFunctionArguments}; this adds the two things only `_exec`
|
|
6
|
+
* may do — point the view at the argument array its broadcast loop rewrites per output cell, and
|
|
7
|
+
* take it off the engine's shared dispatch buffer when the body is about to re-enter dispatch.
|
|
8
|
+
*/
|
|
9
|
+
export interface IArgumentsFrame extends IFunctionArguments {
|
|
10
|
+
/** @see FunctionArguments._setLiftValues */
|
|
11
|
+
_setLiftValues(values: any[] | null): void;
|
|
12
|
+
/** @see FunctionArguments._setPrivateArgs */
|
|
13
|
+
_setPrivateArgs(args: any[]): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Binds the view for a call about to dispatch, and returns it so the lift can point it at its
|
|
17
|
+
* per-cell arguments. Pairs with {@link popArguments} in a `finally`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const pushArguments: (params: IFunction.ParameterTypeJSON[] | null | undefined, variadic: number, suffix: number, args: any[], argsLength: number) => IArgumentsFrame;
|
|
20
|
+
/** Ends the call {@link pushArguments} began. */
|
|
21
|
+
export declare const popArguments: () => void;
|
|
22
|
+
//# sourceMappingURL=FunctionArguments.d.ts.map
|
|
@@ -33,6 +33,14 @@ interface RepeatPlan {
|
|
|
33
33
|
short: boolean;
|
|
34
34
|
/** Period 1 hands the body `T[]`; period 2+ hands it tuples. */
|
|
35
35
|
tuples: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Declared parameters SUPPLIED after the group, solved for alongside `n` rather than fixed — a
|
|
38
|
+
* trailing suffix may be optional (SWITCH's `default`).
|
|
39
|
+
*
|
|
40
|
+
* Only `getArgs()` reads it: the suffix parameters are pinned to the TAIL of the argument list,
|
|
41
|
+
* so this is what lets a body ask for its `default` without counting how many pairs preceded it.
|
|
42
|
+
*/
|
|
43
|
+
suffix: number;
|
|
36
44
|
}
|
|
37
45
|
export declare class TypedFunction implements IFunction {
|
|
38
46
|
protected _n: string;
|
|
@@ -52,6 +60,24 @@ export declare class TypedFunction implements IFunction {
|
|
|
52
60
|
};
|
|
53
61
|
protected _lc: boolean;
|
|
54
62
|
protected _rlc: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* `@compat noReferenceLift` — a multi-cell REFERENCE at a non-repeating scalar parameter is
|
|
65
|
+
* `#VALUE!` rather than a broadcast (DESIGN-FUNCTION-ARGUMENTS §2.3, §6).
|
|
66
|
+
*
|
|
67
|
+
* A declaration bit and not a body concern, because the body never runs: without it the lift
|
|
68
|
+
* runs instead and answers one result per cell, so there is nothing for a body-facing API to
|
|
69
|
+
* express.
|
|
70
|
+
*/
|
|
71
|
+
protected _nrl: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* `@compat noMemberFilter` — members of a REPEATING scalar parameter are coerced rather than
|
|
74
|
+
* filtered: numeric text parses, a blank inside a multi-cell range reads 0, and a boolean or
|
|
75
|
+
* non-numeric text member is `#VALUE!` for the whole call (DESIGN-FUNCTION-ARGUMENTS §2.8, §6).
|
|
76
|
+
*
|
|
77
|
+
* The other half of the ATP heritage `_nrl` carries; `@compat atp` turns on both. It is applied
|
|
78
|
+
* where the native filter lives — the rest branch of the coercion loop — and nowhere else.
|
|
79
|
+
*/
|
|
80
|
+
protected _nmf: boolean;
|
|
55
81
|
/**
|
|
56
82
|
* The declared return scalar type, normalized (`'*'`/null → null).
|
|
57
83
|
*
|
|
@@ -64,6 +90,16 @@ export declare class TypedFunction implements IFunction {
|
|
|
64
90
|
protected _pj: IFunction.ParameterTypeJSON[] | null | undefined;
|
|
65
91
|
/** Index of the repeating-group parameter, or `-1`. */
|
|
66
92
|
protected _gi: number;
|
|
93
|
+
/**
|
|
94
|
+
* Index of the one parameter that consumes a VARIABLE number of arguments — a repeating group or
|
|
95
|
+
* a trailing rest — or `-1`.
|
|
96
|
+
*
|
|
97
|
+
* `getArgs()` indexes by PARAMETER (DESIGN-FUNCTION-ARGUMENTS §3.3) and this is the single place
|
|
98
|
+
* parameter numbering and argument numbering part company, so it is resolved once here rather
|
|
99
|
+
* than re-derived per call. `_gi` cannot serve: it covers `Repeating<T>` only, and a plain rest
|
|
100
|
+
* parameter is the same thing to a body asking which parameter its argument landed in.
|
|
101
|
+
*/
|
|
102
|
+
protected _va: number;
|
|
67
103
|
/** Resolved {@link RepeatPlan} per argument count (`null` = an arity the declaration refuses). */
|
|
68
104
|
protected _gc: Map<number, RepeatPlan | null> | null;
|
|
69
105
|
constructor(json: IFunction.DeclarationJSON, fn: (...args: any) => any, getContext: () => IFormulaContext | null | undefined, desc?: IFunction.DescriptorJSON | ((locale?: string) => Promise<IFunction.DescriptorJSON>) | null, builtIn?: boolean);
|
|
@@ -106,6 +142,30 @@ export declare class TypedFunction implements IFunction {
|
|
|
106
142
|
* writes anything into it.
|
|
107
143
|
*/
|
|
108
144
|
protected _exec<R = any>(argsEval: any[], argsLength: number): R;
|
|
145
|
+
/**
|
|
146
|
+
* `@compat noReferenceLift`: is a multi-cell REFERENCE sitting at a non-repeating scalar
|
|
147
|
+
* parameter? (DESIGN-FUNCTION-ARGUMENTS §2.3, §2.7 rule 3.)
|
|
148
|
+
*
|
|
149
|
+
* Three qualifications, each measured rather than assumed
|
|
150
|
+
* (`fn-battery/adhoc-container-at-slot{,2}`, Excel 16.0 build 20326):
|
|
151
|
+
*
|
|
152
|
+
* - **A REFERENCE, not an array.** `MROUND({3,4,5},5)` spills where `MROUND(A1:A3,5)` is
|
|
153
|
+
* `#VALUE!`, so an array at the same slot still lifts. That is the whole reason this reads the
|
|
154
|
+
* argument's shape rather than trusting the parameter: the engine hands a reference over as
|
|
155
|
+
* COORDS and an array as an `IRange`.
|
|
156
|
+
* - **MULTI-CELL.** A 1×1 reference collapses to its member and is an ordinary argument
|
|
157
|
+
* (`EFFECT(J1,4)` over a text cell is `0.0824…`).
|
|
158
|
+
* - **NON-REPEATING.** A repeating scalar slot ABSORBS a container as members whatever the
|
|
159
|
+
* function's heritage — `GCD(C1:C3)` is 4, `MULTINOMIAL(A1:A3)` is 27720 — and those were the
|
|
160
|
+
* rows that could have broken the rule and did not. Period-1 groups marshal through the rest
|
|
161
|
+
* branch and are already excluded by `rest`; period 2+ expand to per-argument entries, so the
|
|
162
|
+
* group's span is skipped explicitly.
|
|
163
|
+
*
|
|
164
|
+
* A multi-AREA union `(A1:A3,C1:C5)` arrives as an ARRAY of areas and is not treated as a
|
|
165
|
+
* reference here — unmeasured at these slots, and inventing a verdict for it would be the kind
|
|
166
|
+
* of unification §2.0 warns about.
|
|
167
|
+
*/
|
|
168
|
+
protected _refusesReferenceLift(params: IFunction.ParameterTypeJSON[] | null | undefined, paramLength: number, argsEval: any[], argsLength: number, plan: RepeatPlan | null): boolean;
|
|
109
169
|
/**
|
|
110
170
|
* The consumer half of the lift (CALC-ISSUES item 22 change 2). Each `refLifts` entry is a
|
|
111
171
|
* reference-only (r:'p') argument holding a producer lift's preserved per-element results.
|
|
@@ -224,6 +224,7 @@ export declare class Sheet implements ISheet {
|
|
|
224
224
|
calculate: (ranges: ICellRanges.Coords, options?: ICalculation.CalculateOptions) => void;
|
|
225
225
|
autoSelect: (options?: boolean | ICellRange.SelectOptions, selectionOverride?: Partial<IRangeSelection.Coords> | null, axis?: IRange.Axis) => Promise<IRange.Coords[]>;
|
|
226
226
|
autoFit: (ranges: readonly IRange.Coords[], options?: ICellRange.AutoFitOptions) => void;
|
|
227
|
+
getBestFit: (range: IRange.Coords, options?: ICellRange.BestFitOptions) => Size;
|
|
227
228
|
addRangesListeners: (ranges: readonly IRange.Coords[], listener: ICellRange.Listener, options?: ICellRange.ListenerOptions) => IListener.Remove;
|
|
228
229
|
addRangesListeners2: (ranges: readonly IRange.Coords[], listener: ICellRange.Listener, options: ICellRange.ListenerOptions | undefined, isRanges: boolean) => IListener.Remove;
|
|
229
230
|
surroundingRegion: (range: IRange.Coords, options?: ICellRange.GetSurroundingOptions) => IRange.Coords;
|
|
@@ -386,6 +387,7 @@ export declare class Sheet implements ISheet {
|
|
|
386
387
|
calculate: (ranges: ICellRanges.Coords, options?: ICalculation.CalculateOptions) => void;
|
|
387
388
|
autoSelect: (options?: boolean | ICellRange.SelectOptions, selectionOverride?: Partial<IRangeSelection.Coords> | null, axis?: IRange.Axis) => Promise<IRange.Coords[]>;
|
|
388
389
|
autoFit: (ranges: readonly IRange.Coords[], options?: ICellRange.AutoFitOptions) => void;
|
|
390
|
+
getBestFit: (range: IRange.Coords, options?: ICellRange.BestFitOptions) => Size;
|
|
389
391
|
addRangesListeners: (ranges: readonly IRange.Coords[], listener: ICellRange.Listener, options?: ICellRange.ListenerOptions) => IListener.Remove;
|
|
390
392
|
addRangesListeners2: (ranges: readonly IRange.Coords[], listener: ICellRange.Listener, options: ICellRange.ListenerOptions | undefined, isRanges: boolean) => IListener.Remove;
|
|
391
393
|
surroundingRegion: (range: IRange.Coords, options?: ICellRange.GetSurroundingOptions) => IRange.Coords;
|
|
@@ -608,6 +610,12 @@ export declare class Sheet implements ISheet {
|
|
|
608
610
|
* Implementation lives in `_SheetAutoFitUtils` (same pattern as `_SheetSortUtils.doSort`).
|
|
609
611
|
*/
|
|
610
612
|
protected _autoFit(ranges: readonly IRange.Coords[], options?: ICellRange.AutoFitOptions): void;
|
|
613
|
+
/**
|
|
614
|
+
* The size a range's content needs, without writing it. See {@link ICellRange.getBestFit}.
|
|
615
|
+
*
|
|
616
|
+
* @internal
|
|
617
|
+
*/
|
|
618
|
+
protected _getBestFit(range: IRange.Coords, options?: ICellRange.BestFitOptions): Size;
|
|
611
619
|
/** @internal */
|
|
612
620
|
protected _createRangeEvent(coords: (readonly IRange.FixableCoords[]) | IRange.FixableCoords, options: NotifierOptions, coordsFrom?: (readonly IRange.FixableCoords[]) | IRange.FixableCoords): ICellRange.Event;
|
|
613
621
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IRange, Scalar, IRangeStats, InteropScalar } from '@sheetxl/primitives';
|
|
2
|
+
import { Size } from '@sheetxl/utils';
|
|
2
3
|
import { ITransaction } from '../transaction';
|
|
3
4
|
import { IListener } from '../listener';
|
|
4
5
|
import { ICell } from '../cell';
|
|
@@ -246,6 +247,8 @@ export declare class SheetRange implements ICellRange {
|
|
|
246
247
|
get size(): number;
|
|
247
248
|
/** {@inheritDoc ICellRange.getBounds} */
|
|
248
249
|
getBounds(): import('@sheetxl/utils').Bounds;
|
|
250
|
+
/** {@inheritDoc ICellRange.getBestFit} */
|
|
251
|
+
getBestFit(options?: ICellRange.BestFitOptions): Size;
|
|
249
252
|
/** {@inheritDoc ICellRange.isInvalid} */
|
|
250
253
|
isInvalid(): boolean;
|
|
251
254
|
/** {@inheritDoc ICellRange.getDefaultShiftAxis} */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IRange } from '@sheetxl/primitives';
|
|
2
|
+
import { Size } from '@sheetxl/utils';
|
|
2
3
|
import { ICellRange } from '../cellRange';
|
|
3
4
|
import { Sheet } from './Sheet';
|
|
4
5
|
/**
|
|
@@ -15,4 +16,31 @@ import { Sheet } from './Sheet';
|
|
|
15
16
|
* @internal
|
|
16
17
|
*/
|
|
17
18
|
export declare function doAutoFit(sheet: Sheet, ranges: readonly IRange.Coords[], options?: ICellRange.AutoFitOptions): void;
|
|
19
|
+
/**
|
|
20
|
+
* The size `range`'s content needs — what {@link doAutoFit} would commit, reduced to a `Size`
|
|
21
|
+
* instead of written.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* The same phases as `doAutoFit` ({@link measureRange}, then {@link reduceColumnWidths} /
|
|
25
|
+
* {@link reduceRowHeights}) minus the commit. Everything that differs follows from not writing:
|
|
26
|
+
*
|
|
27
|
+
* - The clamps are IDENTITY. `expandOnly` reconciles a measurement with the size a header already
|
|
28
|
+
* has; a query has no such size to reconcile against.
|
|
29
|
+
* - `axes: Both` still lays the rows out against the widths the column pass produced — a wrapped
|
|
30
|
+
* cell's height is a function of its column width — but those widths reach
|
|
31
|
+
* {@link refreshSegmentWidths} as a lookup rather than being read back from headers that were
|
|
32
|
+
* never written.
|
|
33
|
+
* - The scan is not widened to the used range. Widening proves a shrink is safe, and a query does
|
|
34
|
+
* not shrink; so only the range's own content is measured.
|
|
35
|
+
* - No protection check and no protected-axis skip: nothing is written, so nothing can be violated.
|
|
36
|
+
*
|
|
37
|
+
* An axis not being fitted reports its current size, so the result is comparable with
|
|
38
|
+
* `getBounds()` whichever axes were asked for.
|
|
39
|
+
*
|
|
40
|
+
* @param sheet The sheet to measure.
|
|
41
|
+
* @param range The range to measure.
|
|
42
|
+
* @param options Measurement options (axes, minContent, formulaView).
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function doBestFit(sheet: Sheet, range: IRange.Coords, options?: ICellRange.BestFitOptions): Size;
|
|
18
46
|
//# sourceMappingURL=_SheetAutoFitUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.loadEnumManifest=async function(){let e=`@0.7.28-beta.4`;e!==`@local`&&e!==`@0.0.0`||(e=``);let t=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${e}/types/scripting-enums.json`,n=await fetch(t);if(!n.ok)throw Error(`Unable to load script enum runtime (${n.status}) from ${t}.`);return n.json()};
|