export interface RequestInit { method?: string; headers?: HeadersInit; body?: string; timeout?: number; redirect?: 'follow' | 'error'; } export type HeadersInit = Record | Array<[string, string]> | Headers; export declare class Headers { private readonly values; constructor(init?: HeadersInit); append(name: string, value: string): void; set(name: string, value: string): void; get(name: string): string | null; has(name: string): boolean; delete(name: string): void; forEach(callback: (value: string, name: string, headers: Headers) => void): void; entries(): Array<[string, string]>; } export declare class Response { private readonly bodyText; readonly status: number; readonly statusText: string; readonly ok: boolean; readonly headers: Headers; constructor(bodyText: string, status: number, statusText: string, headers?: Headers); text(): Promise; json(): Promise; } /** * Fetches a URL and returns a promise that resolves with the response. * @param input the URL to fetch * @param init the request init options * @returns a promise that resolves with the response */ export declare function fetch(input: string, init?: RequestInit): Promise;