@emailmaker/filemanager 0.10.30 → 0.10.32

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.
@@ -1,4 +1,4 @@
1
- import type { FileManagerErrorCode, IFileManagerApiError } from 'notification';
1
+ import type { FileManageErrorInfo, FileManagerErrorCode } from 'notification';
2
2
  type TFunction = (key: string, params?: Record<string, unknown>) => string;
3
3
  /**
4
4
  * Возвращает локализованное сообщение по коду ошибки, если для него есть i18n-ключ.
@@ -8,5 +8,5 @@ export declare const getErrorMessageFromCode: (code: FileManagerErrorCode | unde
8
8
  /**
9
9
  * Пытается извлечь IFileManagerApiError из unknown.
10
10
  */
11
- export declare const asFileManagerApiError: (error: unknown) => IFileManagerApiError | undefined;
11
+ export declare const asFileManagerApiError: (error: unknown) => FileManageErrorInfo;
12
12
  export {};
@@ -31,4 +31,5 @@ export declare const validateFiles: (files: File[], options?: FileValidationOpti
31
31
  export declare const validateFileUrl: (url: string) => Promise<FileValidationResult>;
32
32
  export declare const getFileCategory: (file: File) => string;
33
33
  export declare const formatFileSize: (bytes: number) => string;
34
+ export declare const formatFileSizeShort: (bytes?: number) => string;
34
35
  export declare const sanitizeFileName: (fileName: string) => string;
@@ -1,47 +0,0 @@
1
- /**
2
- * Коды ошибок для FileManager API.
3
- * Используются для идентификации причины ошибки независимо от UI.
4
- */
5
- export declare const FileManagerErrorCode: {
6
- readonly FileNotFound: "FileNotFound";
7
- readonly FileAlreadyExists: "FileAlreadyExists";
8
- readonly FileInvalidName: "FileInvalidName";
9
- readonly FileAccessDenied: "FileAccessDenied";
10
- readonly FileReadError: "FileReadError";
11
- readonly FileWriteError: "FileWriteError";
12
- readonly FileUploadQuotaExceeded: "FileUploadQuotaExceeded";
13
- readonly FileUploadNetworkError: "FileUploadNetworkError";
14
- readonly FileDownloadNetworkError: "FileDownloadNetworkError";
15
- readonly FileBackendError: "FileBackendError";
16
- readonly FileTimeout: "FileTimeout";
17
- readonly FolderNotFound: "FolderNotFound";
18
- readonly FolderAlreadyExists: "FolderAlreadyExists";
19
- readonly FolderInvalidName: "FolderInvalidName";
20
- readonly FolderAccessDenied: "FolderAccessDenied";
21
- readonly FolderReadError: "FolderReadError";
22
- readonly FolderWriteError: "FolderWriteError";
23
- readonly FolderQuotaExceeded: "FolderQuotaExceeded";
24
- readonly FolderBackendError: "FolderBackendError";
25
- readonly FolderTimeout: "FolderTimeout";
26
- readonly RenameNotAllowed: "RenameNotAllowed";
27
- readonly MoveNotAllowed: "MoveNotAllowed";
28
- readonly CopyNotAllowed: "CopyNotAllowed";
29
- readonly DeleteNotAllowed: "DeleteNotAllowed";
30
- readonly MoveIntoSelf: "MoveIntoSelf";
31
- readonly MoveIntoDescendant: "MoveIntoDescendant";
32
- readonly BatchPartialFailure: "BatchPartialFailure";
33
- readonly BatchAllFailed: "BatchAllFailed";
34
- readonly BatchConflict: "BatchConflict";
35
- readonly NetworkError: "NetworkError";
36
- readonly BackendError: "BackendError";
37
- readonly Timeout: "Timeout";
38
- readonly AuthenticationFailed: "AuthenticationFailed";
39
- readonly AuthorizationFailed: "AuthorizationFailed";
40
- readonly AIResponseInvalid: "AIResponseInvalid";
41
- readonly AIImageGenerationFailed: "AIImageGenerationFailed";
42
- readonly AIImageGenerationLimitExceeded: "AIImageGenerationLimitExceeded";
43
- };
44
- /**
45
- * Тип всех кодов ошибок FileManager
46
- */
47
- export type FileManagerErrorCode = typeof FileManagerErrorCode[keyof typeof FileManagerErrorCode];