import { Storage, Client } from 'node-appwrite'; import { Adapter, FilesError } from '../index.js'; interface AppwriteAdapterOptions { /** * Appwrite storage bucket ID. */ bucket: string; /** * Existing client instance or Storage instance. * Highest precedence. */ client?: Client | Storage; /** * Appwrite API endpoint (e.g. `https://cloud.appwrite.io/v1`). * Falls back to `APPWRITE_ENDPOINT` then `NEXT_PUBLIC_APPWRITE_ENDPOINT`. */ endpoint?: string; /** * Appwrite Project ID. * Falls back to `APPWRITE_PROJECT_ID` then `NEXT_PUBLIC_APPWRITE_PROJECT_ID`. */ projectId?: string; /** * Appwrite API Key. * Falls back to `APPWRITE_API_KEY` then `APPWRITE_KEY`. */ key?: string; /** * Set to `true` if the bucket is configured as a public bucket. * `url()` will then return a constructed permanent, unsigned URL. * Otherwise, `url()` throws an error. */ public?: boolean; } type AppwriteAdapter = Adapter & { readonly bucket: string; }; declare const mapAppwriteError: (err: unknown) => FilesError; declare const appwrite: (opts: AppwriteAdapterOptions) => AppwriteAdapter; export { type AppwriteAdapter, type AppwriteAdapterOptions, appwrite, mapAppwriteError };