UNPKG

playwright-fluent

Version:
15 lines (14 loc) 1.62 kB
import { Frame, Page } from 'playwright'; export interface KeyboardPressOptions { /** * Time to wait between keydown and keyup in milliseconds. * Defaults to 50. * * @type {number} * @memberof KeyboardPressOptions */ delay: number; } export declare type KeyboardKey = '.' | ' ' | '-' | '[' | ']' | '{' | '}' | '*' | '+' | '=' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'A' | 'Add' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'b' | 'B' | 'Backquote' | 'Backslash' | 'Backspace' | 'c' | 'C' | 'd' | 'D' | 'Delete' | 'Digit0' | 'Digit1' | 'Digit2' | 'Digit3' | 'Digit4' | 'Digit5' | 'Digit6' | 'Digit7' | 'Digit8' | 'Digit9' | 'Divide' | 'e' | 'E' | 'Enter' | 'Equal' | 'Escape' | 'f' | 'F' | 'F1' | 'F10' | 'F11' | 'F12' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'g' | 'G' | 'h' | 'H' | 'Home' | 'i' | 'I' | 'Insert' | 'j' | 'J' | 'k' | 'K' | 'KeyA' | 'KeyB' | 'KeyC' | 'KeyD' | 'KeyE' | 'KeyF' | 'KeyG' | 'KeyH' | 'KeyI' | 'KeyJ' | 'KeyK' | 'KeyL' | 'KeyM' | 'KeyN' | 'KeyO' | 'KeyP' | 'KeyQ' | 'KeyR' | 'KeyS' | 'KeyT' | 'KeyU' | 'KeyV' | 'KeyW' | 'KeyX' | 'KeyY' | 'KeyZ' | 'l' | 'L' | 'm' | 'M' | 'Minus' | 'Multiply' | 'n' | 'N' | 'o' | 'O' | 'p' | 'P' | 'PageDown' | 'PageUp' | 'q' | 'Q' | 'r' | 'R' | 's' | 'S' | 'Subtract' | 't' | 'T' | 'Tab' | 'u' | 'U' | 'v' | 'V' | 'w' | 'W' | 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z'; export declare const defaultKeyboardPressOptions: KeyboardPressOptions; export declare function pressKey(key: KeyboardKey, page: Page | Frame | undefined, options: KeyboardPressOptions): Promise<void>;