/**
* Extended Selector Resolver
*
* Supports Playwright-style extended selectors that aren't native CSS:
* - :has-text("text") - matches elements containing text (case-insensitive partial match)
* - :text("text") - matches elements with exact text content
* - :text-is("text") - alias for :text()
*
* Text matching includes: textContent, aria-label, and title attributes.
*
* Examples:
* button:has-text("Submit") -> finds
* a:has-text("Login") -> finds Login
* a:has-text("Homepage") -> finds ...
* div:text("Exact Match") -> finds
Exact Match
(exact only)
* :has-text("Search") -> finds any element containing "Search"
*/
export interface ResolvedSelector {
/** The resolved CSS selector that can be used with querySelector */
selector: string;
/** Number of elements that matched */
matchCount: number;
/** Warning message if multiple matches found */
warning?: string;
}
export interface SelectorError {
error: string;
originalSelector: string;
suggestion?: string;
}
/**
* Check if a selector uses extended syntax
*/
export declare function isExtendedSelector(selector: string): boolean;
/**
* Resolve an extended selector to a standard CSS selector
*
* For extended selectors, this finds matching elements and returns a
* data-attribute based selector that uniquely identifies the first match.
*
* @param page - Puppeteer page instance
* @param selector - The selector (may include extended syntax like :has-text())
* @returns Resolved selector info or error
*/
export declare function resolveSelector(page: any, selector: string): Promise;
/**
* Clean up the temporary data attribute after use
* Should be called after the selector has been used
*/
export declare function cleanupResolvedSelector(page: any, selector: string): Promise;
//# sourceMappingURL=selector-resolver.d.ts.map