odf.js 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/codec.cjs +28 -0
- package/dist/codec.d.cts +72 -0
- package/dist/codec.d.ts +72 -0
- package/dist/codec.js +24 -0
- package/dist/image/sniff.cjs +28 -0
- package/dist/image/sniff.d.cts +5 -0
- package/dist/image/sniff.d.ts +5 -0
- package/dist/image/sniff.js +27 -0
- package/dist/index.cjs +156 -3242
- package/dist/index.d.cts +42 -679
- package/dist/index.d.ts +42 -679
- package/dist/index.js +42 -3129
- package/dist/manifest.cjs +252 -0
- package/dist/manifest.d.cts +41 -0
- package/dist/manifest.d.ts +41 -0
- package/dist/manifest.js +242 -0
- package/dist/media-type.cjs +27 -0
- package/dist/media-type.d.cts +20 -0
- package/dist/media-type.d.ts +20 -0
- package/dist/media-type.js +25 -0
- package/dist/mimetype.cjs +19 -0
- package/dist/mimetype.d.cts +7 -0
- package/dist/mimetype.d.ts +7 -0
- package/dist/mimetype.js +16 -0
- package/dist/model/node.cjs +67 -0
- package/dist/model/node.d.cts +2 -0
- package/dist/model/node.d.ts +2 -0
- package/dist/model/node.js +58 -0
- package/dist/model/package.cjs +19 -0
- package/dist/model/package.d.cts +114 -0
- package/dist/model/package.d.ts +114 -0
- package/dist/model/package.js +15 -0
- package/dist/node-CkBWRjNR.d.cts +83 -0
- package/dist/node-CkBWRjNR.d.ts +83 -0
- package/dist/ns.cjs +37 -0
- package/dist/ns.d.cts +32 -0
- package/dist/ns.d.ts +32 -0
- package/dist/ns.js +35 -0
- package/dist/package-io/read.cjs +35 -0
- package/dist/package-io/read.d.cts +5 -0
- package/dist/package-io/read.d.ts +5 -0
- package/dist/package-io/read.js +34 -0
- package/dist/package-io/write.cjs +36 -0
- package/dist/package-io/write.d.cts +7 -0
- package/dist/package-io/write.d.ts +7 -0
- package/dist/package-io/write.js +33 -0
- package/dist/styles/properties.cjs +286 -0
- package/dist/styles/properties.d.cts +45 -0
- package/dist/styles/properties.d.ts +45 -0
- package/dist/styles/properties.js +277 -0
- package/dist/styles/registry.cjs +212 -0
- package/dist/styles/registry.d.cts +37 -0
- package/dist/styles/registry.d.ts +37 -0
- package/dist/styles/registry.js +209 -0
- package/dist/styles/serialize.cjs +23 -0
- package/dist/styles/serialize.d.cts +7 -0
- package/dist/styles/serialize.d.ts +7 -0
- package/dist/styles/serialize.js +21 -0
- package/dist/styles/span.cjs +114 -0
- package/dist/styles/span.d.cts +5 -0
- package/dist/styles/span.d.ts +5 -0
- package/dist/styles/span.js +113 -0
- package/dist/typed/draw/shapes.cjs +314 -0
- package/dist/typed/draw/shapes.d.cts +14 -0
- package/dist/typed/draw/shapes.d.ts +14 -0
- package/dist/typed/draw/shapes.js +311 -0
- package/dist/typed/formula/read.cjs +48 -0
- package/dist/typed/formula/read.d.cts +12 -0
- package/dist/typed/formula/read.d.ts +12 -0
- package/dist/typed/formula/read.js +47 -0
- package/dist/typed/odb/read.cjs +112 -0
- package/dist/typed/odb/read.d.cts +17 -0
- package/dist/typed/odb/read.d.ts +17 -0
- package/dist/typed/odb/read.js +111 -0
- package/dist/typed/odg/read.cjs +30 -0
- package/dist/typed/odg/read.d.cts +10 -0
- package/dist/typed/odg/read.d.ts +10 -0
- package/dist/typed/odg/read.js +29 -0
- package/dist/typed/odm/read.cjs +37 -0
- package/dist/typed/odm/read.d.cts +15 -0
- package/dist/typed/odm/read.d.ts +15 -0
- package/dist/typed/odm/read.js +36 -0
- package/dist/typed/odp/read.cjs +39 -0
- package/dist/typed/odp/read.d.cts +10 -0
- package/dist/typed/odp/read.d.ts +10 -0
- package/dist/typed/odp/read.js +38 -0
- package/dist/typed/ods/read.cjs +318 -0
- package/dist/typed/ods/read.d.cts +10 -0
- package/dist/typed/ods/read.d.ts +10 -0
- package/dist/typed/ods/read.js +317 -0
- package/dist/typed/odt/read.cjs +112 -0
- package/dist/typed/odt/read.d.cts +10 -0
- package/dist/typed/odt/read.d.ts +10 -0
- package/dist/typed/odt/read.js +111 -0
- package/dist/typed/shared/a1.cjs +68 -0
- package/dist/typed/shared/a1.d.cts +18 -0
- package/dist/typed/shared/a1.d.ts +18 -0
- package/dist/typed/shared/a1.js +63 -0
- package/dist/typed/shared/cascade.cjs +102 -0
- package/dist/typed/shared/cascade.d.cts +22 -0
- package/dist/typed/shared/cascade.d.ts +22 -0
- package/dist/typed/shared/cascade.js +99 -0
- package/dist/typed/shared/color.cjs +14 -0
- package/dist/typed/shared/color.d.cts +6 -0
- package/dist/typed/shared/color.d.ts +6 -0
- package/dist/typed/shared/color.js +12 -0
- package/dist/typed/shared/geometry.cjs +79 -0
- package/dist/typed/shared/geometry.d.cts +12 -0
- package/dist/typed/shared/geometry.d.ts +12 -0
- package/dist/typed/shared/geometry.js +75 -0
- package/dist/typed/shared/masterpage.cjs +39 -0
- package/dist/typed/shared/masterpage.d.cts +8 -0
- package/dist/typed/shared/masterpage.d.ts +8 -0
- package/dist/typed/shared/masterpage.js +37 -0
- package/dist/typed/shared/metadata.cjs +42 -0
- package/dist/typed/shared/metadata.d.cts +7 -0
- package/dist/typed/shared/metadata.d.ts +7 -0
- package/dist/typed/shared/metadata.js +40 -0
- package/dist/typed/shared/paragraph.cjs +57 -0
- package/dist/typed/shared/paragraph.d.cts +7 -0
- package/dist/typed/shared/paragraph.d.ts +7 -0
- package/dist/typed/shared/paragraph.js +56 -0
- package/dist/typed/shared/path.cjs +261 -0
- package/dist/typed/shared/path.d.cts +34 -0
- package/dist/typed/shared/path.d.ts +34 -0
- package/dist/typed/shared/path.js +255 -0
- package/dist/typed/shared/style.cjs +8 -0
- package/dist/typed/shared/style.d.cts +2 -0
- package/dist/typed/shared/style.d.ts +2 -0
- package/dist/typed/shared/style.js +2 -0
- package/dist/typed/shared/table.cjs +84 -0
- package/dist/typed/shared/table.d.cts +7 -0
- package/dist/typed/shared/table.d.ts +7 -0
- package/dist/typed/shared/table.js +83 -0
- package/dist/typed/shared/text.cjs +43 -0
- package/dist/typed/shared/text.d.cts +8 -0
- package/dist/typed/shared/text.d.ts +8 -0
- package/dist/typed/shared/text.js +39 -0
- package/dist/typed/shared/transform.cjs +112 -0
- package/dist/typed/shared/transform.d.cts +26 -0
- package/dist/typed/shared/transform.d.ts +26 -0
- package/dist/typed/shared/transform.js +107 -0
- package/dist/typed/shared/units.cjs +35 -0
- package/dist/typed/shared/units.d.cts +2 -0
- package/dist/typed/shared/units.d.ts +2 -0
- package/dist/typed/shared/units.js +33 -0
- package/dist/units-7pCiECuP.d.cts +6 -0
- package/dist/units-7pCiECuP.d.ts +6 -0
- package/dist/util/base64.cjs +48 -0
- package/dist/util/base64.d.cts +5 -0
- package/dist/util/base64.d.ts +5 -0
- package/dist/util/base64.js +46 -0
- package/dist/xml/build.cjs +46 -0
- package/dist/xml/build.d.cts +5 -0
- package/dist/xml/build.d.ts +5 -0
- package/dist/xml/build.js +46 -0
- package/dist/xml/entities.cjs +19 -0
- package/dist/xml/entities.d.cts +5 -0
- package/dist/xml/entities.d.ts +5 -0
- package/dist/xml/entities.js +17 -0
- package/dist/xml/fragment.cjs +22 -0
- package/dist/xml/fragment.d.cts +6 -0
- package/dist/xml/fragment.d.ts +6 -0
- package/dist/xml/fragment.js +20 -0
- package/dist/xml/parse.cjs +88 -0
- package/dist/xml/parse.d.cts +5 -0
- package/dist/xml/parse.d.ts +5 -0
- package/dist/xml/parse.js +88 -0
- package/dist/xml/query.cjs +33 -0
- package/dist/xml/query.d.cts +9 -0
- package/dist/xml/query.d.ts +9 -0
- package/dist/xml/query.js +28 -0
- package/dist/zip.cjs +15 -0
- package/dist/zip.d.cts +9 -0
- package/dist/zip.d.ts +9 -0
- package/dist/zip.js +13 -0
- package/package.json +9 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_util_base64 = require("./util/base64.cjs");
|
|
3
|
+
const require_package_io_write = require("./package-io/write.cjs");
|
|
4
|
+
//#region src/mimetype.ts
|
|
5
|
+
function readMimetype(pkg) {
|
|
6
|
+
const part = pkg.parts[require_package_io_write.MIMETYPE_PART];
|
|
7
|
+
if (part?.kind !== "binary") return;
|
|
8
|
+
return new TextDecoder("utf-8").decode(require_util_base64.base64ToBytes(part.base64));
|
|
9
|
+
}
|
|
10
|
+
function writeMimetype(pkg, mediaType) {
|
|
11
|
+
pkg.parts[require_package_io_write.MIMETYPE_PART] = {
|
|
12
|
+
kind: "binary",
|
|
13
|
+
base64: require_util_base64.bytesToBase64(new TextEncoder().encode(mediaType))
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.MIMETYPE_PART = require_package_io_write.MIMETYPE_PART;
|
|
18
|
+
exports.readMimetype = readMimetype;
|
|
19
|
+
exports.writeMimetype = writeMimetype;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Package } from "./model/package.cjs";
|
|
2
|
+
import { MIMETYPE_PART } from "./package-io/write.cjs";
|
|
3
|
+
//#region src/mimetype.d.ts
|
|
4
|
+
declare function readMimetype(pkg: Package): string | undefined;
|
|
5
|
+
declare function writeMimetype(pkg: Package, mediaType: string): void;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MIMETYPE_PART, readMimetype, writeMimetype };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Package } from "./model/package.js";
|
|
2
|
+
import { MIMETYPE_PART } from "./package-io/write.js";
|
|
3
|
+
//#region src/mimetype.d.ts
|
|
4
|
+
declare function readMimetype(pkg: Package): string | undefined;
|
|
5
|
+
declare function writeMimetype(pkg: Package, mediaType: string): void;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MIMETYPE_PART, readMimetype, writeMimetype };
|
package/dist/mimetype.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { base64ToBytes, bytesToBase64 } from "./util/base64.js";
|
|
2
|
+
import { MIMETYPE_PART } from "./package-io/write.js";
|
|
3
|
+
//#region src/mimetype.ts
|
|
4
|
+
function readMimetype(pkg) {
|
|
5
|
+
const part = pkg.parts[MIMETYPE_PART];
|
|
6
|
+
if (part?.kind !== "binary") return;
|
|
7
|
+
return new TextDecoder("utf-8").decode(base64ToBytes(part.base64));
|
|
8
|
+
}
|
|
9
|
+
function writeMimetype(pkg, mediaType) {
|
|
10
|
+
pkg.parts[MIMETYPE_PART] = {
|
|
11
|
+
kind: "binary",
|
|
12
|
+
base64: bytesToBase64(new TextEncoder().encode(mediaType))
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { MIMETYPE_PART, readMimetype, writeMimetype };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/model/node.ts
|
|
4
|
+
const AttributeSchema = zod.z.object({
|
|
5
|
+
name: zod.z.string(),
|
|
6
|
+
value: zod.z.string()
|
|
7
|
+
});
|
|
8
|
+
const XmlTextSchema = zod.z.object({
|
|
9
|
+
type: zod.z.literal("text"),
|
|
10
|
+
value: zod.z.string()
|
|
11
|
+
});
|
|
12
|
+
const XmlCdataSchema = zod.z.object({
|
|
13
|
+
type: zod.z.literal("cdata"),
|
|
14
|
+
value: zod.z.string()
|
|
15
|
+
});
|
|
16
|
+
const XmlCommentSchema = zod.z.object({
|
|
17
|
+
type: zod.z.literal("comment"),
|
|
18
|
+
value: zod.z.string()
|
|
19
|
+
});
|
|
20
|
+
const XmlDeclarationSchema = zod.z.object({
|
|
21
|
+
type: zod.z.literal("declaration"),
|
|
22
|
+
attributes: zod.z.array(AttributeSchema)
|
|
23
|
+
});
|
|
24
|
+
const XmlPiSchema = zod.z.object({
|
|
25
|
+
type: zod.z.literal("pi"),
|
|
26
|
+
target: zod.z.string(),
|
|
27
|
+
content: zod.z.string()
|
|
28
|
+
});
|
|
29
|
+
function isRecord(value) {
|
|
30
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31
|
+
}
|
|
32
|
+
function isAttribute(value) {
|
|
33
|
+
return isRecord(value) && typeof value.name === "string" && typeof value.value === "string";
|
|
34
|
+
}
|
|
35
|
+
function isXmlNode(value) {
|
|
36
|
+
if (!isRecord(value)) return false;
|
|
37
|
+
const t = value.type;
|
|
38
|
+
if (t === "text" || t === "cdata" || t === "comment") return typeof value.value === "string";
|
|
39
|
+
if (t === "declaration") return Array.isArray(value.attributes) && value.attributes.every(isAttribute);
|
|
40
|
+
if (t === "pi") return typeof value.target === "string" && typeof value.content === "string";
|
|
41
|
+
if (t === "element") return typeof value.tag === "string" && Array.isArray(value.attributes) && value.attributes.every(isAttribute) && Array.isArray(value.children) && value.children.every(isXmlNode);
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
const XmlElementSchema = zod.z.object({
|
|
45
|
+
type: zod.z.literal("element"),
|
|
46
|
+
tag: zod.z.string(),
|
|
47
|
+
attributes: zod.z.array(AttributeSchema),
|
|
48
|
+
children: zod.z.array(zod.z.custom(isXmlNode))
|
|
49
|
+
});
|
|
50
|
+
const XmlNodeSchema = zod.z.discriminatedUnion("type", [
|
|
51
|
+
XmlTextSchema,
|
|
52
|
+
XmlCdataSchema,
|
|
53
|
+
XmlCommentSchema,
|
|
54
|
+
XmlDeclarationSchema,
|
|
55
|
+
XmlPiSchema,
|
|
56
|
+
XmlElementSchema
|
|
57
|
+
]);
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.AttributeSchema = AttributeSchema;
|
|
60
|
+
exports.XmlCdataSchema = XmlCdataSchema;
|
|
61
|
+
exports.XmlCommentSchema = XmlCommentSchema;
|
|
62
|
+
exports.XmlDeclarationSchema = XmlDeclarationSchema;
|
|
63
|
+
exports.XmlElementSchema = XmlElementSchema;
|
|
64
|
+
exports.XmlNodeSchema = XmlNodeSchema;
|
|
65
|
+
exports.XmlPiSchema = XmlPiSchema;
|
|
66
|
+
exports.XmlTextSchema = XmlTextSchema;
|
|
67
|
+
exports.isXmlNode = isXmlNode;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as isXmlNode, a as XmlComment, c as XmlDeclarationSchema, d as XmlNode, f as XmlNodeSchema, g as XmlTextSchema, h as XmlText, i as XmlCdataSchema, l as XmlElement, m as XmlPiSchema, n as AttributeSchema, o as XmlCommentSchema, p as XmlPi, r as XmlCdata, s as XmlDeclaration, t as Attribute, u as XmlElementSchema } from "../node-CkBWRjNR.cjs";
|
|
2
|
+
export { Attribute, AttributeSchema, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, isXmlNode };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as isXmlNode, a as XmlComment, c as XmlDeclarationSchema, d as XmlNode, f as XmlNodeSchema, g as XmlTextSchema, h as XmlText, i as XmlCdataSchema, l as XmlElement, m as XmlPiSchema, n as AttributeSchema, o as XmlCommentSchema, p as XmlPi, r as XmlCdata, s as XmlDeclaration, t as Attribute, u as XmlElementSchema } from "../node-CkBWRjNR.js";
|
|
2
|
+
export { Attribute, AttributeSchema, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, isXmlNode };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/model/node.ts
|
|
3
|
+
const AttributeSchema = z.object({
|
|
4
|
+
name: z.string(),
|
|
5
|
+
value: z.string()
|
|
6
|
+
});
|
|
7
|
+
const XmlTextSchema = z.object({
|
|
8
|
+
type: z.literal("text"),
|
|
9
|
+
value: z.string()
|
|
10
|
+
});
|
|
11
|
+
const XmlCdataSchema = z.object({
|
|
12
|
+
type: z.literal("cdata"),
|
|
13
|
+
value: z.string()
|
|
14
|
+
});
|
|
15
|
+
const XmlCommentSchema = z.object({
|
|
16
|
+
type: z.literal("comment"),
|
|
17
|
+
value: z.string()
|
|
18
|
+
});
|
|
19
|
+
const XmlDeclarationSchema = z.object({
|
|
20
|
+
type: z.literal("declaration"),
|
|
21
|
+
attributes: z.array(AttributeSchema)
|
|
22
|
+
});
|
|
23
|
+
const XmlPiSchema = z.object({
|
|
24
|
+
type: z.literal("pi"),
|
|
25
|
+
target: z.string(),
|
|
26
|
+
content: z.string()
|
|
27
|
+
});
|
|
28
|
+
function isRecord(value) {
|
|
29
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30
|
+
}
|
|
31
|
+
function isAttribute(value) {
|
|
32
|
+
return isRecord(value) && typeof value.name === "string" && typeof value.value === "string";
|
|
33
|
+
}
|
|
34
|
+
function isXmlNode(value) {
|
|
35
|
+
if (!isRecord(value)) return false;
|
|
36
|
+
const t = value.type;
|
|
37
|
+
if (t === "text" || t === "cdata" || t === "comment") return typeof value.value === "string";
|
|
38
|
+
if (t === "declaration") return Array.isArray(value.attributes) && value.attributes.every(isAttribute);
|
|
39
|
+
if (t === "pi") return typeof value.target === "string" && typeof value.content === "string";
|
|
40
|
+
if (t === "element") return typeof value.tag === "string" && Array.isArray(value.attributes) && value.attributes.every(isAttribute) && Array.isArray(value.children) && value.children.every(isXmlNode);
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const XmlElementSchema = z.object({
|
|
44
|
+
type: z.literal("element"),
|
|
45
|
+
tag: z.string(),
|
|
46
|
+
attributes: z.array(AttributeSchema),
|
|
47
|
+
children: z.array(z.custom(isXmlNode))
|
|
48
|
+
});
|
|
49
|
+
const XmlNodeSchema = z.discriminatedUnion("type", [
|
|
50
|
+
XmlTextSchema,
|
|
51
|
+
XmlCdataSchema,
|
|
52
|
+
XmlCommentSchema,
|
|
53
|
+
XmlDeclarationSchema,
|
|
54
|
+
XmlPiSchema,
|
|
55
|
+
XmlElementSchema
|
|
56
|
+
]);
|
|
57
|
+
//#endregion
|
|
58
|
+
export { AttributeSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPiSchema, XmlTextSchema, isXmlNode };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_model_node = require("./node.cjs");
|
|
3
|
+
let zod = require("zod");
|
|
4
|
+
//#region src/model/package.ts
|
|
5
|
+
const XmlPartSchema = zod.z.object({
|
|
6
|
+
kind: zod.z.literal("xml"),
|
|
7
|
+
nodes: zod.z.array(require_model_node.XmlNodeSchema)
|
|
8
|
+
});
|
|
9
|
+
const BinaryPartSchema = zod.z.object({
|
|
10
|
+
kind: zod.z.literal("binary"),
|
|
11
|
+
base64: zod.z.string()
|
|
12
|
+
});
|
|
13
|
+
const PartSchema = zod.z.discriminatedUnion("kind", [XmlPartSchema, BinaryPartSchema]);
|
|
14
|
+
const PackageSchema = zod.z.object({ parts: zod.z.record(zod.z.string(), PartSchema) });
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.BinaryPartSchema = BinaryPartSchema;
|
|
17
|
+
exports.PackageSchema = PackageSchema;
|
|
18
|
+
exports.PartSchema = PartSchema;
|
|
19
|
+
exports.XmlPartSchema = XmlPartSchema;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { d as XmlNode } from "../node-CkBWRjNR.cjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/model/package.d.ts
|
|
4
|
+
declare const XmlPartSchema: z.ZodObject<{
|
|
5
|
+
kind: z.ZodLiteral<"xml">;
|
|
6
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"text">;
|
|
8
|
+
value: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
type: z.ZodLiteral<"cdata">;
|
|
11
|
+
value: z.ZodString;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"comment">;
|
|
14
|
+
value: z.ZodString;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"declaration">;
|
|
17
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
value: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"pi">;
|
|
23
|
+
target: z.ZodString;
|
|
24
|
+
content: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
type: z.ZodLiteral<"element">;
|
|
27
|
+
tag: z.ZodString;
|
|
28
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
value: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
33
|
+
}, z.core.$strip>], "type">>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
type XmlPart = z.infer<typeof XmlPartSchema>;
|
|
36
|
+
declare const BinaryPartSchema: z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"binary">;
|
|
38
|
+
base64: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
type BinaryPart = z.infer<typeof BinaryPartSchema>;
|
|
41
|
+
declare const PartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
|
+
kind: z.ZodLiteral<"xml">;
|
|
43
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"text">;
|
|
45
|
+
value: z.ZodString;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"cdata">;
|
|
48
|
+
value: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"comment">;
|
|
51
|
+
value: z.ZodString;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"declaration">;
|
|
54
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"pi">;
|
|
60
|
+
target: z.ZodString;
|
|
61
|
+
content: z.ZodString;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"element">;
|
|
64
|
+
tag: z.ZodString;
|
|
65
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
value: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
70
|
+
}, z.core.$strip>], "type">>;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"binary">;
|
|
73
|
+
base64: z.ZodString;
|
|
74
|
+
}, z.core.$strip>], "kind">;
|
|
75
|
+
type Part = z.infer<typeof PartSchema>;
|
|
76
|
+
declare const PackageSchema: z.ZodObject<{
|
|
77
|
+
parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
kind: z.ZodLiteral<"xml">;
|
|
79
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"text">;
|
|
81
|
+
value: z.ZodString;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"cdata">;
|
|
84
|
+
value: z.ZodString;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"comment">;
|
|
87
|
+
value: z.ZodString;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"declaration">;
|
|
90
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
value: z.ZodString;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<"pi">;
|
|
96
|
+
target: z.ZodString;
|
|
97
|
+
content: z.ZodString;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
type: z.ZodLiteral<"element">;
|
|
100
|
+
tag: z.ZodString;
|
|
101
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
value: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
106
|
+
}, z.core.$strip>], "type">>;
|
|
107
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
+
kind: z.ZodLiteral<"binary">;
|
|
109
|
+
base64: z.ZodString;
|
|
110
|
+
}, z.core.$strip>], "kind">>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
type Package = z.infer<typeof PackageSchema>;
|
|
113
|
+
//#endregion
|
|
114
|
+
export { BinaryPart, BinaryPartSchema, Package, PackageSchema, Part, PartSchema, XmlPart, XmlPartSchema };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { d as XmlNode } from "../node-CkBWRjNR.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/model/package.d.ts
|
|
4
|
+
declare const XmlPartSchema: z.ZodObject<{
|
|
5
|
+
kind: z.ZodLiteral<"xml">;
|
|
6
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"text">;
|
|
8
|
+
value: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
type: z.ZodLiteral<"cdata">;
|
|
11
|
+
value: z.ZodString;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"comment">;
|
|
14
|
+
value: z.ZodString;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"declaration">;
|
|
17
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
value: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"pi">;
|
|
23
|
+
target: z.ZodString;
|
|
24
|
+
content: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
type: z.ZodLiteral<"element">;
|
|
27
|
+
tag: z.ZodString;
|
|
28
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
value: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
33
|
+
}, z.core.$strip>], "type">>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
type XmlPart = z.infer<typeof XmlPartSchema>;
|
|
36
|
+
declare const BinaryPartSchema: z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"binary">;
|
|
38
|
+
base64: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
type BinaryPart = z.infer<typeof BinaryPartSchema>;
|
|
41
|
+
declare const PartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
|
+
kind: z.ZodLiteral<"xml">;
|
|
43
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"text">;
|
|
45
|
+
value: z.ZodString;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"cdata">;
|
|
48
|
+
value: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"comment">;
|
|
51
|
+
value: z.ZodString;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"declaration">;
|
|
54
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"pi">;
|
|
60
|
+
target: z.ZodString;
|
|
61
|
+
content: z.ZodString;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"element">;
|
|
64
|
+
tag: z.ZodString;
|
|
65
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
value: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
70
|
+
}, z.core.$strip>], "type">>;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"binary">;
|
|
73
|
+
base64: z.ZodString;
|
|
74
|
+
}, z.core.$strip>], "kind">;
|
|
75
|
+
type Part = z.infer<typeof PartSchema>;
|
|
76
|
+
declare const PackageSchema: z.ZodObject<{
|
|
77
|
+
parts: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
kind: z.ZodLiteral<"xml">;
|
|
79
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"text">;
|
|
81
|
+
value: z.ZodString;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"cdata">;
|
|
84
|
+
value: z.ZodString;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"comment">;
|
|
87
|
+
value: z.ZodString;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"declaration">;
|
|
90
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
value: z.ZodString;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<"pi">;
|
|
96
|
+
target: z.ZodString;
|
|
97
|
+
content: z.ZodString;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
type: z.ZodLiteral<"element">;
|
|
100
|
+
tag: z.ZodString;
|
|
101
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
value: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
106
|
+
}, z.core.$strip>], "type">>;
|
|
107
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
+
kind: z.ZodLiteral<"binary">;
|
|
109
|
+
base64: z.ZodString;
|
|
110
|
+
}, z.core.$strip>], "kind">>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
type Package = z.infer<typeof PackageSchema>;
|
|
113
|
+
//#endregion
|
|
114
|
+
export { BinaryPart, BinaryPartSchema, Package, PackageSchema, Part, PartSchema, XmlPart, XmlPartSchema };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { XmlNodeSchema } from "./node.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/model/package.ts
|
|
4
|
+
const XmlPartSchema = z.object({
|
|
5
|
+
kind: z.literal("xml"),
|
|
6
|
+
nodes: z.array(XmlNodeSchema)
|
|
7
|
+
});
|
|
8
|
+
const BinaryPartSchema = z.object({
|
|
9
|
+
kind: z.literal("binary"),
|
|
10
|
+
base64: z.string()
|
|
11
|
+
});
|
|
12
|
+
const PartSchema = z.discriminatedUnion("kind", [XmlPartSchema, BinaryPartSchema]);
|
|
13
|
+
const PackageSchema = z.object({ parts: z.record(z.string(), PartSchema) });
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BinaryPartSchema, PackageSchema, PartSchema, XmlPartSchema };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/model/node.d.ts
|
|
3
|
+
declare const AttributeSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
value: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type Attribute = z.infer<typeof AttributeSchema>;
|
|
8
|
+
declare const XmlTextSchema: z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"text">;
|
|
10
|
+
value: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
type XmlText = z.infer<typeof XmlTextSchema>;
|
|
13
|
+
declare const XmlCdataSchema: z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"cdata">;
|
|
15
|
+
value: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
type XmlCdata = z.infer<typeof XmlCdataSchema>;
|
|
18
|
+
declare const XmlCommentSchema: z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"comment">;
|
|
20
|
+
value: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
type XmlComment = z.infer<typeof XmlCommentSchema>;
|
|
23
|
+
declare const XmlDeclarationSchema: z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"declaration">;
|
|
25
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
value: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
type XmlDeclaration = z.infer<typeof XmlDeclarationSchema>;
|
|
31
|
+
declare const XmlPiSchema: z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"pi">;
|
|
33
|
+
target: z.ZodString;
|
|
34
|
+
content: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
type XmlPi = z.infer<typeof XmlPiSchema>;
|
|
37
|
+
interface XmlElement {
|
|
38
|
+
type: 'element';
|
|
39
|
+
tag: string;
|
|
40
|
+
attributes: Attribute[];
|
|
41
|
+
children: XmlNode[];
|
|
42
|
+
}
|
|
43
|
+
type XmlNode = XmlText | XmlCdata | XmlComment | XmlDeclaration | XmlPi | XmlElement;
|
|
44
|
+
declare function isXmlNode(value: unknown): value is XmlNode;
|
|
45
|
+
declare const XmlElementSchema: z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"element">;
|
|
47
|
+
tag: z.ZodString;
|
|
48
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
value: z.ZodString;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
declare const XmlNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"text">;
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
type: z.ZodLiteral<"cdata">;
|
|
59
|
+
value: z.ZodString;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"comment">;
|
|
62
|
+
value: z.ZodString;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"declaration">;
|
|
65
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
value: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"pi">;
|
|
71
|
+
target: z.ZodString;
|
|
72
|
+
content: z.ZodString;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
type: z.ZodLiteral<"element">;
|
|
75
|
+
tag: z.ZodString;
|
|
76
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
value: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
81
|
+
}, z.core.$strip>], "type">;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { isXmlNode as _, XmlComment as a, XmlDeclarationSchema as c, XmlNode as d, XmlNodeSchema as f, XmlTextSchema as g, XmlText as h, XmlCdataSchema as i, XmlElement as l, XmlPiSchema as m, AttributeSchema as n, XmlCommentSchema as o, XmlPi as p, XmlCdata as r, XmlDeclaration as s, Attribute as t, XmlElementSchema as u };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/model/node.d.ts
|
|
3
|
+
declare const AttributeSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
value: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type Attribute = z.infer<typeof AttributeSchema>;
|
|
8
|
+
declare const XmlTextSchema: z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"text">;
|
|
10
|
+
value: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
type XmlText = z.infer<typeof XmlTextSchema>;
|
|
13
|
+
declare const XmlCdataSchema: z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"cdata">;
|
|
15
|
+
value: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
type XmlCdata = z.infer<typeof XmlCdataSchema>;
|
|
18
|
+
declare const XmlCommentSchema: z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"comment">;
|
|
20
|
+
value: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
type XmlComment = z.infer<typeof XmlCommentSchema>;
|
|
23
|
+
declare const XmlDeclarationSchema: z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"declaration">;
|
|
25
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
value: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
type XmlDeclaration = z.infer<typeof XmlDeclarationSchema>;
|
|
31
|
+
declare const XmlPiSchema: z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"pi">;
|
|
33
|
+
target: z.ZodString;
|
|
34
|
+
content: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
type XmlPi = z.infer<typeof XmlPiSchema>;
|
|
37
|
+
interface XmlElement {
|
|
38
|
+
type: 'element';
|
|
39
|
+
tag: string;
|
|
40
|
+
attributes: Attribute[];
|
|
41
|
+
children: XmlNode[];
|
|
42
|
+
}
|
|
43
|
+
type XmlNode = XmlText | XmlCdata | XmlComment | XmlDeclaration | XmlPi | XmlElement;
|
|
44
|
+
declare function isXmlNode(value: unknown): value is XmlNode;
|
|
45
|
+
declare const XmlElementSchema: z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"element">;
|
|
47
|
+
tag: z.ZodString;
|
|
48
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
value: z.ZodString;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
declare const XmlNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"text">;
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
type: z.ZodLiteral<"cdata">;
|
|
59
|
+
value: z.ZodString;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"comment">;
|
|
62
|
+
value: z.ZodString;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"declaration">;
|
|
65
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
value: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"pi">;
|
|
71
|
+
target: z.ZodString;
|
|
72
|
+
content: z.ZodString;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
type: z.ZodLiteral<"element">;
|
|
75
|
+
tag: z.ZodString;
|
|
76
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
value: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
children: z.ZodArray<z.ZodCustom<XmlNode, XmlNode>>;
|
|
81
|
+
}, z.core.$strip>], "type">;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { isXmlNode as _, XmlComment as a, XmlDeclarationSchema as c, XmlNode as d, XmlNodeSchema as f, XmlTextSchema as g, XmlText as h, XmlCdataSchema as i, XmlElement as l, XmlPiSchema as m, AttributeSchema as n, XmlCommentSchema as o, XmlPi as p, XmlCdata as r, XmlDeclaration as s, Attribute as t, XmlElementSchema as u };
|
package/dist/ns.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/ns.ts
|
|
3
|
+
const ODF_NAMESPACES = Object.freeze({
|
|
4
|
+
office: "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
|
|
5
|
+
style: "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
|
6
|
+
text: "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
|
7
|
+
table: "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
|
8
|
+
draw: "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
|
9
|
+
fo: "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
|
|
10
|
+
svg: "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
|
|
11
|
+
xlink: "http://www.w3.org/1999/xlink",
|
|
12
|
+
dc: "http://purl.org/dc/elements/1.1/",
|
|
13
|
+
meta: "urn:oasis:names:tc:opendocument:xmlns:meta:1.0",
|
|
14
|
+
number: "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
|
|
15
|
+
chart: "urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
|
|
16
|
+
dr3d: "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",
|
|
17
|
+
math: "http://www.w3.org/1998/Math/MathML",
|
|
18
|
+
form: "urn:oasis:names:tc:opendocument:xmlns:form:1.0",
|
|
19
|
+
script: "urn:oasis:names:tc:opendocument:xmlns:script:1.0",
|
|
20
|
+
config: "urn:oasis:names:tc:opendocument:xmlns:config:1.0",
|
|
21
|
+
presentation: "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
|
|
22
|
+
smil: "urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0",
|
|
23
|
+
anim: "urn:oasis:names:tc:opendocument:xmlns:animation:1.0",
|
|
24
|
+
xforms: "http://www.w3.org/2002/xforms",
|
|
25
|
+
xsd: "http://www.w3.org/2001/XMLSchema",
|
|
26
|
+
xsi: "http://www.w3.org/2001/XMLSchema-instance",
|
|
27
|
+
manifest: "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0",
|
|
28
|
+
db: "urn:oasis:names:tc:opendocument:xmlns:database:1.0"
|
|
29
|
+
});
|
|
30
|
+
function xmlnsAttributes(prefixes) {
|
|
31
|
+
const attrs = {};
|
|
32
|
+
for (const prefix of prefixes) attrs[`xmlns:${prefix}`] = ODF_NAMESPACES[prefix];
|
|
33
|
+
return attrs;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.ODF_NAMESPACES = ODF_NAMESPACES;
|
|
37
|
+
exports.xmlnsAttributes = xmlnsAttributes;
|