import { Timestamp } from './common'; import { UserId } from './user'; export type FileId = string; export enum FileType { IMAGE = 'image', DOCUMENT = 'document', } export enum FileSection { AVATAR = "avatar", ANNOUNCEMENT = "announcement", EVENT = "event", FEED_POST = "feedPost", MESSENGER = "messenger", STUDENT = "student", OTHER = "other", } export type ImageFormat = 'jpg' | 'jpeg' | 'png' | 'tif' | 'tiff' | 'webp'; export interface File { id: string; url?: string | { [size: string]: string; }; } export interface Attachment { id: string; fileName?: string; fileType?: string; url: string; } export interface AttachmentV2 { fileId?: string; fileName?: string; fileType?: string; url?: string; } /** * @deprecated */ export interface ImageV2 { id: string; tiny?: string; small?: string; medium?: string; large?: string; original?: string; } export interface Image { id: string; url?: { [size: string]: string; }; } export interface Video { id: string; url: string; } export interface FileManager { createdAt: Timestamp; createdBy: UserId; files: { [id: string]: FileManagerFile; }; id: string; name: string; // file original name section: FileSection; totalFiles: number; totalFileSize: number; type: FileType; metadata?: { [key: string]: unknown; }; } export interface FileManagerFile { id: string; // original | ImageSize filePath: string; fileSize: number; url: string; }