/** * Hook to run a function once after component has been mounted. */ export declare function useOnMount(fn: () => void): void; /** * Hook to run a function once after component has been unmounted. */ export declare function useOnUnmount(fn: () => void): void; /** * Hook to run a function when a DOM element is resized. * See {@link observeResize} for more details. * * @param fn - receives a DOMRect containing the dimensions of the DOM element. * @param opts - extra options, currently supporting a `debounce` specified in ms. * @returns callback ref to be placed on target component */ export declare function useOnResize(fn: (rect: DOMRect) => any, opts?: { debounce?: number; }): (node: any) => void; /** * Hook to run a function when a DOM element becomes visible / invisible. * * @see observeVisibleChange() for more details. * * @param fn - receives a boolean signifying if visible. * @returns callback ref to be placed on target component */ export declare function useOnVisibleChange(fn: (visible: boolean) => any): (node: any) => void; /** * Hook to run a function when a DOM element scrolls. * * @param fn - receives the scroll event. * @returns callback ref to be placed on target component */ export declare function useOnScroll(fn: (ev: Event) => any): (node: any) => void; /** * Hook to return a cached version of a value - similar useCallback() and useMemo(). * Useful for providing stable object references across renders. * * @param value - value (typically an object) to be cached and potentially returned to this and * subsequent calls. * @param equalsFn - A function taking the previously cached value and the currently presented * value. If evaluates to true, the cached value will be returned rather than the presented * value. If null, any cached value will always be returned. */ export declare function useCached(value: T, equalsFn: (prev: T, curr: T) => boolean): T;