mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
[improve] Add falsy type to skip the question
This commit is contained in:
Vendored
+3
-1
@@ -57,7 +57,7 @@ declare namespace prompts {
|
||||
}
|
||||
|
||||
interface PromptObject<T extends string = string> {
|
||||
type: ValueOrFunc<string>;
|
||||
type: ValueOrFunc<string> | Falsy;
|
||||
name: ValueOrFunc<T>;
|
||||
message?: ValueOrFunc<string>;
|
||||
initial?: string | number | boolean;
|
||||
@@ -86,6 +86,8 @@ declare namespace prompts {
|
||||
values: Answers<T>,
|
||||
prompt: PromptObject
|
||||
) => R;
|
||||
|
||||
type Falsy = false | null | undefined;
|
||||
|
||||
type ValueOrFunc<T extends string> = T | PrevCaller<T>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user