import { a as BucketFile, S as S3Auth, F as FileInfo, W as WriteContent, c as WriteOptions, B as Bucket, b as BucketInfo } from '../types-ANca2IFa.js'; interface S3BucketContext { makeUrl: (path?: string) => string; doRequest: (method: string, path: string, options?: { body?: string | Buffer; headers?: Record; }) => Promise; getAuth: () => Promise; bucketName: string; url: string; prefix: string; } declare class S3File implements BucketFile { #private; name: string; path: string; constructor(path: string, ctx: S3BucketContext); slice(start: number, end?: number): S3File; info(): Promise; exists(): Promise; text(): Promise; json(): Promise; arrayBuffer(): Promise; blob(): Promise; bytes(): Promise; write(content: WriteContent, options?: WriteOptions): Promise; copyTo(dest: string | BucketFile): Promise; moveTo(dest: string | BucketFile): Promise; rename(name: string): Promise; remove(): Promise; unlink(): Promise; stream(): ReadableStream; nodeReadable(): NodeJS.ReadableStream; writable(options?: WriteOptions): WritableStream; nodeWritable(options?: WriteOptions): NodeJS.WritableStream; publicUrl(): Promise; signedUrl(opts: { expires: number | string; }): Promise; uploadUrl(opts: { expires: number | string; }): Promise; } interface S3Config { id?: string; secret?: string; region?: string; url?: string; sessionToken?: string; } declare class S3Bucket implements Bucket { #private; readonly type = "S3"; private bucketName; private region; private url; PREFIX: string; constructor(bucketName?: string, { id, secret, region, url, sessionToken, }?: S3Config); private makeUrl; private doRequest; info(): Promise; scan(filter?: RegExp): AsyncGenerator; list(filter?: RegExp): Promise; remove(filter?: RegExp): Promise; file(name: string): S3File; folder(path: string): S3Bucket; count(filter?: RegExp): Promise; [Symbol.asyncIterator](): AsyncGenerator; } /** * Create an AWS S3 bucket handle. * * @param bucket - Bucket name (falls back to `AWS_BUCKET` env var) * @param config.id - Access Key ID (falls back to `AWS_ACCESS_KEY_ID`) * @param config.secret - Secret Access Key (falls back to `AWS_SECRET_ACCESS_KEY`) * @param config.sessionToken - Session token for temporary credentials (falls back to `AWS_SESSION_TOKEN`) * @param config.region - AWS region, default `"us-east-1"` (falls back to `AWS_REGION`) * @param config.url - Custom url URL (falls back to `AWS_URL`) * * When `id` and `secret` are not provided, credentials are resolved automatically * from the environment: ECS/Lambda container credentials or EC2 instance metadata. * * @example * const bucket = S3("my-bucket", { id: "keyId", secret: "secretKey", region: "us-west-2" }); * await bucket.file("hello.txt").write("hello"); */ declare function S3(bucket?: string, config?: S3Config): S3Bucket; export { Bucket, BucketFile, BucketInfo, FileInfo, type S3Config, WriteContent, WriteOptions, S3 as default };