documents.js 1.49.0 → 1.51.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 +107 -10
- package/dist/index.cjs +3486 -47
- package/dist/index.d.cts +269 -8
- package/dist/index.d.ts +269 -8
- package/dist/index.js +3466 -55
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, Package as Package$1, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElement as XmlElement$1, XmlElementSchema, XmlNode, XmlNode as XmlNode$1, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
|
-
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPoint as ContentPathPoint$1, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettings as ContentSheetPrintSettings$1, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStroke as ContentStroke$1, ContentStrokeSchema, ContentSubpath, ContentSubpath as ContentSubpath$1, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
1
|
+
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, Package as Package$1, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElement as XmlElement$1, XmlElementSchema, XmlNode, XmlNode as XmlNode$1, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
|
+
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPoint as ContentPathPoint$1, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettings as ContentSheetPrintSettings$1, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStroke as ContentStroke$1, ContentStrokeSchema, ContentSubpath, ContentSubpath as ContentSubpath$1, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutMetadata as LayoutMetadata$1, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-content-model";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Package as Package$2, XmlElement as XmlElement$2, XmlNode as XmlNode$2 } from "odf.js";
|
|
5
5
|
//#region src/model/content.d.ts
|
|
@@ -990,6 +990,161 @@ interface ReadPdfOptions {
|
|
|
990
990
|
}
|
|
991
991
|
declare function readPdf(bytes: Uint8Array<ArrayBuffer>, options?: ReadPdfOptions): LayoutDocument$1;
|
|
992
992
|
//#endregion
|
|
993
|
+
//#region src/mathml/layout-types.d.ts
|
|
994
|
+
interface MathColor {
|
|
995
|
+
readonly r: number;
|
|
996
|
+
readonly g: number;
|
|
997
|
+
readonly b: number;
|
|
998
|
+
}
|
|
999
|
+
interface MathGlyphRun {
|
|
1000
|
+
readonly kind: 'glyphs';
|
|
1001
|
+
readonly xPt: number;
|
|
1002
|
+
readonly yPt: number;
|
|
1003
|
+
readonly text: string;
|
|
1004
|
+
readonly sizePt: number;
|
|
1005
|
+
readonly color: MathColor;
|
|
1006
|
+
}
|
|
1007
|
+
interface MathRule {
|
|
1008
|
+
readonly kind: 'rule';
|
|
1009
|
+
readonly xPt: number;
|
|
1010
|
+
readonly yPt: number;
|
|
1011
|
+
readonly widthPt: number;
|
|
1012
|
+
readonly heightPt: number;
|
|
1013
|
+
readonly color: MathColor;
|
|
1014
|
+
}
|
|
1015
|
+
interface MathStroke {
|
|
1016
|
+
readonly kind: 'stroke';
|
|
1017
|
+
readonly points: readonly {
|
|
1018
|
+
readonly xPt: number;
|
|
1019
|
+
readonly yPt: number;
|
|
1020
|
+
}[];
|
|
1021
|
+
readonly widthPt: number;
|
|
1022
|
+
readonly color: MathColor;
|
|
1023
|
+
}
|
|
1024
|
+
type MathLayoutItem = MathGlyphRun | MathRule | MathStroke;
|
|
1025
|
+
interface MathBox {
|
|
1026
|
+
readonly widthPt: number;
|
|
1027
|
+
readonly heightPt: number;
|
|
1028
|
+
readonly ascentPt: number;
|
|
1029
|
+
readonly descentPt: number;
|
|
1030
|
+
readonly items: readonly MathLayoutItem[];
|
|
1031
|
+
}
|
|
1032
|
+
type MathDiagnosticKind = 'unsupported-element' | 'missing-glyph';
|
|
1033
|
+
interface MathDiagnostic {
|
|
1034
|
+
readonly kind: MathDiagnosticKind;
|
|
1035
|
+
readonly detail: string;
|
|
1036
|
+
}
|
|
1037
|
+
interface MathLayoutResult {
|
|
1038
|
+
readonly box: MathBox;
|
|
1039
|
+
readonly diagnostics: readonly MathDiagnostic[];
|
|
1040
|
+
}
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region src/mathml/metrics.d.ts
|
|
1043
|
+
interface MathGlyphMetrics {
|
|
1044
|
+
readonly advanceWidthPt: number;
|
|
1045
|
+
readonly italicCorrectionPt: number;
|
|
1046
|
+
readonly topAccentXPt?: number;
|
|
1047
|
+
}
|
|
1048
|
+
interface MathFontMetrics {
|
|
1049
|
+
readonly ascentPerEm: number;
|
|
1050
|
+
readonly descentPerEm: number;
|
|
1051
|
+
readonly axisHeightPt: number;
|
|
1052
|
+
readonly fractionRuleThicknessPt: number;
|
|
1053
|
+
readonly fractionNumeratorShiftUpPt: number;
|
|
1054
|
+
readonly fractionNumeratorDisplayShiftUpPt: number;
|
|
1055
|
+
readonly fractionDenominatorShiftDownPt: number;
|
|
1056
|
+
readonly fractionDenominatorDisplayShiftDownPt: number;
|
|
1057
|
+
readonly fractionNumeratorGapMinPt: number;
|
|
1058
|
+
readonly fractionDenominatorGapMinPt: number;
|
|
1059
|
+
readonly radicalRuleThicknessPt: number;
|
|
1060
|
+
readonly radicalExtraAscenderPt: number;
|
|
1061
|
+
readonly radicalVerticalGapPt: number;
|
|
1062
|
+
readonly radicalKernBeforeDegreePt: number;
|
|
1063
|
+
readonly radicalKernAfterDegreePt: number;
|
|
1064
|
+
readonly radicalDegreeBottomRaisePercent: number;
|
|
1065
|
+
readonly subscriptShiftDownPt: number;
|
|
1066
|
+
readonly superscriptShiftUpPt: number;
|
|
1067
|
+
readonly superscriptShiftUpCrampedPt: number;
|
|
1068
|
+
readonly subSuperscriptGapMinPt: number;
|
|
1069
|
+
readonly superscriptBaselineDropMaxPt: number;
|
|
1070
|
+
readonly subscriptBaselineDropMinPt: number;
|
|
1071
|
+
readonly spaceAfterScriptPt: number;
|
|
1072
|
+
readonly upperLimitGapMinPt: number;
|
|
1073
|
+
readonly upperLimitBaselineRiseMinPt: number;
|
|
1074
|
+
readonly lowerLimitGapMinPt: number;
|
|
1075
|
+
readonly lowerLimitBaselineDropMinPt: number;
|
|
1076
|
+
readonly stackTopShiftUpPt: number;
|
|
1077
|
+
readonly stackBottomShiftDownPt: number;
|
|
1078
|
+
readonly stackGapMinPt: number;
|
|
1079
|
+
readonly scriptPercentScaleDown: number;
|
|
1080
|
+
readonly scriptScriptPercentScaleDown: number;
|
|
1081
|
+
readonly defaultRuleThicknessPt: number;
|
|
1082
|
+
glyph(codePoint: number, sizePt: number): MathGlyphMetrics | undefined;
|
|
1083
|
+
}
|
|
1084
|
+
//#endregion
|
|
1085
|
+
//#region src/mathml/nodes.d.ts
|
|
1086
|
+
interface MathMlAttribute {
|
|
1087
|
+
readonly name: string;
|
|
1088
|
+
readonly value: string;
|
|
1089
|
+
}
|
|
1090
|
+
interface MathMlElement {
|
|
1091
|
+
readonly type: 'element';
|
|
1092
|
+
readonly tag: string;
|
|
1093
|
+
readonly attributes: readonly MathMlAttribute[];
|
|
1094
|
+
readonly children: readonly MathMlNode[];
|
|
1095
|
+
}
|
|
1096
|
+
interface MathMlText {
|
|
1097
|
+
readonly type: 'text';
|
|
1098
|
+
readonly value: string;
|
|
1099
|
+
}
|
|
1100
|
+
type MathMlNode = MathMlElement | MathMlText | {
|
|
1101
|
+
readonly type: 'cdata' | 'comment' | 'declaration' | 'pi';
|
|
1102
|
+
};
|
|
1103
|
+
declare function isMathMlElement(node: MathMlNode): node is MathMlElement;
|
|
1104
|
+
declare function localName(tag: string): string;
|
|
1105
|
+
declare function elementLocalName(element: MathMlElement): string;
|
|
1106
|
+
declare function elementChildren(node: MathMlElement): readonly MathMlElement[];
|
|
1107
|
+
declare function firstChildByLocalName(node: MathMlElement, name: string): MathMlElement | undefined;
|
|
1108
|
+
declare function textContent(node: MathMlNode): string;
|
|
1109
|
+
//#endregion
|
|
1110
|
+
//#region src/mathml/variant.d.ts
|
|
1111
|
+
type MathVariant = 'normal' | 'bold' | 'italic' | 'bold-italic' | 'double-struck' | 'bold-fraktur' | 'script' | 'bold-script' | 'fraktur' | 'sans-serif' | 'bold-sans-serif' | 'sans-serif-italic' | 'sans-serif-bold-italic' | 'monospace';
|
|
1112
|
+
declare function mapMathVariant(codePoint: number, variant: MathVariant): number;
|
|
1113
|
+
declare function applyMathVariant(text: string, variant: MathVariant): string;
|
|
1114
|
+
declare function isMathVariant(value: string): value is MathVariant;
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region src/mathml/layout.d.ts
|
|
1117
|
+
interface LayoutFormulaOptions {
|
|
1118
|
+
readonly metrics: MathFontMetrics;
|
|
1119
|
+
readonly sizePt: number;
|
|
1120
|
+
readonly color: MathColor;
|
|
1121
|
+
}
|
|
1122
|
+
declare function layoutFormula(mathml: readonly MathMlNode[], options: LayoutFormulaOptions): MathLayoutResult;
|
|
1123
|
+
//#endregion
|
|
1124
|
+
//#region src/mathml/operators.d.ts
|
|
1125
|
+
interface OperatorProperties {
|
|
1126
|
+
readonly lspaceEm: number;
|
|
1127
|
+
readonly rspaceEm: number;
|
|
1128
|
+
readonly stretchy: boolean;
|
|
1129
|
+
readonly largeop: boolean;
|
|
1130
|
+
readonly movablelimits: boolean;
|
|
1131
|
+
readonly fence: boolean;
|
|
1132
|
+
readonly separator: boolean;
|
|
1133
|
+
}
|
|
1134
|
+
declare function operatorProperties(text: string): OperatorProperties;
|
|
1135
|
+
//#endregion
|
|
1136
|
+
//#region src/model/formula.d.ts
|
|
1137
|
+
interface EmbeddedFormula {
|
|
1138
|
+
readonly mathml: readonly MathMlNode[];
|
|
1139
|
+
readonly starMath: string | undefined;
|
|
1140
|
+
}
|
|
1141
|
+
interface PositionedFormula {
|
|
1142
|
+
readonly pageIndex: number;
|
|
1143
|
+
readonly xPt: number;
|
|
1144
|
+
readonly yPt: number;
|
|
1145
|
+
readonly box: MathBox;
|
|
1146
|
+
}
|
|
1147
|
+
//#endregion
|
|
993
1148
|
//#region src/pdf/winansi.d.ts
|
|
994
1149
|
interface WinAnsiSubstitution {
|
|
995
1150
|
readonly from: string;
|
|
@@ -1003,6 +1158,7 @@ interface WritePdfOptions {
|
|
|
1003
1158
|
readonly onSubstitution?: (substitution: WinAnsiSubstitution, context: {
|
|
1004
1159
|
readonly pageIndex: number;
|
|
1005
1160
|
}) => void;
|
|
1161
|
+
readonly formulas?: readonly PositionedFormula[];
|
|
1006
1162
|
}
|
|
1007
1163
|
declare function writePdf(doc: LayoutDocument$1, options?: WritePdfOptions): Uint8Array<ArrayBuffer>;
|
|
1008
1164
|
//#endregion
|
|
@@ -1170,6 +1326,29 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
1170
1326
|
}, z.core.$strip>>;
|
|
1171
1327
|
}, z.core.$strip>>;
|
|
1172
1328
|
//#endregion
|
|
1329
|
+
//#region src/pdf/math-font.d.ts
|
|
1330
|
+
interface MathFontDescriptorMetrics {
|
|
1331
|
+
readonly unitsPerEm: number;
|
|
1332
|
+
readonly ascent: number;
|
|
1333
|
+
readonly descent: number;
|
|
1334
|
+
readonly capHeight: number;
|
|
1335
|
+
readonly bboxMin: readonly [number, number];
|
|
1336
|
+
readonly bboxMax: readonly [number, number];
|
|
1337
|
+
readonly italicAngle: number;
|
|
1338
|
+
}
|
|
1339
|
+
interface MathFont {
|
|
1340
|
+
readonly metrics: MathFontMetrics;
|
|
1341
|
+
readonly cffBytes: Uint8Array<ArrayBuffer>;
|
|
1342
|
+
readonly descriptor: MathFontDescriptorMetrics;
|
|
1343
|
+
glyphId(codePoint: number): number | undefined;
|
|
1344
|
+
glyphSpaceWidth(glyphId: number): number;
|
|
1345
|
+
}
|
|
1346
|
+
interface LoadedMathFont {
|
|
1347
|
+
readonly font: MathFont;
|
|
1348
|
+
readonly metricsAt: (sizePt: number) => MathFontMetrics;
|
|
1349
|
+
}
|
|
1350
|
+
declare function loadMathFont(): LoadedMathFont;
|
|
1351
|
+
//#endregion
|
|
1173
1352
|
//#region src/ooxml/docx/read.d.ts
|
|
1174
1353
|
declare function readDocxContent(pkg: Package$1): ContentDocument;
|
|
1175
1354
|
//#endregion
|
|
@@ -1177,10 +1356,18 @@ declare function readDocxContent(pkg: Package$1): ContentDocument;
|
|
|
1177
1356
|
declare function readPptxContent(pkg: Package$1): ContentDocument;
|
|
1178
1357
|
//#endregion
|
|
1179
1358
|
//#region src/odf/odt/read.d.ts
|
|
1180
|
-
|
|
1359
|
+
interface OdtContentResult {
|
|
1360
|
+
readonly document: ContentDocument;
|
|
1361
|
+
readonly formulas: ReadonlyMap<string, EmbeddedFormula>;
|
|
1362
|
+
}
|
|
1363
|
+
declare function readOdtContent(pkg: Package$2): OdtContentResult;
|
|
1181
1364
|
//#endregion
|
|
1182
1365
|
//#region src/odf/odp/read.d.ts
|
|
1183
|
-
|
|
1366
|
+
interface OdpContentResult {
|
|
1367
|
+
readonly document: ContentDocument;
|
|
1368
|
+
readonly formulas: ReadonlyMap<string, EmbeddedFormula>;
|
|
1369
|
+
}
|
|
1370
|
+
declare function readOdpContent(pkg: Package$2): OdpContentResult;
|
|
1184
1371
|
//#endregion
|
|
1185
1372
|
//#region src/odf/ods/read.d.ts
|
|
1186
1373
|
declare function readOdsContent(pkg: Package$2): ContentDocument;
|
|
@@ -1188,6 +1375,13 @@ declare function readOdsContent(pkg: Package$2): ContentDocument;
|
|
|
1188
1375
|
//#region src/odf/odg/read.d.ts
|
|
1189
1376
|
declare function readOdgContent(pkg: Package$2): ContentDocument;
|
|
1190
1377
|
//#endregion
|
|
1378
|
+
//#region src/odf/formula/read.d.ts
|
|
1379
|
+
interface StandaloneFormulaContent extends EmbeddedFormula {
|
|
1380
|
+
readonly metadata: LayoutMetadata$1;
|
|
1381
|
+
}
|
|
1382
|
+
declare function readOdfFormulaContent(pkg: Package$2): StandaloneFormulaContent;
|
|
1383
|
+
declare function readOdfEmbeddedFormula(outerPkg: Package$2, subPackagePath: string): EmbeddedFormula | undefined;
|
|
1384
|
+
//#endregion
|
|
1191
1385
|
//#region src/pdf/measure.d.ts
|
|
1192
1386
|
interface UnderlineMetrics {
|
|
1193
1387
|
readonly offsetPt: number;
|
|
@@ -1205,20 +1399,30 @@ interface TextMeasurer {
|
|
|
1205
1399
|
//#region src/layout/engine.d.ts
|
|
1206
1400
|
interface EngineLayoutOptions {
|
|
1207
1401
|
readonly measurer: TextMeasurer;
|
|
1402
|
+
readonly formulas?: ReadonlyMap<string, EmbeddedFormula>;
|
|
1403
|
+
}
|
|
1404
|
+
interface WordprocessingLayoutResult {
|
|
1405
|
+
readonly document: LayoutDocument$1;
|
|
1406
|
+
readonly formulas: readonly PositionedFormula[];
|
|
1208
1407
|
}
|
|
1209
1408
|
type WordprocessingContentDocument = Extract<ContentDocument, {
|
|
1210
1409
|
kind: 'wordprocessing';
|
|
1211
1410
|
}>;
|
|
1212
|
-
declare function convertWordprocessingToLayout(doc: WordprocessingContentDocument, options: EngineLayoutOptions):
|
|
1411
|
+
declare function convertWordprocessingToLayout(doc: WordprocessingContentDocument, options: EngineLayoutOptions): WordprocessingLayoutResult;
|
|
1213
1412
|
//#endregion
|
|
1214
1413
|
//#region src/layout/slides.d.ts
|
|
1215
1414
|
interface SlidesLayoutOptions {
|
|
1216
1415
|
readonly measurer: TextMeasurer;
|
|
1416
|
+
readonly formulas?: ReadonlyMap<string, EmbeddedFormula>;
|
|
1417
|
+
}
|
|
1418
|
+
interface PresentationLayoutResult {
|
|
1419
|
+
readonly document: LayoutDocument$1;
|
|
1420
|
+
readonly formulas: readonly PositionedFormula[];
|
|
1217
1421
|
}
|
|
1218
1422
|
type PresentationContentDocument = Extract<ContentDocument, {
|
|
1219
1423
|
kind: 'presentation';
|
|
1220
1424
|
}>;
|
|
1221
|
-
declare function convertPresentationToLayout(doc: PresentationContentDocument, options: SlidesLayoutOptions):
|
|
1425
|
+
declare function convertPresentationToLayout(doc: PresentationContentDocument, options: SlidesLayoutOptions): PresentationLayoutResult;
|
|
1222
1426
|
//#endregion
|
|
1223
1427
|
//#region src/layout/sheets.d.ts
|
|
1224
1428
|
interface SheetsLayoutOptions {
|
|
@@ -1261,6 +1465,7 @@ declare function pptxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToP
|
|
|
1261
1465
|
declare function odpToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1262
1466
|
declare function odsToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1263
1467
|
declare function odgToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1468
|
+
declare function odfToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1264
1469
|
interface PdfToDocumentOptions {
|
|
1265
1470
|
readonly signal?: AbortSignal;
|
|
1266
1471
|
readonly sink?: PdfDiagnosticSink;
|
|
@@ -1280,6 +1485,19 @@ declare function odpToPptx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBri
|
|
|
1280
1485
|
declare function pptxToOdp(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
1281
1486
|
declare function odsToXlsx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
1282
1487
|
declare function xlsxToOds(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
1488
|
+
interface OdmToPdfOptions extends DocumentToPdfOptions {
|
|
1489
|
+
readonly resolveSubDocument?: (href: string) => Uint8Array<ArrayBuffer> | undefined;
|
|
1490
|
+
}
|
|
1491
|
+
declare class OdmUnresolvedSectionError extends Error {
|
|
1492
|
+
readonly hrefs: readonly string[];
|
|
1493
|
+
constructor(hrefs: readonly string[]);
|
|
1494
|
+
}
|
|
1495
|
+
declare function odmToPdf(bytes: Uint8Array<ArrayBuffer>, options?: OdmToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1496
|
+
declare function odbToXlsx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
1497
|
+
interface OdbToCsvOptions extends DocumentBridgeOptions {
|
|
1498
|
+
readonly table?: string;
|
|
1499
|
+
}
|
|
1500
|
+
declare function odbToCsv(bytes: Uint8Array<ArrayBuffer>, options?: OdbToCsvOptions): Uint8Array<ArrayBuffer>;
|
|
1283
1501
|
//#endregion
|
|
1284
1502
|
//#region src/convert/codec.d.ts
|
|
1285
1503
|
declare const docxPdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
@@ -1292,8 +1510,51 @@ declare const odtDocxCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint
|
|
|
1292
1510
|
declare const odpPptxCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
1293
1511
|
declare const odsXlsxCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
1294
1512
|
//#endregion
|
|
1513
|
+
//#region src/hsqldb/script.d.ts
|
|
1514
|
+
declare class HsqldbScriptParseError extends Error {
|
|
1515
|
+
readonly statement: string;
|
|
1516
|
+
constructor(message: string, statement: string);
|
|
1517
|
+
}
|
|
1518
|
+
interface HsqldbColumn {
|
|
1519
|
+
readonly name: string;
|
|
1520
|
+
readonly type: string;
|
|
1521
|
+
}
|
|
1522
|
+
interface HsqldbTable {
|
|
1523
|
+
readonly tableName: string;
|
|
1524
|
+
readonly columns: readonly HsqldbColumn[];
|
|
1525
|
+
readonly rows: readonly (readonly ContentCellValue$1[])[];
|
|
1526
|
+
}
|
|
1527
|
+
declare function displayTextFor(value: ContentCellValue$1): string;
|
|
1528
|
+
declare function parseHsqldbScript(bytes: Uint8Array): HsqldbTable[];
|
|
1529
|
+
//#endregion
|
|
1530
|
+
//#region src/odb/read.d.ts
|
|
1531
|
+
declare class OdbNoEmbeddedDataSourceError extends Error {
|
|
1532
|
+
readonly url: string | undefined;
|
|
1533
|
+
constructor(url: string | undefined);
|
|
1534
|
+
}
|
|
1535
|
+
type OdbUnsupportedFormat = 'firebird' | 'hsqldb-binary' | 'hsqldb-compressed' | 'unrecognised-engine';
|
|
1536
|
+
declare class OdbUnsupportedFormatError extends Error {
|
|
1537
|
+
readonly format: OdbUnsupportedFormat;
|
|
1538
|
+
constructor(format: OdbUnsupportedFormat, detail: string);
|
|
1539
|
+
}
|
|
1540
|
+
declare function readOdbTables(pkg: Package$2): readonly HsqldbTable[];
|
|
1541
|
+
//#endregion
|
|
1542
|
+
//#region src/odb/spreadsheet.d.ts
|
|
1543
|
+
declare function odbTablesToSpreadsheetDocument(tables: readonly HsqldbTable[]): ContentDocument;
|
|
1544
|
+
//#endregion
|
|
1545
|
+
//#region src/odb/csv.d.ts
|
|
1546
|
+
declare class OdbTableNotSpecifiedError extends Error {
|
|
1547
|
+
readonly availableTables: readonly string[];
|
|
1548
|
+
constructor(availableTables: readonly string[]);
|
|
1549
|
+
}
|
|
1550
|
+
declare class OdbTableNotFoundError extends Error {
|
|
1551
|
+
readonly table: string;
|
|
1552
|
+
readonly availableTables: readonly string[];
|
|
1553
|
+
constructor(table: string, availableTables: readonly string[]);
|
|
1554
|
+
}
|
|
1555
|
+
//#endregion
|
|
1295
1556
|
//#region src/convert/port.d.ts
|
|
1296
|
-
type DocumentFormat = 'docx' | 'pptx' | 'xlsx' | 'odt' | 'odp' | 'ods' | 'odg' | 'pdf';
|
|
1557
|
+
type DocumentFormat = 'docx' | 'pptx' | 'xlsx' | 'odt' | 'odp' | 'ods' | 'odg' | 'odf' | 'pdf';
|
|
1297
1558
|
interface DocumentPayload {
|
|
1298
1559
|
readonly format: DocumentFormat;
|
|
1299
1560
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -1336,4 +1597,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
1336
1597
|
//#region src/ports/abort.d.ts
|
|
1337
1598
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
1338
1599
|
//#endregion
|
|
1339
|
-
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutEllipse, type LayoutFont, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type Margins, NOOP_DIAGNOSTIC_SINK, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type TextBoxInit$2 as TextBoxInit, type WinAnsiSubstitution, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToOdt, docxToPdf, elementsWithTag, encodeCompactPackage, encodePackage, fixedClock, flipY, fromCompact, isCompactXmlNode, isContentBlock, isXmlNode, odgPdfCodec, odgToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, packageCodec, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|
|
1600
|
+
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, type HsqldbColumn, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, type TextBoxInit$2 as TextBoxInit, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodePackage, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|