import { App, RootModuleDefinition } from '@deepkit/app';
import { ClassType } from '@deepkit/core';
import { TestingFacade as BaseTestingFacade } from '@deepkit/framework';
import { BaseAppConfig, CreateAppOptions } from '../app';
import { loadEntityFixtures, prepareEntityFixtures } from './fixtures';
import { installStandardHooks, makeMockRequest, resetSrcModuleCache } from './requests';
import { SqlTestingHelper } from './sql';
export type TestDbAdapter = 'mysql' | 'postgres';
export interface ITestingFacadeOptions {
    enableDatabase?: boolean;
    enableMigrations?: boolean;
    autoSeedData?: boolean;
    databasePrefix?: string;
    dbAdapter?: TestDbAdapter;
    onBeforeStart?: (facade: TestingFacade) => Promise<void>;
    onStart?: (facade: TestingFacade) => Promise<void>;
    onBeforeStop?: (facade: TestingFacade) => Promise<void>;
    onStop?: (facade: TestingFacade) => Promise<void>;
    seedData?: (facade: TestingFacade) => Promise<void>;
    defaultTestHeaders?: Record<string, string>;
}
export declare class TestingFacade<A extends RootModuleDefinition = RootModuleDefinition> extends BaseTestingFacade<App<A>> {
    readonly options: ITestingFacadeOptions;
    sql: SqlTestingHelper;
    startTs: number;
    databaseName?: string;
    dbAdapter: TestDbAdapter;
    private stopped;
    private httpServer?;
    constructor(app: App<A>, options?: ITestingFacadeOptions);
    start(): Promise<void>;
    stop(): Promise<void>;
    /**
     * ADDITIONS
     */
    createDatabase(): Promise<void>;
    destroyDatabase(): Promise<void>;
    truncateTables(): Promise<void>;
    runMigrations(): Promise<void>;
    resetToSeed(): Promise<void>;
}
type TestingAppOptions<C> = Omit<CreateAppOptions<any>, 'config'> & {
    config?: ClassType<C>;
};
declare function createTestingFacade<O extends TestingAppOptions<any>>(appOptions: O, options?: ITestingFacadeOptions): TestingFacade<Omit<{
    config: typeof BaseAppConfig;
} & O & {
    frameworkConfig: {
        port: number;
        compression: number;
        host?: string | undefined;
        httpsPort?: number;
        selfSigned?: boolean;
        path?: string | undefined;
        workers?: number | undefined;
        gracefulShutdownTimeout?: number | undefined;
        ssl?: boolean | undefined;
        sslOptions?: any;
        sslKey?: string;
        sslCertificate?: string;
        sslCa?: string;
        sslCrl?: string;
        server?: any;
        maxPayload?: number;
        publicDir?: string;
        publicDirPrefix?: string | undefined;
        debug?: boolean | undefined;
        httpRpcBasePath?: string | undefined;
        debugUrl?: string | undefined;
        profile?: boolean | undefined;
        debugBrokerHost?: string;
        varPath?: string | undefined;
        debugStorePath?: string | undefined;
        httpLog?: boolean | undefined;
        session?: any;
        migrateOnStartup?: boolean | undefined;
        migrationDir?: string | undefined;
        broker?: import("@deepkit/framework").BrokerConfig | undefined;
        http?: import("@deepkit/http").HttpConfig | undefined;
        logStartup?: boolean | undefined;
    };
}, "config" | "db" | "defaultConfig" | "frameworkConfig" | "cors"> & {
    config: ClassType<any>;
    controllers: (typeof import("../services/cli/invoke").ProviderInvokeCommand | (never[] | NonNullable<({
        config: typeof BaseAppConfig;
    } & O & {
        frameworkConfig: {
            port: number;
            compression: number;
            host?: string | undefined;
            httpsPort?: number;
            selfSigned?: boolean;
            path?: string | undefined;
            workers?: number | undefined;
            gracefulShutdownTimeout?: number | undefined;
            ssl?: boolean | undefined;
            sslOptions?: any;
            sslKey?: string;
            sslCertificate?: string;
            sslCa?: string;
            sslCrl?: string;
            server?: any;
            maxPayload?: number;
            publicDir?: string;
            publicDirPrefix?: string | undefined;
            debug?: boolean | undefined;
            httpRpcBasePath?: string | undefined;
            debugUrl?: string | undefined;
            profile?: boolean | undefined;
            debugBrokerHost?: string;
            varPath?: string | undefined;
            debugStorePath?: string | undefined;
            httpLog?: boolean | undefined;
            session?: any;
            migrateOnStartup?: boolean | undefined;
            migrationDir?: string | undefined;
            broker?: import("@deepkit/framework").BrokerConfig | undefined;
            http?: import("@deepkit/http").HttpConfig | undefined;
            logStartup?: boolean | undefined;
        };
    })["controllers"]>)[number])[];
    imports: (import("@deepkit/framework").FrameworkModule | import("..").HealthModule | (never[] | NonNullable<({
        config: typeof BaseAppConfig;
    } & O & {
        frameworkConfig: {
            port: number;
            compression: number;
            host?: string | undefined;
            httpsPort?: number;
            selfSigned?: boolean;
            path?: string | undefined;
            workers?: number | undefined;
            gracefulShutdownTimeout?: number | undefined;
            ssl?: boolean | undefined;
            sslOptions?: any;
            sslKey?: string;
            sslCertificate?: string;
            sslCa?: string;
            sslCrl?: string;
            server?: any;
            maxPayload?: number;
            publicDir?: string;
            publicDirPrefix?: string | undefined;
            debug?: boolean | undefined;
            httpRpcBasePath?: string | undefined;
            debugUrl?: string | undefined;
            profile?: boolean | undefined;
            debugBrokerHost?: string;
            varPath?: string | undefined;
            debugStorePath?: string | undefined;
            httpLog?: boolean | undefined;
            session?: any;
            migrateOnStartup?: boolean | undefined;
            migrationDir?: string | undefined;
            broker?: import("@deepkit/framework").BrokerConfig | undefined;
            http?: import("@deepkit/http").HttpConfig | undefined;
            logStartup?: boolean | undefined;
        };
    })["imports"]>)[number])[];
    providers: (ClassType<import("../database").BaseDatabase<import("@deepkit/orm").DatabaseAdapter>> | typeof import("..").HttpWorkflowListenerOptions | typeof import("..").MailService | typeof import("..").WorkerService | typeof import("@deepkit/http").HttpListener | (never[] | NonNullable<({
        config: typeof BaseAppConfig;
    } & O & {
        frameworkConfig: {
            port: number;
            compression: number;
            host?: string | undefined;
            httpsPort?: number;
            selfSigned?: boolean;
            path?: string | undefined;
            workers?: number | undefined;
            gracefulShutdownTimeout?: number | undefined;
            ssl?: boolean | undefined;
            sslOptions?: any;
            sslKey?: string;
            sslCertificate?: string;
            sslCa?: string;
            sslCrl?: string;
            server?: any;
            maxPayload?: number;
            publicDir?: string;
            publicDirPrefix?: string | undefined;
            debug?: boolean | undefined;
            httpRpcBasePath?: string | undefined;
            debugUrl?: string | undefined;
            profile?: boolean | undefined;
            debugBrokerHost?: string;
            varPath?: string | undefined;
            debugStorePath?: string | undefined;
            httpLog?: boolean | undefined;
            session?: any;
            migrateOnStartup?: boolean | undefined;
            migrationDir?: string | undefined;
            broker?: import("@deepkit/framework").BrokerConfig | undefined;
            http?: import("@deepkit/http").HttpConfig | undefined;
            logStartup?: boolean | undefined;
        };
    })["providers"]>)[number] | {
        provide: typeof import("@deepkit/framework").RpcServer;
        useValue: {
            start: () => void;
        };
    })[];
    listeners: (typeof import("..").HttpWorkflowListener | typeof import("../app/shutdown").ShutdownListener | (never[] | NonNullable<({
        config: typeof BaseAppConfig;
    } & O & {
        frameworkConfig: {
            port: number;
            compression: number;
            host?: string | undefined;
            httpsPort?: number;
            selfSigned?: boolean;
            path?: string | undefined;
            workers?: number | undefined;
            gracefulShutdownTimeout?: number | undefined;
            ssl?: boolean | undefined;
            sslOptions?: any;
            sslKey?: string;
            sslCertificate?: string;
            sslCa?: string;
            sslCrl?: string;
            server?: any;
            maxPayload?: number;
            publicDir?: string;
            publicDirPrefix?: string | undefined;
            debug?: boolean | undefined;
            httpRpcBasePath?: string | undefined;
            debugUrl?: string | undefined;
            profile?: boolean | undefined;
            debugBrokerHost?: string;
            varPath?: string | undefined;
            debugStorePath?: string | undefined;
            httpLog?: boolean | undefined;
            session?: any;
            migrateOnStartup?: boolean | undefined;
            migrationDir?: string | undefined;
            broker?: import("@deepkit/framework").BrokerConfig | undefined;
            http?: import("@deepkit/http").HttpConfig | undefined;
            logStartup?: boolean | undefined;
        };
    })["listeners"]>)[number])[];
}>;
type MySQLConfig = Pick<BaseAppConfig, 'MYSQL_HOST' | 'MYSQL_PORT' | 'MYSQL_USER' | 'MYSQL_PASSWORD_SECRET'>;
type PGConfig = Pick<BaseAppConfig, 'PG_HOST' | 'PG_PORT' | 'PG_USER' | 'PG_PASSWORD_SECRET'>;
declare function setDefaultDatabaseConfig(config: MySQLConfig | PGConfig): void;
declare function cleanupTestDatabases(prefix?: string, except?: string): Promise<void>;
export declare const TestingHelpers: {
    setDefaultDatabaseConfig: typeof setDefaultDatabaseConfig;
    createTestingFacade: typeof createTestingFacade;
    cleanupTestDatabases: typeof cleanupTestDatabases;
    defineEntityFixtures: <T extends import("@deepkit/orm").ActiveRecordClassType, K extends PropertyKey>(cls: T, data: { [P in K]: import("./fixtures").TestFields<T>; }) => { [P in K]: import("./fixtures").MockData<T>; };
    prepareEntityFixtures: typeof prepareEntityFixtures;
    loadEntityFixtures: typeof loadEntityFixtures;
    makeMockRequest: typeof makeMockRequest;
    installStandardHooks: typeof installStandardHooks;
    resetSrcModuleCache: typeof resetSrcModuleCache;
};
export {};
export declare type __ΩTestDbAdapter = any[];
export declare type __ΩITestingFacadeOptions = any[];
//# sourceMappingURL=index.d.ts.map