func LayerInitFromJS(value js.Wrapper) *LayerInit {
	input := value.JSValue()
	var out LayerInit
	var (
		value0 *Union     
		value1 []float32  
		value2 []float32  
	)
	if input.Get("source").Type() != js.TypeNull && input.Get("source").Type() != js.TypeUndefined {
		value0 = UnionFromJS(input.Get("source"))
	}
	out.Source = value0
	value1 = jsarray.Float32ToGo(input.Get("leftBounds"))
	out.LeftBounds = value1
	value2 = jsarray.Float32ToGo(input.Get("rightBounds"))
	out.RightBounds = value2
	return &out
}
LayerInitFromJS is allocating a new
LayerInit object and copy all values from
input javascript object
package webvr
import "syscall/js"
import (
	"github.com/gowebapi/webapi/core/jsarray"
	"github.com/gowebapi/webapi/dom/domcore"
	"github.com/gowebapi/webapi/html/htmlcommon"
	"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 DisplayEventReason int
const (
	Mounted DisplayEventReason = iota
	Navigation
	Requested
	Unmounted
)
var vRDisplayEventReasonToWasmTable = []string{
	"mounted", "navigation", "requested", "unmounted",
}
var vRDisplayEventReasonFromWasmTable = map[string]DisplayEventReason{
	"mounted": Mounted, "navigation": Navigation, "requested": Requested, "unmounted": Unmounted,
}
func (this *DisplayEventReason) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this DisplayEventReason) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(vRDisplayEventReasonToWasmTable) {
		return vRDisplayEventReasonToWasmTable[idx]
	}
	panic("unknown input value")
}
func DisplayEventReasonFromJS(value js.Value) DisplayEventReason {
	key := value.String()
	conv, ok := vRDisplayEventReasonFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type Eye int
const (
	Left Eye = iota
	Right
)
var vREyeToWasmTable = []string{
	"left", "right",
}
var vREyeFromWasmTable = map[string]Eye{
	"left": Left, "right": Right,
}
func (this *Eye) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this Eye) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(vREyeToWasmTable) {
		return vREyeToWasmTable[idx]
	}
	panic("unknown input value")
}
func EyeFromJS(value js.Value) Eye {
	key := value.String()
	conv, ok := vREyeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PromiseSequenceDisplayOnFulfilledFunc func(value []*Display)
type PromiseSequenceDisplayOnFulfilled js.Func
func PromiseSequenceDisplayOnFulfilledToJS(callback PromiseSequenceDisplayOnFulfilledFunc) *PromiseSequenceDisplayOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseSequenceDisplayOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 []*Display  
		)
		__length0 := args[0].Length()
		__array0 := make([]*Display, __length0, __length0)
		for __idx0 := 0; __idx0 < __length0; __idx0++ {
			var __seq_out0 *Display
			__seq_in0 := args[0].Index(__idx0)
			__seq_out0 = DisplayFromJS(__seq_in0)
			__array0[__idx0] = __seq_out0
		}
		_p0 = __array0
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseSequenceDisplayOnFulfilledFromJS(_value js.Value) PromiseSequenceDisplayOnFulfilledFunc {
	return func(value []*Display) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := js.Global().Get("Array").New(len(value))
		for __idx0, __seq_in0 := range value {
			__seq_out0 := __seq_in0.JSValue()
			_p0.SetIndex(__idx0, __seq_out0)
		}
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseSequenceDisplayOnRejectedFunc func(reason js.Value)
type PromiseSequenceDisplayOnRejected js.Func
func PromiseSequenceDisplayOnRejectedToJS(callback PromiseSequenceDisplayOnRejectedFunc) *PromiseSequenceDisplayOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseSequenceDisplayOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseSequenceDisplayOnRejectedFromJS(_value js.Value) PromiseSequenceDisplayOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type DisplayEventInit struct {
	Bubbles    bool
	Cancelable bool
	Composed   bool
	Display    *Display
	Reason     DisplayEventReason
}
func (_this *DisplayEventInit) 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.Display.JSValue()
	out.Set("display", value3)
	value4 := _this.Reason.JSValue()
	out.Set("reason", value4)
	return out
}
func DisplayEventInitFromJS(value js.Wrapper) *DisplayEventInit {
	input := value.JSValue()
	var out DisplayEventInit
	var (
		value0 bool                
		value1 bool                
		value2 bool                
		value3 *Display            
		value4 DisplayEventReason  
	)
	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 = DisplayFromJS(input.Get("display"))
	out.Display = value3
	value4 = DisplayEventReasonFromJS(input.Get("reason"))
	out.Reason = value4
	return &out
}
type LayerInit struct {
	Source      *Union
	LeftBounds  []float32
	RightBounds []float32
}
func (_this *LayerInit) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Source.JSValue()
	out.Set("source", value0)
	value1 := jsarray.Float32ToJS(_this.LeftBounds)
	out.Set("leftBounds", value1)
	value2 := jsarray.Float32ToJS(_this.RightBounds)
	out.Set("rightBounds", value2)
	return out
}