@augment-vir/web
Version:
A collection of augments, helpers types, functions, and classes only for web (frontend) JavaScript environments.
23 lines (22 loc) • 844 B
TypeScript
/**
* The callback triggered for each depth traversal in {@link walkActiveElement}. If this returns
* `true`, the walking stops.
*
* @category Web : Elements
* @category Package : @augment-vir/web
* @package [`@augment-vir/web`](https://www.npmjs.com/package/@augment-vir/web)
*/
export type WalkActiveElementCallback = (params: {
element: Element;
depth: number;
}) => boolean | void | undefined;
/**
* Get the currently active element and walks the shadow dom to find, if any, the truly active
* element nested within the shadow dom.
*
* @category Web : Elements
* @category Package : @augment-vir/web
* @returns The depth that walking stopped at.
* @package [`@augment-vir/web`](https://www.npmjs.com/package/@augment-vir/web)
*/
export declare function walkActiveElement(callback: WalkActiveElementCallback): number;