import type { MutableRefObject, Ref, RefCallback } from "react"; /** * Produces a unique ID that can be used for the HTML `id` attribute. Will use * the provided value if defined (typically obtained from the calling * component's `id` prop), otherwise one will be generated. The ID will remain * the same between renders (even if `idProp` changes). */ export declare function useId(idProp?: string): string; /** * Combines multiple refs into a single ref. * * Useful when a component needs a ref to one of its own elements, but also * supports forwarding a ref from its parent component. */ export declare function mergeRefs(...refs: (RefCallback | MutableRefObject | null)[]): Ref; /** * Returns the previous value of updated props or state. * * @param value The original value of the property. */ export declare function usePrevious(value: T | undefined): T | undefined; /** * A simple, unoptimized implementation of useResizeObserver. * * @param target The node to observe. * @param callback Called when a change is observed. */ export declare function useResizeObserver(target: T, callback: (entry: ResizeObserverEntry) => void): void; /** * Gets the dimensions of an element. * * @param target A ref to the target element. */ export declare function useContentRect(target: React.RefObject | React.MutableRefObject | T): DOMRectReadOnly; /** * Executes a function once when the component is first mounted. The function * will never run again unless the component is unmounted and subsequently * mounted again. * * @param f The function to execute. If the function is async, it's the caller's * responsibility to verify that the component is still mounted after awaiting * any promises (e.g. using `useIsMounted`). */ export declare function useMount(f: () => void | Promise): void; /** * Executes a function once when the component is dismounted. * * @param f The function to execute. */ export declare function useDismount(f: () => void): void;