import * as blob from '@vercel/blob'; import { Adapter } from '../index.js'; interface VercelBlobAdapterOptions { token?: string; /** * Whether blobs uploaded by this adapter are public or private. * * - `"public"` (default): blobs are uploaded with `access: "public"` and * reachable via their CDN URL without authentication. `url()` returns a * permanent public URL. * - `"private"`: blobs are uploaded with `access: "private"`. They cannot * be fetched by URL — `download()` and the lazy bodies returned from * `head()` / `list()` instead route through `blob.get(key, { access: * "private" })`, which uses the token. `url()` throws because there is * no permanent public URL for private blobs. * * The setting is fixed at construction so a single `Files` instance is * unambiguously one or the other. If you need both, instantiate two * adapters. */ access?: "public" | "private"; /** * Add a random suffix to uploaded keys (Vercel default). * * When `false`, the resulting pathname matches the key 1:1, which keeps * the API consistent with S3/R2 where callers expect to control the key. * Defaults to `false`. */ addRandomSuffix?: boolean; /** * Allow overwriting existing keys on upload. Defaults to `true` so that the * "predictable keys" behavior (`addRandomSuffix: false`) actually works — * Vercel rejects same-pathname uploads otherwise. * * **Trade-off:** with the defaults, an `upload(key, ...)` call silently * clobbers any existing object at `key`. If keys are derived from * untrusted input or your callers expect "create-only" semantics, set * `allowOverwrite: false` and handle the resulting Conflict. */ allowOverwrite?: boolean; /** * Timeout in milliseconds for public-URL fetches issued by `download()`, * and by lazy bodies returned from `head()`/`list()`. A hung CDN response * would otherwise leak a fetch that never resolves. * * Defaults to 300_000 (5 minutes). Pass `0` to disable the timeout (not * recommended in server contexts — a stuck request will pin a connection * until the runtime tears it down). */ downloadTimeoutMs?: number; } type VercelBlobClient = typeof blob; type VercelBlobAdapter = Adapter; declare const vercelBlob: (opts?: VercelBlobAdapterOptions) => VercelBlobAdapter; export { type VercelBlobAdapter, type VercelBlobAdapterOptions, type VercelBlobClient, vercelBlob };