import { SceneBackground } from '../types/wall.mjs'; interface UseSceneBackgroundsPanelOptions { /** * UI guard — only enables the setter; the central endpoint enforces auth + ownership * regardless. When false, `submit()` is a no-op so non-admin consumers can render the * primitive read-only. */ isAdmin?: boolean; /** * Per-site upload endpoint for the reference photo. Default `/api/uploads/wall-photos`. * Returns `{ url }`. */ uploadEndpoint?: string; /** * Centrally hosted generation endpoint. Default `/api/admin/generate-wall-background`. * Auth-required + ownership-guarded. Charges 5 credits per generation. */ generateEndpoint?: string; /** * Per-site backgrounds endpoint that lists/creates/deletes rows. Default * `/api/wall-scene-backgrounds`. The POST step is expected to download the * (temporary) Replicate URL into a stable upload schema before persisting. */ backgroundsEndpoint?: string; } interface SceneBackgroundsPanelState { /** The current list of backgrounds, newest-first. */ backgrounds: SceneBackground[]; /** Re-fetch the list. */ refresh: () => Promise; /** Delete one and refresh. */ remove: (id: string) => Promise; /** Title field (e.g. "The Bronx"). */ name: string; setName: (v: string) => void; /** Prompt field — used as the Replicate prompt and stored as the row's description. */ description: string; setDescription: (v: string) => void; /** Reference photo. */ file: File | null; setFile: (f: File | null) => void; /** True when any of upload / generate / save are in flight. */ generating: boolean; /** Human-readable progress label, e.g. "Generating scene with AI…". */ status: string; /** Last error message, or empty string. */ error: string; /** True when name + description + file are all populated and not currently generating. */ canSubmit: boolean; /** Run the full upload → generate → save flow and refresh the list. */ submit: () => Promise; /** Clear name + description + file (does not clear the list). */ reset: () => void; } /** * Owns the form state + 3-step submission for the scene-background editor: * * 1. Upload reference photo to `uploadEndpoint` → URL. * 2. POST `{ name, description, sourceImageUrl }` to `generateEndpoint` * (centrally credit-metered, returns a Replicate URL). * 3. POST `{ name, image_url, description }` to `backgroundsEndpoint` * (the per-site rule downloads the Replicate URL and persists the row). * * Pair with `` for the headless render layer, or wire to * your own JSX directly using the returned state. */ declare function useSceneBackgroundsPanel(opts?: UseSceneBackgroundsPanelOptions): SceneBackgroundsPanelState; export { type SceneBackgroundsPanelState, type UseSceneBackgroundsPanelOptions, useSceneBackgroundsPanel };