import GuacamoleKeyboard from './guacamole-keyboard.js'12export interface GuacamoleKeyboardInterface {3/**4* Fired whenever the user presses a key with the element associated5* with this Guacamole.Keyboard in focus.6*7* @event8* @param {Number} keysym The keysym of the key being pressed.9* @return {Boolean} true if the key event should be allowed through to the10* browser, false otherwise.11*/12onkeydown?: (keysym: number) => boolean1314/**15* Fired whenever the user releases a key with the element associated16* with this Guacamole.Keyboard in focus.17*18* @event19* @param {Number} keysym The keysym of the key being released.20*/21onkeyup?: (keysym: number) => void2223/**24* Marks a key as pressed, firing the keydown event if registered. Key25* repeat for the pressed key will start after a delay if that key is26* not a modifier. The return value of this function depends on the27* return value of the keydown event handler, if any.28*29* @param {Number} keysym The keysym of the key to press.30* @return {Boolean} true if event should NOT be canceled, false otherwise.31*/32press: (keysym: number) => boolean3334/**35* Marks a key as released, firing the keyup event if registered.36*37* @param {Number} keysym The keysym of the key to release.38*/39release: (keysym: number) => void4041/**42* Presses and releases the keys necessary to type the given string of43* text.44*45* @param {String} str46* The string to type.47*/48type: (str: string) => void4950/**51* Resets the state of this keyboard, releasing all keys, and firing keyup52* events for each released key.53*/54reset: () => void5556/**57* Attaches event listeners to the given Element, automatically translating58* received key, input, and composition events into simple keydown/keyup59* events signalled through this Guacamole.Keyboard's onkeydown and60* onkeyup handlers.61*62* @param {Element|Document} element63* The Element to attach event listeners to for the sake of handling64* key or input events.65*/66listenTo: (element: Element | Document) => void67}6869export default function (element?: Element): GuacamoleKeyboardInterface {70const Keyboard = {}7172GuacamoleKeyboard.bind(Keyboard, element)()7374return Keyboard as GuacamoleKeyboardInterface75}767778