import type { Authenticatable } from '@atlex/auth'; import type { Application } from '@atlex/core'; import { TestResponse } from './TestResponse.js'; type HeaderBag = Record; /** * HTTP integration test client (no TCP listen): dispatches through the Express stack. */ export declare class TestClient { private readonly app; private headers; private cookies; private bearer; private bearerType; /** * @param app - Booted {@link Application}. */ constructor(app: Application); /** * Mark subsequent requests as authenticated (requires {@link createTestingAuthMiddleware}). * * @param user - Authenticatable model instance. * @param _guard - Reserved for future multi-guard routing. * @returns This client (fluent). */ actingAs(user: Authenticatable, _guard?: string): this; /** * Merge default headers for subsequent requests. * * @param headers - Header map. * @returns This client (fluent). */ withHeaders(headers: HeaderBag): this; /** * Set a single default header. * * @param key - Header name. * @param value - Header value. * @returns This client (fluent). */ withHeader(key: string, value: string): this; /** * Merge default cookies. * * @param cookies - Cookie map. * @returns This client (fluent). */ withCookies(cookies: Record): this; /** * Set Authorization bearer token. * * @param token - Token value. * @param type - Scheme prefix (default `Bearer`). * @returns This client (fluent). */ withToken(token: string, type?: string): this; /** @inheritdoc */ withoutExceptionHandling(): this; /** @inheritdoc */ withExceptionHandling(): this; /** @inheritdoc */ withoutMiddleware(_middleware?: unknown): this; private applyDefaults; private send; /** @inheritdoc */ get(uri: string, headers?: HeaderBag): Promise; /** @inheritdoc */ post(uri: string, data?: Record, headers?: HeaderBag): Promise; /** @inheritdoc */ put(uri: string, data?: Record, headers?: HeaderBag): Promise; /** @inheritdoc */ patch(uri: string, data?: Record, headers?: HeaderBag): Promise; /** @inheritdoc */ delete(uri: string, data?: Record, headers?: HeaderBag): Promise; /** @inheritdoc */ options(uri: string, headers?: HeaderBag): Promise; /** @inheritdoc */ head(uri: string, headers?: HeaderBag): Promise; /** @inheritdoc */ getJson(uri: string, headers?: HeaderBag): Promise; /** @inheritdoc */ postJson(uri: string, data?: Record, headers?: HeaderBag): Promise; /** @inheritdoc */ putJson(uri: string, data?: Record, headers?: HeaderBag): Promise; /** @inheritdoc */ patchJson(uri: string, data?: Record, headers?: HeaderBag): Promise; /** @inheritdoc */ deleteJson(uri: string, data?: Record, headers?: HeaderBag): Promise; } /** * Build a {@link TestClient} for the given booted application. * * @param app - Application with routes and middleware registered. * @returns Test client instance. */ export declare function createTestClient(app: Application): TestClient; export {}; //# sourceMappingURL=TestClient.d.ts.map