func WakeLockFromJS(value js.Wrapper) *WakeLock {
	input := value.JSValue()
	if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
		return nil
	}
	ret := &WakeLock{}
	ret.Value_JS = input
	return ret
}
WakeLockFromJS is casting a js.Wrapper into WakeLock.
package wakelock
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 WakeLockType int
const (
	ScreenWakeLockType WakeLockType = iota
	SystemWakeLockType
)
var wakeLockTypeToWasmTable = []string{
	"screen", "system",
}
var wakeLockTypeFromWasmTable = map[string]WakeLockType{
	"screen": ScreenWakeLockType, "system": SystemWakeLockType,
}
func (this *WakeLockType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this WakeLockType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(wakeLockTypeToWasmTable) {
		return wakeLockTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func WakeLockTypeFromJS(value js.Value) WakeLockType {
	key := value.String()
	conv, ok := wakeLockTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PromiseWakeLockOnFulfilledFunc func(value *WakeLock)
type PromiseWakeLockOnFulfilled js.Func
func PromiseWakeLockOnFulfilledToJS(callback PromiseWakeLockOnFulfilledFunc) *PromiseWakeLockOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseWakeLockOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *WakeLock  
		)
		_p0 = WakeLockFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseWakeLockOnFulfilledFromJS(_value js.Value) PromiseWakeLockOnFulfilledFunc {
	return func(value *WakeLock) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseWakeLockOnRejectedFunc func(reason js.Value)
type PromiseWakeLockOnRejected js.Func
func PromiseWakeLockOnRejectedToJS(callback PromiseWakeLockOnRejectedFunc) *PromiseWakeLockOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseWakeLockOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseWakeLockOnRejectedFromJS(_value js.Value) PromiseWakeLockOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseWakeLock struct {
	Value_JS js.Value
}
func (_this *PromiseWakeLock) JSValue() js.Value {
	return _this.Value_JS
}
func PromiseWakeLockFromJS(value js.Wrapper) *PromiseWakeLock {
	input := value.JSValue()
	if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
		return nil
	}
	ret := &PromiseWakeLock{}
	ret.Value_JS = input
	return ret
}
func (_this *PromiseWakeLock) Then(onFulfilled *PromiseWakeLockOnFulfilled, onRejected *PromiseWakeLockOnRejected) (_result *PromiseWakeLock) {
	var (
		_args [2]interface{}
		_end  int
	)
	var __callback0 js.Value
	if onFulfilled != nil {
		__callback0 = (*onFulfilled).Value
	} else {
		__callback0 = js.Null()
	}
	_p0 := __callback0
	_args[0] = _p0
	_end++
	if onRejected != nil {
		var __callback1 js.Value
		if onRejected != nil {
			__callback1 = (*onRejected).Value
		} else {
			__callback1 = js.Null()
		}
		_p1 := __callback1
		_args[1] = _p1
		_end++
	}
	_returned := _this.Value_JS.Call("then", _args[0:_end]...)
	var (
		_converted *PromiseWakeLock  
	)
	_converted = PromiseWakeLockFromJS(_returned)
	_result = _converted
	return
}
func (_this *PromiseWakeLock) Catch(onRejected *PromiseWakeLockOnRejected) (_result *PromiseWakeLock) {
	var (
		_args [1]interface{}
		_end  int
	)
	var __callback0 js.Value
	if onRejected != nil {
		__callback0 = (*onRejected).Value
	} else {
		__callback0 = js.Null()
	}
	_p0 := __callback0
	_args[0] = _p0
	_end++
	_returned := _this.Value_JS.Call("catch", _args[0:_end]...)
	var (
		_converted *PromiseWakeLock  
	)
	_converted = PromiseWakeLockFromJS(_returned)
	_result = _converted
	return
}
func (_this *PromiseWakeLock) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseWakeLock) {
	var (
		_args [1]interface{}
		_end  int
	)
	var __callback0 js.Value
	if onFinally != nil {
		__callback0 = (*onFinally).Value
	} else {
		__callback0 = js.Null()
	}
	_p0 := __callback0
	_args[0] = _p0
	_end++
	_returned := _this.Value_JS.Call("finally", _args[0:_end]...)
	var (
		_converted *PromiseWakeLock  
	)
	_converted = PromiseWakeLockFromJS(_returned)
	_result = _converted
	return
}
type WakeLock struct {
	domcore.EventTarget
}