/** * Converts input styles to PDF rendering parameters. * * Maps font, color, border, fill, and alignment properties * to their PDF equivalents for the layout engine and page renderer. * * This module is fully independent of the Excel module — it works with * the PDF module's own style interfaces (PdfFontStyle, PdfFillData, etc.). */ import type { PdfColor, LayoutBorders, PdfColorData, PdfFontStyle, PdfFillData, PdfBordersData, PdfAlignmentData } from "../types.js"; /** * Convert an ARGB color string to PDF RGB color. * Handles "AARRGGBB" (8-char) and "RRGGBB" (6-char) formats. * PDF uses 0-1 floats for each component. */ export declare function argbToPdfColor(argb: string | undefined): PdfColor | null; /** * Convert a color data object to PDF color. * Handles ARGB, theme-based, and indexed colors. */ export declare function excelColorToPdf(color: Partial | undefined): PdfColor | null; /** * Apply a tint value to a color. * Tint range: -1.0 (fully dark) to +1.0 (fully light). * Negative tint darkens, positive tint lightens. * * @see OOXML §18.8.19 - tint formula */ export declare function applyTint(color: PdfColor, tint: number): PdfColor; /** * Default colors used in PDF rendering. */ export declare const DEFAULT_COLORS: { black: PdfColor; white: PdfColor; gridLine: PdfColor; }; /** * Extract font properties for PDF rendering. */ export declare function extractFontProperties(font: Partial | undefined, defaultFamily: string, defaultSize: number): { fontFamily: string; fontSize: number; bold: boolean; italic: boolean; strike: boolean; underline: boolean; textColor: PdfColor; }; /** * Convert a fill to a PDF background color. * Only pattern fills with "solid" pattern are supported as PDF backgrounds. * Other patterns are approximated or ignored. */ export declare function excelFillToPdfColor(fill: PdfFillData | undefined): PdfColor | null; /** * Map border styles to PDF line widths (in points). * * Values match Excel's actual border weights as used historically by this * library (pre-#154). PR #154 doubled every width (0.25 → 0.5, 0.5 → 1, * 1 → 2) to make `thin` and `medium` more visually distinct in PDF * viewers, but that change made all borders heavier than Excel itself * (issue #164). The 2× ratio between thin/medium and the 4× ratio between * thin/thick are preserved with the lighter values, so styles remain * distinguishable while matching Excel. * * hair = 0.1 pt * thin = 0.25 pt (also dotted, dashed, dashDot, dashDotDot, slantDashDot, double) * medium = 0.5 pt (also mediumDashed, mediumDashDot, mediumDashDotDot) * thick = 1 pt */ export declare function borderStyleToLineWidth(style: string): number; /** * Convert border data to PDF LayoutBorders. */ export declare function excelBordersToPdf(borders: Partial | undefined): LayoutBorders; /** * Convert horizontal alignment to PDF alignment. */ export declare function excelHAlignToPdf(alignment: Partial | undefined): "left" | "center" | "right"; /** * Convert vertical alignment to PDF alignment. */ export declare function excelVAlignToPdf(alignment: Partial | undefined): "top" | "middle" | "bottom";