mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	add matchProvider and valueProvider to autocomplete options
This commit is contained in:
		| @@ -13,7 +13,7 @@ export class SlashCommandEnumAutoCompleteOption extends AutoCompleteOption { | ||||
|      * @param {SlashCommandEnumValue} enumValue | ||||
|      */ | ||||
|     constructor(cmd, enumValue) { | ||||
|         super(enumValue.value, enumValue.typeIcon, enumValue.type); | ||||
|         super(enumValue.value, enumValue.typeIcon, enumValue.type, enumValue.matchProvider, enumValue.valueProvider); | ||||
|         this.cmd = cmd; | ||||
|         this.enumValue = enumValue; | ||||
|     } | ||||
|   | ||||
| @@ -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() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user