func (this USBEndpointType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(uSBEndpointTypeToWasmTable) {
		return uSBEndpointTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
Value is converting this into javascript defined
string value
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())
}