File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,14 @@ inside:
58
58
pre-commit
59
59
```
60
60
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
+
61
69
## Help needed
62
70
63
71
Please 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> = {
19
19
asFragment : ( ) => DocumentFragment
20
20
} & { [ P in keyof Q ] : BoundFunction < Q [ P ] > }
21
21
22
+ export type HookResult = {
23
+ rerender : ( ) => void
24
+ unmount : ( ) => boolean
25
+ }
26
+
22
27
export interface RenderOptions < Q extends Queries = typeof queries > {
23
28
container ?: HTMLElement
24
29
baseElement ?: HTMLElement
@@ -43,7 +48,7 @@ export function render<Q extends Queries>(
43
48
/**
44
49
* Renders a test component that calls back to the test.
45
50
*/
46
- export function testHook ( callback : ( ) => void ) : void
51
+ export function testHook ( callback : ( ) => void ) : HookResult
47
52
48
53
/**
49
54
* Unmounts React trees that were mounted with render.
You can’t perform that action at this time.
0 commit comments