import Gio from '@girs/gio-2.0'; import Headers from './headers.js'; import Body from './body.js'; import type { Blob } from './utils/blob-from.js'; import type { Readable } from 'node:stream'; declare const INTERNALS: unique symbol; interface ResponseOptions { status?: number; statusText?: string; headers?: HeadersInit | Headers; url?: string; type?: ResponseType; ok?: boolean; redirected?: boolean; size?: number; counter?: number; highWaterMark?: number; } /** * Response class * * Ref: https://fetch.spec.whatwg.org/#response-class * * @param body Readable stream * @param opts Response options */ export declare class Response extends Body { [INTERNALS]: { type: ResponseType; url: string; status: number; statusText: string; headers: Headers; counter: number; highWaterMark: number; }; _inputStream: Gio.InputStream | null; constructor(body?: BodyInit | Readable | Blob | Buffer | null, options?: ResponseOptions); get type(): ResponseType; get url(): string; get status(): number; /** * Convenience property representing if the request ended normally */ get ok(): boolean; get redirected(): boolean; get statusText(): string; get headers(): Headers; get highWaterMark(): number; /** * Clone this response * * @return Response */ clone(): Response; /** * @param url The URL that the new response is to originate from. * @param status An optional status code for the response (e.g., 302.) * @returns A Response object. */ static redirect(url: string, status?: number): Response; static error(): Response; /** * Create a Response with a JSON body. * @param data The data to serialize as JSON. * @param init Optional response init options. * @returns A Response with the JSON body and appropriate content-type header. */ static json(data: unknown, init?: ResponseOptions): Response; get [Symbol.toStringTag](): string; text(): Promise; } export default Response;