2023-02-03 16:16:25 +01:00
|
|
|
import { ReadStream } from 'fs';
|
|
|
|
|
|
|
|
export interface ImmichReadStream {
|
|
|
|
stream: ReadStream;
|
|
|
|
type: string;
|
|
|
|
length: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const IStorageRepository = 'IStorageRepository';
|
|
|
|
|
|
|
|
export interface IStorageRepository {
|
|
|
|
createReadStream(filepath: string, mimeType: string): Promise<ImmichReadStream>;
|
2023-02-25 15:12:03 +01:00
|
|
|
unlink(filepath: string): Promise<void>;
|
|
|
|
unlinkDir(folder: string, options?: { recursive?: boolean; force?: boolean }): Promise<void>;
|
|
|
|
removeEmptyDirs(folder: string): Promise<void>;
|
|
|
|
moveFile(source: string, target: string): Promise<void>;
|
|
|
|
checkFileExists(filepath: string): Promise<boolean>;
|
|
|
|
mkdirSync(filepath: string): void;
|
2023-02-03 16:16:25 +01:00
|
|
|
}
|