Skip to content

Commit

Permalink
docs: add back static properties and methods (#7706)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored Mar 26, 2022
1 parent 6708533 commit 520f471
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/discord.js/src/structures/GuildAuditLogsEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class GuildAuditLogsEntry {
/**
* Key mirror of all available audit log targets.
* @type {Object<string, string>}
* @memberof GuildAuditLogsEntry
*/
static Targets = Targets;

Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/structures/GuildTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class GuildTemplate extends Base {
/**
* Regular expression that globally matches guild template links
* @type {RegExp}
* @memberof GuildTemplate
*/
static GuildTemplatesPattern = /discord(?:app)?\.(?:com\/template|new)\/([\w-]{2,255})/gi;

Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/structures/Invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Invite extends Base {
/**
* Regular expression that globally matches Discord invite links
* @type {RegExp}
* @memberof Invite
*/
static InvitesPattern = /discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/gi;

Expand Down
4 changes: 4 additions & 0 deletions packages/discord.js/src/structures/MessageMentions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@ class MessageMentions {
/**
* Regular expression that globally matches `@everyone` and `@here`
* @type {RegExp}
* @memberof MessageMentions
*/
static EveryonePattern = /@(everyone|here)/g;

/**
* Regular expression that globally matches user mentions like `<@81440962496172032>`
* @type {RegExp}
* @memberof MessageMentions
*/
static UsersPattern = /<@!?(\d{17,19})>/g;

/**
* Regular expression that globally matches role mentions like `<@&297577916114403338>`
* @type {RegExp}
* @memberof MessageMentions
*/
static RolesPattern = /<@&(\d{17,19})>/g;

/**
* Regular expression that globally matches channel mentions like `<#222079895583457280>`
* @type {RegExp}
* @memberof MessageMentions
*/
static ChannelsPattern = /<#(\d{17,19})>/g;

Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/util/ActivityFlagsBitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ActivityFlagsBitField extends BitField {
/**
* Numeric activity flags.
* @type {ActivityFlags}
* @memberof ActivityFlagsBitField
*/
static Flags = ActivityFlags;
}
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/util/ApplicationFlagsBitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ApplicationFlagsBitField extends BitField {
/**
* Numeric application flags. All available properties:
* @type {ApplicationFlags}
* @memberof ApplicationFlagsBitField
*/
static Flags = ApplicationFlags;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/discord.js/src/util/BitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ class BitField {
* Numeric bitfield flags.
* <info>Defined in extension classes</info>
* @type {Object}
* @memberof BitField
* @abstract
*/
static Flags = {};

/**
* @type {number|bigint}
* @memberof BitField
* @private
*/
static DefaultBit = 0;
Expand Down
19 changes: 19 additions & 0 deletions packages/discord.js/src/util/Formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Formatters extends null {
/**
* Formats the content into a block quote. This needs to be at the start of the line for Discord to format it.
* @method blockQuote
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -36,6 +37,7 @@ class Formatters extends null {
/**
* Formats the content into bold text.
* @method bold
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -44,6 +46,7 @@ class Formatters extends null {
/**
* Formats a channel id into a channel mention.
* @method channelMention
* @memberof Formatters
* @param {string} channelId The channel id to format.
* @returns {string}
*/
Expand All @@ -52,6 +55,7 @@ class Formatters extends null {
/**
* Wraps the content inside a code block with an optional language.
* @method codeBlock
* @memberof Formatters
* @param {string} contentOrLanguage The language to use, content if a second parameter isn't provided.
* @param {string} [content] The content to wrap.
* @returns {string}
Expand All @@ -61,6 +65,8 @@ class Formatters extends null {
/**
* Formats an emoji id into a fully qualified emoji identifier
* @method formatEmoji
* @memberof Formatters
* @memberof Formatters
* @param {string} emojiId The emoji id to format.
* @param {boolean} [animated] Whether the emoji is animated or not. Defaults to `false`
* @returns {string}
Expand All @@ -70,6 +76,7 @@ class Formatters extends null {
/**
* Wraps the URL into `<>`, which stops it from embedding.
* @method hideLinkEmbed
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -78,6 +85,7 @@ class Formatters extends null {
/**
* Formats the content and the URL into a masked URL with an optional title.
* @method hyperlink
* @memberof Formatters
* @param {string} content The content to display.
* @param {string} url The URL the content links to.
* @param {string} [title] The title shown when hovering on the masked link.
Expand All @@ -88,6 +96,7 @@ class Formatters extends null {
/**
* Wraps the content inside \`backticks\`, which formats it as inline code.
* @method inlineCode
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -96,6 +105,7 @@ class Formatters extends null {
/**
* Formats the content into italic text.
* @method italic
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -104,6 +114,7 @@ class Formatters extends null {
/**
* Formats a user id into a member-nickname mention.
* @method memberNicknameMention
* @memberof Formatters
* @param {string} memberId The user id to format.
* @returns {string}
*/
Expand All @@ -112,6 +123,7 @@ class Formatters extends null {
/**
* Formats the content into a quote. This needs to be at the start of the line for Discord to format it.
* @method quote
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -120,6 +132,7 @@ class Formatters extends null {
/**
* Formats a role id into a role mention.
* @method roleMention
* @memberof Formatters
* @param {string} roleId The role id to format.
* @returns {string}
*/
Expand All @@ -128,6 +141,7 @@ class Formatters extends null {
/**
* Formats the content into spoiler text.
* @method spoiler
* @memberof Formatters
* @param {string} content The content to spoiler.
* @returns {string}
*/
Expand All @@ -136,6 +150,7 @@ class Formatters extends null {
/**
* Formats the content into strike-through text.
* @method strikethrough
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -144,6 +159,7 @@ class Formatters extends null {
/**
* Formats a date into a short date-time string.
* @method time
* @memberof Formatters
* @param {number|Date} [date] The date to format.
* @param {TimestampStylesString} [style] The style to use.
* @returns {string}
Expand All @@ -167,12 +183,14 @@ class Formatters extends null {
* The message formatting timestamp
* [styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord.
* @type {Object<string, TimestampStylesString>}
* @memberof Formatters
*/
static TimestampStyles = TimestampStyles;

/**
* Formats the content into underscored text.
* @method underscore
* @memberof Formatters
* @param {string} content The content to wrap.
* @returns {string}
*/
Expand All @@ -181,6 +199,7 @@ class Formatters extends null {
/**
* Formats a user id into a user mention.
* @method userMention
* @memberof Formatters
* @param {string} userId The user id to format.
* @returns {string}
*/
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/util/IntentsBitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class IntentsBitField extends BitField {
/**
* Numeric WebSocket intents
* @type {GatewayIntentBits}
* @memberof IntentsBitField
*/
static Flags = GatewayIntentBits;
}
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/util/MessageFlagsBitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class MessageFlagsBitField extends BitField {
/**
* Numeric message flags.
* @type {MessageFlags}
* @memberof MessageFlagsBitField
*/
static Flags = MessageFlags;
}
Expand Down
9 changes: 9 additions & 0 deletions packages/discord.js/src/util/PermissionsBitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,38 @@ class PermissionsBitField extends BitField {
/**
* Numeric permission flags.
* @type {PermissionFlagsBits}
* @memberof PermissionsBitField
* @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
*/
static Flags = PermissionFlagsBits;

/**
* Bitfield representing every permission combined
* @type {bigint}
* @memberof PermissionsBitField
*/
static All = Object.values(PermissionFlagsBits).reduce((all, p) => all | p, 0n);

/**
* Bitfield representing the default permissions for users
* @type {bigint}
* @memberof PermissionsBitField
*/
static Default = BigInt(104324673);

/**
* Bitfield representing the permissions required for moderators of stage channels
* @type {bigint}
* @memberof PermissionsBitField
*/
static StageModerator =
PermissionFlagsBits.ManageChannels | PermissionFlagsBits.MuteMembers | PermissionFlagsBits.MoveMembers;

/**
* @type {bigint}
* @memberof PermissionsBitField
* @private
*/
static DefaultBit = BigInt(0);

/**
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/util/SystemChannelFlagsBitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SystemChannelFlagsBitField extends BitField {
/**
* Numeric system channel flags.
* @type {GuildSystemChannelFlags}
* @memberof SystemChannelFlagsBitField
*/
static Flags = GuildSystemChannelFlags;
}
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/util/ThreadMemberFlagsBitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ThreadMemberFlagsBitField extends BitField {
/**
* Numeric thread member flags. There are currently no bitflags relevant to bots for this.
* @type {Object<string, number>}
* @memberof ThreadMemberFlagsBitField
*/
static Flags = {};
}
Expand Down

0 comments on commit 520f471

Please sign in to comment.