@sheetxl/sdk 0.7.28-beta.2 → 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.
Files changed (64) hide show
  1. package/browser/cjs/{BREMLtxkQhtNSVra.cjs → BF14ZEAnaqxXroSj.cjs} +1 -1
  2. package/browser/cjs/{BG7YDVxiC4ErxvF1.cjs → BXtvdT1Z-MsB_o5F.cjs} +1 -1
  3. package/browser/cjs/Bc4JjVVZfFo3R4He.cjs +33 -0
  4. package/browser/cjs/{CQf4zxkBmheTVbjX.cjs → CD2RXdnfqSYNc6gX.cjs} +2 -2
  5. package/browser/cjs/DcLpXGexEtOxi-dD.cjs +1 -0
  6. package/browser/cjs/index.cjs +2 -2
  7. package/browser/esm/{DN4d5bDBkti28wuc.mjs → 0Mj5WKM362q6CECb.mjs} +213 -207
  8. package/browser/esm/{BxIOX1TojvA-1ZZP.mjs → CHSahmMFYNB0Ajkf.mjs} +2 -2
  9. package/browser/esm/{CZO1RubmqnJV96rq.mjs → CKk58ZLcrllMzfou.mjs} +2 -2
  10. package/browser/esm/{DRWu3TmcE9JFf78V.mjs → CPTtL2f6_4iblmFM.mjs} +2 -2
  11. package/browser/esm/{DPOelA1J3WHbMXyh.mjs → CoA-sUxjiIUIpTUF.mjs} +2 -2
  12. package/browser/esm/{vHWuKF-ftK7LM1uw.mjs → DBIu6NUHIcxOOBQp.mjs} +1 -1
  13. package/browser/esm/{CB_4gdPPPruwremH.mjs → Dy4Sdpju1T2icURu.mjs} +4748 -3883
  14. package/browser/esm/index.mjs +419 -411
  15. package/node/esm/{XQhP3dYwF_tEuswB.mjs → BtGxbEbBm79YvF_k.mjs} +303 -297
  16. package/node/esm/{B-tgcZihStNV9CbZ.mjs → DUYP6faJJHCaW1Xf.mjs} +1 -1
  17. package/node/esm/{C8tfYGL3wHy9IDDc.mjs → DqgWsVXROpSgKq6c.mjs} +2 -2
  18. package/node/esm/index.mjs +8686 -7802
  19. package/package.json +6 -6
  20. package/resources/locales/de/model.msg.json +12 -0
  21. package/resources/locales/en/model.msg.json +12 -0
  22. package/types/scripting-enums.json +2 -0
  23. package/types/scripting.d.ts +341 -15
  24. package/types/src/anchored/IAnchored.d.ts +27 -0
  25. package/types/src/calculation/Calculation.d.ts +21 -12
  26. package/types/src/calculation/ICalculation.d.ts +183 -0
  27. package/types/src/calculation/compiler/CompilerUtils.d.ts +20 -0
  28. package/types/src/calculation/compiler/FormulaParser.d.ts +32 -6
  29. package/types/src/calculation/executor/CalcExecutor.d.ts +204 -13
  30. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +31 -0
  31. package/types/src/calculation/executor/CircularReference.d.ts +81 -0
  32. package/types/src/calculation/functions/Operators.d.ts +1 -1
  33. package/types/src/calculation/grid/CalcGrid.d.ts +5 -1
  34. package/types/src/calculation/grid/CalcGridUtils.d.ts +3 -2
  35. package/types/src/calculation/grid/ICalcGrid.d.ts +23 -1
  36. package/types/src/calculation/spatial/CircularEntry.d.ts +18 -0
  37. package/types/src/calculation/spatial/index.d.ts +1 -0
  38. package/types/src/calculation/state/CalcNode.d.ts +24 -17
  39. package/types/src/calculation/state/CalcState.d.ts +78 -15
  40. package/types/src/calculation/state/CalculationContext.d.ts +39 -0
  41. package/types/src/calculation/state/_ReadObservedGrid.d.ts +90 -0
  42. package/types/src/cell/ICell.d.ts +16 -0
  43. package/types/src/cellRange/ICellRange.d.ts +72 -6
  44. package/types/src/condition/AnchoredConditional.d.ts +26 -6
  45. package/types/src/conditionalFormat/ConditionalFormat.d.ts +8 -1
  46. package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -1
  47. package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +6 -2
  48. package/types/src/dataValidation/IDataValidationCollection.d.ts +6 -2
  49. package/types/src/hyperlink/IHyperlink.d.ts +3 -1
  50. package/types/src/hyperlink/_Hyperlink.d.ts +6 -0
  51. package/types/src/lib/utils/utils.browser.d.ts +5 -0
  52. package/types/src/license/LicenseDetails.d.ts +5 -0
  53. package/types/src/primitives/CalcSignal.d.ts +20 -0
  54. package/types/src/protectedRange/IProtectedRangeCollection.d.ts +7 -2
  55. package/types/src/scripting/_ScriptUtils.d.ts +13 -0
  56. package/types/src/sheet/Sheet.d.ts +33 -2
  57. package/types/src/sheet/SheetCell.d.ts +2 -0
  58. package/types/src/sheet/SheetRange.d.ts +12 -1
  59. package/types/src/sheet/_SheetStateTypes.d.ts +14 -1
  60. package/types/src/style/IStyle.d.ts +5 -0
  61. package/types/src/table/AnchoredTable.d.ts +17 -1
  62. package/types/src/text/TextUtils.d.ts +18 -0
  63. package/browser/cjs/DoemwsUQoGCk0vBK.cjs +0 -33
  64. package/browser/cjs/_c2uwwpr03Y7lzIj.cjs +0 -1
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.2",
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.2",
47
- "@sheetxl/formulas-extended": "^0.7.28-beta.2",
48
- "@sheetxl/primitives": "^0.7.28-beta.2",
49
- "@sheetxl/scripting": "^0.7.28-beta.2",
50
- "@sheetxl/utils": "^0.7.28-beta.2",
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",
@@ -95,6 +95,17 @@
95
95
  "error.address.textToColumnsOverwrite": "Der Zielbereich enthält Daten.",
96
96
  "error.anchor.protected": "{description} nicht möglich. Das Element ist geschützt.",
97
97
  "error.hyperlink.invalidHyperlink": "Ungültiger Link.",
98
+ "error.io.encryptionUnavailable": "Kennwortschutz ist nicht verfügbar, daher kann diese Arbeitsmappe nicht mit einem Kennwort gespeichert werden.",
99
+ "error.io.passwordIncorrect": "Das Kennwort ist falsch.",
100
+ "error.io.passwordRequired": "''{name}'' ist kennwortgeschützt. Zum Öffnen ist ein Kennwort erforderlich.",
101
+ "error.io.passwordRequiredSave": "''{name}'' ist kennwortgeschützt. Geben Sie das Kennwort an, um die Datei zu speichern, oder speichern Sie sie ohne Schutz.",
102
+ "error.io.passwordRequiredSaveUnnamed": "Diese Datei ist kennwortgeschützt. Geben Sie das Kennwort an, um die Datei zu speichern, oder speichern Sie sie ohne Schutz.",
103
+ "error.io.passwordRequiredUnnamed": "Diese Datei ist kennwortgeschützt. Zum Öffnen ist ein Kennwort erforderlich.",
104
+ "error.io.readFailed": "{format} kann nicht gelesen werden — {reason}",
105
+ "error.io.readFormatUnavailable": "''{format}'' kann nicht geöffnet werden — dieser Dateityp wird nicht unterstützt.",
106
+ "error.io.writeFailed": "Die Arbeitsmappe kann nicht gespeichert werden — {reason}",
107
+ "error.io.writeFormatUnavailable": "Speichern als ''{format}'' ist nicht möglich — dieser Dateityp wird nicht unterstützt.",
108
+ "error.io.writeFormatUnresolved": "Der Dateityp zum Speichern konnte nicht ermittelt werden. Wählen Sie einen Dateityp oder verwenden Sie einen Dateinamen mit bekannter Erweiterung.",
98
109
  "error.model.modelClosed": "Das Modell wurde geschlossen. Weitere Vorgänge sind nicht zulässig.",
99
110
  "error.model.nameRequired": "Name ist erforderlich",
100
111
  "error.named.containsSpaces": "Der Name darf keine Leerzeichen enthalten.",
@@ -506,5 +517,6 @@
506
517
  "table.defaultName": "Tabelle{n}",
507
518
  "table.emptyColumnName": "Spalte",
508
519
  "table.totalsRowLabel": "Ergebnis",
520
+ "workbook.defaultName": "Arbeitsmappe",
509
521
  "workbook.defaultSheetName": "Tabelle{n}"
510
522
  }
@@ -96,6 +96,17 @@
96
96
  "error.anchor.protected": "Unable to {description}. The item is protected.",
97
97
  "error.function.builtInName": "''{name}'' is a built-in function. Choose a different name.",
98
98
  "error.hyperlink.invalidHyperlink": "Invalid hyperlink",
99
+ "error.io.encryptionUnavailable": "Password protection is not available, so this workbook cannot be saved with a password.",
100
+ "error.io.passwordIncorrect": "The password is incorrect.",
101
+ "error.io.passwordRequired": "''{name}'' is password protected. A password is required to open it.",
102
+ "error.io.passwordRequiredSave": "''{name}'' is password protected. Supply the password to save it, or save it without protection.",
103
+ "error.io.passwordRequiredSaveUnnamed": "This file is password protected. Supply the password to save it, or save it without protection.",
104
+ "error.io.passwordRequiredUnnamed": "This file is password protected. A password is required to open it.",
105
+ "error.io.readFailed": "Unable to read {format} — {reason}",
106
+ "error.io.readFormatUnavailable": "Unable to open ''{format}'' — that file type is not supported.",
107
+ "error.io.writeFailed": "Unable to save the workbook — {reason}",
108
+ "error.io.writeFormatUnavailable": "Unable to save as ''{format}'' — that file type is not supported.",
109
+ "error.io.writeFormatUnresolved": "Unable to determine the file type to save as. Choose a file type, or use a file name with a known extension.",
99
110
  "error.model.modelClosed": "Model has been closed. No further operations are allowed.",
100
111
  "error.model.nameRequired": "Name is required",
101
112
  "error.named.containsSpaces": "Name must not contain any spaces.",
@@ -521,5 +532,6 @@
521
532
  "table.defaultName": "Table{n}",
522
533
  "table.emptyColumnName": "Column",
523
534
  "table.totalsRowLabel": "Total",
535
+ "workbook.defaultName": "Workbook",
524
536
  "workbook.defaultSheetName": "Sheet{n}"
525
537
  }
@@ -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",
@@ -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
  */
@@ -2688,6 +2852,11 @@ declare global {
2688
2852
  * two diverge exactly where normalization is lossy — a number (`3.0` → `3`, `1**2` → `100`) or a
2689
2853
  * cell (raw `b2` vs the resolved coords). `undefined` only for a token with no captured source
2690
2854
  * image (e.g. a reference the engine rewrote programmatically rather than one the user typed).
2855
+ *
2856
+ * A reference literal is ONE span: a typed sheet qualifier and a trailing spill anchor ride inside
2857
+ * the `cell`/`named` token's `text` (`Sheet2!A1#`), so the caret rules an editor applies per token
2858
+ * treat the whole reference as one. The anchor keeps its own `postfix` token (carrying the same
2859
+ * {@link referenceIndex}) imaging the empty string, so the concatenation above still holds.
2691
2860
  */
2692
2861
  text?: string;
2693
2862
  /**
@@ -2894,8 +3063,16 @@ declare global {
2894
3063
  /**
2895
3064
  * Called when the calculation has been updated and
2896
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}.
2897
3070
  */
2898
3071
  onStale?(source: ICalculation): void;
3072
+ /**
3073
+ * Called when the calculation mode or the iterative-calculation settings change.
3074
+ */
3075
+ onOptionsChange?(source: ICalculation): void;
2899
3076
  /**
2900
3077
  * Called when a calculation is starting.
2901
3078
  */
@@ -2979,6 +3156,38 @@ declare global {
2979
3156
  readonly AutomaticExceptTables: "automaticExceptTables";
2980
3157
  };
2981
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
+ }
2982
3191
  /**
2983
3192
  * Represents the status of a calculation result
2984
3193
  */
@@ -3241,12 +3450,28 @@ declare global {
3241
3450
  *
3242
3451
  * @remarks
3243
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".
3244
3456
  */
3245
3457
  getWarnings(): readonly string[];
3246
3458
  /**
3247
3459
  * Retrieves any errors attached to the cell.
3248
3460
  */
3249
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;
3250
3475
  /**
3251
3476
  * Returns the style information applied to the cell.
3252
3477
  *
@@ -4689,11 +4914,24 @@ declare global {
4689
4914
  * Returns a range that includes the current range up to a content edge boundary.
4690
4915
  *
4691
4916
  * @param direction The direction.
4692
- * @param cell The cell to use as a starting point.
4693
- * If not provide the cell closest to the edge will be used.
4917
+ * @param cell Either the cell to walk from — as {@link ICellRange.GetExtendedOptions.cell}, and
4918
+ * the positional form Office Scripts' `getExtendedRange` takes — or the full
4919
+ * {@link ICellRange.GetExtendedOptions}. If neither is given the cell closest to
4920
+ * the edge is used.
4694
4921
  * @returns `ICellRange` extended in the given direction.
4922
+ *
4923
+ * @remarks
4924
+ * The result **includes** the current range, and a boundary with nowhere to go returns the range
4925
+ * unchanged — so comparing the two is how you tell there was nothing to extend onto.
4926
+ *
4927
+ * {@link ICellRange.GetExtendedOptions.basis} picks what the boundary is read from: the range's
4928
+ * own content (Ctrl+Arrow, the default) or the lines flanking it (a double-clicked fill handle).
4929
+ *
4930
+ * Both bases read the content, merge and table indexes rather than walking cells, so the cost is
4931
+ * the blocks involved and not the distance traveled — extending across a million rows costs what
4932
+ * extending across ten does.
4695
4933
  */
4696
- getExtended(direction: IRange.Direction, cell?: ICell.Address): this;
4934
+ getExtended(direction: IRange.Direction, cell?: ICell.Address | ICellRange.GetExtendedOptions): this;
4697
4935
  /**
4698
4936
  * Returns a range with coordinates adjusted to be fixed (absolute) or flexible (relative).
4699
4937
  *
@@ -5809,6 +6047,50 @@ declare global {
5809
6047
  */
5810
6048
  colEnd?: boolean;
5811
6049
  }
6050
+ /**
6051
+ * Options for {@link ICellRange.getExtended}.
6052
+ */
6053
+ interface GetExtendedOptions {
6054
+ /**
6055
+ * The cell to walk from. Only `'content'` extends from a cell — the flanking lines a
6056
+ * `'adjacent'` extension reads are fixed by the range's own edges — so this is ignored there.
6057
+ *
6058
+ * @defaultValue the cell of the range closest to the edge being extended toward.
6059
+ */
6060
+ cell?: ICell.Address;
6061
+ /**
6062
+ * What the content edge is read from.
6063
+ *
6064
+ * - `'content'` — the range's own content, walked from {@link cell}. This is Ctrl+Arrow: it
6065
+ * runs to the end of the block it is in, or from a blank onto the next block.
6066
+ * - `'adjacent'` — the two lines flanking the range on the cross axis (for a downward
6067
+ * extension, the column left of the left edge and the column right of the right edge). Each
6068
+ * contributes its contiguous run measured from the line the extension would start on, and
6069
+ * the **further** of the two wins; a flank that starts blank contributes nothing, which is
6070
+ * why a spacer column stops the extension dead. The reach is then cut short **before** the
6071
+ * nearest populated line inside the range's own columns, so an existing block is not run
6072
+ * over. This is the destination Excel picks when the fill handle is double-clicked, and it
6073
+ * feeds {@link ICellRange.autoFill} directly.
6074
+ *
6075
+ * @defaultValue 'content'
6076
+ */
6077
+ basis?: 'content' | 'adjacent';
6078
+ /**
6079
+ * Where a walk that begins on a **blank** cell comes to rest.
6080
+ *
6081
+ * - `'enter'` — on the first cell of the block it runs into. This is Ctrl+Arrow.
6082
+ * - `'before'` — on the last blank, one short of that block. This is what a double-clicked
6083
+ * selection border does.
6084
+ *
6085
+ * Blanks are the *only* thing this changes: from a populated cell both run to the end of that
6086
+ * cell's own block and stop in the same place. It is also independent of {@link basis} — that
6087
+ * says where the boundary is read from, this says what happens on the way — though `'adjacent'`
6088
+ * has nothing to apply it to, since a blank flank contributes no reach in the first place.
6089
+ *
6090
+ * @defaultValue 'enter'
6091
+ */
6092
+ fromBlank?: 'enter' | 'before';
6093
+ }
5812
6094
  /**
5813
6095
  * Options for {@link ICellRange.getSurrounding}.
5814
6096
  */
@@ -6552,11 +6834,20 @@ declare global {
6552
6834
  /** Cells inside a dynamic-array spill zone. Writing into one is a real failure mode. */
6553
6835
  readonly Spills: "spills";
6554
6836
  /**
6555
- * Evaluated state: cells whose calculation itself failed — mostly circular references.
6556
- * Distinct from {@link Feature.Error}: `#DIV/0!` is a successfully calculated error VALUE
6557
- * (the `Error` kind); `CalcError` is the engine failing to evaluate at all.
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}.
6558
6841
  */
6559
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";
6560
6851
  /** Direct fill. */
6561
6852
  readonly Fill: "fill";
6562
6853
  /** Direct borders. */
@@ -9846,8 +10137,11 @@ declare global {
9846
10137
  * Only the keys named are touched. An explicit `null` **clears** a key — required when switching
9847
10138
  * a rule between its two shapes, since `condition`+`style` and `scale` are mutually exclusive
9848
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.
9849
10143
  */
9850
- update(properties: IConditionalFormat.Modifiers, options?: ITransaction.OperationOptions): this;
10144
+ update(properties: IConditionalFormat.Modifiers | IConditionalFormat, options?: ITransaction.OperationOptions): this;
9851
10145
  /**
9852
10146
  * Returns a snapshot of the conditional that can be used for copying and archiving.
9853
10147
  */
@@ -10277,8 +10571,12 @@ declare global {
10277
10571
  export namespace IConditionalFormatCollection {
10278
10572
  /**
10279
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}.
10280
10578
  */
10281
- interface AddOptions extends IConditionalFormat.Properties, ITransaction.OperationOptions {
10579
+ interface AddOptions extends IConditionalFormat.Properties, IAnchored.AddOptions {
10282
10580
  }
10283
10581
  /**
10284
10582
  * Options for searching for {@link IConditionalFormat}s.
@@ -10662,8 +10960,12 @@ declare global {
10662
10960
  export namespace IDataValidationCollection {
10663
10961
  /**
10664
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}.
10665
10967
  */
10666
- interface AddOptions extends IDataValidation.Properties, ITransaction.OperationOptions {
10968
+ interface AddOptions extends IDataValidation.Properties, IAnchored.AddOptions {
10667
10969
  }
10668
10970
  interface GetItemsOptions {
10669
10971
  /**
@@ -12313,12 +12615,19 @@ declare global {
12313
12615
  */
12314
12616
  getFormulaAt(row: number, column: number, sheetName?: string): string | null;
12315
12617
  /**
12316
- * Returns the spill range anchored at a cell.
12618
+ * Returns the range the formula anchored at a cell OCCUPIES — what the spill anchor operator
12619
+ * (`A1#`) resolves to.
12317
12620
  *
12318
- * @param row The row where the spill starts.
12319
- * @param column The column where the spill starts.
12621
+ * @param row The row the formula is anchored at.
12622
+ * @param column The column the formula is anchored at.
12320
12623
  * @param sheetName The name of the sheet. If not provided the current sheet is used.
12321
- * @returns The spilled range, or `null` if nothing spills from that cell.
12624
+ * @returns The range, or `null` if no formula is anchored there.
12625
+ *
12626
+ * @remarks
12627
+ * The range is the formula's spill when it produced an array, the whole block for a legacy
12628
+ * array formula, and the cell ITSELF for an ordinary formula — every formula occupies at least
12629
+ * the cell it sits in. `null` means no formula is anchored at that cell: it holds a constant, it
12630
+ * is empty, or it merely lies INSIDE another cell's spill or array block.
12322
12631
  */
12323
12632
  getSpillAt(row: number, column: number, sheetName?: string): IReferenceRange | null;
12324
12633
  /**
@@ -13952,7 +14261,9 @@ declare global {
13952
14261
  * @remarks
13953
14262
  * This has no counterpart in Excel; it is ours and applies to links opened in a browser.
13954
14263
  *
13955
- * @defaultValue `_self` for a location within this workbook, otherwise `_blank`.
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`.
13956
14267
  */
13957
14268
  getTarget(): string;
13958
14269
  /**
@@ -16294,8 +16605,13 @@ declare global {
16294
16605
  export namespace IProtectedRangeCollection {
16295
16606
  /**
16296
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}.
16297
16613
  */
16298
- interface AddOptions extends IProtectedRange.Properties, ITransaction.OperationOptions {
16614
+ interface AddOptions extends IProtectedRange.Properties, IAnchored.AddOptions {
16299
16615
  }
16300
16616
  /**
16301
16617
  * Options for searching for {@link IProtectedRange}s.
@@ -22025,6 +22341,11 @@ declare global {
22025
22341
  readonly Quarters5: "5Quarters";
22026
22342
  readonly Rating5: "5Rating";
22027
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";
22028
22349
  };
22029
22350
  type IconSet = typeof IconSet[keyof typeof IconSet];
22030
22351
  }
@@ -27830,6 +28151,11 @@ declare global {
27830
28151
  getCpuCount(): number;
27831
28152
  getMemory(): number;
27832
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
+ */
27833
28159
  isValidFor: (feature: string) => boolean;
27834
28160
  getDeveloperCount(): number;
27835
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