import { type CSSProperties, type ReactNode } from "react"; import type { ViewPort } from "react-zoomable-ui"; import { type JsonInput } from "./canvasHelpers"; import type { CanvasThemeMode, GraphData, LayoutDirection, NodeData } from "./types"; /** Imperative handle exposed via the component ref for viewport control. */ export interface JSONCrackRef { /** Nudge the current zoom factor up by one step while keeping center fixed. */ zoomIn: () => void; /** Nudge the current zoom factor down by one step while keeping center fixed. */ zoomOut: () => void; /** Set an absolute zoom factor at the current viewport center. */ setZoom: (zoomFactor: number) => void; /** Fit-to-center the full graph inside the viewport. */ centerView: () => void; /** Center and zoom on the root node of the graph. */ focusFirstNode: () => void; } /** Props accepted by the `JSONCrack` component. */ export interface JSONCrackProps { /** JSON to visualize. Accepts a string or plain object. */ json: JsonInput; /** Color theme applied to the canvas and nodes. Defaults to `dark`. */ theme?: CanvasThemeMode; /** ELK layout direction for node placement. Defaults to `RIGHT`. */ layoutDirection?: LayoutDirection; /** Whether to render the built-in zoom/focus control overlay. Defaults to `true`. */ showControls?: boolean; /** Whether to draw the background grid. Defaults to `true`. */ showGrid?: boolean; /** Treat two-finger trackpad gestures as touch (pinch-zoom, etc). Defaults to `false`. */ trackpadZoom?: boolean; /** Auto fit-to-center after each ELK layout pass. Defaults to `true`. */ centerOnLayout?: boolean; /** Hard cap on renderable nodes; exceeding it triggers the limit overlay. Defaults to `1500`. */ maxRenderableNodes?: number; /** Additional class name appended to the canvas wrapper. */ className?: string; /** Additional inline style merged onto the canvas wrapper. */ style?: CSSProperties; /** Called when a node is clicked. */ onNodeClick?: (node: NodeData) => void; /** Called with parsed `nodes`/`edges` after each successful parse. */ onParse?: (graph: GraphData) => void; /** Called with any error thrown during JSON parsing or graph construction. */ onParseError?: (error: Error) => void; /** Called once the internal `ViewPort` is created, before the first render. */ onViewportCreate?: (viewPort: ViewPort) => void; /** Custom renderer shown when the graph exceeds `maxRenderableNodes`. */ renderNodeLimitExceeded?: (nodeCount: number, maxRenderableNodes: number) => ReactNode; } /** Interactive JSON-to-graph visualization. Forwards a `JSONCrackRef` for imperative viewport control. */ export declare const JSONCrack: import("react").ForwardRefExoticComponent>; //# sourceMappingURL=JSONCrackComponent.d.ts.map