import { UTApi } from 'uploadthing/server'; import { L as LocalMetaStorageOptions, i as BaseStorageOptions, F as File, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js"; import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-CYWYyCUo.js"; import 'node:stream'; import 'node:timers'; import 'node:crypto'; import 'node:http'; import 'lru-cache'; interface UploadThingStorageOptions extends BaseStorageOptions { /** * ACL applied to uploads. Drives `getReadUrl` behavior — `"public-read"` * returns the permanent CDN URL, `"private"` mints a short-lived signed * URL via `generateSignedURL`. Defaults to `"public-read"`. */ acl?: "private" | "public-read"; /** * Pre-built `UTApi` instance. Use this to share an instance, customize * `fetch`, or inject test stubs. Mutually exclusive with `token`. */ client?: UTApi; /** * Default expiry (seconds) for `getReadUrl` when `acl` is `"private"`. * Capped at 7 days (UploadThing maximum). Defaults to 3600 (1 hour). */ defaultUrlExpiresIn?: number; /** * Configure metafiles storage for resumable-upload bookkeeping. */ metaStorageConfig?: LocalMetaStorageOptions; /** * UploadThing token (base64-encoded JSON: `{ apiKey, appId, regions[] }`). * Falls back to `UPLOADTHING_TOKEN`. Ignored when `client` is supplied. */ token?: string; } declare class UploadThingFile extends File { customId?: string; fileHash?: string; ufsKey?: string; url?: string; } declare class UploadThingMetaStorage extends LocalMetaStorage { constructor(config?: LocalMetaStorageOptions); } /** * UploadThing storage backend. * * Uses `UTApi` from `uploadthing/server`. Uploads via `uploadFiles(UTFile)`, * keyed by user-supplied `customId` so subsequent operations (delete, signed * URL, list) round-trip on the user's key, not UploadThing's internal fileKey. * * **Limitations**: * - No native server-side `copy` — implemented as download + re-upload. * - `list` has no server-side prefix filter; prefix filtering happens client- * side within a page. * - No `responseContentDisposition` override on signed URLs. * @remarks * - ⚠️ Per-operation `signal`/`timeout` are best-effort: the underlying SDK does not support request cancellation, so an in-flight call may complete server-side even after abort. `retries` is honored. */ declare class UploadThingStorage extends BaseStorage { static override readonly name: string; override checksumTypes: string[]; protected meta: MetaStorage; private readonly acl; private readonly appId; private readonly defaultUrlExpiresIn; private readonly utapi; constructor(config: UploadThingStorageOptions); override get raw(): UTApi; create(config: FileInit, _options?: OperationOptions): Promise; write(part: FilePart | FileQuery | UploadThingFile, options?: OperationOptions): Promise; delete({ id }: FileQuery, options?: OperationOptions): Promise; get({ id }: FileQuery, options?: OperationOptions): Promise; copy(name: string, destination: string, options?: OperationOptions & { storageClass?: string; }): Promise; move(name: string, destination: string, options?: OperationOptions): Promise; override list(limit?: number, options?: OperationOptions): Promise; override getReadUrl(key: string, options?: { expiresIn?: number; responseContentDisposition?: string; responseContentType?: string; }): Promise; override getUploadUrl(_key: string, _options?: { contentLength?: number; contentType?: string; expiresIn?: number; }): Promise; private resolveFetchUrl; private internalOnComplete; } export { UploadThingFile, UploadThingMetaStorage, UploadThingStorage, type UploadThingStorageOptions };