import { ModifierKeys } from '@angular/cdk/testing'; import { Provider } from '@angular/core'; import { XhrFactory } from '@angular/common'; /** * 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, canBubble?: 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, button?: number, buttons?: number, detail?: number, modifiers?: ModifierKeys, relatedTarget?: Element): MouseEvent; /** * Shorthand to dispatch a pointer event on the specified coordinates. * @docs-private */ declare function dispatchPointerEvent(node: Node, type: string, clientX?: number, clientY?: number, options?: PointerEventInit): PointerEvent; /** * Shorthand to dispatch a touch event on the specified coordinates. * @docs-private */ declare function dispatchTouchEvent(node: Node, type: string, x?: number, y?: number): UIEvent; /** * Creates a browser MouseEvent with the specified options. * @docs-private */ declare function createMouseEvent(type: string, clientX?: number, clientY?: number, button?: number, buttons?: number, detail?: number, modifiers?: ModifierKeys, relatedTarget?: Element): 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, options?: PointerEventInit): PointerEvent; /** * Creates a browser TouchEvent with the specified pointer coordinates. * @docs-private */ declare function createTouchEvent(type: string, pageX?: number, pageY?: 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, canBubble?: boolean, cancelable?: boolean): Event; declare function createDragEvent(type: string, dataTransfer?: DataTransfer | null, canBubble?: boolean, cancelable?: boolean): DragEvent; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Patches an elements focus and blur methods to emit events consistently and predictably. * This is necessary, because some browsers, like IE11, will call the focus handlers asynchronously, * while others won't fire them at all if the browser window is not focused. */ declare function patchElementFocus(element: HTMLElement): void; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Focuses an input, sets its value and dispatches * the `input` event, simulating the user typing. * @param value Value to be set on the input. * @param element Element onto which to set the value. */ declare function typeInElement(value: string, element: HTMLInputElement): void; declare const bypassSanitizeProvider: Provider; declare const defaultInlineIconSet = "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Filter Title\n \n \n \n \n \n \n \n \n \n"; declare const defaultSvgHtml = "\n\n \n"; declare const injectDefaultSvgIconSet: () => void; declare class FakeDataTransferItem implements DataTransferItem { private entry; kind: string; type: string; constructor(entry: FileSystemEntry, kind: string); getAsFile(): File; getAsString(callback: FunctionStringCallback): void; webkitGetAsEntry(): FileSystemEntry; } declare class FakeDataTransfer implements DataTransfer { dataByFormat: {}; dropEffect: 'none' | 'copy' | 'link' | 'move'; effectAllowed: 'none' | 'copy' | 'copyLink' | 'copyMove' | 'link' | 'linkMove' | 'move' | 'all' | 'uninitialized'; files: FileList; types: string[]; items: DataTransferItemList; constructor(files?: File[], items?: DataTransferItem[]); clearData(dataFormat: string): void; getData: (dataFormat: string) => any; setData(dataFormat: string, data: string): boolean; setDragImage: () => void; } declare class MockXhrFactory implements XhrFactory { mock: MockXMLHttpRequest; build(): XMLHttpRequest; } declare class MockXMLHttpRequestUpload { private mock; constructor(mock: MockXMLHttpRequest); addEventListener(event: 'progress', handler: Function): void; removeEventListener(event: 'progress', handler: Function): void; } declare class MockXMLHttpRequest { body: any; method: string; url: string; mockHeaders: { [key: string]: string; }; mockAborted: boolean; withCredentials: boolean; responseType: string; response: any | undefined; responseText: string | undefined; responseURL: string | null; status: number; statusText: string; mockResponseHeaders: string; readyState: number; listeners: { error?: (event: ErrorEvent) => void; load?: () => void; progress?: (event: ProgressEvent) => void; uploadProgress?: (event: ProgressEvent) => void; readystatechange?: () => void; }; upload: MockXMLHttpRequestUpload; open(method: string, url: string): void; send(body: any): void; addEventListener(event: 'error' | 'load' | 'progress' | 'uploadProgress' | 'readystatechange', handler: Function): void; removeEventListener(event: 'error' | 'load' | 'progress' | 'uploadProgress' | 'readystatechange'): void; setRequestHeader(name: string, value: string): void; getAllResponseHeaders(): string; getResponseHeader(header: string): string | null; mockFlush(status: number, statusText: string, body?: string | object): void; mockOnReadyStateChange(readyState?: number): void; mockDownloadProgressEvent(loaded: number, total?: number): void; mockUploadProgressEvent(loaded: number, total?: number): void; mockLoadEvent(): void; mockErrorEvent(error: any): void; abort(): void; } export { FakeDataTransfer, FakeDataTransferItem, MockXMLHttpRequest, MockXMLHttpRequestUpload, MockXhrFactory, bypassSanitizeProvider, createDragEvent, createFakeEvent, createKeyboardEvent, createMouseEvent, createPointerEvent, createTouchEvent, defaultInlineIconSet, defaultSvgHtml, dispatchEvent, dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent, dispatchPointerEvent, dispatchTouchEvent, injectDefaultSvgIconSet, patchElementFocus, typeInElement };