import { ArgumentNullError } from "./Error"; import { EventSource } from "./EventSource"; import { IEventSource } from "./IEventSource"; import { PlatformEvent } from "./PlatformEvent"; export class Events { private static instance: IEventSource = new EventSource(); public static SetEventSource = (eventSource: IEventSource): void => { if (!eventSource) { throw new ArgumentNullError("eventSource"); } Events.instance = eventSource; } public static get Instance(): IEventSource { return Events.instance; } }