UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

44 lines • 1.48 kB
import type { ByteSource } from '../../../io/types.ts'; import { type CookieJar } from './cookie.ts'; export declare const DEFAULT_USER_AGENT = "Mozilla/5.0 (compatible; mirage/1.0)"; export interface HttpResponse { status: number; reason: string; body: ByteSource; url: string; method: string; headers: [string, string][]; history: HttpResponse[]; } export declare function isHttpError(resp: HttpResponse): boolean; export declare function registerInsecureFetch(fn: typeof fetch | null): void; export interface HttpRequestOptions { method?: string; headers?: Record<string, string>; body?: Uint8Array; timeoutMs?: number | null; followRedirects?: boolean; verify?: boolean; signal?: AbortSignal; cookies?: CookieJar; stream?: boolean; } export declare function httpRequest(url: string, options?: HttpRequestOptions): Promise<HttpResponse>; export declare function httpFormRequest(url: string, opts?: { method?: string; formData?: Record<string, string>; headers?: Record<string, string>; timeoutMs?: number | null; followRedirects?: boolean; verify?: boolean; signal?: AbortSignal; cookies?: CookieJar; stream?: boolean; }): Promise<HttpResponse>; export declare function httpGet(url: string, opts?: { headers?: Record<string, string>; timeoutMs?: number | null; signal?: AbortSignal; stream?: boolean; }): Promise<HttpResponse>; //# sourceMappingURL=http.d.ts.map