From a75895308216e81b28f58d276395a01b15c9e645 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sat, 2 Dec 2023 21:08:25 +0100 Subject: [PATCH] JSDoc: indicate optional parameters --- src/connection.js | 6 +++--- src/types/connection.d.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/connection.js b/src/connection.js index 56735fe1..9adfaf96 100644 --- a/src/connection.js +++ b/src/connection.js @@ -526,10 +526,10 @@ class Connection { * without putting user credentials into the page. * * @param {string|Function} jid - The full JID that is bound by the session. - * @param {string} sid - The SID of the BOSH session. - * @param {number} rid - The current RID of the BOSH session. This RID + * @param {string} [sid] - The SID of the BOSH session. + * @param {number} [rid] - The current RID of the BOSH session. This RID * will be used by the next request. - * @param {Function} callback The connect callback function. + * @param {Function} [callback] - The connect callback function. * @param {number} [wait] - The optional HTTPBIND wait value. This is the * time the server will wait before returning an empty result for * a request. The default setting of 60 seconds is recommended. diff --git a/src/types/connection.d.ts b/src/types/connection.d.ts index 5cd78110..59c911f4 100644 --- a/src/types/connection.d.ts +++ b/src/types/connection.d.ts @@ -675,10 +675,10 @@ declare class Connection { * without putting user credentials into the page. * * @param {string|Function} jid - The full JID that is bound by the session. - * @param {string} sid - The SID of the BOSH session. - * @param {number} rid - The current RID of the BOSH session. This RID + * @param {string} [sid] - The SID of the BOSH session. + * @param {number} [rid] - The current RID of the BOSH session. This RID * will be used by the next request. - * @param {Function} callback The connect callback function. + * @param {Function} [callback] - The connect callback function. * @param {number} [wait] - The optional HTTPBIND wait value. This is the * time the server will wait before returning an empty result for * a request. The default setting of 60 seconds is recommended. @@ -689,7 +689,7 @@ declare class Connection { * @param {number} [wind] - The optional HTTBIND window value. This is the * allowed range of request ids that are valid. The default is 5. */ - attach(jid: string | Function, sid: string, rid: number, callback: Function, wait?: number, hold?: number, wind?: number): void; + attach(jid: string | Function, sid?: string, rid?: number, callback?: Function, wait?: number, hold?: number, wind?: number): void; /** * Attempt to restore a cached BOSH session. *