import type { Extractor } from "./extractor/index.ts"; import { type Deunionise } from "./util.ts"; export type ExtractorConfig = Exclude[0], string | undefined>; export interface BaseConfig { /** The output directory for the generated models. Default: "models" */ out?: string; /** Generators to enable. Currently supported generators are "kysely" and "zod". Default: ["kysely"] */ generators?: ("kysely" | "zod")[]; /** The default schema to use for the generated models. These will be unprefixed in the final `Database` interface. Default: "public" */ defaultSchema?: string; } export interface PgConfig extends BaseConfig { /** An instance of node-postgres Client or Pool, or an instance of Pglite. */ pg: ExtractorConfig["pg"]; } export interface UriConfig extends BaseConfig { /** A connection string for node-postgres Pool. */ uri: ExtractorConfig["uri"]; } export interface ConfigConfig extends BaseConfig { /** A configuration object for node-postgres Pool. */ config: ExtractorConfig["config"]; } export type TruePGConfig = Deunionise; export declare const generators: { kysely: import("./types.ts").createGenerator; zod: import("./types.ts").createGenerator; }; export declare function config(opts: TruePGConfig): { out: string; generators: ("kysely" | "zod")[]; defaultSchema: string; pg: ExtractorConfig["pg"]; uri?: undefined; config?: undefined; } | { out: string; generators: ("kysely" | "zod")[]; defaultSchema: string; uri: ExtractorConfig["uri"]; pg?: undefined; config?: undefined; } | { out: string; generators: ("kysely" | "zod")[]; defaultSchema: string; config: ExtractorConfig["config"]; pg?: undefined; uri?: undefined; }; export type ValidatedConfig = ReturnType;