import * as i0 from '@angular/core';
import { EnvironmentProviders, Type, DebugElement, Provider, NgZone, EventEmitter } from '@angular/core';
import { ComponentFixture } from '@angular/core/testing';
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
 */

declare function provideMockDirectionality(): EnvironmentProviders;
type Predicate<T> = (value: T) => boolean;
/**
 * Creates a `describe('RTL', ...)` block that verifies the component correctly toggles
 * an RTL CSS class when `Directionality.valueSignal` changes between 'ltr' and 'rtl'.
 *
 * Must be called at the top level of a spec file (outside any `describe` that has its own
 * `beforeEach` configuring TestBed), because it configures its own TestBed internally.
 *
 * @param componentFn Thunk returning the component class. Using a thunk avoids class hoisting
 *   issues — class declarations defined below the call site would be `undefined` at registration time.
 * @param predicate A `By.directive(...)` or `By.css(...)` predicate to locate the element
 *   that carries the RTL class. Use `By.css` when the RTL class is on a child element rather
 *   than the component host.
 * @param classnamePrefix The class prefix (e.g. `'ant-alert'`). The test asserts the presence
 *   of `${classnamePrefix}-rtl`.
 * @param options.detectChangesFn Custom change detection callback for components that need
 *   imperative updates beyond `fixture.detectChanges()` (e.g. calling a private method).
 * @param options.providers Additional providers needed by the component (e.g. `provideNzIconsTesting()`).
 */
declare function testDirectionality<T>(componentFn: () => Type<T>, predicate: Predicate<DebugElement>, classnamePrefix: string, options?: {
    detectChangesFn?: (fixture: ComponentFixture<T>) => void;
    providers?: Array<Provider | EnvironmentProviders>;
}): 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
 */
/** 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
 */

/**
 * 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>;
}

/**
 * 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
 */

declare function sleep(ms: number): Promise<void>;
declare function nextAnimationFrame(): Promise<void>;
declare function updateNonSignalsInput<T>(fixture: ComponentFixture<T>, ms?: number): Promise<void>;

export { MockNgZone, createFakeEvent, createKeyboardEvent, createMouseEvent, createTouchEvent, dispatchEvent, dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent, dispatchTouchEvent, nextAnimationFrame, provideMockDirectionality, sleep, testDirectionality, typeInElement, updateNonSignalsInput };
