import { ThemeConfig } from '../index'; import { LineSpacing } from '@json-to-office/shared-docx'; /** `w:spacing`'s line height and rule, in the units OOXML uses. */ export interface LineSpacingProperties { line?: number; lineRule?: 'auto' | 'exact' | 'atLeast'; } /** * Convert points to twips for docx spacing * @param points - Value in points * @returns Value in twips (1/20 of a point) */ export declare function pointsToTwips(points: number): number; /** * Resolve theme configuration from either a theme object or theme name * @param theme - Theme configuration object (for custom themes) * @param themeName - Theme name (for built-in themes) * @returns Resolved theme configuration */ export declare function resolveTheme(theme?: ThemeConfig, themeName?: string): ThemeConfig | undefined; /** * Resolve font family from font reference (e.g., 'body', 'heading') to actual font family name * @param theme - Theme configuration object * @param fontRef - Font reference ('body', 'heading', 'mono', 'light') or undefined * @returns Actual font family name (e.g., 'Arial', 'Helvetica') */ export declare function resolveFontFamily(theme: ThemeConfig, fontRef?: 'heading' | 'body' | 'mono' | 'light'): string; /** * Resolve font size from font reference (e.g., 'body', 'heading') to actual font size in points * @param theme - Theme configuration object * @param fontRef - Font reference ('body', 'heading', 'mono', 'light') or undefined * @returns Font size in points (callers multiply by 2 for docx) or undefined if no size found */ export declare function resolveFontSize(theme: ThemeConfig, fontRef?: 'heading' | 'body' | 'mono' | 'light'): number | undefined; /** * Font properties that can be defined in font definitions */ export interface FontProperties { fontWeight?: number; case?: 'none' | 'upper' | 'smallCaps'; family?: string; size?: number; color?: string; bold?: boolean; italic?: boolean; underline?: boolean; alignment?: 'left' | 'center' | 'right' | 'justify'; lineSpacing?: { type: 'single' | 'atLeast' | 'exactly' | 'double' | 'multiple'; value?: number; }; spacing?: { before?: number; after?: number; }; characterSpacing?: { type: 'condensed' | 'expanded'; value: number; }; scale?: number; } /** * Resolve all font properties from font reference. * Returns all formatting properties defined in the font definition. * @param theme - Theme configuration object * @param fontRef - Font reference ('body', 'heading', 'mono', 'light') or undefined * @returns Object containing all font properties */ export declare function resolveFontProperties(theme: ThemeConfig, fontRef?: 'heading' | 'body' | 'mono' | 'light'): FontProperties; /** * Merge font properties with style overrides. * Style properties take precedence over font properties. * Only defined (non-undefined) style properties override font properties. * @param fontProps - Properties from font definition * @param styleOverrides - Properties from style definition * @returns Merged properties object */ export declare function mergeFontAndStyleProperties>(fontProps: FontProperties, styleOverrides: T): FontProperties & T; /** * Get body text style configuration * @param theme - Theme configuration object * @param themeName - Name of the theme (for fallback to built-in themes) * @returns Style configuration object */ export declare const getBodyTextStyle: (theme?: ThemeConfig, themeName?: string) => { size: number; font: string; color: string; }; /** * Converts line spacing from theme definition to DOCX spacing options. * DOCX uses twips (1/20th of a point) for line spacing. * @param lineSpacing The line spacing object from the theme definition. * @returns IParagraphSpacingOptions for docx. */ export declare function convertLineSpacing(lineSpacing?: LineSpacing | number): LineSpacingProperties | undefined; //# sourceMappingURL=styleHelpers.d.ts.map