@studiometa/js-toolkit
Version:
A set of useful little bits of JavaScript to boost your project! 🚀
9 lines (8 loc) • 431 B
TypeScript
/**
* Get an ancestor matching the given condition.
*/
export declare function getAncestorWhere(element: HTMLElement, condition: (el: HTMLElement) => boolean): any;
/**
* Get an ancestor matching the given condition, stop when the until function is truthy.
*/
export declare function getAncestorWhereUntil(element: HTMLElement, condition: (el: HTMLElement) => boolean, until: (el: HTMLElement) => boolean): HTMLElement | null;