"use strict";
/**
 * penguins-eggs
 * lib: select_keyboard_model.ts
 * author: Piero Proietti
 * email: piero.proietti@gmail.com
 * license: MIT
 */
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const inquirer = require('inquirer');
const keyboards_1 = tslib_1.__importDefault(require("../classes/keyboards"));
/**
  *
  */
async function selectKeyboardModel(selected = '') {
    const keyboards = new keyboards_1.default();
    const models = keyboards.getModels();
    const supported = [];
    for (const m of models) {
        supported.push(m.code);
    }
    const questions = [
        {
            type: 'list',
            name: 'model',
            message: 'Select model: ',
            choices: supported,
            default: selected,
        },
    ];
    return new Promise(function (resolve) {
        inquirer.prompt(questions).then(function (options) {
            resolve(options.model);
        });
    });
}
exports.default = selectKeyboardModel;
