(options: SelectOptions<A>)
| 1299 | * @since 4.0.0 |
| 1300 | */ |
| 1301 | export const Select = <const A>(options: SelectOptions<A>): Prompt<A> => { |
| 1302 | const opts: SelectOptionsReq<A> = { |
| 1303 | maxPerPage: 10, |
| 1304 | ...options |
| 1305 | } |
| 1306 | const initialIndex = getSelectInitialIndex(opts.choices) |
| 1307 | return Custom(initialIndex, { |
| 1308 | render: handleSelectRender(opts), |
| 1309 | process: handleSelectProcess(opts), |
| 1310 | clear: handleSelectClear(opts) |
| 1311 | }) |
| 1312 | } |
| 1313 | |
| 1314 | /** |
| 1315 | * Creates a prompt that lets users filter select choices by typing. |
no test coverage detected