func AllowedUSBDeviceFromJS(value js.Wrapper) *AllowedUSBDevice {
	input := value.JSValue()
	var out AllowedUSBDevice
	var (
		value0 int     
		value1 int     
		value2 string  
	)
	value0 = (input.Get("vendorId")).Int()
	out.VendorId = value0
	value1 = (input.Get("productId")).Int()
	out.ProductId = value1
	value2 = (input.Get("serialNumber")).String()
	out.SerialNumber = value2
	return &out
}
AllowedUSBDeviceFromJS is allocating a new
AllowedUSBDevice object and copy all values from
input javascript object
package usb
import "syscall/js"
import (
	"github.com/gowebapi/webapi/dom/domcore"
	"github.com/gowebapi/webapi/dom/permissions"
	"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 USBDirection int
const (
	InUSBDirection USBDirection = iota
	OutUSBDirection
)
var uSBDirectionToWasmTable = []string{
	"in", "out",
}
var uSBDirectionFromWasmTable = map[string]USBDirection{
	"in": InUSBDirection, "out": OutUSBDirection,
}
func (this *USBDirection) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this USBDirection) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(uSBDirectionToWasmTable) {
		return uSBDirectionToWasmTable[idx]
	}
	panic("unknown input value")
}
func USBDirectionFromJS(value js.Value) USBDirection {
	key := value.String()
	conv, ok := uSBDirectionFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type USBEndpointType int
const (
	BulkUSBEndpointType USBEndpointType = iota
	InterruptUSBEndpointType
	IsochronousUSBEndpointType
)
var uSBEndpointTypeToWasmTable = []string{
	"bulk", "interrupt", "isochronous",
}
var uSBEndpointTypeFromWasmTable = map[string]USBEndpointType{
	"bulk": BulkUSBEndpointType, "interrupt": InterruptUSBEndpointType, "isochronous": IsochronousUSBEndpointType,
}
func (this *USBEndpointType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this USBEndpointType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(uSBEndpointTypeToWasmTable) {
		return uSBEndpointTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func USBEndpointTypeFromJS(value js.Value) USBEndpointType {
	key := value.String()
	conv, ok := uSBEndpointTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type USBRecipient int
const (
	DeviceUSBRecipient USBRecipient = iota
	InterfaceUSBRecipient
	EndpointUSBRecipient
	OtherUSBRecipient
)
var uSBRecipientToWasmTable = []string{
	"device", "interface", "endpoint", "other",
}
var uSBRecipientFromWasmTable = map[string]USBRecipient{
	"device": DeviceUSBRecipient, "interface": InterfaceUSBRecipient, "endpoint": EndpointUSBRecipient, "other": OtherUSBRecipient,
}
func (this *USBRecipient) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this USBRecipient) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(uSBRecipientToWasmTable) {
		return uSBRecipientToWasmTable[idx]
	}
	panic("unknown input value")
}
func USBRecipientFromJS(value js.Value) USBRecipient {
	key := value.String()
	conv, ok := uSBRecipientFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type USBRequestType int
const (
	StandardUSBRequestType USBRequestType = iota
	ClassUSBRequestType
	VendorUSBRequestType
)
var uSBRequestTypeToWasmTable = []string{
	"standard", "class", "vendor",
}
var uSBRequestTypeFromWasmTable = map[string]USBRequestType{
	"standard": StandardUSBRequestType, "class": ClassUSBRequestType, "vendor": VendorUSBRequestType,
}
func (this *USBRequestType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this USBRequestType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(uSBRequestTypeToWasmTable) {
		return uSBRequestTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func USBRequestTypeFromJS(value js.Value) USBRequestType {
	key := value.String()
	conv, ok := uSBRequestTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type USBTransferStatus int
const (
	OkUSBTransferStatus USBTransferStatus = iota
	StallUSBTransferStatus
	BabbleUSBTransferStatus
)
var uSBTransferStatusToWasmTable = []string{
	"ok", "stall", "babble",
}
var uSBTransferStatusFromWasmTable = map[string]USBTransferStatus{
	"ok": OkUSBTransferStatus, "stall": StallUSBTransferStatus, "babble": BabbleUSBTransferStatus,
}
func (this *USBTransferStatus) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this USBTransferStatus) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(uSBTransferStatusToWasmTable) {
		return uSBTransferStatusToWasmTable[idx]
	}
	panic("unknown input value")
}
func USBTransferStatusFromJS(value js.Value) USBTransferStatus {
	key := value.String()
	conv, ok := uSBTransferStatusFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PromiseSequenceUSBDeviceOnFulfilledFunc func(value []*USBDevice)
type PromiseSequenceUSBDeviceOnFulfilled js.Func
func PromiseSequenceUSBDeviceOnFulfilledToJS(callback PromiseSequenceUSBDeviceOnFulfilledFunc) *PromiseSequenceUSBDeviceOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseSequenceUSBDeviceOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 []*USBDevice  
		)
		__length0 := args[0].Length()
		__array0 := make([]*USBDevice, __length0, __length0)
		for __idx0 := 0; __idx0 < __length0; __idx0++ {
			var __seq_out0 *USBDevice
			__seq_in0 := args[0].Index(__idx0)
			__seq_out0 = USBDeviceFromJS(__seq_in0)
			__array0[__idx0] = __seq_out0
		}
		_p0 = __array0
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseSequenceUSBDeviceOnFulfilledFromJS(_value js.Value) PromiseSequenceUSBDeviceOnFulfilledFunc {
	return func(value []*USBDevice) {
		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 PromiseSequenceUSBDeviceOnRejectedFunc func(reason js.Value)
type PromiseSequenceUSBDeviceOnRejected js.Func
func PromiseSequenceUSBDeviceOnRejectedToJS(callback PromiseSequenceUSBDeviceOnRejectedFunc) *PromiseSequenceUSBDeviceOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseSequenceUSBDeviceOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseSequenceUSBDeviceOnRejectedFromJS(_value js.Value) PromiseSequenceUSBDeviceOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBDeviceOnFulfilledFunc func(value *USBDevice)
type PromiseUSBDeviceOnFulfilled js.Func
func PromiseUSBDeviceOnFulfilledToJS(callback PromiseUSBDeviceOnFulfilledFunc) *PromiseUSBDeviceOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBDeviceOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *USBDevice  
		)
		_p0 = USBDeviceFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBDeviceOnFulfilledFromJS(_value js.Value) PromiseUSBDeviceOnFulfilledFunc {
	return func(value *USBDevice) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBDeviceOnRejectedFunc func(reason js.Value)
type PromiseUSBDeviceOnRejected js.Func
func PromiseUSBDeviceOnRejectedToJS(callback PromiseUSBDeviceOnRejectedFunc) *PromiseUSBDeviceOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBDeviceOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBDeviceOnRejectedFromJS(_value js.Value) PromiseUSBDeviceOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBInTransferResultOnFulfilledFunc func(value *USBInTransferResult)
type PromiseUSBInTransferResultOnFulfilled js.Func
func PromiseUSBInTransferResultOnFulfilledToJS(callback PromiseUSBInTransferResultOnFulfilledFunc) *PromiseUSBInTransferResultOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBInTransferResultOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *USBInTransferResult  
		)
		_p0 = USBInTransferResultFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBInTransferResultOnFulfilledFromJS(_value js.Value) PromiseUSBInTransferResultOnFulfilledFunc {
	return func(value *USBInTransferResult) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBInTransferResultOnRejectedFunc func(reason js.Value)
type PromiseUSBInTransferResultOnRejected js.Func
func PromiseUSBInTransferResultOnRejectedToJS(callback PromiseUSBInTransferResultOnRejectedFunc) *PromiseUSBInTransferResultOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBInTransferResultOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBInTransferResultOnRejectedFromJS(_value js.Value) PromiseUSBInTransferResultOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBIsochronousInTransferResultOnFulfilledFunc func(value *USBIsochronousInTransferResult)
type PromiseUSBIsochronousInTransferResultOnFulfilled js.Func
func PromiseUSBIsochronousInTransferResultOnFulfilledToJS(callback PromiseUSBIsochronousInTransferResultOnFulfilledFunc) *PromiseUSBIsochronousInTransferResultOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBIsochronousInTransferResultOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *USBIsochronousInTransferResult  
		)
		_p0 = USBIsochronousInTransferResultFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBIsochronousInTransferResultOnFulfilledFromJS(_value js.Value) PromiseUSBIsochronousInTransferResultOnFulfilledFunc {
	return func(value *USBIsochronousInTransferResult) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBIsochronousInTransferResultOnRejectedFunc func(reason js.Value)
type PromiseUSBIsochronousInTransferResultOnRejected js.Func
func PromiseUSBIsochronousInTransferResultOnRejectedToJS(callback PromiseUSBIsochronousInTransferResultOnRejectedFunc) *PromiseUSBIsochronousInTransferResultOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBIsochronousInTransferResultOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBIsochronousInTransferResultOnRejectedFromJS(_value js.Value) PromiseUSBIsochronousInTransferResultOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBIsochronousOutTransferResultOnFulfilledFunc func(value *USBIsochronousOutTransferResult)
type PromiseUSBIsochronousOutTransferResultOnFulfilled js.Func
func PromiseUSBIsochronousOutTransferResultOnFulfilledToJS(callback PromiseUSBIsochronousOutTransferResultOnFulfilledFunc) *PromiseUSBIsochronousOutTransferResultOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBIsochronousOutTransferResultOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *USBIsochronousOutTransferResult  
		)
		_p0 = USBIsochronousOutTransferResultFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBIsochronousOutTransferResultOnFulfilledFromJS(_value js.Value) PromiseUSBIsochronousOutTransferResultOnFulfilledFunc {
	return func(value *USBIsochronousOutTransferResult) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBIsochronousOutTransferResultOnRejectedFunc func(reason js.Value)
type PromiseUSBIsochronousOutTransferResultOnRejected js.Func
func PromiseUSBIsochronousOutTransferResultOnRejectedToJS(callback PromiseUSBIsochronousOutTransferResultOnRejectedFunc) *PromiseUSBIsochronousOutTransferResultOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBIsochronousOutTransferResultOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBIsochronousOutTransferResultOnRejectedFromJS(_value js.Value) PromiseUSBIsochronousOutTransferResultOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBOutTransferResultOnFulfilledFunc func(value *USBOutTransferResult)
type PromiseUSBOutTransferResultOnFulfilled js.Func
func PromiseUSBOutTransferResultOnFulfilledToJS(callback PromiseUSBOutTransferResultOnFulfilledFunc) *PromiseUSBOutTransferResultOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBOutTransferResultOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *USBOutTransferResult  
		)
		_p0 = USBOutTransferResultFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBOutTransferResultOnFulfilledFromJS(_value js.Value) PromiseUSBOutTransferResultOnFulfilledFunc {
	return func(value *USBOutTransferResult) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseUSBOutTransferResultOnRejectedFunc func(reason js.Value)
type PromiseUSBOutTransferResultOnRejected js.Func
func PromiseUSBOutTransferResultOnRejectedToJS(callback PromiseUSBOutTransferResultOnRejectedFunc) *PromiseUSBOutTransferResultOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseUSBOutTransferResultOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseUSBOutTransferResultOnRejectedFromJS(_value js.Value) PromiseUSBOutTransferResultOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type AllowedUSBDevice struct {
	VendorId     int
	ProductId    int
	SerialNumber string
}
func (_this *AllowedUSBDevice) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.VendorId
	out.Set("vendorId", value0)
	value1 := _this.ProductId
	out.Set("productId", value1)
	value2 := _this.SerialNumber
	out.Set("serialNumber", value2)
	return out
}