Added Question.pageSize and enhancing Question.validate in Inquirer (#16160)

* Added pageSize to the Question interface in Inquirer

* Added answers to Question.validate() in Inquirer
This commit is contained in:
Anthony Rosequist
2017-04-27 11:53:33 -05:00
committed by Sheetal Nandi
parent 54017f4f76
commit fc63d5f5cc

View File

@@ -94,7 +94,7 @@ declare namespace inquirer {
* Receive the user input and should return true if the value is valid, and an error message (String)
* otherwise. If false is returned, a default error message is provided.
*/
validate?(input: string): boolean | string;
validate?(input: string, answers?: Answers): boolean | string;
/**
* Receive the user input and return the filtered value to be used inside the program.
* The value returned will be added to the Answers hash.
@@ -106,6 +106,10 @@ declare namespace inquirer {
*/
when?: boolean | ((answers: Answers) => boolean);
paginated?: boolean;
/**
* Change the number of lines that will be rendered when using list, rawList, expand or checkbox.
*/
pageSize?: number;
}
/**