import type { Locator } from '@vitest/browser/context' import type { TestingLibraryMatchers } from './jest-dom.js' import type { Assertion, ExpectPollOptions } from 'vitest' declare module 'vitest' { interface JestAssertion extends TestingLibraryMatchers {} interface AsymmetricMatchersContaining extends TestingLibraryMatchers {} type Promisify = { [K in keyof O]: O[K] extends (...args: infer A) => infer R ? O extends R ? Promisify : (...args: A) => Promise : O[K]; } type PromisifyDomAssertion = Promisify> interface ExpectStatic { /** * `expect.element(locator)` is a shorthand for `expect.poll(() => locator.element())`. * You can set default timeout via `expect.poll.timeout` option in the config. * @see {@link https://vitest.dev/api/expect#poll} */ element: (element: T, options?: ExpectPollOptions) => PromisifyDomAssertion> } } export {}