"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MockUi = void 0;
const tslib_1 = require("tslib");
class MockUi {
    constructor() {
        this.values = {};
        this.responses = {};
    }
    setValue(id, value) {
        this.values[id] = value;
    }
    getValue(id) {
        return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
            try {
                let response;
                if (this.values[id]) {
                    response = this.values[id];
                }
                else {
                    throw new Error(`MockTenCon unable to respond: No mock value was provided for prompt: [${id}].  Use MockTenCon.setValue() to provide a value.`);
                }
                this.responses[id] = response;
                resolve(response);
            }
            catch (err) {
                this.responses[id] = err;
                reject(err);
            }
        }));
    }
    userMessage(message) {
        console.log(message);
    }
    prompt(id, prompt, required, defaultValue) {
        return this.getValue(id);
    }
    promptPassword(id, prompt) {
        return this.getValue(id);
    }
    promptConfirm(id, prompt, defaultValue) {
        return this.getValue(id);
    }
    promptSelect(id, prompt, choices, multiSelect) {
        return this.getValue(id);
    }
    promptSelectFile(id, prompt, fileOptions) {
        return this.getValue(id);
    }
    promptSelectFolder(id, prompt, folderOptions) {
        return this.getValue(id);
    }
    // IOutputStyler members
    bold(content) {
        return content;
    }
    dim(content) {
        return content;
    }
    hilite(content) {
        return content;
    }
    colorGood(content) {
        return content;
    }
    colorWarning(content) {
        return content;
    }
    colorCritical(content) {
        return content;
    }
    openUrl(url) {
        return new Promise((resolve) => resolve());
    }
    startSpinner(userMessage) {
        // do nothing
    }
    stopSpinner(userMessage) {
        // do nothing
    }
}
exports.MockUi = MockUi;
//# sourceMappingURL=mock-ui.js.map