import * as PropertySymbol from '../PropertySymbol.js'; import IRequestInit from './types/IRequestInit.js'; import URL from '../url/URL.js'; import IRequestInfo from './types/IRequestInfo.js'; import Headers from './Headers.js'; import AbortSignal from './AbortSignal.js'; import { ReadableStream } from 'stream/web'; import Blob from '../file/Blob.js'; import IRequestReferrerPolicy from './types/IRequestReferrerPolicy.js'; import IRequestRedirect from './types/IRequestRedirect.js'; import IRequestCredentials from './types/IRequestCredentials.js'; import FormData from '../form-data/FormData.js'; import BrowserWindow from '../window/BrowserWindow.js'; /** * Fetch request. * * Based on: * https://github.com/node-fetch/node-fetch/blob/main/src/request.js * * @see https://fetch.spec.whatwg.org/#request-class */ export default class Request implements Request { protected [PropertySymbol.window]: BrowserWindow; readonly method: string; readonly body: ReadableStream | null; readonly headers: Headers; readonly redirect: IRequestRedirect; readonly referrerPolicy: IRequestReferrerPolicy; readonly signal: AbortSignal; readonly bodyUsed: boolean; readonly credentials: IRequestCredentials; [PropertySymbol.aborted]: boolean; [PropertySymbol.contentLength]: number | null; [PropertySymbol.contentType]: string | null; [PropertySymbol.referrer]: '' | 'no-referrer' | 'client' | URL; [PropertySymbol.url]: URL; [PropertySymbol.bodyBuffer]: Buffer | null; /** * Constructor. * * @param input Input. * @param [init] Init. */ constructor(input: IRequestInfo, init?: IRequestInit); /** * Returns referrer. * * @returns Referrer. */ get referrer(): string; /** * Returns URL. * * @returns URL. */ get url(): string; /** * 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 FormData. * * @returns FormData. */ formData(): Promise; /** * Clones request. * * @returns Clone. */ clone(): Request; } //# sourceMappingURL=Request.d.ts.map