Open leonheess opened 1 year ago
That may help
/* eventsourcemock.d.ts */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
declare module "eventsourcemock" {
type EventSourceConfigurationType = {
withCredentials: boolean
};
type ReadyStateType = 0 | 1 | 2;
export default class EventSource {
constructor(url: string, configuration?: EventSourceConfigurationType): EventSource;
addEventListener(eventName: string, listener: Function): void;
removeEventListener(eventName: string, listener: Function): void;
close(): void;
emit(eventName: string, messageEvent?: MessageEvent): void;
emitError(error: any): void;
emitOpen(): void;
emitMessage(message: any): void;
}
export const sources: { [key: string]: EventSource };
}
:)