import type { BinaryTargetsEnvValue, EngineType, Generator as IGenerator, GeneratorConfig, SqlQueryOutput } from '@prisma/generator'; import type { BinaryTarget } from '@prisma/get-platform'; import { SchemaContext } from '../cli/schemaContext'; import { Generator } from '../Generator'; type BinaryPathsOverride = { [P in EngineType]?: string; }; export type GeneratorRegistryEntry = { type: 'rpc'; generatorPath: string; isNode?: boolean; } | { type: 'in-process'; generator: IGenerator; }; export type GeneratorRegistry = Record; export type ProviderAliases = { [alias: string]: { generatorPath: string; isNode?: boolean; }; }; export type GetGeneratorOptions = { /** @deprecated Pass a schemaContext instead. Kept for compatibility with prisma studio. */ schemaPath?: string; schemaContext?: SchemaContext; registry: GeneratorRegistry; /** @deprecated Use `registry` instead. Kept for compatibility with Prisma Studio. */ providerAliases?: ProviderAliases; version?: string; printDownloadProgress?: boolean; overrideGenerators?: GeneratorConfig[]; skipDownload?: boolean; binaryPathsOverride?: BinaryPathsOverride; generatorNames?: string[]; allowNoModels?: boolean; typedSql?: SqlQueryOutput[]; extensions?: {}; }; /** * Makes sure that all generators have the binaries they deserve and returns a * `Generator` class per generator defined in the schema.prisma file. * In other words, this is basically a generator factory function. */ export declare function getGenerators(options: GetGeneratorOptions): Promise; type NeededVersions = { [key: string]: { engines: EngineType[]; binaryTargets: BinaryTargetsEnvValue[]; }; }; export type GetBinaryPathsByVersionInput = { neededVersions: NeededVersions; detectBinaryTarget: () => Promise; version?: string; printDownloadProgress?: boolean; skipDownload?: boolean; binaryPathsOverride?: BinaryPathsOverride; }; /** * Shortcut for getGenerators, if there is only one generator defined. Useful for testing. * @param schemaPath path to schema.prisma * @param aliases Aliases like `photonjs` -> `node_modules/photonjs/gen.js` * @param version Version of the binary, commit hash of https://github.com/prisma/prisma-engine/commits/master * @param printDownloadProgress `boolean` to print download progress or not */ export declare function getGenerator(options: GetGeneratorOptions): Promise; export declare function skipIndex(arr: T[], index: number): T[]; export declare const knownBinaryTargets: BinaryTarget[]; export {};