import { ThemeConfig } from '../index'; /** * Standard page sizes in twips (1/20 of a point, 1/1440 of an inch). * * `code` is the OOXML `w:pgSz/@w:code` paper-size code — the Windows DEVMODE * `dmPaperSize` value that printer drivers key off (from `wingdi.h`: * DMPAPER_LETTER 1, DMPAPER_LEGAL 5, DMPAPER_A3 8, DMPAPER_A4 9). Without it a * driver has to infer the tray from the dimensions. */ export declare const PAGE_SIZES: { readonly A4: { readonly width: 11906; readonly height: 16838; readonly code: 9; }; readonly A3: { readonly width: 16838; readonly height: 23811; readonly code: 8; }; readonly LETTER: { readonly width: 12240; readonly height: 15840; readonly code: 1; }; readonly LEGAL: { readonly width: 12240; readonly height: 20160; readonly code: 5; }; }; export interface PageDimensions { width: number; height: number; /** Present only for a named size; a custom size has no paper code. */ code?: number; } /** * Get page dimensions from size (string or object). * * A custom `{ width, height }` deliberately returns no `code`: it is not one of * the standard papers, and claiming a code would send the driver to the wrong * tray. */ export declare function getPageDimensions(size: 'A4' | 'A3' | 'LETTER' | 'LEGAL' | { width: number; height: number; }): PageDimensions; /** * Get table style configuration * @param theme - Theme configuration object * @param themeName - Name of the theme (for fallback to built-in themes) * @returns Table style configuration object */ export declare const getTableStyle: (theme?: ThemeConfig, themeName?: string) => { cellParagraph: { line?: number | undefined; lineRule?: "atLeast" | "auto" | "exact" | undefined; before: number; after: number; }; headerParagraph: { line?: number | undefined; lineRule?: "atLeast" | "auto" | "exact" | undefined; before: number; after: number; }; tableHeader: { fill: string; color: string; bold: boolean; size: number; font: string; }; tableCell: { color: string; size: number; font: string; }; alternatingRow: { fill: string; }; borders: { top: { style: string; size: number; color: string; }; bottom: { style: string; size: number; color: string; }; left: { style: string; size: number; color: string; }; right: { style: string; size: number; color: string; }; }; }; /** * Get document margins configuration * @param theme - Theme configuration object * @param themeName - Name of the theme (for fallback to built-in themes) * @returns Document margins object */ export declare const getDocumentMargins: (theme?: ThemeConfig, themeName?: string) => { left: number; top: number; bottom: number; right: number; header: number; footer: number; gutter: number; } | { top: number; right: number; bottom: number; left: number; header: number; footer: number; }; /** * Get page setup configuration * @param theme - Theme configuration object * @param themeName - Name of the theme (for fallback to built-in themes) * @returns Page setup object */ export declare const getPageSetup: (theme?: ThemeConfig, themeName?: string) => { size: { code?: number | undefined; width: number; height: number; }; margin: { top: number; right: number; bottom: number; left: number; }; }; /** A section's `page` prop: a size and/or margins that replace the theme's. */ export interface SectionPageOverride { size?: 'A4' | 'A3' | 'LETTER' | 'LEGAL' | { width: number; height: number; }; margins?: { top?: number; bottom?: number; left?: number; right?: number; header?: number; footer?: number; gutter?: number; }; } /** * The theme as seen from inside a section that overrides the page. * * Everything that sizes content against the page — a table's grid, an image or * chart at a percentage width, explicit columns, a shape — reads the page off * the theme through {@link getPageSetup}. A section that sets its own size or * margins has a different text measure, so its content is measured against * this theme rather than the document's. Without an override the theme comes * back unchanged, identity included. */ export declare function themeForSectionPage(theme: ThemeConfig, page: SectionPageOverride | undefined): ThemeConfig; /** * Whether two resolved page sizes differ in paper or orientation. * * A continuous section break cannot change either: Word starts a new page * anyway and LibreOffice keeps the old size. So a section whose size differs * from the one before it has to say it starts on a new page. */ export declare function pageSizeDiffers(a: { width: number; height: number; }, b: { width: number; height: number; }): boolean; //# sourceMappingURL=layoutUtils.d.ts.map