/** * A builder class for creating Response objects fluently. */ export declare class ApiResponseBuilder { private _status; private _headers; /** * Sets the HTTP status code for the response. * @param code - The HTTP status code. * @returns The builder instance for chaining. */ status(code: Response['status']): this; /** * Adds or merges headers for the response. * @param headersInit - Headers to add or merge. * @returns The builder instance for chaining. */ headers(headersInit: HeadersInit): this; /** * Creates a JSON response using the configured status and headers. * @param data - The data to serialize. * @returns A Response object. */ json(data: unknown): Response; /** * Creates a plain text response using the configured status and headers. * @param data - The text content. * @returns A Response object. */ text(data: string): Response; /** * Creates an HTML response using the configured status and headers. * @param data - The HTML content. * @returns A Response object. */ html(data: string): Response; /** * Creates a redirect response. * @param url - The URL to redirect to. * @param explicitStatus - Optional explicit status code (overrides status() if provided). Defaults to 302 if not set via status(). * @returns A Response object. */ redirect(url: string, explicitStatus?: Response['status']): Response; /** * Creates an error response using the configured status and headers. * If data is an object, it's treated as JSON, otherwise as text. * @param data - The error data (string or object). * @param explicitStatus - Optional explicit status code (overrides status() if provided). Defaults to 500 if not set via status(). * @returns A Response object. */ error(data: string | object, explicitStatus?: Response['status']): Response; }