import type { ExpectationResult, MatcherContext } from 'expect'; import type { ChainablePromiseElement, ChainablePromiseArray } from 'webdriverio'; import type { WdioSome } from './publicTypes/expectWebdriverIO.js'; export type WdioElementMaybePromise = WebdriverIO.Element | ChainablePromiseElement; export type WdioElements = WebdriverIO.ElementArray | WebdriverIO.Element[]; export type WdioElementsMaybePromise = WdioElements | ChainablePromiseArray | Promise | Promise; export type WdioElementOrArrayMaybePromise = WdioElementMaybePromise | WdioElementsMaybePromise; export type MaybeSomeWdioElementOrArrayMaybePromiseOrMultiRemoteElements = MaybeSome; export type WdioMultiRemoteElements = WebdriverIO.MultiRemoteElement | WebdriverIO.MultiRemoteElementArray; /** Multi-remote `mock()`, awaited or not */ export type WdioMultiRemoteMockMaybePromise = WebdriverIO.MultiRemoteMock | Promise; /** The `this` of a matcher: the public context, and the internal options that some matchers set */ export type WdioMatcherContext = ExpectWebdriverIO.MatcherContext & { /** An empty element set passes instead of failing (e.g. `.not.toExist()`) */ allowEmptyElements?: boolean; /** Browser Runner: the stack line of the `toMatchInlineSnapshot()` call in the browser */ errorStack?: string; /** `toHaveElementProperty`: the value can be a plain object or an array (false for `toHaveValue`, whose value is a string) */ allowObjectExpectedValue?: boolean; /** The `expect` library context has more properties (`utils`, `equals`, `promise`, ...) */ [key: string]: unknown; }; export type RawMatcherFn = { (this: Context, actual: unknown, ...expected: unknown[]): ExpectationResult; }; export type MaybeArray = T | T[]; export type MaybeArrayOrMultiRemoteValuesWithArray = MaybeArray | MultiRemoteValuesWithArray; export type MultiRemoteValuesWithArray = MultiRemoteValues; export type MultiRemoteValues = Record; export type MaybeSome = T | WdioSome;