import { Scope } from '@aws-blocks/core'; import type { ScopeParent } from '@aws-blocks/core'; import type { FileBucketOptions, PutOptions, PutUrlOptions, ScanOptions, FileContent, FileInfo, ExternalBucketRef, ExternalKmsKeyRef, FileDownloadClient, FileUploadClient, FileVersionInfo, GetOptionsFor, DeleteOptionsFor, GetUrlOptionsFor } from './types.js'; import type { ChildLogger } from '@aws-blocks/bb-logger'; export { FileBucketErrors } from './errors.js'; export type { FileBucketOptions, PutOptions, GetUrlOptions, PutUrlOptions, ScanOptions, FileContent, FileInfo, CorsRule, LifecycleRule, ExternalBucketRef, ExternalKmsKeyRef, ObjectLockOptions, FileDownloadClient, FileUploadClient, FileVersionInfo, FileDownloadDescriptor, FileUploadDescriptor, VersionedGetOptions, VersionedDeleteOptions, VersionedGetUrlOptions, GetOptionsFor, DeleteOptionsFor, GetUrlOptionsFor, } from './types.js'; /** * File storage backed by Amazon S3. * * **When to use:** You need to store, retrieve, or serve binary files — * user uploads, generated reports, images, videos, or static assets. * * **When NOT to use:** If you need structured key-value data with conditional * writes, use `KVStore`. If you need queryable records with indexes, use * `DistributedTable`. * * **Best practices:** * - Use path prefixes to organize files (e.g., `uploads/{userId}/`, `reports/`) * - Set `contentType` on `put()` to ensure correct MIME handling on download * - Use `getFileHandle` / `createUploadHandle` for ergonomic browser file transfers * - Use presigned URLs (`getUrl` / `putUrl`) when you need direct URL control * - Prefer `scan({ prefix })` over unscoped `scan()` to limit enumeration cost * * **Scaling:** S3 scales automatically. No provisioned throughput. Costs are * per-request plus storage. Individual objects up to 5 TB. For objects larger * than ~100 MB, consider multipart upload. */ export declare class FileBucket extends Scope { readonly bbName = "FileBucket"; private s3; /** Set when this bucket was declared with `objectLock` (presigned uploads can't satisfy its checksum requirement). */ private readonly objectLocked; /** @internal Logger for internal operations. Defaults to error-level when not provided. */ protected log: ChildLogger; constructor(scope: ScopeParent, id: string, options?: O); put(path: string, body: Buffer | string, options?: PutOptions): Promise; get(path: string, options?: GetOptionsFor): Promise; delete(path: string, options?: DeleteOptionsFor): Promise; deleteBatch(paths: string[]): Promise; getUrl(path: string, options?: GetUrlOptionsFor): Promise; putUrl(path: string, options?: PutUrlOptions): Promise; getFileHandle(path: string, options?: GetUrlOptionsFor): Promise; createUploadHandle(path: string, options?: PutUrlOptions): Promise; scan(options?: ScanOptions): AsyncIterable; listVersions(path: string): Promise; restoreVersion(path: string, versionId: string): Promise; private assertPresignedUploadSupported; static fromExisting(bucketName: string): ExternalBucketRef; /** * Reference an existing customer-managed KMS key by ARN, to pass as the * `encryption` option. Encryption is applied at deploy time; the * runtime only needs the reference to keep code shared with the CDK build. * * @param keyArn - The ARN of the existing KMS key. */ static fromKmsKey(keyArn: string): ExternalKmsKeyRef; } //# sourceMappingURL=index.aws.d.ts.map