import { Page } from 'playwright' ; export class Keyboard { constructor ( private page ) { } param key param options async down ( key ) { return this . page . keyboard . down ( key ) ; } /** Shortcut for `keyboard.down` and `keyboard.up`. */ async press ( key , options ? ) { return this . page . keyboard . press ( key , options ) ; } /** Dispatches a `keypress` and `input` event. This does not send a `keydown` or keyup `event`. */ async sendCharacter ( char ) { return this . page . keyboard . insertText ( char ) ; } param text param options async type ( text , options ? ) { return this . page . keyboard . type ( text , options ) ; } param key async up ( key ) { return this . page . keyboard . up ( key ) ; } }