"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getComponentsUrls = exports.getComponentsUrlForActualType = exports.getAvailableTemplates = void 0;
const fs_extra_1 = require("fs-extra");
const path = require("path");
const SETTINGS_PATH = path.resolve(__dirname, '../../../settings.json');
function getAvailableTemplates() {
    return readFromSettings()
        .then(settings => settings['templates']);
}
exports.getAvailableTemplates = getAvailableTemplates;
function getComponentsUrlForActualType(type) {
    return getComponentsUrls()
        .then((componentsUrls) => componentsUrls[type]);
}
exports.getComponentsUrlForActualType = getComponentsUrlForActualType;
function getComponentsUrls() {
    return readFromSettings()
        .then(settings => settings['components']);
}
exports.getComponentsUrls = getComponentsUrls;
function readFromSettings() {
    return (0, fs_extra_1.readJson)(SETTINGS_PATH);
}
//# sourceMappingURL=index.js.map