/// <reference types="node" />
import { ChildProcess } from 'child_process';
import { Engine } from './Engine';
interface EngineConfig {
    prismaYmlPath?: string;
    prismaConfig?: string;
    datamodel: string;
    datamodelJson?: string;
    debug?: boolean;
    schemaInferrerPath?: string;
    prismaPath?: string;
    fetcher?: (query: string) => Promise<{
        data?: any;
        error?: any;
    }>;
}
/**
 * Node.js based wrapper to run the Prisma binary
 */
export declare class NodeEngine extends Engine {
    prismaYmlPath?: string;
    prismaConfig?: string;
    port?: number;
    debug: boolean;
    child?: ChildProcess;
    /**
     * exiting is used to tell the .on('exit') hook, if the exit came from our script.
     * As soon as the Prisma binary returns a correct return code (like 1 or 0), we don't need this anymore
     */
    exiting: boolean;
    managementApiEnabled: boolean;
    datamodelJson?: string;
    cwd: string;
    datamodel: string;
    prismaPath: string;
    url: string;
    startPromise: Promise<void>;
    errorLogs: string;
    static defaultPrismaPath: string;
    constructor({ prismaConfig, datamodelJson, prismaYmlPath, datamodel, schemaInferrerPath, prismaPath, ...args }: EngineConfig);
    /**
     * Resolve the prisma.yml
     */
    getPrismaYml(ymlPath: string): Promise<string>;
    /**
     * Starts the engine, returns the url that it runs on
     */
    start(): Promise<void>;
    fail: (e: any, why: any) => void;
    /**
     * If Prisma runs, stop it
     */
    stop: () => void;
    /**
     * Use the port 0 trick to get a new port
     */
    protected getFreePort(): Promise<number>;
    /**
     * Replace the port in the Prisma Config
     */
    protected generatePrismaConfig(): string;
    /**
     * Make sure that our internal port is not conflicting with the prisma.yml's port
     * @param str config
     */
    protected trimPort(str: string): string;
    protected engineReady(): Promise<void>;
    getDmmf(): Promise<any>;
    request<T>(query: string, typeName?: string): Promise<T>;
    handleErrors({ errors, query }: {
        errors?: any;
        query: string;
    }): void;
}
export {};
