import { type MediaImageRef } from "@/api/media"; /** * Photo storage for business and restaurant profiles, backed by media-service. * * Replaces the previous direct-to-R2 client, which had to ship an R2 access key and * secret inside the production bundle to sign its own requests. Here the browser only * ever holds a short-lived signed upload URL handed out by the service. */ /** media-service rejects anything else with `415 UNSUPPORTED_MEDIA_TYPE`. */ export declare const SUPPORTED_MIME_TYPES: string[]; /** * For `ImageDropField`. Narrower than the field's default because gif — which the old * direct-to-R2 path accepted, since it validated nothing — cannot be stored here. */ export declare const SUPPORTED_FILE_ACCEPT = ".jpg, .jpeg, .png, .webp"; export declare function isManagedUrl(url: string | null | undefined): boolean; interface Scope { businessId?: string; restaurantId?: string; } export declare const mediaStorage: { /** * Uploads bytes and returns the URL to persist. * * Three calls: reserve a signed URL, PUT to it, then confirm so the asset row exists. * A failure after the PUT leaves an orphaned object and no asset row, which is why * `confirm` is never skipped. */ upload(ref: MediaImageRef, file: File, options?: Scope & { bustCache?: boolean; }): Promise; /** * Removes an image the merchant cleared. * * `currentUrl` is what the profile currently holds. Anything written before the * media-service migration lives at a URL this API cannot address, so those objects * are left in place and only the profile field is cleared by the caller — the images * stay readable at their old URL either way, and no merchant-visible surface reads a * profile field we did not clear. */ remove(ref: MediaImageRef, currentUrl: string | null | undefined, options?: Scope): Promise; }; /** * Carousel photos have no natural id, so they get a minted one. * * No colons or dots, unlike the ISO string the old key used: they are legal in a key * segment today, but nothing here needs them and a plain alphanumeric stamp cannot be * mangled by a URL encoder on the way to storage. */ export declare function mintPhotoImageId(index: number): string; export {};