Closed DamianGlowala closed 1 year ago
It would be great to be able to pass an optional generic for select and multiselect prompts to narrow down what type the options might be, e.g.:
type PackageManager = 'npm' | 'pnpm' | 'yarn'
await consola.prompt<PackageManager>(...)
giving us a more precise return type: Promise<PackageManager>
(select) or Promise<PackageManager[]>
(multiselect)
It would be great to be able to pass an optional generic for select and multiselect prompts to narrow down what type the options might be, e.g.:
This is why we have two reserved positional generics. PR welcome to add 👍🏼
Codecov Report
62.98% <0.00%> (-0.16%)