func AesKeyGenParamsFromJS(value js.Wrapper) *AesKeyGenParams {
	input := value.JSValue()
	var out AesKeyGenParams
	var (
		value0 string  
		value1 int     
	)
	value0 = (input.Get("name")).String()
	out.Name = value0
	value1 = (input.Get("length")).Int()
	out.Length = value1
	return &out
}
AesKeyGenParamsFromJS is allocating a new
AesKeyGenParams object and copy all values from
input javascript object
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())
}
func (this KeyType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(keyTypeToWasmTable) {
		return keyTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func KeyTypeFromJS(value js.Value) KeyType {
	key := value.String()
	conv, ok := keyTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type KeyUsage int
const (
	EncryptKeyUsage KeyUsage = iota
	DecryptKeyUsage
	SignKeyUsage
	VerifyKeyUsage
	DeriveKeyKeyUsage
	DeriveBitsKeyUsage
	WrapKeyKeyUsage
	UnwrapKeyKeyUsage
)
var keyUsageToWasmTable = []string{
	"encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey",
}
var keyUsageFromWasmTable = map[string]KeyUsage{
	"encrypt": EncryptKeyUsage, "decrypt": DecryptKeyUsage, "sign": SignKeyUsage, "verify": VerifyKeyUsage, "deriveKey": DeriveKeyKeyUsage, "deriveBits": DeriveBitsKeyUsage, "wrapKey": WrapKeyKeyUsage, "unwrapKey": UnwrapKeyKeyUsage,
}
func (this *KeyUsage) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this KeyUsage) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(keyUsageToWasmTable) {
		return keyUsageToWasmTable[idx]
	}
	panic("unknown input value")
}
func KeyUsageFromJS(value js.Value) KeyUsage {
	key := value.String()
	conv, ok := keyUsageFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PromiseCryptoKeyOnFulfilledFunc func(value *CryptoKey)
type PromiseCryptoKeyOnFulfilled js.Func
func PromiseCryptoKeyOnFulfilledToJS(callback PromiseCryptoKeyOnFulfilledFunc) *PromiseCryptoKeyOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseCryptoKeyOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *CryptoKey  
		)
		_p0 = CryptoKeyFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseCryptoKeyOnFulfilledFromJS(_value js.Value) PromiseCryptoKeyOnFulfilledFunc {
	return func(value *CryptoKey) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseCryptoKeyOnRejectedFunc func(reason js.Value)
type PromiseCryptoKeyOnRejected js.Func
func PromiseCryptoKeyOnRejectedToJS(callback PromiseCryptoKeyOnRejectedFunc) *PromiseCryptoKeyOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseCryptoKeyOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseCryptoKeyOnRejectedFromJS(_value js.Value) PromiseCryptoKeyOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type AesCbcParams struct {
	Name string
	Iv   *Union
}
func (_this *AesCbcParams) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Name
	out.Set("name", value0)
	value1 := _this.Iv.JSValue()
	out.Set("iv", value1)
	return out
}
func AesCbcParamsFromJS(value js.Wrapper) *AesCbcParams {
	input := value.JSValue()
	var out AesCbcParams
	var (
		value0 string  
		value1 *Union  
	)
	value0 = (input.Get("name")).String()
	out.Name = value0
	value1 = UnionFromJS(input.Get("iv"))
	out.Iv = value1
	return &out
}
type AesCtrParams struct {
	Name    string
	Counter *Union
	Length  int
}
func (_this *AesCtrParams) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Name
	out.Set("name", value0)
	value1 := _this.Counter.JSValue()
	out.Set("counter", value1)
	value2 := _this.Length
	out.Set("length", value2)
	return out
}
func AesCtrParamsFromJS(value js.Wrapper) *AesCtrParams {
	input := value.JSValue()
	var out AesCtrParams
	var (
		value0 string  
		value1 *Union  
		value2 int     
	)
	value0 = (input.Get("name")).String()
	out.Name = value0
	value1 = UnionFromJS(input.Get("counter"))
	out.Counter = value1
	value2 = (input.Get("length")).Int()
	out.Length = value2
	return &out
}
type AesDerivedKeyParams struct {
	Name   string
	Length int
}
func (_this *AesDerivedKeyParams) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Name
	out.Set("name", value0)
	value1 := _this.Length
	out.Set("length", value1)
	return out
}
func AesDerivedKeyParamsFromJS(value js.Wrapper) *AesDerivedKeyParams {
	input := value.JSValue()
	var out AesDerivedKeyParams
	var (
		value0 string  
		value1 int     
	)
	value0 = (input.Get("name")).String()
	out.Name = value0
	value1 = (input.Get("length")).Int()
	out.Length = value1
	return &out
}
type AesGcmParams struct {
	Name           string
	Iv             *Union
	AdditionalData *Union
	TagLength      int
}
func (_this *AesGcmParams) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Name
	out.Set("name", value0)
	value1 := _this.Iv.JSValue()
	out.Set("iv", value1)
	value2 := _this.AdditionalData.JSValue()
	out.Set("additionalData", value2)
	value3 := _this.TagLength
	out.Set("tagLength", value3)
	return out
}
func AesGcmParamsFromJS(value js.Wrapper) *AesGcmParams {
	input := value.JSValue()
	var out AesGcmParams
	var (
		value0 string  
		value1 *Union  
		value2 *Union  
		value3 int     
	)
	value0 = (input.Get("name")).String()
	out.Name = value0
	value1 = UnionFromJS(input.Get("iv"))
	out.Iv = value1
	value2 = UnionFromJS(input.Get("additionalData"))
	out.AdditionalData = value2
	value3 = (input.Get("tagLength")).Int()
	out.TagLength = value3
	return &out
}
type AesKeyAlgorithm struct {
	Name   string
	Length int
}
func (_this *AesKeyAlgorithm) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Name
	out.Set("name", value0)
	value1 := _this.Length
	out.Set("length", value1)
	return out
}
func AesKeyAlgorithmFromJS(value js.Wrapper) *AesKeyAlgorithm {
	input := value.JSValue()
	var out AesKeyAlgorithm
	var (
		value0 string  
		value1 int     
	)
	value0 = (input.Get("name")).String()
	out.Name = value0
	value1 = (input.Get("length")).Int()
	out.Length = value1
	return &out
}
type AesKeyGenParams struct {
	Name   string
	Length int
}
func (_this *AesKeyGenParams) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Name
	out.Set("name", value0)
	value1 := _this.Length
	out.Set("length", value1)
	return out
}