import * as i0 from '@angular/core'; import { NgZone, EventEmitter } from '@angular/core'; import { ModifierKeys } from '@angular/cdk/testing'; import { ComponentFixture } from '@angular/core/testing'; declare class FakeMediaQueryList { matches: boolean; media: string; /** The callback for change events. */ private _listeners; constructor(matches: boolean, media: string); /** Toggles the matches state and "emits" a change event. */ setMatches(matches: boolean): void; /** Registers a callback method for change events. */ addListener(callback: (mql: MediaQueryListEvent) => void): void; /** Removes a callback method from the change events. */ removeListener(callback: (mql: MediaQueryListEvent) => void): void; } declare class FakeMediaMatcher { defaultMatches: boolean; /** A map of match media queries. */ private _queries; /** The number of distinct queries created in the media matcher during a test. */ get queryCount(): number; /** Fakes the match media response to be controlled in tests. */ matchMedia(query: string): FakeMediaQueryList; /** Clears all queries from the map of queries. */ clear(): void; /** Toggles the matching state of the provided query. */ setMatchesQuery(query: string, matches: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Utility to dispatch any event on a Node. * @docs-private */ declare function dispatchEvent(node: Node | Window, event: T): T; /** * Shorthand to dispatch a fake event on a specified node. * @docs-private */ declare function dispatchFakeEvent(node: Node | Window, type: string, bubbles?: boolean): Event; /** * Shorthand to dispatch a keyboard event with a specified key code and * optional modifiers. * @docs-private */ declare function dispatchKeyboardEvent(node: Node, type: string, keyCode?: number, key?: string, modifiers?: ModifierKeys): KeyboardEvent; /** * Shorthand to dispatch a mouse event on the specified coordinates. * @docs-private */ declare function dispatchMouseEvent(node: Node, type: string, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number, button?: number, modifiers?: ModifierKeys): MouseEvent; /** * Shorthand to dispatch a pointer event on the specified coordinates. * @docs-private */ declare function dispatchPointerEvent(node: Node, type: string, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number, options?: PointerEventInit): PointerEvent; /** * Shorthand to dispatch a touch event on the specified coordinates. * @docs-private */ declare function dispatchTouchEvent(node: Node, type: string, pageX?: number, pageY?: number, clientX?: number, clientY?: number): UIEvent; /** * Patches an elements focus and blur methods to emit events consistently and predictably. * This is necessary, because some browsers can call the focus handlers asynchronously, * while others won't fire them at all if the browser window is not focused. * @docs-private */ declare function patchElementFocus(element: HTMLElement): void; /** @docs-private */ declare function triggerFocus(element: HTMLElement): void; /** @docs-private */ declare function triggerBlur(element: HTMLElement): void; /** * Creates a browser MouseEvent with the specified options. * @docs-private */ declare function createMouseEvent(type: string, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number, button?: number, modifiers?: ModifierKeys): MouseEvent; /** * Creates a browser `PointerEvent` with the specified options. Pointer events * by default will appear as if they are the primary pointer of their type. * https://www.w3.org/TR/pointerevents2/#dom-pointerevent-isprimary. * * For example, if pointer events for a multi-touch interaction are created, the non-primary * pointer touches would need to be represented by non-primary pointer events. * * @docs-private */ declare function createPointerEvent(type: string, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number, options?: PointerEventInit): PointerEvent; /** * Creates a browser TouchEvent with the specified pointer coordinates. * @docs-private */ declare function createTouchEvent(type: string, pageX?: number, pageY?: number, clientX?: number, clientY?: number): UIEvent; /** * Creates a keyboard event with the specified key and modifiers. * @docs-private */ declare function createKeyboardEvent(type: string, keyCode?: number, key?: string, modifiers?: ModifierKeys): KeyboardEvent; /** * Creates a fake event object with any desired event type. * @docs-private */ declare function createFakeEvent(type: string, bubbles?: boolean, cancelable?: boolean, composed?: boolean): Event; /** * Mock synchronous NgZone implementation that can be used * to flush out `onStable` subscriptions in tests. */ declare class MockNgZone extends NgZone { onStable: EventEmitter; constructor(); run(fn: Function): any; runOutsideAngular(fn: Function): any; simulateZoneExit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * When constructing a Date, the month is zero-based. This can be confusing, since people are * used to seeing them one-based. So we create these aliases to make writing the tests easier. * @docs-private */ declare const JAN = 0; declare const FEB = 1; declare const MAR = 2; declare const APR = 3; declare const MAY = 4; declare const JUN = 5; declare const JUL = 6; declare const AUG = 7; declare const SEP = 8; declare const OCT = 9; declare const NOV = 10; declare const DEC = 11; /** * Checks whether the given Element is a text input element. * @docs-private */ declare function isTextInput(element: Element): element is HTMLInputElement | HTMLTextAreaElement; /** * If keys have been specified, focuses an input, sets its value and dispatches * the `input` event, simulating the user typing. * @param element Element onto which to set the value. * @param keys The keys to send to the element. * @docs-private */ declare function typeInElement(element: HTMLElement, ...keys: (string | { keyCode?: number; key?: string; })[]): void; /** * If keys have been specified, focuses an input, sets its value and dispatches * the `input` event, simulating the user typing. * @param element Element onto which to set the value. * @param modifiers Modifier keys that are held while typing. * @param keys The keys to send to the element. * @docs-private */ declare function typeInElement(element: HTMLElement, modifiers: ModifierKeys, ...keys: (string | { keyCode?: number; key?: string; })[]): void; /** * Clears the text in an input or textarea element. * @docs-private */ declare function clearElement(element: HTMLInputElement | HTMLTextAreaElement): void; declare function switchToLean(fixture?: ComponentFixture): void; /** * Gets a RegExp used to detect an angular wrapped error message. * See https://github.com/angular/angular/issues/8348 */ declare function wrappedErrorMessage(e: Error): RegExp; export { APR, AUG, DEC, FEB, FakeMediaMatcher, FakeMediaQueryList, JAN, JUL, JUN, MAR, MAY, MockNgZone, NOV, OCT, SEP, clearElement, createFakeEvent, createKeyboardEvent, createMouseEvent, createPointerEvent, createTouchEvent, dispatchEvent, dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent, dispatchPointerEvent, dispatchTouchEvent, isTextInput, patchElementFocus, switchToLean, triggerBlur, triggerFocus, typeInElement, wrappedErrorMessage };