docs(*): wrap optional properties with union types in parentheses (#6021)

This commit is contained in:
Almeida
2021-07-03 21:00:53 +01:00
committed by GitHub
parent 4bf49809f2
commit ec06ba7ad0
8 changed files with 11 additions and 11 deletions

View File

@@ -55,7 +55,7 @@ class ClientApplication extends Application {
/**
* The owner of this OAuth application
* @type {?User|Team}
* @type {?(User|Team)}
*/
this.owner = data.team
? new Team(this.client, data.team)

View File

@@ -103,7 +103,7 @@ class ClientUser extends Structures.get('User') {
* @property {PresenceStatusData} [status] Status of the user
* @property {boolean} [afk] Whether the user is AFK
* @property {ActivitiesOptions[]} [activities] Activity the user is playing
* @property {?number|number[]} [shardID] Shard Id(s) to have the activity set on
* @property {?(number|number[])} [shardID] Shard Id(s) to have the activity set on
*/
/**
@@ -130,7 +130,7 @@ class ClientUser extends Structures.get('User') {
/**
* Sets the status of the client user.
* @param {PresenceStatusData} status Status to change to
* @param {?number|number[]} [shardID] Shard ID(s) to have the activity set on
* @param {?(number|number[])} [shardID] Shard ID(s) to have the activity set on
* @returns {Presence}
* @example
* // Set the client user's status

View File

@@ -17,7 +17,7 @@ class CommandInteraction extends Interaction {
/**
* The channel this interaction was sent in
* @type {?TextChannel|NewsChannel|DMChannel}
* @type {?(TextChannel|NewsChannel|DMChannel)}
* @name CommandInteraction#channel
* @readonly
*/

View File

@@ -354,7 +354,7 @@ class GuildAuditLogsEntry {
/**
* Specific property changes
* @type {?(AuditLogChange[])}
* @type {?AuditLogChange[]}
*/
this.changes = data.changes?.map(c => ({ key: c.key, old: c.old_value, new: c.new_value })) ?? null;

View File

@@ -58,7 +58,7 @@ class Interaction extends Base {
/**
* If this interaction was sent in a guild, the member which sent it
* @type {?GuildMember|APIGuildMember}
* @type {?(GuildMember|APIGuildMember)}
*/
this.member = data.member ? this.guild?.members.add(data.member) ?? data.member : null;

View File

@@ -39,7 +39,7 @@ class InteractionCollector extends Collector {
/**
* The channel from which to collect interactions, if provided
* @type {?TextChannel|DMChannel|NewsChannel}
* @type {?(TextChannel|DMChannel|NewsChannel)}
*/
this.channel = this.message?.channel ?? options.channel ?? null;

View File

@@ -68,13 +68,13 @@ class Webhook {
/**
* The owner of the webhook
* @type {?User|APIUser}
* @type {?(User|APIUser)}
*/
this.owner = data.user ? this.client.users?.add(data.user) ?? data.user : null;
/**
* The source guild of the webhook
* @type {?Guild|APIGuild}
* @type {?(Guild|APIGuild)}
*/
this.sourceGuild = data.source_guild
? this.client.guilds?.add(data.source_guild, false) ?? data.source_guild
@@ -82,7 +82,7 @@ class Webhook {
/**
* The source channel of the webhook
* @type {?Channel|APIChannel}
* @type {?(Channel|APIChannel)}
*/
this.sourceChannel = this.client.channels?.resolve(data.source_channel?.id) ?? data.source_channel ?? null;
}

View File

@@ -42,7 +42,7 @@ class WelcomeChannel extends Base {
/**
* The channel of this welcome channel
* @type {?TextChannel|NewsChannel}
* @type {?(TextChannel|NewsChannel)}
*/
get channel() {
return this.client.channels.resolve(this.channelID);