From da882cbc0be6cf9eb6f4a116a00373b723db001f Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:09:22 +0100 Subject: [PATCH 1/2] fix(SSEOptions): declare properties optional --- types/sse.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/sse.d.ts b/types/sse.d.ts index cedc4ae..80972c5 100644 --- a/types/sse.d.ts +++ b/types/sse.d.ts @@ -45,23 +45,23 @@ export type SSEOptions = { /** * - headers */ - headers: SSEHeader; + headers?: SSEHeader; /** * - payload as a string */ - payload: string; + payload?: string; /** * - HTTP Method */ - method: string; + method?: string; /** * - flag, if credentials needed */ - withCredentials: boolean; + withCredentials?: boolean; /** * - debugging flag */ - debug: boolean; + debug?: boolean; }; export type _SSEvent = { id: string; @@ -94,4 +94,4 @@ export type OnAbort = (event: SSEvent) => void; * @return {SSE} */ export var SSE: SSE; -//# sourceMappingURL=sse.d.ts.map \ No newline at end of file +//# sourceMappingURL=sse.d.ts.map From 9314442701c7e5ccb9bd2954d80f4543fe6290d3 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Thu, 9 Nov 2023 13:16:55 +0100 Subject: [PATCH 2/2] fixup! fix(SSEOptions): declare properties optional --- lib/sse.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sse.js b/lib/sse.js index e6e7f56..97f40fa 100644 --- a/lib/sse.js +++ b/lib/sse.js @@ -290,11 +290,11 @@ export { SSE }; */ /** * @typedef {Object} SSEOptions - * @property {SSEHeaders} headers - headers - * @property {string} payload - payload as a string - * @property {string} method - HTTP Method - * @property {boolean} withCredentials - flag, if credentials needed - * @property {boolean} debug - debugging flag + * @property {SSEHeaders} [headers] - headers + * @property {string} [payload] - payload as a string + * @property {string} [method] - HTTP Method + * @property {boolean} [withCredentials] - flag, if credentials needed + * @property {boolean} [debug] - debugging flag */ /** * @typedef {Object} _SSEvent