diff --git a/types/matchers.d.ts b/types/matchers.d.ts index cdd66c1..dfea7f1 100755 --- a/types/matchers.d.ts +++ b/types/matchers.d.ts @@ -1,8 +1,4 @@ -import {ARIARole} from 'aria-query' - -// Get autocomplete for ARIARole union types, while still supporting another string -// Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939 -export type ByRoleMatcher = ARIARole | (string & {}) +import {type ARIARole} from 'aria-query' declare namespace matchers { interface TestingLibraryMatchers { @@ -621,7 +617,11 @@ declare namespace matchers { * @see * [testing-library/jest-dom#tohaverole](https://github.com/testing-library/jest-dom#tohaverole) */ - toHaveRole(role: ByRoleMatcher): R + toHaveRole( + // Get autocomplete for ARIARole union types, while still supporting another string + // Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939 + role: ARIARole | (string & {}), + ): R /** * @description * This allows you to check whether the given element is partially checked.