Skip to content

Commit

Permalink
docs: undocument private constructors (#6732)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC committed Oct 3, 2021
1 parent a8e6010 commit 34b2ad0
Show file tree
Hide file tree
Showing 27 changed files with 105 additions and 275 deletions.
4 changes: 0 additions & 4 deletions src/sharding/Shard.js
Expand Up @@ -14,10 +14,6 @@ let Worker = null;
* @extends EventEmitter
*/
class Shard extends EventEmitter {
/**
* @param {ShardingManager} manager Manager that is creating this shard
* @param {number} id The shard's id
*/
constructor(manager, id) {
super();

Expand Down
4 changes: 0 additions & 4 deletions src/sharding/ShardClientUtil.js
Expand Up @@ -9,10 +9,6 @@ const Util = require('../util/Util');
* Utilises IPC to send and receive data to/from the master process and other shards.
*/
class ShardClientUtil {
/**
* @param {Client} client Client of the current shard
* @param {ShardingManagerMode} mode Mode the shard was spawned with
*/
constructor(client, mode) {
/**
* Client for the shard
Expand Down
5 changes: 0 additions & 5 deletions src/structures/BaseGuildTextChannel.js
Expand Up @@ -14,11 +14,6 @@ const DataResolver = require('../util/DataResolver');
* @implements {TextBasedChannel}
*/
class BaseGuildTextChannel extends GuildChannel {
/**
* @param {Guild} guild The guild the text channel is part of
* @param {APIChannel} data The data for the text channel
* @param {Client} [client] A safety parameter for the client that instantiated this
*/
constructor(guild, data, client) {
super(guild, data, client, false);

Expand Down
10 changes: 6 additions & 4 deletions src/structures/ClientPresence.js
Expand Up @@ -9,10 +9,6 @@ const { ActivityTypes, Opcodes } = require('../util/Constants');
* @extends {Presence}
*/
class ClientPresence extends Presence {
/**
* @param {Client} client The instantiating client
* @param {APIPresence} [data={}] The data for the client presence
*/
constructor(client, data = {}) {
super(client, Object.assign(data, { status: data.status ?? 'online', user: { id: null } }));
}
Expand Down Expand Up @@ -76,3 +72,9 @@ class ClientPresence extends Presence {
}

module.exports = ClientPresence;

/* eslint-disable max-len */
/**
* @external APIPresence
* @see {@link https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields}
*/
4 changes: 0 additions & 4 deletions src/structures/DMChannel.js
Expand Up @@ -10,10 +10,6 @@ const MessageManager = require('../managers/MessageManager');
* @implements {TextBasedChannel}
*/
class DMChannel extends Channel {
/**
* @param {Client} client The instantiating client
* @param {APIChannel} data The data for the DM channel
*/
constructor(client, data) {
super(client, data);

Expand Down
5 changes: 0 additions & 5 deletions src/structures/Guild.js
Expand Up @@ -132,11 +132,6 @@ class Guild extends AnonymousGuild {
return this.client.ws.shards.get(this.shardId);
}

/**
* Sets up the guild.
* @param {*} data The raw data of the guild
* @private
*/
_patch(data) {
super._patch(data);
this.id = data.id;
Expand Down
10 changes: 0 additions & 10 deletions src/structures/GuildBan.js
Expand Up @@ -7,11 +7,6 @@ const Base = require('./Base');
* @extends {Base}
*/
class GuildBan extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIBanData} data The data for the ban
* @param {Guild} guild The guild in which the ban is
*/
constructor(client, data, guild) {
super(client);

Expand Down Expand Up @@ -62,8 +57,3 @@ class GuildBan extends Base {
}

module.exports = GuildBan;

/**
* @external APIBanData
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban-json-params}
*/
6 changes: 0 additions & 6 deletions src/structures/GuildChannel.js
Expand Up @@ -20,12 +20,6 @@ const Util = require('../util/Util');
* @abstract
*/
class GuildChannel extends Channel {
/**
* @param {Guild} guild The guild the guild channel is part of
* @param {APIChannel} data The data for the guild channel
* @param {Client} [client] A safety parameter for the client that instantiated this
* @param {boolean} [immediatePatch=true] Control variable for patching
*/
constructor(guild, data, client, immediatePatch = true) {
super(guild?.client ?? client, data, false);

Expand Down
5 changes: 0 additions & 5 deletions src/structures/GuildEmoji.js
Expand Up @@ -10,11 +10,6 @@ const Permissions = require('../util/Permissions');
* @extends {BaseGuildEmoji}
*/
class GuildEmoji extends BaseGuildEmoji {
/**
* @param {Client} client The instantiating client
* @param {APIEmoji} data The data for the guild emoji
* @param {Guild} guild The guild the guild emoji is part of
*/
constructor(client, data, guild) {
super(client, data, guild);

Expand Down
5 changes: 0 additions & 5 deletions src/structures/GuildMember.js
Expand Up @@ -13,11 +13,6 @@ const Permissions = require('../util/Permissions');
* @extends {Base}
*/
class GuildMember extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIGuildMember} data The data for the guild member
* @param {Guild} guild The guild the member is part of
*/
constructor(client, data, guild) {
super(client);

Expand Down
5 changes: 0 additions & 5 deletions src/structures/GuildPreview.js
Expand Up @@ -18,11 +18,6 @@ class GuildPreview extends Base {
this._patch(data);
}

/**
* Builds the guild with the provided data.
* @param {*} data The raw data of the guild
* @private
*/
_patch(data) {
/**
* The id of this guild
Expand Down
16 changes: 0 additions & 16 deletions src/structures/GuildTemplate.js
Expand Up @@ -9,21 +9,11 @@ const DataResolver = require('../util/DataResolver');
* @extends {Base}
*/
class GuildTemplate extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIGuildTemplate} data The raw data for the template
*/
constructor(client, data) {
super(client);
this._patch(data);
}

/**
* Builds or updates the template with the provided data.
* @param {APIGuildTemplate} data The raw data for the template
* @returns {GuildTemplate}
* @private
*/
_patch(data) {
if ('code' in data) {
/**
Expand Down Expand Up @@ -243,9 +233,3 @@ class GuildTemplate extends Base {
GuildTemplate.GUILD_TEMPLATES_PATTERN = /discord(?:app)?\.(?:com\/template|new)\/([\w-]{2,255})/gi;

module.exports = GuildTemplate;

/* eslint-disable max-len */
/**
* @external APIGuildTemplate
* @see {@link https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure}
*/
4 changes: 0 additions & 4 deletions src/structures/Message.js
Expand Up @@ -24,10 +24,6 @@ const Util = require('../util/Util');
* @extends {Base}
*/
class Message extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIMessage} data The data for the message
*/
constructor(client, data) {
super(client);

Expand Down
10 changes: 0 additions & 10 deletions src/structures/MessageReaction.js
Expand Up @@ -9,11 +9,6 @@ const Util = require('../util/Util');
* Represents a reaction to a message.
*/
class MessageReaction {
/**
* @param {Client} client The instantiating client
* @param {APIReaction} data The data for the message reaction
* @param {Message} message The message the reaction refers to
*/
constructor(client, data, message) {
/**
* The client that instantiated this message reaction
Expand Down Expand Up @@ -134,8 +129,3 @@ class MessageReaction {
}

module.exports = MessageReaction;

/**
* @external APIReaction
* @see {@link https://discord.com/developers/docs/resources/channel#reaction-object}
*/
10 changes: 0 additions & 10 deletions src/structures/Presence.js
Expand Up @@ -35,10 +35,6 @@ const Util = require('../util/Util');
* @extends {Base}
*/
class Presence extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIPresence} [data={}] The data for the presence
*/
constructor(client, data = {}) {
super(client);

Expand Down Expand Up @@ -386,9 +382,3 @@ class RichPresenceAssets {
exports.Presence = Presence;
exports.Activity = Activity;
exports.RichPresenceAssets = RichPresenceAssets;

/* eslint-disable max-len */
/**
* @external APIPresence
* @see {@link https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields}
*/
5 changes: 0 additions & 5 deletions src/structures/Role.js
Expand Up @@ -11,11 +11,6 @@ const Util = require('../util/Util');
* @extends {Base}
*/
class Role extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIRole} data The data for the role
* @param {Guild} guild The guild the role is part of
*/
constructor(client, data, guild) {
super(client);

Expand Down
9 changes: 0 additions & 9 deletions src/structures/Sticker.js
Expand Up @@ -9,10 +9,6 @@ const SnowflakeUtil = require('../util/SnowflakeUtil');
* @extends {Base}
*/
class Sticker extends Base {
/**
* @param {Client} client The instantiating client
* @param {APISticker | APIStickerItem} sticker The data for the sticker
*/
constructor(client, sticker) {
super(client);

Expand Down Expand Up @@ -274,8 +270,3 @@ module.exports = Sticker;
* @external APISticker
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object}
*/

/**
* @external APIStickerItem
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-item-object}
*/
9 changes: 0 additions & 9 deletions src/structures/StickerPack.js
Expand Up @@ -10,10 +10,6 @@ const SnowflakeUtil = require('../util/SnowflakeUtil');
* @extends {Base}
*/
class StickerPack extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIStickerPack} pack The data for the sticker pack
*/
constructor(client, pack) {
super(client);
/**
Expand Down Expand Up @@ -97,8 +93,3 @@ class StickerPack extends Base {
}

module.exports = StickerPack;

/**
* @external APIStickerPack
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-pack-object}
*/
5 changes: 0 additions & 5 deletions src/structures/StoreChannel.js
Expand Up @@ -7,11 +7,6 @@ const GuildChannel = require('./GuildChannel');
* @extends {GuildChannel}
*/
class StoreChannel extends GuildChannel {
/**
* @param {Guild} guild The guild the store channel is part of
* @param {APIChannel} data The data for the store channel
* @param {Client} [client] A safety parameter for the client that instantiated this
*/
constructor(guild, data, client) {
super(guild, data, client);

Expand Down
6 changes: 0 additions & 6 deletions src/structures/ThreadChannel.js
Expand Up @@ -13,12 +13,6 @@ const Permissions = require('../util/Permissions');
* @implements {TextBasedChannel}
*/
class ThreadChannel extends Channel {
/**
* @param {Guild} guild The guild the thread channel is part of
* @param {APIChannel} data The data for the thread channel
* @param {Client} [client] A safety parameter for the client that instantiated this
* @param {boolean} [fromInteraction=false] Whether the data was from an interaction (partial)
*/
constructor(guild, data, client, fromInteraction = false) {
super(guild?.client ?? client, data, false);

Expand Down
9 changes: 0 additions & 9 deletions src/structures/ThreadMember.js
Expand Up @@ -8,10 +8,6 @@ const ThreadMemberFlags = require('../util/ThreadMemberFlags');
* @extends {Base}
*/
class ThreadMember extends Base {
/**
* @param {ThreadChannel} thread The thread that this member is associated with
* @param {APIThreadMember} data The data for the thread member
*/
constructor(thread, data) {
super(thread.client);

Expand Down Expand Up @@ -96,8 +92,3 @@ class ThreadMember extends Base {
}

module.exports = ThreadMember;

/**
* @external APIThreadMember
* @see {@link https://discord.com/developers/docs/resources/channel#thread-member-object}
*/
10 changes: 0 additions & 10 deletions src/structures/Typing.js
Expand Up @@ -7,11 +7,6 @@ const Base = require('./Base');
* @extends {Base}
*/
class Typing extends Base {
/**
* @param {TextBasedChannels} channel The channel this typing came from
* @param {User} user The user that started typing
* @param {APITypingStart} data The raw data received
*/
constructor(channel, user, data) {
super(channel.client);

Expand Down Expand Up @@ -77,8 +72,3 @@ class Typing extends Base {
}

module.exports = Typing;

/**
* @external APITypingStart
* @see {@link https://discord.com/developers/docs/topics/gateway#typing-start-typing-start-event-fields}
*/
4 changes: 0 additions & 4 deletions src/structures/User.js
Expand Up @@ -12,10 +12,6 @@ const UserFlags = require('../util/UserFlags');
* @extends {Base}
*/
class User extends Base {
/**
* @param {Client} client The instantiating client
* @param {APIUser} data The data for the user
*/
constructor(client, data) {
super(client);

Expand Down
9 changes: 0 additions & 9 deletions src/structures/VoiceState.js
Expand Up @@ -7,10 +7,6 @@ const { Error, TypeError } = require('../errors');
* Represents the voice state for a Guild Member.
*/
class VoiceState extends Base {
/**
* @param {Guild} guild The guild the voice state is part of
* @param {APIVoiceState} data The data for the voice state
*/
constructor(guild, data) {
super(guild.client);
/**
Expand Down Expand Up @@ -275,8 +271,3 @@ class VoiceState extends Base {
}

module.exports = VoiceState;

/**
* @external APIVoiceState
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/

0 comments on commit 34b2ad0

Please sign in to comment.