import { session } from "./State";
import { wrapSessionMethod } from "./Util";
var getPrimaryArticlesOfSet = function () { return []; };
var getAllArticles = function () { return session.getArticlesOfType("graphical"); };
var getAllSets = function () { return session.getArticlesOfType("set"); };
var getArticlesOfSet = function (comId) {
    var set = session.getArticleByComId(comId);
    if (set === undefined) {
        return [];
    }
    return set.children.map(function (comId) { return session.getArticleByComId(comId); });
};
export var articleState = {
    getPrimaryArticlesOfSet: getPrimaryArticlesOfSet,
    getAllArticles: getAllArticles,
    getAllItems: wrapSessionMethod("getAllArticles"),
    getAllSets: getAllSets,
    getArticlesOfSet: getArticlesOfSet,
    getArticleByComId: wrapSessionMethod("getArticleByComId"),
    getArticleByGfxId: wrapSessionMethod("getArticleByGfxId"),
    getItemByComId: wrapSessionMethod("getArticleByComId"),
    getArticleConfiguration: wrapSessionMethod("getArticleConfiguration"),
    getArticleData: wrapSessionMethod("getArticleData"),
    getArticleInfo: wrapSessionMethod("getArticleInfo"),
    getArticlesBySource: wrapSessionMethod("getArticlesOfSource"),
    getSetByComId: wrapSessionMethod("getArticleByComId"),
    getHeadArticle: wrapSessionMethod("getArticleByComId"),
    getItemConfiguration: wrapSessionMethod("getArticleConfiguration"),
};
