refactor(*): make typedefs for all options params (#5785)

Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
Shubham Parihar
2021-06-14 00:02:54 +05:30
committed by GitHub
parent 01a1fd615b
commit 1ac9a2eb5b
23 changed files with 356 additions and 237 deletions

View File

@@ -103,7 +103,7 @@ class Shard extends EventEmitter {
* Forks a child process or creates a worker thread for the shard.
* <warn>You should not need to call this manually.</warn>
* @param {number} [timeout=30000] The amount in milliseconds to wait until the {@link Client} has become ready
* before resolving. (-1 or Infinity for no wait)
* before resolving (`-1` or `Infinity` for no wait)
* @returns {Promise<ChildProcess>}
*/
async spawn(timeout = 30000) {
@@ -187,13 +187,17 @@ class Shard extends EventEmitter {
}
/**
* Kills and restarts the shard's process/worker.
* @param {Object} [options] Respawn options for the shard
* @param {number} [options.delay=500] How long to wait between killing the process/worker and
* Options used to respawn a shard.
* @typedef {Object} ShardRespawnOptions
* @property {number} [delay=500] How long to wait between killing the process/worker and
* restarting it (in milliseconds)
* @param {number} [options.timeout=30000] The amount in milliseconds to wait until the {@link Client}
* has become ready
* before resolving. (-1 or Infinity for no wait)
* @property {number} [timeout=30000] The amount in milliseconds to wait until the {@link Client}
* has become ready before resolving (`-1` or `Infinity` for no wait)
*/
/**
* Kills and restarts the shard's process/worker.
* @param {ShardRespawnOptions} [options] Options for respawning the shard
* @returns {Promise<ChildProcess>}
*/
async respawn({ delay = 500, timeout = 30000 } = {}) {