cache.d.ts 764 B

123456789101112
  1. import type { CompiledQuery, InternalOptions } from "../types.js";
  2. /**
  3. * Some selectors such as `:contains` and (non-relative) `:has` will only be
  4. * able to match elements if their parents match the selector (as they contain
  5. * a subset of the elements that the parent contains).
  6. *
  7. * This function wraps the given `matches` function in a function that caches
  8. * the results of the parent elements, so that the `matches` function only
  9. * needs to be called once for each subtree.
  10. */
  11. export declare function cacheParentResults<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, { adapter, cacheResults }: InternalOptions<Node, ElementNode>, matches: (elem: ElementNode) => boolean): CompiledQuery<ElementNode>;
  12. //# sourceMappingURL=cache.d.ts.map