@shbernal/ts-xlsx 3.1.0 → 3.2.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 +30 -23
- package/dist/bytes.d.ts +3 -2
- package/dist/core/address.d.ts +36 -0
- package/dist/core/address.js +47 -9
- package/dist/core/array-formula-ranges.d.ts +33 -0
- package/dist/core/array-formula-ranges.js +62 -0
- package/dist/core/color-resolution.js +2 -2
- package/dist/core/column.js +3 -2
- package/dist/core/comment-thread.d.ts +7 -3
- package/dist/core/conditional-formatting-overlay.d.ts +9 -0
- package/dist/core/conditional-formatting-overlay.js +28 -1
- package/dist/core/conditional-formatting.d.ts +98 -10
- package/dist/core/conditional-formatting.js +42 -1
- package/dist/core/data-validation-overlay.d.ts +5 -0
- package/dist/core/data-validation-overlay.js +15 -0
- package/dist/core/data-validation.d.ts +16 -0
- package/dist/core/data-validation.js +15 -0
- package/dist/core/date-format.js +14 -4
- package/dist/core/date.js +1 -1
- package/dist/core/formula-references.d.ts +26 -0
- package/dist/core/formula-references.js +173 -0
- package/dist/core/formula-scan.d.ts +2 -0
- package/dist/core/formula-scan.js +58 -0
- package/dist/core/formula.d.ts +51 -18
- package/dist/core/formula.js +77 -86
- package/dist/core/function-values.d.ts +4 -0
- package/dist/core/function-values.js +58 -0
- package/dist/core/future-functions.d.ts +3 -0
- package/dist/core/{modern-functions.js → future-functions.js} +119 -88
- package/dist/core/grid-edits.d.ts +28 -0
- package/dist/core/grid-edits.js +193 -25
- package/dist/core/hyperlink.d.ts +39 -0
- package/dist/core/hyperlink.js +88 -0
- package/dist/core/image.d.ts +36 -5
- package/dist/core/image.js +9 -0
- package/dist/core/internal.d.ts +3 -1
- package/dist/core/limits.d.ts +5 -3
- package/dist/core/merge.d.ts +13 -0
- package/dist/core/merge.js +15 -1
- package/dist/core/page-setup.d.ts +26 -11
- package/dist/core/pivot-table.d.ts +49 -10
- package/dist/core/pivot-table.js +55 -21
- package/dist/core/protection.d.ts +66 -4
- package/dist/core/protection.js +4 -0
- package/dist/core/row.js +3 -2
- package/dist/core/structured-reference.d.ts +7 -0
- package/dist/core/structured-reference.js +7 -0
- package/dist/core/table.d.ts +38 -8
- package/dist/core/table.js +37 -7
- package/dist/core/theme.d.ts +2 -0
- package/dist/core/theme.js +4 -1
- package/dist/core/value.d.ts +51 -28
- package/dist/core/value.js +15 -12
- package/dist/core/workbook-styles.d.ts +17 -1
- package/dist/core/workbook-styles.js +4 -0
- package/dist/core/workbook-theme.js +5 -3
- package/dist/core/workbook.d.ts +20 -3
- package/dist/core/workbook.js +26 -5
- package/dist/core/worksheet-merges.d.ts +9 -4
- package/dist/core/worksheet-merges.js +17 -11
- package/dist/core/worksheet-model.d.ts +1 -1
- package/dist/core/worksheet-model.js +4 -0
- package/dist/core/worksheet-pictures.d.ts +3 -3
- package/dist/core/worksheet-pictures.js +7 -6
- package/dist/core/worksheet.d.ts +110 -21
- package/dist/core/worksheet.js +174 -49
- package/dist/entries/core.d.ts +7 -5
- package/dist/entries/core.js +4 -3
- package/dist/entries/errors.d.ts +1 -0
- package/dist/entries/errors.js +1 -0
- package/dist/errors.js +1 -1
- package/dist/io/cell-metadata/metadata.d.ts +42 -0
- package/dist/io/cell-metadata/metadata.js +35 -0
- package/dist/io/cell-metadata/rich-values.d.ts +11 -0
- package/dist/io/cell-metadata/rich-values.js +80 -0
- package/dist/io/csv/delimiter.d.ts +14 -2
- package/dist/io/csv/delimiter.js +12 -0
- package/dist/io/csv/errors.d.ts +14 -0
- package/dist/io/csv/errors.js +5 -0
- package/dist/io/csv/read.d.ts +6 -1
- package/dist/io/csv/read.js +46 -24
- package/dist/io/csv/write.d.ts +10 -3
- package/dist/io/csv/write.js +16 -7
- package/dist/io/opc/part-paths.js +4 -4
- package/dist/io/opc/read-opc.d.ts +4 -0
- package/dist/io/opc/read-opc.js +10 -4
- package/dist/io/opc/strict-relationships.d.ts +2 -0
- package/dist/io/opc/strict-relationships.js +12 -0
- package/dist/io/read-policy/column-budget.d.ts +26 -0
- package/dist/io/{xlsx → read-policy}/column-budget.js +4 -8
- package/dist/io/read-policy/read-repair.d.ts +74 -0
- package/dist/io/read-policy/read-repair.js +119 -0
- package/dist/io/style/cell-style-resolution.d.ts +25 -0
- package/dist/io/style/cell-style-resolution.js +30 -0
- package/dist/io/xlsb/formula.js +4 -2
- package/dist/io/xlsb/ptg-functions.js +110 -0
- package/dist/io/xlsb/read-metadata.d.ts +7 -0
- package/dist/io/xlsb/read-metadata.js +69 -0
- package/dist/io/xlsb/read-worksheet.d.ts +6 -0
- package/dist/io/xlsb/read-worksheet.js +95 -37
- package/dist/io/xlsb/read.js +26 -8
- package/dist/io/xlsb/record-types.d.ts +13 -0
- package/dist/io/xlsb/record-types.js +13 -0
- package/dist/io/xlsb/sheet-protection.d.ts +20 -0
- package/dist/io/xlsb/sheet-protection.js +60 -0
- package/dist/io/xlsx/cell-accumulator.d.ts +20 -12
- package/dist/io/xlsx/cell-accumulator.js +49 -19
- package/dist/io/xlsx/cell-metadata.d.ts +39 -0
- package/dist/io/xlsx/cell-metadata.js +162 -0
- package/dist/io/xlsx/cell-value.d.ts +16 -4
- package/dist/io/xlsx/cell-value.js +38 -21
- package/dist/io/xlsx/color-xml.js +1 -1
- package/dist/io/xlsx/column-span.d.ts +11 -0
- package/dist/io/xlsx/column-span.js +9 -0
- package/dist/io/xlsx/comments.d.ts +3 -28
- package/dist/io/xlsx/comments.js +3 -65
- package/dist/io/xlsx/conditional-formatting.d.ts +42 -25
- package/dist/io/xlsx/conditional-formatting.js +424 -129
- package/dist/io/xlsx/data-validation.d.ts +12 -7
- package/dist/io/xlsx/data-validation.js +41 -29
- package/dist/io/xlsx/edit-vba.js +43 -36
- package/dist/io/xlsx/hyperlinks.d.ts +16 -50
- package/dist/io/xlsx/hyperlinks.js +8 -37
- package/dist/io/xlsx/images.d.ts +49 -16
- package/dist/io/xlsx/images.js +145 -44
- package/dist/io/xlsx/namespaces.d.ts +8 -0
- package/dist/io/xlsx/namespaces.js +4 -0
- package/dist/io/xlsx/package-plan.d.ts +48 -15
- package/dist/io/xlsx/package-plan.js +46 -9
- package/dist/io/xlsx/part-names.d.ts +6 -8
- package/dist/io/xlsx/part-names.js +3 -7
- package/dist/io/xlsx/pivot.d.ts +5 -5
- package/dist/io/xlsx/pivot.js +23 -22
- package/dist/io/xlsx/preserved-splices.d.ts +6 -0
- package/dist/io/xlsx/preserved-splices.js +74 -0
- package/dist/io/xlsx/read-comments.d.ts +29 -0
- package/dist/io/xlsx/read-comments.js +75 -0
- package/dist/io/xlsx/read-parts.d.ts +2 -2
- package/dist/io/xlsx/read-parts.js +44 -37
- package/dist/io/xlsx/read-pivot.js +9 -3
- package/dist/io/xlsx/read-rich-runs.d.ts +8 -5
- package/dist/io/xlsx/read-rich-runs.js +18 -1
- package/dist/io/xlsx/read-rows.d.ts +18 -7
- package/dist/io/xlsx/read-rows.js +47 -37
- package/dist/io/xlsx/read-styles.d.ts +0 -25
- package/dist/io/xlsx/read-styles.js +39 -34
- package/dist/io/xlsx/read-workbook-xml.d.ts +6 -0
- package/dist/io/xlsx/read-workbook-xml.js +9 -4
- package/dist/io/xlsx/read-worksheet.d.ts +8 -3
- package/dist/io/xlsx/read-worksheet.js +45 -23
- package/dist/io/xlsx/read.d.ts +0 -4
- package/dist/io/xlsx/read.js +17 -21
- package/dist/io/xlsx/relationships.d.ts +3 -0
- package/dist/io/xlsx/relationships.js +4 -0
- package/dist/io/xlsx/row-position.d.ts +3 -1
- package/dist/io/xlsx/row-xml.d.ts +18 -7
- package/dist/io/xlsx/row-xml.js +54 -35
- package/dist/io/xlsx/sheet-properties.js +68 -42
- package/dist/io/xlsx/strict-parts.d.ts +7 -0
- package/dist/io/xlsx/strict-parts.js +171 -0
- package/dist/io/xlsx/style-elements.d.ts +0 -2
- package/dist/io/xlsx/style-elements.js +9 -29
- package/dist/io/xlsx/styles.d.ts +5 -0
- package/dist/io/xlsx/styles.js +11 -5
- package/dist/io/xlsx/tables.d.ts +10 -2
- package/dist/io/xlsx/tables.js +49 -42
- package/dist/io/xlsx/theme-xml.d.ts +6 -0
- package/dist/io/xlsx/theme-xml.js +16 -19
- package/dist/io/xlsx/threaded-comments.d.ts +6 -1
- package/dist/io/xlsx/threaded-comments.js +14 -7
- package/dist/io/xlsx/workbook-xml.d.ts +13 -24
- package/dist/io/xlsx/workbook-xml.js +15 -33
- package/dist/io/xlsx/worksheet-xml.d.ts +5 -2
- package/dist/io/xlsx/worksheet-xml.js +37 -69
- package/dist/io/xlsx/write-stream.d.ts +28 -6
- package/dist/io/xlsx/write-stream.js +42 -17
- package/dist/io/xlsx/write.d.ts +11 -4
- package/dist/io/xlsx/write.js +153 -90
- package/dist/rel-type.d.ts +9 -0
- package/dist/rel-type.js +3 -0
- package/dist/vba/bytes.d.ts +2 -0
- package/dist/vba/bytes.js +11 -0
- package/dist/vba/cfb-format.d.ts +47 -0
- package/dist/vba/cfb-format.js +34 -0
- package/dist/vba/cfb-writer.d.ts +1 -2
- package/dist/vba/cfb-writer.js +33 -36
- package/dist/vba/cfb.d.ts +9 -4
- package/dist/vba/cfb.js +55 -43
- package/dist/vba/dir-records.d.ts +6 -0
- package/dist/vba/dir-records.js +10 -2
- package/dist/vba/errors.d.ts +4 -4
- package/dist/vba/index.d.ts +0 -2
- package/dist/vba/index.js +0 -2
- package/dist/vba/ms-ovba.d.ts +6 -2
- package/dist/vba/ms-ovba.js +15 -6
- package/dist/vba/project-editor.js +102 -87
- package/dist/vba/project.d.ts +4 -0
- package/dist/vba/project.js +12 -6
- package/dist/vba/vba-encoding.d.ts +4 -10
- package/dist/vba/vba-encoding.js +2 -15
- package/dist/xml/xml-read.d.ts +29 -1
- package/dist/xml/xml-read.js +56 -0
- package/dist/xml/xml-scan.d.ts +13 -0
- package/dist/xml/xml-scan.js +58 -7
- package/dist/xml/xml.d.ts +33 -1
- package/dist/xml/xml.js +22 -0
- package/package.json +5 -4
- package/skills/ts-xlsx-upstream/SKILL.md +21 -13
- package/dist/core/modern-functions.d.ts +0 -1
- package/dist/io/xlsx/cell-style-resolution.d.ts +0 -25
- package/dist/io/xlsx/cell-style-resolution.js +0 -29
- package/dist/io/xlsx/column-budget.d.ts +0 -26
- package/dist/io/xlsx/read-repair.d.ts +0 -26
- package/dist/io/xlsx/read-repair.js +0 -39
|
@@ -5,7 +5,7 @@ import { numberText } from '../../xml/xml.js';
|
|
|
5
5
|
function normalizeArgb(argb) {
|
|
6
6
|
const rgb = parseArgb(argb);
|
|
7
7
|
if (rgb === undefined) {
|
|
8
|
-
throw new SyntaxError(`
|
|
8
|
+
throw new SyntaxError(`invalid ARGB colour ${quoted(argb)}: expected 6 or 8 hexadecimal digits`);
|
|
9
9
|
}
|
|
10
10
|
return rgb;
|
|
11
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { XmlAttributes } from '../../xml/xml-scan.ts';
|
|
2
|
+
import { type ColumnRecordBudget } from '../read-policy/column-budget.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The columns a `<col min max>` element actually applies to, or `undefined` for one that applies to
|
|
5
|
+
* none: unreadable bounds, or anything {@link clampColumnSpan} refuses. Both XML worksheet readers
|
|
6
|
+
* ask this, so the two cannot read one `<col>` as covering different columns.
|
|
7
|
+
*/
|
|
8
|
+
export declare function takeColumnSpan(attrs: XmlAttributes, budget: ColumnRecordBudget): {
|
|
9
|
+
first: number;
|
|
10
|
+
last: number;
|
|
11
|
+
} | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { numInteger } from '../../xml/xml-attrs.js';
|
|
2
|
+
import { clampColumnSpan } from '../read-policy/column-budget.js';
|
|
3
|
+
export function takeColumnSpan(attrs, budget) {
|
|
4
|
+
const first = numInteger(attrs.min, 1);
|
|
5
|
+
const last = numInteger(attrs.max, 1);
|
|
6
|
+
if (first === undefined || last === undefined)
|
|
7
|
+
return undefined;
|
|
8
|
+
return clampColumnSpan(first, last, budget);
|
|
9
|
+
}
|
|
@@ -48,31 +48,6 @@ export declare function commentsXml(comments: readonly CommentCell[]): string;
|
|
|
48
48
|
* pixel-exact layout. A thread's fallback shape is `ObjectType="Note"` like any other: Excel draws the
|
|
49
49
|
* threaded-comment card itself and only needs the shape to exist. */
|
|
50
50
|
export declare function vmlDrawingXml(comments: readonly CommentCell[]): string;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* The thread head id this comment is the legacy fallback for, read off its synthetic `tc={headId}`
|
|
56
|
-
* author; absent for a user's own note.
|
|
57
|
-
*/
|
|
58
|
-
readonly threadId?: string;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Parse a `comments{n}.xml` part into a map of A1 reference → comment. Text runs within one comment are
|
|
62
|
-
* concatenated; an author-name run is Excel's own convention and is not stripped, so a note reads back
|
|
63
|
-
* as exactly the text that was written.
|
|
64
|
-
*/
|
|
65
|
-
export declare function parseComments(xml: string): Map<string, ParsedComment>;
|
|
66
|
-
/**
|
|
67
|
-
* Apply a parsed comments part onto a sheet's cells as notes, addressing each by its A1 reference.
|
|
68
|
-
*
|
|
69
|
-
* A thread's legacy fallback is not a note and does not become one: its text is boilerplate wrapping a
|
|
70
|
-
* copy of the conversation, so surfacing it as `cell.note` hands the caller garbage, and on write it
|
|
71
|
-
* would be re-emitted as a plain note, destroying the `tc=`/`xr:uid` binding and leaving Excel unable to
|
|
72
|
-
* see the thread at all.
|
|
73
|
-
*
|
|
74
|
-
* Suppressed only for a conversation the reader actually holds: a file whose thread part is missing or
|
|
75
|
-
* damaged has nothing else left, so there the boilerplate is kept rather than the content lost. Call
|
|
76
|
-
* after the sheet's threads are restored, since that is what this reads to decide.
|
|
77
|
-
*/
|
|
78
|
-
export declare function applyNotes(sheet: Worksheet, comments: ReadonlyMap<string, ParsedComment>): void;
|
|
51
|
+
/** Every cell a sheet still holds, row-major: what the writer gathers a sheet's notes from, beside the
|
|
52
|
+
* notes the streaming writer took off the rows it already flushed. */
|
|
53
|
+
export declare function liveCells(sheet: Worksheet): Generator<Cell, void, undefined>;
|
package/dist/io/xlsx/comments.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { tryDecodeCellRef } from '../../core/address.js';
|
|
2
|
-
import { decodeSpreadsheetText, numInteger } from '../../xml/xml-attrs.js';
|
|
3
|
-
import { parseXml, TextCapture } from '../../xml/xml-read.js';
|
|
4
|
-
import { localName } from '../../xml/xml-scan.js';
|
|
5
2
|
import { escapeText, textAttr, textElement, XML_DECLARATION } from '../../xml/xml.js';
|
|
6
3
|
import { MARKUP_COMPATIBILITY_NS, REVISION_NS, SPREADSHEETML_NS } from './namespaces.js';
|
|
7
4
|
export function collectComments(cells, threads, alreadyCollected = []) {
|
|
@@ -108,66 +105,7 @@ export function vmlDrawingXml(comments) {
|
|
|
108
105
|
.join('');
|
|
109
106
|
return `${VML_HEADER}${shapes}</xml>`;
|
|
110
107
|
}
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
const comments = new Map();
|
|
115
|
-
const authors = [];
|
|
116
|
-
let currentRef;
|
|
117
|
-
let currentAuthorId;
|
|
118
|
-
const capture = new TextCapture(['author', 'text']);
|
|
119
|
-
let body = '';
|
|
120
|
-
parseXml(xml, {
|
|
121
|
-
onOpen(name, attrs, selfClosing) {
|
|
122
|
-
const local = localName(name);
|
|
123
|
-
if (local === 'comment') {
|
|
124
|
-
currentRef = attrs.ref;
|
|
125
|
-
currentAuthorId = attrs.authorId;
|
|
126
|
-
body = '';
|
|
127
|
-
}
|
|
128
|
-
capture.open(local, selfClosing);
|
|
129
|
-
},
|
|
130
|
-
onText(text) {
|
|
131
|
-
capture.text(text);
|
|
132
|
-
},
|
|
133
|
-
onClose(name) {
|
|
134
|
-
const local = localName(name);
|
|
135
|
-
const text = capture.close(local);
|
|
136
|
-
if (local === 'author') {
|
|
137
|
-
authors.push(text ?? '');
|
|
138
|
-
}
|
|
139
|
-
else if (local === 'text') {
|
|
140
|
-
body = decodeSpreadsheetText(text ?? '');
|
|
141
|
-
}
|
|
142
|
-
else if (local === 'comment' && currentRef !== undefined) {
|
|
143
|
-
const threadId = threadIdOf(authors[numInteger(currentAuthorId, 0) ?? -1]);
|
|
144
|
-
comments.set(currentRef, {
|
|
145
|
-
text: body,
|
|
146
|
-
...(threadId !== undefined ? { threadId } : {}),
|
|
147
|
-
});
|
|
148
|
-
currentRef = undefined;
|
|
149
|
-
currentAuthorId = undefined;
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
}, { closeEmptyElements: COMMENT_EMPTY_CLOSES });
|
|
153
|
-
return comments;
|
|
154
|
-
}
|
|
155
|
-
function threadIdOf(author) {
|
|
156
|
-
if (author === undefined || !author.startsWith(THREAD_AUTHOR_PREFIX))
|
|
157
|
-
return undefined;
|
|
158
|
-
const id = author.slice(THREAD_AUTHOR_PREFIX.length);
|
|
159
|
-
return id === '' ? undefined : id;
|
|
160
|
-
}
|
|
161
|
-
export function applyNotes(sheet, comments) {
|
|
162
|
-
const headIds = new Set(sheet.commentThreads.flatMap((thread) => {
|
|
163
|
-
const head = thread.comments[0];
|
|
164
|
-
return head === undefined ? [] : [head.id];
|
|
165
|
-
}));
|
|
166
|
-
for (const [ref, comment] of comments) {
|
|
167
|
-
if (comment.threadId !== undefined && headIds.has(comment.threadId))
|
|
168
|
-
continue;
|
|
169
|
-
if (tryDecodeCellRef(ref) === undefined)
|
|
170
|
-
continue;
|
|
171
|
-
sheet.getCell(ref).note = comment.text;
|
|
172
|
-
}
|
|
108
|
+
export function* liveCells(sheet) {
|
|
109
|
+
for (const { cells } of sheet.rows())
|
|
110
|
+
yield* cells;
|
|
173
111
|
}
|
|
@@ -1,36 +1,53 @@
|
|
|
1
1
|
import { type ConditionalFormatting, type ConditionalFormattingRule } from '../../core/conditional-formatting.ts';
|
|
2
|
+
import type { Worksheet } from '../../core/worksheet.ts';
|
|
2
3
|
import { type CollectingPass } from '../../xml/xml-read.ts';
|
|
3
4
|
import type { StyleRegistry } from './styles.ts';
|
|
4
|
-
/** Each extended data bar's link id, keyed by rule identity: the one map both passes are handed. */
|
|
5
|
-
export type DataBarExtLinks = ReadonlyMap<ConditionalFormattingRule, string>;
|
|
6
|
-
export declare function dataBarExtLinks(formattings: readonly ConditionalFormatting[]): DataBarExtLinks;
|
|
7
5
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* What the classic pass and the extension pass must agree on about a sheet's conditional formats,
|
|
7
|
+
* decided once and handed to both. A classic data bar's link and the `<x14:cfRule>` it names have to
|
|
8
|
+
* carry one id, and two rules in different forms must not be numbered alike, and each pass deriving its
|
|
9
|
+
* half itself makes both agreements hold by the two walks happening to visit the rules in one order.
|
|
11
10
|
*/
|
|
12
|
-
export
|
|
11
|
+
export interface ConditionalFormattingPlan {
|
|
12
|
+
/** Every rule's priority: its own, or the next one free after every priority before it. */
|
|
13
|
+
readonly priorities: ReadonlyMap<ConditionalFormattingRule, number>;
|
|
14
|
+
/**
|
|
15
|
+
* The id of every rule with an `<x14:cfRule>`: a rule written wholly in the extension, and a classic
|
|
16
|
+
* data bar whose extra facets ride there. A rule absent from the map needs no extension.
|
|
17
|
+
*/
|
|
18
|
+
readonly extensionIds: ReadonlyMap<ConditionalFormattingRule, string>;
|
|
19
|
+
}
|
|
20
|
+
/** Plan a sheet's conditional formats, in insertion order, for both serialisers. */
|
|
21
|
+
export declare function planConditionalFormatting(formattings: readonly ConditionalFormatting[]): ConditionalFormattingPlan;
|
|
13
22
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
23
|
+
* Serialise the classic `<conditionalFormatting>` blocks of a sheet, in insertion order, leaving out
|
|
24
|
+
* every rule {@link conditionalFormattingsExtXml} writes in the extension form. Returns '' when no rule
|
|
25
|
+
* remains.
|
|
26
|
+
*
|
|
27
|
+
* A rule's formulas, its operands and a `formula` anchor alike, are stored with the function prefixes
|
|
28
|
+
* a cell formula takes, as Excel stores them; `formulaNames` is `formulaNamesInScope` for the sheet.
|
|
19
29
|
*/
|
|
20
|
-
export declare function
|
|
30
|
+
export declare function conditionalFormattingsXml(formattings: readonly ConditionalFormatting[], styles: StyleRegistry, plan: ConditionalFormattingPlan, formulaNames: ReadonlySet<string>): string;
|
|
21
31
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* is never half-read into a broken classic rule.
|
|
32
|
+
* The worksheet `<extLst>` `<ext>` carrying the sheet's extension-form conditional formats, or '' when
|
|
33
|
+
* it needs none: every rule written wholly there, grouped under its set's range, and every classic data
|
|
34
|
+
* bar's extra facets, under the id the plan gave the link its cfRule carries. Emitted bare (no
|
|
35
|
+
* `<extLst>` wrapper) so the worksheet serialiser can gather it into a single `<extLst>` beside the
|
|
36
|
+
* data-validation extension.
|
|
28
37
|
*/
|
|
29
|
-
export declare function
|
|
38
|
+
export declare function conditionalFormattingsExtXml(formattings: readonly ConditionalFormatting[], styles: StyleRegistry, plan: ConditionalFormattingPlan, formulaNames: ReadonlySet<string>): string;
|
|
30
39
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
40
|
+
* A pass reading a worksheet's conditional formatting into the model, from both forms.
|
|
41
|
+
*
|
|
42
|
+
* The classic `<conditionalFormatting>` blocks come first. Each `<x14:conditionalFormatting>` in the
|
|
43
|
+
* worksheet extension that follows them is read as a set of its own, marked `extended`, unless its rule
|
|
44
|
+
* is a data bar a classic rule links to by id: that one only completes the classic rule with the facets
|
|
45
|
+
* and automatic anchors the classic element cannot carry. An extension rule's inline style is handed to
|
|
46
|
+
* `adoptDifferentialStyle`, which answers the index the rule then holds as its `dxfId`.
|
|
47
|
+
*
|
|
48
|
+
* A rule's formulas shed their function prefixes as a cell formula's do, against `definedNames`, the
|
|
49
|
+
* workbook's names as `definedNameKeys` spells them.
|
|
35
50
|
*/
|
|
36
|
-
export declare function
|
|
51
|
+
export declare function conditionalFormattingPass(definedNames: ReadonlySet<string>, adoptDifferentialStyle: (fragment: string) => number): CollectingPass<ConditionalFormatting[]>;
|
|
52
|
+
/** Fold parsed conditional formattings onto a sheet, each bound to its original range. */
|
|
53
|
+
export declare function applyConditionalFormattings(sheet: Worksheet, blocks: readonly ConditionalFormatting[]): void;
|