docs: add back static properties and methods (#7706)

This commit is contained in:
Jiralite
2022-03-26 12:55:53 +00:00
committed by GitHub
parent 6708533376
commit 520f471ac5
13 changed files with 43 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ class GuildAuditLogsEntry {
/** /**
* Key mirror of all available audit log targets. * Key mirror of all available audit log targets.
* @type {Object<string, string>} * @type {Object<string, string>}
* @memberof GuildAuditLogsEntry
*/ */
static Targets = Targets; static Targets = Targets;

View File

@@ -14,6 +14,7 @@ class GuildTemplate extends Base {
/** /**
* Regular expression that globally matches guild template links * Regular expression that globally matches guild template links
* @type {RegExp} * @type {RegExp}
* @memberof GuildTemplate
*/ */
static GuildTemplatesPattern = /discord(?:app)?\.(?:com\/template|new)\/([\w-]{2,255})/gi; static GuildTemplatesPattern = /discord(?:app)?\.(?:com\/template|new)\/([\w-]{2,255})/gi;

View File

@@ -15,6 +15,7 @@ class Invite extends Base {
/** /**
* Regular expression that globally matches Discord invite links * Regular expression that globally matches Discord invite links
* @type {RegExp} * @type {RegExp}
* @memberof Invite
*/ */
static InvitesPattern = /discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/gi; static InvitesPattern = /discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/gi;

View File

@@ -10,24 +10,28 @@ class MessageMentions {
/** /**
* Regular expression that globally matches `@everyone` and `@here` * Regular expression that globally matches `@everyone` and `@here`
* @type {RegExp} * @type {RegExp}
* @memberof MessageMentions
*/ */
static EveryonePattern = /@(everyone|here)/g; static EveryonePattern = /@(everyone|here)/g;
/** /**
* Regular expression that globally matches user mentions like `<@81440962496172032>` * Regular expression that globally matches user mentions like `<@81440962496172032>`
* @type {RegExp} * @type {RegExp}
* @memberof MessageMentions
*/ */
static UsersPattern = /<@!?(\d{17,19})>/g; static UsersPattern = /<@!?(\d{17,19})>/g;
/** /**
* Regular expression that globally matches role mentions like `<@&297577916114403338>` * Regular expression that globally matches role mentions like `<@&297577916114403338>`
* @type {RegExp} * @type {RegExp}
* @memberof MessageMentions
*/ */
static RolesPattern = /<@&(\d{17,19})>/g; static RolesPattern = /<@&(\d{17,19})>/g;
/** /**
* Regular expression that globally matches channel mentions like `<#222079895583457280>` * Regular expression that globally matches channel mentions like `<#222079895583457280>`
* @type {RegExp} * @type {RegExp}
* @memberof MessageMentions
*/ */
static ChannelsPattern = /<#(\d{17,19})>/g; static ChannelsPattern = /<#(\d{17,19})>/g;

View File

@@ -11,6 +11,7 @@ class ActivityFlagsBitField extends BitField {
/** /**
* Numeric activity flags. * Numeric activity flags.
* @type {ActivityFlags} * @type {ActivityFlags}
* @memberof ActivityFlagsBitField
*/ */
static Flags = ActivityFlags; static Flags = ActivityFlags;
} }

View File

@@ -11,6 +11,7 @@ class ApplicationFlagsBitField extends BitField {
/** /**
* Numeric application flags. All available properties: * Numeric application flags. All available properties:
* @type {ApplicationFlags} * @type {ApplicationFlags}
* @memberof ApplicationFlagsBitField
*/ */
static Flags = ApplicationFlags; static Flags = ApplicationFlags;
} }

View File

@@ -10,12 +10,14 @@ class BitField {
* Numeric bitfield flags. * Numeric bitfield flags.
* <info>Defined in extension classes</info> * <info>Defined in extension classes</info>
* @type {Object} * @type {Object}
* @memberof BitField
* @abstract * @abstract
*/ */
static Flags = {}; static Flags = {};
/** /**
* @type {number|bigint} * @type {number|bigint}
* @memberof BitField
* @private * @private
*/ */
static DefaultBit = 0; static DefaultBit = 0;

View File

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

View File

@@ -10,6 +10,7 @@ class IntentsBitField extends BitField {
/** /**
* Numeric WebSocket intents * Numeric WebSocket intents
* @type {GatewayIntentBits} * @type {GatewayIntentBits}
* @memberof IntentsBitField
*/ */
static Flags = GatewayIntentBits; static Flags = GatewayIntentBits;
} }

View File

@@ -11,6 +11,7 @@ class MessageFlagsBitField extends BitField {
/** /**
* Numeric message flags. * Numeric message flags.
* @type {MessageFlags} * @type {MessageFlags}
* @memberof MessageFlagsBitField
*/ */
static Flags = MessageFlags; static Flags = MessageFlags;
} }

View File

@@ -13,6 +13,7 @@ class PermissionsBitField extends BitField {
/** /**
* Numeric permission flags. * Numeric permission flags.
* @type {PermissionFlagsBits} * @type {PermissionFlagsBits}
* @memberof PermissionsBitField
* @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags} * @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
*/ */
static Flags = PermissionFlagsBits; static Flags = PermissionFlagsBits;
@@ -20,22 +21,30 @@ class PermissionsBitField extends BitField {
/** /**
* Bitfield representing every permission combined * Bitfield representing every permission combined
* @type {bigint} * @type {bigint}
* @memberof PermissionsBitField
*/ */
static All = Object.values(PermissionFlagsBits).reduce((all, p) => all | p, 0n); static All = Object.values(PermissionFlagsBits).reduce((all, p) => all | p, 0n);
/** /**
* Bitfield representing the default permissions for users * Bitfield representing the default permissions for users
* @type {bigint} * @type {bigint}
* @memberof PermissionsBitField
*/ */
static Default = BigInt(104324673); static Default = BigInt(104324673);
/** /**
* Bitfield representing the permissions required for moderators of stage channels * Bitfield representing the permissions required for moderators of stage channels
* @type {bigint} * @type {bigint}
* @memberof PermissionsBitField
*/ */
static StageModerator = static StageModerator =
PermissionFlagsBits.ManageChannels | PermissionFlagsBits.MuteMembers | PermissionFlagsBits.MoveMembers; PermissionFlagsBits.ManageChannels | PermissionFlagsBits.MuteMembers | PermissionFlagsBits.MoveMembers;
/**
* @type {bigint}
* @memberof PermissionsBitField
* @private
*/
static DefaultBit = BigInt(0); static DefaultBit = BigInt(0);
/** /**

View File

@@ -13,6 +13,7 @@ class SystemChannelFlagsBitField extends BitField {
/** /**
* Numeric system channel flags. * Numeric system channel flags.
* @type {GuildSystemChannelFlags} * @type {GuildSystemChannelFlags}
* @memberof SystemChannelFlagsBitField
*/ */
static Flags = GuildSystemChannelFlags; static Flags = GuildSystemChannelFlags;
} }

View File

@@ -10,6 +10,7 @@ class ThreadMemberFlagsBitField extends BitField {
/** /**
* Numeric thread member flags. There are currently no bitflags relevant to bots for this. * Numeric thread member flags. There are currently no bitflags relevant to bots for this.
* @type {Object<string, number>} * @type {Object<string, number>}
* @memberof ThreadMemberFlagsBitField
*/ */
static Flags = {}; static Flags = {};
} }