/** * The key a `press` sends when neither `text` nor `key` was named. * * Enter is the historical default. It is also the one key that must NEVER be treated as a * document key without a locator: on a focused field inside a form it submits it. */ export declare const DEFAULT_PRESS_KEY = "Enter"; /** * Keys a real user sends at the page, not at a control. Escape dismisses, Tab moves focus. * A press of one of these with no ref is valid; a press of Enter or a letter is not. */ export declare const GLOBAL_PRESS_KEYS: readonly ["Escape", "Tab"]; /** * Which key a `press` is asking for. * * `text` FIRST, because that is what the tool description documents ("{ text } for type/press") * and therefore what agents send. `key` still works — it is what anyone reading the source would * have sent — and the default only applies when neither was named. */ export declare function pressKeyFromArgs(args: Record): string; /** * The keys a `press` holds down TOGETHER, from `args.keys`. Empty for the ordinary one-key press. * * `modifiers` cannot express this: they are FLAGS on one event, so "Control held while k and then j * are struck" has no spelling there. Only the in-page dispatcher implements the sequence — it * presses these in order and releases them in reverse — so the server reads them through here to * route such a press to that path rather than sending a chord it cannot spell. */ export declare function pressKeysFromArgs(args: Record): string[]; /** * An explicit `code` the caller named, if any. The browser derives one from the key when this is * absent (`pressCode`); an explicit one always wins there, because a caller driving a non-US layout * knows something that derivation cannot. */ export declare function explicitCodeFromArgs(args: Record): string | undefined; /** Canonical modifier names, in chord order — the spelling Playwright accepts. */ export declare const PRESS_MODIFIERS: readonly ["Alt", "Control", "Meta", "Shift"]; export type PressModifier = (typeof PRESS_MODIFIERS)[number]; /** * Canonical, deduped modifiers in `PRESS_MODIFIERS` order; unknown names are dropped, since one the * driver cannot spell would change the whole chord. Server-side only — see `hasModifiers`. */ export declare function pressModifiersFromArgs(args: Record): PressModifier[]; /** * A press that is a document key, not an element action: Escape, Tab, any key with modifiers * (Cmd+K), or several keys held together. Requiring a ref for these forced a snapshot just to name * an element the keystroke is not about. * * `keys` counts even though `hasModifiers` cannot see it: a multi-key press is a sequence held at * the page, never aimed at one control, and without this the documented `keys` spelling would be * refused with "pass a ref" before anything could route it. * * A ONE-element `keys` is judged by the same rule as the one-key spelling rather than by its length: * it names the same key, so it owes the same answer. Counting the list instead let `{ keys: ["Enter"] }` * pass where `{ key: "Enter" }` is refused. */ export declare function isGlobalPress(args: Record): boolean; /** * The tool/step shape `{ action, args }` — a press of a document key, so no locator is required. */ export declare function isGlobalPressCall(args: Record): boolean;