/** * A fake reply object for the Bun adapter that collects response information. * * Since Bun uses the standard Web API Response object instead of a mutable reply, * this class provides a way to capture status and body information from guards * and other middleware that expect a reply object with `.status().send()` interface. * * After guards run, the collected information can be used to construct a Response object. * * @example * ```ts * const fakeReply = new BunFakeReply() * const context = new BunExecutionContext(module, controller, handler, request, fakeReply) * * await guardRunner.runGuards(guards, context, container) * * if (fakeReply.hasResponse()) { * return fakeReply.toResponse() * } * // Continue with normal request handling... * ``` */ export declare class BunFakeReply { private _statusCode; private _body; private _sent; private _headers; /** * Sets the HTTP status code for the response. * Returns `this` for chaining. * * @param code - The HTTP status code. * @returns This instance for method chaining. */ status(code: number): this; /** * Sets the response body and marks the response as sent. * * @param body - The response body (will be JSON stringified if not a string). */ send(body: unknown): void; /** * Sets a response header. * Returns `this` for chaining. * * @param name - The header name. * @param value - The header value. * @returns This instance for method chaining. */ header(name: string, value: string): this; /** * Checks if a response has been sent via this fake reply. * * @returns `true` if `send()` was called, `false` otherwise. */ hasResponse(): boolean; /** * Gets the collected status code. */ getStatusCode(): number; /** * Gets the collected body. */ getBody(): unknown; /** * Converts the collected information into a Web API Response object. * * @returns A Response object with the collected status, body, and headers. */ toResponse(): Response; /** * Resets the fake reply to its initial state. * Useful for reusing the same instance. */ reset(): void; } //# sourceMappingURL=bun-fake-reply.interface.d.mts.map