@foal/aws-s3
Version:
AWS S3 storage components for FoalTS
28 lines (27 loc) • 752 B
TypeScript
import { Readable } from 'stream';
import { Disk } from '@foal/storage';
/**
* File storage to read, write and delete files in AWS S3.
*
* @export
* @class S3Disk
* @extends {Disk}
*/
export declare class S3Disk 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 get bucket();
private _s3;
private get s3();
}