/** * Represents the dimensions of an element * @interface Dimensions * @property {number} width - The width in pixels * @property {number} height - The height in pixels */ export interface Dimensions { width: number; height: number; } /** * Props for the useAspectRatioDimensions hook * @interface UseAspectRatioDimensionsProps * @property {number | 'auto'} width - The explicitly provided width, or 'auto' for container-based width * @property {number | 'auto'} height - The explicitly provided height, or 'auto' for aspect ratio-based height * @property {number} aspectRatio - The desired width-to-height ratio when dimensions are auto-calculated * @property {React.RefObject} containerRef - Reference to the container element */ export interface UseAspectRatioDimensionsProps { width: number | 'auto'; height: number | 'auto'; aspectRatio: number; containerRef: React.RefObject; } /** * A hook that calculates element dimensions based on provided values and container size * * This hook handles various combinations of width/height specifications: * - If both width and height are provided, uses those exact dimensions * - If only width is provided, calculates height using the aspect ratio * - If only height is provided, calculates width using the aspect ratio * - If both are 'auto', uses container width and calculates height using the aspect ratio * * @param {UseAspectRatioDimensionsProps} props - The input parameters for dimension calculation * @returns {Dimensions} The calculated width and height * * @example * ```tsx * const containerRef = useRef(null); * const {width, height} = useAspectRatioDimensions({ * width: 'auto', * height: 'auto', * aspectRatio: 16/9, * containerRef * }); * // Returns dimensions based on container size * ``` */ export declare function useAspectRatioDimensions({ width, height, aspectRatio, containerRef, }: UseAspectRatioDimensionsProps): Dimensions; //# sourceMappingURL=useAspectRatioDimensions.d.ts.map