import type { DbIntrospector } from './db-introspector.js';
import { type ZodFormat } from './zod-codegen.js';
import { type CodedDiagnostic } from '@pikku/inspector';
type Dialect = 'sqlite' | 'postgres';
export interface CodegenOptions {
outFile: string;
coercionFile: string;
manifestFile?: string;
classificationMapFile?: string;
schemaJsonFile?: string;
/**
* When set, emit a standalone module of bare enum unions (one
* `export type
` per enum column) — independent of the wrapped
* DB interface, so callers import a clean union instead of unwrapping
* `ColumnType>`.
*/
enumsFile?: string;
camelCase?: boolean;
rootDir?: string;
/** DB dialect — drives real-type-aware date typing. Defaults to 'sqlite'. */
dialect?: Dialect;
}
export interface CodegenResult {
outFile: string;
coercionFile: string;
manifestFile?: string;
classificationMapFile?: string;
enumsFile?: string;
written: boolean;
coercionWritten: boolean;
manifestWritten: boolean;
classificationMapWritten: boolean;
enumsWritten: boolean;
tables: string[];
/**
* Non-fatal codegen diagnostics (e.g. name looks like a date but unannotated,
* or a JSON column with no concrete `tsType`). The caller surfaces these via
* `logger.diagnostic(...)`, so `pikku db --fail-on-warn` can gate on them.
*/
warnings: CodedDiagnostic[];
/**
* Per-interface, per-field zod `format` overrides for the zod codegen. Keyed
* by interface name (PascalCase) and field name (camelCase), matching the
* shapes the zod emitter parses out of `schema.gen.ts`.
*/
zodFormats: Record>;
}
export declare function generateSchemaTypes(introspector: DbIntrospector, options: CodegenOptions): Promise;
export {};