forked from testing-library/preact-hooks-testing-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderHook.d.ts
18 lines (18 loc) · 886 Bytes
/
renderHook.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { ComponentType } from "preact";
import { Callback } from "./_types";
export interface RenderHookOptions<P> {
initialProps?: P;
wrapper?: ComponentType;
}
export declare function renderHook<P, R>(callback: Callback<P, R>, { initialProps, wrapper }?: RenderHookOptions<P>): {
wait: (callback: () => any, options?: import("./asyncUtils").TimeoutOptions) => Promise<void>;
waitFor: (callback: () => any, { interval, timeout, suppressErrors }?: import("./asyncUtils").TimeoutOptions) => Promise<void>;
waitForNextUpdate: (options?: import("./asyncUtils").TimeoutOptions) => Promise<void>;
waitForValueToChange: (selector: () => any, options?: import("./asyncUtils").TimeoutOptions) => Promise<void>;
result: {
readonly current: R;
readonly error: Error;
};
rerender: (newProps?: P | undefined) => void;
unmount: () => void;
};