ooxml.js 2.1.1 → 2.2.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 +1130 -24
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +1061 -26
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, Color, Color as Color$1, ColorSchema, ContentBlock, ContentBlock as ContentBlock$1, ContentBlockSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
2
|
+
import { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, Color, Color as Color$1, ColorSchema, ContentBlock, ContentBlock as ContentBlock$1, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocument as ContentDocument$1, ContentDocumentSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
3
3
|
//#region src/model/node.d.ts
|
|
4
4
|
declare const AttributeSchema: z.ZodObject<{
|
|
5
5
|
name: z.ZodString;
|
|
@@ -272,6 +272,13 @@ declare function parseXml(xml: string): XmlNode[];
|
|
|
272
272
|
//#region src/xml/build.d.ts
|
|
273
273
|
declare function buildXml(nodes: XmlNode[]): string;
|
|
274
274
|
//#endregion
|
|
275
|
+
//#region src/xml/fragment.d.ts
|
|
276
|
+
declare function el(tag: string, attrs?: Record<string, string>, children?: XmlNode[]): XmlElement;
|
|
277
|
+
declare function txt(value: string): XmlText;
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/xml/entities.d.ts
|
|
280
|
+
declare function encodeXmlText(value: string): string;
|
|
281
|
+
//#endregion
|
|
275
282
|
//#region src/zip.d.ts
|
|
276
283
|
declare function unzipPackage(bytes: Uint8Array<ArrayBuffer>): Record<string, Uint8Array<ArrayBuffer>>;
|
|
277
284
|
declare function zipPackage(parts: Record<string, Uint8Array<ArrayBuffer>>): Uint8Array<ArrayBuffer>;
|
|
@@ -512,4 +519,10 @@ declare const XlsxWorkbookSchema: z.ZodObject<{
|
|
|
512
519
|
type XlsxWorkbook = z.infer<typeof XlsxWorkbookSchema>;
|
|
513
520
|
declare function readXlsx(pkg: Package): XlsxWorkbook;
|
|
514
521
|
//#endregion
|
|
515
|
-
|
|
522
|
+
//#region src/typed/xlsx/content.d.ts
|
|
523
|
+
declare function readXlsxContent(pkg: Package): ContentDocument$1;
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region src/typed/xlsx/build.d.ts
|
|
526
|
+
declare function buildXlsxPackage(document: ContentDocument$1): Package;
|
|
527
|
+
//#endregion
|
|
528
|
+
export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, BoxSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, type Color, ColorSchema, type ColorTransform, 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, ContentListMembershipSchema, 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, ContentSheetImageSchema, 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 DefinedName, DefinedNameSchema, type DocumentMetadata, DocumentMetadataSchema, type DocxDocument, DocxDocumentSchema, type Footnote, FootnoteSchema, type ImageFormat, type Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, PageSizeSchema, type Part, PartSchema, type PptxDocument, PptxDocumentSchema, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type XlsxCell, XlsxCellSchema, type XlsxSheet, XlsxSheetSchema, type XlsxWorkbook, XlsxWorkbookSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyColorTransforms, attr, base64ToBytes, buildXlsxPackage, buildXml, bytesToBase64, childrenWithTag, colorToRgbHex, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, el, elementsWithTag, encodeCompactPackage, encodePackage, encodeXmlText, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, packageCodec, parsePackage, parseXml, readDocx, readPptx, readXlsx, readXlsxContent, resolveRelationships, rgbHexToColor, rootElement, serializePackage, sniffImageFormat, textContent, toCompact, txt, unzipPackage, walk, xmlCodec, zipPackage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, Color, Color as Color$1, ColorSchema, ContentBlock, ContentBlock as ContentBlock$1, ContentBlockSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
2
|
+
import { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, Color, Color as Color$1, ColorSchema, ContentBlock, ContentBlock as ContentBlock$1, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocument as ContentDocument$1, ContentDocumentSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
3
3
|
//#region src/model/node.d.ts
|
|
4
4
|
declare const AttributeSchema: z.ZodObject<{
|
|
5
5
|
name: z.ZodString;
|
|
@@ -272,6 +272,13 @@ declare function parseXml(xml: string): XmlNode[];
|
|
|
272
272
|
//#region src/xml/build.d.ts
|
|
273
273
|
declare function buildXml(nodes: XmlNode[]): string;
|
|
274
274
|
//#endregion
|
|
275
|
+
//#region src/xml/fragment.d.ts
|
|
276
|
+
declare function el(tag: string, attrs?: Record<string, string>, children?: XmlNode[]): XmlElement;
|
|
277
|
+
declare function txt(value: string): XmlText;
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/xml/entities.d.ts
|
|
280
|
+
declare function encodeXmlText(value: string): string;
|
|
281
|
+
//#endregion
|
|
275
282
|
//#region src/zip.d.ts
|
|
276
283
|
declare function unzipPackage(bytes: Uint8Array<ArrayBuffer>): Record<string, Uint8Array<ArrayBuffer>>;
|
|
277
284
|
declare function zipPackage(parts: Record<string, Uint8Array<ArrayBuffer>>): Uint8Array<ArrayBuffer>;
|
|
@@ -512,4 +519,10 @@ declare const XlsxWorkbookSchema: z.ZodObject<{
|
|
|
512
519
|
type XlsxWorkbook = z.infer<typeof XlsxWorkbookSchema>;
|
|
513
520
|
declare function readXlsx(pkg: Package): XlsxWorkbook;
|
|
514
521
|
//#endregion
|
|
515
|
-
|
|
522
|
+
//#region src/typed/xlsx/content.d.ts
|
|
523
|
+
declare function readXlsxContent(pkg: Package): ContentDocument$1;
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region src/typed/xlsx/build.d.ts
|
|
526
|
+
declare function buildXlsxPackage(document: ContentDocument$1): Package;
|
|
527
|
+
//#endregion
|
|
528
|
+
export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, BoxSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, type Color, ColorSchema, type ColorTransform, 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, ContentListMembershipSchema, 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, ContentSheetImageSchema, 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 DefinedName, DefinedNameSchema, type DocumentMetadata, DocumentMetadataSchema, type DocxDocument, DocxDocumentSchema, type Footnote, FootnoteSchema, type ImageFormat, type Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, PageSizeSchema, type Part, PartSchema, type PptxDocument, PptxDocumentSchema, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type XlsxCell, XlsxCellSchema, type XlsxSheet, XlsxSheetSchema, type XlsxWorkbook, XlsxWorkbookSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyColorTransforms, attr, base64ToBytes, buildXlsxPackage, buildXml, bytesToBase64, childrenWithTag, colorToRgbHex, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, el, elementsWithTag, encodeCompactPackage, encodePackage, encodeXmlText, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, packageCodec, parsePackage, parseXml, readDocx, readPptx, readXlsx, readXlsxContent, resolveRelationships, rgbHexToColor, rootElement, serializePackage, sniffImageFormat, textContent, toCompact, txt, unzipPackage, walk, xmlCodec, zipPackage };
|