/// /// import IResponse from './types/IResponse.js'; import * as PropertySymbol from '../PropertySymbol.js'; import IBlob from '../file/IBlob.js'; import IResponseInit from './types/IResponseInit.js'; import IResponseBody from './types/IResponseBody.js'; import IHeaders from './types/IHeaders.js'; import { ReadableStream } from 'stream/web'; import FormData from '../form-data/FormData.js'; import IBrowserWindow from '../window/IBrowserWindow.js'; import IBrowserFrame from '../browser/types/IBrowserFrame.js'; import ICachedResponse from './cache/response/ICachedResponse.js'; import { Buffer } from 'buffer'; /** * Fetch response. * * Based on: * https://github.com/node-fetch/node-fetch/blob/main/src/response.js (MIT) * * @see https://developer.mozilla.org/en-US/docs/Web/API/Response/Response */ export default class Response implements IResponse { #private; protected static [PropertySymbol.window]: IBrowserWindow; readonly body: ReadableStream | null; readonly bodyUsed = false; readonly redirected = false; readonly type: 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'; readonly url: string; readonly status: number; readonly statusText: string; readonly ok: boolean; readonly headers: IHeaders; [PropertySymbol.cachedResponse]: ICachedResponse | null; readonly [PropertySymbol.buffer]: Buffer | null; /** * Constructor. * * @param injected Injected properties. * @param input Input. * @param injected.window * @param body * @param injected.browserFrame * @param [init] Init. */ constructor(injected: { window: IBrowserWindow; browserFrame: IBrowserFrame; }, body?: IResponseBody, init?: IResponseInit); /** * Returns string tag. * * @returns String tag. */ get [Symbol.toStringTag](): string; /** * Returns array buffer. * * @returns Array buffer. */ arrayBuffer(): Promise; /** * Returns blob. * * @returns Blob. */ blob(): Promise; /** * Returns buffer. * * @returns Buffer. */ buffer(): Promise; /** * Returns text. * * @returns Text. */ text(): Promise; /** * Returns json. * * @returns JSON. */ json(): Promise; /** * Returns form data. * * @returns Form data. */ formData(): Promise; /** * Clones request. * * @returns Clone. */ clone(): Response; /** * Returns a redirect response. * * @param url URL. * @param status Status code. * @returns Response. */ static redirect(url: string, status?: number): Response; /** * Returns an error response. * * @param url URL. * @param status Status code. * @returns Response. */ static error(): Response; /** * Returns an JSON response. * * @param injected Injected properties. * @param data Data. * @param [init] Init. * @returns Response. */ static json(data: object, init?: IResponseInit): Response; } //# sourceMappingURL=Response.d.ts.map