func ContextEventInitFromJS(value js.Wrapper) *ContextEventInit {
	input := value.JSValue()
	var out ContextEventInit
	var (
		value0 bool    
		value1 bool    
		value2 bool    
		value3 string  
	)
	value0 = (input.Get("bubbles")).Bool()
	out.Bubbles = value0
	value1 = (input.Get("cancelable")).Bool()
	out.Cancelable = value1
	value2 = (input.Get("composed")).Bool()
	out.Composed = value2
	value3 = (input.Get("statusMessage")).String()
	out.StatusMessage = value3
	return &out
}
ContextEventInitFromJS is allocating a new
ContextEventInit object and copy all values from
input javascript object
package webgl
import js "github.com/gowebapi/webapi/core/js"
import (
	"github.com/gowebapi/webapi/dom/domcore"
	"github.com/gowebapi/webapi/javascript"
)
func unused(value interface{}) {
}
type Union struct {
	Value js.Value
}
func (u *Union) JSValue() js.Value {
	return u.Value
}
func UnionFromJS(value js.Value) *Union {
	return &Union{Value: value}
}
type PowerPreference int
const (
	DefaultWebGLPowerPreference PowerPreference = iota
	LowPowerWebGLPowerPreference
	HighPerformanceWebGLPowerPreference
)
var webGLPowerPreferenceToWasmTable = []string{
	"default", "low-power", "high-performance",
}
var webGLPowerPreferenceFromWasmTable = map[string]PowerPreference{
	"default": DefaultWebGLPowerPreference, "low-power": LowPowerWebGLPowerPreference, "high-performance": HighPerformanceWebGLPowerPreference,
}
func (this *PowerPreference) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this PowerPreference) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(webGLPowerPreferenceToWasmTable) {
		return webGLPowerPreferenceToWasmTable[idx]
	}
	panic("unknown input value")
}
func PowerPreferenceFromJS(value js.Value) PowerPreference {
	key := value.String()
	conv, ok := webGLPowerPreferenceFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type ContextAttributes struct {
	Alpha                        bool
	Depth                        bool
	Stencil                      bool
	Antialias                    bool
	PremultipliedAlpha           bool
	PreserveDrawingBuffer        bool
	PowerPreference              PowerPreference
	FailIfMajorPerformanceCaveat bool
	XrCompatible                 bool
}
func (_this *ContextAttributes) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Alpha
	out.Set("alpha", value0)
	value1 := _this.Depth
	out.Set("depth", value1)
	value2 := _this.Stencil
	out.Set("stencil", value2)
	value3 := _this.Antialias
	out.Set("antialias", value3)
	value4 := _this.PremultipliedAlpha
	out.Set("premultipliedAlpha", value4)
	value5 := _this.PreserveDrawingBuffer
	out.Set("preserveDrawingBuffer", value5)
	value6 := _this.PowerPreference.JSValue()
	out.Set("powerPreference", value6)
	value7 := _this.FailIfMajorPerformanceCaveat
	out.Set("failIfMajorPerformanceCaveat", value7)
	value8 := _this.XrCompatible
	out.Set("xrCompatible", value8)
	return out
}
func ContextAttributesFromJS(value js.Wrapper) *ContextAttributes {
	input := value.JSValue()
	var out ContextAttributes
	var (
		value0 bool             
		value1 bool             
		value2 bool             
		value3 bool             
		value4 bool             
		value5 bool             
		value6 PowerPreference  
		value7 bool             
		value8 bool             
	)
	value0 = (input.Get("alpha")).Bool()
	out.Alpha = value0
	value1 = (input.Get("depth")).Bool()
	out.Depth = value1
	value2 = (input.Get("stencil")).Bool()
	out.Stencil = value2
	value3 = (input.Get("antialias")).Bool()
	out.Antialias = value3
	value4 = (input.Get("premultipliedAlpha")).Bool()
	out.PremultipliedAlpha = value4
	value5 = (input.Get("preserveDrawingBuffer")).Bool()
	out.PreserveDrawingBuffer = value5
	value6 = PowerPreferenceFromJS(input.Get("powerPreference"))
	out.PowerPreference = value6
	value7 = (input.Get("failIfMajorPerformanceCaveat")).Bool()
	out.FailIfMajorPerformanceCaveat = value7
	value8 = (input.Get("xrCompatible")).Bool()
	out.XrCompatible = value8
	return &out
}
type ContextEventInit struct {
	Bubbles       bool
	Cancelable    bool
	Composed      bool
	StatusMessage string
}
func (_this *ContextEventInit) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Bubbles
	out.Set("bubbles", value0)
	value1 := _this.Cancelable
	out.Set("cancelable", value1)
	value2 := _this.Composed
	out.Set("composed", value2)
	value3 := _this.StatusMessage
	out.Set("statusMessage", value3)
	return out
}