export declare type AsyncFactoryFn = () => Promise; export declare type AsyncOptionPredicate = (item: T, option: O) => Promise; export declare type AsyncPredicate = (item: T) => Promise; export interface BaseHarnessFilters { ancestor?: string; selector?: string; } export declare abstract class ComponentHarness { protected readonly locatorFactory: LocatorFactory; constructor(locatorFactory: LocatorFactory); protected documentRootLocatorFactory(): LocatorFactory; protected forceStabilize(): Promise; host(): Promise; protected locatorFor | string)[]>(...queries: T): AsyncFactoryFn>; protected locatorForAll | string)[]>(...queries: T): AsyncFactoryFn[]>; protected locatorForOptional | string)[]>(...queries: T): AsyncFactoryFn | null>; protected waitForTasksOutsideAngular(): Promise; } export interface ComponentHarnessConstructor { hostSelector: string; new (locatorFactory: LocatorFactory): T; } export interface ElementDimensions { height: number; left: number; top: number; width: number; } export declare abstract class HarnessEnvironment implements HarnessLoader, LocatorFactory { protected rawRootElement: E; rootElement: TestElement; protected constructor(rawRootElement: E); protected createComponentHarness(harnessType: ComponentHarnessConstructor, element: E): T; protected abstract createEnvironment(element: E): HarnessEnvironment; protected abstract createTestElement(element: E): TestElement; documentRootLocatorFactory(): LocatorFactory; abstract forceStabilize(): Promise; getAllChildLoaders(selector: string): Promise; getAllHarnesses(query: HarnessQuery): Promise; protected abstract getAllRawElements(selector: string): Promise; getChildLoader(selector: string): Promise; protected abstract getDocumentRoot(): E; getHarness(query: HarnessQuery): Promise; harnessLoaderFor(selector: string): Promise; harnessLoaderForAll(selector: string): Promise; harnessLoaderForOptional(selector: string): Promise; locatorFor | string)[]>(...queries: T): AsyncFactoryFn>; locatorForAll | string)[]>(...queries: T): AsyncFactoryFn[]>; locatorForOptional | string)[]>(...queries: T): AsyncFactoryFn | null>; abstract waitForTasksOutsideAngular(): Promise; } export interface HarnessLoader { getAllChildLoaders(selector: string): Promise; getAllHarnesses(query: HarnessQuery): Promise; getChildLoader(selector: string): Promise; getHarness(query: HarnessQuery): Promise; } export declare class HarnessPredicate { harnessType: ComponentHarnessConstructor; constructor(harnessType: ComponentHarnessConstructor, options: BaseHarnessFilters); add(description: string, predicate: AsyncPredicate): this; addOption(name: string, option: O | undefined, predicate: AsyncOptionPredicate): this; evaluate(harness: T): Promise; filter(harnesses: T[]): Promise; getDescription(): string; getSelector(): string; static stringMatches(value: string | null | Promise, pattern: string | RegExp | null): Promise; } export declare type HarnessQuery = ComponentHarnessConstructor | HarnessPredicate; export interface LocatorFactory { rootElement: TestElement; documentRootLocatorFactory(): LocatorFactory; forceStabilize(): Promise; harnessLoaderFor(selector: string): Promise; harnessLoaderForAll(selector: string): Promise; harnessLoaderForOptional(selector: string): Promise; locatorFor | string)[]>(...queries: T): AsyncFactoryFn>; locatorForAll | string)[]>(...queries: T): AsyncFactoryFn[]>; locatorForOptional | string)[]>(...queries: T): AsyncFactoryFn | null>; waitForTasksOutsideAngular(): Promise; } export declare type LocatorFnResult | string)[]> = { [I in keyof T]: T[I] extends new (...args: any[]) => infer C ? C : T[I] extends { harnessType: new (...args: any[]) => infer C; } ? C : T[I] extends string ? TestElement : never; }[number]; export interface ModifierKeys { alt?: boolean; control?: boolean; meta?: boolean; shift?: boolean; } export interface TestElement { blur(): Promise; clear(): Promise; click(relativeX?: number, relativeY?: number): Promise; focus(): Promise; getAttribute(name: string): Promise; getCssValue(property: string): Promise; getDimensions(): Promise; getProperty(name: string): Promise; hasClass(name: string): Promise; hover(): Promise; isFocused(): Promise; matchesSelector(selector: string): Promise; sendKeys(...keys: (string | TestKey)[]): Promise; sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise; text(): Promise; } export declare enum TestKey { BACKSPACE = 0, TAB = 1, ENTER = 2, SHIFT = 3, CONTROL = 4, ALT = 5, ESCAPE = 6, PAGE_UP = 7, PAGE_DOWN = 8, END = 9, HOME = 10, LEFT_ARROW = 11, UP_ARROW = 12, RIGHT_ARROW = 13, DOWN_ARROW = 14, INSERT = 15, DELETE = 16, F1 = 17, F2 = 18, F3 = 19, F4 = 20, F5 = 21, F6 = 22, F7 = 23, F8 = 24, F9 = 25, F10 = 26, F11 = 27, F12 = 28, META = 29 }