/** * Keyboard key codes. */ export declare enum KeyCode { Backspace = "Backspace", Tab = "Tab", Enter = "Enter", ShiftRight = "ShiftRight", ShiftLeft = "ShiftLeft", ControlRight = "ControlRight", ControlLeft = "ControlLeft", Escape = "Escape", AltLeft = "AltLeft", AltRight = "AltRight", MetaLeft = "MetaLeft", MetaRight = "MetaRight", Space = "Space", ArrowUp = "ArrowUp", ArrowDown = "ArrowDown", ArrowLeft = "ArrowLeft", ArrowRight = "ArrowRight", PageUp = "PageUp", PageDown = "PageDown", End = "End", Home = "Home", Delete = "Delete", Insert = "Insert", CapsLock = "CapsLock", ScrollLock = "ScrollLock", F1 = "F1", F2 = "F2", F3 = "F3", F4 = "F4", F5 = "F5", F6 = "F6", F7 = "F7", F8 = "F8", F9 = "F9", F10 = "F10", F11 = "F11", F12 = "F12", Digit0 = "Digit0", Digit1 = "Digit1", Digit2 = "Digit2", Digit3 = "Digit3", Digit4 = "Digit4", Digit5 = "Digit5", Digit6 = "Digit6", Digit7 = "Digit7", Digit8 = "Digit8", Digit9 = "Digit9", Numpad0 = "Numpad0", Numpad1 = "Numpad1", Numpad2 = "Numpad2", Numpad3 = "Numpad3", Numpad4 = "Numpad4", Numpad5 = "Numpad5", Numpad6 = "Numpad6", Numpad7 = "Numpad7", Numpad8 = "Numpad8", Numpad9 = "Numpad9", NumpadAdd = "NumpadAdd", NumpadDecimal = "NumpadDecimal", NumpadDivide = "NumpadDivide", NumpadEnter = "NumpadEnter", NumpadMultiply = "NumpadMultiply", NumpadSubtract = "NumpadSubtract", NumLock = "NumLock", KeyA = "KeyA", KeyB = "KeyB", KeyC = "KeyC", KeyD = "KeyD", KeyE = "KeyE", KeyF = "KeyF", KeyG = "KeyG", KeyH = "KeyH", KeyI = "KeyI", KeyJ = "KeyJ", KeyK = "KeyK", KeyL = "KeyL", KeyM = "KeyM", KeyN = "KeyN", KeyO = "KeyO", KeyP = "KeyP", KeyQ = "KeyQ", KeyR = "KeyR", KeyS = "KeyS", KeyT = "KeyT", KeyU = "KeyU", KeyV = "KeyV", KeyW = "KeyW", KeyX = "KeyX", KeyY = "KeyY", KeyZ = "KeyZ", Backquote = "Backquote", Minus = "Minus", Equal = "Equal", Backslash = "Backslash", Semicolon = "Semicolon", Quote = "Quote", Comma = "Comma", Period = "Period", Slash = "Slash", BracketLeft = "BracketLeft", BracketRight = "BracketRight" } /** * Result pair for a key press action containing keydown and keyup events. */ export interface KeyPressResult { /** Dispatched keydown KeyboardEvent */ keydown: KeyboardEvent; /** Dispatched keyup KeyboardEvent */ keyup: KeyboardEvent; } /** * Result of a mouse click action containing mousedown, mouseup, and click events. */ export interface MouseClickResult { /** Dispatched mousedown event */ mousedown: MouseEvent; /** Dispatched mouseup event */ mouseup: MouseEvent; /** Dispatched click event */ click: MouseEvent; } /** * Result of a mouse double-click action containing dispatched mouse events. */ export interface MouseDblClickResult { /** Dispatched first mousedown event */ mousedown1: MouseEvent; /** Dispatched first mouseup event */ mouseup1: MouseEvent; /** Dispatched first click event */ click1: MouseEvent; /** Dispatched second mousedown event */ mousedown2: MouseEvent; /** Dispatched second mouseup event */ mouseup2: MouseEvent; /** Dispatched second click event */ click2: MouseEvent; /** Dispatched dblclick event */ dblclick: MouseEvent; } /** * Result of a mouse hover action containing mouseover and mouseenter events. */ export interface MouseHoverResult { /** Dispatched mouseover event */ mouseover: MouseEvent; /** Dispatched mouseenter event */ mouseenter: MouseEvent; } /** * Result of a mouse leave action containing mouseout and mouseleave events. */ export interface MouseLeaveResult { /** Dispatched mouseout event */ mouseout: MouseEvent; /** Dispatched mouseleave event */ mouseleave: MouseEvent; } /** * Result of an input fill or check action containing input and change events. */ export interface FormFieldActionResult { /** Dispatched input event */ inputEvent: Event; /** Dispatched change event */ changeEvent: Event; } /** * Result of a focus action containing dispatched focus and focusin events. */ export interface FocusActionResult { /** Dispatched focus event */ focus: FocusEvent; /** Dispatched focusin event */ focusin: FocusEvent; } /** * Result of a blur action containing dispatched blur and focusout events. */ export interface BlurActionResult { /** Dispatched blur event */ blur: FocusEvent; /** Dispatched focusout event */ focusout: FocusEvent; } /** * Options for synthetic keyboard press operations. */ export interface EventsKeyboardPressOptions extends EventModifierInit { /** * Time to wait between keydown and keyup in milliseconds. Defaults to 0. */ delay?: number; } /** * Options for synthetic keyboard typing operations. */ export interface EventsKeyboardTypeOptions extends EventModifierInit { /** * Time to wait between key presses in milliseconds. Defaults to 0. */ delay?: number; } /** * Synchronous synthetic keyboard event dispatcher for DOM testing. * * @use when * - Fast, synthetic keyboard event dispatching is needed directly on a DOM target. * - Simulating key presses, typing, and modifier shortcuts in isolated component tests. * * @dont use when * - Testing OS-level input driver behavior or Playwright actionability checks. */ export declare class KeyboardEvents { private readonly target; /** * The default modifier keys and dispatch settings for keyboard events. */ readonly defaultModifierInit: EventModifierInit; /** * Creates a new instance of the KeyboardEvents class. * * @param target - The target DOM node for dispatching keyboard events. */ constructor(target: EventTarget); /** * Private helper to parse key shortcuts, resolve key mapping, and dispatch a KeyboardEvent. * * @param eventType - Event type string ('keydown' or 'keyup'). * @param code - The KeyCode, key string, or modifier shortcut. * @param init - Optional EventModifierInit overrides. * @returns Dispatched KeyboardEvent. */ private dispatch; /** * Dispatches a synthetic keyboard event `keydown` on the target. * Supports modifier shortcut syntax (e.g. `'Control+A'`, `'ControlOrMeta+Shift+Z'`). * * @param code - The `KeyCode`, key string, or modifier shortcut (e.g. `KeyCode.KeyA`, `'a'`, `'Control+A'`). * @param init - Optional `EventModifierInit` overrides. * @returns The dispatched keydown `KeyboardEvent`. */ down(code: KeyCode | string, init?: EventModifierInit): KeyboardEvent; /** * Dispatches a synthetic keyboard event `keyup` on the target. * Supports modifier shortcut syntax (e.g. `'Control+A'`, `'ControlOrMeta+Shift+Z'`). * * @param code - The `KeyCode`, key string, or modifier shortcut (e.g. `KeyCode.KeyA`, `'a'`, `'Control+A'`). * @param init - Optional `EventModifierInit` overrides. * @returns The dispatched keyup `KeyboardEvent`. */ up(code: KeyCode | string, init?: EventModifierInit): KeyboardEvent; /** * Dispatches `keydown` followed by `keyup` on the target. * Supports modifier shortcut syntax (e.g. `'Control+A'`, `'ControlOrMeta+Shift+Z'`). * * @param code - The `KeyCode`, key string, or modifier shortcut. * @param options - Optional `EventsKeyboardPressOptions` settings. * @returns A promise that resolves to an object containing the dispatched `{ keydown, keyup }` events. */ press(code: KeyCode | string, options?: EventsKeyboardPressOptions): Promise; /** * Sequentially dispatches `keydown` and `keyup` events for each character in text. * * @param text - The string of characters to type. * @param options - Optional `EventsKeyboardTypeOptions` settings. * @returns A promise that resolves to an array of dispatched `{ keydown, keyup }` event pairs. */ type(text: string, options?: EventsKeyboardTypeOptions): Promise; } /** * Synchronous synthetic mouse event dispatcher for DOM testing. * * @use when * - Fast, synthetic mouse interactions (click, dblclick, hover, contextMenu) are needed directly on DOM targets. * - Testing event listeners in web component or element unit tests. * * @dont use when * - Testing native browser pointer positioning or Playwright actionability checks. */ export declare class MouseEvents { private readonly target; /** * Default settings for synthetic mouse events. */ readonly defaultInit: MouseEventInit; /** * Creates a new instance of the MouseEvents class. * * @param target - The target DOM node for dispatching mouse events. */ constructor(target: EventTarget); /** * Private helper to merge defaults and dispatch a MouseEvent. * * @param type - Event type string (e.g. 'click', 'mousedown'). * @param options - Optional MouseEventInit overrides. * @returns Dispatched MouseEvent. */ private dispatch; /** * Dispatches a synthetic `mousedown` event on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Dispatched `MouseEvent`. */ down(options?: MouseEventInit): MouseEvent; /** * Dispatches a synthetic `mouseup` event on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Dispatched `MouseEvent`. */ up(options?: MouseEventInit): MouseEvent; /** * Dispatches a synthetic `mousemove` event on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Dispatched `MouseEvent`. */ move(options?: MouseEventInit): MouseEvent; /** * Dispatches `mousedown`, `mouseup`, and `click` events in sequence on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Object containing the dispatched `{ mousedown, mouseup, click }` events. */ click(options?: MouseEventInit): MouseClickResult; /** * Dispatches a double-click sequence (`mousedown` -> `mouseup` -> `click` x2 -> `dblclick`) on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Object containing all dispatched mouse events in the sequence. */ dblclick(options?: MouseEventInit): MouseDblClickResult; /** * Dispatches a right-click `contextmenu` event on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Dispatched `MouseEvent`. */ contextMenu(options?: MouseEventInit): MouseEvent; /** * Dispatches `mouseover` and `mouseenter` events on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Object containing dispatched `{ mouseover, mouseenter }` events. */ hover(options?: MouseEventInit): MouseHoverResult; /** * Dispatches `mouseout` and `mouseleave` events on the target. * * @param options - Optional `MouseEventInit` overrides. * @returns Object containing dispatched `{ mouseout, mouseleave }` events. */ leave(options?: MouseEventInit): MouseLeaveResult; } /** * Synchronous synthetic input and form control event dispatcher for DOM testing. * * @use when * - Fast, synthetic form control interactions (fill, check, uncheck, select) are needed directly on DOM targets. * - Triggering `input` and `change` event handlers in framework tests (React, Vue, Lit, Web Components). * * @dont use when * - Testing native browser auto-actionability checks or Playwright form fill commands. */ export declare class InputEvents { private readonly target; /** * Creates a new instance of the InputEvents class. * * @param target - The target DOM node for dispatching input events. */ constructor(target: EventTarget); /** * Dispatches a synthetic `input` event on the target. * * @param options - Optional `EventInit` overrides. * @returns Dispatched input `Event`. */ emitInput(options?: EventInit): Event; /** * Dispatches a synthetic `change` event on the target. * * @param options - Optional `EventInit` overrides. * @returns Dispatched change `Event`. */ emitChange(options?: EventInit): Event; /** * Sets the value of an input or textarea element and dispatches `input` and `change` events. * * @param value - The text value to set. * @param options - Optional `EventInit` overrides for the dispatched events. * @returns Object containing the dispatched `{ inputEvent, changeEvent }`. */ fill(value: string, options?: EventInit): FormFieldActionResult; /** * Sets `checked = true` on a checkbox or radio element and dispatches `input` and `change` events. * * @param options - Optional `EventInit` overrides. * @returns Object containing the dispatched `{ inputEvent, changeEvent }`. */ check(options?: EventInit): FormFieldActionResult; /** * Sets `checked = false` on a checkbox element and dispatches `input` and `change` events. * * @param options - Optional `EventInit` overrides. * @returns Object containing the dispatched `{ inputEvent, changeEvent }`. */ uncheck(options?: EventInit): FormFieldActionResult; /** * Toggles the `checked` property on a checkbox element and dispatches `input` and `change` events. * * @param options - Optional `EventInit` overrides. * @returns Object containing the dispatched `{ inputEvent, changeEvent }`. */ toggle(options?: EventInit): FormFieldActionResult; /** * Sets the value of a `