Archived
Template
1
Fork 0
This repository has been archived on 2024-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
Contour/public/@shoelace-style/shoelace/cdn/internal/active-elements.d.ts
2024-01-30 10:59:28 -05:00

15 lines
649 B
TypeScript

/**
* Use a generator so we can iterate and possibly break early.
* @example
* // to operate like a regular array. This kinda nullifies generator benefits, but worth knowing if you need the whole array.
* const allActiveElements = [...activeElements()]
*
* // Early return
* for (const activeElement of activeElements()) {
* if (<cond>) {
* break; // Break the loop, dont need to iterate over the whole array or store an array in memory!
* }
* }
*/
export declare function activeElements(activeElement?: Element | null): Generator<Element>;
export declare function getDeepestActiveElement(): Element | undefined;