Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit 742be60

Browse files
Sophie AuSophie Au
authored andcommitted
Add typings
1 parent e080c06 commit 742be60

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

typings/events.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ export declare class NativeTestEvent {
3232

3333
export type FireFunction = (element: NativeTestInstance, event: NativeTestEvent) => boolean;
3434
export type FireObject = {
35-
[K in EventType]: (element: NativeTestInstance, options?: {}) => boolean
35+
[K in EventType]: (element: NativeTestInstance, options?: {}) => boolean;
3636
};
3737

3838
export const getEventHandlerName: (key: string) => string;
3939
export const fireEvent: FireFunction & FireObject;
40+
export const asyncFireEvent: Promise<FireFunction & FireObject>;

typings/index.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,19 @@ export function render<Q extends Queries>(
4747
options: RenderOptions<Q>,
4848
): RenderResult<Q>;
4949

50+
export function asyncRender(
51+
ui: ReactElement<any>,
52+
options?: Omit<RenderOptions, 'queries'>,
53+
): Promise<RenderResult>;
54+
export function asyncRender<Q extends Queries>(
55+
ui: ReactElement<any>,
56+
options: RenderOptions<Q>,
57+
): Promise<RenderResult<Q>>;
58+
5059
export const cleanup: () => void;
5160

5261
export const act: (callback: () => void) => void;
62+
export function act(callback: () => Promise<void | undefined>): Promise<undefined>;
5363

5464
export { queries, queryHelpers, within };
5565
export * from './to-json';

0 commit comments

Comments
 (0)