use-tus 0.4.0 → 0.6.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.
Files changed (47) hide show
  1. package/README.md +73 -33
  2. package/dist/TusClientProvider/TusClientProvider.d.ts +7 -4
  3. package/dist/TusClientProvider/constants.d.ts +4 -0
  4. package/dist/TusClientProvider/index.d.ts +3 -2
  5. package/dist/{core → TusClientProvider/store}/contexts.d.ts +7 -7
  6. package/dist/{core → TusClientProvider/store}/tucClientActions.d.ts +49 -50
  7. package/dist/{core → TusClientProvider/store}/tusClientReducer.d.ts +18 -18
  8. package/dist/TusClientProvider/types.d.ts +2 -0
  9. package/dist/__stories__/Basic.stories.d.ts +5 -0
  10. package/dist/__stories__/CacheKey.stories.d.ts +5 -0
  11. package/dist/__stories__/DefaultOptions.stories.d.ts +5 -0
  12. package/dist/__stories__/components/BasicButton/BasicButton.d.ts +9 -0
  13. package/dist/__stories__/components/BasicButton/index.d.ts +1 -0
  14. package/dist/__stories__/components/LoadingCircle/LoadingCircle.d.ts +2 -0
  15. package/dist/__stories__/components/LoadingCircle/index.d.ts +1 -0
  16. package/dist/__stories__/components/ProgressBar/ProgressBar.d.ts +7 -0
  17. package/dist/__stories__/components/ProgressBar/index.d.ts +1 -0
  18. package/dist/__stories__/components/UploadIcon/UploadIcon.d.ts +2 -0
  19. package/dist/__stories__/components/UploadIcon/index.d.ts +1 -0
  20. package/dist/__stories__/constants.d.ts +1 -0
  21. package/dist/__tests__/TusClientProvider.test.d.ts +1 -0
  22. package/dist/__tests__/useTus.test.d.ts +1 -0
  23. package/dist/__tests__/useTusStore.test.d.ts +1 -0
  24. package/dist/__tests__/utils/getBlob.d.ts +1 -0
  25. package/dist/__tests__/utils/getDefaultOptions.d.ts +2 -0
  26. package/dist/__tests__/utils/mock.d.ts +6 -0
  27. package/dist/index.cjs.js +289 -1759
  28. package/dist/index.d.ts +3 -4
  29. package/dist/index.esm.js +280 -1727
  30. package/dist/index.js +345 -0
  31. package/dist/useTus/index.d.ts +3 -2
  32. package/dist/useTus/types.d.ts +14 -15
  33. package/dist/useTus/useTus.d.ts +2 -2
  34. package/dist/useTus/useTusStore.d.ts +2 -0
  35. package/dist/useTus/utils/createUpload.d.ts +3 -0
  36. package/dist/useTus/utils/startOrResumeUpload.d.ts +2 -0
  37. package/dist/useTus/utils/useAutoAbort.d.ts +2 -0
  38. package/dist/useTus/utils/useMergeTusOptions.d.ts +6 -0
  39. package/dist/useTusClient/index.d.ts +1 -1
  40. package/dist/useTusClient/useTusClient.d.ts +7 -7
  41. package/package.json +9 -9
  42. package/dist/TusClientProvider/TusController.d.ts +0 -4
  43. package/dist/core/constants.d.ts +0 -4
  44. package/dist/core/tusHandler.d.ts +0 -17
  45. package/dist/core/types.d.ts +0 -8
  46. package/dist/useTus/utils.d.ts +0 -16
  47. package/dist/utils/uid.d.ts +0 -1
package/README.md CHANGED
@@ -14,8 +14,8 @@
14
14
 
15
15
  ## Features
16
16
  - Resumable file uploads on react.
17
+ - Lightweight and simple interface hooks.
17
18
  - Managing the [Upload](https://github.com/tus/tus-js-client/blob/master/docs/api.md#tusuploadfile-options) by using context.
18
- - One dependency ([tus-js-client](https://github.com/tus/tus-js-client)).
19
19
  - TypeScript support.
20
20
 
21
21
  ## Demo
@@ -25,25 +25,20 @@ You can try the [use-tus demo](https://kqito.github.io/use-tus/?path=/story/uset
25
25
  ## Installation
26
26
  You can install the package from npm.
27
27
  ```sh
28
- npm install use-tus
28
+ npm install use-tus tus-js-client
29
29
  ```
30
30
 
31
31
  or
32
+
32
33
  ```sh
33
- yarn add use-tus
34
+ yarn add use-tus tus-js-client
34
35
  ```
35
36
 
36
37
  ## Usage
37
38
  We can use `useTus` as following.
38
39
 
39
40
  ```tsx
40
- import { useTus, TusClientProvider } from 'use-tus'
41
-
42
- const App = () => (
43
- <TusClientProvider>
44
- <Uploader />
45
- </TusClientProvider>
46
- );
41
+ import { useTus } from 'use-tus'
47
42
 
48
43
  const Uploader = () => {
49
44
  const { upload, setUpload, isSuccess, error, remove } = useTus();
@@ -71,7 +66,7 @@ const Uploader = () => {
71
66
  return;
72
67
  }
73
68
 
74
- // Start upload the file.
69
+ // Start to upload the file.
75
70
  upload.start();
76
71
  }, [upload]);
77
72
 
@@ -91,27 +86,79 @@ const Uploader = () => {
91
86
  ### `useTus` hooks
92
87
 
93
88
  ```tsx
94
- const { upload, setUpload, isSuccess, isAborted, error, remove } = useTus({ cacheKey, autoAbort, autoStart });
89
+ const { upload, setUpload, isSuccess, isAborted, error, remove } = useTus({ autoAbort, autoStart, uploadOptions });
95
90
  ```
96
91
 
97
- `useTus` is a hooks to get or create an `Upload` of tus.
92
+ `useTus` is a hooks that creates an object to perform Resumable file upload.
98
93
 
99
94
  ### Arguments
100
- - `cacheKey` (type: `string | undefined`)
101
- - Specify the key associated with the `Upload` if it's undefined, a random string will be specified.
102
-
103
95
  - `autoAbort` (type: `boolean | undefined`) (default: true)
104
96
  - Whether or not to automatically abort uploads when useTus hooks is unmounted.
105
97
 
106
98
  - `autoStart` (type: `boolean | undefined`) (default: false)
107
99
  - Whether or not to start upload the file after `setUpload` function.
108
100
 
101
+ - `uploadOptions` (type: `UploadOptions | undefined`) (default: undefined)
102
+ - Option to used by upload object that generated by that hooks.
103
+ - For detail type information of `UploadOptions`, please see [here](https://github.com/tus/tus-js-client/blob/master/lib/index.d.ts#L22).
104
+
105
+ ### Returns
106
+ - `upload` (type: `tus.Upload | undefined`)
107
+ - Object to be used when performing Resumable file upload.
108
+ - This value is undefined unless the `setUpload` function called.
109
+ - For detail usage, please see [here](https://github.com/tus/tus-js-client#example)
110
+
111
+ - `setUpload` (type: `(file: tus.Upload['file'], options?: UploadOptions) => void`)
112
+ - Function to create an `Upload`.
113
+ - The property specified in `uploadOptions` will be overwritten if property of `options` are speicified.
114
+
115
+ - `isSuccess` (type: `boolean`)
116
+ - Whether the upload was successful or not.
117
+
118
+ - `isAborted` (type: `boolean`)
119
+ - Whether the upload was aborted or not.
120
+
121
+ - `error` (type: `Error | undefined`)
122
+ - Error when upload fails.
123
+
124
+ - `remove` (type: `() => void`)
125
+ - Function to reset states.
126
+
127
+ ### `useTusStore` hooks
128
+
129
+ ```tsx
130
+ const { upload, setUpload, isSuccess, isAborted, error, remove } = useTusStore(cacheKey, { autoAbort, autoStart, uploadOptions });
131
+ ```
132
+
133
+ `useTusStore` is a hooks that creates an object for resumable file upload and stores it in a context.
134
+
135
+ This hooks is useful when you want to handle uploads across pages or components.
136
+
137
+ **Note that using `useTusStore` hooks, the `TusClientProvider` must be specified as the parent or higher element.**
138
+
139
+ ### Arguments
140
+ - `cacheKey` (type: `string`)
141
+ - Specify the key associated with the `Upload` object is created by `setUpload` function.
142
+
143
+ - `autoAbort` (type: `boolean | undefined`) (default: true)
144
+ - Whether or not to automatically abort uploads when useTusStore hooks is unmounted.
145
+
146
+ - `autoStart` (type: `boolean | undefined`) (default: false)
147
+ - Whether or not to start upload the file after `setUpload` function.
148
+
149
+ - `uploadOptions` (type: `UploadOptions | undefined`) (default: undefined)
150
+ - Option to used by upload object that generated by that hooks.
151
+ - For detail type information of `UploadOptions`, please see [here](https://github.com/tus/tus-js-client/blob/master/lib/index.d.ts#L22).
152
+
109
153
  ### Returns
110
154
  - `upload` (type: `tus.Upload | undefined`)
111
- - The value of the `Upload` associated with the cacheKey in the TusClientProvider. If not present, undefined.
155
+ - Object to be used when performing Resumable file upload.
156
+ - This value of the `Upload` associated with the cacheKey in the TusClientProvider. If not present, undefined.
157
+ - For detail usage, please see [here](https://github.com/tus/tus-js-client#example)
112
158
 
113
159
  - `setUpload` (type: `(file: tus.Upload['file'], options?: tus.Upload['options']) => void`)
114
- - Function to create an `Upload` and store it in TusClientProvider.
160
+ - Function to create an `Upload`.
161
+ - The property specified in `uploadOptions` will be overwritten if property of `options` are speicified.
115
162
 
116
163
  - `isSuccess` (type: `boolean`)
117
164
  - Whether the upload was successful or not.
@@ -129,21 +176,16 @@ const { upload, setUpload, isSuccess, isAborted, error, remove } = useTus({ cach
129
176
 
130
177
  ```tsx
131
178
  () => (
132
- <TusClientProvider>
179
+ <TusClientProvider defaultOptions={defaultOptions}>
133
180
  {children}
134
181
  </TusClientProvider>
135
182
  )
136
183
  ```
137
184
 
138
- `TusClientProvider` is the provider that stores the `Upload` with `useTus` hooks.
139
-
140
- **In order to use `useTus`, you need to set `TusClientProvider`.**
185
+ `TusClientProvider` is the provider that stores the `Upload` with `useTusStore` hooks.
141
186
 
142
187
  ### Props
143
- - `canStoreURLs` (type: `boolean | undefined`)
144
- - A boolean indicating whether the current environment allows storing URLs enabling the corresponding upload to be resumed. [detail](https://github.com/tus/tus-js-client/blob/master/docs/api.md#tuscanstoreurls)
145
-
146
- - `defaultOptions` (type: `(file: tus.Upload['file']) => tus.DefaltOptions | undefined`)
188
+ - `defaultOptions` (type: `(file: tus.Upload['file']) => UploadOptions | undefined`)
147
189
  - An object containing the default options used when creating a new upload. [detail](https://github.com/tus/tus-js-client/blob/master/docs/api.md#tusdefaultoptions)
148
190
 
149
191
  ### `useTusClient`
@@ -166,8 +208,6 @@ const { state, removeUpload, reset } = useTusClient();
166
208
  ## Examples
167
209
  The following are some example of how to use `use-tus`.
168
210
 
169
- Note that the `TusClientProvider` must be specified as the parent or higher element.
170
-
171
211
  ### Uploading a file
172
212
  The setUpload and `upload.start` functions can be used to perform resumable file uploads.
173
213
 
@@ -289,7 +329,7 @@ const Uploader = () => {
289
329
  You can specify default options in the `defaultOptions` props of the `TusClientProvider`.
290
330
 
291
331
  ```tsx
292
- import { useTus, DefaultOptions, TusClientProvider } from 'use-tus'
332
+ import { useTusStore, DefaultOptions, TusClientProvider } from 'use-tus'
293
333
 
294
334
  const defaultOptions: DefaultOptions = (contents) => {
295
335
  const file = contents instanceof File ? contents : undefined;
@@ -312,7 +352,7 @@ const App = () => (
312
352
  );
313
353
 
314
354
  const Uploader = () => {
315
- const { setUpload } = useTus({ autoAtart: true });
355
+ const { setUpload } = useTusStore('cacheKey', { autoAtart: true });
316
356
 
317
357
  const handleSetUpload = useCallback((event: ChangeEvent<HTMLInputElement>) => {
318
358
  const file = event.target.files.item(0);
@@ -337,18 +377,18 @@ const Uploader = () => {
337
377
  ```
338
378
 
339
379
  ### Specify upload key
340
- If you specify `cacheKey` as an argument to useTus, you can get the `upload` associated with it. This is useful for cross-page file uploads.
380
+ If you specify `cacheKey` as an argument to useTusStore, you can get the `upload` associated with it. This is useful for cross-page file uploads.
341
381
 
342
382
  ```tsx
343
383
  const SelectFileComponent = (file: File) => {
344
384
  // Create upload accosiated with 'upload-thumbnail' key
345
- const { setUpload } = useTus({ cacheKey: 'upload-thumbnail' })
385
+ const { setUpload } = useTusStore('upload-thumbnail')
346
386
 
347
387
  setUpload(file)
348
388
  }
349
389
 
350
390
  const UploadFileComponent = () => {
351
- const { upload } = useTus({ cacheKey: 'upload-thumbnail' })
391
+ const { upload } = useTusStore('upload-thumbnail')
352
392
 
353
393
  upload.start()
354
394
  }
@@ -1,4 +1,7 @@
1
- import type { FC } from 'react';
2
- import { TusConfigs } from '../core/tusHandler';
3
- export declare type TusClientProviderProps = Readonly<TusConfigs>;
4
- export declare const TusClientProvider: FC<TusClientProviderProps>;
1
+ import { FC } from "react";
2
+ import { DefaultOptions } from "./types";
3
+ export declare type TusClientProviderProps = Readonly<{
4
+ children?: React.ReactNode;
5
+ defaultOptions?: DefaultOptions;
6
+ }>;
7
+ export declare const TusClientProvider: FC<TusClientProviderProps>;
@@ -0,0 +1,4 @@
1
+ export declare const ERROR_MESSAGES: {
2
+ readonly tusClientHasNotFounded: "No TusClient set, use TusClientProvider to set one";
3
+ readonly tusIsNotSupported: "This browser does not support uploads. Please use a modern browser instead.";
4
+ };
@@ -1,2 +1,3 @@
1
- export { TusClientProvider } from './TusClientProvider';
2
- export type { TusClientProviderProps } from './TusClientProvider';
1
+ export { TusClientProvider } from "./TusClientProvider";
2
+ export type { TusClientProviderProps } from "./TusClientProvider";
3
+ export type { DefaultOptions } from "./types";
@@ -1,7 +1,7 @@
1
- import type { Dispatch } from 'react';
2
- import { TusClientActions } from './tucClientActions';
3
- import { TusClientState } from './tusClientReducer';
4
- export declare const TusClientStateContext: import("react").Context<TusClientState | undefined>;
5
- export declare const TusClientDispatchContext: import("react").Context<Dispatch<TusClientActions> | undefined>;
6
- export declare const useTusClientState: () => TusClientState;
7
- export declare const useTusClientDispatch: () => Dispatch<TusClientActions>;
1
+ import type { Dispatch } from "react";
2
+ import { TusClientActions } from "./tucClientActions";
3
+ import { TusClientState } from "./tusClientReducer";
4
+ export declare const TusClientStateContext: import("react").Context<TusClientState | undefined>;
5
+ export declare const TusClientDispatchContext: import("react").Context<Dispatch<TusClientActions> | undefined>;
6
+ export declare const useTusClientState: () => TusClientState;
7
+ export declare const useTusClientDispatch: () => Dispatch<TusClientActions>;
@@ -1,50 +1,49 @@
1
- import type { Upload } from 'tus-js-client';
2
- import { TusConfigs } from './tusHandler';
3
- export declare type TusClientActions = ReturnType<typeof insertUploadInstance | typeof removeUploadInstance | typeof resetClient | typeof updateSuccessUpload | typeof updateErrorUpload | typeof updateIsAbortedUpload | typeof updateTusHandlerOptions>;
4
- export declare const insertUploadInstance: (cacheKey: string, upload: Upload) => {
5
- readonly type: "INSERT_UPLOAD_INSTANCE";
6
- readonly payload: {
7
- readonly cacheKey: string;
8
- readonly uploadState: {
9
- readonly upload: Upload;
10
- readonly isSuccess: false;
11
- readonly isAborted: false;
12
- };
13
- };
14
- };
15
- export declare const updateSuccessUpload: (cacheKey: string) => {
16
- readonly type: "UPDATE_SUCCESS_UPLOAD";
17
- readonly payload: {
18
- readonly cacheKey: string;
19
- };
20
- };
21
- export declare const updateErrorUpload: (cacheKey: string, error?: Error | undefined) => {
22
- readonly type: "UPDATE_ERROR_UPLOAD";
23
- readonly payload: {
24
- readonly cacheKey: string;
25
- readonly error: Error | undefined;
26
- };
27
- };
28
- export declare const updateIsAbortedUpload: (cacheKey: string, isAborted: boolean) => {
29
- readonly type: "UPDATE_IS_ABORTED_UPLOAD";
30
- readonly payload: {
31
- readonly cacheKey: string;
32
- readonly isAborted: boolean;
33
- };
34
- };
35
- export declare const removeUploadInstance: (cacheKey: string) => {
36
- readonly type: "REMOVE_UPLOAD_INSTANCE";
37
- readonly payload: {
38
- readonly cacheKey: string;
39
- };
40
- };
41
- export declare const resetClient: () => {
42
- readonly type: "RESET_CLIENT";
43
- };
44
- export declare const updateTusHandlerOptions: (payload: TusConfigs) => {
45
- readonly type: "UPDATE_TUS_HANDLER_OPTIONS";
46
- readonly payload: Partial<{
47
- canStoreURLs: boolean;
48
- defaultOptions: import("./tusHandler").DefaultOptions;
49
- }>;
50
- };
1
+ import type { Upload } from "tus-js-client";
2
+ import { DefaultOptions } from "../types";
3
+ export declare type TusClientActions = ReturnType<typeof insertUploadInstance | typeof removeUploadInstance | typeof updateSuccessUpload | typeof updateErrorUpload | typeof updateIsAbortedUpload | typeof resetClient | typeof updateDefaultOptions>;
4
+ export declare const insertUploadInstance: (cacheKey: string, upload: Upload) => {
5
+ readonly type: "INSERT_UPLOAD_INSTANCE";
6
+ readonly payload: {
7
+ readonly cacheKey: string;
8
+ readonly uploadState: {
9
+ readonly upload: Upload;
10
+ readonly isSuccess: false;
11
+ readonly isAborted: false;
12
+ };
13
+ };
14
+ };
15
+ export declare const updateSuccessUpload: (cacheKey: string) => {
16
+ readonly type: "UPDATE_SUCCESS_UPLOAD";
17
+ readonly payload: {
18
+ readonly cacheKey: string;
19
+ };
20
+ };
21
+ export declare const updateErrorUpload: (cacheKey: string, error?: Error | undefined) => {
22
+ readonly type: "UPDATE_ERROR_UPLOAD";
23
+ readonly payload: {
24
+ readonly cacheKey: string;
25
+ readonly error: Error | undefined;
26
+ };
27
+ };
28
+ export declare const updateIsAbortedUpload: (cacheKey: string, isAborted: boolean) => {
29
+ readonly type: "UPDATE_IS_ABORTED_UPLOAD";
30
+ readonly payload: {
31
+ readonly cacheKey: string;
32
+ readonly isAborted: boolean;
33
+ };
34
+ };
35
+ export declare const removeUploadInstance: (cacheKey: string) => {
36
+ readonly type: "REMOVE_UPLOAD_INSTANCE";
37
+ readonly payload: {
38
+ readonly cacheKey: string;
39
+ };
40
+ };
41
+ export declare const resetClient: () => {
42
+ readonly type: "RESET_CLIENT";
43
+ };
44
+ export declare const updateDefaultOptions: (defaultOptions: DefaultOptions | undefined) => {
45
+ readonly type: "UPDATE_DEFAULT_OPTIONS";
46
+ readonly payload: {
47
+ readonly defaultOptions: DefaultOptions | undefined;
48
+ };
49
+ };
@@ -1,18 +1,18 @@
1
- import type { Reducer } from 'react';
2
- import type { Upload } from 'tus-js-client';
3
- import { TusClientActions } from './tucClientActions';
4
- import { TusHandler } from './tusHandler';
5
- export declare type UploadState = {
6
- upload: Upload | undefined;
7
- isSuccess: boolean;
8
- isAborted: boolean;
9
- error?: Error;
10
- };
11
- export declare type TusClientState = {
12
- uploads: {
13
- [cacheKey: string]: UploadState | undefined;
14
- };
15
- tusHandler: TusHandler;
16
- };
17
- export declare const tusClientReducer: Reducer<TusClientState, TusClientActions>;
18
- export declare const tusClientInitialState: TusClientState;
1
+ import type { Reducer } from "react";
2
+ import type { Upload } from "tus-js-client";
3
+ import { DefaultOptions } from "../types";
4
+ import { TusClientActions } from "./tucClientActions";
5
+ export declare type UploadState = {
6
+ upload: Upload | undefined;
7
+ isSuccess: boolean;
8
+ isAborted: boolean;
9
+ error?: Error;
10
+ };
11
+ export declare type TusClientState = {
12
+ uploads: {
13
+ [cacheKey: string]: UploadState | undefined;
14
+ };
15
+ defaultOptions: DefaultOptions | undefined;
16
+ };
17
+ export declare const tusClientReducer: Reducer<TusClientState, TusClientActions>;
18
+ export declare const tusClientInitialState: TusClientState;
@@ -0,0 +1,2 @@
1
+ import { Upload, UploadOptions } from "tus-js-client";
2
+ export declare type DefaultOptions = (file: Upload["file"]) => UploadOptions;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from "@storybook/react";
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Basic: () => JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from "@storybook/react";
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const CacheKey: () => JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from "@storybook/react";
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const WithDefaultOptions: () => JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ComponentProps } from "react";
2
+ declare type BasicButtonProps = {
3
+ onClick: ComponentProps<"button">["onClick"];
4
+ title: string;
5
+ disabled?: ComponentProps<"button">["disabled"];
6
+ styleColor?: "primary" | "basic" | "error";
7
+ };
8
+ export declare const BasicButton: import("react").ForwardRefExoticComponent<BasicButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { BasicButton } from "./BasicButton";
@@ -0,0 +1,2 @@
1
+ import type { VFC } from "react";
2
+ export declare const LoadingCircle: VFC;
@@ -0,0 +1 @@
1
+ export { LoadingCircle } from "./LoadingCircle";
@@ -0,0 +1,7 @@
1
+ import { VFC } from "react";
2
+ declare type ProgressBarProps = {
3
+ title?: string;
4
+ value?: number;
5
+ };
6
+ export declare const ProgressBar: VFC<ProgressBarProps>;
7
+ export {};
@@ -0,0 +1 @@
1
+ export { ProgressBar } from "./ProgressBar";
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const UploadIcon: VFC;
@@ -0,0 +1 @@
1
+ export { UploadIcon } from "./UploadIcon";
@@ -0,0 +1 @@
1
+ export declare const TUS_DEMO_ENDPOINT: "https://tusd.tusdemo.net/files/";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const getBlob: (str: string) => Blob;
@@ -0,0 +1,2 @@
1
+ import { Upload } from "tus-js-client";
2
+ export declare const getDefaultOptions: () => Upload["options"];
@@ -0,0 +1,6 @@
1
+ /// <reference types="jest" />
2
+ /// <reference types="webpack-env" />
3
+ /// <reference types="node" />
4
+ export declare const createConsoleErrorMock: () => jest.SpyInstance<void, [message?: any, ...optionalParams: any[]]>;
5
+ export declare const insertEnvValue: (value: NodeJS.Process["env"]) => void;
6
+ export declare const startOrResumeUploadMock: jest.SpyInstance<void, [upload: import("tus-js-client").Upload]>;