UNPKG

@russ-b/nestjs-common-tools

Version:
16 lines (15 loc) 860 B
import { S3Client } from '@aws-sdk/client-s3'; import { Readable } from 'stream'; import { StreamingBlobPayloadInputTypes } from '@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types'; import { UploadParams } from './s3.interface'; export declare class S3Service { private readonly options; private readonly s3Client; private readonly logger; private readonly bucket; constructor(options: Record<string, string>, s3Client: S3Client); upload(key: string, body: StreamingBlobPayloadInputTypes, contentType?: string, params?: UploadParams): Promise<void>; uploadObject(key: string, body: StreamingBlobPayloadInputTypes, contentType?: string, params?: UploadParams): Promise<void>; deleteObject(key: string, bucket?: string): Promise<void>; getObject(key: string, bucket?: string): Promise<Readable>; }