@capgo/capacitor-downloader 8.0.6 → 8.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -20
- package/android/src/main/java/ee/forgr/capacitor/plugin/downloader/CapacitorDownloaderPlugin.java +8 -2
- package/dist/docs.json +25 -25
- package/dist/esm/definitions.d.ts +20 -10
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +15 -5
- package/dist/esm/web.js +10 -10
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +10 -10
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +10 -10
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorDownloaderPlugin/CapacitorDownloaderPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,15 +80,15 @@ Start a new download task.
|
|
|
80
80
|
### pause(...)
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
|
-
pause(id: string) => Promise<void>
|
|
83
|
+
pause(options: { id: string; }) => Promise<void>
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Pause an active download.
|
|
87
87
|
Download can be resumed later from the same position.
|
|
88
88
|
|
|
89
|
-
| Param
|
|
90
|
-
|
|
|
91
|
-
| **`
|
|
89
|
+
| Param | Type | Description |
|
|
90
|
+
| ------------- | ---------------------------- | ----------------------------------------- |
|
|
91
|
+
| **`options`** | <code>{ id: string; }</code> | - Options containing the download task ID |
|
|
92
92
|
|
|
93
93
|
--------------------
|
|
94
94
|
|
|
@@ -96,15 +96,15 @@ Download can be resumed later from the same position.
|
|
|
96
96
|
### resume(...)
|
|
97
97
|
|
|
98
98
|
```typescript
|
|
99
|
-
resume(id: string) => Promise<void>
|
|
99
|
+
resume(options: { id: string; }) => Promise<void>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
Resume a paused download.
|
|
103
103
|
Continues from where it was paused.
|
|
104
104
|
|
|
105
|
-
| Param
|
|
106
|
-
|
|
|
107
|
-
| **`
|
|
105
|
+
| Param | Type | Description |
|
|
106
|
+
| ------------- | ---------------------------- | ----------------------------------------- |
|
|
107
|
+
| **`options`** | <code>{ id: string; }</code> | - Options containing the download task ID |
|
|
108
108
|
|
|
109
109
|
--------------------
|
|
110
110
|
|
|
@@ -112,15 +112,15 @@ Continues from where it was paused.
|
|
|
112
112
|
### stop(...)
|
|
113
113
|
|
|
114
114
|
```typescript
|
|
115
|
-
stop(id: string) => Promise<void>
|
|
115
|
+
stop(options: { id: string; }) => Promise<void>
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
Stop and cancel a download permanently.
|
|
119
119
|
Downloaded data will be deleted.
|
|
120
120
|
|
|
121
|
-
| Param
|
|
122
|
-
|
|
|
123
|
-
| **`
|
|
121
|
+
| Param | Type | Description |
|
|
122
|
+
| ------------- | ---------------------------- | ----------------------------------------- |
|
|
123
|
+
| **`options`** | <code>{ id: string; }</code> | - Options containing the download task ID |
|
|
124
124
|
|
|
125
125
|
--------------------
|
|
126
126
|
|
|
@@ -128,14 +128,14 @@ Downloaded data will be deleted.
|
|
|
128
128
|
### checkStatus(...)
|
|
129
129
|
|
|
130
130
|
```typescript
|
|
131
|
-
checkStatus(id: string) => Promise<DownloadTask>
|
|
131
|
+
checkStatus(options: { id: string; }) => Promise<DownloadTask>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
Check the current status of a download.
|
|
135
135
|
|
|
136
|
-
| Param
|
|
137
|
-
|
|
|
138
|
-
| **`
|
|
136
|
+
| Param | Type | Description |
|
|
137
|
+
| ------------- | ---------------------------- | ----------------------------------------- |
|
|
138
|
+
| **`options`** | <code>{ id: string; }</code> | - Options containing the download task ID |
|
|
139
139
|
|
|
140
140
|
**Returns:** <code>Promise<<a href="#downloadtask">DownloadTask</a>></code>
|
|
141
141
|
|
|
@@ -145,14 +145,14 @@ Check the current status of a download.
|
|
|
145
145
|
### getFileInfo(...)
|
|
146
146
|
|
|
147
147
|
```typescript
|
|
148
|
-
getFileInfo(path: string) => Promise<{ size: number; type: string; }>
|
|
148
|
+
getFileInfo(options: { path: string; }) => Promise<{ size: number; type: string; }>
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
Get information about a downloaded file.
|
|
152
152
|
|
|
153
|
-
| Param
|
|
154
|
-
|
|
|
155
|
-
| **`
|
|
153
|
+
| Param | Type | Description |
|
|
154
|
+
| ------------- | ------------------------------ | ---------------------------------- |
|
|
155
|
+
| **`options`** | <code>{ path: string; }</code> | - Options containing the file path |
|
|
156
156
|
|
|
157
157
|
**Returns:** <code>Promise<{ size: number; type: string; }></code>
|
|
158
158
|
|
package/android/src/main/java/ee/forgr/capacitor/plugin/downloader/CapacitorDownloaderPlugin.java
CHANGED
|
@@ -9,6 +9,7 @@ import android.database.Cursor;
|
|
|
9
9
|
import android.net.Uri;
|
|
10
10
|
import android.os.Handler;
|
|
11
11
|
import android.os.Looper;
|
|
12
|
+
import androidx.core.content.ContextCompat;
|
|
12
13
|
import com.getcapacitor.JSObject;
|
|
13
14
|
import com.getcapacitor.Plugin;
|
|
14
15
|
import com.getcapacitor.PluginCall;
|
|
@@ -22,7 +23,7 @@ import java.util.Map;
|
|
|
22
23
|
@CapacitorPlugin(name = "CapacitorDownloader")
|
|
23
24
|
public class CapacitorDownloaderPlugin extends Plugin {
|
|
24
25
|
|
|
25
|
-
private final String pluginVersion = "8.0.
|
|
26
|
+
private final String pluginVersion = "8.0.8";
|
|
26
27
|
|
|
27
28
|
private DownloadManager downloadManager;
|
|
28
29
|
private final Map<String, Long> downloads = new HashMap<>();
|
|
@@ -46,7 +47,12 @@ public class CapacitorDownloaderPlugin extends Plugin {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
|
-
|
|
50
|
+
ContextCompat.registerReceiver(
|
|
51
|
+
getContext(),
|
|
52
|
+
downloadReceiver,
|
|
53
|
+
new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE),
|
|
54
|
+
ContextCompat.RECEIVER_EXPORTED
|
|
55
|
+
);
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
private String getDownloadIdByValue(long value) {
|
package/dist/docs.json
CHANGED
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"name": "pause",
|
|
42
|
-
"signature": "(id: string) => Promise<void>",
|
|
42
|
+
"signature": "(options: { id: string; }) => Promise<void>",
|
|
43
43
|
"parameters": [
|
|
44
44
|
{
|
|
45
|
-
"name": "
|
|
46
|
-
"docs": "-
|
|
47
|
-
"type": "string"
|
|
45
|
+
"name": "options",
|
|
46
|
+
"docs": "- Options containing the download task ID",
|
|
47
|
+
"type": "{ id: string; }"
|
|
48
48
|
}
|
|
49
49
|
],
|
|
50
50
|
"returns": "Promise<void>",
|
|
51
51
|
"tags": [
|
|
52
52
|
{
|
|
53
53
|
"name": "param",
|
|
54
|
-
"text": "
|
|
54
|
+
"text": "options - Options containing the download task ID"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"name": "returns",
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"name": "resume",
|
|
67
|
-
"signature": "(id: string) => Promise<void>",
|
|
67
|
+
"signature": "(options: { id: string; }) => Promise<void>",
|
|
68
68
|
"parameters": [
|
|
69
69
|
{
|
|
70
|
-
"name": "
|
|
71
|
-
"docs": "-
|
|
72
|
-
"type": "string"
|
|
70
|
+
"name": "options",
|
|
71
|
+
"docs": "- Options containing the download task ID",
|
|
72
|
+
"type": "{ id: string; }"
|
|
73
73
|
}
|
|
74
74
|
],
|
|
75
75
|
"returns": "Promise<void>",
|
|
76
76
|
"tags": [
|
|
77
77
|
{
|
|
78
78
|
"name": "param",
|
|
79
|
-
"text": "
|
|
79
|
+
"text": "options - Options containing the download task ID"
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
"name": "returns",
|
|
@@ -89,19 +89,19 @@
|
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"name": "stop",
|
|
92
|
-
"signature": "(id: string) => Promise<void>",
|
|
92
|
+
"signature": "(options: { id: string; }) => Promise<void>",
|
|
93
93
|
"parameters": [
|
|
94
94
|
{
|
|
95
|
-
"name": "
|
|
96
|
-
"docs": "-
|
|
97
|
-
"type": "string"
|
|
95
|
+
"name": "options",
|
|
96
|
+
"docs": "- Options containing the download task ID",
|
|
97
|
+
"type": "{ id: string; }"
|
|
98
98
|
}
|
|
99
99
|
],
|
|
100
100
|
"returns": "Promise<void>",
|
|
101
101
|
"tags": [
|
|
102
102
|
{
|
|
103
103
|
"name": "param",
|
|
104
|
-
"text": "
|
|
104
|
+
"text": "options - Options containing the download task ID"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
"name": "returns",
|
|
@@ -114,19 +114,19 @@
|
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"name": "checkStatus",
|
|
117
|
-
"signature": "(id: string) => Promise<DownloadTask>",
|
|
117
|
+
"signature": "(options: { id: string; }) => Promise<DownloadTask>",
|
|
118
118
|
"parameters": [
|
|
119
119
|
{
|
|
120
|
-
"name": "
|
|
121
|
-
"docs": "-
|
|
122
|
-
"type": "string"
|
|
120
|
+
"name": "options",
|
|
121
|
+
"docs": "- Options containing the download task ID",
|
|
122
|
+
"type": "{ id: string; }"
|
|
123
123
|
}
|
|
124
124
|
],
|
|
125
125
|
"returns": "Promise<DownloadTask>",
|
|
126
126
|
"tags": [
|
|
127
127
|
{
|
|
128
128
|
"name": "param",
|
|
129
|
-
"text": "
|
|
129
|
+
"text": "options - Options containing the download task ID"
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
"name": "returns",
|
|
@@ -141,19 +141,19 @@
|
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
"name": "getFileInfo",
|
|
144
|
-
"signature": "(path: string) => Promise<{ size: number; type: string; }>",
|
|
144
|
+
"signature": "(options: { path: string; }) => Promise<{ size: number; type: string; }>",
|
|
145
145
|
"parameters": [
|
|
146
146
|
{
|
|
147
|
-
"name": "
|
|
148
|
-
"docs": "-
|
|
149
|
-
"type": "string"
|
|
147
|
+
"name": "options",
|
|
148
|
+
"docs": "- Options containing the file path",
|
|
149
|
+
"type": "{ path: string; }"
|
|
150
150
|
}
|
|
151
151
|
],
|
|
152
152
|
"returns": "Promise<{ size: number; type: string; }>",
|
|
153
153
|
"tags": [
|
|
154
154
|
{
|
|
155
155
|
"name": "param",
|
|
156
|
-
"text": "
|
|
156
|
+
"text": "options - Options containing the file path"
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
"name": "returns",
|
|
@@ -53,40 +53,50 @@ export interface CapacitorDownloaderPlugin {
|
|
|
53
53
|
* Pause an active download.
|
|
54
54
|
* Download can be resumed later from the same position.
|
|
55
55
|
*
|
|
56
|
-
* @param
|
|
56
|
+
* @param options - Options containing the download task ID
|
|
57
57
|
* @returns Promise that resolves when paused
|
|
58
58
|
*/
|
|
59
|
-
pause(
|
|
59
|
+
pause(options: {
|
|
60
|
+
id: string;
|
|
61
|
+
}): Promise<void>;
|
|
60
62
|
/**
|
|
61
63
|
* Resume a paused download.
|
|
62
64
|
* Continues from where it was paused.
|
|
63
65
|
*
|
|
64
|
-
* @param
|
|
66
|
+
* @param options - Options containing the download task ID
|
|
65
67
|
* @returns Promise that resolves when resumed
|
|
66
68
|
*/
|
|
67
|
-
resume(
|
|
69
|
+
resume(options: {
|
|
70
|
+
id: string;
|
|
71
|
+
}): Promise<void>;
|
|
68
72
|
/**
|
|
69
73
|
* Stop and cancel a download permanently.
|
|
70
74
|
* Downloaded data will be deleted.
|
|
71
75
|
*
|
|
72
|
-
* @param
|
|
76
|
+
* @param options - Options containing the download task ID
|
|
73
77
|
* @returns Promise that resolves when stopped
|
|
74
78
|
*/
|
|
75
|
-
stop(
|
|
79
|
+
stop(options: {
|
|
80
|
+
id: string;
|
|
81
|
+
}): Promise<void>;
|
|
76
82
|
/**
|
|
77
83
|
* Check the current status of a download.
|
|
78
84
|
*
|
|
79
|
-
* @param
|
|
85
|
+
* @param options - Options containing the download task ID
|
|
80
86
|
* @returns Promise with current download task status
|
|
81
87
|
*/
|
|
82
|
-
checkStatus(
|
|
88
|
+
checkStatus(options: {
|
|
89
|
+
id: string;
|
|
90
|
+
}): Promise<DownloadTask>;
|
|
83
91
|
/**
|
|
84
92
|
* Get information about a downloaded file.
|
|
85
93
|
*
|
|
86
|
-
* @param
|
|
94
|
+
* @param options - Options containing the file path
|
|
87
95
|
* @returns Promise with file size and MIME type
|
|
88
96
|
*/
|
|
89
|
-
getFileInfo(
|
|
97
|
+
getFileInfo(options: {
|
|
98
|
+
path: string;
|
|
99
|
+
}): Promise<{
|
|
90
100
|
size: number;
|
|
91
101
|
type: string;
|
|
92
102
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * Represents the current state and progress of a download task.\n */\nexport interface DownloadTask {\n /** Unique identifier for the download task */\n id: string;\n /** Download progress from 0 to 100 */\n progress: number;\n /** Current state of the download */\n state: 'PENDING' | 'RUNNING' | 'PAUSED' | 'DONE' | 'ERROR';\n}\n\n/**\n * Configuration options for starting a download.\n */\nexport interface DownloadOptions {\n /** Unique identifier for this download task */\n id: string;\n /** URL of the file to download */\n url: string;\n /** Local file path where the download will be saved */\n destination: string;\n /** Optional HTTP headers to include in the request */\n headers?: { [key: string]: string };\n /** Network type requirement for download */\n network?: 'cellular' | 'wifi-only';\n /** Download priority level */\n priority?: 'high' | 'normal' | 'low';\n}\n\n/**\n * Capacitor plugin for downloading files with background support.\n * Provides resumable downloads with progress tracking.\n */\nexport interface CapacitorDownloaderPlugin {\n /**\n * Start a new download task.\n *\n * @param options - Download configuration\n * @returns Promise with initial download task status\n * @example\n * ```typescript\n * const task = await Downloader.download({\n * id: 'my-download',\n * url: 'https://example.com/file.pdf',\n * destination: 'downloads/file.pdf'\n * });\n * ```\n */\n download(options: DownloadOptions): Promise<DownloadTask>;\n\n /**\n * Pause an active download.\n * Download can be resumed later from the same position.\n *\n * @param
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * Represents the current state and progress of a download task.\n */\nexport interface DownloadTask {\n /** Unique identifier for the download task */\n id: string;\n /** Download progress from 0 to 100 */\n progress: number;\n /** Current state of the download */\n state: 'PENDING' | 'RUNNING' | 'PAUSED' | 'DONE' | 'ERROR';\n}\n\n/**\n * Configuration options for starting a download.\n */\nexport interface DownloadOptions {\n /** Unique identifier for this download task */\n id: string;\n /** URL of the file to download */\n url: string;\n /** Local file path where the download will be saved */\n destination: string;\n /** Optional HTTP headers to include in the request */\n headers?: { [key: string]: string };\n /** Network type requirement for download */\n network?: 'cellular' | 'wifi-only';\n /** Download priority level */\n priority?: 'high' | 'normal' | 'low';\n}\n\n/**\n * Capacitor plugin for downloading files with background support.\n * Provides resumable downloads with progress tracking.\n */\nexport interface CapacitorDownloaderPlugin {\n /**\n * Start a new download task.\n *\n * @param options - Download configuration\n * @returns Promise with initial download task status\n * @example\n * ```typescript\n * const task = await Downloader.download({\n * id: 'my-download',\n * url: 'https://example.com/file.pdf',\n * destination: 'downloads/file.pdf'\n * });\n * ```\n */\n download(options: DownloadOptions): Promise<DownloadTask>;\n\n /**\n * Pause an active download.\n * Download can be resumed later from the same position.\n *\n * @param options - Options containing the download task ID\n * @returns Promise that resolves when paused\n */\n pause(options: { id: string }): Promise<void>;\n\n /**\n * Resume a paused download.\n * Continues from where it was paused.\n *\n * @param options - Options containing the download task ID\n * @returns Promise that resolves when resumed\n */\n resume(options: { id: string }): Promise<void>;\n\n /**\n * Stop and cancel a download permanently.\n * Downloaded data will be deleted.\n *\n * @param options - Options containing the download task ID\n * @returns Promise that resolves when stopped\n */\n stop(options: { id: string }): Promise<void>;\n\n /**\n * Check the current status of a download.\n *\n * @param options - Options containing the download task ID\n * @returns Promise with current download task status\n */\n checkStatus(options: { id: string }): Promise<DownloadTask>;\n\n /**\n * Get information about a downloaded file.\n *\n * @param options - Options containing the file path\n * @returns Promise with file size and MIME type\n */\n getFileInfo(options: { path: string }): Promise<{ size: number; type: string }>;\n\n /**\n * Listen for download progress updates.\n * Fired periodically as download progresses.\n *\n * @param eventName - Must be 'downloadProgress'\n * @param listenerFunc - Callback receiving progress updates\n * @returns Promise with listener handle for removal\n * @example\n * ```typescript\n * const listener = await Downloader.addListener('downloadProgress', (data) => {\n * console.log(`Download ${data.id}: ${data.progress}%`);\n * });\n * ```\n */\n addListener(\n eventName: 'downloadProgress',\n listenerFunc: (progress: { id: string; progress: number }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for download completion.\n * Fired when a download finishes successfully.\n *\n * @param eventName - Must be 'downloadCompleted'\n * @param listenerFunc - Callback receiving completion notification\n * @returns Promise with listener handle for removal\n */\n addListener(\n eventName: 'downloadCompleted',\n listenerFunc: (result: { id: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for download failures.\n * Fired when a download encounters an error.\n *\n * @param eventName - Must be 'downloadFailed'\n * @param listenerFunc - Callback receiving error information\n * @returns Promise with listener handle for removal\n */\n addListener(\n eventName: 'downloadFailed',\n listenerFunc: (error: { id: string; error: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all event listeners.\n * Cleanup method to prevent memory leaks.\n *\n * @returns Promise that resolves when all listeners removed\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Get the plugin version number.\n *\n * @returns Promise with version string\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -2,11 +2,21 @@ import { WebPlugin } from '@capacitor/core';
|
|
|
2
2
|
import type { CapacitorDownloaderPlugin, DownloadTask, DownloadOptions } from './definitions';
|
|
3
3
|
export declare class CapacitorDownloaderWeb extends WebPlugin implements CapacitorDownloaderPlugin {
|
|
4
4
|
download(options: DownloadOptions): Promise<DownloadTask>;
|
|
5
|
-
pause(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
pause(options: {
|
|
6
|
+
id: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
resume(options: {
|
|
9
|
+
id: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
stop(options: {
|
|
12
|
+
id: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
checkStatus(options: {
|
|
15
|
+
id: string;
|
|
16
|
+
}): Promise<DownloadTask>;
|
|
17
|
+
getFileInfo(options: {
|
|
18
|
+
path: string;
|
|
19
|
+
}): Promise<{
|
|
10
20
|
size: number;
|
|
11
21
|
type: string;
|
|
12
22
|
}>;
|
package/dist/esm/web.js
CHANGED
|
@@ -4,24 +4,24 @@ export class CapacitorDownloaderWeb extends WebPlugin {
|
|
|
4
4
|
console.log('DOWNLOAD', options);
|
|
5
5
|
throw new Error('Method not implemented.');
|
|
6
6
|
}
|
|
7
|
-
async pause(
|
|
8
|
-
console.log('PAUSE', id);
|
|
7
|
+
async pause(options) {
|
|
8
|
+
console.log('PAUSE', options.id);
|
|
9
9
|
throw new Error('Method not implemented.');
|
|
10
10
|
}
|
|
11
|
-
async resume(
|
|
12
|
-
console.log('RESUME', id);
|
|
11
|
+
async resume(options) {
|
|
12
|
+
console.log('RESUME', options.id);
|
|
13
13
|
throw new Error('Method not implemented.');
|
|
14
14
|
}
|
|
15
|
-
async stop(
|
|
16
|
-
console.log('STOP', id);
|
|
15
|
+
async stop(options) {
|
|
16
|
+
console.log('STOP', options.id);
|
|
17
17
|
throw new Error('Method not implemented.');
|
|
18
18
|
}
|
|
19
|
-
async checkStatus(
|
|
20
|
-
console.log('CHECK STATUS', id);
|
|
19
|
+
async checkStatus(options) {
|
|
20
|
+
console.log('CHECK STATUS', options.id);
|
|
21
21
|
throw new Error('Method not implemented.');
|
|
22
22
|
}
|
|
23
|
-
async getFileInfo(
|
|
24
|
-
console.log('GET FILE INFO', path);
|
|
23
|
+
async getFileInfo(options) {
|
|
24
|
+
console.log('GET FILE INFO', options.path);
|
|
25
25
|
throw new Error('Method not implemented.');
|
|
26
26
|
}
|
|
27
27
|
async getPluginVersion() {
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IACnD,KAAK,CAAC,QAAQ,CAAC,OAAwB;QACrC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IACnD,KAAK,CAAC,QAAQ,CAAC,OAAwB;QACrC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,OAAuB;QACjC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAuB;QAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAAuB;QACvC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAAyB;QACzC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorDownloaderPlugin, DownloadTask, DownloadOptions } from './definitions';\n\nexport class CapacitorDownloaderWeb extends WebPlugin implements CapacitorDownloaderPlugin {\n async download(options: DownloadOptions): Promise<DownloadTask> {\n console.log('DOWNLOAD', options);\n throw new Error('Method not implemented.');\n }\n async pause(options: { id: string }): Promise<void> {\n console.log('PAUSE', options.id);\n throw new Error('Method not implemented.');\n }\n async resume(options: { id: string }): Promise<void> {\n console.log('RESUME', options.id);\n throw new Error('Method not implemented.');\n }\n async stop(options: { id: string }): Promise<void> {\n console.log('STOP', options.id);\n throw new Error('Method not implemented.');\n }\n async checkStatus(options: { id: string }): Promise<DownloadTask> {\n console.log('CHECK STATUS', options.id);\n throw new Error('Method not implemented.');\n }\n async getFileInfo(options: { path: string }): Promise<{ size: number; type: string }> {\n console.log('GET FILE INFO', options.path);\n throw new Error('Method not implemented.');\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -11,24 +11,24 @@ class CapacitorDownloaderWeb extends core.WebPlugin {
|
|
|
11
11
|
console.log('DOWNLOAD', options);
|
|
12
12
|
throw new Error('Method not implemented.');
|
|
13
13
|
}
|
|
14
|
-
async pause(
|
|
15
|
-
console.log('PAUSE', id);
|
|
14
|
+
async pause(options) {
|
|
15
|
+
console.log('PAUSE', options.id);
|
|
16
16
|
throw new Error('Method not implemented.');
|
|
17
17
|
}
|
|
18
|
-
async resume(
|
|
19
|
-
console.log('RESUME', id);
|
|
18
|
+
async resume(options) {
|
|
19
|
+
console.log('RESUME', options.id);
|
|
20
20
|
throw new Error('Method not implemented.');
|
|
21
21
|
}
|
|
22
|
-
async stop(
|
|
23
|
-
console.log('STOP', id);
|
|
22
|
+
async stop(options) {
|
|
23
|
+
console.log('STOP', options.id);
|
|
24
24
|
throw new Error('Method not implemented.');
|
|
25
25
|
}
|
|
26
|
-
async checkStatus(
|
|
27
|
-
console.log('CHECK STATUS', id);
|
|
26
|
+
async checkStatus(options) {
|
|
27
|
+
console.log('CHECK STATUS', options.id);
|
|
28
28
|
throw new Error('Method not implemented.');
|
|
29
29
|
}
|
|
30
|
-
async getFileInfo(
|
|
31
|
-
console.log('GET FILE INFO', path);
|
|
30
|
+
async getFileInfo(options) {
|
|
31
|
+
console.log('GET FILE INFO', options.path);
|
|
32
32
|
throw new Error('Method not implemented.');
|
|
33
33
|
}
|
|
34
34
|
async getPluginVersion() {
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorDownloader = registerPlugin('CapacitorDownloader', {\n web: () => import('./web').then((m) => new m.CapacitorDownloaderWeb()),\n});\nexport * from './definitions';\nexport { CapacitorDownloader };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorDownloaderWeb extends WebPlugin {\n async download(options) {\n console.log('DOWNLOAD', options);\n throw new Error('Method not implemented.');\n }\n async pause(
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorDownloader = registerPlugin('CapacitorDownloader', {\n web: () => import('./web').then((m) => new m.CapacitorDownloaderWeb()),\n});\nexport * from './definitions';\nexport { CapacitorDownloader };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorDownloaderWeb extends WebPlugin {\n async download(options) {\n console.log('DOWNLOAD', options);\n throw new Error('Method not implemented.');\n }\n async pause(options) {\n console.log('PAUSE', options.id);\n throw new Error('Method not implemented.');\n }\n async resume(options) {\n console.log('RESUME', options.id);\n throw new Error('Method not implemented.');\n }\n async stop(options) {\n console.log('STOP', options.id);\n throw new Error('Method not implemented.');\n }\n async checkStatus(options) {\n console.log('CHECK STATUS', options.id);\n throw new Error('Method not implemented.');\n }\n async getFileInfo(options) {\n console.log('GET FILE INFO', options.path);\n throw new Error('Method not implemented.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;AAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;AAC1E,CAAC;;ACFM,MAAM,sBAAsB,SAASC,cAAS,CAAC;AACtD,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC;AACxC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;AACzB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;AACxC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;AACzC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;AACvC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC;AAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -10,24 +10,24 @@ var capacitorCapacitorDownloader = (function (exports, core) {
|
|
|
10
10
|
console.log('DOWNLOAD', options);
|
|
11
11
|
throw new Error('Method not implemented.');
|
|
12
12
|
}
|
|
13
|
-
async pause(
|
|
14
|
-
console.log('PAUSE', id);
|
|
13
|
+
async pause(options) {
|
|
14
|
+
console.log('PAUSE', options.id);
|
|
15
15
|
throw new Error('Method not implemented.');
|
|
16
16
|
}
|
|
17
|
-
async resume(
|
|
18
|
-
console.log('RESUME', id);
|
|
17
|
+
async resume(options) {
|
|
18
|
+
console.log('RESUME', options.id);
|
|
19
19
|
throw new Error('Method not implemented.');
|
|
20
20
|
}
|
|
21
|
-
async stop(
|
|
22
|
-
console.log('STOP', id);
|
|
21
|
+
async stop(options) {
|
|
22
|
+
console.log('STOP', options.id);
|
|
23
23
|
throw new Error('Method not implemented.');
|
|
24
24
|
}
|
|
25
|
-
async checkStatus(
|
|
26
|
-
console.log('CHECK STATUS', id);
|
|
25
|
+
async checkStatus(options) {
|
|
26
|
+
console.log('CHECK STATUS', options.id);
|
|
27
27
|
throw new Error('Method not implemented.');
|
|
28
28
|
}
|
|
29
|
-
async getFileInfo(
|
|
30
|
-
console.log('GET FILE INFO', path);
|
|
29
|
+
async getFileInfo(options) {
|
|
30
|
+
console.log('GET FILE INFO', options.path);
|
|
31
31
|
throw new Error('Method not implemented.');
|
|
32
32
|
}
|
|
33
33
|
async getPluginVersion() {
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorDownloader = registerPlugin('CapacitorDownloader', {\n web: () => import('./web').then((m) => new m.CapacitorDownloaderWeb()),\n});\nexport * from './definitions';\nexport { CapacitorDownloader };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorDownloaderWeb extends WebPlugin {\n async download(options) {\n console.log('DOWNLOAD', options);\n throw new Error('Method not implemented.');\n }\n async pause(
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorDownloader = registerPlugin('CapacitorDownloader', {\n web: () => import('./web').then((m) => new m.CapacitorDownloaderWeb()),\n});\nexport * from './definitions';\nexport { CapacitorDownloader };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorDownloaderWeb extends WebPlugin {\n async download(options) {\n console.log('DOWNLOAD', options);\n throw new Error('Method not implemented.');\n }\n async pause(options) {\n console.log('PAUSE', options.id);\n throw new Error('Method not implemented.');\n }\n async resume(options) {\n console.log('RESUME', options.id);\n throw new Error('Method not implemented.');\n }\n async stop(options) {\n console.log('STOP', options.id);\n throw new Error('Method not implemented.');\n }\n async checkStatus(options) {\n console.log('CHECK STATUS', options.id);\n throw new Error('Method not implemented.');\n }\n async getFileInfo(options) {\n console.log('GET FILE INFO', options.path);\n throw new Error('Method not implemented.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;IAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;IAC1E,CAAC;;ICFM,MAAM,sBAAsB,SAASC,cAAS,CAAC;IACtD,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC;IACxC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;IACzB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;IACxC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;IAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;IACzC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACvC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,CAAC;IAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC;IAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -8,7 +8,7 @@ import Capacitor
|
|
|
8
8
|
|
|
9
9
|
@objc(CapacitorDownloaderPlugin)
|
|
10
10
|
public class CapacitorDownloaderPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
11
|
-
private let pluginVersion: String = "8.0.
|
|
11
|
+
private let pluginVersion: String = "8.0.8"
|
|
12
12
|
public let identifier = "CapacitorDownloaderPlugin"
|
|
13
13
|
public let jsName = "CapacitorDownloader"
|
|
14
14
|
public let pluginMethods: [CAPPluginMethod] = [
|