use-tus 0.7.0 → 0.7.3
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 +1 -1
- package/dist/TusClientProvider/TusClientProvider.d.ts +1 -1
- package/dist/TusClientProvider/store/tucClientActions.d.ts +1 -1
- package/dist/TusClientProvider/store/tusClientReducer.d.ts +2 -2
- package/dist/TusClientProvider/types.d.ts +1 -1
- package/dist/__stories__/Basic.stories.d.ts +5 -3
- package/dist/__stories__/components/BasicButton/BasicButton.d.ts +3 -3
- package/dist/__stories__/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/__tests__/utils/mock.d.ts +2 -8
- package/dist/index.cjs.js +1 -631
- package/dist/index.esm.js +1 -625
- package/dist/index.js +1 -3
- package/dist/useTus/utils/createUpload.d.ts +1 -1
- package/package.json +43 -47
- package/dist/__stories__/CacheKey.stories.d.ts +0 -5
- package/dist/__stories__/DefaultOptions.stories.d.ts +0 -5
package/README.md
CHANGED
|
@@ -352,7 +352,7 @@ const App = () => (
|
|
|
352
352
|
);
|
|
353
353
|
|
|
354
354
|
const Uploader = () => {
|
|
355
|
-
const { setUpload } = useTusStore('cacheKey', {
|
|
355
|
+
const { setUpload } = useTusStore('cacheKey', { autoStart: true });
|
|
356
356
|
|
|
357
357
|
const handleSetUpload = useCallback((event: ChangeEvent<HTMLInputElement>) => {
|
|
358
358
|
const file = event.target.files.item(0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Upload } from "tus-js-client";
|
|
2
2
|
import { DefaultOptions } from "../types";
|
|
3
|
-
export
|
|
3
|
+
export type TusClientActions = ReturnType<typeof insertUploadInstance | typeof removeUploadInstance | typeof updateSuccessUpload | typeof updateErrorUpload | typeof updateIsAbortedUpload | typeof resetClient | typeof updateDefaultOptions>;
|
|
4
4
|
export declare const insertUploadInstance: (cacheKey: string, upload: Upload) => {
|
|
5
5
|
readonly type: "INSERT_UPLOAD_INSTANCE";
|
|
6
6
|
readonly payload: {
|
|
@@ -2,13 +2,13 @@ import type { Reducer } from "react";
|
|
|
2
2
|
import type { Upload } from "tus-js-client";
|
|
3
3
|
import { DefaultOptions } from "../types";
|
|
4
4
|
import { TusClientActions } from "./tucClientActions";
|
|
5
|
-
export
|
|
5
|
+
export type UploadState = {
|
|
6
6
|
upload: Upload | undefined;
|
|
7
7
|
isSuccess: boolean;
|
|
8
8
|
isAborted: boolean;
|
|
9
9
|
error?: Error;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type TusClientState = {
|
|
12
12
|
uploads: {
|
|
13
13
|
[cacheKey: string]: UploadState | undefined;
|
|
14
14
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Upload, UploadOptions } from "tus-js-client";
|
|
2
|
-
export
|
|
2
|
+
export type DefaultOptions = (file: Upload["file"]) => UploadOptions;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Meta } from "@storybook/react";
|
|
3
|
-
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
-
export default _default;
|
|
5
2
|
export declare const Basic: () => JSX.Element;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: () => JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
|
|
1
|
+
import { ComponentProps, FC } from "react";
|
|
2
|
+
type BasicButtonProps = {
|
|
3
3
|
onClick: ComponentProps<"button">["onClick"];
|
|
4
4
|
title: string;
|
|
5
5
|
disabled?: ComponentProps<"button">["disabled"];
|
|
6
6
|
styleColor?: "primary" | "basic" | "error";
|
|
7
7
|
};
|
|
8
|
-
export declare const BasicButton:
|
|
8
|
+
export declare const BasicButton: FC<BasicButtonProps>;
|
|
9
9
|
export {};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
|
-
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
/// <reference types="node" />
|
|
7
|
-
/// <reference types="node" />
|
|
8
|
-
export declare const createConsoleErrorMock: () => jest.SpyInstance<void, [message?: any, ...optionalParams: any[]]>;
|
|
2
|
+
export declare const createConsoleErrorMock: () => jest.SpyInstance<void, [message?: any, ...optionalParams: any[]], any>;
|
|
9
3
|
export declare const insertEnvValue: (value: NodeJS.Process["env"]) => void;
|
|
10
|
-
export declare const startOrResumeUploadMock: jest.SpyInstance<void, [upload: import("tus-js-client").Upload]>;
|
|
4
|
+
export declare const startOrResumeUploadMock: jest.SpyInstance<void, [upload: import("tus-js-client").Upload], any>;
|