import { Storage } from '@google-cloud/storage'; import { Adapter, FilesError } from '../index.js'; interface GCSAdapterOptions { bucket: string; /** * GCP project ID. Falls back to `GOOGLE_CLOUD_PROJECT` then * `GCLOUD_PROJECT`. Optional — Application Default Credentials carry * a project ID and the SDK will discover it automatically. */ projectId?: string; /** * Path to a service-account JSON file. When set, takes precedence over * ADC. Mutually exclusive with `credentials` in practice; if both are * passed, the SDK uses `credentials`. */ keyFilename?: string; /** * Inline service-account credentials. Useful when you only have * `client_email` + `private_key` available as separate env vars (e.g. * Vercel/Netlify) and don't want to materialize a JSON file. When * neither this nor `keyFilename` is set, the SDK falls back to ADC * (`GOOGLE_APPLICATION_CREDENTIALS`, `gcloud auth`, GCE metadata). */ credentials?: { client_email: string; private_key: string; }; /** * Origin used to build URLs from `url()`. When set, `url(key)` returns * `${publicBaseUrl}/${key}` and skips signing — appropriate for a * public bucket or a CDN in front of GCS. When unset, `url()` falls * back to a V4 signed read URL (default expiry: 1 hour). * * For a public GCS bucket, the natural value is * `https://storage.googleapis.com/`. */ publicBaseUrl?: string; /** * Default expiry, in seconds, for the V4 signed URLs returned by * `url()` when `publicBaseUrl` is not set. Defaults to 3600 (1 hour). * Per-call `url(key, { expiresIn })` overrides. GCS V4 caps at 7 days. */ defaultUrlExpiresIn?: number; } type GCSAdapter = Adapter & { readonly bucket: string; }; declare const mapGCSError: (err: unknown) => FilesError; declare const gcs: (opts: GCSAdapterOptions) => GCSAdapter; export { type GCSAdapter, type GCSAdapterOptions, gcs, mapGCSError };