@sheetxl/sdk 0.7.28-beta.3 → 0.7.28-beta.4
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/{D6cjnwWR_iUSe1f6.cjs → BF14ZEAnaqxXroSj.cjs} +1 -1
- package/browser/cjs/{CWCKcp58KidyndaL.cjs → BXtvdT1Z-MsB_o5F.cjs} +1 -1
- package/browser/cjs/Bc4JjVVZfFo3R4He.cjs +33 -0
- package/browser/cjs/{BX6A6xGDOr_td9mw.cjs → CD2RXdnfqSYNc6gX.cjs} +1 -1
- package/browser/cjs/{B4PKKgaDTG9aSO-f.cjs → DcLpXGexEtOxi-dD.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{CX1NO_a1QPjXDvTU.mjs → 0Mj5WKM362q6CECb.mjs} +3 -3
- package/browser/esm/{Rj8e7SashcMlcdZJ.mjs → CHSahmMFYNB0Ajkf.mjs} +2 -2
- package/browser/esm/{B1gpnr-7kLU7jTy-.mjs → CKk58ZLcrllMzfou.mjs} +2 -2
- package/browser/esm/{CPgz9_iM7xyAcytg.mjs → CPTtL2f6_4iblmFM.mjs} +2 -2
- package/browser/esm/{Dv8FyXyeygJPXoHo.mjs → CoA-sUxjiIUIpTUF.mjs} +2 -2
- package/browser/esm/{DZfds6s3ayTZrozO.mjs → DBIu6NUHIcxOOBQp.mjs} +1 -1
- package/browser/esm/{C78IaCXqwCcraBPe.mjs → Dy4Sdpju1T2icURu.mjs} +6266 -5497
- package/browser/esm/index.mjs +17 -14
- package/node/esm/{BkY99r-c3BhlT_Kv.mjs → BtGxbEbBm79YvF_k.mjs} +1 -1
- package/node/esm/{DE3eIaqkk5xzmV1c.mjs → DUYP6faJJHCaW1Xf.mjs} +1 -1
- package/node/esm/{8VtzCFSmLPKxJjOa.mjs → DqgWsVXROpSgKq6c.mjs} +1 -1
- package/node/esm/index.mjs +8589 -7804
- package/package.json +6 -6
- package/types/scripting-enums.json +2 -0
- package/types/scripting.d.ts +265 -8
- package/types/src/anchored/IAnchored.d.ts +27 -0
- package/types/src/calculation/Calculation.d.ts +21 -12
- package/types/src/calculation/ICalculation.d.ts +178 -0
- package/types/src/calculation/executor/CalcExecutor.d.ts +204 -13
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +31 -0
- package/types/src/calculation/executor/CircularReference.d.ts +81 -0
- package/types/src/calculation/grid/CalcGrid.d.ts +3 -1
- package/types/src/calculation/grid/CalcGridUtils.d.ts +3 -2
- package/types/src/calculation/grid/ICalcGrid.d.ts +12 -1
- package/types/src/calculation/spatial/CircularEntry.d.ts +18 -0
- package/types/src/calculation/spatial/index.d.ts +1 -0
- package/types/src/calculation/state/CalcNode.d.ts +24 -17
- package/types/src/calculation/state/CalcState.d.ts +78 -15
- package/types/src/calculation/state/CalculationContext.d.ts +39 -0
- package/types/src/calculation/state/_ReadObservedGrid.d.ts +90 -0
- package/types/src/cell/ICell.d.ts +16 -0
- package/types/src/cellRange/ICellRange.d.ts +12 -3
- package/types/src/condition/AnchoredConditional.d.ts +26 -6
- package/types/src/conditionalFormat/ConditionalFormat.d.ts +8 -1
- package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -1
- package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +6 -2
- package/types/src/dataValidation/IDataValidationCollection.d.ts +6 -2
- package/types/src/hyperlink/IHyperlink.d.ts +3 -1
- package/types/src/hyperlink/_Hyperlink.d.ts +6 -0
- package/types/src/lib/utils/utils.browser.d.ts +5 -0
- package/types/src/license/LicenseDetails.d.ts +5 -0
- package/types/src/primitives/CalcSignal.d.ts +20 -0
- package/types/src/protectedRange/IProtectedRangeCollection.d.ts +7 -2
- package/types/src/scripting/_ScriptUtils.d.ts +13 -0
- package/types/src/sheet/Sheet.d.ts +33 -2
- package/types/src/sheet/SheetCell.d.ts +2 -0
- package/types/src/sheet/_SheetStateTypes.d.ts +14 -1
- package/types/src/style/IStyle.d.ts +5 -0
- package/types/src/table/AnchoredTable.d.ts +17 -1
- package/types/src/text/TextUtils.d.ts +18 -0
- package/browser/cjs/1mH2uhx_Dmceu88H.cjs +0 -33
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/sdk",
|
|
3
3
|
"description": "SDK - A high-performance, embeddable spreadsheet engine.",
|
|
4
|
-
"version": "0.7.28-beta.
|
|
4
|
+
"version": "0.7.28-beta.4",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"automation"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@sheetxl/formulas": "^0.7.28-beta.
|
|
47
|
-
"@sheetxl/formulas-extended": "^0.7.28-beta.
|
|
48
|
-
"@sheetxl/primitives": "^0.7.28-beta.
|
|
49
|
-
"@sheetxl/scripting": "^0.7.28-beta.
|
|
50
|
-
"@sheetxl/utils": "^0.7.28-beta.
|
|
46
|
+
"@sheetxl/formulas": "^0.7.28-beta.4",
|
|
47
|
+
"@sheetxl/formulas-extended": "^0.7.28-beta.4",
|
|
48
|
+
"@sheetxl/primitives": "^0.7.28-beta.4",
|
|
49
|
+
"@sheetxl/scripting": "^0.7.28-beta.4",
|
|
50
|
+
"@sheetxl/utils": "^0.7.28-beta.4",
|
|
51
51
|
"bahttext": "^2.4.0",
|
|
52
52
|
"bessel": "^1.0.2",
|
|
53
53
|
"chalk": "^6.0.0",
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
"AutoTable": "autoTable",
|
|
184
184
|
"Border": "border",
|
|
185
185
|
"CalcError": "calcError",
|
|
186
|
+
"Circular": "circular",
|
|
186
187
|
"Comments": "comments",
|
|
187
188
|
"Conditionals": "conditionals",
|
|
188
189
|
"Contentful": "contentful",
|
|
@@ -841,6 +842,7 @@
|
|
|
841
842
|
"ArrowsGray5": "5ArrowsGray",
|
|
842
843
|
"Boxes5": "5Boxes",
|
|
843
844
|
"Flags3": "3Flags",
|
|
845
|
+
"NoIcons": "NoIcons",
|
|
844
846
|
"Quarters5": "5Quarters",
|
|
845
847
|
"Rating4": "4Rating",
|
|
846
848
|
"Rating5": "5Rating",
|
package/types/scripting.d.ts
CHANGED
|
@@ -1707,6 +1707,32 @@ declare global {
|
|
|
1707
1707
|
readonly TwoCell: "twoCell";
|
|
1708
1708
|
};
|
|
1709
1709
|
type Type = typeof Type[keyof typeof Type];
|
|
1710
|
+
/**
|
|
1711
|
+
* Options shared by the collections that add anchored items — conditional formats, data
|
|
1712
|
+
* validations, protected ranges.
|
|
1713
|
+
*/
|
|
1714
|
+
interface AddOptions extends ITransaction.OperationOptions {
|
|
1715
|
+
/**
|
|
1716
|
+
* Position in the collection. `0` is first — for a conditional format, the highest priority.
|
|
1717
|
+
*
|
|
1718
|
+
* @defaultValue 0 — a new item goes first, as in Excel.
|
|
1719
|
+
*/
|
|
1720
|
+
index?: number;
|
|
1721
|
+
/**
|
|
1722
|
+
* Redefine the item already at `index` instead of inserting, when it is anchored to exactly
|
|
1723
|
+
* the same ranges (discontiguous ranges compare area by area, in authored order).
|
|
1724
|
+
*
|
|
1725
|
+
* @defaultValue false
|
|
1726
|
+
*
|
|
1727
|
+
* @remarks
|
|
1728
|
+
* Only the item at `index` is considered, as in Excel. What counts as the same item is per
|
|
1729
|
+
* collection: a data validation or protected range matches on ranges alone; a conditional
|
|
1730
|
+
* format only redefines a scale rule (data bar, color scale, icon set) of the same kind —
|
|
1731
|
+
* a style rule always inserts, since several may apply to one cell, whereas a second scale
|
|
1732
|
+
* of one kind on the same ranges could never render.
|
|
1733
|
+
*/
|
|
1734
|
+
replaceExisting?: boolean;
|
|
1735
|
+
}
|
|
1710
1736
|
}
|
|
1711
1737
|
|
|
1712
1738
|
/**
|
|
@@ -2192,6 +2218,63 @@ declare global {
|
|
|
2192
2218
|
* This is similar convenience method for `getCalculation().createFormula(expression).evaluate(options)`.
|
|
2193
2219
|
*/
|
|
2194
2220
|
evaluate(expression: string, options?: number | ICalculation.EvaluateOptions & Partial<IRange.CellCoords>): Promise<Scalar | IRange>;
|
|
2221
|
+
/**
|
|
2222
|
+
* When the engine recalculates on its own — Excel's Calculation Options.
|
|
2223
|
+
*
|
|
2224
|
+
* @remarks
|
|
2225
|
+
* In {@link ICalculation.CalculationMode.Automatic} every commit that dirties a formula
|
|
2226
|
+
* schedules a pass. In {@link ICalculation.CalculationMode.Manual} an edit only marks its
|
|
2227
|
+
* dependents out of date ({@link isCalculationRequired}) and nothing is recalculated — volatile
|
|
2228
|
+
* functions (`NOW`, `RAND`) stop re-rolling too — until {@link calculate}: Excel's F9 (every
|
|
2229
|
+
* sheet), Shift+F9 (`scope`) and Ctrl+Alt+F9 (`full`). {@link ready} resolves at once in manual
|
|
2230
|
+
* mode; a caller that wants current values calls {@link calculate}.
|
|
2231
|
+
*
|
|
2232
|
+
* @defaultValue {@link ICalculation.CalculationMode.Automatic}
|
|
2233
|
+
*/
|
|
2234
|
+
getCalculationMode(): ICalculation.CalculationMode;
|
|
2235
|
+
/**
|
|
2236
|
+
* Sets the calculation mode.
|
|
2237
|
+
*
|
|
2238
|
+
* @remarks
|
|
2239
|
+
* Leaving manual mode recalculates whatever is out of date, as Excel does.
|
|
2240
|
+
* {@link ICalculation.CalculationMode.AutomaticExceptTables} is accepted for parity with the
|
|
2241
|
+
* file format and Office Scripts; this engine has no what-if data tables, so it recalculates
|
|
2242
|
+
* exactly as `Automatic` does.
|
|
2243
|
+
*/
|
|
2244
|
+
setCalculationMode(mode: ICalculation.CalculationMode): this;
|
|
2245
|
+
/**
|
|
2246
|
+
* Whether any formula is out of date — Excel's `Calculate` indicator in the status bar.
|
|
2247
|
+
*
|
|
2248
|
+
* @remarks
|
|
2249
|
+
* Meaningful in manual mode, where edits accumulate until {@link calculate}. In automatic
|
|
2250
|
+
* mode it is `true` only between an edit and the pass it schedules.
|
|
2251
|
+
*/
|
|
2252
|
+
isCalculationRequired(): boolean;
|
|
2253
|
+
/**
|
|
2254
|
+
* How a reference cycle is resolved — Excel's "Enable iterative calculation" and its limits.
|
|
2255
|
+
*
|
|
2256
|
+
* @see {@link ICalculation.IterativeCalculation}
|
|
2257
|
+
*/
|
|
2258
|
+
getIterativeCalculation(): ICalculation.IterativeCalculation;
|
|
2259
|
+
/**
|
|
2260
|
+
* Enables, disables or configures iterative calculation.
|
|
2261
|
+
*
|
|
2262
|
+
* @param options `true`/`false` toggles `enabled` alone; an object updates the fields given and
|
|
2263
|
+
* keeps the rest.
|
|
2264
|
+
*
|
|
2265
|
+
* @remarks
|
|
2266
|
+
* Every cell in a cycle is recalculated when this changes: turning iteration on resolves the
|
|
2267
|
+
* cycles the workbook shows as unresolved, turning it off writes `0` to them again.
|
|
2268
|
+
*/
|
|
2269
|
+
setIterativeCalculation(options: boolean | Partial<ICalculation.IterativeCalculation>): this;
|
|
2270
|
+
/**
|
|
2271
|
+
* The calculation settings as JSON — what an xlsx carries in `calcPr`.
|
|
2272
|
+
*
|
|
2273
|
+
* @remarks
|
|
2274
|
+
* Sparse: a setting at its default is omitted. Settings a file carried that this engine does
|
|
2275
|
+
* not act on (`calcOnSave`, `fullCalcOnLoad`, `fullPrecision`, …) are kept and written back.
|
|
2276
|
+
*/
|
|
2277
|
+
toJSON(): ICalculation.JSON;
|
|
2195
2278
|
/**
|
|
2196
2279
|
* Add Listeners.
|
|
2197
2280
|
*
|
|
@@ -2221,6 +2304,87 @@ declare global {
|
|
|
2221
2304
|
* tokenizer, the AST, a formula input — is ever handed an expression of unbounded size.
|
|
2222
2305
|
*/
|
|
2223
2306
|
const MAX_EXPRESSION_LENGTH = 8192;
|
|
2307
|
+
/**
|
|
2308
|
+
* A reference cycle — the answer to "why is this cell `0`".
|
|
2309
|
+
*
|
|
2310
|
+
* @remarks
|
|
2311
|
+
* A cell is in a cycle when calculating it opens its own value, directly or through other cells
|
|
2312
|
+
* — `=A1+1` in A1, `=OFFSET(A1,0,0)` in A1, `=SUMIF(B1,C1,A1)` in A1 while B1 matches C1. With
|
|
2313
|
+
* iterative calculation off (the default, and Excel's) every cell in a cycle, and every cell
|
|
2314
|
+
* downstream of one, evaluates to `0`; nothing on the value says why. This does.
|
|
2315
|
+
*
|
|
2316
|
+
* Reached from a cell — {@link ICell.getCircularReference} answers it for members and for
|
|
2317
|
+
* downstream cells alike — and carried by the `ICellRange.Feature.Circular` regions, so a
|
|
2318
|
+
* range, a sheet or the workbook is asked the way any other error is asked:
|
|
2319
|
+
* `getCounts(Feature.Circular)` for how many, `getRegions(Feature.Circular)` for which, with
|
|
2320
|
+
* this object as each region's payload. There is no list of cycles on the calculation: nobody
|
|
2321
|
+
* starts from the cycle; they start from a cell or a range and want to know more.
|
|
2322
|
+
*
|
|
2323
|
+
* Live, not a snapshot: it reads the engine's cycle table on every call and drops members whose
|
|
2324
|
+
* formula has since been edited away, so a stale handle answers `getMemberCount() === 0`.
|
|
2325
|
+
* Persists until the last member is edited away.
|
|
2326
|
+
*/
|
|
2327
|
+
interface ICircularReference {
|
|
2328
|
+
/**
|
|
2329
|
+
* The cell named for the cycle, the way Excel's status bar names one
|
|
2330
|
+
* (`Worksheet.CircularReference` likewise answers a single cell): the first member in
|
|
2331
|
+
* row-major order. `scope` is the sheet name, or `null` when the member lives in a named
|
|
2332
|
+
* formula's body rather than on a sheet.
|
|
2333
|
+
*/
|
|
2334
|
+
getRepresentative(): IRange.CellCoords | null;
|
|
2335
|
+
/**
|
|
2336
|
+
* Every cell IN the cycle, in row-major order, `scope` set to the sheet name. Small — a cycle
|
|
2337
|
+
* is the cells that read each other, not everything that reads them (that is
|
|
2338
|
+
* {@link getDownstreamCount}).
|
|
2339
|
+
*/
|
|
2340
|
+
getMembers(): readonly IRange.CellCoords[];
|
|
2341
|
+
/** How many cells are IN the cycle, the representative included. */
|
|
2342
|
+
getMemberCount(): number;
|
|
2343
|
+
/** How many cells read the cycle (transitively) and evaluate to `0` because of it. */
|
|
2344
|
+
getDownstreamCount(): number;
|
|
2345
|
+
/**
|
|
2346
|
+
* Whether `coords` is IN the cycle, as opposed to downstream of it. A cell that reads a
|
|
2347
|
+
* member's `0` answers `false` here but still resolves this cycle from
|
|
2348
|
+
* {@link ICell.getCircularReference} — the tooltip for it says "reads a circular reference
|
|
2349
|
+
* at A1", not "is one".
|
|
2350
|
+
*/
|
|
2351
|
+
isMember(coords: IRange.CellCoords): boolean;
|
|
2352
|
+
/**
|
|
2353
|
+
* The cycle as a walk of reads from `from` back to itself — each cell reads the next, and
|
|
2354
|
+
* the last reads the first. A cycle has no start, so it is told from the cell that asks:
|
|
2355
|
+
* with `A1 = B1+1` and `B1 = A1+1`, asked from A1 it is `[A1, B1]` (A1 → B1 → A1), asked
|
|
2356
|
+
* from B1 it is `[B1, A1]`. A cycle of one is `[A1]`.
|
|
2357
|
+
*
|
|
2358
|
+
* @remarks
|
|
2359
|
+
* Exact, not inferred from formula text: it is the order the engine found the cycle in,
|
|
2360
|
+
* which is the order the reads happened — a dynamic read (`INDIRECT`, `OFFSET`) is a step
|
|
2361
|
+
* like any other. Interlocking cycles share members; the walk follows the read that closed
|
|
2362
|
+
* the cycle `from` was found in, so it is ONE loop through that cell, not every member
|
|
2363
|
+
* ({@link getMembers} is every member).
|
|
2364
|
+
*
|
|
2365
|
+
* Empty when `from` is not a live member — a downstream cell asks from
|
|
2366
|
+
* {@link getRepresentative}.
|
|
2367
|
+
*/
|
|
2368
|
+
getPath(from: IRange.CellCoords): readonly IRange.CellCoords[];
|
|
2369
|
+
/**
|
|
2370
|
+
* Whether iterative calculation was on when the cycle was last evaluated. When `false` the
|
|
2371
|
+
* cycle is unresolved and every member and downstream cell is `0`; the iteration answers
|
|
2372
|
+
* below are then meaningless (`0` sweeps, no change).
|
|
2373
|
+
*/
|
|
2374
|
+
isIterative(): boolean;
|
|
2375
|
+
/**
|
|
2376
|
+
* Whether iterative calculation settled it: every member moved by less than the workbook's
|
|
2377
|
+
* `maxIterateChange` in the last sweep. Always `false` with iteration off.
|
|
2378
|
+
*/
|
|
2379
|
+
isConverged(): boolean;
|
|
2380
|
+
/** How many sweeps the last evaluation ran — up to the workbook's `maxIterations`. */
|
|
2381
|
+
getIterationCount(): number;
|
|
2382
|
+
/**
|
|
2383
|
+
* The largest change any member made in the last sweep — what stopped the iteration when
|
|
2384
|
+
* {@link isConverged}, what it never got under when not. `0` with iteration off.
|
|
2385
|
+
*/
|
|
2386
|
+
getLastChange(): number;
|
|
2387
|
+
}
|
|
2224
2388
|
/**
|
|
2225
2389
|
* Represents a formula that can be evaluated.
|
|
2226
2390
|
*/
|
|
@@ -2899,8 +3063,16 @@ declare global {
|
|
|
2899
3063
|
/**
|
|
2900
3064
|
* Called when the calculation has been updated and
|
|
2901
3065
|
* a calculation has not been started.
|
|
3066
|
+
*
|
|
3067
|
+
* @remarks
|
|
3068
|
+
* In manual mode this is every edit that leaves a formula out of date — see
|
|
3069
|
+
* {@link ICalculation.isCalculationRequired}.
|
|
2902
3070
|
*/
|
|
2903
3071
|
onStale?(source: ICalculation): void;
|
|
3072
|
+
/**
|
|
3073
|
+
* Called when the calculation mode or the iterative-calculation settings change.
|
|
3074
|
+
*/
|
|
3075
|
+
onOptionsChange?(source: ICalculation): void;
|
|
2904
3076
|
/**
|
|
2905
3077
|
* Called when a calculation is starting.
|
|
2906
3078
|
*/
|
|
@@ -2984,6 +3156,38 @@ declare global {
|
|
|
2984
3156
|
readonly AutomaticExceptTables: "automaticExceptTables";
|
|
2985
3157
|
};
|
|
2986
3158
|
type CalculationMode = typeof CalculationMode[keyof typeof CalculationMode];
|
|
3159
|
+
/**
|
|
3160
|
+
* Iterative calculation — Excel's "Enable iterative calculation" with its two limits.
|
|
3161
|
+
*
|
|
3162
|
+
* @remarks
|
|
3163
|
+
* With it off a reference cycle evaluates to `0` and is reported as unresolved. With it on the
|
|
3164
|
+
* cells of the cycle are re-evaluated in turn, each read seeing the latest value, until no cell
|
|
3165
|
+
* moved by {@link maxChange} or {@link maxIterations} sweeps ran — and the results persist into
|
|
3166
|
+
* the next recalculation, which re-runs every cycle the way it re-runs `NOW()`: `=A1+1` in A1 is
|
|
3167
|
+
* a counter that advances by `maxIterations` per recalc. A cycle that stops on the sweep cap is
|
|
3168
|
+
* still reported ({@link ICircularReference.isConverged}); a converged one is not.
|
|
3169
|
+
*
|
|
3170
|
+
* Office Scripts calls the count `maxIteration`; the file format `iterateCount` / `iterateDelta`.
|
|
3171
|
+
*/
|
|
3172
|
+
interface IterativeCalculation {
|
|
3173
|
+
/**
|
|
3174
|
+
* @defaultValue `false`
|
|
3175
|
+
*/
|
|
3176
|
+
enabled: boolean;
|
|
3177
|
+
/**
|
|
3178
|
+
* The most sweeps one recalculation runs over a cycle.
|
|
3179
|
+
*
|
|
3180
|
+
* @defaultValue `100`
|
|
3181
|
+
*/
|
|
3182
|
+
maxIterations: number;
|
|
3183
|
+
/**
|
|
3184
|
+
* Sweeps stop early once every cell in the cycle moved by less than this. A non-numeric
|
|
3185
|
+
* change (text, error) never counts as settled.
|
|
3186
|
+
*
|
|
3187
|
+
* @defaultValue `0.001`
|
|
3188
|
+
*/
|
|
3189
|
+
maxChange: number;
|
|
3190
|
+
}
|
|
2987
3191
|
/**
|
|
2988
3192
|
* Represents the status of a calculation result
|
|
2989
3193
|
*/
|
|
@@ -3246,12 +3450,28 @@ declare global {
|
|
|
3246
3450
|
*
|
|
3247
3451
|
* @remarks
|
|
3248
3452
|
* Warnings differ from errors in that they may alter the display of the cell's value or type.
|
|
3453
|
+
* A cell in a reference cycle, or downstream of one, carries one here — the text form of
|
|
3454
|
+
* {@link getCircularReference}: the walk from this cell around the cycle and back
|
|
3455
|
+
* ("Circular reference: A1 → B1 → A1"), or "Reads a circular reference at A1".
|
|
3249
3456
|
*/
|
|
3250
3457
|
getWarnings(): readonly string[];
|
|
3251
3458
|
/**
|
|
3252
3459
|
* Retrieves any errors attached to the cell.
|
|
3253
3460
|
*/
|
|
3254
3461
|
getErrors(): readonly string[];
|
|
3462
|
+
/**
|
|
3463
|
+
* The reference cycle this cell is in, or downstream of — or `null` when it is neither.
|
|
3464
|
+
*
|
|
3465
|
+
* @remarks
|
|
3466
|
+
* Evaluated state, beside the value: a cell in a cycle, and every cell that reads one, is `0`
|
|
3467
|
+
* (Excel, iterative calculation off), and this is the only thing that says why. Ask the cycle
|
|
3468
|
+
* whether this cell is a member or a reader ({@link ICalculation.ICircularReference.isMember})
|
|
3469
|
+
* and, under iterative calculation, whether it converged.
|
|
3470
|
+
*
|
|
3471
|
+
* The range-level view is `ICellRange.Feature.Circular` — `getCounts` for how many cells,
|
|
3472
|
+
* `getRegions` for which, each region carrying this same object as its payload.
|
|
3473
|
+
*/
|
|
3474
|
+
getCircularReference(): ICalculation.ICircularReference | null;
|
|
3255
3475
|
/**
|
|
3256
3476
|
* Returns the style information applied to the cell.
|
|
3257
3477
|
*
|
|
@@ -6614,11 +6834,20 @@ declare global {
|
|
|
6614
6834
|
/** Cells inside a dynamic-array spill zone. Writing into one is a real failure mode. */
|
|
6615
6835
|
readonly Spills: "spills";
|
|
6616
6836
|
/**
|
|
6617
|
-
* Evaluated state: cells whose calculation itself failed
|
|
6618
|
-
*
|
|
6619
|
-
*
|
|
6837
|
+
* Evaluated state: cells whose calculation itself failed. Distinct from
|
|
6838
|
+
* {@link Feature.Error}: `#DIV/0!` is a successfully calculated error VALUE (the `Error`
|
|
6839
|
+
* kind); `CalcError` is the engine failing to evaluate at all. A reference cycle is not a
|
|
6840
|
+
* failure — its cells evaluate, to `0` — and is {@link Feature.Circular}.
|
|
6620
6841
|
*/
|
|
6621
6842
|
readonly CalcError: "calcError";
|
|
6843
|
+
/**
|
|
6844
|
+
* Evaluated state: cells in a reference cycle, or downstream of one. Both evaluate to `0`
|
|
6845
|
+
* (Excel, iterative calculation off) with nothing else to show for it — this is the marker.
|
|
6846
|
+
* Regions group by cycle and by kind (`member` | `downstream`), so a block that reads one bad
|
|
6847
|
+
* cell is ONE region, and each region's payload is the cycle itself
|
|
6848
|
+
* (`ICalculation.ICircularReference` — members, counts, whether iteration settled it).
|
|
6849
|
+
*/
|
|
6850
|
+
readonly Circular: "circular";
|
|
6622
6851
|
/** Direct fill. */
|
|
6623
6852
|
readonly Fill: "fill";
|
|
6624
6853
|
/** Direct borders. */
|
|
@@ -9908,8 +10137,11 @@ declare global {
|
|
|
9908
10137
|
* Only the keys named are touched. An explicit `null` **clears** a key — required when switching
|
|
9909
10138
|
* a rule between its two shapes, since `condition`+`style` and `scale` are mutually exclusive
|
|
9910
10139
|
* (setting one side also clears the other unless the caller named both).
|
|
10140
|
+
*
|
|
10141
|
+
* Passing another rule takes its whole definition — every key, cleared where the other rule
|
|
10142
|
+
* has none — so the shape switches with it. The anchor is not part of it.
|
|
9911
10143
|
*/
|
|
9912
|
-
update(properties: IConditionalFormat.Modifiers, options?: ITransaction.OperationOptions): this;
|
|
10144
|
+
update(properties: IConditionalFormat.Modifiers | IConditionalFormat, options?: ITransaction.OperationOptions): this;
|
|
9913
10145
|
/**
|
|
9914
10146
|
* Returns a snapshot of the conditional that can be used for copying and archiving.
|
|
9915
10147
|
*/
|
|
@@ -10339,8 +10571,12 @@ declare global {
|
|
|
10339
10571
|
export namespace IConditionalFormatCollection {
|
|
10340
10572
|
/**
|
|
10341
10573
|
* Options for adding a {@link IConditionalFormat}.
|
|
10574
|
+
*
|
|
10575
|
+
* @remarks
|
|
10576
|
+
* `replaceExisting` redefines the rule at `index` only when it is a scale rule of the same
|
|
10577
|
+
* kind on exactly the same ranges — see {@link IAnchored.AddOptions.replaceExisting}.
|
|
10342
10578
|
*/
|
|
10343
|
-
interface AddOptions extends IConditionalFormat.Properties,
|
|
10579
|
+
interface AddOptions extends IConditionalFormat.Properties, IAnchored.AddOptions {
|
|
10344
10580
|
}
|
|
10345
10581
|
/**
|
|
10346
10582
|
* Options for searching for {@link IConditionalFormat}s.
|
|
@@ -10724,8 +10960,12 @@ declare global {
|
|
|
10724
10960
|
export namespace IDataValidationCollection {
|
|
10725
10961
|
/**
|
|
10726
10962
|
* Options for adding a data validation to the collection.
|
|
10963
|
+
*
|
|
10964
|
+
* @remarks
|
|
10965
|
+
* `replaceExisting` redefines the validation at `index` when it covers exactly the same ranges —
|
|
10966
|
+
* see {@link IAnchored.AddOptions.replaceExisting}.
|
|
10727
10967
|
*/
|
|
10728
|
-
interface AddOptions extends IDataValidation.Properties,
|
|
10968
|
+
interface AddOptions extends IDataValidation.Properties, IAnchored.AddOptions {
|
|
10729
10969
|
}
|
|
10730
10970
|
interface GetItemsOptions {
|
|
10731
10971
|
/**
|
|
@@ -14021,7 +14261,9 @@ declare global {
|
|
|
14021
14261
|
* @remarks
|
|
14022
14262
|
* This has no counterpart in Excel; it is ours and applies to links opened in a browser.
|
|
14023
14263
|
*
|
|
14024
|
-
* @defaultValue `_self` for a location within this workbook
|
|
14264
|
+
* @defaultValue `_self` for a location within this workbook or a `mailto:`/`tel:`/`sms:`
|
|
14265
|
+
* address (handled by another application, so there is nothing to show in a new tab),
|
|
14266
|
+
* otherwise `_blank`.
|
|
14025
14267
|
*/
|
|
14026
14268
|
getTarget(): string;
|
|
14027
14269
|
/**
|
|
@@ -16363,8 +16605,13 @@ declare global {
|
|
|
16363
16605
|
export namespace IProtectedRangeCollection {
|
|
16364
16606
|
/**
|
|
16365
16607
|
* Options for adding an {@link IProtectedRange}.
|
|
16608
|
+
*
|
|
16609
|
+
* @remarks
|
|
16610
|
+
* `replaceExisting` redefines the entry at `index` when it covers exactly the same ranges; the
|
|
16611
|
+
* entry keeps its name unless a free one is supplied — see
|
|
16612
|
+
* {@link IAnchored.AddOptions.replaceExisting}.
|
|
16366
16613
|
*/
|
|
16367
|
-
interface AddOptions extends IProtectedRange.Properties,
|
|
16614
|
+
interface AddOptions extends IProtectedRange.Properties, IAnchored.AddOptions {
|
|
16368
16615
|
}
|
|
16369
16616
|
/**
|
|
16370
16617
|
* Options for searching for {@link IProtectedRange}s.
|
|
@@ -22094,6 +22341,11 @@ declare global {
|
|
|
22094
22341
|
readonly Quarters5: "5Quarters";
|
|
22095
22342
|
readonly Rating5: "5Rating";
|
|
22096
22343
|
readonly Boxes5: "5Boxes";
|
|
22344
|
+
/**
|
|
22345
|
+
* Not a set to apply — the x14 name Excel writes for a band whose custom icon is
|
|
22346
|
+
* "No Cell Icon" (`iconSet="NoIcons" iconId="0"`). It holds zero icons.
|
|
22347
|
+
*/
|
|
22348
|
+
readonly NoIcons: "NoIcons";
|
|
22097
22349
|
};
|
|
22098
22350
|
type IconSet = typeof IconSet[keyof typeof IconSet];
|
|
22099
22351
|
}
|
|
@@ -27899,6 +28151,11 @@ declare global {
|
|
|
27899
28151
|
getCpuCount(): number;
|
|
27900
28152
|
getMemory(): number;
|
|
27901
28153
|
isEval(): boolean;
|
|
28154
|
+
/**
|
|
28155
|
+
* `true` when the licensed product may run `feature` without the license watermark: a valid
|
|
28156
|
+
* license with no exceptions, or an evaluation on localhost / in a dev build. An evaluation on
|
|
28157
|
+
* any other host answers `false` so the watermark shows.
|
|
28158
|
+
*/
|
|
27902
28159
|
isValidFor: (feature: string) => boolean;
|
|
27903
28160
|
getDeveloperCount(): number;
|
|
27904
28161
|
getType(): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IRange } from '@sheetxl/primitives';
|
|
2
2
|
import { IListener } from '../listener';
|
|
3
3
|
import { ICellRange, ICellRanges } from '../cellRange';
|
|
4
|
+
import { ITransaction } from '../transaction';
|
|
4
5
|
/**
|
|
5
6
|
* `IAnchored` objects are anchored to one or more ranges.
|
|
6
7
|
*/
|
|
@@ -114,5 +115,31 @@ export declare namespace IAnchored {
|
|
|
114
115
|
readonly TwoCell: "twoCell";
|
|
115
116
|
};
|
|
116
117
|
type Type = typeof Type[keyof typeof Type];
|
|
118
|
+
/**
|
|
119
|
+
* Options shared by the collections that add anchored items — conditional formats, data
|
|
120
|
+
* validations, protected ranges.
|
|
121
|
+
*/
|
|
122
|
+
interface AddOptions extends ITransaction.OperationOptions {
|
|
123
|
+
/**
|
|
124
|
+
* Position in the collection. `0` is first — for a conditional format, the highest priority.
|
|
125
|
+
*
|
|
126
|
+
* @defaultValue 0 — a new item goes first, as in Excel.
|
|
127
|
+
*/
|
|
128
|
+
index?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Redefine the item already at `index` instead of inserting, when it is anchored to exactly
|
|
131
|
+
* the same ranges (discontiguous ranges compare area by area, in authored order).
|
|
132
|
+
*
|
|
133
|
+
* @defaultValue false
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* Only the item at `index` is considered, as in Excel. What counts as the same item is per
|
|
137
|
+
* collection: a data validation or protected range matches on ranges alone; a conditional
|
|
138
|
+
* format only redefines a scale rule (data bar, color scale, icon set) of the same kind —
|
|
139
|
+
* a style rule always inserts, since several may apply to one cell, whereas a second scale
|
|
140
|
+
* of one kind on the same ranges could never render.
|
|
141
|
+
*/
|
|
142
|
+
replaceExisting?: boolean;
|
|
143
|
+
}
|
|
117
144
|
}
|
|
118
145
|
//# sourceMappingURL=IAnchored.d.ts.map
|
|
@@ -44,6 +44,15 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
44
44
|
protected _pendingPriority: (() => Promise<unknown>)[] | null;
|
|
45
45
|
protected _draining: boolean;
|
|
46
46
|
protected _drainScheduled: boolean;
|
|
47
|
+
protected _calcOwed: boolean;
|
|
48
|
+
/** {@link ICalculation.getCalculationMode} — gates the reactive pass in {@link _calculate}. */
|
|
49
|
+
protected _calcMode: ICalculation.CalculationMode;
|
|
50
|
+
/** {@link ICalculation.getIterativeCalculation} — handed to the executor per pass. */
|
|
51
|
+
protected _iterate: boolean;
|
|
52
|
+
protected _maxIterations: number;
|
|
53
|
+
protected _maxIterateChange: number;
|
|
54
|
+
/** The `calcPr` the file carried, kept whole so settings this engine ignores still round-trip. */
|
|
55
|
+
protected _calcJSON: ICalculation.JSON | null;
|
|
47
56
|
protected _removeNamedItemsListeners: (() => void) | null;
|
|
48
57
|
protected _namedDependents: Map<string, IRange.Coords[]> | null;
|
|
49
58
|
protected _namedDependentsOf: ISpatialMap3D<FormulaSpatialValue> | null;
|
|
@@ -218,6 +227,18 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
218
227
|
stop(): Promise<void>;
|
|
219
228
|
/** @inheritdoc ICalculation.getStatus */
|
|
220
229
|
getStatus(): ICalculation.Status;
|
|
230
|
+
/** @inheritdoc ICalculation.getCalculationMode */
|
|
231
|
+
getCalculationMode(): ICalculation.CalculationMode;
|
|
232
|
+
/** @inheritdoc ICalculation.setCalculationMode */
|
|
233
|
+
setCalculationMode(mode: ICalculation.CalculationMode): this;
|
|
234
|
+
/** @inheritdoc ICalculation.isCalculationRequired */
|
|
235
|
+
isCalculationRequired(): boolean;
|
|
236
|
+
/** @inheritdoc ICalculation.getIterativeCalculation */
|
|
237
|
+
getIterativeCalculation(): ICalculation.IterativeCalculation;
|
|
238
|
+
/** @inheritdoc ICalculation.setIterativeCalculation */
|
|
239
|
+
setIterativeCalculation(options: boolean | Partial<ICalculation.IterativeCalculation>): this;
|
|
240
|
+
/** @inheritdoc ICalculation.toJSON */
|
|
241
|
+
toJSON(): ICalculation.JSON;
|
|
221
242
|
/** @inheritdoc ICalculation.ready */
|
|
222
243
|
ready(options?: ICalculation.CalculateOptions): Promise<ICalculation.Status>;
|
|
223
244
|
/**
|
|
@@ -421,18 +442,6 @@ interface State extends AbstractModel.State {
|
|
|
421
442
|
* Listeners to individual named items
|
|
422
443
|
*/
|
|
423
444
|
itemRemoveListeners: (() => void)[];
|
|
424
|
-
/**
|
|
425
|
-
* Indicates if calculation will do iterative calcs
|
|
426
|
-
*/
|
|
427
|
-
iterate: boolean;
|
|
428
|
-
/**
|
|
429
|
-
* The maximum number of iterations to perform when calculating.
|
|
430
|
-
*/
|
|
431
|
-
maxIterations: number;
|
|
432
|
-
/**
|
|
433
|
-
* The maximum change allowed between iterations when performing iterative calculations.
|
|
434
|
-
*/
|
|
435
|
-
maxIterateChange: number;
|
|
436
445
|
}
|
|
437
446
|
interface CommitView extends AbstractModel.CommitView {
|
|
438
447
|
}
|