document-schema.js 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/math.cjs ADDED
@@ -0,0 +1,152 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let zod = require("zod");
3
+ //#region src/math.ts
4
+ const CANONICAL_SIGNED_INTEGER = /^(0|-?[1-9]\d*)$/;
5
+ const CANONICAL_POSITIVE_INTEGER = /^[1-9]\d*$/;
6
+ const EXACT_RATIONAL_FIELDS = {
7
+ numerator: zod.z.string().regex(CANONICAL_SIGNED_INTEGER),
8
+ denominator: zod.z.string().regex(CANONICAL_POSITIVE_INTEGER)
9
+ };
10
+ const ExactRationalSchema = zod.z.object(EXACT_RATIONAL_FIELDS);
11
+ const SI_BASE_DIMENSIONS = [
12
+ "length",
13
+ "mass",
14
+ "time",
15
+ "electricCurrent",
16
+ "thermodynamicTemperature",
17
+ "amountOfSubstance",
18
+ "luminousIntensity"
19
+ ];
20
+ const DimensionVectorSchema = zod.z.partialRecord(zod.z.enum(SI_BASE_DIMENSIONS), zod.z.number().int());
21
+ const MathUnitSchema = zod.z.object({
22
+ id: zod.z.string(),
23
+ symbol: zod.z.string(),
24
+ name: zod.z.string().optional(),
25
+ dimension: DimensionVectorSchema,
26
+ factorToSi: ExactRationalSchema,
27
+ offsetToSi: ExactRationalSchema.optional(),
28
+ context: zod.z.string().optional()
29
+ });
30
+ const MathNormalisationContextSchema = zod.z.object({
31
+ id: zod.z.string(),
32
+ bases: zod.z.array(zod.z.object({
33
+ unit: zod.z.string(),
34
+ value: ExactRationalSchema
35
+ }))
36
+ });
37
+ const MathSymbolEntrySchema = zod.z.object({
38
+ glyph: zod.z.string(),
39
+ scope: zod.z.string(),
40
+ id: zod.z.string(),
41
+ quantityKind: zod.z.string().optional(),
42
+ preferredUnit: zod.z.string().optional(),
43
+ definitionSource: zod.z.string().optional()
44
+ });
45
+ const SymbolTableSchema = zod.z.object({
46
+ symbols: zod.z.array(MathSymbolEntrySchema),
47
+ units: zod.z.array(MathUnitSchema),
48
+ contexts: zod.z.array(MathNormalisationContextSchema).optional()
49
+ });
50
+ const MathPresentationSchema = zod.z.object({ latex: zod.z.string() });
51
+ const MathProvenanceSchema = zod.z.object({
52
+ source: zod.z.string(),
53
+ pageRef: zod.z.string().optional(),
54
+ editTrail: zod.z.array(zod.z.string())
55
+ });
56
+ const MathUncertaintySchema = zod.z.object({
57
+ magnitude: ExactRationalSchema,
58
+ unit: zod.z.string().optional(),
59
+ coverageFactor: zod.z.number().positive().optional()
60
+ });
61
+ const MathNumSchema = zod.z.object({
62
+ kind: zod.z.literal("num"),
63
+ ...EXACT_RATIONAL_FIELDS
64
+ });
65
+ const MathQtySchema = zod.z.object({
66
+ kind: zod.z.literal("qty"),
67
+ value: ExactRationalSchema,
68
+ unit: zod.z.string(),
69
+ uncertainty: MathUncertaintySchema.optional()
70
+ });
71
+ const MathSymSchema = zod.z.object({
72
+ kind: zod.z.literal("sym"),
73
+ id: zod.z.string()
74
+ });
75
+ const MathUnparsedSchema = zod.z.object({
76
+ kind: zod.z.literal("unparsed"),
77
+ latex: zod.z.string()
78
+ });
79
+ function isRecord(value) {
80
+ return typeof value === "object" && value !== null && !Array.isArray(value);
81
+ }
82
+ function isExactRational(value) {
83
+ return isRecord(value) && typeof value.numerator === "string" && CANONICAL_SIGNED_INTEGER.test(value.numerator) && typeof value.denominator === "string" && CANONICAL_POSITIVE_INTEGER.test(value.denominator);
84
+ }
85
+ function isMathUncertainty(value) {
86
+ return isRecord(value) && isExactRational(value.magnitude) && (value.unit === void 0 || typeof value.unit === "string") && (value.coverageFactor === void 0 || typeof value.coverageFactor === "number" && value.coverageFactor > 0);
87
+ }
88
+ function isMathExpression(value) {
89
+ if (!isRecord(value)) return false;
90
+ const kind = value.kind;
91
+ if (kind === "num") return typeof value.numerator === "string" && CANONICAL_SIGNED_INTEGER.test(value.numerator) && typeof value.denominator === "string" && CANONICAL_POSITIVE_INTEGER.test(value.denominator);
92
+ if (kind === "qty") return isExactRational(value.value) && typeof value.unit === "string" && (value.uncertainty === void 0 || isMathUncertainty(value.uncertainty));
93
+ if (kind === "sym") return typeof value.id === "string";
94
+ if (kind === "app") return typeof value.operator === "string" && Array.isArray(value.args) && value.args.every(isMathExpression);
95
+ if (kind === "sum" || kind === "prod") return typeof value.binder === "string" && isMathExpression(value.lower) && isMathExpression(value.upper) && isMathExpression(value.body);
96
+ if (kind === "matrix") {
97
+ if (!Array.isArray(value.rows)) return false;
98
+ const widths = /* @__PURE__ */ new Set();
99
+ for (const row of value.rows) {
100
+ if (!Array.isArray(row) || !row.every(isMathExpression)) return false;
101
+ widths.add(row.length);
102
+ }
103
+ return widths.size <= 1;
104
+ }
105
+ if (kind === "unparsed") return typeof value.latex === "string";
106
+ return false;
107
+ }
108
+ const MathExpressionSchema = zod.z.custom(isMathExpression);
109
+ const MathAppSchema = zod.z.object({
110
+ kind: zod.z.literal("app"),
111
+ operator: zod.z.string(),
112
+ args: zod.z.array(MathExpressionSchema)
113
+ });
114
+ const BINDER_SCHEMA_FIELDS = {
115
+ binder: zod.z.string(),
116
+ lower: MathExpressionSchema,
117
+ upper: MathExpressionSchema,
118
+ body: MathExpressionSchema
119
+ };
120
+ const MathSumSchema = zod.z.object({
121
+ kind: zod.z.literal("sum"),
122
+ ...BINDER_SCHEMA_FIELDS
123
+ });
124
+ const MathProdSchema = zod.z.object({
125
+ kind: zod.z.literal("prod"),
126
+ ...BINDER_SCHEMA_FIELDS
127
+ });
128
+ const MathMatrixSchema = zod.z.object({
129
+ kind: zod.z.literal("matrix"),
130
+ rows: zod.z.array(zod.z.array(MathExpressionSchema))
131
+ }).refine((matrix) => new Set(matrix.rows.map((row) => row.length)).size <= 1, { message: "matrix rows must all have the same number of columns" });
132
+ //#endregion
133
+ exports.DimensionVectorSchema = DimensionVectorSchema;
134
+ exports.ExactRationalSchema = ExactRationalSchema;
135
+ exports.MathAppSchema = MathAppSchema;
136
+ exports.MathExpressionSchema = MathExpressionSchema;
137
+ exports.MathMatrixSchema = MathMatrixSchema;
138
+ exports.MathNormalisationContextSchema = MathNormalisationContextSchema;
139
+ exports.MathNumSchema = MathNumSchema;
140
+ exports.MathPresentationSchema = MathPresentationSchema;
141
+ exports.MathProdSchema = MathProdSchema;
142
+ exports.MathProvenanceSchema = MathProvenanceSchema;
143
+ exports.MathQtySchema = MathQtySchema;
144
+ exports.MathSumSchema = MathSumSchema;
145
+ exports.MathSymSchema = MathSymSchema;
146
+ exports.MathSymbolEntrySchema = MathSymbolEntrySchema;
147
+ exports.MathUncertaintySchema = MathUncertaintySchema;
148
+ exports.MathUnitSchema = MathUnitSchema;
149
+ exports.MathUnparsedSchema = MathUnparsedSchema;
150
+ exports.SI_BASE_DIMENSIONS = SI_BASE_DIMENSIONS;
151
+ exports.SymbolTableSchema = SymbolTableSchema;
152
+ exports.isMathExpression = isMathExpression;
@@ -0,0 +1,2 @@
1
+ import { A as MathUncertaintySchema, C as MathSum, D as MathSymbolEntry, E as MathSymSchema, F as SI_BASE_DIMENSIONS, I as SiBaseDimension, L as SymbolTable, M as MathUnitSchema, N as MathUnparsed, O as MathSymbolEntrySchema, P as MathUnparsedSchema, R as SymbolTableSchema, S as MathQtySchema, T as MathSym, _ as MathProd, a as MathApp, b as MathProvenanceSchema, c as MathExpressionSchema, d as MathNormalisationContext, f as MathNormalisationContextSchema, g as MathPresentationSchema, h as MathPresentation, i as ExactRationalSchema, j as MathUnit, k as MathUncertainty, l as MathMatrix, m as MathNumSchema, n as DimensionVectorSchema, o as MathAppSchema, p as MathNum, r as ExactRational, s as MathExpression, t as DimensionVector, u as MathMatrixSchema, v as MathProdSchema, w as MathSumSchema, x as MathQty, y as MathProvenance, z as isMathExpression } from "./math-B7gZJeND.cjs";
2
+ export { DimensionVector, DimensionVectorSchema, ExactRational, ExactRationalSchema, MathApp, MathAppSchema, MathExpression, MathExpressionSchema, MathMatrix, MathMatrixSchema, MathNormalisationContext, MathNormalisationContextSchema, MathNum, MathNumSchema, MathPresentation, MathPresentationSchema, MathProd, MathProdSchema, MathProvenance, MathProvenanceSchema, MathQty, MathQtySchema, MathSum, MathSumSchema, MathSym, MathSymSchema, MathSymbolEntry, MathSymbolEntrySchema, MathUncertainty, MathUncertaintySchema, MathUnit, MathUnitSchema, MathUnparsed, MathUnparsedSchema, SI_BASE_DIMENSIONS, SiBaseDimension, SymbolTable, SymbolTableSchema, isMathExpression };
package/dist/math.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { A as MathUncertaintySchema, C as MathSum, D as MathSymbolEntry, E as MathSymSchema, F as SI_BASE_DIMENSIONS, I as SiBaseDimension, L as SymbolTable, M as MathUnitSchema, N as MathUnparsed, O as MathSymbolEntrySchema, P as MathUnparsedSchema, R as SymbolTableSchema, S as MathQtySchema, T as MathSym, _ as MathProd, a as MathApp, b as MathProvenanceSchema, c as MathExpressionSchema, d as MathNormalisationContext, f as MathNormalisationContextSchema, g as MathPresentationSchema, h as MathPresentation, i as ExactRationalSchema, j as MathUnit, k as MathUncertainty, l as MathMatrix, m as MathNumSchema, n as DimensionVectorSchema, o as MathAppSchema, p as MathNum, r as ExactRational, s as MathExpression, t as DimensionVector, u as MathMatrixSchema, v as MathProdSchema, w as MathSumSchema, x as MathQty, y as MathProvenance, z as isMathExpression } from "./math-B7gZJeND.js";
2
+ export { DimensionVector, DimensionVectorSchema, ExactRational, ExactRationalSchema, MathApp, MathAppSchema, MathExpression, MathExpressionSchema, MathMatrix, MathMatrixSchema, MathNormalisationContext, MathNormalisationContextSchema, MathNum, MathNumSchema, MathPresentation, MathPresentationSchema, MathProd, MathProdSchema, MathProvenance, MathProvenanceSchema, MathQty, MathQtySchema, MathSum, MathSumSchema, MathSym, MathSymSchema, MathSymbolEntry, MathSymbolEntrySchema, MathUncertainty, MathUncertaintySchema, MathUnit, MathUnitSchema, MathUnparsed, MathUnparsedSchema, SI_BASE_DIMENSIONS, SiBaseDimension, SymbolTable, SymbolTableSchema, isMathExpression };
package/dist/math.js ADDED
@@ -0,0 +1,132 @@
1
+ import { z } from "zod";
2
+ //#region src/math.ts
3
+ const CANONICAL_SIGNED_INTEGER = /^(0|-?[1-9]\d*)$/;
4
+ const CANONICAL_POSITIVE_INTEGER = /^[1-9]\d*$/;
5
+ const EXACT_RATIONAL_FIELDS = {
6
+ numerator: z.string().regex(CANONICAL_SIGNED_INTEGER),
7
+ denominator: z.string().regex(CANONICAL_POSITIVE_INTEGER)
8
+ };
9
+ const ExactRationalSchema = z.object(EXACT_RATIONAL_FIELDS);
10
+ const SI_BASE_DIMENSIONS = [
11
+ "length",
12
+ "mass",
13
+ "time",
14
+ "electricCurrent",
15
+ "thermodynamicTemperature",
16
+ "amountOfSubstance",
17
+ "luminousIntensity"
18
+ ];
19
+ const DimensionVectorSchema = z.partialRecord(z.enum(SI_BASE_DIMENSIONS), z.number().int());
20
+ const MathUnitSchema = z.object({
21
+ id: z.string(),
22
+ symbol: z.string(),
23
+ name: z.string().optional(),
24
+ dimension: DimensionVectorSchema,
25
+ factorToSi: ExactRationalSchema,
26
+ offsetToSi: ExactRationalSchema.optional(),
27
+ context: z.string().optional()
28
+ });
29
+ const MathNormalisationContextSchema = z.object({
30
+ id: z.string(),
31
+ bases: z.array(z.object({
32
+ unit: z.string(),
33
+ value: ExactRationalSchema
34
+ }))
35
+ });
36
+ const MathSymbolEntrySchema = z.object({
37
+ glyph: z.string(),
38
+ scope: z.string(),
39
+ id: z.string(),
40
+ quantityKind: z.string().optional(),
41
+ preferredUnit: z.string().optional(),
42
+ definitionSource: z.string().optional()
43
+ });
44
+ const SymbolTableSchema = z.object({
45
+ symbols: z.array(MathSymbolEntrySchema),
46
+ units: z.array(MathUnitSchema),
47
+ contexts: z.array(MathNormalisationContextSchema).optional()
48
+ });
49
+ const MathPresentationSchema = z.object({ latex: z.string() });
50
+ const MathProvenanceSchema = z.object({
51
+ source: z.string(),
52
+ pageRef: z.string().optional(),
53
+ editTrail: z.array(z.string())
54
+ });
55
+ const MathUncertaintySchema = z.object({
56
+ magnitude: ExactRationalSchema,
57
+ unit: z.string().optional(),
58
+ coverageFactor: z.number().positive().optional()
59
+ });
60
+ const MathNumSchema = z.object({
61
+ kind: z.literal("num"),
62
+ ...EXACT_RATIONAL_FIELDS
63
+ });
64
+ const MathQtySchema = z.object({
65
+ kind: z.literal("qty"),
66
+ value: ExactRationalSchema,
67
+ unit: z.string(),
68
+ uncertainty: MathUncertaintySchema.optional()
69
+ });
70
+ const MathSymSchema = z.object({
71
+ kind: z.literal("sym"),
72
+ id: z.string()
73
+ });
74
+ const MathUnparsedSchema = z.object({
75
+ kind: z.literal("unparsed"),
76
+ latex: z.string()
77
+ });
78
+ function isRecord(value) {
79
+ return typeof value === "object" && value !== null && !Array.isArray(value);
80
+ }
81
+ function isExactRational(value) {
82
+ return isRecord(value) && typeof value.numerator === "string" && CANONICAL_SIGNED_INTEGER.test(value.numerator) && typeof value.denominator === "string" && CANONICAL_POSITIVE_INTEGER.test(value.denominator);
83
+ }
84
+ function isMathUncertainty(value) {
85
+ return isRecord(value) && isExactRational(value.magnitude) && (value.unit === void 0 || typeof value.unit === "string") && (value.coverageFactor === void 0 || typeof value.coverageFactor === "number" && value.coverageFactor > 0);
86
+ }
87
+ function isMathExpression(value) {
88
+ if (!isRecord(value)) return false;
89
+ const kind = value.kind;
90
+ if (kind === "num") return typeof value.numerator === "string" && CANONICAL_SIGNED_INTEGER.test(value.numerator) && typeof value.denominator === "string" && CANONICAL_POSITIVE_INTEGER.test(value.denominator);
91
+ if (kind === "qty") return isExactRational(value.value) && typeof value.unit === "string" && (value.uncertainty === void 0 || isMathUncertainty(value.uncertainty));
92
+ if (kind === "sym") return typeof value.id === "string";
93
+ if (kind === "app") return typeof value.operator === "string" && Array.isArray(value.args) && value.args.every(isMathExpression);
94
+ if (kind === "sum" || kind === "prod") return typeof value.binder === "string" && isMathExpression(value.lower) && isMathExpression(value.upper) && isMathExpression(value.body);
95
+ if (kind === "matrix") {
96
+ if (!Array.isArray(value.rows)) return false;
97
+ const widths = /* @__PURE__ */ new Set();
98
+ for (const row of value.rows) {
99
+ if (!Array.isArray(row) || !row.every(isMathExpression)) return false;
100
+ widths.add(row.length);
101
+ }
102
+ return widths.size <= 1;
103
+ }
104
+ if (kind === "unparsed") return typeof value.latex === "string";
105
+ return false;
106
+ }
107
+ const MathExpressionSchema = z.custom(isMathExpression);
108
+ const MathAppSchema = z.object({
109
+ kind: z.literal("app"),
110
+ operator: z.string(),
111
+ args: z.array(MathExpressionSchema)
112
+ });
113
+ const BINDER_SCHEMA_FIELDS = {
114
+ binder: z.string(),
115
+ lower: MathExpressionSchema,
116
+ upper: MathExpressionSchema,
117
+ body: MathExpressionSchema
118
+ };
119
+ const MathSumSchema = z.object({
120
+ kind: z.literal("sum"),
121
+ ...BINDER_SCHEMA_FIELDS
122
+ });
123
+ const MathProdSchema = z.object({
124
+ kind: z.literal("prod"),
125
+ ...BINDER_SCHEMA_FIELDS
126
+ });
127
+ const MathMatrixSchema = z.object({
128
+ kind: z.literal("matrix"),
129
+ rows: z.array(z.array(MathExpressionSchema))
130
+ }).refine((matrix) => new Set(matrix.rows.map((row) => row.length)).size <= 1, { message: "matrix rows must all have the same number of columns" });
131
+ //#endregion
132
+ export { DimensionVectorSchema, ExactRationalSchema, MathAppSchema, MathExpressionSchema, MathMatrixSchema, MathNormalisationContextSchema, MathNumSchema, MathPresentationSchema, MathProdSchema, MathProvenanceSchema, MathQtySchema, MathSumSchema, MathSymSchema, MathSymbolEntrySchema, MathUncertaintySchema, MathUnitSchema, MathUnparsedSchema, SI_BASE_DIMENSIONS, SymbolTableSchema, isMathExpression };
@@ -1,4 +1,5 @@
1
1
  import { d as MathMlNode } from "./mathml-B1oTCtzc.cjs";
2
+ import { s as MathExpression } from "./math-B7gZJeND.cjs";
2
3
  import { ContentBlock, ContentEmbeddedObject } from "./content.cjs";
3
4
  import { z } from "zod";
4
5
  //#region src/package.d.ts
@@ -6,18 +7,6 @@ declare const DOCUMENT_PACKAGE_FORMAT_VERSION = 2;
6
7
  declare const DocumentPackageSchema: z.ZodObject<{
7
8
  formatVersion: z.ZodLiteral<2>;
8
9
  content: z.ZodDiscriminatedUnion<[z.ZodObject<{
9
- kind: z.ZodLiteral<"wordprocessing">;
10
- formatVersion: z.ZodLiteral<3>;
11
- metadata: z.ZodObject<{
12
- title: z.ZodOptional<z.ZodString>;
13
- author: z.ZodOptional<z.ZodString>;
14
- subject: z.ZodOptional<z.ZodString>;
15
- keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
- creator: z.ZodOptional<z.ZodString>;
17
- producer: z.ZodOptional<z.ZodString>;
18
- createdIso: z.ZodOptional<z.ZodString>;
19
- modifiedIso: z.ZodOptional<z.ZodString>;
20
- }, z.core.$strip>;
21
10
  sections: z.ZodArray<z.ZodObject<{
22
11
  pageSize: z.ZodObject<{
23
12
  widthPt: z.ZodNumber;
@@ -31,8 +20,50 @@ declare const DocumentPackageSchema: z.ZodObject<{
31
20
  }, z.core.$strip>;
32
21
  blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
33
22
  }, z.core.$strip>>;
34
- }, z.core.$strip>, z.ZodObject<{
35
- kind: z.ZodLiteral<"presentation">;
23
+ symbolTable: z.ZodOptional<z.ZodObject<{
24
+ symbols: z.ZodArray<z.ZodObject<{
25
+ glyph: z.ZodString;
26
+ scope: z.ZodString;
27
+ id: z.ZodString;
28
+ quantityKind: z.ZodOptional<z.ZodString>;
29
+ preferredUnit: z.ZodOptional<z.ZodString>;
30
+ definitionSource: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>;
32
+ units: z.ZodArray<z.ZodObject<{
33
+ id: z.ZodString;
34
+ symbol: z.ZodString;
35
+ name: z.ZodOptional<z.ZodString>;
36
+ dimension: z.ZodRecord<z.ZodEnum<{
37
+ time: "time";
38
+ length: "length";
39
+ mass: "mass";
40
+ electricCurrent: "electricCurrent";
41
+ thermodynamicTemperature: "thermodynamicTemperature";
42
+ amountOfSubstance: "amountOfSubstance";
43
+ luminousIntensity: "luminousIntensity";
44
+ }> & z.core.$partial, z.ZodNumber>;
45
+ factorToSi: z.ZodObject<{
46
+ numerator: z.ZodString;
47
+ denominator: z.ZodString;
48
+ }, z.core.$strip>;
49
+ offsetToSi: z.ZodOptional<z.ZodObject<{
50
+ numerator: z.ZodString;
51
+ denominator: z.ZodString;
52
+ }, z.core.$strip>>;
53
+ context: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>>;
55
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
56
+ id: z.ZodString;
57
+ bases: z.ZodArray<z.ZodObject<{
58
+ unit: z.ZodString;
59
+ value: z.ZodObject<{
60
+ numerator: z.ZodString;
61
+ denominator: z.ZodString;
62
+ }, z.core.$strip>;
63
+ }, z.core.$strip>>;
64
+ }, z.core.$strip>>>;
65
+ }, z.core.$strip>>;
66
+ kind: z.ZodLiteral<"wordprocessing">;
36
67
  formatVersion: z.ZodLiteral<3>;
37
68
  metadata: z.ZodObject<{
38
69
  title: z.ZodOptional<z.ZodString>;
@@ -44,6 +75,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
44
75
  createdIso: z.ZodOptional<z.ZodString>;
45
76
  modifiedIso: z.ZodOptional<z.ZodString>;
46
77
  }, z.core.$strip>;
78
+ }, z.core.$strip>, z.ZodObject<{
47
79
  slides: z.ZodArray<z.ZodObject<{
48
80
  size: z.ZodObject<{
49
81
  widthPt: z.ZodNumber;
@@ -77,8 +109,50 @@ declare const DocumentPackageSchema: z.ZodObject<{
77
109
  }, z.core.$strip>>;
78
110
  notes: z.ZodString;
79
111
  }, z.core.$strip>>;
80
- }, z.core.$strip>, z.ZodObject<{
81
- kind: z.ZodLiteral<"spreadsheet">;
112
+ symbolTable: z.ZodOptional<z.ZodObject<{
113
+ symbols: z.ZodArray<z.ZodObject<{
114
+ glyph: z.ZodString;
115
+ scope: z.ZodString;
116
+ id: z.ZodString;
117
+ quantityKind: z.ZodOptional<z.ZodString>;
118
+ preferredUnit: z.ZodOptional<z.ZodString>;
119
+ definitionSource: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$strip>>;
121
+ units: z.ZodArray<z.ZodObject<{
122
+ id: z.ZodString;
123
+ symbol: z.ZodString;
124
+ name: z.ZodOptional<z.ZodString>;
125
+ dimension: z.ZodRecord<z.ZodEnum<{
126
+ time: "time";
127
+ length: "length";
128
+ mass: "mass";
129
+ electricCurrent: "electricCurrent";
130
+ thermodynamicTemperature: "thermodynamicTemperature";
131
+ amountOfSubstance: "amountOfSubstance";
132
+ luminousIntensity: "luminousIntensity";
133
+ }> & z.core.$partial, z.ZodNumber>;
134
+ factorToSi: z.ZodObject<{
135
+ numerator: z.ZodString;
136
+ denominator: z.ZodString;
137
+ }, z.core.$strip>;
138
+ offsetToSi: z.ZodOptional<z.ZodObject<{
139
+ numerator: z.ZodString;
140
+ denominator: z.ZodString;
141
+ }, z.core.$strip>>;
142
+ context: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>>;
144
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
145
+ id: z.ZodString;
146
+ bases: z.ZodArray<z.ZodObject<{
147
+ unit: z.ZodString;
148
+ value: z.ZodObject<{
149
+ numerator: z.ZodString;
150
+ denominator: z.ZodString;
151
+ }, z.core.$strip>;
152
+ }, z.core.$strip>>;
153
+ }, z.core.$strip>>>;
154
+ }, z.core.$strip>>;
155
+ kind: z.ZodLiteral<"presentation">;
82
156
  formatVersion: z.ZodLiteral<3>;
83
157
  metadata: z.ZodObject<{
84
158
  title: z.ZodOptional<z.ZodString>;
@@ -90,6 +164,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
90
164
  createdIso: z.ZodOptional<z.ZodString>;
91
165
  modifiedIso: z.ZodOptional<z.ZodString>;
92
166
  }, z.core.$strip>;
167
+ }, z.core.$strip>, z.ZodObject<{
93
168
  sheets: z.ZodArray<z.ZodObject<{
94
169
  name: z.ZodString;
95
170
  cells: z.ZodArray<z.ZodObject<{
@@ -324,8 +399,50 @@ declare const DocumentPackageSchema: z.ZodObject<{
324
399
  }, z.core.$strip>;
325
400
  embeddedObjects: z.ZodOptional<z.ZodArray<z.ZodCustom<ContentEmbeddedObject, ContentEmbeddedObject>>>;
326
401
  }, z.core.$strip>>;
327
- }, z.core.$strip>, z.ZodObject<{
328
- kind: z.ZodLiteral<"drawing">;
402
+ symbolTable: z.ZodOptional<z.ZodObject<{
403
+ symbols: z.ZodArray<z.ZodObject<{
404
+ glyph: z.ZodString;
405
+ scope: z.ZodString;
406
+ id: z.ZodString;
407
+ quantityKind: z.ZodOptional<z.ZodString>;
408
+ preferredUnit: z.ZodOptional<z.ZodString>;
409
+ definitionSource: z.ZodOptional<z.ZodString>;
410
+ }, z.core.$strip>>;
411
+ units: z.ZodArray<z.ZodObject<{
412
+ id: z.ZodString;
413
+ symbol: z.ZodString;
414
+ name: z.ZodOptional<z.ZodString>;
415
+ dimension: z.ZodRecord<z.ZodEnum<{
416
+ time: "time";
417
+ length: "length";
418
+ mass: "mass";
419
+ electricCurrent: "electricCurrent";
420
+ thermodynamicTemperature: "thermodynamicTemperature";
421
+ amountOfSubstance: "amountOfSubstance";
422
+ luminousIntensity: "luminousIntensity";
423
+ }> & z.core.$partial, z.ZodNumber>;
424
+ factorToSi: z.ZodObject<{
425
+ numerator: z.ZodString;
426
+ denominator: z.ZodString;
427
+ }, z.core.$strip>;
428
+ offsetToSi: z.ZodOptional<z.ZodObject<{
429
+ numerator: z.ZodString;
430
+ denominator: z.ZodString;
431
+ }, z.core.$strip>>;
432
+ context: z.ZodOptional<z.ZodString>;
433
+ }, z.core.$strip>>;
434
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
435
+ id: z.ZodString;
436
+ bases: z.ZodArray<z.ZodObject<{
437
+ unit: z.ZodString;
438
+ value: z.ZodObject<{
439
+ numerator: z.ZodString;
440
+ denominator: z.ZodString;
441
+ }, z.core.$strip>;
442
+ }, z.core.$strip>>;
443
+ }, z.core.$strip>>>;
444
+ }, z.core.$strip>>;
445
+ kind: z.ZodLiteral<"spreadsheet">;
329
446
  formatVersion: z.ZodLiteral<3>;
330
447
  metadata: z.ZodObject<{
331
448
  title: z.ZodOptional<z.ZodString>;
@@ -337,6 +454,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
337
454
  createdIso: z.ZodOptional<z.ZodString>;
338
455
  modifiedIso: z.ZodOptional<z.ZodString>;
339
456
  }, z.core.$strip>;
457
+ }, z.core.$strip>, z.ZodObject<{
340
458
  pages: z.ZodArray<z.ZodObject<{
341
459
  size: z.ZodObject<{
342
460
  widthPt: z.ZodNumber;
@@ -546,8 +664,50 @@ declare const DocumentPackageSchema: z.ZodObject<{
546
664
  }, z.core.$strip>>>;
547
665
  }, z.core.$strip>], "kind">>;
548
666
  }, z.core.$strip>>;
549
- }, z.core.$strip>, z.ZodObject<{
550
- kind: z.ZodLiteral<"formula">;
667
+ symbolTable: z.ZodOptional<z.ZodObject<{
668
+ symbols: z.ZodArray<z.ZodObject<{
669
+ glyph: z.ZodString;
670
+ scope: z.ZodString;
671
+ id: z.ZodString;
672
+ quantityKind: z.ZodOptional<z.ZodString>;
673
+ preferredUnit: z.ZodOptional<z.ZodString>;
674
+ definitionSource: z.ZodOptional<z.ZodString>;
675
+ }, z.core.$strip>>;
676
+ units: z.ZodArray<z.ZodObject<{
677
+ id: z.ZodString;
678
+ symbol: z.ZodString;
679
+ name: z.ZodOptional<z.ZodString>;
680
+ dimension: z.ZodRecord<z.ZodEnum<{
681
+ time: "time";
682
+ length: "length";
683
+ mass: "mass";
684
+ electricCurrent: "electricCurrent";
685
+ thermodynamicTemperature: "thermodynamicTemperature";
686
+ amountOfSubstance: "amountOfSubstance";
687
+ luminousIntensity: "luminousIntensity";
688
+ }> & z.core.$partial, z.ZodNumber>;
689
+ factorToSi: z.ZodObject<{
690
+ numerator: z.ZodString;
691
+ denominator: z.ZodString;
692
+ }, z.core.$strip>;
693
+ offsetToSi: z.ZodOptional<z.ZodObject<{
694
+ numerator: z.ZodString;
695
+ denominator: z.ZodString;
696
+ }, z.core.$strip>>;
697
+ context: z.ZodOptional<z.ZodString>;
698
+ }, z.core.$strip>>;
699
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
700
+ id: z.ZodString;
701
+ bases: z.ZodArray<z.ZodObject<{
702
+ unit: z.ZodString;
703
+ value: z.ZodObject<{
704
+ numerator: z.ZodString;
705
+ denominator: z.ZodString;
706
+ }, z.core.$strip>;
707
+ }, z.core.$strip>>;
708
+ }, z.core.$strip>>>;
709
+ }, z.core.$strip>>;
710
+ kind: z.ZodLiteral<"drawing">;
551
711
  formatVersion: z.ZodLiteral<3>;
552
712
  metadata: z.ZodObject<{
553
713
  title: z.ZodOptional<z.ZodString>;
@@ -559,9 +719,74 @@ declare const DocumentPackageSchema: z.ZodObject<{
559
719
  createdIso: z.ZodOptional<z.ZodString>;
560
720
  modifiedIso: z.ZodOptional<z.ZodString>;
561
721
  }, z.core.$strip>;
722
+ }, z.core.$strip>, z.ZodObject<{
562
723
  formula: z.ZodObject<{
563
724
  mathml: z.ZodArray<z.ZodCustom<MathMlNode, MathMlNode>>;
564
725
  starMath: z.ZodOptional<z.ZodString>;
726
+ presentation: z.ZodOptional<z.ZodObject<{
727
+ latex: z.ZodString;
728
+ }, z.core.$strip>>;
729
+ content: z.ZodOptional<z.ZodCustom<MathExpression, MathExpression>>;
730
+ provenance: z.ZodOptional<z.ZodObject<{
731
+ source: z.ZodString;
732
+ pageRef: z.ZodOptional<z.ZodString>;
733
+ editTrail: z.ZodArray<z.ZodString>;
734
+ }, z.core.$strip>>;
735
+ }, z.core.$strip>;
736
+ symbolTable: z.ZodOptional<z.ZodObject<{
737
+ symbols: z.ZodArray<z.ZodObject<{
738
+ glyph: z.ZodString;
739
+ scope: z.ZodString;
740
+ id: z.ZodString;
741
+ quantityKind: z.ZodOptional<z.ZodString>;
742
+ preferredUnit: z.ZodOptional<z.ZodString>;
743
+ definitionSource: z.ZodOptional<z.ZodString>;
744
+ }, z.core.$strip>>;
745
+ units: z.ZodArray<z.ZodObject<{
746
+ id: z.ZodString;
747
+ symbol: z.ZodString;
748
+ name: z.ZodOptional<z.ZodString>;
749
+ dimension: z.ZodRecord<z.ZodEnum<{
750
+ time: "time";
751
+ length: "length";
752
+ mass: "mass";
753
+ electricCurrent: "electricCurrent";
754
+ thermodynamicTemperature: "thermodynamicTemperature";
755
+ amountOfSubstance: "amountOfSubstance";
756
+ luminousIntensity: "luminousIntensity";
757
+ }> & z.core.$partial, z.ZodNumber>;
758
+ factorToSi: z.ZodObject<{
759
+ numerator: z.ZodString;
760
+ denominator: z.ZodString;
761
+ }, z.core.$strip>;
762
+ offsetToSi: z.ZodOptional<z.ZodObject<{
763
+ numerator: z.ZodString;
764
+ denominator: z.ZodString;
765
+ }, z.core.$strip>>;
766
+ context: z.ZodOptional<z.ZodString>;
767
+ }, z.core.$strip>>;
768
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
769
+ id: z.ZodString;
770
+ bases: z.ZodArray<z.ZodObject<{
771
+ unit: z.ZodString;
772
+ value: z.ZodObject<{
773
+ numerator: z.ZodString;
774
+ denominator: z.ZodString;
775
+ }, z.core.$strip>;
776
+ }, z.core.$strip>>;
777
+ }, z.core.$strip>>>;
778
+ }, z.core.$strip>>;
779
+ kind: z.ZodLiteral<"formula">;
780
+ formatVersion: z.ZodLiteral<3>;
781
+ metadata: z.ZodObject<{
782
+ title: z.ZodOptional<z.ZodString>;
783
+ author: z.ZodOptional<z.ZodString>;
784
+ subject: z.ZodOptional<z.ZodString>;
785
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
786
+ creator: z.ZodOptional<z.ZodString>;
787
+ producer: z.ZodOptional<z.ZodString>;
788
+ createdIso: z.ZodOptional<z.ZodString>;
789
+ modifiedIso: z.ZodOptional<z.ZodString>;
565
790
  }, z.core.$strip>;
566
791
  }, z.core.$strip>], "kind">;
567
792
  pages: z.ZodOptional<z.ZodArray<z.ZodObject<{