document-content-model 3.0.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/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { cellReference, columnIndexToLetters, columnLettersToIndex, parseCellReference, parseRangeReference, rangeReference } from "./a1.js";
2
2
  import "./codec.js";
3
3
  import { COLOR_BLACK, ColorSchema, colorToRgbHex, rgbHexToColor } from "./color.js";
4
+ import { DimensionVectorSchema, ExactRationalSchema, MathAppSchema, MathExpressionSchema, MathMatrixSchema, MathNormalisationContextSchema, MathNumSchema, MathPresentationSchema, MathProdSchema, MathProvenanceSchema, MathQtySchema, MathSumSchema, MathSymSchema, MathSymbolEntrySchema, MathUncertaintySchema, MathUnitSchema, MathUnparsedSchema, SI_BASE_DIMENSIONS, SymbolTableSchema, isMathExpression } from "./math.js";
4
5
  import { BoxSchema, LayoutFrameSchema, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN } from "./geometry.js";
5
6
  import { MathMlAttributeSchema, MathMlCdataSchema, MathMlCommentSchema, MathMlDeclarationSchema, MathMlElementSchema, MathMlNodeSchema, MathMlPiSchema, MathMlTextSchema, isMathMlNode } from "./mathml.js";
6
7
  import { LayoutMetadataSchema } from "./metadata.js";
7
8
  import { AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFontSchema } from "./style.js";
8
- import { CONTENT_FORMAT_VERSION, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFormulaSchema, ContentImageBlockSchema, ContentListMembershipSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentStrokeStyleSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DecimalStringSchema, clampHeadingLevel, isContentBlock } from "./content.js";
9
+ import { CONTENT_FORMAT_VERSION, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFormulaSchema, ContentImageBlockSchema, ContentListMembershipSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentStrokeStyleSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DecimalStringSchema, clampHeadingLevel, isContentBlock } from "./content.js";
9
10
  import { LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, LayoutEllipseSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutItemSchema, LayoutLineSchema, LayoutLinkSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutSubpathSchema, LayoutTextSchema } from "./layout.js";
10
11
  import { DOCUMENT_PACKAGE_FORMAT_VERSION, DocumentPackageSchema } from "./package.js";
11
12
  import { SCHEMA_FILE_NAMES, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, layoutDocumentWithSchema, schemaUriFor } from "./schema-io.js";
@@ -13,4 +14,4 @@ import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INT
13
14
  import "./font-port.js";
14
15
  import "./text-layout.js";
15
16
  import "./math-layout.js";
16
- export { AlignmentSchema, BoxSchema, COLOR_BLACK, CONTENT_DEFS, CONTENT_DOCUMENT_URI, CONTENT_FORMAT_VERSION, ColorSchema, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFormulaSchema, ContentImageBlockSchema, ContentListMembershipSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentStrokeStyleSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_PACKAGE_FORMAT_VERSION, DecimalStringSchema, DocumentPackageSchema, EMBEDDED_OBJECT_KINDS, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, LayoutEllipseSchema, LayoutFontSchema, LayoutFrameSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutItemSchema, LayoutLineSchema, LayoutLinkSchema, LayoutMetadataSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutSubpathSchema, LayoutTextSchema, MAX_SAFE_INTEGER, MarginsSchema, MathMlAttributeSchema, MathMlCdataSchema, MathMlCommentSchema, MathMlDeclarationSchema, MathMlElementSchema, MathMlNodeSchema, MathMlPiSchema, MathMlTextSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSizeSchema, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, cellReference, clampHeadingLevel, colorToRgbHex, columnIndexToLetters, columnLettersToIndex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, parseCellReference, parseRangeReference, rangeReference, rgbHexToColor, schemaUriFor };
17
+ export { AlignmentSchema, BoxSchema, COLOR_BLACK, CONTENT_DEFS, CONTENT_DOCUMENT_URI, CONTENT_FORMAT_VERSION, ColorSchema, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFormulaSchema, ContentImageBlockSchema, ContentListMembershipSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentStrokeStyleSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_PACKAGE_FORMAT_VERSION, DecimalStringSchema, DimensionVectorSchema, DocumentPackageSchema, EMBEDDED_OBJECT_KINDS, ExactRationalSchema, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, LayoutEllipseSchema, LayoutFontSchema, LayoutFrameSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutItemSchema, LayoutLineSchema, LayoutLinkSchema, LayoutMetadataSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutSubpathSchema, LayoutTextSchema, MAX_SAFE_INTEGER, MarginsSchema, MathAppSchema, MathExpressionSchema, MathMatrixSchema, MathMlAttributeSchema, MathMlCdataSchema, MathMlCommentSchema, MathMlDeclarationSchema, MathMlElementSchema, MathMlNodeSchema, MathMlPiSchema, MathMlTextSchema, MathNormalisationContextSchema, MathNumSchema, MathPresentationSchema, MathProdSchema, MathProvenanceSchema, MathQtySchema, MathSumSchema, MathSymSchema, MathSymbolEntrySchema, MathUncertaintySchema, MathUnitSchema, MathUnparsedSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSizeSchema, SCHEMA_FILE_NAMES, SI_BASE_DIMENSIONS, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SymbolTableSchema, UnrecognizedDocumentSchemaError, cellReference, clampHeadingLevel, colorToRgbHex, columnIndexToLetters, columnLettersToIndex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathExpression, isMathMlNode, layoutDocumentWithSchema, parseCellReference, parseRangeReference, rangeReference, rgbHexToColor, schemaUriFor };
package/dist/layout.d.cts CHANGED
@@ -9,12 +9,12 @@ declare const LayoutTextSchema: z.ZodObject<{
9
9
  font: z.ZodObject<{
10
10
  family: z.ZodString;
11
11
  weight: z.ZodEnum<{
12
- bold: "bold";
13
12
  normal: "normal";
13
+ bold: "bold";
14
14
  }>;
15
15
  style: z.ZodEnum<{
16
- italic: "italic";
17
16
  normal: "normal";
17
+ italic: "italic";
18
18
  }>;
19
19
  }, z.core.$strip>;
20
20
  sizePt: z.ZodNumber;
@@ -202,12 +202,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
202
202
  font: z.ZodObject<{
203
203
  family: z.ZodString;
204
204
  weight: z.ZodEnum<{
205
- bold: "bold";
206
205
  normal: "normal";
206
+ bold: "bold";
207
207
  }>;
208
208
  style: z.ZodEnum<{
209
- italic: "italic";
210
209
  normal: "normal";
210
+ italic: "italic";
211
211
  }>;
212
212
  }, z.core.$strip>;
213
213
  sizePt: z.ZodNumber;
@@ -353,12 +353,12 @@ declare const LayoutPageSchema: z.ZodObject<{
353
353
  font: z.ZodObject<{
354
354
  family: z.ZodString;
355
355
  weight: z.ZodEnum<{
356
- bold: "bold";
357
356
  normal: "normal";
357
+ bold: "bold";
358
358
  }>;
359
359
  style: z.ZodEnum<{
360
- italic: "italic";
361
360
  normal: "normal";
361
+ italic: "italic";
362
362
  }>;
363
363
  }, z.core.$strip>;
364
364
  sizePt: z.ZodNumber;
@@ -528,12 +528,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
528
528
  font: z.ZodObject<{
529
529
  family: z.ZodString;
530
530
  weight: z.ZodEnum<{
531
- bold: "bold";
532
531
  normal: "normal";
532
+ bold: "bold";
533
533
  }>;
534
534
  style: z.ZodEnum<{
535
- italic: "italic";
536
535
  normal: "normal";
536
+ italic: "italic";
537
537
  }>;
538
538
  }, z.core.$strip>;
539
539
  sizePt: z.ZodNumber;
package/dist/layout.d.ts CHANGED
@@ -9,12 +9,12 @@ declare const LayoutTextSchema: z.ZodObject<{
9
9
  font: z.ZodObject<{
10
10
  family: z.ZodString;
11
11
  weight: z.ZodEnum<{
12
- bold: "bold";
13
12
  normal: "normal";
13
+ bold: "bold";
14
14
  }>;
15
15
  style: z.ZodEnum<{
16
- italic: "italic";
17
16
  normal: "normal";
17
+ italic: "italic";
18
18
  }>;
19
19
  }, z.core.$strip>;
20
20
  sizePt: z.ZodNumber;
@@ -202,12 +202,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
202
202
  font: z.ZodObject<{
203
203
  family: z.ZodString;
204
204
  weight: z.ZodEnum<{
205
- bold: "bold";
206
205
  normal: "normal";
206
+ bold: "bold";
207
207
  }>;
208
208
  style: z.ZodEnum<{
209
- italic: "italic";
210
209
  normal: "normal";
210
+ italic: "italic";
211
211
  }>;
212
212
  }, z.core.$strip>;
213
213
  sizePt: z.ZodNumber;
@@ -353,12 +353,12 @@ declare const LayoutPageSchema: z.ZodObject<{
353
353
  font: z.ZodObject<{
354
354
  family: z.ZodString;
355
355
  weight: z.ZodEnum<{
356
- bold: "bold";
357
356
  normal: "normal";
357
+ bold: "bold";
358
358
  }>;
359
359
  style: z.ZodEnum<{
360
- italic: "italic";
361
360
  normal: "normal";
361
+ italic: "italic";
362
362
  }>;
363
363
  }, z.core.$strip>;
364
364
  sizePt: z.ZodNumber;
@@ -528,12 +528,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
528
528
  font: z.ZodObject<{
529
529
  family: z.ZodString;
530
530
  weight: z.ZodEnum<{
531
- bold: "bold";
532
531
  normal: "normal";
532
+ bold: "bold";
533
533
  }>;
534
534
  style: z.ZodEnum<{
535
- italic: "italic";
536
535
  normal: "normal";
536
+ italic: "italic";
537
537
  }>;
538
538
  }, z.core.$strip>;
539
539
  sizePt: z.ZodNumber;
@@ -0,0 +1,210 @@
1
+ import { z } from "zod";
2
+ //#region src/math.d.ts
3
+ declare const ExactRationalSchema: z.ZodObject<{
4
+ numerator: z.ZodString;
5
+ denominator: z.ZodString;
6
+ }, z.core.$strip>;
7
+ type ExactRational = z.infer<typeof ExactRationalSchema>;
8
+ declare const SI_BASE_DIMENSIONS: readonly ["length", "mass", "time", "electricCurrent", "thermodynamicTemperature", "amountOfSubstance", "luminousIntensity"];
9
+ type SiBaseDimension = (typeof SI_BASE_DIMENSIONS)[number];
10
+ declare const DimensionVectorSchema: z.ZodRecord<z.ZodEnum<{
11
+ time: "time";
12
+ length: "length";
13
+ mass: "mass";
14
+ electricCurrent: "electricCurrent";
15
+ thermodynamicTemperature: "thermodynamicTemperature";
16
+ amountOfSubstance: "amountOfSubstance";
17
+ luminousIntensity: "luminousIntensity";
18
+ }> & z.core.$partial, z.ZodNumber>;
19
+ type DimensionVector = z.infer<typeof DimensionVectorSchema>;
20
+ declare const MathUnitSchema: z.ZodObject<{
21
+ id: z.ZodString;
22
+ symbol: z.ZodString;
23
+ name: z.ZodOptional<z.ZodString>;
24
+ dimension: z.ZodRecord<z.ZodEnum<{
25
+ time: "time";
26
+ length: "length";
27
+ mass: "mass";
28
+ electricCurrent: "electricCurrent";
29
+ thermodynamicTemperature: "thermodynamicTemperature";
30
+ amountOfSubstance: "amountOfSubstance";
31
+ luminousIntensity: "luminousIntensity";
32
+ }> & z.core.$partial, z.ZodNumber>;
33
+ factorToSi: z.ZodObject<{
34
+ numerator: z.ZodString;
35
+ denominator: z.ZodString;
36
+ }, z.core.$strip>;
37
+ offsetToSi: z.ZodOptional<z.ZodObject<{
38
+ numerator: z.ZodString;
39
+ denominator: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ context: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ type MathUnit = z.infer<typeof MathUnitSchema>;
44
+ declare const MathNormalisationContextSchema: z.ZodObject<{
45
+ id: z.ZodString;
46
+ bases: z.ZodArray<z.ZodObject<{
47
+ unit: z.ZodString;
48
+ value: z.ZodObject<{
49
+ numerator: z.ZodString;
50
+ denominator: z.ZodString;
51
+ }, z.core.$strip>;
52
+ }, z.core.$strip>>;
53
+ }, z.core.$strip>;
54
+ type MathNormalisationContext = z.infer<typeof MathNormalisationContextSchema>;
55
+ declare const MathSymbolEntrySchema: z.ZodObject<{
56
+ glyph: z.ZodString;
57
+ scope: z.ZodString;
58
+ id: z.ZodString;
59
+ quantityKind: z.ZodOptional<z.ZodString>;
60
+ preferredUnit: z.ZodOptional<z.ZodString>;
61
+ definitionSource: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>;
63
+ type MathSymbolEntry = z.infer<typeof MathSymbolEntrySchema>;
64
+ declare const SymbolTableSchema: z.ZodObject<{
65
+ symbols: z.ZodArray<z.ZodObject<{
66
+ glyph: z.ZodString;
67
+ scope: z.ZodString;
68
+ id: z.ZodString;
69
+ quantityKind: z.ZodOptional<z.ZodString>;
70
+ preferredUnit: z.ZodOptional<z.ZodString>;
71
+ definitionSource: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>>;
73
+ units: z.ZodArray<z.ZodObject<{
74
+ id: z.ZodString;
75
+ symbol: z.ZodString;
76
+ name: z.ZodOptional<z.ZodString>;
77
+ dimension: z.ZodRecord<z.ZodEnum<{
78
+ time: "time";
79
+ length: "length";
80
+ mass: "mass";
81
+ electricCurrent: "electricCurrent";
82
+ thermodynamicTemperature: "thermodynamicTemperature";
83
+ amountOfSubstance: "amountOfSubstance";
84
+ luminousIntensity: "luminousIntensity";
85
+ }> & z.core.$partial, z.ZodNumber>;
86
+ factorToSi: z.ZodObject<{
87
+ numerator: z.ZodString;
88
+ denominator: z.ZodString;
89
+ }, z.core.$strip>;
90
+ offsetToSi: z.ZodOptional<z.ZodObject<{
91
+ numerator: z.ZodString;
92
+ denominator: z.ZodString;
93
+ }, z.core.$strip>>;
94
+ context: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>>;
96
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
97
+ id: z.ZodString;
98
+ bases: z.ZodArray<z.ZodObject<{
99
+ unit: z.ZodString;
100
+ value: z.ZodObject<{
101
+ numerator: z.ZodString;
102
+ denominator: z.ZodString;
103
+ }, z.core.$strip>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>>>;
106
+ }, z.core.$strip>;
107
+ type SymbolTable = z.infer<typeof SymbolTableSchema>;
108
+ declare const MathPresentationSchema: z.ZodObject<{
109
+ latex: z.ZodString;
110
+ }, z.core.$strip>;
111
+ type MathPresentation = z.infer<typeof MathPresentationSchema>;
112
+ declare const MathProvenanceSchema: z.ZodObject<{
113
+ source: z.ZodString;
114
+ pageRef: z.ZodOptional<z.ZodString>;
115
+ editTrail: z.ZodArray<z.ZodString>;
116
+ }, z.core.$strip>;
117
+ type MathProvenance = z.infer<typeof MathProvenanceSchema>;
118
+ declare const MathUncertaintySchema: z.ZodObject<{
119
+ magnitude: z.ZodObject<{
120
+ numerator: z.ZodString;
121
+ denominator: z.ZodString;
122
+ }, z.core.$strip>;
123
+ unit: z.ZodOptional<z.ZodString>;
124
+ coverageFactor: z.ZodOptional<z.ZodNumber>;
125
+ }, z.core.$strip>;
126
+ type MathUncertainty = z.infer<typeof MathUncertaintySchema>;
127
+ declare const MathNumSchema: z.ZodObject<{
128
+ numerator: z.ZodString;
129
+ denominator: z.ZodString;
130
+ kind: z.ZodLiteral<"num">;
131
+ }, z.core.$strip>;
132
+ type MathNum = z.infer<typeof MathNumSchema>;
133
+ declare const MathQtySchema: z.ZodObject<{
134
+ kind: z.ZodLiteral<"qty">;
135
+ value: z.ZodObject<{
136
+ numerator: z.ZodString;
137
+ denominator: z.ZodString;
138
+ }, z.core.$strip>;
139
+ unit: z.ZodString;
140
+ uncertainty: z.ZodOptional<z.ZodObject<{
141
+ magnitude: z.ZodObject<{
142
+ numerator: z.ZodString;
143
+ denominator: z.ZodString;
144
+ }, z.core.$strip>;
145
+ unit: z.ZodOptional<z.ZodString>;
146
+ coverageFactor: z.ZodOptional<z.ZodNumber>;
147
+ }, z.core.$strip>>;
148
+ }, z.core.$strip>;
149
+ type MathQty = z.infer<typeof MathQtySchema>;
150
+ declare const MathSymSchema: z.ZodObject<{
151
+ kind: z.ZodLiteral<"sym">;
152
+ id: z.ZodString;
153
+ }, z.core.$strip>;
154
+ type MathSym = z.infer<typeof MathSymSchema>;
155
+ declare const MathUnparsedSchema: z.ZodObject<{
156
+ kind: z.ZodLiteral<"unparsed">;
157
+ latex: z.ZodString;
158
+ }, z.core.$strip>;
159
+ type MathUnparsed = z.infer<typeof MathUnparsedSchema>;
160
+ interface MathApp {
161
+ kind: 'app';
162
+ operator: string;
163
+ args: MathExpression[];
164
+ }
165
+ interface MathSum {
166
+ kind: 'sum';
167
+ binder: string;
168
+ lower: MathExpression;
169
+ upper: MathExpression;
170
+ body: MathExpression;
171
+ }
172
+ interface MathProd {
173
+ kind: 'prod';
174
+ binder: string;
175
+ lower: MathExpression;
176
+ upper: MathExpression;
177
+ body: MathExpression;
178
+ }
179
+ interface MathMatrix {
180
+ kind: 'matrix';
181
+ rows: MathExpression[][];
182
+ }
183
+ type MathExpression = MathNum | MathQty | MathSym | MathApp | MathSum | MathProd | MathMatrix | MathUnparsed;
184
+ declare function isMathExpression(value: unknown): value is MathExpression;
185
+ declare const MathExpressionSchema: z.ZodCustom<MathExpression, MathExpression>;
186
+ declare const MathAppSchema: z.ZodObject<{
187
+ kind: z.ZodLiteral<"app">;
188
+ operator: z.ZodString;
189
+ args: z.ZodArray<z.ZodCustom<MathExpression, MathExpression>>;
190
+ }, z.core.$strip>;
191
+ declare const MathSumSchema: z.ZodObject<{
192
+ binder: z.ZodString;
193
+ lower: z.ZodCustom<MathExpression, MathExpression>;
194
+ upper: z.ZodCustom<MathExpression, MathExpression>;
195
+ body: z.ZodCustom<MathExpression, MathExpression>;
196
+ kind: z.ZodLiteral<"sum">;
197
+ }, z.core.$strip>;
198
+ declare const MathProdSchema: z.ZodObject<{
199
+ binder: z.ZodString;
200
+ lower: z.ZodCustom<MathExpression, MathExpression>;
201
+ upper: z.ZodCustom<MathExpression, MathExpression>;
202
+ body: z.ZodCustom<MathExpression, MathExpression>;
203
+ kind: z.ZodLiteral<"prod">;
204
+ }, z.core.$strip>;
205
+ declare const MathMatrixSchema: z.ZodObject<{
206
+ kind: z.ZodLiteral<"matrix">;
207
+ rows: z.ZodArray<z.ZodArray<z.ZodCustom<MathExpression, MathExpression>>>;
208
+ }, z.core.$strip>;
209
+ //#endregion
210
+ export { MathUncertaintySchema as A, MathSum as C, MathSymbolEntry as D, MathSymSchema as E, SI_BASE_DIMENSIONS as F, SiBaseDimension as I, SymbolTable as L, MathUnitSchema as M, MathUnparsed as N, MathSymbolEntrySchema as O, MathUnparsedSchema as P, SymbolTableSchema as R, MathQtySchema as S, MathSym as T, MathProd as _, MathApp as a, MathProvenanceSchema as b, MathExpressionSchema as c, MathNormalisationContext as d, MathNormalisationContextSchema as f, MathPresentationSchema as g, MathPresentation as h, ExactRationalSchema as i, MathUnit as j, MathUncertainty as k, MathMatrix as l, MathNumSchema as m, DimensionVectorSchema as n, MathAppSchema as o, MathNum as p, ExactRational as r, MathExpression as s, DimensionVector as t, MathMatrixSchema as u, MathProdSchema as v, MathSumSchema as w, MathQty as x, MathProvenance as y, isMathExpression as z };
@@ -0,0 +1,210 @@
1
+ import { z } from "zod";
2
+ //#region src/math.d.ts
3
+ declare const ExactRationalSchema: z.ZodObject<{
4
+ numerator: z.ZodString;
5
+ denominator: z.ZodString;
6
+ }, z.core.$strip>;
7
+ type ExactRational = z.infer<typeof ExactRationalSchema>;
8
+ declare const SI_BASE_DIMENSIONS: readonly ["length", "mass", "time", "electricCurrent", "thermodynamicTemperature", "amountOfSubstance", "luminousIntensity"];
9
+ type SiBaseDimension = (typeof SI_BASE_DIMENSIONS)[number];
10
+ declare const DimensionVectorSchema: z.ZodRecord<z.ZodEnum<{
11
+ time: "time";
12
+ length: "length";
13
+ mass: "mass";
14
+ electricCurrent: "electricCurrent";
15
+ thermodynamicTemperature: "thermodynamicTemperature";
16
+ amountOfSubstance: "amountOfSubstance";
17
+ luminousIntensity: "luminousIntensity";
18
+ }> & z.core.$partial, z.ZodNumber>;
19
+ type DimensionVector = z.infer<typeof DimensionVectorSchema>;
20
+ declare const MathUnitSchema: z.ZodObject<{
21
+ id: z.ZodString;
22
+ symbol: z.ZodString;
23
+ name: z.ZodOptional<z.ZodString>;
24
+ dimension: z.ZodRecord<z.ZodEnum<{
25
+ time: "time";
26
+ length: "length";
27
+ mass: "mass";
28
+ electricCurrent: "electricCurrent";
29
+ thermodynamicTemperature: "thermodynamicTemperature";
30
+ amountOfSubstance: "amountOfSubstance";
31
+ luminousIntensity: "luminousIntensity";
32
+ }> & z.core.$partial, z.ZodNumber>;
33
+ factorToSi: z.ZodObject<{
34
+ numerator: z.ZodString;
35
+ denominator: z.ZodString;
36
+ }, z.core.$strip>;
37
+ offsetToSi: z.ZodOptional<z.ZodObject<{
38
+ numerator: z.ZodString;
39
+ denominator: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ context: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ type MathUnit = z.infer<typeof MathUnitSchema>;
44
+ declare const MathNormalisationContextSchema: z.ZodObject<{
45
+ id: z.ZodString;
46
+ bases: z.ZodArray<z.ZodObject<{
47
+ unit: z.ZodString;
48
+ value: z.ZodObject<{
49
+ numerator: z.ZodString;
50
+ denominator: z.ZodString;
51
+ }, z.core.$strip>;
52
+ }, z.core.$strip>>;
53
+ }, z.core.$strip>;
54
+ type MathNormalisationContext = z.infer<typeof MathNormalisationContextSchema>;
55
+ declare const MathSymbolEntrySchema: z.ZodObject<{
56
+ glyph: z.ZodString;
57
+ scope: z.ZodString;
58
+ id: z.ZodString;
59
+ quantityKind: z.ZodOptional<z.ZodString>;
60
+ preferredUnit: z.ZodOptional<z.ZodString>;
61
+ definitionSource: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>;
63
+ type MathSymbolEntry = z.infer<typeof MathSymbolEntrySchema>;
64
+ declare const SymbolTableSchema: z.ZodObject<{
65
+ symbols: z.ZodArray<z.ZodObject<{
66
+ glyph: z.ZodString;
67
+ scope: z.ZodString;
68
+ id: z.ZodString;
69
+ quantityKind: z.ZodOptional<z.ZodString>;
70
+ preferredUnit: z.ZodOptional<z.ZodString>;
71
+ definitionSource: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>>;
73
+ units: z.ZodArray<z.ZodObject<{
74
+ id: z.ZodString;
75
+ symbol: z.ZodString;
76
+ name: z.ZodOptional<z.ZodString>;
77
+ dimension: z.ZodRecord<z.ZodEnum<{
78
+ time: "time";
79
+ length: "length";
80
+ mass: "mass";
81
+ electricCurrent: "electricCurrent";
82
+ thermodynamicTemperature: "thermodynamicTemperature";
83
+ amountOfSubstance: "amountOfSubstance";
84
+ luminousIntensity: "luminousIntensity";
85
+ }> & z.core.$partial, z.ZodNumber>;
86
+ factorToSi: z.ZodObject<{
87
+ numerator: z.ZodString;
88
+ denominator: z.ZodString;
89
+ }, z.core.$strip>;
90
+ offsetToSi: z.ZodOptional<z.ZodObject<{
91
+ numerator: z.ZodString;
92
+ denominator: z.ZodString;
93
+ }, z.core.$strip>>;
94
+ context: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>>;
96
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
97
+ id: z.ZodString;
98
+ bases: z.ZodArray<z.ZodObject<{
99
+ unit: z.ZodString;
100
+ value: z.ZodObject<{
101
+ numerator: z.ZodString;
102
+ denominator: z.ZodString;
103
+ }, z.core.$strip>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>>>;
106
+ }, z.core.$strip>;
107
+ type SymbolTable = z.infer<typeof SymbolTableSchema>;
108
+ declare const MathPresentationSchema: z.ZodObject<{
109
+ latex: z.ZodString;
110
+ }, z.core.$strip>;
111
+ type MathPresentation = z.infer<typeof MathPresentationSchema>;
112
+ declare const MathProvenanceSchema: z.ZodObject<{
113
+ source: z.ZodString;
114
+ pageRef: z.ZodOptional<z.ZodString>;
115
+ editTrail: z.ZodArray<z.ZodString>;
116
+ }, z.core.$strip>;
117
+ type MathProvenance = z.infer<typeof MathProvenanceSchema>;
118
+ declare const MathUncertaintySchema: z.ZodObject<{
119
+ magnitude: z.ZodObject<{
120
+ numerator: z.ZodString;
121
+ denominator: z.ZodString;
122
+ }, z.core.$strip>;
123
+ unit: z.ZodOptional<z.ZodString>;
124
+ coverageFactor: z.ZodOptional<z.ZodNumber>;
125
+ }, z.core.$strip>;
126
+ type MathUncertainty = z.infer<typeof MathUncertaintySchema>;
127
+ declare const MathNumSchema: z.ZodObject<{
128
+ numerator: z.ZodString;
129
+ denominator: z.ZodString;
130
+ kind: z.ZodLiteral<"num">;
131
+ }, z.core.$strip>;
132
+ type MathNum = z.infer<typeof MathNumSchema>;
133
+ declare const MathQtySchema: z.ZodObject<{
134
+ kind: z.ZodLiteral<"qty">;
135
+ value: z.ZodObject<{
136
+ numerator: z.ZodString;
137
+ denominator: z.ZodString;
138
+ }, z.core.$strip>;
139
+ unit: z.ZodString;
140
+ uncertainty: z.ZodOptional<z.ZodObject<{
141
+ magnitude: z.ZodObject<{
142
+ numerator: z.ZodString;
143
+ denominator: z.ZodString;
144
+ }, z.core.$strip>;
145
+ unit: z.ZodOptional<z.ZodString>;
146
+ coverageFactor: z.ZodOptional<z.ZodNumber>;
147
+ }, z.core.$strip>>;
148
+ }, z.core.$strip>;
149
+ type MathQty = z.infer<typeof MathQtySchema>;
150
+ declare const MathSymSchema: z.ZodObject<{
151
+ kind: z.ZodLiteral<"sym">;
152
+ id: z.ZodString;
153
+ }, z.core.$strip>;
154
+ type MathSym = z.infer<typeof MathSymSchema>;
155
+ declare const MathUnparsedSchema: z.ZodObject<{
156
+ kind: z.ZodLiteral<"unparsed">;
157
+ latex: z.ZodString;
158
+ }, z.core.$strip>;
159
+ type MathUnparsed = z.infer<typeof MathUnparsedSchema>;
160
+ interface MathApp {
161
+ kind: 'app';
162
+ operator: string;
163
+ args: MathExpression[];
164
+ }
165
+ interface MathSum {
166
+ kind: 'sum';
167
+ binder: string;
168
+ lower: MathExpression;
169
+ upper: MathExpression;
170
+ body: MathExpression;
171
+ }
172
+ interface MathProd {
173
+ kind: 'prod';
174
+ binder: string;
175
+ lower: MathExpression;
176
+ upper: MathExpression;
177
+ body: MathExpression;
178
+ }
179
+ interface MathMatrix {
180
+ kind: 'matrix';
181
+ rows: MathExpression[][];
182
+ }
183
+ type MathExpression = MathNum | MathQty | MathSym | MathApp | MathSum | MathProd | MathMatrix | MathUnparsed;
184
+ declare function isMathExpression(value: unknown): value is MathExpression;
185
+ declare const MathExpressionSchema: z.ZodCustom<MathExpression, MathExpression>;
186
+ declare const MathAppSchema: z.ZodObject<{
187
+ kind: z.ZodLiteral<"app">;
188
+ operator: z.ZodString;
189
+ args: z.ZodArray<z.ZodCustom<MathExpression, MathExpression>>;
190
+ }, z.core.$strip>;
191
+ declare const MathSumSchema: z.ZodObject<{
192
+ binder: z.ZodString;
193
+ lower: z.ZodCustom<MathExpression, MathExpression>;
194
+ upper: z.ZodCustom<MathExpression, MathExpression>;
195
+ body: z.ZodCustom<MathExpression, MathExpression>;
196
+ kind: z.ZodLiteral<"sum">;
197
+ }, z.core.$strip>;
198
+ declare const MathProdSchema: z.ZodObject<{
199
+ binder: z.ZodString;
200
+ lower: z.ZodCustom<MathExpression, MathExpression>;
201
+ upper: z.ZodCustom<MathExpression, MathExpression>;
202
+ body: z.ZodCustom<MathExpression, MathExpression>;
203
+ kind: z.ZodLiteral<"prod">;
204
+ }, z.core.$strip>;
205
+ declare const MathMatrixSchema: z.ZodObject<{
206
+ kind: z.ZodLiteral<"matrix">;
207
+ rows: z.ZodArray<z.ZodArray<z.ZodCustom<MathExpression, MathExpression>>>;
208
+ }, z.core.$strip>;
209
+ //#endregion
210
+ export { MathUncertaintySchema as A, MathSum as C, MathSymbolEntry as D, MathSymSchema as E, SI_BASE_DIMENSIONS as F, SiBaseDimension as I, SymbolTable as L, MathUnitSchema as M, MathUnparsed as N, MathSymbolEntrySchema as O, MathUnparsedSchema as P, SymbolTableSchema as R, MathQtySchema as S, MathSym as T, MathProd as _, MathApp as a, MathProvenanceSchema as b, MathExpressionSchema as c, MathNormalisationContext as d, MathNormalisationContextSchema as f, MathPresentationSchema as g, MathPresentation as h, ExactRationalSchema as i, MathUnit as j, MathUncertainty as k, MathMatrix as l, MathNumSchema as m, DimensionVectorSchema as n, MathAppSchema as o, MathNum as p, ExactRational as r, MathExpression as s, DimensionVector as t, MathMatrixSchema as u, MathProdSchema as v, MathSumSchema as w, MathQty as x, MathProvenance as y, isMathExpression as z };