UNPKG

opds-web-client

Version:
28 lines (27 loc) 814 B
import { AuthCredentials } from "./interfaces"; export interface RequestError { status: number; response: string; url: string; headers?: any; } export interface RequestRejector { (err: RequestError): any; } export default class DataFetcher { authKey: string; private proxyUrl; private adapter; constructor(config?: { proxyUrl?: string; adapter?: any; }); fetchOPDSData(url: string): Promise<{}>; fetchSearchDescriptionData(searchDescriptionUrl: string): Promise<{}>; fetch(url: string, options?: {}): Promise<IResponse>; setAuthCredentials(credentials: AuthCredentials): void; getAuthCredentials(): AuthCredentials; clearAuthCredentials(): void; prepareAuthHeaders(headers?: any): any; isErrorCode(status: number): boolean; }