documents.js 1.31.0 → 1.32.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.
package/dist/index.d.cts CHANGED
@@ -1,2 +1,1110 @@
1
- import { decodePackage, encodePackage } from "ooxml.js";
2
- export { decodePackage, encodePackage };
1
+ import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, Package as Package$1, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElement as XmlElement$1, XmlElementSchema, XmlNode, XmlNode as XmlNode$1, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
2
+ import { z } from "zod";
3
+ //#region src/model/color.d.ts
4
+ declare const LayoutColorSchema: z.ZodObject<{
5
+ r: z.ZodNumber;
6
+ g: z.ZodNumber;
7
+ b: z.ZodNumber;
8
+ }, z.core.$strip>;
9
+ type LayoutColor = z.infer<typeof LayoutColorSchema>;
10
+ declare const COLOR_BLACK: LayoutColor;
11
+ declare function rgbHexToColor(hex: string): LayoutColor;
12
+ //#endregion
13
+ //#region src/model/content.d.ts
14
+ declare const CONTENT_FORMAT_VERSION = 1;
15
+ declare const ContentRunSchema: z.ZodObject<{
16
+ text: z.ZodString;
17
+ bold: z.ZodOptional<z.ZodBoolean>;
18
+ italic: z.ZodOptional<z.ZodBoolean>;
19
+ underline: z.ZodOptional<z.ZodBoolean>;
20
+ strike: z.ZodOptional<z.ZodBoolean>;
21
+ fontFamily: z.ZodOptional<z.ZodString>;
22
+ sizePt: z.ZodOptional<z.ZodNumber>;
23
+ color: z.ZodOptional<z.ZodObject<{
24
+ r: z.ZodNumber;
25
+ g: z.ZodNumber;
26
+ b: z.ZodNumber;
27
+ }, z.core.$strip>>;
28
+ hyperlink: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ type ContentRun = z.infer<typeof ContentRunSchema>;
31
+ declare const ContentListMembershipSchema: z.ZodObject<{
32
+ numId: z.ZodString;
33
+ level: z.ZodNumber;
34
+ }, z.core.$strip>;
35
+ type ContentListMembership = z.infer<typeof ContentListMembershipSchema>;
36
+ declare const ContentParagraphSchema: z.ZodObject<{
37
+ kind: z.ZodLiteral<"paragraph">;
38
+ runs: z.ZodArray<z.ZodObject<{
39
+ text: z.ZodString;
40
+ bold: z.ZodOptional<z.ZodBoolean>;
41
+ italic: z.ZodOptional<z.ZodBoolean>;
42
+ underline: z.ZodOptional<z.ZodBoolean>;
43
+ strike: z.ZodOptional<z.ZodBoolean>;
44
+ fontFamily: z.ZodOptional<z.ZodString>;
45
+ sizePt: z.ZodOptional<z.ZodNumber>;
46
+ color: z.ZodOptional<z.ZodObject<{
47
+ r: z.ZodNumber;
48
+ g: z.ZodNumber;
49
+ b: z.ZodNumber;
50
+ }, z.core.$strip>>;
51
+ hyperlink: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strip>>;
53
+ styleId: z.ZodOptional<z.ZodString>;
54
+ alignment: z.ZodOptional<z.ZodEnum<{
55
+ left: "left";
56
+ center: "center";
57
+ right: "right";
58
+ justify: "justify";
59
+ }>>;
60
+ list: z.ZodOptional<z.ZodObject<{
61
+ numId: z.ZodString;
62
+ level: z.ZodNumber;
63
+ }, z.core.$strip>>;
64
+ spacingBeforePt: z.ZodOptional<z.ZodNumber>;
65
+ spacingAfterPt: z.ZodOptional<z.ZodNumber>;
66
+ lineSpacing: z.ZodOptional<z.ZodNumber>;
67
+ indentLeftPt: z.ZodOptional<z.ZodNumber>;
68
+ indentFirstLinePt: z.ZodOptional<z.ZodNumber>;
69
+ }, z.core.$strip>;
70
+ type ContentParagraph = z.infer<typeof ContentParagraphSchema>;
71
+ declare const ContentImageBlockSchema: z.ZodObject<{
72
+ kind: z.ZodLiteral<"image">;
73
+ format: z.ZodEnum<{
74
+ png: "png";
75
+ jpeg: "jpeg";
76
+ }>;
77
+ base64: z.ZodString;
78
+ widthPt: z.ZodNumber;
79
+ heightPt: z.ZodNumber;
80
+ altText: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>;
82
+ type ContentImageBlock = z.infer<typeof ContentImageBlockSchema>;
83
+ declare const ContentPageBreakSchema: z.ZodObject<{
84
+ kind: z.ZodLiteral<"pageBreak">;
85
+ }, z.core.$strip>;
86
+ type ContentPageBreak = z.infer<typeof ContentPageBreakSchema>;
87
+ interface ContentTableCell {
88
+ blocks: ContentBlock[];
89
+ colSpan?: number;
90
+ rowSpan?: number;
91
+ background?: LayoutColor;
92
+ }
93
+ interface ContentTableRow {
94
+ cells: ContentTableCell[];
95
+ heightPt?: number;
96
+ }
97
+ interface ContentTable {
98
+ kind: 'table';
99
+ rows: ContentTableRow[];
100
+ columnWidthsPt: number[];
101
+ }
102
+ type ContentBlock = ContentParagraph | ContentTable | ContentImageBlock | ContentPageBreak;
103
+ declare function isContentBlock(value: unknown): value is ContentBlock;
104
+ declare const ContentBlockSchema: z.ZodCustom<ContentBlock, ContentBlock>;
105
+ declare const ContentTableCellSchema: z.ZodObject<{
106
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
107
+ colSpan: z.ZodOptional<z.ZodNumber>;
108
+ rowSpan: z.ZodOptional<z.ZodNumber>;
109
+ background: z.ZodOptional<z.ZodObject<{
110
+ r: z.ZodNumber;
111
+ g: z.ZodNumber;
112
+ b: z.ZodNumber;
113
+ }, z.core.$strip>>;
114
+ }, z.core.$strip>;
115
+ declare const ContentTableRowSchema: z.ZodObject<{
116
+ cells: z.ZodArray<z.ZodObject<{
117
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
118
+ colSpan: z.ZodOptional<z.ZodNumber>;
119
+ rowSpan: z.ZodOptional<z.ZodNumber>;
120
+ background: z.ZodOptional<z.ZodObject<{
121
+ r: z.ZodNumber;
122
+ g: z.ZodNumber;
123
+ b: z.ZodNumber;
124
+ }, z.core.$strip>>;
125
+ }, z.core.$strip>>;
126
+ heightPt: z.ZodOptional<z.ZodNumber>;
127
+ }, z.core.$strip>;
128
+ declare const ContentTableSchema: z.ZodObject<{
129
+ kind: z.ZodLiteral<"table">;
130
+ rows: z.ZodArray<z.ZodObject<{
131
+ cells: z.ZodArray<z.ZodObject<{
132
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
133
+ colSpan: z.ZodOptional<z.ZodNumber>;
134
+ rowSpan: z.ZodOptional<z.ZodNumber>;
135
+ background: z.ZodOptional<z.ZodObject<{
136
+ r: z.ZodNumber;
137
+ g: z.ZodNumber;
138
+ b: z.ZodNumber;
139
+ }, z.core.$strip>>;
140
+ }, z.core.$strip>>;
141
+ heightPt: z.ZodOptional<z.ZodNumber>;
142
+ }, z.core.$strip>>;
143
+ columnWidthsPt: z.ZodArray<z.ZodNumber>;
144
+ }, z.core.$strip>;
145
+ declare const ContentSectionSchema: z.ZodObject<{
146
+ pageSize: z.ZodObject<{
147
+ widthPt: z.ZodNumber;
148
+ heightPt: z.ZodNumber;
149
+ }, z.core.$strip>;
150
+ margins: z.ZodObject<{
151
+ topPt: z.ZodNumber;
152
+ rightPt: z.ZodNumber;
153
+ bottomPt: z.ZodNumber;
154
+ leftPt: z.ZodNumber;
155
+ }, z.core.$strip>;
156
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
157
+ }, z.core.$strip>;
158
+ type ContentSection = z.infer<typeof ContentSectionSchema>;
159
+ declare const ContentShapeSchema: z.ZodObject<{
160
+ name: z.ZodOptional<z.ZodString>;
161
+ frame: z.ZodObject<{
162
+ xPt: z.ZodNumber;
163
+ yPt: z.ZodNumber;
164
+ widthPt: z.ZodNumber;
165
+ heightPt: z.ZodNumber;
166
+ }, z.core.$strip>;
167
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
168
+ insetLeftPt: z.ZodNumber;
169
+ insetTopPt: z.ZodNumber;
170
+ insetRightPt: z.ZodNumber;
171
+ insetBottomPt: z.ZodNumber;
172
+ fontScale: z.ZodOptional<z.ZodNumber>;
173
+ lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
174
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
175
+ }, z.core.$strip>;
176
+ type ContentShape = z.infer<typeof ContentShapeSchema>;
177
+ declare const ContentSlideSchema: z.ZodObject<{
178
+ size: z.ZodObject<{
179
+ widthPt: z.ZodNumber;
180
+ heightPt: z.ZodNumber;
181
+ }, z.core.$strip>;
182
+ shapes: z.ZodArray<z.ZodObject<{
183
+ name: z.ZodOptional<z.ZodString>;
184
+ frame: z.ZodObject<{
185
+ xPt: z.ZodNumber;
186
+ yPt: z.ZodNumber;
187
+ widthPt: z.ZodNumber;
188
+ heightPt: z.ZodNumber;
189
+ }, z.core.$strip>;
190
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
191
+ insetLeftPt: z.ZodNumber;
192
+ insetTopPt: z.ZodNumber;
193
+ insetRightPt: z.ZodNumber;
194
+ insetBottomPt: z.ZodNumber;
195
+ fontScale: z.ZodOptional<z.ZodNumber>;
196
+ lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
197
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
198
+ }, z.core.$strip>>;
199
+ notes: z.ZodString;
200
+ }, z.core.$strip>;
201
+ type ContentSlide = z.infer<typeof ContentSlideSchema>;
202
+ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
+ kind: z.ZodLiteral<"wordprocessing">;
204
+ formatVersion: z.ZodLiteral<1>;
205
+ metadata: z.ZodObject<{
206
+ title: z.ZodOptional<z.ZodString>;
207
+ author: z.ZodOptional<z.ZodString>;
208
+ subject: z.ZodOptional<z.ZodString>;
209
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
210
+ creator: z.ZodOptional<z.ZodString>;
211
+ producer: z.ZodOptional<z.ZodString>;
212
+ createdIso: z.ZodOptional<z.ZodString>;
213
+ modifiedIso: z.ZodOptional<z.ZodString>;
214
+ }, z.core.$strip>;
215
+ sections: z.ZodArray<z.ZodObject<{
216
+ pageSize: z.ZodObject<{
217
+ widthPt: z.ZodNumber;
218
+ heightPt: z.ZodNumber;
219
+ }, z.core.$strip>;
220
+ margins: z.ZodObject<{
221
+ topPt: z.ZodNumber;
222
+ rightPt: z.ZodNumber;
223
+ bottomPt: z.ZodNumber;
224
+ leftPt: z.ZodNumber;
225
+ }, z.core.$strip>;
226
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
227
+ }, z.core.$strip>>;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ kind: z.ZodLiteral<"presentation">;
230
+ formatVersion: z.ZodLiteral<1>;
231
+ metadata: z.ZodObject<{
232
+ title: z.ZodOptional<z.ZodString>;
233
+ author: z.ZodOptional<z.ZodString>;
234
+ subject: z.ZodOptional<z.ZodString>;
235
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
+ creator: z.ZodOptional<z.ZodString>;
237
+ producer: z.ZodOptional<z.ZodString>;
238
+ createdIso: z.ZodOptional<z.ZodString>;
239
+ modifiedIso: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strip>;
241
+ slides: z.ZodArray<z.ZodObject<{
242
+ size: z.ZodObject<{
243
+ widthPt: z.ZodNumber;
244
+ heightPt: z.ZodNumber;
245
+ }, z.core.$strip>;
246
+ shapes: z.ZodArray<z.ZodObject<{
247
+ name: z.ZodOptional<z.ZodString>;
248
+ frame: z.ZodObject<{
249
+ xPt: z.ZodNumber;
250
+ yPt: z.ZodNumber;
251
+ widthPt: z.ZodNumber;
252
+ heightPt: z.ZodNumber;
253
+ }, z.core.$strip>;
254
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
255
+ insetLeftPt: z.ZodNumber;
256
+ insetTopPt: z.ZodNumber;
257
+ insetRightPt: z.ZodNumber;
258
+ insetBottomPt: z.ZodNumber;
259
+ fontScale: z.ZodOptional<z.ZodNumber>;
260
+ lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
261
+ blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
262
+ }, z.core.$strip>>;
263
+ notes: z.ZodString;
264
+ }, z.core.$strip>>;
265
+ }, z.core.$strip>], "kind">;
266
+ type ContentDocument = z.infer<typeof ContentDocumentSchema>;
267
+ //#endregion
268
+ //#region src/model/layout.d.ts
269
+ declare const LAYOUT_FORMAT_VERSION = 1;
270
+ declare const LayoutTextSchema: z.ZodObject<{
271
+ kind: z.ZodLiteral<"text">;
272
+ text: z.ZodString;
273
+ xPt: z.ZodNumber;
274
+ yPt: z.ZodNumber;
275
+ font: z.ZodObject<{
276
+ family: z.ZodString;
277
+ weight: z.ZodEnum<{
278
+ bold: "bold";
279
+ normal: "normal";
280
+ }>;
281
+ style: z.ZodEnum<{
282
+ italic: "italic";
283
+ normal: "normal";
284
+ }>;
285
+ }, z.core.$strip>;
286
+ sizePt: z.ZodNumber;
287
+ color: z.ZodObject<{
288
+ r: z.ZodNumber;
289
+ g: z.ZodNumber;
290
+ b: z.ZodNumber;
291
+ }, z.core.$strip>;
292
+ widthPt: z.ZodOptional<z.ZodNumber>;
293
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
294
+ underline: z.ZodOptional<z.ZodBoolean>;
295
+ }, z.core.$strip>;
296
+ type LayoutText = z.infer<typeof LayoutTextSchema>;
297
+ declare const LayoutImageSchema: z.ZodObject<{
298
+ kind: z.ZodLiteral<"image">;
299
+ imageId: z.ZodString;
300
+ xPt: z.ZodNumber;
301
+ yPt: z.ZodNumber;
302
+ widthPt: z.ZodNumber;
303
+ heightPt: z.ZodNumber;
304
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
305
+ }, z.core.$strip>;
306
+ type LayoutImage = z.infer<typeof LayoutImageSchema>;
307
+ declare const LayoutRectSchema: z.ZodObject<{
308
+ kind: z.ZodLiteral<"rect">;
309
+ xPt: z.ZodNumber;
310
+ yPt: z.ZodNumber;
311
+ widthPt: z.ZodNumber;
312
+ heightPt: z.ZodNumber;
313
+ fill: z.ZodOptional<z.ZodObject<{
314
+ r: z.ZodNumber;
315
+ g: z.ZodNumber;
316
+ b: z.ZodNumber;
317
+ }, z.core.$strip>>;
318
+ stroke: z.ZodOptional<z.ZodObject<{
319
+ color: z.ZodObject<{
320
+ r: z.ZodNumber;
321
+ g: z.ZodNumber;
322
+ b: z.ZodNumber;
323
+ }, z.core.$strip>;
324
+ widthPt: z.ZodNumber;
325
+ }, z.core.$strip>>;
326
+ }, z.core.$strip>;
327
+ type LayoutRect = z.infer<typeof LayoutRectSchema>;
328
+ declare const LayoutLineSchema: z.ZodObject<{
329
+ kind: z.ZodLiteral<"line">;
330
+ x1Pt: z.ZodNumber;
331
+ y1Pt: z.ZodNumber;
332
+ x2Pt: z.ZodNumber;
333
+ y2Pt: z.ZodNumber;
334
+ color: z.ZodObject<{
335
+ r: z.ZodNumber;
336
+ g: z.ZodNumber;
337
+ b: z.ZodNumber;
338
+ }, z.core.$strip>;
339
+ widthPt: z.ZodNumber;
340
+ }, z.core.$strip>;
341
+ type LayoutLine = z.infer<typeof LayoutLineSchema>;
342
+ declare const LayoutEllipseSchema: z.ZodObject<{
343
+ kind: z.ZodLiteral<"ellipse">;
344
+ xPt: z.ZodNumber;
345
+ yPt: z.ZodNumber;
346
+ widthPt: z.ZodNumber;
347
+ heightPt: z.ZodNumber;
348
+ fill: z.ZodOptional<z.ZodObject<{
349
+ r: z.ZodNumber;
350
+ g: z.ZodNumber;
351
+ b: z.ZodNumber;
352
+ }, z.core.$strip>>;
353
+ stroke: z.ZodOptional<z.ZodObject<{
354
+ color: z.ZodObject<{
355
+ r: z.ZodNumber;
356
+ g: z.ZodNumber;
357
+ b: z.ZodNumber;
358
+ }, z.core.$strip>;
359
+ widthPt: z.ZodNumber;
360
+ }, z.core.$strip>>;
361
+ }, z.core.$strip>;
362
+ type LayoutEllipse = z.infer<typeof LayoutEllipseSchema>;
363
+ declare const LayoutLinkSchema: z.ZodObject<{
364
+ kind: z.ZodLiteral<"link">;
365
+ uri: z.ZodString;
366
+ xPt: z.ZodNumber;
367
+ yPt: z.ZodNumber;
368
+ widthPt: z.ZodNumber;
369
+ heightPt: z.ZodNumber;
370
+ }, z.core.$strip>;
371
+ type LayoutLink = z.infer<typeof LayoutLinkSchema>;
372
+ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
373
+ kind: z.ZodLiteral<"text">;
374
+ text: z.ZodString;
375
+ xPt: z.ZodNumber;
376
+ yPt: z.ZodNumber;
377
+ font: z.ZodObject<{
378
+ family: z.ZodString;
379
+ weight: z.ZodEnum<{
380
+ bold: "bold";
381
+ normal: "normal";
382
+ }>;
383
+ style: z.ZodEnum<{
384
+ italic: "italic";
385
+ normal: "normal";
386
+ }>;
387
+ }, z.core.$strip>;
388
+ sizePt: z.ZodNumber;
389
+ color: z.ZodObject<{
390
+ r: z.ZodNumber;
391
+ g: z.ZodNumber;
392
+ b: z.ZodNumber;
393
+ }, z.core.$strip>;
394
+ widthPt: z.ZodOptional<z.ZodNumber>;
395
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
396
+ underline: z.ZodOptional<z.ZodBoolean>;
397
+ }, z.core.$strip>, z.ZodObject<{
398
+ kind: z.ZodLiteral<"image">;
399
+ imageId: z.ZodString;
400
+ xPt: z.ZodNumber;
401
+ yPt: z.ZodNumber;
402
+ widthPt: z.ZodNumber;
403
+ heightPt: z.ZodNumber;
404
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
405
+ }, z.core.$strip>, z.ZodObject<{
406
+ kind: z.ZodLiteral<"rect">;
407
+ xPt: z.ZodNumber;
408
+ yPt: z.ZodNumber;
409
+ widthPt: z.ZodNumber;
410
+ heightPt: z.ZodNumber;
411
+ fill: z.ZodOptional<z.ZodObject<{
412
+ r: z.ZodNumber;
413
+ g: z.ZodNumber;
414
+ b: z.ZodNumber;
415
+ }, z.core.$strip>>;
416
+ stroke: z.ZodOptional<z.ZodObject<{
417
+ color: z.ZodObject<{
418
+ r: z.ZodNumber;
419
+ g: z.ZodNumber;
420
+ b: z.ZodNumber;
421
+ }, z.core.$strip>;
422
+ widthPt: z.ZodNumber;
423
+ }, z.core.$strip>>;
424
+ }, z.core.$strip>, z.ZodObject<{
425
+ kind: z.ZodLiteral<"line">;
426
+ x1Pt: z.ZodNumber;
427
+ y1Pt: z.ZodNumber;
428
+ x2Pt: z.ZodNumber;
429
+ y2Pt: z.ZodNumber;
430
+ color: z.ZodObject<{
431
+ r: z.ZodNumber;
432
+ g: z.ZodNumber;
433
+ b: z.ZodNumber;
434
+ }, z.core.$strip>;
435
+ widthPt: z.ZodNumber;
436
+ }, z.core.$strip>, z.ZodObject<{
437
+ kind: z.ZodLiteral<"ellipse">;
438
+ xPt: z.ZodNumber;
439
+ yPt: z.ZodNumber;
440
+ widthPt: z.ZodNumber;
441
+ heightPt: z.ZodNumber;
442
+ fill: z.ZodOptional<z.ZodObject<{
443
+ r: z.ZodNumber;
444
+ g: z.ZodNumber;
445
+ b: z.ZodNumber;
446
+ }, z.core.$strip>>;
447
+ stroke: z.ZodOptional<z.ZodObject<{
448
+ color: z.ZodObject<{
449
+ r: z.ZodNumber;
450
+ g: z.ZodNumber;
451
+ b: z.ZodNumber;
452
+ }, z.core.$strip>;
453
+ widthPt: z.ZodNumber;
454
+ }, z.core.$strip>>;
455
+ }, z.core.$strip>, z.ZodObject<{
456
+ kind: z.ZodLiteral<"link">;
457
+ uri: z.ZodString;
458
+ xPt: z.ZodNumber;
459
+ yPt: z.ZodNumber;
460
+ widthPt: z.ZodNumber;
461
+ heightPt: z.ZodNumber;
462
+ }, z.core.$strip>], "kind">;
463
+ type LayoutItem = z.infer<typeof LayoutItemSchema>;
464
+ declare const LayoutPageSchema: z.ZodObject<{
465
+ widthPt: z.ZodNumber;
466
+ heightPt: z.ZodNumber;
467
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
468
+ kind: z.ZodLiteral<"text">;
469
+ text: z.ZodString;
470
+ xPt: z.ZodNumber;
471
+ yPt: z.ZodNumber;
472
+ font: z.ZodObject<{
473
+ family: z.ZodString;
474
+ weight: z.ZodEnum<{
475
+ bold: "bold";
476
+ normal: "normal";
477
+ }>;
478
+ style: z.ZodEnum<{
479
+ italic: "italic";
480
+ normal: "normal";
481
+ }>;
482
+ }, z.core.$strip>;
483
+ sizePt: z.ZodNumber;
484
+ color: z.ZodObject<{
485
+ r: z.ZodNumber;
486
+ g: z.ZodNumber;
487
+ b: z.ZodNumber;
488
+ }, z.core.$strip>;
489
+ widthPt: z.ZodOptional<z.ZodNumber>;
490
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
491
+ underline: z.ZodOptional<z.ZodBoolean>;
492
+ }, z.core.$strip>, z.ZodObject<{
493
+ kind: z.ZodLiteral<"image">;
494
+ imageId: z.ZodString;
495
+ xPt: z.ZodNumber;
496
+ yPt: z.ZodNumber;
497
+ widthPt: z.ZodNumber;
498
+ heightPt: z.ZodNumber;
499
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
500
+ }, z.core.$strip>, z.ZodObject<{
501
+ kind: z.ZodLiteral<"rect">;
502
+ xPt: z.ZodNumber;
503
+ yPt: z.ZodNumber;
504
+ widthPt: z.ZodNumber;
505
+ heightPt: z.ZodNumber;
506
+ fill: z.ZodOptional<z.ZodObject<{
507
+ r: z.ZodNumber;
508
+ g: z.ZodNumber;
509
+ b: z.ZodNumber;
510
+ }, z.core.$strip>>;
511
+ stroke: z.ZodOptional<z.ZodObject<{
512
+ color: z.ZodObject<{
513
+ r: z.ZodNumber;
514
+ g: z.ZodNumber;
515
+ b: z.ZodNumber;
516
+ }, z.core.$strip>;
517
+ widthPt: z.ZodNumber;
518
+ }, z.core.$strip>>;
519
+ }, z.core.$strip>, z.ZodObject<{
520
+ kind: z.ZodLiteral<"line">;
521
+ x1Pt: z.ZodNumber;
522
+ y1Pt: z.ZodNumber;
523
+ x2Pt: z.ZodNumber;
524
+ y2Pt: z.ZodNumber;
525
+ color: z.ZodObject<{
526
+ r: z.ZodNumber;
527
+ g: z.ZodNumber;
528
+ b: z.ZodNumber;
529
+ }, z.core.$strip>;
530
+ widthPt: z.ZodNumber;
531
+ }, z.core.$strip>, z.ZodObject<{
532
+ kind: z.ZodLiteral<"ellipse">;
533
+ xPt: z.ZodNumber;
534
+ yPt: z.ZodNumber;
535
+ widthPt: z.ZodNumber;
536
+ heightPt: z.ZodNumber;
537
+ fill: z.ZodOptional<z.ZodObject<{
538
+ r: z.ZodNumber;
539
+ g: z.ZodNumber;
540
+ b: z.ZodNumber;
541
+ }, z.core.$strip>>;
542
+ stroke: z.ZodOptional<z.ZodObject<{
543
+ color: z.ZodObject<{
544
+ r: z.ZodNumber;
545
+ g: z.ZodNumber;
546
+ b: z.ZodNumber;
547
+ }, z.core.$strip>;
548
+ widthPt: z.ZodNumber;
549
+ }, z.core.$strip>>;
550
+ }, z.core.$strip>, z.ZodObject<{
551
+ kind: z.ZodLiteral<"link">;
552
+ uri: z.ZodString;
553
+ xPt: z.ZodNumber;
554
+ yPt: z.ZodNumber;
555
+ widthPt: z.ZodNumber;
556
+ heightPt: z.ZodNumber;
557
+ }, z.core.$strip>], "kind">>;
558
+ }, z.core.$strip>;
559
+ type LayoutPage = z.infer<typeof LayoutPageSchema>;
560
+ declare const LayoutImageAssetSchema: z.ZodObject<{
561
+ format: z.ZodEnum<{
562
+ png: "png";
563
+ jpeg: "jpeg";
564
+ }>;
565
+ base64: z.ZodString;
566
+ widthPx: z.ZodNumber;
567
+ heightPx: z.ZodNumber;
568
+ }, z.core.$strip>;
569
+ type LayoutImageAsset = z.infer<typeof LayoutImageAssetSchema>;
570
+ declare const LayoutMetadataSchema: z.ZodObject<{
571
+ title: z.ZodOptional<z.ZodString>;
572
+ author: z.ZodOptional<z.ZodString>;
573
+ subject: z.ZodOptional<z.ZodString>;
574
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
575
+ creator: z.ZodOptional<z.ZodString>;
576
+ producer: z.ZodOptional<z.ZodString>;
577
+ createdIso: z.ZodOptional<z.ZodString>;
578
+ modifiedIso: z.ZodOptional<z.ZodString>;
579
+ }, z.core.$strip>;
580
+ type LayoutMetadata = z.infer<typeof LayoutMetadataSchema>;
581
+ declare const LayoutDocumentSchema: z.ZodObject<{
582
+ formatVersion: z.ZodLiteral<1>;
583
+ metadata: z.ZodObject<{
584
+ title: z.ZodOptional<z.ZodString>;
585
+ author: z.ZodOptional<z.ZodString>;
586
+ subject: z.ZodOptional<z.ZodString>;
587
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
588
+ creator: z.ZodOptional<z.ZodString>;
589
+ producer: z.ZodOptional<z.ZodString>;
590
+ createdIso: z.ZodOptional<z.ZodString>;
591
+ modifiedIso: z.ZodOptional<z.ZodString>;
592
+ }, z.core.$strip>;
593
+ pages: z.ZodArray<z.ZodObject<{
594
+ widthPt: z.ZodNumber;
595
+ heightPt: z.ZodNumber;
596
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
597
+ kind: z.ZodLiteral<"text">;
598
+ text: z.ZodString;
599
+ xPt: z.ZodNumber;
600
+ yPt: z.ZodNumber;
601
+ font: z.ZodObject<{
602
+ family: z.ZodString;
603
+ weight: z.ZodEnum<{
604
+ bold: "bold";
605
+ normal: "normal";
606
+ }>;
607
+ style: z.ZodEnum<{
608
+ italic: "italic";
609
+ normal: "normal";
610
+ }>;
611
+ }, z.core.$strip>;
612
+ sizePt: z.ZodNumber;
613
+ color: z.ZodObject<{
614
+ r: z.ZodNumber;
615
+ g: z.ZodNumber;
616
+ b: z.ZodNumber;
617
+ }, z.core.$strip>;
618
+ widthPt: z.ZodOptional<z.ZodNumber>;
619
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
620
+ underline: z.ZodOptional<z.ZodBoolean>;
621
+ }, z.core.$strip>, z.ZodObject<{
622
+ kind: z.ZodLiteral<"image">;
623
+ imageId: z.ZodString;
624
+ xPt: z.ZodNumber;
625
+ yPt: z.ZodNumber;
626
+ widthPt: z.ZodNumber;
627
+ heightPt: z.ZodNumber;
628
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
629
+ }, z.core.$strip>, z.ZodObject<{
630
+ kind: z.ZodLiteral<"rect">;
631
+ xPt: z.ZodNumber;
632
+ yPt: z.ZodNumber;
633
+ widthPt: z.ZodNumber;
634
+ heightPt: z.ZodNumber;
635
+ fill: z.ZodOptional<z.ZodObject<{
636
+ r: z.ZodNumber;
637
+ g: z.ZodNumber;
638
+ b: z.ZodNumber;
639
+ }, z.core.$strip>>;
640
+ stroke: z.ZodOptional<z.ZodObject<{
641
+ color: z.ZodObject<{
642
+ r: z.ZodNumber;
643
+ g: z.ZodNumber;
644
+ b: z.ZodNumber;
645
+ }, z.core.$strip>;
646
+ widthPt: z.ZodNumber;
647
+ }, z.core.$strip>>;
648
+ }, z.core.$strip>, z.ZodObject<{
649
+ kind: z.ZodLiteral<"line">;
650
+ x1Pt: z.ZodNumber;
651
+ y1Pt: z.ZodNumber;
652
+ x2Pt: z.ZodNumber;
653
+ y2Pt: z.ZodNumber;
654
+ color: z.ZodObject<{
655
+ r: z.ZodNumber;
656
+ g: z.ZodNumber;
657
+ b: z.ZodNumber;
658
+ }, z.core.$strip>;
659
+ widthPt: z.ZodNumber;
660
+ }, z.core.$strip>, z.ZodObject<{
661
+ kind: z.ZodLiteral<"ellipse">;
662
+ xPt: z.ZodNumber;
663
+ yPt: z.ZodNumber;
664
+ widthPt: z.ZodNumber;
665
+ heightPt: z.ZodNumber;
666
+ fill: z.ZodOptional<z.ZodObject<{
667
+ r: z.ZodNumber;
668
+ g: z.ZodNumber;
669
+ b: z.ZodNumber;
670
+ }, z.core.$strip>>;
671
+ stroke: z.ZodOptional<z.ZodObject<{
672
+ color: z.ZodObject<{
673
+ r: z.ZodNumber;
674
+ g: z.ZodNumber;
675
+ b: z.ZodNumber;
676
+ }, z.core.$strip>;
677
+ widthPt: z.ZodNumber;
678
+ }, z.core.$strip>>;
679
+ }, z.core.$strip>, z.ZodObject<{
680
+ kind: z.ZodLiteral<"link">;
681
+ uri: z.ZodString;
682
+ xPt: z.ZodNumber;
683
+ yPt: z.ZodNumber;
684
+ widthPt: z.ZodNumber;
685
+ heightPt: z.ZodNumber;
686
+ }, z.core.$strip>], "kind">>;
687
+ }, z.core.$strip>>;
688
+ images: z.ZodRecord<z.ZodString, z.ZodObject<{
689
+ format: z.ZodEnum<{
690
+ png: "png";
691
+ jpeg: "jpeg";
692
+ }>;
693
+ base64: z.ZodString;
694
+ widthPx: z.ZodNumber;
695
+ heightPx: z.ZodNumber;
696
+ }, z.core.$strip>>;
697
+ }, z.core.$strip>;
698
+ type LayoutDocument = z.infer<typeof LayoutDocumentSchema>;
699
+ //#endregion
700
+ //#region src/model/geometry.d.ts
701
+ declare const BoxSchema: z.ZodObject<{
702
+ xPt: z.ZodNumber;
703
+ yPt: z.ZodNumber;
704
+ widthPt: z.ZodNumber;
705
+ heightPt: z.ZodNumber;
706
+ }, z.core.$strip>;
707
+ type Box = z.infer<typeof BoxSchema>;
708
+ declare const PageSizeSchema: z.ZodObject<{
709
+ widthPt: z.ZodNumber;
710
+ heightPt: z.ZodNumber;
711
+ }, z.core.$strip>;
712
+ type PageSize = z.infer<typeof PageSizeSchema>;
713
+ declare const MarginsSchema: z.ZodObject<{
714
+ topPt: z.ZodNumber;
715
+ rightPt: z.ZodNumber;
716
+ bottomPt: z.ZodNumber;
717
+ leftPt: z.ZodNumber;
718
+ }, z.core.$strip>;
719
+ type Margins = z.infer<typeof MarginsSchema>;
720
+ declare const PAGE_SIZE_LETTER: PageSize;
721
+ declare const PAGE_SIZE_A4: PageSize;
722
+ declare const SLIDE_SIZE_WIDESCREEN: PageSize;
723
+ declare const SLIDE_SIZE_STANDARD: PageSize;
724
+ declare function flipY(box: Box, containerHeightPt: number): Box;
725
+ //#endregion
726
+ //#region src/model/style.d.ts
727
+ declare const LayoutFontSchema: z.ZodObject<{
728
+ family: z.ZodString;
729
+ weight: z.ZodEnum<{
730
+ bold: "bold";
731
+ normal: "normal";
732
+ }>;
733
+ style: z.ZodEnum<{
734
+ italic: "italic";
735
+ normal: "normal";
736
+ }>;
737
+ }, z.core.$strip>;
738
+ type LayoutFont = z.infer<typeof LayoutFontSchema>;
739
+ declare const DEFAULT_LAYOUT_FONT: LayoutFont;
740
+ declare const AlignmentSchema: z.ZodEnum<{
741
+ left: "left";
742
+ center: "center";
743
+ right: "right";
744
+ justify: "justify";
745
+ }>;
746
+ type Alignment = z.infer<typeof AlignmentSchema>;
747
+ //#endregion
748
+ //#region src/edit/docx/image.d.ts
749
+ interface ImageInit$1 {
750
+ readonly format: 'png' | 'jpeg';
751
+ readonly bytes: Uint8Array<ArrayBuffer>;
752
+ readonly widthPt: number;
753
+ readonly heightPt: number;
754
+ readonly altText?: string;
755
+ }
756
+ interface MediaContext {
757
+ readonly pkg: Package$1;
758
+ readonly partPath: string;
759
+ readonly mediaDir: string;
760
+ }
761
+ //#endregion
762
+ //#region src/edit/docx/run.d.ts
763
+ interface RunInit {
764
+ readonly text?: string;
765
+ readonly bold?: boolean;
766
+ readonly italic?: boolean;
767
+ readonly underline?: boolean;
768
+ readonly fontFamily?: string;
769
+ readonly sizePt?: number;
770
+ readonly color?: LayoutColor;
771
+ }
772
+ declare class DocxRun {
773
+ private readonly container;
774
+ private readonly node;
775
+ private removed;
776
+ constructor(container: XmlNode$1[], node: XmlElement$1);
777
+ private live;
778
+ private rPr;
779
+ get text(): string;
780
+ set text(value: string);
781
+ get bold(): boolean;
782
+ set bold(value: boolean);
783
+ get italic(): boolean;
784
+ set italic(value: boolean);
785
+ get underline(): boolean;
786
+ set underline(value: boolean);
787
+ get fontFamily(): string | undefined;
788
+ set fontFamily(value: string);
789
+ get sizePt(): number | undefined;
790
+ set sizePt(value: number);
791
+ get color(): LayoutColor | undefined;
792
+ set color(value: LayoutColor);
793
+ remove(): void;
794
+ }
795
+ //#endregion
796
+ //#region src/edit/docx/paragraph.d.ts
797
+ interface ParagraphInit {
798
+ readonly text?: string;
799
+ readonly styleId?: string;
800
+ readonly alignment?: 'left' | 'center' | 'right' | 'justify';
801
+ }
802
+ interface ImageMediaContext {
803
+ readonly pkg: Package$1;
804
+ readonly documentRoot: XmlElement$1;
805
+ readonly media: MediaContext;
806
+ }
807
+ declare class DocxParagraph {
808
+ private readonly container;
809
+ private readonly node;
810
+ private readonly imageContext;
811
+ private removed;
812
+ constructor(container: XmlNode$1[], node: XmlElement$1, imageContext?: ImageMediaContext);
813
+ private live;
814
+ private pPr;
815
+ get text(): string;
816
+ runs(): DocxRun[];
817
+ appendRun(init?: RunInit): DocxRun;
818
+ appendTab(): void;
819
+ insertRunAt(index: number, init?: RunInit): DocxRun;
820
+ get styleId(): string | undefined;
821
+ set styleId(value: string | undefined);
822
+ get alignment(): 'left' | 'center' | 'right' | 'justify' | undefined;
823
+ set alignment(value: 'left' | 'center' | 'right' | 'justify' | undefined);
824
+ get list(): ContentListMembership | undefined;
825
+ set list(value: ContentListMembership | undefined);
826
+ insertImageAfter(image: ImageInit$1): void;
827
+ remove(): void;
828
+ }
829
+ //#endregion
830
+ //#region src/edit/docx/table.d.ts
831
+ interface TableInit {
832
+ readonly rows: number;
833
+ readonly columns: number;
834
+ readonly columnWidthsTwips?: readonly number[];
835
+ }
836
+ declare class DocxTableCell {
837
+ private readonly node;
838
+ constructor(node: XmlElement$1);
839
+ paragraphs(): DocxParagraph[];
840
+ appendParagraph(init?: ParagraphInit): DocxParagraph;
841
+ get text(): string;
842
+ }
843
+ declare class DocxTableRow {
844
+ private readonly node;
845
+ constructor(node: XmlElement$1);
846
+ cells(): DocxTableCell[];
847
+ }
848
+ declare class DocxTable {
849
+ private readonly container;
850
+ private readonly node;
851
+ private removed;
852
+ constructor(container: XmlNode$1[], node: XmlElement$1);
853
+ private live;
854
+ rows(): DocxTableRow[];
855
+ cell(rowIndex: number, columnIndex: number): DocxTableCell;
856
+ appendRow(columnCount: number): DocxTableRow;
857
+ remove(): void;
858
+ }
859
+ //#endregion
860
+ //#region src/edit/docx/editor.d.ts
861
+ interface DocxBody {
862
+ insertParagraphAt(index: number, init?: ParagraphInit): DocxParagraph;
863
+ appendParagraph(init?: ParagraphInit): DocxParagraph;
864
+ appendTable(init: TableInit): DocxTable;
865
+ appendPageBreak(): void;
866
+ }
867
+ declare class DocxEditor {
868
+ readonly body: DocxBody;
869
+ private readonly pkg;
870
+ constructor(pkg: Package$1);
871
+ paragraphs(): DocxParagraph[];
872
+ tables(): DocxTable[];
873
+ toPackage(): Package$1;
874
+ toBytes(): Uint8Array<ArrayBuffer>;
875
+ }
876
+ declare function openDocx(bytes: Uint8Array<ArrayBuffer>): DocxEditor;
877
+ declare function createDocx(): DocxEditor;
878
+ //#endregion
879
+ //#region src/edit/docx/content.d.ts
880
+ declare function buildDocxPackage(content: ContentDocument): Package$1;
881
+ //#endregion
882
+ //#region src/edit/pptx/image.d.ts
883
+ interface ImageInit {
884
+ readonly format: 'png' | 'jpeg';
885
+ readonly bytes: Uint8Array<ArrayBuffer>;
886
+ readonly altText?: string;
887
+ }
888
+ //#endregion
889
+ //#region src/edit/pptx/shape.d.ts
890
+ declare class PptxShape {
891
+ private readonly container;
892
+ private readonly node;
893
+ private removed;
894
+ constructor(container: XmlNode$1[], node: XmlElement$1);
895
+ private live;
896
+ private spPrElement;
897
+ get frame(): Box | undefined;
898
+ set frame(value: Box);
899
+ get text(): string;
900
+ set text(value: string);
901
+ setParagraphs(paragraphs: readonly DrawingParagraphInit[]): void;
902
+ remove(): void;
903
+ }
904
+ interface DrawingRunInit {
905
+ readonly text: string;
906
+ readonly bold?: boolean;
907
+ readonly italic?: boolean;
908
+ readonly fontFamily?: string;
909
+ readonly sizePt?: number;
910
+ readonly color?: LayoutColor;
911
+ }
912
+ interface DrawingParagraphInit {
913
+ readonly runs: readonly DrawingRunInit[];
914
+ readonly alignment?: Alignment;
915
+ }
916
+ //#endregion
917
+ //#region src/edit/pptx/slide.d.ts
918
+ interface TextBoxInit {
919
+ readonly frame: Box;
920
+ readonly text: string;
921
+ }
922
+ interface SlideImageInit extends ImageInit {
923
+ readonly frame: Box;
924
+ }
925
+ interface SlideContext {
926
+ readonly pkg: Package$1;
927
+ readonly slidePartPath: string;
928
+ readonly mediaDir: string;
929
+ }
930
+ declare class PptxSlide {
931
+ private readonly container;
932
+ private readonly node;
933
+ private readonly context;
934
+ private removed;
935
+ constructor(container: XmlNode$1[], node: XmlElement$1, context: SlideContext);
936
+ private live;
937
+ shapes(): PptxShape[];
938
+ addTextBox(init: TextBoxInit): PptxShape;
939
+ addImage(init: SlideImageInit): PptxShape;
940
+ get notes(): string;
941
+ set notes(value: string);
942
+ remove(): void;
943
+ }
944
+ //#endregion
945
+ //#region src/edit/pptx/editor.d.ts
946
+ declare class PptxEditor {
947
+ private readonly pkg;
948
+ constructor(pkg: Package$1);
949
+ slides(): PptxSlide[];
950
+ addSlide(): PptxSlide;
951
+ removeSlideAt(index: number): void;
952
+ moveSlide(from: number, to: number): void;
953
+ get slideSize(): PageSize;
954
+ set slideSize(size: PageSize);
955
+ toPackage(): Package$1;
956
+ toBytes(): Uint8Array<ArrayBuffer>;
957
+ }
958
+ declare function openPptx(bytes: Uint8Array<ArrayBuffer>): PptxEditor;
959
+ declare function createPptx(): PptxEditor;
960
+ //#endregion
961
+ //#region src/edit/pptx/content.d.ts
962
+ declare function buildPptxPackage(content: ContentDocument): Package$1;
963
+ //#endregion
964
+ //#region src/pdf/diagnostics.d.ts
965
+ type PdfDiagnosticSeverity = 'info' | 'warning';
966
+ interface PdfDiagnostic {
967
+ readonly code: string;
968
+ readonly severity: PdfDiagnosticSeverity;
969
+ readonly message: string;
970
+ readonly pageIndex?: number;
971
+ }
972
+ type PdfDiagnosticSink = (diagnostic: PdfDiagnostic) => void;
973
+ declare const NOOP_DIAGNOSTIC_SINK: PdfDiagnosticSink;
974
+ declare class PdfParseError extends Error {
975
+ readonly code: string;
976
+ constructor(code: string, message: string);
977
+ }
978
+ declare class PdfEncryptedError extends PdfParseError {
979
+ constructor(message?: string);
980
+ }
981
+ //#endregion
982
+ //#region src/pdf/read.d.ts
983
+ interface ReadPdfOptions {
984
+ readonly sink?: PdfDiagnosticSink;
985
+ readonly signal?: AbortSignal;
986
+ }
987
+ declare function readPdf(bytes: Uint8Array<ArrayBuffer>, options?: ReadPdfOptions): LayoutDocument;
988
+ //#endregion
989
+ //#region src/pdf/winansi.d.ts
990
+ interface WinAnsiSubstitution {
991
+ readonly from: string;
992
+ readonly to: string;
993
+ }
994
+ //#endregion
995
+ //#region src/pdf/write.d.ts
996
+ interface WritePdfOptions {
997
+ readonly compress?: boolean;
998
+ readonly signal?: AbortSignal;
999
+ readonly onSubstitution?: (substitution: WinAnsiSubstitution, context: {
1000
+ readonly pageIndex: number;
1001
+ }) => void;
1002
+ }
1003
+ declare function writePdf(doc: LayoutDocument, options?: WritePdfOptions): Uint8Array<ArrayBuffer>;
1004
+ //#endregion
1005
+ //#region src/ooxml/docx/read.d.ts
1006
+ declare function readDocxContent(pkg: Package$1): ContentDocument;
1007
+ //#endregion
1008
+ //#region src/ooxml/pptx/read.d.ts
1009
+ declare function readPptxContent(pkg: Package$1): ContentDocument;
1010
+ //#endregion
1011
+ //#region src/pdf/measure.d.ts
1012
+ interface UnderlineMetrics {
1013
+ readonly offsetPt: number;
1014
+ readonly thicknessPt: number;
1015
+ }
1016
+ interface TextMeasurer {
1017
+ widthOfTextAtSize(text: string, font: LayoutFont, sizePt: number): number;
1018
+ lineHeightAtSize(font: LayoutFont, sizePt: number): number;
1019
+ ascenderAtSize(font: LayoutFont, sizePt: number): number;
1020
+ descenderAtSize(font: LayoutFont, sizePt: number): number;
1021
+ underlineAtSize(font: LayoutFont, sizePt: number): UnderlineMetrics;
1022
+ horizontalScaleFor(font: LayoutFont): number;
1023
+ }
1024
+ //#endregion
1025
+ //#region src/layout/engine.d.ts
1026
+ interface EngineLayoutOptions {
1027
+ readonly measurer: TextMeasurer;
1028
+ }
1029
+ type WordprocessingContentDocument = Extract<ContentDocument, {
1030
+ kind: 'wordprocessing';
1031
+ }>;
1032
+ declare function convertWordprocessingToLayout(doc: WordprocessingContentDocument, options: EngineLayoutOptions): LayoutDocument;
1033
+ //#endregion
1034
+ //#region src/layout/slides.d.ts
1035
+ interface SlidesLayoutOptions {
1036
+ readonly measurer: TextMeasurer;
1037
+ }
1038
+ type PresentationContentDocument = Extract<ContentDocument, {
1039
+ kind: 'presentation';
1040
+ }>;
1041
+ declare function convertPresentationToLayout(doc: PresentationContentDocument, options: SlidesLayoutOptions): LayoutDocument;
1042
+ //#endregion
1043
+ //#region src/layout/reconstruct.d.ts
1044
+ interface ReconstructOptions {
1045
+ readonly signal?: AbortSignal;
1046
+ }
1047
+ declare function reconstructWordprocessing(doc: LayoutDocument, options?: ReconstructOptions): ContentDocument;
1048
+ declare function reconstructPresentation(doc: LayoutDocument, options?: ReconstructOptions): ContentDocument;
1049
+ //#endregion
1050
+ //#region src/convert/convert.d.ts
1051
+ interface DocumentToPdfOptions {
1052
+ readonly signal?: AbortSignal;
1053
+ readonly onSubstitution?: (substitution: WinAnsiSubstitution, context: {
1054
+ readonly pageIndex: number;
1055
+ }) => void;
1056
+ }
1057
+ declare function docxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
1058
+ declare function pptxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
1059
+ interface PdfToDocumentOptions {
1060
+ readonly signal?: AbortSignal;
1061
+ readonly sink?: PdfDiagnosticSink;
1062
+ }
1063
+ declare function pdfToDocx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
1064
+ declare function pdfToPptx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
1065
+ //#endregion
1066
+ //#region src/convert/port.d.ts
1067
+ type DocumentFormat = 'docx' | 'pptx' | 'pdf';
1068
+ interface DocumentPayload {
1069
+ readonly format: DocumentFormat;
1070
+ readonly bytes: Uint8Array<ArrayBuffer>;
1071
+ }
1072
+ interface Diagnostic {
1073
+ readonly severity: 'info' | 'warning';
1074
+ readonly code: string;
1075
+ readonly message: string;
1076
+ readonly pageIndex?: number;
1077
+ }
1078
+ interface ConversionRequest {
1079
+ readonly source: DocumentPayload;
1080
+ readonly targetFormat: DocumentFormat;
1081
+ }
1082
+ interface ConversionResult {
1083
+ readonly document: DocumentPayload;
1084
+ readonly diagnostics: readonly Diagnostic[];
1085
+ }
1086
+ interface DocumentConverter {
1087
+ readonly contractVersion: number;
1088
+ readonly conversions: readonly {
1089
+ readonly source: DocumentFormat;
1090
+ readonly target: DocumentFormat;
1091
+ }[];
1092
+ convert(request: ConversionRequest, options: {
1093
+ readonly signal: AbortSignal;
1094
+ }): Promise<ConversionResult>;
1095
+ }
1096
+ //#endregion
1097
+ //#region src/convert/local.d.ts
1098
+ declare function createLocalDocumentConverter(): DocumentConverter;
1099
+ //#endregion
1100
+ //#region src/ports/clock.d.ts
1101
+ interface ClockPort {
1102
+ now(): Date;
1103
+ }
1104
+ declare const systemClock: ClockPort;
1105
+ declare function fixedClock(date: Date): ClockPort;
1106
+ //#endregion
1107
+ //#region src/ports/abort.d.ts
1108
+ declare function throwIfAborted(signal: AbortSignal | undefined): void;
1109
+ //#endregion
1110
+ export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSlide, ContentSlideSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutEllipse, type LayoutFont, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutRect, type LayoutText, type Margins, NOOP_DIAGNOSTIC_SINK, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, PptxEditor, PptxShape, PptxSlide, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SlideImageInit, type SlidesLayoutOptions, type TextBoxInit, type WinAnsiSubstitution, type WritePdfOptions, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, attr, base64ToBytes, buildDocxPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertPresentationToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, openDocx, openPptx, packageCodec, parsePackage, parseXml, pdfToDocx, pdfToPptx, pptxToPdf, readDocxContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };