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

@ -11,6 +11,8 @@ export class AutoCompleteOption {
/**@type {AutoCompleteFuzzyScore}*/ score;
/**@type {string}*/ replacer;
/**@type {HTMLElement}*/ dom;
/**@type {(input:string)=>boolean}*/ matchProvider;
/**@type {(input:string)=>string}*/ valueProvider;
/**
@ -25,10 +27,12 @@ export class AutoCompleteOption {
/**
* @param {string} name
*/
constructor(name, typeIcon = ' ', type = '') {
constructor(name, typeIcon = ' ', type = '', matchProvider = null, valueProvider = null) {
this.name = name;
this.typeIcon = typeIcon;
this.type = type;
this.matchProvider = matchProvider;
this.valueProvider = valueProvider;
}