use-tus 0.5.0 → 0.7.0
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 +71 -30
- package/dist/TusClientProvider/TusClientProvider.d.ts +6 -3
- package/dist/TusClientProvider/constants.d.ts +4 -0
- package/dist/TusClientProvider/index.d.ts +3 -2
- package/dist/{core → TusClientProvider/store}/contexts.d.ts +3 -3
- package/dist/{core → TusClientProvider/store}/tucClientActions.d.ts +9 -10
- package/dist/{core → TusClientProvider/store}/tusClientReducer.d.ts +5 -5
- package/dist/TusClientProvider/types.d.ts +2 -0
- package/dist/__stories__/Basic.stories.d.ts +1 -1
- package/dist/__stories__/CacheKey.stories.d.ts +1 -1
- package/dist/__stories__/DefaultOptions.stories.d.ts +1 -1
- package/dist/__stories__/components/BasicButton/BasicButton.d.ts +4 -4
- package/dist/__stories__/components/BasicButton/index.d.ts +1 -1
- package/dist/__stories__/components/LoadingCircle/LoadingCircle.d.ts +2 -2
- package/dist/__stories__/components/LoadingCircle/index.d.ts +1 -1
- package/dist/__stories__/components/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/__stories__/components/ProgressBar/index.d.ts +1 -1
- package/dist/__stories__/components/UploadIcon/UploadIcon.d.ts +2 -2
- package/dist/__stories__/components/UploadIcon/index.d.ts +1 -1
- package/dist/__tests__/useTusStore.test.d.ts +1 -0
- package/dist/__tests__/utils/getDefaultOptions.d.ts +2 -0
- package/dist/__tests__/utils/mock.d.ts +6 -1
- package/dist/index.cjs.js +266 -343
- package/dist/index.d.ts +3 -4
- package/dist/index.esm.js +267 -324
- package/dist/index.js +175 -211
- package/dist/useTus/index.d.ts +3 -2
- package/dist/useTus/types.d.ts +8 -9
- package/dist/useTus/useTus.d.ts +2 -2
- package/dist/useTus/useTusStore.d.ts +2 -0
- package/dist/useTus/utils/createUpload.d.ts +7 -0
- package/dist/useTus/utils/startOrResumeUpload.d.ts +2 -0
- package/dist/useTus/utils/useAutoAbort.d.ts +2 -0
- package/dist/useTus/utils/useMergeTusOptions.d.ts +6 -0
- package/dist/useTusClient/index.d.ts +1 -1
- package/dist/useTusClient/useTusClient.d.ts +1 -1
- package/package.json +9 -10
- package/dist/TusClientProvider/TusController.d.ts +0 -4
- package/dist/core/constants.d.ts +0 -4
- package/dist/core/tusHandler.d.ts +0 -17
- package/dist/core/types.d.ts +0 -8
- package/dist/useTus/utils.d.ts +0 -16
- package/dist/utils/uid.d.ts +0 -1
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as tus from 'tus-js-client';
|
|
2
|
-
import { Upload } from 'tus-js-client';
|
|
3
|
-
export declare type DefaultOptions = (file: Upload['file']) => tus.UploadOptions;
|
|
4
|
-
export declare type TusConfigs = Partial<{
|
|
5
|
-
canStoreURLs: boolean;
|
|
6
|
-
defaultOptions: DefaultOptions;
|
|
7
|
-
}>;
|
|
8
|
-
export declare type Tus = Readonly<Omit<typeof tus, 'defaultOptions'> & Required<TusConfigs>>;
|
|
9
|
-
export declare const initialDefaultOptions: DefaultOptions;
|
|
10
|
-
export declare class TusHandler {
|
|
11
|
-
private tus;
|
|
12
|
-
constructor(tusConfigs?: TusConfigs);
|
|
13
|
-
get getTus(): Readonly<Omit<typeof tus, "defaultOptions"> & Required<Partial<{
|
|
14
|
-
canStoreURLs: boolean;
|
|
15
|
-
defaultOptions: DefaultOptions;
|
|
16
|
-
}>>>;
|
|
17
|
-
}
|
package/dist/core/types.d.ts
DELETED
package/dist/useTus/utils.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SetStateAction } from 'react';
|
|
2
|
-
import { Upload } from 'tus-js-client';
|
|
3
|
-
import { TusClientActions } from '../core/tucClientActions';
|
|
4
|
-
import { UseTusOptions, UseTusState } from './types';
|
|
5
|
-
export declare type Dispatcher = {
|
|
6
|
-
dispatch: (value: TusClientActions) => void;
|
|
7
|
-
internalDispatch: (value: SetStateAction<UseTusState>) => void;
|
|
8
|
-
cacheKey: UseTusOptions['cacheKey'];
|
|
9
|
-
};
|
|
10
|
-
declare type OptionHandler = Pick<Upload['options'], 'onError' | 'onSuccess'>;
|
|
11
|
-
declare type CreateUpload = (file: Upload['file'], options: Upload['options'], dispatcher: Dispatcher) => Upload;
|
|
12
|
-
declare type CreateOptionHandler = (handlers: OptionHandler, dispatcher: Dispatcher) => OptionHandler;
|
|
13
|
-
export declare const createOptionHandler: CreateOptionHandler;
|
|
14
|
-
export declare const startOrResumeUpload: (upload: Upload) => void;
|
|
15
|
-
export declare const createUpload: CreateUpload;
|
|
16
|
-
export {};
|
package/dist/utils/uid.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createUid: () => string;
|