import { Stats } from 'fs'; import { FileReadOptions } from 'fs/promises'; import { Readable } from 'stream'; import { CrawlOptionsDto } from '../library'; export interface ImmichReadStream { stream: Readable; type?: string; length?: number; } export interface ImmichZipStream extends ImmichReadStream { addFile: (inputPath: string, filename: string) => void; finalize: () => Promise; } export interface DiskUsage { available: number; free: number; total: number; } export const IStorageRepository = 'IStorageRepository'; export interface IStorageRepository { createZipStream(): ImmichZipStream; createReadStream(filepath: string, mimeType?: string | null): Promise; readFile(filepath: string, options?: FileReadOptions): Promise; writeFile(filepath: string, buffer: Buffer): Promise; unlink(filepath: string): Promise; unlinkDir(folder: string, options?: { recursive?: boolean; force?: boolean }): Promise; removeEmptyDirs(folder: string, self?: boolean): Promise; moveFile(source: string, target: string): Promise; checkFileExists(filepath: string, mode?: number): Promise; mkdirSync(filepath: string): void; checkDiskUsage(folder: string): Promise; readdir(folder: string): Promise; stat(filepath: string): Promise; crawl(crawlOptions: CrawlOptionsDto): Promise; }