reamkit 1.15.4 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/core/converter/facade.d.ts +5 -0
- package/dist/esm/core/converter/ream.d.ts +6 -0
- package/dist/esm/core/converter/ream.js +34 -8
- package/dist/esm/core/document-model/index.d.ts +1 -1
- package/dist/esm/core/document-model/types.d.ts +187 -1
- package/dist/esm/core/drawingml/chart-geometry.d.ts +28 -0
- package/dist/esm/core/drawingml/chart-geometry.js +371 -88
- package/dist/esm/core/drawingml/chart-parser.js +262 -11
- package/dist/esm/core/drawingml/colors.d.ts +6 -6
- package/dist/esm/core/drawingml/colors.js +58 -18
- package/dist/esm/core/drawingml/preset-geometry.js +7 -6
- package/dist/esm/core/drawingml/sparkline-geometry.js +6 -4
- package/dist/esm/core/drawingml/theme-parser.d.ts +41 -0
- package/dist/esm/core/drawingml/theme-parser.js +74 -1
- package/dist/esm/core/font/ttf-subset.js +26 -1
- package/dist/esm/core/images.js +172 -43
- package/dist/esm/core/indexed-colors.d.ts +11 -0
- package/dist/esm/core/indexed-colors.js +81 -0
- package/dist/esm/core/ir/sheet.d.ts +61 -0
- package/dist/esm/{excel → core}/number-format.d.ts +37 -0
- package/dist/esm/core/number-format.js +800 -0
- package/dist/esm/core/opc/alternate-content.d.ts +13 -0
- package/dist/esm/core/opc/alternate-content.js +72 -0
- package/dist/esm/core/opc/core-properties.js +1 -0
- package/dist/esm/core/opc/package.d.ts +14 -1
- package/dist/esm/core/opc/package.js +43 -4
- package/dist/esm/core/opc/relationships.js +1 -0
- package/dist/esm/core/opc/xml-entities.d.ts +12 -0
- package/dist/esm/core/opc/xml-entities.js +91 -0
- package/dist/esm/core/spreadsheet-model/index.d.ts +1 -1
- package/dist/esm/core/spreadsheet-model/types.d.ts +137 -0
- package/dist/esm/core/vector.d.ts +13 -0
- package/dist/esm/excel/activex-parser.js +1 -0
- package/dist/esm/excel/column-bands.d.ts +26 -1
- package/dist/esm/excel/column-bands.js +156 -20
- package/dist/esm/excel/comments-parser.js +5 -3
- package/dist/esm/excel/conditional-format.d.ts +25 -2
- package/dist/esm/excel/conditional-format.js +63 -19
- package/dist/esm/excel/escaped-text.d.ts +9 -0
- package/dist/esm/excel/escaped-text.js +20 -0
- package/dist/esm/excel/form-control-parser.js +1 -0
- package/dist/esm/excel/formula/dates.js +1 -1
- package/dist/esm/excel/header-footer.d.ts +9 -1
- package/dist/esm/excel/header-footer.js +162 -14
- package/dist/esm/excel/index.d.ts +1 -1
- package/dist/esm/excel/index.js +2 -2
- package/dist/esm/excel/pivot-table-parser.js +1 -0
- package/dist/esm/excel/print-model.d.ts +75 -0
- package/dist/esm/excel/print-model.js +898 -76
- package/dist/esm/excel/printer-settings.d.ts +16 -0
- package/dist/esm/excel/printer-settings.js +36 -0
- package/dist/esm/excel/rich-value.d.ts +13 -0
- package/dist/esm/excel/rich-value.js +120 -0
- package/dist/esm/excel/shared-strings-parser.js +11 -7
- package/dist/esm/excel/sheet-drawing.d.ts +11 -0
- package/dist/esm/excel/sheet-drawing.js +26 -3
- package/dist/esm/excel/sheet-shape-parser.d.ts +53 -1
- package/dist/esm/excel/sheet-shape-parser.js +461 -32
- package/dist/esm/excel/sheet-to-flow.d.ts +23 -2
- package/dist/esm/excel/sheet-to-flow.js +551 -36
- package/dist/esm/excel/slicer-parser.js +1 -0
- package/dist/esm/excel/styles-parser.d.ts +30 -2
- package/dist/esm/excel/styles-parser.js +177 -40
- package/dist/esm/excel/table-parser.js +1 -0
- package/dist/esm/excel/vml-drawing.d.ts +68 -0
- package/dist/esm/excel/vml-drawing.js +158 -0
- package/dist/esm/excel/workbook-parser.d.ts +5 -0
- package/dist/esm/excel/workbook-parser.js +5 -1
- package/dist/esm/excel/worksheet-parser.d.ts +2 -1
- package/dist/esm/excel/worksheet-parser.js +150 -61
- package/dist/esm/excel/xlsx-reader.js +242 -11
- package/dist/esm/excel/xlsx-to-pdf.js +12 -1
- package/dist/esm/html/html-writer.js +11 -2
- package/dist/esm/layout/page-doc.d.ts +26 -0
- package/dist/esm/layout/styled-layout.d.ts +2 -0
- package/dist/esm/layout/styled-layout.js +493 -64
- package/dist/esm/pdf/cid-font.js +20 -9
- package/dist/esm/pdf/objects.d.ts +13 -0
- package/dist/esm/pdf/objects.js +18 -1
- package/dist/esm/pdf/styled-page-emitter.js +164 -32
- package/dist/esm/pdf/text-page-renderer.js +1 -0
- package/dist/esm/pdf/vector-graphics.d.ts +3 -1
- package/dist/esm/pdf/vector-graphics.js +19 -2
- package/dist/esm/pptx/pptx-reader.js +1 -0
- package/dist/esm/pptx/slide-parser.js +12 -1
- package/dist/esm/svg/svg-writer.js +23 -4
- package/dist/esm/word/document-parser.js +1 -0
- package/dist/esm/word/drawing-parser.d.ts +34 -1
- package/dist/esm/word/drawing-parser.js +52 -2
- package/dist/esm/word/numbering-parser.js +1 -0
- package/dist/esm/word/settings-parser.js +1 -0
- package/dist/esm/word/styles-parser.js +1 -0
- package/package.json +7 -3
- package/dist/esm/excel/number-format.js +0 -476
|
@@ -1,4 +1,38 @@
|
|
|
1
|
+
import { pt } from "../core/ir/units.js";
|
|
1
2
|
//#region src/excel/header-footer.ts
|
|
3
|
+
var HEADER_THEME_SLOTS = [
|
|
4
|
+
"lt1",
|
|
5
|
+
"dk1",
|
|
6
|
+
"lt2",
|
|
7
|
+
"dk2",
|
|
8
|
+
"accent1",
|
|
9
|
+
"accent2",
|
|
10
|
+
"accent3",
|
|
11
|
+
"accent4",
|
|
12
|
+
"accent5",
|
|
13
|
+
"accent6",
|
|
14
|
+
"hlink",
|
|
15
|
+
"folHlink"
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Lighten or darken a theme colour by a header/footer tint (§18.3.1.55): the
|
|
19
|
+
* value is a fraction of the way to white, or to black when the sign is minus.
|
|
20
|
+
*
|
|
21
|
+
* @param hex The theme colour, RRGGBB.
|
|
22
|
+
* @param amount 0..1.
|
|
23
|
+
* @param darken True for a `-` sign.
|
|
24
|
+
* @returns The tinted colour, RRGGBB.
|
|
25
|
+
*/
|
|
26
|
+
function applyHeaderTint(hex, amount, darken) {
|
|
27
|
+
if (!(amount > 0)) return hex.toUpperCase();
|
|
28
|
+
const n = parseInt(hex, 16);
|
|
29
|
+
const mix = (c) => darken ? Math.round(c * (1 - amount)) : Math.round(c + (255 - c) * amount);
|
|
30
|
+
return [
|
|
31
|
+
mix(n >> 16 & 255),
|
|
32
|
+
mix(n >> 8 & 255),
|
|
33
|
+
mix(n & 255)
|
|
34
|
+
].map((c) => c.toString(16).padStart(2, "0")).join("").toUpperCase();
|
|
35
|
+
}
|
|
2
36
|
/**
|
|
3
37
|
* Expand a print header/footer `&`-code string (E-SHEET W4) into header/footer band
|
|
4
38
|
* content — one aligned paragraph per non-empty left/centre/right region — or `[]`
|
|
@@ -7,16 +41,24 @@
|
|
|
7
41
|
*
|
|
8
42
|
* @param formatString The raw `&`-code format string.
|
|
9
43
|
* @param sheetName The worksheet tab name, substituted for `&A`.
|
|
44
|
+
* @param scale The sheet's print scale.
|
|
45
|
+
* @param basePt The default header font size.
|
|
46
|
+
* @param fileName The workbook's file name, substituted for `&F`. A
|
|
47
|
+
* byte-oriented API does not know it, so the caller supplies
|
|
48
|
+
* it; absent, `&F` is dropped as before.
|
|
49
|
+
* @param themePalette The workbook theme, resolving a `&K` theme reference.
|
|
50
|
+
* @param now The reference date `&D`/`&T` print. An explicit input,
|
|
51
|
+
* never the wall clock; absent, both are dropped as before.
|
|
10
52
|
*/
|
|
11
|
-
function buildHeaderFooterContent(formatString, sheetName) {
|
|
12
|
-
const regions = parseHeaderFooterString(formatString, sheetName);
|
|
53
|
+
function buildHeaderFooterContent(formatString, sheetName, scale = 1, basePt = DEFAULT_HEADER_PT, fileName, themePalette, now) {
|
|
54
|
+
const regions = parseHeaderFooterString(formatString, sheetName, scale, basePt, fileName, themePalette, now);
|
|
13
55
|
const out = [];
|
|
14
56
|
const para = (runs, alignment) => {
|
|
15
|
-
if (
|
|
57
|
+
for (const line of splitLines(runs)) if (line.length > 0) out.push({
|
|
16
58
|
kind: "paragraph",
|
|
17
59
|
paragraph: {
|
|
18
60
|
properties: { alignment },
|
|
19
|
-
runs:
|
|
61
|
+
runs: line
|
|
20
62
|
}
|
|
21
63
|
});
|
|
22
64
|
};
|
|
@@ -25,7 +67,34 @@ function buildHeaderFooterContent(formatString, sheetName) {
|
|
|
25
67
|
para(regions.right, "right");
|
|
26
68
|
return out;
|
|
27
69
|
}
|
|
28
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Break a region's runs at the line breaks Excel allows inside one — a header
|
|
72
|
+
* region is not necessarily one line.
|
|
73
|
+
*
|
|
74
|
+
* The break is a literal CR/LF in the format string, not a `&`-code, so it
|
|
75
|
+
* arrives as text. Left as text it is drawn: tdf58243.xlsx puts a CR LF in the
|
|
76
|
+
* middle of its centre header and we rendered the carriage return as a missing
|
|
77
|
+
* glyph — a tofu box mid-title — with the rest of the title running on after it
|
|
78
|
+
* where every other reader starts a second line.
|
|
79
|
+
*/
|
|
80
|
+
function splitLines(runs) {
|
|
81
|
+
const lines = [[]];
|
|
82
|
+
for (const run of runs) {
|
|
83
|
+
const parts = run.text.split(/\r\n|\r|\n/);
|
|
84
|
+
for (let i = 0; i < parts.length; i++) {
|
|
85
|
+
if (i > 0) lines.push([]);
|
|
86
|
+
const text = parts[i];
|
|
87
|
+
if (text.length > 0) lines[lines.length - 1].push({
|
|
88
|
+
...run,
|
|
89
|
+
text
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return lines;
|
|
94
|
+
}
|
|
95
|
+
/** The point size a header run takes when it names none — the layout's own. */
|
|
96
|
+
var DEFAULT_HEADER_PT = 11;
|
|
97
|
+
function parseHeaderFooterString(s, sheetName, scale, basePt, fileName, themePalette, now) {
|
|
29
98
|
const regions = {
|
|
30
99
|
left: [],
|
|
31
100
|
center: [],
|
|
@@ -34,11 +103,22 @@ function parseHeaderFooterString(s, sheetName) {
|
|
|
34
103
|
let current = regions.center;
|
|
35
104
|
let bold = false;
|
|
36
105
|
let italic = false;
|
|
106
|
+
let underline = false;
|
|
107
|
+
let strike = false;
|
|
108
|
+
let sizePt;
|
|
109
|
+
let colorHex;
|
|
37
110
|
let buf = "";
|
|
38
|
-
const runProps = () =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
111
|
+
const runProps = () => {
|
|
112
|
+
const effectivePt = (sizePt ?? basePt) * scale;
|
|
113
|
+
return {
|
|
114
|
+
...bold ? { bold: true } : {},
|
|
115
|
+
...italic ? { italic: true } : {},
|
|
116
|
+
...underline ? { underline: "single" } : {},
|
|
117
|
+
...strike ? { strike: true } : {},
|
|
118
|
+
...effectivePt !== DEFAULT_HEADER_PT ? { fontSizePt: pt(effectivePt) } : {},
|
|
119
|
+
...colorHex !== void 0 ? { colorHex } : {}
|
|
120
|
+
};
|
|
121
|
+
};
|
|
42
122
|
const flush = () => {
|
|
43
123
|
if (buf.length > 0) {
|
|
44
124
|
current.push({
|
|
@@ -77,6 +157,12 @@ function parseHeaderFooterString(s, sheetName) {
|
|
|
77
157
|
if (next === "L" || next === "C" || next === "R") {
|
|
78
158
|
flush();
|
|
79
159
|
current = next === "L" ? regions.left : next === "R" ? regions.right : regions.center;
|
|
160
|
+
bold = false;
|
|
161
|
+
italic = false;
|
|
162
|
+
underline = false;
|
|
163
|
+
strike = false;
|
|
164
|
+
sizePt = void 0;
|
|
165
|
+
colorHex = void 0;
|
|
80
166
|
i += 2;
|
|
81
167
|
continue;
|
|
82
168
|
}
|
|
@@ -107,24 +193,78 @@ function parseHeaderFooterString(s, sheetName) {
|
|
|
107
193
|
i += 2;
|
|
108
194
|
continue;
|
|
109
195
|
}
|
|
196
|
+
if (next === "U") {
|
|
197
|
+
flush();
|
|
198
|
+
underline = !underline;
|
|
199
|
+
i += 2;
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (next === "S") {
|
|
203
|
+
flush();
|
|
204
|
+
strike = !strike;
|
|
205
|
+
i += 2;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
110
208
|
if (next === "K") {
|
|
111
209
|
i += 2;
|
|
112
|
-
|
|
113
|
-
|
|
210
|
+
const themed = /^(\d\d)([+-])(\d\d\d)/.exec(s.slice(i));
|
|
211
|
+
if (themed) {
|
|
212
|
+
i += themed[0].length;
|
|
213
|
+
const slot = HEADER_THEME_SLOTS[Number(themed[1])];
|
|
214
|
+
const base = slot ? themePalette?.get(slot) : void 0;
|
|
215
|
+
flush();
|
|
216
|
+
colorHex = base ? applyHeaderTint(base, Number(themed[3]) / 1e3, themed[2] === "-") : void 0;
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
let hex = "";
|
|
220
|
+
while (hex.length < 6 && i < s.length && /[0-9A-Fa-f]/.test(s[i])) {
|
|
221
|
+
hex += s[i];
|
|
114
222
|
i++;
|
|
115
|
-
|
|
223
|
+
}
|
|
224
|
+
if (hex.length === 6) {
|
|
225
|
+
flush();
|
|
226
|
+
colorHex = hex.toUpperCase();
|
|
116
227
|
}
|
|
117
228
|
continue;
|
|
118
229
|
}
|
|
119
230
|
if (next === "\"") {
|
|
120
231
|
i += 2;
|
|
121
|
-
|
|
232
|
+
let spec = "";
|
|
233
|
+
while (i < s.length && s[i] !== "\"") {
|
|
234
|
+
spec += s[i];
|
|
235
|
+
i++;
|
|
236
|
+
}
|
|
122
237
|
if (i < s.length) i++;
|
|
238
|
+
const style = (spec.split(",")[1] ?? "").toLowerCase();
|
|
239
|
+
if (style.length > 0) {
|
|
240
|
+
flush();
|
|
241
|
+
bold = style.includes("bold");
|
|
242
|
+
italic = style.includes("italic") || style.includes("oblique");
|
|
243
|
+
}
|
|
123
244
|
continue;
|
|
124
245
|
}
|
|
125
246
|
if (next >= "0" && next <= "9") {
|
|
126
247
|
i += 1;
|
|
127
|
-
|
|
248
|
+
let digits = "";
|
|
249
|
+
while (i < s.length && s[i] >= "0" && s[i] <= "9") {
|
|
250
|
+
digits += s[i];
|
|
251
|
+
i++;
|
|
252
|
+
}
|
|
253
|
+
const n = Number(digits);
|
|
254
|
+
if (Number.isFinite(n) && n > 0 && n <= 409) {
|
|
255
|
+
flush();
|
|
256
|
+
sizePt = n;
|
|
257
|
+
}
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (next === "F") {
|
|
261
|
+
if (fileName !== void 0 && fileName.length > 0) buf += fileName;
|
|
262
|
+
i += 2;
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
if ((next === "D" || next === "T") && now) {
|
|
266
|
+
buf += next === "D" ? shortDate(now) : clockTime(now);
|
|
267
|
+
i += 2;
|
|
128
268
|
continue;
|
|
129
269
|
}
|
|
130
270
|
i += 2;
|
|
@@ -132,5 +272,13 @@ function parseHeaderFooterString(s, sheetName) {
|
|
|
132
272
|
flush();
|
|
133
273
|
return regions;
|
|
134
274
|
}
|
|
275
|
+
function shortDate(d) {
|
|
276
|
+
const p = (n) => String(n).padStart(2, "0");
|
|
277
|
+
return `${p(d.getUTCMonth() + 1)}/${p(d.getUTCDate())}/${String(d.getUTCFullYear())}`;
|
|
278
|
+
}
|
|
279
|
+
function clockTime(d) {
|
|
280
|
+
const p = (n) => String(n).padStart(2, "0");
|
|
281
|
+
return `${p(d.getUTCHours())}:${p(d.getUTCMinutes())}:${p(d.getUTCSeconds())}`;
|
|
282
|
+
}
|
|
135
283
|
//#endregion
|
|
136
284
|
export { buildHeaderFooterContent };
|
|
@@ -10,4 +10,4 @@ export { parseWorksheet } from './worksheet-parser.js';
|
|
|
10
10
|
export type { CellType, ColumnWidth, DataValidation, DataValidationType, HeaderFooter, HyperlinkRef, ExcelTable, MergedRange, ParsedWorksheet, RowHeight, SheetRichRun, WorksheetCell, XlsxPageMargins, XlsxPageSetup, XlsxPrintOptions, } from '../core/spreadsheet-model/index.js';
|
|
11
11
|
export { parseXlsxStyles, EMPTY_XLSX_STYLES } from './styles-parser.js';
|
|
12
12
|
export type { XlsxBorder, XlsxBorderEdge, XlsxBorderStyleName, XlsxCellAlignment, XlsxCellXf, XlsxFill, XlsxFont, XlsxHorizontalAlign, XlsxStyles, XlsxVerticalAlign, } from '../core/spreadsheet-model/index.js';
|
|
13
|
-
export { applyNumberFormat } from '
|
|
13
|
+
export { applyNumberFormat, generalToWidth, numberFormatColorHex } from '../core/number-format.js';
|
package/dist/esm/excel/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import "../core/number-format.js";
|
|
1
2
|
import "./cell-reference.js";
|
|
2
3
|
import "./defined-name-ref.js";
|
|
3
4
|
import "./shared-strings-parser.js";
|
|
4
5
|
import "./workbook-parser.js";
|
|
5
|
-
import "./worksheet-parser.js";
|
|
6
6
|
import "./styles-parser.js";
|
|
7
|
-
import "./
|
|
7
|
+
import "./worksheet-parser.js";
|
|
@@ -20,11 +20,36 @@ export declare const TWIPS_PER_EXCEL_CHAR = 105;
|
|
|
20
20
|
* default was derived from the full formula while the explicit path dropped it.
|
|
21
21
|
*/
|
|
22
22
|
export declare const COL_PADDING_TWIPS = 75;
|
|
23
|
+
/**
|
|
24
|
+
* §18.3.1.13 — a `<col width>` in twips.
|
|
25
|
+
*
|
|
26
|
+
* The padding above is the formula for a column at least one character wide.
|
|
27
|
+
* Excel documents a SEPARATE one below that: `px = Trunc(width × MDW + 0.5)`,
|
|
28
|
+
* with no padding at all. It matters because the padding is a constant: on a
|
|
29
|
+
* form drawn over a fine grid — tdf118668.xlsx rules 168 columns of 0.855
|
|
30
|
+
* characters — 3.75pt of padding nearly doubles a 4.5pt column, and the sheet
|
|
31
|
+
* came out 1384pt wide against the reference's 754, so it paginated across two
|
|
32
|
+
* pages where every reader prints one.
|
|
33
|
+
*
|
|
34
|
+
* @param chars The declared width in characters.
|
|
35
|
+
* @param charTwips The Maximum Digit Width, in twips.
|
|
36
|
+
* @returns The rendered column width in twips.
|
|
37
|
+
*/
|
|
38
|
+
export declare function columnTwips(chars: number, charTwips: number): number;
|
|
23
39
|
/**
|
|
24
40
|
* Excel's default column width is 8.43 "characters" ≈ 64px ≈ 960 twips. Used for
|
|
25
41
|
* columns without an explicit `<col width="..">`.
|
|
26
42
|
*/
|
|
27
43
|
export declare const DEFAULT_COL_TWIPS = 960;
|
|
44
|
+
/**
|
|
45
|
+
* The row height a sheet that declares none inherits from the workbook's
|
|
46
|
+
* Normal font. Sizes outside Excel's table scale from its 10pt entry and snap
|
|
47
|
+
* up to the 0.75pt grid row heights are stored on (one pixel at 96 dpi).
|
|
48
|
+
*
|
|
49
|
+
* @param fontPt The Normal style's font size, or undefined if unknown.
|
|
50
|
+
* @returns The default row height in points.
|
|
51
|
+
*/
|
|
52
|
+
export declare function defaultRowHeightPtFor(fontPt: number | undefined): number;
|
|
28
53
|
/**
|
|
29
54
|
* Excel's default row height is ~15pt = 300 twips. Used (for the `fitToHeight`
|
|
30
55
|
* estimate) for rows without an explicit `<row ht="..">`.
|
|
@@ -52,6 +77,22 @@ export declare function resolvePrintTitleRows(definedNames: ReadonlyArray<Define
|
|
|
52
77
|
readonly startRow: number;
|
|
53
78
|
readonly endRow: number;
|
|
54
79
|
} | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* The width one page has for content: the sheet's paper (declared or the A4
|
|
82
|
+
* default) less its left and right margins, in points. The same measure the
|
|
83
|
+
* column bands are packed into — a drawing layer banded on any other width
|
|
84
|
+
* would not line up with the grid beside it.
|
|
85
|
+
*/
|
|
86
|
+
export declare function printableWidthPt(worksheet: ParsedWorksheet): number;
|
|
87
|
+
/**
|
|
88
|
+
* The printable HEIGHT of one page of this sheet, in points — its paper height
|
|
89
|
+
* less its own top and bottom margins. The vertical twin of
|
|
90
|
+
* {@link printableWidthPt}.
|
|
91
|
+
*
|
|
92
|
+
* @param worksheet The parsed worksheet (paper + margins).
|
|
93
|
+
* @returns The height a page of this sheet has for content, in points.
|
|
94
|
+
*/
|
|
95
|
+
export declare function printableHeightPt(worksheet: ParsedWorksheet): number;
|
|
55
96
|
interface PrintModelOptions {
|
|
56
97
|
readonly printArea?: CellRange;
|
|
57
98
|
readonly gridLines: boolean;
|
|
@@ -65,6 +106,18 @@ interface PrintModelOptions {
|
|
|
65
106
|
readonly hyperlinks?: ReadonlyArray<SheetHyperlink>;
|
|
66
107
|
readonly sharedStringRuns?: ReadonlyArray<ReadonlyArray<SheetRichRun> | undefined>;
|
|
67
108
|
readonly now?: Date;
|
|
109
|
+
readonly digitWidthPt?: number;
|
|
110
|
+
readonly defaultFontPt?: number;
|
|
111
|
+
readonly scaleSink?: {
|
|
112
|
+
value: number;
|
|
113
|
+
};
|
|
114
|
+
readonly bandSink?: {
|
|
115
|
+
lefts: Array<number>;
|
|
116
|
+
};
|
|
117
|
+
readonly drawingExtentPt?: {
|
|
118
|
+
readonly widthPt: number;
|
|
119
|
+
readonly heightPt: number;
|
|
120
|
+
};
|
|
68
121
|
readonly losses?: Array<Loss>;
|
|
69
122
|
}
|
|
70
123
|
/**
|
|
@@ -96,6 +149,28 @@ export declare function worksheetToBody(worksheet: ParsedWorksheet, sharedString
|
|
|
96
149
|
* @returns The resolved display string.
|
|
97
150
|
*/
|
|
98
151
|
export declare function resolveCellText(cell: WorksheetCell, sharedStrings: ReadonlyArray<string>, styles: XlsxStyles, date1904: boolean): string;
|
|
152
|
+
/**
|
|
153
|
+
* Whether an EMPTY cell still draws something of its own — a fill or a border.
|
|
154
|
+
*
|
|
155
|
+
* Such a cell cannot be swallowed by a neighbour's overflowing text: the span
|
|
156
|
+
* that gives the text its width would take the paint with it.
|
|
157
|
+
*/
|
|
158
|
+
/**
|
|
159
|
+
* Whether a cell puts anything VISIBLE on an otherwise-empty page.
|
|
160
|
+
*
|
|
161
|
+
* The difference from {@link cellPaintsSomething} is white: a solid fill in the
|
|
162
|
+
* paper's own colour paints nothing a reader can see, and a sheet of them is a
|
|
163
|
+
* blank sheet. bnc762542.xlsx is 176 such cells — `fgColor indexed="9"`, the
|
|
164
|
+
* legacy palette's white — with every word it prints living in a callout, and
|
|
165
|
+
* both references print the callout on a bare page. 48779.xlsx is one cell of
|
|
166
|
+
* solid red, and both print the swatch.
|
|
167
|
+
*
|
|
168
|
+
* @param cell The cell, or undefined.
|
|
169
|
+
* @param styles The workbook's style tables.
|
|
170
|
+
* @returns True when the cell draws something the eye can find.
|
|
171
|
+
*/
|
|
172
|
+
export declare function cellPaintsVisibly(cell: WorksheetCell | undefined, styles: XlsxStyles): boolean;
|
|
173
|
+
export declare function cellPaintsSomething(cell: WorksheetCell | undefined, styles: XlsxStyles): boolean;
|
|
99
174
|
/**
|
|
100
175
|
* Project a slicer panel (E-SHEET SV2) into a styled mini-{@link Table} emitted
|
|
101
176
|
* after the grid: a caption header spanning the button columns, then one button
|