import type { ChecksumOptions, DirectoryListing, FileContents, GetStreamOptions, ListOptions, MimeTypeOptions, PresignedUploadPolicy, PresignedUploadPolicyOptions, PresignedUploadUrl, PresignedUploadUrlOptions, PublicUrlOptions, PutResult, PutStreamOptions, SignedUrlOptions, StatEntry, StorageAdapter, TemporaryUrlOptions, Visibility } from '../types'; /** * Convenience factory — most app code reads cleaner with the * function form than `new ScopedStorageAdapter(...)`. * * @example * ```ts * const tenantDisk = scoped(Storage.disk('s3'), { scope: `tenant-${id}` }) * ``` */ export declare function scoped(inner: StorageAdapter, options: ScopedAdapterOptions): ScopedStorageAdapter; /** * Configuration for a scoped adapter. */ export declare interface ScopedAdapterOptions { scope: string scopePattern?: RegExp } /** * Wrap any `StorageAdapter` to scope every operation under a * per-tenant prefix. The wrapped instance presents the same * `StorageAdapter` interface so the session middleware / * `Storage.disk()` / cross-disk copy all work transparently. * * Construction validates the scope against * {@link ScopedAdapterOptions.scopePattern} so a hostile or * malformed tenant id can't escape via `..` segments or path * separators. * * @example * ```ts * const tenantDisk = new ScopedStorageAdapter( * Storage.disk('s3'), * { scope: `tenant-${tenantId}` }, * ) * await tenantDisk.write('avatar.jpg', file) // → tenant-42/avatar.jpg * ``` */ export declare class ScopedStorageAdapter implements StorageAdapter { constructor(inner: StorageAdapter, options: ScopedAdapterOptions); write(path: string, contents: FileContents): Promise; read(path: string): Promise; readToString(path: string): Promise; readToBuffer(path: string): Promise; readToUint8Array(path: string): Promise; deleteFile(path: string): Promise; deleteDirectory(path: string): Promise; createDirectory(path: string): Promise; moveFile(from: string, to: string): Promise; copyFile(from: string, to: string): Promise; stat(path: string): Promise; list(path: string, options?: ListOptions): DirectoryListing; changeVisibility(path: string, visibility: Visibility): Promise; visibility(path: string): Promise; fileExists(path: string): Promise; directoryExists(path: string): Promise; publicUrl(path: string, options?: PublicUrlOptions): Promise; temporaryUrl(path: string, options: TemporaryUrlOptions): Promise; signedUrl(path: string, options: SignedUrlOptions): Promise; presignedUploadUrl(options: PresignedUploadUrlOptions): Promise; presignedUploadPolicy(options: PresignedUploadPolicyOptions): Promise; getStream(path: string, options?: GetStreamOptions): Promise>; putStream(path: string, stream: ReadableStream, options?: PutStreamOptions): Promise; checksum(path: string, options?: ChecksumOptions): Promise; mimeType(path: string, options?: MimeTypeOptions): Promise; lastModified(path: string): Promise; fileSize(path: string): Promise; }