import { t as Interceptor } from "./interceptor-dtJZ_9QT.js"; import { t as BatchInterceptor } from "./batch-interceptor-CPjFK2td.js"; import { a as RequestControllerSource, i as RequestController, n as HttpRequestEventMap, r as HttpResponseEvent, t as HttpRequestEvent } from "./http-CB9rQ7i_.js"; //#region src/interceptor-error.d.ts declare class InterceptorError extends Error { constructor(message?: string); } //#endregion //#region src/create-request-id.d.ts /** * Generate a random ID string to represent a request. * @example * createRequestId() * // "f774b6c9c600f" */ declare function createRequestId(): string; //#endregion //#region src/utils/get-clean-url.d.ts /** * Removes query parameters and hashes from a given URL. */ declare function getCleanUrl(url: URL, isAbsolute?: boolean): string; //#endregion //#region src/utils/buffer-utils.d.ts declare function encodeBuffer(text: string): Uint8Array; declare function decodeBuffer(buffer: AllowSharedBufferSource, encoding?: string): string; //#endregion //#region src/utils/fetch-utils.d.ts interface FetchRequestInit extends Omit { mode?: RequestMode | 'websocket' | 'webtransport'; duplex?: 'half' | 'full'; } declare class FetchRequest extends Request { #private; /** * Check if the given request method is configurable. * @see https://fetch.spec.whatwg.org/#methods */ static isConfigurableMethod(method: string): boolean; static isMethodWithBody(method: string): boolean; /** * Check if the given request `mode` is configurable. * @see https://fetch.spec.whatwg.org/#concept-request-mode */ static isConfigurableMode(mode: string): boolean; constructor(input: URL | RequestInfo, init?: FetchRequestInit); } interface FetchResponseInit extends ResponseInit { url?: string; } declare class FetchResponse extends Response { #private; static from(response: Response, init?: FetchResponseInit): FetchResponse; /** * Response status codes for responses that cannot have body. * @see https://fetch.spec.whatwg.org/#statuses */ static readonly STATUS_CODES_WITHOUT_BODY: number[]; static readonly STATUS_CODES_WITH_REDIRECT: number[]; static isConfigurableStatusCode(status: number): boolean; static isRedirectResponse(status: number): boolean; /** * Returns a boolean indicating whether the given response status * code represents a response that can have a body. */ static isResponseWithBody(status: number): boolean; static setStatus(status: number, response: Response): void; static setUrl(url: string | undefined, response: Response): void; /** * Parses the given raw HTTP headers into a Fetch API `Headers` instance. */ static parseRawHeaders(rawHeaders: Array): Headers; /** * Safely clones the given `Response`. * Coerces response clone exceptions into 500 mocked responses. * Handy in the environments that introduce arbitrary response * cloning restrictions, like "101 Switching Protocols" cloning * in "miniflare". */ static clone(response: Response): Response; constructor(body?: BodyInit | null, init?: FetchResponseInit); clone(): Response; } //#endregion //#region src/utils/resolve-web-socket-url.d.ts /** * Resolve potentially relative WebSocket URLs the same way * the browser does (replace the protocol, use the origin, etc). * * @see https://websockets.spec.whatwg.org//#dom-websocket-websocket */ declare function resolveWebSocketUrl(url: string | URL): string; //#endregion export { BatchInterceptor, FetchRequest, FetchResponse, type HttpRequestEvent, type HttpRequestEventMap, type HttpResponseEvent, Interceptor, InterceptorError, RequestController, type RequestControllerSource, createRequestId, decodeBuffer, encodeBuffer, getCleanUrl, resolveWebSocketUrl }; //# sourceMappingURL=index.d.ts.map