import type { MaybeSomeWdioElementOrArrayMaybePromiseOrMultiRemoteElements, WdioElements, WdioElementsMaybePromise, WdioMultiRemoteElements } from '../types.js'; /** * Wraps the expected value in an array if both the target element (`el`) and the `actual` value are arrays. * * @param element - The WebdriverIO element, element array, or unknown target being evaluated. * @param actual - The actual result or results array. * @param expected - The expected result to potentially wrap. * @returns An array containing the expected result if conditions are met, otherwise returns the expected result as-is. */ export declare const wrapExpectedWithArray: (elements: WebdriverIO.Element | WdioElements | unknown, actual: unknown, expected: unknown) => unknown; export declare const fillSingleExpectedForElementArray: (subject: WebdriverIO.Element | WdioElements | unknown, value: unknown) => unknown[] | unknown; /** * Make isArray typing recognize WebdriverIO.ElementArray since it already works fine at runtime. */ export declare const isArray: (obj: unknown) => obj is unknown[] | WebdriverIO.ElementArray; /** * A `$$()` list, awaited or not: in WebdriverIO v10, a not-awaited `$$()` is the list itself, not a Promise. */ export declare const isStrictlyElementArray: (obj: unknown) => obj is WebdriverIO.ElementArray; /** * A loaded element: an awaited `$()`, an item of an awaited `$$()`, or the result of `getElement()`. * A not-awaited `$()` has the same brand, but it is a Promise of the element. */ export declare const isElement: (obj: unknown) => obj is WebdriverIO.Element; /** * ElementArray or Element[] * Warning: empty array is considered as Element[] and will return true. * */ export declare const isElementArrayLike: (obj: unknown) => obj is WebdriverIO.ElementArray | WebdriverIO.Element[]; /** * Element[] * Warning: empty array is considered as Element[] and will return true. */ export declare const isArrayOfElement: (obj: unknown) => obj is WebdriverIO.Element[]; /** * Element, ElementArray or Element[] * Warning: empty array is considered as Element[] and will return true. */ export declare const isElementOrArrayLike: (obj: unknown) => obj is WebdriverIO.ElementArray | WebdriverIO.Element[] | WebdriverIO.Element | WdioMultiRemoteElements; /** * Element, ElementArray, Element[] or MultiRemoteElement * Warning: empty array is considered as Element[] and will return true. */ export declare const isElementOrArrayOrMultiRemoteElementLike: (obj: unknown) => obj is WebdriverIO.ElementArray | WebdriverIO.Element[] | WebdriverIO.Element | WdioMultiRemoteElements; /** * Universally awaits and resolves WebdriverIO element(s) into a standardized object. * * Element resolution can be complex depending on the type received: * - Using `$()` or `$$()` returns a `ChainablePromiseElement` or `ChainablePromiseArray`. These need to be awaited. * - Even though methods like `.getElement()` can be called statically, at runtime `'getElement'` / `'getElements'` does not exist on the chainable promise itself. * - Using `await $()` resolves to a `WebdriverIO.Element` or `WebdriverIO.ElementArray`, meaning `'getElement'` or `'getElements'` can be safely checked and evaluated at runtime. * - Native promises are also fully supported and properly awaited, including those returned by methods like: * - `$().getElement()` which evaluates to `Promise` * - `$$().getElements()` which evaluates to `Promise` * - `$$().filter()` which evaluates to `Promise` * - Directly passing a `WebdriverIO.Element` or `WebdriverIO.ElementArray` requires no awaiting, and runtime methods work immediately. * * @param received - The target to resolve. Can be a single WebdriverIO element, an array of elements, a promise evaluating to elements, or an undefined/primitive value. * @returns A promise resolving to an object detailing the state of the element(s): * - `selector`: The resolved WebdriverIO element or array of elements. * - `element`: The resolved single `WebdriverIO.Element` (if a single element was passed). * - `elements`: The resolved array of elements (if an array or ElementArray was passed). * - `isEmptyElements`: `true` if the resolved array of elements has a length of 0. * - `other`: Contains the original value if it was a primitive, `undefined`, or not a recognized element/array. */ export declare const awaitElementOrArray: (received: MaybeSomeWdioElementOrArrayMaybePromiseOrMultiRemoteElements | PromiseLike | WdioMultiRemoteElements | unknown) => Promise<{ selector?: WdioElements | WebdriverIO.Element | WebdriverIO.MultiRemoteElement | WebdriverIO.MultiRemoteElementArray; elements?: WdioElements | WebdriverIO.MultiRemoteElementArray; element?: WebdriverIO.Element; other?: unknown; isEmptyElements?: boolean; multiRemoteSelector?: WebdriverIO.MultiRemoteElement; }>; export declare const awaitElementArray: (received: WdioElementsMaybePromise | undefined) => Promise<{ elements?: WdioElements; other?: unknown; }>; /** * An awaited multi-remote `$()`, or an item of a multi-remote `$$()`. It has no `parent`. */ export declare const isMultiRemoteElement: (obj: unknown) => obj is WebdriverIO.MultiRemoteElement; /** * The `MultiRemoteElementArray` of a multi-remote `$$()`, which knows its parent, its selector and its instances. */ export declare const isMultiRemoteElementArray: (obj: unknown) => obj is WebdriverIO.MultiRemoteElementArray; /** * Checks if the object is like a MultiRemoteElement, array or not. */ export declare const isMultiRemoteElementLike: (obj: unknown) => obj is WdioMultiRemoteElements;