import { RefObject } from '../../../../node_modules/react'; export interface UseCenterOnNodeOptions { /** * @default theme.transitions.duration.enteringScreen (read internally via `useTheme()`) — not * an arbitrary number. CJO times this to outlast `FlowConfigDrawer`'s own width transition, * which uses the same MUI token for the same reason (see `05-node-interactions.md` §2). * Override only if this canvas is never paired with a `FlowConfigDrawer`, or is paired with * one that animates on a different duration. */ delayMs?: number; /** @default 1 — CJO always centers at 100% zoom regardless of the zoom level before the click. */ zoom?: number; /** @default 400 — the `setCenter` pan/zoom's own duration (CJO `centerOnNode`). */ durationMs?: number; /** * @default { width: FLOW_NODE_WIDTH, height: FLOW_NODE_MIN_HEIGHT } — used when the target * node has not been measured yet. CJO's own `centerOnNode` uses a local, untokenized `150` * for height; this migration already carries a generic "unmeasured node fallback height" * token (`FLOW_NODE_MIN_HEIGHT`, from `00-node-tokens-and-theming.md`, also used by * `getFlowLayout`) so it is reused here rather than introducing a second, stray magic number * for the same underlying concept. Deliberate simplification versus CJO's two-different- * heights approach. */ fallbackSize?: { width: number; height: number; }; /** * Optional. When supplied, centering is skipped while this element reports a zero-size * bounding rect (CJO's `canvasContainerRef` guard) — protects against feeding `NaN` into the * viewport transform while the canvas itself hasn't been laid out yet (e.g. it's still hidden * behind a loading state or an inactive tab). `01-canvas.md`'s `FlowBuilder` exposes no * ref/context for its own container element, so a consumer that wants this guard must forward * its own container ref explicitly; omitting it skips the guard rather than failing to * compile. */ containerRef?: RefObject; } /** * Returns a stable function: call it with a node id to pan/zoom the canvas so that node is * centered, after `delayMs`. Must be called from a descendant of ``/ * `ReactFlowProvider` — it resolves the live React Flow instance via `@xyflow/react`'s * `useReactFlow()` internally. * * A node id the instance doesn't know about, or (when `containerRef` is supplied) a zero-size * container, is a silent no-op — never throws, never feeds `NaN` into `setCenter`. */ export declare function useCenterOnNode(options?: UseCenterOnNodeOptions): (nodeId: string) => void;