Skip to content

Commit c6b864c

Browse files
chore: update TL types (#282)
1 parent 11105d0 commit c6b864c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

projects/testing-library/src/lib/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface RenderResult<ComponentType, WrapperType = ComponentType> extend
2020
* element: The to be printed HTML element, if not provided it will log the whole component's DOM
2121
*/
2222
debug: (
23-
element?: Element | HTMLDocument | (Element | HTMLDocument)[],
23+
element?: Element | Document | (Element | Document)[],
2424
maxLength?: number,
2525
options?: PrettyDOMOptions,
2626
) => void;

projects/testing-library/src/lib/testing-library.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ import {
2222
within as dtlWithin,
2323
waitForOptions as dtlWaitForOptions,
2424
configure as dtlConfigure,
25-
Queries,
26-
getQueriesForElement,
2725
queries as dtlQueries,
2826
} from '@testing-library/dom';
27+
import type { Queries, BoundFunctions } from '@testing-library/dom';
2928
import { RenderComponentOptions, RenderTemplateOptions, RenderResult } from './models';
3029
import { getConfig } from './config';
3130

@@ -439,12 +438,11 @@ const screen = replaceFindWithFindAndDetectChanges(dtlScreen);
439438
/**
440439
* Re-export within with patched queries
441440
*/
442-
443-
const within: typeof getQueriesForElement = <T extends Queries = typeof dtlQueries>(
441+
const within = <QueriesToBind extends Queries = typeof dtlQueries, T extends QueriesToBind = QueriesToBind>(
444442
element: HTMLElement,
445443
queriesToBind?: T,
446-
) => {
447-
const container = dtlWithin(element, queriesToBind);
444+
): BoundFunctions<T> => {
445+
const container = dtlWithin<T>(element, queriesToBind);
448446
return replaceFindWithFindAndDetectChanges(container);
449447
};
450448

0 commit comments

Comments
 (0)