• Parameters

    • event: string | Event | CustomEvent<any>

      The event to dispatch

    • Optionalelement: null | Element | Window

      The element to dispatch from, or will use window if none given.

    Returns void

    Throws an error if the event is not a string that can be converted to a CustomEvent or not an instance of Event.