"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var State_1 = require("./State");
var Util_1 = require("./Util");
var getPrimaryArticlesOfSet = function () { return []; };
var getAllArticles = function () { return State_1.session.getArticlesOfType("graphical"); };
var getAllSets = function () { return State_1.session.getArticlesOfType("set"); };
var getArticlesOfSet = function (comId) {
    var set = State_1.session.getArticleByComId(comId);
    if (set === undefined) {
        return [];
    }
    return set.children.map(function (comId) { return State_1.session.getArticleByComId(comId); });
};
exports.articleState = {
    getPrimaryArticlesOfSet: getPrimaryArticlesOfSet,
    getAllArticles: getAllArticles,
    getAllItems: Util_1.wrapSessionMethod("getAllArticles"),
    getAllSets: getAllSets,
    getArticlesOfSet: getArticlesOfSet,
    getArticleByComId: Util_1.wrapSessionMethod("getArticleByComId"),
    getArticleByGfxId: Util_1.wrapSessionMethod("getArticleByGfxId"),
    getItemByComId: Util_1.wrapSessionMethod("getArticleByComId"),
    getArticleConfiguration: Util_1.wrapSessionMethod("getArticleConfiguration"),
    getArticleData: Util_1.wrapSessionMethod("getArticleData"),
    getArticleInfo: Util_1.wrapSessionMethod("getArticleInfo"),
    getArticlesBySource: Util_1.wrapSessionMethod("getArticlesOfSource"),
    getSetByComId: Util_1.wrapSessionMethod("getArticleByComId"),
    getHeadArticle: Util_1.wrapSessionMethod("getArticleByComId"),
    getItemConfiguration: Util_1.wrapSessionMethod("getArticleConfiguration"),
};
