ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
70 lines (63 loc) • 3.52 kB
TypeScript
import * as i0 from '@angular/core';
import { NgZone, EventEmitter } from '@angular/core';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/** Utility to dispatch any event on a Node. */
declare function dispatchEvent(node: Node | Window, event: Event): Event;
/** Shorthand to dispatch a fake event on a specified node. */
declare function dispatchFakeEvent(node: Node | Window, type: string, canBubble?: boolean): Event;
/** Shorthand to dispatch a keyboard event with a specified key code. */
declare function dispatchKeyboardEvent(node: Node, type: string, keyCode: number, target?: Element): KeyboardEvent;
/** Shorthand to dispatch a mouse event on the specified coordinates. */
declare function dispatchMouseEvent(node: Node, type: string, x?: number, y?: number, event?: MouseEvent): MouseEvent;
/** Shorthand to dispatch a touch event on the specified coordinates. */
declare function dispatchTouchEvent(node: Node, type: string, x?: number, y?: number): TouchEvent;
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/** Creates a browser MouseEvent with the specified options. */
declare function createMouseEvent(type: string, x?: number, y?: number, button?: number): MouseEvent;
/** Creates a browser TouchEvent with the specified pointer coordinates. */
declare function createTouchEvent(type: string, pageX?: number, pageY?: number): UIEvent;
/** Dispatches a keydown event from an element. */
declare function createKeyboardEvent(type: string, keyCode: number, target?: Element, key?: string, ctrlKey?: boolean, metaKey?: boolean, shiftKey?: boolean): KeyboardEvent;
/** Creates a fake event object with any desired event type. */
declare function createFakeEvent(type: string, canBubble?: boolean, cancelable?: boolean): Event;
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/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 | HTMLTextAreaElement): void;
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* Mock synchronous NgZone implementation that can be used
* to flush out `onStable` subscriptions in tests.
*
* via: https://github.com/angular/angular/blob/master/packages/core/testing/src/ng_zone_mock.ts
*
* @docs-private
*/
declare class MockNgZone extends NgZone {
onStable: EventEmitter<any>;
constructor();
run(fn: () => NzSafeAny): NzSafeAny;
runOutsideAngular(fn: () => NzSafeAny): NzSafeAny;
simulateZoneExit(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<MockNgZone, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<MockNgZone>;
}
export { MockNgZone, createFakeEvent, createKeyboardEvent, createMouseEvent, createTouchEvent, dispatchEvent, dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent, dispatchTouchEvent, typeInElement };