[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

Exports `Option` type (#229)

authored by

Nate Moore and committed by
GitHub
(Jan 8, 2025, 10:09 PM -0600) 98925e3f 1904e57d

+42 -3
+5
.changeset/orange-olives-yell.md
··· 1 + --- 2 + "@clack/prompts": patch 3 + --- 4 + 5 + Exports the `Option` type and improves JSDocannotations
+37 -3
packages/prompts/src/index.ts
··· 209 209 210 210 type Primitive = Readonly<string | boolean | number>; 211 211 212 - type Option<Value> = Value extends Primitive 213 - ? { value: Value; label?: string; hint?: string } 214 - : { value: Value; label: string; hint?: string }; 212 + export type Option<Value> = Value extends Primitive 213 + ? { 214 + /** 215 + * Internal data for this option. 216 + */ 217 + value: Value; 218 + /** 219 + * The optional, user-facing text for this option. 220 + * 221 + * By default, the `value` is converted to a string. 222 + */ 223 + label?: string; 224 + /** 225 + * An optional hint to display to the user when 226 + * this option might be selected. 227 + * 228 + * By default, no `hint` is displayed. 229 + */ 230 + hint?: string; 231 + } 232 + : { 233 + /** 234 + * Internal data for this option. 235 + */ 236 + value: Value; 237 + /** 238 + * Required. The user-facing text for this option. 239 + */ 240 + label: string; 241 + /** 242 + * An optional hint to display to the user when 243 + * this option might be selected. 244 + * 245 + * By default, no `hint` is displayed. 246 + */ 247 + hint?: string; 248 + }; 215 249 216 250 export interface SelectOptions<Value> { 217 251 message: string;