2018-09-26 18:39:47 -04:00

37 lines
985 B
TypeScript

// vnode flags
export const enum VNodeFlags {
ELEMENT_HTML = 1,
ELEMENT_SVG = 1 << 1,
COMPONENT_UNKNOWN = 1 << 2,
COMPONENT_STATEFUL_NORMAL = 1 << 3,
COMPONENT_STATEFUL_SHOULD_KEEP_ALIVE = 1 << 4,
COMPONENT_STATEFUL_KEPT_ALIVE = 1 << 5,
COMPONENT_FUNCTIONAL = 1 << 6,
TEXT = 1 << 7,
FRAGMENT = 1 << 8,
PORTAL = 1 << 9,
// masks (only use for bitwise checks, do not use equal checks or assign)
ELEMENT = ELEMENT_HTML | ELEMENT_SVG,
COMPONENT_STATEFUL = COMPONENT_STATEFUL_NORMAL |
COMPONENT_STATEFUL_SHOULD_KEEP_ALIVE |
COMPONENT_STATEFUL_KEPT_ALIVE,
COMPONENT = COMPONENT_UNKNOWN | COMPONENT_STATEFUL | COMPONENT_FUNCTIONAL
}
export const enum ChildrenFlags {
UNKNOWN_CHILDREN = 0,
NO_CHILDREN = 1,
SINGLE_VNODE = 1 << 1,
KEYED_VNODES = 1 << 2,
NONE_KEYED_VNODES = 1 << 3,
STABLE_SLOTS = 1 << 4,
DYNAMIC_SLOTS = 1 << 5,
// masks
HAS_SLOTS = STABLE_SLOTS | DYNAMIC_SLOTS,
MULTIPLE_VNODES = KEYED_VNODES | NONE_KEYED_VNODES
}