func (this KeyType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(keyTypeToWasmTable) {
		return keyTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
Value is converting this into javascript defined
string value
package crypto
import "syscall/js"
import (
	"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 KeyFormat int
const (
	RawKeyFormat KeyFormat = iota
	SpkiKeyFormat
	Pkcs8KeyFormat
	JwkKeyFormat
)
var keyFormatToWasmTable = []string{
	"raw", "spki", "pkcs8", "jwk",
}
var keyFormatFromWasmTable = map[string]KeyFormat{
	"raw": RawKeyFormat, "spki": SpkiKeyFormat, "pkcs8": Pkcs8KeyFormat, "jwk": JwkKeyFormat,
}
func (this *KeyFormat) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this KeyFormat) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(keyFormatToWasmTable) {
		return keyFormatToWasmTable[idx]
	}
	panic("unknown input value")
}
func KeyFormatFromJS(value js.Value) KeyFormat {
	key := value.String()
	conv, ok := keyFormatFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type KeyType int
const (
	PublicKeyType KeyType = iota
	PrivateKeyType
	SecretKeyType
)
var keyTypeToWasmTable = []string{
	"public", "private", "secret",
}
var keyTypeFromWasmTable = map[string]KeyType{
	"public": PublicKeyType, "private": PrivateKeyType, "secret": SecretKeyType,
}
func (this *KeyType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}