import type { TreeNode } from "../../core/index.js"; import { useEffect } from "react"; export type NodeMap = ReadonlyMap; /** A value that rolls from one figure to the next rather than cutting to it. */ export interface NumericTick { from: number; to: number; /** The exact string the leaf renders for a value — the tick writes these. */ render(value: number): string | null; } export type NodeMark = { kind: "enter"; } | { kind: "exit"; } | { kind: "pulse"; tick: NumericTick | null; }; export interface PaintDiff { marks: ReadonlyMap; /** Departed subtrees, with the surviving parent and slot they held. */ exits: ReadonlyArray<{ parent: string; index: number; id: string; }>; } /** What moved between two paints of the same screen. Pure. */ export declare function diffPaints(before: NodeMap, after: NodeMap): PaintDiff; /** The beat has to be set up BEFORE the browser paints the repaint, or an * entering row flashes at full height for a frame. On the server there is no * paint (and no marks), so the layout variant would only earn a warning. */ export declare const useMotionLayoutEffect: typeof useEffect; /** * The renderer's seam. Returns the node map to WALK — the repaint's own, plus * any departing subtrees spliced back into the slots they held — and the mark * each node's shell should play. * * `active` is the caller's "this is a repaint of a live screen" gate; while it * is false the baseline resets, so the paint that turns it back on is treated * as a first paint rather than a diff against a stream. */ export declare function useRepaintMotion(nodes: NodeMap, active: boolean): { nodes: NodeMap; marks: ReadonlyMap; }; /** Play a node's mark on its shell element. Safe to call with no Web Animations * support (jsdom, older engines): the beat is skipped, the paint still lands. */ export declare function playNodeMotion(el: HTMLElement, mark: NodeMark): void;