import { TSESTree } from '@typescript-eslint/utils'; /** * Playwright locator-producing methods. */ export declare const LOCATOR_METHODS: ReadonlySet; /** * Playwright interaction methods. Called directly on `page` they take a * selector as first argument (`page.click(sel)`); called on a locator they * act on the already-selected element (`page.locator(sel).click()`). */ export declare const INTERACTION_METHODS: ReadonlySet; export interface SelectorPart { /** * The method that received the argument: a locator method for chains, or * the interaction method itself for direct calls (`page.click(sel)`). */ method: string; /** The selector or text argument. */ argNode: TSESTree.Expression; } export interface SelectorInteractionMatch { /** The outer CallExpression performing the interaction (report anchor). */ callNode: TSESTree.CallExpression; /** * The selector arguments, root-to-tip: one for a direct call, one per * locator call in a chain (`page.locator(a).getByText(b).click()` → [a, b]). */ selectorParts: SelectorPart[]; /** true for `page.locator(sel).click()`, false for `page.click(sel)`. */ viaLocatorChain: boolean; /** Name of the interaction method, e.g. 'click', 'dblclick', 'fill'. */ interactionMethod: string; /** true when the call passes `{ button: 'right' }` (context menu open). */ isRightClick: boolean; } /** * True when an interaction call passes `{ button: 'right' }` option. */ export declare function isRightClick(node: TSESTree.CallExpression): boolean; /** * Matches raw Playwright selector interactions on the Galata `page` fixture: * * - `page.(selector, ...)` e.g. `page.dblclick('text=a.ipynb')` * - `page.(selector)[...].(...)` e.g. * `page.locator('.jp-DirListing-item').click()` or chained locators like * `page.locator('#filebrowser').getByText('notebooks').dblclick()` * * Returns null for any other shape */ export declare function matchSelectorInteraction(node: TSESTree.CallExpression): SelectorInteractionMatch | null; /** * Extracts a best-effort static string from a selector argument so it can be * matched against known patterns. String literals return their value; * template literals return their static parts joined by a space, so * `` `.jp-DirListing-item span:has-text("${name}")` `` still exposes its * static prefix. Fully dynamic expressions return null. */ export declare function extractStaticSelectorText(node: TSESTree.Expression): string | null; /** * Joins the statically extractable selector parts of a match into a single * pattern-matchable string. Arguments of text-matching locators (`getByText`, * `getByTitle`, …) are normalized to the `text=` selector form, so patterns * written against `text=` selectors also match the locator-method shape. * Returns null when no part is static. */ export declare function combineStaticSelectorText(match: SelectorInteractionMatch): string | null;