import { ChokidarOptions } from 'chokidar';
import { Dirent, ReadOptionsWithBuffer, watch } from 'node:fs';
import { PassThrough, Readable, Writable } from 'node:stream';
import { CrawlOptionsDto, WalkOptionsDto } from "../dtos/library.dto";
import { LoggingRepository } from "./logging.repository";
export interface WatchEvents {
    onReady(): void;
    onAdd(path: string): void;
    onChange(path: string): void;
    onUnlink(path: string): void;
    onError(error: Error): void;
}
export interface ImmichReadStream {
    stream: Readable;
    type?: string;
    length?: number;
}
export interface ImmichZipStream extends ImmichReadStream {
    addFile: (inputPath: string, filename: string) => void;
    finalize: () => Promise<void>;
}
export interface DiskUsage {
    available: number;
    free: number;
    total: number;
}
export declare class StorageRepository {
    private logger;
    constructor(logger: LoggingRepository);
    realpath(filepath: string): Promise<string>;
    readdir(folder: string): Promise<string[]>;
    readdirWithTypes(folder: string): Promise<Dirent[]>;
    copyFile(source: string, target: string): Promise<void>;
    stat(filepath: string): Promise<import("fs").Stats>;
    createFile(filepath: string, buffer: Buffer): Promise<void>;
    createWriteStream(filepath: string): Writable;
    createOrOverwriteFile(filepath: string, buffer: Buffer): Promise<void>;
    overwriteFile(filepath: string, buffer: Buffer): Promise<void>;
    rename(source: string, target: string): Promise<void>;
    utimes(filepath: string, atime: Date, mtime: Date): Promise<void>;
    createZipStream(): ImmichZipStream;
    createGzip(): PassThrough;
    createGunzip(): PassThrough;
    createPlainReadStream(filepath: string): Readable;
    createReadStream(filepath: string, mimeType?: string | null): Promise<ImmichReadStream>;
    readFile(filepath: string, options?: ReadOptionsWithBuffer<Buffer>): Promise<Buffer>;
    readJsonFile<T>(filepath: string): Promise<T>;
    checkFileExists(filepath: string, mode?: number): Promise<boolean>;
    unlink(file: string): Promise<void>;
    unlinkDir(folder: string, options: {
        recursive?: boolean;
        force?: boolean;
    }): Promise<void>;
    removeEmptyDirs(directory: string, self?: boolean): Promise<void>;
    mkdirSync(filepath: string): void;
    existsSync(filepath: string): boolean;
    checkDiskUsage(folder: string): Promise<DiskUsage>;
    crawl(crawlOptions: CrawlOptionsDto): Promise<string[]>;
    walk(walkOptions: WalkOptionsDto): AsyncGenerator<string[]>;
    watch(paths: string[], options: ChokidarOptions, events: Partial<WatchEvents>): () => Promise<void>;
    watchDir: typeof watch;
    private asGlob;
}
