/** * Render a cell's raw stored value through its number format (§18.8.30 built-ins * and §18.8.31 custom codes). Handles `General`, text (`@`), the built-in date / * time formats, custom date codes, and the numeric placeholder grammar (`0` `#` * `,` `.` `%`, scientific notation, quoted literals, `;`-separated sections). An * unknown id, or a value that does not parse as a number, falls back to a plain * render of `rawValue`. * * @param rawValue The cell's raw stored value (a serial for dates). * @param numFmtId The number-format id from the cell's `cellXf`. * @param customFormats Custom format codes by id (from ``). * @param date1904 The workbook date epoch (1904 vs the 1900 default). * @returns The formatted display string. */ export declare function applyNumberFormat(rawValue: string, numFmtId: number, customFormats: ReadonlyMap, date1904?: boolean): string; /** * The colour a number format paints its cell in (§18.8.31), as a 6-digit RRGGBB, * or undefined when the section that applies declares none. * * A `[Red]` at the head of a section is part of the format, not decoration: the * accounting codes write the negative section as `[Red]-#,##0.00`, and rendering * it in the cell's own font colour loses the one signal the format exists for. * `[Color 12]` indexes the same legacy palette a `` does. * * @param rawValue The cell's raw stored value — it selects the section. * @param numFmtId The number-format id from the cell's `cellXf`. * @param customFormats Custom format codes by id (from ``). */ export declare function numberFormatColorHex(rawValue: string, numFmtId: number, customFormats: ReadonlyMap): string | undefined; /** * Excel serial date → JS `Date`. The default 1900 epoch uses 1899-12-30 as day 0 * (so serial 1 is 1900-01-01) and inherits the Lotus 1-2-3 leap-year bug: serial 60 * is considered "1900-02-29" which never existed. For serial ≥ 61 the simple * formula is exact; values < 60 are vanishingly rare in business sheets (and our * render is approximate anyway). * * The 1904 epoch (legacy Mac Excel) uses 1904-01-01 as day 0 and has no leap bug. * Files saved with `` store dates offset by exactly 1462 * days from the 1900-epoch interpretation. */ export declare function excelSerialToDate(serial: number, date1904: boolean): Date; /** * The inverse over a UTC calendar date: `(year, month0, day)` → the integer Excel * serial day, using the same epoch. Round-trips {@link excelSerialToDate} exactly * for an integer serial (the time-of-day is zero), so a serial → parts → serial * loop is stable. Used by the formula engine's date functions and the `timePeriod` * windows (E-SHEET W9) to map an injected reference date into serial space. * * @param month0 The 0-indexed month (0 = January). */ export declare function excelSerialFromUtcParts(year: number, month0: number, day: number, date1904: boolean): number; /** * A General number rounded to the decimals that fit `maxChars` characters. * * General is not a fixed format: a spreadsheet shows as many decimal places as * the column has room for and ROUNDS to that, so 4.3900875881221957 in a * column eight characters wide reads 4.390088. We rendered every stored digit * and let the cell clip it, which turns the same value into 4.390087 — off by * one in the last place shown, with nothing to say a digit was cut. * * The integer part is never dropped: a number too wide even without decimals * keeps them all and the cell says so its own way (see hashOnOverflow). * * `fits` decides, and it must measure in the face this will be DRAWN in rather * than count characters against the column's width in the document's unit. * Counted that way we produced nine digits for a column that holds nine of * Excel's and eight of ours, and the layout clipped the ninth — the very * truncation this exists to prevent. Fewer digits than the reference shows is a * coarser number; a clipped one is a different number. * * @param rawValue The cell's stored value. * @param fits Whether a rendering will fit the cell. */ export declare function generalToWidth(rawValue: string, fits: (text: string) => boolean): string;