@bluealba/pae-ui-react-core 4.6.0 → 4.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 +33 -0
- package/dist/index.cjs.js +44 -44
- package/dist/index.esm.js +3304 -3187
- package/dist/index.systemjs.js +46 -46
- package/dist/index.umd.js +47 -47
- package/dist/src/hooks/file-storage/index.d.ts +2 -0
- package/dist/src/hooks/file-storage/types.d.ts +35 -0
- package/dist/src/hooks/file-storage/uploadWithProgress.d.ts +7 -0
- package/dist/src/hooks/file-storage/uploadWithProgress.test.d.ts +1 -0
- package/dist/src/hooks/file-storage/useFileStorage.d.ts +9 -0
- package/dist/src/hooks/file-storage/useFileStorage.test.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface FileDto {
|
|
2
|
+
id: number;
|
|
3
|
+
originalName: string;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
extension: string;
|
|
6
|
+
size: number;
|
|
7
|
+
isPublic: boolean;
|
|
8
|
+
description?: string;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
url: string;
|
|
11
|
+
createdBy: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
export interface UploadOptions {
|
|
16
|
+
isPublic?: boolean;
|
|
17
|
+
description?: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
onProgress?: (percent: number) => void;
|
|
20
|
+
signal?: AbortSignal;
|
|
21
|
+
}
|
|
22
|
+
export interface UpdateMetadataOptions {
|
|
23
|
+
originalName?: string;
|
|
24
|
+
isPublic?: boolean;
|
|
25
|
+
description?: string;
|
|
26
|
+
metadata?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface UseFileStorageResult {
|
|
29
|
+
isEnabled: boolean;
|
|
30
|
+
upload(file: File, options?: UploadOptions): Promise<FileDto>;
|
|
31
|
+
updateMetadata(id: number, options: UpdateMetadataOptions): Promise<FileDto>;
|
|
32
|
+
remove(id: number): Promise<void>;
|
|
33
|
+
download(id: number): Promise<void>;
|
|
34
|
+
getPreviewUrl(id: number): Promise<string>;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UseFileStorageResult } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook providing client-side access to the platform File Storage API.
|
|
5
|
+
*
|
|
6
|
+
* The hook is a no-op when `fileStorageEnabled` is `false` in the platform state —
|
|
7
|
+
* every method will reject with a descriptive error.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useFileStorage(): UseFileStorageResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -43,3 +43,5 @@ export { useResource } from './commons/useResource';
|
|
|
43
43
|
export { useTenants } from './tenants/useTenants';
|
|
44
44
|
export { useUserState } from './userState/useUserState';
|
|
45
45
|
export { useAppStatus } from './useAppStatus';
|
|
46
|
+
export { useFileStorage } from './file-storage/useFileStorage';
|
|
47
|
+
export type { FileDto, UploadOptions, UpdateMetadataOptions, UseFileStorageResult } from './file-storage/types';
|