doc-codec 2.4.3 → 2.6.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 +53 -20
- package/dist/chp-B6AOh85P.d.ts +18 -0
- package/dist/chp-BpCqpb7V.d.cts +18 -0
- package/dist/detect.cjs +3 -0
- package/dist/detect.d.cts +3 -1
- package/dist/detect.d.ts +3 -1
- package/dist/detect.js +3 -1
- package/dist/encryption.cjs +44 -10
- package/dist/encryption.d.cts +2 -2
- package/dist/encryption.d.ts +2 -2
- package/dist/encryption.js +45 -11
- package/dist/fib/fib.cjs +14 -0
- package/dist/fib/fib.d.cts +1 -1
- package/dist/fib/fib.d.ts +1 -1
- package/dist/fib/fib.js +14 -0
- package/dist/fib/offsets.cjs +14 -0
- package/dist/fib/offsets.d.cts +14 -0
- package/dist/fib/offsets.d.ts +14 -0
- package/dist/fib/offsets.js +14 -0
- package/dist/{fib-DWFta19r.d.cts → fib-6BFIx153.d.cts} +14 -0
- package/dist/{fib-DWFta19r.d.ts → fib-6BFIx153.d.ts} +14 -0
- package/dist/fkp-I-laf-8y.d.cts +33 -0
- package/dist/fkp-I-laf-8y.d.ts +33 -0
- package/dist/headers-footers.cjs +34 -0
- package/dist/headers-footers.d.cts +16 -0
- package/dist/headers-footers.d.ts +16 -0
- package/dist/headers-footers.js +33 -0
- package/dist/index.cjs +20 -9
- package/dist/index.d.cts +16 -12
- package/dist/index.d.ts +16 -12
- package/dist/index.js +15 -11
- package/dist/list/numbering-write.d.cts +1 -1
- package/dist/list/numbering-write.d.ts +1 -1
- package/dist/list/numbering.d.cts +23 -1
- package/dist/list/numbering.d.ts +23 -1
- package/dist/notes.cjs +26 -0
- package/dist/notes.d.cts +20 -0
- package/dist/notes.d.ts +20 -0
- package/dist/notes.js +25 -0
- package/dist/{pap-BT1p0uzu.d.cts → pap-BQ2E17K9.d.cts} +5 -3
- package/dist/{pap-DOFLMWcG.d.ts → pap-iWFIpCdo.d.ts} +5 -3
- package/dist/paragraphs-DQUp8_HB.d.cts +31 -0
- package/dist/paragraphs-s2lJ6w2I.d.ts +31 -0
- package/dist/pictures.cjs +93 -0
- package/dist/pictures.d.cts +6 -0
- package/dist/pictures.d.ts +6 -0
- package/dist/pictures.js +92 -0
- package/dist/piece-table-CA18mhjv.d.cts +28 -0
- package/dist/piece-table-CA18mhjv.d.ts +28 -0
- package/dist/prop/chp.d.cts +1 -17
- package/dist/prop/chp.d.ts +1 -17
- package/dist/prop/fkp.d.cts +1 -32
- package/dist/prop/fkp.d.ts +1 -32
- package/dist/prop/pap.cjs +4 -2
- package/dist/prop/pap.d.cts +1 -1
- package/dist/prop/pap.d.ts +1 -1
- package/dist/prop/pap.js +4 -2
- package/dist/prop/sep.cjs +20 -10
- package/dist/prop/sep.d.cts +8 -4
- package/dist/prop/sep.d.ts +8 -4
- package/dist/prop/sep.js +20 -10
- package/dist/read.cjs +48 -153
- package/dist/read.d.cts +13 -15
- package/dist/read.d.ts +13 -15
- package/dist/read.js +51 -156
- package/dist/stsh-Bj0YSEOp.d.ts +40 -0
- package/dist/stsh-CK59x6XG.d.cts +40 -0
- package/dist/style/stsh.d.cts +1 -39
- package/dist/style/stsh.d.ts +1 -39
- package/dist/subdocument.cjs +20 -0
- package/dist/subdocument.d.cts +8 -0
- package/dist/subdocument.d.ts +8 -0
- package/dist/subdocument.js +18 -0
- package/dist/table/read.cjs +31 -17
- package/dist/table/read.d.cts +1 -1
- package/dist/table/read.d.ts +1 -1
- package/dist/table/read.js +32 -18
- package/dist/text/characters.d.cts +1 -1
- package/dist/text/characters.d.ts +1 -1
- package/dist/text/paragraphs.cjs +189 -0
- package/dist/text/paragraphs.d.cts +2 -0
- package/dist/text/paragraphs.d.ts +2 -0
- package/dist/text/paragraphs.js +187 -0
- package/dist/text/piece-table.d.cts +1 -27
- package/dist/text/piece-table.d.ts +1 -27
- package/dist/write.cjs +3 -3
- package/dist/write.js +3 -3
- package/package.json +2 -2
- package/dist/numbering-DSpm9w6y.d.cts +0 -24
- package/dist/numbering-DayjnHXY.d.ts +0 -24
package/dist/fib/offsets.cjs
CHANGED
|
@@ -32,8 +32,18 @@ const LW_OFFSET = {
|
|
|
32
32
|
const FC_LCB_VALUE_INDEX = {
|
|
33
33
|
fcStshf: 2,
|
|
34
34
|
lcbStshf: 3,
|
|
35
|
+
fcPlcffndRef: 4,
|
|
36
|
+
lcbPlcffndRef: 5,
|
|
37
|
+
fcPlcffndTxt: 6,
|
|
38
|
+
lcbPlcffndTxt: 7,
|
|
39
|
+
fcPlcfandRef: 8,
|
|
40
|
+
lcbPlcfandRef: 9,
|
|
41
|
+
fcPlcfandTxt: 10,
|
|
42
|
+
lcbPlcfandTxt: 11,
|
|
35
43
|
fcPlcfSed: 12,
|
|
36
44
|
lcbPlcfSed: 13,
|
|
45
|
+
fcPlcfHdd: 22,
|
|
46
|
+
lcbPlcfHdd: 23,
|
|
37
47
|
fcPlcfBteChpx: 24,
|
|
38
48
|
lcbPlcfBteChpx: 25,
|
|
39
49
|
fcPlcfBtePapx: 26,
|
|
@@ -42,6 +52,10 @@ const FC_LCB_VALUE_INDEX = {
|
|
|
42
52
|
lcbSttbfFfn: 31,
|
|
43
53
|
fcClx: 66,
|
|
44
54
|
lcbClx: 67,
|
|
55
|
+
fcPlcfendRef: 92,
|
|
56
|
+
lcbPlcfendRef: 93,
|
|
57
|
+
fcPlcfendTxt: 94,
|
|
58
|
+
lcbPlcfendTxt: 95,
|
|
45
59
|
fcPlfLst: 146,
|
|
46
60
|
lcbPlfLst: 147,
|
|
47
61
|
fcPlfLfo: 148,
|
package/dist/fib/offsets.d.cts
CHANGED
|
@@ -31,8 +31,18 @@ declare const LW_OFFSET: {
|
|
|
31
31
|
declare const FC_LCB_VALUE_INDEX: {
|
|
32
32
|
readonly fcStshf: 2;
|
|
33
33
|
readonly lcbStshf: 3;
|
|
34
|
+
readonly fcPlcffndRef: 4;
|
|
35
|
+
readonly lcbPlcffndRef: 5;
|
|
36
|
+
readonly fcPlcffndTxt: 6;
|
|
37
|
+
readonly lcbPlcffndTxt: 7;
|
|
38
|
+
readonly fcPlcfandRef: 8;
|
|
39
|
+
readonly lcbPlcfandRef: 9;
|
|
40
|
+
readonly fcPlcfandTxt: 10;
|
|
41
|
+
readonly lcbPlcfandTxt: 11;
|
|
34
42
|
readonly fcPlcfSed: 12;
|
|
35
43
|
readonly lcbPlcfSed: 13;
|
|
44
|
+
readonly fcPlcfHdd: 22;
|
|
45
|
+
readonly lcbPlcfHdd: 23;
|
|
36
46
|
readonly fcPlcfBteChpx: 24;
|
|
37
47
|
readonly lcbPlcfBteChpx: 25;
|
|
38
48
|
readonly fcPlcfBtePapx: 26;
|
|
@@ -41,6 +51,10 @@ declare const FC_LCB_VALUE_INDEX: {
|
|
|
41
51
|
readonly lcbSttbfFfn: 31;
|
|
42
52
|
readonly fcClx: 66;
|
|
43
53
|
readonly lcbClx: 67;
|
|
54
|
+
readonly fcPlcfendRef: 92;
|
|
55
|
+
readonly lcbPlcfendRef: 93;
|
|
56
|
+
readonly fcPlcfendTxt: 94;
|
|
57
|
+
readonly lcbPlcfendTxt: 95;
|
|
44
58
|
readonly fcPlfLst: 146;
|
|
45
59
|
readonly lcbPlfLst: 147;
|
|
46
60
|
readonly fcPlfLfo: 148;
|
package/dist/fib/offsets.d.ts
CHANGED
|
@@ -31,8 +31,18 @@ declare const LW_OFFSET: {
|
|
|
31
31
|
declare const FC_LCB_VALUE_INDEX: {
|
|
32
32
|
readonly fcStshf: 2;
|
|
33
33
|
readonly lcbStshf: 3;
|
|
34
|
+
readonly fcPlcffndRef: 4;
|
|
35
|
+
readonly lcbPlcffndRef: 5;
|
|
36
|
+
readonly fcPlcffndTxt: 6;
|
|
37
|
+
readonly lcbPlcffndTxt: 7;
|
|
38
|
+
readonly fcPlcfandRef: 8;
|
|
39
|
+
readonly lcbPlcfandRef: 9;
|
|
40
|
+
readonly fcPlcfandTxt: 10;
|
|
41
|
+
readonly lcbPlcfandTxt: 11;
|
|
34
42
|
readonly fcPlcfSed: 12;
|
|
35
43
|
readonly lcbPlcfSed: 13;
|
|
44
|
+
readonly fcPlcfHdd: 22;
|
|
45
|
+
readonly lcbPlcfHdd: 23;
|
|
36
46
|
readonly fcPlcfBteChpx: 24;
|
|
37
47
|
readonly lcbPlcfBteChpx: 25;
|
|
38
48
|
readonly fcPlcfBtePapx: 26;
|
|
@@ -41,6 +51,10 @@ declare const FC_LCB_VALUE_INDEX: {
|
|
|
41
51
|
readonly lcbSttbfFfn: 31;
|
|
42
52
|
readonly fcClx: 66;
|
|
43
53
|
readonly lcbClx: 67;
|
|
54
|
+
readonly fcPlcfendRef: 92;
|
|
55
|
+
readonly lcbPlcfendRef: 93;
|
|
56
|
+
readonly fcPlcfendTxt: 94;
|
|
57
|
+
readonly lcbPlcfendTxt: 95;
|
|
44
58
|
readonly fcPlfLst: 146;
|
|
45
59
|
readonly lcbPlfLst: 147;
|
|
46
60
|
readonly fcPlfLfo: 148;
|
package/dist/fib/offsets.js
CHANGED
|
@@ -31,8 +31,18 @@ const LW_OFFSET = {
|
|
|
31
31
|
const FC_LCB_VALUE_INDEX = {
|
|
32
32
|
fcStshf: 2,
|
|
33
33
|
lcbStshf: 3,
|
|
34
|
+
fcPlcffndRef: 4,
|
|
35
|
+
lcbPlcffndRef: 5,
|
|
36
|
+
fcPlcffndTxt: 6,
|
|
37
|
+
lcbPlcffndTxt: 7,
|
|
38
|
+
fcPlcfandRef: 8,
|
|
39
|
+
lcbPlcfandRef: 9,
|
|
40
|
+
fcPlcfandTxt: 10,
|
|
41
|
+
lcbPlcfandTxt: 11,
|
|
34
42
|
fcPlcfSed: 12,
|
|
35
43
|
lcbPlcfSed: 13,
|
|
44
|
+
fcPlcfHdd: 22,
|
|
45
|
+
lcbPlcfHdd: 23,
|
|
36
46
|
fcPlcfBteChpx: 24,
|
|
37
47
|
lcbPlcfBteChpx: 25,
|
|
38
48
|
fcPlcfBtePapx: 26,
|
|
@@ -41,6 +51,10 @@ const FC_LCB_VALUE_INDEX = {
|
|
|
41
51
|
lcbSttbfFfn: 31,
|
|
42
52
|
fcClx: 66,
|
|
43
53
|
lcbClx: 67,
|
|
54
|
+
fcPlcfendRef: 92,
|
|
55
|
+
lcbPlcfendRef: 93,
|
|
56
|
+
fcPlcfendTxt: 94,
|
|
57
|
+
lcbPlcfendTxt: 95,
|
|
44
58
|
fcPlfLst: 146,
|
|
45
59
|
lcbPlfLst: 147,
|
|
46
60
|
fcPlfLfo: 148,
|
|
@@ -23,6 +23,20 @@ interface Fib {
|
|
|
23
23
|
readonly lcbClx: number;
|
|
24
24
|
readonly fcPlcfSed: number;
|
|
25
25
|
readonly lcbPlcfSed: number;
|
|
26
|
+
readonly fcPlcffndRef: number;
|
|
27
|
+
readonly lcbPlcffndRef: number;
|
|
28
|
+
readonly fcPlcffndTxt: number;
|
|
29
|
+
readonly lcbPlcffndTxt: number;
|
|
30
|
+
readonly fcPlcfandRef: number;
|
|
31
|
+
readonly lcbPlcfandRef: number;
|
|
32
|
+
readonly fcPlcfandTxt: number;
|
|
33
|
+
readonly lcbPlcfandTxt: number;
|
|
34
|
+
readonly fcPlcfendRef: number;
|
|
35
|
+
readonly lcbPlcfendRef: number;
|
|
36
|
+
readonly fcPlcfendTxt: number;
|
|
37
|
+
readonly lcbPlcfendTxt: number;
|
|
38
|
+
readonly fcPlcfHdd: number;
|
|
39
|
+
readonly lcbPlcfHdd: number;
|
|
26
40
|
readonly fcSttbfFfn: number;
|
|
27
41
|
readonly lcbSttbfFfn: number;
|
|
28
42
|
readonly fcPlfLst: number;
|
|
@@ -23,6 +23,20 @@ interface Fib {
|
|
|
23
23
|
readonly lcbClx: number;
|
|
24
24
|
readonly fcPlcfSed: number;
|
|
25
25
|
readonly lcbPlcfSed: number;
|
|
26
|
+
readonly fcPlcffndRef: number;
|
|
27
|
+
readonly lcbPlcffndRef: number;
|
|
28
|
+
readonly fcPlcffndTxt: number;
|
|
29
|
+
readonly lcbPlcffndTxt: number;
|
|
30
|
+
readonly fcPlcfandRef: number;
|
|
31
|
+
readonly lcbPlcfandRef: number;
|
|
32
|
+
readonly fcPlcfandTxt: number;
|
|
33
|
+
readonly lcbPlcfandTxt: number;
|
|
34
|
+
readonly fcPlcfendRef: number;
|
|
35
|
+
readonly lcbPlcfendRef: number;
|
|
36
|
+
readonly fcPlcfendTxt: number;
|
|
37
|
+
readonly lcbPlcfendTxt: number;
|
|
38
|
+
readonly fcPlcfHdd: number;
|
|
39
|
+
readonly lcbPlcfHdd: number;
|
|
26
40
|
readonly fcSttbfFfn: number;
|
|
27
41
|
readonly lcbSttbfFfn: number;
|
|
28
42
|
readonly fcPlfLst: number;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/prop/fkp.d.ts
|
|
2
|
+
/** Every FKP is exactly one 512-byte page, whatever the compound file's own sector size. */
|
|
3
|
+
declare const FKP_PAGE_SIZE = 512;
|
|
4
|
+
interface ChpxFkp {
|
|
5
|
+
readonly rgfc: readonly number[];
|
|
6
|
+
/** The Chpx's grpprl for run `index`, or undefined when the run's rgb entry is zero and it carries no exception. */
|
|
7
|
+
grpprl(index: number): Uint8Array | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface PapxRecord {
|
|
10
|
+
readonly istd: number;
|
|
11
|
+
readonly grpprl: Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
interface PapxFkp {
|
|
14
|
+
readonly rgfc: readonly number[];
|
|
15
|
+
/** The PapxInFkp for paragraph `index`, or undefined when its BxPap.bOffset is zero and the paragraph takes the defaults. */
|
|
16
|
+
papx(index: number): PapxRecord | undefined;
|
|
17
|
+
}
|
|
18
|
+
declare function parseChpxFkp(page: Uint8Array): ChpxFkp;
|
|
19
|
+
declare function parsePapxFkp(page: Uint8Array): PapxFkp;
|
|
20
|
+
interface PapxLookup extends PapxRecord {
|
|
21
|
+
/** The byte offset one past the end of the paragraph this record covers -- PapxFkp.rgfc[k + 1], the paragraph boundary [MS-DOC] 2.4.2 derives its own from. */
|
|
22
|
+
readonly fcLim: number;
|
|
23
|
+
}
|
|
24
|
+
declare class PropertyBinTable {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(wordDocument: Uint8Array, plc: Uint8Array, what: string);
|
|
27
|
+
/** The direct character-formatting grpprl covering `fc`, or undefined when the offset is outside the table or its run carries no exception. */
|
|
28
|
+
chpxGrpprl(fc: number): Uint8Array | undefined;
|
|
29
|
+
/** The direct paragraph-formatting record covering `fc`, or undefined when the offset is outside the table or its paragraph carries no exception. */
|
|
30
|
+
papx(fc: number): PapxLookup | undefined;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { PapxRecord as a, parsePapxFkp as c, PapxLookup as i, FKP_PAGE_SIZE as n, PropertyBinTable as o, PapxFkp as r, parseChpxFkp as s, ChpxFkp as t };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/prop/fkp.d.ts
|
|
2
|
+
/** Every FKP is exactly one 512-byte page, whatever the compound file's own sector size. */
|
|
3
|
+
declare const FKP_PAGE_SIZE = 512;
|
|
4
|
+
interface ChpxFkp {
|
|
5
|
+
readonly rgfc: readonly number[];
|
|
6
|
+
/** The Chpx's grpprl for run `index`, or undefined when the run's rgb entry is zero and it carries no exception. */
|
|
7
|
+
grpprl(index: number): Uint8Array | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface PapxRecord {
|
|
10
|
+
readonly istd: number;
|
|
11
|
+
readonly grpprl: Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
interface PapxFkp {
|
|
14
|
+
readonly rgfc: readonly number[];
|
|
15
|
+
/** The PapxInFkp for paragraph `index`, or undefined when its BxPap.bOffset is zero and the paragraph takes the defaults. */
|
|
16
|
+
papx(index: number): PapxRecord | undefined;
|
|
17
|
+
}
|
|
18
|
+
declare function parseChpxFkp(page: Uint8Array): ChpxFkp;
|
|
19
|
+
declare function parsePapxFkp(page: Uint8Array): PapxFkp;
|
|
20
|
+
interface PapxLookup extends PapxRecord {
|
|
21
|
+
/** The byte offset one past the end of the paragraph this record covers -- PapxFkp.rgfc[k + 1], the paragraph boundary [MS-DOC] 2.4.2 derives its own from. */
|
|
22
|
+
readonly fcLim: number;
|
|
23
|
+
}
|
|
24
|
+
declare class PropertyBinTable {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(wordDocument: Uint8Array, plc: Uint8Array, what: string);
|
|
27
|
+
/** The direct character-formatting grpprl covering `fc`, or undefined when the offset is outside the table or its run carries no exception. */
|
|
28
|
+
chpxGrpprl(fc: number): Uint8Array | undefined;
|
|
29
|
+
/** The direct paragraph-formatting record covering `fc`, or undefined when the offset is outside the table or its paragraph carries no exception. */
|
|
30
|
+
papx(fc: number): PapxLookup | undefined;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { PapxRecord as a, parsePapxFkp as c, PapxLookup as i, FKP_PAGE_SIZE as n, PropertyBinTable as o, PapxFkp as r, parseChpxFkp as s, ChpxFkp as t };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_subdocument = require("./subdocument.cjs");
|
|
3
|
+
const require_table_read = require("./table/read.cjs");
|
|
4
|
+
//#region src/headers-footers.ts
|
|
5
|
+
/** The six per-section slots' own order within each of Plcfhdd's per-section groups, [MS-DOC]'s own Headers page: "The stories within each group MUST appear in the following order." */
|
|
6
|
+
const SLOT_ORDER = [
|
|
7
|
+
"evenHeader",
|
|
8
|
+
"oddHeader",
|
|
9
|
+
"evenFooter",
|
|
10
|
+
"oddFooter",
|
|
11
|
+
"firstHeader",
|
|
12
|
+
"firstFooter"
|
|
13
|
+
];
|
|
14
|
+
/** The six fixed footnote/endnote-separator stories preceding every section's own six -- footnote separator, footnote continuation separator, footnote continuation notice, endnote separator, endnote continuation separator, endnote continuation notice -- carried by Plcfhdd but not read here, since neither this package's own schema nor ooxml.js's DocxDocument has anywhere to put a separator story. */
|
|
15
|
+
const FIXED_SEPARATOR_STORY_COUNT = 6;
|
|
16
|
+
function readHeaderFooterStories(wordDocument, table, pieceTable, context, fib, sectionCount) {
|
|
17
|
+
const headerStartCp = fib.ccpText + fib.ccpFtn;
|
|
18
|
+
const perSectionStories = require_subdocument.readSubdocumentStories(wordDocument, table, pieceTable, context, headerStartCp, fib.ccpHdd, fib.fcPlcfHdd, fib.lcbPlcfHdd, "Plcfhdd").slice(FIXED_SEPARATOR_STORY_COUNT);
|
|
19
|
+
const stories = [];
|
|
20
|
+
for (let section = 0; section < sectionCount; section += 1) for (let slotIndex = 0; slotIndex < SLOT_ORDER.length; slotIndex += 1) {
|
|
21
|
+
const entries = perSectionStories[section * SLOT_ORDER.length + slotIndex];
|
|
22
|
+
if (entries === void 0 || entries.length === 0) continue;
|
|
23
|
+
const slot = SLOT_ORDER[slotIndex];
|
|
24
|
+
if (slot === void 0) continue;
|
|
25
|
+
stories.push({
|
|
26
|
+
section,
|
|
27
|
+
slot,
|
|
28
|
+
blocks: require_table_read.assembleBlocks(entries)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return stories;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.readHeaderFooterStories = readHeaderFooterStories;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as Fib } from "./fib-6BFIx153.cjs";
|
|
2
|
+
import { n as ReadContext } from "./paragraphs-DQUp8_HB.cjs";
|
|
3
|
+
import { n as PieceTable } from "./piece-table-CA18mhjv.cjs";
|
|
4
|
+
import { ContentBlock } from "document-schema.js";
|
|
5
|
+
//#region src/headers-footers.d.ts
|
|
6
|
+
type HeaderFooterSlot = "evenHeader" | "oddHeader" | "evenFooter" | "oddFooter" | "firstHeader" | "firstFooter";
|
|
7
|
+
interface HeaderFooterStory {
|
|
8
|
+
/** The 0-based index into DocContent.sections this story belongs to. */
|
|
9
|
+
readonly section: number;
|
|
10
|
+
readonly slot: HeaderFooterSlot;
|
|
11
|
+
readonly blocks: readonly ContentBlock[];
|
|
12
|
+
}
|
|
13
|
+
type HeaderFooterStories = readonly HeaderFooterStory[];
|
|
14
|
+
declare function readHeaderFooterStories(wordDocument: Uint8Array, table: Uint8Array, pieceTable: PieceTable, context: ReadContext, fib: Fib, sectionCount: number): HeaderFooterStories;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { HeaderFooterSlot, HeaderFooterStories, HeaderFooterStory, readHeaderFooterStories };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as Fib } from "./fib-6BFIx153.js";
|
|
2
|
+
import { n as ReadContext } from "./paragraphs-s2lJ6w2I.js";
|
|
3
|
+
import { n as PieceTable } from "./piece-table-CA18mhjv.js";
|
|
4
|
+
import { ContentBlock } from "document-schema.js";
|
|
5
|
+
//#region src/headers-footers.d.ts
|
|
6
|
+
type HeaderFooterSlot = "evenHeader" | "oddHeader" | "evenFooter" | "oddFooter" | "firstHeader" | "firstFooter";
|
|
7
|
+
interface HeaderFooterStory {
|
|
8
|
+
/** The 0-based index into DocContent.sections this story belongs to. */
|
|
9
|
+
readonly section: number;
|
|
10
|
+
readonly slot: HeaderFooterSlot;
|
|
11
|
+
readonly blocks: readonly ContentBlock[];
|
|
12
|
+
}
|
|
13
|
+
type HeaderFooterStories = readonly HeaderFooterStory[];
|
|
14
|
+
declare function readHeaderFooterStories(wordDocument: Uint8Array, table: Uint8Array, pieceTable: PieceTable, context: ReadContext, fib: Fib, sectionCount: number): HeaderFooterStories;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { HeaderFooterSlot, HeaderFooterStories, HeaderFooterStory, readHeaderFooterStories };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { readSubdocumentStories } from "./subdocument.js";
|
|
2
|
+
import { assembleBlocks } from "./table/read.js";
|
|
3
|
+
//#region src/headers-footers.ts
|
|
4
|
+
/** The six per-section slots' own order within each of Plcfhdd's per-section groups, [MS-DOC]'s own Headers page: "The stories within each group MUST appear in the following order." */
|
|
5
|
+
const SLOT_ORDER = [
|
|
6
|
+
"evenHeader",
|
|
7
|
+
"oddHeader",
|
|
8
|
+
"evenFooter",
|
|
9
|
+
"oddFooter",
|
|
10
|
+
"firstHeader",
|
|
11
|
+
"firstFooter"
|
|
12
|
+
];
|
|
13
|
+
/** The six fixed footnote/endnote-separator stories preceding every section's own six -- footnote separator, footnote continuation separator, footnote continuation notice, endnote separator, endnote continuation separator, endnote continuation notice -- carried by Plcfhdd but not read here, since neither this package's own schema nor ooxml.js's DocxDocument has anywhere to put a separator story. */
|
|
14
|
+
const FIXED_SEPARATOR_STORY_COUNT = 6;
|
|
15
|
+
function readHeaderFooterStories(wordDocument, table, pieceTable, context, fib, sectionCount) {
|
|
16
|
+
const headerStartCp = fib.ccpText + fib.ccpFtn;
|
|
17
|
+
const perSectionStories = readSubdocumentStories(wordDocument, table, pieceTable, context, headerStartCp, fib.ccpHdd, fib.fcPlcfHdd, fib.lcbPlcfHdd, "Plcfhdd").slice(FIXED_SEPARATOR_STORY_COUNT);
|
|
18
|
+
const stories = [];
|
|
19
|
+
for (let section = 0; section < sectionCount; section += 1) for (let slotIndex = 0; slotIndex < SLOT_ORDER.length; slotIndex += 1) {
|
|
20
|
+
const entries = perSectionStories[section * SLOT_ORDER.length + slotIndex];
|
|
21
|
+
if (entries === void 0 || entries.length === 0) continue;
|
|
22
|
+
const slot = SLOT_ORDER[slotIndex];
|
|
23
|
+
if (slot === void 0) continue;
|
|
24
|
+
stories.push({
|
|
25
|
+
section,
|
|
26
|
+
slot,
|
|
27
|
+
blocks: assembleBlocks(entries)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return stories;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { readHeaderFooterStories };
|
package/dist/index.cjs
CHANGED
|
@@ -4,30 +4,35 @@ const require_bytes = require("./bytes.cjs");
|
|
|
4
4
|
const require_fib_offsets = require("./fib/offsets.cjs");
|
|
5
5
|
const require_detect = require("./detect.cjs");
|
|
6
6
|
const require_plc = require("./plc.cjs");
|
|
7
|
+
const require_prop_fkp = require("./prop/fkp.cjs");
|
|
8
|
+
const require_prop_sprm = require("./prop/sprm.cjs");
|
|
9
|
+
const require_prop_chp = require("./prop/chp.cjs");
|
|
10
|
+
const require_prop_pap = require("./prop/pap.cjs");
|
|
11
|
+
const require_style_stsh = require("./style/stsh.cjs");
|
|
12
|
+
const require_text_special = require("./text/special.cjs");
|
|
13
|
+
const require_text_paragraphs = require("./text/paragraphs.cjs");
|
|
14
|
+
const require_text_piece_table = require("./text/piece-table.cjs");
|
|
15
|
+
const require_text_characters = require("./text/characters.cjs");
|
|
16
|
+
const require_subdocument = require("./subdocument.cjs");
|
|
17
|
+
const require_headers_footers = require("./headers-footers.cjs");
|
|
7
18
|
const require_fib_fib = require("./fib/fib.cjs");
|
|
8
19
|
const require_fib_write = require("./fib/write.cjs");
|
|
9
20
|
const require_metadata = require("./metadata.cjs");
|
|
10
|
-
const require_text_piece_table = require("./text/piece-table.cjs");
|
|
11
21
|
const require_text_piece_table_write = require("./text/piece-table-write.cjs");
|
|
12
|
-
const require_text_characters = require("./text/characters.cjs");
|
|
13
|
-
const require_text_special = require("./text/special.cjs");
|
|
14
|
-
const require_prop_sprm = require("./prop/sprm.cjs");
|
|
15
|
-
const require_prop_fkp = require("./prop/fkp.cjs");
|
|
16
22
|
const require_prop_fkp_write = require("./prop/fkp-write.cjs");
|
|
17
|
-
const require_prop_chp = require("./prop/chp.cjs");
|
|
18
23
|
const require_prop_chp_write = require("./prop/chp-write.cjs");
|
|
19
|
-
const require_prop_pap = require("./prop/pap.cjs");
|
|
20
24
|
const require_prop_pap_write = require("./prop/pap-write.cjs");
|
|
21
25
|
const require_prop_sep = require("./prop/sep.cjs");
|
|
22
26
|
const require_prop_sep_write = require("./prop/sep-write.cjs");
|
|
23
|
-
const require_style_stsh = require("./style/stsh.cjs");
|
|
24
27
|
const require_style_fonts = require("./style/fonts.cjs");
|
|
25
28
|
const require_list_numbering = require("./list/numbering.cjs");
|
|
29
|
+
const require_notes = require("./notes.cjs");
|
|
26
30
|
const require_read = require("./read.cjs");
|
|
27
31
|
const require_write = require("./write.cjs");
|
|
28
32
|
exports.ANNOTATION_REFERENCE = require_text_special.ANNOTATION_REFERENCE;
|
|
29
33
|
exports.CELL_MARK = require_text_special.CELL_MARK;
|
|
30
34
|
exports.COMPRESSED_CHARACTER_MAP = require_text_characters.COMPRESSED_CHARACTER_MAP;
|
|
35
|
+
exports.DATA_STREAM = require_detect.DATA_STREAM;
|
|
31
36
|
exports.DRAWN_OBJECT = require_text_special.DRAWN_OBJECT;
|
|
32
37
|
exports.DocFormatError = require_errors.DocFormatError;
|
|
33
38
|
exports.DocUnsupportedError = require_errors.DocUnsupportedError;
|
|
@@ -99,18 +104,24 @@ exports.parsePapxFkp = require_prop_fkp.parsePapxFkp;
|
|
|
99
104
|
exports.parsePlc = require_plc.parsePlc;
|
|
100
105
|
exports.parseStsh = require_style_stsh.parseStsh;
|
|
101
106
|
exports.peekFibBaseFlags = require_fib_fib.peekFibBaseFlags;
|
|
107
|
+
exports.readAllSectionProperties = require_prop_sep.readAllSectionProperties;
|
|
102
108
|
exports.readDocContent = require_read.readDocContent;
|
|
103
109
|
exports.readDocStreams = require_read.readDocStreams;
|
|
104
110
|
exports.readGrpprl = require_prop_sprm.readGrpprl;
|
|
111
|
+
exports.readHeaderFooterStories = require_headers_footers.readHeaderFooterStories;
|
|
105
112
|
exports.readInt16LE = require_bytes.readInt16LE;
|
|
106
113
|
exports.readInt32LE = require_bytes.readInt32LE;
|
|
114
|
+
exports.readNoteBodies = require_notes.readNoteBodies;
|
|
107
115
|
exports.readNumberingDefinitions = require_list_numbering.readNumberingDefinitions;
|
|
108
|
-
exports.
|
|
116
|
+
exports.readParagraphs = require_text_paragraphs.readParagraphs;
|
|
117
|
+
exports.readSubdocumentStories = require_subdocument.readSubdocumentStories;
|
|
109
118
|
exports.readTextRange = require_text_characters.readTextRange;
|
|
110
119
|
exports.readUint16LE = require_bytes.readUint16LE;
|
|
111
120
|
exports.readUint32LE = require_bytes.readUint32LE;
|
|
112
121
|
exports.readUint8 = require_bytes.readUint8;
|
|
113
122
|
exports.resolveStyleFormatting = require_style_stsh.resolveStyleFormatting;
|
|
114
123
|
exports.slice = require_bytes.slice;
|
|
124
|
+
exports.splitEntriesByBoundaries = require_text_paragraphs.splitEntriesByBoundaries;
|
|
125
|
+
exports.storyText = require_subdocument.storyText;
|
|
115
126
|
exports.tableStreamName = require_fib_fib.tableStreamName;
|
|
116
127
|
exports.writeDocContent = require_write.writeDocContent;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { readInt16LE, readInt32LE, readUint16LE, readUint32LE, readUint8, slice } from "./bytes.cjs";
|
|
2
|
-
import { SUMMARY_INFORMATION_STREAM, WORD_DOCUMENT_STREAM, isDocBytes } from "./detect.cjs";
|
|
2
|
+
import { DATA_STREAM, SUMMARY_INFORMATION_STREAM, WORD_DOCUMENT_STREAM, isDocBytes } from "./detect.cjs";
|
|
3
3
|
import { DocFormatError, DocUnsupportedError } from "./errors.cjs";
|
|
4
|
-
import { i as tableStreamName, n as parseFib, r as peekFibBaseFlags, t as Fib } from "./fib-
|
|
4
|
+
import { i as tableStreamName, n as parseFib, r as peekFibBaseFlags, t as Fib } from "./fib-6BFIx153.cjs";
|
|
5
5
|
import { FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, LW_OFFSET } from "./fib/offsets.cjs";
|
|
6
6
|
import { FibWriteSpec, buildFib } from "./fib/write.cjs";
|
|
7
|
+
import { a as PapxRecord, c as parsePapxFkp, i as PapxLookup, n as FKP_PAGE_SIZE, o as PropertyBinTable, r as PapxFkp, s as parseChpxFkp, t as ChpxFkp } from "./fkp-I-laf-8y.cjs";
|
|
8
|
+
import { a as operandSize, i as decodeSprm, n as SGC, o as readGrpprl, r as Sprm, t as Prl } from "./sprm-DEyvdOo0.cjs";
|
|
9
|
+
import { n as applyCharacterSprms, r as characterIstdFromGrpprl, t as CharacterProperties } from "./chp-BpCqpb7V.cjs";
|
|
10
|
+
import { n as applyParagraphSprms, t as ParagraphProperties } from "./pap-BQ2E17K9.cjs";
|
|
11
|
+
import { a as StyleSheet, c as parseStsh, i as Style, l as resolveStyleFormatting, n as STI_USER_DEFINED, o as buildStshForStyles, r as STK, s as headingLevelFromIstd, t as ResolvedStyleFormatting } from "./stsh-CK59x6XG.cjs";
|
|
12
|
+
import { i as splitEntriesByBoundaries, n as ReadContext, r as readParagraphs, t as ParagraphEntry } from "./paragraphs-DQUp8_HB.cjs";
|
|
13
|
+
import { a as parseClx, i as characterSize, n as PieceTable, r as characterOffset, t as Piece } from "./piece-table-CA18mhjv.cjs";
|
|
14
|
+
import { HeaderFooterSlot, HeaderFooterStories, HeaderFooterStory, readHeaderFooterStories } from "./headers-footers.cjs";
|
|
7
15
|
import { Plc, findLargestAtMost, parsePlc } from "./plc.cjs";
|
|
8
16
|
import { layoutMetadataToSummaryInformation } from "./metadata.cjs";
|
|
9
|
-
import { Piece, PieceTable, characterOffset, characterSize, parseClx } from "./text/piece-table.cjs";
|
|
10
17
|
import { buildTextClx } from "./text/piece-table-write.cjs";
|
|
11
18
|
import { COMPRESSED_CHARACTER_MAP, TextRange, readTextRange } from "./text/characters.cjs";
|
|
12
19
|
import { ANNOTATION_REFERENCE, CELL_MARK, DRAWN_OBJECT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FOOTNOTE_REFERENCE, INLINE_PICTURE, LINE_BREAK, PARAGRAPH_MARK, SECTION_MARK, SYMBOL_ANCHOR, endsParagraph, isAnchorOnly } from "./text/special.cjs";
|
|
13
|
-
import { a as operandSize, i as decodeSprm, n as SGC, o as readGrpprl, r as Sprm, t as Prl } from "./sprm-DEyvdOo0.cjs";
|
|
14
|
-
import { ChpxFkp, FKP_PAGE_SIZE, PapxFkp, PapxLookup, PapxRecord, PropertyBinTable, parseChpxFkp, parsePapxFkp } from "./prop/fkp.cjs";
|
|
15
20
|
import { ChpxRunToWrite, PapxParagraphToWrite, buildChpxPages, buildPapxPages, buildPropertyBinTable, firstFcOfPage, fitsAloneOnPapxPage } from "./prop/fkp-write.cjs";
|
|
16
|
-
import { CharacterProperties, applyCharacterSprms, characterIstdFromGrpprl } from "./prop/chp.cjs";
|
|
17
21
|
import { encodeCharacterGrpprl } from "./prop/chp-write.cjs";
|
|
18
|
-
import { n as applyParagraphSprms, t as ParagraphProperties } from "./pap-BT1p0uzu.cjs";
|
|
19
22
|
import { encodeParagraphGrpprl } from "./prop/pap-write.cjs";
|
|
20
|
-
import { SectionProperties, applySectionSprms,
|
|
23
|
+
import { DocSectionProperties, SectionProperties, applySectionSprms, readAllSectionProperties } from "./prop/sep.cjs";
|
|
21
24
|
import { buildPlcfSed, buildSepx, encodeSectionGrpprl } from "./prop/sep-write.cjs";
|
|
22
|
-
import { ResolvedStyleFormatting, STI_USER_DEFINED, STK, Style, StyleSheet, buildStshForStyles, headingLevelFromIstd, parseStsh, resolveStyleFormatting } from "./style/stsh.cjs";
|
|
23
25
|
import { buildFontTable, parseFontTable } from "./style/fonts.cjs";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
+
import { NUMBER_FORMAT_BY_NFC, NumberingDefinition, NumberingDefinitions, NumberingLevel, readNumberingDefinitions } from "./list/numbering.cjs";
|
|
27
|
+
import { readSubdocumentStories, storyText } from "./subdocument.cjs";
|
|
28
|
+
import { Comment, Footnote, NoteBodies, readNoteBodies } from "./notes.cjs";
|
|
29
|
+
import { DocContent, DocStreams, readDocContent, readDocStreams } from "./read.cjs";
|
|
26
30
|
import { WriteDocContentOptions, writeDocContent } from "./write.cjs";
|
|
27
|
-
export { ANNOTATION_REFERENCE, CELL_MARK, COMPRESSED_CHARACTER_MAP, CharacterProperties, ChpxFkp, ChpxRunToWrite, DRAWN_OBJECT, DocContent, DocFormatError, DocStreams, DocUnsupportedError, FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FKP_PAGE_SIZE, FOOTNOTE_REFERENCE, Fib, FibWriteSpec, INLINE_PICTURE, LINE_BREAK, LW_OFFSET, NUMBER_FORMAT_BY_NFC, NumberingDefinition, NumberingDefinitions, NumberingLevel, PARAGRAPH_MARK, PapxFkp, PapxLookup, PapxParagraphToWrite, PapxRecord, ParagraphEntry, ParagraphProperties, Piece, PieceTable, Plc, Prl, PropertyBinTable, ResolvedStyleFormatting, SECTION_MARK, SGC, STI_USER_DEFINED, STK, SUMMARY_INFORMATION_STREAM, SYMBOL_ANCHOR, SectionProperties, Sprm, Style, StyleSheet, TextRange, WORD_DOCUMENT_STREAM, WriteDocContentOptions, applyCharacterSprms, applyParagraphSprms, applySectionSprms, buildChpxPages, buildFib, buildFontTable, buildPapxPages, buildPlcfSed, buildPropertyBinTable, buildSepx, buildStshForStyles, buildTextClx, characterIstdFromGrpprl, characterOffset, characterSize, decodeSprm, encodeCharacterGrpprl, encodeParagraphGrpprl, encodeSectionGrpprl, endsParagraph, findLargestAtMost, firstFcOfPage, fitsAloneOnPapxPage, headingLevelFromIstd, isAnchorOnly, isDocBytes, layoutMetadataToSummaryInformation, operandSize, parseChpxFkp, parseClx, parseFib, parseFontTable, parsePapxFkp, parsePlc, parseStsh, peekFibBaseFlags, readDocContent, readDocStreams, readGrpprl, readInt16LE, readInt32LE, readNumberingDefinitions,
|
|
31
|
+
export { ANNOTATION_REFERENCE, CELL_MARK, COMPRESSED_CHARACTER_MAP, CharacterProperties, ChpxFkp, ChpxRunToWrite, Comment, DATA_STREAM, DRAWN_OBJECT, DocContent, DocFormatError, DocSectionProperties, DocStreams, DocUnsupportedError, FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FKP_PAGE_SIZE, FOOTNOTE_REFERENCE, Fib, FibWriteSpec, Footnote, HeaderFooterSlot, HeaderFooterStories, HeaderFooterStory, INLINE_PICTURE, LINE_BREAK, LW_OFFSET, NUMBER_FORMAT_BY_NFC, NoteBodies, NumberingDefinition, NumberingDefinitions, NumberingLevel, PARAGRAPH_MARK, PapxFkp, PapxLookup, PapxParagraphToWrite, PapxRecord, ParagraphEntry, ParagraphProperties, Piece, PieceTable, Plc, Prl, PropertyBinTable, ReadContext, ResolvedStyleFormatting, SECTION_MARK, SGC, STI_USER_DEFINED, STK, SUMMARY_INFORMATION_STREAM, SYMBOL_ANCHOR, SectionProperties, Sprm, Style, StyleSheet, TextRange, WORD_DOCUMENT_STREAM, WriteDocContentOptions, applyCharacterSprms, applyParagraphSprms, applySectionSprms, buildChpxPages, buildFib, buildFontTable, buildPapxPages, buildPlcfSed, buildPropertyBinTable, buildSepx, buildStshForStyles, buildTextClx, characterIstdFromGrpprl, characterOffset, characterSize, decodeSprm, encodeCharacterGrpprl, encodeParagraphGrpprl, encodeSectionGrpprl, endsParagraph, findLargestAtMost, firstFcOfPage, fitsAloneOnPapxPage, headingLevelFromIstd, isAnchorOnly, isDocBytes, layoutMetadataToSummaryInformation, operandSize, parseChpxFkp, parseClx, parseFib, parseFontTable, parsePapxFkp, parsePlc, parseStsh, peekFibBaseFlags, readAllSectionProperties, readDocContent, readDocStreams, readGrpprl, readHeaderFooterStories, readInt16LE, readInt32LE, readNoteBodies, readNumberingDefinitions, readParagraphs, readSubdocumentStories, readTextRange, readUint16LE, readUint32LE, readUint8, resolveStyleFormatting, slice, splitEntriesByBoundaries, storyText, tableStreamName, writeDocContent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { readInt16LE, readInt32LE, readUint16LE, readUint32LE, readUint8, slice } from "./bytes.js";
|
|
2
|
-
import { SUMMARY_INFORMATION_STREAM, WORD_DOCUMENT_STREAM, isDocBytes } from "./detect.js";
|
|
2
|
+
import { DATA_STREAM, SUMMARY_INFORMATION_STREAM, WORD_DOCUMENT_STREAM, isDocBytes } from "./detect.js";
|
|
3
3
|
import { DocFormatError, DocUnsupportedError } from "./errors.js";
|
|
4
|
-
import { i as tableStreamName, n as parseFib, r as peekFibBaseFlags, t as Fib } from "./fib-
|
|
4
|
+
import { i as tableStreamName, n as parseFib, r as peekFibBaseFlags, t as Fib } from "./fib-6BFIx153.js";
|
|
5
5
|
import { FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, LW_OFFSET } from "./fib/offsets.js";
|
|
6
6
|
import { FibWriteSpec, buildFib } from "./fib/write.js";
|
|
7
|
+
import { a as PapxRecord, c as parsePapxFkp, i as PapxLookup, n as FKP_PAGE_SIZE, o as PropertyBinTable, r as PapxFkp, s as parseChpxFkp, t as ChpxFkp } from "./fkp-I-laf-8y.js";
|
|
8
|
+
import { a as operandSize, i as decodeSprm, n as SGC, o as readGrpprl, r as Sprm, t as Prl } from "./sprm-DEyvdOo0.js";
|
|
9
|
+
import { n as applyCharacterSprms, r as characterIstdFromGrpprl, t as CharacterProperties } from "./chp-B6AOh85P.js";
|
|
10
|
+
import { n as applyParagraphSprms, t as ParagraphProperties } from "./pap-iWFIpCdo.js";
|
|
11
|
+
import { a as StyleSheet, c as parseStsh, i as Style, l as resolveStyleFormatting, n as STI_USER_DEFINED, o as buildStshForStyles, r as STK, s as headingLevelFromIstd, t as ResolvedStyleFormatting } from "./stsh-Bj0YSEOp.js";
|
|
12
|
+
import { i as splitEntriesByBoundaries, n as ReadContext, r as readParagraphs, t as ParagraphEntry } from "./paragraphs-s2lJ6w2I.js";
|
|
13
|
+
import { a as parseClx, i as characterSize, n as PieceTable, r as characterOffset, t as Piece } from "./piece-table-CA18mhjv.js";
|
|
14
|
+
import { HeaderFooterSlot, HeaderFooterStories, HeaderFooterStory, readHeaderFooterStories } from "./headers-footers.js";
|
|
7
15
|
import { Plc, findLargestAtMost, parsePlc } from "./plc.js";
|
|
8
16
|
import { layoutMetadataToSummaryInformation } from "./metadata.js";
|
|
9
|
-
import { Piece, PieceTable, characterOffset, characterSize, parseClx } from "./text/piece-table.js";
|
|
10
17
|
import { buildTextClx } from "./text/piece-table-write.js";
|
|
11
18
|
import { COMPRESSED_CHARACTER_MAP, TextRange, readTextRange } from "./text/characters.js";
|
|
12
19
|
import { ANNOTATION_REFERENCE, CELL_MARK, DRAWN_OBJECT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FOOTNOTE_REFERENCE, INLINE_PICTURE, LINE_BREAK, PARAGRAPH_MARK, SECTION_MARK, SYMBOL_ANCHOR, endsParagraph, isAnchorOnly } from "./text/special.js";
|
|
13
|
-
import { a as operandSize, i as decodeSprm, n as SGC, o as readGrpprl, r as Sprm, t as Prl } from "./sprm-DEyvdOo0.js";
|
|
14
|
-
import { ChpxFkp, FKP_PAGE_SIZE, PapxFkp, PapxLookup, PapxRecord, PropertyBinTable, parseChpxFkp, parsePapxFkp } from "./prop/fkp.js";
|
|
15
20
|
import { ChpxRunToWrite, PapxParagraphToWrite, buildChpxPages, buildPapxPages, buildPropertyBinTable, firstFcOfPage, fitsAloneOnPapxPage } from "./prop/fkp-write.js";
|
|
16
|
-
import { CharacterProperties, applyCharacterSprms, characterIstdFromGrpprl } from "./prop/chp.js";
|
|
17
21
|
import { encodeCharacterGrpprl } from "./prop/chp-write.js";
|
|
18
|
-
import { n as applyParagraphSprms, t as ParagraphProperties } from "./pap-DOFLMWcG.js";
|
|
19
22
|
import { encodeParagraphGrpprl } from "./prop/pap-write.js";
|
|
20
|
-
import { SectionProperties, applySectionSprms,
|
|
23
|
+
import { DocSectionProperties, SectionProperties, applySectionSprms, readAllSectionProperties } from "./prop/sep.js";
|
|
21
24
|
import { buildPlcfSed, buildSepx, encodeSectionGrpprl } from "./prop/sep-write.js";
|
|
22
|
-
import { ResolvedStyleFormatting, STI_USER_DEFINED, STK, Style, StyleSheet, buildStshForStyles, headingLevelFromIstd, parseStsh, resolveStyleFormatting } from "./style/stsh.js";
|
|
23
25
|
import { buildFontTable, parseFontTable } from "./style/fonts.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
+
import { NUMBER_FORMAT_BY_NFC, NumberingDefinition, NumberingDefinitions, NumberingLevel, readNumberingDefinitions } from "./list/numbering.js";
|
|
27
|
+
import { readSubdocumentStories, storyText } from "./subdocument.js";
|
|
28
|
+
import { Comment, Footnote, NoteBodies, readNoteBodies } from "./notes.js";
|
|
29
|
+
import { DocContent, DocStreams, readDocContent, readDocStreams } from "./read.js";
|
|
26
30
|
import { WriteDocContentOptions, writeDocContent } from "./write.js";
|
|
27
|
-
export { ANNOTATION_REFERENCE, CELL_MARK, COMPRESSED_CHARACTER_MAP, CharacterProperties, ChpxFkp, ChpxRunToWrite, DRAWN_OBJECT, DocContent, DocFormatError, DocStreams, DocUnsupportedError, FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FKP_PAGE_SIZE, FOOTNOTE_REFERENCE, Fib, FibWriteSpec, INLINE_PICTURE, LINE_BREAK, LW_OFFSET, NUMBER_FORMAT_BY_NFC, NumberingDefinition, NumberingDefinitions, NumberingLevel, PARAGRAPH_MARK, PapxFkp, PapxLookup, PapxParagraphToWrite, PapxRecord, ParagraphEntry, ParagraphProperties, Piece, PieceTable, Plc, Prl, PropertyBinTable, ResolvedStyleFormatting, SECTION_MARK, SGC, STI_USER_DEFINED, STK, SUMMARY_INFORMATION_STREAM, SYMBOL_ANCHOR, SectionProperties, Sprm, Style, StyleSheet, TextRange, WORD_DOCUMENT_STREAM, WriteDocContentOptions, applyCharacterSprms, applyParagraphSprms, applySectionSprms, buildChpxPages, buildFib, buildFontTable, buildPapxPages, buildPlcfSed, buildPropertyBinTable, buildSepx, buildStshForStyles, buildTextClx, characterIstdFromGrpprl, characterOffset, characterSize, decodeSprm, encodeCharacterGrpprl, encodeParagraphGrpprl, encodeSectionGrpprl, endsParagraph, findLargestAtMost, firstFcOfPage, fitsAloneOnPapxPage, headingLevelFromIstd, isAnchorOnly, isDocBytes, layoutMetadataToSummaryInformation, operandSize, parseChpxFkp, parseClx, parseFib, parseFontTable, parsePapxFkp, parsePlc, parseStsh, peekFibBaseFlags, readDocContent, readDocStreams, readGrpprl, readInt16LE, readInt32LE, readNumberingDefinitions,
|
|
31
|
+
export { ANNOTATION_REFERENCE, CELL_MARK, COMPRESSED_CHARACTER_MAP, CharacterProperties, ChpxFkp, ChpxRunToWrite, Comment, DATA_STREAM, DRAWN_OBJECT, DocContent, DocFormatError, DocSectionProperties, DocStreams, DocUnsupportedError, FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FKP_PAGE_SIZE, FOOTNOTE_REFERENCE, Fib, FibWriteSpec, Footnote, HeaderFooterSlot, HeaderFooterStories, HeaderFooterStory, INLINE_PICTURE, LINE_BREAK, LW_OFFSET, NUMBER_FORMAT_BY_NFC, NoteBodies, NumberingDefinition, NumberingDefinitions, NumberingLevel, PARAGRAPH_MARK, PapxFkp, PapxLookup, PapxParagraphToWrite, PapxRecord, ParagraphEntry, ParagraphProperties, Piece, PieceTable, Plc, Prl, PropertyBinTable, ReadContext, ResolvedStyleFormatting, SECTION_MARK, SGC, STI_USER_DEFINED, STK, SUMMARY_INFORMATION_STREAM, SYMBOL_ANCHOR, SectionProperties, Sprm, Style, StyleSheet, TextRange, WORD_DOCUMENT_STREAM, WriteDocContentOptions, applyCharacterSprms, applyParagraphSprms, applySectionSprms, buildChpxPages, buildFib, buildFontTable, buildPapxPages, buildPlcfSed, buildPropertyBinTable, buildSepx, buildStshForStyles, buildTextClx, characterIstdFromGrpprl, characterOffset, characterSize, decodeSprm, encodeCharacterGrpprl, encodeParagraphGrpprl, encodeSectionGrpprl, endsParagraph, findLargestAtMost, firstFcOfPage, fitsAloneOnPapxPage, headingLevelFromIstd, isAnchorOnly, isDocBytes, layoutMetadataToSummaryInformation, operandSize, parseChpxFkp, parseClx, parseFib, parseFontTable, parsePapxFkp, parsePlc, parseStsh, peekFibBaseFlags, readAllSectionProperties, readDocContent, readDocStreams, readGrpprl, readHeaderFooterStories, readInt16LE, readInt32LE, readNoteBodies, readNumberingDefinitions, readParagraphs, readSubdocumentStories, readTextRange, readUint16LE, readUint32LE, readUint8, resolveStyleFormatting, slice, splitEntriesByBoundaries, storyText, tableStreamName, writeDocContent };
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { DocFormatError, DocUnsupportedError } from "./errors.js";
|
|
2
2
|
import { readInt16LE, readInt32LE, readUint16LE, readUint32LE, readUint8, slice } from "./bytes.js";
|
|
3
3
|
import { FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, LW_OFFSET } from "./fib/offsets.js";
|
|
4
|
-
import { SUMMARY_INFORMATION_STREAM, WORD_DOCUMENT_STREAM, isDocBytes } from "./detect.js";
|
|
4
|
+
import { DATA_STREAM, SUMMARY_INFORMATION_STREAM, WORD_DOCUMENT_STREAM, isDocBytes } from "./detect.js";
|
|
5
5
|
import { findLargestAtMost, parsePlc } from "./plc.js";
|
|
6
|
+
import { FKP_PAGE_SIZE, PropertyBinTable, parseChpxFkp, parsePapxFkp } from "./prop/fkp.js";
|
|
7
|
+
import { SGC, decodeSprm, operandSize, readGrpprl } from "./prop/sprm.js";
|
|
8
|
+
import { applyCharacterSprms, characterIstdFromGrpprl } from "./prop/chp.js";
|
|
9
|
+
import { applyParagraphSprms } from "./prop/pap.js";
|
|
10
|
+
import { STI_USER_DEFINED, STK, buildStshForStyles, headingLevelFromIstd, parseStsh, resolveStyleFormatting } from "./style/stsh.js";
|
|
11
|
+
import { ANNOTATION_REFERENCE, CELL_MARK, DRAWN_OBJECT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FOOTNOTE_REFERENCE, INLINE_PICTURE, LINE_BREAK, PARAGRAPH_MARK, SECTION_MARK, SYMBOL_ANCHOR, endsParagraph, isAnchorOnly } from "./text/special.js";
|
|
12
|
+
import { readParagraphs, splitEntriesByBoundaries } from "./text/paragraphs.js";
|
|
13
|
+
import { characterOffset, characterSize, parseClx } from "./text/piece-table.js";
|
|
14
|
+
import { COMPRESSED_CHARACTER_MAP, readTextRange } from "./text/characters.js";
|
|
15
|
+
import { readSubdocumentStories, storyText } from "./subdocument.js";
|
|
16
|
+
import { readHeaderFooterStories } from "./headers-footers.js";
|
|
6
17
|
import { parseFib, peekFibBaseFlags, tableStreamName } from "./fib/fib.js";
|
|
7
18
|
import { buildFib } from "./fib/write.js";
|
|
8
19
|
import { layoutMetadataToSummaryInformation } from "./metadata.js";
|
|
9
|
-
import { characterOffset, characterSize, parseClx } from "./text/piece-table.js";
|
|
10
20
|
import { buildTextClx } from "./text/piece-table-write.js";
|
|
11
|
-
import { COMPRESSED_CHARACTER_MAP, readTextRange } from "./text/characters.js";
|
|
12
|
-
import { ANNOTATION_REFERENCE, CELL_MARK, DRAWN_OBJECT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FOOTNOTE_REFERENCE, INLINE_PICTURE, LINE_BREAK, PARAGRAPH_MARK, SECTION_MARK, SYMBOL_ANCHOR, endsParagraph, isAnchorOnly } from "./text/special.js";
|
|
13
|
-
import { SGC, decodeSprm, operandSize, readGrpprl } from "./prop/sprm.js";
|
|
14
|
-
import { FKP_PAGE_SIZE, PropertyBinTable, parseChpxFkp, parsePapxFkp } from "./prop/fkp.js";
|
|
15
21
|
import { buildChpxPages, buildPapxPages, buildPropertyBinTable, firstFcOfPage, fitsAloneOnPapxPage } from "./prop/fkp-write.js";
|
|
16
|
-
import { applyCharacterSprms, characterIstdFromGrpprl } from "./prop/chp.js";
|
|
17
22
|
import { encodeCharacterGrpprl } from "./prop/chp-write.js";
|
|
18
|
-
import { applyParagraphSprms } from "./prop/pap.js";
|
|
19
23
|
import { encodeParagraphGrpprl } from "./prop/pap-write.js";
|
|
20
|
-
import { applySectionSprms,
|
|
24
|
+
import { applySectionSprms, readAllSectionProperties } from "./prop/sep.js";
|
|
21
25
|
import { buildPlcfSed, buildSepx, encodeSectionGrpprl } from "./prop/sep-write.js";
|
|
22
|
-
import { STI_USER_DEFINED, STK, buildStshForStyles, headingLevelFromIstd, parseStsh, resolveStyleFormatting } from "./style/stsh.js";
|
|
23
26
|
import { buildFontTable, parseFontTable } from "./style/fonts.js";
|
|
24
27
|
import { NUMBER_FORMAT_BY_NFC, readNumberingDefinitions } from "./list/numbering.js";
|
|
28
|
+
import { readNoteBodies } from "./notes.js";
|
|
25
29
|
import { readDocContent, readDocStreams } from "./read.js";
|
|
26
30
|
import { writeDocContent } from "./write.js";
|
|
27
|
-
export { ANNOTATION_REFERENCE, CELL_MARK, COMPRESSED_CHARACTER_MAP, DRAWN_OBJECT, DocFormatError, DocUnsupportedError, FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FKP_PAGE_SIZE, FOOTNOTE_REFERENCE, INLINE_PICTURE, LINE_BREAK, LW_OFFSET, NUMBER_FORMAT_BY_NFC, PARAGRAPH_MARK, PropertyBinTable, SECTION_MARK, SGC, STI_USER_DEFINED, STK, SUMMARY_INFORMATION_STREAM, SYMBOL_ANCHOR, WORD_DOCUMENT_STREAM, applyCharacterSprms, applyParagraphSprms, applySectionSprms, buildChpxPages, buildFib, buildFontTable, buildPapxPages, buildPlcfSed, buildPropertyBinTable, buildSepx, buildStshForStyles, buildTextClx, characterIstdFromGrpprl, characterOffset, characterSize, decodeSprm, encodeCharacterGrpprl, encodeParagraphGrpprl, encodeSectionGrpprl, endsParagraph, findLargestAtMost, firstFcOfPage, fitsAloneOnPapxPage, headingLevelFromIstd, isAnchorOnly, isDocBytes, layoutMetadataToSummaryInformation, operandSize, parseChpxFkp, parseClx, parseFib, parseFontTable, parsePapxFkp, parsePlc, parseStsh, peekFibBaseFlags, readDocContent, readDocStreams, readGrpprl, readInt16LE, readInt32LE, readNumberingDefinitions,
|
|
31
|
+
export { ANNOTATION_REFERENCE, CELL_MARK, COMPRESSED_CHARACTER_MAP, DATA_STREAM, DRAWN_OBJECT, DocFormatError, DocUnsupportedError, FC_LCB_VALUE_INDEX, FIB_BASE_FLAG, FIB_BASE_SIZE, FIB_CB_RG_FC_LCB_OFFSET, FIB_CSLW_OFFSET, FIB_CSLW_REQUIRED, FIB_CSW_REQUIRED, FIB_FC_LCB_BLOB_OFFSET, FIB_LKEY_OFFSET, FIB_RG_LW_OFFSET, FIB_RG_LW_SIZE, FIB_RG_W_OFFSET, FIB_RG_W_SIZE, FIB_W_IDENT, FIELD_BEGIN, FIELD_END, FIELD_SEPARATOR, FKP_PAGE_SIZE, FOOTNOTE_REFERENCE, INLINE_PICTURE, LINE_BREAK, LW_OFFSET, NUMBER_FORMAT_BY_NFC, PARAGRAPH_MARK, PropertyBinTable, SECTION_MARK, SGC, STI_USER_DEFINED, STK, SUMMARY_INFORMATION_STREAM, SYMBOL_ANCHOR, WORD_DOCUMENT_STREAM, applyCharacterSprms, applyParagraphSprms, applySectionSprms, buildChpxPages, buildFib, buildFontTable, buildPapxPages, buildPlcfSed, buildPropertyBinTable, buildSepx, buildStshForStyles, buildTextClx, characterIstdFromGrpprl, characterOffset, characterSize, decodeSprm, encodeCharacterGrpprl, encodeParagraphGrpprl, encodeSectionGrpprl, endsParagraph, findLargestAtMost, firstFcOfPage, fitsAloneOnPapxPage, headingLevelFromIstd, isAnchorOnly, isDocBytes, layoutMetadataToSummaryInformation, operandSize, parseChpxFkp, parseClx, parseFib, parseFontTable, parsePapxFkp, parsePlc, parseStsh, peekFibBaseFlags, readAllSectionProperties, readDocContent, readDocStreams, readGrpprl, readHeaderFooterStories, readInt16LE, readInt32LE, readNoteBodies, readNumberingDefinitions, readParagraphs, readSubdocumentStories, readTextRange, readUint16LE, readUint32LE, readUint8, resolveStyleFormatting, slice, splitEntriesByBoundaries, storyText, tableStreamName, writeDocContent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberingDefinitions } from "./numbering.cjs";
|
|
2
2
|
import { ContentListMembership } from "document-schema.js";
|
|
3
3
|
//#region src/list/numbering-write.d.ts
|
|
4
4
|
/** One document's own numbering, gathered from every paragraph's list membership (the caller passes the already-flattened sequence, table cells included, so a list used only inside a table cell is still resolved). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberingDefinitions } from "./numbering.js";
|
|
2
2
|
import { ContentListMembership } from "document-schema.js";
|
|
3
3
|
//#region src/list/numbering-write.d.ts
|
|
4
4
|
/** One document's own numbering, gathered from every paragraph's list membership (the caller passes the already-flattened sequence, table cells included, so a list used only inside a table cell is still resolved). */
|
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as Fib } from "../fib-6BFIx153.cjs";
|
|
2
|
+
//#region src/list/numbering.d.ts
|
|
3
|
+
/** MSONFC ([MS-OSHARED] 2.2.1.3), mapped to its own documented ST_NumberFormat equivalent -- the identical vocabulary ooxml.js's NumberingLevel.format carries verbatim from word/numbering.xml's own w:numFmt/@w:val. Every member through msonfcUCRus (0x3B) is a real numbered/lettered/ideograph format; 0x17 (msonfcBullet) is handled separately below since PlfLfo also treats it as the "no number sequence, but has bullets" case LVLF's own field text calls out by name. */
|
|
4
|
+
declare const NUMBER_FORMAT_BY_NFC: Readonly<Record<number, string>>;
|
|
5
|
+
interface NumberingLevel {
|
|
6
|
+
/** The ST_NumberFormat-equivalent string MSONFC's own value maps to ("decimal", "upperRoman", "bullet", ...), or "none" for a level with no number sequence at all ([MS-DOC] 2.9.150's own nfc field text: "If this is equal to 0xFF..., this level does not have a number sequence"). */
|
|
7
|
+
readonly format: string;
|
|
8
|
+
/** The level's own text template: a placeholder pattern like '%1.' or '%2)' for a numbered format (the digit names which zero-based level's own counter substitutes at that position, one-based in the placeholder itself) -- the identical convention ooxml.js's own NumberingLevel.text carries verbatim from w:lvlText/@w:val -- or a literal bullet glyph string for format 'bullet'. Decoded from the level's own Xst (a raw UTF-16 string) plus its rgbxchNums array, which names which character POSITIONS in that string are placeholders rather than literal text -- see readLevelText below. */
|
|
9
|
+
readonly text: string;
|
|
10
|
+
/** iStartAt: the value this level's counter begins from. Meaningless (and not read as anything but 1) for a level with no number sequence. */
|
|
11
|
+
readonly startAt: number;
|
|
12
|
+
/** ilvlRestartLim ([MS-DOC] 2.9.150), only when fNoRestart is set: the first (most-significant) zero-based level after which this level's own number sequence does NOT restart. Absent (undefined) is the spec's own default behaviour -- "restarts when a more significant level is encountered" -- not "never restarts". */
|
|
13
|
+
readonly restart?: number;
|
|
14
|
+
}
|
|
15
|
+
interface NumberingDefinition {
|
|
16
|
+
/** Keyed by the level's own zero-based ilvl, stringified -- the identical zero-based numbering ContentListMembership.level already uses, so `definitions[membership.numId]?.levels[String(membership.level)]` is the direct lookup path from a paragraph's own membership to its rendering definition. A record rather than a fixed-length array/tuple: a simple (fSimpleList) LSTF states only level 0. */
|
|
17
|
+
readonly levels: Readonly<Record<string, NumberingLevel>>;
|
|
18
|
+
}
|
|
19
|
+
/** Keyed by a paragraph's own listId (ContentListMembership.numId, stringified) -- prop/pap.ts's own sprmPIlfo, a one-based index into PlfLfo.rgLfo. */
|
|
20
|
+
type NumberingDefinitions = Readonly<Record<string, NumberingDefinition>>;
|
|
21
|
+
/** Resolves PlfLst and PlfLfo into NumberingDefinitions, keyed by the one-based ilfo every listId already is (prop/pap.ts's own Math.abs(ilfo)) -- absent entirely when the file carries neither (fcPlfLst/fcPlfLfo both 0, a document with no lists at all, the common case this reader must not fail on). */
|
|
22
|
+
declare function readNumberingDefinitions(table: Uint8Array, fib: Fib): NumberingDefinitions;
|
|
23
|
+
//#endregion
|
|
2
24
|
export { NUMBER_FORMAT_BY_NFC, NumberingDefinition, NumberingDefinitions, NumberingLevel, readNumberingDefinitions };
|