@blockquote/frontend-utilities
Version:
Utilities for managing the DOM, handling events, and performing various common tasks in frontend development.
14 lines (13 loc) • 447 B
TypeScript
/**
* Return the ancestors of the given node in the composed tree.
*
* In the composed tree, the ancestor of a node assigned to a slot is that slot,
* not the node's DOM ancestor. The ancestor of a shadow root is its host.
*
* @author Jan Miksovsky
* @see https://github.com/JanMiksovsky/elix/blob/main/src/core/dom.js
*
* @param {Node} node
* @returns {Iterable<Node>}
*/
export function composedAncestors(node: Node): Iterable<Node>;