import type { ChainablePromiseElement, ChainablePromiseArray } from 'webdriverio'; import * as allLocatorsTypes from '../locators/insiders.js'; import { ContextMenu } from './index.js'; type ClassWithFunctionLocatorsAsString = { [key in keyof T as T[key] extends Function | undefined ? key : never]: T[key]; }; type ClassWithFunctionLocators$ = { [key in keyof ClassWithFunctionLocatorsAsString as `${key}$`]: (...args: Parameters[key]>) => ChainablePromiseElement; }; type ClassWithFunctionLocators$$ = { [key in keyof ClassWithFunctionLocatorsAsString as `${key}$$`]: (...args: Parameters[key]>) => ChainablePromiseArray; }; type ClassWithLocators$ = { [key in keyof T & string as T[key] extends String | undefined ? `${key}$` : never]: ChainablePromiseElement; }; type ClassWithLocators$$ = { [key in keyof T & string as T[key] extends String | undefined ? `${key}$$` : never]: ChainablePromiseArray; }; type AllLocatorType = typeof allLocatorsTypes; export type LocatorComponents = keyof AllLocatorType | (keyof AllLocatorType)[]; export type Locators = Record; export type VSCodeLocatorMap = Record; export type IPageDecorator = (ClassWithLocators$ & ClassWithLocators$$ & ClassWithFunctionLocators$ & ClassWithFunctionLocators$$); type PageObjectClass = { new (...args: any[]): any; [staticMethod: string]: any; }; export declare function PageDecorator(locators: Locators): (ctor: T) => T; export declare abstract class BasePage = VSCodeLocatorMap> { protected _locators: LocatorMap; private _baseElem?; private _parentElem?; /** * @private */ abstract locatorKey: keyof LocatorMap | (keyof LocatorMap)[]; /** * @private */ constructor(_locators: LocatorMap, _baseElem?: string | ChainablePromiseElement | undefined, _parentElem?: string | ChainablePromiseElement | undefined); /** * Get the locator map of given page object */ get locators(): PageLocators; /** * @private */ get baseElem(): string | ChainablePromiseElement | undefined; /** * @private */ get locatorMap(): LocatorMap; /** * Base element of given page object */ get elem(): ChainablePromiseElement; /** * Parent element of given page object */ get parent(): ChainablePromiseElement; /** * @private */ setParentElement(parentElem: string | ChainablePromiseElement): void; /** * Wait for the element to become visible * @param timeout custom timeout for the wait * @returns thenable self reference */ wait(timeout?: number): Promise; /** * Poll for the element to become visible * @param timeout custom timeout for the wait * @param interval custom interval to control polling * @returns thenable self reference */ poll(timeout?: number, interval?: number): Promise; } /** * Abstract element that has a context menu */ export declare abstract class ElementWithContextMenu extends BasePage { /** * Open context menu on the element */ openContextMenu(): Promise; } export declare function sleep(ms?: number): Promise; /** * Semver utility function that handles the special case where version is 'stable' * @param version The version to compare * @param targetVersion The target version to compare against * @returns true if version is 'stable' or if version >= targetVersion */ export declare function semverGte(version: string, targetVersion: string): boolean; /** * Semver utility function that handles the special case where version is 'stable' * @param version The version to compare * @param targetVersion The target version to compare against * @returns true if version is 'stable', otherwise returns version < targetVersion */ export declare function semverLt(version: string, targetVersion: string): boolean; export {}; //# sourceMappingURL=utils.d.ts.map