|
1 |
| -import { Matcher, MatcherOptions, ByRoleMatcher } from './matches' |
2 |
| -import { SelectorMatcherOptions } from './query-helpers' |
3 |
| -import { waitForOptions } from './wait-for' |
| 1 | +import {Matcher, MatcherOptions} from './matches' |
| 2 | +import {SelectorMatcherOptions} from './query-helpers' |
| 3 | +import {waitForOptions} from './wait-for' |
| 4 | +import {ARIARole} from 'aria-query' |
4 | 5 |
|
5 | 6 | export type QueryByBoundAttribute = (
|
6 | 7 | container: HTMLElement,
|
@@ -92,37 +93,64 @@ export interface ByRoleOptions extends MatcherOptions {
|
92 | 93 | | ((accessibleName: string, element: Element) => boolean)
|
93 | 94 | }
|
94 | 95 |
|
95 |
| -export type AllByRole = ( |
| 96 | +declare function AllByRole( |
96 | 97 | container: HTMLElement,
|
97 |
| - role: ByRoleMatcher, |
| 98 | + role: Matcher, |
98 | 99 | options?: ByRoleOptions,
|
99 |
| -) => HTMLElement[] |
| 100 | +): HTMLElement[] |
| 101 | +declare function AllByRole( |
| 102 | + container: HTMLElement, |
| 103 | + role: ARIARole, |
| 104 | + options?: ByRoleOptions, |
| 105 | +): HTMLElement[] |
100 | 106 |
|
101 |
| -export type GetByRole = ( |
| 107 | +declare function GetByRole( |
102 | 108 | container: HTMLElement,
|
103 |
| - role: ByRoleMatcher, |
| 109 | + role: Matcher, |
104 | 110 | options?: ByRoleOptions,
|
105 |
| -) => HTMLElement |
| 111 | +): HTMLElement |
| 112 | +declare function GetByRole( |
| 113 | + container: HTMLElement, |
| 114 | + role: ARIARole, |
| 115 | + options?: ByRoleOptions, |
| 116 | +): HTMLElement |
106 | 117 |
|
107 |
| -export type QueryByRole = ( |
| 118 | +declare function QueryByRole( |
108 | 119 | container: HTMLElement,
|
109 |
| - role: ByRoleMatcher, |
| 120 | + role: Matcher | ByRoleOptions, |
110 | 121 | options?: ByRoleOptions,
|
111 |
| -) => HTMLElement | null |
| 122 | +): HTMLElement | null |
| 123 | +declare function QueryByRole( |
| 124 | + container: HTMLElement, |
| 125 | + role: ARIARole, |
| 126 | + options?: ByRoleOptions, |
| 127 | +): HTMLElement | null |
112 | 128 |
|
113 |
| -export type FindByRole = ( |
| 129 | +declare function FindByRole( |
114 | 130 | container: HTMLElement,
|
115 |
| - role: ByRoleMatcher, |
| 131 | + role: Matcher, |
116 | 132 | options?: ByRoleOptions,
|
117 | 133 | waitForElementOptions?: waitForOptions,
|
118 |
| -) => Promise<HTMLElement> |
| 134 | +): Promise<HTMLElement> |
| 135 | +declare function FindByRole( |
| 136 | + container: HTMLElement, |
| 137 | + role: ARIARole, |
| 138 | + options?: ByRoleOptions, |
| 139 | + waitForElementOptions?: waitForOptions, |
| 140 | +): Promise<HTMLElement> |
119 | 141 |
|
120 |
| -export type FindAllByRole = ( |
| 142 | +declare function FindAllByRole( |
121 | 143 | container: HTMLElement,
|
122 |
| - role: ByRoleMatcher, |
| 144 | + role: Matcher, |
123 | 145 | options?: ByRoleOptions,
|
124 | 146 | waitForElementOptions?: waitForOptions,
|
125 |
| -) => Promise<HTMLElement[]> |
| 147 | +): Promise<HTMLElement[]> |
| 148 | +declare function FindAllByRole( |
| 149 | + container: HTMLElement, |
| 150 | + role: Matcher, |
| 151 | + options?: ByRoleOptions, |
| 152 | + waitForElementOptions?: waitForOptions, |
| 153 | +): Promise<HTMLElement[]> |
126 | 154 |
|
127 | 155 | export const getByLabelText: GetByText
|
128 | 156 | export const getAllByLabelText: AllByText
|
@@ -160,12 +188,12 @@ export const queryByDisplayValue: QueryByBoundAttribute
|
160 | 188 | export const queryAllByDisplayValue: AllByBoundAttribute
|
161 | 189 | export const findByDisplayValue: FindByBoundAttribute
|
162 | 190 | export const findAllByDisplayValue: FindAllByBoundAttribute
|
163 |
| -export const getByRole: GetByRole |
164 |
| -export const getAllByRole: AllByRole |
165 |
| -export const queryByRole: QueryByRole |
166 |
| -export const queryAllByRole: AllByRole |
167 |
| -export const findByRole: FindByRole |
168 |
| -export const findAllByRole: FindAllByRole |
| 191 | +export const getByRole: typeof GetByRole |
| 192 | +export const getAllByRole: typeof AllByRole |
| 193 | +export const queryByRole: typeof QueryByRole |
| 194 | +export const queryAllByRole: typeof AllByRole |
| 195 | +export const findByRole: typeof FindByRole |
| 196 | +export const findAllByRole: typeof FindAllByRole |
169 | 197 | export const getByTestId: GetByBoundAttribute
|
170 | 198 | export const getAllByTestId: AllByBoundAttribute
|
171 | 199 | export const queryByTestId: QueryByBoundAttribute
|
|
0 commit comments