mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-03-30 18:24:26 +00:00
18 lines
684 B
TypeScript
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();
|