/** * The two states that are about the pointer and the keyboard rather than about * what a click opens: a control under focus, and a control under the pointer. * * This is a deliberate narrowing of a rule the rubric was right to have. Focus * rings were never filed because nothing in a rest, overlay or in-page shot * holds focus on purpose, so a ring there is an accident of whatever was last * clicked, and a still image cannot show focus ORDER at all. Both stay true. * What changes is that lookout can now drive ONE named control into focus on * purpose and say on the manifest line which one, and that control's indicator * on that one shot is then evidence rather than an accident. * * Two facts about the browser shape the actuation: * * - Chromium paints a `:focus-visible` ring only in keyboard modality, so * `focus()` alone on a document that has been clicked shows nothing. The * recipe presses Tab first and then verifies the ring is actually on. A * control that will not show one is a skip, not a shot: photographing it * would file "no focus indicator" against the capture rather than the app. * - Screenshots never draw the cursor. A hover shot shows what hovering DID, * never where the pointer is, so nothing about it tells a judge which control * was hovered except the manifest line that names it. */ import type { Locator, Page } from "playwright"; /** The interaction a state was captured under, when it was captured under one. */ export type Interaction = "focus" | "hover"; /** At most one focus state per route, and one hover state. */ export declare const DEFAULT_MAX_FOCUS = 1; export declare const DEFAULT_MAX_HOVER = 1; /** The prefix a planned indicator state's name carries, so the axis reads as itself. */ export declare const PREFIX: Record; /** * The planner's name with its interaction spelled out, where that still fits. * The prefix is a convenience for whoever reads a shot id, never identity: the * record's `interaction` field is what anything downstream reads. */ export declare function prefixed(name: string, interaction: Interaction): string; /** * Hovering is not an interaction a phone has. * * Takes any outcome, not just an indicator one, so the capture walk can ask it * about every planned state without narrowing first. This is the one copy of * the rule: execute.ts applies it, and a test that pins it pins what capture * actually obeys. */ export declare function skipsAt(outcome: string, formFactor: string): boolean; /** * Put the keyboard on this control and prove the browser shows it. * * The Tab press is what puts Chromium in keyboard modality; the `focus()` that * follows is what lands on the control the plan actually named, since one Tab * from wherever the document starts lands somewhere arbitrary. */ export declare function focusControl(page: Page, target: Locator, name: string): Promise; /** Put the pointer on this control and let whatever it triggers settle. */ export declare function hoverControl(page: Page, target: Locator, name: string): Promise;