ooxml.js 2.4.0 → 2.5.0

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 (138) hide show
  1. package/README.md +40 -2
  2. package/dist/codec.cjs +28 -0
  3. package/dist/codec.d.cts +72 -0
  4. package/dist/codec.d.ts +72 -0
  5. package/dist/codec.js +24 -0
  6. package/dist/compact.cjs +162 -0
  7. package/dist/compact.d.cts +70 -0
  8. package/dist/compact.d.ts +70 -0
  9. package/dist/compact.js +152 -0
  10. package/dist/image/sniff.cjs +28 -0
  11. package/dist/image/sniff.d.cts +5 -0
  12. package/dist/image/sniff.d.ts +5 -0
  13. package/dist/image/sniff.js +27 -0
  14. package/dist/index.cjs +83 -3025
  15. package/dist/index.d.cts +22 -527
  16. package/dist/index.d.ts +22 -527
  17. package/dist/index.js +22 -2964
  18. package/dist/model/node.cjs +67 -0
  19. package/dist/model/node.d.cts +2 -0
  20. package/dist/model/node.d.ts +2 -0
  21. package/dist/model/node.js +58 -0
  22. package/dist/model/package.cjs +19 -0
  23. package/dist/model/package.d.cts +2 -0
  24. package/dist/model/package.d.ts +2 -0
  25. package/dist/model/package.js +15 -0
  26. package/dist/node-CkBWRjNR.d.cts +83 -0
  27. package/dist/node-CkBWRjNR.d.ts +83 -0
  28. package/dist/package-BUojjTXf.d.ts +114 -0
  29. package/dist/package-L24lkba-.d.cts +114 -0
  30. package/dist/package-io/read.cjs +33 -0
  31. package/dist/package-io/read.d.cts +5 -0
  32. package/dist/package-io/read.d.ts +5 -0
  33. package/dist/package-io/read.js +32 -0
  34. package/dist/package-io/write.cjs +18 -0
  35. package/dist/package-io/write.d.cts +5 -0
  36. package/dist/package-io/write.d.ts +5 -0
  37. package/dist/package-io/write.js +17 -0
  38. package/dist/typed/docx/read.cjs +332 -0
  39. package/dist/typed/docx/read.d.cts +52 -0
  40. package/dist/typed/docx/read.d.ts +52 -0
  41. package/dist/typed/docx/read.js +328 -0
  42. package/dist/typed/docx/styles.cjs +148 -0
  43. package/dist/typed/docx/styles.d.cts +29 -0
  44. package/dist/typed/docx/styles.d.ts +29 -0
  45. package/dist/typed/docx/styles.js +146 -0
  46. package/dist/typed/pptx/inherit.cjs +96 -0
  47. package/dist/typed/pptx/inherit.d.cts +30 -0
  48. package/dist/typed/pptx/inherit.d.ts +30 -0
  49. package/dist/typed/pptx/inherit.js +90 -0
  50. package/dist/typed/pptx/read.cjs +364 -0
  51. package/dist/typed/pptx/read.d.cts +44 -0
  52. package/dist/typed/pptx/read.d.ts +44 -0
  53. package/dist/typed/pptx/read.js +362 -0
  54. package/dist/typed/shared/color.cjs +85 -0
  55. package/dist/typed/shared/color.d.cts +9 -0
  56. package/dist/typed/shared/color.d.ts +9 -0
  57. package/dist/typed/shared/color.js +84 -0
  58. package/dist/typed/shared/drawingml.cjs +191 -0
  59. package/dist/typed/shared/drawingml.d.cts +40 -0
  60. package/dist/typed/shared/drawingml.d.ts +40 -0
  61. package/dist/typed/shared/drawingml.js +180 -0
  62. package/dist/typed/shared/metadata.cjs +44 -0
  63. package/dist/typed/shared/metadata.d.cts +16 -0
  64. package/dist/typed/shared/metadata.d.ts +16 -0
  65. package/dist/typed/shared/metadata.js +42 -0
  66. package/dist/typed/shared/source-path.cjs +18 -0
  67. package/dist/typed/shared/source-path.d.cts +5 -0
  68. package/dist/typed/shared/source-path.d.ts +5 -0
  69. package/dist/typed/shared/source-path.js +17 -0
  70. package/dist/typed/shared/units.cjs +55 -0
  71. package/dist/typed/shared/units.d.cts +20 -0
  72. package/dist/typed/shared/units.d.ts +20 -0
  73. package/dist/typed/shared/units.js +38 -0
  74. package/dist/typed/util.cjs +85 -0
  75. package/dist/typed/util.d.cts +18 -0
  76. package/dist/typed/util.d.ts +18 -0
  77. package/dist/typed/util.js +77 -0
  78. package/dist/typed/xlsx/a1.cjs +64 -0
  79. package/dist/typed/xlsx/a1.d.cts +19 -0
  80. package/dist/typed/xlsx/a1.d.ts +19 -0
  81. package/dist/typed/xlsx/a1.js +58 -0
  82. package/dist/typed/xlsx/build.cjs +456 -0
  83. package/dist/typed/xlsx/build.d.cts +6 -0
  84. package/dist/typed/xlsx/build.d.ts +6 -0
  85. package/dist/typed/xlsx/build.js +455 -0
  86. package/dist/typed/xlsx/content.cjs +257 -0
  87. package/dist/typed/xlsx/content.d.cts +6 -0
  88. package/dist/typed/xlsx/content.d.ts +6 -0
  89. package/dist/typed/xlsx/content.js +256 -0
  90. package/dist/typed/xlsx/defined-names.cjs +90 -0
  91. package/dist/typed/xlsx/defined-names.d.cts +20 -0
  92. package/dist/typed/xlsx/defined-names.d.ts +20 -0
  93. package/dist/typed/xlsx/defined-names.js +83 -0
  94. package/dist/typed/xlsx/print-settings.cjs +116 -0
  95. package/dist/typed/xlsx/print-settings.d.cts +8 -0
  96. package/dist/typed/xlsx/print-settings.d.ts +8 -0
  97. package/dist/typed/xlsx/print-settings.js +114 -0
  98. package/dist/typed/xlsx/shared-strings.cjs +35 -0
  99. package/dist/typed/xlsx/shared-strings.d.cts +12 -0
  100. package/dist/typed/xlsx/shared-strings.d.ts +12 -0
  101. package/dist/typed/xlsx/shared-strings.js +33 -0
  102. package/dist/typed/xlsx/units.cjs +21 -0
  103. package/dist/typed/xlsx/units.d.cts +8 -0
  104. package/dist/typed/xlsx/units.d.ts +8 -0
  105. package/dist/typed/xlsx/units.js +16 -0
  106. package/dist/typed/xlsx/util.cjs +53 -0
  107. package/dist/typed/xlsx/util.d.cts +10 -0
  108. package/dist/typed/xlsx/util.d.ts +10 -0
  109. package/dist/typed/xlsx/util.js +47 -0
  110. package/dist/typed/xlsx.cjs +140 -0
  111. package/dist/typed/xlsx.d.cts +43 -0
  112. package/dist/typed/xlsx.d.ts +43 -0
  113. package/dist/typed/xlsx.js +135 -0
  114. package/dist/util/base64.cjs +48 -0
  115. package/dist/util/base64.d.cts +5 -0
  116. package/dist/util/base64.d.ts +5 -0
  117. package/dist/util/base64.js +46 -0
  118. package/dist/xml/build.cjs +46 -0
  119. package/dist/xml/build.d.cts +5 -0
  120. package/dist/xml/build.d.ts +5 -0
  121. package/dist/xml/build.js +46 -0
  122. package/dist/xml/entities.cjs +7 -0
  123. package/dist/xml/entities.d.cts +4 -0
  124. package/dist/xml/entities.d.ts +4 -0
  125. package/dist/xml/entities.js +6 -0
  126. package/dist/xml/fragment.cjs +22 -0
  127. package/dist/xml/fragment.d.cts +6 -0
  128. package/dist/xml/fragment.d.ts +6 -0
  129. package/dist/xml/fragment.js +20 -0
  130. package/dist/xml/parse.cjs +88 -0
  131. package/dist/xml/parse.d.cts +5 -0
  132. package/dist/xml/parse.d.ts +5 -0
  133. package/dist/xml/parse.js +88 -0
  134. package/dist/zip.cjs +12 -0
  135. package/dist/zip.d.cts +5 -0
  136. package/dist/zip.d.ts +5 -0
  137. package/dist/zip.js +10 -0
  138. package/package.json +9 -1
package/dist/index.d.ts CHANGED
@@ -1,528 +1,23 @@
1
- import { z } from "zod";
2
- import { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, Color, Color as Color$1, ColorSchema, ContentBlock, ContentBlock as ContentBlock$1, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocument as ContentDocument$1, ContentDocumentSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-schema.js";
3
- //#region src/model/node.d.ts
4
- declare const AttributeSchema: z.ZodObject<{
5
- name: z.ZodString;
6
- value: z.ZodString;
7
- }, z.core.$strip>;
8
- type Attribute = z.infer<typeof AttributeSchema>;
9
- declare const XmlTextSchema: z.ZodObject<{
10
- type: z.ZodLiteral<"text">;
11
- value: z.ZodString;
12
- }, z.core.$strip>;
13
- type XmlText = z.infer<typeof XmlTextSchema>;
14
- declare const XmlCdataSchema: z.ZodObject<{
15
- type: z.ZodLiteral<"cdata">;
16
- value: z.ZodString;
17
- }, z.core.$strip>;
18
- type XmlCdata = z.infer<typeof XmlCdataSchema>;
19
- declare const XmlCommentSchema: z.ZodObject<{
20
- type: z.ZodLiteral<"comment">;
21
- value: z.ZodString;
22
- }, z.core.$strip>;
23
- type XmlComment = z.infer<typeof XmlCommentSchema>;
24
- declare const XmlDeclarationSchema: z.ZodObject<{
25
- type: z.ZodLiteral<"declaration">;
26
- attributes: z.ZodArray<z.ZodObject<{
27
- name: z.ZodString;
28
- value: z.ZodString;
29
- }, z.core.$strip>>;
30
- }, z.core.$strip>;
31
- type XmlDeclaration = z.infer<typeof XmlDeclarationSchema>;
32
- declare const XmlPiSchema: z.ZodObject<{
33
- type: z.ZodLiteral<"pi">;
34
- target: z.ZodString;
35
- content: z.ZodString;
36
- }, z.core.$strip>;
37
- type XmlPi = z.infer<typeof XmlPiSchema>;
38
- interface XmlElement {
39
- type: 'element';
40
- tag: string;
41
- attributes: Attribute[];
42
- children: XmlNode[];
43
- }
44
- type XmlNode = XmlText | XmlCdata | XmlComment | XmlDeclaration | XmlPi | XmlElement;
45
- declare function isXmlNode(value: unknown): value is XmlNode;
46
- declare const XmlElementSchema: z.ZodObject<{
47
- type: z.ZodLiteral<"element">;
48
- tag: z.ZodString;
49
- attributes: z.ZodArray<z.ZodObject<{
50
- name: z.ZodString;
51
- value: z.ZodString;
52
- }, z.core.$strip>>;
53
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
54
- }, z.core.$strip>;
55
- declare const XmlNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
56
- type: z.ZodLiteral<"text">;
57
- value: z.ZodString;
58
- }, z.core.$strip>, z.ZodObject<{
59
- type: z.ZodLiteral<"cdata">;
60
- value: z.ZodString;
61
- }, z.core.$strip>, z.ZodObject<{
62
- type: z.ZodLiteral<"comment">;
63
- value: z.ZodString;
64
- }, z.core.$strip>, z.ZodObject<{
65
- type: z.ZodLiteral<"declaration">;
66
- attributes: z.ZodArray<z.ZodObject<{
67
- name: z.ZodString;
68
- value: z.ZodString;
69
- }, z.core.$strip>>;
70
- }, z.core.$strip>, z.ZodObject<{
71
- type: z.ZodLiteral<"pi">;
72
- target: z.ZodString;
73
- content: z.ZodString;
74
- }, z.core.$strip>, z.ZodObject<{
75
- type: z.ZodLiteral<"element">;
76
- tag: z.ZodString;
77
- attributes: z.ZodArray<z.ZodObject<{
78
- name: z.ZodString;
79
- value: z.ZodString;
80
- }, z.core.$strip>>;
81
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
82
- }, z.core.$strip>], "type">;
83
- //#endregion
84
- //#region src/model/package.d.ts
85
- declare const XmlPartSchema: z.ZodObject<{
86
- kind: z.ZodLiteral<"xml">;
87
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
88
- type: z.ZodLiteral<"text">;
89
- value: z.ZodString;
90
- }, z.core.$strip>, z.ZodObject<{
91
- type: z.ZodLiteral<"cdata">;
92
- value: z.ZodString;
93
- }, z.core.$strip>, z.ZodObject<{
94
- type: z.ZodLiteral<"comment">;
95
- value: z.ZodString;
96
- }, z.core.$strip>, z.ZodObject<{
97
- type: z.ZodLiteral<"declaration">;
98
- attributes: z.ZodArray<z.ZodObject<{
99
- name: z.ZodString;
100
- value: z.ZodString;
101
- }, z.core.$strip>>;
102
- }, z.core.$strip>, z.ZodObject<{
103
- type: z.ZodLiteral<"pi">;
104
- target: z.ZodString;
105
- content: z.ZodString;
106
- }, z.core.$strip>, z.ZodObject<{
107
- type: z.ZodLiteral<"element">;
108
- tag: z.ZodString;
109
- attributes: z.ZodArray<z.ZodObject<{
110
- name: z.ZodString;
111
- value: z.ZodString;
112
- }, z.core.$strip>>;
113
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
114
- }, z.core.$strip>], "type">>;
115
- }, z.core.$strip>;
116
- type XmlPart = z.infer<typeof XmlPartSchema>;
117
- declare const BinaryPartSchema: z.ZodObject<{
118
- kind: z.ZodLiteral<"binary">;
119
- base64: z.ZodString;
120
- }, z.core.$strip>;
121
- type BinaryPart = z.infer<typeof BinaryPartSchema>;
122
- declare const PartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
123
- kind: z.ZodLiteral<"xml">;
124
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
125
- type: z.ZodLiteral<"text">;
126
- value: z.ZodString;
127
- }, z.core.$strip>, z.ZodObject<{
128
- type: z.ZodLiteral<"cdata">;
129
- value: z.ZodString;
130
- }, z.core.$strip>, z.ZodObject<{
131
- type: z.ZodLiteral<"comment">;
132
- value: z.ZodString;
133
- }, z.core.$strip>, z.ZodObject<{
134
- type: z.ZodLiteral<"declaration">;
135
- attributes: z.ZodArray<z.ZodObject<{
136
- name: z.ZodString;
137
- value: z.ZodString;
138
- }, z.core.$strip>>;
139
- }, z.core.$strip>, z.ZodObject<{
140
- type: z.ZodLiteral<"pi">;
141
- target: z.ZodString;
142
- content: z.ZodString;
143
- }, z.core.$strip>, z.ZodObject<{
144
- type: z.ZodLiteral<"element">;
145
- tag: z.ZodString;
146
- attributes: z.ZodArray<z.ZodObject<{
147
- name: z.ZodString;
148
- value: z.ZodString;
149
- }, z.core.$strip>>;
150
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
151
- }, z.core.$strip>], "type">>;
152
- }, z.core.$strip>, z.ZodObject<{
153
- kind: z.ZodLiteral<"binary">;
154
- base64: z.ZodString;
155
- }, z.core.$strip>], "kind">;
156
- type Part = z.infer<typeof PartSchema>;
157
- declare const PackageSchema: z.ZodObject<{
158
- parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
159
- kind: z.ZodLiteral<"xml">;
160
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
161
- type: z.ZodLiteral<"text">;
162
- value: z.ZodString;
163
- }, z.core.$strip>, z.ZodObject<{
164
- type: z.ZodLiteral<"cdata">;
165
- value: z.ZodString;
166
- }, z.core.$strip>, z.ZodObject<{
167
- type: z.ZodLiteral<"comment">;
168
- value: z.ZodString;
169
- }, z.core.$strip>, z.ZodObject<{
170
- type: z.ZodLiteral<"declaration">;
171
- attributes: z.ZodArray<z.ZodObject<{
172
- name: z.ZodString;
173
- value: z.ZodString;
174
- }, z.core.$strip>>;
175
- }, z.core.$strip>, z.ZodObject<{
176
- type: z.ZodLiteral<"pi">;
177
- target: z.ZodString;
178
- content: z.ZodString;
179
- }, z.core.$strip>, z.ZodObject<{
180
- type: z.ZodLiteral<"element">;
181
- tag: z.ZodString;
182
- attributes: z.ZodArray<z.ZodObject<{
183
- name: z.ZodString;
184
- value: z.ZodString;
185
- }, z.core.$strip>>;
186
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
187
- }, z.core.$strip>], "type">>;
188
- }, z.core.$strip>, z.ZodObject<{
189
- kind: z.ZodLiteral<"binary">;
190
- base64: z.ZodString;
191
- }, z.core.$strip>], "kind">>;
192
- }, z.core.$strip>;
193
- type Package = z.infer<typeof PackageSchema>;
194
- //#endregion
195
- //#region src/codec.d.ts
196
- declare const xmlCodec: z.ZodCodec<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
197
- type: z.ZodLiteral<"text">;
198
- value: z.ZodString;
199
- }, z.core.$strip>, z.ZodObject<{
200
- type: z.ZodLiteral<"cdata">;
201
- value: z.ZodString;
202
- }, z.core.$strip>, z.ZodObject<{
203
- type: z.ZodLiteral<"comment">;
204
- value: z.ZodString;
205
- }, z.core.$strip>, z.ZodObject<{
206
- type: z.ZodLiteral<"declaration">;
207
- attributes: z.ZodArray<z.ZodObject<{
208
- name: z.ZodString;
209
- value: z.ZodString;
210
- }, z.core.$strip>>;
211
- }, z.core.$strip>, z.ZodObject<{
212
- type: z.ZodLiteral<"pi">;
213
- target: z.ZodString;
214
- content: z.ZodString;
215
- }, z.core.$strip>, z.ZodObject<{
216
- type: z.ZodLiteral<"element">;
217
- tag: z.ZodString;
218
- attributes: z.ZodArray<z.ZodObject<{
219
- name: z.ZodString;
220
- value: z.ZodString;
221
- }, z.core.$strip>>;
222
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
223
- }, z.core.$strip>], "type">>>;
224
- declare const packageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodObject<{
225
- parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
226
- kind: z.ZodLiteral<"xml">;
227
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
228
- type: z.ZodLiteral<"text">;
229
- value: z.ZodString;
230
- }, z.core.$strip>, z.ZodObject<{
231
- type: z.ZodLiteral<"cdata">;
232
- value: z.ZodString;
233
- }, z.core.$strip>, z.ZodObject<{
234
- type: z.ZodLiteral<"comment">;
235
- value: z.ZodString;
236
- }, z.core.$strip>, z.ZodObject<{
237
- type: z.ZodLiteral<"declaration">;
238
- attributes: z.ZodArray<z.ZodObject<{
239
- name: z.ZodString;
240
- value: z.ZodString;
241
- }, z.core.$strip>>;
242
- }, z.core.$strip>, z.ZodObject<{
243
- type: z.ZodLiteral<"pi">;
244
- target: z.ZodString;
245
- content: z.ZodString;
246
- }, z.core.$strip>, z.ZodObject<{
247
- type: z.ZodLiteral<"element">;
248
- tag: z.ZodString;
249
- attributes: z.ZodArray<z.ZodObject<{
250
- name: z.ZodString;
251
- value: z.ZodString;
252
- }, z.core.$strip>>;
253
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
254
- }, z.core.$strip>], "type">>;
255
- }, z.core.$strip>, z.ZodObject<{
256
- kind: z.ZodLiteral<"binary">;
257
- base64: z.ZodString;
258
- }, z.core.$strip>], "kind">>;
259
- }, z.core.$strip>>;
260
- declare function decodePackage(bytes: Uint8Array<ArrayBuffer>): Package;
261
- declare function encodePackage(pkg: Package): Uint8Array<ArrayBuffer>;
262
- //#endregion
263
- //#region src/package-io/read.d.ts
264
- declare function parsePackage(bytes: Uint8Array<ArrayBuffer>): Package;
265
- //#endregion
266
- //#region src/package-io/write.d.ts
267
- declare function serializePackage(pkg: Package): Uint8Array<ArrayBuffer>;
268
- //#endregion
269
- //#region src/xml/parse.d.ts
270
- declare function parseXml(xml: string): XmlNode[];
271
- //#endregion
272
- //#region src/xml/build.d.ts
273
- declare function buildXml(nodes: XmlNode[]): string;
274
- //#endregion
275
- //#region src/xml/fragment.d.ts
276
- declare function el(tag: string, attrs?: Record<string, string>, children?: XmlNode[]): XmlElement;
277
- declare function txt(value: string): XmlText;
278
- //#endregion
279
- //#region src/xml/entities.d.ts
280
- declare function encodeXmlText(value: string): string;
281
- //#endregion
282
- //#region src/zip.d.ts
283
- declare function unzipPackage(bytes: Uint8Array<ArrayBuffer>): Record<string, Uint8Array<ArrayBuffer>>;
284
- declare function zipPackage(parts: Record<string, Uint8Array<ArrayBuffer>>): Uint8Array<ArrayBuffer>;
285
- //#endregion
286
- //#region src/util/base64.d.ts
287
- declare function bytesToBase64(bytes: Uint8Array<ArrayBuffer>): string;
288
- declare function base64ToBytes(b64: string): Uint8Array<ArrayBuffer>;
289
- //#endregion
290
- //#region src/typed/util.d.ts
291
- declare function walk(nodes: XmlNode[]): Generator<XmlNode>;
292
- declare function elementsWithTag(nodes: XmlNode[], tag: string): XmlElement[];
293
- declare function childrenWithTag(element: XmlElement, tag: string): XmlElement[];
294
- declare function attr(element: XmlElement, name: string): string | undefined;
295
- declare function rootElement(part: Part | undefined): XmlElement | undefined;
296
- declare function decodeEntities(value: string): string;
297
- declare function textContent(element: XmlElement): string;
298
- interface Relationship {
299
- type: string;
300
- target: string;
301
- targetMode?: string;
302
- }
303
- declare function resolveRelationships(pkg: Package, partPath: string): Map<string, Relationship>;
304
- //#endregion
305
- //#region src/compact.d.ts
306
- type CompactAttrPairs = number[];
307
- type CompactElement = [0, number, CompactAttrPairs, CompactXmlNode[]];
308
- type CompactText = [1, number];
309
- type CompactCdata = [2, number];
310
- type CompactComment = [3, number];
311
- type CompactDeclaration = [4, CompactAttrPairs];
312
- type CompactPi = [5, number, number];
313
- type CompactXmlNode = CompactElement | CompactText | CompactCdata | CompactComment | CompactDeclaration | CompactPi;
314
- declare function isCompactXmlNode(value: unknown): value is CompactXmlNode;
315
- declare const CompactXmlNodeSchema: z.ZodCustom<CompactXmlNode, CompactXmlNode>;
316
- declare const CompactPartSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodCustom<CompactXmlNode, CompactXmlNode>>, z.ZodNumber]>;
317
- type CompactPart = z.infer<typeof CompactPartSchema>;
318
- declare const CompactPackageSchema: z.ZodObject<{
319
- s: z.ZodArray<z.ZodString>;
320
- p: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodArray<z.ZodCustom<CompactXmlNode, CompactXmlNode>>, z.ZodNumber]>>;
321
- }, z.core.$strip>;
322
- type CompactPackage = z.infer<typeof CompactPackageSchema>;
323
- declare const compactCodec: z.ZodCodec<z.ZodObject<{
324
- parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
325
- kind: z.ZodLiteral<"xml">;
326
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
327
- type: z.ZodLiteral<"text">;
328
- value: z.ZodString;
329
- }, z.core.$strip>, z.ZodObject<{
330
- type: z.ZodLiteral<"cdata">;
331
- value: z.ZodString;
332
- }, z.core.$strip>, z.ZodObject<{
333
- type: z.ZodLiteral<"comment">;
334
- value: z.ZodString;
335
- }, z.core.$strip>, z.ZodObject<{
336
- type: z.ZodLiteral<"declaration">;
337
- attributes: z.ZodArray<z.ZodObject<{
338
- name: z.ZodString;
339
- value: z.ZodString;
340
- }, z.core.$strip>>;
341
- }, z.core.$strip>, z.ZodObject<{
342
- type: z.ZodLiteral<"pi">;
343
- target: z.ZodString;
344
- content: z.ZodString;
345
- }, z.core.$strip>, z.ZodObject<{
346
- type: z.ZodLiteral<"element">;
347
- tag: z.ZodString;
348
- attributes: z.ZodArray<z.ZodObject<{
349
- name: z.ZodString;
350
- value: z.ZodString;
351
- }, z.core.$strip>>;
352
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
353
- }, z.core.$strip>], "type">>;
354
- }, z.core.$strip>, z.ZodObject<{
355
- kind: z.ZodLiteral<"binary">;
356
- base64: z.ZodString;
357
- }, z.core.$strip>], "kind">>;
358
- }, z.core.$strip>, z.ZodObject<{
359
- s: z.ZodArray<z.ZodString>;
360
- p: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodArray<z.ZodCustom<CompactXmlNode, CompactXmlNode>>, z.ZodNumber]>>;
361
- }, z.core.$strip>>;
362
- declare function toCompact(pkg: Package): CompactPackage;
363
- declare function fromCompact(cpkg: CompactPackage): Package;
364
- declare const compactPackageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodObject<{
365
- s: z.ZodArray<z.ZodString>;
366
- p: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodArray<z.ZodCustom<CompactXmlNode, CompactXmlNode>>, z.ZodNumber]>>;
367
- }, z.core.$strip>>;
368
- declare function decodeCompactPackage(bytes: Uint8Array<ArrayBuffer>): CompactPackage;
369
- declare function encodeCompactPackage(cpkg: CompactPackage): Uint8Array<ArrayBuffer>;
370
- //#endregion
371
- //#region src/typed/shared/color.d.ts
372
- interface ColorTransform {
373
- readonly kind: 'shade' | 'tint' | 'lumMod' | 'lumOff';
374
- readonly value: number;
375
- }
376
- declare function applyColorTransforms(base: Color$1, transforms: readonly ColorTransform[]): Color$1;
377
- //#endregion
378
- //#region src/typed/shared/metadata.d.ts
379
- declare const DocumentMetadataSchema: z.ZodObject<{
380
- title: z.ZodOptional<z.ZodString>;
381
- author: z.ZodOptional<z.ZodString>;
382
- subject: z.ZodOptional<z.ZodString>;
383
- keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
384
- creator: z.ZodOptional<z.ZodString>;
385
- createdIso: z.ZodOptional<z.ZodString>;
386
- modifiedIso: z.ZodOptional<z.ZodString>;
387
- }, z.core.$strip>;
388
- type DocumentMetadata = z.infer<typeof DocumentMetadataSchema>;
389
- //#endregion
390
- //#region src/image/sniff.d.ts
391
- type ImageFormat = 'png' | 'jpeg';
392
- declare function sniffImageFormat(bytes: Uint8Array<ArrayBuffer>): ImageFormat | undefined;
393
- //#endregion
394
- //#region src/typed/docx/read.d.ts
395
- declare const CommentSchema: z.ZodObject<{
396
- author: z.ZodOptional<z.ZodString>;
397
- text: z.ZodString;
398
- }, z.core.$strip>;
399
- type Comment = z.infer<typeof CommentSchema>;
400
- declare const FootnoteSchema: z.ZodObject<{
401
- type: z.ZodOptional<z.ZodString>;
402
- text: z.ZodString;
403
- }, z.core.$strip>;
404
- type Footnote = z.infer<typeof FootnoteSchema>;
405
- declare const DocxDocumentSchema: z.ZodObject<{
406
- metadata: z.ZodObject<{
407
- title: z.ZodOptional<z.ZodString>;
408
- author: z.ZodOptional<z.ZodString>;
409
- subject: z.ZodOptional<z.ZodString>;
410
- keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
411
- creator: z.ZodOptional<z.ZodString>;
412
- createdIso: z.ZodOptional<z.ZodString>;
413
- modifiedIso: z.ZodOptional<z.ZodString>;
414
- }, z.core.$strip>;
415
- sections: z.ZodArray<z.ZodObject<{
416
- pageSize: z.ZodObject<{
417
- widthPt: z.ZodNumber;
418
- heightPt: z.ZodNumber;
419
- }, z.core.$strip>;
420
- margins: z.ZodObject<{
421
- topPt: z.ZodNumber;
422
- rightPt: z.ZodNumber;
423
- bottomPt: z.ZodNumber;
424
- leftPt: z.ZodNumber;
425
- }, z.core.$strip>;
426
- blocks: z.ZodArray<z.ZodCustom<ContentBlock$1, ContentBlock$1>>;
427
- }, z.core.$strip>>;
428
- comments: z.ZodArray<z.ZodObject<{
429
- author: z.ZodOptional<z.ZodString>;
430
- text: z.ZodString;
431
- }, z.core.$strip>>;
432
- footnotes: z.ZodArray<z.ZodObject<{
433
- type: z.ZodOptional<z.ZodString>;
434
- text: z.ZodString;
435
- }, z.core.$strip>>;
436
- headers: z.ZodArray<z.ZodString>;
437
- footers: z.ZodArray<z.ZodString>;
438
- }, z.core.$strip>;
439
- type DocxDocument = z.infer<typeof DocxDocumentSchema>;
440
- declare function readDocx(pkg: Package): DocxDocument;
441
- //#endregion
442
- //#region src/typed/pptx/read.d.ts
443
- declare const PptxDocumentSchema: z.ZodObject<{
444
- metadata: z.ZodObject<{
445
- title: z.ZodOptional<z.ZodString>;
446
- author: z.ZodOptional<z.ZodString>;
447
- subject: z.ZodOptional<z.ZodString>;
448
- keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
449
- creator: z.ZodOptional<z.ZodString>;
450
- createdIso: z.ZodOptional<z.ZodString>;
451
- modifiedIso: z.ZodOptional<z.ZodString>;
452
- }, z.core.$strip>;
453
- slides: z.ZodArray<z.ZodObject<{
454
- size: z.ZodObject<{
455
- widthPt: z.ZodNumber;
456
- heightPt: z.ZodNumber;
457
- }, z.core.$strip>;
458
- shapes: z.ZodArray<z.ZodObject<{
459
- name: z.ZodOptional<z.ZodString>;
460
- frame: z.ZodObject<{
461
- xPt: z.ZodNumber;
462
- yPt: z.ZodNumber;
463
- widthPt: z.ZodNumber;
464
- heightPt: z.ZodNumber;
465
- }, z.core.$strip>;
466
- rotationDeg: z.ZodOptional<z.ZodNumber>;
467
- insetLeftPt: z.ZodNumber;
468
- insetTopPt: z.ZodNumber;
469
- insetRightPt: z.ZodNumber;
470
- insetBottomPt: z.ZodNumber;
471
- fontScale: z.ZodOptional<z.ZodNumber>;
472
- lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
473
- sourcePath: z.ZodOptional<z.ZodString>;
474
- blocks: z.ZodArray<z.ZodCustom<ContentBlock$1, ContentBlock$1>>;
475
- }, z.core.$strip>>;
476
- notes: z.ZodString;
477
- }, z.core.$strip>>;
478
- }, z.core.$strip>;
479
- type PptxDocument = z.infer<typeof PptxDocumentSchema>;
480
- declare function readPptx(pkg: Package): PptxDocument;
481
- //#endregion
482
- //#region src/typed/xlsx.d.ts
483
- declare const XlsxCellSchema: z.ZodObject<{
484
- reference: z.ZodString;
485
- value: z.ZodString;
486
- formula: z.ZodOptional<z.ZodString>;
487
- }, z.core.$strip>;
488
- type XlsxCell = z.infer<typeof XlsxCellSchema>;
489
- declare const XlsxSheetSchema: z.ZodObject<{
490
- name: z.ZodString;
491
- cells: z.ZodArray<z.ZodObject<{
492
- reference: z.ZodString;
493
- value: z.ZodString;
494
- formula: z.ZodOptional<z.ZodString>;
495
- }, z.core.$strip>>;
496
- mergedRanges: z.ZodArray<z.ZodString>;
497
- }, z.core.$strip>;
498
- type XlsxSheet = z.infer<typeof XlsxSheetSchema>;
499
- declare const DefinedNameSchema: z.ZodObject<{
500
- name: z.ZodString;
501
- refersTo: z.ZodString;
502
- }, z.core.$strip>;
503
- type DefinedName = z.infer<typeof DefinedNameSchema>;
504
- declare const XlsxWorkbookSchema: z.ZodObject<{
505
- sheets: z.ZodArray<z.ZodObject<{
506
- name: z.ZodString;
507
- cells: z.ZodArray<z.ZodObject<{
508
- reference: z.ZodString;
509
- value: z.ZodString;
510
- formula: z.ZodOptional<z.ZodString>;
511
- }, z.core.$strip>>;
512
- mergedRanges: z.ZodArray<z.ZodString>;
513
- }, z.core.$strip>>;
514
- definedNames: z.ZodArray<z.ZodObject<{
515
- name: z.ZodString;
516
- refersTo: z.ZodString;
517
- }, z.core.$strip>>;
518
- }, z.core.$strip>;
519
- type XlsxWorkbook = z.infer<typeof XlsxWorkbookSchema>;
520
- declare function readXlsx(pkg: Package): XlsxWorkbook;
521
- //#endregion
522
- //#region src/typed/xlsx/content.d.ts
523
- declare function readXlsxContent(pkg: Package): ContentDocument$1;
524
- //#endregion
525
- //#region src/typed/xlsx/build.d.ts
526
- declare function buildXlsxPackage(document: ContentDocument$1): Package;
527
- //#endregion
1
+ import { _ as isXmlNode, a as XmlComment, c as XmlDeclarationSchema, d as XmlNode, f as XmlNodeSchema, g as XmlTextSchema, h as XmlText, i as XmlCdataSchema, l as XmlElement, m as XmlPiSchema, n as AttributeSchema, o as XmlCommentSchema, p as XmlPi, r as XmlCdata, s as XmlDeclaration, t as Attribute, u as XmlElementSchema } from "./node-CkBWRjNR.js";
2
+ import { a as Part, c as XmlPartSchema, i as PackageSchema, n as BinaryPartSchema, o as PartSchema, r as Package, s as XmlPart, t as BinaryPart } from "./package-BUojjTXf.js";
3
+ import { decodePackage, encodePackage, packageCodec, xmlCodec } from "./codec.js";
4
+ import { CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, compactCodec, compactPackageCodec, decodeCompactPackage, encodeCompactPackage, fromCompact, isCompactXmlNode, toCompact } from "./compact.js";
5
+ import { ImageFormat, sniffImageFormat } from "./image/sniff.js";
6
+ import { parsePackage } from "./package-io/read.js";
7
+ import { serializePackage } from "./package-io/write.js";
8
+ import { parseXml } from "./xml/parse.js";
9
+ import { buildXml } from "./xml/build.js";
10
+ import { el, txt } from "./xml/fragment.js";
11
+ import { encodeXmlText } from "./xml/entities.js";
12
+ import { unzipPackage, zipPackage } from "./zip.js";
13
+ import { base64ToBytes, bytesToBase64 } from "./util/base64.js";
14
+ import { Relationship, attr, childrenWithTag, decodeEntities, elementsWithTag, resolveRelationships, rootElement, textContent, walk } from "./typed/util.js";
15
+ import { ColorTransform, applyColorTransforms } from "./typed/shared/color.js";
16
+ import { DocumentMetadata, DocumentMetadataSchema } from "./typed/shared/metadata.js";
17
+ import { Comment, CommentSchema, DocxDocument, DocxDocumentSchema, Footnote, FootnoteSchema, readDocx } from "./typed/docx/read.js";
18
+ import { PptxDocument, PptxDocumentSchema, readPptx } from "./typed/pptx/read.js";
19
+ import { DefinedName, DefinedNameSchema, XlsxCell, XlsxCellSchema, XlsxSheet, XlsxSheetSchema, XlsxWorkbook, XlsxWorkbookSchema, readXlsx } from "./typed/xlsx.js";
20
+ import { readXlsxContent } from "./typed/xlsx/content.js";
21
+ import { buildXlsxPackage } from "./typed/xlsx/build.js";
22
+ import { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, Color, ColorSchema, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-schema.js";
528
23
  export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, BoxSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, type Color, ColorSchema, type ColorTransform, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, ContentListMembershipSchema, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, ContentSheetImageSchema, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type DefinedName, DefinedNameSchema, type DocumentMetadata, DocumentMetadataSchema, type DocxDocument, DocxDocumentSchema, type Footnote, FootnoteSchema, type ImageFormat, type Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, PageSizeSchema, type Part, PartSchema, type PptxDocument, PptxDocumentSchema, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type XlsxCell, XlsxCellSchema, type XlsxSheet, XlsxSheetSchema, type XlsxWorkbook, XlsxWorkbookSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyColorTransforms, attr, base64ToBytes, buildXlsxPackage, buildXml, bytesToBase64, childrenWithTag, colorToRgbHex, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, el, elementsWithTag, encodeCompactPackage, encodePackage, encodeXmlText, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, packageCodec, parsePackage, parseXml, readDocx, readPptx, readXlsx, readXlsxContent, resolveRelationships, rgbHexToColor, rootElement, serializePackage, sniffImageFormat, textContent, toCompact, txt, unzipPackage, walk, xmlCodec, zipPackage };