@jupyterlab/apputils
Version:
JupyterLab - Application Utilities
28 lines (27 loc) • 1.08 kB
TypeScript
/**
* The namespace for DOM utilities.
*/
export declare namespace DOMUtils {
/**
* Get the index of the node at a client position, or `-1`.
*/
function hitTestNodes(nodes: HTMLElement[] | HTMLCollection, x: number, y: number): number;
/**
* Find the first element matching a class name.
* Only use this function when the element existence is guaranteed.
*/
function findElement(parent: HTMLElement, className: string): HTMLElement;
/**
* Find the first element matching a class name.
*/
function findElements(parent: HTMLElement, className: string): HTMLCollectionOf<HTMLElement>;
/**
* Create a DOM id with prefix "id-" to solve bug for UUIDs beginning with numbers.
*/
function createDomID(): string;
/**
* Check whether the active element descendant from given parent is editable.
* When checking active elements it includes elements in the open shadow DOM.
*/
function hasActiveEditableElement(parent: Node | DocumentFragment, root?: ShadowRoot | Document): boolean;
}