File tree Expand file tree Collapse file tree 2 files changed +42
-3
lines changed Expand file tree Collapse file tree 2 files changed +42
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @clack/prompts " : patch
3
+ ---
4
+
5
+ Exports the ` Option ` type and improves JSDocannotations
Original file line number Diff line number Diff line change @@ -209,9 +209,43 @@ export const confirm = (opts: ConfirmOptions) => {
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 ;
You can’t perform that action at this time.
0 commit comments