@types/eventsource
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -6,5 +6,12 @@ // Type definitions for eventsource 1.1 | ||
// Pedro Gámez <https://github.com/snakedrak> | ||
// Akuukis <https://github.com/Akuukis> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.8 | ||
// TypeScript Version: 3.0 | ||
// eventsource uses DOM dependencies which are absent in browserless envoronment like node.js. | ||
// to avoid compiler errors this monkey patch is used. See more details in: | ||
// - sinon: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11351 | ||
// - rxjs: https://github.com/ReactiveX/rxjs/issues/1986 | ||
/// <reference path="./dom-monkeypatch.d.ts" /> | ||
declare class EventSource { | ||
@@ -45,2 +52,1 @@ static readonly CLOSED: number; | ||
export = EventSource; | ||
export as namespace EventSource; |
@@ -1,36 +0,2 @@ | ||
declare class EventSource { | ||
static readonly CLOSED: number; | ||
static readonly CONNECTING: number; | ||
static readonly OPEN: number; | ||
constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict); | ||
readonly CLOSED: number; | ||
readonly CONNECTING: number; | ||
readonly OPEN: number; | ||
readonly url: string; | ||
readonly readyState: number; | ||
readonly withCredentials: boolean; | ||
onopen: (evt: MessageEvent) => any; | ||
onmessage: (evt: MessageEvent) => any; | ||
onerror: (evt: MessageEvent) => any; | ||
addEventListener(type: string, listener: EventListener): void; | ||
dispatchEvent(evt: Event): boolean; | ||
removeEventListener(type: string, listener?: EventListener): void; | ||
close(): void; | ||
} | ||
declare namespace EventSource { | ||
enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2} | ||
interface EventSourceInitDict { | ||
withCredentials?: boolean; | ||
headers?: object; | ||
proxy?: string; | ||
https?: object; | ||
rejectUnauthorized?: boolean; | ||
} | ||
} | ||
import * as EventSource from '../../index'; | ||
export = EventSource; | ||
export as namespace EventSource; |
{ | ||
"name": "@types/eventsource", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "TypeScript definitions for eventsource", | ||
@@ -21,2 +21,7 @@ "license": "MIT", | ||
"githubUsername": "snakedrak" | ||
}, | ||
{ | ||
"name": "Akuukis", | ||
"url": "https://github.com/Akuukis", | ||
"githubUsername": "Akuukis" | ||
} | ||
@@ -28,8 +33,9 @@ ], | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/eventsource" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "ac33a41882edeb864c6e296a314be593aaf558b1d7ab625c65d6cd689d543455", | ||
"typeScriptVersion": "2.8" | ||
"typesPublisherContentHash": "030e9728da08f50e7381f03861a541ffd0dad4a55cf46f42b5bc5de12f14d0c2", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
Additional Details | ||
* Last updated: Sat, 19 Jan 2019 01:10:40 GMT | ||
* Last updated: Mon, 01 Jul 2019 15:33:01 GMT | ||
* Dependencies: none | ||
* Global values: EventSource | ||
* Global values: MessageEvent | ||
# Credits | ||
These definitions were written by Scott Lee Davis <https://github.com/scottleedavis>, Ali Afroozeh <https://github.com/afroozeh>, Pedro Gámez <https://github.com/snakedrak>. | ||
These definitions were written by Scott Lee Davis <https://github.com/scottleedavis>, Ali Afroozeh <https://github.com/afroozeh>, Pedro Gámez <https://github.com/snakedrak>, and Akuukis <https://github.com/Akuukis>. |
8014
6
130