diff --git a/src/index.ts b/src/index.ts index 15b1e9a..8d02b8d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -310,8 +310,9 @@ export async function click (selector:Element|string):Promise { * converted to a CustomEvent or not an instance of Event. */ export function event ( - event:string|InstanceType|InstanceType>, - element?:Element|Window + event:CustomEvent|Event|string, + // event:string|InstanceType|InstanceType>, + element?:Element|Window|null ):void { element = (element instanceof Window ? element : toElement(element)) diff --git a/src/util.ts b/src/util.ts index 0367725..12100d7 100644 --- a/src/util.ts +++ b/src/util.ts @@ -13,7 +13,7 @@ * */ export function toElement ( - _selector?:string|HTMLElement|Element + _selector?:string|HTMLElement|Element|null ):Element|InstanceType { if (!_selector) return window