From cb08a0961ac07099d0efdd58e7f0a1ca9f535635 Mon Sep 17 00:00:00 2001 From: Souji Date: Fri, 24 Aug 2018 16:51:15 +0200 Subject: [PATCH] Docs: merge PermissionOverwriteOptions and OverwriteData (#2738) * Docs: merge PermissionOverwriteOptions and OverwriteData * fix user-member and replace eslint-disable with linebreaks * consistency fix * Fix: remove empty line between jsdocs and method * Fix: allowed/denied to allow/deny to conform with recent master changes --- src/stores/GuildChannelStore.js | 11 ++--------- src/structures/GuildChannel.js | 18 +++++++++--------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/stores/GuildChannelStore.js b/src/stores/GuildChannelStore.js index e73b52e98..d775622d7 100644 --- a/src/stores/GuildChannelStore.js +++ b/src/stores/GuildChannelStore.js @@ -21,14 +21,6 @@ class GuildChannelStore extends DataStore { return Channel.create(this.client, data, this.guild); } - /** - * Can be used to overwrite permissions when creating a channel. - * @typedef {Object} PermissionOverwriteOptions - * @property {PermissionResolvable} [allow] The permissions to allow - * @property {PermissionResolvable} [deny] The permissions to deny - * @property {RoleResolvable|UserResolvable} id ID of the role or member this overwrite is for - */ - /** * Creates a new channel in the guild. * @param {string} name The name of the new channel @@ -39,7 +31,8 @@ class GuildChannelStore extends DataStore { * @param {number} [options.bitrate] Bitrate of the new channel in bits (only voice) * @param {number} [options.userLimit] Maximum amount of users allowed in the new channel (only voice) * @param {ChannelResolvable} [options.parent] Parent of the new channel - * @param {Array} [options.overwrites] Permission overwrites + * @param {OverwriteData[]|Collection} [options.overwrites] + * Permission overwrites of the new channel * @param {string} [options.reason] Reason for creating the channel * @returns {Promise} * @example diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 20e09093f..ffae8c36b 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -176,11 +176,11 @@ class GuildChannel extends Channel { .freeze(); } - /* eslint-disable max-len */ /** * Replaces the permission overwrites in this channel. * @param {Object} [options] Options - * @param {Array|Collection} [options.overwrites] Permission overwrites + * @param {OverwriteData[]|Collection} [options.overwrites] + * Permission overwrites the channel gets updated with * @param {string} [options.reason] Reason for updating the channel overwrites * @returns {Promise} * @example @@ -198,7 +198,6 @@ class GuildChannel extends Channel { return this.edit({ permissionOverwrites: resolvePermissions.call(this, overwrites), reason }) .then(() => this); } - /* eslint-enable max-len */ /** * An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled). @@ -307,17 +306,18 @@ class GuildChannel extends Channel { * @property {number} [bitrate] The bitrate of the voice channel * @property {number} [userLimit] The user limit of the voice channel * @property {Snowflake} [parentID] The parent ID of the channel - * @property {boolean} [lockPermissions] Lock the permissions of the channel to what the parent's permissions are - * @property {OverwriteData[]} [permissionOverwrites] An array of overwrites to set for the channel + * @property {boolean} [lockPermissions] + * Lock the permissions of the channel to what the parent's permissions are + * @property {OverwriteData[]|Collection} [permissionOverwrites] + * Permission overwrites for the channel */ /** * The data for a permission overwrite * @typedef {Object} OverwriteData - * @property {string} id The id of the overwrite - * @property {string} type The type of the overwrite, either role or member - * @property {number} allow The bitfield for the allowed permissions - * @property {number} deny The bitfield for the denied permissions + * @property {PermissionResolvable} [allow] The permissions to allow + * @property {PermissionResolvable} [deny] The permissions to deny + * @property {GuildMemberResolvable|RoleResolvable} memberOrRole Member or role this overwrite is for */ /**