@kystverket/styrbord 1.3.12 → 1.3.13
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/main.js +54 -24
- package/dist/main.umd.cjs +6 -6
- package/dist/src/components/kystverket/FileUploader/FileUploader.context.d.ts +2 -2
- package/dist/src/components/kystverket/FileUploader/FileUploader.stories.d.ts +4 -0
- package/dist/src/components/kystverket/FileUploader/FileUploader.types.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FileInfo } from './FileUploader.types';
|
|
1
|
+
import { FileInfo, UploadFileResult } from './FileUploader.types';
|
|
2
2
|
export type FileChangeCallback = (files: FileInfo[]) => void;
|
|
3
3
|
export interface FileUploaderContextProps {
|
|
4
|
-
uploadFile: (file: FormData) => Promise<
|
|
4
|
+
uploadFile: (file: FormData) => Promise<UploadFileResult>;
|
|
5
5
|
deleteFile: (fileId: string) => Promise<void>;
|
|
6
6
|
}
|
|
7
7
|
export declare const FileUploaderContext: React.Context<FileUploaderContextProps>;
|
|
@@ -17,3 +17,7 @@ export declare const RequiredText: Story;
|
|
|
17
17
|
export declare const WithError: Story;
|
|
18
18
|
export declare const WithExistingFiles: Story;
|
|
19
19
|
export declare const WithExistingFilesWithTranslations: Story;
|
|
20
|
+
export declare const withFileSizeLimit: Story;
|
|
21
|
+
export declare const WithFileSizeLimitEnglish: Story;
|
|
22
|
+
export declare const withFileTypeRestriction: Story;
|
|
23
|
+
export declare const withFileScanFailed: Story;
|
|
@@ -16,3 +16,9 @@ export type Exif = {
|
|
|
16
16
|
latitude?: number;
|
|
17
17
|
longitude?: number;
|
|
18
18
|
};
|
|
19
|
+
export type UploadFileResult = {
|
|
20
|
+
storageId: string;
|
|
21
|
+
success: boolean;
|
|
22
|
+
error?: UploadFileError;
|
|
23
|
+
};
|
|
24
|
+
export type UploadFileError = 'error' | 'network-error' | 'invalid-file-type' | 'file-too-large' | 'unknown-error' | 'file-scan-failed';
|