| 9 | * Options for the {@link path} prompt. |
| 10 | */ |
| 11 | export interface PathOptions extends CommonOptions { |
| 12 | /** |
| 13 | * The message or question shown to the user above the input. |
| 14 | */ |
| 15 | message: string; |
| 16 | |
| 17 | /** |
| 18 | * The starting directory for path suggestions (defaults to current working directory). |
| 19 | */ |
| 20 | root?: string; |
| 21 | |
| 22 | /** |
| 23 | * When `true` only **directories** appear in suggestions while you navigate. |
| 24 | */ |
| 25 | directory?: boolean; |
| 26 | |
| 27 | /** |
| 28 | * The starting path shown when the prompt first renders, which users can edit |
| 29 | * before submitting. If not provided it will fall back to the given `root`, |
| 30 | * or the current working directory. |
| 31 | * |
| 32 | * In `directory` mode, if the initial value points to a directory that exists, |
| 33 | * pressing enter will submit the input instead of jumping to the first child. |
| 34 | */ |
| 35 | initialValue?: string; |
| 36 | |
| 37 | /** |
| 38 | * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema) |
| 39 | * that validates user input. If a custom function is given, you should return a `string` or `Error` |
| 40 | * to show as a validation error, or `undefined` to accept the result. |
| 41 | */ |
| 42 | validate?: Validate<string>; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * The `path` prompt extends `autocomplete` to provide file and directory suggestions. |
nothing calls this directly
no outgoing calls
no test coverage detected