import { Readable } from 'stream'; /** * S3 storage class for objects. * Defined locally to decouple from the AWS SDK types. * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html */ export declare enum StorageClass { DEEP_ARCHIVE = "DEEP_ARCHIVE", EXPRESS_ONEZONE = "EXPRESS_ONEZONE", GLACIER = "GLACIER", GLACIER_IR = "GLACIER_IR", INTELLIGENT_TIERING = "INTELLIGENT_TIERING", ONEZONE_IA = "ONEZONE_IA", OUTPOSTS = "OUTPOSTS", REDUCED_REDUNDANCY = "REDUCED_REDUNDANCY", SNOW = "SNOW", STANDARD = "STANDARD", STANDARD_IA = "STANDARD_IA" } /** * Common arguments shared by all upload methods. */ export interface BaseUploadArgs { /** Destination bucket to upload the file to */ bucket: string; /** Path in the bucket to upload the file to */ remotePath: string; /** * A standard MIME type describing the format of the contents * @see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type */ contentType?: string; /** * Metadata to be stored with the file. * all keys must start with "x-amz-meta-" prefix * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html#UserMetadata */ metadata?: Record; /** * The S3 storage class for the object. * @default 'STANDARD' * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html */ storageClass?: StorageClass; /** * The HTTP Cache-Control header holds directives (instructions) in both requests and responses * that control caching in browsers and shared caches (e.g., Proxies, CDNs). * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control */ cacheControl?: string; } export interface UploadFileArgs extends BaseUploadArgs { /** Path to local file */ filePath: string; } export interface UploadContentArgs extends BaseUploadArgs { /** Content of the file to upload */ content: string; } export interface UploadStreamArgs extends BaseUploadArgs { stream: Readable; } export interface DownloadFileArgs { bucket: string; remotePath: string; filePath: string; } export interface ListFilesArgs { bucket: string; remotePath: string; maxKeys?: number; startAfterKey?: string; } export interface IterateFilesArgs { bucket: string; remotePath: string; pageSize?: number; } export interface GetMetadataArgs { bucket: string; remotePath: string; } export interface DeleteFileArgs { bucket: string; remotePath: string; } export interface BucketExistsArgs { bucket: string; } export interface CreateBucketArgs { bucket: string | undefined; } export interface CreateBucketResponse { Location?: string; } export interface DeleteBucketArgs { bucket: string | undefined; } export interface PutBucketPolicyArgs { bucket: string | undefined; policy: string | undefined; } export interface HeadObject { AcceptRanges?: string; LastModified?: Date; ContentLength?: number; ETag?: string; ContentType?: string; Metadata?: Record; StorageClass?: string; CacheControl?: string; } export interface GetObjectArgs { bucket: string | undefined; key: string | undefined; } export interface GetObjectResponseBody extends Readable { transformToByteArray(): Promise; transformToString(): Promise; transformToWebStream(): ReadableStream; } export interface GetObjectResponse { Body?: GetObjectResponseBody; ContentType?: string; } export interface IterateFilesResponseItem { key: string; lastModified: Date | undefined; size: number | undefined; } export interface DeleteObjectArgs { bucket: string | undefined; key: string | undefined; } export interface GetPresignedUrlArgs { /** The bucket the signed URL belongs to */ bucket: string; /** The key of the object the signed URL belongs to */ remotePath: string; /** The expiration time of the signed URL in seconds */ expirationInSec: number; }