@coreui/react-pro
Version:
UI Components Library for React.js
37 lines (36 loc) • 1.63 kB
TypeScript
import React from 'react';
/**
* Gets all focusable child elements within a container.
* Uses a comprehensive selector to find elements that can receive focus.
* @param element - The container element to search within
* @returns Array of focusable HTML elements
*/
export declare const focusableChildren: (element: HTMLElement) => HTMLElement[];
/**
* Checks if an element is disabled.
* Considers various ways an element can be disabled including CSS classes and attributes.
* @param element - The HTML element to check
* @returns True if the element is disabled, false otherwise
*/
export declare const isDisabled: (element: HTMLElement) => boolean;
/**
* Type guard to check if an object is an Element.
* Handles edge cases including jQuery objects.
* @param object - The object to check
* @returns True if the object is an Element, false otherwise
*/
export declare const isElement: (object: unknown) => object is Element;
/**
* Checks if an element is visible in the DOM.
* Considers client rects and computed visibility styles, handling edge cases like details elements.
* @param element - The HTML element to check for visibility
* @returns True if the element is visible, false otherwise
*/
export declare const isVisible: (element: HTMLElement) => boolean;
/**
* Merges multiple React refs into a single ref callback.
* Handles both function refs and ref objects, gracefully ignoring failures.
* @param refs - Array of React refs to merge
* @returns A ref callback that applies to all provided refs
*/
export declare const mergeRefs: <T>(...refs: (React.Ref<T> | undefined)[]) => (node: T) => void;