@uploadista/react-native-core 0.1.3-beta.9 → 0.1.4-beta.1
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/dist/index.d.mts +12 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/hooks/use-flow.ts +15 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/react-native-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core React Native client for Uploadista",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"uuid": "^13.0.0",
|
|
17
17
|
"js-base64": "^3.7.7",
|
|
18
|
-
"@uploadista/
|
|
19
|
-
"@uploadista/core": "0.1.
|
|
18
|
+
"@uploadista/core": "0.1.4-beta.1",
|
|
19
|
+
"@uploadista/client-core": "0.1.4-beta.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react": ">=16.8.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": ">=18.0.0",
|
|
33
33
|
"tsdown": "0.20.1",
|
|
34
|
-
"@uploadista/typescript-config": "0.1.
|
|
34
|
+
"@uploadista/typescript-config": "0.1.4-beta.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc --noEmit && tsdown",
|
package/src/hooks/use-flow.ts
CHANGED
|
@@ -130,7 +130,7 @@ export interface UseFlowReturn {
|
|
|
130
130
|
/**
|
|
131
131
|
* Abort the current upload
|
|
132
132
|
*/
|
|
133
|
-
abort: () => void
|
|
133
|
+
abort: () => Promise<void>;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
* Reset the upload state and clear all inputs
|
|
@@ -172,6 +172,11 @@ export interface UseFlowReturn {
|
|
|
172
172
|
*/
|
|
173
173
|
pause: () => void;
|
|
174
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Resume a paused upload
|
|
177
|
+
*/
|
|
178
|
+
resume: () => void;
|
|
179
|
+
|
|
175
180
|
/**
|
|
176
181
|
* Whether the flow is currently paused
|
|
177
182
|
*/
|
|
@@ -536,12 +541,16 @@ export function useFlow(options: UseFlowOptions): UseFlowReturn {
|
|
|
536
541
|
[inputMetadata, fileSystemProvider, options],
|
|
537
542
|
);
|
|
538
543
|
|
|
539
|
-
const abort = useCallback(() => {
|
|
540
|
-
managerRef.current?.abort();
|
|
544
|
+
const abort = useCallback(async () => {
|
|
545
|
+
await managerRef.current?.abort();
|
|
546
|
+
}, []);
|
|
547
|
+
|
|
548
|
+
const pause = useCallback(async () => {
|
|
549
|
+
await managerRef.current?.pause();
|
|
541
550
|
}, []);
|
|
542
551
|
|
|
543
|
-
const
|
|
544
|
-
managerRef.current?.
|
|
552
|
+
const resume = useCallback(async () => {
|
|
553
|
+
await managerRef.current?.resume();
|
|
545
554
|
}, []);
|
|
546
555
|
|
|
547
556
|
const reset = useCallback(() => {
|
|
@@ -582,6 +591,7 @@ export function useFlow(options: UseFlowOptions): UseFlowReturn {
|
|
|
582
591
|
upload,
|
|
583
592
|
abort,
|
|
584
593
|
pause,
|
|
594
|
+
resume,
|
|
585
595
|
reset,
|
|
586
596
|
retry,
|
|
587
597
|
isActive,
|