@foal/storage
Version:
Storage components for FoalTS
27 lines (26 loc) • 768 B
TypeScript
import { Readable } from 'stream';
import { Disk } from './disk.service';
/**
* File storage to write, read and delete files in the local file system.
*
* @export
* @class LocalDisk
* @extends {Disk}
*/
export declare class LocalDisk extends Disk {
write(dirname: string, content: Buffer | Readable, options?: {
name?: string;
} | {
extension?: string;
}): Promise<{
path: string;
}>;
read<C extends 'buffer' | 'stream'>(path: string, content: C): Promise<{
file: C extends 'buffer' ? Buffer : C extends 'stream' ? Readable : never;
size: number;
}>;
readSize(path: string): Promise<number>;
delete(path: string): Promise<void>;
private getPath;
}
export { LocalDisk as ConcreteDisk };