@sheetxl/sdk 0.8.0-beta.5 → 0.8.0-beta.6

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 (109) hide show
  1. package/browser/cjs/-wfVn4ubg563jjqj.cjs +93 -0
  2. package/browser/cjs/B2GVAGA-CBeu_7U4.cjs +1 -0
  3. package/browser/cjs/{D_hl_D3IBlVqjbUu.cjs → CMrcyRRWS0gjwpr2.cjs} +1 -1
  4. package/browser/cjs/{BV3LBQXG3kA013a2.cjs → DFKGFVvoELb8_p_B.cjs} +1 -1
  5. package/browser/cjs/{CvjJnxfMX3aal6Zj.cjs → KMBs7XyoINajcR-L.cjs} +1 -1
  6. package/browser/cjs/index.cjs +2 -2
  7. package/browser/esm/{B6t-k7D3HcTIJ-Xl.mjs → 7_M82_Otn5kHQ0qd.mjs} +2 -2
  8. package/browser/esm/{CLfbadk6S57dy8sc.mjs → CEk-nufZXNFx5jDl.mjs} +9451 -8355
  9. package/browser/esm/{DWJJtu3q6iMfUbbN.mjs → CfoNUsKHL7SzfO8c.mjs} +2 -2
  10. package/browser/esm/{BiUnakUlo61EtntE.mjs → DBjWjEUK9qrHG5VD.mjs} +1 -1
  11. package/browser/esm/{B45qhpdlbHHa6-gu.mjs → DRsp6JAObqXYGvhz.mjs} +2 -2
  12. package/browser/esm/{ahTq_KBqu4jWkQ8A.mjs → J1egfq2ajlXPw3Ki.mjs} +2 -2
  13. package/browser/esm/{CoiupvxiR8tLrCa4.mjs → iLZfKwfSx5bQgCOp.mjs} +2 -2
  14. package/browser/esm/index.mjs +8 -8
  15. package/node/esm/{CDh1Fw2maXvyOhIs.mjs → BMtLBfP7JzIsG9_G.mjs} +1 -1
  16. package/node/esm/{K4Xw9Ur7uFf9M5Gh.mjs → CynxiHhVY9UGe_h6.mjs} +1 -1
  17. package/node/esm/{BP9JmWMpUInDk4OG.mjs → DYRjFZ75QYgmgEWF.mjs} +1 -1
  18. package/node/esm/{B2dQyLw_fQU5VuXt.mjs → DpyQm1VnGyCmRRKJ.mjs} +1 -1
  19. package/node/esm/index.mjs +12767 -11626
  20. package/package.json +6 -6
  21. package/resources/locales/de/model.msg.json +16 -0
  22. package/resources/locales/en/model.msg.json +16 -0
  23. package/types/scripting-api.json +6166 -6120
  24. package/types/scripting.d.ts +481 -128
  25. package/types/src/calculation/_TableRename.d.ts +13 -0
  26. package/types/src/calculation/grid/CalcGrid.d.ts +18 -3
  27. package/types/src/calculation/grid/CalcGridBackend.d.ts +49 -0
  28. package/types/src/calculation/grid/CalcGridProxy.d.ts +5 -0
  29. package/types/src/calculation/grid/ICalcGrid.d.ts +37 -0
  30. package/types/src/calculation/grid/_CalcRequest.d.ts +22 -0
  31. package/types/src/calculation/state/CalculationContext.d.ts +7 -1
  32. package/types/src/cell/ICell.d.ts +21 -1
  33. package/types/src/chart/Chart.d.ts +5 -18
  34. package/types/src/chart/ChartCollection.d.ts +1 -1
  35. package/types/src/chart/IChart.d.ts +11 -10
  36. package/types/src/chart/IChartCollection.d.ts +3 -3
  37. package/types/src/color/_BuiltInIndexDefs.d.ts +6 -0
  38. package/types/src/comment/Comment.d.ts +69 -7
  39. package/types/src/comment/IComment.d.ts +70 -51
  40. package/types/src/comment/NoteMovable.d.ts +26 -0
  41. package/types/src/comment/_CommentUtils.d.ts +23 -1
  42. package/types/src/comment/_NoteBox.d.ts +50 -0
  43. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +27 -2
  44. package/types/src/condition/BuiltInOperators/AfterEqualToOperator.d.ts +2 -0
  45. package/types/src/condition/BuiltInOperators/AfterOperator.d.ts +2 -0
  46. package/types/src/condition/BuiltInOperators/AndOperator.d.ts +3 -1
  47. package/types/src/condition/BuiltInOperators/AverageOperator.d.ts +2 -0
  48. package/types/src/condition/BuiltInOperators/BeforeEqualToOperator.d.ts +2 -0
  49. package/types/src/condition/BuiltInOperators/BeforeOperator.d.ts +2 -0
  50. package/types/src/condition/BuiltInOperators/BetweenOperator.d.ts +2 -0
  51. package/types/src/condition/BuiltInOperators/ContainsOperator.d.ts +2 -0
  52. package/types/src/condition/BuiltInOperators/EndsWithOperator.d.ts +2 -0
  53. package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +2 -0
  54. package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +2 -0
  55. package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +2 -0
  56. package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +2 -0
  57. package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +2 -0
  58. package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +2 -0
  59. package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +2 -0
  60. package/types/src/condition/BuiltInOperators/NotOperator.d.ts +2 -0
  61. package/types/src/condition/BuiltInOperators/OrOperator.d.ts +3 -1
  62. package/types/src/condition/BuiltInOperators/StartsWithOperator.d.ts +2 -0
  63. package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
  64. package/types/src/condition/BuiltInOperators/TopNOperator.d.ts +6 -0
  65. package/types/src/condition/Condition.d.ts +2 -0
  66. package/types/src/condition/ICondition.d.ts +59 -2
  67. package/types/src/condition/_ConditionUtils.d.ts +10 -0
  68. package/types/src/filter/IFilter.d.ts +76 -1
  69. package/types/src/movable/AbstractMovableContent.d.ts +54 -0
  70. package/types/src/movable/Control.d.ts +5 -7
  71. package/types/src/movable/CustomElement.d.ts +4 -5
  72. package/types/src/movable/IControl.d.ts +7 -5
  73. package/types/src/movable/ICustomElement.d.ts +7 -2
  74. package/types/src/movable/IMovable.d.ts +74 -42
  75. package/types/src/movable/IMovableCollection.d.ts +6 -0
  76. package/types/src/movable/Movable.d.ts +53 -32
  77. package/types/src/numFmt/_FormatCell.d.ts +9 -0
  78. package/types/src/person/index.d.ts +1 -0
  79. package/types/src/picture/IPicture.d.ts +7 -1
  80. package/types/src/picture/Picture.d.ts +5 -4
  81. package/types/src/primitives/Range.d.ts +31 -1
  82. package/types/src/primitives/RangeStats.d.ts +7 -2
  83. package/types/src/primitives/ReferenceRange.d.ts +2 -0
  84. package/types/src/primitives/stats/AggregateStats.d.ts +49 -15
  85. package/types/src/primitives/stats/FrequencyStats.d.ts +1 -1
  86. package/types/src/primitives/stats/Ranked.d.ts +1 -1
  87. package/types/src/primitives/stats/SortedNumbers.d.ts +2 -2
  88. package/types/src/shape/IShape.d.ts +6 -4
  89. package/types/src/shape/Shape.d.ts +5 -10
  90. package/types/src/sheet/ISheet.d.ts +3 -2
  91. package/types/src/sheet/Sheet.d.ts +73 -21
  92. package/types/src/sheet/SheetCell.d.ts +1 -1
  93. package/types/src/sheet/_SheetFilterUtils.d.ts +17 -0
  94. package/types/src/sheet/_SheetStateTypes.d.ts +18 -0
  95. package/types/src/sheet/_SheetUtils.d.ts +15 -0
  96. package/types/src/sheetHeader/ISheetHeader.d.ts +17 -0
  97. package/types/src/sheetHeader/SheetHeader.d.ts +11 -0
  98. package/types/src/slicer/ISlicer.d.ts +7 -2
  99. package/types/src/slicer/Slicer.d.ts +5 -9
  100. package/types/src/table/AnchoredTable.d.ts +46 -6
  101. package/types/src/table/ITable.d.ts +10 -1
  102. package/types/src/table/ITableCollection.d.ts +10 -0
  103. package/types/src/table/_FilterField.d.ts +9 -1
  104. package/types/src/text/richtext/IRichText.d.ts +36 -0
  105. package/types/src/text/richtext/index.d.ts +1 -0
  106. package/types/src/transaction/ITransaction.d.ts +11 -0
  107. package/types/src/transaction/Transaction.d.ts +2 -0
  108. package/browser/cjs/By2s44r4eRFvMq6H.cjs +0 -93
  109. package/browser/cjs/Nt1C8528otcBXJ2J.cjs +0 -1
@@ -0,0 +1,13 @@
1
+ import { IRange } from '@sheetxl/primitives';
2
+ import { ICalculation } from './ICalculation';
3
+ /**
4
+ * Re-points every structured reference that names the table `from` at the table `to`. A
5
+ * reference with no table name is left alone: it names the table it is written in.
6
+ */
7
+ export declare function renameTableTransform(from: string, to: string): ICalculation.FormulaTransform;
8
+ /**
9
+ * `text`, parsed at `at`, with its references to the table `from` re-pointed at `to`, or the text
10
+ * itself when it names no such table or does not parse.
11
+ */
12
+ export declare function renameTableInText(text: string, at: IRange.CellCoords, from: string, to: string): string;
13
+ //# sourceMappingURL=_TableRename.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { IRange, Scalar, IRuntime, FormulaError } from '@sheetxl/primitives';
2
- import { CoordUtils } from '@sheetxl/utils';
2
+ import { CoordUtils, RunCoords } from '@sheetxl/utils';
3
3
  import { ITypes } from '../../type';
4
4
  import { IListener } from '../../listener';
5
5
  import { ListenerEmitter } from '../../listener/ListenerEmitter';
@@ -223,6 +223,15 @@ export declare class CalcGrid implements ICalcGrid {
223
223
  getEntireCoords(): IRange.Coords;
224
224
  /** {@inheritDoc ICalcGrid.resize} */
225
225
  resize(options?: ICalcGrid.RequestOptions): void;
226
+ /** {@inheritDoc ICalcGrid.setHidden} */
227
+ setHidden(axis: IRange.Axis, runs: readonly RunCoords[], options?: ICalcGrid.RequestOptions): void;
228
+ /** {@inheritDoc ICalcGrid.setFiltered} */
229
+ setFiltered(filtered: boolean, options?: ICalcGrid.RequestOptions): void;
230
+ /**
231
+ * Holds what the owner says of itself - what it hides, whether it is filtered - in the caller's
232
+ * operation: an undo restores it with whatever changed it.
233
+ */
234
+ protected _holdOwnerState(update: Pick<Partial<CalcGrid.State>, 'hiddenRows' | 'hiddenColumns' | 'filtered'>): void;
226
235
  /** {@inheritDoc ICalcGrid.getId} */
227
236
  getId(): string;
228
237
  /** {@inheritDoc ICalcGrid.toJSON} */
@@ -237,8 +246,8 @@ export declare class CalcGrid implements ICalcGrid {
237
246
  /**
238
247
  * This grid's content as its calc JSON (DESIGN-CALC-SERVICE §6.6): the same record a save
239
248
  * writes, and what a start opens the backend from. The formulas, the array extents, the
240
- * volatile regions and - with `includeData` - the values are all this grid's own; a volatile
241
- * region is kept only where a formula still sits.
249
+ * volatile regions, the rows and columns the owner hides and - with `includeData` - the values
250
+ * are all this grid's own; a volatile region is kept only where a formula still sits.
242
251
  *
243
252
  * A pending entry is written as its own text; a compiled one images its block where it sits.
244
253
  * @internal
@@ -366,6 +375,12 @@ export declare namespace CalcGrid {
366
375
  errorSpatial: ISpatialMap<boolean>;
367
376
  /** The grid was deleted - a sheet's removal - in this snapshot or before it. */
368
377
  deleted: boolean;
378
+ /** The rows the owner hides, ascending and disjoint; `null` for none. See {@link ICalcGrid.setHidden}. */
379
+ hiddenRows: readonly RunCoords[] | null;
380
+ /** The columns the owner hides, as {@link hiddenRows}. */
381
+ hiddenColumns: readonly RunCoords[] | null;
382
+ /** Whether the owner is filtered. See {@link ICalcGrid.setFiltered}. */
383
+ filtered: boolean;
369
384
  }
370
385
  /**
371
386
  * The maps a write may change. Each is cloned once, on first ask, under the caller's key; a map
@@ -1,4 +1,5 @@
1
1
  import { IRange, FormulaError, Scalar, IFormulaContext } from '@sheetxl/primitives';
2
+ import { RunCoords } from '@sheetxl/utils';
2
3
  import { Tuple, ISpatialQuery, ISparseGrid, ISpatialMap, ISpatialMap3D } from '../../collections';
3
4
  import { IContextContainer, CalcNode } from '../state';
4
5
  import { SpillEntry, FormulaSpatialValue, ContentfulSpatialValue, PrecedentSpatialValue, CircularEntry } from '../spatial';
@@ -46,6 +47,12 @@ export declare class CalcGridBackend extends CalcGridProxy implements ICalcGrid.
46
47
  _getEntireCoords: () => IRange.Coords;
47
48
  /** The size a `resize` gave, in place of {@link _getEntireCoords}; versioned with the maps. */
48
49
  protected _resized: IRange.Coords | null;
50
+ /** The rows the owner hides, ascending and disjoint; `null` for none. Versioned with the maps. */
51
+ protected _hiddenRows: readonly RunCoords[] | null;
52
+ /** The columns the owner hides, as {@link _hiddenRows}. */
53
+ protected _hiddenColumns: readonly RunCoords[] | null;
54
+ /** Whether the owner is filtered ({@link ICalcGrid.setFiltered}). Versioned with the maps. */
55
+ protected _filtered: boolean;
49
56
  /**
50
57
  * @see CalcGridBackend.ConstructorOptions.unanchored
51
58
  */
@@ -151,6 +158,42 @@ export declare class CalcGridBackend extends CalcGridProxy implements ICalcGrid.
151
158
  _detach(): void;
152
159
  /** The engine's own dirty marking over this grid's cells. @internal */
153
160
  _markDirtyRegionsNow(coords: readonly IRange.Coords[]): void;
161
+ /**
162
+ * The rows or columns the owner hides, ascending and disjoint; `null` for none. Engine-side: not
163
+ * on {@link ICalcGrid}.
164
+ */
165
+ getHiddenRuns(axis: IRange.Axis): readonly RunCoords[] | null;
166
+ /**
167
+ * Whether the owner is filtered: some AutoFilter or table on it holds a condition
168
+ * ({@link ICalcGrid.setFiltered}). Engine-side: not on {@link ICalcGrid}.
169
+ */
170
+ isFiltered(): boolean;
171
+ /**
172
+ * A range's skip (`IRange.IteratorOptions.processRowSkip`) over the rows or columns the owner
173
+ * hides, for a range starting at `origin` on that axis; `null` when the hidden set does not
174
+ * cross `origin..end`.
175
+ *
176
+ * @remarks
177
+ * One per hidden set and origin, kept: the statistics cache their zones by the skip they were
178
+ * walked under, so a formula handed the same skip on every pass keeps them warm, and a set
179
+ * that changed is a new array and so a new skip. A skip keeps a cursor, which makes it cheap
180
+ * to ask in order and correct to ask out of it.
181
+ */
182
+ getHiddenSkip(axis: IRange.Axis, origin: number, end: number): ((index: number, reverse?: boolean) => number) | null;
183
+ /**
184
+ * What a `hidden` request carries, held; the formulas that can skip hidden cells are owed a pass.
185
+ *
186
+ * @remarks
187
+ * A row hidden changes no cell, so nothing in the graph reaches them. They are found by what
188
+ * they call ({@link FormulaSpatialValue.hasTotals}), on every grid: a total reads another
189
+ * sheet's rows too, and a fact of the compiled formula holds for one a load trusted and never
190
+ * evaluated.
191
+ */
192
+ protected _setHiddenNow(axis: IRange.Axis, runs: readonly RunCoords[]): void;
193
+ /** What a `filtered` request carries, held; as {@link _setHiddenNow}, the totals are owed a pass. */
194
+ protected _setFilteredNow(filtered: boolean): void;
195
+ /** Mark every formula that calls a total function, on every grid, and ask for a pass. */
196
+ protected _markTotals(): void;
154
197
  /** @inheritdoc ICalcGrid.getId */
155
198
  getShadowOf(): string | null;
156
199
  /** @inheritdoc ICalcGrid.isArrayFirstCell */
@@ -434,6 +477,12 @@ export interface CalcGridMaps {
434
477
  circular: ISpatialMap<CircularEntry>;
435
478
  /** The size a `resize` gave, or `null` for the one the grid was made with. */
436
479
  entireCoords?: IRange.Coords | null;
480
+ /** The rows the owner hides, or `null` for none. */
481
+ hiddenRows?: readonly RunCoords[] | null;
482
+ /** The columns the owner hides, or `null` for none. */
483
+ hiddenColumns?: readonly RunCoords[] | null;
484
+ /** Whether the owner is filtered. */
485
+ filtered?: boolean;
437
486
  }
438
487
  interface CalcGridSnapshot {
439
488
  calcGrid: CalcGridBackend;
@@ -1,4 +1,5 @@
1
1
  import { IRange, FormulaError, Scalar } from '@sheetxl/primitives';
2
+ import { RunCoords } from '@sheetxl/utils';
2
3
  import { IListener } from '../../listener';
3
4
  import { ListenerEmitter } from '../../listener/ListenerEmitter';
4
5
  import { ISpatialMap, Tuple } from '../../collections';
@@ -40,6 +41,10 @@ export declare class CalcGridProxy implements ICalcGrid.Backend {
40
41
  getEntireCoords(): IRange.Coords;
41
42
  /** {@inheritDoc ICalcGrid.resize} */
42
43
  resize(options?: ICalcGrid.RequestOptions): void;
44
+ /** {@inheritDoc ICalcGrid.setHidden} */
45
+ setHidden(axis: IRange.Axis, runs: readonly RunCoords[], options?: ICalcGrid.RequestOptions): void;
46
+ /** {@inheritDoc ICalcGrid.setFiltered} */
47
+ setFiltered(filtered: boolean, options?: ICalcGrid.RequestOptions): void;
43
48
  /** {@inheritDoc ICalcGrid.addListeners} */
44
49
  addListeners(listeners: ICalcGrid.IListeners, options?: IListener.Options): IListener.Remove;
45
50
  /** @inheritdoc ICalcGrid.setInputs */
@@ -1,4 +1,5 @@
1
1
  import { Scalar, IRange, FormulaError } from '@sheetxl/primitives';
2
+ import { RunCoords } from '@sheetxl/utils';
2
3
  import { RangeStats } from '../../primitives/RangeStats';
3
4
  import { ITypes } from '../../type';
4
5
  import { ITransaction } from '../../transaction';
@@ -312,6 +313,30 @@ export interface ICalcGrid {
312
313
  * @param options See {@link ICalcGrid.RequestOptions}.
313
314
  */
314
315
  resize(options?: ICalcGrid.RequestOptions): void;
316
+ /**
317
+ * Sets the rows or columns the grid's owner hides: the whole set on that axis, replacing the
318
+ * one before. Recorded with the grid's other content, in the caller's operation, and told to the
319
+ * engine in order with the grid's writes; every formula that calls `SUBTOTAL` or `AGGREGATE`
320
+ * recalculates. The set a grid opens with is its seed's ({@link ICalcGrid.JSON.hiddenRows}).
321
+ *
322
+ * @param axis The axis the runs are on.
323
+ * @param runs Every hidden run on that axis, ascending and disjoint; empty for none.
324
+ * @param options See {@link ICalcGrid.RequestOptions}.
325
+ */
326
+ setHidden(axis: IRange.Axis, runs: readonly RunCoords[], options?: ICalcGrid.RequestOptions): void;
327
+ /**
328
+ * Sets whether the grid's owner is filtered: some AutoFilter or table on it holds a condition.
329
+ * Recorded and told as {@link setHidden} is; every formula that calls `SUBTOTAL` or `AGGREGATE`
330
+ * recalculates. The state a grid opens with is its seed's ({@link ICalcGrid.JSON.filtered}).
331
+ *
332
+ * @remarks
333
+ * `SUBTOTAL` 1-11 skip the owner's hidden rows only while this is set; 101-111 skip them always.
334
+ * A hidden row is one thing whoever hid it, so this is the whole of what a filter adds.
335
+ *
336
+ * @param filtered `true` while a condition is held.
337
+ * @param options See {@link ICalcGrid.RequestOptions}.
338
+ */
339
+ setFiltered(filtered: boolean, options?: ICalcGrid.RequestOptions): void;
315
340
  /**
316
341
  * Opens the grid from a seed: a statement of its whole content (DESIGN-CALC-SERVICE §6).
317
342
  *
@@ -810,6 +835,18 @@ export declare namespace ICalcGrid {
810
835
  * For built-in functions volatile will be auto added.
811
836
  */
812
837
  volatile?: IRange.Address[];
838
+ /**
839
+ * The rows the grid's owner hides, ascending and disjoint; absent for none.
840
+ */
841
+ hiddenRows?: readonly RunCoords[];
842
+ /**
843
+ * The columns the grid's owner hides, as {@link hiddenRows}.
844
+ */
845
+ hiddenColumns?: readonly RunCoords[];
846
+ /**
847
+ * Whether the grid's owner is filtered ({@link ICalcGrid.setFiltered}); absent for not.
848
+ */
849
+ filtered?: boolean;
813
850
  }
814
851
  /**
815
852
  * Options for {@link ICalcGrid.seed}.
@@ -1,4 +1,5 @@
1
1
  import { Scalar, IRange } from '@sheetxl/primitives';
2
+ import { RunCoords } from '@sheetxl/utils';
2
3
  import { ISpatialMap, Tuple } from '../../collections';
3
4
  import { FormulaRecord, FormulaImager } from '../formula';
4
5
  import { ICalculation } from '../ICalculation';
@@ -31,6 +32,27 @@ export type CalcRequest =
31
32
  type: 'resize';
32
33
  entireCoords: IRange.Coords;
33
34
  options?: ICalcGrid.RequestOptions;
35
+ }
36
+ /**
37
+ * The rows or columns the grid's owner hides changed: every run as it is now, ascending and
38
+ * disjoint, empty for none. What the functions that skip hidden cells read (`SUBTOTAL` 101-111,
39
+ * `AGGREGATE`'s ignore-hidden options); the formulas that call them are recalculated.
40
+ */
41
+ | {
42
+ type: 'hidden';
43
+ axis: IRange.Axis;
44
+ runs: readonly RunCoords[];
45
+ options?: ICalcGrid.RequestOptions;
46
+ }
47
+ /**
48
+ * Whether the grid's owner is filtered changed: some AutoFilter or table on it holds a
49
+ * condition, or none does any more. What `SUBTOTAL` 1-11 read to decide whether hidden rows
50
+ * count; the formulas that call the total functions are recalculated.
51
+ */
52
+ | {
53
+ type: 'filtered';
54
+ filtered: boolean;
55
+ options?: ICalcGrid.RequestOptions;
34
56
  } | {
35
57
  type: 'seed';
36
58
  json: ICalcGrid.JSON;
@@ -92,7 +92,13 @@ export declare class CalculationContext implements IFormulaContext {
92
92
  /** @inheritdoc IFormulaContext.formatResults */
93
93
  formatResults(numFmt: string): void;
94
94
  /** @inheritdoc IFormulaContext.filterHidden */
95
- filterHidden(range: IRange, axes?: IRange.AxisSelection): IRange;
95
+ filterHidden(range: IRange, options?: IFormulaContext.FilterHiddenOptions): IRange;
96
+ /**
97
+ * The id of the grid a reference's public coords name: its sheet's, or - unqualified - the grid
98
+ * being evaluated. `getCoords()` spells a sheet as its name, and the engine's own maps (the
99
+ * formulas, the hidden runs) are keyed by grid id.
100
+ */
101
+ private _gridIdOf;
96
102
  /** @inheritdoc IFormulaContext.filterTotals */
97
103
  filterTotals(range: IRange): IRange;
98
104
  /** @inheritdoc IFormulaContext.getSheetIndex */
@@ -369,10 +369,13 @@ export interface ICell {
369
369
  /**
370
370
  * Creates a temporary copy of the cell with the specified updates applied.
371
371
  *
372
+ * @param modifiers The update.
373
+ * @param options How the update is read. See {@link ICell.CreateCellOptions}.
374
+ *
372
375
  * @remarks
373
376
  * The original cell remains unchanged, making this useful for temporary modifications.
374
377
  */
375
- createCell(modifiers: ICell.Update): ICell;
378
+ createCell(modifiers: ICell.Update, options?: ICell.CreateCellOptions): ICell;
376
379
  /**
377
380
  * Returns the `CellCoords`.
378
381
  */
@@ -518,6 +521,23 @@ export declare namespace ICell {
518
521
  */
519
522
  comments?: IComment.Update;
520
523
  }
524
+ /**
525
+ * Options for {@link ICell.createCell} and {@link ISheet.createCell}.
526
+ */
527
+ interface CreateCellOptions {
528
+ /**
529
+ * Whether a text value is read as a typed entry is — `9/23/95` a date, `12.3%` a number —
530
+ * rather than taken as the text it is. `true` reads it with the defaults; an
531
+ * {@link ICell.ModifiersFromStringOptions} customizes the reading.
532
+ *
533
+ * @defaultValue false
534
+ *
535
+ * @remarks
536
+ * The same reading {@link ICellRange.setValues} gives text, where it is the default. Here it
537
+ * is opt-in: a cell created from a value keeps that value.
538
+ */
539
+ textParser?: boolean | ICell.ModifiersFromStringOptions;
540
+ }
521
541
  /**
522
542
  * Configuration options for customizing the parsing of a string into an `ICell.Update` object.
523
543
  * Commonly used for processing CSV imports and other string-based data sources.
@@ -1,22 +1,20 @@
1
1
  import { IResource, IResourceCollection } from '../resource';
2
- import { IModel, AbstractModel } from '../model';
3
- import { IMovable } from '../movable';
2
+ import { AbstractMovableContent } from '../movable/AbstractMovableContent';
4
3
  import { ICellRange } from '../cellRange';
5
4
  import { IEmbeddedPart } from '../io';
6
5
  import { IChart } from './IChart';
7
- interface State extends AbstractModel.State {
6
+ interface State extends AbstractMovableContent.State {
8
7
  data?: any;
9
8
  }
10
9
  /**
11
10
  * Implementation for {@link IChart}.
12
11
  */
13
- export declare class Chart extends AbstractModel<State, IChart.JSON> implements IChart {
12
+ export declare class Chart extends AbstractMovableContent<State, IChart.JSON> implements IChart {
14
13
  /**
15
14
  * The chart's document part. Held beside {@link State.data} rather than in it because the
16
15
  * resources it carries are model references, not JSON, and have to be re-persisted per save.
17
16
  */
18
17
  protected _part: IEmbeddedPart | null;
19
- protected _getMovable: () => IMovable;
20
18
  protected _getRange: ((address: string) => ICellRange | null) | null;
21
19
  /** The markup `_facts` was read from. */
22
20
  private _factsSource;
@@ -47,15 +45,11 @@ export declare class Chart extends AbstractModel<State, IChart.JSON> implements
47
45
  getAxes(): readonly IChart.IAxis[];
48
46
  /** {@inheritDoc IChart.getPivotSource} */
49
47
  getPivotSource(): string | null;
50
- /** {@inheritDoc Movable.Content.getDescription} */
51
- getDescription(): string;
52
- /** {@inheritDoc IChart.getMovable} */
53
- getMovable(): IMovable;
54
48
  /** {@inheritDoc IChart.getXML} */
55
49
  getXML(): string | null;
56
50
  /** {@inheritDoc Movable.Content.toJSON} */
57
51
  toJSON(toResourceId?: (resource: IResource) => number | null): IChart.JSON | null;
58
- /** {@inheritDoc Movable.Content.getTypeDescription} */
52
+ /** {@inheritDoc IMovable.IContent.getTypeDescription} */
59
53
  getTypeDescription(): string;
60
54
  /** @internal */
61
55
  protected _processDelete(): void;
@@ -74,7 +68,7 @@ export declare namespace Chart {
74
68
  /**
75
69
  * Options for creating a Chart.
76
70
  */
77
- interface ConstructorOptions extends IModel.ConstructorOptions<IChart.JSON> {
71
+ interface ConstructorOptions extends AbstractMovableContent.ConstructorOptions<IChart.JSON> {
78
72
  /**
79
73
  * Returns an IResource from the resourceId or null if not found.
80
74
  */
@@ -87,13 +81,6 @@ export declare namespace Chart {
87
81
  * Allow for the default lock aspect ratio to be overwritten.
88
82
  */
89
83
  defaultLockAspectRatio?: boolean;
90
- /**
91
- * Resolves the movable this chart is the content of.
92
- *
93
- * @remarks
94
- * Called when asked, not at construction — the content is built before its movable is.
95
- */
96
- getMovable: () => IMovable;
97
84
  /**
98
85
  * Resolves a sheet-qualified address in the chart's workbook.
99
86
  */
@@ -9,7 +9,7 @@ import { IChartCollection } from './IChartCollection';
9
9
  * @remarks
10
10
  * A live view over the movables — no store of its own and no event of its own. The movables'
11
11
  * `onCollectionChange` is forwarded as this collection's, with this collection as the source;
12
- * deleting the movable is deleting the chart.
12
+ * deleting the chart removes its movable.
13
13
  */
14
14
  export declare class ChartCollection extends AbstractCollection<IChart> implements IChartCollection {
15
15
  private _movables;
@@ -1,4 +1,5 @@
1
1
  import { IListener } from '../listener';
2
+ import { ITransaction } from '../transaction';
2
3
  import { IResource } from '../resource';
3
4
  import { IModel } from '../model';
4
5
  import { IMovable } from '../movable';
@@ -8,11 +9,11 @@ import { ICellRange } from '../cellRange';
8
9
  * Interface for working with a chart.
9
10
  *
10
11
  * @remarks
11
- * A chart is the content of a movable, which places and names it — see {@link IChart.getMovable}.
12
+ * A chart is the content of a movable, which places it — see {@link IChart.getMovable}.
12
13
  * Until the chart is modeled it is carried as the markup it was read from and written back
13
14
  * unchanged; {@link IChart.getXML} is the read-only view of that markup.
14
15
  */
15
- export interface IChart extends IModel {
16
+ export interface IChart extends IModel, IMovable.IContent {
16
17
  /**
17
18
  * Returns the chart's title, or `null` if it has none.
18
19
  *
@@ -54,17 +55,17 @@ export interface IChart extends IModel {
54
55
  */
55
56
  getPivotSource(): string | null;
56
57
  /**
57
- * Returns a description for assistive technologies.
58
- */
59
- getDescription(): string;
60
- /**
61
- * Returns the movable that places the chart on the sheet.
58
+ * Returns the movable that places the chart on the sheet, or `null` if it is not placed by one.
62
59
  *
63
60
  * @remarks
64
- * The movable holds the chart's position, size and name; the chart keeps no copy of any of
65
- * them. Deleting the movable deletes the chart.
61
+ * The movable holds the chart's position and size; the chart keeps no copy of either.
62
+ * Deleting the chart removes its movable.
63
+ */
64
+ getMovable(): IMovable | null;
65
+ /**
66
+ * Deletes the chart, and with it the movable that places it.
66
67
  */
67
- getMovable(): IMovable;
68
+ delete(options?: ITransaction.OperationOptions): void;
68
69
  /**
69
70
  * Returns the chart's own markup, or `null` if none was captured.
70
71
  *
@@ -5,8 +5,8 @@ import { IChart } from './IChart';
5
5
  *
6
6
  * @remarks
7
7
  * A view over the sheet's movables: a chart is the content of a movable, and the movable is what
8
- * places, names and deletes it — see {@link IChart.getMovable}. Read-only for now; a chart is
9
- * added by adding a movable with chart content.
8
+ * places it — see {@link IChart.getMovable}. Read-only for now; a chart is added by adding a
9
+ * movable with chart content.
10
10
  */
11
11
  export interface IChartCollection extends ICollection<IChart> {
12
12
  /**
@@ -14,7 +14,7 @@ export interface IChartCollection extends ICollection<IChart> {
14
14
  */
15
15
  getItems(options?: ICollection.GetItemsOptions): IChart[];
16
16
  /**
17
- * Returns the chart whose movable has the given name, or `null` if there is none.
17
+ * Returns the chart with the given name, or `null` if there is none.
18
18
  *
19
19
  * @param name The name of the chart. This is case insensitive.
20
20
  */
@@ -1,4 +1,10 @@
1
1
  import { ColorSpace } from './ColorSpace';
2
+ import { IColor } from './IColor';
3
+ /**
4
+ * The system color an index names, or `null` for a palette index.
5
+ * @internal
6
+ */
7
+ export declare function _BuiltInIndexSystemName(index: number): IColor.Named | null;
2
8
  /** @internal */
3
9
  export declare function _BuiltInIndexDefs(index: number): ColorSpace.RGBA | null;
4
10
  //# sourceMappingURL=_BuiltInIndexDefs.d.ts.map
@@ -4,9 +4,12 @@ import { ITransaction } from '../transaction';
4
4
  import { ICellRange } from '../cellRange';
5
5
  import { ISheet } from '../sheet';
6
6
  import { IPerson, IPersonCollection } from '../person';
7
+ import { IMovable } from '../movable';
8
+ import { IRichText } from '../text';
7
9
  import { Anchored } from '../anchored/Anchored';
8
10
  import { AbstractAnchored } from '../anchored/AbstractAnchored';
9
11
  import { IComment } from './IComment';
12
+ import { NoteMovable } from './NoteMovable';
10
13
  /**
11
14
  * Implementation of {@link IComment}.
12
15
  *
@@ -15,9 +18,19 @@ import { IComment } from './IComment';
15
18
  * so it subscribes to nothing. The replies are part of this model's state — a reply has no cell
16
19
  * and no transaction of its own — and {@link CommentReply} objects are handles over them, one
17
20
  * per reply id, minted on demand and kept so identity is stable.
21
+ *
22
+ * A note's box is a movable the sheet places when the comment becomes a note, with the comment
23
+ * as its content. Where the box is and whether it is shown are the movable's; the comment saves
24
+ * them with itself, the anchor restated from its cell, so a note copied to another cell keeps
25
+ * its box beside it.
18
26
  */
19
27
  export declare class Comment extends AbstractAnchored<State, IComment.Events> implements IComment {
20
28
  private _replies;
29
+ /**
30
+ * Every box placed for this comment. At most one is live: a reply deletes the box, an undo
31
+ * brings the same one back, and a note made again from a thread is given a new one.
32
+ */
33
+ private _boxes;
21
34
  /** @internal */
22
35
  protected _initialize(options: Comment.ConstructorOptions): void;
23
36
  /** @internal */
@@ -31,6 +44,8 @@ export declare class Comment extends AbstractAnchored<State, IComment.Events> im
31
44
  protected _isAnchorAbsolute(): boolean;
32
45
  /** @internal */
33
46
  protected _processContainerShift(options: Anchored.ShiftOptions): IRange.Coords | null | void;
47
+ /** @internal */
48
+ protected _processDelete(): void;
34
49
  /**
35
50
  * {@inheritDoc IComment.getId}
36
51
  *
@@ -48,7 +63,7 @@ export declare class Comment extends AbstractAnchored<State, IComment.Events> im
48
63
  /** {@inheritDoc IComment.setContent} */
49
64
  setContent(content: IComment.Content, options?: ITransaction.OperationOptions): this;
50
65
  /** {@inheritDoc IComment.getRichContent} */
51
- getRichContent(): IComment.RichContent | null;
66
+ getRichContent(): IRichText.JSON | null;
52
67
  /** {@inheritDoc IComment.getAuthor} */
53
68
  getAuthor(): IPerson | null;
54
69
  /** {@inheritDoc IComment.getCreationDate} */
@@ -67,17 +82,38 @@ export declare class Comment extends AbstractAnchored<State, IComment.Events> im
67
82
  addReply(content: IComment.Content, options?: IComment.AddReplyOptions): IComment.IReply;
68
83
  /** {@inheritDoc IComment.update} */
69
84
  update(update: IComment.Modifiers | IComment, options?: ITransaction.OperationOptions): this;
85
+ /** {@inheritDoc IComment.getType} */
86
+ getType(): string;
87
+ /** {@inheritDoc IMovable.IContent.getTypeDescription} */
88
+ getTypeDescription(): string;
89
+ /** {@inheritDoc IMovable.IContent.getDescription} */
90
+ getDescription(): string | null;
91
+ /** {@inheritDoc IMovable.IContent.setDescription} */
92
+ setDescription(description: string | null): this;
93
+ /** {@inheritDoc IComment.getMovable} */
94
+ getMovable(): IMovable | null;
95
+ /**
96
+ * The live box, if there is one.
97
+ * @internal
98
+ */
99
+ protected _getBox(): NoteMovable | null;
100
+ /**
101
+ * Asks the sheet for a box: at `anchor`, its cells counted from this comment's, or where Excel
102
+ * puts a new note's. A comment with no sheet to place one on has no box.
103
+ * @internal
104
+ */
105
+ protected _placeBox(anchor: IMovable.AnchorOffset | null, hidden: boolean): void;
106
+ /**
107
+ * The note is gone, or is a thread now: its box goes with it.
108
+ * @internal
109
+ */
110
+ protected _removeBox(): void;
70
111
  /** {@inheritDoc IListener.ISource.addListeners} */
71
112
  addListeners(listeners: IComment.IListeners, options?: IListener.Options): IListener.Remove;
72
113
  /** {@inheritDoc IComment.toJSON} */
73
114
  toJSON(): IComment.JSON | null;
74
115
  /** @internal */
75
116
  protected _fromJSON(json?: IComment.JSON | null, options?: ITransaction.OperationOptions): void;
76
- /**
77
- * The note's box, as read.
78
- * @internal
79
- */
80
- getBox(): IComment.BoxJSON | null;
81
117
  /** @internal */
82
118
  protected _getPeople(): IPersonCollection | null;
83
119
  /** @internal */
@@ -140,6 +176,29 @@ export declare namespace Comment {
140
176
  * has finished loading.
141
177
  */
142
178
  getPeople?: () => IPersonCollection | null;
179
+ /**
180
+ * What places a note's box. A comment given none has no movable.
181
+ */
182
+ boxes?: Comment.Boxes;
183
+ }
184
+ /**
185
+ * What a note's box needs of the sheet it is on: to be placed, and to know whether it is where
186
+ * a new note's goes.
187
+ */
188
+ interface Boxes {
189
+ /**
190
+ * Places a note's box among the sheet's movables, with the note as its content.
191
+ *
192
+ * @param comment The note.
193
+ * @param anchor Where the box is, its cells counted from the note's; `null` for where Excel
194
+ * puts a new note's.
195
+ * @param hidden Whether the box appears only while its cell is pointed at.
196
+ */
197
+ add(comment: Comment, anchor: IMovable.AnchorOffset | null, hidden: boolean): NoteMovable;
198
+ /**
199
+ * Whether a box is where a new note's goes, which a note saves nothing for.
200
+ */
201
+ isDefault(comment: Comment, box: IMovable): boolean;
143
202
  }
144
203
  }
145
204
  /** @internal */
@@ -153,7 +212,10 @@ interface State extends AbstractAnchored.State {
153
212
  asNote: boolean;
154
213
  mentions: IComment.MentionJSON[] | null;
155
214
  replies: readonly IComment.ReplyJSON[];
156
- box: IComment.BoxJSON | null;
215
+ /** The alternative text of a note's box. */
216
+ description: string | null;
217
+ /** How a note's box is drawn when not the default: markup a file's writer replays. */
218
+ boxXml: string | null;
157
219
  }
158
220
  export {};
159
221
  //# sourceMappingURL=Comment.d.ts.map