documents.js 1.43.1 → 1.45.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 +41 -12
- package/dist/index.cjs +1060 -250
- package/dist/index.d.cts +328 -7
- package/dist/index.d.ts +328 -7
- package/dist/index.js +1035 -272
- 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, 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, ContentPathPoint as ContentPathPoint$1, 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, ContentStroke as ContentStroke$1, ContentStrokeSchema, ContentSubpath, ContentSubpath as ContentSubpath$1, 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
|
|
@@ -389,7 +544,7 @@ interface DrawingParagraphInit {
|
|
|
389
544
|
}
|
|
390
545
|
//#endregion
|
|
391
546
|
//#region src/edit/pptx/slide.d.ts
|
|
392
|
-
interface TextBoxInit$
|
|
547
|
+
interface TextBoxInit$2 {
|
|
393
548
|
readonly frame: Box;
|
|
394
549
|
readonly text: string;
|
|
395
550
|
}
|
|
@@ -409,7 +564,7 @@ declare class PptxSlide {
|
|
|
409
564
|
constructor(container: XmlNode$1[], node: XmlElement$1, context: SlideContext$1);
|
|
410
565
|
private live;
|
|
411
566
|
shapes(): PptxShape[];
|
|
412
|
-
addTextBox(init: TextBoxInit$
|
|
567
|
+
addTextBox(init: TextBoxInit$2): PptxShape;
|
|
413
568
|
addImage(init: SlideImageInit$1): PptxShape;
|
|
414
569
|
get notes(): string;
|
|
415
570
|
set notes(value: string);
|
|
@@ -601,7 +756,7 @@ declare class OdpShape {
|
|
|
601
756
|
}
|
|
602
757
|
//#endregion
|
|
603
758
|
//#region src/edit/odp/slide.d.ts
|
|
604
|
-
interface TextBoxInit {
|
|
759
|
+
interface TextBoxInit$1 {
|
|
605
760
|
readonly frame: Box;
|
|
606
761
|
readonly text: string;
|
|
607
762
|
}
|
|
@@ -619,7 +774,7 @@ declare class OdpSlide {
|
|
|
619
774
|
constructor(container: XmlNode$2[], node: XmlElement$2, context: SlideContext);
|
|
620
775
|
private live;
|
|
621
776
|
shapes(): OdpShape[];
|
|
622
|
-
addTextBox(init: TextBoxInit): OdpShape;
|
|
777
|
+
addTextBox(init: TextBoxInit$1): OdpShape;
|
|
623
778
|
addImage(init: SlideImageInit): OdpShape;
|
|
624
779
|
get notes(): string;
|
|
625
780
|
set notes(value: string);
|
|
@@ -692,6 +847,121 @@ declare function createOds(): OdsEditor;
|
|
|
692
847
|
//#region src/edit/ods/content.d.ts
|
|
693
848
|
declare function buildOdsPackage(content: ContentDocument): Package$2;
|
|
694
849
|
//#endregion
|
|
850
|
+
//#region src/edit/odg/vector.d.ts
|
|
851
|
+
interface BoxVectorInit {
|
|
852
|
+
readonly frame: Box$1;
|
|
853
|
+
readonly fill?: Color;
|
|
854
|
+
readonly stroke?: ContentStroke$1;
|
|
855
|
+
}
|
|
856
|
+
type OdgBoxVectorKind = 'rect' | 'ellipse';
|
|
857
|
+
declare class OdgBoxVector {
|
|
858
|
+
private readonly container;
|
|
859
|
+
private readonly node;
|
|
860
|
+
private readonly pkg;
|
|
861
|
+
private removed;
|
|
862
|
+
constructor(container: XmlNode$2[], node: XmlElement$2, pkg: Package$2);
|
|
863
|
+
private live;
|
|
864
|
+
get kind(): OdgBoxVectorKind;
|
|
865
|
+
get name(): string | undefined;
|
|
866
|
+
get frame(): Box$1 | undefined;
|
|
867
|
+
set frame(value: Box$1);
|
|
868
|
+
get fill(): Color | undefined;
|
|
869
|
+
set fill(value: Color | undefined);
|
|
870
|
+
get stroke(): ContentStroke$1 | undefined;
|
|
871
|
+
set stroke(value: ContentStroke$1 | undefined);
|
|
872
|
+
remove(): void;
|
|
873
|
+
}
|
|
874
|
+
interface LineVectorInit {
|
|
875
|
+
readonly from: ContentPathPoint$1;
|
|
876
|
+
readonly to: ContentPathPoint$1;
|
|
877
|
+
readonly stroke: ContentStroke$1;
|
|
878
|
+
}
|
|
879
|
+
declare class OdgLineVector {
|
|
880
|
+
private readonly container;
|
|
881
|
+
private readonly node;
|
|
882
|
+
private readonly pkg;
|
|
883
|
+
private removed;
|
|
884
|
+
constructor(container: XmlNode$2[], node: XmlElement$2, pkg: Package$2);
|
|
885
|
+
private live;
|
|
886
|
+
get name(): string | undefined;
|
|
887
|
+
get from(): ContentPathPoint$1 | undefined;
|
|
888
|
+
set from(value: ContentPathPoint$1);
|
|
889
|
+
get to(): ContentPathPoint$1 | undefined;
|
|
890
|
+
set to(value: ContentPathPoint$1);
|
|
891
|
+
get stroke(): ContentStroke$1 | undefined;
|
|
892
|
+
set stroke(value: ContentStroke$1);
|
|
893
|
+
remove(): void;
|
|
894
|
+
}
|
|
895
|
+
interface PathVectorInit {
|
|
896
|
+
readonly frame: Box$1;
|
|
897
|
+
readonly subpaths: readonly ContentSubpath$1[];
|
|
898
|
+
readonly fill?: Color;
|
|
899
|
+
readonly stroke?: ContentStroke$1;
|
|
900
|
+
}
|
|
901
|
+
declare class OdgPathVector {
|
|
902
|
+
private readonly container;
|
|
903
|
+
private readonly node;
|
|
904
|
+
private readonly pkg;
|
|
905
|
+
private removed;
|
|
906
|
+
constructor(container: XmlNode$2[], node: XmlElement$2, pkg: Package$2);
|
|
907
|
+
private live;
|
|
908
|
+
get name(): string | undefined;
|
|
909
|
+
get frame(): Box$1 | undefined;
|
|
910
|
+
set frame(value: Box$1);
|
|
911
|
+
get fill(): Color | undefined;
|
|
912
|
+
set fill(value: Color | undefined);
|
|
913
|
+
get stroke(): ContentStroke$1 | undefined;
|
|
914
|
+
set stroke(value: ContentStroke$1 | undefined);
|
|
915
|
+
get subpaths(): ContentSubpath$1[];
|
|
916
|
+
remove(): void;
|
|
917
|
+
}
|
|
918
|
+
//#endregion
|
|
919
|
+
//#region src/edit/odg/page.d.ts
|
|
920
|
+
interface TextBoxInit {
|
|
921
|
+
readonly frame: Box$1;
|
|
922
|
+
readonly text: string;
|
|
923
|
+
}
|
|
924
|
+
interface PageImageInit extends ImageInit {
|
|
925
|
+
readonly frame: Box$1;
|
|
926
|
+
}
|
|
927
|
+
interface PageContext {
|
|
928
|
+
readonly pkg: Package$2;
|
|
929
|
+
}
|
|
930
|
+
declare class OdgPage {
|
|
931
|
+
private readonly container;
|
|
932
|
+
private readonly node;
|
|
933
|
+
private readonly context;
|
|
934
|
+
private removed;
|
|
935
|
+
constructor(container: XmlNode$2[], node: XmlElement$2, context: PageContext);
|
|
936
|
+
private live;
|
|
937
|
+
shapes(): OdpShape[];
|
|
938
|
+
addTextBox(init: TextBoxInit): OdpShape;
|
|
939
|
+
addImage(init: PageImageInit): OdpShape;
|
|
940
|
+
addRect(init: BoxVectorInit): OdgBoxVector;
|
|
941
|
+
addEllipse(init: BoxVectorInit): OdgBoxVector;
|
|
942
|
+
addLine(init: LineVectorInit): OdgLineVector;
|
|
943
|
+
addPath(init: PathVectorInit): OdgPathVector;
|
|
944
|
+
remove(): void;
|
|
945
|
+
}
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region src/edit/odg/editor.d.ts
|
|
948
|
+
declare class OdgEditor {
|
|
949
|
+
private readonly pkg;
|
|
950
|
+
constructor(pkg: Package$2);
|
|
951
|
+
pages(): OdgPage[];
|
|
952
|
+
addPage(): OdgPage;
|
|
953
|
+
removePageAt(index: number): void;
|
|
954
|
+
get pageSize(): PageSize;
|
|
955
|
+
set pageSize(size: PageSize);
|
|
956
|
+
toPackage(): Package$2;
|
|
957
|
+
toBytes(): Uint8Array<ArrayBuffer>;
|
|
958
|
+
}
|
|
959
|
+
declare function openOdg(bytes: Uint8Array<ArrayBuffer>): OdgEditor;
|
|
960
|
+
declare function createOdg(): OdgEditor;
|
|
961
|
+
//#endregion
|
|
962
|
+
//#region src/edit/odg/content.d.ts
|
|
963
|
+
declare function buildOdgPackage(content: ContentDocument): Package$2;
|
|
964
|
+
//#endregion
|
|
695
965
|
//#region src/pdf/diagnostics.d.ts
|
|
696
966
|
type PdfDiagnosticSeverity = 'info' | 'warning';
|
|
697
967
|
interface PdfDiagnostic {
|
|
@@ -837,6 +1107,44 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
837
1107
|
widthPt: z.ZodNumber;
|
|
838
1108
|
}, z.core.$strip>>;
|
|
839
1109
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
1110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1111
|
+
kind: z.ZodLiteral<"path">;
|
|
1112
|
+
subpaths: z.ZodArray<z.ZodObject<{
|
|
1113
|
+
startXPt: z.ZodNumber;
|
|
1114
|
+
startYPt: z.ZodNumber;
|
|
1115
|
+
segments: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1116
|
+
kind: z.ZodLiteral<"line">;
|
|
1117
|
+
xPt: z.ZodNumber;
|
|
1118
|
+
yPt: z.ZodNumber;
|
|
1119
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1120
|
+
kind: z.ZodLiteral<"cubic">;
|
|
1121
|
+
c1xPt: z.ZodNumber;
|
|
1122
|
+
c1yPt: z.ZodNumber;
|
|
1123
|
+
c2xPt: z.ZodNumber;
|
|
1124
|
+
c2yPt: z.ZodNumber;
|
|
1125
|
+
xPt: z.ZodNumber;
|
|
1126
|
+
yPt: z.ZodNumber;
|
|
1127
|
+
}, z.core.$strip>], "kind">>;
|
|
1128
|
+
closed: z.ZodBoolean;
|
|
1129
|
+
}, z.core.$strip>>;
|
|
1130
|
+
fill: z.ZodOptional<z.ZodObject<{
|
|
1131
|
+
r: z.ZodNumber;
|
|
1132
|
+
g: z.ZodNumber;
|
|
1133
|
+
b: z.ZodNumber;
|
|
1134
|
+
}, z.core.$strip>>;
|
|
1135
|
+
fillRule: z.ZodOptional<z.ZodEnum<{
|
|
1136
|
+
nonzero: "nonzero";
|
|
1137
|
+
evenodd: "evenodd";
|
|
1138
|
+
}>>;
|
|
1139
|
+
stroke: z.ZodOptional<z.ZodObject<{
|
|
1140
|
+
color: z.ZodObject<{
|
|
1141
|
+
r: z.ZodNumber;
|
|
1142
|
+
g: z.ZodNumber;
|
|
1143
|
+
b: z.ZodNumber;
|
|
1144
|
+
}, z.core.$strip>;
|
|
1145
|
+
widthPt: z.ZodNumber;
|
|
1146
|
+
}, z.core.$strip>>;
|
|
1147
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
840
1148
|
}, z.core.$strip>, z.ZodObject<{
|
|
841
1149
|
kind: z.ZodLiteral<"link">;
|
|
842
1150
|
uri: z.ZodString;
|
|
@@ -874,6 +1182,9 @@ declare function readOdpContent(pkg: Package$2): ContentDocument;
|
|
|
874
1182
|
//#region src/odf/ods/read.d.ts
|
|
875
1183
|
declare function readOdsContent(pkg: Package$2): ContentDocument;
|
|
876
1184
|
//#endregion
|
|
1185
|
+
//#region src/odf/odg/read.d.ts
|
|
1186
|
+
declare function readOdgContent(pkg: Package$2): ContentDocument;
|
|
1187
|
+
//#endregion
|
|
877
1188
|
//#region src/pdf/measure.d.ts
|
|
878
1189
|
interface UnderlineMetrics {
|
|
879
1190
|
readonly offsetPt: number;
|
|
@@ -916,6 +1227,15 @@ type SpreadsheetContentDocument = Extract<ContentDocument, {
|
|
|
916
1227
|
}>;
|
|
917
1228
|
declare function convertSpreadsheetToLayout(doc: SpreadsheetContentDocument, options: SheetsLayoutOptions): LayoutDocument$1;
|
|
918
1229
|
//#endregion
|
|
1230
|
+
//#region src/layout/drawing.d.ts
|
|
1231
|
+
interface DrawingLayoutOptions {
|
|
1232
|
+
readonly measurer: TextMeasurer;
|
|
1233
|
+
}
|
|
1234
|
+
type DrawingContentDocument = Extract<ContentDocument, {
|
|
1235
|
+
kind: 'drawing';
|
|
1236
|
+
}>;
|
|
1237
|
+
declare function convertDrawingToLayout(doc: DrawingContentDocument, options: DrawingLayoutOptions): LayoutDocument$1;
|
|
1238
|
+
//#endregion
|
|
919
1239
|
//#region src/layout/reconstruct.d.ts
|
|
920
1240
|
interface ReconstructOptions {
|
|
921
1241
|
readonly signal?: AbortSignal;
|
|
@@ -935,6 +1255,7 @@ declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPd
|
|
|
935
1255
|
declare function pptxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
936
1256
|
declare function odpToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
937
1257
|
declare function odsToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1258
|
+
declare function odgToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
938
1259
|
interface PdfToDocumentOptions {
|
|
939
1260
|
readonly signal?: AbortSignal;
|
|
940
1261
|
readonly sink?: PdfDiagnosticSink;
|
|
@@ -951,7 +1272,7 @@ declare const odtPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8
|
|
|
951
1272
|
declare const odpPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
952
1273
|
//#endregion
|
|
953
1274
|
//#region src/convert/port.d.ts
|
|
954
|
-
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'pdf';
|
|
1275
|
+
type DocumentFormat = 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'odg' | 'pdf';
|
|
955
1276
|
interface DocumentPayload {
|
|
956
1277
|
readonly format: DocumentFormat;
|
|
957
1278
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -994,4 +1315,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
994
1315
|
//#region src/ports/abort.d.ts
|
|
995
1316
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
996
1317
|
//#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$
|
|
1318
|
+
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, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 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$2 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, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, 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, openOdg, 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 };
|