@opengeni/artifact-tool 0.2.2
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/LICENSE +190 -0
- package/README.md +104 -0
- package/dist/bounded-zip.d.ts +28 -0
- package/dist/chunk-4BSENMAE.js +39 -0
- package/dist/chunk-4BSENMAE.js.map +1 -0
- package/dist/chunk-4FRFNNBM.js +276 -0
- package/dist/chunk-4FRFNNBM.js.map +1 -0
- package/dist/chunk-5XIA6KHZ.js +49 -0
- package/dist/chunk-5XIA6KHZ.js.map +1 -0
- package/dist/chunk-66CT2ZRP.js +2229 -0
- package/dist/chunk-66CT2ZRP.js.map +1 -0
- package/dist/chunk-72SYDU4O.js +319 -0
- package/dist/chunk-72SYDU4O.js.map +1 -0
- package/dist/chunk-B2ZJRZDA.js +279 -0
- package/dist/chunk-B2ZJRZDA.js.map +1 -0
- package/dist/chunk-DCTLTNPW.js +2458 -0
- package/dist/chunk-DCTLTNPW.js.map +1 -0
- package/dist/chunk-FGZM4FQ6.js +473 -0
- package/dist/chunk-FGZM4FQ6.js.map +1 -0
- package/dist/chunk-HTJBLBDE.js +591 -0
- package/dist/chunk-HTJBLBDE.js.map +1 -0
- package/dist/chunk-IYFXZQ34.js +5306 -0
- package/dist/chunk-IYFXZQ34.js.map +1 -0
- package/dist/chunk-J6N7IR44.js +172 -0
- package/dist/chunk-J6N7IR44.js.map +1 -0
- package/dist/chunk-N2IHNWBS.js +1002 -0
- package/dist/chunk-N2IHNWBS.js.map +1 -0
- package/dist/chunk-NAG44K67.js +549 -0
- package/dist/chunk-NAG44K67.js.map +1 -0
- package/dist/chunk-O24KTEGP.js +33 -0
- package/dist/chunk-O24KTEGP.js.map +1 -0
- package/dist/chunk-PI2AZVGK.js +2074 -0
- package/dist/chunk-PI2AZVGK.js.map +1 -0
- package/dist/chunk-Q2FFHEY7.js +40 -0
- package/dist/chunk-Q2FFHEY7.js.map +1 -0
- package/dist/chunk-RBGQADXA.js +57 -0
- package/dist/chunk-RBGQADXA.js.map +1 -0
- package/dist/chunk-U5G2BKM2.js +613 -0
- package/dist/chunk-U5G2BKM2.js.map +1 -0
- package/dist/chunk-VOJHMSM3.js +39 -0
- package/dist/chunk-VOJHMSM3.js.map +1 -0
- package/dist/chunk-VUNV25KB.js +16 -0
- package/dist/chunk-VUNV25KB.js.map +1 -0
- package/dist/chunk-XIFUNVBO.js +101 -0
- package/dist/chunk-XIFUNVBO.js.map +1 -0
- package/dist/chunk-ZCJYRJGB.js +489 -0
- package/dist/chunk-ZCJYRJGB.js.map +1 -0
- package/dist/chunk-ZZXPEE4S.js +2260 -0
- package/dist/chunk-ZZXPEE4S.js.map +1 -0
- package/dist/document-docx-api.d.ts +49 -0
- package/dist/document-docx-codec.d.ts +9 -0
- package/dist/document-docx-codec.js +4765 -0
- package/dist/document-docx-codec.js.map +1 -0
- package/dist/document-docx-import.d.ts +261 -0
- package/dist/document-docx-packer.d.ts +18 -0
- package/dist/document-docx-state.d.ts +12 -0
- package/dist/document-render.d.ts +3 -0
- package/dist/document-render.js +492 -0
- package/dist/document-render.js.map +1 -0
- package/dist/document.d.ts +432 -0
- package/dist/document.js +37 -0
- package/dist/document.js.map +1 -0
- package/dist/errors.d.ts +23 -0
- package/dist/file-blob.d.ts +11 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +186 -0
- package/dist/index.js.map +1 -0
- package/dist/inspection.d.ts +12 -0
- package/dist/kernel.d.ts +101 -0
- package/dist/lib-GQLPACFK.js +9746 -0
- package/dist/lib-GQLPACFK.js.map +1 -0
- package/dist/materializer-cli-entry.d.ts +2 -0
- package/dist/materializer-cli-entry.js +29 -0
- package/dist/materializer-cli-entry.js.map +1 -0
- package/dist/materializer-cli.d.ts +24 -0
- package/dist/materializer-cli.js +24 -0
- package/dist/materializer-cli.js.map +1 -0
- package/dist/native-raster.d.ts +10 -0
- package/dist/native.d.ts +129 -0
- package/dist/native.js +31 -0
- package/dist/native.js.map +1 -0
- package/dist/office-import.d.ts +48 -0
- package/dist/office-import.js +154 -0
- package/dist/office-import.js.map +1 -0
- package/dist/presentation-pptx-api.d.ts +60 -0
- package/dist/presentation-pptx-import.d.ts +5 -0
- package/dist/presentation-pptx-state-digest-765CZZED.js +10 -0
- package/dist/presentation-pptx-state-digest-765CZZED.js.map +1 -0
- package/dist/presentation-pptx-state-digest.d.ts +3 -0
- package/dist/presentation-pptx-state.d.ts +4 -0
- package/dist/presentation-pptx-xml.d.ts +29 -0
- package/dist/presentation-pptx.d.ts +5 -0
- package/dist/presentation-pptx.js +2365 -0
- package/dist/presentation-pptx.js.map +1 -0
- package/dist/presentation-render.d.ts +29 -0
- package/dist/presentation-render.js +375 -0
- package/dist/presentation-render.js.map +1 -0
- package/dist/presentation.d.ts +565 -0
- package/dist/presentation.js +71 -0
- package/dist/presentation.js.map +1 -0
- package/dist/production-composite.d.ts +68 -0
- package/dist/production-document.d.ts +2 -0
- package/dist/production-document.js +176 -0
- package/dist/production-document.js.map +1 -0
- package/dist/production-native-codecs.d.ts +94 -0
- package/dist/production-presentation.d.ts +2 -0
- package/dist/production-presentation.js +176 -0
- package/dist/production-presentation.js.map +1 -0
- package/dist/production-sha256.d.ts +2 -0
- package/dist/production-spreadsheet-native.d.ts +12 -0
- package/dist/production-spreadsheet.d.ts +2 -0
- package/dist/production-spreadsheet.js +176 -0
- package/dist/production-spreadsheet.js.map +1 -0
- package/dist/production.d.ts +96 -0
- package/dist/raster-image.d.ts +34 -0
- package/dist/reference.d.ts +17 -0
- package/dist/reference.js +574 -0
- package/dist/reference.js.map +1 -0
- package/dist/runtime-cli-entry.d.ts +2 -0
- package/dist/runtime-cli-entry.js +21 -0
- package/dist/runtime-cli-entry.js.map +1 -0
- package/dist/runtime-cli.d.ts +76 -0
- package/dist/runtime-cli.js +26 -0
- package/dist/runtime-cli.js.map +1 -0
- package/dist/runtime-development.d.ts +73 -0
- package/dist/runtime-development.js +30 -0
- package/dist/runtime-development.js.map +1 -0
- package/dist/runtime-receipt.d.ts +19 -0
- package/dist/runtime.d.ts +355 -0
- package/dist/runtime.js +42 -0
- package/dist/runtime.js.map +1 -0
- package/dist/snapshot.d.ts +26 -0
- package/dist/snapshot.js +61 -0
- package/dist/snapshot.js.map +1 -0
- package/dist/spreadsheet-address.d.ts +18 -0
- package/dist/spreadsheet-file.d.ts +17 -0
- package/dist/spreadsheet-formula.d.ts +67 -0
- package/dist/spreadsheet-image.d.ts +17 -0
- package/dist/spreadsheet-render.d.ts +5 -0
- package/dist/spreadsheet-render.js +752 -0
- package/dist/spreadsheet-render.js.map +1 -0
- package/dist/spreadsheet-types.d.ts +155 -0
- package/dist/spreadsheet-xlsx-api.d.ts +88 -0
- package/dist/spreadsheet-xlsx-codec.d.ts +16 -0
- package/dist/spreadsheet-xlsx-codec.js +16 -0
- package/dist/spreadsheet-xlsx-codec.js.map +1 -0
- package/dist/spreadsheet-xlsx-state.d.ts +16 -0
- package/dist/spreadsheet.d.ts +724 -0
- package/dist/spreadsheet.js +67 -0
- package/dist/spreadsheet.js.map +1 -0
- package/package.json +129 -0
- package/src/bounded-zip.ts +450 -0
- package/src/document-docx-api.ts +64 -0
- package/src/document-docx-codec.ts +2253 -0
- package/src/document-docx-import.ts +3814 -0
- package/src/document-docx-packer.ts +72 -0
- package/src/document-docx-state.ts +59 -0
- package/src/document-render.ts +615 -0
- package/src/document.ts +2800 -0
- package/src/errors.ts +45 -0
- package/src/file-blob.ts +43 -0
- package/src/index.ts +4 -0
- package/src/inspection.ts +50 -0
- package/src/kernel.ts +525 -0
- package/src/materializer-cli-entry.ts +11 -0
- package/src/materializer-cli.ts +743 -0
- package/src/native-raster.ts +141 -0
- package/src/native.ts +390 -0
- package/src/office-import.ts +243 -0
- package/src/presentation-pptx-api.ts +107 -0
- package/src/presentation-pptx-import.ts +2065 -0
- package/src/presentation-pptx-state-digest.ts +46 -0
- package/src/presentation-pptx-state.ts +18 -0
- package/src/presentation-pptx-xml.ts +473 -0
- package/src/presentation-pptx.ts +447 -0
- package/src/presentation-render.ts +532 -0
- package/src/presentation.ts +2599 -0
- package/src/production-composite.ts +805 -0
- package/src/production-document.ts +2 -0
- package/src/production-native-codecs.ts +1141 -0
- package/src/production-presentation.ts +2 -0
- package/src/production-sha256.ts +150 -0
- package/src/production-spreadsheet-native.ts +686 -0
- package/src/production-spreadsheet.ts +2 -0
- package/src/production.ts +1022 -0
- package/src/raster-image.ts +586 -0
- package/src/reference.ts +17 -0
- package/src/runtime-cli-entry.ts +13 -0
- package/src/runtime-cli.ts +670 -0
- package/src/runtime-development.ts +689 -0
- package/src/runtime-receipt.ts +169 -0
- package/src/runtime.ts +1463 -0
- package/src/snapshot.ts +88 -0
- package/src/spreadsheet-address.ts +90 -0
- package/src/spreadsheet-file.ts +71 -0
- package/src/spreadsheet-formula.ts +1212 -0
- package/src/spreadsheet-image.ts +242 -0
- package/src/spreadsheet-render.ts +985 -0
- package/src/spreadsheet-types.ts +171 -0
- package/src/spreadsheet-xlsx-api.ts +123 -0
- package/src/spreadsheet-xlsx-codec.ts +3063 -0
- package/src/spreadsheet-xlsx-state.ts +191 -0
- package/src/spreadsheet.ts +5195 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A dependency-free, browser-safe DOCX reader.
|
|
3
|
+
*
|
|
4
|
+
* This module deliberately returns a neutral DTO. The editable document model
|
|
5
|
+
* can consume that DTO without making the ZIP/XML reader depend on it (or on a
|
|
6
|
+
* Node-only OOXML library). Unsupported fidelity-bearing content fails closed.
|
|
7
|
+
*/
|
|
8
|
+
import type { DocumentOpaqueContent } from "./document-docx-api.js";
|
|
9
|
+
export type DocxImportLimits = {
|
|
10
|
+
maxCompressedBytes: number;
|
|
11
|
+
maxEntries: number;
|
|
12
|
+
maxEntryCompressedBytes: number;
|
|
13
|
+
maxEntryUncompressedBytes: number;
|
|
14
|
+
maxTotalUncompressedBytes: number;
|
|
15
|
+
maxCompressionRatio: number;
|
|
16
|
+
maxXmlBytes: number;
|
|
17
|
+
maxTotalXmlBytes: number;
|
|
18
|
+
maxRetainedXmlCharacters: number;
|
|
19
|
+
maxXmlNodes: number;
|
|
20
|
+
maxXmlDepth: number;
|
|
21
|
+
maxXmlAttributesPerElement: number;
|
|
22
|
+
maxRelationshipsPerPart: number;
|
|
23
|
+
maxTotalRelationships: number;
|
|
24
|
+
maxBlocks: number;
|
|
25
|
+
maxTextCharacters: number;
|
|
26
|
+
maxSections: number;
|
|
27
|
+
maxProjectedStoryBlocks: number;
|
|
28
|
+
maxProjectedStoryCharacters: number;
|
|
29
|
+
maxStyles: number;
|
|
30
|
+
maxStyleInheritanceDepth: number;
|
|
31
|
+
maxNumberingDefinitions: number;
|
|
32
|
+
maxComments: number;
|
|
33
|
+
maxProjectedCommentWork: number;
|
|
34
|
+
};
|
|
35
|
+
export type DocxImportErrorCode = "invalid_input" | "invalid_zip" | "limit_exceeded" | "invalid_xml" | "invalid_package" | "unsupported_feature" | "unsupported_platform";
|
|
36
|
+
export declare class DocxImportError extends Error {
|
|
37
|
+
readonly code: DocxImportErrorCode;
|
|
38
|
+
readonly partName?: string | undefined;
|
|
39
|
+
readonly name = "DocxImportError";
|
|
40
|
+
constructor(code: DocxImportErrorCode, message: string, partName?: string | undefined);
|
|
41
|
+
}
|
|
42
|
+
export type ImportedDocument = {
|
|
43
|
+
format: "docx";
|
|
44
|
+
schemaVersion: 1;
|
|
45
|
+
evenAndOddHeaders: boolean;
|
|
46
|
+
trackRevisions: boolean;
|
|
47
|
+
blocks: ImportedBlock[];
|
|
48
|
+
sections: ImportedSection[];
|
|
49
|
+
styles: ImportedStyle[];
|
|
50
|
+
lists: ImportedListDefinition[];
|
|
51
|
+
headers: ImportedHeaderFooter[];
|
|
52
|
+
footers: ImportedHeaderFooter[];
|
|
53
|
+
comments: ImportedComment[];
|
|
54
|
+
trackedChanges: ImportedTrackedChange[];
|
|
55
|
+
opaqueContent: DocumentOpaqueContent;
|
|
56
|
+
};
|
|
57
|
+
export type ImportedBlock = ImportedParagraph | ImportedTable | ImportedPageBreak;
|
|
58
|
+
export type ImportedParagraph = {
|
|
59
|
+
kind: "paragraph";
|
|
60
|
+
id: string;
|
|
61
|
+
styleId?: string;
|
|
62
|
+
style: ImportedParagraphStyle;
|
|
63
|
+
inlines: ImportedInline[];
|
|
64
|
+
commentAnchors: ImportedCommentAnchor[];
|
|
65
|
+
};
|
|
66
|
+
export type ImportedInline = ImportedRun | ImportedPageBreak;
|
|
67
|
+
export type ImportedRun = {
|
|
68
|
+
kind: "run";
|
|
69
|
+
text: string;
|
|
70
|
+
styleId?: string;
|
|
71
|
+
style: ImportedRunStyle;
|
|
72
|
+
changeId?: string;
|
|
73
|
+
};
|
|
74
|
+
export type ImportedPageBreak = {
|
|
75
|
+
kind: "pageBreak";
|
|
76
|
+
};
|
|
77
|
+
export type ImportedTable = {
|
|
78
|
+
kind: "table";
|
|
79
|
+
id: string;
|
|
80
|
+
styleId?: string;
|
|
81
|
+
width?: ImportedMeasure;
|
|
82
|
+
indent?: ImportedMeasure;
|
|
83
|
+
alignment?: string;
|
|
84
|
+
layout?: "fixed" | "autofit";
|
|
85
|
+
cellMargins?: ImportedBoxMeasures;
|
|
86
|
+
borders?: ImportedTableBorders;
|
|
87
|
+
gridColumnWidthsPt: number[];
|
|
88
|
+
rows: ImportedTableRow[];
|
|
89
|
+
};
|
|
90
|
+
export type ImportedTableRow = {
|
|
91
|
+
header: boolean;
|
|
92
|
+
cannotSplit: boolean;
|
|
93
|
+
heightPt?: number;
|
|
94
|
+
heightRule?: "auto" | "atLeast" | "exact";
|
|
95
|
+
cells: ImportedTableCell[];
|
|
96
|
+
};
|
|
97
|
+
export type ImportedTableCell = {
|
|
98
|
+
width?: ImportedMeasure;
|
|
99
|
+
margins?: ImportedBoxMeasures;
|
|
100
|
+
columnSpan: number;
|
|
101
|
+
verticalMerge?: "restart" | "continue";
|
|
102
|
+
verticalAlignment?: string;
|
|
103
|
+
fill?: string;
|
|
104
|
+
blocks: ImportedBlock[];
|
|
105
|
+
};
|
|
106
|
+
export type ImportedMeasure = {
|
|
107
|
+
value: number;
|
|
108
|
+
unit: "pt" | "percent" | "auto";
|
|
109
|
+
};
|
|
110
|
+
export type ImportedBoxMeasures = {
|
|
111
|
+
top?: ImportedMeasure;
|
|
112
|
+
right?: ImportedMeasure;
|
|
113
|
+
bottom?: ImportedMeasure;
|
|
114
|
+
left?: ImportedMeasure;
|
|
115
|
+
start?: ImportedMeasure;
|
|
116
|
+
end?: ImportedMeasure;
|
|
117
|
+
};
|
|
118
|
+
export type ImportedBorder = {
|
|
119
|
+
style: string;
|
|
120
|
+
color?: string;
|
|
121
|
+
sizePt?: number;
|
|
122
|
+
spacePt?: number;
|
|
123
|
+
shadow?: boolean;
|
|
124
|
+
frame?: boolean;
|
|
125
|
+
};
|
|
126
|
+
export type ImportedTableBorders = {
|
|
127
|
+
top?: ImportedBorder;
|
|
128
|
+
right?: ImportedBorder;
|
|
129
|
+
bottom?: ImportedBorder;
|
|
130
|
+
left?: ImportedBorder;
|
|
131
|
+
insideHorizontal?: ImportedBorder;
|
|
132
|
+
insideVertical?: ImportedBorder;
|
|
133
|
+
};
|
|
134
|
+
export type ImportedParagraphStyle = {
|
|
135
|
+
alignment?: string;
|
|
136
|
+
spaceBeforePt?: number;
|
|
137
|
+
spaceAfterPt?: number;
|
|
138
|
+
line?: number;
|
|
139
|
+
lineRule?: string;
|
|
140
|
+
indentLeftPt?: number;
|
|
141
|
+
indentRightPt?: number;
|
|
142
|
+
firstLinePt?: number;
|
|
143
|
+
hangingPt?: number;
|
|
144
|
+
keepNext?: boolean;
|
|
145
|
+
keepLines?: boolean;
|
|
146
|
+
pageBreakBefore?: boolean;
|
|
147
|
+
outlineLevel?: number;
|
|
148
|
+
bidirectional?: boolean;
|
|
149
|
+
list?: {
|
|
150
|
+
numId: string;
|
|
151
|
+
level: number;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
export type ImportedRunStyle = {
|
|
155
|
+
fontFamily?: string;
|
|
156
|
+
fontSizePt?: number;
|
|
157
|
+
fontSizeComplexScriptPt?: number;
|
|
158
|
+
color?: string;
|
|
159
|
+
bold?: boolean;
|
|
160
|
+
boldComplexScript?: boolean;
|
|
161
|
+
italic?: boolean;
|
|
162
|
+
italicComplexScript?: boolean;
|
|
163
|
+
underline?: string;
|
|
164
|
+
strike?: boolean;
|
|
165
|
+
highlight?: string;
|
|
166
|
+
verticalAlign?: string;
|
|
167
|
+
language?: string;
|
|
168
|
+
};
|
|
169
|
+
export type ImportedStyle = {
|
|
170
|
+
styleId: string;
|
|
171
|
+
kind: string;
|
|
172
|
+
name?: string;
|
|
173
|
+
basedOn?: string;
|
|
174
|
+
next?: string;
|
|
175
|
+
isDefault: boolean;
|
|
176
|
+
paragraph: ImportedParagraphStyle;
|
|
177
|
+
run: ImportedRunStyle;
|
|
178
|
+
};
|
|
179
|
+
export type ImportedListLevel = {
|
|
180
|
+
level: number;
|
|
181
|
+
start: number;
|
|
182
|
+
restart?: number;
|
|
183
|
+
legal?: boolean;
|
|
184
|
+
alignment?: string;
|
|
185
|
+
format?: string;
|
|
186
|
+
text?: string;
|
|
187
|
+
suffix?: string;
|
|
188
|
+
paragraphStyleId?: string;
|
|
189
|
+
paragraph: ImportedParagraphStyle;
|
|
190
|
+
run: ImportedRunStyle;
|
|
191
|
+
};
|
|
192
|
+
export type ImportedListDefinition = {
|
|
193
|
+
numId: string;
|
|
194
|
+
abstractNumId: string;
|
|
195
|
+
levels: ImportedListLevel[];
|
|
196
|
+
overrides: Array<{
|
|
197
|
+
level: number;
|
|
198
|
+
start?: number;
|
|
199
|
+
definition?: ImportedListLevel;
|
|
200
|
+
}>;
|
|
201
|
+
};
|
|
202
|
+
export type ImportedSection = {
|
|
203
|
+
startBlockIndex: number;
|
|
204
|
+
endBlockIndex: number;
|
|
205
|
+
type?: string;
|
|
206
|
+
titlePage: boolean;
|
|
207
|
+
page: {
|
|
208
|
+
widthPt: number;
|
|
209
|
+
heightPt: number;
|
|
210
|
+
orientation?: string;
|
|
211
|
+
marginTopPt: number;
|
|
212
|
+
marginRightPt: number;
|
|
213
|
+
marginBottomPt: number;
|
|
214
|
+
marginLeftPt: number;
|
|
215
|
+
headerPt: number;
|
|
216
|
+
footerPt: number;
|
|
217
|
+
gutterPt: number;
|
|
218
|
+
};
|
|
219
|
+
headers: ImportedSectionReference[];
|
|
220
|
+
footers: ImportedSectionReference[];
|
|
221
|
+
};
|
|
222
|
+
export type ImportedSectionReference = {
|
|
223
|
+
kind: string;
|
|
224
|
+
relationshipId: string;
|
|
225
|
+
partName: string;
|
|
226
|
+
};
|
|
227
|
+
export type ImportedHeaderFooter = {
|
|
228
|
+
kind: "header" | "footer";
|
|
229
|
+
partName: string;
|
|
230
|
+
blocks: ImportedBlock[];
|
|
231
|
+
};
|
|
232
|
+
export type ImportedCommentAnchor = {
|
|
233
|
+
commentId: string;
|
|
234
|
+
kind: "start" | "end" | "reference";
|
|
235
|
+
textOffset: number;
|
|
236
|
+
};
|
|
237
|
+
export type ImportedComment = {
|
|
238
|
+
id: string;
|
|
239
|
+
parentId?: string;
|
|
240
|
+
resolved?: boolean;
|
|
241
|
+
author?: string;
|
|
242
|
+
initials?: string;
|
|
243
|
+
createdAt?: string;
|
|
244
|
+
blocks: ImportedBlock[];
|
|
245
|
+
};
|
|
246
|
+
export type ImportedTrackedChange = {
|
|
247
|
+
id: string;
|
|
248
|
+
kind: "insert" | "delete";
|
|
249
|
+
author?: string;
|
|
250
|
+
createdAt?: string;
|
|
251
|
+
blockId: string;
|
|
252
|
+
startInlineIndex: number;
|
|
253
|
+
endInlineIndex: number;
|
|
254
|
+
startTextOffset: number;
|
|
255
|
+
endTextOffset: number;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Imports the fidelity-bearing, editable WordprocessingML subset into a neutral
|
|
259
|
+
* DTO. The function has no Node imports and is suitable for a browser worker.
|
|
260
|
+
*/
|
|
261
|
+
export declare function importDocx(input: Blob | ArrayBuffer, options?: Partial<DocxImportLimits>): Promise<ImportedDocument>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrow adapter around the pinned `docx` compiler.
|
|
3
|
+
*
|
|
4
|
+
* `docx`'s public Packer hard-codes DEFLATE, which can make valid repetitive
|
|
5
|
+
* text exceed our secure importer's 100:1 ceiling. Its pinned compiler already
|
|
6
|
+
* produces a JSZip-compatible archive, so generate those exact OOXML parts as
|
|
7
|
+
* STORE. If that controlled runtime contract changes, fail closed instead of
|
|
8
|
+
* silently shipping a second ZIP implementation or masking the incompatibility.
|
|
9
|
+
*/
|
|
10
|
+
export type DocxXmlOverride = {
|
|
11
|
+
path: string;
|
|
12
|
+
data: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class DocxExportCompatibilityError extends Error {
|
|
15
|
+
readonly name = "DocxExportCompatibilityError";
|
|
16
|
+
readonly code: "incompatible_docx_runtime";
|
|
17
|
+
}
|
|
18
|
+
export declare function packDocxWithBoundedCompression(file: unknown, packer: unknown, overrides?: readonly DocxXmlOverride[]): Promise<Uint8Array>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Document } from "./document.js";
|
|
2
|
+
import { type DocumentFidelityIssue, type DocumentLossPreservationEnvelope, type DocumentOpaqueContent } from "./document-docx-api.js";
|
|
3
|
+
export type DocumentLossPreservationState = {
|
|
4
|
+
sourceBytes: Uint8Array;
|
|
5
|
+
sourceDigest: string;
|
|
6
|
+
importedRevision: number;
|
|
7
|
+
opaqueContent: DocumentOpaqueContent;
|
|
8
|
+
modelDigest: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const DOCUMENT_LOSS_PRESERVATION: WeakMap<Document, DocumentLossPreservationState>;
|
|
11
|
+
export declare function documentFidelityReport(document: Document): readonly DocumentFidelityIssue[];
|
|
12
|
+
export declare function documentLossPreservationEnvelope(document: Document): DocumentLossPreservationEnvelope | null;
|