doc: fix: docstring: use Promise
This commit is contained in:
@ -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())
|
||||
|
@ -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("");
|
||||
|
Reference in New Issue
Block a user