querying.d.ts 1.5 KB

123456789101112131415161718192021222324
  1. import type { InternalOptions, Predicate, Adapter } from "../types.js";
  2. /**
  3. * Find all elements matching the query. If not in XML mode, the query will ignore
  4. * the contents of `<template>` elements.
  5. *
  6. * @param query - Function that returns true if the element matches the query.
  7. * @param elems - Nodes to query. If a node is an element, its children will be queried.
  8. * @param options - Options for querying the document.
  9. * @returns All matching elements.
  10. */
  11. export declare function findAll<Node, ElementNode extends Node>(query: Predicate<ElementNode>, elems: Node[], options: InternalOptions<Node, ElementNode>): ElementNode[];
  12. /**
  13. * Find the first element matching the query. If not in XML mode, the query will ignore
  14. * the contents of `<template>` elements.
  15. *
  16. * @param query - Function that returns true if the element matches the query.
  17. * @param elems - Nodes to query. If a node is an element, its children will be queried.
  18. * @param options - Options for querying the document.
  19. * @returns The first matching element, or null if there was no match.
  20. */
  21. export declare function findOne<Node, ElementNode extends Node>(query: Predicate<ElementNode>, elems: Node[], options: InternalOptions<Node, ElementNode>): ElementNode | null;
  22. export declare function getNextSiblings<Node, ElementNode extends Node>(elem: Node, adapter: Adapter<Node, ElementNode>): ElementNode[];
  23. export declare function getElementParent<Node, ElementNode extends Node>(node: ElementNode, adapter: Adapter<Node, ElementNode>): ElementNode | null;
  24. //# sourceMappingURL=querying.d.ts.map