| 47 | } |
| 48 | |
| 49 | export interface AutocompleteOptions<T extends OptionLike> |
| 50 | extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> { |
| 51 | options: T[] | ((this: AutocompletePrompt<T>) => T[]); |
| 52 | filter?: FilterFunction<T>; |
| 53 | multiple?: boolean; |
| 54 | /** |
| 55 | * When set (non-empty), pressing Tab with no input fills the field with this value |
| 56 | * and runs the normal filter/selection logic so the user can confirm with Enter. |
| 57 | * Tab only fills the input when the placeholder matches at least one option under |
| 58 | * the prompt's filter (so the value remains selectable). |
| 59 | */ |
| 60 | placeholder?: string; |
| 61 | } |
| 62 | |
| 63 | export default class AutocompletePrompt<T extends OptionLike> extends Prompt< |
| 64 | T['value'] | T['value'][] |
nothing calls this directly
no outgoing calls
no test coverage detected