/** * A structural subset of `@nl-framework/storage`'s `StorageAdapter`. The HTTP * package intentionally does **not** depend on the storage package — any object * shaped like this (S3, Azure, a test fake) can receive a streamed upload. */ export interface StorageAdapterLike { uploadObject(key: string, data: ArrayBuffer | Uint8Array, options?: { contentType?: string; cacheControl?: string; }): Promise<{ key: string; url?: string; }>; /** * Optional true-streaming path. When present, `pipeTo` streams the request * body straight through without buffering it in memory. */ uploadStream?(key: string, stream: ReadableStream, options?: { contentType?: string; cacheControl?: string; }): Promise<{ key: string; url?: string; }>; } /** * A single uploaded file extracted from a `multipart/form-data` request. * * Wraps the Web `File` yielded by `request.formData()` and exposes ergonomic * accessors plus helpers to persist the file to disk or stream it into any * `@nl-framework/storage` adapter without buffering. */ export declare class UploadedFileHandle { private readonly file; constructor(file: File); /** The original client-provided filename (`file.name`). */ get filename(): string; /** The declared MIME type (`file.type`), e.g. `image/png`. */ get mimeType(): string; /** File size in bytes. */ get size(): number; /** Read the whole file into memory. */ arrayBuffer(): Promise; /** A Web `ReadableStream` of the file's bytes (no buffering). */ stream(): ReadableStream; /** Persist the file to a filesystem path using Bun's fast `Bun.write`. */ saveTo(path: string): Promise; /** * Stream the file into a storage adapter under `key`. Uses the adapter's * `uploadStream` when available (no buffering); otherwise falls back to * reading the file into memory once and calling `uploadObject`. */ pipeTo(adapter: StorageAdapterLike, key: string): Promise<{ key: string; url?: string; }>; } /** Runtime guard used by decorators + tests. */ export declare const isUploadedFile: (value: unknown) => value is UploadedFileHandle; //# sourceMappingURL=uploaded-file.d.ts.map