mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
towards generic autocomplete
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user