/** * query-selector-shadow-dom-modern * * Drop-in replacement for https://www.npmjs.com/package/query-selector-shadow-dom * with the same public API: * * - querySelectorDeep(selector, root?, allElements?) * - querySelectorAllDeep(selector, root?, allElements?) * - collectAllElementsDeep(selector?, root?, cachedElements?) * * but faster and safer: * - Native `querySelector(All)` does the heavy lifting whenever possible * (whole-selector fast path when no shadow roots are involved, and a * per-root pre-filter on the right-most compound selector otherwise). * - Selector parsing is memoized (strings are immutable — safe to cache). * - No DOM caching: results are always computed from the live tree, so * dynamic pages never see stale data. * - Full combinator support across shadow boundaries: ` `, `>`, `+`, `~`. * - Cross-realm safe (iframe documents): no `instanceof` on DOM classes. * * One upstream bug is fixed: the original re-tests a `>` group at every * ancestor, which silently turns the child combinator into a descendant * combinator. Here `a > b` means "a is b's composed parent", exactly like a * native `querySelector` — just extended across shadow boundaries. */ export type QueryableNode = Document | DocumentFragment | Element; /** * Finds the first matching element on the page, piercing any number of nested * shadow roots. Same signature and semantics as the original library. */ export declare function querySelectorDeep(selector: string, root?: QueryableNode, allElements?: Element[] | null): T | null; /** * Finds all matching elements on the page, piercing any number of nested * shadow roots. Same signature and semantics as the original library * (results are additionally de-duplicated). */ export declare function querySelectorAllDeep(selector: string, root?: QueryableNode, allElements?: Element[] | null): T[]; /** * Finds all elements on the page, inclusive of those within shadow roots. * Optionally filtered by a CSS selector. * Same signature and semantics as the original library. */ export declare function collectAllElementsDeep(selector?: string | null, root?: QueryableNode, cachedElements?: Element[] | null): T[]; /** * Split a selector list on top-level commas (ignores commas inside quotes, * attribute brackets and pseudo-class parentheses). */ export declare function splitByComma(selector: string): string[]; /** * Tokenize a CSS selector into compounds and combinators: * 'div > p span' → ['div', '>', 'p', ' ', 'span']. */ export declare function tokenizePath(selector: string): string[]; //# sourceMappingURL=index.d.ts.map