Files
DefinitelyTyped/types/eventsource/eventsource-tests.ts
2018-04-19 14:25:09 -07:00

18 lines
684 B
TypeScript

import EventSource = require("eventsource");
const eventSource = new EventSource("http://foobar");
eventSource.onmessage = (x: any) => {};
eventSource.onerror = (x: any) => {};
eventSource.onopen = (x: any) => {};
eventSource.addEventListener = (type: string, x: any) => {};
eventSource.close();
import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill");
const eventSourcePolyfill = new EventSourcePolyfill("http://foobar");
eventSourcePolyfill.onmessage = (x: any) => {};
eventSourcePolyfill.onerror = (x: any) => {};
eventSourcePolyfill.onopen = (x: any) => {};
eventSourcePolyfill.addEventListener = (type: string, x: any) => {};
eventSourcePolyfill.close();