import { Headers, HeadersInit } from "./headers"; import { Signal } from "./signal"; /** * Marker to indicate the body has been used. */ export declare const kBodyUsed: unique symbol; /** * Marker to indicate the body has been destroyed and can not be used. */ export declare const kBodyDestroyed: unique symbol; /** * Read and "use" the raw body from a `Body` instance. */ export declare function useRawBody(body: CommonBody): T | null; /** * Read the raw body from a `Body` instance. */ export declare function getRawBody(body: CommonBody): T | null; /** * Support body input types. */ export declare type EmptyBody = null | undefined; /** * Body constructor shape. */ export declare type CommonBodyConstructor = { new (body: T | EmptyBody, headers: Headers): CommonBody; }; /** * Abstract body shared between node.js and browsers. */ export interface CommonBody { $rawBody: T | null | typeof kBodyUsed | typeof kBodyDestroyed; readonly bodyUsed: boolean; json(): Promise; text(): Promise; arrayBuffer(): Promise; clone(): CommonBody; destroy(): Promise; } /** * Request configuration. */ export interface CommonRequestOptions { method?: string; body?: T; signal?: Signal; headers?: HeadersInit; omitDefaultHeaders?: boolean; trailer?: HeadersInit | Promise; } /** * Request implementation standard. */ export interface CommonRequest extends CommonBody { url: string; method: string; headers: Headers; trailer: Promise; readonly signal: Signal; clone(): CommonRequest; } /** * Response configuration. */ export interface CommonResponseOptions { status?: number; statusText?: string; headers?: HeadersInit; omitDefaultHeaders?: boolean; trailer?: HeadersInit | Promise; } /** * Response implementation standard. */ export interface CommonResponse extends CommonBody { status: number; statusText: string; headers: Headers; trailer: Promise; clone(): CommonResponse; }