documents.js 1.43.1 → 1.44.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/README.md +17 -11
- package/dist/index.cjs +219 -9
- package/dist/index.d.cts +209 -3
- package/dist/index.d.ts +209 -3
- package/dist/index.js +183 -12
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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 { Alignment, Box, Box as Box$1, COLOR_BLACK, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutRect, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
2
|
+
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Package as Package$2, XmlElement as XmlElement$2, XmlNode as XmlNode$2 } from "odf.js";
|
|
5
5
|
//#region src/model/content.d.ts
|
|
@@ -204,6 +204,161 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
204
204
|
}, z.core.$strip>;
|
|
205
205
|
embeddedObjects: z.ZodOptional<z.ZodArray<z.ZodCustom<import("document-content-model").ContentEmbeddedObject, import("document-content-model").ContentEmbeddedObject>>>;
|
|
206
206
|
}, z.core.$strip>>;
|
|
207
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
208
|
+
kind: z.ZodLiteral<"drawing">;
|
|
209
|
+
formatVersion: z.ZodLiteral<1>;
|
|
210
|
+
metadata: z.ZodObject<{
|
|
211
|
+
title: z.ZodOptional<z.ZodString>;
|
|
212
|
+
author: z.ZodOptional<z.ZodString>;
|
|
213
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
214
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
215
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
216
|
+
producer: z.ZodOptional<z.ZodString>;
|
|
217
|
+
createdIso: z.ZodOptional<z.ZodString>;
|
|
218
|
+
modifiedIso: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
221
|
+
size: z.ZodObject<{
|
|
222
|
+
widthPt: z.ZodNumber;
|
|
223
|
+
heightPt: z.ZodNumber;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
shapes: z.ZodArray<z.ZodObject<{
|
|
226
|
+
name: z.ZodOptional<z.ZodString>;
|
|
227
|
+
frame: z.ZodObject<{
|
|
228
|
+
xPt: z.ZodNumber;
|
|
229
|
+
yPt: z.ZodNumber;
|
|
230
|
+
widthPt: z.ZodNumber;
|
|
231
|
+
heightPt: z.ZodNumber;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
rotationDeg: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
insetLeftPt: z.ZodNumber;
|
|
235
|
+
insetTopPt: z.ZodNumber;
|
|
236
|
+
insetRightPt: z.ZodNumber;
|
|
237
|
+
insetBottomPt: z.ZodNumber;
|
|
238
|
+
fontScale: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
241
|
+
blocks: z.ZodArray<z.ZodCustom<import("document-content-model").ContentBlock, import("document-content-model").ContentBlock>>;
|
|
242
|
+
}, z.core.$strip>>;
|
|
243
|
+
vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
244
|
+
kind: z.ZodLiteral<"rect">;
|
|
245
|
+
frame: z.ZodObject<{
|
|
246
|
+
xPt: z.ZodNumber;
|
|
247
|
+
yPt: z.ZodNumber;
|
|
248
|
+
widthPt: z.ZodNumber;
|
|
249
|
+
heightPt: z.ZodNumber;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
r: z.ZodNumber;
|
|
253
|
+
g: z.ZodNumber;
|
|
254
|
+
b: z.ZodNumber;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
color: z.ZodObject<{
|
|
258
|
+
r: z.ZodNumber;
|
|
259
|
+
g: z.ZodNumber;
|
|
260
|
+
b: z.ZodNumber;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
widthPt: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>>;
|
|
264
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
266
|
+
kind: z.ZodLiteral<"ellipse">;
|
|
267
|
+
frame: z.ZodObject<{
|
|
268
|
+
xPt: z.ZodNumber;
|
|
269
|
+
yPt: z.ZodNumber;
|
|
270
|
+
widthPt: z.ZodNumber;
|
|
271
|
+
heightPt: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
r: z.ZodNumber;
|
|
275
|
+
g: z.ZodNumber;
|
|
276
|
+
b: z.ZodNumber;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
279
|
+
color: z.ZodObject<{
|
|
280
|
+
r: z.ZodNumber;
|
|
281
|
+
g: z.ZodNumber;
|
|
282
|
+
b: z.ZodNumber;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
widthPt: z.ZodNumber;
|
|
285
|
+
}, z.core.$strip>>;
|
|
286
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
288
|
+
kind: z.ZodLiteral<"line">;
|
|
289
|
+
from: z.ZodObject<{
|
|
290
|
+
xPt: z.ZodNumber;
|
|
291
|
+
yPt: z.ZodNumber;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
to: z.ZodObject<{
|
|
294
|
+
xPt: z.ZodNumber;
|
|
295
|
+
yPt: z.ZodNumber;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
stroke: z.ZodObject<{
|
|
298
|
+
color: z.ZodObject<{
|
|
299
|
+
r: z.ZodNumber;
|
|
300
|
+
g: z.ZodNumber;
|
|
301
|
+
b: z.ZodNumber;
|
|
302
|
+
}, z.core.$strip>;
|
|
303
|
+
widthPt: z.ZodNumber;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
306
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
307
|
+
kind: z.ZodLiteral<"path">;
|
|
308
|
+
frame: z.ZodObject<{
|
|
309
|
+
xPt: z.ZodNumber;
|
|
310
|
+
yPt: z.ZodNumber;
|
|
311
|
+
widthPt: z.ZodNumber;
|
|
312
|
+
heightPt: z.ZodNumber;
|
|
313
|
+
}, z.core.$strip>;
|
|
314
|
+
subpaths: z.ZodArray<z.ZodObject<{
|
|
315
|
+
start: z.ZodObject<{
|
|
316
|
+
xPt: z.ZodNumber;
|
|
317
|
+
yPt: z.ZodNumber;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
segments: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
320
|
+
kind: z.ZodLiteral<"line">;
|
|
321
|
+
to: z.ZodObject<{
|
|
322
|
+
xPt: z.ZodNumber;
|
|
323
|
+
yPt: z.ZodNumber;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
326
|
+
kind: z.ZodLiteral<"cubic">;
|
|
327
|
+
control1: z.ZodObject<{
|
|
328
|
+
xPt: z.ZodNumber;
|
|
329
|
+
yPt: z.ZodNumber;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
control2: z.ZodObject<{
|
|
332
|
+
xPt: z.ZodNumber;
|
|
333
|
+
yPt: z.ZodNumber;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
to: z.ZodObject<{
|
|
336
|
+
xPt: z.ZodNumber;
|
|
337
|
+
yPt: z.ZodNumber;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
}, z.core.$strip>], "kind">>;
|
|
340
|
+
closed: z.ZodBoolean;
|
|
341
|
+
}, z.core.$strip>>;
|
|
342
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
343
|
+
r: z.ZodNumber;
|
|
344
|
+
g: z.ZodNumber;
|
|
345
|
+
b: z.ZodNumber;
|
|
346
|
+
}, z.core.$strip>>;
|
|
347
|
+
fillRule: z.ZodOptional<z.ZodEnum<{
|
|
348
|
+
nonzero: "nonzero";
|
|
349
|
+
evenodd: "evenodd";
|
|
350
|
+
}>>;
|
|
351
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
color: z.ZodObject<{
|
|
353
|
+
r: z.ZodNumber;
|
|
354
|
+
g: z.ZodNumber;
|
|
355
|
+
b: z.ZodNumber;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
widthPt: z.ZodNumber;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, z.core.$strip>], "kind">>;
|
|
361
|
+
}, z.core.$strip>>;
|
|
207
362
|
}, z.core.$strip>], "kind">;
|
|
208
363
|
type ContentDocument = z.infer<typeof ContentDocumentSchema>;
|
|
209
364
|
//#endregion
|
|
@@ -837,6 +992,44 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
837
992
|
widthPt: z.ZodNumber;
|
|
838
993
|
}, z.core.$strip>>;
|
|
839
994
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
995
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
996
|
+
kind: z.ZodLiteral<"path">;
|
|
997
|
+
subpaths: z.ZodArray<z.ZodObject<{
|
|
998
|
+
startXPt: z.ZodNumber;
|
|
999
|
+
startYPt: z.ZodNumber;
|
|
1000
|
+
segments: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1001
|
+
kind: z.ZodLiteral<"line">;
|
|
1002
|
+
xPt: z.ZodNumber;
|
|
1003
|
+
yPt: z.ZodNumber;
|
|
1004
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1005
|
+
kind: z.ZodLiteral<"cubic">;
|
|
1006
|
+
c1xPt: z.ZodNumber;
|
|
1007
|
+
c1yPt: z.ZodNumber;
|
|
1008
|
+
c2xPt: z.ZodNumber;
|
|
1009
|
+
c2yPt: z.ZodNumber;
|
|
1010
|
+
xPt: z.ZodNumber;
|
|
1011
|
+
yPt: z.ZodNumber;
|
|
1012
|
+
}, z.core.$strip>], "kind">>;
|
|
1013
|
+
closed: z.ZodBoolean;
|
|
1014
|
+
}, z.core.$strip>>;
|
|
1015
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
1016
|
+
r: z.ZodNumber;
|
|
1017
|
+
g: z.ZodNumber;
|
|
1018
|
+
b: z.ZodNumber;
|
|
1019
|
+
}, z.core.$strip>>;
|
|
1020
|
+
fillRule: z.ZodOptional<z.ZodEnum<{
|
|
1021
|
+
nonzero: "nonzero";
|
|
1022
|
+
evenodd: "evenodd";
|
|
1023
|
+
}>>;
|
|
1024
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
1025
|
+
color: z.ZodObject<{
|
|
1026
|
+
r: z.ZodNumber;
|
|
1027
|
+
g: z.ZodNumber;
|
|
1028
|
+
b: z.ZodNumber;
|
|
1029
|
+
}, z.core.$strip>;
|
|
1030
|
+
widthPt: z.ZodNumber;
|
|
1031
|
+
}, z.core.$strip>>;
|
|
1032
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
840
1033
|
}, z.core.$strip>, z.ZodObject<{
|
|
841
1034
|
kind: z.ZodLiteral<"link">;
|
|
842
1035
|
uri: z.ZodString;
|
|
@@ -874,6 +1067,9 @@ declare function readOdpContent(pkg: Package$2): ContentDocument;
|
|
|
874
1067
|
//#region src/odf/ods/read.d.ts
|
|
875
1068
|
declare function readOdsContent(pkg: Package$2): ContentDocument;
|
|
876
1069
|
//#endregion
|
|
1070
|
+
//#region src/odf/odg/read.d.ts
|
|
1071
|
+
declare function readOdgContent(pkg: Package$2): ContentDocument;
|
|
1072
|
+
//#endregion
|
|
877
1073
|
//#region src/pdf/measure.d.ts
|
|
878
1074
|
interface UnderlineMetrics {
|
|
879
1075
|
readonly offsetPt: number;
|
|
@@ -916,6 +1112,15 @@ type SpreadsheetContentDocument = Extract<ContentDocument, {
|
|
|
916
1112
|
}>;
|
|
917
1113
|
declare function convertSpreadsheetToLayout(doc: SpreadsheetContentDocument, options: SheetsLayoutOptions): LayoutDocument$1;
|
|
918
1114
|
//#endregion
|
|
1115
|
+
//#region src/layout/drawing.d.ts
|
|
1116
|
+
interface DrawingLayoutOptions {
|
|
1117
|
+
readonly measurer: TextMeasurer;
|
|
1118
|
+
}
|
|
1119
|
+
type DrawingContentDocument = Extract<ContentDocument, {
|
|
1120
|
+
kind: 'drawing';
|
|
1121
|
+
}>;
|
|
1122
|
+
declare function convertDrawingToLayout(doc: DrawingContentDocument, options: DrawingLayoutOptions): LayoutDocument$1;
|
|
1123
|
+
//#endregion
|
|
919
1124
|
//#region src/layout/reconstruct.d.ts
|
|
920
1125
|
interface ReconstructOptions {
|
|
921
1126
|
readonly signal?: AbortSignal;
|
|
@@ -935,6 +1140,7 @@ declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPd
|
|
|
935
1140
|
declare function pptxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
936
1141
|
declare function odpToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
937
1142
|
declare function odsToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1143
|
+
declare function odgToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
938
1144
|
interface PdfToDocumentOptions {
|
|
939
1145
|
readonly signal?: AbortSignal;
|
|
940
1146
|
readonly sink?: PdfDiagnosticSink;
|
|
@@ -951,7 +1157,7 @@ declare const odtPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8
|
|
|
951
1157
|
declare const odpPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
952
1158
|
//#endregion
|
|
953
1159
|
//#region src/convert/port.d.ts
|
|
954
|
-
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'pdf';
|
|
1160
|
+
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'odg' | 'pdf';
|
|
955
1161
|
interface DocumentPayload {
|
|
956
1162
|
readonly format: DocumentFormat;
|
|
957
1163
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -994,4 +1200,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
994
1200
|
//#region src/ports/abort.d.ts
|
|
995
1201
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
996
1202
|
//#endregion
|
|
997
|
-
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 ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, 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, 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 ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, 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, OdgBytesSchema, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type TextBoxInit$1 as 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, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odpPdfCodec, odpToPdf, odsToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOds, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|
|
1203
|
+
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 ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, 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 LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type Margins, NOOP_DIAGNOSTIC_SINK, OdgBytesSchema, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type TextBoxInit$1 as 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, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odgToPdf, odpPdfCodec, odpToPdf, odsToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOds, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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 { Alignment, Box, Box as Box$1, COLOR_BLACK, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutRect, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
2
|
+
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Package as Package$2, XmlElement as XmlElement$2, XmlNode as XmlNode$2 } from "odf.js";
|
|
5
5
|
//#region src/model/content.d.ts
|
|
@@ -204,6 +204,161 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
204
204
|
}, z.core.$strip>;
|
|
205
205
|
embeddedObjects: z.ZodOptional<z.ZodArray<z.ZodCustom<import("document-content-model").ContentEmbeddedObject, import("document-content-model").ContentEmbeddedObject>>>;
|
|
206
206
|
}, z.core.$strip>>;
|
|
207
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
208
|
+
kind: z.ZodLiteral<"drawing">;
|
|
209
|
+
formatVersion: z.ZodLiteral<1>;
|
|
210
|
+
metadata: z.ZodObject<{
|
|
211
|
+
title: z.ZodOptional<z.ZodString>;
|
|
212
|
+
author: z.ZodOptional<z.ZodString>;
|
|
213
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
214
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
215
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
216
|
+
producer: z.ZodOptional<z.ZodString>;
|
|
217
|
+
createdIso: z.ZodOptional<z.ZodString>;
|
|
218
|
+
modifiedIso: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
221
|
+
size: z.ZodObject<{
|
|
222
|
+
widthPt: z.ZodNumber;
|
|
223
|
+
heightPt: z.ZodNumber;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
shapes: z.ZodArray<z.ZodObject<{
|
|
226
|
+
name: z.ZodOptional<z.ZodString>;
|
|
227
|
+
frame: z.ZodObject<{
|
|
228
|
+
xPt: z.ZodNumber;
|
|
229
|
+
yPt: z.ZodNumber;
|
|
230
|
+
widthPt: z.ZodNumber;
|
|
231
|
+
heightPt: z.ZodNumber;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
rotationDeg: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
insetLeftPt: z.ZodNumber;
|
|
235
|
+
insetTopPt: z.ZodNumber;
|
|
236
|
+
insetRightPt: z.ZodNumber;
|
|
237
|
+
insetBottomPt: z.ZodNumber;
|
|
238
|
+
fontScale: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
241
|
+
blocks: z.ZodArray<z.ZodCustom<import("document-content-model").ContentBlock, import("document-content-model").ContentBlock>>;
|
|
242
|
+
}, z.core.$strip>>;
|
|
243
|
+
vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
244
|
+
kind: z.ZodLiteral<"rect">;
|
|
245
|
+
frame: z.ZodObject<{
|
|
246
|
+
xPt: z.ZodNumber;
|
|
247
|
+
yPt: z.ZodNumber;
|
|
248
|
+
widthPt: z.ZodNumber;
|
|
249
|
+
heightPt: z.ZodNumber;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
r: z.ZodNumber;
|
|
253
|
+
g: z.ZodNumber;
|
|
254
|
+
b: z.ZodNumber;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
color: z.ZodObject<{
|
|
258
|
+
r: z.ZodNumber;
|
|
259
|
+
g: z.ZodNumber;
|
|
260
|
+
b: z.ZodNumber;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
widthPt: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>>;
|
|
264
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
266
|
+
kind: z.ZodLiteral<"ellipse">;
|
|
267
|
+
frame: z.ZodObject<{
|
|
268
|
+
xPt: z.ZodNumber;
|
|
269
|
+
yPt: z.ZodNumber;
|
|
270
|
+
widthPt: z.ZodNumber;
|
|
271
|
+
heightPt: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
r: z.ZodNumber;
|
|
275
|
+
g: z.ZodNumber;
|
|
276
|
+
b: z.ZodNumber;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
279
|
+
color: z.ZodObject<{
|
|
280
|
+
r: z.ZodNumber;
|
|
281
|
+
g: z.ZodNumber;
|
|
282
|
+
b: z.ZodNumber;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
widthPt: z.ZodNumber;
|
|
285
|
+
}, z.core.$strip>>;
|
|
286
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
288
|
+
kind: z.ZodLiteral<"line">;
|
|
289
|
+
from: z.ZodObject<{
|
|
290
|
+
xPt: z.ZodNumber;
|
|
291
|
+
yPt: z.ZodNumber;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
to: z.ZodObject<{
|
|
294
|
+
xPt: z.ZodNumber;
|
|
295
|
+
yPt: z.ZodNumber;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
stroke: z.ZodObject<{
|
|
298
|
+
color: z.ZodObject<{
|
|
299
|
+
r: z.ZodNumber;
|
|
300
|
+
g: z.ZodNumber;
|
|
301
|
+
b: z.ZodNumber;
|
|
302
|
+
}, z.core.$strip>;
|
|
303
|
+
widthPt: z.ZodNumber;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
306
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
307
|
+
kind: z.ZodLiteral<"path">;
|
|
308
|
+
frame: z.ZodObject<{
|
|
309
|
+
xPt: z.ZodNumber;
|
|
310
|
+
yPt: z.ZodNumber;
|
|
311
|
+
widthPt: z.ZodNumber;
|
|
312
|
+
heightPt: z.ZodNumber;
|
|
313
|
+
}, z.core.$strip>;
|
|
314
|
+
subpaths: z.ZodArray<z.ZodObject<{
|
|
315
|
+
start: z.ZodObject<{
|
|
316
|
+
xPt: z.ZodNumber;
|
|
317
|
+
yPt: z.ZodNumber;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
segments: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
320
|
+
kind: z.ZodLiteral<"line">;
|
|
321
|
+
to: z.ZodObject<{
|
|
322
|
+
xPt: z.ZodNumber;
|
|
323
|
+
yPt: z.ZodNumber;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
326
|
+
kind: z.ZodLiteral<"cubic">;
|
|
327
|
+
control1: z.ZodObject<{
|
|
328
|
+
xPt: z.ZodNumber;
|
|
329
|
+
yPt: z.ZodNumber;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
control2: z.ZodObject<{
|
|
332
|
+
xPt: z.ZodNumber;
|
|
333
|
+
yPt: z.ZodNumber;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
to: z.ZodObject<{
|
|
336
|
+
xPt: z.ZodNumber;
|
|
337
|
+
yPt: z.ZodNumber;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
}, z.core.$strip>], "kind">>;
|
|
340
|
+
closed: z.ZodBoolean;
|
|
341
|
+
}, z.core.$strip>>;
|
|
342
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
343
|
+
r: z.ZodNumber;
|
|
344
|
+
g: z.ZodNumber;
|
|
345
|
+
b: z.ZodNumber;
|
|
346
|
+
}, z.core.$strip>>;
|
|
347
|
+
fillRule: z.ZodOptional<z.ZodEnum<{
|
|
348
|
+
nonzero: "nonzero";
|
|
349
|
+
evenodd: "evenodd";
|
|
350
|
+
}>>;
|
|
351
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
color: z.ZodObject<{
|
|
353
|
+
r: z.ZodNumber;
|
|
354
|
+
g: z.ZodNumber;
|
|
355
|
+
b: z.ZodNumber;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
widthPt: z.ZodNumber;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, z.core.$strip>], "kind">>;
|
|
361
|
+
}, z.core.$strip>>;
|
|
207
362
|
}, z.core.$strip>], "kind">;
|
|
208
363
|
type ContentDocument = z.infer<typeof ContentDocumentSchema>;
|
|
209
364
|
//#endregion
|
|
@@ -837,6 +992,44 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
837
992
|
widthPt: z.ZodNumber;
|
|
838
993
|
}, z.core.$strip>>;
|
|
839
994
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
995
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
996
|
+
kind: z.ZodLiteral<"path">;
|
|
997
|
+
subpaths: z.ZodArray<z.ZodObject<{
|
|
998
|
+
startXPt: z.ZodNumber;
|
|
999
|
+
startYPt: z.ZodNumber;
|
|
1000
|
+
segments: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1001
|
+
kind: z.ZodLiteral<"line">;
|
|
1002
|
+
xPt: z.ZodNumber;
|
|
1003
|
+
yPt: z.ZodNumber;
|
|
1004
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1005
|
+
kind: z.ZodLiteral<"cubic">;
|
|
1006
|
+
c1xPt: z.ZodNumber;
|
|
1007
|
+
c1yPt: z.ZodNumber;
|
|
1008
|
+
c2xPt: z.ZodNumber;
|
|
1009
|
+
c2yPt: z.ZodNumber;
|
|
1010
|
+
xPt: z.ZodNumber;
|
|
1011
|
+
yPt: z.ZodNumber;
|
|
1012
|
+
}, z.core.$strip>], "kind">>;
|
|
1013
|
+
closed: z.ZodBoolean;
|
|
1014
|
+
}, z.core.$strip>>;
|
|
1015
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
1016
|
+
r: z.ZodNumber;
|
|
1017
|
+
g: z.ZodNumber;
|
|
1018
|
+
b: z.ZodNumber;
|
|
1019
|
+
}, z.core.$strip>>;
|
|
1020
|
+
fillRule: z.ZodOptional<z.ZodEnum<{
|
|
1021
|
+
nonzero: "nonzero";
|
|
1022
|
+
evenodd: "evenodd";
|
|
1023
|
+
}>>;
|
|
1024
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
1025
|
+
color: z.ZodObject<{
|
|
1026
|
+
r: z.ZodNumber;
|
|
1027
|
+
g: z.ZodNumber;
|
|
1028
|
+
b: z.ZodNumber;
|
|
1029
|
+
}, z.core.$strip>;
|
|
1030
|
+
widthPt: z.ZodNumber;
|
|
1031
|
+
}, z.core.$strip>>;
|
|
1032
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
840
1033
|
}, z.core.$strip>, z.ZodObject<{
|
|
841
1034
|
kind: z.ZodLiteral<"link">;
|
|
842
1035
|
uri: z.ZodString;
|
|
@@ -874,6 +1067,9 @@ declare function readOdpContent(pkg: Package$2): ContentDocument;
|
|
|
874
1067
|
//#region src/odf/ods/read.d.ts
|
|
875
1068
|
declare function readOdsContent(pkg: Package$2): ContentDocument;
|
|
876
1069
|
//#endregion
|
|
1070
|
+
//#region src/odf/odg/read.d.ts
|
|
1071
|
+
declare function readOdgContent(pkg: Package$2): ContentDocument;
|
|
1072
|
+
//#endregion
|
|
877
1073
|
//#region src/pdf/measure.d.ts
|
|
878
1074
|
interface UnderlineMetrics {
|
|
879
1075
|
readonly offsetPt: number;
|
|
@@ -916,6 +1112,15 @@ type SpreadsheetContentDocument = Extract<ContentDocument, {
|
|
|
916
1112
|
}>;
|
|
917
1113
|
declare function convertSpreadsheetToLayout(doc: SpreadsheetContentDocument, options: SheetsLayoutOptions): LayoutDocument$1;
|
|
918
1114
|
//#endregion
|
|
1115
|
+
//#region src/layout/drawing.d.ts
|
|
1116
|
+
interface DrawingLayoutOptions {
|
|
1117
|
+
readonly measurer: TextMeasurer;
|
|
1118
|
+
}
|
|
1119
|
+
type DrawingContentDocument = Extract<ContentDocument, {
|
|
1120
|
+
kind: 'drawing';
|
|
1121
|
+
}>;
|
|
1122
|
+
declare function convertDrawingToLayout(doc: DrawingContentDocument, options: DrawingLayoutOptions): LayoutDocument$1;
|
|
1123
|
+
//#endregion
|
|
919
1124
|
//#region src/layout/reconstruct.d.ts
|
|
920
1125
|
interface ReconstructOptions {
|
|
921
1126
|
readonly signal?: AbortSignal;
|
|
@@ -935,6 +1140,7 @@ declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPd
|
|
|
935
1140
|
declare function pptxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
936
1141
|
declare function odpToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
937
1142
|
declare function odsToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1143
|
+
declare function odgToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
938
1144
|
interface PdfToDocumentOptions {
|
|
939
1145
|
readonly signal?: AbortSignal;
|
|
940
1146
|
readonly sink?: PdfDiagnosticSink;
|
|
@@ -951,7 +1157,7 @@ declare const odtPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8
|
|
|
951
1157
|
declare const odpPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
952
1158
|
//#endregion
|
|
953
1159
|
//#region src/convert/port.d.ts
|
|
954
|
-
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'pdf';
|
|
1160
|
+
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'odg' | 'pdf';
|
|
955
1161
|
interface DocumentPayload {
|
|
956
1162
|
readonly format: DocumentFormat;
|
|
957
1163
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -994,4 +1200,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
994
1200
|
//#region src/ports/abort.d.ts
|
|
995
1201
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
996
1202
|
//#endregion
|
|
997
|
-
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 ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, 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, 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 ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, 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, OdgBytesSchema, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type TextBoxInit$1 as 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, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odpPdfCodec, odpToPdf, odsToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOds, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|
|
1203
|
+
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 ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, 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 LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type Margins, NOOP_DIAGNOSTIC_SINK, OdgBytesSchema, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type TextBoxInit$1 as 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, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odgToPdf, odpPdfCodec, odpToPdf, odsToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOds, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|