1
|
/**
|
2
|
* Myext stored item types "enum"
|
3
|
*
|
4
|
* Copyright (C) 2021 Wojtek Kosior
|
5
|
* Redistribution terms are gathered in the `copyright' file.
|
6
|
*/
|
7
|
|
8
|
/*
|
9
|
* Key for item that is stored in quantity (script, page) is constructed by
|
10
|
* prepending its name with first letter of its list name. However, we also
|
11
|
* need to store some items that don't belong to any list. Let's call them
|
12
|
* persisted variables. In such case item's key is its "name" prepended with
|
13
|
* an underscore.
|
14
|
*/
|
15
|
|
16
|
const TYPE_PREFIX = {
|
17
|
PAGE : "p",
|
18
|
BAG : "b",
|
19
|
SCRIPT : "s",
|
20
|
VAR : "_"
|
21
|
};
|
22
|
|
23
|
const TYPE_NAME = {
|
24
|
[TYPE_PREFIX.PAGE] : "page",
|
25
|
[TYPE_PREFIX.BAG] : "bag",
|
26
|
[TYPE_PREFIX.SCRIPT] : "script"
|
27
|
}
|
28
|
|
29
|
const list_prefixes = [
|
30
|
TYPE_PREFIX.PAGE,
|
31
|
TYPE_PREFIX.BAG,
|
32
|
TYPE_PREFIX.SCRIPT
|
33
|
];
|
34
|
|
35
|
/*
|
36
|
* EXPORTS_START
|
37
|
* EXPORT TYPE_PREFIX
|
38
|
* EXPORT TYPE_NAME
|
39
|
* EXPORT list_prefixes
|
40
|
* EXPORTS_END
|
41
|
*/
|