UNPKG

bandcamp-fetch

Version:
27 lines 905 B
import type Cache from './Cache.js'; export declare enum FetchMethod { GET = "GET", POST = "POST", HEAD = "HEAD" } export interface FetcherParams { cookie?: string | null; cache: Cache; } export default class Fetcher { #private; constructor(params: FetcherParams); setCookie(value?: string | null): void; get cookie(): string | null | undefined; fetch(url: string, jsonResponse: false, method: FetchMethod.HEAD, payload?: undefined): Promise<{ ok: boolean; status: number; }>; fetch(url: string, jsonResponse: true, method?: FetchMethod, payload?: Record<string, any>): Promise<any>; fetch(url: string, jsonResponse?: boolean, method?: FetchMethod, payload?: Record<string, any>): Promise<string>; } export declare class FetchError extends Error { code?: number; constructor(payload: any); } //# sourceMappingURL=Fetcher.d.ts.map