odf.js 2.4.23 → 2.5.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.
Files changed (182) hide show
  1. package/README.md +12 -0
  2. package/dist/a1-5e9veCyu.d.cts +18 -0
  3. package/dist/a1-5e9veCyu.d.ts +18 -0
  4. package/dist/base64--HuymRl_.d.cts +5 -0
  5. package/dist/base64--HuymRl_.d.ts +5 -0
  6. package/dist/build-XSm3I8LT.d.cts +5 -0
  7. package/dist/build-Z1KRkSEB.d.ts +5 -0
  8. package/dist/cascade-8u4q16_U.d.ts +22 -0
  9. package/dist/cascade-qYa3mgnE.d.cts +22 -0
  10. package/dist/codec-CqVFFwD0.d.ts +107 -0
  11. package/dist/codec-Dg0R3WGd.d.cts +107 -0
  12. package/dist/codec.d.cts +2 -72
  13. package/dist/codec.d.ts +2 -72
  14. package/dist/color-CqXjt_to.d.cts +6 -0
  15. package/dist/color-CqXjt_to.d.ts +6 -0
  16. package/dist/embedded-CNMqOrnt.d.ts +13 -0
  17. package/dist/embedded-D7Kr1Sce.d.cts +13 -0
  18. package/dist/entities-BZlXvHqu.d.cts +5 -0
  19. package/dist/entities-BZlXvHqu.d.ts +5 -0
  20. package/dist/form-BC-wb1M2.d.cts +31 -0
  21. package/dist/form-DcGOX5RW.d.ts +31 -0
  22. package/dist/fragment-B1ZV7T5Z.d.ts +6 -0
  23. package/dist/fragment-B1og_8uA.d.cts +6 -0
  24. package/dist/geometry-DnhkIhAM.d.ts +12 -0
  25. package/dist/geometry-lKWJ_ifA.d.cts +12 -0
  26. package/dist/image/sniff.d.cts +1 -4
  27. package/dist/image/sniff.d.ts +1 -4
  28. package/dist/index.d.cts +43 -43
  29. package/dist/index.d.ts +43 -43
  30. package/dist/manifest-CmsCOCEi.d.cts +40 -0
  31. package/dist/manifest-xxJ4FpSe.d.ts +40 -0
  32. package/dist/manifest.cjs +0 -1
  33. package/dist/manifest.d.cts +2 -41
  34. package/dist/manifest.d.ts +2 -41
  35. package/dist/manifest.js +1 -1
  36. package/dist/masterpage-7nBnqFj-.d.ts +8 -0
  37. package/dist/masterpage-EmefIRgy.d.cts +8 -0
  38. package/dist/media-type-BOLkcHkJ.d.cts +20 -0
  39. package/dist/media-type-BOLkcHkJ.d.ts +20 -0
  40. package/dist/media-type.d.cts +1 -19
  41. package/dist/media-type.d.ts +1 -19
  42. package/dist/metadata-32LoP2TK.d.ts +7 -0
  43. package/dist/metadata-frJqeeSB.d.cts +7 -0
  44. package/dist/mimetype-BcLX0N-N.d.cts +6 -0
  45. package/dist/mimetype-uF-RHNpR.d.ts +6 -0
  46. package/dist/mimetype.cjs +0 -1
  47. package/dist/mimetype.d.cts +2 -7
  48. package/dist/mimetype.d.ts +2 -7
  49. package/dist/mimetype.js +1 -1
  50. package/dist/ns-Cihto3Fx.d.cts +33 -0
  51. package/dist/ns-Cihto3Fx.d.ts +33 -0
  52. package/dist/ns.d.cts +1 -32
  53. package/dist/ns.d.ts +1 -32
  54. package/dist/package-io/read.d.cts +1 -4
  55. package/dist/package-io/read.d.ts +1 -4
  56. package/dist/package-io/write.d.cts +1 -6
  57. package/dist/package-io/write.d.ts +1 -6
  58. package/dist/paragraph-9ii2naJC.d.cts +7 -0
  59. package/dist/paragraph-DWNnedIE.d.ts +7 -0
  60. package/dist/parse-A8_8sdpX.d.ts +5 -0
  61. package/dist/parse-CP5FLZqv.d.cts +5 -0
  62. package/dist/path-DE7wkIcz.d.cts +34 -0
  63. package/dist/path-DE7wkIcz.d.ts +34 -0
  64. package/dist/properties-BF_Fv6B3.d.cts +44 -0
  65. package/dist/properties-DjAIdPry.d.ts +44 -0
  66. package/dist/query-P-Y5DK0-.d.cts +9 -0
  67. package/dist/query-sECN-7vU.d.ts +9 -0
  68. package/dist/read-B0aBfNRf.d.ts +10 -0
  69. package/dist/read-BKS_zlGG.d.cts +10 -0
  70. package/dist/read-Bd16x8VD.d.cts +10 -0
  71. package/dist/read-BkFbEves.d.ts +15 -0
  72. package/dist/read-Bleh4LfR.d.ts +14 -0
  73. package/dist/read-BoIUENWq.d.ts +28 -0
  74. package/dist/read-C7gT8wtc.d.ts +10 -0
  75. package/dist/read-CFMsXSl7.d.cts +5 -0
  76. package/dist/read-CxdHrV1m.d.ts +10 -0
  77. package/dist/read-D4DKvOY7.d.cts +10 -0
  78. package/dist/read-DNNf5_6n.d.cts +15 -0
  79. package/dist/read-DapcRIZV.d.cts +10 -0
  80. package/dist/read-DhLNXgiM.d.ts +5 -0
  81. package/dist/read-Dn9qyBBs.d.ts +10 -0
  82. package/dist/read-DrdmKX0x.d.cts +28 -0
  83. package/dist/read-DyR9HfLT.d.cts +14 -0
  84. package/dist/registry-Dy6pjoh3.d.cts +37 -0
  85. package/dist/registry-R43n1hcL.d.ts +37 -0
  86. package/dist/report-BuCJ7_YU.d.cts +48 -0
  87. package/dist/report-MpwUgXbA.d.ts +48 -0
  88. package/dist/serialize-9xvti0FF.d.cts +7 -0
  89. package/dist/serialize-DvaE_t5D.d.ts +7 -0
  90. package/dist/shapes-BJAtBY24.d.ts +18 -0
  91. package/dist/shapes-CHc96HKu.d.cts +18 -0
  92. package/dist/sniff-DjpnUZRp.d.cts +5 -0
  93. package/dist/sniff-DjpnUZRp.d.ts +5 -0
  94. package/dist/span-BtmvlqZH.d.cts +5 -0
  95. package/dist/span-KXroEGuH.d.ts +5 -0
  96. package/dist/style-CwuPFm34.d.cts +2 -0
  97. package/dist/style-Jzwx2Q-Y.d.ts +2 -0
  98. package/dist/styles/properties.cjs +0 -1
  99. package/dist/styles/properties.d.cts +2 -45
  100. package/dist/styles/properties.d.ts +2 -45
  101. package/dist/styles/properties.js +1 -1
  102. package/dist/styles/registry.d.cts +1 -36
  103. package/dist/styles/registry.d.ts +1 -36
  104. package/dist/styles/serialize.d.cts +1 -6
  105. package/dist/styles/serialize.d.ts +1 -6
  106. package/dist/styles/span.d.cts +1 -4
  107. package/dist/styles/span.d.ts +1 -4
  108. package/dist/subdocument-CIxH3a5V.d.cts +8 -0
  109. package/dist/subdocument-DQNQF7wV.d.ts +8 -0
  110. package/dist/table-D81TZyBn.d.ts +14 -0
  111. package/dist/table-sweV3r9n.d.cts +14 -0
  112. package/dist/text-Cal14ZaX.d.cts +8 -0
  113. package/dist/text-CkNojpZm.d.ts +8 -0
  114. package/dist/transform-C7GrZZdR.d.ts +26 -0
  115. package/dist/transform-DKEjydnm.d.cts +26 -0
  116. package/dist/typed/draw/embedded.d.cts +1 -12
  117. package/dist/typed/draw/embedded.d.ts +1 -12
  118. package/dist/typed/draw/shapes.d.cts +1 -17
  119. package/dist/typed/draw/shapes.d.ts +1 -17
  120. package/dist/typed/formula/read.d.cts +1 -13
  121. package/dist/typed/formula/read.d.ts +1 -13
  122. package/dist/typed/odb/form.d.cts +1 -30
  123. package/dist/typed/odb/form.d.ts +1 -30
  124. package/dist/typed/odb/read.d.cts +1 -27
  125. package/dist/typed/odb/read.d.ts +1 -27
  126. package/dist/typed/odb/report.d.cts +1 -47
  127. package/dist/typed/odb/report.d.ts +1 -47
  128. package/dist/typed/odb/subdocument.d.cts +1 -7
  129. package/dist/typed/odb/subdocument.d.ts +1 -7
  130. package/dist/typed/odg/read.d.cts +1 -9
  131. package/dist/typed/odg/read.d.ts +1 -9
  132. package/dist/typed/odm/read.d.cts +1 -14
  133. package/dist/typed/odm/read.d.ts +1 -14
  134. package/dist/typed/odp/read.d.cts +1 -9
  135. package/dist/typed/odp/read.d.ts +1 -9
  136. package/dist/typed/ods/read.d.cts +1 -9
  137. package/dist/typed/ods/read.d.ts +1 -9
  138. package/dist/typed/odt/read.d.cts +1 -9
  139. package/dist/typed/odt/read.d.ts +1 -9
  140. package/dist/typed/shared/a1.d.cts +1 -17
  141. package/dist/typed/shared/a1.d.ts +1 -17
  142. package/dist/typed/shared/cascade.d.cts +1 -21
  143. package/dist/typed/shared/cascade.d.ts +1 -21
  144. package/dist/typed/shared/color.d.cts +1 -5
  145. package/dist/typed/shared/color.d.ts +1 -5
  146. package/dist/typed/shared/geometry.d.cts +1 -11
  147. package/dist/typed/shared/geometry.d.ts +1 -11
  148. package/dist/typed/shared/masterpage.d.cts +1 -7
  149. package/dist/typed/shared/masterpage.d.ts +1 -7
  150. package/dist/typed/shared/metadata.d.cts +1 -6
  151. package/dist/typed/shared/metadata.d.ts +1 -6
  152. package/dist/typed/shared/paragraph.d.cts +1 -6
  153. package/dist/typed/shared/paragraph.d.ts +1 -6
  154. package/dist/typed/shared/path.d.cts +1 -33
  155. package/dist/typed/shared/path.d.ts +1 -33
  156. package/dist/typed/shared/style.d.cts +1 -1
  157. package/dist/typed/shared/style.d.ts +1 -1
  158. package/dist/typed/shared/table.d.cts +1 -13
  159. package/dist/typed/shared/table.d.ts +1 -13
  160. package/dist/typed/shared/text.d.cts +1 -7
  161. package/dist/typed/shared/text.d.ts +1 -7
  162. package/dist/typed/shared/transform.d.cts +1 -25
  163. package/dist/typed/shared/transform.d.ts +1 -25
  164. package/dist/util/base64.d.cts +1 -4
  165. package/dist/util/base64.d.ts +1 -4
  166. package/dist/write-C0nwVuPI.d.ts +7 -0
  167. package/dist/write-Dfb2tirK.d.cts +7 -0
  168. package/dist/xml/build.d.cts +1 -4
  169. package/dist/xml/build.d.ts +1 -4
  170. package/dist/xml/entities.d.cts +1 -4
  171. package/dist/xml/entities.d.ts +1 -4
  172. package/dist/xml/fragment.d.cts +1 -5
  173. package/dist/xml/fragment.d.ts +1 -5
  174. package/dist/xml/parse.d.cts +1 -4
  175. package/dist/xml/parse.d.ts +1 -4
  176. package/dist/xml/query.d.cts +1 -8
  177. package/dist/xml/query.d.ts +1 -8
  178. package/dist/zip-ie17sOo5.d.cts +9 -0
  179. package/dist/zip-ie17sOo5.d.ts +9 -0
  180. package/dist/zip.d.cts +1 -8
  181. package/dist/zip.d.ts +1 -8
  182. package/package.json +1 -1
package/README.md CHANGED
@@ -86,6 +86,18 @@ pnpm add odf.js
86
86
  npm install odf.js
87
87
  ```
88
88
 
89
+ ## Build, test, and lint
90
+
91
+ ```sh
92
+ pnpm build # turbo run _build -> tsdown (dist/: ESM + CJS + .d.ts)
93
+ pnpm typecheck # turbo run _typecheck -> tsc -p tsconfig.json && tsc -p tsconfig.node.json
94
+ pnpm lint # turbo run _lint -> eslint . --fix --cache --max-warnings 0
95
+ pnpm test # turbo run _test -> vitest run --project unit
96
+ pnpm test:workers # turbo run _test:workers -> vitest run --config vitest.workers.config.ts (the package parsing and ODF content readers run inside a real Cloudflare Workers isolate, proving they carry zero Node-only API usage)
97
+ ```
98
+
99
+ To run a single test file: `pnpm vitest run src/path/to/file.test.ts`.
100
+
89
101
  ## Usage
90
102
 
91
103
  The lossless core — the only public surface stable enough to document with real examples right now:
@@ -0,0 +1,18 @@
1
+ //#region src/typed/shared/a1.d.ts
2
+ declare function columnIndexToLetters(index: number): string;
3
+ declare function cellReference(columnIndex: number, rowIndex: number): string;
4
+ declare function columnLettersToIndex(letters: string): number | undefined;
5
+ declare function parseCellReference(reference: string): {
6
+ column: number;
7
+ row: number;
8
+ } | undefined;
9
+ declare class TableCursor {
10
+ private columnCursor;
11
+ private rowCursor;
12
+ get columnIndex(): number;
13
+ get rowIndex(): number;
14
+ nextCell(repeatCount?: number): string;
15
+ nextRow(repeatCount?: number): void;
16
+ }
17
+ //#endregion
18
+ export { parseCellReference as a, columnLettersToIndex as i, cellReference as n, columnIndexToLetters as r, TableCursor as t };
@@ -0,0 +1,18 @@
1
+ //#region src/typed/shared/a1.d.ts
2
+ declare function columnIndexToLetters(index: number): string;
3
+ declare function cellReference(columnIndex: number, rowIndex: number): string;
4
+ declare function columnLettersToIndex(letters: string): number | undefined;
5
+ declare function parseCellReference(reference: string): {
6
+ column: number;
7
+ row: number;
8
+ } | undefined;
9
+ declare class TableCursor {
10
+ private columnCursor;
11
+ private rowCursor;
12
+ get columnIndex(): number;
13
+ get rowIndex(): number;
14
+ nextCell(repeatCount?: number): string;
15
+ nextRow(repeatCount?: number): void;
16
+ }
17
+ //#endregion
18
+ export { parseCellReference as a, columnLettersToIndex as i, cellReference as n, columnIndexToLetters as r, TableCursor as t };
@@ -0,0 +1,5 @@
1
+ //#region src/util/base64.d.ts
2
+ declare function bytesToBase64(bytes: Uint8Array<ArrayBuffer>): string;
3
+ declare function base64ToBytes(b64: string): Uint8Array<ArrayBuffer>;
4
+ //#endregion
5
+ export { bytesToBase64 as n, base64ToBytes as t };
@@ -0,0 +1,5 @@
1
+ //#region src/util/base64.d.ts
2
+ declare function bytesToBase64(bytes: Uint8Array<ArrayBuffer>): string;
3
+ declare function base64ToBytes(b64: string): Uint8Array<ArrayBuffer>;
4
+ //#endregion
5
+ export { bytesToBase64 as n, base64ToBytes as t };
@@ -0,0 +1,5 @@
1
+ import { d as XmlNode } from "./node-CkBWRjNR.cjs";
2
+ //#region src/xml/build.d.ts
3
+ declare function buildXml(nodes: XmlNode[]): string;
4
+ //#endregion
5
+ export { buildXml as t };
@@ -0,0 +1,5 @@
1
+ import { d as XmlNode } from "./node-CkBWRjNR.js";
2
+ //#region src/xml/build.d.ts
3
+ declare function buildXml(nodes: XmlNode[]): string;
4
+ //#endregion
5
+ export { buildXml as t };
@@ -0,0 +1,22 @@
1
+ import { l as XmlElement } from "./node-CkBWRjNR.js";
2
+ import { Package } from "./model/package.js";
3
+ import { n as StyleProperties } from "./properties-DjAIdPry.js";
4
+ import { i as StyleFamily } from "./registry-R43n1hcL.js";
5
+ //#region src/typed/shared/cascade.d.ts
6
+ interface CascadeDiagnostic {
7
+ severity: 'warning';
8
+ message: string;
9
+ }
10
+ interface StyleCascadeResult {
11
+ properties: StyleProperties;
12
+ diagnostics: CascadeDiagnostic[];
13
+ }
14
+ interface StyleElementChainResult {
15
+ elements: XmlElement[];
16
+ diagnostics: CascadeDiagnostic[];
17
+ }
18
+ declare function resolveStyleElementChain(styleName: string | undefined, family: StyleFamily, pkg: Package): StyleElementChainResult;
19
+ declare function resolveStyle(styleName: string | undefined, family: StyleFamily, pkg: Package): StyleCascadeResult;
20
+ declare function findStyleElement(styleName: string, family: StyleFamily, pkg: Package): XmlElement | undefined;
21
+ //#endregion
22
+ export { resolveStyle as a, findStyleElement as i, StyleCascadeResult as n, resolveStyleElementChain as o, StyleElementChainResult as r, CascadeDiagnostic as t };
@@ -0,0 +1,22 @@
1
+ import { l as XmlElement } from "./node-CkBWRjNR.cjs";
2
+ import { Package } from "./model/package.cjs";
3
+ import { n as StyleProperties } from "./properties-BF_Fv6B3.cjs";
4
+ import { i as StyleFamily } from "./registry-Dy6pjoh3.cjs";
5
+ //#region src/typed/shared/cascade.d.ts
6
+ interface CascadeDiagnostic {
7
+ severity: 'warning';
8
+ message: string;
9
+ }
10
+ interface StyleCascadeResult {
11
+ properties: StyleProperties;
12
+ diagnostics: CascadeDiagnostic[];
13
+ }
14
+ interface StyleElementChainResult {
15
+ elements: XmlElement[];
16
+ diagnostics: CascadeDiagnostic[];
17
+ }
18
+ declare function resolveStyleElementChain(styleName: string | undefined, family: StyleFamily, pkg: Package): StyleElementChainResult;
19
+ declare function resolveStyle(styleName: string | undefined, family: StyleFamily, pkg: Package): StyleCascadeResult;
20
+ declare function findStyleElement(styleName: string, family: StyleFamily, pkg: Package): XmlElement | undefined;
21
+ //#endregion
22
+ export { resolveStyle as a, findStyleElement as i, StyleCascadeResult as n, resolveStyleElementChain as o, StyleElementChainResult as r, CascadeDiagnostic as t };
@@ -0,0 +1,107 @@
1
+ import { d as XmlNode } from "./node-CkBWRjNR.js";
2
+ import { Package } from "./model/package.js";
3
+ import "./read-DhLNXgiM.js";
4
+ import "./write-C0nwVuPI.js";
5
+ import "./parse-A8_8sdpX.js";
6
+ import "./build-Z1KRkSEB.js";
7
+ import "./mimetype-uF-RHNpR.js";
8
+ import "./fragment-B1ZV7T5Z.js";
9
+ import "./manifest-xxJ4FpSe.js";
10
+ import "./properties-DjAIdPry.js";
11
+ import "./serialize-DvaE_t5D.js";
12
+ import "./registry-R43n1hcL.js";
13
+ import "./span-KXroEGuH.js";
14
+ import "./query-sECN-7vU.js";
15
+ import "./color-CqXjt_to.js";
16
+ import "./geometry-DnhkIhAM.js";
17
+ import "./style-Jzwx2Q-Y.js";
18
+ import "./text-CkNojpZm.js";
19
+ import "./cascade-8u4q16_U.js";
20
+ import "./metadata-32LoP2TK.js";
21
+ import "./paragraph-DWNnedIE.js";
22
+ import "./table-D81TZyBn.js";
23
+ import "./transform-C7GrZZdR.js";
24
+ import "./masterpage-7nBnqFj-.js";
25
+ import "./path-DE7wkIcz.js";
26
+ import "./shapes-BJAtBY24.js";
27
+ import "./embedded-CNMqOrnt.js";
28
+ import "./read-CxdHrV1m.js";
29
+ import "./read-Dn9qyBBs.js";
30
+ import "./read-C7gT8wtc.js";
31
+ import "./read-B0aBfNRf.js";
32
+ import "./read-Bleh4LfR.js";
33
+ import "./read-BkFbEves.js";
34
+ import "./read-BoIUENWq.js";
35
+ import "./subdocument-DQNQF7wV.js";
36
+ import "./form-DcGOX5RW.js";
37
+ import "./report-MpwUgXbA.js";
38
+ import { z } from "zod";
39
+ //#region src/codec.d.ts
40
+ declare const xmlCodec: z.ZodCodec<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
41
+ type: z.ZodLiteral<"text">;
42
+ value: z.ZodString;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ type: z.ZodLiteral<"cdata">;
45
+ value: z.ZodString;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ type: z.ZodLiteral<"comment">;
48
+ value: z.ZodString;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ type: z.ZodLiteral<"declaration">;
51
+ attributes: z.ZodArray<z.ZodObject<{
52
+ name: z.ZodString;
53
+ value: z.ZodString;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ type: z.ZodLiteral<"pi">;
57
+ target: z.ZodString;
58
+ content: z.ZodString;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<"element">;
61
+ tag: z.ZodString;
62
+ attributes: z.ZodArray<z.ZodObject<{
63
+ name: z.ZodString;
64
+ value: z.ZodString;
65
+ }, z.core.$strip>>;
66
+ children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
67
+ }, z.core.$strip>], "type">>>;
68
+ declare const packageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodObject<{
69
+ parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
70
+ kind: z.ZodLiteral<"xml">;
71
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
72
+ type: z.ZodLiteral<"text">;
73
+ value: z.ZodString;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ type: z.ZodLiteral<"cdata">;
76
+ value: z.ZodString;
77
+ }, z.core.$strip>, z.ZodObject<{
78
+ type: z.ZodLiteral<"comment">;
79
+ value: z.ZodString;
80
+ }, z.core.$strip>, z.ZodObject<{
81
+ type: z.ZodLiteral<"declaration">;
82
+ attributes: z.ZodArray<z.ZodObject<{
83
+ name: z.ZodString;
84
+ value: z.ZodString;
85
+ }, z.core.$strip>>;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ type: z.ZodLiteral<"pi">;
88
+ target: z.ZodString;
89
+ content: z.ZodString;
90
+ }, z.core.$strip>, z.ZodObject<{
91
+ type: z.ZodLiteral<"element">;
92
+ tag: z.ZodString;
93
+ attributes: z.ZodArray<z.ZodObject<{
94
+ name: z.ZodString;
95
+ value: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
98
+ }, z.core.$strip>], "type">>;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ kind: z.ZodLiteral<"binary">;
101
+ base64: z.ZodString;
102
+ }, z.core.$strip>], "kind">>;
103
+ }, z.core.$strip>>;
104
+ declare function decodePackage(bytes: Uint8Array<ArrayBuffer>): Package;
105
+ declare function encodePackage(pkg: Package): Uint8Array<ArrayBuffer>;
106
+ //#endregion
107
+ export { xmlCodec as i, encodePackage as n, packageCodec as r, decodePackage as t };
@@ -0,0 +1,107 @@
1
+ import { d as XmlNode } from "./node-CkBWRjNR.cjs";
2
+ import { Package } from "./model/package.cjs";
3
+ import "./read-CFMsXSl7.cjs";
4
+ import "./write-Dfb2tirK.cjs";
5
+ import "./parse-CP5FLZqv.cjs";
6
+ import "./build-XSm3I8LT.cjs";
7
+ import "./mimetype-BcLX0N-N.cjs";
8
+ import "./fragment-B1og_8uA.cjs";
9
+ import "./manifest-CmsCOCEi.cjs";
10
+ import "./properties-BF_Fv6B3.cjs";
11
+ import "./serialize-9xvti0FF.cjs";
12
+ import "./registry-Dy6pjoh3.cjs";
13
+ import "./span-BtmvlqZH.cjs";
14
+ import "./query-P-Y5DK0-.cjs";
15
+ import "./color-CqXjt_to.cjs";
16
+ import "./geometry-lKWJ_ifA.cjs";
17
+ import "./style-CwuPFm34.cjs";
18
+ import "./text-Cal14ZaX.cjs";
19
+ import "./cascade-qYa3mgnE.cjs";
20
+ import "./metadata-frJqeeSB.cjs";
21
+ import "./paragraph-9ii2naJC.cjs";
22
+ import "./table-sweV3r9n.cjs";
23
+ import "./transform-DKEjydnm.cjs";
24
+ import "./masterpage-EmefIRgy.cjs";
25
+ import "./path-DE7wkIcz.cjs";
26
+ import "./shapes-CHc96HKu.cjs";
27
+ import "./embedded-D7Kr1Sce.cjs";
28
+ import "./read-Bd16x8VD.cjs";
29
+ import "./read-BKS_zlGG.cjs";
30
+ import "./read-DapcRIZV.cjs";
31
+ import "./read-D4DKvOY7.cjs";
32
+ import "./read-DyR9HfLT.cjs";
33
+ import "./read-DNNf5_6n.cjs";
34
+ import "./read-DrdmKX0x.cjs";
35
+ import "./subdocument-CIxH3a5V.cjs";
36
+ import "./form-BC-wb1M2.cjs";
37
+ import "./report-BuCJ7_YU.cjs";
38
+ import { z } from "zod";
39
+ //#region src/codec.d.ts
40
+ declare const xmlCodec: z.ZodCodec<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
41
+ type: z.ZodLiteral<"text">;
42
+ value: z.ZodString;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ type: z.ZodLiteral<"cdata">;
45
+ value: z.ZodString;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ type: z.ZodLiteral<"comment">;
48
+ value: z.ZodString;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ type: z.ZodLiteral<"declaration">;
51
+ attributes: z.ZodArray<z.ZodObject<{
52
+ name: z.ZodString;
53
+ value: z.ZodString;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ type: z.ZodLiteral<"pi">;
57
+ target: z.ZodString;
58
+ content: z.ZodString;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<"element">;
61
+ tag: z.ZodString;
62
+ attributes: z.ZodArray<z.ZodObject<{
63
+ name: z.ZodString;
64
+ value: z.ZodString;
65
+ }, z.core.$strip>>;
66
+ children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
67
+ }, z.core.$strip>], "type">>>;
68
+ declare const packageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodObject<{
69
+ parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
70
+ kind: z.ZodLiteral<"xml">;
71
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
72
+ type: z.ZodLiteral<"text">;
73
+ value: z.ZodString;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ type: z.ZodLiteral<"cdata">;
76
+ value: z.ZodString;
77
+ }, z.core.$strip>, z.ZodObject<{
78
+ type: z.ZodLiteral<"comment">;
79
+ value: z.ZodString;
80
+ }, z.core.$strip>, z.ZodObject<{
81
+ type: z.ZodLiteral<"declaration">;
82
+ attributes: z.ZodArray<z.ZodObject<{
83
+ name: z.ZodString;
84
+ value: z.ZodString;
85
+ }, z.core.$strip>>;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ type: z.ZodLiteral<"pi">;
88
+ target: z.ZodString;
89
+ content: z.ZodString;
90
+ }, z.core.$strip>, z.ZodObject<{
91
+ type: z.ZodLiteral<"element">;
92
+ tag: z.ZodString;
93
+ attributes: z.ZodArray<z.ZodObject<{
94
+ name: z.ZodString;
95
+ value: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
98
+ }, z.core.$strip>], "type">>;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ kind: z.ZodLiteral<"binary">;
101
+ base64: z.ZodString;
102
+ }, z.core.$strip>], "kind">>;
103
+ }, z.core.$strip>>;
104
+ declare function decodePackage(bytes: Uint8Array<ArrayBuffer>): Package;
105
+ declare function encodePackage(pkg: Package): Uint8Array<ArrayBuffer>;
106
+ //#endregion
107
+ export { xmlCodec as i, encodePackage as n, packageCodec as r, decodePackage as t };
package/dist/codec.d.cts CHANGED
@@ -1,72 +1,2 @@
1
- import { d as XmlNode } from "./node-CkBWRjNR.cjs";
2
- import { Package } from "./model/package.cjs";
3
- import { z } from "zod";
4
- //#region src/codec.d.ts
5
- declare const xmlCodec: z.ZodCodec<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
- type: z.ZodLiteral<"text">;
7
- value: z.ZodString;
8
- }, z.core.$strip>, z.ZodObject<{
9
- type: z.ZodLiteral<"cdata">;
10
- value: z.ZodString;
11
- }, z.core.$strip>, z.ZodObject<{
12
- type: z.ZodLiteral<"comment">;
13
- value: z.ZodString;
14
- }, z.core.$strip>, z.ZodObject<{
15
- type: z.ZodLiteral<"declaration">;
16
- attributes: z.ZodArray<z.ZodObject<{
17
- name: z.ZodString;
18
- value: z.ZodString;
19
- }, z.core.$strip>>;
20
- }, z.core.$strip>, z.ZodObject<{
21
- type: z.ZodLiteral<"pi">;
22
- target: z.ZodString;
23
- content: z.ZodString;
24
- }, z.core.$strip>, z.ZodObject<{
25
- type: z.ZodLiteral<"element">;
26
- tag: z.ZodString;
27
- attributes: z.ZodArray<z.ZodObject<{
28
- name: z.ZodString;
29
- value: z.ZodString;
30
- }, z.core.$strip>>;
31
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
32
- }, z.core.$strip>], "type">>>;
33
- declare const packageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodObject<{
34
- parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
35
- kind: z.ZodLiteral<"xml">;
36
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
37
- type: z.ZodLiteral<"text">;
38
- value: z.ZodString;
39
- }, z.core.$strip>, z.ZodObject<{
40
- type: z.ZodLiteral<"cdata">;
41
- value: z.ZodString;
42
- }, z.core.$strip>, z.ZodObject<{
43
- type: z.ZodLiteral<"comment">;
44
- value: z.ZodString;
45
- }, z.core.$strip>, z.ZodObject<{
46
- type: z.ZodLiteral<"declaration">;
47
- attributes: z.ZodArray<z.ZodObject<{
48
- name: z.ZodString;
49
- value: z.ZodString;
50
- }, z.core.$strip>>;
51
- }, z.core.$strip>, z.ZodObject<{
52
- type: z.ZodLiteral<"pi">;
53
- target: z.ZodString;
54
- content: z.ZodString;
55
- }, z.core.$strip>, z.ZodObject<{
56
- type: z.ZodLiteral<"element">;
57
- tag: z.ZodString;
58
- attributes: z.ZodArray<z.ZodObject<{
59
- name: z.ZodString;
60
- value: z.ZodString;
61
- }, z.core.$strip>>;
62
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
63
- }, z.core.$strip>], "type">>;
64
- }, z.core.$strip>, z.ZodObject<{
65
- kind: z.ZodLiteral<"binary">;
66
- base64: z.ZodString;
67
- }, z.core.$strip>], "kind">>;
68
- }, z.core.$strip>>;
69
- declare function decodePackage(bytes: Uint8Array<ArrayBuffer>): Package;
70
- declare function encodePackage(pkg: Package): Uint8Array<ArrayBuffer>;
71
- //#endregion
72
- export { type XmlNode, decodePackage, encodePackage, packageCodec, xmlCodec };
1
+ import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-Dg0R3WGd.cjs";
2
+ export { decodePackage, encodePackage, packageCodec, xmlCodec };
package/dist/codec.d.ts CHANGED
@@ -1,72 +1,2 @@
1
- import { d as XmlNode } from "./node-CkBWRjNR.js";
2
- import { Package } from "./model/package.js";
3
- import { z } from "zod";
4
- //#region src/codec.d.ts
5
- declare const xmlCodec: z.ZodCodec<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
- type: z.ZodLiteral<"text">;
7
- value: z.ZodString;
8
- }, z.core.$strip>, z.ZodObject<{
9
- type: z.ZodLiteral<"cdata">;
10
- value: z.ZodString;
11
- }, z.core.$strip>, z.ZodObject<{
12
- type: z.ZodLiteral<"comment">;
13
- value: z.ZodString;
14
- }, z.core.$strip>, z.ZodObject<{
15
- type: z.ZodLiteral<"declaration">;
16
- attributes: z.ZodArray<z.ZodObject<{
17
- name: z.ZodString;
18
- value: z.ZodString;
19
- }, z.core.$strip>>;
20
- }, z.core.$strip>, z.ZodObject<{
21
- type: z.ZodLiteral<"pi">;
22
- target: z.ZodString;
23
- content: z.ZodString;
24
- }, z.core.$strip>, z.ZodObject<{
25
- type: z.ZodLiteral<"element">;
26
- tag: z.ZodString;
27
- attributes: z.ZodArray<z.ZodObject<{
28
- name: z.ZodString;
29
- value: z.ZodString;
30
- }, z.core.$strip>>;
31
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
32
- }, z.core.$strip>], "type">>>;
33
- declare const packageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodObject<{
34
- parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
35
- kind: z.ZodLiteral<"xml">;
36
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
37
- type: z.ZodLiteral<"text">;
38
- value: z.ZodString;
39
- }, z.core.$strip>, z.ZodObject<{
40
- type: z.ZodLiteral<"cdata">;
41
- value: z.ZodString;
42
- }, z.core.$strip>, z.ZodObject<{
43
- type: z.ZodLiteral<"comment">;
44
- value: z.ZodString;
45
- }, z.core.$strip>, z.ZodObject<{
46
- type: z.ZodLiteral<"declaration">;
47
- attributes: z.ZodArray<z.ZodObject<{
48
- name: z.ZodString;
49
- value: z.ZodString;
50
- }, z.core.$strip>>;
51
- }, z.core.$strip>, z.ZodObject<{
52
- type: z.ZodLiteral<"pi">;
53
- target: z.ZodString;
54
- content: z.ZodString;
55
- }, z.core.$strip>, z.ZodObject<{
56
- type: z.ZodLiteral<"element">;
57
- tag: z.ZodString;
58
- attributes: z.ZodArray<z.ZodObject<{
59
- name: z.ZodString;
60
- value: z.ZodString;
61
- }, z.core.$strip>>;
62
- children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
63
- }, z.core.$strip>], "type">>;
64
- }, z.core.$strip>, z.ZodObject<{
65
- kind: z.ZodLiteral<"binary">;
66
- base64: z.ZodString;
67
- }, z.core.$strip>], "kind">>;
68
- }, z.core.$strip>>;
69
- declare function decodePackage(bytes: Uint8Array<ArrayBuffer>): Package;
70
- declare function encodePackage(pkg: Package): Uint8Array<ArrayBuffer>;
71
- //#endregion
72
- export { type XmlNode, decodePackage, encodePackage, packageCodec, xmlCodec };
1
+ import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-CqVFFwD0.js";
2
+ export { decodePackage, encodePackage, packageCodec, xmlCodec };
@@ -0,0 +1,6 @@
1
+ import { Color } from "document-schema.js";
2
+ //#region src/typed/shared/color.d.ts
3
+ declare function parseOdfColor(value: string): Color | undefined;
4
+ declare function formatOdfColor(color: Color): string;
5
+ //#endregion
6
+ export { parseOdfColor as n, formatOdfColor as t };
@@ -0,0 +1,6 @@
1
+ import { Color } from "document-schema.js";
2
+ //#region src/typed/shared/color.d.ts
3
+ declare function parseOdfColor(value: string): Color | undefined;
4
+ declare function formatOdfColor(color: Color): string;
5
+ //#endregion
6
+ export { parseOdfColor as n, formatOdfColor as t };
@@ -0,0 +1,13 @@
1
+ import { l as XmlElement } from "./node-CkBWRjNR.js";
2
+ import { Package } from "./model/package.js";
3
+ import { ContentEmbeddedObjectKind } from "document-schema.js";
4
+ //#region src/typed/draw/embedded.d.ts
5
+ type EmbeddedDocumentKind = ContentEmbeddedObjectKind;
6
+ interface EmbeddedDrawObject {
7
+ objectKind: EmbeddedDocumentKind;
8
+ package: Package;
9
+ href: string;
10
+ }
11
+ declare function readDrawObjectReference(frame: XmlElement, pkg: Package): EmbeddedDrawObject | undefined;
12
+ //#endregion
13
+ export { EmbeddedDrawObject as n, readDrawObjectReference as r, EmbeddedDocumentKind as t };
@@ -0,0 +1,13 @@
1
+ import { l as XmlElement } from "./node-CkBWRjNR.cjs";
2
+ import { Package } from "./model/package.cjs";
3
+ import { ContentEmbeddedObjectKind } from "document-schema.js";
4
+ //#region src/typed/draw/embedded.d.ts
5
+ type EmbeddedDocumentKind = ContentEmbeddedObjectKind;
6
+ interface EmbeddedDrawObject {
7
+ objectKind: EmbeddedDocumentKind;
8
+ package: Package;
9
+ href: string;
10
+ }
11
+ declare function readDrawObjectReference(frame: XmlElement, pkg: Package): EmbeddedDrawObject | undefined;
12
+ //#endregion
13
+ export { EmbeddedDrawObject as n, readDrawObjectReference as r, EmbeddedDocumentKind as t };
@@ -0,0 +1,5 @@
1
+ //#region src/xml/entities.d.ts
2
+ declare function encodeXmlText(value: string): string;
3
+ declare function decodeXmlText(value: string): string;
4
+ //#endregion
5
+ export { encodeXmlText as n, decodeXmlText as t };
@@ -0,0 +1,5 @@
1
+ //#region src/xml/entities.d.ts
2
+ declare function encodeXmlText(value: string): string;
3
+ declare function decodeXmlText(value: string): string;
4
+ //#endregion
5
+ export { encodeXmlText as n, decodeXmlText as t };
@@ -0,0 +1,31 @@
1
+ import { Package } from "./model/package.cjs";
2
+ import { t as OdtDocument } from "./read-BKS_zlGG.cjs";
3
+ //#region src/typed/odb/form.d.ts
4
+ interface OdbFormControl {
5
+ tag: string;
6
+ name?: string;
7
+ controlImplementation?: string;
8
+ dataField?: string;
9
+ id?: string;
10
+ label?: string;
11
+ controls: OdbFormControl[];
12
+ }
13
+ interface OdbFormDefinition {
14
+ name?: string;
15
+ command?: string;
16
+ commandType?: string;
17
+ datasource?: string;
18
+ filter?: string;
19
+ order?: string;
20
+ controls: OdbFormControl[];
21
+ subForms: OdbFormDefinition[];
22
+ }
23
+ interface OdbForm {
24
+ name: string;
25
+ href: string;
26
+ document: OdtDocument;
27
+ forms: OdbFormDefinition[];
28
+ }
29
+ declare function readOdbForm(pkg: Package, formName: string): OdbForm;
30
+ //#endregion
31
+ export { readOdbForm as i, OdbFormControl as n, OdbFormDefinition as r, OdbForm as t };
@@ -0,0 +1,31 @@
1
+ import { Package } from "./model/package.js";
2
+ import { t as OdtDocument } from "./read-Dn9qyBBs.js";
3
+ //#region src/typed/odb/form.d.ts
4
+ interface OdbFormControl {
5
+ tag: string;
6
+ name?: string;
7
+ controlImplementation?: string;
8
+ dataField?: string;
9
+ id?: string;
10
+ label?: string;
11
+ controls: OdbFormControl[];
12
+ }
13
+ interface OdbFormDefinition {
14
+ name?: string;
15
+ command?: string;
16
+ commandType?: string;
17
+ datasource?: string;
18
+ filter?: string;
19
+ order?: string;
20
+ controls: OdbFormControl[];
21
+ subForms: OdbFormDefinition[];
22
+ }
23
+ interface OdbForm {
24
+ name: string;
25
+ href: string;
26
+ document: OdtDocument;
27
+ forms: OdbFormDefinition[];
28
+ }
29
+ declare function readOdbForm(pkg: Package, formName: string): OdbForm;
30
+ //#endregion
31
+ export { readOdbForm as i, OdbFormControl as n, OdbFormDefinition as r, OdbForm as t };
@@ -0,0 +1,6 @@
1
+ import { d as XmlNode, h as XmlText, l as XmlElement } from "./node-CkBWRjNR.js";
2
+ //#region src/xml/fragment.d.ts
3
+ declare function el(tag: string, attrs?: Record<string, string>, children?: XmlNode[]): XmlElement;
4
+ declare function txt(value: string): XmlText;
5
+ //#endregion
6
+ export { txt as n, el as t };
@@ -0,0 +1,6 @@
1
+ import { d as XmlNode, h as XmlText, l as XmlElement } from "./node-CkBWRjNR.cjs";
2
+ //#region src/xml/fragment.d.ts
3
+ declare function el(tag: string, attrs?: Record<string, string>, children?: XmlNode[]): XmlElement;
4
+ declare function txt(value: string): XmlText;
5
+ //#endregion
6
+ export { txt as n, el as t };
@@ -0,0 +1,12 @@
1
+ import { l as XmlElement } from "./node-CkBWRjNR.js";
2
+ import { Box, ContentPathPoint, Margins, PageSize } from "document-schema.js";
3
+ //#region src/typed/shared/geometry.d.ts
4
+ declare function parsePageSize(pageLayoutProperties: XmlElement): PageSize | undefined;
5
+ declare function parseMargins(pageLayoutProperties: XmlElement): Margins | undefined;
6
+ declare function parseBox(element: XmlElement): Box | undefined;
7
+ declare function parseLinePoints(element: XmlElement): {
8
+ from: ContentPathPoint;
9
+ to: ContentPathPoint;
10
+ } | undefined;
11
+ //#endregion
12
+ export { parsePageSize as i, parseLinePoints as n, parseMargins as r, parseBox as t };
@@ -0,0 +1,12 @@
1
+ import { l as XmlElement } from "./node-CkBWRjNR.cjs";
2
+ import { Box, ContentPathPoint, Margins, PageSize } from "document-schema.js";
3
+ //#region src/typed/shared/geometry.d.ts
4
+ declare function parsePageSize(pageLayoutProperties: XmlElement): PageSize | undefined;
5
+ declare function parseMargins(pageLayoutProperties: XmlElement): Margins | undefined;
6
+ declare function parseBox(element: XmlElement): Box | undefined;
7
+ declare function parseLinePoints(element: XmlElement): {
8
+ from: ContentPathPoint;
9
+ to: ContentPathPoint;
10
+ } | undefined;
11
+ //#endregion
12
+ export { parsePageSize as i, parseLinePoints as n, parseMargins as r, parseBox as t };