xls-codec 4.3.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +6 -3
  2. package/dist/biff/record-types.cjs +15 -0
  3. package/dist/biff/record-types.d.cts +11 -1
  4. package/dist/biff/record-types.d.ts +11 -1
  5. package/dist/biff/record-types.js +11 -1
  6. package/dist/biff/substreams.cjs +8 -0
  7. package/dist/biff/substreams.js +8 -0
  8. package/dist/biff/xf-colors.cjs +61 -0
  9. package/dist/biff/xf-colors.d.cts +2 -2
  10. package/dist/biff/xf-colors.d.ts +2 -2
  11. package/dist/biff/xf-colors.js +61 -1
  12. package/dist/biff/xf-writer.d.cts +1 -1
  13. package/dist/biff/xf-writer.d.ts +1 -1
  14. package/dist/conditional-format-12-DdEL5DL0.d.cts +49 -0
  15. package/dist/conditional-format-12-Dw82ECRh.d.ts +49 -0
  16. package/dist/conditional-format-BV2313jL.d.ts +28 -0
  17. package/dist/conditional-format-DUQuOrNW.d.cts +28 -0
  18. package/dist/content.cjs +87 -1
  19. package/dist/content.js +88 -2
  20. package/dist/index.cjs +5 -0
  21. package/dist/index.d.cts +2 -2
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +2 -2
  24. package/dist/workbook/conditional-format-12.cjs +255 -0
  25. package/dist/workbook/conditional-format-12.d.cts +2 -0
  26. package/dist/workbook/conditional-format-12.d.ts +2 -0
  27. package/dist/workbook/conditional-format-12.js +254 -0
  28. package/dist/workbook/conditional-format.cjs +141 -0
  29. package/dist/workbook/conditional-format.d.cts +2 -0
  30. package/dist/workbook/conditional-format.d.ts +2 -0
  31. package/dist/workbook/conditional-format.js +140 -0
  32. package/dist/workbook/globals-writer.d.cts +1 -1
  33. package/dist/workbook/globals-writer.d.ts +1 -1
  34. package/dist/workbook/globals.d.cts +1 -1
  35. package/dist/workbook/globals.d.ts +1 -1
  36. package/dist/workbook/sheet.cjs +21 -1
  37. package/dist/workbook/sheet.d.cts +4 -0
  38. package/dist/workbook/sheet.d.ts +4 -0
  39. package/dist/workbook/sheet.js +21 -1
  40. package/dist/{xf-colors--5oxSeI1.d.ts → xf-colors-d3OvRw76.d.ts} +7 -1
  41. package/dist/{xf-colors-BB5MKq6R.d.cts → xf-colors-mqerVt2O.d.cts} +7 -1
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -35,8 +35,9 @@ What `writeXlsContent`/`writeXls` cover: every `ContentCellValue` kind a real `.
35
35
  | Per-cell font | The reader does not read one back: `ContentSheetCell` has no cell-level font field at all (`ooxml.js`'s xlsx reader makes the identical font-scope choice), so writing a real value here would be unverifiable by round trip. Every `XF` this writer emits still references the same single font. |
36
36
  | `MulBlank`/`RK`/`MulRk` | Pure compaction optimisations over information a plain `Blank`/`Number`/`LabelSst`/`BoolErr` record already carries losslessly. (`Blank` itself _is_ written, for a formatted empty cell — see the `empty` row below.) |
37
37
  | An `empty`-kind cell carrying no formatting | Written as nothing at all, which is what round-trips: `content.ts`'s reader drops an unformatted blank cell it reads, and a merged range's empty anchor is independently reconstructed from `MergeCells` alone. A formatted one (a fill, a border, or a non-default alignment) is the opposite case — its formatting exists only in the `XF` a cell record names, so it gets a real `Blank` record ([MS-XLS] 2.4.20) and round-trips with that formatting intact. |
38
- | Images, embedded objects, conditional formatting, defined names (`Lbl`) | Not read either (see below); there is no round trip to verify a writer for them against. |
38
+ | Images, embedded objects, defined names (`Lbl`) | Not read either (see below); there is no round trip to verify a writer for them against. |
39
39
  | Data validation (`Dv`/`DVal`) | The reader now recovers a sheet's own validation rules (see Read-side gaps below), but writing them back out is its own separate mechanism -- re-encoding a formula's own text back into `Ptg` tokens for `Dv`'s two `DVParsedFormula` fields, the same "not folded into recovering the read side" split this table already draws for `Formula` records. A `ContentSheet.dataValidations` is silently ignored on write. |
40
+ | Conditional formatting (`CondFmt`/`CF`, `CondFmt12`/`CF12`) | The reader now recovers a sheet's own base `cellIs` rules and `CF12`'s colour scale/data bar/icon set rules (see Read-side gaps below), but writing them back out is its own separate mechanism, the same "not folded into recovering the read side" split this table already draws for `Formula` records and `Dv`. A `ContentSheet.conditionalFormats` is silently ignored on write. |
40
41
  | Cell comments (`Note`/`Txo`) | The reader now recovers a cell's comment (see Read-side gaps below), but writing one back out is its own separate mechanism -- a `Note`/`Obj`/`Txo` triple with its own object-id bookkeeping, distinct from every other cell record this writer already emits -- scoped as its own piece of work rather than folded into recovering the read side, the same split this table already draws for `Formula` records. A `ContentSheetCell.comment` is silently ignored on write. |
41
42
  | A page size no `iPaperSize` code names | Written as [MS-XLS] 2.4.257's own custom-paper value rather than as a named paper it is not — the dimensions themselves are unwritable, since `Setup` addresses paper only by code. See [Print settings](#print-settings). |
42
43
  | `Window1`/`Window2`, `CodePage`, `Index`/`DBCell`, the legacy interface records (`InterfaceHdr`, `WriteAccess`, …) | UI and interoperability bookkeeping [MS-XLS]'s own grammar names in the globals/worksheet substreams alongside the content-carrying records above, not data. `Index`/`DBCell` specifically is a pure cell-lookup performance optimisation (see [MS-XLS]'s own "Retrieval of Last-Calculated Cell Values Without Loading Cell Table") that this reader — and Excel's own reader — does not require to find a cell; real, well-established minimal BIFF8 writers (e.g. Python's `xlwt`) omit the same set and produce files Excel opens correctly. The calculation-state records (`CalcCount`, `CalcRefMode`, `CalcIter`, `CalcDelta`, `CalcSaveRecalc`) sat in this row until print settings needed them — see [Print settings](#print-settings) for why the writer emits them now. |
@@ -52,8 +53,10 @@ Each deliberate rather than overlooked:
52
53
  - **Cell decoration and alignment resolved for real; font still not.** `XF`'s trailing `CellXF` payload's fill pattern/colours and per-side border style/colour are read and resolved through the `Palette` record (or the default colour table when one is absent) — see [Cell decoration](#cell-decoration) for the full mapping, including every named pattern beyond solid, and how this was verified against real LibreOffice-produced BIFF8. The same payload's leading word is resolved too — see [Cell alignment](#cell-alignment) for the full `alc`/`alcV` mapping. `Font` records are not read at all: `ContentSheetCell` has no cell-level font field, and `ooxml.js`'s xlsx reader makes the identical scope choice.
53
54
  - **Print settings, resolved for real.** Every field of `ContentSheetPrintSettings` is read from the records that carry it, with Excel's own "Normal" preset standing in per field for whatever the file leaves unstated — see [Print settings](#print-settings) for the record map, the two of BIFF8's own conditional rules that decide how to read `Setup`, and the three things that genuinely do not come through.
54
55
  - **Cell comments, resolved for real (ExaDev/documents.js#949).** A legacy BIFF8 comment is split across three record kinds a single self-contained xlsx `<comment>` element never needs: a `Note` record ([MS-XLS] 2.4.179, wrapping a `NoteSh` structure) anchors the comment to a cell and names its author, but carries no text of its own; the text lives in a `Txo` record ([MS-XLS] 2.4.329), its characters carried across trailing `Continue` records; the two are joined through an `Obj` record ([MS-XLS] 2.4.181) whose `FtCmo` names an object id and type, the `Note`'s own `idObj` field naming that same id, and a `Txo` always immediately following the `Obj` record whose shape it belongs to (`src/workbook/comments.ts`). Read in one independent pass over the whole worksheet substream rather than assuming stream order between a `Note` and the `Obj`+`Txo` pair it names -- both are resolved regardless of which comes first. Legacy BIFF8 has no threading and no per-comment timestamp at all (unlike xlsx's own `[MS-XLSX]` threaded-comments extension), so `ContentSheetCellComment.replies` and `.createdAt` are never populated from an `.xls` source; rich per-character formatting within a comment (`TxORuns`) is skipped rather than modelled, the same scope limit this reader already applies to the shared string table's own rich runs, since `ContentSheetCellComment.text` is a plain string with nowhere to carry them.
55
- - **Data validation, resolved for real (ExaDev/documents.js#1098).** `Dv` ([MS-XLS] 2.4.95) is a fixed, published binary structure -- a bit-packed flags `DWORD` (`valType`/`errStyle`/`fAllowBlank`/`fShowInputMsg`/`fShowErrorMsg`/`typOperator`), four `XLUnicodeString`s (prompt/error titles and messages), one or two `DVParsedFormula` structures, and a trailing `SqRefU` range list -- read directly against that spec (`src/workbook/data-validation.ts`), unlike `calcext:condition`'s own LibreOffice-source-transcribed mini-language odf.js's equivalent reader needed. A `DVParsedFormula`'s own `rgce` is the identical `Ptg` token grammar a cell's `Formula` record carries, so its formula text is recovered with the same `parseFormulaText` this reader already uses for ordinary cell formulas. `DVal` ([MS-XLS] 2.4.96), the record that precedes a sheet's own `Dv` collection, carries only input-window UI state (position, drop-down `Obj` reference) with no counterpart in `ContentSheetDataValidationSchema` and is not read for its own fields. BIFF8's `CF`/`CFEx`/`CondFmt` conditional-formatting records remain unread (ExaDev/documents.js#1100) -- a separate record family, its own cycle.
56
- - **Not read at all:** charts, drawings and images, and conditional formatting (`CF`/`CFEx`/`CondFmt`, ExaDev/documents.js#1100). Defined names (`Lbl`) are read only for the two built-in ones a sheet's print range and repeated header bands live in ([Print settings](#print-settings)); a user-defined name has nowhere to land in `document-schema.js`'s spreadsheet model, so it is skipped.
56
+ - **Data validation, resolved for real (ExaDev/documents.js#1098).** `Dv` ([MS-XLS] 2.4.95) is a fixed, published binary structure -- a bit-packed flags `DWORD` (`valType`/`errStyle`/`fAllowBlank`/`fShowInputMsg`/`fShowErrorMsg`/`typOperator`), four `XLUnicodeString`s (prompt/error titles and messages), one or two `DVParsedFormula` structures, and a trailing `SqRefU` range list -- read directly against that spec (`src/workbook/data-validation.ts`), unlike `calcext:condition`'s own LibreOffice-source-transcribed mini-language odf.js's equivalent reader needed. A `DVParsedFormula`'s own `rgce` is the identical `Ptg` token grammar a cell's `Formula` record carries, so its formula text is recovered with the same `parseFormulaText` this reader already uses for ordinary cell formulas. `DVal` ([MS-XLS] 2.4.96), the record that precedes a sheet's own `Dv` collection, carries only input-window UI state (position, drop-down `Obj` reference) with no counterpart in `ContentSheetDataValidationSchema` and is not read for its own fields.
57
+ - **Conditional formatting, base rules resolved for real (ExaDev/documents.js#1102).** A `CondFmt` record ([MS-XLS] 2.4.56) marks the start of one to three `CF` records ([MS-XLS] 2.4.42) sharing one cell-range list, read together as a group (`src/workbook/conditional-format.ts`) since a `CF`'s own ranges live on its parent `CondFmt`, not on itself. Base BIFF8 (Excel 97) conditional formatting has exactly two rule shapes: a comparison ("Cell Value Is") condition, promoted to `ContentSheetConditionalFormat`'s `cellIs` variant with its formula(s) recovered through the same `parseFormulaText` this reader already uses for cell formulas and `Dv`; and a formula condition, left unpromoted for the same "no closed-form structure without a general formula engine" reason `data-validation.ts` and `ooxml.js`'s own xlsx `cfRule` reading already draw. A rule's resulting style -- font colour and fill background -- comes from its `CF`'s own `DXFN` structure, resolved through the identical `icv`/`Palette` colour machinery a regular cell's fill and border already use ([Cell decoration](#cell-decoration)); a `DXFN` naming a user-defined number format (`DXFNumUsr`) degrades that one rule's style to absent rather than risk misreading the font/fill fields that follow it, since [MS-XLS]'s own prose for `DXFNumUsr`'s length field does not settle whether it counts itself. Every richer rule type Excel 2007+ added has no representation in the base `CF` record at all; it rides a `CF12` record instead, linked to its own `CondFmt` through a `CFEx` extension record.
58
+ - **Conditional formatting, CF12's colour scale/data bar/icon set rules resolved for real (ExaDev/documents.js#1104).** `CF12`'s own `ct` field picks one of six rule shapes ([MS-XLS] 2.4.43); this reader promotes the three that share a genuine array-of-thresholds building block already modelled in `document-schema.js` -- colour scale, data bar, and icon set (`src/workbook/conditional-format-12.ts`) -- each reading an array of `CFVO` threshold objects (the identical `num`/`percent`/`max`/`min`/`formula`/`percentile` vocabulary `ContentSheetConditionalFormatValueSchema` already carries for `ooxml.js`'s xlsx reader and `odf.js`'s ods reader) paired with `CFColor` values. A `CFColor` naming an indexed colour resolves through the same `icv`/`Palette` machinery as base `CF`'s own `DXFN`; one naming a plain RGB triple resolves directly; one naming an automatic or theme colour degrades the whole rule to absent, since this package has no BIFF8 `Theme` reader to resolve a theme reference against. Icon set's own `iIconSet` byte maps to the identical ECMA-376 `ST_IconSetType` vocabulary (`3Arrows`, `3TrafficLights1`, `5Quarters`, and the rest of the seventeen built-in sets) `ooxml.js`'s xlsx `cfRule` reading already carries as a plain string. `CF12`'s remaining rule shapes -- comparison/formula rules re-expressed in this newer record shape, and the filter-dispatched template family (top10, aboveAverage, duplicate/unique values, text/date conditions, dispatched through `icfTemplate` + a fixed `CFExTemplateParams` block) -- remain unread (ExaDev/documents.js#1100), along with `CFEx`'s own extension of a legacy `CF` record.
59
+ - **Not read at all:** charts, drawings and images, and `CF12`'s filter-dispatched template rules plus `CFEx`'s own `CF`-record extension (ExaDev/documents.js#1100). Defined names (`Lbl`) are read only for the two built-in ones a sheet's print range and repeated header bands live in ([Print settings](#print-settings)); a user-defined name has nowhere to land in `document-schema.js`'s spreadsheet model, so it is skipped.
57
60
  - **Encrypted workbooks** are refused rather than mis-read: a `FilePass` record means every record after it is ciphertext.
58
61
 
59
62
  This package is wired into `documents.js`'s conversion registry (`xlsToPdf`/`pdfToXls`, `convertDocument("xls", ...)`, and every same-variant spreadsheet bridge) — see that package's own README Fidelity table for exactly which pairs route and which don't. Remaining read+write scope gaps (formula writing and per-cell font) are tracked on [#815](https://github.com/ExaDev/documents.js/issues/815).
@@ -6,6 +6,8 @@ const RECORD_BOF = 2057;
6
6
  const RECORD_EOF = 10;
7
7
  /** Carries the overflow of a preceding record whose data exceeds what one record can hold ([MS-XLS] 2.4.58). */
8
8
  const RECORD_CONTINUE = 60;
9
+ /** Carries the overflow of a preceding "future record type" (FRT) record -- CondFmt12/CF12 among them -- whose data exceeds what one record can hold, restating a 12-byte FrtRefHeader of its own before the actual continuation bytes ([MS-XLS] 2.4.62). Plain Continue never follows an FRT record; this is its own record type precisely so a reader can tell the two apart. */
10
+ const RECORD_CONTINUEFRT12 = 2175;
9
11
  /** One per sheet: its name, hidden state, type, and the stream offset of its own BOF ([MS-XLS] 2.4.28). */
10
12
  const RECORD_BOUNDSHEET8 = 133;
11
13
  /** The shared string table every LabelSst cell indexes into ([MS-XLS] 2.4.265). */
@@ -46,6 +48,14 @@ const RECORD_MERGECELLS = 229;
46
48
  const RECORD_DVAL = 434;
47
49
  /** One data-validation rule: its type/operator/error-style/flags, prompt and error text, one or two formulas, and the cell ranges it applies to ([MS-XLS] 2.4.95). */
48
50
  const RECORD_DV = 446;
51
+ /** Marks the start of a collection of 1-3 CF records and carries their own shared cell-range list (a bounding Ref8U plus a SqRefU) and a rule-set id CFEx can later extend ([MS-XLS] 2.4.56). */
52
+ const RECORD_CONDFMT = 432;
53
+ /** One conditional-formatting rule: a comparison ("Cell Value Is") or formula condition, one or two Ptg-encoded formulas, and a DXFN structure naming the resulting cell's own font/fill override ([MS-XLS] 2.4.42). Every richer rule type (top10, aboveAverage, colour scale, data bar, icon set, …) is a CF12/CFEx extension instead -- not this record. */
54
+ const RECORD_CF = 433;
55
+ /** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
56
+ const RECORD_CONDFMT12 = 2169;
57
+ /** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). This reader only promotes the three rule types with a genuine array-of-thresholds shape already shared with ooxml.js's xlsx cfRule reading -- colour scale, data bar, icon set (ExaDev/documents.js#1104); the filter-template family stays unread (ExaDev/documents.js#1100). */
58
+ const RECORD_CF12 = 2170;
49
59
  /** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
50
60
  const RECORD_NOTE = 28;
51
61
  /** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
@@ -138,8 +148,13 @@ exports.RECORD_CALCDELTA = RECORD_CALCDELTA;
138
148
  exports.RECORD_CALCITER = RECORD_CALCITER;
139
149
  exports.RECORD_CALCREFMODE = RECORD_CALCREFMODE;
140
150
  exports.RECORD_CALCSAVERECALC = RECORD_CALCSAVERECALC;
151
+ exports.RECORD_CF = RECORD_CF;
152
+ exports.RECORD_CF12 = RECORD_CF12;
141
153
  exports.RECORD_COLINFO = RECORD_COLINFO;
154
+ exports.RECORD_CONDFMT = RECORD_CONDFMT;
155
+ exports.RECORD_CONDFMT12 = RECORD_CONDFMT12;
142
156
  exports.RECORD_CONTINUE = RECORD_CONTINUE;
157
+ exports.RECORD_CONTINUEFRT12 = RECORD_CONTINUEFRT12;
143
158
  exports.RECORD_DATE1904 = RECORD_DATE1904;
144
159
  exports.RECORD_DEFAULTROWHEIGHT = RECORD_DEFAULTROWHEIGHT;
145
160
  exports.RECORD_DEFCOLWIDTH = RECORD_DEFCOLWIDTH;
@@ -5,6 +5,8 @@ declare const RECORD_BOF = 2057;
5
5
  declare const RECORD_EOF = 10;
6
6
  /** Carries the overflow of a preceding record whose data exceeds what one record can hold ([MS-XLS] 2.4.58). */
7
7
  declare const RECORD_CONTINUE = 60;
8
+ /** Carries the overflow of a preceding "future record type" (FRT) record -- CondFmt12/CF12 among them -- whose data exceeds what one record can hold, restating a 12-byte FrtRefHeader of its own before the actual continuation bytes ([MS-XLS] 2.4.62). Plain Continue never follows an FRT record; this is its own record type precisely so a reader can tell the two apart. */
9
+ declare const RECORD_CONTINUEFRT12 = 2175;
8
10
  /** One per sheet: its name, hidden state, type, and the stream offset of its own BOF ([MS-XLS] 2.4.28). */
9
11
  declare const RECORD_BOUNDSHEET8 = 133;
10
12
  /** The shared string table every LabelSst cell indexes into ([MS-XLS] 2.4.265). */
@@ -45,6 +47,14 @@ declare const RECORD_MERGECELLS = 229;
45
47
  declare const RECORD_DVAL = 434;
46
48
  /** One data-validation rule: its type/operator/error-style/flags, prompt and error text, one or two formulas, and the cell ranges it applies to ([MS-XLS] 2.4.95). */
47
49
  declare const RECORD_DV = 446;
50
+ /** Marks the start of a collection of 1-3 CF records and carries their own shared cell-range list (a bounding Ref8U plus a SqRefU) and a rule-set id CFEx can later extend ([MS-XLS] 2.4.56). */
51
+ declare const RECORD_CONDFMT = 432;
52
+ /** One conditional-formatting rule: a comparison ("Cell Value Is") or formula condition, one or two Ptg-encoded formulas, and a DXFN structure naming the resulting cell's own font/fill override ([MS-XLS] 2.4.42). Every richer rule type (top10, aboveAverage, colour scale, data bar, icon set, …) is a CF12/CFEx extension instead -- not this record. */
53
+ declare const RECORD_CF = 433;
54
+ /** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
55
+ declare const RECORD_CONDFMT12 = 2169;
56
+ /** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). This reader only promotes the three rule types with a genuine array-of-thresholds shape already shared with ooxml.js's xlsx cfRule reading -- colour scale, data bar, icon set (ExaDev/documents.js#1104); the filter-template family stays unread (ExaDev/documents.js#1100). */
57
+ declare const RECORD_CF12 = 2170;
48
58
  /** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
49
59
  declare const RECORD_NOTE = 28;
50
60
  /** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
@@ -120,4 +130,4 @@ declare const BIFF8_VERSION = 1536;
120
130
  /** [MS-XLS] 2.1.4: "The record size ... MUST be less than or equal to 8224." The ceiling a writer splits a record at, and the bound a reader can sanity-check a declared size against. */
121
131
  declare const MAX_RECORD_DATA_SIZE = 8224;
122
132
  //#endregion
123
- export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
133
+ export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
@@ -5,6 +5,8 @@ declare const RECORD_BOF = 2057;
5
5
  declare const RECORD_EOF = 10;
6
6
  /** Carries the overflow of a preceding record whose data exceeds what one record can hold ([MS-XLS] 2.4.58). */
7
7
  declare const RECORD_CONTINUE = 60;
8
+ /** Carries the overflow of a preceding "future record type" (FRT) record -- CondFmt12/CF12 among them -- whose data exceeds what one record can hold, restating a 12-byte FrtRefHeader of its own before the actual continuation bytes ([MS-XLS] 2.4.62). Plain Continue never follows an FRT record; this is its own record type precisely so a reader can tell the two apart. */
9
+ declare const RECORD_CONTINUEFRT12 = 2175;
8
10
  /** One per sheet: its name, hidden state, type, and the stream offset of its own BOF ([MS-XLS] 2.4.28). */
9
11
  declare const RECORD_BOUNDSHEET8 = 133;
10
12
  /** The shared string table every LabelSst cell indexes into ([MS-XLS] 2.4.265). */
@@ -45,6 +47,14 @@ declare const RECORD_MERGECELLS = 229;
45
47
  declare const RECORD_DVAL = 434;
46
48
  /** One data-validation rule: its type/operator/error-style/flags, prompt and error text, one or two formulas, and the cell ranges it applies to ([MS-XLS] 2.4.95). */
47
49
  declare const RECORD_DV = 446;
50
+ /** Marks the start of a collection of 1-3 CF records and carries their own shared cell-range list (a bounding Ref8U plus a SqRefU) and a rule-set id CFEx can later extend ([MS-XLS] 2.4.56). */
51
+ declare const RECORD_CONDFMT = 432;
52
+ /** One conditional-formatting rule: a comparison ("Cell Value Is") or formula condition, one or two Ptg-encoded formulas, and a DXFN structure naming the resulting cell's own font/fill override ([MS-XLS] 2.4.42). Every richer rule type (top10, aboveAverage, colour scale, data bar, icon set, …) is a CF12/CFEx extension instead -- not this record. */
53
+ declare const RECORD_CF = 433;
54
+ /** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
55
+ declare const RECORD_CONDFMT12 = 2169;
56
+ /** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). This reader only promotes the three rule types with a genuine array-of-thresholds shape already shared with ooxml.js's xlsx cfRule reading -- colour scale, data bar, icon set (ExaDev/documents.js#1104); the filter-template family stays unread (ExaDev/documents.js#1100). */
57
+ declare const RECORD_CF12 = 2170;
48
58
  /** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
49
59
  declare const RECORD_NOTE = 28;
50
60
  /** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
@@ -120,4 +130,4 @@ declare const BIFF8_VERSION = 1536;
120
130
  /** [MS-XLS] 2.1.4: "The record size ... MUST be less than or equal to 8224." The ceiling a writer splits a record at, and the bound a reader can sanity-check a declared size against. */
121
131
  declare const MAX_RECORD_DATA_SIZE = 8224;
122
132
  //#endregion
123
- export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
133
+ export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
@@ -5,6 +5,8 @@ const RECORD_BOF = 2057;
5
5
  const RECORD_EOF = 10;
6
6
  /** Carries the overflow of a preceding record whose data exceeds what one record can hold ([MS-XLS] 2.4.58). */
7
7
  const RECORD_CONTINUE = 60;
8
+ /** Carries the overflow of a preceding "future record type" (FRT) record -- CondFmt12/CF12 among them -- whose data exceeds what one record can hold, restating a 12-byte FrtRefHeader of its own before the actual continuation bytes ([MS-XLS] 2.4.62). Plain Continue never follows an FRT record; this is its own record type precisely so a reader can tell the two apart. */
9
+ const RECORD_CONTINUEFRT12 = 2175;
8
10
  /** One per sheet: its name, hidden state, type, and the stream offset of its own BOF ([MS-XLS] 2.4.28). */
9
11
  const RECORD_BOUNDSHEET8 = 133;
10
12
  /** The shared string table every LabelSst cell indexes into ([MS-XLS] 2.4.265). */
@@ -45,6 +47,14 @@ const RECORD_MERGECELLS = 229;
45
47
  const RECORD_DVAL = 434;
46
48
  /** One data-validation rule: its type/operator/error-style/flags, prompt and error text, one or two formulas, and the cell ranges it applies to ([MS-XLS] 2.4.95). */
47
49
  const RECORD_DV = 446;
50
+ /** Marks the start of a collection of 1-3 CF records and carries their own shared cell-range list (a bounding Ref8U plus a SqRefU) and a rule-set id CFEx can later extend ([MS-XLS] 2.4.56). */
51
+ const RECORD_CONDFMT = 432;
52
+ /** One conditional-formatting rule: a comparison ("Cell Value Is") or formula condition, one or two Ptg-encoded formulas, and a DXFN structure naming the resulting cell's own font/fill override ([MS-XLS] 2.4.42). Every richer rule type (top10, aboveAverage, colour scale, data bar, icon set, …) is a CF12/CFEx extension instead -- not this record. */
53
+ const RECORD_CF = 433;
54
+ /** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
55
+ const RECORD_CONDFMT12 = 2169;
56
+ /** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). This reader only promotes the three rule types with a genuine array-of-thresholds shape already shared with ooxml.js's xlsx cfRule reading -- colour scale, data bar, icon set (ExaDev/documents.js#1104); the filter-template family stays unread (ExaDev/documents.js#1100). */
57
+ const RECORD_CF12 = 2170;
48
58
  /** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
49
59
  const RECORD_NOTE = 28;
50
60
  /** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
@@ -120,4 +130,4 @@ const BIFF8_VERSION = 1536;
120
130
  /** [MS-XLS] 2.1.4: "The record size ... MUST be less than or equal to 8224." The ceiling a writer splits a record at, and the bound a reader can sanity-check a declared size against. */
121
131
  const MAX_RECORD_DATA_SIZE = 8224;
122
132
  //#endregion
123
- export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_COLINFO, RECORD_CONTINUE, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
133
+ export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
@@ -2,6 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./record-types.cjs");
3
3
  const require_biff_records = require("./records.cjs");
4
4
  //#region src/biff/substreams.ts
5
+ /** FrtRefHeader/FrtRefHeaderU's own fixed size ([MS-XLS] 2.4), restated at the front of every ContinueFrt12 record and stripped before its remaining bytes join the record it continues. */
6
+ const FRT_REF_HEADER_SIZE = 12;
5
7
  /** The total byte length of a record's data across every block (the base record's and any Continues that followed it) -- what a reader needs whenever a trailing field's own length is implied by "whatever is left" rather than stated by a preceding count (a Mul record's entry count, an SST's own bounds check, a formula's RgbExtra trailer). */
6
8
  function recordByteLength(record) {
7
9
  return record.blocks.reduce((sum, block) => sum + block.length, 0);
@@ -16,6 +18,12 @@ function groupRecords(records) {
16
18
  current.blocks.push(record.data);
17
19
  continue;
18
20
  }
21
+ if (record.type === 2175) {
22
+ const current = groups[groups.length - 1];
23
+ if (current === void 0) throw new require_biff_records.BiffFormatError("ContinueFrt12 record with no preceding record to continue");
24
+ current.blocks.push(record.data.subarray(FRT_REF_HEADER_SIZE));
25
+ continue;
26
+ }
19
27
  groups.push({
20
28
  type: record.type,
21
29
  blocks: [record.data],
@@ -1,6 +1,8 @@
1
1
  import "./record-types.js";
2
2
  import { BiffFormatError } from "./records.js";
3
3
  //#region src/biff/substreams.ts
4
+ /** FrtRefHeader/FrtRefHeaderU's own fixed size ([MS-XLS] 2.4), restated at the front of every ContinueFrt12 record and stripped before its remaining bytes join the record it continues. */
5
+ const FRT_REF_HEADER_SIZE = 12;
4
6
  /** The total byte length of a record's data across every block (the base record's and any Continues that followed it) -- what a reader needs whenever a trailing field's own length is implied by "whatever is left" rather than stated by a preceding count (a Mul record's entry count, an SST's own bounds check, a formula's RgbExtra trailer). */
5
7
  function recordByteLength(record) {
6
8
  return record.blocks.reduce((sum, block) => sum + block.length, 0);
@@ -15,6 +17,12 @@ function groupRecords(records) {
15
17
  current.blocks.push(record.data);
16
18
  continue;
17
19
  }
20
+ if (record.type === 2175) {
21
+ const current = groups[groups.length - 1];
22
+ if (current === void 0) throw new BiffFormatError("ContinueFrt12 record with no preceding record to continue");
23
+ current.blocks.push(record.data.subarray(FRT_REF_HEADER_SIZE));
24
+ continue;
25
+ }
18
26
  groups.push({
19
27
  type: record.type,
20
28
  blocks: [record.data],
@@ -186,6 +186,66 @@ function resolveIcvColor(icv, palette) {
186
186
  return palette === void 0 ? DEFAULT_PALETTE_TABLE[index] : palette[index];
187
187
  }
188
188
  }
189
+ function rgbToHsl(color) {
190
+ const { r, g, b } = color;
191
+ const max = Math.max(r, g, b);
192
+ const min = Math.min(r, g, b);
193
+ const l = (max + min) / 2;
194
+ if (max === min) return {
195
+ h: 0,
196
+ s: 0,
197
+ l
198
+ };
199
+ const d = max - min;
200
+ const s = l > .5 ? d / (2 - max - min) : d / (max + min);
201
+ let h;
202
+ if (max === r) h = (g - b) / d + (g < b ? 6 : 0);
203
+ else if (max === g) h = (b - r) / d + 2;
204
+ else h = (r - g) / d + 4;
205
+ return {
206
+ h: h / 6,
207
+ s,
208
+ l
209
+ };
210
+ }
211
+ function hslToRgb(hsl) {
212
+ const { h, s, l } = hsl;
213
+ if (s === 0) return {
214
+ r: l,
215
+ g: l,
216
+ b: l
217
+ };
218
+ const hueToRgb = (p, q, t) => {
219
+ let tt = t;
220
+ if (tt < 0) tt += 1;
221
+ if (tt > 1) tt -= 1;
222
+ if (tt < 1 / 6) return p + (q - p) * 6 * tt;
223
+ if (tt < 1 / 2) return q;
224
+ if (tt < 2 / 3) return p + (q - p) * (2 / 3 - tt) * 6;
225
+ return p;
226
+ };
227
+ const q = l < .5 ? l * (1 + s) : l + s - l * s;
228
+ const p = 2 * l - q;
229
+ return {
230
+ r: hueToRgb(p, q, h + 1 / 3),
231
+ g: hueToRgb(p, q, h),
232
+ b: hueToRgb(p, q, h - 1 / 3)
233
+ };
234
+ }
235
+ /**
236
+ * Applies Excel's own "TintAndShade" colour model to an already-resolved colour: a single -1.0..1.0 value shading a colour toward black (negative) or tinting it toward white (positive), the model CFColor's own numTint field ([MS-XLS] 2.4, https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/fd8e679d-069f-486b-ab48-2382cc167305) carries -- distinct from DrawingML's own separate shade/tint elements (ooxml.js's typed/shared/color.ts), which apply in linear light rather than adjusting HSL lightness directly.
237
+ *
238
+ * The formula itself -- Lum' = Lum*(1+tint) for a negative tint, Lum' = Lum*(1-tint) + tint for a positive one -- is Microsoft's own documented Color.TintAndShade algorithm, cross-checked against Apache POI's XSSFColor#getTint/#setTint javadoc (a completely independent implementation carrying the identical formula) rather than trusted from memory alone.
239
+ */
240
+ function applyTint(color, tint) {
241
+ if (tint === 0) return color;
242
+ const hsl = rgbToHsl(color);
243
+ const l = tint < 0 ? hsl.l * (1 + tint) : hsl.l * (1 - tint) + tint;
244
+ return hslToRgb({
245
+ ...hsl,
246
+ l
247
+ });
248
+ }
189
249
  /** Every BorderStyle token this reader resolves to a (weight, pattern) pair -- BORDER_STYLE_NONE has no entry, since "no border" is handled by the caller before consulting this table. The dash-family tokens (dashDot/dashDotDot and their medium/slant variants) collapse to 'dashed', the closest ContentStrokeStyle member, exactly as ooxml.js's own XLSX_BORDER_STYLE table does for the equivalent xlsx tokens. */
190
250
  const BIFF_BORDER_STYLE = {
191
251
  [1]: {
@@ -410,6 +470,7 @@ exports.PALETTE_BASE_ICV = PALETTE_BASE_ICV;
410
470
  exports.PALETTE_ENTRY_COUNT = PALETTE_ENTRY_COUNT;
411
471
  exports.PATTERN_TYPE_TO_FILL_PATTERN = PATTERN_TYPE_TO_FILL_PATTERN;
412
472
  exports.UNDECORATED_XF_FIELDS = UNDECORATED_XF_FIELDS;
473
+ exports.applyTint = applyTint;
413
474
  exports.borderStyleTokenFor = borderStyleTokenFor;
414
475
  exports.horizAlignTokenFor = horizAlignTokenFor;
415
476
  exports.longRgbBytesOf = longRgbBytesOf;
@@ -1,2 +1,2 @@
1
- import { A as packXfDecorationWords, C as UNDECORATED_XF_FIELDS, D as borderStyleTokenFor, E as XfDecorationFields, F as resolveIcvColor, I as resolveVerticalAlignment, L as unpackXfAlignment, M as resolveBorderEdge, N as resolveFillBackground, O as horizAlignTokenFor, P as resolveHorizontalAlignment, R as unpackXfDecoration, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as readLongRgbColor, k as longRgbBytesOf, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as vertAlignTokenFor } from "../xf-colors-BB5MKq6R.cjs";
2
- export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, XfAlignmentFields, XfBorderEdge, XfDecorationFields, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
1
+ import { A as longRgbBytesOf, B as vertAlignTokenFor, C as UNDECORATED_XF_FIELDS, D as applyTint, E as XfDecorationFields, F as resolveHorizontalAlignment, I as resolveIcvColor, L as resolveVerticalAlignment, M as readLongRgbColor, N as resolveBorderEdge, O as borderStyleTokenFor, P as resolveFillBackground, R as unpackXfAlignment, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as packXfDecorationWords, k as horizAlignTokenFor, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as unpackXfDecoration } from "../xf-colors-mqerVt2O.cjs";
2
+ export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, XfAlignmentFields, XfBorderEdge, XfDecorationFields, applyTint, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
@@ -1,2 +1,2 @@
1
- import { A as packXfDecorationWords, C as UNDECORATED_XF_FIELDS, D as borderStyleTokenFor, E as XfDecorationFields, F as resolveIcvColor, I as resolveVerticalAlignment, L as unpackXfAlignment, M as resolveBorderEdge, N as resolveFillBackground, O as horizAlignTokenFor, P as resolveHorizontalAlignment, R as unpackXfDecoration, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as readLongRgbColor, k as longRgbBytesOf, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as vertAlignTokenFor } from "../xf-colors--5oxSeI1.js";
2
- export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, XfAlignmentFields, XfBorderEdge, XfDecorationFields, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
1
+ import { A as longRgbBytesOf, B as vertAlignTokenFor, C as UNDECORATED_XF_FIELDS, D as applyTint, E as XfDecorationFields, F as resolveHorizontalAlignment, I as resolveIcvColor, L as resolveVerticalAlignment, M as readLongRgbColor, N as resolveBorderEdge, O as borderStyleTokenFor, P as resolveFillBackground, R as unpackXfAlignment, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as packXfDecorationWords, k as horizAlignTokenFor, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as unpackXfDecoration } from "../xf-colors-d3OvRw76.js";
2
+ export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, XfAlignmentFields, XfBorderEdge, XfDecorationFields, applyTint, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
@@ -185,6 +185,66 @@ function resolveIcvColor(icv, palette) {
185
185
  return palette === void 0 ? DEFAULT_PALETTE_TABLE[index] : palette[index];
186
186
  }
187
187
  }
188
+ function rgbToHsl(color) {
189
+ const { r, g, b } = color;
190
+ const max = Math.max(r, g, b);
191
+ const min = Math.min(r, g, b);
192
+ const l = (max + min) / 2;
193
+ if (max === min) return {
194
+ h: 0,
195
+ s: 0,
196
+ l
197
+ };
198
+ const d = max - min;
199
+ const s = l > .5 ? d / (2 - max - min) : d / (max + min);
200
+ let h;
201
+ if (max === r) h = (g - b) / d + (g < b ? 6 : 0);
202
+ else if (max === g) h = (b - r) / d + 2;
203
+ else h = (r - g) / d + 4;
204
+ return {
205
+ h: h / 6,
206
+ s,
207
+ l
208
+ };
209
+ }
210
+ function hslToRgb(hsl) {
211
+ const { h, s, l } = hsl;
212
+ if (s === 0) return {
213
+ r: l,
214
+ g: l,
215
+ b: l
216
+ };
217
+ const hueToRgb = (p, q, t) => {
218
+ let tt = t;
219
+ if (tt < 0) tt += 1;
220
+ if (tt > 1) tt -= 1;
221
+ if (tt < 1 / 6) return p + (q - p) * 6 * tt;
222
+ if (tt < 1 / 2) return q;
223
+ if (tt < 2 / 3) return p + (q - p) * (2 / 3 - tt) * 6;
224
+ return p;
225
+ };
226
+ const q = l < .5 ? l * (1 + s) : l + s - l * s;
227
+ const p = 2 * l - q;
228
+ return {
229
+ r: hueToRgb(p, q, h + 1 / 3),
230
+ g: hueToRgb(p, q, h),
231
+ b: hueToRgb(p, q, h - 1 / 3)
232
+ };
233
+ }
234
+ /**
235
+ * Applies Excel's own "TintAndShade" colour model to an already-resolved colour: a single -1.0..1.0 value shading a colour toward black (negative) or tinting it toward white (positive), the model CFColor's own numTint field ([MS-XLS] 2.4, https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/fd8e679d-069f-486b-ab48-2382cc167305) carries -- distinct from DrawingML's own separate shade/tint elements (ooxml.js's typed/shared/color.ts), which apply in linear light rather than adjusting HSL lightness directly.
236
+ *
237
+ * The formula itself -- Lum' = Lum*(1+tint) for a negative tint, Lum' = Lum*(1-tint) + tint for a positive one -- is Microsoft's own documented Color.TintAndShade algorithm, cross-checked against Apache POI's XSSFColor#getTint/#setTint javadoc (a completely independent implementation carrying the identical formula) rather than trusted from memory alone.
238
+ */
239
+ function applyTint(color, tint) {
240
+ if (tint === 0) return color;
241
+ const hsl = rgbToHsl(color);
242
+ const l = tint < 0 ? hsl.l * (1 + tint) : hsl.l * (1 - tint) + tint;
243
+ return hslToRgb({
244
+ ...hsl,
245
+ l
246
+ });
247
+ }
188
248
  /** Every BorderStyle token this reader resolves to a (weight, pattern) pair -- BORDER_STYLE_NONE has no entry, since "no border" is handled by the caller before consulting this table. The dash-family tokens (dashDot/dashDotDot and their medium/slant variants) collapse to 'dashed', the closest ContentStrokeStyle member, exactly as ooxml.js's own XLSX_BORDER_STYLE table does for the equivalent xlsx tokens. */
189
249
  const BIFF_BORDER_STYLE = {
190
250
  [1]: {
@@ -386,4 +446,4 @@ function longRgbBytesOf(color) {
386
446
  ];
387
447
  }
388
448
  //#endregion
389
- export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
449
+ export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, applyTint, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
@@ -1,4 +1,4 @@
1
- import { E as XfDecorationFields } from "../xf-colors-BB5MKq6R.cjs";
1
+ import { E as XfDecorationFields } from "../xf-colors-mqerVt2O.cjs";
2
2
  import { Alignment, Color } from "document-schema.js";
3
3
  //#region src/biff/xf-writer.d.ts
4
4
  /** Writes one cell-format XF record (fStyle=0): ifnt/ifmt as given, ixfParent pointing at the Normal cell-style XF (index 0), a CellXF payload carrying `alignment`/`verticalAlignment`/`decoration`'s own fields -- general alignment, bottom vertical alignment, and no fill/border (the same bytes this always wrote before either existed) for whatever is omitted. Twenty bytes total ([MS-XLS] 2.4.353). */
@@ -1,4 +1,4 @@
1
- import { E as XfDecorationFields } from "../xf-colors--5oxSeI1.js";
1
+ import { E as XfDecorationFields } from "../xf-colors-d3OvRw76.js";
2
2
  import { Alignment, Color } from "document-schema.js";
3
3
  //#region src/biff/xf-writer.d.ts
4
4
  /** Writes one cell-format XF record (fStyle=0): ifnt/ifmt as given, ixfParent pointing at the Normal cell-style XF (index 0), a CellXF payload carrying `alignment`/`verticalAlignment`/`decoration`'s own fields -- general alignment, bottom vertical alignment, and no fill/border (the same bytes this always wrote before either existed) for whatever is omitted. Twenty bytes total ([MS-XLS] 2.4.353). */
@@ -0,0 +1,49 @@
1
+ import { r as FormulaSheetContext } from "./ptg-CCBbJLZJ.cjs";
2
+ import { t as RecordGroup } from "./substreams-Cpy5Fi3d.cjs";
3
+ import { Color, ContentSheetConditionalFormatValue, ContentSheetRange } from "document-schema.js";
4
+ //#region src/workbook/conditional-format-12.d.ts
5
+ type RawCfColor = {
6
+ readonly kind: "icv";
7
+ readonly icv: number;
8
+ readonly tint: number;
9
+ } | {
10
+ readonly kind: "rgb";
11
+ readonly color: Color;
12
+ readonly tint: number;
13
+ };
14
+ interface RawConditionalFormat12Common {
15
+ /** CF12's own ipriority field, always genuinely present and meaningful (MUST be unique across every CF12 record in the worksheet substream) -- unlike base CF, which has no priority concept at all, this is never an "absent" or omittable-default value. */
16
+ readonly priority: number;
17
+ readonly stopIfTrue: boolean;
18
+ readonly ranges: ContentSheetRange[];
19
+ }
20
+ interface RawColorScaleFormat extends RawConditionalFormat12Common {
21
+ readonly kind: "colorScale";
22
+ readonly stops: readonly {
23
+ readonly value: ContentSheetConditionalFormatValue;
24
+ readonly color: RawCfColor;
25
+ }[];
26
+ }
27
+ interface RawDataBarFormat extends RawConditionalFormat12Common {
28
+ readonly kind: "dataBar";
29
+ readonly min: ContentSheetConditionalFormatValue;
30
+ readonly max: ContentSheetConditionalFormatValue;
31
+ readonly color: RawCfColor;
32
+ readonly showValue: boolean;
33
+ }
34
+ interface RawIconSetFormat extends RawConditionalFormat12Common {
35
+ readonly kind: "iconSet";
36
+ readonly iconSetType: string;
37
+ readonly thresholds: readonly ContentSheetConditionalFormatValue[];
38
+ readonly reverse: boolean;
39
+ readonly showValue: boolean;
40
+ }
41
+ type RawConditionalFormat12 = RawColorScaleFormat | RawDataBarFormat | RawIconSetFormat;
42
+ interface CondFmt12GroupResult {
43
+ readonly formats: RawConditionalFormat12[];
44
+ /** How many records (the CondFmt12 itself plus every CF12 it claimed) the caller should advance past, regardless of how many rules actually promoted. */
45
+ readonly recordsConsumed: number;
46
+ }
47
+ declare function readCondFmt12Group(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmt12GroupResult;
48
+ //#endregion
49
+ export { RawDataBarFormat as a, RawConditionalFormat12 as i, RawCfColor as n, RawIconSetFormat as o, RawColorScaleFormat as r, readCondFmt12Group as s, CondFmt12GroupResult as t };
@@ -0,0 +1,49 @@
1
+ import { r as FormulaSheetContext } from "./ptg-CCBbJLZJ.js";
2
+ import { t as RecordGroup } from "./substreams-CmyZMtuM.js";
3
+ import { Color, ContentSheetConditionalFormatValue, ContentSheetRange } from "document-schema.js";
4
+ //#region src/workbook/conditional-format-12.d.ts
5
+ type RawCfColor = {
6
+ readonly kind: "icv";
7
+ readonly icv: number;
8
+ readonly tint: number;
9
+ } | {
10
+ readonly kind: "rgb";
11
+ readonly color: Color;
12
+ readonly tint: number;
13
+ };
14
+ interface RawConditionalFormat12Common {
15
+ /** CF12's own ipriority field, always genuinely present and meaningful (MUST be unique across every CF12 record in the worksheet substream) -- unlike base CF, which has no priority concept at all, this is never an "absent" or omittable-default value. */
16
+ readonly priority: number;
17
+ readonly stopIfTrue: boolean;
18
+ readonly ranges: ContentSheetRange[];
19
+ }
20
+ interface RawColorScaleFormat extends RawConditionalFormat12Common {
21
+ readonly kind: "colorScale";
22
+ readonly stops: readonly {
23
+ readonly value: ContentSheetConditionalFormatValue;
24
+ readonly color: RawCfColor;
25
+ }[];
26
+ }
27
+ interface RawDataBarFormat extends RawConditionalFormat12Common {
28
+ readonly kind: "dataBar";
29
+ readonly min: ContentSheetConditionalFormatValue;
30
+ readonly max: ContentSheetConditionalFormatValue;
31
+ readonly color: RawCfColor;
32
+ readonly showValue: boolean;
33
+ }
34
+ interface RawIconSetFormat extends RawConditionalFormat12Common {
35
+ readonly kind: "iconSet";
36
+ readonly iconSetType: string;
37
+ readonly thresholds: readonly ContentSheetConditionalFormatValue[];
38
+ readonly reverse: boolean;
39
+ readonly showValue: boolean;
40
+ }
41
+ type RawConditionalFormat12 = RawColorScaleFormat | RawDataBarFormat | RawIconSetFormat;
42
+ interface CondFmt12GroupResult {
43
+ readonly formats: RawConditionalFormat12[];
44
+ /** How many records (the CondFmt12 itself plus every CF12 it claimed) the caller should advance past, regardless of how many rules actually promoted. */
45
+ readonly recordsConsumed: number;
46
+ }
47
+ declare function readCondFmt12Group(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmt12GroupResult;
48
+ //#endregion
49
+ export { RawDataBarFormat as a, RawConditionalFormat12 as i, RawCfColor as n, RawIconSetFormat as o, RawColorScaleFormat as r, readCondFmt12Group as s, CondFmt12GroupResult as t };
@@ -0,0 +1,28 @@
1
+ import { r as FormulaSheetContext } from "./ptg-CCBbJLZJ.js";
2
+ import { t as RecordGroup } from "./substreams-CmyZMtuM.js";
3
+ import { ContentSheetRange, SheetRuleOperator } from "document-schema.js";
4
+ //#region src/workbook/conditional-format.d.ts
5
+ interface RawConditionalFormatFill {
6
+ readonly fillPattern: number;
7
+ readonly fillForegroundIcv: number;
8
+ readonly fillBackgroundIcv: number;
9
+ }
10
+ interface RawConditionalFormatStyle {
11
+ readonly fontColorIcv: number | undefined;
12
+ readonly fill: RawConditionalFormatFill | undefined;
13
+ }
14
+ interface RawConditionalFormat {
15
+ readonly operator: SheetRuleOperator;
16
+ readonly formula1: string;
17
+ readonly formula2: string | undefined;
18
+ readonly style: RawConditionalFormatStyle | undefined;
19
+ readonly ranges: ContentSheetRange[];
20
+ }
21
+ interface CondFmtGroupResult {
22
+ readonly formats: RawConditionalFormat[];
23
+ /** How many records (the CondFmt itself plus every CF it claimed) the caller should advance past, regardless of how many rules actually promoted. */
24
+ readonly recordsConsumed: number;
25
+ }
26
+ declare function readCondFmtGroup(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmtGroupResult;
27
+ //#endregion
28
+ export { readCondFmtGroup as a, RawConditionalFormatStyle as i, RawConditionalFormat as n, RawConditionalFormatFill as r, CondFmtGroupResult as t };
@@ -0,0 +1,28 @@
1
+ import { r as FormulaSheetContext } from "./ptg-CCBbJLZJ.cjs";
2
+ import { t as RecordGroup } from "./substreams-Cpy5Fi3d.cjs";
3
+ import { ContentSheetRange, SheetRuleOperator } from "document-schema.js";
4
+ //#region src/workbook/conditional-format.d.ts
5
+ interface RawConditionalFormatFill {
6
+ readonly fillPattern: number;
7
+ readonly fillForegroundIcv: number;
8
+ readonly fillBackgroundIcv: number;
9
+ }
10
+ interface RawConditionalFormatStyle {
11
+ readonly fontColorIcv: number | undefined;
12
+ readonly fill: RawConditionalFormatFill | undefined;
13
+ }
14
+ interface RawConditionalFormat {
15
+ readonly operator: SheetRuleOperator;
16
+ readonly formula1: string;
17
+ readonly formula2: string | undefined;
18
+ readonly style: RawConditionalFormatStyle | undefined;
19
+ readonly ranges: ContentSheetRange[];
20
+ }
21
+ interface CondFmtGroupResult {
22
+ readonly formats: RawConditionalFormat[];
23
+ /** How many records (the CondFmt itself plus every CF it claimed) the caller should advance past, regardless of how many rules actually promoted. */
24
+ readonly recordsConsumed: number;
25
+ }
26
+ declare function readCondFmtGroup(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmtGroupResult;
27
+ //#endregion
28
+ export { readCondFmtGroup as a, RawConditionalFormatStyle as i, RawConditionalFormat as n, RawConditionalFormatFill as r, CondFmtGroupResult as t };