diff --git a/lib/sse.js b/lib/sse.js index d9a0873..e6e7f56 100644 --- a/lib/sse.js +++ b/lib/sse.js @@ -40,8 +40,9 @@ var SSE = function (url, options) { /** @type { {[key: string]: EventListener} } */ this.listeners = {}; - + /** @type {XMLHttpRequest} */ this.xhr = null; + /** @type {number} */ this.readyState = this.INITIALIZING; /** @type {number} */ this.progress = 0; @@ -285,11 +286,11 @@ if (typeof exports !== 'undefined') { export { SSE }; /** - * @typedef { {[key: string]: string} } SSEHeader + * @typedef { {[key: string]: string} } SSEHeaders */ /** * @typedef {Object} SSEOptions - * @property {SSEHeader} headers - headers + * @property {SSEHeaders} headers - headers * @property {string} payload - payload as a string * @property {string} method - HTTP Method * @property {boolean} withCredentials - flag, if credentials needed