0.0.12 • Published 9 months ago

@capgo/capacitor-downloader v0.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@capgo/capacitor-downloader

Download file in background or foreground

WIP: the plugin is not yet ready for production

Install

npm install @capgo/capacitor-downloader
npx cap sync

API

download(...)

download(options: DownloadOptions) => any
ParamType
optionsDownloadOptions

Returns: any


pause(...)

pause(id: string) => any
ParamType
idstring

Returns: any


resume(...)

resume(id: string) => any
ParamType
idstring

Returns: any


stop(...)

stop(id: string) => any
ParamType
idstring

Returns: any


checkStatus(...)

checkStatus(id: string) => any
ParamType
idstring

Returns: any


getFileInfo(...)

getFileInfo(path: string) => any
ParamType
pathstring

Returns: any


addListener('downloadProgress', ...)

addListener(eventName: 'downloadProgress', listenerFunc: (progress: { id: string; progress: number; }) => void) => any
ParamType
eventName'downloadProgress'
listenerFunc(progress: { id: string; progress: number; }) => void

Returns: any


addListener('downloadCompleted', ...)

addListener(eventName: 'downloadCompleted', listenerFunc: (result: { id: string; }) => void) => any
ParamType
eventName'downloadCompleted'
listenerFunc(result: { id: string; }) => void

Returns: any


addListener('downloadFailed', ...)

addListener(eventName: 'downloadFailed', listenerFunc: (error: { id: string; error: string; }) => void) => any
ParamType
eventName'downloadFailed'
listenerFunc(error: { id: string; error: string; }) => void

Returns: any


removeAllListeners()

removeAllListeners() => any

Returns: any


Interfaces

DownloadOptions

PropType
idstring
urlstring
destinationstring
headers{ key: string: string; }
network'cellular' | 'wifi-only'
priority'high' | 'normal' | 'low'

DownloadTask

PropType
idstring
progressnumber
state'PENDING' | 'RUNNING' | 'PAUSED' | 'DONE' | 'ERROR'

PluginListenerHandle

PropType
remove() => any

Credit

This plugin was inspired from: https://github.com/kesha-antonov/react-native-background-downloader

0.0.12

9 months ago

0.0.11

9 months ago

0.0.8

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago