Skip to content

Commit

Permalink
fix types for reorder and drag test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
BoussonKarel committed Sep 27, 2024
1 parent a5edc3e commit b35613c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addon/src/test-support/helpers/drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface Callbacks {

export async function drag(
mode: TMode,
itemSelector: string,
itemSelector: keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string, // or Parameters<typeof find>[0][]
offsetFn: () => { dx: number; dy: number },
callbacks: Callbacks = {},
) {
Expand Down
6 changes: 3 additions & 3 deletions addon/src/test-support/helpers/reorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const OVERSHOOT = 2;
selectors for the resultant order
@return {Promise}
*/
export async function reorder<T extends keyof HTMLElementTagNameMap>(
export async function reorder(
mode: TMode,
itemSelector: string,
...resultSelectors: T[]
itemSelector: keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string, // or Parameters<typeof findAll>[0],
...resultSelectors: (keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string)[] // or Parameters<typeof find>[0][]
) {
for (let targetIndex = 0; targetIndex < resultSelectors.length; targetIndex++) {
const items = findAll(itemSelector);
Expand Down

0 comments on commit b35613c

Please sign in to comment.