mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
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:
@@ -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 } = {}) {
|
||||
|
||||
Reference in New Issue
Block a user