docs: mark getters as @ readonly

This commit is contained in:
SpaceEEC
2019-03-19 19:59:45 +01:00
parent df1889ab49
commit e62833b5e1
15 changed files with 27 additions and 4 deletions

View File

@@ -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;

View File

@@ -130,6 +130,7 @@ class VoiceConnection extends EventEmitter {
/**
* The client that instantiated this connection
* @type {Client}
* @readonly
*/
get client() {
return this.voiceManager.client;

View File

@@ -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; }

View File

@@ -32,6 +32,7 @@ class VoiceWebSocket extends EventEmitter {
/**
* The client of this voice WebSocket
* @type {Client}
* @readonly
*/
get client() {
return this.connection.voiceManager.client;

View File

@@ -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);