import { WallScene } from '../types/wall.js'; interface UseWallScenesOptions { /** Endpoint that returns `{ scenes: WallScene[] }` newest-first. Defaults to '/api/wall-scenes'. */ scenesEndpoint?: string; /** Public scene poll interval. 0 disables polling. Default 10000. */ pollMs?: number; /** Auto-rotation interval. 0 disables rotation. Default 10000. */ rotationMs?: number; } interface UseWallScenesResult { scenes: WallScene[]; activeScene: WallScene | null; /** Index of the active scene in the (newest-first) `scenes` array — useful for thumbnail highlight. */ activeSceneIndex: number; /** Jump rotation to a specific scene; resets the rotation timer. */ setActiveScene: (id: string) => void; /** Re-fetch scenes (used after creating one). */ refresh: () => Promise; } /** * Manages the wall scene list, public polling, and the auto-rotating slideshow * with new-arrival interrupt logic for TV/live wall mode. * * Behaviour: * - `scenes` is the raw list (newest-first) returned by `scenesEndpoint`. Updated on poll. * - On hard reload: rotation order = scenes order; `activeScene` starts at scenes[0]. * - On 10s rotation tick: advance to the next id in `playOrder`, wrapping at the end. * - When poll detects new ids: insert them right after the currently displayed scene * in `playOrder`, jump display to the first new scene (interrupt), and reset the * rotation timer so the new scene gets a full cycle. Thumbnail order (= scenes * array) keeps showing newest first — the rotation order is independent. * - Deleted scenes are pruned from `playOrder`. */ declare function useWallScenes(opts?: UseWallScenesOptions): UseWallScenesResult; export { type UseWallScenesOptions, type UseWallScenesResult, useWallScenes };