UNPKG

opds-web-client

Version:
27 lines (26 loc) 773 B
export interface RequestError { status: number; response: string; url: string; headers?: any; } export interface RequestRejector { (err: RequestError): any; } export default class DataFetcher { basicAuthKey: 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>; setBasicAuthCredentials(credentials: string): void; getBasicAuthCredentials(): string; clearBasicAuthCredentials(): void; prepareBasicAuthHeaders(headers?: any): any; isErrorCode(status: number): boolean; }