import { type CanvasTokenOptions } from '@pixerate/editor/canvas'; import type { TokenModeContext, TokenState, TokenStore } from '@pixerate/editor/tokens'; import type { CanvasNode } from './types.js'; export interface CreateCanvasTokensOptions extends Omit { store: TokenStore; getNodes: () => TNode[]; setNodes: (nodes: TNode[]) => void; /** Modes for nodes without an explicit mode up their tree, or a getter for reactive modes. */ modes?: TokenModeContext | (() => TokenModeContext | undefined); } /** * Headless Svelte 5 rune keeping token-bound node properties resolved. Token edits, undo and * redo re-resolve the nodes; deleting a variable detaches the nodes bound to it, keeping their * values. Call `resolve()` after changing the nodes yourself (e.g. pasting bound nodes, or * switching the root `modes`); `bind` and `setMode` resolve on their own. */ export declare function createCanvasTokens(options: CreateCanvasTokensOptions): { /** The token store's state (reactive). */ readonly state: TokenState; /** Binds (or with `null` unbinds) a property of the nodes; throws `TokenError` when refused. */ bind(ids: Iterable, propertyKey: string, variableId: string | null): void; /** Sets (or with `null` clears) an explicit mode on frames / groups; descendants follow. */ setMode(ids: Iterable, collectionId: string, modeId: string | null): void; /** The modes a node is in (its own, inherited, then the root `modes`). */ modesOf(nodeId: string): Record; /** Re-resolves every bound property (after changing nodes or root modes). */ resolve: () => void; destroy: () => void; }; export type SvelteCanvasTokens = ReturnType;