func XRReferenceSpaceEventInitFromJS(value js.Wrapper) *XRReferenceSpaceEventInit {
	input := value.JSValue()
	var out XRReferenceSpaceEventInit
	var (
		value0 bool               
		value1 bool               
		value2 bool               
		value3 *XRReferenceSpace  
		value4 *XRRigidTransform  
	)
	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 = XRReferenceSpaceFromJS(input.Get("referenceSpace"))
	out.ReferenceSpace = value3
	value4 = XRRigidTransformFromJS(input.Get("transform"))
	out.Transform = value4
	return &out
}
XRReferenceSpaceEventInitFromJS is allocating a new
XRReferenceSpaceEventInit object and copy all values from
input javascript object
package webxr
import js "github.com/gowebapi/webapi/core/js"
import (
	"github.com/gowebapi/webapi/dom/domcore"
	"github.com/gowebapi/webapi/dom/geometry"
	"github.com/gowebapi/webapi/graphics/webgl"
	"github.com/gowebapi/webapi/html/canvas"
	"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 XREnvironmentBlendMode int
const (
	OpaqueXREnvironmentBlendMode XREnvironmentBlendMode = iota
	AdditiveXREnvironmentBlendMode
	AlphaBlendXREnvironmentBlendMode
)
var xREnvironmentBlendModeToWasmTable = []string{
	"opaque", "additive", "alpha-blend",
}
var xREnvironmentBlendModeFromWasmTable = map[string]XREnvironmentBlendMode{
	"opaque": OpaqueXREnvironmentBlendMode, "additive": AdditiveXREnvironmentBlendMode, "alpha-blend": AlphaBlendXREnvironmentBlendMode,
}
func (this *XREnvironmentBlendMode) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this XREnvironmentBlendMode) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(xREnvironmentBlendModeToWasmTable) {
		return xREnvironmentBlendModeToWasmTable[idx]
	}
	panic("unknown input value")
}
func XREnvironmentBlendModeFromJS(value js.Value) XREnvironmentBlendMode {
	key := value.String()
	conv, ok := xREnvironmentBlendModeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type XREye int
const (
	LeftXREye XREye = iota
	RightXREye
)
var xREyeToWasmTable = []string{
	"left", "right",
}
var xREyeFromWasmTable = map[string]XREye{
	"left": LeftXREye, "right": RightXREye,
}
func (this *XREye) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this XREye) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(xREyeToWasmTable) {
		return xREyeToWasmTable[idx]
	}
	panic("unknown input value")
}
func XREyeFromJS(value js.Value) XREye {
	key := value.String()
	conv, ok := xREyeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type XRHandedness int
const (
	NoneXRHandedness XRHandedness = iota
	LeftXRHandedness
	RightXRHandedness
)
var xRHandednessToWasmTable = []string{
	"none", "left", "right",
}
var xRHandednessFromWasmTable = map[string]XRHandedness{
	"none": NoneXRHandedness, "left": LeftXRHandedness, "right": RightXRHandedness,
}
func (this *XRHandedness) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this XRHandedness) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(xRHandednessToWasmTable) {
		return xRHandednessToWasmTable[idx]
	}
	panic("unknown input value")
}
func XRHandednessFromJS(value js.Value) XRHandedness {
	key := value.String()
	conv, ok := xRHandednessFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type XRReferenceSpaceType int
const (
	StationaryXRReferenceSpaceType XRReferenceSpaceType = iota
	BoundedXRReferenceSpaceType
	UnboundedXRReferenceSpaceType
)
var xRReferenceSpaceTypeToWasmTable = []string{
	"stationary", "bounded", "unbounded",
}
var xRReferenceSpaceTypeFromWasmTable = map[string]XRReferenceSpaceType{
	"stationary": StationaryXRReferenceSpaceType, "bounded": BoundedXRReferenceSpaceType, "unbounded": UnboundedXRReferenceSpaceType,
}
func (this *XRReferenceSpaceType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this XRReferenceSpaceType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(xRReferenceSpaceTypeToWasmTable) {
		return xRReferenceSpaceTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func XRReferenceSpaceTypeFromJS(value js.Value) XRReferenceSpaceType {
	key := value.String()
	conv, ok := xRReferenceSpaceTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type XRSessionMode int
const (
	InlineXRSessionMode XRSessionMode = iota
	ImmersiveVrXRSessionMode
	ImmersiveArXRSessionMode
)
var xRSessionModeToWasmTable = []string{
	"inline", "immersive-vr", "immersive-ar",
}
var xRSessionModeFromWasmTable = map[string]XRSessionMode{
	"inline": InlineXRSessionMode, "immersive-vr": ImmersiveVrXRSessionMode, "immersive-ar": ImmersiveArXRSessionMode,
}
func (this *XRSessionMode) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this XRSessionMode) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(xRSessionModeToWasmTable) {
		return xRSessionModeToWasmTable[idx]
	}
	panic("unknown input value")
}
func XRSessionModeFromJS(value js.Value) XRSessionMode {
	key := value.String()
	conv, ok := xRSessionModeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type XRStationaryReferenceSpaceSubtype int
const (
	EyeLevelXRStationaryReferenceSpaceSubtype XRStationaryReferenceSpaceSubtype = iota
	FloorLevelXRStationaryReferenceSpaceSubtype
	PositionDisabledXRStationaryReferenceSpaceSubtype
)
var xRStationaryReferenceSpaceSubtypeToWasmTable = []string{
	"eye-level", "floor-level", "position-disabled",
}
var xRStationaryReferenceSpaceSubtypeFromWasmTable = map[string]XRStationaryReferenceSpaceSubtype{
	"eye-level": EyeLevelXRStationaryReferenceSpaceSubtype, "floor-level": FloorLevelXRStationaryReferenceSpaceSubtype, "position-disabled": PositionDisabledXRStationaryReferenceSpaceSubtype,
}
func (this *XRStationaryReferenceSpaceSubtype) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this XRStationaryReferenceSpaceSubtype) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(xRStationaryReferenceSpaceSubtypeToWasmTable) {
		return xRStationaryReferenceSpaceSubtypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func XRStationaryReferenceSpaceSubtypeFromJS(value js.Value) XRStationaryReferenceSpaceSubtype {
	key := value.String()
	conv, ok := xRStationaryReferenceSpaceSubtypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type XRTargetRayMode int
const (
	GazeXRTargetRayMode XRTargetRayMode = iota
	TrackedPointerXRTargetRayMode
	ScreenXRTargetRayMode
)
var xRTargetRayModeToWasmTable = []string{
	"gaze", "tracked-pointer", "screen",
}
var xRTargetRayModeFromWasmTable = map[string]XRTargetRayMode{
	"gaze": GazeXRTargetRayMode, "tracked-pointer": TrackedPointerXRTargetRayMode, "screen": ScreenXRTargetRayMode,
}
func (this *XRTargetRayMode) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this XRTargetRayMode) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(xRTargetRayModeToWasmTable) {
		return xRTargetRayModeToWasmTable[idx]
	}
	panic("unknown input value")
}
func XRTargetRayModeFromJS(value js.Value) XRTargetRayMode {
	key := value.String()
	conv, ok := xRTargetRayModeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PromiseXRReferenceSpaceOnFulfilledFunc func(value *XRReferenceSpace)
type PromiseXRReferenceSpaceOnFulfilled js.Func
func PromiseXRReferenceSpaceOnFulfilledToJS(callback PromiseXRReferenceSpaceOnFulfilledFunc) *PromiseXRReferenceSpaceOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseXRReferenceSpaceOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *XRReferenceSpace  
		)
		_p0 = XRReferenceSpaceFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseXRReferenceSpaceOnFulfilledFromJS(_value js.Value) PromiseXRReferenceSpaceOnFulfilledFunc {
	return func(value *XRReferenceSpace) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseXRReferenceSpaceOnRejectedFunc func(reason js.Value)
type PromiseXRReferenceSpaceOnRejected js.Func
func PromiseXRReferenceSpaceOnRejectedToJS(callback PromiseXRReferenceSpaceOnRejectedFunc) *PromiseXRReferenceSpaceOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseXRReferenceSpaceOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseXRReferenceSpaceOnRejectedFromJS(_value js.Value) PromiseXRReferenceSpaceOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseXRSessionOnFulfilledFunc func(value *XRSession)
type PromiseXRSessionOnFulfilled js.Func
func PromiseXRSessionOnFulfilledToJS(callback PromiseXRSessionOnFulfilledFunc) *PromiseXRSessionOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseXRSessionOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *XRSession  
		)
		_p0 = XRSessionFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseXRSessionOnFulfilledFromJS(_value js.Value) PromiseXRSessionOnFulfilledFunc {
	return func(value *XRSession) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseXRSessionOnRejectedFunc func(reason js.Value)
type PromiseXRSessionOnRejected js.Func
func PromiseXRSessionOnRejectedToJS(callback PromiseXRSessionOnRejectedFunc) *PromiseXRSessionOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseXRSessionOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseXRSessionOnRejectedFromJS(_value js.Value) PromiseXRSessionOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type XRFrameRequestCallbackFunc func(time float64, frame *XRFrame)
type XRFrameRequestCallback js.Func
func XRFrameRequestCallbackToJS(callback XRFrameRequestCallbackFunc) *XRFrameRequestCallback {
	if callback == nil {
		return nil
	}
	ret := XRFrameRequestCallback(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 float64   
			_p1 *XRFrame  
		)
		_p0 = (args[0]).Float()
		_p1 = XRFrameFromJS(args[1])
		callback(_p0, _p1)
		return nil
	}))
	return &ret
}
func XRFrameRequestCallbackFromJS(_value js.Value) XRFrameRequestCallbackFunc {
	return func(time float64, frame *XRFrame) {
		var (
			_args [2]interface{}
			_end  int
		)
		_p0 := time
		_args[0] = _p0
		_end++
		_p1 := frame.JSValue()
		_args[1] = _p1
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type XRInputSourceEventInit struct {
	Bubbles     bool
	Cancelable  bool
	Composed    bool
	Frame       *XRFrame
	InputSource *XRInputSource
}
func (_this *XRInputSourceEventInit) 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.Frame.JSValue()
	out.Set("frame", value3)
	value4 := _this.InputSource.JSValue()
	out.Set("inputSource", value4)
	return out
}
func XRInputSourceEventInitFromJS(value js.Wrapper) *XRInputSourceEventInit {
	input := value.JSValue()
	var out XRInputSourceEventInit
	var (
		value0 bool            
		value1 bool            
		value2 bool            
		value3 *XRFrame        
		value4 *XRInputSource  
	)
	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 = XRFrameFromJS(input.Get("frame"))
	out.Frame = value3
	value4 = XRInputSourceFromJS(input.Get("inputSource"))
	out.InputSource = value4
	return &out
}
type XRReferenceSpaceEventInit struct {
	Bubbles        bool
	Cancelable     bool
	Composed       bool
	ReferenceSpace *XRReferenceSpace
	Transform      *XRRigidTransform
}
func (_this *XRReferenceSpaceEventInit) 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.ReferenceSpace.JSValue()
	out.Set("referenceSpace", value3)
	value4 := _this.Transform.JSValue()
	out.Set("transform", value4)
	return out
}