add matchProvider and valueProvider to autocomplete options

This commit is contained in:
LenAnderson
2024-06-20 09:12:43 -04:00
parent 6ff1d6a9b0
commit 996268e6b3
4 changed files with 23 additions and 6 deletions

View File

@ -1,14 +1,21 @@
import { SlashCommandExecutor } from './SlashCommandExecutor.js';
import { SlashCommandScope } from './SlashCommandScope.js';
export class SlashCommandEnumValue {
/**@type {string}*/ value;
/**@type {string}*/ description;
/**@type {string}*/ type = 'enum';
/**@type {string}*/ typeIcon = '◊';
/**@type {(input:string)=>boolean}*/ matchProvider;
/**@type {(input:string)=>string}*/ valueProvider;
constructor(value, description = null, type = 'enum', typeIcon = '◊') {
constructor(value, description = null, type = 'enum', typeIcon = '◊', matchProvider, valueProvider) {
this.value = value;
this.description = description;
this.type = type;
this.typeIcon = typeIcon;
this.matchProvider = matchProvider;
this.valueProvider = valueProvider;
}
toString() {