import { type DB } from '../db/client.js'; export interface ContentGeneratorOptions { /** * D1 binding OR a pre-built Drizzle client (any schema). v0.7+: * normalized internally. */ db: D1Database | DB; /** Name of the app-defined content table. */ table: string; /** Column holding the YYYY-MM-DD date. Default `date`. */ dateColumn?: string; /** Column holding the generated body. Default `content`. */ contentColumn?: string; /** * Columns to NULL on update — typically derived artifacts that no longer * match new content (e.g. cached audio_url, summary, image_url). Pass an * empty array (default) to leave every other column alone. */ resetColumns?: string[]; /** * Minimum length the content must reach to count as usable. Below this, * a row is treated as missing and regenerated. Default 80. */ minUsableLength?: number; /** * Produce content for `date`. Return null/empty to signal a recoverable * failure (the row is left alone; caller sees status='failed'). Throwing * is also recoverable — caught and surfaced as failed. */ generate: (date: string) => Promise; } export type EnsureStatus = 'skipped' | 'created' | 'updated' | 'failed'; export interface EnsureResult { status: EnsureStatus; id?: number; reason?: 'invalid_date' | 'generation_failed'; } export declare class ContentGenerator { readonly db: DB; readonly table: string; readonly dateColumn: string; readonly contentColumn: string; readonly resetColumns: string[]; readonly minUsableLength: number; readonly generateFn: (date: string) => Promise; constructor(opts: ContentGeneratorOptions); /** Convenience — ensure a row exists for today (UTC). */ ensureToday(opts?: { force?: boolean; }): Promise; ensureForDate(date: string, { force }?: { force?: boolean; }): Promise; /** Direct generation passthrough — useful for tests and ops scripts. */ generate(date: string): Promise; private findExisting; private insertRow; private updateRow; } //# sourceMappingURL=content_generator.d.ts.map