import type { MutableRefObject, RefObject } from "react";
/**
 * Returns `false` on the server (no effect fires there) and during the
 * first client render after hydration; `true` from the first
 * post-commit re-render onward.
 */
export declare function useHydration(): boolean;
/**
 * Returns `true` when this component instance was mounted via SSR
 * hydration (i.e. there was server-rendered HTML to hydrate from), and
 * `false` when it was mounted via pure client-side rendering (no SSR).
 *
 * The trick: `useSyncExternalStore`'s `getServerSnapshot` callback is
 * called *only* during hydration of server-rendered content — never
 * during a fresh CSR mount. Returning different values from the two
 * snapshots lets us read the hydration mode on the very first render,
 * then we capture it into a ref so it survives later renders.
 *
 * Stream Frames use this to decide whether to skip the intro animation
 * on the canvas's first paint: when SSR has already shown the chart in
 * its final state, re-animating from blank when the canvas takes over
 * looks like a regression. CSR mounts keep their intro animation
 * because the SVG branch's output never actually paints (it's
 * overwritten by the canvas branch within the same paint frame, before
 * the browser commits a frame).
 */
export declare function useWasHydratingFromSSR(): boolean;
/**
 * Shared post-hydration lifecycle for every Stream Frame.
 *
 * Three things happen on every commit-after-hydration:
 *
 * 1. If we just rehydrated from SSR, cancel the intro animation that
 *    the SVG-branch's `computeScene` installed (the server already
 *    painted the chart in its final state — re-animating from blank
 *    on the canvas takeover is a visual regression).
 * 2. Mark the scene dirty so the canvas-paint pipeline rebuilds.
 * 3. **Paint the canvas synchronously** via `renderFnRef.current()`.
 *
 * Step 3 is the timing-critical bit. The hook fires inside an
 * isomorphic layout effect — `useLayoutEffect` on the client (runs
 * synchronously after commit but before the browser paints),
 * `useEffect` on the server (no-op, since SSR doesn't paint). If we
 * deferred the paint to a `requestAnimationFrame` (the standard
 * `scheduleRender()` route), the rAF callback wouldn't fire until
 * the *next* frame — meaning the browser would paint *frame N* with
 * the canvas in DOM but blank, then *frame N+1* with the canvas
 * actually drawn. Synchronous paint inside the layout effect makes
 * frame N's paint already include the canvas content; no flash.
 *
 * Each frame supplies its own `cleanup` for unmount work that's
 * frame-specific (XY/Ordinal clear the streaming adapter; Geo clears
 * its tile cache; Network has no extra cleanup).
 */
export interface HydrationLifecycleOptions {
    hydrated: boolean;
    wasHydratingFromSSR: boolean;
    /**
     * Ref to the frame's pipeline store. The store optionally implements
     * `cancelIntroAnimation()`; the hook calls it when the SVG → canvas
     * swap fires after SSR rehydration. (Currently every shipped store
     * implements the method, but the optional shape lets a custom store
     * opt out.)
     */
    storeRef: RefObject<{
        cancelIntroAnimation?: () => void;
    } | null>;
    /**
     * Mutable dirty flag the renderer reads on its next paint. The hook
     * sets it to true on every commit so the post-hydration paint
     * rebuilds the scene from scratch.
     */
    dirtyRef: MutableRefObject<boolean>;
    /**
     * Ref to the frame's render closure (assigned by `useFrame` /
     * the frame body). The hook calls this synchronously to paint
     * within the same frame as the SVG → canvas swap commit, avoiding
     * the one-frame blank-canvas flicker that an rAF-deferred paint
     * would produce.
     */
    renderFnRef: MutableRefObject<() => void>;
    /**
     * Optional unmount cleanup. Frame-specific work the hook can't
     * generalize — e.g. clearing the streaming `DataSourceAdapter`
     * (XY/Ordinal) or the geo tile cache.
     */
    cleanup?: () => void;
}
export declare function useHydrationLifecycle(opts: HydrationLifecycleOptions): void;
