func DeviceRotationRateInitFromJS(value js.Wrapper) *DeviceRotationRateInit {
	input := value.JSValue()
	var out DeviceRotationRateInit
	var (
		value0 *float64  
		value1 *float64  
		value2 *float64  
	)
	if input.Get("alpha").Type() != js.TypeNull && input.Get("alpha").Type() != js.TypeUndefined {
		__tmp := (input.Get("alpha")).Float()
		value0 = &__tmp
	}
	out.Alpha = value0
	if input.Get("beta").Type() != js.TypeNull && input.Get("beta").Type() != js.TypeUndefined {
		__tmp := (input.Get("beta")).Float()
		value1 = &__tmp
	}
	out.Beta = value1
	if input.Get("gamma").Type() != js.TypeNull && input.Get("gamma").Type() != js.TypeUndefined {
		__tmp := (input.Get("gamma")).Float()
		value2 = &__tmp
	}
	out.Gamma = value2
	return &out
}
DeviceRotationRateInitFromJS is allocating a new
DeviceRotationRateInit object and copy all values from
input javascript object
package sensor
import "syscall/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 LocalCoordinateSystem int
const (
	CoordinateSystemDevice LocalCoordinateSystem = iota
	CoordinateSystemScreen
)
var genericSensorLocalCoordinateSystemToWasmTable = []string{
	"device", "screen",
}
var genericSensorLocalCoordinateSystemFromWasmTable = map[string]LocalCoordinateSystem{
	"device": CoordinateSystemDevice, "screen": CoordinateSystemScreen,
}
func (this *LocalCoordinateSystem) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this LocalCoordinateSystem) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(genericSensorLocalCoordinateSystemToWasmTable) {
		return genericSensorLocalCoordinateSystemToWasmTable[idx]
	}
	panic("unknown input value")
}
func LocalCoordinateSystemFromJS(value js.Value) LocalCoordinateSystem {
	key := value.String()
	conv, ok := genericSensorLocalCoordinateSystemFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type MockSensorType int
const (
	AmbientLightMockSensorType MockSensorType = iota
	AccelerometerMockSensorType
	LinearAccelerationMockSensorType
	GravityMockSensorType
	GyroscopeMockSensorType
	MagnetometerMockSensorType
	UncalibratedMagnetometerMockSensorType
	AbsoluteOrientationMockSensorType
	RelativeOrientationMockSensorType
	GeolocationMockSensorType
	ProximityMockSensorType
)
var mockSensorTypeToWasmTable = []string{
	"ambient-light", "accelerometer", "linear-acceleration", "gravity", "gyroscope", "magnetometer", "uncalibrated-magnetometer", "absolute-orientation", "relative-orientation", "geolocation", "proximity",
}
var mockSensorTypeFromWasmTable = map[string]MockSensorType{
	"ambient-light": AmbientLightMockSensorType, "accelerometer": AccelerometerMockSensorType, "linear-acceleration": LinearAccelerationMockSensorType, "gravity": GravityMockSensorType, "gyroscope": GyroscopeMockSensorType, "magnetometer": MagnetometerMockSensorType, "uncalibrated-magnetometer": UncalibratedMagnetometerMockSensorType, "absolute-orientation": AbsoluteOrientationMockSensorType, "relative-orientation": RelativeOrientationMockSensorType, "geolocation": GeolocationMockSensorType, "proximity": ProximityMockSensorType,
}
func (this *MockSensorType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this MockSensorType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(mockSensorTypeToWasmTable) {
		return mockSensorTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func MockSensorTypeFromJS(value js.Value) MockSensorType {
	key := value.String()
	conv, ok := mockSensorTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PositionCallbackFunc func(position *Position)
type PositionCallback js.Func
func PositionCallbackToJS(callback PositionCallbackFunc) *PositionCallback {
	if callback == nil {
		return nil
	}
	ret := PositionCallback(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *Position  
		)
		_p0 = PositionFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PositionCallbackFromJS(_value js.Value) PositionCallbackFunc {
	return func(position *Position) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := position.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PositionErrorCallbackFunc func(positionError *PositionError)
type PositionErrorCallback js.Func
func PositionErrorCallbackToJS(callback PositionErrorCallbackFunc) *PositionErrorCallback {
	if callback == nil {
		return nil
	}
	ret := PositionErrorCallback(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *PositionError  
		)
		_p0 = PositionErrorFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PositionErrorCallbackFromJS(_value js.Value) PositionErrorCallbackFunc {
	return func(positionError *PositionError) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := positionError.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseGeolocationSensorReadingOnFulfilledFunc func(value *GeolocationSensorReading)
type PromiseGeolocationSensorReadingOnFulfilled js.Func
func PromiseGeolocationSensorReadingOnFulfilledToJS(callback PromiseGeolocationSensorReadingOnFulfilledFunc) *PromiseGeolocationSensorReadingOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseGeolocationSensorReadingOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *GeolocationSensorReading  
		)
		_p0 = GeolocationSensorReadingFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseGeolocationSensorReadingOnFulfilledFromJS(_value js.Value) PromiseGeolocationSensorReadingOnFulfilledFunc {
	return func(value *GeolocationSensorReading) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseGeolocationSensorReadingOnRejectedFunc func(reason js.Value)
type PromiseGeolocationSensorReadingOnRejected js.Func
func PromiseGeolocationSensorReadingOnRejectedToJS(callback PromiseGeolocationSensorReadingOnRejectedFunc) *PromiseGeolocationSensorReadingOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseGeolocationSensorReadingOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseGeolocationSensorReadingOnRejectedFromJS(_value js.Value) PromiseGeolocationSensorReadingOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type AbsoluteOrientationReadingValues struct {
	Quaternion *javascript.FrozenArray
}
func (_this *AbsoluteOrientationReadingValues) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Quaternion.JSValue()
	out.Set("quaternion", value0)
	return out
}
func AbsoluteOrientationReadingValuesFromJS(value js.Wrapper) *AbsoluteOrientationReadingValues {
	input := value.JSValue()
	var out AbsoluteOrientationReadingValues
	var (
		value0 *javascript.FrozenArray  
	)
	if input.Get("quaternion").Type() != js.TypeNull && input.Get("quaternion").Type() != js.TypeUndefined {
		value0 = javascript.FrozenArrayFromJS(input.Get("quaternion"))
	}
	out.Quaternion = value0
	return &out
}
type AccelerometerReadingValues struct {
	X *float64
	Y *float64
	Z *float64
}
func (_this *AccelerometerReadingValues) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	var value0 interface{}
	if _this.X != nil {
		value0 = *(_this.X)
	} else {
		value0 = nil
	}
	out.Set("x", value0)
	var value1 interface{}
	if _this.Y != nil {
		value1 = *(_this.Y)
	} else {
		value1 = nil
	}
	out.Set("y", value1)
	var value2 interface{}
	if _this.Z != nil {
		value2 = *(_this.Z)
	} else {
		value2 = nil
	}
	out.Set("z", value2)
	return out
}
func AccelerometerReadingValuesFromJS(value js.Wrapper) *AccelerometerReadingValues {
	input := value.JSValue()
	var out AccelerometerReadingValues
	var (
		value0 *float64  
		value1 *float64  
		value2 *float64  
	)
	if input.Get("x").Type() != js.TypeNull && input.Get("x").Type() != js.TypeUndefined {
		__tmp := (input.Get("x")).Float()
		value0 = &__tmp
	}
	out.X = value0
	if input.Get("y").Type() != js.TypeNull && input.Get("y").Type() != js.TypeUndefined {
		__tmp := (input.Get("y")).Float()
		value1 = &__tmp
	}
	out.Y = value1
	if input.Get("z").Type() != js.TypeNull && input.Get("z").Type() != js.TypeUndefined {
		__tmp := (input.Get("z")).Float()
		value2 = &__tmp
	}
	out.Z = value2
	return &out
}
type AccelerometerSensorOptions struct {
	Frequency      float64
	ReferenceFrame LocalCoordinateSystem
}
func (_this *AccelerometerSensorOptions) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Frequency
	out.Set("frequency", value0)
	value1 := _this.ReferenceFrame.JSValue()
	out.Set("referenceFrame", value1)
	return out
}
func AccelerometerSensorOptionsFromJS(value js.Wrapper) *AccelerometerSensorOptions {
	input := value.JSValue()
	var out AccelerometerSensorOptions
	var (
		value0 float64                
		value1 LocalCoordinateSystem  
	)
	value0 = (input.Get("frequency")).Float()
	out.Frequency = value0
	value1 = LocalCoordinateSystemFromJS(input.Get("referenceFrame"))
	out.ReferenceFrame = value1
	return &out
}
type AmbientLightReadingValues struct {
	Illuminance *float64
}
func (_this *AmbientLightReadingValues) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	var value0 interface{}
	if _this.Illuminance != nil {
		value0 = *(_this.Illuminance)
	} else {
		value0 = nil
	}
	out.Set("illuminance", value0)
	return out
}
func AmbientLightReadingValuesFromJS(value js.Wrapper) *AmbientLightReadingValues {
	input := value.JSValue()
	var out AmbientLightReadingValues
	var (
		value0 *float64  
	)
	if input.Get("illuminance").Type() != js.TypeNull && input.Get("illuminance").Type() != js.TypeUndefined {
		__tmp := (input.Get("illuminance")).Float()
		value0 = &__tmp
	}
	out.Illuminance = value0
	return &out
}
type DeviceAccelerationInit struct {
	X *float64
	Y *float64
	Z *float64
}
func (_this *DeviceAccelerationInit) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	var value0 interface{}
	if _this.X != nil {
		value0 = *(_this.X)
	} else {
		value0 = nil
	}
	out.Set("x", value0)
	var value1 interface{}
	if _this.Y != nil {
		value1 = *(_this.Y)
	} else {
		value1 = nil
	}
	out.Set("y", value1)
	var value2 interface{}
	if _this.Z != nil {
		value2 = *(_this.Z)
	} else {
		value2 = nil
	}
	out.Set("z", value2)
	return out
}
func DeviceAccelerationInitFromJS(value js.Wrapper) *DeviceAccelerationInit {
	input := value.JSValue()
	var out DeviceAccelerationInit
	var (
		value0 *float64  
		value1 *float64  
		value2 *float64  
	)
	if input.Get("x").Type() != js.TypeNull && input.Get("x").Type() != js.TypeUndefined {
		__tmp := (input.Get("x")).Float()
		value0 = &__tmp
	}
	out.X = value0
	if input.Get("y").Type() != js.TypeNull && input.Get("y").Type() != js.TypeUndefined {
		__tmp := (input.Get("y")).Float()
		value1 = &__tmp
	}
	out.Y = value1
	if input.Get("z").Type() != js.TypeNull && input.Get("z").Type() != js.TypeUndefined {
		__tmp := (input.Get("z")).Float()
		value2 = &__tmp
	}
	out.Z = value2
	return &out
}
type DeviceMotionEventInit struct {
	Bubbles                      bool
	Cancelable                   bool
	Composed                     bool
	Acceleration                 *DeviceAccelerationInit
	AccelerationIncludingGravity *DeviceAccelerationInit
	RotationRate                 *DeviceRotationRateInit
	Interval                     float64
}
func (_this *DeviceMotionEventInit) 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.Acceleration.JSValue()
	out.Set("acceleration", value3)
	value4 := _this.AccelerationIncludingGravity.JSValue()
	out.Set("accelerationIncludingGravity", value4)
	value5 := _this.RotationRate.JSValue()
	out.Set("rotationRate", value5)
	value6 := _this.Interval
	out.Set("interval", value6)
	return out
}
func DeviceMotionEventInitFromJS(value js.Wrapper) *DeviceMotionEventInit {
	input := value.JSValue()
	var out DeviceMotionEventInit
	var (
		value0 bool                     
		value1 bool                     
		value2 bool                     
		value3 *DeviceAccelerationInit  
		value4 *DeviceAccelerationInit  
		value5 *DeviceRotationRateInit  
		value6 float64                  
	)
	value0 = (input.Get("bubbles")).Bool()
	out.Bubbles = value0
	value1 = (input.Get("cancelable")).Bool()
	out.Cancelable = value1
	value2 = (input.Get("composed")).Bool()
	out.Composed = value2
	if input.Get("acceleration").Type() != js.TypeNull && input.Get("acceleration").Type() != js.TypeUndefined {
		value3 = DeviceAccelerationInitFromJS(input.Get("acceleration"))
	}
	out.Acceleration = value3
	if input.Get("accelerationIncludingGravity").Type() != js.TypeNull && input.Get("accelerationIncludingGravity").Type() != js.TypeUndefined {
		value4 = DeviceAccelerationInitFromJS(input.Get("accelerationIncludingGravity"))
	}
	out.AccelerationIncludingGravity = value4
	if input.Get("rotationRate").Type() != js.TypeNull && input.Get("rotationRate").Type() != js.TypeUndefined {
		value5 = DeviceRotationRateInitFromJS(input.Get("rotationRate"))
	}
	out.RotationRate = value5
	value6 = (input.Get("interval")).Float()
	out.Interval = value6
	return &out
}
type DeviceOrientationEventInit struct {
	Bubbles    bool
	Cancelable bool
	Composed   bool
	Alpha      *float64
	Beta       *float64
	Gamma      *float64
	Absolute   bool
}
func (_this *DeviceOrientationEventInit) 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)
	var value3 interface{}
	if _this.Alpha != nil {
		value3 = *(_this.Alpha)
	} else {
		value3 = nil
	}
	out.Set("alpha", value3)
	var value4 interface{}
	if _this.Beta != nil {
		value4 = *(_this.Beta)
	} else {
		value4 = nil
	}
	out.Set("beta", value4)
	var value5 interface{}
	if _this.Gamma != nil {
		value5 = *(_this.Gamma)
	} else {
		value5 = nil
	}
	out.Set("gamma", value5)
	value6 := _this.Absolute
	out.Set("absolute", value6)
	return out
}
func DeviceOrientationEventInitFromJS(value js.Wrapper) *DeviceOrientationEventInit {
	input := value.JSValue()
	var out DeviceOrientationEventInit
	var (
		value0 bool      
		value1 bool      
		value2 bool      
		value3 *float64  
		value4 *float64  
		value5 *float64  
		value6 bool      
	)
	value0 = (input.Get("bubbles")).Bool()
	out.Bubbles = value0
	value1 = (input.Get("cancelable")).Bool()
	out.Cancelable = value1
	value2 = (input.Get("composed")).Bool()
	out.Composed = value2
	if input.Get("alpha").Type() != js.TypeNull && input.Get("alpha").Type() != js.TypeUndefined {
		__tmp := (input.Get("alpha")).Float()
		value3 = &__tmp
	}
	out.Alpha = value3
	if input.Get("beta").Type() != js.TypeNull && input.Get("beta").Type() != js.TypeUndefined {
		__tmp := (input.Get("beta")).Float()
		value4 = &__tmp
	}
	out.Beta = value4
	if input.Get("gamma").Type() != js.TypeNull && input.Get("gamma").Type() != js.TypeUndefined {
		__tmp := (input.Get("gamma")).Float()
		value5 = &__tmp
	}
	out.Gamma = value5
	value6 = (input.Get("absolute")).Bool()
	out.Absolute = value6
	return &out
}
type DeviceRotationRateInit struct {
	Alpha *float64
	Beta  *float64
	Gamma *float64
}
func (_this *DeviceRotationRateInit) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	var value0 interface{}
	if _this.Alpha != nil {
		value0 = *(_this.Alpha)
	} else {
		value0 = nil
	}
	out.Set("alpha", value0)
	var value1 interface{}
	if _this.Beta != nil {
		value1 = *(_this.Beta)
	} else {
		value1 = nil
	}
	out.Set("beta", value1)
	var value2 interface{}
	if _this.Gamma != nil {
		value2 = *(_this.Gamma)
	} else {
		value2 = nil
	}
	out.Set("gamma", value2)
	return out
}