UNPKG

@triniwiz/nativescript-downloader

Version:

Download Manager for NativeScript

21 lines (20 loc) 962 B
import { DownloaderBase, DownloadOptions, StatusCode, ProgressEventData, DownloadEventData, DownloadEventError, DownloadsData } from './common'; export { DownloadsData, DownloadOptions, ProgressEventData, DownloadEventData, DownloadEventError }; export declare class Downloader extends DownloaderBase { static _downloads: Map<string, number>; static _downloadsData: Map<string, DownloadsData>; static _downloadRequests: Map<number, string>; static _fetch: com.tonyodev.fetch2.Fetch; static _okHttpClient: okhttp3.OkHttpClient; static _timeout: number; constructor(); private static _setFetcher; static setTimeout(timeout: number): void; createDownload(options: DownloadOptions): string; getStatus(id: string): StatusCode; start(id: string, progress?: Function): Promise<DownloadEventData>; resume(id: string): void; cancel(id: string): void; pause(id: string): void; getPath(id: string): string; }