/
constants.ts
120 lines (94 loc) · 2.44 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/**
* This constants file is largely for minification tricks, and to
* have easy to read variable names. Enums would make more sense
* in most cases, but doing values like this as constants allows
* minifiers to just place the raw value directly in source, and in
* production there is no variable at all. For example, the minifier
* turns data[BUNDLE_ID] turns into data[0] for production builds.
*/
/**
* Member Types
*/
export const MEMBER_PROP = 1;
export const MEMBER_PROP_STATE = 2;
export const MEMBER_PROP_CONTEXT = 3;
export const MEMBER_STATE = 4;
export const MEMBER_METHOD = 5;
export const MEMBER_ELEMENT_REF = 6;
/**
* Prop Change Meta Indexes
*/
export const PROP_CHANGE_PROP_NAME = 0;
export const PROP_CHANGE_METHOD_NAME = 1;
/**
* Property Types
*/
export const TYPE_ANY = 0;
export const TYPE_BOOLEAN = 1;
export const TYPE_NUMBER = 2;
/**
* JS Property to Attribute Name Options
*/
export const ATTR_LOWER_CASE = 1;
/**
* Priority Levels
*/
export const PRIORITY_HIGH = 3;
export const PRIORITY_MEDIUM = 2;
export const PRIORITY_LOW = 1;
/**
* Slot Meta
*/
export const SLOT_TAG = 0;
export const HAS_SLOTS = 1;
export const HAS_NAMED_SLOTS = 2;
/**
* SSR Attribute Names
*/
export const SSR_VNODE_ID = 'ssrv';
export const SSR_CHILD_ID = 'ssrc';
/**
* Node Types
*/
export const ELEMENT_NODE = 1;
export const TEXT_NODE = 3;
export const COMMENT_NODE = 8;
/**
* Key Name to Key Code Map
*/
export const KEY_CODE_MAP: {[key: string]: number} = {
'enter': 13,
'escape': 27,
'space': 32,
'tab': 9
};
/**
* CSS class that gets added to the host element
* after the component has fully hydrated
*/
export const HYDRATED_CSS = '💎';
/**
* Namespaces
*/
export const SVG_NS = 'http://www.w3.org/2000/svg';
export const XLINK_NS = 'http://www.w3.org/1999/xlink';
export const XML_NS = 'http://www.w3.org/XML/1998/namespace';
/**
* File names and value
*/
export const BANNER = `Built with http://stenciljs.com`;
export const COLLECTION_MANIFEST_FILE_NAME = 'collection-manifest.json';
export const CORE_NAME = 'core';
export const GLOBAL_NAME = 'global';
export const LOADER_NAME = 'loader';
export const APP_NAMESPACE_REGEX = /["']__STENCIL__APP__['"]/g;
/**
* Errors
*/
export const LOAD_BUNDLE_ERROR = 1;
export const QUEUE_EVENTS_ERROR = 2;
export const WILL_LOAD_ERROR = 3;
export const DID_LOAD_ERROR = 4;
export const INIT_INSTANCE_ERROR = 5;
export const RENDER_ERROR = 6;
export const INITIAL_LOAD_ERROR = 7;