@sheetxl/io-xlsx 0.8.0-beta.2 → 0.8.0-beta.20

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 (217) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/Bw35-W8cnzxxvqQy.mjs +104 -0
  3. package/browser/esm/{CMHb6pUUmsCP9r_9.mjs → C16bEh6IrUpJONhS.mjs} +3 -3
  4. package/browser/esm/CPK1-z95jtLOfCXG.mjs +2474 -0
  5. package/browser/esm/CSOuRlSN9bhykqDr.mjs +4627 -0
  6. package/browser/esm/{DhqYgh9G2vLn7mIE.mjs → D2872f7aTugYxhht.mjs} +3 -3
  7. package/browser/esm/D7ogsrtXfjU5NW7r.mjs +10312 -0
  8. package/browser/esm/D8CQKL3Y3CMFOPqD.mjs +7007 -0
  9. package/browser/esm/{CMzkLUwbgA73RvCb.mjs → DpPFQ7-tBwVyjvWr.mjs} +3 -3
  10. package/browser/esm/{IZf0hIeLYj3T0Xvu.mjs → PgUWs0pPSCSFYJtU.mjs} +194 -144
  11. package/browser/esm/RFSuXvJ9sgsaA2LC.mjs +2433 -0
  12. package/browser/esm/{_UDbQq5-pHbU1f82.mjs → S4Uq85YdUb6O5Pz0.mjs} +2 -2
  13. package/browser/esm/index.mjs +3 -4
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/BOAucs-qLpjtUOcZ.mjs +6957 -0
  16. package/node/esm/{CY-pSutJLHskZfXZ.mjs → BSHqfcsR9hY-JB30.mjs} +2 -2
  17. package/node/esm/{CB1ijGbhl-e2l6Mm.mjs → C6eSWtTkyDQKbQdT.mjs} +3 -3
  18. package/node/esm/{Bi_kZVtZams7taqa.mjs → CPhiu1T7tl-leKh2.mjs} +3 -3
  19. package/node/esm/D2vDZOgLcv-YiWnB.mjs +4741 -0
  20. package/node/esm/DFw0ibBUmPyd-wey.mjs +2479 -0
  21. package/node/esm/DGuQIj077oygCTGu.mjs +2562 -0
  22. package/node/esm/Qn2Bv4QG3mOLiJHh.mjs +7269 -0
  23. package/node/esm/index.mjs +65 -28
  24. package/package.json +8 -9
  25. package/types/src/AutoFilterRules.d.ts +85 -22
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +30 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  80. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  81. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  82. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +8 -3
  83. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  84. package/types/src/reader/domVisitors/CommentVisitor.d.ts +7 -2
  85. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  86. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +34 -1
  87. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  88. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  89. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
  90. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  91. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  92. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  93. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  94. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  95. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  96. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  97. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  98. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  99. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  101. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  102. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  103. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  104. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  105. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
  106. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  107. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  108. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  109. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  110. package/types/src/reader/domVisitors/index.d.ts +10 -36
  111. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  112. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  113. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  114. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  115. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  116. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  117. package/types/src/richValue/RichDataParts.d.ts +69 -0
  118. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  119. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  120. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  121. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  122. package/types/src/richValue/index.d.ts +7 -0
  123. package/types/src/utils/DrawingMLText.d.ts +39 -0
  124. package/types/src/utils/FormControls.d.ts +170 -0
  125. package/types/src/utils/SharedNames.d.ts +13 -0
  126. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  127. package/types/src/utils/VmlNoteShapes.d.ts +88 -35
  128. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  129. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  130. package/types/src/vba/VBAProject.d.ts +0 -19
  131. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  132. package/types/src/writer/builder/Emitter.d.ts +5 -0
  133. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  134. package/types/src/writer/builder/PackageBuilder.d.ts +4 -41
  135. package/types/src/writer/builder/Types.d.ts +28 -28
  136. package/types/src/writer/emitters/CommentsEmitter.d.ts +10 -4
  137. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  138. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  139. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  140. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  141. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  142. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  143. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  144. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  145. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  146. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  147. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  148. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  149. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  150. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  151. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  152. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  153. package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +7 -1
  154. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  155. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  156. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  157. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  158. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  159. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  160. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  161. package/types/src/writer/utils/DrawMLUtils.d.ts +42 -3
  162. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  163. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  164. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  165. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  166. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  167. package/types/src/writer/utils/TextUtils.d.ts +26 -2
  168. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  169. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  170. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  171. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  172. package/browser/cjs/BzOEBR0jaxXg9wvt.cjs +0 -5
  173. package/browser/cjs/C8oC1tPbhgR0Dqtx.cjs +0 -2
  174. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  175. package/browser/cjs/Ca-xJDjg5bOpUPXX.cjs +0 -1
  176. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  177. package/browser/cjs/DULsYP_GcPGLVYSE.cjs +0 -11
  178. package/browser/cjs/DtBN3UOzNJjYBwJ6.cjs +0 -1
  179. package/browser/cjs/index.cjs +0 -1
  180. package/browser/cjs/sNZR19Wk-XQ2xZ9E.cjs +0 -1
  181. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  182. package/browser/esm/B9q618XELV7uWJsA.mjs +0 -67
  183. package/browser/esm/BwbMurFOptAFs7gC.mjs +0 -5214
  184. package/browser/esm/D75_rfogFUfXADKc.mjs +0 -3324
  185. package/browser/esm/DfuBawaydlvgZMR-.mjs +0 -4428
  186. package/browser/esm/DoMlKUCnMSlR2qX5.mjs +0 -159
  187. package/browser/esm/DtpWa7tZahylJ3HS.mjs +0 -2310
  188. package/node/esm/BD03jrMQ_UKA196-.mjs +0 -4535
  189. package/node/esm/BxHvzSROx_N_7nJH.mjs +0 -2356
  190. package/node/esm/CO1M1H1N6fB422K-.mjs +0 -2959
  191. package/node/esm/CWpezSa6TERGEv-B.mjs +0 -3410
  192. package/node/esm/Dezt2uIDqlxjiuk5.mjs +0 -170
  193. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  194. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  195. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  196. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  197. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  198. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  199. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  200. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  201. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  202. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  203. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
  204. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  205. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  206. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  207. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  208. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  209. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  210. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  211. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  212. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  213. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  214. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  215. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  216. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  217. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -0,0 +1,61 @@
1
+ import { IRichType, Scalar } from '@sheetxl/sdk';
2
+ import { RichPrimitiveType } from './IRichValueHandler';
3
+ /** A key of a structure or a bag structure: its name and type code (none for a number). */
4
+ export type RichStructureKey = readonly [name: string, type?: RichPrimitiveType | 'spba', defaultValue?: string];
5
+ /** A structure written: `<s t>` and its keys. @internal */
6
+ export interface RichValueStructureDef {
7
+ readonly structure: string;
8
+ readonly props: readonly RichStructureKey[];
9
+ }
10
+ /** An item of an array or a bag array: `<v t>`. */
11
+ export type RichItemText = readonly [type: string | undefined, text: string];
12
+ /** A `richStyles` entry. */
13
+ export interface RichStyleDef {
14
+ readonly numberFormat?: string;
15
+ readonly isTitle?: boolean;
16
+ readonly isHero?: boolean;
17
+ }
18
+ /**
19
+ * What the record writer writes into: the file's rich data tables. Every add answers the index
20
+ * the file names the entry by; equal entries share one.
21
+ *
22
+ * @internal
23
+ */
24
+ export interface RichValueSink {
25
+ /** The structure `t` with `keys`, added when new. */
26
+ structureFor(t: string, keys: readonly RichStructureKey[]): RichValueStructureDef;
27
+ /** An `<rv>`: its index in rdrichvalue.xml. */
28
+ addValue(structure: RichValueStructureDef, values: readonly string[], fb?: string): number;
29
+ /** An `<rv>` for a value a handler writes (an error, a picture), or `null`. */
30
+ addHandled(value: Scalar): number | null;
31
+ /** An `<a>` of rdarray.xml. */
32
+ addArray(rows: number, columns: number, items: readonly RichItemText[]): number;
33
+ /** An `<spb>`. */
34
+ addBag(keys: readonly RichStructureKey[], values: readonly string[]): number;
35
+ /** An `<a>` of the bags' `spbArrays`. */
36
+ addBagArray(items: readonly RichItemText[]): number;
37
+ /** A `richStyles` entry, 1-based as bags name them. */
38
+ addRichStyle(style: RichStyleDef): number;
39
+ /** A key's flags for the structure type `t`. */
40
+ addKeyFlags(t: string, key: string, flags: readonly (readonly [name: string, value: string])[]): void;
41
+ }
42
+ /** What a kind is a kind of: its name up to the digest (`_linkedentitycore:3f…` → `_linkedentitycore`). */
43
+ export declare const baseOfKind: (kind: IRichType) => string;
44
+ /**
45
+ * Writes rich values as Excel's rich data: records as `<rv>`s of their kind's structure, nested
46
+ * values by index, presentation back into Excel's bags.
47
+ *
48
+ * @remarks
49
+ * The inverse of `createRichValueResolver`. A key's type follows its kind's declared value type,
50
+ * so a number in a `rich` key is written as a `_formattednumber` carrying its format (geography)
51
+ * and a number in a number key takes its format from the record's `_Format` bag (finance). A full
52
+ * entity record is written with the form a cell or a parent names it by: the finance wrapper
53
+ * (`_linkedentity`, `%cvi`), or the geography stub (`_linkedentity2`) beside its full record.
54
+ *
55
+ * @internal
56
+ */
57
+ export declare const createRichRecordWriter: (sink: RichValueSink) => {
58
+ /** The `<rv>` a cell holding `value` names, or `null` when `value` is not one this writes. */
59
+ writeCell: (value: Scalar) => number | null;
60
+ };
61
+ //# sourceMappingURL=RichRecordWriter.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { Scalar } from '@sheetxl/sdk';
2
+ import { IRichValueHandler } from './IRichValueHandler';
3
+ /**
4
+ * The rich value handlers the xlsx reader and writer dispatch through: one per Excel structure
5
+ * type, found by the structure when reading and by the value when writing.
6
+ *
7
+ * @internal
8
+ */
9
+ export declare namespace RichValueHandlers {
10
+ /**
11
+ * Adds a handler, replacing one for the same structure. Where several write one kind, the one
12
+ * registered last that {@link IRichValueHandler.writes} the value writes it.
13
+ */
14
+ function register(handler: IRichValueHandler): void;
15
+ /** Every handler, in registration order. */
16
+ function getAll(): IRichValueHandler[];
17
+ /** The handler that reads a structure type (`t=` on `<s>`), or `null`. */
18
+ function getByStructure(structure: string): IRichValueHandler | null;
19
+ /**
20
+ * The handler that writes a cell value: its kind's for a rich value; for an error with no kind
21
+ * of its own, `_error`. `null` when none does.
22
+ */
23
+ function getForValue(value: Scalar): IRichValueHandler | null;
24
+ }
25
+ //# sourceMappingURL=RichValueHandlers.d.ts.map
@@ -0,0 +1,54 @@
1
+ import { IRichData, Scalar } from '@sheetxl/sdk';
2
+ import { IRichValueReader } from './IRichValueHandler';
3
+ import { RichDataParts } from './RichDataParts';
4
+ /**
5
+ * The name base of a kind made from a supporting property bag structure. A rich value
6
+ * structure's kind is based on its `t`, which Excel never starts with `#`.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare const BAG_KIND_BASE = "#spb";
11
+ /**
12
+ * Excel's reserved presentation keys: read into {@link IRichMeta}, not held as values. The kind
13
+ * still declares them, in file order, so a value is written back with the structure it was read
14
+ * with.
15
+ *
16
+ * - `_Display`: the card (`^Order`, `TitleProperty`, `SubTitleProperty`), for the kind.
17
+ * - `_Icon`: the icon, for the kind.
18
+ * - `_Flags`: per property, where it is not offered (`ShowInCardView`, …).
19
+ * - `_Format`: per property, a `richStyles` entry (1-based): number format, title, hero image.
20
+ * - `_SubLabel`: per property, its caption.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare const META_KEYS: ReadonlySet<string>;
25
+ /**
26
+ * A property name as a bag key names it. Excel escapes a key that starts with a reserved character
27
+ * (`%`, `^`, a backtick) with a backtick: the `_Flags` bag names `%ProviderInfo` as `` `%ProviderInfo ``.
28
+ *
29
+ * @internal
30
+ */
31
+ export declare const unescapeBagKey: (key: string) => string;
32
+ /** A property name as a bag key, escaped as Excel escapes it ({@link unescapeBagKey}). @internal */
33
+ export declare const escapeBagKey: (name: string) => string;
34
+ /** What one file's rich values read as, by `<rv>` index. @internal */
35
+ export interface RichValueResolver {
36
+ /** The value a cell naming `<rv>` `index` holds: an error, a rich value's JSON, or `undefined`. */
37
+ cellValue(index: number): Scalar | IRichData.JSON | undefined;
38
+ }
39
+ /**
40
+ * Reads a file's rich values into cell values.
41
+ *
42
+ * @remarks
43
+ * A structure a handler reads (`_error`, `_webimage`, `_localImage`) is read by it. Every other
44
+ * structure is a {@link RichRecord} of a kind made from the structure; supporting property bags
45
+ * become records of their own, Excel's presentation keys ({@link META_KEYS}) become meta, and an
46
+ * entity's two forms are one value: a cell holds the full record (Excel's `_linkedentity` names it
47
+ * by `%cvi`; a `_linkedentity2` stub matches its `_linkedentity2core` by identity), and a nested
48
+ * entity with no full record holds its stub. A `_formattednumber` inside a record is a number,
49
+ * its format the property's.
50
+ *
51
+ * @internal
52
+ */
53
+ export declare const createRichValueResolver: (parts: RichDataParts, readers: ReadonlyMap<string, IRichValueReader>, warn: (message: string) => void) => RichValueResolver;
54
+ //# sourceMappingURL=RichValueResolver.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { IResource } from '@sheetxl/sdk';
2
+ import { IRichValueHandler, RichValueReadContext } from './IRichValueHandler';
3
+ /** The part listing the pictures `_webimage` rich values name, by position. */
4
+ export declare const WEB_IMAGES_PART = "/xl/richData/rdRichValueWebImage.xml";
5
+ /** One `<webImageSrd>`: where a picture came from, and the picture Excel kept. */
6
+ export interface WebImage {
7
+ /** The source URL (`address`), or `null` when the file names none. */
8
+ source: string | null;
9
+ /** The kept picture (`blip`), or `null`. */
10
+ bytes: ArrayBuffer | null;
11
+ }
12
+ /** A picture a `_webimage` written names: its source, and the resource holding its bytes. */
13
+ export interface WrittenWebImage {
14
+ source: string;
15
+ resource: IResource | null;
16
+ }
17
+ /**
18
+ * The pictures of rdRichValueWebImage.xml, in file order: a `_webimage`'s `WebImageIdentifier`
19
+ * indexes this list. Empty when the part is absent.
20
+ */
21
+ export declare const readWebImages: (ctx: RichValueReadContext) => WebImage[];
22
+ export declare const calcOriginOf: (formula: string | null) => number;
23
+ /**
24
+ * Excel's `_webimage` structure: a picture as a cell value (`IMAGE`), read as and written from an
25
+ * `image` value.
26
+ *
27
+ * @remarks
28
+ * The structure names its picture by position in rdRichValueWebImage.xml, which holds the source
29
+ * URL (`address`, an external hyperlink) and the picture Excel kept for it (`blip`, a media part).
30
+ * Reading adds each picture to the workbook as the resource its values hold; writing takes the
31
+ * bytes from the value's resource, else the workbook's fetch. Alt text, height and width have no
32
+ * key: Excel's file for them is unprobed.
33
+ *
34
+ * @internal
35
+ */
36
+ export declare const WebImageRichValueHandler: IRichValueHandler;
37
+ //# sourceMappingURL=WebImageRichValueHandler.d.ts.map
@@ -0,0 +1,7 @@
1
+ export * from './IRichValueHandler';
2
+ export * from './RichValueHandlers';
3
+ export { WEB_IMAGES_PART } from './WebImageRichValueHandler';
4
+ export * from './RichDataParts';
5
+ export * from './RichValueResolver';
6
+ export * from './RichRecordWriter';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { IFont, IShape, IText, ITextFrame } from '@sheetxl/sdk';
2
+ /**
3
+ * DrawingML's vocabulary for drawing text and shapes against SheetXL's: the attribute values a
4
+ * file states (`algn="ctr"`, `u="sng"`, `vert="eaVert"`) and the model values they read to.
5
+ *
6
+ * @remarks
7
+ * Every reader and writer of a `txBody`, a `cNvPr` or a drawing element goes through these
8
+ * tables, so a shape's text and a chart's title agree on what `center` is. A value neither side
9
+ * knows passes through unchanged: the file still reads back as written.
10
+ */
11
+ interface Vocabulary<M extends string> {
12
+ /** The model value for an attribute value. */
13
+ read(value: string): M;
14
+ /** The attribute value for a model value; `undefined` stays `undefined`. */
15
+ write(value: M | undefined): string | undefined;
16
+ }
17
+ /** The drawing element each kind of shape is written as, and reads from. */
18
+ export declare const SHAPE_TYPES: Readonly<Record<string, IShape.Type>>;
19
+ /** `pPr/@algn`. */
20
+ export declare const paragraphAlignment: Vocabulary<IText.ParagraphAlignment>;
21
+ /** `pPr/@fontAlgn`. */
22
+ export declare const fontAlignment: Vocabulary<IText.FontAlignment>;
23
+ /** `bodyPr/@anchor`. */
24
+ export declare const anchor: Vocabulary<ITextFrame.VerticalAlignment>;
25
+ /** `rPr/@u`. */
26
+ export declare const underline: Vocabulary<IFont.UnderlineStyle>;
27
+ /** `rPr/@strike`. */
28
+ export declare const strike: Vocabulary<IFont.StrikeStyle>;
29
+ /** `bodyPr/@vert`. */
30
+ export declare const writingMode: Vocabulary<ITextFrame.WritingMode>;
31
+ /** `bodyPr/@vertOverflow` and `@horzOverflow`. */
32
+ export declare const overflow: Vocabulary<ITextFrame.Overflow>;
33
+ /** `tab/@algn`. */
34
+ export declare const tabAlignment: Vocabulary<ITextFrame.TabStopAlignment>;
35
+ /** `latin/@charset` and its kin: a signed byte in the file, the `0-255` `LOGFONT` value in the model. */
36
+ export declare const readCharset: (value: string) => IFont.Charset | undefined;
37
+ export declare const writeCharset: (value: IFont.Charset | undefined) => string | undefined;
38
+ export {};
39
+ //# sourceMappingURL=DrawingMLText.d.ts.map
@@ -0,0 +1,170 @@
1
+ import { IFormControl, ICaptioned, IAnchored, Bounds, IMovable, IWorksheet, ITextFrame } from '@sheetxl/sdk';
2
+ /**
3
+ * A form control as Excel stores it, in and out of the model's form-control content types.
4
+ *
5
+ * @remarks
6
+ * Excel writes one control three times: a `ctrlProp` part (`<formControlPr>`) says what it is
7
+ * and what it holds; a shape in the sheet's VML draws it for Excel 2007; and a hidden `<xdr:sp>`
8
+ * in the drawing part — the *twin*, joined to the control by `a14:compatExt/@spid` — carries the
9
+ * caption and its font for Excel 2010 and later. The model holds one content per control, typed
10
+ * by kind ({@link IFormControl.Type}), and this module turns it into, and out of, all three.
11
+ *
12
+ * Excel 2010 and later read only the `<controls>` entry, the part and the twin: the VML shape is
13
+ * an echo they ignore and regenerate (its `<x:Checked>`, its caption, even its absence). So the
14
+ * shape is never carried: the reader takes it out of the sheet's VML, and the writer draws a new
15
+ * one from the model for the consumers that still read it (Excel 2007, LibreOffice). A file
16
+ * Excel 2007 wrote has no part and no `<controls>` entry at all, only the shape; that shape is
17
+ * read into a control ({@link readControlShape}) and written back in all three forms.
18
+ */
19
+ /** The x14 namespace the `ctrlProp` part declares. */
20
+ export declare const NS_FORM_CONTROL = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main";
21
+ /** The content type of a `ctrlProp` part. */
22
+ export declare const CONTENT_TYPE_CTRL_PROP = "application/vnd.ms-excel.controlproperties+xml";
23
+ /** The relationship a `<control>` uses for its `ctrlProp` part. */
24
+ export declare const RELATIONSHIP_TYPE_CTRL_PROP = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp";
25
+ /** The content types that are form controls, and so are written as Excel's `<controls>`. */
26
+ export declare const FORM_CONTROL_TYPES: ReadonlySet<string>;
27
+ /** Whether a movable's content is a form control. */
28
+ export declare const isFormControlType: (type: string | undefined) => boolean;
29
+ /**
30
+ * Reads a `<formControlPr>`, as its attributes, its list items and its `extLst` markup, into a
31
+ * content type and that kind's fields.
32
+ */
33
+ export declare function readFormControlPr(attributes: Record<string, string>, items: readonly string[], extLst: string | undefined): {
34
+ type: string;
35
+ json: IFormControl.JSON;
36
+ };
37
+ /**
38
+ * Writes a control's fields as a `ctrlProp` part.
39
+ */
40
+ export declare function writeFormControlPr(type: string, control: IFormControl.JSON): string;
41
+ /**
42
+ * Lifts the `<controlPr>` attributes the model names out of the attribute bag.
43
+ */
44
+ export declare function liftControlPr(props: Record<string, string>, control: IFormControl.JSON): void;
45
+ /**
46
+ * The `<controlPr>` attributes, the lifted ones restored.
47
+ */
48
+ export declare function controlPrAttributes(control: IFormControl.JSON): Record<string, string | undefined>;
49
+ /**
50
+ * What a hidden twin's shape JSON carries until `absorbControlTwins` takes it: the VML shape id
51
+ * of the control it draws for.
52
+ */
53
+ export interface ControlTwinMarks {
54
+ twinOf?: number;
55
+ }
56
+ /** What the drawing's hidden twin says about a control. */
57
+ export interface ControlTwin {
58
+ caption?: string;
59
+ font?: ICaptioned.Font;
60
+ }
61
+ /**
62
+ * Reads the caption and its font off a twin's text: the caption is the text, the font is the
63
+ * first run's.
64
+ */
65
+ export declare function readControlTwin(text: ITextFrame.JSON | undefined): ControlTwin;
66
+ /**
67
+ * Joins each drawing twin to the control it draws for, and takes it off the sheet.
68
+ *
69
+ * @remarks
70
+ * The twin is read as a hidden shape of its own (`DrawingSpVisitor`, which marks it with
71
+ * {@link ControlTwinMarks}); here it becomes the control's caption and font, and is written back
72
+ * from those (`controlTwinShape`). A twin whose control was not read stays the hidden shape it was.
73
+ *
74
+ * A twin inside a group is the control's place in it: Excel draws a grouped control at its twin's
75
+ * frame in the group, and its `<controls>` anchor only restates that on the sheet. So the member
76
+ * becomes the control, and the control read from `<controls>` leaves the sheet.
77
+ */
78
+ export declare function absorbControlTwins(sheet: IWorksheet.JSON): void;
79
+ /**
80
+ * The hidden `<xdr:sp>` the drawing part carries for a control, written from the model.
81
+ *
82
+ * @remarks
83
+ * Hidden, so the drawing layer never shows it; its `cNvPr/@id` is the shape id, as Excel's own
84
+ * is. The caption's font is restated as Excel restates it: size, weight and style on the run,
85
+ * the color as a solid fill, the family as `latin`.
86
+ *
87
+ * On the sheet the twin hangs from its anchor and states no frame; in a group it is the control's
88
+ * place in the group, so `frame` (pixels, in the group's child space) is written.
89
+ */
90
+ export declare function controlTwinShape(type: string, json: IFormControl.JSON, name: string | undefined, frame?: Bounds): string;
91
+ /**
92
+ * A control the sheet writes, wherever it is: on the sheet, or a member of a group, with where
93
+ * it sits in cells.
94
+ */
95
+ export interface SheetControl {
96
+ /** The control's movable, as the sheet's JSON or its group's holds it. */
97
+ jsonMovable: IMovable.JSON;
98
+ /** Its corners in cells. */
99
+ anchor: IMovable.AnchorOffset;
100
+ /** How it moves and sizes with its cells. */
101
+ anchorType: IAnchored.Type;
102
+ }
103
+ /**
104
+ * The sheet's controls, each in its `<controls>` place.
105
+ *
106
+ * @remarks
107
+ * A control on the sheet is where its anchor says. A grouped control is wherever its group draws
108
+ * it, which only the live model knows, so its corners are found from its drawn bounds; it moves
109
+ * and sizes as its group does. The JSON's movables are the sheet's (less notes) in order, and a
110
+ * group's members its own, in order.
111
+ */
112
+ export declare function sheetControls(sheet: IWorksheet, json: IWorksheet.JSON): SheetControl[];
113
+ /** The attributes an `mc:AlternateContent` around a twin's anchor declares. */
114
+ export declare const TWIN_ALTERNATE_CONTENT_ATTRIBUTES: {
115
+ 'xmlns:mc': string;
116
+ };
117
+ /** The attributes the `mc:Choice` inside it declares. */
118
+ export declare const TWIN_CHOICE_ATTRIBUTES: {
119
+ 'xmlns:a14': string;
120
+ Requires: string;
121
+ };
122
+ /** The shape id a VML shape names, or `null`. */
123
+ export declare function vmlShapeId(shape: string): number | null;
124
+ /** Whether a VML shape draws a form control (and not a note or a picture). */
125
+ export declare function isVmlControlShape(shape: string): boolean;
126
+ /**
127
+ * The VML part with every control shape visited: `update` answers the shape to keep, or `null`
128
+ * to drop it. Shapes that draw something else are left as they are.
129
+ */
130
+ export declare function mapVmlControlShapes(xml: string, update: (shape: string, shapeId: number | null) => string | null): string;
131
+ /** The shapetype every control shape refers to, declared once per part. */
132
+ export declare const CONTROL_SHAPETYPE = "<v:shapetype id=\"_x0000_t201\" coordsize=\"21600,21600\" o:spt=\"201\"\n path=\"m,l,21600r21600,l21600,xe\">\n <v:stroke joinstyle=\"miter\"/>\n <v:path shadowok=\"f\" o:extrusionok=\"f\" strokeok=\"f\" fillok=\"f\" o:connecttype=\"rect\"/>\n <o:lock v:ext=\"edit\" shapetype=\"t\"/>\n </v:shapetype>";
133
+ /**
134
+ * Where a control shape is written.
135
+ */
136
+ export interface ControlShapePlacement {
137
+ /** The number in `_x0000_s{n}`: the control's own shape id. */
138
+ shapeId: number;
139
+ zIndex: number;
140
+ /** The eight numbers of `<x:Anchor>`. */
141
+ anchor: readonly number[];
142
+ /** The control in pixels, for the `style` echo. */
143
+ bounds: Bounds;
144
+ anchorType: IAnchored.Type;
145
+ }
146
+ /**
147
+ * The VML shape that draws a control for the consumers that still read one, written from the
148
+ * model.
149
+ *
150
+ * @remarks
151
+ * Excel's own spelling, child for child, of a control it draws fresh. `<x:MoveWithCells/>` and
152
+ * `<x:SizeWithCells/>` are inverted in VML: present means the control does *not* follow its
153
+ * cells. Returns `null` for a kind the VML has no name for.
154
+ */
155
+ export declare function writeControlShape(type: string, control: IFormControl.JSON, placement: ControlShapePlacement): string | null;
156
+ /**
157
+ * A control read from its VML shape alone, as Excel 2007 stores one: no part, no `<controls>`
158
+ * entry. `null` when the shape is not a control or names no anchor.
159
+ *
160
+ * @remarks
161
+ * The anchor's offsets are the authoring machine's pixels and are taken as they are.
162
+ */
163
+ export declare function readControlShape(shape: string, shapeId: number | null): IMovable.JSON | null;
164
+ /**
165
+ * Takes every control shape out of the sheet's VML: a shape whose control was read from the
166
+ * sheet is dropped (the writer draws a new one), and one with no control is read into one
167
+ * ({@link readControlShape}). A part left with no shapes is dropped with them.
168
+ */
169
+ export declare function absorbControlShapes(sheet: IWorksheet.JSON): void;
170
+ //# sourceMappingURL=FormControls.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { ICell } from '@sheetxl/sdk';
2
+ /**
3
+ * Names the reader and the writer both spell, kept here so neither imports the other (they load as
4
+ * separate lazy chunks).
5
+ */
6
+ /**
7
+ * The `<ignoredError>` check attributes, in the schema's order (the order Excel writes them). Only
8
+ * these nine are Excel's; any other `ICell.ErrorCheck` is not written to xlsx.
9
+ */
10
+ export declare const IGNORED_ERROR_CHECKS: readonly ICell.ErrorCheck[];
11
+ /** The 2012 theme extension that names the theme's family (`thm15:themeFamily`). */
12
+ export declare const THEME_FAMILY_EXT_URI = "{05A4C25C-085E-4340-85A3-A5531E510DB2}";
13
+ //# sourceMappingURL=SharedNames.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { IFont, IFontStyle, ITheme } from '@sheetxl/sdk';
2
+ /** Whether a family follows the theme. */
3
+ export declare function isThemeFamily(family: string | null | undefined): family is IFontStyle.ThemeFamily;
4
+ /** The model's family and fallbacks for a `<name>` (or `<rFont>`) and a `<scheme>`, in place. */
5
+ export declare function readFamily(font: {
6
+ family?: string;
7
+ fallbacks?: string[];
8
+ }, scheme: string | null | undefined): void;
9
+ /**
10
+ * The `<name>` and `<scheme>` a family is written as. A font that states no family is the theme's
11
+ * body font when it is a whole record (`whole`), and says nothing when it is differential. A theme
12
+ * font is named by the face cached for it, else by the theme's; with no `theme`, the name is the
13
+ * cached face alone.
14
+ */
15
+ export declare function writeFamily(family: string | undefined, fallbacks: readonly string[] | undefined, theme: ITheme | null, whole: boolean): {
16
+ name?: string;
17
+ scheme?: 'major' | 'minor';
18
+ };
19
+ /** The baseline a `vertAlign` stands for, or `undefined` for a value SpreadsheetML does not define. */
20
+ export declare function readBaseline(vertAlign: string | null | undefined): number | undefined;
21
+ /**
22
+ * The `vertAlign` a baseline is written as. A stated `0` is written as `baseline` only where the
23
+ * font is differential (a dxf, a run), where it undoes an inherited raise.
24
+ */
25
+ export declare function writeBaseline(baseline: number | null | undefined, differential: boolean): string | undefined;
26
+ /** The strike a `<strike>` toggle stands for. */
27
+ export declare function readStrike(on: boolean): IFont.StrikeStyle;
28
+ /** Whether a strike is written as `<strike/>`, or `undefined` when the font states none. */
29
+ export declare function writeStrike(strike: IFont.StrikeStyle | null | undefined): boolean | undefined;
30
+ /** The letter spacing `<condense/>` or `<extend/>` stands for, or `undefined` when it is off. */
31
+ export declare function readMacSpacing(name: 'condense' | 'extend', on: boolean): number | undefined;
32
+ /** The Macintosh style a letter spacing is written as, or `undefined` for none. */
33
+ export declare function writeMacSpacing(letterSpacing: number | null | undefined): 'condense' | 'extend' | undefined;
34
+ /** The underline a `<u val>` stands for; no `val` is a single underline. */
35
+ export declare function readUnderline(val: string | null | undefined): IFont.UnderlineStyle;
36
+ /** The `<u val>` an underline is written as, or `undefined` for none. */
37
+ export declare function writeUnderline(underline: IFont.UnderlineStyle | null | undefined): string | undefined;
38
+ //# sourceMappingURL=SpreadsheetFont.d.ts.map
@@ -1,23 +1,64 @@
1
- /**
2
- * The note boxes in a sheet's VML drawing: finding them, keeping them apart from the control
3
- * shapes that share the part, and writing them back beside the comment each belongs to.
4
- *
5
- * @remarks
6
- * A note's box is a `<v:shape>` whose `<x:ClientData ObjectType="Note">` names its cell in
7
- * `<x:Row>`/`<x:Column>` (0-based), and its corners in `<x:Anchor>` as four cell/offset pairs
8
- * (left cell, left offset, top cell, top offset, right cell, right offset, bottom cell, bottom
9
- * offset). Nothing else in the VML names a note, so the cell is the join to the comment.
10
- *
11
- * Excel writes the offsets in the authoring machine's pixels (PLAN-MODEL-HOMES §5), so on a move
12
- * only the cell halves of the anchor are rewritten, by the same delta the note's cell moved; the
13
- * offsets, the size and the absolute `style` are replayed as they were.
14
- */
1
+ import { NoteShapeStyle } from './VmlNoteStyle';
15
2
  /** A note shape as read: its markup and the cell it was on. */
16
3
  export interface NoteShape {
17
4
  xml: string;
18
5
  row: number;
19
6
  col: number;
20
7
  }
8
+ /**
9
+ * What a note shape says, apart from the cell it is on.
10
+ */
11
+ export interface NoteShapeBox {
12
+ /**
13
+ * The eight numbers of `<x:Anchor>`, or `null` when the shape has none that can be read.
14
+ */
15
+ anchor: number[] | null;
16
+ /**
17
+ * Where the `style` puts the box, in pixels from the sheet's top-left, when the shape has no
18
+ * anchor. Excel places such a box by its `style` alone: `margin-left` / `margin-top` and
19
+ * `width` / `height`, with no margin meaning 0 and no size meaning VML's 750pt.
20
+ */
21
+ bounds: {
22
+ x: number;
23
+ y: number;
24
+ width: number;
25
+ height: number;
26
+ } | null;
27
+ /** Whether the shape has `<x:Visible/>`: the box stays on the sheet. */
28
+ visible: boolean;
29
+ /** The shape's alternative text. */
30
+ alt: string | null;
31
+ /** The box's fill and line, where they are not Excel's default. */
32
+ style: NoteShapeStyle;
33
+ /**
34
+ * The shape without its id, position, cell, alternative text, fill or line, or `null` when
35
+ * that is Excel's default shape.
36
+ */
37
+ xml: string | null;
38
+ }
39
+ /**
40
+ * Where a note shape is written.
41
+ */
42
+ export interface NoteShapePlacement {
43
+ /** The number in `_x0000_s{n}`. */
44
+ shapeId: number;
45
+ zIndex: number;
46
+ /** 0-based. */
47
+ row: number;
48
+ /** 0-based. */
49
+ col: number;
50
+ /** The eight numbers of `<x:Anchor>`. */
51
+ anchor: readonly number[];
52
+ /** The box in pixels, for the `style` echo. */
53
+ bounds: {
54
+ x: number;
55
+ y: number;
56
+ width: number;
57
+ height: number;
58
+ };
59
+ visible: boolean;
60
+ alt?: string | null;
61
+ }
21
62
  /**
22
63
  * Splits the note shapes out of a VML part.
23
64
  *
@@ -35,41 +76,53 @@ export declare function splitNoteShapes(xml: string): {
35
76
  */
36
77
  export declare function hasShapes(xml: string): boolean;
37
78
  /**
38
- * A note shape rewritten for the cell its comment is on now.
79
+ * A note shape without what the model writes: its id, its anchor and the `style` that echoes
80
+ * it, its cell, whether it is shown and its alternative text. Whitespace between elements is
81
+ * dropped, so two shapes that say the same thing are the same string.
39
82
  *
40
- * @remarks
41
- * `<x:Row>`/`<x:Column>` are the cell restated, and are written from it. The anchor's cell
42
- * halves move by the delta from the cell the shape was read on, offsets untouched; a shape that
43
- * declares neither `<x:MoveWithCells/>` nor `<x:SizeWithCells/>` is pinned and its anchor is
44
- * left alone. The markup is returned as it was when nothing changed.
83
+ * @returns The markup, or `null` when it is not a shape.
45
84
  */
46
- export declare function withNoteCell(shape: NoteShape, row: number, col: number): string;
85
+ export declare function normalizeNoteShape(xml: string): string | null;
47
86
  /**
48
- * The largest shape number the part uses, so a synthesized shape can take the next.
87
+ * The shape Excel gives a note that has not been formatted, normalized.
49
88
  */
50
- export declare function maxShapeId(xml: string): number;
89
+ export declare const DEFAULT_NOTE_SHAPE: string;
90
+ /**
91
+ * Reads a note shape into what a note stores.
92
+ */
93
+ export declare function readNoteShape(xml: string): NoteShapeBox;
94
+ /** A pixel length in points, as Excel writes one: no trailing zeros. */
95
+ export declare const toPt: (px: number) => string;
51
96
  /**
52
- * A note box for a comment that has none: Excel's default — hidden until hovered, two columns
53
- * wide and four rows tall, hung to the right of the cell — with the shape's own row and column.
97
+ * A note shape for a comment: the markup it carries, or Excel's default, with its id, its
98
+ * position and its cell written in.
99
+ *
100
+ * @param markup A shape as {@link normalizeNoteShape} leaves it, or `null` for the default. One
101
+ * that was not normalized is normalized first.
102
+ */
103
+ export declare function writeNoteShape(markup: string | null | undefined, placement: NoteShapePlacement): string;
104
+ /**
105
+ * The largest shape number the part uses, so a written shape can take the next.
54
106
  *
55
107
  * @remarks
56
- * The geometry is the one Excel writes for a fresh note (and the one openpyxl writes, which
57
- * Excel opens): an anchor of cell halves only, no absolute `style` beyond `visibility:hidden`
58
- * and a nominal size, which Excel recomputes from the anchor.
108
+ * A part with no shapes starts from the block its `<o:idmap>` claims: ids come in blocks of
109
+ * 1024, and Excel gives each sheet's drawing a block of its own.
59
110
  */
60
- export declare function synthesizeNoteShape(row: number, col: number, shapeId: number): string;
111
+ export declare function maxShapeId(xml: string): number;
61
112
  /** The shapetype every note box refers to, declared once per part. */
62
113
  export declare const NOTE_SHAPETYPE = "<v:shapetype id=\"_x0000_t202\" coordsize=\"21600,21600\" o:spt=\"202\"\n path=\"m,l,21600r21600,l21600,xe\">\n <v:stroke joinstyle=\"miter\"/>\n <v:path gradientshapeok=\"t\" o:connecttype=\"rect\"/>\n </v:shapetype>";
63
114
  /** An empty VML part, for a sheet whose notes have no drawing to be added to. */
64
115
  export declare const EMPTY_LEGACY_DRAWING = "<xml xmlns:v=\"urn:schemas-microsoft-com:vml\"\n xmlns:o=\"urn:schemas-microsoft-com:office:office\"\n xmlns:x=\"urn:schemas-microsoft-com:office:excel\">\n <o:shapelayout v:ext=\"edit\">\n <o:idmap v:ext=\"edit\" data=\"1\"/>\n </o:shapelayout></xml>";
65
116
  /**
66
- * The part with the note shapes put back before the closing root.
117
+ * The part with shapes put back before the closing root: note boxes, or the shapes of another
118
+ * kind given its `shapetype`.
119
+ *
120
+ * @param lastShapeId The largest shape number among `shapes`, so the part can claim its block.
121
+ * @param shapetype The declaration `shapes` refer to; the note box's by default.
67
122
  *
68
123
  * @remarks
69
- * The note shapetype is declared once if any shape needs it and the part does not already
70
- * declare it. A part that ends up with no shapes at all returns `null`: nothing to write.
124
+ * The shapetype is declared once if any shape needs it and the part does not already declare
125
+ * it. A part that ends up with no shapes at all returns `null`: nothing to write.
71
126
  */
72
- export declare function assembleLegacyDrawing(rest: string | null, notes: string[]): string | null;
73
- /** The shape's own number, if it declares one. */
74
- export declare function shapeIdOf(xml: string): number | null;
127
+ export declare function assembleLegacyDrawing(rest: string | null, shapes: string[], lastShapeId?: number, shapetype?: string): string | null;
75
128
  //# sourceMappingURL=VmlNoteShapes.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { IColor, IFill, IStroke } from '@sheetxl/sdk';
2
+ /** A note box's fill and line, as the model states them. */
3
+ export interface NoteShapeStyle {
4
+ fill?: IFill.JSON;
5
+ stroke?: IStroke.JSON;
6
+ }
7
+ /**
8
+ * Reads a note shape's fill and line into the model's, and the markup with them restored to
9
+ * Excel's default, so the rest can be told apart from a shape that was never formatted.
10
+ *
11
+ * @param markup A normalized note shape.
12
+ */
13
+ export declare function readNoteStyle(markup: string): {
14
+ style: NoteShapeStyle;
15
+ markup: string;
16
+ };
17
+ /**
18
+ * A note shape with the model's fill and line written onto it: the inverse of
19
+ * {@link readNoteStyle}.
20
+ *
21
+ * @param markup A normalized note shape: what a note stored, or Excel's default.
22
+ * @param resolve Resolves a model color, a theme color included.
23
+ */
24
+ export declare function writeNoteStyle(markup: string, style: NoteShapeStyle, resolve: (color: string) => IColor): string;
25
+ //# sourceMappingURL=VmlNoteStyle.d.ts.map