The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/polyfills/customEventPolyfill.ts

23 lines
577 B

((): void => {
if (typeof window.CustomEvent === 'function') {
return;
}
const CustomEvent = (function <T>(
type: string,
{
bubbles = false,
cancelable = false,
detail = (null as unknown) as T,
}: CustomEventInit<T> = {},
): CustomEvent<T> {
const evt = document.createEvent('CustomEvent') as CustomEvent<T>;
evt.initCustomEvent(type, bubbles, cancelable, detail);
return evt;
} as unknown) as {
prototype: CustomEvent;
new <T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
};
window.CustomEvent = CustomEvent;
})();