documents.js 1.41.0 → 1.43.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.cjs +1166 -124
- package/dist/index.d.cts +200 -3
- package/dist/index.d.ts +200 -3
- package/dist/index.js +1112 -127
- package/package.json +1 -1
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, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, 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, 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";
|
|
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
|
|
@@ -68,6 +68,142 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
68
68
|
}, z.core.$strip>>;
|
|
69
69
|
notes: z.ZodString;
|
|
70
70
|
}, z.core.$strip>>;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"spreadsheet">;
|
|
73
|
+
formatVersion: z.ZodLiteral<1>;
|
|
74
|
+
metadata: z.ZodObject<{
|
|
75
|
+
title: z.ZodOptional<z.ZodString>;
|
|
76
|
+
author: z.ZodOptional<z.ZodString>;
|
|
77
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
78
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
80
|
+
producer: z.ZodOptional<z.ZodString>;
|
|
81
|
+
createdIso: z.ZodOptional<z.ZodString>;
|
|
82
|
+
modifiedIso: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
sheets: z.ZodArray<z.ZodObject<{
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
cells: z.ZodArray<z.ZodObject<{
|
|
87
|
+
row: z.ZodNumber;
|
|
88
|
+
column: z.ZodNumber;
|
|
89
|
+
value: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"number">;
|
|
91
|
+
value: z.ZodNumber;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"percentage">;
|
|
94
|
+
value: z.ZodNumber;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
kind: z.ZodLiteral<"currency">;
|
|
97
|
+
value: z.ZodNumber;
|
|
98
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
+
kind: z.ZodLiteral<"boolean">;
|
|
101
|
+
value: z.ZodBoolean;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
kind: z.ZodLiteral<"date">;
|
|
104
|
+
value: z.ZodString;
|
|
105
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
+
kind: z.ZodLiteral<"time">;
|
|
107
|
+
value: z.ZodString;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
kind: z.ZodLiteral<"string">;
|
|
110
|
+
value: z.ZodString;
|
|
111
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
+
kind: z.ZodLiteral<"error">;
|
|
113
|
+
value: z.ZodString;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
kind: z.ZodLiteral<"empty">;
|
|
116
|
+
}, z.core.$strip>], "kind">;
|
|
117
|
+
formula: z.ZodOptional<z.ZodString>;
|
|
118
|
+
displayText: z.ZodString;
|
|
119
|
+
runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
|
+
text: z.ZodString;
|
|
121
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
strike: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
126
|
+
sizePt: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
r: z.ZodNumber;
|
|
129
|
+
g: z.ZodNumber;
|
|
130
|
+
b: z.ZodNumber;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
hyperlink: z.ZodOptional<z.ZodString>;
|
|
133
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>>>;
|
|
135
|
+
colSpan: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
rowSpan: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
139
|
+
index: z.ZodNumber;
|
|
140
|
+
widthPt: z.ZodNumber;
|
|
141
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
144
|
+
index: z.ZodNumber;
|
|
145
|
+
heightPt: z.ZodNumber;
|
|
146
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
images: z.ZodArray<z.ZodObject<{
|
|
149
|
+
kind: z.ZodLiteral<"image">;
|
|
150
|
+
format: z.ZodEnum<{
|
|
151
|
+
png: "png";
|
|
152
|
+
jpeg: "jpeg";
|
|
153
|
+
}>;
|
|
154
|
+
base64: z.ZodString;
|
|
155
|
+
widthPt: z.ZodNumber;
|
|
156
|
+
heightPt: z.ZodNumber;
|
|
157
|
+
altText: z.ZodOptional<z.ZodString>;
|
|
158
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
159
|
+
anchorRow: z.ZodNumber;
|
|
160
|
+
anchorColumn: z.ZodNumber;
|
|
161
|
+
offsetXPt: z.ZodNumber;
|
|
162
|
+
offsetYPt: z.ZodNumber;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
printSettings: z.ZodObject<{
|
|
165
|
+
pageSize: z.ZodObject<{
|
|
166
|
+
widthPt: z.ZodNumber;
|
|
167
|
+
heightPt: z.ZodNumber;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
margins: z.ZodObject<{
|
|
170
|
+
topPt: z.ZodNumber;
|
|
171
|
+
rightPt: z.ZodNumber;
|
|
172
|
+
bottomPt: z.ZodNumber;
|
|
173
|
+
leftPt: z.ZodNumber;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
printRange: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
startRow: z.ZodNumber;
|
|
177
|
+
startColumn: z.ZodNumber;
|
|
178
|
+
endRow: z.ZodNumber;
|
|
179
|
+
endColumn: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
fitToPages: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
width: z.ZodNumber;
|
|
184
|
+
height: z.ZodNumber;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
repeatRows: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
start: z.ZodNumber;
|
|
188
|
+
end: z.ZodNumber;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
repeatColumns: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
start: z.ZodNumber;
|
|
192
|
+
end: z.ZodNumber;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
gridlines: z.ZodBoolean;
|
|
195
|
+
headers: z.ZodBoolean;
|
|
196
|
+
pageOrder: z.ZodEnum<{
|
|
197
|
+
downThenOver: "downThenOver";
|
|
198
|
+
overThenDown: "overThenDown";
|
|
199
|
+
}>;
|
|
200
|
+
manualBreaks: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
rows: z.ZodArray<z.ZodNumber>;
|
|
202
|
+
columns: z.ZodArray<z.ZodNumber>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
embeddedObjects: z.ZodOptional<z.ZodArray<z.ZodCustom<import("document-content-model").ContentEmbeddedObject, import("document-content-model").ContentEmbeddedObject>>>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
71
207
|
}, z.core.$strip>], "kind">;
|
|
72
208
|
type ContentDocument = z.infer<typeof ContentDocumentSchema>;
|
|
73
209
|
//#endregion
|
|
@@ -509,6 +645,53 @@ declare function createOdp(): OdpEditor;
|
|
|
509
645
|
//#region src/edit/odp/content.d.ts
|
|
510
646
|
declare function buildOdpPackage(content: ContentDocument): Package$2;
|
|
511
647
|
//#endregion
|
|
648
|
+
//#region src/edit/ods/cell.d.ts
|
|
649
|
+
declare class OdsCell {
|
|
650
|
+
private readonly node;
|
|
651
|
+
private readonly pkg;
|
|
652
|
+
constructor(node: XmlElement$2, pkg: Package$2);
|
|
653
|
+
get value(): ContentCellValue$1;
|
|
654
|
+
set value(value: ContentCellValue$1);
|
|
655
|
+
get formula(): string | undefined;
|
|
656
|
+
set formula(value: string | undefined);
|
|
657
|
+
get displayText(): string;
|
|
658
|
+
set displayText(value: string);
|
|
659
|
+
setStyledRuns(runs: readonly ContentRun$1[]): void;
|
|
660
|
+
}
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/edit/ods/sheet.d.ts
|
|
663
|
+
declare class OdsSheet {
|
|
664
|
+
private readonly container;
|
|
665
|
+
private readonly node;
|
|
666
|
+
private readonly pkg;
|
|
667
|
+
private removed;
|
|
668
|
+
constructor(container: XmlNode$2[], node: XmlElement$2, pkg: Package$2);
|
|
669
|
+
private live;
|
|
670
|
+
get name(): string;
|
|
671
|
+
set name(value: string);
|
|
672
|
+
cell(row: number, column: number): OdsCell;
|
|
673
|
+
cellAt(reference: string): OdsCell;
|
|
674
|
+
mergeCells(startRow: number, startColumn: number, rowSpan: number, colSpan: number): OdsCell;
|
|
675
|
+
remove(): void;
|
|
676
|
+
}
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/edit/ods/editor.d.ts
|
|
679
|
+
declare class OdsEditor {
|
|
680
|
+
private readonly pkg;
|
|
681
|
+
constructor(pkg: Package$2);
|
|
682
|
+
sheets(): OdsSheet[];
|
|
683
|
+
sheet(name: string): OdsSheet;
|
|
684
|
+
addSheet(name: string): OdsSheet;
|
|
685
|
+
removeSheetAt(index: number): void;
|
|
686
|
+
toPackage(): Package$2;
|
|
687
|
+
toBytes(): Uint8Array<ArrayBuffer>;
|
|
688
|
+
}
|
|
689
|
+
declare function openOds(bytes: Uint8Array<ArrayBuffer>): OdsEditor;
|
|
690
|
+
declare function createOds(): OdsEditor;
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region src/edit/ods/content.d.ts
|
|
693
|
+
declare function buildOdsPackage(content: ContentDocument): Package$2;
|
|
694
|
+
//#endregion
|
|
512
695
|
//#region src/pdf/diagnostics.d.ts
|
|
513
696
|
type PdfDiagnosticSeverity = 'info' | 'warning';
|
|
514
697
|
interface PdfDiagnostic {
|
|
@@ -688,6 +871,9 @@ declare function readOdtContent(pkg: Package$2): ContentDocument;
|
|
|
688
871
|
//#region src/odf/odp/read.d.ts
|
|
689
872
|
declare function readOdpContent(pkg: Package$2): ContentDocument;
|
|
690
873
|
//#endregion
|
|
874
|
+
//#region src/odf/ods/read.d.ts
|
|
875
|
+
declare function readOdsContent(pkg: Package$2): ContentDocument;
|
|
876
|
+
//#endregion
|
|
691
877
|
//#region src/pdf/measure.d.ts
|
|
692
878
|
interface UnderlineMetrics {
|
|
693
879
|
readonly offsetPt: number;
|
|
@@ -720,6 +906,16 @@ type PresentationContentDocument = Extract<ContentDocument, {
|
|
|
720
906
|
}>;
|
|
721
907
|
declare function convertPresentationToLayout(doc: PresentationContentDocument, options: SlidesLayoutOptions): LayoutDocument$1;
|
|
722
908
|
//#endregion
|
|
909
|
+
//#region src/layout/sheets.d.ts
|
|
910
|
+
interface SheetsLayoutOptions {
|
|
911
|
+
readonly measurer: TextMeasurer;
|
|
912
|
+
readonly signal?: AbortSignal;
|
|
913
|
+
}
|
|
914
|
+
type SpreadsheetContentDocument = Extract<ContentDocument, {
|
|
915
|
+
kind: 'spreadsheet';
|
|
916
|
+
}>;
|
|
917
|
+
declare function convertSpreadsheetToLayout(doc: SpreadsheetContentDocument, options: SheetsLayoutOptions): LayoutDocument$1;
|
|
918
|
+
//#endregion
|
|
723
919
|
//#region src/layout/reconstruct.d.ts
|
|
724
920
|
interface ReconstructOptions {
|
|
725
921
|
readonly signal?: AbortSignal;
|
|
@@ -738,6 +934,7 @@ declare function docxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToP
|
|
|
738
934
|
declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
739
935
|
declare function pptxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
740
936
|
declare function odpToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
937
|
+
declare function odsToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
741
938
|
interface PdfToDocumentOptions {
|
|
742
939
|
readonly signal?: AbortSignal;
|
|
743
940
|
readonly sink?: PdfDiagnosticSink;
|
|
@@ -754,7 +951,7 @@ declare const odtPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8
|
|
|
754
951
|
declare const odpPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
755
952
|
//#endregion
|
|
756
953
|
//#region src/convert/port.d.ts
|
|
757
|
-
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'pdf';
|
|
954
|
+
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'pdf';
|
|
758
955
|
interface DocumentPayload {
|
|
759
956
|
readonly format: DocumentFormat;
|
|
760
957
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -797,4 +994,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
797
994
|
//#region src/ports/abort.d.ts
|
|
798
995
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
799
996
|
//#endregion
|
|
800
|
-
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, 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, 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 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, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertPresentationToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odpPdfCodec, odpToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdpContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|
|
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 };
|
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, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, 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, 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";
|
|
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
|
|
@@ -68,6 +68,142 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
68
68
|
}, z.core.$strip>>;
|
|
69
69
|
notes: z.ZodString;
|
|
70
70
|
}, z.core.$strip>>;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"spreadsheet">;
|
|
73
|
+
formatVersion: z.ZodLiteral<1>;
|
|
74
|
+
metadata: z.ZodObject<{
|
|
75
|
+
title: z.ZodOptional<z.ZodString>;
|
|
76
|
+
author: z.ZodOptional<z.ZodString>;
|
|
77
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
78
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
80
|
+
producer: z.ZodOptional<z.ZodString>;
|
|
81
|
+
createdIso: z.ZodOptional<z.ZodString>;
|
|
82
|
+
modifiedIso: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
sheets: z.ZodArray<z.ZodObject<{
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
cells: z.ZodArray<z.ZodObject<{
|
|
87
|
+
row: z.ZodNumber;
|
|
88
|
+
column: z.ZodNumber;
|
|
89
|
+
value: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"number">;
|
|
91
|
+
value: z.ZodNumber;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"percentage">;
|
|
94
|
+
value: z.ZodNumber;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
kind: z.ZodLiteral<"currency">;
|
|
97
|
+
value: z.ZodNumber;
|
|
98
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
+
kind: z.ZodLiteral<"boolean">;
|
|
101
|
+
value: z.ZodBoolean;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
kind: z.ZodLiteral<"date">;
|
|
104
|
+
value: z.ZodString;
|
|
105
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
+
kind: z.ZodLiteral<"time">;
|
|
107
|
+
value: z.ZodString;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
kind: z.ZodLiteral<"string">;
|
|
110
|
+
value: z.ZodString;
|
|
111
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
+
kind: z.ZodLiteral<"error">;
|
|
113
|
+
value: z.ZodString;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
kind: z.ZodLiteral<"empty">;
|
|
116
|
+
}, z.core.$strip>], "kind">;
|
|
117
|
+
formula: z.ZodOptional<z.ZodString>;
|
|
118
|
+
displayText: z.ZodString;
|
|
119
|
+
runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
|
+
text: z.ZodString;
|
|
121
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
strike: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
126
|
+
sizePt: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
r: z.ZodNumber;
|
|
129
|
+
g: z.ZodNumber;
|
|
130
|
+
b: z.ZodNumber;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
hyperlink: z.ZodOptional<z.ZodString>;
|
|
133
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>>>;
|
|
135
|
+
colSpan: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
rowSpan: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
139
|
+
index: z.ZodNumber;
|
|
140
|
+
widthPt: z.ZodNumber;
|
|
141
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
144
|
+
index: z.ZodNumber;
|
|
145
|
+
heightPt: z.ZodNumber;
|
|
146
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
images: z.ZodArray<z.ZodObject<{
|
|
149
|
+
kind: z.ZodLiteral<"image">;
|
|
150
|
+
format: z.ZodEnum<{
|
|
151
|
+
png: "png";
|
|
152
|
+
jpeg: "jpeg";
|
|
153
|
+
}>;
|
|
154
|
+
base64: z.ZodString;
|
|
155
|
+
widthPt: z.ZodNumber;
|
|
156
|
+
heightPt: z.ZodNumber;
|
|
157
|
+
altText: z.ZodOptional<z.ZodString>;
|
|
158
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
159
|
+
anchorRow: z.ZodNumber;
|
|
160
|
+
anchorColumn: z.ZodNumber;
|
|
161
|
+
offsetXPt: z.ZodNumber;
|
|
162
|
+
offsetYPt: z.ZodNumber;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
printSettings: z.ZodObject<{
|
|
165
|
+
pageSize: z.ZodObject<{
|
|
166
|
+
widthPt: z.ZodNumber;
|
|
167
|
+
heightPt: z.ZodNumber;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
margins: z.ZodObject<{
|
|
170
|
+
topPt: z.ZodNumber;
|
|
171
|
+
rightPt: z.ZodNumber;
|
|
172
|
+
bottomPt: z.ZodNumber;
|
|
173
|
+
leftPt: z.ZodNumber;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
printRange: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
startRow: z.ZodNumber;
|
|
177
|
+
startColumn: z.ZodNumber;
|
|
178
|
+
endRow: z.ZodNumber;
|
|
179
|
+
endColumn: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
fitToPages: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
width: z.ZodNumber;
|
|
184
|
+
height: z.ZodNumber;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
repeatRows: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
start: z.ZodNumber;
|
|
188
|
+
end: z.ZodNumber;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
repeatColumns: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
start: z.ZodNumber;
|
|
192
|
+
end: z.ZodNumber;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
gridlines: z.ZodBoolean;
|
|
195
|
+
headers: z.ZodBoolean;
|
|
196
|
+
pageOrder: z.ZodEnum<{
|
|
197
|
+
downThenOver: "downThenOver";
|
|
198
|
+
overThenDown: "overThenDown";
|
|
199
|
+
}>;
|
|
200
|
+
manualBreaks: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
rows: z.ZodArray<z.ZodNumber>;
|
|
202
|
+
columns: z.ZodArray<z.ZodNumber>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
embeddedObjects: z.ZodOptional<z.ZodArray<z.ZodCustom<import("document-content-model").ContentEmbeddedObject, import("document-content-model").ContentEmbeddedObject>>>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
71
207
|
}, z.core.$strip>], "kind">;
|
|
72
208
|
type ContentDocument = z.infer<typeof ContentDocumentSchema>;
|
|
73
209
|
//#endregion
|
|
@@ -509,6 +645,53 @@ declare function createOdp(): OdpEditor;
|
|
|
509
645
|
//#region src/edit/odp/content.d.ts
|
|
510
646
|
declare function buildOdpPackage(content: ContentDocument): Package$2;
|
|
511
647
|
//#endregion
|
|
648
|
+
//#region src/edit/ods/cell.d.ts
|
|
649
|
+
declare class OdsCell {
|
|
650
|
+
private readonly node;
|
|
651
|
+
private readonly pkg;
|
|
652
|
+
constructor(node: XmlElement$2, pkg: Package$2);
|
|
653
|
+
get value(): ContentCellValue$1;
|
|
654
|
+
set value(value: ContentCellValue$1);
|
|
655
|
+
get formula(): string | undefined;
|
|
656
|
+
set formula(value: string | undefined);
|
|
657
|
+
get displayText(): string;
|
|
658
|
+
set displayText(value: string);
|
|
659
|
+
setStyledRuns(runs: readonly ContentRun$1[]): void;
|
|
660
|
+
}
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/edit/ods/sheet.d.ts
|
|
663
|
+
declare class OdsSheet {
|
|
664
|
+
private readonly container;
|
|
665
|
+
private readonly node;
|
|
666
|
+
private readonly pkg;
|
|
667
|
+
private removed;
|
|
668
|
+
constructor(container: XmlNode$2[], node: XmlElement$2, pkg: Package$2);
|
|
669
|
+
private live;
|
|
670
|
+
get name(): string;
|
|
671
|
+
set name(value: string);
|
|
672
|
+
cell(row: number, column: number): OdsCell;
|
|
673
|
+
cellAt(reference: string): OdsCell;
|
|
674
|
+
mergeCells(startRow: number, startColumn: number, rowSpan: number, colSpan: number): OdsCell;
|
|
675
|
+
remove(): void;
|
|
676
|
+
}
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/edit/ods/editor.d.ts
|
|
679
|
+
declare class OdsEditor {
|
|
680
|
+
private readonly pkg;
|
|
681
|
+
constructor(pkg: Package$2);
|
|
682
|
+
sheets(): OdsSheet[];
|
|
683
|
+
sheet(name: string): OdsSheet;
|
|
684
|
+
addSheet(name: string): OdsSheet;
|
|
685
|
+
removeSheetAt(index: number): void;
|
|
686
|
+
toPackage(): Package$2;
|
|
687
|
+
toBytes(): Uint8Array<ArrayBuffer>;
|
|
688
|
+
}
|
|
689
|
+
declare function openOds(bytes: Uint8Array<ArrayBuffer>): OdsEditor;
|
|
690
|
+
declare function createOds(): OdsEditor;
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region src/edit/ods/content.d.ts
|
|
693
|
+
declare function buildOdsPackage(content: ContentDocument): Package$2;
|
|
694
|
+
//#endregion
|
|
512
695
|
//#region src/pdf/diagnostics.d.ts
|
|
513
696
|
type PdfDiagnosticSeverity = 'info' | 'warning';
|
|
514
697
|
interface PdfDiagnostic {
|
|
@@ -688,6 +871,9 @@ declare function readOdtContent(pkg: Package$2): ContentDocument;
|
|
|
688
871
|
//#region src/odf/odp/read.d.ts
|
|
689
872
|
declare function readOdpContent(pkg: Package$2): ContentDocument;
|
|
690
873
|
//#endregion
|
|
874
|
+
//#region src/odf/ods/read.d.ts
|
|
875
|
+
declare function readOdsContent(pkg: Package$2): ContentDocument;
|
|
876
|
+
//#endregion
|
|
691
877
|
//#region src/pdf/measure.d.ts
|
|
692
878
|
interface UnderlineMetrics {
|
|
693
879
|
readonly offsetPt: number;
|
|
@@ -720,6 +906,16 @@ type PresentationContentDocument = Extract<ContentDocument, {
|
|
|
720
906
|
}>;
|
|
721
907
|
declare function convertPresentationToLayout(doc: PresentationContentDocument, options: SlidesLayoutOptions): LayoutDocument$1;
|
|
722
908
|
//#endregion
|
|
909
|
+
//#region src/layout/sheets.d.ts
|
|
910
|
+
interface SheetsLayoutOptions {
|
|
911
|
+
readonly measurer: TextMeasurer;
|
|
912
|
+
readonly signal?: AbortSignal;
|
|
913
|
+
}
|
|
914
|
+
type SpreadsheetContentDocument = Extract<ContentDocument, {
|
|
915
|
+
kind: 'spreadsheet';
|
|
916
|
+
}>;
|
|
917
|
+
declare function convertSpreadsheetToLayout(doc: SpreadsheetContentDocument, options: SheetsLayoutOptions): LayoutDocument$1;
|
|
918
|
+
//#endregion
|
|
723
919
|
//#region src/layout/reconstruct.d.ts
|
|
724
920
|
interface ReconstructOptions {
|
|
725
921
|
readonly signal?: AbortSignal;
|
|
@@ -738,6 +934,7 @@ declare function docxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToP
|
|
|
738
934
|
declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
739
935
|
declare function pptxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
740
936
|
declare function odpToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
937
|
+
declare function odsToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
741
938
|
interface PdfToDocumentOptions {
|
|
742
939
|
readonly signal?: AbortSignal;
|
|
743
940
|
readonly sink?: PdfDiagnosticSink;
|
|
@@ -754,7 +951,7 @@ declare const odtPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8
|
|
|
754
951
|
declare const odpPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
755
952
|
//#endregion
|
|
756
953
|
//#region src/convert/port.d.ts
|
|
757
|
-
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'pdf';
|
|
954
|
+
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'pdf';
|
|
758
955
|
interface DocumentPayload {
|
|
759
956
|
readonly format: DocumentFormat;
|
|
760
957
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -797,4 +994,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
797
994
|
//#region src/ports/abort.d.ts
|
|
798
995
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
799
996
|
//#endregion
|
|
800
|
-
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, 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, 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 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, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertPresentationToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdp, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odpPdfCodec, odpToPdf, odtPdfCodec, odtToPdf, openDocx, openOdp, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdp, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToPdf, readDocxContent, readOdpContent, readOdtContent, readPdf, readPptxContent, reconstructPresentation, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xmlCodec, zipPackage };
|
|
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 };
|