File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,14 @@ inside:
5858pre-commit
5959```
6060
61+ ### Add typings
62+
63+ If your PR introduced some changes in the API, you are more than welcome to
64+ modify the Typescript type definition to reflect those changes. Just modify the
65+ ` /typings/index.d.ts ` file accordingly. If you have never seen Typescript
66+ definitions before, you can read more about it in its
67+ [ documentation pages] ( https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html )
68+
6169## Help needed
6270
6371Please checkout the [ the open issues] [ issues ]
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ export type RenderResult<Q extends Queries = typeof queries> = {
1919 asFragment : ( ) => DocumentFragment
2020} & { [ P in keyof Q ] : BoundFunction < Q [ P ] > }
2121
22+ export type HookResult = {
23+ rerender : ( ) => void
24+ unmount : ( ) => boolean
25+ }
26+
2227export interface RenderOptions < Q extends Queries = typeof queries > {
2328 container ?: HTMLElement
2429 baseElement ?: HTMLElement
@@ -43,7 +48,7 @@ export function render<Q extends Queries>(
4348/**
4449 * Renders a test component that calls back to the test.
4550 */
46- export function testHook ( callback : ( ) => void ) : void
51+ export function testHook ( callback : ( ) => void ) : HookResult
4752
4853/**
4954 * Unmounts React trees that were mounted with render.
You can’t perform that action at this time.
0 commit comments