import GLib from '@girs/glib-2.0'; import type Soup from '@girs/soup-3.0'; import Gio from '@girs/gio-2.0'; import { URL } from '@gjsify/url'; import type { Blob } from './utils/blob-from.js'; import type { Readable } from 'node:stream'; import Headers from './headers.js'; import Body from './body.js'; import type { FormData } from '@gjsify/formdata'; declare const INTERNALS: unique symbol; export interface Request extends globalThis.Request { } /** This Fetch API interface represents a resource request. */ export declare class Request extends Body { /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */ readonly cache: RequestCache; /** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. */ readonly credentials: RequestCredentials; /** Returns the kind of resource requested by request, e.g., "document" or "script". */ readonly destination: RequestDestination; /** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header. */ get headers(): Headers; /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] */ readonly integrity: string; /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */ readonly keepalive: boolean; /** Returns request's HTTP method, which is "GET" by default. */ get method(): string; /** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. */ readonly mode: RequestMode; /** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. */ get redirect(): RequestRedirect; /** * Returns the referrer of request. * Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. * This is used during fetching to determine the value of the `Referer` header of the request being made. * @see https://fetch.spec.whatwg.org/#dom-request-referrer **/ get referrer(): string; /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */ get referrerPolicy(): ReferrerPolicy; set referrerPolicy(referrerPolicy: ReferrerPolicy); /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. */ get signal(): AbortSignal; /** Returns the URL of request as a string. */ get url(): string; get _uri(): GLib.Uri; get _session(): Soup.Session; get _message(): Soup.Message; get _inputStream(): Gio.InputStream; get [Symbol.toStringTag](): string; [INTERNALS]: { method: string; redirect: RequestRedirect; headers: Headers; parsedURL: URL; signal: AbortSignal; referrer: string | URL; referrerPolicy: ReferrerPolicy; session: Soup.Session | null; message: Soup.Message | null; inputStream?: Gio.InputStream; readable?: Readable; }; follow: number; compress: boolean; counter: number; agent: string | ((url: URL) => string); highWaterMark: number; insecureHTTPParser: boolean; /** Per-request TLS opt-out (undefined ⇒ verify, honoring NODE_TLS_REJECT_UNAUTHORIZED). */ rejectUnauthorized?: boolean; constructor(input: RequestInfo | URL | Request, init?: RequestInit); /** * Send the request using Soup. */ _send(options: { headers: Headers; }): Promise<{ inputStream: Gio.InputStream; readable: Readable; cancellable: Gio.Cancellable; }>; /** * Clone this request */ clone(): Request; arrayBuffer(): Promise; blob(): Promise; formData(): Promise; json(): Promise; text(): Promise; } export default Request; /** * @param request */ export declare const getSoupRequestOptions: (request: Request) => { parsedURL: URL; options: { headers: Headers; }; };