mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
docs: mark getters as @ readonly
This commit is contained in:
@@ -34,6 +34,7 @@ class VoiceBroadcast extends EventEmitter {
|
||||
/**
|
||||
* The current master dispatcher, if any. This dispatcher controls all that is played by subscribed dispatchers.
|
||||
* @type {?BroadcastDispatcher}
|
||||
* @readonly
|
||||
*/
|
||||
get dispatcher() {
|
||||
return this.player.dispatcher;
|
||||
|
||||
@@ -130,6 +130,7 @@ class VoiceConnection extends EventEmitter {
|
||||
/**
|
||||
* The client that instantiated this connection
|
||||
* @type {Client}
|
||||
* @readonly
|
||||
*/
|
||||
get client() {
|
||||
return this.voiceManager.client;
|
||||
|
||||
@@ -146,12 +146,14 @@ class StreamDispatcher extends Writable {
|
||||
/**
|
||||
* Whether or not playback is paused
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get paused() { return Boolean(this.pausedSince); }
|
||||
|
||||
/**
|
||||
* Total time that this dispatcher has been paused
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
get pausedTime() {
|
||||
return this._silentPausedTime + this._pausedTime + (this.paused ? Date.now() - this.pausedSince : 0);
|
||||
@@ -177,6 +179,7 @@ class StreamDispatcher extends Writable {
|
||||
/**
|
||||
* The time (in milliseconds) that the dispatcher has actually been playing audio for
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
get streamTime() {
|
||||
return this.count * FRAME_LENGTH;
|
||||
@@ -185,6 +188,7 @@ class StreamDispatcher extends Writable {
|
||||
/**
|
||||
* The time (in milliseconds) that the dispatcher has been playing audio for, taking into account skips and pauses
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
get totalStreamTime() {
|
||||
return Date.now() - this.startTime;
|
||||
@@ -322,6 +326,7 @@ class StreamDispatcher extends Writable {
|
||||
/**
|
||||
* Whether or not the Opus bitrate of this stream is editable
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get bitrateEditable() { return this.streams.opus && this.streams.opus.setBitrate; }
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ class VoiceWebSocket extends EventEmitter {
|
||||
/**
|
||||
* The client of this voice WebSocket
|
||||
* @type {Client}
|
||||
* @readonly
|
||||
*/
|
||||
get client() {
|
||||
return this.connection.voiceManager.client;
|
||||
|
||||
@@ -15,6 +15,7 @@ class VolumeInterface extends EventEmitter {
|
||||
/**
|
||||
* Whether or not the volume of this stream is editable
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get volumeEditable() {
|
||||
return true;
|
||||
@@ -22,8 +23,8 @@ class VolumeInterface extends EventEmitter {
|
||||
|
||||
/**
|
||||
* The current volume of the stream
|
||||
* @readonly
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
get volume() {
|
||||
return this._volume;
|
||||
@@ -31,8 +32,8 @@ class VolumeInterface extends EventEmitter {
|
||||
|
||||
/**
|
||||
* The current volume of the stream in decibels
|
||||
* @readonly
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
get volumeDecibels() {
|
||||
return Math.log10(this.volume) * 20;
|
||||
@@ -40,8 +41,8 @@ class VolumeInterface extends EventEmitter {
|
||||
|
||||
/**
|
||||
* The current volume of the stream from a logarithmic scale
|
||||
* @readonly
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
get volumeLogarithmic() {
|
||||
return Math.pow(this.volume, 1 / 1.660964);
|
||||
|
||||
Reference in New Issue
Block a user