reamkit 1.14.0 → 1.15.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.
Files changed (62) hide show
  1. package/README.md +34 -8
  2. package/dist/esm/core/converter/facade.d.ts +8 -1
  3. package/dist/esm/core/converter/facade.js +34 -8
  4. package/dist/esm/core/converter/ream.d.ts +1 -0
  5. package/dist/esm/core/converter/ream.js +13 -8
  6. package/dist/esm/core/ir/features.d.ts +1 -0
  7. package/dist/esm/core/ir/features.js +1 -0
  8. package/dist/esm/core/ir/sheet.d.ts +7 -0
  9. package/dist/esm/core/ole/cfb.d.ts +19 -0
  10. package/dist/esm/core/ole/cfb.js +158 -0
  11. package/dist/esm/core/spreadsheet-model/index.d.ts +1 -1
  12. package/dist/esm/core/spreadsheet-model/types.d.ts +20 -1
  13. package/dist/esm/excel/activex-parser.d.ts +9 -0
  14. package/dist/esm/excel/activex-parser.js +188 -0
  15. package/dist/esm/excel/conditional-format.d.ts +4 -2
  16. package/dist/esm/excel/conditional-format.js +138 -4
  17. package/dist/esm/excel/formula/context.d.ts +11 -0
  18. package/dist/esm/excel/formula/dates.d.ts +11 -0
  19. package/dist/esm/excel/formula/dates.js +46 -0
  20. package/dist/esm/excel/formula/eval.d.ts +11 -0
  21. package/dist/esm/excel/formula/eval.js +196 -0
  22. package/dist/esm/excel/formula/functions.d.ts +7 -0
  23. package/dist/esm/excel/formula/functions.js +1359 -0
  24. package/dist/esm/excel/formula/index.d.ts +14 -0
  25. package/dist/esm/excel/formula/index.js +17 -0
  26. package/dist/esm/excel/formula/lexer.d.ts +8 -0
  27. package/dist/esm/excel/formula/lexer.js +163 -0
  28. package/dist/esm/excel/formula/parser.d.ts +57 -0
  29. package/dist/esm/excel/formula/parser.js +274 -0
  30. package/dist/esm/excel/formula/value.d.ts +52 -0
  31. package/dist/esm/excel/formula/value.js +102 -0
  32. package/dist/esm/excel/number-format.d.ts +2 -0
  33. package/dist/esm/excel/number-format.js +5 -1
  34. package/dist/esm/excel/print-model.d.ts +3 -0
  35. package/dist/esm/excel/print-model.js +1 -1
  36. package/dist/esm/excel/sheet-to-flow.d.ts +4 -1
  37. package/dist/esm/excel/sheet-to-flow.js +46 -2
  38. package/dist/esm/excel/worksheet-parser.js +66 -0
  39. package/dist/esm/excel/xls/biff-chart.d.ts +8 -0
  40. package/dist/esm/excel/xls/biff-chart.js +121 -0
  41. package/dist/esm/excel/xls/biff-reader.d.ts +4 -0
  42. package/dist/esm/excel/xls/biff-reader.js +1418 -0
  43. package/dist/esm/excel/xls/biff-styles.d.ts +8 -0
  44. package/dist/esm/excel/xls/biff-styles.js +299 -0
  45. package/dist/esm/excel/xls/escher.d.ts +24 -0
  46. package/dist/esm/excel/xls/escher.js +171 -0
  47. package/dist/esm/excel/xls/xls-reader.d.ts +3 -0
  48. package/dist/esm/excel/xls/xls-reader.js +30 -0
  49. package/dist/esm/excel/xlsx-reader.d.ts +2 -1
  50. package/dist/esm/excel/xlsx-reader.js +28 -3
  51. package/dist/esm/excel/xlsx-to-pdf.d.ts +1 -0
  52. package/dist/esm/excel/xlsx-to-pdf.js +2 -2
  53. package/dist/esm/excel/xlsx-writer.js +2 -0
  54. package/dist/esm/pptx/ppt/ppt-reader.d.ts +4 -0
  55. package/dist/esm/pptx/ppt/ppt-reader.js +337 -0
  56. package/dist/esm/pptx/ppt/ppt-text.d.ts +69 -0
  57. package/dist/esm/pptx/ppt/ppt-text.js +756 -0
  58. package/dist/esm/word/doc/doc-reader.d.ts +4 -0
  59. package/dist/esm/word/doc/doc-reader.js +421 -0
  60. package/dist/esm/word/doc/doc-text.d.ts +79 -0
  61. package/dist/esm/word/doc/doc-text.js +706 -0
  62. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ import { DocumentReader, ReadResult } from '../../core/ir/adapters.js';
2
+ import { FlowDoc } from '../../core/ir/flow.js';
3
+ export declare function readDoc(bytes: Uint8Array): ReadResult<FlowDoc>;
4
+ export declare const docReader: DocumentReader<FlowDoc>;
@@ -0,0 +1,421 @@
1
+ import { pt, twipsToPt } from "../../core/ir/units.js";
2
+ import { ResourceStore } from "../../core/ir/resources.js";
3
+ import { FEATURES } from "../../core/ir/features.js";
4
+ import { EMPTY_STYLE_SHEET, resolveBodyStyles } from "../../core/style-cascade/resolver.js";
5
+ import "../../core/style-cascade/index.js";
6
+ import { isCfb, openCfb } from "../../core/ole/cfb.js";
7
+ import { extractDocContent } from "./doc-text.js";
8
+ //#region src/word/doc/doc-reader.ts
9
+ var ZERO_WIDTH_SPACE = "​";
10
+ var CONTENT_WIDTH_PT = 468;
11
+ var LIST_BULLETS = [
12
+ "•",
13
+ "◦",
14
+ "▪"
15
+ ];
16
+ var LIST_INDENT_PT = 18;
17
+ var TABLE_BORDER = {
18
+ style: "single",
19
+ width: pt(.5),
20
+ colorHex: "000000"
21
+ };
22
+ var TABLE_BORDERS = {
23
+ top: TABLE_BORDER,
24
+ right: TABLE_BORDER,
25
+ bottom: TABLE_BORDER,
26
+ left: TABLE_BORDER,
27
+ insideH: TABLE_BORDER,
28
+ insideV: TABLE_BORDER
29
+ };
30
+ function createListMarkers(tables) {
31
+ const counters = /* @__PURE__ */ new Map();
32
+ const resolve = (ilfo, ilvl) => {
33
+ if (!tables || ilfo < 1 || ilfo > tables.lfoLsids.length) return void 0;
34
+ const lsid = tables.lfoLsids[ilfo - 1];
35
+ const list = tables.lists.get(lsid);
36
+ const lvl = list?.levels[list.simple ? 0 : ilvl];
37
+ return list && lvl ? {
38
+ lsid,
39
+ lvl
40
+ } : void 0;
41
+ };
42
+ return { marker(ilfo, ilvl) {
43
+ const r = resolve(ilfo, ilvl);
44
+ if (!r) return void 0;
45
+ const { lsid, lvl } = r;
46
+ if (lvl.nfc === 23 || lvl.nfc === 255 || !lvl.xst.some((cu) => cu <= 8)) return lvl.xst.map((cu) => String.fromCharCode(cu)).join("");
47
+ const col = counters.get(lsid) ?? [];
48
+ col[ilvl] = (col[ilvl] ?? lvl.iStartAt - 1) + 1;
49
+ for (let l = ilvl + 1; l < col.length; l++) col[l] = void 0;
50
+ counters.set(lsid, col);
51
+ let out = "";
52
+ for (const cu of lvl.xst) if (cu <= 8) {
53
+ const other = resolve(ilfo, cu);
54
+ out += formatListNumber(other?.lvl.nfc ?? 0, col[cu] ?? other?.lvl.iStartAt ?? 1);
55
+ } else out += String.fromCharCode(cu);
56
+ return out;
57
+ } };
58
+ }
59
+ function formatListNumber(nfc, n) {
60
+ switch (nfc) {
61
+ case 1: return toRoman(n);
62
+ case 2: return toRoman(n).toLowerCase();
63
+ case 3: return toLetters(n);
64
+ case 4: return toLetters(n).toLowerCase();
65
+ case 22: return n < 10 ? `0${n}` : String(n);
66
+ default: return String(n);
67
+ }
68
+ }
69
+ function toLetters(n) {
70
+ let s = "";
71
+ while (n > 0) {
72
+ n--;
73
+ s = String.fromCharCode(65 + n % 26) + s;
74
+ n = Math.floor(n / 26);
75
+ }
76
+ return s;
77
+ }
78
+ var ROMAN = [
79
+ [1e3, "M"],
80
+ [900, "CM"],
81
+ [500, "D"],
82
+ [400, "CD"],
83
+ [100, "C"],
84
+ [90, "XC"],
85
+ [50, "L"],
86
+ [40, "XL"],
87
+ [10, "X"],
88
+ [9, "IX"],
89
+ [5, "V"],
90
+ [4, "IV"],
91
+ [1, "I"]
92
+ ];
93
+ function toRoman(n) {
94
+ if (n <= 0) return String(n);
95
+ let out = "";
96
+ for (const [v, sym] of ROMAN) while (n >= v) out += sym, n -= v;
97
+ return out;
98
+ }
99
+ function looksLikeDoc(bytes) {
100
+ if (!isCfb(bytes)) return false;
101
+ try {
102
+ return openCfb(bytes).hasStream("WordDocument");
103
+ } catch {
104
+ return false;
105
+ }
106
+ }
107
+ var DOC_TEXT_LOSS = {
108
+ severity: "degraded",
109
+ feature: FEATURES.text,
110
+ detail: "legacy .doc: the document text, run formatting (bold/italic/underline/size), paragraph formatting (alignment/indent/spacing), tables (with column widths, cell borders, vertical merges and cell background shading), inline images, fields, the section's headers/footers and list items (with their number format / bullet) are read; drawing shapes / text boxes and comments are not (re-save as .docx for full fidelity)"
111
+ };
112
+ var DOC_ENCRYPTED_LOSS = {
113
+ severity: "dropped",
114
+ feature: FEATURES.text,
115
+ detail: "legacy .doc is encrypted/obfuscated — its text cannot be read"
116
+ };
117
+ function readDoc(bytes) {
118
+ const content = extractDocContent(bytes);
119
+ const resources = new ResourceStore();
120
+ const body = buildBody(content, resources);
121
+ const headersFooters = /* @__PURE__ */ new Map();
122
+ const headers = [];
123
+ const footers = [];
124
+ const addStory = (story, kind, type) => {
125
+ if (!story) return;
126
+ const id = `${kind}-${type}`;
127
+ const els = resolveBodyStyles(story.flatMap((p) => mapParagraph(p, resources)), EMPTY_STYLE_SHEET);
128
+ headersFooters.set(id, els);
129
+ (kind === "header" ? headers : footers).push({
130
+ type,
131
+ relationshipId: id
132
+ });
133
+ };
134
+ const hf = content.headerFooters;
135
+ if (hf) {
136
+ addStory(hf.defaultHeader, "header", "default");
137
+ addStory(hf.firstHeader, "header", "first");
138
+ addStory(hf.evenHeader, "header", "even");
139
+ addStory(hf.defaultFooter, "footer", "default");
140
+ addStory(hf.firstFooter, "footer", "first");
141
+ addStory(hf.evenFooter, "footer", "even");
142
+ }
143
+ return {
144
+ doc: {
145
+ kind: "flow",
146
+ body: resolveBodyStyles(body, EMPTY_STYLE_SHEET),
147
+ sections: [],
148
+ section: {
149
+ pageSize: {
150
+ width: pt(612),
151
+ height: pt(792)
152
+ },
153
+ margins: {
154
+ top: pt(72),
155
+ right: pt(72),
156
+ bottom: pt(72),
157
+ left: pt(72)
158
+ },
159
+ headers,
160
+ footers
161
+ },
162
+ styles: EMPTY_STYLE_SHEET,
163
+ resources,
164
+ ...headersFooters.size > 0 ? { headersFooters } : {}
165
+ },
166
+ losses: [content.encrypted ? DOC_ENCRYPTED_LOSS : DOC_TEXT_LOSS]
167
+ };
168
+ }
169
+ function buildBody(content, resources) {
170
+ const markers = createListMarkers(content.listTables);
171
+ const body = groupTables(content.paragraphs, resources, markers);
172
+ while (body.length > 1 && isEmptyParagraph(body[body.length - 1])) body.pop();
173
+ if (body.length === 0) body.push(emptyParagraph());
174
+ return body;
175
+ }
176
+ function groupTables(paras, resources, markers) {
177
+ const out = [];
178
+ let i = 0;
179
+ while (i < paras.length) if (paras[i].props.inTable) {
180
+ const group = [];
181
+ while (i < paras.length && paras[i].props.inTable) group.push(paras[i++]);
182
+ out.push({
183
+ kind: "table",
184
+ table: buildTable(group, resources, markers)
185
+ });
186
+ } else out.push(...mapParagraph(paras[i++], resources, markers));
187
+ return out;
188
+ }
189
+ function buildTable(group, resources, markers) {
190
+ const edges = group.find((p) => p.props.cellEdgesTwips)?.props.cellEdgesTwips;
191
+ const rawRows = [];
192
+ let rowParas = [];
193
+ for (const p of group) {
194
+ rowParas.push(p);
195
+ if (p.props.rowEnd) {
196
+ rawRows.push(buildRawRow(rowParas, resources, edges, markers));
197
+ rowParas = [];
198
+ }
199
+ }
200
+ if (rowParas.length > 0) rawRows.push(buildRawRow(rowParas, resources, edges, markers));
201
+ resolveVerticalMerges(rawRows);
202
+ const rows = rawRows.map((cells) => ({
203
+ properties: {},
204
+ cells: cells.map(toTableCell)
205
+ }));
206
+ return {
207
+ properties: {
208
+ borders: TABLE_BORDERS,
209
+ layout: "fixed"
210
+ },
211
+ grid: columnWidths(edges, rows),
212
+ rows
213
+ };
214
+ }
215
+ function columnWidths(edges, rows) {
216
+ if (edges && edges.length >= 2) {
217
+ const widths = [];
218
+ for (let i = 0; i + 1 < edges.length; i++) widths.push(twipsToPt(Math.max(0, edges[i + 1] - edges[i])));
219
+ return widths;
220
+ }
221
+ const cols = Math.max(1, ...rows.map((r) => r.cells.length));
222
+ const even = pt(CONTENT_WIDTH_PT / cols);
223
+ return Array.from({ length: cols }, () => even);
224
+ }
225
+ function buildRawRow(rowParas, resources, edges, markers) {
226
+ const descriptors = rowParas.find((p) => p.props.cellDescriptors)?.props.cellDescriptors;
227
+ const shadings = rowParas.find((p) => p.props.cellShadings)?.props.cellShadings;
228
+ const cells = [];
229
+ let col = 0;
230
+ for (const p of rowParas) {
231
+ if (p.props.rowEnd && isBlank(p)) continue;
232
+ const tc = descriptors?.[col];
233
+ cells.push({
234
+ content: mapParagraph(p, resources, markers),
235
+ width: cellWidth(edges, col),
236
+ borders: tc?.borders ? toCellBorders(tc.borders) : void 0,
237
+ shading: shadings?.[col],
238
+ vMergeRaw: tc?.vMerge
239
+ });
240
+ col++;
241
+ }
242
+ if (cells.length === 0) cells.push({
243
+ content: [emptyParagraph()],
244
+ width: void 0,
245
+ borders: void 0,
246
+ shading: void 0,
247
+ vMergeRaw: void 0
248
+ });
249
+ return cells;
250
+ }
251
+ function resolveVerticalMerges(rows) {
252
+ const maxCols = Math.max(0, ...rows.map((r) => r.length));
253
+ for (let c = 0; c < maxCols; c++) {
254
+ let span = [];
255
+ const close = () => {
256
+ if (span.length >= 2) {
257
+ span[0].merge = "start";
258
+ span[span.length - 1].merge = "end";
259
+ for (let k = 1; k < span.length - 1; k++) span[k].merge = "middle";
260
+ }
261
+ span = [];
262
+ };
263
+ for (const row of rows) {
264
+ const cell = row[c];
265
+ if (cell?.vMergeRaw === "restart") {
266
+ close();
267
+ span = [cell];
268
+ } else if (cell?.vMergeRaw === "continue" && span.length > 0) span.push(cell);
269
+ else close();
270
+ }
271
+ close();
272
+ }
273
+ }
274
+ function toTableCell(raw) {
275
+ return {
276
+ properties: {
277
+ ...raw.width ? { width: raw.width } : {},
278
+ ...raw.borders ? { borders: raw.borders } : {},
279
+ ...raw.shading ? { shading: { colorHex: raw.shading } } : {},
280
+ ...raw.merge ? { merge: raw.merge } : {}
281
+ },
282
+ content: raw.content
283
+ };
284
+ }
285
+ function toCellBorders(b) {
286
+ const edge = (db) => db ? {
287
+ style: db.double ? "double" : "single",
288
+ width: pt(db.widthPt),
289
+ colorHex: db.colorHex
290
+ } : void 0;
291
+ const top = edge(b.top);
292
+ const left = edge(b.left);
293
+ const bottom = edge(b.bottom);
294
+ const right = edge(b.right);
295
+ return {
296
+ ...top ? { top } : {},
297
+ ...left ? { left } : {},
298
+ ...bottom ? { bottom } : {},
299
+ ...right ? { right } : {}
300
+ };
301
+ }
302
+ function cellWidth(edges, col) {
303
+ if (edges && col + 1 < edges.length) {
304
+ const w = edges[col + 1] - edges[col];
305
+ if (w > 0) return twipsToPt(w);
306
+ }
307
+ }
308
+ function isBlank(p) {
309
+ return p.runs.every((r) => r.text.length === 0 && r.picture === void 0);
310
+ }
311
+ function mapParagraph(p, resources, markers) {
312
+ const out = [];
313
+ const textRuns = p.runs.filter((r) => r.picture === void 0);
314
+ const ilvl = p.props.listIlvl ?? 0;
315
+ const isList = (p.props.listIlfo ?? 0) > 0;
316
+ if (textRuns.some((r) => r.text.length > 0) || isList) {
317
+ const runs = textRuns.map((r) => ({
318
+ text: r.text,
319
+ properties: toRunProperties(r.props)
320
+ }));
321
+ let properties = toParaProperties(p.props);
322
+ if (isList) {
323
+ const marker = markers?.marker(p.props.listIlfo, ilvl) ?? LIST_BULLETS[ilvl % LIST_BULLETS.length];
324
+ runs.unshift({
325
+ text: `${marker} `,
326
+ properties: {}
327
+ });
328
+ properties = {
329
+ ...properties,
330
+ indentLeft: pt((ilvl + 1) * LIST_INDENT_PT)
331
+ };
332
+ }
333
+ out.push({
334
+ kind: "paragraph",
335
+ paragraph: {
336
+ properties,
337
+ runs: runs.length > 0 ? runs : [{
338
+ text: ZERO_WIDTH_SPACE,
339
+ properties: {}
340
+ }]
341
+ }
342
+ });
343
+ }
344
+ for (const r of p.runs) if (r.picture) out.push(imageBlock(r.picture, resources, toParaProperties(p.props)));
345
+ if (out.length === 0) out.push(emptyParagraph());
346
+ return out;
347
+ }
348
+ function imageBlock(pic, resources, paragraphProperties) {
349
+ return {
350
+ kind: "image",
351
+ image: {
352
+ resource: resources.put(pic.bytes),
353
+ width: twipsToPt(pic.widthTwips),
354
+ height: twipsToPt(pic.heightTwips),
355
+ paragraphProperties
356
+ }
357
+ };
358
+ }
359
+ function emptyParagraph() {
360
+ return {
361
+ kind: "paragraph",
362
+ paragraph: {
363
+ properties: {},
364
+ runs: [{
365
+ text: ZERO_WIDTH_SPACE,
366
+ properties: {}
367
+ }]
368
+ }
369
+ };
370
+ }
371
+ function isEmptyParagraph(el) {
372
+ return el.kind === "paragraph" && el.paragraph.runs.length === 1 && el.paragraph.runs[0].text === ZERO_WIDTH_SPACE;
373
+ }
374
+ function toRunProperties(p) {
375
+ const underline = p.underlineKul ? underlineStyle(p.underlineKul) : void 0;
376
+ const size = p.sizeHalfPts && p.sizeHalfPts > 0 ? pt(p.sizeHalfPts / 2) : void 0;
377
+ return {
378
+ ...p.bold ? { bold: true } : {},
379
+ ...p.italic ? { italic: true } : {},
380
+ ...underline ? { underline } : {},
381
+ ...size ? { fontSizePt: size } : {}
382
+ };
383
+ }
384
+ function toParaProperties(p) {
385
+ const alignment = p.jc !== void 0 ? alignmentFromJc(p.jc) : void 0;
386
+ return {
387
+ ...alignment ? { alignment } : {},
388
+ ...p.indentLeftTwips !== void 0 ? { indentLeft: pt(p.indentLeftTwips / 20) } : {},
389
+ ...p.indentRightTwips !== void 0 ? { indentRight: pt(p.indentRightTwips / 20) } : {},
390
+ ...p.indentFirstTwips !== void 0 ? { indentFirstLine: pt(p.indentFirstTwips / 20) } : {},
391
+ ...p.spaceBeforeTwips !== void 0 ? { spacingBefore: pt(p.spaceBeforeTwips / 20) } : {},
392
+ ...p.spaceAfterTwips !== void 0 ? { spacingAfter: pt(p.spaceAfterTwips / 20) } : {}
393
+ };
394
+ }
395
+ function underlineStyle(kul) {
396
+ switch (kul) {
397
+ case 0: return;
398
+ case 3: return "double";
399
+ case 4: return "dotted";
400
+ case 7: return "dash";
401
+ default: return "single";
402
+ }
403
+ }
404
+ function alignmentFromJc(jc) {
405
+ switch (jc) {
406
+ case 1: return "center";
407
+ case 2: return "right";
408
+ case 3: return "both";
409
+ case 4: return "distribute";
410
+ default: return;
411
+ }
412
+ }
413
+ var docReader = {
414
+ id: "doc",
415
+ produces: "flow",
416
+ supports: new Set([FEATURES.text]),
417
+ sniff: looksLikeDoc,
418
+ read: (bytes) => readDoc(bytes)
419
+ };
420
+ //#endregion
421
+ export { docReader };
@@ -0,0 +1,79 @@
1
+ export interface DocCharProps {
2
+ readonly bold?: boolean;
3
+ readonly italic?: boolean;
4
+ readonly underlineKul?: number;
5
+ readonly sizeHalfPts?: number;
6
+ readonly fSpec?: boolean;
7
+ readonly picOffset?: number;
8
+ }
9
+ export interface DocPicture {
10
+ readonly bytes: Uint8Array;
11
+ readonly widthTwips: number;
12
+ readonly heightTwips: number;
13
+ }
14
+ export interface DocBorder {
15
+ readonly widthPt: number;
16
+ readonly colorHex: string;
17
+ readonly double?: boolean;
18
+ }
19
+ export interface DocTc {
20
+ readonly borders?: {
21
+ readonly top?: DocBorder;
22
+ readonly left?: DocBorder;
23
+ readonly bottom?: DocBorder;
24
+ readonly right?: DocBorder;
25
+ };
26
+ readonly vMerge?: 'restart' | 'continue';
27
+ }
28
+ export interface DocParaProps {
29
+ readonly jc?: number;
30
+ readonly indentLeftTwips?: number;
31
+ readonly indentRightTwips?: number;
32
+ readonly indentFirstTwips?: number;
33
+ readonly spaceBeforeTwips?: number;
34
+ readonly spaceAfterTwips?: number;
35
+ readonly inTable?: boolean;
36
+ readonly rowEnd?: boolean;
37
+ readonly cellEdgesTwips?: ReadonlyArray<number>;
38
+ readonly cellDescriptors?: ReadonlyArray<DocTc>;
39
+ readonly cellShadings?: ReadonlyArray<string | undefined>;
40
+ readonly listIlfo?: number;
41
+ readonly listIlvl?: number;
42
+ }
43
+ export interface DocRun {
44
+ readonly text: string;
45
+ readonly props: DocCharProps;
46
+ readonly picture?: DocPicture;
47
+ }
48
+ export interface DocParagraph {
49
+ readonly runs: ReadonlyArray<DocRun>;
50
+ readonly props: DocParaProps;
51
+ readonly cellMark?: boolean;
52
+ }
53
+ export interface DocHeaderFooters {
54
+ readonly defaultHeader?: ReadonlyArray<DocParagraph>;
55
+ readonly defaultFooter?: ReadonlyArray<DocParagraph>;
56
+ readonly firstHeader?: ReadonlyArray<DocParagraph>;
57
+ readonly firstFooter?: ReadonlyArray<DocParagraph>;
58
+ readonly evenHeader?: ReadonlyArray<DocParagraph>;
59
+ readonly evenFooter?: ReadonlyArray<DocParagraph>;
60
+ }
61
+ export interface DocLvl {
62
+ readonly nfc: number;
63
+ readonly iStartAt: number;
64
+ readonly xst: ReadonlyArray<number>;
65
+ }
66
+ export interface DocListTables {
67
+ readonly lfoLsids: ReadonlyArray<number>;
68
+ readonly lists: ReadonlyMap<number, {
69
+ readonly simple: boolean;
70
+ readonly levels: ReadonlyArray<DocLvl>;
71
+ }>;
72
+ }
73
+ export interface DocContent {
74
+ readonly paragraphs: ReadonlyArray<DocParagraph>;
75
+ readonly headerFooters?: DocHeaderFooters;
76
+ readonly listTables?: DocListTables;
77
+ readonly encrypted: boolean;
78
+ }
79
+ export declare function extractDocContent(bytes: Uint8Array): DocContent;