electron-dl-manager
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -41,2 +41,3 @@ "use strict"; | ||
isDownloadInterrupted: jest.fn(), | ||
isDownloadResumable: jest.fn(), | ||
isDownloadPaused: jest.fn(), | ||
@@ -43,0 +44,0 @@ item, |
@@ -72,2 +72,5 @@ "use strict"; | ||
} | ||
isDownloadResumable() { | ||
return this.item.canResume(); | ||
} | ||
isDownloadPaused() { | ||
@@ -74,0 +77,0 @@ return this.item.isPaused(); |
@@ -38,2 +38,3 @@ import { EventEmitter } from 'events'; | ||
isDownloadInterrupted: jest.fn(), | ||
isDownloadResumable: jest.fn(), | ||
isDownloadPaused: jest.fn(), | ||
@@ -40,0 +41,0 @@ item, |
@@ -69,2 +69,5 @@ import { generateRandomId } from './utils'; | ||
} | ||
isDownloadResumable() { | ||
return this.item.canResume(); | ||
} | ||
isDownloadPaused() { | ||
@@ -71,0 +74,0 @@ return this.item.isPaused(); |
@@ -51,3 +51,4 @@ import type { DownloadItem, Event, WebContents } from 'electron'; | ||
isDownloadInterrupted(): boolean; | ||
isDownloadResumable(): boolean; | ||
isDownloadPaused(): boolean; | ||
} |
{ | ||
"name": "electron-dl-manager", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "A library for implementing file downloads in Electron with 'save as' dialog and id support.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -72,2 +72,3 @@ # Electron File Download Manager | ||
- [`isDownloadPaused()`](#isdownloadpaused) | ||
- [`isDownloadResumable()`](#isdownloadresumable) | ||
- [`isDownloadCancelled()`](#isdownloadcancelled) | ||
@@ -379,3 +380,8 @@ - [`isDownloadInterrupted()`](#isdownloadinterrupted) | ||
import dayjs from 'dayjs' | ||
import relativeTime from 'dayjs/plugin/relativeTime'; | ||
import duration from 'dayjs/plugin/duration'; | ||
dayjs.extend(relativeTime); | ||
dayjs.extend(duration); | ||
const downloadData = manager.getDownloadData(id); // or DataItem from the callbacks | ||
@@ -406,2 +412,10 @@ | ||
### `isDownloadResumable()` | ||
Returns true if the download is resumable. | ||
```typescript | ||
isDownloadResumable(): boolean | ||
``` | ||
### `isDownloadCancelled()` | ||
@@ -408,0 +422,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
287356
1884
454