@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
@@ -0,0 +1,37 @@
1
+ import { IRange } from '@sheetxl/primitives';
2
+ import { IPivotTable } from './IPivotTable';
3
+ /**
4
+ * A plain A1 reference as the part spells it (`B3`, `A1:A7`, relative) made absolute, which is how
5
+ * it is held: a relative endpoint in a body that has no position is left where it is written,
6
+ * and these name fixed cells.
7
+ */
8
+ export declare function absoluteA1(ref: string): string;
9
+ /** The held text back in the part's spelling: relative. */
10
+ export declare function relativeA1(ref: string): string;
11
+ /**
12
+ * The cells a pivot table is laid out on, as coords on its own sheet, or `null` when its location
13
+ * is not one it can be anchored at.
14
+ */
15
+ export declare function locationCoordsOf(json: IPivotTable.JSON | undefined): IRange.Coords | null;
16
+ /**
17
+ * How many rows and columns a table's page fields take above its location, and after how many
18
+ * fields they wrap: down then across, or across then down with `pageOverThenDown`. All 0 when it
19
+ * has none.
20
+ */
21
+ export declare function pageCountsOf(json: Pick<IPivotTable.JSON, 'pageFields' | 'pageWrap' | 'pageOverThenDown'>): {
22
+ rows: number;
23
+ columns: number;
24
+ wrap: number;
25
+ };
26
+ /**
27
+ * The cells a laid-out table shows a field button on, as {@link IPivotTable.JSON.buttons} holds
28
+ * them, or `null` when it has not been laid out ({@link IPivotTable.JSON.header}).
29
+ *
30
+ * @remarks
31
+ * As Excel places them (`pivotLayout.xlsx`, `pivotDefinitionSettings.xlsx`): each page field's
32
+ * caption; each row-label column of the row header; the column header's caption, beside the one
33
+ * data field's caption when there are row fields too. One button per column field outside compact
34
+ * form is assumed, not probed.
35
+ */
36
+ export declare function buttonsOf(json: IPivotTable.JSON): string[] | null;
37
+ //# sourceMappingURL=_PivotUtils.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { IPivotTable } from '../IPivotTable';
2
+ import { IPivotTableCollection } from '../IPivotTableCollection';
3
+ import { PivotSourceRead } from './PivotRefresh';
4
+ /** A cache's contents for a source read for the first time. */
5
+ export declare const newPivotCache: (read: PivotSourceRead, source: IPivotTable.CacheSourceJSON, date1904: boolean) => Omit<IPivotTable.CacheJSON, "cacheId" | "part" | "partFormats">;
6
+ /**
7
+ * A cache whose `fields` list their items rather than hold their values in the records: a table can
8
+ * only name a listed item, so a field placed on an axis is one, as Excel makes it when placing it.
9
+ *
10
+ * @returns `cache` itself when they all are already.
11
+ */
12
+ export declare const withListedFields: <T extends Pick<IPivotTable.CacheJSON, "fields">>(cache: T, fields: readonly number[]) => T;
13
+ /** The fields a table's definition places on an axis. */
14
+ export declare const axisFieldsOf: (table: Pick<IPivotTable.JSON, "rowFields" | "columnFields" | "pageFields">) => number[];
15
+ /**
16
+ * What a table lists for a field it places for the first time: a grouping's groups in their order, any
17
+ * other's items sorted by label, by no standing sort, so a new item goes last (A14, M16).
18
+ */
19
+ export declare const listedItemsOf: (cache: IPivotTable.CacheJSON, field: number) => IPivotTable.PivotItemJSON[];
20
+ /**
21
+ * @throws ExpectedError for a format that does not parse, or the id of no built-in one.
22
+ */
23
+ export declare const assertNumberFormat: (format: string | number) => void;
24
+ /**
25
+ * A data field over a field of the cache, as Excel makes one: the function by what the field holds
26
+ * unless asked for, the caption `Sum of Sales`, numbered, unless named (A07, D01, D26).
27
+ *
28
+ * @throws ExpectedError for a caption taken, a function that is none or a format that does not parse.
29
+ */
30
+ export declare const newDataField: (table: Pick<IPivotTable.JSON, "fields" | "dataFields" | "valuesCaption">, cache: IPivotTable.CacheJSON, field: number, input?: Omit<IPivotTable.IDataField.Input, "field">) => IPivotTable.DataFieldJSON;
31
+ /**
32
+ * The definition of a new table over `cache`, not yet laid out.
33
+ *
34
+ * @throws ExpectedError for a field the cache does not hold, or a value's caption Excel refuses.
35
+ */
36
+ export declare const newPivotTable: (cache: IPivotTable.CacheJSON, options: IPivotTableCollection.AddOptions | undefined) => Omit<IPivotTable.JSON, "name" | "cacheId" | "location">;
37
+ //# sourceMappingURL=PivotAdd.d.ts.map
@@ -0,0 +1,65 @@
1
+ import { IPivotTable } from '../IPivotTable';
2
+ /**
3
+ * What an edit of a table's values does to its definition, as Excel's
4
+ * (`pivot-probes/probe-pivot-data-fields.ps1`, `-fields2`, `-fields3`). Pure: the table lays itself out
5
+ * from what comes back.
6
+ */
7
+ type Editable = Pick<IPivotTable.JSON, 'fields' | 'rowFields' | 'columnFields' | 'pageFields' | 'dataFields' | 'filters' | 'formats' | 'conditionalFormats' | 'valuesOnRows' | 'valuesPosition' | 'valuesCaption'>;
8
+ /**
9
+ * `table` with a new data field, last. Its source leaves any axis it is on, with what a field taking
10
+ * that step keeps (D01, D27): setting it on an axis afterwards holds both.
11
+ *
12
+ * @throws ExpectedError for a caption taken, a function that is none or a format that does not parse.
13
+ */
14
+ export declare const addPivotDataField: <T extends Editable>(table: T, cache: IPivotTable.CacheJSON, field: number, input?: Omit<IPivotTable.IDataField.Input, "field">) => T;
15
+ /** `table` without a data field; without any when `data` is absent (D16). */
16
+ export declare const removePivotDataField: <T extends Editable>(table: T, data?: number) => T;
17
+ /**
18
+ * `table` with a data field at `position`, counted from 1.
19
+ *
20
+ * @returns `table` itself when it is there already.
21
+ * @throws ExpectedError for a position it cannot take.
22
+ */
23
+ export declare const movePivotDataField: <T extends Editable>(table: T, data: number, position: number) => T;
24
+ /**
25
+ * `table` with a data field's function. Its caption follows: what comes before its first ` of ` takes the
26
+ * function's name, a caption without one becomes the default, and a caption taken is numbered (D04, D05,
27
+ * D20, D21, D30). Its format stays.
28
+ *
29
+ * @returns `table` itself when the function is the field's already.
30
+ * @throws ExpectedError for a function that is none.
31
+ */
32
+ export declare const setPivotDataFunction: <T extends Editable>(table: T, cache: IPivotTable.CacheJSON, data: number, name: string) => T;
33
+ /**
34
+ * `table` with a data field shown as `rule`, or as is for `null`. A new base field starts at its first item
35
+ * (D22). The base stays through a change of kind and through `null` (D22); the number format is judged by
36
+ * {@link formatAfterKind} when the kind changes, the formats on single cells staying over it (D22).
37
+ *
38
+ * @returns `table` itself when nothing changes.
39
+ * @throws ExpectedError for a kind that is none, or a base field or item the table does not have.
40
+ */
41
+ export declare const setPivotDataShowAs: <T extends Editable>(table: T, cache: IPivotTable.CacheJSON, data: number, rule: IPivotTable.IDataField.ShowAs | null) => T;
42
+ /**
43
+ * `table` with a data field's number format, over any format a single cell of its values holds, whose
44
+ * other settings stay (D10, D23). Excel's own shape: the field's format and one more format on the table
45
+ * over all its values, replaced by the next.
46
+ *
47
+ * @returns `table` itself when the format is on top already.
48
+ * @throws ExpectedError for a format that does not parse.
49
+ */
50
+ export declare const setPivotDataNumberFormat: <T extends Editable>(table: T, data: number, format: string | number) => T;
51
+ /**
52
+ * `table` with the values on an axis, at `position` among its fields, counted from 1; absent, last, and
53
+ * nothing when they are on it. `null` takes every value off the table (D16).
54
+ *
55
+ * @throws ExpectedError for an axis the values cannot take, or a position not on it (D16, D24).
56
+ */
57
+ export declare const movePivotValues: <T extends Editable>(table: T, axis: IPivotTable.Axis | null, position?: number) => T;
58
+ /**
59
+ * `table` with the values' caption. It shares its namespace with the fields and the data fields (D24, D26).
60
+ *
61
+ * @throws ExpectedError for a caption taken.
62
+ */
63
+ export declare const renamePivotValues: <T extends Editable>(table: T, cache: IPivotTable.CacheJSON, name: string) => T;
64
+ export {};
65
+ //# sourceMappingURL=PivotData.d.ts.map
@@ -0,0 +1,45 @@
1
+ import { Scalar } from '@sheetxl/primitives';
2
+ import { IPivotTable } from '../IPivotTable';
3
+ import { PivotModel } from '../_PivotItems';
4
+ import { PivotCellRole } from './PivotLayout';
5
+ /**
6
+ * A table with an item of a field renamed, as Excel's `PivotItem.Caption` takes it
7
+ * (`pivot-probes/probe-pivot-items.ps1`, I05): the text as given, spaces and all, empty allowed;
8
+ * its value's own text restores the original. Under a sort by label the field is sorted again, as
9
+ * Excel sorts by the caption (I05c). The item's cell shows the caption; `GETPIVOTDATA` finds it by
10
+ * the caption or by its value.
11
+ *
12
+ * @param rank The item's place in the field's listed items.
13
+ * @returns The table as edited, or `table` itself when the item already has the name.
14
+ * @throws ExpectedError When another item of the field has the name, without regard to case, as
15
+ * Excel refuses (I05a).
16
+ */
17
+ export declare const renamePivotItem: <T extends PivotModel>(table: T, cache: IPivotTable.CacheJSON, field: number, rank: number, name: string) => T;
18
+ /**
19
+ * A table with an item of a field moved along its field's listed items, as Excel's
20
+ * `PivotItem.Position` and a label typed over with another item's name do
21
+ * (`pivot-probes/probe-pivot-items.ps1`, I01-I04; `probe-pivot-items-followup.ps1`): the field's
22
+ * order is then by hand, so a sort it had ends, by label or by value, and holds through a refresh.
23
+ * Whatever names an item by its place in the list follows it ({@link reorderPivotItems}).
24
+ *
25
+ * @param from The item's place in the field's listed items.
26
+ * @param to Its new place, in the list without it.
27
+ * @returns The table as edited, or `table` itself when the item is already there and the field has
28
+ * no sort to end.
29
+ */
30
+ export declare const movePivotItem: <T extends PivotModel>(table: T, field: number, from: number, to: number) => T;
31
+ /**
32
+ * A table with `value` typed over a cell of it, as Excel takes it
33
+ * (`pivot-probes/probe-pivot-edit.ps1`):
34
+ * - over an item's label, the item is renamed; over it with another item's name, that item moves
35
+ * there instead;
36
+ * - over a field's caption, a data field's name, a compact table's header or the grand total's
37
+ * caption, that caption is renamed; a field or data field cannot take a name another field has;
38
+ * - over a page field's item, the page field shows the item named, or every item for `(All)`.
39
+ *
40
+ * @param role What the cell is ({@link PivotLayout.roles}).
41
+ * @returns The table as edited; the caller lays it out again.
42
+ * @throws ExpectedError where Excel refuses the value.
43
+ */
44
+ export declare const typeOverPivot: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON, role: PivotCellRole, value: Scalar) => IPivotTable.JSON;
45
+ //# sourceMappingURL=PivotEdit.d.ts.map
@@ -0,0 +1,50 @@
1
+ import { IRuntime, Scalar } from '@sheetxl/primitives';
2
+ import { ICalculation } from '../../calculation';
3
+ import { IPivotTable } from '../IPivotTable';
4
+ import { isItemFilter } from '../_PivotItems';
5
+ import { CalculatedRecords } from './PivotFormulas';
6
+ export { isItemFilter };
7
+ /**
8
+ * What a table's filters keep, for a layout to read ({@link layOutPivot}).
9
+ */
10
+ export interface PivotFilterResult {
11
+ /**
12
+ * Per field with a label or date filter, per cache item id: `1` where the item passes every one
13
+ * of them. An item that fails is left out as a hidden item is.
14
+ */
15
+ readonly keep: ReadonlyMap<number, Uint8Array>;
16
+ /**
17
+ * Per record, which axes keep it after the value and top filters, which drop groups (an item
18
+ * under one outer item, which another outer item may keep): {@link KeepRows} unless a filter on a
19
+ * row field dropped it, {@link KeepColumns} unless one on a column field did. A record makes items
20
+ * on the axes that keep it and counts in a value only with both, as Excel's other axis keeps the
21
+ * items such a filter empties. Absent when none drops any.
22
+ */
23
+ readonly records?: Uint8Array;
24
+ /** The records a table's calculated items add ({@link calculatedRecordsOf}), when it has them. */
25
+ readonly calculatedRecords?: CalculatedRecords | null;
26
+ /** Per data field with a formula, its values: one per cell of the kernel's pass, then a crossing with no cell. */
27
+ readonly fieldValues?: ReadonlyMap<number, Scalar[]> | null;
28
+ }
29
+ /**
30
+ * Runs a table's filters, as the conditions model runs any condition. A label filter
31
+ * (Display-shaped) tests each item's caption, as its cell shows it, `(blank)` included, given as
32
+ * the value itself; a date filter tests the item's value, a date being a number. A value or top
33
+ * filter tests each item's total of its data field within each item of the fields outside it, the
34
+ * items under one outer item being the population a top filter ranks; the totals count only what
35
+ * the filters before it keep. Label and date filters apply first, then the others in their
36
+ * `evalOrder`; two filters on one field both apply.
37
+ *
38
+ * @remarks
39
+ * Async, as every condition is: one may carry a formula, which the engine evaluates.
40
+ */
41
+ export declare const evaluatePivotFilters: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON, runtime: IRuntime, calculation?: ICalculation | null) => Promise<PivotFilterResult>;
42
+ /**
43
+ * `model` with each relative date filter's `anchorDate` set to `today`, as a relayout evaluates them
44
+ * again: Excel holds the window a period was last evaluated over until the table is laid out
45
+ * (`pivot-probes/probe-pivot-relative-dates.ps1`). `model` itself when none changes.
46
+ *
47
+ * @param today The day, as a whole serial.
48
+ */
49
+ export declare const anchorPivotPeriods: <T extends Pick<IPivotTable.JSON, "filters">>(model: T, today: number) => T;
50
+ //# sourceMappingURL=PivotFilters.d.ts.map
@@ -0,0 +1,72 @@
1
+ import { IRuntime, Scalar } from '@sheetxl/primitives';
2
+ import { ICalculation } from '../../calculation';
3
+ import { IPivotTable } from '../IPivotTable';
4
+ /**
5
+ * A table's calculated fields and items, by Excel's rules (PLAN-PIVOT §4.7,
6
+ * `pivot-probes/probe-pivot-calculated.ps1`). A formula names fields or items, never cells, and reads
7
+ * totals: rollup first, then the formula, then the layout. A table's formulas go to the calc service
8
+ * as one request ({@link ICalculation.evaluateBatch}), each written over columns of values.
9
+ */
10
+ /** What a formula's names become: a reference; `null` for a name it does not know, left as it is. */
11
+ type Resolve = (field: string, item: string | null) => string | null;
12
+ /**
13
+ * A pivot formula with its field and item names replaced: `Sales-Cost`, `'Unit Price'*2`,
14
+ * `Region[North]+Region['North East']`.
15
+ *
16
+ * @returns The formula, or `null` when it names an item {@link Resolve} does not: a position
17
+ * (`Region[+1]`) or one the field does not list.
18
+ */
19
+ export declare const rewriteFormula: (formula: string, resolve: Resolve) => string | null;
20
+ /** The fields a data field's formula reads, the columns of the source, a formula's own followed. */
21
+ export interface FieldFormulas {
22
+ /** The cache fields the formulas read, each rolled up as a sum. */
23
+ readonly operands: readonly number[];
24
+ /** The cache fields with a formula the data fields need, each read by those after it. */
25
+ readonly formulas: readonly {
26
+ readonly field: number;
27
+ readonly expression: string;
28
+ }[];
29
+ /** Per data field with a formula, its index and which of {@link formulas} it shows. */
30
+ readonly measures: readonly {
31
+ readonly data: number;
32
+ readonly formula: number;
33
+ }[];
34
+ }
35
+ /**
36
+ * What the data fields' formulas need, or `null` when a formula cannot be written over columns.
37
+ * A table with none has none of each.
38
+ */
39
+ export declare const fieldFormulasOf: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON) => FieldFormulas | null;
40
+ /**
41
+ * The data fields' values from what the rollup gave, one per cell and then what a crossing with no
42
+ * cell shows, in one request.
43
+ *
44
+ * @param operands Per {@link FieldFormulas.operands}, its sum per cell.
45
+ * @returns Per data field with a formula, its values.
46
+ */
47
+ export declare const evaluateFieldFormulas: (plan: FieldFormulas, operands: readonly (readonly Scalar[])[], cells: number, calculation: ICalculation) => Promise<Map<number, Scalar[]>>;
48
+ /** Records a table's calculated items add to its cache's, each holding the item's value at a crossing. */
49
+ export interface CalculatedRecords {
50
+ /** How many. */
51
+ readonly count: number;
52
+ /** Per cache field, each record's item id. */
53
+ readonly ids: readonly (readonly number[])[];
54
+ /** Per data field, each record's value. */
55
+ readonly values: readonly (readonly Scalar[])[];
56
+ }
57
+ /**
58
+ * The records that make a table's calculated items show: one per item per crossing of the other
59
+ * fields on its axes, so a total adds the item as it adds any line, a sort or a filter reads it, and
60
+ * an item hidden leaves them. Under a count, as many as the count, each worth 1. The item shows under
61
+ * every outer item with records and with every item of the fields inside it and across, 0 where its
62
+ * members have none (S06, S27, S29, CI11).
63
+ *
64
+ * A member hidden still counts, its records read here whatever the table hides of its own field; one
65
+ * gone from the source is 0.
66
+ *
67
+ * @returns The records; `null` when the table has calculated items this cannot lay out: more than one
68
+ * field's, beside a calculated field, under another function, or a formula naming a position.
69
+ */
70
+ export declare const calculatedRecordsOf: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON, runtime: IRuntime, calculation: ICalculation, keep?: ReadonlyMap<number, Uint8Array>) => Promise<CalculatedRecords | null>;
71
+ export {};
72
+ //# sourceMappingURL=PivotFormulas.d.ts.map
@@ -0,0 +1,133 @@
1
+ import { IRuntime, Scalar } from '@sheetxl/primitives';
2
+ import { ICalculation } from '../../calculation';
3
+ import { Tuple } from '../../collections';
4
+ import { IPivotTable } from '../IPivotTable';
5
+ import { PivotFilterResult } from './PivotFilters';
6
+ import { CalculatedRecords } from './PivotFormulas';
7
+ import { formatCodeOf } from '../_PivotStructure';
8
+ /** `KEEP_ROWS`, `KEEP_COLUMNS`: a record mask's bits, the axes whose items keep the record. */
9
+ export declare const KeepRows = 1;
10
+ export declare const KeepColumns = 2;
11
+ /**
12
+ * A pivot table laid out: its cells, and the lines and offsets Excel stores beside them.
13
+ */
14
+ export interface PivotLayout {
15
+ /**
16
+ * The table's cells from the location's top-left, in the order {@link LayOutOptions.cellOrder}
17
+ * asks for: a value, a label or a caption. The page fields sit at negative rows, above a blank
18
+ * row over the location. Blanks are not stored.
19
+ */
20
+ readonly cells: Tuple.GridTuple<Scalar>;
21
+ /** How many rows and columns the location covers. */
22
+ readonly rows: number;
23
+ readonly columns: number;
24
+ /** How many rows and columns of page fields there are. */
25
+ readonly rowPageCount: number;
26
+ readonly columnPageCount: number;
27
+ readonly header: IPivotTable.PivotHeaderJSON;
28
+ readonly rowLines: IPivotTable.PivotLineJSON[];
29
+ readonly columnLines: IPivotTable.PivotLineJSON[];
30
+ /**
31
+ * The values the table shows, keyed for `GETPIVOTDATA` (`ICalcGrid.PivotJSON.values`): per data
32
+ * field, the item of each row and column field, `-1` past a line's depth. An empty crossing is 0.
33
+ */
34
+ readonly viewValues: [string, Scalar][];
35
+ /**
36
+ * The key in {@link viewValues} of the first cell of the data area - the first row line's
37
+ * crossing with the first column line - or `null` when the table has none.
38
+ */
39
+ readonly firstKey: string | null;
40
+ /**
41
+ * What each label and caption cell is, by `row,column` as {@link cells} places them; asked for
42
+ * ({@link LayOutOptions.roles}). A cell without one - a value, a total, a subtotal's caption -
43
+ * takes no edit.
44
+ */
45
+ readonly roles?: ReadonlyMap<string, PivotCellRole>;
46
+ }
47
+ /** Options for {@link layOutPivot}. */
48
+ export interface LayOutOptions {
49
+ /** Say what each label and caption cell is ({@link PivotLayout.roles}). */
50
+ roles?: boolean;
51
+ /**
52
+ * What the table's filters keep ({@link evaluatePivotFilters}), for the definition and cache laid
53
+ * out; without it a table with filters is not laid out.
54
+ */
55
+ filters?: PivotFilterResult | null;
56
+ /**
57
+ * The order of {@link PivotLayout.cells}: `rows`, the default, is major by row (`[row, [[column,
58
+ * run]]]`), `columns` major by column (`[column, [[row, run]]]`), so a sheet that stores by column
59
+ * takes the runs as they are.
60
+ */
61
+ cellOrder?: 'rows' | 'columns';
62
+ /**
63
+ * The fields the table's slicers filter, by cache index: their hidden items keep records out, on
64
+ * an axis or not ({@link withSlicerPages}).
65
+ */
66
+ slicerFields?: readonly number[];
67
+ }
68
+ /**
69
+ * What a laid-out cell is, for a value typed over it (`pivot-probes/probe-pivot-edit.ps1`):
70
+ * - `item`: an item's label on rows or columns, `rank` its index in the field's items;
71
+ * - `fieldCaption`: a field's caption, over an outline or tabular field or beside a page field;
72
+ * - `rowHeader`, `columnHeader`: a compact table's captions;
73
+ * - `dataCaption`: a data field's name;
74
+ * - `grandTotal`: the grand total's caption;
75
+ * - `pageItem`: the item a page field shows, `page` its index in the page fields.
76
+ */
77
+ export type PivotCellRole = {
78
+ readonly kind: 'item';
79
+ readonly field: number;
80
+ readonly rank: number;
81
+ } | {
82
+ readonly kind: 'fieldCaption';
83
+ readonly field: number;
84
+ } | {
85
+ readonly kind: 'rowHeader';
86
+ } | {
87
+ readonly kind: 'columnHeader';
88
+ } | {
89
+ readonly kind: 'dataCaption';
90
+ readonly data: number;
91
+ } | {
92
+ readonly kind: 'grandTotal';
93
+ } | {
94
+ readonly kind: 'pageItem';
95
+ readonly page: number;
96
+ };
97
+ /**
98
+ * Lays out a modeled pivot table from its cache's records, as Excel lays it out on a refresh.
99
+ *
100
+ * @returns The layout, or `null` when the WebAssembly has not loaded, the table has filters and
101
+ * {@link LayOutOptions.filters} is not given, or the table asks for what is not laid out yet:
102
+ * a calculated item, a field the records do not hold that groups nothing, a value its group cannot
103
+ * hold, or a custom subtotal function.
104
+ */
105
+ export declare const layOutPivot: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON, runtime: IRuntime, options?: LayOutOptions) => PivotLayout | null;
106
+ /** What {@link itemTotalsOf} gives a value or top filter. */
107
+ export interface PivotItemTotals {
108
+ /** The fields outside the filtered one on its axis, outermost first. */
109
+ readonly outer: readonly number[];
110
+ /** Per item of the outer fields (their item ids, joined by `,`), the filtered field's items with data and their totals. */
111
+ readonly groups: ReadonlyMap<string, {
112
+ readonly ids: readonly number[];
113
+ readonly totals: readonly Scalar[];
114
+ }>;
115
+ /** Per field, its records' item ids. */
116
+ readonly records: readonly (readonly number[])[];
117
+ }
118
+ /**
119
+ * The totals a value or top filter on `field` tests: each of its items' total of data field
120
+ * `dataField`, within each item of the fields outside it on its axis, over the records the table
121
+ * keeps (hidden items, page picks, `keep` and `recordKeep` left out) and across the other axis.
122
+ * The items are those `field`'s axis keeps (`recordKeep`'s bit for it), so an item a filter on
123
+ * the other axis emptied is there with no total, as Excel judges it. `null` when `field` is on
124
+ * neither axis or the data field is not one a layout computes.
125
+ */
126
+ export declare const itemTotalsOf: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON, runtime: IRuntime, field: number, dataField: number, keep?: ReadonlyMap<number, Uint8Array>, recordKeep?: Uint8Array, added?: CalculatedRecords | null, calculation?: ICalculation | null) => Promise<PivotItemTotals | null>;
127
+ /**
128
+ * The formulas of a table's data fields, evaluated over the rollup of what the table keeps: what
129
+ * {@link LayOutOptions.filters} carries for the layout. `null` when the table cannot be laid out.
130
+ */
131
+ export declare const fieldValuesOf: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON, runtime: IRuntime, calculation: ICalculation, keep: ReadonlyMap<number, Uint8Array> | undefined, recordKeep: Uint8Array | undefined, added: CalculatedRecords | null | undefined) => Promise<ReadonlyMap<number, Scalar[]> | null>;
132
+ export { formatCodeOf };
133
+ //# sourceMappingURL=PivotLayout.d.ts.map
@@ -0,0 +1,24 @@
1
+ import { IPivotTable } from '../IPivotTable';
2
+ /**
3
+ * What a field's move does to a table's definition, as Excel's (`pivot-probes/probe-pivot-moves.ps1`,
4
+ * and A10 of `probe-pivot-add.ps1`). Pure: the table lays itself out from what comes back.
5
+ */
6
+ type Movable = Pick<IPivotTable.JSON, 'fields' | 'rowFields' | 'columnFields' | 'pageFields' | 'filters' | 'formats'>;
7
+ /**
8
+ * `table` with a field on `axis`, or off the table for `null`: at `position`, counted from 1 and with
9
+ * the values among the fields, else after the axis's last (A10, M01, M31).
10
+ *
11
+ * @remarks
12
+ * What the field holds goes with it, off the table too (M03, M06, M07, M09): its hidden items, filters,
13
+ * sort and names. A page field's pick does not leave the page (M04), a filter does not reach it (M05,
14
+ * M29), and hidden items there are a multiple selection (M03). Off the table it filters nothing, and
15
+ * the formats naming it in their references are gone for good (M20): other formats, a `button` area
16
+ * naming it too, stay.
17
+ *
18
+ * @returns `table` itself when the field is there already.
19
+ * @throws ExpectedError for a position not on the axis, the values, or what Excel will not place:
20
+ * a calculated field anywhere but the values, a field with calculated items on the page (M15).
21
+ */
22
+ export declare const movePivotField: <T extends Movable>(table: T, cache: IPivotTable.CacheJSON, field: number, axis: IPivotTable.Axis | null, position?: number) => T;
23
+ export {};
24
+ //# sourceMappingURL=PivotMove.d.ts.map
@@ -0,0 +1,87 @@
1
+ import { Scalar } from '@sheetxl/primitives';
2
+ import { ICellRange } from '../../cellRange';
3
+ import { IPivotTable } from '../IPivotTable';
4
+ /**
5
+ * A pivot cache read again from its source, and each table on it carried over to the new cache,
6
+ * by Excel's rules (PLAN-PIVOT §4.4, `pivot-probes/probe-pivot-refresh-*.ps1`):
7
+ *
8
+ * - a field is matched to a source column by its header, without regard to case; a header no field
9
+ * had is a new field, and a field no header has is gone from the cache and from every table;
10
+ * - a field's items are those the column holds, in the order they first appear, then the items
11
+ * it held before and holds no longer, kept as unused (unless `missingItemsLimit="0"`);
12
+ * - a table's items keep their place and their state; an item no longer held is missing and keeps
13
+ * its state for when it comes back; an item new to the field is added after the others, or in
14
+ * its place under a sort, hidden when the field is filtered;
15
+ * - a range grouping's bounds follow the values unless fixed and its groups are made anew, and a
16
+ * value that is not a number ends the grouping; a discrete grouping keeps its groups, each new
17
+ * item a group of its own after them (§4.6);
18
+ * - a calculated field stays, and a calculated item, last among its field's items (§4.7).
19
+ */
20
+ /** One column of the source as read: its header, each record's item id, and each id's value. */
21
+ export interface PivotSourceColumn {
22
+ /** The header cell's text; `''` for a blank header. */
23
+ header: string;
24
+ /** Per record, the item id ({@link Items}); 0 is the blank. */
25
+ ids: Uint32Array;
26
+ /** Per item id, its value. */
27
+ values: readonly Scalar[];
28
+ /** The number format every data cell shares; `undefined` when they do not share one, or it is General. */
29
+ numberFormat?: string;
30
+ /** Its numbers are dates: every number in it has a date format. */
31
+ dates: boolean;
32
+ /** Which of `values` are dates, when others are plain numbers: then a value with both has two ids. */
33
+ dateIds?: ReadonlySet<number>;
34
+ }
35
+ /** A source as read: its columns, each as tall as the records. */
36
+ export interface PivotSourceRead {
37
+ columns: PivotSourceColumn[];
38
+ recordCount: number;
39
+ }
40
+ /**
41
+ * Reads a source range, its first row the headers: each column interned into item ids, with the
42
+ * number format all its data cells share and whether its numbers are dates.
43
+ *
44
+ * @param range The source as the sheet holds it now.
45
+ */
46
+ export declare const readPivotSource: (range: ICellRange) => PivotSourceRead;
47
+ /** How a refresh carried each old cache field and its items into the new cache. */
48
+ export interface PivotCacheRemap {
49
+ /** Per old cache field, its index in the new cache; -1 when it is gone. */
50
+ fields: number[];
51
+ /** Per old cache field, per old item index, its index in the new field's items; -1 when dropped. */
52
+ items: number[][];
53
+ /** Per new field, its items: in use first, then unused ({@link IPivotTable.CacheFieldJSON.unused}). */
54
+ newItems: Scalar.JSON[][];
55
+ /** Per new field, how many of its items are in use. */
56
+ usedCounts: number[];
57
+ /** Per new field, whether a table lists its items in their own order: a range's groups. */
58
+ inItemOrder: boolean[];
59
+ /** Per new field holding dates and plain numbers, the items that are dates. */
60
+ dateItems: (ReadonlySet<number> | undefined)[];
61
+ }
62
+ /**
63
+ * The cache a refresh from the source makes, and how its old fields and items map onto it.
64
+ *
65
+ */
66
+ export declare const refreshPivotCache: (old: IPivotTable.CacheJSON, read: PivotSourceRead, source: IPivotTable.CacheSourceJSON | undefined, date1904?: boolean) => {
67
+ model: Omit<IPivotTable.CacheJSON, "cacheId" | "part" | "partFormats">;
68
+ remap: PivotCacheRemap;
69
+ };
70
+ /**
71
+ * Excel's ascending sort order: numbers, text without regard to case, logicals, dates among plain
72
+ * numbers (`pivot-probes/probe-pivot-dates-and-numbers.ps1`; errors after them is assumed), errors,
73
+ * blanks last.
74
+ *
75
+ * @param aIsDate Whether `a` is a date in a field that also holds plain numbers.
76
+ * @param bIsDate The same of `b`.
77
+ */
78
+ export declare const compareItems: (a: Scalar, b: Scalar, aIsDate?: boolean, bIsDate?: boolean) => number;
79
+ /**
80
+ * A table carried over to its refreshed cache: its fields in the new cache's order (a field gone
81
+ * from the source is gone from every axis, its data fields, filters and formats), and each
82
+ * field's items remapped by {@link PivotCacheRemap}.
83
+ */
84
+ export declare const remapPivotTable: <T extends Omit<IPivotTable.JSON, "name" | "cacheId" | "location" | "part" | "partFormats" | "buttons">>(table: T, remap: PivotCacheRemap) => T;
85
+ /** An area carried over: `null` when it names a field gone from the source or an item dropped. */
86
+ export declare const remapArea: (area: IPivotTable.PivotAreaJSON, fieldOf: (old: number) => number, kept: (old: number) => boolean, listMaps: readonly (number[] | null)[], dataIndex: readonly number[]) => IPivotTable.PivotAreaJSON | null;
87
+ //# sourceMappingURL=PivotRefresh.d.ts.map
@@ -0,0 +1,26 @@
1
+ import { IPivotTable } from '../IPivotTable';
2
+ import { PivotModel } from '../_PivotItems';
3
+ /**
4
+ * A table with a field's items listed in a new order: `order` is the new list, each entry an index
5
+ * into the old one, every entry once.
6
+ *
7
+ * @remarks
8
+ * Whatever names an item by its place in the list follows it: the page pick, another field's sort
9
+ * scope, a data field's base item, the areas of the table's formats and conditional formats. The
10
+ * field's own sort is left as it is, for the caller to settle.
11
+ */
12
+ export declare const reorderPivotItems: <T extends PivotModel>(table: T, field: number, order: readonly number[]) => T;
13
+ /**
14
+ * A table with a field's items listed in Excel's label order and the field sorted so: numbers,
15
+ * text without regard to case, logicals, errors, blanks last; descending is the exact reverse, its
16
+ * blank first (`pivot-probes/probe-pivot-field-filter-api.ps1`, H15, H16). A sort by value the
17
+ * field had is replaced, as Excel's last sort wins (H17). A range's groups order as the range does,
18
+ * months by the calendar, and a discrete field's by caption (GE09-GE11). A renamed item sorts by its
19
+ * caption (`probe-pivot-items.ps1`, I05c).
20
+ *
21
+ * @remarks
22
+ * Entries that are not items (subtotal lines) keep their places. Whatever names an item by its
23
+ * place in the list follows it ({@link reorderPivotItems}).
24
+ */
25
+ export declare const sortPivotItemsByLabel: <T extends PivotModel>(table: T, cache: IPivotTable.CacheJSON, field: number, order: "ascending" | "descending") => T;
26
+ //# sourceMappingURL=PivotSort.d.ts.map
@@ -0,0 +1,22 @@
1
+ import { IRange, IRuntime } from '@sheetxl/primitives';
2
+ import { IPivotTable } from '../IPivotTable';
3
+ import { PivotTable } from '../PivotTable';
4
+ import { PivotFilterResult } from './PivotFilters';
5
+ /**
6
+ * The values a modeled pivot table shows, from its model and its cache's: what its sheet tells
7
+ * the grid (`ICalcGrid.setPivots`) for `GETPIVOTDATA`.
8
+ *
9
+ * @param saved The location as saved: its top-left is the anchor.
10
+ * @param blocked The table shows `#SPILL!` at its anchor.
11
+ * @param filters What the table's filters keep ({@link LayOutOptions.filters}).
12
+ * @param slicerFields The fields the table's slicers filter ({@link LayOutOptions.slicerFields}).
13
+ * @returns The data and the location's size, or `null` when the table is not laid out
14
+ * ({@link layOutPivot}) or its page fields have no room above the anchor.
15
+ *
16
+ * @remarks
17
+ * The values are the layout's: a line is shown as Excel lays it out
18
+ * (`pivot-probes/probe-getpivotdata.ps1`), hidden items and the page selection keep their records
19
+ * out of every value, and an empty crossing answers 0.
20
+ */
21
+ export declare const buildPivotView: (table: IPivotTable.JSON, cache: IPivotTable.CacheJSON, saved: IRange.Coords, runtime: IRuntime, blocked?: boolean, filters?: PivotFilterResult | null, slicerFields?: readonly number[]) => PivotTable.View | null;
22
+ //# sourceMappingURL=PivotViewBuilder.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The pivot code a workbook loads only once it holds a modeled pivot table: the views
3
+ * `GETPIVOTDATA` reads and the layout they come from; in time the refresh and writer.
4
+ * @internal
5
+ */
6
+ export { buildPivotView } from './PivotViewBuilder';
7
+ export { anchorPivotPeriods, evaluatePivotFilters, isItemFilter, type PivotFilterResult } from './PivotFilters';
8
+ export { layOutPivot, type PivotCellRole, type PivotLayout } from './PivotLayout';
9
+ export { movePivotItem, renamePivotItem, typeOverPivot } from './PivotEdit';
10
+ export { reorderPivotItems, sortPivotItemsByLabel } from './PivotSort';
11
+ export { readPivotSource, refreshPivotCache, remapPivotTable, type PivotCacheRemap, type PivotSourceRead } from './PivotRefresh';
12
+ export { assertNumberFormat, axisFieldsOf, listedItemsOf, newPivotCache, newPivotTable, withListedFields } from './PivotAdd';
13
+ export { movePivotField } from './PivotMove';
14
+ export { addPivotDataField, movePivotDataField, movePivotValues, removePivotDataField, renamePivotValues, setPivotDataFunction, setPivotDataNumberFormat, setPivotDataShowAs } from './PivotData';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,8 @@
3
3
  */
4
4
  export * from './IPivotTable';
5
5
  export * from './IPivotTableCollection';
6
+ /** @internal */
7
+ export { pivotStylePreviewOf, type PivotStylePreview } from './_PivotStylePreview';
8
+ /** @internal */
9
+ export { pivotBoxOf, pivotCellFormatsOf, pivotControlsIn, type PivotCellFormats, type PivotControl } from './_PivotControls';
6
10
  //# sourceMappingURL=index.d.ts.map