func PublicKeyCredentialParametersFromJS(value js.Wrapper) *PublicKeyCredentialParameters {
	input := value.JSValue()
	var out PublicKeyCredentialParameters
	var (
		value0 PublicKeyCredentialType  
		value1 int                      
	)
	value0 = PublicKeyCredentialTypeFromJS(input.Get("type"))
	out.Type = value0
	value1 = (input.Get("alg")).Int()
	out.Alg = value1
	return &out
}
PublicKeyCredentialParametersFromJS is allocating a new
PublicKeyCredentialParameters object and copy all values from
input javascript object
package credential
import js "github.com/gowebapi/webapi/core/js"
import (
	"github.com/gowebapi/webapi/crypto/authentication"
	"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 CredentialMediationRequirement int
const (
	SilentCredentialMediationRequirement CredentialMediationRequirement = iota
	OptionalCredentialMediationRequirement
	RequiredCredentialMediationRequirement
)
var credentialMediationRequirementToWasmTable = []string{
	"silent", "optional", "required",
}
var credentialMediationRequirementFromWasmTable = map[string]CredentialMediationRequirement{
	"silent": SilentCredentialMediationRequirement, "optional": OptionalCredentialMediationRequirement, "required": RequiredCredentialMediationRequirement,
}
func (this *CredentialMediationRequirement) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this CredentialMediationRequirement) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(credentialMediationRequirementToWasmTable) {
		return credentialMediationRequirementToWasmTable[idx]
	}
	panic("unknown input value")
}
func CredentialMediationRequirementFromJS(value js.Value) CredentialMediationRequirement {
	key := value.String()
	conv, ok := credentialMediationRequirementFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PublicKeyCredentialType int
const (
	PublicKeyPublicKeyCredentialType PublicKeyCredentialType = iota
)
var publicKeyCredentialTypeToWasmTable = []string{
	"public-key",
}
var publicKeyCredentialTypeFromWasmTable = map[string]PublicKeyCredentialType{
	"public-key": PublicKeyPublicKeyCredentialType,
}
func (this *PublicKeyCredentialType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this PublicKeyCredentialType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(publicKeyCredentialTypeToWasmTable) {
		return publicKeyCredentialTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func PublicKeyCredentialTypeFromJS(value js.Value) PublicKeyCredentialType {
	key := value.String()
	conv, ok := publicKeyCredentialTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type PromiseCredentialOnFulfilledFunc func(value *Credential)
type PromiseCredentialOnFulfilled js.Func
func PromiseCredentialOnFulfilledToJS(callback PromiseCredentialOnFulfilledFunc) *PromiseCredentialOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseCredentialOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *Credential  
		)
		_p0 = CredentialFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseCredentialOnFulfilledFromJS(_value js.Value) PromiseCredentialOnFulfilledFunc {
	return func(value *Credential) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseCredentialOnRejectedFunc func(reason js.Value)
type PromiseCredentialOnRejected js.Func
func PromiseCredentialOnRejectedToJS(callback PromiseCredentialOnRejectedFunc) *PromiseCredentialOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseCredentialOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseCredentialOnRejectedFromJS(_value js.Value) PromiseCredentialOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseNilCredentialOnFulfilledFunc func(value *Credential)
type PromiseNilCredentialOnFulfilled js.Func
func PromiseNilCredentialOnFulfilledToJS(callback PromiseNilCredentialOnFulfilledFunc) *PromiseNilCredentialOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseNilCredentialOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *Credential  
		)
		_p0 = CredentialFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseNilCredentialOnFulfilledFromJS(_value js.Value) PromiseNilCredentialOnFulfilledFunc {
	return func(value *Credential) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseNilCredentialOnRejectedFunc func(reason js.Value)
type PromiseNilCredentialOnRejected js.Func
func PromiseNilCredentialOnRejectedToJS(callback PromiseNilCredentialOnRejectedFunc) *PromiseNilCredentialOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseNilCredentialOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseNilCredentialOnRejectedFromJS(_value js.Value) PromiseNilCredentialOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type CredentialCreationOptions struct {
	Signal    *domcore.AbortSignal
	Password  *Union
	Federated *FederatedCredentialInit
	PublicKey *PublicKeyCredentialCreationOptions
}
func (_this *CredentialCreationOptions) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Signal.JSValue()
	out.Set("signal", value0)
	value1 := _this.Password.JSValue()
	out.Set("password", value1)
	value2 := _this.Federated.JSValue()
	out.Set("federated", value2)
	value3 := _this.PublicKey.JSValue()
	out.Set("publicKey", value3)
	return out
}
func CredentialCreationOptionsFromJS(value js.Wrapper) *CredentialCreationOptions {
	input := value.JSValue()
	var out CredentialCreationOptions
	var (
		value0 *domcore.AbortSignal                 
		value1 *Union                               
		value2 *FederatedCredentialInit             
		value3 *PublicKeyCredentialCreationOptions  
	)
	value0 = domcore.AbortSignalFromJS(input.Get("signal"))
	out.Signal = value0
	value1 = UnionFromJS(input.Get("password"))
	out.Password = value1
	value2 = FederatedCredentialInitFromJS(input.Get("federated"))
	out.Federated = value2
	value3 = PublicKeyCredentialCreationOptionsFromJS(input.Get("publicKey"))
	out.PublicKey = value3
	return &out
}
type CredentialData struct {
	Id string
}
func (_this *CredentialData) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Id
	out.Set("id", value0)
	return out
}
func CredentialDataFromJS(value js.Wrapper) *CredentialData {
	input := value.JSValue()
	var out CredentialData
	var (
		value0 string  
	)
	value0 = (input.Get("id")).String()
	out.Id = value0
	return &out
}
type CredentialRequestOptions struct {
	Mediation CredentialMediationRequirement
	Signal    *domcore.AbortSignal
	Password  bool
	Federated *FederatedCredentialRequestOptions
	PublicKey *PublicKeyCredentialRequestOptions
}
func (_this *CredentialRequestOptions) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Mediation.JSValue()
	out.Set("mediation", value0)
	value1 := _this.Signal.JSValue()
	out.Set("signal", value1)
	value2 := _this.Password
	out.Set("password", value2)
	value3 := _this.Federated.JSValue()
	out.Set("federated", value3)
	value4 := _this.PublicKey.JSValue()
	out.Set("publicKey", value4)
	return out
}
func CredentialRequestOptionsFromJS(value js.Wrapper) *CredentialRequestOptions {
	input := value.JSValue()
	var out CredentialRequestOptions
	var (
		value0 CredentialMediationRequirement      
		value1 *domcore.AbortSignal                
		value2 bool                                
		value3 *FederatedCredentialRequestOptions  
		value4 *PublicKeyCredentialRequestOptions  
	)
	value0 = CredentialMediationRequirementFromJS(input.Get("mediation"))
	out.Mediation = value0
	value1 = domcore.AbortSignalFromJS(input.Get("signal"))
	out.Signal = value1
	value2 = (input.Get("password")).Bool()
	out.Password = value2
	value3 = FederatedCredentialRequestOptionsFromJS(input.Get("federated"))
	out.Federated = value3
	value4 = PublicKeyCredentialRequestOptionsFromJS(input.Get("publicKey"))
	out.PublicKey = value4
	return &out
}
type FederatedCredentialInit struct {
	Id       string
	Name     string
	IconURL  string
	Origin   string
	Provider string
	Protocol string
}
func (_this *FederatedCredentialInit) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Id
	out.Set("id", value0)
	value1 := _this.Name
	out.Set("name", value1)
	value2 := _this.IconURL
	out.Set("iconURL", value2)
	value3 := _this.Origin
	out.Set("origin", value3)
	value4 := _this.Provider
	out.Set("provider", value4)
	value5 := _this.Protocol
	out.Set("protocol", value5)
	return out
}
func FederatedCredentialInitFromJS(value js.Wrapper) *FederatedCredentialInit {
	input := value.JSValue()
	var out FederatedCredentialInit
	var (
		value0 string  
		value1 string  
		value2 string  
		value3 string  
		value4 string  
		value5 string  
	)
	value0 = (input.Get("id")).String()
	out.Id = value0
	value1 = (input.Get("name")).String()
	out.Name = value1
	value2 = (input.Get("iconURL")).String()
	out.IconURL = value2
	value3 = (input.Get("origin")).String()
	out.Origin = value3
	value4 = (input.Get("provider")).String()
	out.Provider = value4
	value5 = (input.Get("protocol")).String()
	out.Protocol = value5
	return &out
}
type FederatedCredentialRequestOptions struct {
	Providers []string
	Protocols []string
}
func (_this *FederatedCredentialRequestOptions) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := js.Global().Get("Array").New(len(_this.Providers))
	for __idx0, __seq_in0 := range _this.Providers {
		__seq_out0 := __seq_in0
		value0.SetIndex(__idx0, __seq_out0)
	}
	out.Set("providers", value0)
	value1 := js.Global().Get("Array").New(len(_this.Protocols))
	for __idx1, __seq_in1 := range _this.Protocols {
		__seq_out1 := __seq_in1
		value1.SetIndex(__idx1, __seq_out1)
	}
	out.Set("protocols", value1)
	return out
}
func FederatedCredentialRequestOptionsFromJS(value js.Wrapper) *FederatedCredentialRequestOptions {
	input := value.JSValue()
	var out FederatedCredentialRequestOptions
	var (
		value0 []string  
		value1 []string  
	)
	__length0 := input.Get("providers").Length()
	__array0 := make([]string, __length0, __length0)
	for __idx0 := 0; __idx0 < __length0; __idx0++ {
		var __seq_out0 string
		__seq_in0 := input.Get("providers").Index(__idx0)
		__seq_out0 = (__seq_in0).String()
		__array0[__idx0] = __seq_out0
	}
	value0 = __array0
	out.Providers = value0
	__length1 := input.Get("protocols").Length()
	__array1 := make([]string, __length1, __length1)
	for __idx1 := 0; __idx1 < __length1; __idx1++ {
		var __seq_out1 string
		__seq_in1 := input.Get("protocols").Index(__idx1)
		__seq_out1 = (__seq_in1).String()
		__array1[__idx1] = __seq_out1
	}
	value1 = __array1
	out.Protocols = value1
	return &out
}
type PasswordCredentialData struct {
	Id       string
	Name     string
	IconURL  string
	Origin   string
	Password string
}
func (_this *PasswordCredentialData) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Id
	out.Set("id", value0)
	value1 := _this.Name
	out.Set("name", value1)
	value2 := _this.IconURL
	out.Set("iconURL", value2)
	value3 := _this.Origin
	out.Set("origin", value3)
	value4 := _this.Password
	out.Set("password", value4)
	return out
}
func PasswordCredentialDataFromJS(value js.Wrapper) *PasswordCredentialData {
	input := value.JSValue()
	var out PasswordCredentialData
	var (
		value0 string  
		value1 string  
		value2 string  
		value3 string  
		value4 string  
	)
	value0 = (input.Get("id")).String()
	out.Id = value0
	value1 = (input.Get("name")).String()
	out.Name = value1
	value2 = (input.Get("iconURL")).String()
	out.IconURL = value2
	value3 = (input.Get("origin")).String()
	out.Origin = value3
	value4 = (input.Get("password")).String()
	out.Password = value4
	return &out
}
type PublicKeyCredentialCreationOptions struct {
	Rp                     *PublicKeyCredentialRpEntity
	User                   *PublicKeyCredentialUserEntity
	Challenge              *Union
	PubKeyCredParams       []*PublicKeyCredentialParameters
	Timeout                uint
	ExcludeCredentials     []*PublicKeyCredentialDescriptor
	AuthenticatorSelection *authentication.SelectionCriteria
	Attestation            authentication.AttestationConveyancePreference
	Extensions             *authentication.AuthenticationExtensionsClientInputs
}
func (_this *PublicKeyCredentialCreationOptions) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Rp.JSValue()
	out.Set("rp", value0)
	value1 := _this.User.JSValue()
	out.Set("user", value1)
	value2 := _this.Challenge.JSValue()
	out.Set("challenge", value2)
	value3 := js.Global().Get("Array").New(len(_this.PubKeyCredParams))
	for __idx3, __seq_in3 := range _this.PubKeyCredParams {
		__seq_out3 := __seq_in3.JSValue()
		value3.SetIndex(__idx3, __seq_out3)
	}
	out.Set("pubKeyCredParams", value3)
	value4 := _this.Timeout
	out.Set("timeout", value4)
	value5 := js.Global().Get("Array").New(len(_this.ExcludeCredentials))
	for __idx5, __seq_in5 := range _this.ExcludeCredentials {
		__seq_out5 := __seq_in5.JSValue()
		value5.SetIndex(__idx5, __seq_out5)
	}
	out.Set("excludeCredentials", value5)
	value6 := _this.AuthenticatorSelection.JSValue()
	out.Set("authenticatorSelection", value6)
	value7 := _this.Attestation.JSValue()
	out.Set("attestation", value7)
	value8 := _this.Extensions.JSValue()
	out.Set("extensions", value8)
	return out
}
func PublicKeyCredentialCreationOptionsFromJS(value js.Wrapper) *PublicKeyCredentialCreationOptions {
	input := value.JSValue()
	var out PublicKeyCredentialCreationOptions
	var (
		value0 *PublicKeyCredentialRpEntity                          
		value1 *PublicKeyCredentialUserEntity                        
		value2 *Union                                                
		value3 []*PublicKeyCredentialParameters                      
		value4 uint                                                  
		value5 []*PublicKeyCredentialDescriptor                      
		value6 *authentication.SelectionCriteria                     
		value7 authentication.AttestationConveyancePreference        
		value8 *authentication.AuthenticationExtensionsClientInputs  
	)
	value0 = PublicKeyCredentialRpEntityFromJS(input.Get("rp"))
	out.Rp = value0
	value1 = PublicKeyCredentialUserEntityFromJS(input.Get("user"))
	out.User = value1
	value2 = UnionFromJS(input.Get("challenge"))
	out.Challenge = value2
	__length3 := input.Get("pubKeyCredParams").Length()
	__array3 := make([]*PublicKeyCredentialParameters, __length3, __length3)
	for __idx3 := 0; __idx3 < __length3; __idx3++ {
		var __seq_out3 *PublicKeyCredentialParameters
		__seq_in3 := input.Get("pubKeyCredParams").Index(__idx3)
		__seq_out3 = PublicKeyCredentialParametersFromJS(__seq_in3)
		__array3[__idx3] = __seq_out3
	}
	value3 = __array3
	out.PubKeyCredParams = value3
	value4 = (uint)((input.Get("timeout")).Int())
	out.Timeout = value4
	__length5 := input.Get("excludeCredentials").Length()
	__array5 := make([]*PublicKeyCredentialDescriptor, __length5, __length5)
	for __idx5 := 0; __idx5 < __length5; __idx5++ {
		var __seq_out5 *PublicKeyCredentialDescriptor
		__seq_in5 := input.Get("excludeCredentials").Index(__idx5)
		__seq_out5 = PublicKeyCredentialDescriptorFromJS(__seq_in5)
		__array5[__idx5] = __seq_out5
	}
	value5 = __array5
	out.ExcludeCredentials = value5
	value6 = authentication.SelectionCriteriaFromJS(input.Get("authenticatorSelection"))
	out.AuthenticatorSelection = value6
	value7 = authentication.AttestationConveyancePreferenceFromJS(input.Get("attestation"))
	out.Attestation = value7
	value8 = authentication.AuthenticationExtensionsClientInputsFromJS(input.Get("extensions"))
	out.Extensions = value8
	return &out
}
type PublicKeyCredentialDescriptor struct {
	Type       PublicKeyCredentialType
	Id         *Union
	Transports []authentication.Transport
}
func (_this *PublicKeyCredentialDescriptor) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Type.JSValue()
	out.Set("type", value0)
	value1 := _this.Id.JSValue()
	out.Set("id", value1)
	value2 := js.Global().Get("Array").New(len(_this.Transports))
	for __idx2, __seq_in2 := range _this.Transports {
		__seq_out2 := __seq_in2.JSValue()
		value2.SetIndex(__idx2, __seq_out2)
	}
	out.Set("transports", value2)
	return out
}
func PublicKeyCredentialDescriptorFromJS(value js.Wrapper) *PublicKeyCredentialDescriptor {
	input := value.JSValue()
	var out PublicKeyCredentialDescriptor
	var (
		value0 PublicKeyCredentialType     
		value1 *Union                      
		value2 []authentication.Transport  
	)
	value0 = PublicKeyCredentialTypeFromJS(input.Get("type"))
	out.Type = value0
	value1 = UnionFromJS(input.Get("id"))
	out.Id = value1
	__length2 := input.Get("transports").Length()
	__array2 := make([]authentication.Transport, __length2, __length2)
	for __idx2 := 0; __idx2 < __length2; __idx2++ {
		var __seq_out2 authentication.Transport
		__seq_in2 := input.Get("transports").Index(__idx2)
		__seq_out2 = authentication.TransportFromJS(__seq_in2)
		__array2[__idx2] = __seq_out2
	}
	value2 = __array2
	out.Transports = value2
	return &out
}
type PublicKeyCredentialEntity struct {
	Name string
	Icon string
}
func (_this *PublicKeyCredentialEntity) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Name
	out.Set("name", value0)
	value1 := _this.Icon
	out.Set("icon", value1)
	return out
}
func PublicKeyCredentialEntityFromJS(value js.Wrapper) *PublicKeyCredentialEntity {
	input := value.JSValue()
	var out PublicKeyCredentialEntity
	var (
		value0 string  
		value1 string  
	)
	value0 = (input.Get("name")).String()
	out.Name = value0
	value1 = (input.Get("icon")).String()
	out.Icon = value1
	return &out
}
type PublicKeyCredentialParameters struct {
	Type PublicKeyCredentialType
	Alg  int
}
func (_this *PublicKeyCredentialParameters) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Type.JSValue()
	out.Set("type", value0)
	value1 := _this.Alg
	out.Set("alg", value1)
	return out
}