import { API } from '@editorjs/editorjs'; import { CardWithSelectConfig } from '../types/card-with-select-config.interface'; /** * Handler for file operations */ declare class FileHandler { private api; private uploadUrl; private renameUrl; constructor(api: API, config: CardWithSelectConfig); /** * Handle file upload * @param file - file to upload * @param entity - entity object * @param onProgress - progress callback * @param onSuccess - success callback * @param onError - error callback */ handleFileUpload(file: File, entity: any, onProgress: (entity: any, file: File) => void, onSuccess: (entity: any, fileData: any) => void, onError: (entity: any, error: Error) => void): Promise; /** * Upload file to server * @param file - file to upload * @returns Promise with file data */ private uploadFileToServer; /** * Get CSRF token for requests */ private getCSRFToken; /** * @param bytes */ formatFileSize(bytes: number): string; /** * Get file icon by filename * @param fileName */ getFileIcon(fileName: string): string; /** * Get file extension * @param fileName - name of the file */ getFileExtension(fileName: string): string; /** * Переименовать файл на сервере * @param fileMeta – текущие метаданные файла * @param newName – новое имя без расширения */ handleFileRename(fileMeta: any, // Может быть response объект или данные файла newName: string): Promise<{ id: string; name: string; extension: string; url: string; size: number; createdAt: string; updatedAt: string; }>; } export { FileHandler };