declare global { interface HASSDomEvents { } } export type ValidHassDomEvent = keyof HASSDomEvents ; export interface HASSDomEvent < T > extends Event { detail : T ; } param { string } type param { * = } detail param { { bubbles : ( boolean | undefined ) , cancelable : ( boolean | undefined ) , composed : ( boolean | undefined ) } = } options return { Event } export const fireEvent = < HassEvent extends ValidHassDomEvent > ( node , type , detail ? , options ? ) => { options = options || { } ; detail = detail === null || detail === undefined ? { } : detail ; const event = new Event ( type , { bubbles : options . bubbles === undefined ? true : options . bubbles , cancelable : Boolean ( options . cancelable ) , composed : options . composed === undefined ? true : options . composed } ) ; ( event as any ) . detail = detail ; node . dispatchEvent ( event ) ; return event ; } ;