uzb-d3-map
Version:
A flexible, customizable SVG map component for Uzbekistan built with D3 and React
33 lines • 1.14 kB
TypeScript
import React from "react";
/**
* Measures the dimensions of a React element by rendering it in a hidden container
* Uses React 18+ createRoot API
* @param element - The React element to measure
* @returns Promise resolving to width and height of the element
*/
export declare function measureElementDimensions(element: React.ReactElement): Promise<{
width: number;
height: number;
}>;
/**
* Hook to measure React element dimensions dynamically
* @param element - The React element to measure
* @returns Object with width, height, and loading state
*/
export declare function useElementDimensions(element: React.ReactElement | null): {
dimensions: {
width: number;
height: number;
} | null;
isMeasuring: boolean;
};
/**
* Synchronously measures dimensions using a ref (for use in React components)
* @param ref - React ref to the DOM element
* @returns Width and height of the element, or null if not available
*/
export declare function measureRefDimensions(ref: React.RefObject<HTMLElement>): {
width: number;
height: number;
} | null;
//# sourceMappingURL=label-dimensions.d.ts.map