import { CanvasScenesStore, type CanvasScene, type CanvasScenesOptions, type CanvasViewport, type FitViewportOptions } from '@pixerate/editor/canvas'; import type { EffectProvider } from '@pixerate/editor/effects'; import type { CanvasNode } from './types.js'; export interface CreateCanvasScenesOptions extends CanvasScenesOptions { /** Reads the live viewport, used by `capture` / `recapture` (e.g. `useSvelteFlow().getViewport`). */ getViewport?: () => CanvasViewport; /** Moves the canvas to a scene (e.g. `useSvelteFlow().setViewport`). */ setViewport?: (viewport: CanvasViewport, options?: { duration?: number; }) => void; /** Transition duration passed to `setViewport` when showing a scene (default 300ms). */ duration?: number; /** * Plays a scene's provider transition (`scene.transition`) when showing it: `element` is the * canvas view to capture and cover (e.g. the SvelteFlow wrapper). Without a provider or an * element, scenes are shown with the plain viewport move. */ transitions?: { provider: () => EffectProvider | null | undefined; element: () => HTMLElement | null; }; } /** * Headless Svelte 5 rune for Freeform-style Scenes: named saved viewports with * show next / previous, reorder, rename and JSON persistence. Wraps the framework-agnostic * `CanvasScenesStore` from `@pixerate/editor/canvas`. */ export declare function createCanvasScenes(options?: CreateCanvasScenesOptions): { store: CanvasScenesStore; readonly scenes: readonly CanvasScene[]; readonly currentId: string | null; readonly currentIndex: number; readonly current: CanvasScene | null; /** Saves the current viewport (or `viewport`) as a new scene. */ capture(name?: string, extra?: { viewport?: CanvasViewport; nodeIds?: string[]; index?: number; }): CanvasScene; /** Saves a scene framing the given nodes in a container of `size`. */ captureNodes(nodes: CanvasNode[], ids: string[], size: { width: number; height: number; }, name?: string, fit?: FitViewportOptions): CanvasScene | undefined; /** Replaces a scene's viewport with the live one. */ recapture(id: string): CanvasScene | undefined; update: (id: string, patch: Partial>) => CanvasScene | undefined; rename: (id: string, name: string) => CanvasScene | undefined; move: (id: string, toIndex: number) => void; reorder: (ids: string[]) => void; remove: (id: string) => void; clear: () => void; goTo: (id: string) => CanvasScene | undefined; next: () => CanvasScene | undefined; previous: () => CanvasScene | undefined; toJSON: () => import("@pixerate/editor/canvas").SerializedCanvasScenes; serialize: () => string; load: (input: string | unknown) => void; }; export type CanvasScenes = ReturnType;