@codification/cutwater-aws
Version:
A library providing general functionality for TypeScript based AWS projects.
25 lines • 973 B
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { GetObjectOutput, PutObjectOutput, PutObjectRequest, S3 } from '@aws-sdk/client-s3';
import { Readable } from 'stream';
/**
* @beta
*/
export declare class S3Bucket {
static toMimeType(key: string): string;
private bucketName;
private s3Client;
constructor(bucketName: string, client?: S3);
setBucketName(name: string): void;
private headObject;
size(fileName: string): Promise<number | undefined>;
exists(fileName: string): Promise<boolean>;
private toDeleteObjectsRequest;
remove(...fileNames: string[]): Promise<void>;
loadBuffer(fileName: string): Promise<Buffer>;
private toBaseObjectRequest;
private toPutObjectRequest;
load(fileName: string): Promise<GetObjectOutput>;
store(fileName: string, content: string | Buffer | Readable, options?: Partial<PutObjectRequest>): Promise<PutObjectOutput>;
}
//# sourceMappingURL=S3Bucket.d.ts.map