inferno-vnode-flags
Version:
Provides an enum of all possible VNode Flags used when calling Inferno.createVNode
47 lines (45 loc) • 2.54 kB
JavaScript
/* If editing these values check babel-plugin-also */
var VNodeFlags;
(function (VNodeFlags) {
/* First set of bits define shape of vNode */
VNodeFlags[VNodeFlags["Unknown"] = 0] = "Unknown";
VNodeFlags[VNodeFlags["HtmlElement"] = 1] = "HtmlElement";
VNodeFlags[VNodeFlags["ComponentUnknown"] = 2] = "ComponentUnknown";
VNodeFlags[VNodeFlags["ComponentClass"] = 4] = "ComponentClass";
VNodeFlags[VNodeFlags["ComponentFunction"] = 8] = "ComponentFunction";
VNodeFlags[VNodeFlags["Text"] = 16] = "Text";
/* Special flags */
VNodeFlags[VNodeFlags["SvgElement"] = 32] = "SvgElement";
VNodeFlags[VNodeFlags["InputElement"] = 64] = "InputElement";
VNodeFlags[VNodeFlags["TextareaElement"] = 128] = "TextareaElement";
VNodeFlags[VNodeFlags["SelectElement"] = 256] = "SelectElement";
VNodeFlags[VNodeFlags["Portal"] = 1024] = "Portal";
VNodeFlags[VNodeFlags["ReCreate"] = 2048] = "ReCreate";
VNodeFlags[VNodeFlags["ContentEditable"] = 4096] = "ContentEditable";
VNodeFlags[VNodeFlags["Fragment"] = 8192] = "Fragment";
VNodeFlags[VNodeFlags["InUse"] = 16384] = "InUse";
VNodeFlags[VNodeFlags["ForwardRef"] = 32768] = "ForwardRef";
VNodeFlags[VNodeFlags["Normalized"] = 65536] = "Normalized";
/* Masks */
VNodeFlags[VNodeFlags["ForwardRefComponent"] = 32776] = "ForwardRefComponent";
VNodeFlags[VNodeFlags["FormElement"] = 448] = "FormElement";
VNodeFlags[VNodeFlags["Element"] = 481] = "Element";
VNodeFlags[VNodeFlags["Component"] = 14] = "Component";
VNodeFlags[VNodeFlags["DOMRef"] = 1521] = "DOMRef";
VNodeFlags[VNodeFlags["InUseOrNormalized"] = 81920] = "InUseOrNormalized";
VNodeFlags[VNodeFlags["ClearInUse"] = -16385] = "ClearInUse";
VNodeFlags[VNodeFlags["ComponentKnown"] = 12] = "ComponentKnown";
})(VNodeFlags || (VNodeFlags = {}));
// Combinations are not possible, its bitwise only to reduce vNode size
var ChildFlags;
(function (ChildFlags) {
ChildFlags[ChildFlags["UnknownChildren"] = 0] = "UnknownChildren";
/* Second set of bits define shape of children */
ChildFlags[ChildFlags["HasInvalidChildren"] = 1] = "HasInvalidChildren";
ChildFlags[ChildFlags["HasVNodeChildren"] = 2] = "HasVNodeChildren";
ChildFlags[ChildFlags["HasNonKeyedChildren"] = 4] = "HasNonKeyedChildren";
ChildFlags[ChildFlags["HasKeyedChildren"] = 8] = "HasKeyedChildren";
ChildFlags[ChildFlags["HasTextChildren"] = 16] = "HasTextChildren";
ChildFlags[ChildFlags["MultipleChildren"] = 12] = "MultipleChildren";
})(ChildFlags || (ChildFlags = {}));
export { ChildFlags, VNodeFlags };