import { SyntheticEvent } from 'react'; /** * Is this element visible and not within a hidden sub-tree (e.g. hidden tab)? * Based on the underlying css 'display' property of all ancestor properties. */ export declare function isDisplayed(elem: HTMLElement): boolean; /** * Observe when a dom node's size changes. * * @param fn - function to be called with the co-ordinates of the node. * @param node - The DOM node to observe * @param opts - extra options, currently supporting a `debounce` specified in ms. * @returns ResizeObserver used to implement this function. Be sure to call disconnect() * on this when finished. * * Unlike the raw ResizeObserver implementation, this function will not run the * callback when the dimensions are both changed to 0 or is changed back from 0 * to a previous size. This is to improve performance by avoiding responding to * visibility changes. * * For a hook that conveniently wraps this function see {@link useOnResize}. */ export declare function observeResize(fn: (size: DOMRect) => any, node: Element, opts?: { debounce?: number; }): ResizeObserver; /** * Observe when a dom node's visibility changes. * * @param fn - function that takes a single argument with visibility. * @param node - The DOM node to observe * @returns ResizeObserver used to implement this function. Be sure to call disconnect() on this * when finished. * * For a hook that conveniently wraps this function see {@link useOnVisibleChange}. */ export declare function observeVisibleChange(fn: (visible: boolean) => any, node: Element): ResizeObserver; /** * Determines whether an element has an ancestor with a specific class name */ export declare function elemWithin(target: HTMLElement, className: string): boolean; /** * A convenience handler that will call 'stopPropagation' * and 'preventDefault' on an event. */ export declare function consumeEvent(e: Event | SyntheticEvent): void; /** * A convenience handler that will 'stopPropagation' on an event. */ export declare function stopPropagation(e: Event | SyntheticEvent): void;