burdy
Version:
Open Source Headless Platform
30 lines (29 loc) • 977 B
TypeScript
/// <reference types="node" />
import { IFileDriver } from '@server/drivers/file.driver';
import multer from 'multer';
import stream from 'stream';
export default class AwsS3FileDriver implements IFileDriver {
private provider;
private dir;
private bucket;
private region;
private s3;
constructor();
getPath: (key: string) => string;
getUpload: () => multer.Multer;
getName: () => string;
getKey: (key?: string) => string;
write: (key: string, data: any) => Promise<{
key: string;
provider: string;
}>;
stat: (key: string) => Promise<any>;
read: (key: string) => Promise<any>;
createReadStream: (key: string, options: any) => any;
createWriteStream: (key: string) => stream.PassThrough;
uploadReadableStream: (key: string, stream: any) => Promise<any>;
delete: (params: string | string[]) => Promise<any>;
copy: (src: string, dest: string) => Promise<{
dest: string;
}>;
}