Skip to content

Commit

Permalink
feat(typings): allow document to be used in fireEvent (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
foray1010 authored and Kent C. Dodds committed Jun 1, 2019
1 parent 8c64eec commit 43d32f5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions typings/events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,21 @@ export type EventType =
| 'transitionEnd'
| 'doubleClick'

export type FireFunction = (element: Element | Window, event: Event) => boolean
export type FireFunction = (
element: Document | Element | Window,
event: Event,
) => boolean
export type FireObject = {
[K in EventType]: (element: Element | Window, options?: {}) => boolean
[K in EventType]: (
element: Document | Element | Window,
options?: {},
) => boolean
}
export type CreateObject = {
[K in EventType]: (element: Element | Window, options?: {}) => Event
[K in EventType]: (
element: Document | Element | Window,
options?: {},
) => Event
}

export const createEvent: CreateObject
Expand Down

0 comments on commit 43d32f5

Please sign in to comment.