doc: fix: docstring: use Promise

This commit is contained in:
2024-01-25 17:37:08 +01:00
parent 8eeb9ed4ab
commit c23500e0a0
8 changed files with 42 additions and 19 deletions

View File

@ -73,6 +73,10 @@ class Tourmanent
this.connected = false;
}
/**
*
* @returns {Promise<?>}
*/
async init()
{
let response = await this.client._get(`/api/tournaments/${id}`);
@ -108,6 +112,12 @@ class Tourmanent
this._socket.send(JSON.stringify({participate: ""}));
}
/**
* Join the tournament Websocket
* @param {CallableFunction} receive_func
* @param {CallableFunction} disconnect_func
* @returns {?}
*/
async join(receive_func, disconnect_func)
{
if (!await this.client.isAuthentificate())

View File

@ -17,7 +17,7 @@ class Tourmanents
/**
*
* @param {Number} id
* @returns
* @returns {?Promise<Tournament>}
*/
async getTournament(id)
{
@ -47,6 +47,7 @@ class Tourmanents
/**
* @param {String} state must be "finished", or "started", or "waiting". Any other return all elements
* @returns {?Promise<[Tourmanent]>}
*/
async search(state)
{
@ -76,6 +77,10 @@ class Tourmanents
return tournaments;
}
/**
* Get all tournaments
* @returns {?Promise<[Tourmanent]>}
*/
async all()
{
return await this.search("");