import { ColumnConfig } from '../FormGenerator'; import React from 'react'; import { EditFieldConfig } from '../Popup/EditForm'; // Re-export file-related interfaces from hooks export type { UserFile, FileInfo } from '../../hooks/useFiles'; // Import for local use import type { UserFile } from '../../hooks/useFiles'; // Component Props Interfaces export interface DateienTableProps { className?: string; } // Table Action Interface export interface TableAction { label: string; onClick: (file: UserFile) => Promise | void; icon: React.ReactNode | ((file: UserFile) => React.ReactNode); } // File Operation Handler Types export interface FileHandlers { handleFileDownload: (fileId: string, fileName: string) => Promise; handleFileDelete: (fileId: string, onOptimisticDelete?: () => void) => Promise; handleFileUpload: (file: globalThis.File, workflowId?: string) => Promise<{ success: boolean; fileData?: any; error?: string }>; handleFileUpdate: (fileId: string, updateData: Partial<{ fileName: string }>) => Promise<{ success: boolean; fileData?: any; error?: string }>; } // Hook Return Types for File Operations export interface FileOperationsReturn extends FileHandlers { downloadingFiles: Set; deletingFiles: Set; uploadingFile: boolean; downloadError: string | null; deleteError: string | null; uploadError: string | null; isLoading: boolean; } // Hook Return Types for User Files export interface UserFilesReturn { files: UserFile[]; loading: boolean; error: string | null; refetch: () => Promise; removeFileOptimistically: (fileId: string) => void; addFileOptimistically: (newFile: UserFile) => void; } // File Table Configuration export interface FileTableConfig { columns: ColumnConfig[]; actions: TableAction[]; pageSize: number; searchable: boolean; filterable: boolean; sortable: boolean; resizable: boolean; pagination: boolean; } // File Size Formatter Function Type export type FileSizeFormatter = (sizeInBytes?: number) => string; // Date Formatter Function Type export type DateFormatter = (value?: string) => string; // Hook Return Type for Dateien Logic export interface DateienLogicReturn { files: UserFile[]; loading: boolean; error: string | null; refetch: () => Promise; columns: ColumnConfig[]; actions: TableAction[]; downloadingFiles: Set; deletingFiles: Set; downloadError: string | null; deleteError: string | null; editModalOpen: boolean; editingFile: UserFile | null; editFileFields: EditFieldConfig[]; handleEditFile: (file: UserFile) => void; handleSaveFile: (updatedFile: UserFile) => Promise; handleCancelEdit: () => void; }