import { ExtendedGeneratorOptions } from '../generator'; import { Replacer } from './replacer'; import type { DMMF } from '@prisma/generator-helper'; /** Interface used to configure generator behavior */ export interface Config { /** Input type generation config */ migrations?: { /** Directory to generate the custom migrations from project root. Default: `'./prisma/migrations'` */ outputDirPath?: string; /** Disable generaton of migrations. Default: `false` */ disabled?: boolean; /** Disable generaton of migrations. Default: `false` */ outputStatusFilePath?: string; /** A function to replace generated source. Combined with global replacer config */ replacer?: Replacer<'migrations'>; /** Included models in migrations */ includeModels?: string[]; /** Excluded models in migrations (Ignored if includeModels is set) */ excludeModels?: string[]; }; /** CRUD generation config */ extension?: { /** Disable generaton of crud. Default: `false` */ disabled?: boolean; /** Path to generate the inputs file to from project root. Default: `'./src/realtime/prismaExtension.ts'` */ outputFilePath?: string; /** A function to replace generated source */ replacer?: Replacer<'extension'>; /** How to import Prisma. Default `"import { Prisma } from "@prisma/client";"` */ prismaClientImporter?: string; }; /** Global config */ global?: { /** Name of the trigger to send from database and watch from prisma extension. Default: 'prisma_postgres_realtime_trigger' */ triggerName?: string; /** A function to replace generated source */ replacer?: Replacer; /** Run function before generate */ beforeGenerate?: (dmmf: DMMF.Document) => void; /** Run function after generate */ afterGenerate?: (dmmf: DMMF.Document) => void; }; } /** Type representing a configuration filled with default values where the original config was missing them, for internal purposes */ export type ConfigInternal = { migrations: NonNullable>; extension: NonNullable>; global: NonNullable>; }; /** Parses the configuration file path */ export declare const getConfigPath: ({ generatorConfigPath, schemaPath, }: { generatorConfigPath?: string; schemaPath: string; }) => string | undefined; /** Parses the configuration file based on the provided schema and config paths */ export declare const parseConfig: (configPath: string) => Promise; export declare const getDefaultConfig: (global?: Config['global']) => ConfigInternal; /** Receives the config path from generator options, loads the config from file, fills out the default values, and returns it */ export declare const getConfig: (extendedGeneratorOptions: ExtendedGeneratorOptions) => Promise; export declare const includeModel: ({ model, configs }: { model: DMMF.Model; configs: ConfigInternal; }) => boolean;