@sheetxl/sdk 0.8.0-beta.14 → 0.8.0-beta.16

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 (195) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/4MbBwfmW2hDXk9_w.mjs +165 -0
  3. package/browser/esm/{ChYgQL-8qIDFmX31.mjs → 9YWdxmSjzLN4j_ts.mjs} +22 -22
  4. package/browser/esm/B6BdiHigbUdbZp3J.mjs +686 -0
  5. package/browser/esm/{CImFKFaYToUH-bSE.mjs → BF_QwkZ_hs2rFoTT.mjs} +3 -3
  6. package/browser/esm/{DBvu0tdSf-5vol4e.mjs → BMo2_9Ul36IwRm3S.mjs} +3 -3
  7. package/browser/esm/{B1aH_qa-czVyEVHd.mjs → BWY1qiidTUBVPJoD.mjs} +506 -502
  8. package/browser/esm/{BSXQAXwZdJKYTO4P.mjs → Bf80epSsm_RyAOb9.mjs} +29 -29
  9. package/browser/esm/{D_XMi4_5iO2rkET5.mjs → BfoE6Dn_GQCIkQD3.mjs} +2 -2
  10. package/browser/esm/{Dhw5XEJYFrkYjdU2.mjs → BlMYYQZP-QM-iBHz.mjs} +23 -22
  11. package/browser/esm/{MuNBN02MyZ558c_K.mjs → BqT-ASHP0NVSUUnY.mjs} +1528 -1433
  12. package/browser/esm/{DnR0xY7_iE3TmMcg.mjs → BtNuoQIrrHw_jnbJ.mjs} +4 -4
  13. package/browser/esm/BxFzcCYhvo9NXFjC.mjs +527 -0
  14. package/browser/esm/{DonQz2Tc3k9lNT8E.mjs → BxYuRTSF9ykc-Tpz.mjs} +3 -3
  15. package/browser/esm/{aRXqxIzjuSLwawMh.mjs → C2PvZwqK-uvsugVS.mjs} +2 -2
  16. package/browser/esm/C3JOjQwdG9kAig7i.mjs +2017 -0
  17. package/browser/esm/{SwLp-iElwDjfcJtv.mjs → C5x0EzqElYGTiTQc.mjs} +2 -2
  18. package/browser/esm/{AXlD9K1gCwPU4gCO.mjs → CMChv-fCFh68VQQt.mjs} +588 -587
  19. package/browser/esm/{BpwULQPKbb4R9Jew.mjs → CRbQATfI0yZxe1kX.mjs} +3 -3
  20. package/browser/esm/{CM_X1zZYzEUPaNJL.mjs → CUu3zeHqcwMRYiov.mjs} +2 -2
  21. package/{node/esm/b3XnssSr9lmvAC2N.mjs → browser/esm/C_jLGkFemj55_BP3.mjs} +3 -3
  22. package/browser/esm/{CtC__ALh4I8PKIln.mjs → CkZoDPUCK5jMUaeJ.mjs} +26955 -22064
  23. package/browser/esm/{DvvqmUQ9Z0NFm1-4.mjs → D-iHJ3q4nwOLcn1D.mjs} +2 -2
  24. package/browser/esm/{qCqzZW74-fhaIG2V.mjs → D807piM0VSokWz-L.mjs} +2 -2
  25. package/browser/esm/{BLYl-afJe_3std8i.mjs → DW3oQ39IF0bsc_lm.mjs} +2 -2
  26. package/browser/esm/{Ln4gsmhqH1LyoANj.mjs → DcB52JPBPmkc3l1m.mjs} +4 -4
  27. package/browser/esm/{DIfAk63CvaOZ3QKi.mjs → DlVnybrgwZWxWN3_.mjs} +10 -10
  28. package/browser/esm/{Dh84MDs-OhdCPCIg.mjs → DvVhatd0J1ch3OCO.mjs} +22 -22
  29. package/browser/esm/{BWoz4kQdA5KKJfl6.mjs → Dx9Fya60meMpuHqm.mjs} +2 -2
  30. package/browser/esm/{r_EZapMBdyS4gUd-.mjs → HV0FkJ6k3Ils318J.mjs} +78 -78
  31. package/browser/esm/{C7hpfT-sX2lyLS-D.mjs → JV9Szh5qTssjxJoE.mjs} +2 -2
  32. package/browser/esm/{CPIWV3Enlh_BF2TY.mjs → KpuD1kEcWB7cT0VM.mjs} +3 -3
  33. package/browser/esm/{3t4S9eda2I6jFad0.mjs → U4FL-QeC0bRUhTEo.mjs} +2 -2
  34. package/browser/esm/{D39XcmtPXVtMN4yF.mjs → WLlpmgLN5OVLoLrC.mjs} +3 -3
  35. package/browser/esm/{Cy8uYCggktF83278.mjs → WR146UAqrsUsL39e.mjs} +2 -2
  36. package/browser/esm/{BPPMKyMn65i1a1mE.mjs → WcHfawW2lkTHtWUd.mjs} +51 -49
  37. package/browser/esm/{Bdcd3QOzsc0aVMjN.mjs → Zp5-cTJ0Llb6EfGi.mjs} +4 -4
  38. package/browser/esm/{oSCy1X5CJ1iYtGDp.mjs → ad9PX897hYE4Srkc.mjs} +3 -3
  39. package/browser/esm/{UMQTbO0zNmBpzW1V.mjs → d_t-7d5BD1AdHg3u.mjs} +404 -404
  40. package/browser/esm/{BVqIknGhQCLUB_7Q.mjs → dwGdnbV-CykjNrlm.mjs} +2 -2
  41. package/browser/esm/{DiXeQjc0WJGLSVEo.mjs → e69NcYnKMLnAmqyA.mjs} +2 -2
  42. package/browser/esm/index.mjs +886 -578
  43. package/browser/esm/{yuF8SbWfjBfrxcq5.mjs → r-o0UCm7KtluNmyK.mjs} +3 -3
  44. package/licenses/dependencies.txt +69 -69
  45. package/node/esm/{BEBt5fo__rvT2q_u.mjs → 446KYBjJQa8g-8Gg.mjs} +52 -50
  46. package/node/esm/{BELc5aQ_pFPgbiso.mjs → 5OfKfTRX2_y2NwpU.mjs} +2 -2
  47. package/node/esm/{C-5JLSNof0FhkuFd.mjs → A3PEHO1HJvkHfb5n.mjs} +2 -2
  48. package/node/esm/{YpOpRyciqQLIY1-G.mjs → B4WUGzJBkQu7BXRm.mjs} +2 -2
  49. package/node/esm/{I-FZojIFWluC6X-j.mjs → BH8J6vKSO5zI_TWo.mjs} +2 -2
  50. package/node/esm/BLmdKnkLwkb3wWe6.mjs +2040 -0
  51. package/node/esm/{BuyAYLI4s33-vmgG.mjs → BZSxu_ZqX8-Uczzn.mjs} +2 -2
  52. package/node/esm/{DiCMnYA2bttmrX3q.mjs → BfPBiAgVmWhuFgFP.mjs} +3 -3
  53. package/node/esm/{BSVttk12GXNfKZ9k.mjs → Bknw7zWZhl2-w1pi.mjs} +3 -3
  54. package/node/esm/{uLrulyR7IXq0SF4j.mjs → BvIPsPiHhMclZ1kH.mjs} +22 -22
  55. package/node/esm/{clgEkmEwfB28nkz2.mjs → By2TFKOjA1HekZap.mjs} +4 -4
  56. package/node/esm/{BXg-D8Rc_iyB8p7X.mjs → BywIhvYkWk2o7MSW.mjs} +2 -2
  57. package/node/esm/{pF2vCOTmrxPAB41Q.mjs → C3zyhnMwQ2hRQBz7.mjs} +31 -30
  58. package/node/esm/{BCjHRVU8tC5lYypg.mjs → C884edhUf9yMqpPp.mjs} +2 -2
  59. package/node/esm/{B6jhx5pHPs2W5GE7.mjs → CDHY-0OyQ9348Brb.mjs} +189 -189
  60. package/node/esm/{xRGObcoaGDnAZFnj.mjs → CERNLhFrAwtu_p-q.mjs} +2 -2
  61. package/node/esm/{DbPUG2DcQ3T_QhcJ.mjs → CFkX_Cn6avQqQiVC.mjs} +78 -78
  62. package/node/esm/CJDV8P3hI8lu--3Z.mjs +530 -0
  63. package/node/esm/{Cyeq1rDslIqF1LKz.mjs → CKwiipdPJGzAiPjg.mjs} +2 -2
  64. package/node/esm/{BLPrFp_jKGYgWPX1.mjs → CLtUMJfKsy4SevWE.mjs} +3 -3
  65. package/node/esm/{DLdXl0O0TXuyqLU4.mjs → CVPieTgKCwkL21nD.mjs} +28573 -23108
  66. package/node/esm/{Dlk2ZYExFgQ0xE2H.mjs → C_fYuynP2a_70WdL.mjs} +2 -2
  67. package/{browser/esm/BEDfJP2tcuRy2Y2E.mjs → node/esm/CgdNA3B_GFG_yJiN.mjs} +3 -3
  68. package/node/esm/Cs3ibv6YHCDwLRlk.mjs +115 -0
  69. package/node/esm/{DeFE8QfuCeGw-mvd.mjs → Cxak8i2NidZ4Uv6v.mjs} +487 -483
  70. package/node/esm/{NA-8urR7T1NCwrgD.mjs → D88A3UpCyGRjcX3U.mjs} +3 -3
  71. package/node/esm/{99miMotf3dOuG5Jk.mjs → DBIUe2BC9xU7qMHR.mjs} +3 -3
  72. package/node/esm/{BEdxa3I4VOiCsvy7.mjs → DELfV5HQZo1mInBd.mjs} +4 -4
  73. package/node/esm/{BfEdeOg4iYXaYTlh.mjs → DOt3t-13tsnM7Fj6.mjs} +2 -2
  74. package/node/esm/{B3hBxzqJ2_hUylNr.mjs → DfWc3nW_Z_qqc_Wf.mjs} +1762 -1674
  75. package/node/esm/DgnwKbUEyQN5_gWT.mjs +169 -0
  76. package/node/esm/{Ccocd9DTvOnlOE9D.mjs → Dhv9JymnXqcF54oo.mjs} +2 -2
  77. package/node/esm/{Lj98EH6coGdKUzuS.mjs → DvtyKKzOnoOM80NB.mjs} +22 -22
  78. package/node/esm/{Crn6dnSQQRCQAnQ-.mjs → KDGrIa9R5XzWfjM2.mjs} +2 -2
  79. package/node/esm/{D30rC6AWaGGf3CaC.mjs → RTwm9ge1KoPdlBNt.mjs} +2 -2
  80. package/node/esm/{CdSTmD2ZvG9NesNR.mjs → _RIAmJI98l6bIFfZ.mjs} +2 -2
  81. package/node/esm/{CI8UIWR01z9QDlzH.mjs → bIGdvfpnijWeCac6.mjs} +1005 -1004
  82. package/node/esm/index.mjs +913 -598
  83. package/node/esm/kaiXmn0AA5WDsLPo.mjs +199 -0
  84. package/node/esm/{B5VmOC0jO9Zbh9Mq.mjs → mTIhoz1gEcaEm7s1.mjs} +3 -3
  85. package/package.json +7 -7
  86. package/resources/locales/de/model.msg.json +82 -1
  87. package/resources/locales/en/model.msg.json +80 -1
  88. package/types/scripting-api.json +9967 -9497
  89. package/types/scripting-enums.json +27 -0
  90. package/types/scripting.d.ts +2282 -166
  91. package/types/src/.generated/wasm/sdk.d.ts +332 -0
  92. package/types/src/calculation/Calculation.d.ts +8 -0
  93. package/types/src/calculation/ICalculation.d.ts +51 -0
  94. package/types/src/calculation/compiler/Types.d.ts +5 -0
  95. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +1 -1
  96. package/types/src/calculation/formula/FormulaBlock.d.ts +2 -0
  97. package/types/src/calculation/formula/IFormulaBlock.d.ts +18 -0
  98. package/types/src/calculation/grid/CalcGrid.d.ts +5 -1
  99. package/types/src/calculation/grid/CalcGridBackend.d.ts +36 -1
  100. package/types/src/calculation/grid/CalcGridProxy.d.ts +2 -0
  101. package/types/src/calculation/grid/CalcGridUtils.d.ts +4 -2
  102. package/types/src/calculation/grid/FormulaHost.d.ts +3 -1
  103. package/types/src/calculation/grid/ICalcGrid.d.ts +88 -0
  104. package/types/src/calculation/grid/_CalcRequest.d.ts +9 -0
  105. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +2 -0
  106. package/types/src/calculation/spatial/SpillEntry.d.ts +55 -4
  107. package/types/src/calculation/state/CalcNode.d.ts +6 -3
  108. package/types/src/calculation/state/CalculationContext.d.ts +4 -2
  109. package/types/src/calculation/state/_PivotView.d.ts +22 -0
  110. package/types/src/cell/ICell.d.ts +1 -21
  111. package/types/src/cellRange/ICellRange.d.ts +18 -2
  112. package/types/src/collections/MixedTypedArrayList.d.ts +16 -2
  113. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +10 -0
  114. package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +3 -0
  115. package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +3 -0
  116. package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +3 -0
  117. package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +3 -0
  118. package/types/src/condition/BuiltInOperators/MatchesOperator.d.ts +10 -0
  119. package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
  120. package/types/src/condition/BuiltInOperators/index.d.ts +2 -0
  121. package/types/src/condition/Condition.d.ts +1 -0
  122. package/types/src/condition/ICondition.d.ts +15 -0
  123. package/types/src/condition/_ConditionUtils.d.ts +14 -0
  124. package/types/src/conditionalFormat/ConditionalFormat.d.ts +2 -1
  125. package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -3
  126. package/types/src/license/LicenseDetails.d.ts +27 -0
  127. package/types/src/license/LicenseManager.d.ts +24 -7
  128. package/types/src/license/_Utils.d.ts +34 -3
  129. package/types/src/license/index.d.ts +1 -0
  130. package/types/src/license/runtime.browser.d.ts +32 -4
  131. package/types/src/license/runtime.node.d.ts +8 -5
  132. package/types/src/license/summary.d.ts +18 -0
  133. package/types/src/pivot/IPivotTable.d.ts +1549 -13
  134. package/types/src/pivot/IPivotTableCollection.d.ts +70 -4
  135. package/types/src/pivot/PivotCache.d.ts +95 -11
  136. package/types/src/pivot/PivotDataField.d.ts +73 -0
  137. package/types/src/pivot/PivotField.d.ts +142 -0
  138. package/types/src/pivot/PivotTable.d.ts +548 -14
  139. package/types/src/pivot/PivotTableCollection.d.ts +18 -3
  140. package/types/src/pivot/_PivotAreas.d.ts +48 -0
  141. package/types/src/pivot/_PivotControls.d.ts +140 -0
  142. package/types/src/pivot/_PivotEngine.d.ts +9 -0
  143. package/types/src/pivot/_PivotGroups.d.ts +25 -0
  144. package/types/src/pivot/_PivotItems.d.ts +167 -0
  145. package/types/src/pivot/_PivotStructure.d.ts +237 -0
  146. package/types/src/pivot/_PivotStylePreview.d.ts +21 -0
  147. package/types/src/pivot/_PivotUtils.d.ts +37 -0
  148. package/types/src/pivot/engine/PivotAdd.d.ts +37 -0
  149. package/types/src/pivot/engine/PivotData.d.ts +65 -0
  150. package/types/src/pivot/engine/PivotEdit.d.ts +45 -0
  151. package/types/src/pivot/engine/PivotFilters.d.ts +50 -0
  152. package/types/src/pivot/engine/PivotFormulas.d.ts +72 -0
  153. package/types/src/pivot/engine/PivotLayout.d.ts +133 -0
  154. package/types/src/pivot/engine/PivotMove.d.ts +24 -0
  155. package/types/src/pivot/engine/PivotRefresh.d.ts +87 -0
  156. package/types/src/pivot/engine/PivotSort.d.ts +26 -0
  157. package/types/src/pivot/engine/PivotViewBuilder.d.ts +22 -0
  158. package/types/src/pivot/engine/index.d.ts +15 -0
  159. package/types/src/pivot/index.d.ts +4 -0
  160. package/types/src/pivot/kernel/KernelPivot.d.ts +63 -0
  161. package/types/src/pivot/kernel/_KernelLeaves.d.ts +100 -0
  162. package/types/src/pivot/kernel/_PivotAxisTree.d.ts +71 -0
  163. package/types/src/primitives/Range.d.ts +12 -1
  164. package/types/src/sheet/IWorksheet.d.ts +35 -0
  165. package/types/src/sheet/SheetCell.d.ts +21 -14
  166. package/types/src/sheet/SheetRange.d.ts +3 -0
  167. package/types/src/sheet/Worksheet.d.ts +175 -7
  168. package/types/src/sheet/_PivotFootprint.d.ts +42 -0
  169. package/types/src/sheet/_SheetAutoFitUtils.d.ts +12 -1
  170. package/types/src/sheet/_SheetMutations.d.ts +47 -0
  171. package/types/src/sheet/_SheetStateTypes.d.ts +11 -0
  172. package/types/src/sheet/style/SheetCellStyle.d.ts +6 -0
  173. package/types/src/sheet/style/SheetPivotStyle.d.ts +83 -0
  174. package/types/src/sheet/style/_IndentUnit.d.ts +14 -0
  175. package/types/src/sheetHeader/SheetCellHeader.d.ts +1 -1
  176. package/types/src/slicer/ISlicer.d.ts +114 -34
  177. package/types/src/slicer/ITimeline.d.ts +61 -0
  178. package/types/src/slicer/Slicer.d.ts +76 -3
  179. package/types/src/slicer/_PivotSlicer.d.ts +51 -0
  180. package/types/src/slicer/index.d.ts +1 -0
  181. package/types/src/table/AnchoredTable.d.ts +11 -1
  182. package/types/src/table/ITable.d.ts +5 -6
  183. package/types/src/table/ITableStyle.d.ts +50 -34
  184. package/types/src/table/_BuiltInPivotStyles.d.ts +8 -0
  185. package/types/src/table/_BuiltInTableStyles.d.ts +0 -1
  186. package/types/src/type/ITypes.d.ts +5 -1
  187. package/types/src/workbook/IWorkbook.d.ts +8 -2
  188. package/types/src/workbook/Workbook.d.ts +72 -6
  189. package/browser/esm/D2NFcBM4xsv0JJ1q.mjs +0 -184
  190. package/browser/esm/DnqwX3-2NfGBaXXl.mjs +0 -357
  191. package/node/esm/C3S4hF1vn0NyJPPd.mjs +0 -199
  192. package/node/esm/CPsGyt3vnOdLTShj.mjs +0 -360
  193. package/node/esm/D4Y1WJgjiFEgbWrW.mjs +0 -115
  194. package/types/src/pivot/_PivotXml.d.ts +0 -24
  195. package/types/src/primitives/Grouping.d.ts +0 -65
@@ -1,13 +1,41 @@
1
+ import { ICellRange } from '../cellRange';
2
+ import { ITable } from '../table';
3
+ import { ITransaction } from '../transaction';
1
4
  import { ICollection } from '../type';
2
5
  import { IPivotTable } from './IPivotTable';
3
6
  /**
4
7
  * Holds {@link IPivotTable | pivot tables} — a sheet's, or every sheet's in the workbook.
5
- *
6
- * @remarks
7
- * Read-only for now: a table is carried as it was read and written back unchanged. Adding,
8
- * deleting and refreshing wait on the table having a model of its own.
9
8
  */
10
9
  export interface IPivotTableCollection extends ICollection<IPivotTable> {
10
+ /**
11
+ * Adds a pivot table on this sheet, as one step that can be undone.
12
+ *
13
+ * @param source The cells to summarize, their first row the field names: a range, a table, or a
14
+ * table's or defined name's name. A table already summarizing the same source shares its cache
15
+ * unless the source was edited since, so they refresh together.
16
+ * @param location Where the table's top-left cell goes. Filters sit above it, a blank row between;
17
+ * at the top of a sheet the table moves down to make room for them.
18
+ * @param options The fields to place. With none, the table is empty and holds 18 rows by 3 columns.
19
+ *
20
+ * @remarks
21
+ * The cells the table needs, its filters' included, must hold no value, unless
22
+ * {@link IPivotTableCollection.AddOptions.discardValues} clears them. Another pivot table or an
23
+ * array's cells there always refuse it.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const pivot = await sheet.getPivotTables().add('Data!A1:H500', 'A3', {
28
+ * rows: ['Region'],
29
+ * columns: ['Year'],
30
+ * values: ['Sales', { field: 'Sales', function: 'average' }]
31
+ * });
32
+ * ```
33
+ *
34
+ * @throws When the cells it needs hold a value, an array or another pivot table, a field or the source does not
35
+ * exist, the source has no row of data, the name is taken on this sheet or the sheet is locked; and
36
+ * on the workbook's collection, which holds no sheet to add to.
37
+ */
38
+ add(source: IPivotTableCollection.Source, location: ICellRange.Address, options?: IPivotTableCollection.AddOptions): Promise<IPivotTable>;
11
39
  /**
12
40
  * Returns the pivot tables, in the order they were read; the workbook's walks its sheets in
13
41
  * sheet order.
@@ -17,9 +45,47 @@ export interface IPivotTableCollection extends ICollection<IPivotTable> {
17
45
  * Returns the pivot table with the given name, or `null` if there is none.
18
46
  *
19
47
  * @param name The name of the pivot table. This is case insensitive.
48
+ *
49
+ * @remarks
50
+ * A name is unique only on its sheet, so the workbook's collection returns the first table with
51
+ * that name in sheet order. Ask the sheet's collection to find one table for certain.
20
52
  */
21
53
  getByName(name: string): IPivotTable | null;
54
+ /**
55
+ * Refreshes every table ({@link IPivotTable.refresh}) as one step that can be undone.
56
+ *
57
+ * @remarks
58
+ * A table that cannot be refreshed refuses the whole step, and nothing changes.
59
+ */
60
+ refreshAll(options?: IPivotTable.RefreshOptions): Promise<void>;
22
61
  /** For runtime type checking. */
23
62
  readonly isIPivotTableCollection: true;
24
63
  }
64
+ export declare namespace IPivotTableCollection {
65
+ /** What a pivot table summarizes. A string is a table's name, a defined name, or an address. */
66
+ type Source = ICellRange.Address | ITable;
67
+ /** Options for {@link IPivotTableCollection.add}. */
68
+ interface AddOptions extends ITransaction.OperationOptions {
69
+ /** Absent, `PivotTable` and one past the highest number the workbook's tables have. */
70
+ name?: string;
71
+ /** The fields down the rows, outermost first. */
72
+ rows?: readonly string[];
73
+ /** The fields across the columns, outermost first. */
74
+ columns?: readonly string[];
75
+ /** The fields above the table, each filtering it by an item. */
76
+ pages?: readonly string[];
77
+ /** The values. A field's name alone sums a column of numbers, blanks among them, and counts any other. */
78
+ values?: readonly (string | IPivotTable.IDataField.Input)[];
79
+ /** Absent, compact. */
80
+ form?: 'compact' | IPivotTable.PivotForm;
81
+ /** A pivot table style by name; absent, `PivotStyleLight16`. */
82
+ style?: string;
83
+ /**
84
+ * Whether values in the cells the table needs are cleared; `false` refuses the table instead.
85
+ *
86
+ * @defaultValue `false`
87
+ */
88
+ discardValues?: boolean;
89
+ }
90
+ }
25
91
  //# sourceMappingURL=IPivotTableCollection.d.ts.map
@@ -1,34 +1,118 @@
1
1
  import { IResource } from '../resource';
2
+ import { ICellRange } from '../cellRange';
3
+ import { ITable } from '../table';
2
4
  import { IEmbeddedPart } from '../io';
3
5
  import { AbstractMovableContent } from '../movable/AbstractMovableContent';
4
6
  import { IPivotTable } from './IPivotTable';
5
7
  /**
6
- * A pivot cache as the workbook holds it: the part it was read from, and its source held in the
7
- * calculation engine so it follows the cells it names.
8
+ * A pivot cache as the workbook holds it: its model and the part it was read from, and its source
9
+ * held in the calculation engine so it follows the cells it names.
8
10
  *
9
11
  * @remarks
10
12
  * The cache is workbook-level and shared by every table on it. Its `<cacheSource>
11
- * <worksheetSource ref sheet>` is the one thing in the part that names cells; it is held through
12
- * the seam of the sheet it names ({@link _hold}), once the sheets exist, and restated in place by
13
- * {@link getXML}. A source that is a defined name or an external book holds nothing and is
14
- * written as read.
13
+ * <worksheetSource>` is the one thing in the part that names cells. The reader types it as
14
+ * {@link IPivotTable.CacheJSON.source} whether or not the rest is modeled; it is held through the
15
+ * seam of the sheet it names ({@link _hold}), once the sheets exist, and {@link toJSON} gives it
16
+ * where it is now, for the writer to restate the part with. Excel's rules (`pivot-probes/probe-pivot-named-source.ps1`, 2026-10-24):
17
+ *
18
+ * - `ref sheet` follows the cells, as a formula's reference does;
19
+ * - `name`, naming a table, follows the table: a rename restates the name, and a table converted
20
+ * to a range becomes the `ref sheet` it covered;
21
+ * - `name`, naming a defined name, is written as read: Excel does not follow a defined name's
22
+ * rename or deletion either. An external book's source is written as read too.
15
23
  * @internal
16
24
  */
17
25
  export declare class PivotCache {
18
26
  readonly cacheId: number;
19
- readonly part: IEmbeddedPart | null;
27
+ /** Where its contents live: the workbook's state, so a refresh is undone with the cells it wrote. */
28
+ private readonly _store;
20
29
  /** The source as the engine holds it; `null` while nothing is held. */
21
30
  private _source;
22
- constructor(cacheId: number, part: IEmbeddedPart | null);
31
+ /**
32
+ * The contents the source's cells match: those read or refreshed since its last edit
33
+ * ({@link _watchSource}). A new set at each edit, so an undone refresh reads as stale.
34
+ */
35
+ private _fresh;
36
+ /** Stops watching the source; `null` while nothing is watched. */
37
+ private _unwatch;
38
+ constructor(cacheId: number, store: PivotCache.Store);
39
+ /** The contents of a cache's JSON. */
40
+ static dataOf(json: IPivotTable.CacheJSON, fromResourceId?: (resourceId: number) => IResource): PivotCache.Data;
41
+ /** The model of a cache's JSON, or `null` when it has none. */
42
+ static modelOf(json: IPivotTable.CacheJSON): PivotCache.Model | null;
43
+ /** The part as read, written while the cache is unchanged; `null` once it is refreshed. */
44
+ get part(): IEmbeddedPart | null;
45
+ /** The fields, items and records; `null` for a cache that is not modeled. */
46
+ private get _model();
47
+ /**
48
+ * The contents now, an immutable value: one identity per version, so what is derived from a
49
+ * cache can be kept against it.
50
+ */
51
+ _getData(): PivotCache.Data;
52
+ /**
53
+ * Replaces the contents with those a refresh from the source read, in the caller's commit: the
54
+ * part goes, and the cache is written from `model` from then on. The new contents match the
55
+ * source, and so do the old ones if nothing was edited since they were read.
56
+ */
57
+ _replace(model: PivotCache.Model): void;
58
+ /**
59
+ * Replaces the contents with the same records told apart differently, in the caller's commit: as
60
+ * {@link _replace}, but matching the source only if the old ones did.
61
+ */
62
+ _restate(model: PivotCache.Model): void;
23
63
  /**
24
64
  * Holds the source through the sheet it names. Asked once the sheets exist; a source naming no
25
65
  * sheet of the workbook is left as read.
26
66
  *
27
67
  * @param resolve The seam of the sheet with that name, or `null` when there is none.
68
+ * @param resolveTable The seam of the sheet the table with that name is on, or `null` when no
69
+ * table has it.
70
+ */
71
+ _hold(resolve: (sheetName: string) => AbstractMovableContent.AddWatch | null, resolveTable: (tableName: string) => AbstractMovableContent.AddWatch | null): void;
72
+ /** The source as read, the model's or, for a cache carried as its part, the one typed beside it; `null` when there is neither. */
73
+ private _sourceAsRead;
74
+ /**
75
+ * Marks the cache stale once its source's cells are edited: a value or formula written or
76
+ * cleared (an undo too), a row or column inserted or deleted inside it, or a table it names
77
+ * resized. A move that keeps its size does not, nor does a recalculation, nor a source naming no
78
+ * sheet or table of the workbook. Asked once the sheets exist; the records stay as they are, as
79
+ * Excel's do.
80
+ *
81
+ * @param resolve The range `ref` names on the sheet with that name, or `null` when there is none.
82
+ * @param resolveTable The table with that name, or `null` when there is none.
83
+ * @param resolveNamed The range a defined name refers to now, by its name and the sheet it is
84
+ * scoped to; `null` when there is no such name or it refers to no single range.
28
85
  */
29
- _hold(resolve: (sheetName: string) => AbstractMovableContent.AddWatch | null): void;
30
- /** The part's markup, its source restated where the engine has moved it. */
31
- getXML(): string | null;
86
+ _watchSource(resolve: (sheetName: string, ref: string) => ICellRange | null, resolveTable: (tableName: string) => ITable | null, resolveNamed: (name: string, sheet: string | null) => ICellRange | null): void;
87
+ /** Whether the source's cells have been edited since the contents were read ({@link _watchSource}). */
88
+ _isStale(): boolean;
89
+ /** The source where the engine has moved it, or `null` while it is where it was read: `null` removes a key. */
90
+ private _moved;
91
+ /**
92
+ * The source where it is now: as read, restated where the engine has moved it; `null` when the
93
+ * cache names none.
94
+ */
95
+ _getSource(): IPivotTable.CacheSourceJSON | null;
32
96
  toJSON(toResourceId?: (resource: IResource) => number | null): IPivotTable.CacheJSON;
33
97
  }
98
+ export declare namespace PivotCache {
99
+ /** What a modeled cache's JSON holds besides its id and part. */
100
+ type Model = Omit<IPivotTable.CacheJSON, 'cacheId' | 'part' | 'partFormats'>;
101
+ /** A cache's contents: replaced whole, never changed in place. */
102
+ interface Data {
103
+ /** The part as read, written while the cache is unchanged. */
104
+ readonly part: IEmbeddedPart | null;
105
+ /** The fields, items and records; `null` for a cache that is not modeled. */
106
+ readonly model: Model | null;
107
+ /** What the part's format ids named when read, for a cache that is not modeled. */
108
+ readonly partFormats: IPivotTable.PartFormatsJSON | null;
109
+ /** The source as read, for a cache that is not modeled (a modeled one's is the model's). */
110
+ readonly source: IPivotTable.CacheSourceJSON | null;
111
+ }
112
+ /** Where a cache's contents are kept: read now, and replaced as a transactional change. */
113
+ interface Store {
114
+ get(): Data;
115
+ set(data: Data): void;
116
+ }
117
+ }
34
118
  //# sourceMappingURL=PivotCache.d.ts.map
@@ -0,0 +1,73 @@
1
+ import { ITransaction } from '../transaction';
2
+ import { IPivotTable } from './IPivotTable';
3
+ import { PivotTable } from './PivotTable';
4
+ /**
5
+ * Implementation for {@link IPivotTable.IDataField}: a value of a table, found by its caption, which no
6
+ * other field of the table can hold, so it holds through moves and deletes of the others.
7
+ * @internal
8
+ */
9
+ export declare class PivotDataField implements IPivotTable.IDataField {
10
+ private readonly _table;
11
+ private _name;
12
+ constructor(table: PivotTable, name: string);
13
+ /** Where it is in `model`. */
14
+ private _indexIn;
15
+ private _json;
16
+ /** Runs an edit over the field's place, and follows its caption. */
17
+ private _edit;
18
+ /** {@inheritDoc IPivotTable.IDataField.getName} */
19
+ getName(): string;
20
+ /** {@inheritDoc IPivotTable.IDataField.setName} */
21
+ setName(name: string, options?: ITransaction.OperationOptions): Promise<void>;
22
+ /** {@inheritDoc IPivotTable.IDataField.getField} */
23
+ getField(): IPivotTable.IField;
24
+ /** {@inheritDoc IPivotTable.IDataField.getFunction} */
25
+ getFunction(): IPivotTable.IDataField.Function;
26
+ /** {@inheritDoc IPivotTable.IDataField.setFunction} */
27
+ setFunction(fn: IPivotTable.IDataField.Function, options?: ITransaction.OperationOptions): Promise<void>;
28
+ /** {@inheritDoc IPivotTable.IDataField.getCaptionFor} */
29
+ getCaptionFor(fn: IPivotTable.IDataField.Function): string;
30
+ /** {@inheritDoc IPivotTable.IDataField.getShowAs} */
31
+ getShowAs(): IPivotTable.IDataField.ShowAs | null;
32
+ /** {@inheritDoc IPivotTable.IDataField.setShowAs} */
33
+ setShowAs(rule: IPivotTable.IDataField.ShowAs | null, options?: ITransaction.OperationOptions): Promise<void>;
34
+ /** {@inheritDoc IPivotTable.IDataField.getNumberFormat} */
35
+ getNumberFormat(): string;
36
+ /** {@inheritDoc IPivotTable.IDataField.setNumberFormat} */
37
+ setNumberFormat(format: string | number, options?: ITransaction.OperationOptions): Promise<void>;
38
+ /** {@inheritDoc IPivotTable.IDataField.getPosition} */
39
+ getPosition(): number;
40
+ /** {@inheritDoc IPivotTable.IDataField.setPosition} */
41
+ setPosition(position: number, options?: ITransaction.OperationOptions): Promise<void>;
42
+ /** {@inheritDoc IPivotTable.IDataField.delete} */
43
+ delete(options?: ITransaction.OperationOptions): Promise<void>;
44
+ /** {@inheritDoc IPivotTable.IDataField.getPivotTable} */
45
+ getPivotTable(): IPivotTable;
46
+ /** {@inheritDoc IPivotTable.IDataField.isIPivotDataField} */
47
+ get isIPivotDataField(): true;
48
+ }
49
+ /**
50
+ * Implementation for {@link IPivotTable.IValuesField}: where a table's values sit.
51
+ * @internal
52
+ */
53
+ export declare class PivotValuesField implements IPivotTable.IValuesField {
54
+ private readonly _table;
55
+ constructor(table: PivotTable);
56
+ /** {@inheritDoc IPivotTable.IValuesField.getName} */
57
+ getName(): string;
58
+ /** {@inheritDoc IPivotTable.IValuesField.setName} */
59
+ setName(name: string, options?: ITransaction.OperationOptions): Promise<void>;
60
+ /** {@inheritDoc IPivotTable.IValuesField.getAxis} */
61
+ getAxis(): IPivotTable.Axis | null;
62
+ /** {@inheritDoc IPivotTable.IValuesField.setAxis} */
63
+ setAxis(axis: IPivotTable.Axis | null, position?: number, options?: ITransaction.OperationOptions): Promise<void>;
64
+ /** {@inheritDoc IPivotTable.IValuesField.getPosition} */
65
+ getPosition(): number | null;
66
+ /** {@inheritDoc IPivotTable.IValuesField.setPosition} */
67
+ setPosition(position: number, options?: ITransaction.OperationOptions): Promise<void>;
68
+ /** {@inheritDoc IPivotTable.IValuesField.getPivotTable} */
69
+ getPivotTable(): IPivotTable;
70
+ /** {@inheritDoc IPivotTable.IValuesField.isIPivotValuesField} */
71
+ get isIPivotValuesField(): true;
72
+ }
73
+ //# sourceMappingURL=PivotDataField.d.ts.map
@@ -0,0 +1,142 @@
1
+ import { ITransaction } from '../transaction';
2
+ import { IPivotTable } from './IPivotTable';
3
+ import { PivotTable } from './PivotTable';
4
+ /**
5
+ * Implementation for {@link IPivotTable.IField}: a field of a table by its index in the cache, reading
6
+ * the table's model on every call.
7
+ * @internal
8
+ */
9
+ export declare class PivotField implements IPivotTable.IField {
10
+ readonly _table: PivotTable;
11
+ readonly _index: number;
12
+ constructor(table: PivotTable, index: number);
13
+ /** {@inheritDoc IPivotTable.IField.getName} */
14
+ getName(): string;
15
+ /** {@inheritDoc IPivotTable.IField.getDataType} */
16
+ getDataType(): IPivotTable.IField.DataType;
17
+ /** {@inheritDoc IPivotTable.IField.getAxis} */
18
+ getAxis(): IPivotTable.Axis | null;
19
+ /** {@inheritDoc IPivotTable.IField.setAxis} */
20
+ setAxis(axis: IPivotTable.Axis | null, position?: number, options?: ITransaction.OperationOptions): Promise<void>;
21
+ /** {@inheritDoc IPivotTable.IField.getPosition} */
22
+ getPosition(): number | null;
23
+ /** {@inheritDoc IPivotTable.IField.setPosition} */
24
+ setPosition(position: number, options?: ITransaction.OperationOptions): Promise<void>;
25
+ /** A property of the field's definition, or left out for `undefined`, laid out again. */
26
+ private _editField;
27
+ private _json;
28
+ /** {@inheritDoc IPivotTable.IField.getSubtotals} */
29
+ getSubtotals(): readonly IPivotTable.IField.Subtotal[];
30
+ /** {@inheritDoc IPivotTable.IField.setSubtotals} */
31
+ setSubtotals(subtotals: readonly IPivotTable.IField.Subtotal[], options?: ITransaction.OperationOptions): Promise<void>;
32
+ /** {@inheritDoc IPivotTable.IField.getForm} */
33
+ getForm(): 'compact' | IPivotTable.PivotForm;
34
+ /** {@inheritDoc IPivotTable.IField.setForm} */
35
+ setForm(form: 'compact' | IPivotTable.PivotForm, options?: ITransaction.OperationOptions): Promise<void>;
36
+ /** {@inheritDoc IPivotTable.IField.getRepeatLabels} */
37
+ getRepeatLabels(): boolean;
38
+ /** {@inheritDoc IPivotTable.IField.setRepeatLabels} */
39
+ setRepeatLabels(repeat: boolean, options?: ITransaction.OperationOptions): Promise<void>;
40
+ /** {@inheritDoc IPivotTable.IField.getBlankRowAfter} */
41
+ getBlankRowAfter(): boolean;
42
+ /** {@inheritDoc IPivotTable.IField.setBlankRowAfter} */
43
+ setBlankRowAfter(blank: boolean, options?: ITransaction.OperationOptions): Promise<void>;
44
+ /** {@inheritDoc IPivotTable.IField.getSubtotalsOnTop} */
45
+ getSubtotalsOnTop(): boolean;
46
+ /** {@inheritDoc IPivotTable.IField.setSubtotalsOnTop} */
47
+ setSubtotalsOnTop(top: boolean, options?: ITransaction.OperationOptions): Promise<void>;
48
+ /** Whether every item is a number or date, the only fields a number format reaches. */
49
+ private _holdsOnlyNumbers;
50
+ /** {@inheritDoc IPivotTable.IField.getNumberFormat} */
51
+ getNumberFormat(): string;
52
+ /** {@inheritDoc IPivotTable.IField.setNumberFormat} */
53
+ setNumberFormat(format: string | number, options?: ITransaction.OperationOptions): Promise<void>;
54
+ /** {@inheritDoc IPivotTable.IField.getPivotTable} */
55
+ getPivotTable(): IPivotTable;
56
+ /** The captions of the field's items, by index into its listed items; `null` where an entry is not an item. */
57
+ _getCaptions(): (string | null)[];
58
+ /** The item listed at `rank`, by the cache item it is. */
59
+ private _itemAt;
60
+ /** {@inheritDoc IPivotTable.IField.getItems} */
61
+ getItems(): readonly IPivotTable.IItem[];
62
+ /** {@inheritDoc IPivotTable.IField.getItem} */
63
+ getItem(name: string): IPivotTable.IItem | null;
64
+ /** The index of each named item in the field's listed items. */
65
+ private _ranksOf;
66
+ /** {@inheritDoc IPivotTable.IField.setExpanded} */
67
+ setExpanded(expanded: boolean, options?: ITransaction.OperationOptions): Promise<void>;
68
+ /** {@inheritDoc IPivotTable.IField.setVisibleItems} */
69
+ setVisibleItems(names: readonly string[] | null, options?: ITransaction.OperationOptions): Promise<void>;
70
+ /** {@inheritDoc IPivotTable.IField.getCurrentPage} */
71
+ getCurrentPage(): IPivotTable.IItem | null;
72
+ /** {@inheritDoc IPivotTable.IField.setCurrentPage} */
73
+ setCurrentPage(name: string | null, options?: ITransaction.OperationOptions): Promise<void>;
74
+ /** The field's definition in `model`. */
75
+ private _field;
76
+ /** Whether the field is on the rows or the columns, the axes a label, date or value filter and a sort apply to. */
77
+ private _isOnRowsOrColumns;
78
+ /** A data field's name: the table's, else its source field's. */
79
+ private _dataFieldName;
80
+ /** The data field with a name, by index. */
81
+ private _dataFieldOf;
82
+ /** The items shown when some are hidden by hand, or the page field's one pick; `null` when every item shows. */
83
+ private _shownByHand;
84
+ /** {@inheritDoc IPivotTable.IField.getFilters} */
85
+ getFilters(): IPivotTable.IField.Filters;
86
+ /** {@inheritDoc IPivotTable.IField.isFiltered} */
87
+ isFiltered(type?: IPivotTable.IField.FilterType): boolean;
88
+ /** {@inheritDoc IPivotTable.IField.applyFilter} */
89
+ applyFilter(filters: IPivotTable.IField.FilterInput, options?: ITransaction.OperationOptions): Promise<void>;
90
+ /** {@inheritDoc IPivotTable.IField.clearFilter} */
91
+ clearFilter(type: IPivotTable.IField.FilterType, options?: ITransaction.OperationOptions): Promise<void>;
92
+ /** {@inheritDoc IPivotTable.IField.clearAllFilters} */
93
+ clearAllFilters(options?: ITransaction.OperationOptions): Promise<void>;
94
+ /** {@inheritDoc IPivotTable.IField.getSort} */
95
+ getSort(): IPivotTable.IField.Sort | null;
96
+ /** {@inheritDoc IPivotTable.IField.sortByLabels} */
97
+ sortByLabels(order: 'ascending' | 'descending', options?: ITransaction.OperationOptions): Promise<void>;
98
+ /** {@inheritDoc IPivotTable.IField.sortByValues} */
99
+ sortByValues(order: 'ascending' | 'descending', dataField: string, scope?: readonly string[] | null, options?: ITransaction.OperationOptions): Promise<void>;
100
+ /** {@inheritDoc IPivotTable.IField.getShowAllItems} */
101
+ getShowAllItems(): boolean;
102
+ /** {@inheritDoc IPivotTable.IField.setShowAllItems} */
103
+ setShowAllItems(showAllItems: boolean, options?: ITransaction.OperationOptions): Promise<void>;
104
+ /** {@inheritDoc IPivotTable.IField.setName} */
105
+ setName(name: string, options?: ITransaction.OperationOptions): Promise<void>;
106
+ /** {@inheritDoc IPivotTable.IField.isIPivotField} */
107
+ get isIPivotField(): true;
108
+ }
109
+ /**
110
+ * Implementation for {@link IPivotTable.IItem}: an item of a field by its index in the cache field's
111
+ * items, which a move or a sort of the listed items does not change.
112
+ * @internal
113
+ */
114
+ export declare class PivotItem implements IPivotTable.IItem {
115
+ private readonly _field;
116
+ private readonly _index;
117
+ constructor(field: PivotField, index: number);
118
+ /** The item's place in the field's listed items, or -1 once it is listed no more. */
119
+ private _rank;
120
+ private _item;
121
+ /** {@inheritDoc IPivotTable.IItem.getName} */
122
+ getName(): string;
123
+ /** {@inheritDoc IPivotTable.IItem.getField} */
124
+ getField(): IPivotTable.IField;
125
+ /** {@inheritDoc IPivotTable.IItem.isVisible} */
126
+ isVisible(): boolean;
127
+ /** {@inheritDoc IPivotTable.IItem.setVisible} */
128
+ setVisible(visible: boolean, options?: ITransaction.OperationOptions): Promise<void>;
129
+ /** {@inheritDoc IPivotTable.IItem.isExpanded} */
130
+ isExpanded(): boolean;
131
+ /** {@inheritDoc IPivotTable.IItem.setExpanded} */
132
+ setExpanded(expanded: boolean, options?: ITransaction.OperationOptions): Promise<void>;
133
+ /** {@inheritDoc IPivotTable.IItem.getPosition} */
134
+ getPosition(): number | null;
135
+ /** {@inheritDoc IPivotTable.IItem.setPosition} */
136
+ setPosition(position: number, options?: ITransaction.OperationOptions): Promise<void>;
137
+ /** {@inheritDoc IPivotTable.IItem.setName} */
138
+ setName(name: string, options?: ITransaction.OperationOptions): Promise<void>;
139
+ /** {@inheritDoc IPivotTable.IItem.isIPivotItem} */
140
+ get isIPivotItem(): true;
141
+ }
142
+ //# sourceMappingURL=PivotField.d.ts.map