js.documents 1.77.3 → 1.78.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.
@@ -0,0 +1,89 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_edit_docx_content = require("../edit/docx/content.cjs");
3
+ const require_edit_pptx_content = require("../edit/pptx/content.cjs");
4
+ const require_edit_odt_content = require("../edit/odt/content.cjs");
5
+ const require_edit_odp_content = require("../edit/odp/content.cjs");
6
+ const require_edit_ods_content = require("../edit/ods/content.cjs");
7
+ const require_edit_odg_content = require("../edit/odg/content.cjs");
8
+ const require_markdown_read = require("../markdown/read.cjs");
9
+ const require_markdown_write = require("../markdown/write.cjs");
10
+ const require_ooxml_docx_read = require("../ooxml/docx/read.cjs");
11
+ const require_ooxml_pptx_read = require("../ooxml/pptx/read.cjs");
12
+ const require_odf_formula_read = require("../odf/formula/read.cjs");
13
+ const require_odf_odt_read = require("../odf/odt/read.cjs");
14
+ const require_odf_odp_read = require("../odf/odp/read.cjs");
15
+ const require_odf_ods_read = require("../odf/ods/read.cjs");
16
+ const require_odf_odg_read = require("../odf/odg/read.cjs");
17
+ const require_markdown_text = require("../markdown/text.cjs");
18
+ const require_ports_abort = require("../ports/abort.cjs");
19
+ const require_package_codec = require("../package-codec.cjs");
20
+ let pdf_codec = require("pdf-codec");
21
+ //#region src/codecs/registry.ts
22
+ function isArrayBufferBacked(bytes) {
23
+ return bytes.buffer instanceof ArrayBuffer;
24
+ }
25
+ function requireArrayBufferBytes(bytes) {
26
+ if (!isArrayBufferBacked(bytes)) throw new TypeError("expected an ArrayBuffer-backed Uint8Array, received one backed by a SharedArrayBuffer");
27
+ return bytes;
28
+ }
29
+ const DOCUMENT_FORMAT_CODECS = {
30
+ docx: { content: {
31
+ read: (bytes, options) => {
32
+ require_ports_abort.throwIfAborted(options?.signal);
33
+ return require_ooxml_docx_read.readDocxContent(require_package_codec.decodeDocumentPackage("docx", requireArrayBufferBytes(bytes)));
34
+ },
35
+ write: (content) => require_package_codec.encodeDocumentPackage("docx", require_edit_docx_content.buildDocxPackage(content))
36
+ } },
37
+ pptx: { content: {
38
+ read: (bytes, options) => {
39
+ require_ports_abort.throwIfAborted(options?.signal);
40
+ return require_ooxml_pptx_read.readPptxContent(require_package_codec.decodeDocumentPackage("pptx", requireArrayBufferBytes(bytes)));
41
+ },
42
+ write: (content) => require_package_codec.encodeDocumentPackage("pptx", require_edit_pptx_content.buildPptxPackage(content))
43
+ } },
44
+ odt: { content: {
45
+ read: (bytes, options) => {
46
+ require_ports_abort.throwIfAborted(options?.signal);
47
+ return require_odf_odt_read.readOdtContent(require_package_codec.decodeDocumentPackage("odt", requireArrayBufferBytes(bytes)));
48
+ },
49
+ write: (content) => require_package_codec.encodeDocumentPackage("odt", require_edit_odt_content.buildOdtPackage(content))
50
+ } },
51
+ odp: { content: {
52
+ read: (bytes, options) => {
53
+ require_ports_abort.throwIfAborted(options?.signal);
54
+ return require_odf_odp_read.readOdpContent(require_package_codec.decodeDocumentPackage("odp", requireArrayBufferBytes(bytes)));
55
+ },
56
+ write: (content) => require_package_codec.encodeDocumentPackage("odp", require_edit_odp_content.buildOdpPackage(content))
57
+ } },
58
+ ods: { content: {
59
+ read: (bytes, options) => {
60
+ require_ports_abort.throwIfAborted(options?.signal);
61
+ return require_odf_ods_read.readOdsContent(require_package_codec.decodeDocumentPackage("ods", requireArrayBufferBytes(bytes)));
62
+ },
63
+ write: (content) => require_package_codec.encodeDocumentPackage("ods", require_edit_ods_content.buildOdsPackage(content))
64
+ } },
65
+ odg: { content: {
66
+ read: (bytes, options) => {
67
+ require_ports_abort.throwIfAborted(options?.signal);
68
+ return require_odf_odg_read.readOdgContent(require_package_codec.decodeDocumentPackage("odg", requireArrayBufferBytes(bytes)));
69
+ },
70
+ write: (content) => require_package_codec.encodeDocumentPackage("odg", require_edit_odg_content.buildOdgPackage(content))
71
+ } },
72
+ odf: { content: { read: (bytes, options) => {
73
+ require_ports_abort.throwIfAborted(options?.signal);
74
+ return require_odf_formula_read.readOdfFormulaContent(require_package_codec.decodeDocumentPackage("odf", requireArrayBufferBytes(bytes)));
75
+ } } },
76
+ markdown: { content: {
77
+ read: (bytes, options) => require_markdown_read.readMarkdownContent(require_markdown_text.decodeMarkdownText(bytes), { signal: options?.signal }),
78
+ write: (content) => require_markdown_text.encodeMarkdownText(require_markdown_write.buildMarkdownText(content))
79
+ } },
80
+ pdf: { layout: {
81
+ read: (bytes, options) => (0, pdf_codec.readPdf)(requireArrayBufferBytes(bytes), { signal: options?.signal }),
82
+ write: (layout, options) => (0, pdf_codec.writePdf)(layout, { signal: options?.signal })
83
+ } },
84
+ xlsx: {}
85
+ };
86
+ //#endregion
87
+ exports.DOCUMENT_FORMAT_CODECS = DOCUMENT_FORMAT_CODECS;
88
+ exports.isArrayBufferBacked = isArrayBufferBacked;
89
+ exports.requireArrayBufferBytes = requireArrayBufferBytes;
@@ -0,0 +1,15 @@
1
+ import { DocumentFormat } from "../convert/port.cjs";
2
+ import { ContentCodec, LayoutCodec } from "document-schema.js";
3
+ //#region src/codecs/registry.d.ts
4
+ declare function isArrayBufferBacked(bytes: Uint8Array): bytes is Uint8Array<ArrayBuffer>;
5
+ declare function requireArrayBufferBytes(bytes: Uint8Array): Uint8Array<ArrayBuffer>;
6
+ interface DocumentCodecOptions {
7
+ readonly signal?: AbortSignal;
8
+ }
9
+ interface DocumentFormatCodecs {
10
+ readonly content?: ContentCodec<DocumentCodecOptions>;
11
+ readonly layout?: LayoutCodec<DocumentCodecOptions>;
12
+ }
13
+ declare const DOCUMENT_FORMAT_CODECS: Readonly<Record<DocumentFormat, DocumentFormatCodecs>>;
14
+ //#endregion
15
+ export { DOCUMENT_FORMAT_CODECS, DocumentCodecOptions, DocumentFormatCodecs, isArrayBufferBacked, requireArrayBufferBytes };
@@ -0,0 +1,15 @@
1
+ import { DocumentFormat } from "../convert/port.js";
2
+ import { ContentCodec, LayoutCodec } from "document-schema.js";
3
+ //#region src/codecs/registry.d.ts
4
+ declare function isArrayBufferBacked(bytes: Uint8Array): bytes is Uint8Array<ArrayBuffer>;
5
+ declare function requireArrayBufferBytes(bytes: Uint8Array): Uint8Array<ArrayBuffer>;
6
+ interface DocumentCodecOptions {
7
+ readonly signal?: AbortSignal;
8
+ }
9
+ interface DocumentFormatCodecs {
10
+ readonly content?: ContentCodec<DocumentCodecOptions>;
11
+ readonly layout?: LayoutCodec<DocumentCodecOptions>;
12
+ }
13
+ declare const DOCUMENT_FORMAT_CODECS: Readonly<Record<DocumentFormat, DocumentFormatCodecs>>;
14
+ //#endregion
15
+ export { DOCUMENT_FORMAT_CODECS, DocumentCodecOptions, DocumentFormatCodecs, isArrayBufferBacked, requireArrayBufferBytes };
@@ -0,0 +1,86 @@
1
+ import { buildDocxPackage } from "../edit/docx/content.js";
2
+ import { buildPptxPackage } from "../edit/pptx/content.js";
3
+ import { buildOdtPackage } from "../edit/odt/content.js";
4
+ import { buildOdpPackage } from "../edit/odp/content.js";
5
+ import { buildOdsPackage } from "../edit/ods/content.js";
6
+ import { buildOdgPackage } from "../edit/odg/content.js";
7
+ import { readMarkdownContent } from "../markdown/read.js";
8
+ import { buildMarkdownText } from "../markdown/write.js";
9
+ import { readDocxContent } from "../ooxml/docx/read.js";
10
+ import { readPptxContent } from "../ooxml/pptx/read.js";
11
+ import { readOdfFormulaContent } from "../odf/formula/read.js";
12
+ import { readOdtContent } from "../odf/odt/read.js";
13
+ import { readOdpContent } from "../odf/odp/read.js";
14
+ import { readOdsContent } from "../odf/ods/read.js";
15
+ import { readOdgContent } from "../odf/odg/read.js";
16
+ import { decodeMarkdownText, encodeMarkdownText } from "../markdown/text.js";
17
+ import { throwIfAborted } from "../ports/abort.js";
18
+ import { decodeDocumentPackage, encodeDocumentPackage } from "../package-codec.js";
19
+ import { readPdf, writePdf } from "pdf-codec";
20
+ //#region src/codecs/registry.ts
21
+ function isArrayBufferBacked(bytes) {
22
+ return bytes.buffer instanceof ArrayBuffer;
23
+ }
24
+ function requireArrayBufferBytes(bytes) {
25
+ if (!isArrayBufferBacked(bytes)) throw new TypeError("expected an ArrayBuffer-backed Uint8Array, received one backed by a SharedArrayBuffer");
26
+ return bytes;
27
+ }
28
+ const DOCUMENT_FORMAT_CODECS = {
29
+ docx: { content: {
30
+ read: (bytes, options) => {
31
+ throwIfAborted(options?.signal);
32
+ return readDocxContent(decodeDocumentPackage("docx", requireArrayBufferBytes(bytes)));
33
+ },
34
+ write: (content) => encodeDocumentPackage("docx", buildDocxPackage(content))
35
+ } },
36
+ pptx: { content: {
37
+ read: (bytes, options) => {
38
+ throwIfAborted(options?.signal);
39
+ return readPptxContent(decodeDocumentPackage("pptx", requireArrayBufferBytes(bytes)));
40
+ },
41
+ write: (content) => encodeDocumentPackage("pptx", buildPptxPackage(content))
42
+ } },
43
+ odt: { content: {
44
+ read: (bytes, options) => {
45
+ throwIfAborted(options?.signal);
46
+ return readOdtContent(decodeDocumentPackage("odt", requireArrayBufferBytes(bytes)));
47
+ },
48
+ write: (content) => encodeDocumentPackage("odt", buildOdtPackage(content))
49
+ } },
50
+ odp: { content: {
51
+ read: (bytes, options) => {
52
+ throwIfAborted(options?.signal);
53
+ return readOdpContent(decodeDocumentPackage("odp", requireArrayBufferBytes(bytes)));
54
+ },
55
+ write: (content) => encodeDocumentPackage("odp", buildOdpPackage(content))
56
+ } },
57
+ ods: { content: {
58
+ read: (bytes, options) => {
59
+ throwIfAborted(options?.signal);
60
+ return readOdsContent(decodeDocumentPackage("ods", requireArrayBufferBytes(bytes)));
61
+ },
62
+ write: (content) => encodeDocumentPackage("ods", buildOdsPackage(content))
63
+ } },
64
+ odg: { content: {
65
+ read: (bytes, options) => {
66
+ throwIfAborted(options?.signal);
67
+ return readOdgContent(decodeDocumentPackage("odg", requireArrayBufferBytes(bytes)));
68
+ },
69
+ write: (content) => encodeDocumentPackage("odg", buildOdgPackage(content))
70
+ } },
71
+ odf: { content: { read: (bytes, options) => {
72
+ throwIfAborted(options?.signal);
73
+ return readOdfFormulaContent(decodeDocumentPackage("odf", requireArrayBufferBytes(bytes)));
74
+ } } },
75
+ markdown: { content: {
76
+ read: (bytes, options) => readMarkdownContent(decodeMarkdownText(bytes), { signal: options?.signal }),
77
+ write: (content) => encodeMarkdownText(buildMarkdownText(content))
78
+ } },
79
+ pdf: { layout: {
80
+ read: (bytes, options) => readPdf(requireArrayBufferBytes(bytes), { signal: options?.signal }),
81
+ write: (layout, options) => writePdf(layout, { signal: options?.signal })
82
+ } },
83
+ xlsx: {}
84
+ };
85
+ //#endregion
86
+ export { DOCUMENT_FORMAT_CODECS, isArrayBufferBacked, requireArrayBufferBytes };
@@ -1,5 +1,5 @@
1
- import { DocumentBridgeOptions, DocumentToPdfOptions, PdfToDocumentOptions } from "./convert.cjs";
2
1
  import { DocumentFormat } from "./port.cjs";
2
+ import { DocumentBridgeOptions, DocumentToPdfOptions, PdfToDocumentOptions } from "./convert.cjs";
3
3
  //#region src/convert/capability.d.ts
4
4
  type ContentVariant = 'wordprocessing' | 'presentation' | 'spreadsheet' | 'drawing' | 'formula';
5
5
  interface FormatCapability {
@@ -1,5 +1,5 @@
1
- import { DocumentBridgeOptions, DocumentToPdfOptions, PdfToDocumentOptions } from "./convert.js";
2
1
  import { DocumentFormat } from "./port.js";
2
+ import { DocumentBridgeOptions, DocumentToPdfOptions, PdfToDocumentOptions } from "./convert.js";
3
3
  //#region src/convert/capability.d.ts
4
4
  type ContentVariant = 'wordprocessing' | 'presentation' | 'spreadsheet' | 'drawing' | 'formula';
5
5
  interface FormatCapability {
@@ -1,9 +1,9 @@
1
1
  import { n as HsqldbDecodeOptions } from "../rowformat-Cl2exlEh.cjs";
2
2
  import { t as OmmlDiagnostic } from "../shared-DLZ3IQUl.cjs";
3
- import { t as DocumentFontRegistryOptions } from "../registry-lqJej0Jr.cjs";
3
+ import { t as DocumentFontRegistryOptions } from "../registry-CeZB1W_p.cjs";
4
4
  import { ContentDocument, ContentSection, DocumentPackage } from "document-schema.js";
5
- import { OdmSection, Package } from "odf.js";
6
5
  import { PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec";
6
+ import { OdmSection, Package } from "odf.js";
7
7
  //#region src/convert/convert.d.ts
8
8
  interface DocumentToPdfOptions extends DocumentFontRegistryOptions {
9
9
  readonly signal?: AbortSignal;
@@ -1,14 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_edit_docx_content = require("../edit/docx/content.cjs");
3
- const require_edit_pptx_content = require("../edit/pptx/content.cjs");
4
- const require_edit_odt_content = require("../edit/odt/content.cjs");
5
- const require_edit_odp_content = require("../edit/odp/content.cjs");
6
- const require_edit_ods_content = require("../edit/ods/content.cjs");
7
- const require_edit_odg_content = require("../edit/odg/content.cjs");
8
- const require_markdown_write = require("../markdown/write.cjs");
9
- const require_markdown_text = require("../markdown/text.cjs");
10
- let ooxml_js = require("ooxml.js");
11
- let odf_js = require("odf.js");
2
+ const require_codecs_registry = require("../codecs/registry.cjs");
12
3
  let pdf_codec = require("pdf-codec");
13
4
  //#region src/convert/from-package.ts
14
5
  function buildDocumentBytes(pkg, target) {
@@ -16,17 +7,11 @@ function buildDocumentBytes(pkg, target) {
16
7
  if (pkg.layout === void 0) throw new Error("this DocumentPackage has no layout -- only a package dumped from a <format>-to-pdf or pdf-to-<format> conversion carries one; a bridge conversion's own dump (e.g. odt-to-docx) never does, so 'pdf' is not a reachable target from it");
17
8
  return (0, pdf_codec.writePdf)(pkg.layout);
18
9
  }
19
- switch (target) {
20
- case "docx": return (0, ooxml_js.encodePackage)(require_edit_docx_content.buildDocxPackage(pkg.content));
21
- case "pptx": return (0, ooxml_js.encodePackage)(require_edit_pptx_content.buildPptxPackage(pkg.content));
22
- case "odt": return (0, odf_js.encodePackage)(require_edit_odt_content.buildOdtPackage(pkg.content));
23
- case "odp": return (0, odf_js.encodePackage)(require_edit_odp_content.buildOdpPackage(pkg.content));
24
- case "ods": return (0, odf_js.encodePackage)(require_edit_ods_content.buildOdsPackage(pkg.content));
25
- case "odg": return (0, odf_js.encodePackage)(require_edit_odg_content.buildOdgPackage(pkg.content));
26
- case "markdown": return require_markdown_text.encodeMarkdownText(require_markdown_write.buildMarkdownText(pkg.content));
27
- case "xlsx": throw new Error("'xlsx' cannot be built from a DocumentPackage directly -- this package does not re-export a ContentDocument-to-xlsx builder; convert to 'ods' here, then call odsToXlsx on the result instead");
28
- case "odf": throw new Error("'odf' (a standalone formula document) cannot be built from a DocumentPackage -- there is no ContentDocument-to-odf builder");
29
- }
10
+ if (target === "xlsx") throw new Error("'xlsx' cannot be built from a DocumentPackage directly -- this package does not re-export a ContentDocument-to-xlsx builder; convert to 'ods' here, then call odsToXlsx on the result instead");
11
+ if (target === "odf") throw new Error("'odf' (a standalone formula document) cannot be built from a DocumentPackage -- there is no ContentDocument-to-odf builder");
12
+ const content = require_codecs_registry.DOCUMENT_FORMAT_CODECS[target].content;
13
+ if (!content?.write) throw new Error(`DocumentFormat '${target}' has no content.write codec in DOCUMENT_FORMAT_CODECS, and is not 'pdf'/'xlsx'/'odf' -- this is an internal invariant violation, not a caller error`);
14
+ return require_codecs_registry.requireArrayBufferBytes(content.write(pkg.content));
30
15
  }
31
16
  //#endregion
32
17
  exports.buildDocumentBytes = buildDocumentBytes;
@@ -1,13 +1,4 @@
1
- import { buildDocxPackage } from "../edit/docx/content.js";
2
- import { buildPptxPackage } from "../edit/pptx/content.js";
3
- import { buildOdtPackage } from "../edit/odt/content.js";
4
- import { buildOdpPackage } from "../edit/odp/content.js";
5
- import { buildOdsPackage } from "../edit/ods/content.js";
6
- import { buildOdgPackage } from "../edit/odg/content.js";
7
- import { buildMarkdownText } from "../markdown/write.js";
8
- import { encodeMarkdownText } from "../markdown/text.js";
9
- import { encodePackage } from "ooxml.js";
10
- import { encodePackage as encodePackage$1 } from "odf.js";
1
+ import { DOCUMENT_FORMAT_CODECS, requireArrayBufferBytes } from "../codecs/registry.js";
11
2
  import { writePdf } from "pdf-codec";
12
3
  //#region src/convert/from-package.ts
13
4
  function buildDocumentBytes(pkg, target) {
@@ -15,17 +6,11 @@ function buildDocumentBytes(pkg, target) {
15
6
  if (pkg.layout === void 0) throw new Error("this DocumentPackage has no layout -- only a package dumped from a <format>-to-pdf or pdf-to-<format> conversion carries one; a bridge conversion's own dump (e.g. odt-to-docx) never does, so 'pdf' is not a reachable target from it");
16
7
  return writePdf(pkg.layout);
17
8
  }
18
- switch (target) {
19
- case "docx": return encodePackage(buildDocxPackage(pkg.content));
20
- case "pptx": return encodePackage(buildPptxPackage(pkg.content));
21
- case "odt": return encodePackage$1(buildOdtPackage(pkg.content));
22
- case "odp": return encodePackage$1(buildOdpPackage(pkg.content));
23
- case "ods": return encodePackage$1(buildOdsPackage(pkg.content));
24
- case "odg": return encodePackage$1(buildOdgPackage(pkg.content));
25
- case "markdown": return encodeMarkdownText(buildMarkdownText(pkg.content));
26
- case "xlsx": throw new Error("'xlsx' cannot be built from a DocumentPackage directly -- this package does not re-export a ContentDocument-to-xlsx builder; convert to 'ods' here, then call odsToXlsx on the result instead");
27
- case "odf": throw new Error("'odf' (a standalone formula document) cannot be built from a DocumentPackage -- there is no ContentDocument-to-odf builder");
28
- }
9
+ if (target === "xlsx") throw new Error("'xlsx' cannot be built from a DocumentPackage directly -- this package does not re-export a ContentDocument-to-xlsx builder; convert to 'ods' here, then call odsToXlsx on the result instead");
10
+ if (target === "odf") throw new Error("'odf' (a standalone formula document) cannot be built from a DocumentPackage -- there is no ContentDocument-to-odf builder");
11
+ const content = DOCUMENT_FORMAT_CODECS[target].content;
12
+ if (!content?.write) throw new Error(`DocumentFormat '${target}' has no content.write codec in DOCUMENT_FORMAT_CODECS, and is not 'pdf'/'xlsx'/'odf' -- this is an internal invariant violation, not a caller error`);
13
+ return requireArrayBufferBytes(content.write(pkg.content));
29
14
  }
30
15
  //#endregion
31
16
  export { buildDocumentBytes };
@@ -1,5 +1,5 @@
1
- import { Package } from "odf.js";
2
1
  import { ProvidedFont } from "pdf-codec";
2
+ import { Package } from "odf.js";
3
3
  //#region src/fonts/odf.d.ts
4
4
  declare class OdfEmbeddedFontError extends Error {
5
5
  constructor(detail: string);
@@ -1,2 +1,2 @@
1
- import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "../registry-lqJej0Jr.cjs";
1
+ import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "../registry-CeZB1W_p.cjs";
2
2
  export { DocumentFontRegistryOptions, FontSourcePackage, createDocumentFontRegistry, extractSourceFonts };
package/dist/index.cjs CHANGED
@@ -98,6 +98,7 @@ const require_odb_report_source = require("./odb/report/source.cjs");
98
98
  const require_odb_report_content = require("./odb/report/content.cjs");
99
99
  const require_convert_port = require("./convert/port.cjs");
100
100
  const require_convert_local = require("./convert/local.cjs");
101
+ const require_package_codec = require("./package-codec.cjs");
101
102
  const require_convert_from_package = require("./convert/from-package.cjs");
102
103
  const require_convert_document_fonts = require("./convert/document-fonts.cjs");
103
104
  const require_metadata_read = require("./metadata/read.cjs");
@@ -503,6 +504,7 @@ Object.defineProperty(exports, "UnrecognizedDocumentSchemaError", {
503
504
  }
504
505
  });
505
506
  exports.UnsupportedFontSourceFormatError = require_convert_document_fonts.UnsupportedFontSourceFormatError;
507
+ exports.UnsupportedPackageFormatError = require_package_codec.UnsupportedPackageFormatError;
506
508
  exports.XlsxBytesSchema = require_model_bytes.XlsxBytesSchema;
507
509
  Object.defineProperty(exports, "XmlCdataSchema", {
508
510
  enumerable: true,
@@ -652,6 +654,7 @@ Object.defineProperty(exports, "decodeCompactPackage", {
652
654
  return ooxml_js.decodeCompactPackage;
653
655
  }
654
656
  });
657
+ exports.decodeDocumentPackage = require_package_codec.decodeDocumentPackage;
655
658
  Object.defineProperty(exports, "decodeEntities", {
656
659
  enumerable: true,
657
660
  get: function() {
@@ -706,6 +709,7 @@ Object.defineProperty(exports, "encodeCompactPackage", {
706
709
  return ooxml_js.encodeCompactPackage;
707
710
  }
708
711
  });
712
+ exports.encodeDocumentPackage = require_package_codec.encodeDocumentPackage;
709
713
  exports.encodeMarkdownText = require_markdown_text.encodeMarkdownText;
710
714
  Object.defineProperty(exports, "encodePackage", {
711
715
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
+ import { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload } from "./convert/port.cjs";
1
2
  import { n as HsqldbDecodeOptions, r as HsqldbRowFormatError } from "./rowformat-Cl2exlEh.cjs";
2
3
  import { i as mapMathVariant, n as applyMathVariant, r as isMathVariant, t as MathVariant } from "./variant-BMrebjMw.cjs";
3
4
  import { n as OmmlDiagnosticKind, t as OmmlDiagnostic } from "./shared-DLZ3IQUl.cjs";
4
- import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-lqJej0Jr.cjs";
5
+ import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-CeZB1W_p.cjs";
5
6
  import { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf } from "./convert/convert.cjs";
6
- import { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload } from "./convert/port.cjs";
7
7
  import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.cjs";
8
8
  import { UnsupportedFontSourceFormatError, extractSourceFontsForFormat } from "./convert/document-fonts.cjs";
9
9
  import { buildDocumentBytes } from "./convert/from-package.cjs";
@@ -109,11 +109,12 @@ import { RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedE
109
109
  import { OdbReportContentOptions, OdbReportNotSpecifiedError, readOdbReportContent } from "./odb/report/content.cjs";
110
110
  import { renderOdbReportContent } from "./odb/report/render.cjs";
111
111
  import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } from "./odb/report/source.cjs";
112
+ import { UnsupportedPackageFormatError, decodeDocumentPackage, encodeDocumentPackage } from "./package-codec.cjs";
112
113
  import { ReadDocumentMetadataOptions, readDocumentMetadata } from "./metadata/read.cjs";
113
114
  import { MetadataOverrides, SetDocumentMetadataOptions, setDocumentMetadata } from "./metadata/write.cjs";
114
115
  import { throwIfAborted } from "./ports/abort.cjs";
115
116
  import { CONTENT_FORMAT_VERSION, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
116
- import { OdbComponentInfo, OdbConnectionInfo, OdbForm, OdbFormControl, OdbFormDefinition, OdbInventory, OdbQueryInfo, OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
117
117
  import { FontRegistry, FontRegistryOptions, FontSubstitution, LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PositionedFormula, ProvidedFont, ReadPdfOptions, ResolvedFace, WinAnsiSubstitution, WritePdfOptions, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
118
+ import { OdbComponentInfo, OdbConnectionInfo, OdbForm, OdbFormControl, OdbFormDefinition, OdbInventory, OdbQueryInfo, OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
118
119
  import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Footnote, FootnoteSchema, NumberingDefinition, NumberingDefinitionSchema, NumberingDefinitions, NumberingLevel, NumberingLevelSchema, Package, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, 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 as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
119
- export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, COLOR_BLACK, CONTENT_FORMAT_VERSION, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, 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 ConversionOptions, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, 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 LoadedMathFont, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, 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, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, looksLikeSfnt, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
120
+ export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, COLOR_BLACK, CONTENT_FORMAT_VERSION, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, 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 ConversionOptions, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, 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 LoadedMathFont, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, 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, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeDocumentPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, looksLikeSfnt, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
+ import { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload } from "./convert/port.js";
1
2
  import { n as HsqldbDecodeOptions, r as HsqldbRowFormatError } from "./rowformat-Cl2exlEh.js";
2
3
  import { i as mapMathVariant, n as applyMathVariant, r as isMathVariant, t as MathVariant } from "./variant-BMrebjMw.js";
3
4
  import { n as OmmlDiagnosticKind, t as OmmlDiagnostic } from "./shared-DUOzjwcL.js";
4
5
  import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-CrSqLIcn.js";
5
6
  import { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf } from "./convert/convert.js";
6
- import { ConversionOptions, ConversionRequest, ConversionResult, DOCUMENT_FORMATS, Diagnostic, DocumentConverter, DocumentFormat, DocumentFormatSchema, DocumentPayload } from "./convert/port.js";
7
7
  import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.js";
8
8
  import { UnsupportedFontSourceFormatError, extractSourceFontsForFormat } from "./convert/document-fonts.js";
9
9
  import { buildDocumentBytes } from "./convert/from-package.js";
@@ -109,6 +109,7 @@ import { RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedE
109
109
  import { OdbReportContentOptions, OdbReportNotSpecifiedError, readOdbReportContent } from "./odb/report/content.js";
110
110
  import { renderOdbReportContent } from "./odb/report/render.js";
111
111
  import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } from "./odb/report/source.js";
112
+ import { UnsupportedPackageFormatError, decodeDocumentPackage, encodeDocumentPackage } from "./package-codec.js";
112
113
  import { ReadDocumentMetadataOptions, readDocumentMetadata } from "./metadata/read.js";
113
114
  import { MetadataOverrides, SetDocumentMetadataOptions, setDocumentMetadata } from "./metadata/write.js";
114
115
  import { throwIfAborted } from "./ports/abort.js";
@@ -116,4 +117,4 @@ import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, Comm
116
117
  import { CONTENT_FORMAT_VERSION, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
117
118
  import { OdbComponentInfo, OdbConnectionInfo, OdbForm, OdbFormControl, OdbFormDefinition, OdbInventory, OdbQueryInfo, OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
118
119
  import { FontRegistry, FontRegistryOptions, FontSubstitution, LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PositionedFormula, ProvidedFont, ReadPdfOptions, ResolvedFace, WinAnsiSubstitution, WritePdfOptions, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
119
- export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, COLOR_BLACK, CONTENT_FORMAT_VERSION, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, 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 ConversionOptions, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, 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 LoadedMathFont, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, 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, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, looksLikeSfnt, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
120
+ export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, COLOR_BLACK, CONTENT_FORMAT_VERSION, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, 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 ConversionOptions, type ConversionRequest, type ConversionResult, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptxOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, 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 LoadedMathFont, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, MarkdownParagraph, type ParagraphInit as MarkdownParagraphInit, MarkdownRun, type RunInit as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, 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, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$1 as OdtParagraphInit, OdtRun, type RunInit$1 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$1 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeDocumentPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, looksLikeSfnt, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
package/dist/index.js CHANGED
@@ -99,6 +99,7 @@ import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } f
99
99
  import { OdbReportNotSpecifiedError, readOdbReportContent } from "./odb/report/content.js";
100
100
  import { DOCUMENT_FORMATS, DocumentFormatSchema } from "./convert/port.js";
101
101
  import { createLocalDocumentConverter } from "./convert/local.js";
102
+ import { UnsupportedPackageFormatError, decodeDocumentPackage, encodeDocumentPackage } from "./package-codec.js";
102
103
  import { buildDocumentBytes } from "./convert/from-package.js";
103
104
  import { UnsupportedFontSourceFormatError, extractSourceFontsForFormat } from "./convert/document-fonts.js";
104
105
  import { readDocumentMetadata } from "./metadata/read.js";
@@ -107,4 +108,4 @@ import { AttributeSchema, BinaryPartSchema, CommentSchema, CompactPackageSchema,
107
108
  import { CONTENT_FORMAT_VERSION, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DocumentPackageSchema, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
108
109
  import { readOdbForm, readOdbInventory, readOdbReport, resolveOdbComponent } from "odf.js";
109
110
  import { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfParseError, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
110
- export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, DefinedNameSchema, DocumentFormatSchema, DocumentPackageSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, FootnoteSchema, HsqldbBinaryScriptParseError, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, MarkdownBytesSchema, MarkdownEditor, MarkdownList, MarkdownParagraph, MarkdownRun, MarkdownTable, MarkdownTableCell, MarkdownTableRow, NOOP_DIAGNOSTIC_SINK, NumberingDefinitionSchema, NumberingLevelSchema, OdbNoEmbeddedDataSourceError, OdbReportDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, OdgBytesSchema, OdgEditor, OdgLineVector, OdgPage, OdgPathVector, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, OoxmlEmbeddedFontError, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEditor, PdfEllipseItem, PdfEncryptedError, PdfImageItem, PdfLineItem, PdfLinkItem, PdfPage, PdfParseError, PdfPathItem, PdfRectItem, PdfTextItem, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, PptxTableRow, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, RptReportStructureError, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, XlsxBytesSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, looksLikeSfnt, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
111
+ export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, DefinedNameSchema, DocumentFormatSchema, DocumentPackageSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, FootnoteSchema, HsqldbBinaryScriptParseError, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, MarkdownBytesSchema, MarkdownEditor, MarkdownList, MarkdownParagraph, MarkdownRun, MarkdownTable, MarkdownTableCell, MarkdownTableRow, NOOP_DIAGNOSTIC_SINK, NumberingDefinitionSchema, NumberingLevelSchema, OdbNoEmbeddedDataSourceError, OdbReportDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, OdgBytesSchema, OdgEditor, OdgLineVector, OdgPage, OdgPathVector, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, OoxmlEmbeddedFontError, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEditor, PdfEllipseItem, PdfEncryptedError, PdfImageItem, PdfLineItem, PdfLinkItem, PdfPage, PdfParseError, PdfPathItem, PdfRectItem, PdfTextItem, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, PptxTableRow, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, RptReportStructureError, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, XlsxBytesSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, collectOfficeMathElements, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPptx, createStandardFontMeasurer, decodeCompactPackage, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, deobfuscateEmbeddedFont, deriveFontKey, detectGridLattice, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeDocumentPackage, encodeMarkdownText, encodePackage, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, looksLikeSfnt, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPptx, operatorProperties, packageCodec, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRptFormula, parseSelect, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocumentMetadata, readDocxContent, readDocxExtras, readFirebirdBackup, readMarkdownContent, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderOdbReportContent, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
@@ -1,47 +1,15 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_markdown_read = require("../markdown/read.cjs");
3
- const require_ooxml_docx_read = require("../ooxml/docx/read.cjs");
4
- const require_ooxml_pptx_read = require("../ooxml/pptx/read.cjs");
5
- const require_odf_formula_read = require("../odf/formula/read.cjs");
6
- const require_odf_odt_read = require("../odf/odt/read.cjs");
7
- const require_odf_odp_read = require("../odf/odp/read.cjs");
8
- const require_odf_ods_read = require("../odf/ods/read.cjs");
9
- const require_odf_odg_read = require("../odf/odg/read.cjs");
10
- const require_markdown_text = require("../markdown/text.cjs");
11
- const require_ports_abort = require("../ports/abort.cjs");
12
2
  const require_convert_convert = require("../convert/convert.cjs");
13
- let ooxml_js = require("ooxml.js");
14
- let odf_js = require("odf.js");
3
+ const require_codecs_registry = require("../codecs/registry.cjs");
15
4
  let pdf_codec = require("pdf-codec");
16
5
  //#region src/metadata/read.ts
17
6
  function readDocumentMetadata(format, bytes, options) {
18
7
  const signal = options?.signal;
19
- switch (format) {
20
- case "docx":
21
- require_ports_abort.throwIfAborted(signal);
22
- return require_ooxml_docx_read.readDocxContent((0, ooxml_js.decodePackage)(bytes)).metadata;
23
- case "pptx":
24
- require_ports_abort.throwIfAborted(signal);
25
- return require_ooxml_pptx_read.readPptxContent((0, ooxml_js.decodePackage)(bytes)).metadata;
26
- case "odt":
27
- require_ports_abort.throwIfAborted(signal);
28
- return require_odf_odt_read.readOdtContent((0, odf_js.decodePackage)(bytes)).metadata;
29
- case "odp":
30
- require_ports_abort.throwIfAborted(signal);
31
- return require_odf_odp_read.readOdpContent((0, odf_js.decodePackage)(bytes)).metadata;
32
- case "ods":
33
- require_ports_abort.throwIfAborted(signal);
34
- return require_odf_ods_read.readOdsContent((0, odf_js.decodePackage)(bytes)).metadata;
35
- case "odg":
36
- require_ports_abort.throwIfAborted(signal);
37
- return require_odf_odg_read.readOdgContent((0, odf_js.decodePackage)(bytes)).metadata;
38
- case "odf":
39
- require_ports_abort.throwIfAborted(signal);
40
- return require_odf_formula_read.readOdfFormulaContent((0, odf_js.decodePackage)(bytes)).metadata;
41
- case "markdown": return require_markdown_read.readMarkdownContent(require_markdown_text.decodeMarkdownText(bytes), { signal }).metadata;
42
- case "pdf": return (0, pdf_codec.readPdf)(bytes, { signal }).metadata;
43
- case "xlsx": return (0, pdf_codec.readPdf)(require_convert_convert.xlsxToPdf(bytes, { signal }), { signal }).metadata;
44
- }
8
+ if (format === "xlsx") return (0, pdf_codec.readPdf)(require_convert_convert.xlsxToPdf(bytes, { signal }), { signal }).metadata;
9
+ const codecs = require_codecs_registry.DOCUMENT_FORMAT_CODECS[format];
10
+ if (codecs.content) return codecs.content.read(bytes, { signal }).metadata;
11
+ if (codecs.layout) return codecs.layout.read(bytes, { signal }).metadata;
12
+ throw new Error(`DocumentFormat '${format}' has neither a content nor a layout codec in DOCUMENT_FORMAT_CODECS, and is not 'xlsx' -- this is an internal invariant violation, not a caller error`);
45
13
  }
46
14
  //#endregion
47
15
  exports.readDocumentMetadata = readDocumentMetadata;
@@ -1,46 +1,14 @@
1
- import { readMarkdownContent } from "../markdown/read.js";
2
- import { readDocxContent } from "../ooxml/docx/read.js";
3
- import { readPptxContent } from "../ooxml/pptx/read.js";
4
- import { readOdfFormulaContent } from "../odf/formula/read.js";
5
- import { readOdtContent } from "../odf/odt/read.js";
6
- import { readOdpContent } from "../odf/odp/read.js";
7
- import { readOdsContent } from "../odf/ods/read.js";
8
- import { readOdgContent } from "../odf/odg/read.js";
9
- import { decodeMarkdownText } from "../markdown/text.js";
10
- import { throwIfAborted } from "../ports/abort.js";
11
1
  import { xlsxToPdf } from "../convert/convert.js";
12
- import { decodePackage } from "ooxml.js";
13
- import { decodePackage as decodePackage$1 } from "odf.js";
2
+ import { DOCUMENT_FORMAT_CODECS } from "../codecs/registry.js";
14
3
  import { readPdf } from "pdf-codec";
15
4
  //#region src/metadata/read.ts
16
5
  function readDocumentMetadata(format, bytes, options) {
17
6
  const signal = options?.signal;
18
- switch (format) {
19
- case "docx":
20
- throwIfAborted(signal);
21
- return readDocxContent(decodePackage(bytes)).metadata;
22
- case "pptx":
23
- throwIfAborted(signal);
24
- return readPptxContent(decodePackage(bytes)).metadata;
25
- case "odt":
26
- throwIfAborted(signal);
27
- return readOdtContent(decodePackage$1(bytes)).metadata;
28
- case "odp":
29
- throwIfAborted(signal);
30
- return readOdpContent(decodePackage$1(bytes)).metadata;
31
- case "ods":
32
- throwIfAborted(signal);
33
- return readOdsContent(decodePackage$1(bytes)).metadata;
34
- case "odg":
35
- throwIfAborted(signal);
36
- return readOdgContent(decodePackage$1(bytes)).metadata;
37
- case "odf":
38
- throwIfAborted(signal);
39
- return readOdfFormulaContent(decodePackage$1(bytes)).metadata;
40
- case "markdown": return readMarkdownContent(decodeMarkdownText(bytes), { signal }).metadata;
41
- case "pdf": return readPdf(bytes, { signal }).metadata;
42
- case "xlsx": return readPdf(xlsxToPdf(bytes, { signal }), { signal }).metadata;
43
- }
7
+ if (format === "xlsx") return readPdf(xlsxToPdf(bytes, { signal }), { signal }).metadata;
8
+ const codecs = DOCUMENT_FORMAT_CODECS[format];
9
+ if (codecs.content) return codecs.content.read(bytes, { signal }).metadata;
10
+ if (codecs.layout) return codecs.layout.read(bytes, { signal }).metadata;
11
+ throw new Error(`DocumentFormat '${format}' has neither a content nor a layout codec in DOCUMENT_FORMAT_CODECS, and is not 'xlsx' -- this is an internal invariant violation, not a caller error`);
44
12
  }
45
13
  //#endregion
46
14
  export { readDocumentMetadata };
@@ -1,22 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_edit_docx_content = require("../edit/docx/content.cjs");
3
- const require_edit_pptx_content = require("../edit/pptx/content.cjs");
4
- const require_edit_odt_content = require("../edit/odt/content.cjs");
5
- const require_edit_odp_content = require("../edit/odp/content.cjs");
6
- const require_edit_ods_content = require("../edit/ods/content.cjs");
7
- const require_edit_odg_content = require("../edit/odg/content.cjs");
8
- const require_markdown_read = require("../markdown/read.cjs");
9
- const require_markdown_write = require("../markdown/write.cjs");
10
- const require_ooxml_docx_read = require("../ooxml/docx/read.cjs");
11
- const require_ooxml_pptx_read = require("../ooxml/pptx/read.cjs");
12
- const require_odf_odt_read = require("../odf/odt/read.cjs");
13
- const require_odf_odp_read = require("../odf/odp/read.cjs");
14
- const require_odf_ods_read = require("../odf/ods/read.cjs");
15
- const require_odf_odg_read = require("../odf/odg/read.cjs");
16
- const require_markdown_text = require("../markdown/text.cjs");
17
2
  const require_ports_abort = require("../ports/abort.cjs");
18
- let ooxml_js = require("ooxml.js");
19
- let odf_js = require("odf.js");
3
+ const require_codecs_registry = require("../codecs/registry.cjs");
20
4
  let pdf_codec = require("pdf-codec");
21
5
  //#region src/metadata/write.ts
22
6
  const REBUILD_FORMATS = {
@@ -32,26 +16,14 @@ function isRebuildFormat(format) {
32
16
  return format in REBUILD_FORMATS;
33
17
  }
34
18
  function readContentForFormat(format, bytes) {
35
- switch (format) {
36
- case "docx": return require_ooxml_docx_read.readDocxContent((0, ooxml_js.decodePackage)(bytes));
37
- case "pptx": return require_ooxml_pptx_read.readPptxContent((0, ooxml_js.decodePackage)(bytes));
38
- case "odt": return require_odf_odt_read.readOdtContent((0, odf_js.decodePackage)(bytes));
39
- case "odp": return require_odf_odp_read.readOdpContent((0, odf_js.decodePackage)(bytes));
40
- case "ods": return require_odf_ods_read.readOdsContent((0, odf_js.decodePackage)(bytes));
41
- case "odg": return require_odf_odg_read.readOdgContent((0, odf_js.decodePackage)(bytes));
42
- case "markdown": return require_markdown_read.readMarkdownContent(require_markdown_text.decodeMarkdownText(bytes));
43
- }
19
+ const content = require_codecs_registry.DOCUMENT_FORMAT_CODECS[format].content;
20
+ if (!content) throw new Error(`RebuildFormat '${format}' has no content codec in DOCUMENT_FORMAT_CODECS -- this is an internal invariant violation, not a caller error`);
21
+ return content.read(bytes);
44
22
  }
45
23
  function buildBytesForRebuildFormat(format, content) {
46
- switch (format) {
47
- case "docx": return (0, ooxml_js.encodePackage)(require_edit_docx_content.buildDocxPackage(content));
48
- case "pptx": return (0, ooxml_js.encodePackage)(require_edit_pptx_content.buildPptxPackage(content));
49
- case "odt": return (0, odf_js.encodePackage)(require_edit_odt_content.buildOdtPackage(content));
50
- case "odp": return (0, odf_js.encodePackage)(require_edit_odp_content.buildOdpPackage(content));
51
- case "ods": return (0, odf_js.encodePackage)(require_edit_ods_content.buildOdsPackage(content));
52
- case "odg": return (0, odf_js.encodePackage)(require_edit_odg_content.buildOdgPackage(content));
53
- case "markdown": return require_markdown_text.encodeMarkdownText(require_markdown_write.buildMarkdownText(content));
54
- }
24
+ const codec = require_codecs_registry.DOCUMENT_FORMAT_CODECS[format].content;
25
+ if (!codec?.write) throw new Error(`RebuildFormat '${format}' has no content.write codec in DOCUMENT_FORMAT_CODECS -- this is an internal invariant violation, not a caller error`);
26
+ return require_codecs_registry.requireArrayBufferBytes(codec.write(content));
55
27
  }
56
28
  function mergeMetadata(current, overrides) {
57
29
  return {
@@ -1,21 +1,5 @@
1
- import { buildDocxPackage } from "../edit/docx/content.js";
2
- import { buildPptxPackage } from "../edit/pptx/content.js";
3
- import { buildOdtPackage } from "../edit/odt/content.js";
4
- import { buildOdpPackage } from "../edit/odp/content.js";
5
- import { buildOdsPackage } from "../edit/ods/content.js";
6
- import { buildOdgPackage } from "../edit/odg/content.js";
7
- import { readMarkdownContent } from "../markdown/read.js";
8
- import { buildMarkdownText } from "../markdown/write.js";
9
- import { readDocxContent } from "../ooxml/docx/read.js";
10
- import { readPptxContent } from "../ooxml/pptx/read.js";
11
- import { readOdtContent } from "../odf/odt/read.js";
12
- import { readOdpContent } from "../odf/odp/read.js";
13
- import { readOdsContent } from "../odf/ods/read.js";
14
- import { readOdgContent } from "../odf/odg/read.js";
15
- import { decodeMarkdownText, encodeMarkdownText } from "../markdown/text.js";
16
1
  import { throwIfAborted } from "../ports/abort.js";
17
- import { decodePackage, encodePackage } from "ooxml.js";
18
- import { decodePackage as decodePackage$1, encodePackage as encodePackage$1 } from "odf.js";
2
+ import { DOCUMENT_FORMAT_CODECS, requireArrayBufferBytes } from "../codecs/registry.js";
19
3
  import { readPdf, writePdf } from "pdf-codec";
20
4
  //#region src/metadata/write.ts
21
5
  const REBUILD_FORMATS = {
@@ -31,26 +15,14 @@ function isRebuildFormat(format) {
31
15
  return format in REBUILD_FORMATS;
32
16
  }
33
17
  function readContentForFormat(format, bytes) {
34
- switch (format) {
35
- case "docx": return readDocxContent(decodePackage(bytes));
36
- case "pptx": return readPptxContent(decodePackage(bytes));
37
- case "odt": return readOdtContent(decodePackage$1(bytes));
38
- case "odp": return readOdpContent(decodePackage$1(bytes));
39
- case "ods": return readOdsContent(decodePackage$1(bytes));
40
- case "odg": return readOdgContent(decodePackage$1(bytes));
41
- case "markdown": return readMarkdownContent(decodeMarkdownText(bytes));
42
- }
18
+ const content = DOCUMENT_FORMAT_CODECS[format].content;
19
+ if (!content) throw new Error(`RebuildFormat '${format}' has no content codec in DOCUMENT_FORMAT_CODECS -- this is an internal invariant violation, not a caller error`);
20
+ return content.read(bytes);
43
21
  }
44
22
  function buildBytesForRebuildFormat(format, content) {
45
- switch (format) {
46
- case "docx": return encodePackage(buildDocxPackage(content));
47
- case "pptx": return encodePackage(buildPptxPackage(content));
48
- case "odt": return encodePackage$1(buildOdtPackage(content));
49
- case "odp": return encodePackage$1(buildOdpPackage(content));
50
- case "ods": return encodePackage$1(buildOdsPackage(content));
51
- case "odg": return encodePackage$1(buildOdgPackage(content));
52
- case "markdown": return encodeMarkdownText(buildMarkdownText(content));
53
- }
23
+ const codec = DOCUMENT_FORMAT_CODECS[format].content;
24
+ if (!codec?.write) throw new Error(`RebuildFormat '${format}' has no content.write codec in DOCUMENT_FORMAT_CODECS -- this is an internal invariant violation, not a caller error`);
25
+ return requireArrayBufferBytes(codec.write(content));
54
26
  }
55
27
  function mergeMetadata(current, overrides) {
56
28
  return {
@@ -0,0 +1,44 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let ooxml_js = require("ooxml.js");
3
+ let odf_js = require("odf.js");
4
+ //#region src/package-codec.ts
5
+ const OOXML_PACKAGE_FORMATS = {
6
+ docx: true,
7
+ pptx: true,
8
+ xlsx: true
9
+ };
10
+ const ODF_PACKAGE_FORMATS = {
11
+ odt: true,
12
+ odp: true,
13
+ ods: true,
14
+ odg: true,
15
+ odf: true
16
+ };
17
+ function isOoxmlPackageFormat(format) {
18
+ return format in OOXML_PACKAGE_FORMATS;
19
+ }
20
+ function isOdfPackageFormat(format) {
21
+ return format in ODF_PACKAGE_FORMATS;
22
+ }
23
+ var UnsupportedPackageFormatError = class extends Error {
24
+ format;
25
+ constructor(format) {
26
+ super(`'${format}' documents carry no raw package concept to decode/encode -- expected one of docx, pptx, xlsx, odt, odp, ods, odg, odf`);
27
+ this.name = "UnsupportedPackageFormatError";
28
+ this.format = format;
29
+ }
30
+ };
31
+ function decodeDocumentPackage(format, bytes) {
32
+ if (isOoxmlPackageFormat(format)) return (0, ooxml_js.decodePackage)(bytes);
33
+ if (isOdfPackageFormat(format)) return (0, odf_js.decodePackage)(bytes);
34
+ throw new UnsupportedPackageFormatError(format);
35
+ }
36
+ function encodeDocumentPackage(format, pkg) {
37
+ if (isOoxmlPackageFormat(format)) return (0, ooxml_js.encodePackage)(pkg);
38
+ if (isOdfPackageFormat(format)) return (0, odf_js.encodePackage)(pkg);
39
+ throw new UnsupportedPackageFormatError(format);
40
+ }
41
+ //#endregion
42
+ exports.UnsupportedPackageFormatError = UnsupportedPackageFormatError;
43
+ exports.decodeDocumentPackage = decodeDocumentPackage;
44
+ exports.encodeDocumentPackage = encodeDocumentPackage;
@@ -0,0 +1,11 @@
1
+ import { DocumentFormat } from "./convert/port.cjs";
2
+ import { Package } from "ooxml.js";
3
+ //#region src/package-codec.d.ts
4
+ declare class UnsupportedPackageFormatError extends Error {
5
+ readonly format: DocumentFormat;
6
+ constructor(format: DocumentFormat);
7
+ }
8
+ declare function decodeDocumentPackage(format: DocumentFormat, bytes: Uint8Array<ArrayBuffer>): Package;
9
+ declare function encodeDocumentPackage(format: DocumentFormat, pkg: Package): Uint8Array<ArrayBuffer>;
10
+ //#endregion
11
+ export { UnsupportedPackageFormatError, decodeDocumentPackage, encodeDocumentPackage };
@@ -0,0 +1,11 @@
1
+ import { DocumentFormat } from "./convert/port.js";
2
+ import { Package } from "ooxml.js";
3
+ //#region src/package-codec.d.ts
4
+ declare class UnsupportedPackageFormatError extends Error {
5
+ readonly format: DocumentFormat;
6
+ constructor(format: DocumentFormat);
7
+ }
8
+ declare function decodeDocumentPackage(format: DocumentFormat, bytes: Uint8Array<ArrayBuffer>): Package;
9
+ declare function encodeDocumentPackage(format: DocumentFormat, pkg: Package): Uint8Array<ArrayBuffer>;
10
+ //#endregion
11
+ export { UnsupportedPackageFormatError, decodeDocumentPackage, encodeDocumentPackage };
@@ -0,0 +1,41 @@
1
+ import { decodePackage, encodePackage } from "ooxml.js";
2
+ import { decodePackage as decodePackage$1, encodePackage as encodePackage$1 } from "odf.js";
3
+ //#region src/package-codec.ts
4
+ const OOXML_PACKAGE_FORMATS = {
5
+ docx: true,
6
+ pptx: true,
7
+ xlsx: true
8
+ };
9
+ const ODF_PACKAGE_FORMATS = {
10
+ odt: true,
11
+ odp: true,
12
+ ods: true,
13
+ odg: true,
14
+ odf: true
15
+ };
16
+ function isOoxmlPackageFormat(format) {
17
+ return format in OOXML_PACKAGE_FORMATS;
18
+ }
19
+ function isOdfPackageFormat(format) {
20
+ return format in ODF_PACKAGE_FORMATS;
21
+ }
22
+ var UnsupportedPackageFormatError = class extends Error {
23
+ format;
24
+ constructor(format) {
25
+ super(`'${format}' documents carry no raw package concept to decode/encode -- expected one of docx, pptx, xlsx, odt, odp, ods, odg, odf`);
26
+ this.name = "UnsupportedPackageFormatError";
27
+ this.format = format;
28
+ }
29
+ };
30
+ function decodeDocumentPackage(format, bytes) {
31
+ if (isOoxmlPackageFormat(format)) return decodePackage(bytes);
32
+ if (isOdfPackageFormat(format)) return decodePackage$1(bytes);
33
+ throw new UnsupportedPackageFormatError(format);
34
+ }
35
+ function encodeDocumentPackage(format, pkg) {
36
+ if (isOoxmlPackageFormat(format)) return encodePackage(pkg);
37
+ if (isOdfPackageFormat(format)) return encodePackage$1(pkg);
38
+ throw new UnsupportedPackageFormatError(format);
39
+ }
40
+ //#endregion
41
+ export { UnsupportedPackageFormatError, decodeDocumentPackage, encodeDocumentPackage };
@@ -1,5 +1,5 @@
1
- import { Package } from "odf.js";
2
1
  import { FontRegistry, FontSubstitution, ProvidedFont } from "pdf-codec";
2
+ import { Package } from "odf.js";
3
3
  import { Package as Package$1 } from "ooxml.js";
4
4
  //#region src/fonts/registry.d.ts
5
5
  type FontSourcePackage = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js.documents",
3
- "version": "1.77.3",
3
+ "version": "1.78.0",
4
4
  "description": "Bidirectional docx/pptx <-> PDF conversion and a read+write editable OOXML document model, built on ooxml.js and Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {