import { IElementWrapper } from './interfaces'; import { KeyCode } from './utils'; declare global { interface KeyboardEventInit { char?: string; keyCode?: number; charCode?: number; } } export declare const usesDom: MethodDecorator; interface WrapperClass { new (element: ElementType): Wrapper; } interface ComponentWrapperClass extends WrapperClass { rootSelector: string; legacyRootSelector?: string; } export declare class AbstractWrapper implements IElementWrapper>> { protected element: ElementType; constructor(element: ElementType); getElement(): ElementType; /** * Performs a click by triggering a mouse event. * Note that programmatic events ignore disabled attribute and will trigger listeners even if the element is disabled. */ click(params?: MouseEventInit): void; keydown(keyCode: KeyCode): void; keydown(keyboardEventProps: KeyboardEventInit): void; keyup(keyCode: KeyCode): void; keyup(keyboardEventProps: KeyboardEventInit): void; keypress(keyCode: KeyCode): void; keypress(keyboardEventProps: KeyboardEventInit): void; fireEvent(event: Event): void; focus(): void; blur(): void; find(selector: string): ElementWrapper | null; matches(selector: string): this | null; findAll(selector: string): ElementWrapper[]; findAny(...selectors: Array): ElementWrapper | null; findByClassName(className: string): ElementWrapper | null; findAllByClassName(className: string): ElementWrapper[]; /** * Returns the component wrapper matching the specified selector. * If the specified selector doesn't match any element, it returns `null`. * * Note: This function returns the specified component's wrapper even if the specified selector points to a different component type. * * @param {string} selector CSS selector * @param {WrapperClass} ComponentClass Component's wrapper class * @returns `Wrapper | null` */ findComponent(selector: string, ComponentClass: WrapperClass): Wrapper | null; /** * Returns the wrappers of all components that match the specified component type and the specified CSS selector. * If no CSS selector is specified, returns all of the components that match the specified component type. * If no matching component is found, returns an empty array. * * @param {ComponentWrapperClass} ComponentClass Component's wrapper class * @param {string} [selector] CSS selector * @returns `Array` */ findAllComponents(ComponentClass: ComponentWrapperClass, selector?: string): Array; /** * Returns the closest ancestor element (or self) that matches the specified component type. * If no matching component is found, returns `null`. * * @param {ComponentWrapperClass} ComponentClass Component's wrapper class * @returns `Wrapper | null` */ findClosestComponent(ComponentClass: ComponentWrapperClass): Wrapper | null; } export declare class ElementWrapper extends AbstractWrapper { } export declare class ComponentWrapper extends AbstractWrapper { } export declare function createWrapper(root?: Element): ElementWrapper; export {};