types(AutocompleteOption): backport fix and improve types (#8078)

This commit is contained in:
Rodry
2022-06-13 19:03:39 +01:00
committed by GitHub
parent 3095f350e0
commit 613fd43fcf
2 changed files with 24 additions and 3 deletions

View File

@@ -240,10 +240,19 @@ class CommandInteractionOptionResolver {
return option?.message ?? null;
}
/**
* The full autocomplete option object.
* @typedef {Object} AutocompleteFocusedOption
* @property {string} name The name of the option
* @property {ApplicationCommandOptionType} type The type of the application command option
* @property {string} value The value of the option
* @property {boolean} focused Whether this option is currently in focus for autocomplete
*/
/**
* Gets the focused option.
* @param {boolean} [getFull=false] Whether to get the full option object
* @returns {string|number|ApplicationCommandOptionChoice}
* @returns {string|AutocompleteFocusedOption}
* The value of the option, or the whole option if getFull is true
*/
getFocused(getFull = false) {