export type TemplateType = 'email' | 'report' export type BlockType = 'heading' | 'text' | 'kpi' | 'button' | 'image' | 'divider' | 'table' | 'spacer' export type Block = { id: string type: BlockType props: Record style?: Record } export type TemplateDocument = { theme?: Record email?: { subject?: string preheader?: string } blocks: Block[] } export type EmailCompatibilityWarning = { code: string severity: 'info' | 'warning' | 'error' message: string block_id?: string | null } export type EmailRenderResult = { subject: string preheader: string html: string text: string warnings: EmailCompatibilityWarning[] metadata: Record } export type TemplateRecord = { id: string template_key: string name: string type: TemplateType status: string draft_document: TemplateDocument sample_data: Record published_version?: number | null folder_id?: string | null updated_at: string } export type TemplateSummary = Pick< TemplateRecord, 'id' | 'template_key' | 'name' | 'type' | 'status' | 'published_version' | 'folder_id' | 'updated_at' > export type ApiKeySummary = { id: string name: string key_prefix: string created_at: string last_used_at?: string | null } export type ThemeSummary = { id: string name: string applies_to: 'all' | TemplateType theme: Record created_at: string updated_at: string } export type FolderSummary = { id: string name: string parent_id?: string | null template_count: number created_at: string updated_at: string }