/** * Document Structure Functions * Handle document hierarchy and organization without layout concerns */ import { ComponentDefinition, ReportProps, ReportComponentDefinition, RenderContext } from '../types'; import { ThemeConfig } from '../styles'; export interface ProcessedDocument { metadata: DocumentMetadata; sections: ProcessedSection[]; theme: ThemeConfig; themeName: string; /** Open the generated document in track-changes mode */ trackRevisions?: boolean; /** Default document language (BCP-47) applied to docDefaults proofing */ language?: string; } export interface DocumentMetadata { title?: string; subtitle?: string; description?: string; author?: string; company?: string; version?: string; tags?: string[]; date: Date; } export interface ProcessedSection { components: ComponentDefinition[]; header?: ComponentDefinition[] | 'linkToPrevious'; footer?: ComponentDefinition[] | 'linkToPrevious'; /** True if this section originates from an explicit Section component */ isExplicitSection?: boolean; /** Whether this section should start on a new page */ pageBreak?: boolean; /** Page configuration override for this section */ page?: { size?: 'A4' | 'A3' | 'LETTER' | 'LEGAL' | { width: number; height: number; }; margins?: { top?: number; bottom?: number; left?: number; right?: number; header?: number; footer?: number; gutter?: number; }; }; } export interface ResolvedDocumentTree { theme: ThemeConfig; children: ComponentDefinition[]; } /** * Apply document-level defaults to the theme and component tree. * * Kept synchronous and renderer-free so preflight checks can inspect exactly * the props structure processing will render. */ export declare function resolveDocumentTree(document: ReportComponentDefinition, theme: ThemeConfig): ResolvedDocumentTree; /** * Process document definition into structured format */ export declare function processDocument(document: ReportComponentDefinition, theme: ThemeConfig, themeName: string, generationDate?: Date): Promise; /** Process a tree whose effective theme/default cascade is already resolved. */ export declare function processResolvedDocument(document: ReportComponentDefinition, resolved: ResolvedDocumentTree, themeName: string, generationDate?: Date): Promise; /** * Extract document metadata from report props */ export declare function createDocumentMetadata(props: ReportProps, generationDate?: Date): DocumentMetadata; /** * Extract and flatten sections from component hierarchy */ export declare function extractSections(components: ComponentDefinition[], context: RenderContext): Promise; /** * Flatten nested container components while preserving content components */ export declare function flattenComponents(components: ComponentDefinition[], context: RenderContext): Promise; /** * Create render context from processed document */ export declare function createRenderContext(document: ProcessedDocument, theme: ThemeConfig, themeName: string): RenderContext; //# sourceMappingURL=structure.d.ts.map