import {ByRoleMatcher, Matcher, MatcherOptions} from './matches' import {SelectorMatcherOptions} from './query-helpers' import {waitForOptions} from './wait-for' export type QueryByBoundAttribute = ( container: HTMLElement, id: Matcher, options?: MatcherOptions, ) => T | null export type AllByBoundAttribute = ( container: HTMLElement, id: Matcher, options?: MatcherOptions, ) => T[] export type FindAllByBoundAttribute = ( container: HTMLElement, id: Matcher, options?: MatcherOptions, waitForElementOptions?: waitForOptions, ) => Promise export type GetByBoundAttribute = ( container: HTMLElement, id: Matcher, options?: MatcherOptions, ) => T export type FindByBoundAttribute = ( container: HTMLElement, id: Matcher, options?: MatcherOptions, waitForElementOptions?: waitForOptions, ) => Promise export type QueryByText = ( container: HTMLElement, id: Matcher, options?: SelectorMatcherOptions, ) => T | null export type AllByText = ( container: HTMLElement, id: Matcher, options?: SelectorMatcherOptions, ) => T[] export type FindAllByText = ( container: HTMLElement, id: Matcher, options?: SelectorMatcherOptions, waitForElementOptions?: waitForOptions, ) => Promise export type GetByText = ( container: HTMLElement, id: Matcher, options?: SelectorMatcherOptions, ) => T export type FindByText = ( container: HTMLElement, id: Matcher, options?: SelectorMatcherOptions, waitForElementOptions?: waitForOptions, ) => Promise export interface ByRoleOptions extends MatcherOptions { /** * If true includes elements in the query set that are usually excluded from * the accessibility tree. `role="none"` or `role="presentation"` are included * in either case. */ hidden?: boolean /** * If true only includes elements in the query set that are marked as * selected in the accessibility tree, i.e., `aria-selected="true"` */ selected?: boolean /** * If true only includes elements in the query set that are marked as * checked in the accessibility tree, i.e., `aria-checked="true"` */ checked?: boolean /** * If true only includes elements in the query set that are marked as * pressed in the accessibility tree, i.e., `aria-pressed="true"` */ pressed?: boolean /** * Filters elements by their `aria-current` state. `true` and `false` match `aria-current="true"` and `aria-current="false"` (as well as a missing `aria-current` attribute) respectively. */ current?: boolean | string /** * If true only includes elements in the query set that are marked as * expanded in the accessibility tree, i.e., `aria-expanded="true"` */ expanded?: boolean /** * Includes elements with the `"heading"` role matching the indicated level, * either by the semantic HTML heading elements `

-

` or matching * the `aria-level` attribute. */ level?: number /** * Includes every role used in the `role` attribute * For example *ByRole('progressbar', {queryFallbacks: true})` will find
`. */ queryFallbacks?: boolean /** * Only considers elements with the specified accessible name. */ name?: | RegExp | string | ((accessibleName: string, element: Element) => boolean) /** * Only considers elements with the specified accessible description. */ description?: | RegExp | string | ((accessibleDescription: string, element: Element) => boolean) } export type AllByRole = ( container: HTMLElement, role: ByRoleMatcher, options?: ByRoleOptions, ) => T[] export type GetByRole = ( container: HTMLElement, role: ByRoleMatcher, options?: ByRoleOptions, ) => T export type QueryByRole = ( container: HTMLElement, role: ByRoleMatcher, options?: ByRoleOptions, ) => T | null export type FindByRole = ( container: HTMLElement, role: ByRoleMatcher, options?: ByRoleOptions, waitForElementOptions?: waitForOptions, ) => Promise export type FindAllByRole = ( container: HTMLElement, role: ByRoleMatcher, options?: ByRoleOptions, waitForElementOptions?: waitForOptions, ) => Promise export function getByLabelText( ...args: Parameters> ): ReturnType> export function getAllByLabelText( ...args: Parameters> ): ReturnType> export function queryByLabelText( ...args: Parameters> ): ReturnType> export function queryAllByLabelText( ...args: Parameters> ): ReturnType> export function findByLabelText( ...args: Parameters> ): ReturnType> export function findAllByLabelText( ...args: Parameters> ): ReturnType> export function getByPlaceholderText( ...args: Parameters> ): ReturnType> export function getAllByPlaceholderText( ...args: Parameters> ): ReturnType> export function queryByPlaceholderText( ...args: Parameters> ): ReturnType> export function queryAllByPlaceholderText( ...args: Parameters> ): ReturnType> export function findByPlaceholderText( ...args: Parameters> ): ReturnType> export function findAllByPlaceholderText( ...args: Parameters> ): ReturnType> export function getByText( ...args: Parameters> ): ReturnType> export function getAllByText( ...args: Parameters> ): ReturnType> export function queryByText( ...args: Parameters> ): ReturnType> export function queryAllByText( ...args: Parameters> ): ReturnType> export function findByText( ...args: Parameters> ): ReturnType> export function findAllByText( ...args: Parameters> ): ReturnType> export function getByAltText( ...args: Parameters> ): ReturnType> export function getAllByAltText( ...args: Parameters> ): ReturnType> export function queryByAltText( ...args: Parameters> ): ReturnType> export function queryAllByAltText( ...args: Parameters> ): ReturnType> export function findByAltText( ...args: Parameters> ): ReturnType> export function findAllByAltText( ...args: Parameters> ): ReturnType> export function getByTitle( ...args: Parameters> ): ReturnType> export function getAllByTitle( ...args: Parameters> ): ReturnType> export function queryByTitle( ...args: Parameters> ): ReturnType> export function queryAllByTitle( ...args: Parameters> ): ReturnType> export function findByTitle( ...args: Parameters> ): ReturnType> export function findAllByTitle( ...args: Parameters> ): ReturnType> export function getByDisplayValue( ...args: Parameters> ): ReturnType> export function getAllByDisplayValue( ...args: Parameters> ): ReturnType> export function queryByDisplayValue( ...args: Parameters> ): ReturnType> export function queryAllByDisplayValue( ...args: Parameters> ): ReturnType> export function findByDisplayValue( ...args: Parameters> ): ReturnType> export function findAllByDisplayValue( ...args: Parameters> ): ReturnType> export function getByRole( ...args: Parameters> ): ReturnType> export function getAllByRole( ...args: Parameters> ): ReturnType> export function queryByRole( ...args: Parameters> ): ReturnType> export function queryAllByRole( ...args: Parameters> ): ReturnType> export function findByRole( ...args: Parameters> ): ReturnType> export function findAllByRole( ...args: Parameters> ): ReturnType> export function getByTestId( ...args: Parameters> ): ReturnType> export function getAllByTestId( ...args: Parameters> ): ReturnType> export function queryByTestId( ...args: Parameters> ): ReturnType> export function queryAllByTestId( ...args: Parameters> ): ReturnType> export function findByTestId( ...args: Parameters> ): ReturnType> export function findAllByTestId( ...args: Parameters> ): ReturnType>