import { Locator, LocatorScreenshotOptions, Page } from 'playwright-core'; import { Expect } from '@playwright/test'; type NestedElements = { [K in keyof A]: A[K] extends WebElement ? A[K] & NestedElements> : A[K] extends (this: any, ...args: infer Args) => infer Result ? (this: T & Omit, K>, ...args: Args) => Result : A[K]; }; type InferNestedElements = T extends { with(config: infer Config): any; } ? Config extends object ? Config : {} : {}; type InternalMethods = { [K in keyof M]: M[K] extends (this: any, ...args: infer Args) => infer Result ? (this: T & Omit, K>, ...args: Args) => Result : M[K]; }; type AriaSnapshotOptions = Parameters[0]; type BlurOptions = Parameters[0]; type BoundingBoxOptions = Parameters[0]; type BoundingBoxReturnType = ReturnType; type CheckOptions = Parameters[0]; type ClearOptions = Parameters[0]; type ClickOptions = Parameters[0]; type DblClickOptions = Parameters[0]; type DispatchEventInit = Parameters[1]; type DispatchEventOptions = Parameters[2]; type DragToOptions = Parameters[1]; type FillOptions = Parameters[1]; type FocusOptions = Parameters[0]; type GetAttributeOptions = Parameters[1]; type HoverOptions = Parameters[0]; type InnerHTMLOptions = Parameters[0]; type InnerTextOptions = Parameters[0]; type InputValueOptions = Parameters[0]; type IsCheckedOptions = Parameters[0]; type IsDisabledOptions = Parameters[0]; type IsEditableOptions = Parameters[0]; type IsEnabledOptions = Parameters[0]; type IsVisibleOptions = Parameters[0]; type PressOptions = Parameters[1]; type ScrollIntoViewIfNeededOptions = Parameters[0]; type SelectOptionValuesType = Parameters[0]; type SelectOptionOptions = Parameters[1]; type SelectTextOptions = Parameters[0]; type SetCheckedOptions = Parameters[1]; type SetInputFilesType = Parameters[0]; type SetInputFilesOptions = Parameters[1]; type TapOptions = Parameters[0]; type TextContentOptions = Parameters[0]; type TypeOptions = Parameters[1]; type PressSequentiallyOptions = Parameters[1]; type UncheckOptions = Parameters[0]; type WaitForOptions = Parameters[0]; type AddLocatorHandlerOptions = Parameters[2]; declare const _expect: Expect<{ [key: string]: (...args: any[]) => Promise; }>; type LocatorExpect = ReturnType>; export declare class WebElement { protected _isFrame: boolean; protected _isInFrame: boolean; protected _frameSelector: string; private _parents; private readonly _selector; private readonly _by; private _byOptions; private _hasLocator; private _hasNotLocator; private _hasText; private _hasNotText; private _nth; private _and; private _or; constructor(selector: string, by?: By, options?: ByOptions | ByRoleOptions); private selectLocatorMethod; private buildLocator; private buildParentLocatorsChain; get locator(): Locator; get _(): Locator; static useExpect(expect: Expect): void; expect(message?: string): LocatorExpect; softExpect(message?: string): LocatorExpect; private recursiveParentSelectorInjection; subElements(this: T, augment: NestedElements): T & A; withMethods(this: T, augment: InternalMethods): T & A; with(this: T, augment: NestedElements): T & A; get narrowSelector(): string; private buildNarrowSelectorWithInternalLocator; get selector(): string; get parentsSelector(): string; parent(this: WebElement): WebElement & T; private get parentElements(); private addParentSelector; clone(this: T, options?: { selector?: string; hasLocator?: string | WebElement; hasNotLocator?: string | WebElement; hasText?: string | RegExp; hasNotText?: string | RegExp; nth?: number; }): T; and(this: R, element: string | T): R; or(this: R, element: string | T): R; has(this: R, element: string | T): R; hasNot(this: R, element: string | T): R; hasText(this: R, text: string | RegExp): R; hasNotText(this: R, text: string | RegExp): R; private addParentsToWebElement; contentFrame(): this; owner(): this; addHandler(this: T, handler: (element: T) => Promise, options?: AddLocatorHandlerOptions): Promise; removeHandler(): Promise; $(selector: string): WebElement; $getByAltText(altText: string, options?: ByOptions): WebElement; $getByLabel(label: string, options?: ByOptions): WebElement; $getByPlaceholder(placeholder: string, options?: ByOptions): WebElement; $getByRole(role: Role, options?: ByRoleOptions): WebElement; $getByTestId(testId: string): WebElement; $getByText(text: string, options?: ByOptions): WebElement; $getByTitle(title: string, options?: ByOptions): WebElement; nth(index: number): this; first(): this; last(): this; getAll(this: T): Promise; asyncForEach(this: T, action: (element: T) => unknown | Promise): Promise; syncForEach(this: T, action: (element: T) => unknown | Promise): Promise; map(this: T, item: (element: T) => R | Promise): Promise>; filter(this: R, options: { has?: string | T; hasNot?: string | T; hasText?: string | RegExp; hasNotText?: string | RegExp; }): R; filterElements(this: T, predicate: (element: T) => boolean | Promise): Promise; allInnerTexts(): Promise>; allTextContents(): Promise>; ariaSnapshot(options?: AriaSnapshotOptions): Promise; blur(options?: BlurOptions): Promise; boundingBox(options?: BoundingBoxOptions): BoundingBoxReturnType; check(options?: CheckOptions): Promise; clear(options?: ClearOptions): Promise; click(options?: ClickOptions): Promise; count(): Promise; dblclick(options?: DblClickOptions): Promise; dispatchEvent(type: string, eventInit?: DispatchEventInit, options?: DispatchEventOptions): Promise; dragTo(target: Locator | WebElement, options?: DragToOptions): Promise; fill(value: string, options?: FillOptions): Promise; focus(options?: FocusOptions): Promise; getAttribute(name: string, options?: GetAttributeOptions): Promise; highlight(): Promise; hover(options?: HoverOptions): Promise; innerHTML(options?: InnerHTMLOptions): Promise; innerText(options?: InnerTextOptions): Promise; inputValue(options?: InputValueOptions): Promise; isChecked(options?: IsCheckedOptions): Promise; isDisabled(options?: IsDisabledOptions): Promise; isEditable(options?: IsEditableOptions): Promise; isEnabled(options?: IsEnabledOptions): Promise; isHidden(): Promise; isVisible(options?: IsVisibleOptions): Promise; press(key: string, options?: PressOptions): Promise; screenshot(options?: LocatorScreenshotOptions): Promise; scrollIntoViewIfNeeded(options?: ScrollIntoViewIfNeededOptions): Promise; selectOption(values: SelectOptionValuesType, options?: SelectOptionOptions): Promise>; selectText(options?: SelectTextOptions): Promise; setChecked(checked: boolean, options?: SetCheckedOptions): Promise; setInputFiles(files: SetInputFilesType, options?: SetInputFilesOptions): Promise; tap(options?: TapOptions): Promise; textContent(options?: TextContentOptions): Promise; type(text: string, options?: TypeOptions): Promise; pressSequentially(text: string, options?: PressSequentiallyOptions): Promise; uncheck(options?: UncheckOptions): Promise; waitFor(options?: WaitForOptions): Promise; getText(options?: TextContentOptions): Promise; } declare enum By { getByAltText = "getByAltText", getByLabel = "getByLabel", getByPlaceholder = "getByPlaceholder", getByRole = "getByRole", getByTestId = "getByTestId", getByText = "getByText", getByTitle = "getByTitle" } type ByOptions = { exact?: boolean; }; type Role = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'blockquote' | 'button' | 'caption' | 'cell' | 'checkbox' | 'code' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'deletion' | 'dialog' | 'directory' | 'document' | 'emphasis' | 'feed' | 'figure' | 'form' | 'generic' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'insertion' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'meter' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'paragraph' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'strong' | 'subscript' | 'superscript' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'time' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem'; type ByRoleOptions = { checked?: boolean; disabled?: boolean; exact?: boolean; expanded?: boolean; includeHidden?: boolean; level?: number; name?: string | RegExp; pressed?: boolean; selected?: boolean; }; export declare function $(selector: string): WebElement; export declare function $getByAltText(altText: string, options?: ByOptions): WebElement; export declare function $getByLabel(label: string, options?: ByOptions): WebElement; export declare function $getByPlaceholder(placeholder: string, options?: ByOptions): WebElement; export declare function $getByRole(role: Role, options?: ByRoleOptions): WebElement; export declare function $getByTestId(testId: string): WebElement; export declare function $getByText(text: string, options?: ByOptions): WebElement; export declare function $getByTitle(title: string, options?: ByOptions): WebElement; export declare function initDesktopOrMobile(desktop: T, mobile: T): T; export {};