"use strict";
var marked = require('marked');
function createData(projectPackage, graphdocPackage, plugins, type) {
    function reduceHeaders(items, plugin) {
        return items.concat(plugin.getHeaders(type && type.name));
    }
    function reduceNavigations(items, plugin) {
        return items.concat(plugin.getNavigations(type && type.name));
    }
    function reduceDocuments(items, plugin) {
        return items.concat(plugin.getDocuments(type && type.name));
    }
    return Object.assign({}, projectPackage, {
        title: (type && type.name) || projectPackage.graphdoc.title || 'Graphql schema documentation',
        description: type ? marked(type.description || '') : projectPackage.description,
        graphdoc: Object.assign({}, graphdocPackage, projectPackage.graphdoc),
        headers: plugins.reduce(reduceHeaders, []),
        navs: plugins.reduce(reduceNavigations, []),
        sections: plugins.reduce(reduceDocuments, []),
    });
}
exports.createData = createData;
//# sourceMappingURL=template.js.map