mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
docs: Remove JSONEncondable (#9344)
docs: remove `JSONEncondable` Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -66,12 +66,10 @@ class ApplicationCommandManager extends CachedManager {
|
|||||||
* @typedef {ApplicationCommand|Snowflake} ApplicationCommandResolvable
|
* @typedef {ApplicationCommand|Snowflake} ApplicationCommandResolvable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
|
||||||
/**
|
/**
|
||||||
* Data that resolves to the data of an ApplicationCommand
|
* Data that resolves to the data of an ApplicationCommand
|
||||||
* @typedef {ApplicationCommandData|APIApplicationCommand|JSONEncodable<APIApplicationCommand>} ApplicationCommandDataResolvable
|
* @typedef {ApplicationCommandData|APIApplicationCommand} ApplicationCommandDataResolvable
|
||||||
*/
|
*/
|
||||||
/* eslint-enable max-len */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options used to fetch data from Discord
|
* Options used to fetch data from Discord
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class GuildStickerManager extends CachedManager {
|
|||||||
/**
|
/**
|
||||||
* Options used to create a guild sticker.
|
* Options used to create a guild sticker.
|
||||||
* @typedef {Object} GuildStickerCreateOptions
|
* @typedef {Object} GuildStickerCreateOptions
|
||||||
* @property {BufferResolvable|Stream|JSONEncodable<AttachmentPayload>} file The file for the sticker
|
* @property {AttachmentPayload|BufferResolvable|Stream} file The file for the sticker
|
||||||
* @property {string} name The name for the sticker
|
* @property {string} name The name for the sticker
|
||||||
* @property {string} tags The Discord name of a unicode emoji representing the sticker's expression
|
* @property {string} tags The Discord name of a unicode emoji representing the sticker's expression
|
||||||
* @property {?string} [description] The description for the sticker
|
* @property {?string} [description] The description for the sticker
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class MessageManager extends CachedManager {
|
|||||||
/**
|
/**
|
||||||
* Options that can be passed to edit a message.
|
* Options that can be passed to edit a message.
|
||||||
* @typedef {BaseMessageOptions} MessageEditOptions
|
* @typedef {BaseMessageOptions} MessageEditOptions
|
||||||
* @property {Array<JSONEncodable<AttachmentPayload>>} [attachments] An array of attachments to keep,
|
* @property {AttachmentPayload[]} [attachments] An array of attachments to keep,
|
||||||
* all attachments will be kept if omitted
|
* all attachments will be kept if omitted
|
||||||
* @property {MessageFlags} [flags] Which flags to set for the message
|
* @property {MessageFlags} [flags] Which flags to set for the message
|
||||||
* <info>Only the {@link MessageFlags.SuppressEmbeds} flag can be modified.</info>
|
* <info>Only the {@link MessageFlags.SuppressEmbeds} flag can be modified.</info>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class ActionRow extends Component {
|
|||||||
* Creates a new action row builder from JSON data
|
* Creates a new action row builder from JSON data
|
||||||
* @method from
|
* @method from
|
||||||
* @memberof ActionRow
|
* @memberof ActionRow
|
||||||
* @param {JSONEncodable<APIActionRowComponent>|APIActionRowComponent} other The other data
|
* @param {ActionRowBuilder|ActionRow|APIActionRowComponent} other The other data
|
||||||
* @returns {ActionRowBuilder}
|
* @returns {ActionRowBuilder}
|
||||||
* @deprecated Use {@link ActionRowBuilder.from} instead.
|
* @deprecated Use {@link ActionRowBuilder.from} instead.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,15 +18,11 @@ class ActionRowBuilder extends BuildersActionRow {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new action row builder from JSON data
|
* Creates a new action row builder from JSON data
|
||||||
* @param {JSONEncodable<APIActionRowComponent<APIActionRowComponentTypes>>
|
* @param {ActionRow|ActionRowBuilder|APIActionRowComponent} other The other data
|
||||||
* |APIActionRowComponent<APIActionRowComponentTypes>} other The other data
|
|
||||||
* @returns {ActionRowBuilder}
|
* @returns {ActionRowBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class AttachmentBuilder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes a new builder instance from a preexisting attachment structure.
|
* Makes a new builder instance from a preexisting attachment structure.
|
||||||
* @param {JSONEncodable<AttachmentPayload>} other The builder to construct a new instance from
|
* @param {AttachmentBuilder|Attachment|AttachmentPayload} other The builder to construct a new instance from
|
||||||
* @returns {AttachmentBuilder}
|
* @returns {AttachmentBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
|
|||||||
@@ -27,14 +27,11 @@ class ButtonBuilder extends BuildersButton {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new button builder from JSON data
|
* Creates a new button builder from JSON data
|
||||||
* @param {JSONEncodable<APIButtonComponent>|APIButtonComponent} other The other data
|
* @param {ButtonBuilder|ButtonComponent|APIButtonComponent} other The other data
|
||||||
* @returns {ButtonBuilder}
|
* @returns {ButtonBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,12 @@ class ChannelSelectMenuBuilder extends BuildersChannelSelectMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new select menu builder from json data
|
* Creates a new select menu builder from JSON data
|
||||||
* @param {JSONEncodable<APISelectMenuComponent> | APISelectMenuComponent} other The other data
|
* @param {ChannelSelectMenuBuilder|ChannelSelectMenuComponent|APIChannelSelectComponent} other The other data
|
||||||
* @returns {ChannelSelectMenuBuilder}
|
* @returns {ChannelSelectMenuBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,14 +24,11 @@ class EmbedBuilder extends BuildersEmbed {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new embed builder from JSON data
|
* Creates a new embed builder from JSON data
|
||||||
* @param {JSONEncodable<APIEmbed>|APIEmbed} other The other data
|
* @param {EmbedBuilder|Embed|APIEmbed} other The other data
|
||||||
* @returns {EmbedBuilder}
|
* @returns {EmbedBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,13 @@ class MentionableSelectMenuBuilder extends BuildersMentionableSelectMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new select menu builder from json data
|
* Creates a new select menu builder from JSON data
|
||||||
* @param {JSONEncodable<APISelectMenuComponent> | APISelectMenuComponent} other The other data
|
* @param {MentionableSelectMenuBuilder|MentionableSelectMenuComponent|APIMentionableSelectComponent} other
|
||||||
|
* The other data
|
||||||
* @returns {MentionableSelectMenuBuilder}
|
* @returns {MentionableSelectMenuBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -227,8 +227,7 @@ class MessagePayload {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves a single file into an object sendable to the API.
|
* Resolves a single file into an object sendable to the API.
|
||||||
* @param {BufferResolvable|Stream|JSONEncodable<AttachmentPayload>} fileLike Something that could
|
* @param {AttachmentPayload|BufferResolvable|Stream} fileLike Something that could be resolved to a file
|
||||||
* be resolved to a file
|
|
||||||
* @returns {Promise<RawFile>}
|
* @returns {Promise<RawFile>}
|
||||||
*/
|
*/
|
||||||
static async resolveFile(fileLike) {
|
static async resolveFile(fileLike) {
|
||||||
|
|||||||
@@ -17,14 +17,11 @@ class ModalBuilder extends BuildersModal {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new modal builder from JSON data
|
* Creates a new modal builder from JSON data
|
||||||
* @param {JSONEncodable<APIModalComponent>|APIModalComponent} other The other data
|
* @param {ModalBuilder|APIModalComponent} other The other data
|
||||||
* @returns {ModalBuilder}
|
* @returns {ModalBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,12 @@ class RoleSelectMenuBuilder extends BuildersRoleSelectMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new select menu builder from json data
|
* Creates a new select menu builder from JSON data
|
||||||
* @param {JSONEncodable<APISelectMenuComponent> | APISelectMenuComponent} other The other data
|
* @param {RoleSelectMenuBuilder|RoleSelectMenuComponent|APIRoleSelectComponent} other The other data
|
||||||
* @returns {RoleSelectMenuBuilder}
|
* @returns {RoleSelectMenuBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class StringSelectMenuBuilder extends BuildersSelectMenu {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Normalizes a select menu option emoji
|
* Normalizes a select menu option emoji
|
||||||
* @param {SelectMenuOptionData|JSONEncodable<APISelectMenuOption>} selectMenuOption The option to normalize
|
* @param {SelectMenuOptionData|APISelectMenuOption} selectMenuOption The option to normalize
|
||||||
* @returns {SelectMenuOptionBuilder|APISelectMenuOption}
|
* @returns {SelectMenuOptionBuilder|APISelectMenuOption}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -59,7 +59,7 @@ class StringSelectMenuBuilder extends BuildersSelectMenu {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new select menu builder from json data
|
* Creates a new select menu builder from json data
|
||||||
* @param {JSONEncodable<APISelectMenuComponent> | APISelectMenuComponent} other The other data
|
* @param {StringSelectMenuBuilder|StringSelectMenuComponent|APIStringSelectComponent} other The other data
|
||||||
* @returns {StringSelectMenuBuilder}
|
* @returns {StringSelectMenuBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
|
|||||||
@@ -32,14 +32,11 @@ class StringSelectMenuOptionBuilder extends BuildersSelectMenuOption {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new select menu option builder from JSON data
|
* Creates a new select menu option builder from JSON data
|
||||||
* @param {JSONEncodable<APISelectMenuOption>|APISelectMenuOption} other The other data
|
* @param {StringSelectMenuOptionBuilder|APISelectMenuOption} other The other data
|
||||||
* @returns {StringSelectMenuOptionBuilder}
|
* @returns {StringSelectMenuOptionBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,11 @@ class TextInputBuilder extends BuildersTextInput {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new text input builder from JSON data
|
* Creates a new text input builder from JSON data
|
||||||
* @param {JSONEncodable<APITextInputComponent>|APITextInputComponent} other The other data
|
* @param {TextInputBuilder|TextInputComponent|APITextInputComponent} other The other data
|
||||||
* @returns {TextInputBuilder}
|
* @returns {TextInputBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,12 @@ class UserSelectMenuBuilder extends BuildersUserSelectMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new select menu builder from json data
|
* Creates a new select menu builder from JSON data
|
||||||
* @param {JSONEncodable<APISelectMenuComponent> | APISelectMenuComponent} other The other data
|
* @param {UserSelectMenuBuilder|UserSelectMenuComponent|APIUserSelectComponent} other The other data
|
||||||
* @returns {UserSelectMenuBuilder}
|
* @returns {UserSelectMenuBuilder}
|
||||||
*/
|
*/
|
||||||
static from(other) {
|
static from(other) {
|
||||||
if (isJSONEncodable(other)) {
|
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
||||||
return new this(other.toJSON());
|
|
||||||
}
|
|
||||||
return new this(other);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class TextBasedChannel {
|
|||||||
* @property {Embed[]|APIEmbed[]} [embeds] The embeds for the message
|
* @property {Embed[]|APIEmbed[]} [embeds] The embeds for the message
|
||||||
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
|
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
|
||||||
* (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details)
|
* (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details)
|
||||||
* @property {Array<JSONEncodable<AttachmentPayload>>|BufferResolvable[]|Attachment[]|AttachmentBuilder[]} [files]
|
* @property {AttachmentBuilder[]|Attachment[]|AttachmentPayload[]|BufferResolvable[]} [files]
|
||||||
* The files to send with the message.
|
* The files to send with the message.
|
||||||
* @property {ActionRow[]|ActionRowBuilder[]} [components]
|
* @property {ActionRow[]|ActionRowBuilder[]} [components]
|
||||||
* Action rows containing interactive components for the message (buttons, select menus)
|
* Action rows containing interactive components for the message (buttons, select menus)
|
||||||
|
|||||||
@@ -43,6 +43,11 @@
|
|||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIChannel}
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIChannel}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @external APIChannelSelectComponent
|
||||||
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIChannelSelectComponent}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @external APIEmbed
|
* @external APIEmbed
|
||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIEmbed}
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIEmbed}
|
||||||
@@ -98,6 +103,11 @@
|
|||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIInteractionGuildMember}
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIInteractionGuildMember}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @external APIMentionableSelectComponent
|
||||||
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIMentionableSelectComponent}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @external APIMessage
|
* @external APIMessage
|
||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIMessage}
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIMessage}
|
||||||
@@ -139,13 +149,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @external APISelectMenuComponent
|
* @external APISelectMenuOption
|
||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APISelectMenuComponent}
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APISelectMenuOption}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @external APISelectMenuOption
|
* @external APIStringSelectComponent
|
||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APISelectMenuOption}
|
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIStringSelectComponent}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -150,8 +150,3 @@ const TextInputBuilder = require('../structures/TextInputBuilder');
|
|||||||
const TextInputComponent = require('../structures/TextInputComponent');
|
const TextInputComponent = require('../structures/TextInputComponent');
|
||||||
const UserSelectMenuBuilder = require('../structures/UserSelectMenuBuilder');
|
const UserSelectMenuBuilder = require('../structures/UserSelectMenuBuilder');
|
||||||
const UserSelectMenuComponent = require('../structures/UserSelectMenuComponent');
|
const UserSelectMenuComponent = require('../structures/UserSelectMenuComponent');
|
||||||
|
|
||||||
/**
|
|
||||||
* @external JSONEncodable
|
|
||||||
* @see {@link https://discord.js.org/docs/packages/util/main/JSONEncodable:Interface}
|
|
||||||
*/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user