towards generic autocomplete

This commit is contained in:
LenAnderson
2024-04-25 18:31:14 -04:00
parent e531da615e
commit d220f3e6f9
8 changed files with 253 additions and 287 deletions

View File

@ -0,0 +1,30 @@
import { SlashCommand } from './SlashCommand.js';
import { SlashCommandAutoCompleteOption } from './SlashCommandAutoCompleteOption.js';
export class SlashCommandCommandAutoCompleteOption extends SlashCommandAutoCompleteOption {
/**@type {SlashCommand} */
get cmd() {
// @ts-ignore
return this.value;
}
/**
* @param {SlashCommand} value
* @param {string} name
*/
constructor(value, name) {
super(value, name);
}
renderItem() {
let li;
li = this.cmd.renderHelpItem(this.name);
li.setAttribute('data-name', this.name);
return li;
}
renderDetails() {
return this.cmd.renderHelpDetails(this.name);
}
}