import type { Middleware, SslInfo } from './server.d.ts';
import type { ServerCustomizer } from '../config.d.ts';


export interface TestClient {
    readonly fetch: (input: string | URL, init?: RequestInit) => Promise<Response>;
}

export interface TestClientBuilder {
    baseUrl(url: string): this;
    build(): Promise<TestClient>;
}

export interface MockServerSpec {
    middleware(...middleware: Middleware): this;
    sslInfo(sslInfo?: SslInfo): this;
    configureClient(): TestClientBuilder;
    build(): Promise<TestClient>;
}

declare const TestClient: {
    bindToApp(app: ServerCustomizer): MockServerSpec;
    bindToServer(): TestClientBuilder;
}
