import { ServerResponse } from 'node:http'; import { Readable } from 'node:stream'; import * as cookie from 'cookie'; export declare class Response { private res; private _status; private _headers; private _cookies; private _content; private _isStreamed; constructor(res: ServerResponse); reset(res: ServerResponse | null): void; /** * Set the HTTP status code. */ status(code: number): this; /** * Helper: 200 OK. */ ok(): this; /** * Helper: 201 Created. */ created(): this; /** * Helper: 204 No Content. */ noContent(): this; /** * Helper: 403 Forbidden. */ forbidden(): this; /** * Helper: 404 Not Found. */ notFound(): this; /** * Set a header. */ header(name: string, value: string | number | string[]): this; /** * Set a cookie. */ cookie(name: string, value: string, options?: cookie.SerializeOptions): this; /** * Set the response content as JSON. */ json(data: any, status?: number): this; /** * Set the response content as plain text or HTML. */ send(content: string | Buffer, status?: number): this; /** * Redirect to a specific URL. */ redirect(url: string, status?: number): this; /** * Redirect to the previous URL. */ back(request: any, fallback?: string, status?: number): this; /** * Set the response content. */ setContent(content: string | Buffer): this; /** * Set the response content as a stream (supports Node Readable and Web ReadableStream). */ stream(content: Readable | ReadableStream): this; /** * Get the current content as a string for human consumption. */ getContent(): string | Buffer | null; /** * Get the raw content for network transmission. */ getRawContent(): string | Buffer | null; /** * Get the current status code. */ getStatusCode(): number; /** * Get all currently set headers. */ getHeaders(): Record; /** * Actually terminate the request and send to client. * This is called by the Kernel. */ terminate(): void; /** * Get the underlying Node response. */ getOriginalResponse(): ServerResponse; /** * Get the underlying Node response (alias for getOriginalResponse) */ get raw(): ServerResponse; } //# sourceMappingURL=Response.d.ts.map