import { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio'; import { QavajsWdioWorld } from './QavajsWdioWorld'; type SelectorDefinition = string | ((argument: string) => string) | ((argument: any) => any) | null; export declare class Selector { selector: SelectorDefinition; component: Function; type: string; constructor(selector: SelectorDefinition, type?: string); /** * Define current locator as component * @param { new () => void } component */ as(component: new () => void): this; } export type NativeSelectorParams = { browser: WebdriverIO.Browser; driver: WebdriverIO.Browser; parent: ChainablePromiseElement; argument: string; }; /** * Define selector */ export interface LocatorDefinition { (selector: any): Selector; /** * Define selector as a template * @param {(argument: string) => string} selector - selector template */ template: (selector: (argument: string) => string) => Selector; /** * Define selector using native wdio API * @param {(argument: string) => string} selector - selector function */ native: (selector: (params: NativeSelectorParams) => ChainablePromiseElement) => Selector; /** * Define component * @param { new () => void } component */ as: (component: new () => void) => Selector; } export declare const locator: LocatorDefinition; export declare class ChainItem { alias: string; argument?: string; selector: any; type: string; constructor({ alias, argument, selector, type }: { alias: string; argument?: string; selector?: string; type: string; }); } export declare function query(root: any, path: string): ChainItem[]; export interface Locator { (): ChainablePromiseElement; collection: () => ChainablePromiseArray; } export declare function element(this: QavajsWdioWorld, path: string): Locator; export {};