import { default as React, ReactNode } from 'react'; import { PanelBounds, PanelSlotPosition } from '../types'; /** * Props for the PanelBoundsProvider component */ export interface PanelBoundsProviderProps { /** The slot position this provider is for */ slot: PanelSlotPosition; /** Child components that will have access to panel bounds */ children: ReactNode; } /** * Provider component that tracks and provides panel bounds to children * * This component wraps each panel slot's content in ConfigurablePanelLayout. * It uses ResizeObserver and scroll/resize listeners to keep bounds up to date. */ export declare const PanelBoundsProvider: React.FC; /** * Return type for usePanelBounds hook */ export interface UsePanelBoundsReturn { /** The current slot this panel is in (null if not in a panel) */ slot: PanelSlotPosition | null; /** The bounds of this panel relative to the viewport */ bounds: PanelBounds; /** Whether this hook is being used within a PanelBoundsProvider */ isInPanel: boolean; } /** * Hook to access the current panel's viewport-relative bounds * * @example * ```tsx * const MyCanvasPanel: React.FC = () => { * const { bounds, isInPanel } = usePanelBounds(); * * // Use bounds.x and bounds.y to offset a viewport-sized canvas * const canvasStyle = { * position: 'absolute' as const, * top: 0, * left: 0, * width: '100dvw', * height: '100dvh', * transform: `translate(${-bounds.x}px, ${-bounds.y}px)`, * }; * * return ; * }; * ``` */ export declare function usePanelBounds(): UsePanelBoundsReturn; /** * Hook to get just the panel offset (x, y) for convenience * * @example * ```tsx * const { offsetX, offsetY } = usePanelOffset(); * // Use to position a viewport-sized element at the viewport origin * const style = { transform: `translate(${-offsetX}px, ${-offsetY}px)` }; * ``` */ export declare function usePanelOffset(): { offsetX: number; offsetY: number; }; //# sourceMappingURL=usePanelBounds.d.ts.map