Skip to content

Commit 43d32f5

Browse files
foray1010Kent C. Dodds
authored and
Kent C. Dodds
committed
feat(typings): allow document to be used in fireEvent (#272)
1 parent 8c64eec commit 43d32f5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

typings/events.d.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,21 @@ export type EventType =
7171
| 'transitionEnd'
7272
| 'doubleClick'
7373

74-
export type FireFunction = (element: Element | Window, event: Event) => boolean
74+
export type FireFunction = (
75+
element: Document | Element | Window,
76+
event: Event,
77+
) => boolean
7578
export type FireObject = {
76-
[K in EventType]: (element: Element | Window, options?: {}) => boolean
79+
[K in EventType]: (
80+
element: Document | Element | Window,
81+
options?: {},
82+
) => boolean
7783
}
7884
export type CreateObject = {
79-
[K in EventType]: (element: Element | Window, options?: {}) => Event
85+
[K in EventType]: (
86+
element: Document | Element | Window,
87+
options?: {},
88+
) => Event
8089
}
8190

8291
export const createEvent: CreateObject

0 commit comments

Comments
 (0)