documents.js 1.33.0 → 1.33.2
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 +3 -3
- package/dist/index.cjs +73 -1246
- package/dist/index.d.cts +14 -54
- package/dist/index.d.ts +14 -54
- package/dist/index.js +18 -1221
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
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";
|
|
1
|
+
import { Alignment, Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Box, Box as Box$1, COLOR_BLACK, Color as LayoutColor, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, Package, Package as Package$1, PackageSchema, PageSize, Part, PartSchema, Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, 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, rgbHexToColor, rootElement, serializePackage, textContent, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
//#region src/model/color.d.ts
|
|
4
|
-
declare const LayoutColorSchema: z.ZodObject<{
|
|
5
|
-
r: z.ZodNumber;
|
|
6
|
-
g: z.ZodNumber;
|
|
7
|
-
b: z.ZodNumber;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
type LayoutColor = z.infer<typeof LayoutColorSchema>;
|
|
10
|
-
declare const COLOR_BLACK: LayoutColor;
|
|
11
|
-
declare function rgbHexToColor(hex: string): LayoutColor;
|
|
12
|
-
//#endregion
|
|
13
3
|
//#region src/model/content.d.ts
|
|
14
4
|
declare const CONTENT_FORMAT_VERSION = 1;
|
|
15
5
|
declare const ContentRunSchema: z.ZodObject<{
|
|
@@ -275,12 +265,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
275
265
|
font: z.ZodObject<{
|
|
276
266
|
family: z.ZodString;
|
|
277
267
|
weight: z.ZodEnum<{
|
|
278
|
-
bold: "bold";
|
|
279
268
|
normal: "normal";
|
|
269
|
+
bold: "bold";
|
|
280
270
|
}>;
|
|
281
271
|
style: z.ZodEnum<{
|
|
282
|
-
italic: "italic";
|
|
283
272
|
normal: "normal";
|
|
273
|
+
italic: "italic";
|
|
284
274
|
}>;
|
|
285
275
|
}, z.core.$strip>;
|
|
286
276
|
sizePt: z.ZodNumber;
|
|
@@ -377,12 +367,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
377
367
|
font: z.ZodObject<{
|
|
378
368
|
family: z.ZodString;
|
|
379
369
|
weight: z.ZodEnum<{
|
|
380
|
-
bold: "bold";
|
|
381
370
|
normal: "normal";
|
|
371
|
+
bold: "bold";
|
|
382
372
|
}>;
|
|
383
373
|
style: z.ZodEnum<{
|
|
384
|
-
italic: "italic";
|
|
385
374
|
normal: "normal";
|
|
375
|
+
italic: "italic";
|
|
386
376
|
}>;
|
|
387
377
|
}, z.core.$strip>;
|
|
388
378
|
sizePt: z.ZodNumber;
|
|
@@ -472,12 +462,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
472
462
|
font: z.ZodObject<{
|
|
473
463
|
family: z.ZodString;
|
|
474
464
|
weight: z.ZodEnum<{
|
|
475
|
-
bold: "bold";
|
|
476
465
|
normal: "normal";
|
|
466
|
+
bold: "bold";
|
|
477
467
|
}>;
|
|
478
468
|
style: z.ZodEnum<{
|
|
479
|
-
italic: "italic";
|
|
480
469
|
normal: "normal";
|
|
470
|
+
italic: "italic";
|
|
481
471
|
}>;
|
|
482
472
|
}, z.core.$strip>;
|
|
483
473
|
sizePt: z.ZodNumber;
|
|
@@ -601,12 +591,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
601
591
|
font: z.ZodObject<{
|
|
602
592
|
family: z.ZodString;
|
|
603
593
|
weight: z.ZodEnum<{
|
|
604
|
-
bold: "bold";
|
|
605
594
|
normal: "normal";
|
|
595
|
+
bold: "bold";
|
|
606
596
|
}>;
|
|
607
597
|
style: z.ZodEnum<{
|
|
608
|
-
italic: "italic";
|
|
609
598
|
normal: "normal";
|
|
599
|
+
italic: "italic";
|
|
610
600
|
}>;
|
|
611
601
|
}, z.core.$strip>;
|
|
612
602
|
sizePt: z.ZodNumber;
|
|
@@ -698,52 +688,22 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
698
688
|
type LayoutDocument = z.infer<typeof LayoutDocumentSchema>;
|
|
699
689
|
//#endregion
|
|
700
690
|
//#region src/model/geometry.d.ts
|
|
701
|
-
declare
|
|
702
|
-
xPt: z.ZodNumber;
|
|
703
|
-
yPt: z.ZodNumber;
|
|
704
|
-
widthPt: z.ZodNumber;
|
|
705
|
-
heightPt: z.ZodNumber;
|
|
706
|
-
}, z.core.$strip>;
|
|
707
|
-
type Box = z.infer<typeof BoxSchema>;
|
|
708
|
-
declare const PageSizeSchema: z.ZodObject<{
|
|
709
|
-
widthPt: z.ZodNumber;
|
|
710
|
-
heightPt: z.ZodNumber;
|
|
711
|
-
}, z.core.$strip>;
|
|
712
|
-
type PageSize = z.infer<typeof PageSizeSchema>;
|
|
713
|
-
declare const MarginsSchema: z.ZodObject<{
|
|
714
|
-
topPt: z.ZodNumber;
|
|
715
|
-
rightPt: z.ZodNumber;
|
|
716
|
-
bottomPt: z.ZodNumber;
|
|
717
|
-
leftPt: z.ZodNumber;
|
|
718
|
-
}, z.core.$strip>;
|
|
719
|
-
type Margins = z.infer<typeof MarginsSchema>;
|
|
720
|
-
declare const PAGE_SIZE_LETTER: PageSize;
|
|
721
|
-
declare const PAGE_SIZE_A4: PageSize;
|
|
722
|
-
declare const SLIDE_SIZE_WIDESCREEN: PageSize;
|
|
723
|
-
declare const SLIDE_SIZE_STANDARD: PageSize;
|
|
724
|
-
declare function flipY(box: Box, containerHeightPt: number): Box;
|
|
691
|
+
declare function flipY(box: Box$1, containerHeightPt: number): Box$1;
|
|
725
692
|
//#endregion
|
|
726
693
|
//#region src/model/style.d.ts
|
|
727
694
|
declare const LayoutFontSchema: z.ZodObject<{
|
|
728
695
|
family: z.ZodString;
|
|
729
696
|
weight: z.ZodEnum<{
|
|
730
|
-
bold: "bold";
|
|
731
697
|
normal: "normal";
|
|
698
|
+
bold: "bold";
|
|
732
699
|
}>;
|
|
733
700
|
style: z.ZodEnum<{
|
|
734
|
-
italic: "italic";
|
|
735
701
|
normal: "normal";
|
|
702
|
+
italic: "italic";
|
|
736
703
|
}>;
|
|
737
704
|
}, z.core.$strip>;
|
|
738
705
|
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
739
706
|
declare const DEFAULT_LAYOUT_FONT: LayoutFont;
|
|
740
|
-
declare const AlignmentSchema: z.ZodEnum<{
|
|
741
|
-
left: "left";
|
|
742
|
-
center: "center";
|
|
743
|
-
right: "right";
|
|
744
|
-
justify: "justify";
|
|
745
|
-
}>;
|
|
746
|
-
type Alignment = z.infer<typeof AlignmentSchema>;
|
|
747
707
|
//#endregion
|
|
748
708
|
//#region src/model/bytes.d.ts
|
|
749
709
|
declare const DocxBytesSchema: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
@@ -1031,12 +991,12 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
1031
991
|
font: z.ZodObject<{
|
|
1032
992
|
family: z.ZodString;
|
|
1033
993
|
weight: z.ZodEnum<{
|
|
1034
|
-
bold: "bold";
|
|
1035
994
|
normal: "normal";
|
|
995
|
+
bold: "bold";
|
|
1036
996
|
}>;
|
|
1037
997
|
style: z.ZodEnum<{
|
|
1038
|
-
italic: "italic";
|
|
1039
998
|
normal: "normal";
|
|
999
|
+
italic: "italic";
|
|
1040
1000
|
}>;
|
|
1041
1001
|
}, z.core.$strip>;
|
|
1042
1002
|
sizePt: z.ZodNumber;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
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";
|
|
1
|
+
import { Alignment, Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Box, Box as Box$1, COLOR_BLACK, Color as LayoutColor, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, Package, Package as Package$1, PackageSchema, PageSize, Part, PartSchema, Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, 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, rgbHexToColor, rootElement, serializePackage, textContent, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
//#region src/model/color.d.ts
|
|
4
|
-
declare const LayoutColorSchema: z.ZodObject<{
|
|
5
|
-
r: z.ZodNumber;
|
|
6
|
-
g: z.ZodNumber;
|
|
7
|
-
b: z.ZodNumber;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
type LayoutColor = z.infer<typeof LayoutColorSchema>;
|
|
10
|
-
declare const COLOR_BLACK: LayoutColor;
|
|
11
|
-
declare function rgbHexToColor(hex: string): LayoutColor;
|
|
12
|
-
//#endregion
|
|
13
3
|
//#region src/model/content.d.ts
|
|
14
4
|
declare const CONTENT_FORMAT_VERSION = 1;
|
|
15
5
|
declare const ContentRunSchema: z.ZodObject<{
|
|
@@ -275,12 +265,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
275
265
|
font: z.ZodObject<{
|
|
276
266
|
family: z.ZodString;
|
|
277
267
|
weight: z.ZodEnum<{
|
|
278
|
-
bold: "bold";
|
|
279
268
|
normal: "normal";
|
|
269
|
+
bold: "bold";
|
|
280
270
|
}>;
|
|
281
271
|
style: z.ZodEnum<{
|
|
282
|
-
italic: "italic";
|
|
283
272
|
normal: "normal";
|
|
273
|
+
italic: "italic";
|
|
284
274
|
}>;
|
|
285
275
|
}, z.core.$strip>;
|
|
286
276
|
sizePt: z.ZodNumber;
|
|
@@ -377,12 +367,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
377
367
|
font: z.ZodObject<{
|
|
378
368
|
family: z.ZodString;
|
|
379
369
|
weight: z.ZodEnum<{
|
|
380
|
-
bold: "bold";
|
|
381
370
|
normal: "normal";
|
|
371
|
+
bold: "bold";
|
|
382
372
|
}>;
|
|
383
373
|
style: z.ZodEnum<{
|
|
384
|
-
italic: "italic";
|
|
385
374
|
normal: "normal";
|
|
375
|
+
italic: "italic";
|
|
386
376
|
}>;
|
|
387
377
|
}, z.core.$strip>;
|
|
388
378
|
sizePt: z.ZodNumber;
|
|
@@ -472,12 +462,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
472
462
|
font: z.ZodObject<{
|
|
473
463
|
family: z.ZodString;
|
|
474
464
|
weight: z.ZodEnum<{
|
|
475
|
-
bold: "bold";
|
|
476
465
|
normal: "normal";
|
|
466
|
+
bold: "bold";
|
|
477
467
|
}>;
|
|
478
468
|
style: z.ZodEnum<{
|
|
479
|
-
italic: "italic";
|
|
480
469
|
normal: "normal";
|
|
470
|
+
italic: "italic";
|
|
481
471
|
}>;
|
|
482
472
|
}, z.core.$strip>;
|
|
483
473
|
sizePt: z.ZodNumber;
|
|
@@ -601,12 +591,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
601
591
|
font: z.ZodObject<{
|
|
602
592
|
family: z.ZodString;
|
|
603
593
|
weight: z.ZodEnum<{
|
|
604
|
-
bold: "bold";
|
|
605
594
|
normal: "normal";
|
|
595
|
+
bold: "bold";
|
|
606
596
|
}>;
|
|
607
597
|
style: z.ZodEnum<{
|
|
608
|
-
italic: "italic";
|
|
609
598
|
normal: "normal";
|
|
599
|
+
italic: "italic";
|
|
610
600
|
}>;
|
|
611
601
|
}, z.core.$strip>;
|
|
612
602
|
sizePt: z.ZodNumber;
|
|
@@ -698,52 +688,22 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
698
688
|
type LayoutDocument = z.infer<typeof LayoutDocumentSchema>;
|
|
699
689
|
//#endregion
|
|
700
690
|
//#region src/model/geometry.d.ts
|
|
701
|
-
declare
|
|
702
|
-
xPt: z.ZodNumber;
|
|
703
|
-
yPt: z.ZodNumber;
|
|
704
|
-
widthPt: z.ZodNumber;
|
|
705
|
-
heightPt: z.ZodNumber;
|
|
706
|
-
}, z.core.$strip>;
|
|
707
|
-
type Box = z.infer<typeof BoxSchema>;
|
|
708
|
-
declare const PageSizeSchema: z.ZodObject<{
|
|
709
|
-
widthPt: z.ZodNumber;
|
|
710
|
-
heightPt: z.ZodNumber;
|
|
711
|
-
}, z.core.$strip>;
|
|
712
|
-
type PageSize = z.infer<typeof PageSizeSchema>;
|
|
713
|
-
declare const MarginsSchema: z.ZodObject<{
|
|
714
|
-
topPt: z.ZodNumber;
|
|
715
|
-
rightPt: z.ZodNumber;
|
|
716
|
-
bottomPt: z.ZodNumber;
|
|
717
|
-
leftPt: z.ZodNumber;
|
|
718
|
-
}, z.core.$strip>;
|
|
719
|
-
type Margins = z.infer<typeof MarginsSchema>;
|
|
720
|
-
declare const PAGE_SIZE_LETTER: PageSize;
|
|
721
|
-
declare const PAGE_SIZE_A4: PageSize;
|
|
722
|
-
declare const SLIDE_SIZE_WIDESCREEN: PageSize;
|
|
723
|
-
declare const SLIDE_SIZE_STANDARD: PageSize;
|
|
724
|
-
declare function flipY(box: Box, containerHeightPt: number): Box;
|
|
691
|
+
declare function flipY(box: Box$1, containerHeightPt: number): Box$1;
|
|
725
692
|
//#endregion
|
|
726
693
|
//#region src/model/style.d.ts
|
|
727
694
|
declare const LayoutFontSchema: z.ZodObject<{
|
|
728
695
|
family: z.ZodString;
|
|
729
696
|
weight: z.ZodEnum<{
|
|
730
|
-
bold: "bold";
|
|
731
697
|
normal: "normal";
|
|
698
|
+
bold: "bold";
|
|
732
699
|
}>;
|
|
733
700
|
style: z.ZodEnum<{
|
|
734
|
-
italic: "italic";
|
|
735
701
|
normal: "normal";
|
|
702
|
+
italic: "italic";
|
|
736
703
|
}>;
|
|
737
704
|
}, z.core.$strip>;
|
|
738
705
|
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
739
706
|
declare const DEFAULT_LAYOUT_FONT: LayoutFont;
|
|
740
|
-
declare const AlignmentSchema: z.ZodEnum<{
|
|
741
|
-
left: "left";
|
|
742
|
-
center: "center";
|
|
743
|
-
right: "right";
|
|
744
|
-
justify: "justify";
|
|
745
|
-
}>;
|
|
746
|
-
type Alignment = z.infer<typeof AlignmentSchema>;
|
|
747
707
|
//#endregion
|
|
748
708
|
//#region src/model/bytes.d.ts
|
|
749
709
|
declare const DocxBytesSchema: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
@@ -1031,12 +991,12 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
1031
991
|
font: z.ZodObject<{
|
|
1032
992
|
family: z.ZodString;
|
|
1033
993
|
weight: z.ZodEnum<{
|
|
1034
|
-
bold: "bold";
|
|
1035
994
|
normal: "normal";
|
|
995
|
+
bold: "bold";
|
|
1036
996
|
}>;
|
|
1037
997
|
style: z.ZodEnum<{
|
|
1038
|
-
italic: "italic";
|
|
1039
998
|
normal: "normal";
|
|
999
|
+
italic: "italic";
|
|
1040
1000
|
}>;
|
|
1041
1001
|
}, z.core.$strip>;
|
|
1042
1002
|
sizePt: z.ZodNumber;
|