/** * This file is part of Haketilo. * * Function: Define an "enum" of stored item types. * * Copyright (C) 2021 Wojtek Kosior * Redistribution terms are gathered in the `copyright' file. */ /* * Key for item that is stored in quantity (script, page) is constructed by * prepending its name with first letter of its list name. However, we also * need to store some items that don't belong to any list. Let's call them * persisted variables. In such case item's key is its "name" prepended with * an underscore. */ const TYPE_PREFIX = { REPO: "r", PAGE : "p", BAG : "b", SCRIPT : "s", VAR : "_", /* Url prefix is not used in stored settings. */ URL : "u" }; const TYPE_NAME = { [TYPE_PREFIX.REPO] : "repo", [TYPE_PREFIX.PAGE] : "page", [TYPE_PREFIX.BAG] : "bag", [TYPE_PREFIX.SCRIPT] : "script" } const list_prefixes = [ TYPE_PREFIX.REPO, TYPE_PREFIX.PAGE, TYPE_PREFIX.BAG, TYPE_PREFIX.SCRIPT ]; /* * EXPORTS_START * EXPORT TYPE_PREFIX * EXPORT TYPE_NAME * EXPORT list_prefixes * EXPORTS_END */