typings(MessageEmebd): fix typings for addFields (#3821)

* typings(MessageEmebd): fix typings for addFields

* fix: add missing semicolon

* docs(MessageEmbed): fix various types

* in accordance with the scope of the PR

* Update src/structures/MessageEmbed.js

Co-Authored-By: SpaceEEC <spaceeec@yahoo.com>

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
Souji
2020-02-24 14:02:06 +01:00
committed by GitHub
parent 967b533e9d
commit 54f24d1fea
2 changed files with 20 additions and 7 deletions

View File

@@ -216,7 +216,7 @@ class MessageEmbed {
/**
* Adds a fields to the embed (max 25).
* @param {...EmbedField|EmbedField[]} fields The fields to add
* @param {...EmbedFieldData|EmbedFieldData[]} fields The fields to add
* @returns {MessageEmbed}
*/
addFields(...fields) {
@@ -228,7 +228,7 @@ class MessageEmbed {
* Removes, replaces, and inserts fields in the embed (max 25).
* @param {number} index The index to start at
* @param {number} deleteCount The number of fields to remove
* @param {...EmbedField|EmbedField[]} [fields] The replacing field objects
* @param {...EmbedFieldData|EmbedFieldData[]} [fields] The replacing field objects
* @returns {MessageEmbed}
*/
spliceFields(index, deleteCount, ...fields) {
@@ -386,9 +386,16 @@ class MessageEmbed {
return { name, value, inline };
}
/**
* @typedef {Object} EmbedFieldData
* @property {StringResolvable} name The name of this field
* @property {StringResolvable} value The value of this field
* @property {boolean} [inline] If this field will be displayed inline
*/
/**
* Check for valid field input and resolves strings
* @param {...EmbedField|EmbedField[]} fields Fields to normalize
* @param {...EmbedFieldData|EmbedFieldData[]} fields Fields to normalize
* @returns {EmbedField[]}
*/
static normalizeFields(...fields) {