import { RefObject } from 'react'; interface UseWallTokenOptions { /** Endpoint for GET/POST owner-token operations. Defaults to '/api/admin/wall-scene-token'. */ adminEndpoint?: string; /** Set true after admin role is confirmed; gates the GET fetch. */ isAdmin?: boolean; /** URL search-param key carrying the token. Defaults to 't'. */ paramKey?: string; /** * Site-level AI photobooth switch. Defaults to `'token'` (legacy behaviour: * `aiEnabled` flips true when the URL carries `?t=`). Pass `'off'` for * sites that don't want the AI scene flow at all — URL token capture is * skipped and `aiEnabled` stays false even if a token sneaks into the URL. * The admin token panel still renders for `isAdmin` users in either mode so * an owner can pre-configure a token before flipping AI on later. */ aiMode?: 'token' | 'off'; /** * Runtime override for the AI photobooth switch — typically wired to * `useWallSettings().wallAiEnabled`. When `false`, behaves exactly like * `aiMode: 'off'` (URL token capture skipped, `aiEnabled` forced false). * When `true` or omitted, the static `aiMode` controls behaviour. Lets a * site flip AI on/off at runtime via the admin checkbox without a redeploy. */ enabled?: boolean; } interface WallTokenAdmin { currentToken: string; input: string; setInput: (v: string) => void; generate: (len?: number) => void; save: () => Promise; saving: boolean; loaded: boolean; shareUrl: string; qrCanvasRef: RefObject; downloadQR: () => void; clear: () => void; } interface UseWallTokenResult { /** True iff the URL carried a token at mount; AI scene generation should be enabled. */ aiEnabled: boolean; /** Live token value, in-memory only, captured once at mount. */ tokenRef: RefObject; /** Owner-only admin panel state. Always returned, but `loaded` stays false until an admin GET completes. */ admin: WallTokenAdmin; } /** * Captures a one-shot wall-access token from the URL (`?t=`) on mount and * strips it from the address bar via `history.replaceState`. Held in-memory only — * never persisted in localStorage / sessionStorage. * * When `isAdmin` is true, also fetches and exposes the admin token panel state * (current token, editable input, generate/save handlers, QR canvas ref + download). */ declare function useWallToken(opts?: UseWallTokenOptions): UseWallTokenResult; export { type UseWallTokenOptions, type UseWallTokenResult, type WallTokenAdmin, useWallToken };