@sheetxl/sdk 0.8.0-beta.15 → 0.8.0-beta.17

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/{DDQtExVGSoCzAf6-.mjs → B-Q1-7RgSnA75J32.mjs} +506 -502
  3. package/browser/esm/{Cl3jq6y4Idilod82.mjs → BI6NwRrdLCbPdz6f.mjs} +3 -3
  4. package/browser/esm/{Blo0Hwg2ojXt99Dl.mjs → BWNQcQyx8wt6huOq.mjs} +2 -2
  5. package/browser/esm/{Do8TQqQvnFXRlFu-.mjs → BY_-BTa5h6HnnZ1W.mjs} +3 -3
  6. package/browser/esm/{D4ZCoKyNCJvDQAkx.mjs → BlkstmZEklk6Y1QD.mjs} +23 -22
  7. package/browser/esm/{DpaqR081c-Q7WemN.mjs → BuKA3E-Ev8Dp5W2I.mjs} +2 -2
  8. package/browser/esm/{Bbrhl946_QbCz5WS.mjs → Byp_bvP9G-tN6hcz.mjs} +588 -587
  9. package/browser/esm/{CMSeF5rGzeuMUydM.mjs → C0o6WpBojS7XhV5m.mjs} +3 -3
  10. package/browser/esm/CAjITJT3eLst9Rhi.mjs +686 -0
  11. package/browser/esm/{CZ_ZPliIkoh8BViV.mjs → CFywn1iiD35nNNUP.mjs} +10 -10
  12. package/browser/esm/{DJNLo8Rd_5UQP0U5.mjs → CHByUyHFA3ESf7DX.mjs} +2 -2
  13. package/browser/esm/CLT3qGy_brDIwbYd.mjs +2017 -0
  14. package/browser/esm/{Blo0jHze0bQxnKh4.mjs → CVV4xqwD8gIjYj1E.mjs} +78 -78
  15. package/browser/esm/{FHp0QfwZMIfP0Sry.mjs → CWkaF7gYWCkW7vDA.mjs} +2 -2
  16. package/browser/esm/{CNM5d4p0Y7In0rTf.mjs → DCs7bk-yx0UhCvQ4.mjs} +3 -3
  17. package/browser/esm/{BsGN0Tk0jVc2n0hy.mjs → DDNerAeet8uDYKhf.mjs} +3 -3
  18. package/browser/esm/{D6OqcO9IWPaY211T.mjs → DGUOlgm1_WFmf_xO.mjs} +2 -2
  19. package/browser/esm/{Dp4OIVjjAVhpD815.mjs → DJTEQZiR9IFTuN_4.mjs} +3 -3
  20. package/browser/esm/{KgTozk3nvOZzEG27.mjs → DJrnSjYjFxJvpQiH.mjs} +2 -2
  21. package/browser/esm/{D0KMmRjGOQUs7Ls-.mjs → DTXsi--x2wgqgwtf.mjs} +3 -3
  22. package/browser/esm/{CPUobTehcKZllBDS.mjs → DUB6Oj_aiV3f8s5_.mjs} +51 -49
  23. package/browser/esm/{Bw66vzKThXKvXvPI.mjs → DW3kFc5t4Wnh5E9S.mjs} +2 -2
  24. package/browser/esm/{BzG0p8RdGDWHttVr.mjs → DkmqFp_-iUIy_l3D.mjs} +4 -4
  25. package/browser/esm/{zjEXdQiQruTkUyf5.mjs → Dlk1kRgkiBIpUxd9.mjs} +22 -22
  26. package/browser/esm/{tm7XJ-Zd_04xWKG6.mjs → DnMFW_oKYQxRjP1l.mjs} +2 -2
  27. package/browser/esm/{DA4S5eqog20pG7b2.mjs → DrmOaEx6CQ91zBsP.mjs} +29 -29
  28. package/browser/esm/{D8PxKK6OrmancpLT.mjs → DsWDvmky7CgzX_7W.mjs} +3 -3
  29. package/browser/esm/{DMbcmIZ-G2fbWn8v.mjs → Dx_dZ7jrw5Hxeoot.mjs} +2 -2
  30. package/browser/esm/{BN1MW1nuBndrzryn.mjs → Dy0TAi9WafVT8eke.mjs} +3 -3
  31. package/browser/esm/{L7SKr6r1tmMwFx6Q.mjs → JmmPE8Vsj85wdV8H.mjs} +2 -2
  32. package/browser/esm/{CIab4UYcHQQKTHeD.mjs → O970I8lbI7okqG7N.mjs} +404 -404
  33. package/browser/esm/{DwH4H_p6gTAcpQ17.mjs → WR3-xqcK1gF3ewAR.mjs} +4 -4
  34. package/browser/esm/XHhDDWrJiZJgWxPM.mjs +165 -0
  35. package/browser/esm/{KsfZhE6ocmYobGjY.mjs → YwDdO4YwcIE4OB0D.mjs} +2 -2
  36. package/browser/esm/aYpwVCDSwMUuz147.mjs +527 -0
  37. package/browser/esm/{BGPT-k25jo0UhtT5.mjs → gQzj95vSMXdKhpWf.mjs} +29032 -24101
  38. package/browser/esm/index.mjs +886 -578
  39. package/browser/esm/{CxhXbk-5XhaK8UNs.mjs → jotvQFBWO2jXAhWx.mjs} +2 -2
  40. package/browser/esm/{CWyzk_3eDCR9bKq6.mjs → mufbL88lyIKJEWyP.mjs} +1528 -1433
  41. package/browser/esm/{BVsG6Vpvb1ZzpURJ.mjs → qNv1x-Ny9TPbvZzj.mjs} +2 -2
  42. package/browser/esm/{XrasOsWQ-64jwMn1.mjs → taTjDyUIIxq2eClH.mjs} +4 -4
  43. package/browser/esm/{CqzKBrmmV-fWRoK7.mjs → yudASWe8CWXYcGt3.mjs} +22 -22
  44. package/licenses/dependencies.txt +69 -69
  45. package/node/esm/{CjwmkzMtjj6OMJbO.mjs → -q1xF3_2jmk3QHIY.mjs} +487 -483
  46. package/node/esm/{DDIiQZTdeY4vdK8_.mjs → 7ZwdVIsOdcziHpMD.mjs} +189 -189
  47. package/node/esm/{C7h7SvhWNwQ9TfGh.mjs → B6BQYUDRxbRnzca4.mjs} +4 -4
  48. package/node/esm/{DjsOfZn5vYpB7L6U.mjs → B8MYgBe4XICBSROW.mjs} +52 -50
  49. package/node/esm/{B8KEX44VZTFTTKb3.mjs → BBUVvO9Ma1RzbKux.mjs} +3 -3
  50. package/node/esm/{D9RwzPR5s2mWrbCQ.mjs → BQko-9y6mf2oQK7u.mjs} +2 -2
  51. package/node/esm/{BNiG1ISiMjs-G2mE.mjs → BSlFO0_8UZ38gfeE.mjs} +22 -22
  52. package/node/esm/{DUft-qpAS4MMANwG.mjs → Bgy7uWJVGwkN7AlD.mjs} +3 -3
  53. package/node/esm/{DyIASfKKPuNl5Xx-.mjs → BhosJbKOPgbJSZMY.mjs} +2 -2
  54. package/node/esm/BoLecFnIxhYKGor-.mjs +2040 -0
  55. package/node/esm/{WBHD7ECKG6HZ5UpY.mjs → BwyoLlHutolJw7OW.mjs} +2 -2
  56. package/node/esm/{Dh8o-woVpmUL50BD.mjs → CDgUHRW6vSASfqNr.mjs} +2 -2
  57. package/node/esm/{BZ0IRjh2hYuI86xW.mjs → CHS84ZGEoH6aeHsZ.mjs} +31 -30
  58. package/node/esm/{BRnNpoS8VpkAhdVk.mjs → CIlH2fSEpdYBZwUA.mjs} +2 -2
  59. package/node/esm/{BlzPuXtKvF3Qfr0p.mjs → CIxb44vA81H9lRip.mjs} +2 -2
  60. package/node/esm/{Cx9nQSsuyqhayyBS.mjs → Cb1-r2RCxcJZB6fM.mjs} +32675 -27215
  61. package/node/esm/{DKdFasYVvjAitASZ.mjs → CjCqcGyCYGkaMQI9.mjs} +2 -2
  62. package/node/esm/{D7ia4o3y5Wvl__9Y.mjs → ClJJC8tBpgsqHwdn.mjs} +2 -2
  63. package/node/esm/{C-JEySqMuKdpcKe0.mjs → Cle-_21jebWv_-D4.mjs} +3 -3
  64. package/node/esm/{j8DqCwPgfIPICFtf.mjs → D51xu0rubo34Ppeg.mjs} +1005 -1004
  65. package/node/esm/{Ddd1y3TP0kqnnSs7.mjs → DCSJKgcCQzOV-dMJ.mjs} +3 -3
  66. package/node/esm/{ZtF9EuipL7Z9Iwfs.mjs → DCaLNIs-_4Y6hJ8S.mjs} +2 -2
  67. package/node/esm/DTkV7IK2_ODMJAP5.mjs +115 -0
  68. package/node/esm/DfbVTAhNutxM74E8.mjs +169 -0
  69. package/node/esm/{DVejVdSBXzAFQbqo.mjs → DfrxGbxxowFmm3SF.mjs} +2 -2
  70. package/node/esm/{DW3u4bBJIUaHZ6m-.mjs → DgsBYF3xbjgx9Mzp.mjs} +2 -2
  71. package/node/esm/{CHBlLTJaoPUVxA2J.mjs → DxnBYzOueAKEqaQT.mjs} +22 -22
  72. package/node/esm/M3jahkTgfUxGyeZv.mjs +530 -0
  73. package/node/esm/{-afI0SRg_vgXtea7.mjs → NnrDjio_xwTBs05n.mjs} +3 -3
  74. package/node/esm/{BqvqbFsPQB0gEvwF.mjs → OCrS6pBT6lGRu82d.mjs} +1762 -1674
  75. package/node/esm/XhDjStxKy-dd3WKa.mjs +199 -0
  76. package/node/esm/{D9zb5xVRehABdbXL.mjs → Yo7_havHbr9VL8R4.mjs} +2 -2
  77. package/node/esm/{MtRwC1PMkOEb1Nty.mjs → btVWSwUwMjM0J5fS.mjs} +3 -3
  78. package/node/esm/{DQqXPS05dvF0F-gh.mjs → cRz94rkuvDrA8mr9.mjs} +2 -2
  79. package/node/esm/{BfXLtDqsXXYeZ6LX.mjs → fwfAgq8qIADcHmY4.mjs} +78 -78
  80. package/node/esm/index.mjs +913 -598
  81. package/node/esm/{OnkJkCGFDjamqIUQ.mjs → jqBKdf9DG54xqpaw.mjs} +3 -3
  82. package/node/esm/{C6b4rM62pIWIywlM.mjs → nxxwAZZF8NsdErJW.mjs} +2 -2
  83. package/node/esm/{B07QPde9GloqsW8e.mjs → oGGVbqahqfK45-Uz.mjs} +4 -4
  84. package/node/esm/{BlHlBRvKGt-4CS0A.mjs → zh6vcRzFqdV1aYh5.mjs} +2 -2
  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/BrHplg4RuI5jOmmr.mjs +0 -357
  190. package/browser/esm/eImPONkfn5DstmS8.mjs +0 -184
  191. package/node/esm/03AYPvCda2x9EOlY.mjs +0 -360
  192. package/node/esm/BmVQRGAijOHzgHmz.mjs +0 -199
  193. package/node/esm/Dk4KLs5GoRRuD8J4.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,63 @@
1
+ import { IFormulaContext, IFunction, IRange, Scalar } from '@sheetxl/primitives';
2
+ import { MemberColumnFactory } from './_PivotAxisTree';
3
+ /**
4
+ * Records grouped by rows and by columns, by the Rust pivot kernel (`crates/sheetxl-pivot`) in the
5
+ * sdk's WebAssembly: one pass numbers every prefix of each axis and every crossing of the two, and
6
+ * each built-in aggregate asked for is one more pass over a value leaf.
7
+ *
8
+ * @remarks
9
+ * ### Not public API
10
+ *
11
+ * Reached as `IFormulaContext.createPivot`; a started engine has the WebAssembly. The keys become
12
+ * item ids on the host, by `UNIQUE`'s rule ({@link Items}), and a value column is written once
13
+ * into a leaf in the WebAssembly's memory. Members, for a function the kernel does not compute,
14
+ * come from a pass that keeps each crossing's records, run the first time one is asked for.
15
+ */
16
+ export declare class KernelPivot implements IFormulaContext.Pivot {
17
+ private readonly _wasm;
18
+ private readonly _request;
19
+ private readonly _result;
20
+ private readonly _createColumn;
21
+ private readonly _recordCount;
22
+ /** The records, kept or not: every key and value column is this tall. */
23
+ private readonly _n;
24
+ private readonly _rows;
25
+ private readonly _columns;
26
+ /** Per column group, each row group's crossing with it; `Unset` where no record is in both. */
27
+ private readonly _cellsByColumn;
28
+ private readonly _errors;
29
+ private readonly _values;
30
+ private _leafCount;
31
+ /** The pass that kept each crossing's records, once members were asked for. */
32
+ private _withRecords;
33
+ /**
34
+ * The kernel's pivot of the keys.
35
+ *
36
+ * @throws `#VALUE!` when the kernel refuses them: more than {@link MaxFields} key columns on an
37
+ * axis, or more records, groups or crossings than it holds.
38
+ */
39
+ static create(rows: IRange | null, columns: IRange | null, createColumn: MemberColumnFactory, options?: IFormulaContext.PivotOptions): KernelPivot;
40
+ private static _addFields;
41
+ private static _fillFields;
42
+ private constructor();
43
+ /** @inheritdoc IFormulaContext.Pivot.getRecordCount */
44
+ getRecordCount(): number;
45
+ /** @inheritdoc IFormulaContext.Pivot.getRows */
46
+ getRows(): IFormulaContext.PivotAxis;
47
+ /** @inheritdoc IFormulaContext.Pivot.getColumns */
48
+ getColumns(): IFormulaContext.PivotAxis;
49
+ /** @inheritdoc IFormulaContext.Pivot.getMembers */
50
+ getMembers(values: IRange, row?: IFormulaContext.PivotGroup, column?: IFormulaContext.PivotGroup): IRange | null;
51
+ /** @inheritdoc IFormulaContext.Pivot.getAggregate */
52
+ getAggregate(values: IRange, fn: IFunction, row?: IFormulaContext.PivotGroup, column?: IFormulaContext.PivotGroup): Scalar | null | undefined;
53
+ /** The crossing of a row group and a column group, `Unset` where no record is in both. */
54
+ private _cell;
55
+ private _buffer;
56
+ private _addValues;
57
+ /**
58
+ * One pass for one reducer: per crossing its result. The kernel numbers the crossings the same
59
+ * way on every pass over the same keys, so they index the first pass's.
60
+ */
61
+ private _run;
62
+ }
63
+ //# sourceMappingURL=KernelPivot.d.ts.map
@@ -0,0 +1,100 @@
1
+ import { FormulaError, IRange, Scalar } from '@sheetxl/primitives';
2
+ import { MixedTypedArrayList } from '../../collections/MixedTypedArrayList';
3
+ import { SdkWasmExports } from '../../wasm/sdkWasm';
4
+ export type Request = InstanceType<SdkWasmExports['PivotRequest']>;
5
+ export declare const Type: {
6
+ readonly Blank: 0;
7
+ readonly False: 1;
8
+ readonly True: 2;
9
+ readonly Int32: 3;
10
+ readonly Float64: 4;
11
+ readonly String: 5;
12
+ readonly Error: 6;
13
+ readonly Rich: 7;
14
+ };
15
+ /** Every type a value leaf may hold: width 8 and a type byte per value. */
16
+ export declare const AllTypes = 127;
17
+ export declare const Unset = 4294967295;
18
+ /** The words of one node in the binding's flattened tree: parent, item, depth, first record, records. */
19
+ export declare const NodeStride = 5;
20
+ /** The kernel's reducer (its index in `Reducer::ALL`) for each built-in it computes. */
21
+ export declare const ReducerOf: Readonly<Record<string, number>>;
22
+ /** The variances read a column of numbers only: their sdk functions coerce a logical or text member. */
23
+ export declare const FirstVariance = 7;
24
+ /** The error code a division by zero is stored as: the first entry of every error table. */
25
+ export declare const Div0Code = 0;
26
+ /**
27
+ * Item ids for one key field, by the rule {@link defaultFrequencyKey} keys a group by (`UNIQUE`'s):
28
+ * equal ids, equal keys. Id 0 is the blank, so an unwritten id reads as one.
29
+ */
30
+ export declare class Items {
31
+ private _next;
32
+ private readonly _numbers;
33
+ private readonly _keys;
34
+ /** Per codec, a string id's item, so a pool string is folded once, not once per record. */
35
+ private readonly _strings;
36
+ /** Each id's value, as first met; id 0 is the blank. */
37
+ readonly values: Scalar[];
38
+ of(value: Scalar | undefined): number;
39
+ /** Writes the ids of a range's values into `ids`, one per record. */
40
+ fill(range: IRange, ids: Uint32Array): void;
41
+ private _number;
42
+ private _run;
43
+ }
44
+ /** The errors a value leaf stores by code; code 0 is `#DIV/0!`. */
45
+ export declare class Errors {
46
+ readonly table: FormulaError.Known[];
47
+ private readonly _codes;
48
+ codeOf(error: FormulaError.Known): number;
49
+ }
50
+ /** A value column in the request: its leaf, what it holds, and the results asked of it so far. */
51
+ export interface ValueColumn {
52
+ readonly leaf: number;
53
+ /** No member is text or a logical. */
54
+ readonly numeric: boolean;
55
+ /** Per reducer, per group, then the grand total last. */
56
+ readonly results: (Scalar[] | undefined)[];
57
+ }
58
+ /**
59
+ * The views a value leaf of every type is written through: width 8, so an `int32` is the low word
60
+ * of its slot.
61
+ */
62
+ export interface LeafViews {
63
+ readonly doubles: Float64Array;
64
+ readonly ints: Int32Array;
65
+ readonly types: Uint8Array;
66
+ }
67
+ /**
68
+ * Writes a range's values into a value leaf, or answers `false` at the first one a leaf cannot
69
+ * hold (a rich value, a lambda).
70
+ */
71
+ export declare const writeValues: (range: IRange, views: LeafViews, errors: Errors) => {
72
+ ok: boolean;
73
+ numeric: boolean;
74
+ };
75
+ /**
76
+ * Writes one value into a value leaf at record `r`, clearing `written.ok` for a value a leaf
77
+ * cannot hold (a rich value, a lambda) and `written.numeric` for text or a logical.
78
+ */
79
+ export declare const writeValue: (views: LeafViews, r: number, value: Scalar | undefined, errors: Errors, written: {
80
+ ok: boolean;
81
+ numeric: boolean;
82
+ }) => void;
83
+ /**
84
+ * The handle of a leaf the kernel allocated: its layout follows from its length and type mask, as
85
+ * `MixedTypedArrayList` lays one out.
86
+ */
87
+ export declare const handleOf: (buffer: ArrayBufferLike, byteOffset: number, length: number, typeMask: number) => MixedTypedArrayList.Handle;
88
+ /** A result leaf the kernel returned: where it is and what it holds. */
89
+ export interface ResultLeaf {
90
+ ptr(): number;
91
+ length(): number;
92
+ type_mask(): number;
93
+ }
94
+ /**
95
+ * A reader of a result leaf, read in place in the WebAssembly's memory: valid until the leaf is
96
+ * freed or the memory grows. A number past the double range is `#NUM!`, as any function's
97
+ * non-finite result is.
98
+ */
99
+ export declare const readLeaf: (buffer: ArrayBufferLike, leaf: ResultLeaf, errors: Errors) => (index: number) => Scalar;
100
+ //# sourceMappingURL=_KernelLeaves.d.ts.map
@@ -0,0 +1,71 @@
1
+ import { IFormulaContext, IRange, Scalar } from '@sheetxl/primitives';
2
+ /**
3
+ * Builds the column a group's members come back in: `size` rows, with `values[i]` at `rows[i]`
4
+ * and every other row blank.
5
+ * @internal
6
+ */
7
+ export type MemberColumnFactory = (size: number, rows: ArrayLike<number>, values: ArrayLike<Scalar>, count: number) => IRange;
8
+ /**
9
+ * One axis of a pivot, from the arrays its builder filled: per group its parent, level, first
10
+ * record and size. Group objects are made on first ask; keys are read from the key columns then.
11
+ * @internal
12
+ */
13
+ export declare class PivotAxisTree implements IFormulaContext.PivotAxis {
14
+ private readonly _keys;
15
+ private readonly _parents;
16
+ private readonly _levels;
17
+ private readonly _firsts;
18
+ private readonly _sizes;
19
+ private readonly _groups;
20
+ private _children;
21
+ private readonly _keyRows;
22
+ constructor(keys: IRange | null, parents: ArrayLike<number>, levels: ArrayLike<number>, firsts: ArrayLike<number>, sizes: ArrayLike<number>);
23
+ /** @inheritdoc IFormulaContext.PivotAxis.getRoot */
24
+ getRoot(): IFormulaContext.PivotGroup;
25
+ /** @inheritdoc IFormulaContext.PivotAxis.getGroupCount */
26
+ getGroupCount(): number;
27
+ /** The group numbered `id`, the root being `0`. */
28
+ group(id: number): PivotTreeGroup;
29
+ levelOf(id: number): number;
30
+ parentOf(id: number): PivotTreeGroup | null;
31
+ childrenOf(id: number): readonly PivotTreeGroup[];
32
+ keysOf(id: number): readonly Scalar[];
33
+ sizeOf(id: number): number;
34
+ firstRecordOf(id: number): number;
35
+ }
36
+ /**
37
+ * A group of a {@link PivotAxisTree}, by its number.
38
+ * @internal
39
+ */
40
+ export declare class PivotTreeGroup implements IFormulaContext.PivotGroup {
41
+ private readonly _tree;
42
+ /** The group's number on its axis, the root being `0`. */
43
+ readonly id: number;
44
+ constructor(_tree: PivotAxisTree,
45
+ /** The group's number on its axis, the root being `0`. */
46
+ id: number);
47
+ /** @inheritdoc IFormulaContext.PivotGroup.getLevel */
48
+ getLevel(): number;
49
+ /** @inheritdoc IFormulaContext.PivotGroup.getParent */
50
+ getParent(): IFormulaContext.PivotGroup | null;
51
+ /** @inheritdoc IFormulaContext.PivotGroup.getChildren */
52
+ getChildren(): readonly IFormulaContext.PivotGroup[];
53
+ /** @inheritdoc IFormulaContext.PivotGroup.getKeys */
54
+ getKeys(): readonly Scalar[];
55
+ /** @inheritdoc IFormulaContext.PivotGroup.getSize */
56
+ getSize(): number;
57
+ /** @inheritdoc IFormulaContext.PivotGroup.getFirstRecord */
58
+ getFirstRecord(): number;
59
+ }
60
+ /**
61
+ * The number of a group passed to a pivot: `0`, the root, when omitted.
62
+ * @internal
63
+ */
64
+ export declare const groupId: (group: IFormulaContext.PivotGroup | undefined) => number;
65
+ /**
66
+ * The members of `values` at `records`, one row per record, as {@link MemberColumnFactory}
67
+ * builds a column: only the non-blank ones are written.
68
+ * @internal
69
+ */
70
+ export declare const membersAt: (values: IRange, records: ArrayLike<number>, createColumn: MemberColumnFactory) => IRange;
71
+ //# sourceMappingURL=_PivotAxisTree.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { IRange, FormulaError, ScalarType, MaybeError, Scalar, IRangeStats, IRuntime } from '@sheetxl/primitives';
2
- import { Tuple, IGrid, ISparseGrid, ISpatialMap } from '../collections';
2
+ import { Tuple, IGrid, ISparseGrid, ISpatialMap, IListLike } from '../collections';
3
3
  export declare class Range<T extends Scalar = Scalar> implements IRange<T> {
4
4
  protected _runtime: IRuntime;
5
5
  protected _values: ISparseGrid<Scalar>;
@@ -66,6 +66,17 @@ export declare class Range<T extends Scalar = Scalar> implements IRange<T> {
66
66
  * @internal
67
67
  */
68
68
  _materializeEmpty(): this;
69
+ /**
70
+ * Visits a one-column range's stored values leaf by leaf, for a reader that loops typed leaves
71
+ * rather than entries: `visit(row, list, from, to)` covers the range's rows `row` to
72
+ * `row + to - from` with `list.at(from)` to `list.at(to)`, where `list` is never an
73
+ * `ImmutableList` (its leaves are visited instead). A row no leaf covers is blank.
74
+ *
75
+ * @returns `false`, having visited nothing, when the range is not one column of a column-major
76
+ * grid or reads with skips; read its entries instead.
77
+ * @internal
78
+ */
79
+ _visitColumnRuns(visit: (row: number, list: IListLike<Scalar>, from: number, to: number) => void): boolean;
69
80
  /** @inheritdoc IRange.filter */
70
81
  filter<TS extends Scalar = T>(callbackFn: (value: TS, coords: IRange.CellCoords, range: IRange<T>) => boolean, options?: IRange.IteratorOptions): this;
71
82
  /** @inheritdoc IRange.firstError */
@@ -28,6 +28,7 @@ import { IModule, IModuleCollection } from '../scripting';
28
28
  import { IChartCollection } from '../chart';
29
29
  import { INamedCollection } from '../named';
30
30
  import { ICalculation } from '../calculation';
31
+ import { IFontCollection } from '../font';
31
32
  import { IWorksheetView } from '../sheetView';
32
33
  import { ISheetHeader } from '../sheetHeader';
33
34
  import { IWorksheetProtection } from '../sheetProtection';
@@ -578,6 +579,14 @@ export interface IWorksheet extends ISheet, ITransaction.ITransactional, IListen
578
579
  * own sheet).
579
580
  */
580
581
  getCalculation(): ICalculation;
582
+ /**
583
+ * Returns the {@link IFontCollection} the sheet measures text with.
584
+ *
585
+ * @remarks
586
+ * Fonts are shared: every sheet, with or without a workbook, returns the same collection, so a
587
+ * face loaded for one is loaded for all.
588
+ */
589
+ getFonts(): IFontCollection;
581
590
  /**
582
591
  * Recalculates THIS sheet — Excel's "Calculate Sheet" (Shift+F9) / `Worksheet.Calculate`.
583
592
  *
@@ -614,6 +623,25 @@ export interface IWorksheet extends ISheet, ITransaction.ITransactional, IListen
614
623
  * it has not been started.
615
624
  */
616
625
  whenCalculationReady(): Promise<ICalculation.Status>;
626
+ /**
627
+ * Returns when every font the sheet measures with has loaded and every autofit that was taken
628
+ * with a stand-in meanwhile has been taken again.
629
+ *
630
+ * @remarks
631
+ * Measuring never waits: a style naming a face not yet loaded measures with a related or
632
+ * built-in one and the lookup starts the load, the way a browser paints with a fallback until
633
+ * a web font arrives. This is the point after which sizes are final. Fonts are shared, so this
634
+ * also waits for faces other sheets and workbooks started loading; a load that fails leaves its
635
+ * stand-in and still settles.
636
+ *
637
+ * The same point as {@link IWorkbook.whenFontsReady}; a sheet without a workbook has it here.
638
+ */
639
+ whenFontsReady(): Promise<void>;
640
+ /**
641
+ * Returns when the sheet is settled: {@link whenCalculationReady} and {@link whenFontsReady}
642
+ * both hold.
643
+ */
644
+ whenReady(): Promise<void>;
617
645
  /**
618
646
  * Returns the {@link IWorkbook} for the sheet.
619
647
  *
@@ -952,6 +980,13 @@ export declare namespace IWorksheet {
952
980
  * Called when any table are added or removed.
953
981
  */
954
982
  onTablesChange?(source: IWorksheet): void;
983
+ /**
984
+ * Called when a pivot table changes: its style, its layout, or where it sits.
985
+ *
986
+ * @remarks
987
+ * Always accompanied by the coarse {@link onStyleChange}.
988
+ */
989
+ onPivotTablesChange?(source: IWorksheet): void;
955
990
  /**
956
991
  * Called when any data validation is added, removed, re-anchored, or re-evaluates its results.
957
992
  *
@@ -5,8 +5,6 @@ import { IProperties, ITypes } from '../type';
5
5
  import { NumberFormat } from '../numFmt';
6
6
  import { ITextFrame, IRichText } from '../text';
7
7
  import { IRichDataKind } from '../richData/IRichDataKind';
8
- import { ITable } from '../table';
9
- import { IDataValidation } from '../dataValidation';
10
8
  import { IHyperlink } from '../hyperlink';
11
9
  import { ICalculation } from '../calculation';
12
10
  import { IComment } from '../comment';
@@ -22,6 +20,7 @@ import { CellStyleUpdater } from './style/SheetCellStyle';
22
20
  import { ICalcGrid } from '../calculation/grid';
23
21
  import { IConditionalFormat } from '../conditionalFormat';
24
22
  import { ICellControl } from '../cellControl/ICellControl';
23
+ import { PivotLabelInset } from '../pivot/_PivotControls';
25
24
  /**
26
25
  * CellModifiers with all functions removed and all properties set and a type.
27
26
  */
@@ -67,12 +66,19 @@ isParsingCustom?: boolean, destination?: IRange.CellCoords | null, quotePrefixOn
67
66
  */
68
67
  export declare function csConditionalDecorations(conditionals: IConditionalFormat | IConditionalFormat[] | null | undefined, rowIndex: number, colIndex: number, value: Scalar, getStyle: () => ICellStyle): Readonly<IConditionalFormat.Decorations>;
69
68
  export declare const csIconGutter: (style: ICellStyle) => number;
69
+ /**
70
+ * What a pivot label's leading inset adds to the one its style gives it: the label is set in by its
71
+ * table ({@link pivotLabelLayoutOf}), not by the indent in its format, so this replaces that indent
72
+ * with the table's level and box. Read the same way by {@link SheetCell.getInsets}, autoFit and the
73
+ * overflow walk.
74
+ */
75
+ export declare const csPivotLead: (type: ScalarType, style: ICellStyle, label: PivotLabelInset) => number;
70
76
  export declare function csOverflowable(type: ScalarType, style: ICellStyle, prev?: boolean, next?: boolean): boolean;
71
77
  /**
72
78
  * Updates the overflow calc and returns a range if overflowed
73
79
  * @internal
74
80
  */
75
- export declare function calcTextOverflow(rowIndex: number, colIndex: number, type: ScalarType, style: ICellStyle, value: Scalar, prev: IRange.CellCoords | null, next: IRange.CellCoords | null, continuousCoords: IRange.Coords | null, cellOptions: SheetCellOptions): ICell.HorizontalOverflow | null;
81
+ export declare function calcTextOverflow(rowIndex: number, colIndex: number, type: ScalarType, style: ICellStyle, value: Scalar, prev: IRange.CellCoords | null, next: IRange.CellCoords | null, continuousCoords: IRange.Coords | null, cellOptions: SheetCellOptions, leading?: number): ICell.HorizontalOverflow | null;
76
82
  /** Guaranteed to never return null */
77
83
  export declare function csStyle(value: Scalar, range: IRange.Coords | null, intersection: RangeState.Intersection | null, options: SheetCellOptions, direct: boolean,
78
84
  /**
@@ -193,7 +199,6 @@ export declare class SheetCell implements ICell {
193
199
  protected _v: Scalar;
194
200
  protected _d: Date | null | undefined;
195
201
  protected _dfmt: string | null;
196
- protected _column: ITable.IColumn | null | undefined;
197
202
  protected _cd: Readonly<IConditionalFormat.Decorations> | undefined;
198
203
  protected _s: ICellStyle | undefined;
199
204
  protected _sd: ICellStyle | undefined;
@@ -229,12 +234,6 @@ export declare class SheetCell implements ICell {
229
234
  * @internal
230
235
  */
231
236
  _openAddress(address: string, options: ITypes.SelectOptions | null, target?: string, features?: string): Promise<boolean>;
232
- /** {@inheritDoc ICell.getColumn} */
233
- getColumn(): ITable.IColumn | null;
234
- /** {@inheritDoc ICell.getTable} */
235
- getTable(): ITable | null;
236
- /** {@inheritDoc ICell.getDataValidation} */
237
- getDataValidation(): IDataValidation | null;
238
237
  /** {@inheritDoc ICell.getConditionalDecorations} */
239
238
  getConditionalDecorations(): Readonly<IConditionalFormat.Decorations>;
240
239
  /** {@inheritDoc ICell.getControl} */
@@ -260,14 +259,22 @@ export declare class SheetCell implements ICell {
260
259
  /** {@inheritDoc ICell.getInsets} */
261
260
  getInsets(): Rectangle;
262
261
  /**
263
- * The leading-edge width this cell's icon-set decoration reserves, or `0` for a cell without one.
262
+ * The leading-edge width this cell's icon-set decoration reserves, and what its pivot table's
263
+ * level and expand/collapse box add; `0` for a cell with neither.
264
264
  *
265
265
  * @remarks
266
- * See {@link csIconGutter} for what the reservation is made of. Every measurement of the cell —
267
- * insets, best-fit, the editor's caret — reads it from here, so they cannot disagree with the
268
- * icon layer, which places the icon from the same two style numbers.
266
+ * See {@link csIconGutter} and {@link csPivotLead} for what the reservation is made of. Every
267
+ * measurement of the cell — insets, best-fit, overflow, the editor's caret — reads it from here,
268
+ * so they cannot disagree with the icon layer or the pivot layer, which place their marks from
269
+ * the same style numbers. A pivot label keeps the box's gutter whether or not it has a box, as
270
+ * Excel lines up a level's labels.
269
271
  */
270
272
  protected _iconGutter(): number;
273
+ /**
274
+ * How this cell is set in as a label of the pivot table placed over it: its level's indent and
275
+ * whether it keeps a box's gutter; `null` for a cell that is not one.
276
+ */
277
+ protected _pivotLabel(): PivotLabelInset | null;
271
278
  /** {@inheritDoc ICell.getTextFrame} */
272
279
  getTextFrame(showFormula?: boolean): ITextFrame | null;
273
280
  /** {@inheritDoc ICell.getTextPlacement} */
@@ -7,6 +7,7 @@ import { ICellRange, ICellRegions, ICellRanges, ICellHeaderRange } from '../cell
7
7
  import { IComment, ICommentCollection } from '../comment';
8
8
  import { ICellStyle } from '../style';
9
9
  import { ITable, ITableCollection } from '../table';
10
+ import { IPivotTable } from '../pivot';
10
11
  import { IMovable, IMovableCollection } from '../movable';
11
12
  import { IHyperlink } from '../hyperlink';
12
13
  import { IRichText } from '../text';
@@ -353,6 +354,8 @@ export declare class SheetRange implements ICellRange {
353
354
  getComments(options?: ICellRange.GetItemsOptions<ICommentCollection.GetItemsOptions>): IComment[];
354
355
  /** {@inheritDoc ICellRange.getTables} */
355
356
  getTables(options?: ICellRange.GetItemsOptions<ITableCollection.GetItemsOptions>): ITable[];
357
+ /** {@inheritDoc ICellRange.getPivotTables} */
358
+ getPivotTables(): IPivotTable[];
356
359
  /** {@inheritDoc ICellRange.getMovables} */
357
360
  getMovables(options?: ICellRange.GetItemsOptions<IMovableCollection.GetItemsOptions>): IMovable[];
358
361
  /** {@inheritDoc ICellRange.getSnapshot} */