export interface CssStyle { fontBold: boolean; fontItalic: boolean; fontUnderline: boolean; fontColor: string | null; backgroundColor: string | null; } export interface CellMeta { className?: string | string[]; readOnly?: boolean; borders?: Record; type?: string; source?: unknown[]; comment?: { value?: unknown; }; numericFormat?: { pattern?: string; style?: string; currency?: string; minimumFractionDigits?: number; maximumFractionDigits?: number; useGrouping?: boolean; } | null; locale?: string; checkedTemplate?: unknown; [key: string]: unknown; } /** * Clears the per-export CSS style caches for the given document. * * Call this once at the start of each export so that CSS rule changes made * between exports are picked up instead of returning stale cached values. * * @param {Document} doc The owner document whose cache entries should be cleared. */ export declare function clearStyleCaches(doc: Document): void; /** * Reads visual style properties from a rendered Handsontable cell element via * `getComputedStyle`. * * Font color is only read when the cell has at least one CSS class that is not a * Handsontable alignment class (`htLeft`, `htRight`, etc.), because alignment-only * cells carry only the inherited default text color. * * Background color is only emitted when a custom meta class actually changes the * computed background. Detection is done via a temporary off-screen probe element * (see `detectExplicitBackgroundColor`) — the actual table cell is never modified. * * When `element` is `null` (cell outside the render viewport) but `rootDocument` * and `rootWindow` are provided, style information is derived via a temporary probe * element (see `getCssStyleFromProbe`). Returns `null` only when no element and no * document fallback are available, or when the className has no custom classes. * * @param {HTMLElement|null} element The rendered `` element, or `null`. * @param {string|string[]|undefined} className The cell's `className` meta value. * @param {Document|null} [rootDocument] Fallback document used when `element` is `null`. * @param {Window|null} [rootWindow] Fallback window used when `element` is `null`. * @returns {{ fontBold: boolean, fontItalic: boolean, fontUnderline: boolean, * fontColor: string|null, backgroundColor: string|null }|null} */ export declare function getCssStyleFromElement(element: HTMLElement | null, className: string | string[] | undefined, rootDocument?: Document | null, rootWindow?: Window | null): CssStyle | null; /** * Converts a CSS hex color string to an ARGB hex string expected by ExcelJS. * * @private * @param {string} color CSS color string. * @returns {string} Eight-character ARGB hex string (e.g. `'FF3366CC'`). */ export declare function cssColorToArgb(color: string): string; /** * Derives an ExcelJS `alignment` object from a CSS className string. * * @private * @param {string|undefined} className CSS class string. * @returns {object|null} */ export declare function getAlignmentFromClassName(className: string | undefined): object | null; /** * Derives an ExcelJS `alignment` object from the cell meta `className`. * * Recognised Handsontable alignment classes: * - Horizontal: `htLeft`, `htCenter`, `htRight`, `htJustify` * - Vertical: `htTop`, `htMiddle`, `htBottom` * * @private * @param {object|undefined} meta Cell meta object. * @returns {object|null} */ export declare function getAlignmentFromMeta(meta: CellMeta | undefined): object | null; /** * Derives an ExcelJS `border` object from custom border data stored in cell meta. * * Border widths are mapped to the nearest Excel border style: * `1` → `'thin'`, `2` → `'medium'`, `3+` → `'thick'`. * * @private * @param {object|undefined} meta Cell meta object. * @returns {object|null} */ export declare function getBorderFromMeta(meta: CellMeta | undefined): object | null; /** * Derives an ExcelJS `font` object from computed CSS style. * * All boolean properties (bold, italic, underline) and color are read exclusively * from the `cssStyle` object produced by `getCssStyleFromElement`. When `cssStyle` * is `null` (e.g. the cell is outside the rendered viewport), no font styling is * applied unless `meta.readOnly` is set. * * When `meta.readOnly` is `true` and no explicit color is found, a default dimmed text * color (`READ_ONLY_TEXT_ARGB`) is applied. * * @param {object|undefined} meta Cell meta object. * @param {{ fontBold: boolean, fontItalic: boolean, fontUnderline: boolean, * fontColor: string|null }|null} [cssStyle] Computed CSS style from * `getCssStyleFromElement`, or `null` for non-rendered cells. * @returns {object|null} */ export declare function getFontFromMeta(meta: CellMeta | undefined, cssStyle?: CssStyle | null): object | null; /** * Derives an ExcelJS solid `fill` object from the computed CSS background color. * * Background color is read exclusively from `cssStyle.backgroundColor`. * When `meta.readOnly` is `true` and no explicit color is found, a default light gray fill * (`READ_ONLY_BG_ARGB`) is applied. * * @private * @param {object|undefined} meta Cell meta object. * @param {{ backgroundColor: string|null }|null} [cssStyle] Computed CSS style from * `getCssStyleFromElement`, or `null` for non-rendered cells. * @returns {object|null} */ export declare function getFillFromMeta(meta: CellMeta | undefined, cssStyle?: { backgroundColor: string | null; } | null): object | null; /** * Returns an ExcelJS data validation object for dropdown and autocomplete cell types. * * @private * @param {object|undefined} meta Cell meta object. * @param {string|null} rangeRef Excel range reference to the validation list * (e.g. `'_HotValidation'!$A$1:$A$3`). When `null` or `undefined`, returns `null`. * @returns {object|null} */ export declare function getDropdownValidation(meta: CellMeta | undefined, rangeRef: string | null): object | null;