Skip to content

Commit

Permalink
feat(prompt): Add JSDoc types
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Dec 10, 2020
1 parent 1840492 commit 0406568
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/prompt/index.js
Expand Up @@ -7,6 +7,11 @@ exports.confirm = confirm;
exports.select = select;
exports.input = input;

/**
* Prompt for confirmation
* @param {string} message
* @returns {Promise<boolean>}
*/
function confirm(message) {
log.pause();

Expand All @@ -30,6 +35,12 @@ function confirm(message) {
});
}

/**
* Prompt for selection
* @param {string} message
* @param {{ choices: import("inquirer").ListChoiceOptions[] } & Pick<import("inquirer").Question, 'filter' | 'validate'>} [options]
* @returns {Promise<string>}
*/
function select(message, { choices, filter, validate } = {}) {
log.pause();

Expand All @@ -52,6 +63,12 @@ function select(message, { choices, filter, validate } = {}) {
});
}

/**
* Prompt for input
* @param {string} message
* @param {Pick<import("inquirer").Question, 'filter' | 'validate'>} [options]
* @returns {Promise<string>}
*/
function input(message, { filter, validate } = {}) {
log.pause();

Expand Down

0 comments on commit 0406568

Please sign in to comment.