UNPKG

713 BTypeScriptView Raw
1/**
2 * The namespace for DOM utilities.
3 */
4export declare namespace DOMUtils {
5 /**
6 * Get the index of the node at a client position, or `-1`.
7 */
8 function hitTestNodes(nodes: HTMLElement[] | HTMLCollection, x: number, y: number): number;
9 /**
10 * Find the first element matching a class name.
11 */
12 function findElement(parent: HTMLElement, className: string): HTMLElement;
13 /**
14 * Find the first element matching a class name.
15 */
16 function findElements(parent: HTMLElement, className: string): HTMLCollectionOf<HTMLElement>;
17 /**
18 * Create a DOM id with prefix "id-" to solve bug for UUIDs beginning with numbers.
19 */
20 function createDomID(): string;
21}