diff --git a/lib/typedefs.ts b/lib/typedefs.ts index f841200..98098eb 100644 --- a/lib/typedefs.ts +++ b/lib/typedefs.ts @@ -1,4 +1,5 @@ import { + ByRoleOptions as ByRoleOptions_, Matcher, MatcherOptions as MatcherOptions_, SelectorMatcherOptions as SelectorMatcherOptions_, @@ -10,16 +11,7 @@ type Element = ElementHandle type MatcherOptions = Omit type SelectorMatcherOptions = Omit - -// tslint:disable-next-line -interface RoleMatcherOptions extends MatcherOptions { - name?: string | RegExp -} - -// tslint:disable-next-line -interface SelectorRoleMatcherOptions extends SelectorMatcherOptions { - name?: string | RegExp -} +type ByRoleOptions = Omit interface IQueryMethods { queryByPlaceholderText(el: Element, m: Matcher, opts?: MatcherOptions): Promise @@ -124,20 +116,20 @@ interface IQueryMethods { waitForOpts?: waitForOptions, ): Promise - queryByRole(el: Element, m: Matcher, opts?: RoleMatcherOptions): Promise - queryAllByRole(el: Element, m: Matcher, opts?: RoleMatcherOptions): Promise - getByRole(el: Element, m: Matcher, opts?: RoleMatcherOptions): Promise - getAllByRole(el: Element, m: Matcher, opts?: RoleMatcherOptions): Promise + queryByRole(el: Element, m: Matcher, opts?: ByRoleOptions): Promise + queryAllByRole(el: Element, m: Matcher, opts?: ByRoleOptions): Promise + getByRole(el: Element, m: Matcher, opts?: ByRoleOptions): Promise + getAllByRole(el: Element, m: Matcher, opts?: ByRoleOptions): Promise findByRole( el: Element, m: Matcher, - opts?: SelectorRoleMatcherOptions, + opts?: ByRoleOptions, waitForOpts?: waitForOptions, ): Promise findAllByRole( el: Element, m: Matcher, - opts?: SelectorRoleMatcherOptions, + opts?: ByRoleOptions, waitForOpts?: waitForOptions, ): Promise