MCPcopy
hub / github.com/bombshell-dev/clack / AutocompleteSharedOptions

Interface AutocompleteSharedOptions

packages/prompts/src/autocomplete.ts:48–84  ·  view source on GitHub ↗

* Options for the autocomplete prompt.

Source from the content-addressed store, hash-verified

46 * Options for the {@link autocomplete} prompt.
47 */
48interface AutocompleteSharedOptions<Value> extends CommonOptions {
49 /**
50 * The message or question shown to the user above the input.
51 */
52 message: string;
53
54 /**
55 * The options to present, or a function that returns the options to present
56 * allowing for custom search/filtering.
57 *
58 * @see https://bomb.sh/docs/clack/packages/prompts/#dynamic-options-getter
59 */
60 options: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);
61
62 /**
63 * The maximum number of items/options to display in the autocomplete list at once.
64 */
65 maxItems?: number;
66
67 /**
68 * Placeholder text displayed when the search field is empty. When set, pressing
69 * tab copies the placeholder into the input.
70 */
71 placeholder?: string;
72
73 /**
74 * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
75 * that validates user input. If a custom function is given, you should return a `string` or `Error`
76 * to show as a validation error, or `undefined` to accept the result.
77 */
78 validate?: Validate<Value | Value[]>;
79
80 /**
81 * Custom filter function to match options against the search input.
82 */
83 filter?: (search: string, option: Option<Value>) => boolean;
84}
85
86export interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {
87 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected