github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/certificateprovider/apis_js_wasm.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package certificateprovider
     5  
     6  import (
     7  	"github.com/primecitizens/pcz/std/core/abi"
     8  	"github.com/primecitizens/pcz/std/core/mark"
     9  	"github.com/primecitizens/pcz/std/ffi/js"
    10  	"github.com/primecitizens/pcz/std/plat/js/webext/certificateprovider/bindings"
    11  )
    12  
    13  type Algorithm uint32
    14  
    15  const (
    16  	_ Algorithm = iota
    17  
    18  	Algorithm_RSASSA_PKCS1_V1_5_MD5_SHA1
    19  	Algorithm_RSASSA_PKCS1_V1_5_SHA1
    20  	Algorithm_RSASSA_PKCS1_V1_5_SHA256
    21  	Algorithm_RSASSA_PKCS1_V1_5_SHA384
    22  	Algorithm_RSASSA_PKCS1_V1_5_SHA512
    23  	Algorithm_RSASSA_PSS_SHA256
    24  	Algorithm_RSASSA_PSS_SHA384
    25  	Algorithm_RSASSA_PSS_SHA512
    26  )
    27  
    28  func (Algorithm) FromRef(str js.Ref) Algorithm {
    29  	return Algorithm(bindings.ConstOfAlgorithm(str))
    30  }
    31  
    32  func (x Algorithm) String() (string, bool) {
    33  	switch x {
    34  	case Algorithm_RSASSA_PKCS1_V1_5_MD5_SHA1:
    35  		return "RSASSA_PKCS1_v1_5_MD5_SHA1", true
    36  	case Algorithm_RSASSA_PKCS1_V1_5_SHA1:
    37  		return "RSASSA_PKCS1_v1_5_SHA1", true
    38  	case Algorithm_RSASSA_PKCS1_V1_5_SHA256:
    39  		return "RSASSA_PKCS1_v1_5_SHA256", true
    40  	case Algorithm_RSASSA_PKCS1_V1_5_SHA384:
    41  		return "RSASSA_PKCS1_v1_5_SHA384", true
    42  	case Algorithm_RSASSA_PKCS1_V1_5_SHA512:
    43  		return "RSASSA_PKCS1_v1_5_SHA512", true
    44  	case Algorithm_RSASSA_PSS_SHA256:
    45  		return "RSASSA_PSS_SHA256", true
    46  	case Algorithm_RSASSA_PSS_SHA384:
    47  		return "RSASSA_PSS_SHA384", true
    48  	case Algorithm_RSASSA_PSS_SHA512:
    49  		return "RSASSA_PSS_SHA512", true
    50  	default:
    51  		return "", false
    52  	}
    53  }
    54  
    55  type Hash uint32
    56  
    57  const (
    58  	_ Hash = iota
    59  
    60  	Hash_MD5_SHA1
    61  	Hash_SHA1
    62  	Hash_SHA256
    63  	Hash_SHA384
    64  	Hash_SHA512
    65  )
    66  
    67  func (Hash) FromRef(str js.Ref) Hash {
    68  	return Hash(bindings.ConstOfHash(str))
    69  }
    70  
    71  func (x Hash) String() (string, bool) {
    72  	switch x {
    73  	case Hash_MD5_SHA1:
    74  		return "MD5_SHA1", true
    75  	case Hash_SHA1:
    76  		return "SHA1", true
    77  	case Hash_SHA256:
    78  		return "SHA256", true
    79  	case Hash_SHA384:
    80  		return "SHA384", true
    81  	case Hash_SHA512:
    82  		return "SHA512", true
    83  	default:
    84  		return "", false
    85  	}
    86  }
    87  
    88  type CertificateInfo struct {
    89  	// Certificate is "CertificateInfo.certificate"
    90  	//
    91  	// Optional
    92  	Certificate js.ArrayBuffer
    93  	// SupportedHashes is "CertificateInfo.supportedHashes"
    94  	//
    95  	// Optional
    96  	SupportedHashes js.Array[Hash]
    97  
    98  	FFI_USE bool
    99  }
   100  
   101  // FromRef calls UpdateFrom and returns a CertificateInfo with all fields set.
   102  func (p CertificateInfo) FromRef(ref js.Ref) CertificateInfo {
   103  	p.UpdateFrom(ref)
   104  	return p
   105  }
   106  
   107  // New creates a new CertificateInfo in the application heap.
   108  func (p CertificateInfo) New() js.Ref {
   109  	return bindings.CertificateInfoJSLoad(
   110  		js.Pointer(&p), js.True, 0,
   111  	)
   112  }
   113  
   114  // UpdateFrom copies value of all fields of the heap object to p.
   115  func (p *CertificateInfo) UpdateFrom(ref js.Ref) {
   116  	bindings.CertificateInfoJSStore(
   117  		js.Pointer(p), ref,
   118  	)
   119  }
   120  
   121  // Update writes all fields of the p to the heap object referenced by ref.
   122  func (p *CertificateInfo) Update(ref js.Ref) {
   123  	bindings.CertificateInfoJSLoad(
   124  		js.Pointer(p), js.False, ref,
   125  	)
   126  }
   127  
   128  // FreeMembers frees fields with heap reference, if recursive is true
   129  // free all heap references reachable from p.
   130  func (p *CertificateInfo) FreeMembers(recursive bool) {
   131  	js.Free(
   132  		p.Certificate.Ref(),
   133  		p.SupportedHashes.Ref(),
   134  	)
   135  	p.Certificate = p.Certificate.FromRef(js.Undefined)
   136  	p.SupportedHashes = p.SupportedHashes.FromRef(js.Undefined)
   137  }
   138  
   139  type CertificatesCallbackFunc func(this js.Ref, certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])]) js.Ref
   140  
   141  func (fn CertificatesCallbackFunc) Register() js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])] {
   142  	return js.RegisterCallback[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])](
   143  		fn, abi.FuncPCABIInternal(fn),
   144  	)
   145  }
   146  
   147  func (fn CertificatesCallbackFunc) DispatchCallback(
   148  	targetPC uintptr, ctx *js.CallbackContext,
   149  ) {
   150  	args := ctx.Args()
   151  	if len(args) != 2+1 /* js this */ ||
   152  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   153  		js.ThrowInvalidCallbackInvocation()
   154  	}
   155  
   156  	if ctx.Return(fn(
   157  		args[0],
   158  
   159  		js.Array[CertificateInfo]{}.FromRef(args[0+1]),
   160  		js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])]{}.FromRef(args[1+1]),
   161  	)) {
   162  		return
   163  	}
   164  
   165  	js.ThrowCallbackValueNotReturned()
   166  }
   167  
   168  type CertificatesCallback[T any] struct {
   169  	Fn  func(arg T, this js.Ref, certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])]) js.Ref
   170  	Arg T
   171  }
   172  
   173  func (cb *CertificatesCallback[T]) Register() js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])] {
   174  	return js.RegisterCallback[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])](
   175  		cb, abi.FuncPCABIInternal(cb.Fn),
   176  	)
   177  }
   178  
   179  func (cb *CertificatesCallback[T]) DispatchCallback(
   180  	targetPC uintptr, ctx *js.CallbackContext,
   181  ) {
   182  	args := ctx.Args()
   183  	if len(args) != 2+1 /* js this */ ||
   184  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   185  		js.ThrowInvalidCallbackInvocation()
   186  	}
   187  
   188  	if ctx.Return(cb.Fn(
   189  		cb.Arg,
   190  		args[0],
   191  
   192  		js.Array[CertificateInfo]{}.FromRef(args[0+1]),
   193  		js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])]{}.FromRef(args[1+1]),
   194  	)) {
   195  		return
   196  	}
   197  
   198  	js.ThrowCallbackValueNotReturned()
   199  }
   200  
   201  type ResultCallbackFunc func(this js.Ref, rejectedCertificates js.Array[js.ArrayBuffer]) js.Ref
   202  
   203  func (fn ResultCallbackFunc) Register() js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])] {
   204  	return js.RegisterCallback[func(rejectedCertificates js.Array[js.ArrayBuffer])](
   205  		fn, abi.FuncPCABIInternal(fn),
   206  	)
   207  }
   208  
   209  func (fn ResultCallbackFunc) DispatchCallback(
   210  	targetPC uintptr, ctx *js.CallbackContext,
   211  ) {
   212  	args := ctx.Args()
   213  	if len(args) != 1+1 /* js this */ ||
   214  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   215  		js.ThrowInvalidCallbackInvocation()
   216  	}
   217  
   218  	if ctx.Return(fn(
   219  		args[0],
   220  
   221  		js.Array[js.ArrayBuffer]{}.FromRef(args[0+1]),
   222  	)) {
   223  		return
   224  	}
   225  
   226  	js.ThrowCallbackValueNotReturned()
   227  }
   228  
   229  type ResultCallback[T any] struct {
   230  	Fn  func(arg T, this js.Ref, rejectedCertificates js.Array[js.ArrayBuffer]) js.Ref
   231  	Arg T
   232  }
   233  
   234  func (cb *ResultCallback[T]) Register() js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])] {
   235  	return js.RegisterCallback[func(rejectedCertificates js.Array[js.ArrayBuffer])](
   236  		cb, abi.FuncPCABIInternal(cb.Fn),
   237  	)
   238  }
   239  
   240  func (cb *ResultCallback[T]) DispatchCallback(
   241  	targetPC uintptr, ctx *js.CallbackContext,
   242  ) {
   243  	args := ctx.Args()
   244  	if len(args) != 1+1 /* js this */ ||
   245  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   246  		js.ThrowInvalidCallbackInvocation()
   247  	}
   248  
   249  	if ctx.Return(cb.Fn(
   250  		cb.Arg,
   251  		args[0],
   252  
   253  		js.Array[js.ArrayBuffer]{}.FromRef(args[0+1]),
   254  	)) {
   255  		return
   256  	}
   257  
   258  	js.ThrowCallbackValueNotReturned()
   259  }
   260  
   261  type CertificatesUpdateRequest struct {
   262  	// CertificatesRequestId is "CertificatesUpdateRequest.certificatesRequestId"
   263  	//
   264  	// Optional
   265  	//
   266  	// NOTE: FFI_USE_CertificatesRequestId MUST be set to true to make this field effective.
   267  	CertificatesRequestId int32
   268  
   269  	FFI_USE_CertificatesRequestId bool // for CertificatesRequestId.
   270  
   271  	FFI_USE bool
   272  }
   273  
   274  // FromRef calls UpdateFrom and returns a CertificatesUpdateRequest with all fields set.
   275  func (p CertificatesUpdateRequest) FromRef(ref js.Ref) CertificatesUpdateRequest {
   276  	p.UpdateFrom(ref)
   277  	return p
   278  }
   279  
   280  // New creates a new CertificatesUpdateRequest in the application heap.
   281  func (p CertificatesUpdateRequest) New() js.Ref {
   282  	return bindings.CertificatesUpdateRequestJSLoad(
   283  		js.Pointer(&p), js.True, 0,
   284  	)
   285  }
   286  
   287  // UpdateFrom copies value of all fields of the heap object to p.
   288  func (p *CertificatesUpdateRequest) UpdateFrom(ref js.Ref) {
   289  	bindings.CertificatesUpdateRequestJSStore(
   290  		js.Pointer(p), ref,
   291  	)
   292  }
   293  
   294  // Update writes all fields of the p to the heap object referenced by ref.
   295  func (p *CertificatesUpdateRequest) Update(ref js.Ref) {
   296  	bindings.CertificatesUpdateRequestJSLoad(
   297  		js.Pointer(p), js.False, ref,
   298  	)
   299  }
   300  
   301  // FreeMembers frees fields with heap reference, if recursive is true
   302  // free all heap references reachable from p.
   303  func (p *CertificatesUpdateRequest) FreeMembers(recursive bool) {
   304  }
   305  
   306  type ClientCertificateInfo struct {
   307  	// CertificateChain is "ClientCertificateInfo.certificateChain"
   308  	//
   309  	// Optional
   310  	CertificateChain js.Array[js.ArrayBuffer]
   311  	// SupportedAlgorithms is "ClientCertificateInfo.supportedAlgorithms"
   312  	//
   313  	// Optional
   314  	SupportedAlgorithms js.Array[Algorithm]
   315  
   316  	FFI_USE bool
   317  }
   318  
   319  // FromRef calls UpdateFrom and returns a ClientCertificateInfo with all fields set.
   320  func (p ClientCertificateInfo) FromRef(ref js.Ref) ClientCertificateInfo {
   321  	p.UpdateFrom(ref)
   322  	return p
   323  }
   324  
   325  // New creates a new ClientCertificateInfo in the application heap.
   326  func (p ClientCertificateInfo) New() js.Ref {
   327  	return bindings.ClientCertificateInfoJSLoad(
   328  		js.Pointer(&p), js.True, 0,
   329  	)
   330  }
   331  
   332  // UpdateFrom copies value of all fields of the heap object to p.
   333  func (p *ClientCertificateInfo) UpdateFrom(ref js.Ref) {
   334  	bindings.ClientCertificateInfoJSStore(
   335  		js.Pointer(p), ref,
   336  	)
   337  }
   338  
   339  // Update writes all fields of the p to the heap object referenced by ref.
   340  func (p *ClientCertificateInfo) Update(ref js.Ref) {
   341  	bindings.ClientCertificateInfoJSLoad(
   342  		js.Pointer(p), js.False, ref,
   343  	)
   344  }
   345  
   346  // FreeMembers frees fields with heap reference, if recursive is true
   347  // free all heap references reachable from p.
   348  func (p *ClientCertificateInfo) FreeMembers(recursive bool) {
   349  	js.Free(
   350  		p.CertificateChain.Ref(),
   351  		p.SupportedAlgorithms.Ref(),
   352  	)
   353  	p.CertificateChain = p.CertificateChain.FromRef(js.Undefined)
   354  	p.SupportedAlgorithms = p.SupportedAlgorithms.FromRef(js.Undefined)
   355  }
   356  
   357  type Error uint32
   358  
   359  const (
   360  	_ Error = iota
   361  
   362  	Error_GENERAL_ERROR
   363  )
   364  
   365  func (Error) FromRef(str js.Ref) Error {
   366  	return Error(bindings.ConstOfError(str))
   367  }
   368  
   369  func (x Error) String() (string, bool) {
   370  	switch x {
   371  	case Error_GENERAL_ERROR:
   372  		return "GENERAL_ERROR", true
   373  	default:
   374  		return "", false
   375  	}
   376  }
   377  
   378  type PinRequestErrorType uint32
   379  
   380  const (
   381  	_ PinRequestErrorType = iota
   382  
   383  	PinRequestErrorType_INVALID_PIN
   384  	PinRequestErrorType_INVALID_PUK
   385  	PinRequestErrorType_MAX_ATTEMPTS_EXCEEDED
   386  	PinRequestErrorType_UNKNOWN_ERROR
   387  )
   388  
   389  func (PinRequestErrorType) FromRef(str js.Ref) PinRequestErrorType {
   390  	return PinRequestErrorType(bindings.ConstOfPinRequestErrorType(str))
   391  }
   392  
   393  func (x PinRequestErrorType) String() (string, bool) {
   394  	switch x {
   395  	case PinRequestErrorType_INVALID_PIN:
   396  		return "INVALID_PIN", true
   397  	case PinRequestErrorType_INVALID_PUK:
   398  		return "INVALID_PUK", true
   399  	case PinRequestErrorType_MAX_ATTEMPTS_EXCEEDED:
   400  		return "MAX_ATTEMPTS_EXCEEDED", true
   401  	case PinRequestErrorType_UNKNOWN_ERROR:
   402  		return "UNKNOWN_ERROR", true
   403  	default:
   404  		return "", false
   405  	}
   406  }
   407  
   408  type PinRequestType uint32
   409  
   410  const (
   411  	_ PinRequestType = iota
   412  
   413  	PinRequestType_PIN
   414  	PinRequestType_PUK
   415  )
   416  
   417  func (PinRequestType) FromRef(str js.Ref) PinRequestType {
   418  	return PinRequestType(bindings.ConstOfPinRequestType(str))
   419  }
   420  
   421  func (x PinRequestType) String() (string, bool) {
   422  	switch x {
   423  	case PinRequestType_PIN:
   424  		return "PIN", true
   425  	case PinRequestType_PUK:
   426  		return "PUK", true
   427  	default:
   428  		return "", false
   429  	}
   430  }
   431  
   432  type PinResponseDetails struct {
   433  	// UserInput is "PinResponseDetails.userInput"
   434  	//
   435  	// Optional
   436  	UserInput js.String
   437  
   438  	FFI_USE bool
   439  }
   440  
   441  // FromRef calls UpdateFrom and returns a PinResponseDetails with all fields set.
   442  func (p PinResponseDetails) FromRef(ref js.Ref) PinResponseDetails {
   443  	p.UpdateFrom(ref)
   444  	return p
   445  }
   446  
   447  // New creates a new PinResponseDetails in the application heap.
   448  func (p PinResponseDetails) New() js.Ref {
   449  	return bindings.PinResponseDetailsJSLoad(
   450  		js.Pointer(&p), js.True, 0,
   451  	)
   452  }
   453  
   454  // UpdateFrom copies value of all fields of the heap object to p.
   455  func (p *PinResponseDetails) UpdateFrom(ref js.Ref) {
   456  	bindings.PinResponseDetailsJSStore(
   457  		js.Pointer(p), ref,
   458  	)
   459  }
   460  
   461  // Update writes all fields of the p to the heap object referenced by ref.
   462  func (p *PinResponseDetails) Update(ref js.Ref) {
   463  	bindings.PinResponseDetailsJSLoad(
   464  		js.Pointer(p), js.False, ref,
   465  	)
   466  }
   467  
   468  // FreeMembers frees fields with heap reference, if recursive is true
   469  // free all heap references reachable from p.
   470  func (p *PinResponseDetails) FreeMembers(recursive bool) {
   471  	js.Free(
   472  		p.UserInput.Ref(),
   473  	)
   474  	p.UserInput = p.UserInput.FromRef(js.Undefined)
   475  }
   476  
   477  type ReportSignatureCallbackFunc func(this js.Ref) js.Ref
   478  
   479  func (fn ReportSignatureCallbackFunc) Register() js.Func[func()] {
   480  	return js.RegisterCallback[func()](
   481  		fn, abi.FuncPCABIInternal(fn),
   482  	)
   483  }
   484  
   485  func (fn ReportSignatureCallbackFunc) DispatchCallback(
   486  	targetPC uintptr, ctx *js.CallbackContext,
   487  ) {
   488  	args := ctx.Args()
   489  	if len(args) != 0+1 /* js this */ ||
   490  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   491  		js.ThrowInvalidCallbackInvocation()
   492  	}
   493  
   494  	if ctx.Return(fn(
   495  		args[0],
   496  	)) {
   497  		return
   498  	}
   499  
   500  	js.ThrowCallbackValueNotReturned()
   501  }
   502  
   503  type ReportSignatureCallback[T any] struct {
   504  	Fn  func(arg T, this js.Ref) js.Ref
   505  	Arg T
   506  }
   507  
   508  func (cb *ReportSignatureCallback[T]) Register() js.Func[func()] {
   509  	return js.RegisterCallback[func()](
   510  		cb, abi.FuncPCABIInternal(cb.Fn),
   511  	)
   512  }
   513  
   514  func (cb *ReportSignatureCallback[T]) DispatchCallback(
   515  	targetPC uintptr, ctx *js.CallbackContext,
   516  ) {
   517  	args := ctx.Args()
   518  	if len(args) != 0+1 /* js this */ ||
   519  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   520  		js.ThrowInvalidCallbackInvocation()
   521  	}
   522  
   523  	if ctx.Return(cb.Fn(
   524  		cb.Arg,
   525  		args[0],
   526  	)) {
   527  		return
   528  	}
   529  
   530  	js.ThrowCallbackValueNotReturned()
   531  }
   532  
   533  type ReportSignatureDetails struct {
   534  	// SignRequestId is "ReportSignatureDetails.signRequestId"
   535  	//
   536  	// Optional
   537  	//
   538  	// NOTE: FFI_USE_SignRequestId MUST be set to true to make this field effective.
   539  	SignRequestId int32
   540  	// Error is "ReportSignatureDetails.error"
   541  	//
   542  	// Optional
   543  	Error Error
   544  	// Signature is "ReportSignatureDetails.signature"
   545  	//
   546  	// Optional
   547  	Signature js.ArrayBuffer
   548  
   549  	FFI_USE_SignRequestId bool // for SignRequestId.
   550  
   551  	FFI_USE bool
   552  }
   553  
   554  // FromRef calls UpdateFrom and returns a ReportSignatureDetails with all fields set.
   555  func (p ReportSignatureDetails) FromRef(ref js.Ref) ReportSignatureDetails {
   556  	p.UpdateFrom(ref)
   557  	return p
   558  }
   559  
   560  // New creates a new ReportSignatureDetails in the application heap.
   561  func (p ReportSignatureDetails) New() js.Ref {
   562  	return bindings.ReportSignatureDetailsJSLoad(
   563  		js.Pointer(&p), js.True, 0,
   564  	)
   565  }
   566  
   567  // UpdateFrom copies value of all fields of the heap object to p.
   568  func (p *ReportSignatureDetails) UpdateFrom(ref js.Ref) {
   569  	bindings.ReportSignatureDetailsJSStore(
   570  		js.Pointer(p), ref,
   571  	)
   572  }
   573  
   574  // Update writes all fields of the p to the heap object referenced by ref.
   575  func (p *ReportSignatureDetails) Update(ref js.Ref) {
   576  	bindings.ReportSignatureDetailsJSLoad(
   577  		js.Pointer(p), js.False, ref,
   578  	)
   579  }
   580  
   581  // FreeMembers frees fields with heap reference, if recursive is true
   582  // free all heap references reachable from p.
   583  func (p *ReportSignatureDetails) FreeMembers(recursive bool) {
   584  	js.Free(
   585  		p.Signature.Ref(),
   586  	)
   587  	p.Signature = p.Signature.FromRef(js.Undefined)
   588  }
   589  
   590  type RequestPinCallbackFunc func(this js.Ref, details *PinResponseDetails) js.Ref
   591  
   592  func (fn RequestPinCallbackFunc) Register() js.Func[func(details *PinResponseDetails)] {
   593  	return js.RegisterCallback[func(details *PinResponseDetails)](
   594  		fn, abi.FuncPCABIInternal(fn),
   595  	)
   596  }
   597  
   598  func (fn RequestPinCallbackFunc) DispatchCallback(
   599  	targetPC uintptr, ctx *js.CallbackContext,
   600  ) {
   601  	args := ctx.Args()
   602  	if len(args) != 1+1 /* js this */ ||
   603  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   604  		js.ThrowInvalidCallbackInvocation()
   605  	}
   606  	var arg0 PinResponseDetails
   607  	arg0.UpdateFrom(args[0+1])
   608  	defer arg0.FreeMembers(true)
   609  
   610  	if ctx.Return(fn(
   611  		args[0],
   612  
   613  		mark.NoEscape(&arg0),
   614  	)) {
   615  		return
   616  	}
   617  
   618  	js.ThrowCallbackValueNotReturned()
   619  }
   620  
   621  type RequestPinCallback[T any] struct {
   622  	Fn  func(arg T, this js.Ref, details *PinResponseDetails) js.Ref
   623  	Arg T
   624  }
   625  
   626  func (cb *RequestPinCallback[T]) Register() js.Func[func(details *PinResponseDetails)] {
   627  	return js.RegisterCallback[func(details *PinResponseDetails)](
   628  		cb, abi.FuncPCABIInternal(cb.Fn),
   629  	)
   630  }
   631  
   632  func (cb *RequestPinCallback[T]) DispatchCallback(
   633  	targetPC uintptr, ctx *js.CallbackContext,
   634  ) {
   635  	args := ctx.Args()
   636  	if len(args) != 1+1 /* js this */ ||
   637  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   638  		js.ThrowInvalidCallbackInvocation()
   639  	}
   640  	var arg0 PinResponseDetails
   641  	arg0.UpdateFrom(args[0+1])
   642  	defer arg0.FreeMembers(true)
   643  
   644  	if ctx.Return(cb.Fn(
   645  		cb.Arg,
   646  		args[0],
   647  
   648  		mark.NoEscape(&arg0),
   649  	)) {
   650  		return
   651  	}
   652  
   653  	js.ThrowCallbackValueNotReturned()
   654  }
   655  
   656  type RequestPinDetails struct {
   657  	// SignRequestId is "RequestPinDetails.signRequestId"
   658  	//
   659  	// Optional
   660  	//
   661  	// NOTE: FFI_USE_SignRequestId MUST be set to true to make this field effective.
   662  	SignRequestId int32
   663  	// RequestType is "RequestPinDetails.requestType"
   664  	//
   665  	// Optional
   666  	RequestType PinRequestType
   667  	// ErrorType is "RequestPinDetails.errorType"
   668  	//
   669  	// Optional
   670  	ErrorType PinRequestErrorType
   671  	// AttemptsLeft is "RequestPinDetails.attemptsLeft"
   672  	//
   673  	// Optional
   674  	//
   675  	// NOTE: FFI_USE_AttemptsLeft MUST be set to true to make this field effective.
   676  	AttemptsLeft int32
   677  
   678  	FFI_USE_SignRequestId bool // for SignRequestId.
   679  	FFI_USE_AttemptsLeft  bool // for AttemptsLeft.
   680  
   681  	FFI_USE bool
   682  }
   683  
   684  // FromRef calls UpdateFrom and returns a RequestPinDetails with all fields set.
   685  func (p RequestPinDetails) FromRef(ref js.Ref) RequestPinDetails {
   686  	p.UpdateFrom(ref)
   687  	return p
   688  }
   689  
   690  // New creates a new RequestPinDetails in the application heap.
   691  func (p RequestPinDetails) New() js.Ref {
   692  	return bindings.RequestPinDetailsJSLoad(
   693  		js.Pointer(&p), js.True, 0,
   694  	)
   695  }
   696  
   697  // UpdateFrom copies value of all fields of the heap object to p.
   698  func (p *RequestPinDetails) UpdateFrom(ref js.Ref) {
   699  	bindings.RequestPinDetailsJSStore(
   700  		js.Pointer(p), ref,
   701  	)
   702  }
   703  
   704  // Update writes all fields of the p to the heap object referenced by ref.
   705  func (p *RequestPinDetails) Update(ref js.Ref) {
   706  	bindings.RequestPinDetailsJSLoad(
   707  		js.Pointer(p), js.False, ref,
   708  	)
   709  }
   710  
   711  // FreeMembers frees fields with heap reference, if recursive is true
   712  // free all heap references reachable from p.
   713  func (p *RequestPinDetails) FreeMembers(recursive bool) {
   714  }
   715  
   716  type SetCertificatesCallbackFunc func(this js.Ref) js.Ref
   717  
   718  func (fn SetCertificatesCallbackFunc) Register() js.Func[func()] {
   719  	return js.RegisterCallback[func()](
   720  		fn, abi.FuncPCABIInternal(fn),
   721  	)
   722  }
   723  
   724  func (fn SetCertificatesCallbackFunc) DispatchCallback(
   725  	targetPC uintptr, ctx *js.CallbackContext,
   726  ) {
   727  	args := ctx.Args()
   728  	if len(args) != 0+1 /* js this */ ||
   729  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   730  		js.ThrowInvalidCallbackInvocation()
   731  	}
   732  
   733  	if ctx.Return(fn(
   734  		args[0],
   735  	)) {
   736  		return
   737  	}
   738  
   739  	js.ThrowCallbackValueNotReturned()
   740  }
   741  
   742  type SetCertificatesCallback[T any] struct {
   743  	Fn  func(arg T, this js.Ref) js.Ref
   744  	Arg T
   745  }
   746  
   747  func (cb *SetCertificatesCallback[T]) Register() js.Func[func()] {
   748  	return js.RegisterCallback[func()](
   749  		cb, abi.FuncPCABIInternal(cb.Fn),
   750  	)
   751  }
   752  
   753  func (cb *SetCertificatesCallback[T]) DispatchCallback(
   754  	targetPC uintptr, ctx *js.CallbackContext,
   755  ) {
   756  	args := ctx.Args()
   757  	if len(args) != 0+1 /* js this */ ||
   758  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   759  		js.ThrowInvalidCallbackInvocation()
   760  	}
   761  
   762  	if ctx.Return(cb.Fn(
   763  		cb.Arg,
   764  		args[0],
   765  	)) {
   766  		return
   767  	}
   768  
   769  	js.ThrowCallbackValueNotReturned()
   770  }
   771  
   772  type SetCertificatesDetails struct {
   773  	// CertificatesRequestId is "SetCertificatesDetails.certificatesRequestId"
   774  	//
   775  	// Optional
   776  	//
   777  	// NOTE: FFI_USE_CertificatesRequestId MUST be set to true to make this field effective.
   778  	CertificatesRequestId int32
   779  	// Error is "SetCertificatesDetails.error"
   780  	//
   781  	// Optional
   782  	Error Error
   783  	// ClientCertificates is "SetCertificatesDetails.clientCertificates"
   784  	//
   785  	// Optional
   786  	ClientCertificates js.Array[ClientCertificateInfo]
   787  
   788  	FFI_USE_CertificatesRequestId bool // for CertificatesRequestId.
   789  
   790  	FFI_USE bool
   791  }
   792  
   793  // FromRef calls UpdateFrom and returns a SetCertificatesDetails with all fields set.
   794  func (p SetCertificatesDetails) FromRef(ref js.Ref) SetCertificatesDetails {
   795  	p.UpdateFrom(ref)
   796  	return p
   797  }
   798  
   799  // New creates a new SetCertificatesDetails in the application heap.
   800  func (p SetCertificatesDetails) New() js.Ref {
   801  	return bindings.SetCertificatesDetailsJSLoad(
   802  		js.Pointer(&p), js.True, 0,
   803  	)
   804  }
   805  
   806  // UpdateFrom copies value of all fields of the heap object to p.
   807  func (p *SetCertificatesDetails) UpdateFrom(ref js.Ref) {
   808  	bindings.SetCertificatesDetailsJSStore(
   809  		js.Pointer(p), ref,
   810  	)
   811  }
   812  
   813  // Update writes all fields of the p to the heap object referenced by ref.
   814  func (p *SetCertificatesDetails) Update(ref js.Ref) {
   815  	bindings.SetCertificatesDetailsJSLoad(
   816  		js.Pointer(p), js.False, ref,
   817  	)
   818  }
   819  
   820  // FreeMembers frees fields with heap reference, if recursive is true
   821  // free all heap references reachable from p.
   822  func (p *SetCertificatesDetails) FreeMembers(recursive bool) {
   823  	js.Free(
   824  		p.ClientCertificates.Ref(),
   825  	)
   826  	p.ClientCertificates = p.ClientCertificates.FromRef(js.Undefined)
   827  }
   828  
   829  type SignCallbackFunc func(this js.Ref, signature js.ArrayBuffer) js.Ref
   830  
   831  func (fn SignCallbackFunc) Register() js.Func[func(signature js.ArrayBuffer)] {
   832  	return js.RegisterCallback[func(signature js.ArrayBuffer)](
   833  		fn, abi.FuncPCABIInternal(fn),
   834  	)
   835  }
   836  
   837  func (fn SignCallbackFunc) DispatchCallback(
   838  	targetPC uintptr, ctx *js.CallbackContext,
   839  ) {
   840  	args := ctx.Args()
   841  	if len(args) != 1+1 /* js this */ ||
   842  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   843  		js.ThrowInvalidCallbackInvocation()
   844  	}
   845  
   846  	if ctx.Return(fn(
   847  		args[0],
   848  
   849  		js.ArrayBuffer{}.FromRef(args[0+1]),
   850  	)) {
   851  		return
   852  	}
   853  
   854  	js.ThrowCallbackValueNotReturned()
   855  }
   856  
   857  type SignCallback[T any] struct {
   858  	Fn  func(arg T, this js.Ref, signature js.ArrayBuffer) js.Ref
   859  	Arg T
   860  }
   861  
   862  func (cb *SignCallback[T]) Register() js.Func[func(signature js.ArrayBuffer)] {
   863  	return js.RegisterCallback[func(signature js.ArrayBuffer)](
   864  		cb, abi.FuncPCABIInternal(cb.Fn),
   865  	)
   866  }
   867  
   868  func (cb *SignCallback[T]) DispatchCallback(
   869  	targetPC uintptr, ctx *js.CallbackContext,
   870  ) {
   871  	args := ctx.Args()
   872  	if len(args) != 1+1 /* js this */ ||
   873  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   874  		js.ThrowInvalidCallbackInvocation()
   875  	}
   876  
   877  	if ctx.Return(cb.Fn(
   878  		cb.Arg,
   879  		args[0],
   880  
   881  		js.ArrayBuffer{}.FromRef(args[0+1]),
   882  	)) {
   883  		return
   884  	}
   885  
   886  	js.ThrowCallbackValueNotReturned()
   887  }
   888  
   889  type SignRequest struct {
   890  	// SignRequestId is "SignRequest.signRequestId"
   891  	//
   892  	// Optional
   893  	//
   894  	// NOTE: FFI_USE_SignRequestId MUST be set to true to make this field effective.
   895  	SignRequestId int32
   896  	// Digest is "SignRequest.digest"
   897  	//
   898  	// Optional
   899  	Digest js.ArrayBuffer
   900  	// Hash is "SignRequest.hash"
   901  	//
   902  	// Optional
   903  	Hash Hash
   904  	// Certificate is "SignRequest.certificate"
   905  	//
   906  	// Optional
   907  	Certificate js.ArrayBuffer
   908  
   909  	FFI_USE_SignRequestId bool // for SignRequestId.
   910  
   911  	FFI_USE bool
   912  }
   913  
   914  // FromRef calls UpdateFrom and returns a SignRequest with all fields set.
   915  func (p SignRequest) FromRef(ref js.Ref) SignRequest {
   916  	p.UpdateFrom(ref)
   917  	return p
   918  }
   919  
   920  // New creates a new SignRequest in the application heap.
   921  func (p SignRequest) New() js.Ref {
   922  	return bindings.SignRequestJSLoad(
   923  		js.Pointer(&p), js.True, 0,
   924  	)
   925  }
   926  
   927  // UpdateFrom copies value of all fields of the heap object to p.
   928  func (p *SignRequest) UpdateFrom(ref js.Ref) {
   929  	bindings.SignRequestJSStore(
   930  		js.Pointer(p), ref,
   931  	)
   932  }
   933  
   934  // Update writes all fields of the p to the heap object referenced by ref.
   935  func (p *SignRequest) Update(ref js.Ref) {
   936  	bindings.SignRequestJSLoad(
   937  		js.Pointer(p), js.False, ref,
   938  	)
   939  }
   940  
   941  // FreeMembers frees fields with heap reference, if recursive is true
   942  // free all heap references reachable from p.
   943  func (p *SignRequest) FreeMembers(recursive bool) {
   944  	js.Free(
   945  		p.Digest.Ref(),
   946  		p.Certificate.Ref(),
   947  	)
   948  	p.Digest = p.Digest.FromRef(js.Undefined)
   949  	p.Certificate = p.Certificate.FromRef(js.Undefined)
   950  }
   951  
   952  type SignatureRequest struct {
   953  	// SignRequestId is "SignatureRequest.signRequestId"
   954  	//
   955  	// Optional
   956  	//
   957  	// NOTE: FFI_USE_SignRequestId MUST be set to true to make this field effective.
   958  	SignRequestId int32
   959  	// Input is "SignatureRequest.input"
   960  	//
   961  	// Optional
   962  	Input js.ArrayBuffer
   963  	// Algorithm is "SignatureRequest.algorithm"
   964  	//
   965  	// Optional
   966  	Algorithm Algorithm
   967  	// Certificate is "SignatureRequest.certificate"
   968  	//
   969  	// Optional
   970  	Certificate js.ArrayBuffer
   971  
   972  	FFI_USE_SignRequestId bool // for SignRequestId.
   973  
   974  	FFI_USE bool
   975  }
   976  
   977  // FromRef calls UpdateFrom and returns a SignatureRequest with all fields set.
   978  func (p SignatureRequest) FromRef(ref js.Ref) SignatureRequest {
   979  	p.UpdateFrom(ref)
   980  	return p
   981  }
   982  
   983  // New creates a new SignatureRequest in the application heap.
   984  func (p SignatureRequest) New() js.Ref {
   985  	return bindings.SignatureRequestJSLoad(
   986  		js.Pointer(&p), js.True, 0,
   987  	)
   988  }
   989  
   990  // UpdateFrom copies value of all fields of the heap object to p.
   991  func (p *SignatureRequest) UpdateFrom(ref js.Ref) {
   992  	bindings.SignatureRequestJSStore(
   993  		js.Pointer(p), ref,
   994  	)
   995  }
   996  
   997  // Update writes all fields of the p to the heap object referenced by ref.
   998  func (p *SignatureRequest) Update(ref js.Ref) {
   999  	bindings.SignatureRequestJSLoad(
  1000  		js.Pointer(p), js.False, ref,
  1001  	)
  1002  }
  1003  
  1004  // FreeMembers frees fields with heap reference, if recursive is true
  1005  // free all heap references reachable from p.
  1006  func (p *SignatureRequest) FreeMembers(recursive bool) {
  1007  	js.Free(
  1008  		p.Input.Ref(),
  1009  		p.Certificate.Ref(),
  1010  	)
  1011  	p.Input = p.Input.FromRef(js.Undefined)
  1012  	p.Certificate = p.Certificate.FromRef(js.Undefined)
  1013  }
  1014  
  1015  type StopPinRequestCallbackFunc func(this js.Ref) js.Ref
  1016  
  1017  func (fn StopPinRequestCallbackFunc) Register() js.Func[func()] {
  1018  	return js.RegisterCallback[func()](
  1019  		fn, abi.FuncPCABIInternal(fn),
  1020  	)
  1021  }
  1022  
  1023  func (fn StopPinRequestCallbackFunc) DispatchCallback(
  1024  	targetPC uintptr, ctx *js.CallbackContext,
  1025  ) {
  1026  	args := ctx.Args()
  1027  	if len(args) != 0+1 /* js this */ ||
  1028  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1029  		js.ThrowInvalidCallbackInvocation()
  1030  	}
  1031  
  1032  	if ctx.Return(fn(
  1033  		args[0],
  1034  	)) {
  1035  		return
  1036  	}
  1037  
  1038  	js.ThrowCallbackValueNotReturned()
  1039  }
  1040  
  1041  type StopPinRequestCallback[T any] struct {
  1042  	Fn  func(arg T, this js.Ref) js.Ref
  1043  	Arg T
  1044  }
  1045  
  1046  func (cb *StopPinRequestCallback[T]) Register() js.Func[func()] {
  1047  	return js.RegisterCallback[func()](
  1048  		cb, abi.FuncPCABIInternal(cb.Fn),
  1049  	)
  1050  }
  1051  
  1052  func (cb *StopPinRequestCallback[T]) DispatchCallback(
  1053  	targetPC uintptr, ctx *js.CallbackContext,
  1054  ) {
  1055  	args := ctx.Args()
  1056  	if len(args) != 0+1 /* js this */ ||
  1057  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1058  		js.ThrowInvalidCallbackInvocation()
  1059  	}
  1060  
  1061  	if ctx.Return(cb.Fn(
  1062  		cb.Arg,
  1063  		args[0],
  1064  	)) {
  1065  		return
  1066  	}
  1067  
  1068  	js.ThrowCallbackValueNotReturned()
  1069  }
  1070  
  1071  type StopPinRequestDetails struct {
  1072  	// SignRequestId is "StopPinRequestDetails.signRequestId"
  1073  	//
  1074  	// Optional
  1075  	//
  1076  	// NOTE: FFI_USE_SignRequestId MUST be set to true to make this field effective.
  1077  	SignRequestId int32
  1078  	// ErrorType is "StopPinRequestDetails.errorType"
  1079  	//
  1080  	// Optional
  1081  	ErrorType PinRequestErrorType
  1082  
  1083  	FFI_USE_SignRequestId bool // for SignRequestId.
  1084  
  1085  	FFI_USE bool
  1086  }
  1087  
  1088  // FromRef calls UpdateFrom and returns a StopPinRequestDetails with all fields set.
  1089  func (p StopPinRequestDetails) FromRef(ref js.Ref) StopPinRequestDetails {
  1090  	p.UpdateFrom(ref)
  1091  	return p
  1092  }
  1093  
  1094  // New creates a new StopPinRequestDetails in the application heap.
  1095  func (p StopPinRequestDetails) New() js.Ref {
  1096  	return bindings.StopPinRequestDetailsJSLoad(
  1097  		js.Pointer(&p), js.True, 0,
  1098  	)
  1099  }
  1100  
  1101  // UpdateFrom copies value of all fields of the heap object to p.
  1102  func (p *StopPinRequestDetails) UpdateFrom(ref js.Ref) {
  1103  	bindings.StopPinRequestDetailsJSStore(
  1104  		js.Pointer(p), ref,
  1105  	)
  1106  }
  1107  
  1108  // Update writes all fields of the p to the heap object referenced by ref.
  1109  func (p *StopPinRequestDetails) Update(ref js.Ref) {
  1110  	bindings.StopPinRequestDetailsJSLoad(
  1111  		js.Pointer(p), js.False, ref,
  1112  	)
  1113  }
  1114  
  1115  // FreeMembers frees fields with heap reference, if recursive is true
  1116  // free all heap references reachable from p.
  1117  func (p *StopPinRequestDetails) FreeMembers(recursive bool) {
  1118  }
  1119  
  1120  type OnCertificatesRequestedEventCallbackFunc func(this js.Ref, reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])]) js.Ref
  1121  
  1122  func (fn OnCertificatesRequestedEventCallbackFunc) Register() js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])] {
  1123  	return js.RegisterCallback[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])](
  1124  		fn, abi.FuncPCABIInternal(fn),
  1125  	)
  1126  }
  1127  
  1128  func (fn OnCertificatesRequestedEventCallbackFunc) DispatchCallback(
  1129  	targetPC uintptr, ctx *js.CallbackContext,
  1130  ) {
  1131  	args := ctx.Args()
  1132  	if len(args) != 1+1 /* js this */ ||
  1133  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1134  		js.ThrowInvalidCallbackInvocation()
  1135  	}
  1136  
  1137  	if ctx.Return(fn(
  1138  		args[0],
  1139  
  1140  		js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])]{}.FromRef(args[0+1]),
  1141  	)) {
  1142  		return
  1143  	}
  1144  
  1145  	js.ThrowCallbackValueNotReturned()
  1146  }
  1147  
  1148  type OnCertificatesRequestedEventCallback[T any] struct {
  1149  	Fn  func(arg T, this js.Ref, reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])]) js.Ref
  1150  	Arg T
  1151  }
  1152  
  1153  func (cb *OnCertificatesRequestedEventCallback[T]) Register() js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])] {
  1154  	return js.RegisterCallback[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])](
  1155  		cb, abi.FuncPCABIInternal(cb.Fn),
  1156  	)
  1157  }
  1158  
  1159  func (cb *OnCertificatesRequestedEventCallback[T]) DispatchCallback(
  1160  	targetPC uintptr, ctx *js.CallbackContext,
  1161  ) {
  1162  	args := ctx.Args()
  1163  	if len(args) != 1+1 /* js this */ ||
  1164  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1165  		js.ThrowInvalidCallbackInvocation()
  1166  	}
  1167  
  1168  	if ctx.Return(cb.Fn(
  1169  		cb.Arg,
  1170  		args[0],
  1171  
  1172  		js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])]{}.FromRef(args[0+1]),
  1173  	)) {
  1174  		return
  1175  	}
  1176  
  1177  	js.ThrowCallbackValueNotReturned()
  1178  }
  1179  
  1180  // HasFuncOnCertificatesRequested returns true if the function "WEBEXT.certificateProvider.onCertificatesRequested.addListener" exists.
  1181  func HasFuncOnCertificatesRequested() bool {
  1182  	return js.True == bindings.HasFuncOnCertificatesRequested()
  1183  }
  1184  
  1185  // FuncOnCertificatesRequested returns the function "WEBEXT.certificateProvider.onCertificatesRequested.addListener".
  1186  func FuncOnCertificatesRequested() (fn js.Func[func(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])])]) {
  1187  	bindings.FuncOnCertificatesRequested(
  1188  		js.Pointer(&fn),
  1189  	)
  1190  	return
  1191  }
  1192  
  1193  // OnCertificatesRequested calls the function "WEBEXT.certificateProvider.onCertificatesRequested.addListener" directly.
  1194  func OnCertificatesRequested(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])]) (ret js.Void) {
  1195  	bindings.CallOnCertificatesRequested(
  1196  		js.Pointer(&ret),
  1197  		callback.Ref(),
  1198  	)
  1199  
  1200  	return
  1201  }
  1202  
  1203  // TryOnCertificatesRequested calls the function "WEBEXT.certificateProvider.onCertificatesRequested.addListener"
  1204  // in a try/catch block and returns (_, err, ok = false) when it went through
  1205  // the catch clause.
  1206  func TryOnCertificatesRequested(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])]) (ret js.Void, exception js.Any, ok bool) {
  1207  	ok = js.True == bindings.TryOnCertificatesRequested(
  1208  		js.Pointer(&ret), js.Pointer(&exception),
  1209  		callback.Ref(),
  1210  	)
  1211  
  1212  	return
  1213  }
  1214  
  1215  // HasFuncOffCertificatesRequested returns true if the function "WEBEXT.certificateProvider.onCertificatesRequested.removeListener" exists.
  1216  func HasFuncOffCertificatesRequested() bool {
  1217  	return js.True == bindings.HasFuncOffCertificatesRequested()
  1218  }
  1219  
  1220  // FuncOffCertificatesRequested returns the function "WEBEXT.certificateProvider.onCertificatesRequested.removeListener".
  1221  func FuncOffCertificatesRequested() (fn js.Func[func(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])])]) {
  1222  	bindings.FuncOffCertificatesRequested(
  1223  		js.Pointer(&fn),
  1224  	)
  1225  	return
  1226  }
  1227  
  1228  // OffCertificatesRequested calls the function "WEBEXT.certificateProvider.onCertificatesRequested.removeListener" directly.
  1229  func OffCertificatesRequested(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])]) (ret js.Void) {
  1230  	bindings.CallOffCertificatesRequested(
  1231  		js.Pointer(&ret),
  1232  		callback.Ref(),
  1233  	)
  1234  
  1235  	return
  1236  }
  1237  
  1238  // TryOffCertificatesRequested calls the function "WEBEXT.certificateProvider.onCertificatesRequested.removeListener"
  1239  // in a try/catch block and returns (_, err, ok = false) when it went through
  1240  // the catch clause.
  1241  func TryOffCertificatesRequested(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])]) (ret js.Void, exception js.Any, ok bool) {
  1242  	ok = js.True == bindings.TryOffCertificatesRequested(
  1243  		js.Pointer(&ret), js.Pointer(&exception),
  1244  		callback.Ref(),
  1245  	)
  1246  
  1247  	return
  1248  }
  1249  
  1250  // HasFuncHasOnCertificatesRequested returns true if the function "WEBEXT.certificateProvider.onCertificatesRequested.hasListener" exists.
  1251  func HasFuncHasOnCertificatesRequested() bool {
  1252  	return js.True == bindings.HasFuncHasOnCertificatesRequested()
  1253  }
  1254  
  1255  // FuncHasOnCertificatesRequested returns the function "WEBEXT.certificateProvider.onCertificatesRequested.hasListener".
  1256  func FuncHasOnCertificatesRequested() (fn js.Func[func(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])]) bool]) {
  1257  	bindings.FuncHasOnCertificatesRequested(
  1258  		js.Pointer(&fn),
  1259  	)
  1260  	return
  1261  }
  1262  
  1263  // HasOnCertificatesRequested calls the function "WEBEXT.certificateProvider.onCertificatesRequested.hasListener" directly.
  1264  func HasOnCertificatesRequested(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])]) (ret bool) {
  1265  	bindings.CallHasOnCertificatesRequested(
  1266  		js.Pointer(&ret),
  1267  		callback.Ref(),
  1268  	)
  1269  
  1270  	return
  1271  }
  1272  
  1273  // TryHasOnCertificatesRequested calls the function "WEBEXT.certificateProvider.onCertificatesRequested.hasListener"
  1274  // in a try/catch block and returns (_, err, ok = false) when it went through
  1275  // the catch clause.
  1276  func TryHasOnCertificatesRequested(callback js.Func[func(reportCallback js.Func[func(certificates js.Array[CertificateInfo], callback js.Func[func(rejectedCertificates js.Array[js.ArrayBuffer])])])]) (ret bool, exception js.Any, ok bool) {
  1277  	ok = js.True == bindings.TryHasOnCertificatesRequested(
  1278  		js.Pointer(&ret), js.Pointer(&exception),
  1279  		callback.Ref(),
  1280  	)
  1281  
  1282  	return
  1283  }
  1284  
  1285  type OnCertificatesUpdateRequestedEventCallbackFunc func(this js.Ref, request *CertificatesUpdateRequest) js.Ref
  1286  
  1287  func (fn OnCertificatesUpdateRequestedEventCallbackFunc) Register() js.Func[func(request *CertificatesUpdateRequest)] {
  1288  	return js.RegisterCallback[func(request *CertificatesUpdateRequest)](
  1289  		fn, abi.FuncPCABIInternal(fn),
  1290  	)
  1291  }
  1292  
  1293  func (fn OnCertificatesUpdateRequestedEventCallbackFunc) DispatchCallback(
  1294  	targetPC uintptr, ctx *js.CallbackContext,
  1295  ) {
  1296  	args := ctx.Args()
  1297  	if len(args) != 1+1 /* js this */ ||
  1298  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1299  		js.ThrowInvalidCallbackInvocation()
  1300  	}
  1301  	var arg0 CertificatesUpdateRequest
  1302  	arg0.UpdateFrom(args[0+1])
  1303  	defer arg0.FreeMembers(true)
  1304  
  1305  	if ctx.Return(fn(
  1306  		args[0],
  1307  
  1308  		mark.NoEscape(&arg0),
  1309  	)) {
  1310  		return
  1311  	}
  1312  
  1313  	js.ThrowCallbackValueNotReturned()
  1314  }
  1315  
  1316  type OnCertificatesUpdateRequestedEventCallback[T any] struct {
  1317  	Fn  func(arg T, this js.Ref, request *CertificatesUpdateRequest) js.Ref
  1318  	Arg T
  1319  }
  1320  
  1321  func (cb *OnCertificatesUpdateRequestedEventCallback[T]) Register() js.Func[func(request *CertificatesUpdateRequest)] {
  1322  	return js.RegisterCallback[func(request *CertificatesUpdateRequest)](
  1323  		cb, abi.FuncPCABIInternal(cb.Fn),
  1324  	)
  1325  }
  1326  
  1327  func (cb *OnCertificatesUpdateRequestedEventCallback[T]) DispatchCallback(
  1328  	targetPC uintptr, ctx *js.CallbackContext,
  1329  ) {
  1330  	args := ctx.Args()
  1331  	if len(args) != 1+1 /* js this */ ||
  1332  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1333  		js.ThrowInvalidCallbackInvocation()
  1334  	}
  1335  	var arg0 CertificatesUpdateRequest
  1336  	arg0.UpdateFrom(args[0+1])
  1337  	defer arg0.FreeMembers(true)
  1338  
  1339  	if ctx.Return(cb.Fn(
  1340  		cb.Arg,
  1341  		args[0],
  1342  
  1343  		mark.NoEscape(&arg0),
  1344  	)) {
  1345  		return
  1346  	}
  1347  
  1348  	js.ThrowCallbackValueNotReturned()
  1349  }
  1350  
  1351  // HasFuncOnCertificatesUpdateRequested returns true if the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.addListener" exists.
  1352  func HasFuncOnCertificatesUpdateRequested() bool {
  1353  	return js.True == bindings.HasFuncOnCertificatesUpdateRequested()
  1354  }
  1355  
  1356  // FuncOnCertificatesUpdateRequested returns the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.addListener".
  1357  func FuncOnCertificatesUpdateRequested() (fn js.Func[func(callback js.Func[func(request *CertificatesUpdateRequest)])]) {
  1358  	bindings.FuncOnCertificatesUpdateRequested(
  1359  		js.Pointer(&fn),
  1360  	)
  1361  	return
  1362  }
  1363  
  1364  // OnCertificatesUpdateRequested calls the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.addListener" directly.
  1365  func OnCertificatesUpdateRequested(callback js.Func[func(request *CertificatesUpdateRequest)]) (ret js.Void) {
  1366  	bindings.CallOnCertificatesUpdateRequested(
  1367  		js.Pointer(&ret),
  1368  		callback.Ref(),
  1369  	)
  1370  
  1371  	return
  1372  }
  1373  
  1374  // TryOnCertificatesUpdateRequested calls the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.addListener"
  1375  // in a try/catch block and returns (_, err, ok = false) when it went through
  1376  // the catch clause.
  1377  func TryOnCertificatesUpdateRequested(callback js.Func[func(request *CertificatesUpdateRequest)]) (ret js.Void, exception js.Any, ok bool) {
  1378  	ok = js.True == bindings.TryOnCertificatesUpdateRequested(
  1379  		js.Pointer(&ret), js.Pointer(&exception),
  1380  		callback.Ref(),
  1381  	)
  1382  
  1383  	return
  1384  }
  1385  
  1386  // HasFuncOffCertificatesUpdateRequested returns true if the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.removeListener" exists.
  1387  func HasFuncOffCertificatesUpdateRequested() bool {
  1388  	return js.True == bindings.HasFuncOffCertificatesUpdateRequested()
  1389  }
  1390  
  1391  // FuncOffCertificatesUpdateRequested returns the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.removeListener".
  1392  func FuncOffCertificatesUpdateRequested() (fn js.Func[func(callback js.Func[func(request *CertificatesUpdateRequest)])]) {
  1393  	bindings.FuncOffCertificatesUpdateRequested(
  1394  		js.Pointer(&fn),
  1395  	)
  1396  	return
  1397  }
  1398  
  1399  // OffCertificatesUpdateRequested calls the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.removeListener" directly.
  1400  func OffCertificatesUpdateRequested(callback js.Func[func(request *CertificatesUpdateRequest)]) (ret js.Void) {
  1401  	bindings.CallOffCertificatesUpdateRequested(
  1402  		js.Pointer(&ret),
  1403  		callback.Ref(),
  1404  	)
  1405  
  1406  	return
  1407  }
  1408  
  1409  // TryOffCertificatesUpdateRequested calls the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.removeListener"
  1410  // in a try/catch block and returns (_, err, ok = false) when it went through
  1411  // the catch clause.
  1412  func TryOffCertificatesUpdateRequested(callback js.Func[func(request *CertificatesUpdateRequest)]) (ret js.Void, exception js.Any, ok bool) {
  1413  	ok = js.True == bindings.TryOffCertificatesUpdateRequested(
  1414  		js.Pointer(&ret), js.Pointer(&exception),
  1415  		callback.Ref(),
  1416  	)
  1417  
  1418  	return
  1419  }
  1420  
  1421  // HasFuncHasOnCertificatesUpdateRequested returns true if the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.hasListener" exists.
  1422  func HasFuncHasOnCertificatesUpdateRequested() bool {
  1423  	return js.True == bindings.HasFuncHasOnCertificatesUpdateRequested()
  1424  }
  1425  
  1426  // FuncHasOnCertificatesUpdateRequested returns the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.hasListener".
  1427  func FuncHasOnCertificatesUpdateRequested() (fn js.Func[func(callback js.Func[func(request *CertificatesUpdateRequest)]) bool]) {
  1428  	bindings.FuncHasOnCertificatesUpdateRequested(
  1429  		js.Pointer(&fn),
  1430  	)
  1431  	return
  1432  }
  1433  
  1434  // HasOnCertificatesUpdateRequested calls the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.hasListener" directly.
  1435  func HasOnCertificatesUpdateRequested(callback js.Func[func(request *CertificatesUpdateRequest)]) (ret bool) {
  1436  	bindings.CallHasOnCertificatesUpdateRequested(
  1437  		js.Pointer(&ret),
  1438  		callback.Ref(),
  1439  	)
  1440  
  1441  	return
  1442  }
  1443  
  1444  // TryHasOnCertificatesUpdateRequested calls the function "WEBEXT.certificateProvider.onCertificatesUpdateRequested.hasListener"
  1445  // in a try/catch block and returns (_, err, ok = false) when it went through
  1446  // the catch clause.
  1447  func TryHasOnCertificatesUpdateRequested(callback js.Func[func(request *CertificatesUpdateRequest)]) (ret bool, exception js.Any, ok bool) {
  1448  	ok = js.True == bindings.TryHasOnCertificatesUpdateRequested(
  1449  		js.Pointer(&ret), js.Pointer(&exception),
  1450  		callback.Ref(),
  1451  	)
  1452  
  1453  	return
  1454  }
  1455  
  1456  type OnSignDigestRequestedEventCallbackFunc func(this js.Ref, request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)]) js.Ref
  1457  
  1458  func (fn OnSignDigestRequestedEventCallbackFunc) Register() js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])] {
  1459  	return js.RegisterCallback[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])](
  1460  		fn, abi.FuncPCABIInternal(fn),
  1461  	)
  1462  }
  1463  
  1464  func (fn OnSignDigestRequestedEventCallbackFunc) DispatchCallback(
  1465  	targetPC uintptr, ctx *js.CallbackContext,
  1466  ) {
  1467  	args := ctx.Args()
  1468  	if len(args) != 2+1 /* js this */ ||
  1469  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1470  		js.ThrowInvalidCallbackInvocation()
  1471  	}
  1472  	var arg0 SignRequest
  1473  	arg0.UpdateFrom(args[0+1])
  1474  	defer arg0.FreeMembers(true)
  1475  
  1476  	if ctx.Return(fn(
  1477  		args[0],
  1478  
  1479  		mark.NoEscape(&arg0),
  1480  		js.Func[func(signature js.ArrayBuffer)]{}.FromRef(args[1+1]),
  1481  	)) {
  1482  		return
  1483  	}
  1484  
  1485  	js.ThrowCallbackValueNotReturned()
  1486  }
  1487  
  1488  type OnSignDigestRequestedEventCallback[T any] struct {
  1489  	Fn  func(arg T, this js.Ref, request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)]) js.Ref
  1490  	Arg T
  1491  }
  1492  
  1493  func (cb *OnSignDigestRequestedEventCallback[T]) Register() js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])] {
  1494  	return js.RegisterCallback[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])](
  1495  		cb, abi.FuncPCABIInternal(cb.Fn),
  1496  	)
  1497  }
  1498  
  1499  func (cb *OnSignDigestRequestedEventCallback[T]) DispatchCallback(
  1500  	targetPC uintptr, ctx *js.CallbackContext,
  1501  ) {
  1502  	args := ctx.Args()
  1503  	if len(args) != 2+1 /* js this */ ||
  1504  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1505  		js.ThrowInvalidCallbackInvocation()
  1506  	}
  1507  	var arg0 SignRequest
  1508  	arg0.UpdateFrom(args[0+1])
  1509  	defer arg0.FreeMembers(true)
  1510  
  1511  	if ctx.Return(cb.Fn(
  1512  		cb.Arg,
  1513  		args[0],
  1514  
  1515  		mark.NoEscape(&arg0),
  1516  		js.Func[func(signature js.ArrayBuffer)]{}.FromRef(args[1+1]),
  1517  	)) {
  1518  		return
  1519  	}
  1520  
  1521  	js.ThrowCallbackValueNotReturned()
  1522  }
  1523  
  1524  // HasFuncOnSignDigestRequested returns true if the function "WEBEXT.certificateProvider.onSignDigestRequested.addListener" exists.
  1525  func HasFuncOnSignDigestRequested() bool {
  1526  	return js.True == bindings.HasFuncOnSignDigestRequested()
  1527  }
  1528  
  1529  // FuncOnSignDigestRequested returns the function "WEBEXT.certificateProvider.onSignDigestRequested.addListener".
  1530  func FuncOnSignDigestRequested() (fn js.Func[func(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])])]) {
  1531  	bindings.FuncOnSignDigestRequested(
  1532  		js.Pointer(&fn),
  1533  	)
  1534  	return
  1535  }
  1536  
  1537  // OnSignDigestRequested calls the function "WEBEXT.certificateProvider.onSignDigestRequested.addListener" directly.
  1538  func OnSignDigestRequested(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])]) (ret js.Void) {
  1539  	bindings.CallOnSignDigestRequested(
  1540  		js.Pointer(&ret),
  1541  		callback.Ref(),
  1542  	)
  1543  
  1544  	return
  1545  }
  1546  
  1547  // TryOnSignDigestRequested calls the function "WEBEXT.certificateProvider.onSignDigestRequested.addListener"
  1548  // in a try/catch block and returns (_, err, ok = false) when it went through
  1549  // the catch clause.
  1550  func TryOnSignDigestRequested(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])]) (ret js.Void, exception js.Any, ok bool) {
  1551  	ok = js.True == bindings.TryOnSignDigestRequested(
  1552  		js.Pointer(&ret), js.Pointer(&exception),
  1553  		callback.Ref(),
  1554  	)
  1555  
  1556  	return
  1557  }
  1558  
  1559  // HasFuncOffSignDigestRequested returns true if the function "WEBEXT.certificateProvider.onSignDigestRequested.removeListener" exists.
  1560  func HasFuncOffSignDigestRequested() bool {
  1561  	return js.True == bindings.HasFuncOffSignDigestRequested()
  1562  }
  1563  
  1564  // FuncOffSignDigestRequested returns the function "WEBEXT.certificateProvider.onSignDigestRequested.removeListener".
  1565  func FuncOffSignDigestRequested() (fn js.Func[func(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])])]) {
  1566  	bindings.FuncOffSignDigestRequested(
  1567  		js.Pointer(&fn),
  1568  	)
  1569  	return
  1570  }
  1571  
  1572  // OffSignDigestRequested calls the function "WEBEXT.certificateProvider.onSignDigestRequested.removeListener" directly.
  1573  func OffSignDigestRequested(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])]) (ret js.Void) {
  1574  	bindings.CallOffSignDigestRequested(
  1575  		js.Pointer(&ret),
  1576  		callback.Ref(),
  1577  	)
  1578  
  1579  	return
  1580  }
  1581  
  1582  // TryOffSignDigestRequested calls the function "WEBEXT.certificateProvider.onSignDigestRequested.removeListener"
  1583  // in a try/catch block and returns (_, err, ok = false) when it went through
  1584  // the catch clause.
  1585  func TryOffSignDigestRequested(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])]) (ret js.Void, exception js.Any, ok bool) {
  1586  	ok = js.True == bindings.TryOffSignDigestRequested(
  1587  		js.Pointer(&ret), js.Pointer(&exception),
  1588  		callback.Ref(),
  1589  	)
  1590  
  1591  	return
  1592  }
  1593  
  1594  // HasFuncHasOnSignDigestRequested returns true if the function "WEBEXT.certificateProvider.onSignDigestRequested.hasListener" exists.
  1595  func HasFuncHasOnSignDigestRequested() bool {
  1596  	return js.True == bindings.HasFuncHasOnSignDigestRequested()
  1597  }
  1598  
  1599  // FuncHasOnSignDigestRequested returns the function "WEBEXT.certificateProvider.onSignDigestRequested.hasListener".
  1600  func FuncHasOnSignDigestRequested() (fn js.Func[func(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])]) bool]) {
  1601  	bindings.FuncHasOnSignDigestRequested(
  1602  		js.Pointer(&fn),
  1603  	)
  1604  	return
  1605  }
  1606  
  1607  // HasOnSignDigestRequested calls the function "WEBEXT.certificateProvider.onSignDigestRequested.hasListener" directly.
  1608  func HasOnSignDigestRequested(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])]) (ret bool) {
  1609  	bindings.CallHasOnSignDigestRequested(
  1610  		js.Pointer(&ret),
  1611  		callback.Ref(),
  1612  	)
  1613  
  1614  	return
  1615  }
  1616  
  1617  // TryHasOnSignDigestRequested calls the function "WEBEXT.certificateProvider.onSignDigestRequested.hasListener"
  1618  // in a try/catch block and returns (_, err, ok = false) when it went through
  1619  // the catch clause.
  1620  func TryHasOnSignDigestRequested(callback js.Func[func(request *SignRequest, reportCallback js.Func[func(signature js.ArrayBuffer)])]) (ret bool, exception js.Any, ok bool) {
  1621  	ok = js.True == bindings.TryHasOnSignDigestRequested(
  1622  		js.Pointer(&ret), js.Pointer(&exception),
  1623  		callback.Ref(),
  1624  	)
  1625  
  1626  	return
  1627  }
  1628  
  1629  type OnSignatureRequestedEventCallbackFunc func(this js.Ref, request *SignatureRequest) js.Ref
  1630  
  1631  func (fn OnSignatureRequestedEventCallbackFunc) Register() js.Func[func(request *SignatureRequest)] {
  1632  	return js.RegisterCallback[func(request *SignatureRequest)](
  1633  		fn, abi.FuncPCABIInternal(fn),
  1634  	)
  1635  }
  1636  
  1637  func (fn OnSignatureRequestedEventCallbackFunc) DispatchCallback(
  1638  	targetPC uintptr, ctx *js.CallbackContext,
  1639  ) {
  1640  	args := ctx.Args()
  1641  	if len(args) != 1+1 /* js this */ ||
  1642  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1643  		js.ThrowInvalidCallbackInvocation()
  1644  	}
  1645  	var arg0 SignatureRequest
  1646  	arg0.UpdateFrom(args[0+1])
  1647  	defer arg0.FreeMembers(true)
  1648  
  1649  	if ctx.Return(fn(
  1650  		args[0],
  1651  
  1652  		mark.NoEscape(&arg0),
  1653  	)) {
  1654  		return
  1655  	}
  1656  
  1657  	js.ThrowCallbackValueNotReturned()
  1658  }
  1659  
  1660  type OnSignatureRequestedEventCallback[T any] struct {
  1661  	Fn  func(arg T, this js.Ref, request *SignatureRequest) js.Ref
  1662  	Arg T
  1663  }
  1664  
  1665  func (cb *OnSignatureRequestedEventCallback[T]) Register() js.Func[func(request *SignatureRequest)] {
  1666  	return js.RegisterCallback[func(request *SignatureRequest)](
  1667  		cb, abi.FuncPCABIInternal(cb.Fn),
  1668  	)
  1669  }
  1670  
  1671  func (cb *OnSignatureRequestedEventCallback[T]) DispatchCallback(
  1672  	targetPC uintptr, ctx *js.CallbackContext,
  1673  ) {
  1674  	args := ctx.Args()
  1675  	if len(args) != 1+1 /* js this */ ||
  1676  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1677  		js.ThrowInvalidCallbackInvocation()
  1678  	}
  1679  	var arg0 SignatureRequest
  1680  	arg0.UpdateFrom(args[0+1])
  1681  	defer arg0.FreeMembers(true)
  1682  
  1683  	if ctx.Return(cb.Fn(
  1684  		cb.Arg,
  1685  		args[0],
  1686  
  1687  		mark.NoEscape(&arg0),
  1688  	)) {
  1689  		return
  1690  	}
  1691  
  1692  	js.ThrowCallbackValueNotReturned()
  1693  }
  1694  
  1695  // HasFuncOnSignatureRequested returns true if the function "WEBEXT.certificateProvider.onSignatureRequested.addListener" exists.
  1696  func HasFuncOnSignatureRequested() bool {
  1697  	return js.True == bindings.HasFuncOnSignatureRequested()
  1698  }
  1699  
  1700  // FuncOnSignatureRequested returns the function "WEBEXT.certificateProvider.onSignatureRequested.addListener".
  1701  func FuncOnSignatureRequested() (fn js.Func[func(callback js.Func[func(request *SignatureRequest)])]) {
  1702  	bindings.FuncOnSignatureRequested(
  1703  		js.Pointer(&fn),
  1704  	)
  1705  	return
  1706  }
  1707  
  1708  // OnSignatureRequested calls the function "WEBEXT.certificateProvider.onSignatureRequested.addListener" directly.
  1709  func OnSignatureRequested(callback js.Func[func(request *SignatureRequest)]) (ret js.Void) {
  1710  	bindings.CallOnSignatureRequested(
  1711  		js.Pointer(&ret),
  1712  		callback.Ref(),
  1713  	)
  1714  
  1715  	return
  1716  }
  1717  
  1718  // TryOnSignatureRequested calls the function "WEBEXT.certificateProvider.onSignatureRequested.addListener"
  1719  // in a try/catch block and returns (_, err, ok = false) when it went through
  1720  // the catch clause.
  1721  func TryOnSignatureRequested(callback js.Func[func(request *SignatureRequest)]) (ret js.Void, exception js.Any, ok bool) {
  1722  	ok = js.True == bindings.TryOnSignatureRequested(
  1723  		js.Pointer(&ret), js.Pointer(&exception),
  1724  		callback.Ref(),
  1725  	)
  1726  
  1727  	return
  1728  }
  1729  
  1730  // HasFuncOffSignatureRequested returns true if the function "WEBEXT.certificateProvider.onSignatureRequested.removeListener" exists.
  1731  func HasFuncOffSignatureRequested() bool {
  1732  	return js.True == bindings.HasFuncOffSignatureRequested()
  1733  }
  1734  
  1735  // FuncOffSignatureRequested returns the function "WEBEXT.certificateProvider.onSignatureRequested.removeListener".
  1736  func FuncOffSignatureRequested() (fn js.Func[func(callback js.Func[func(request *SignatureRequest)])]) {
  1737  	bindings.FuncOffSignatureRequested(
  1738  		js.Pointer(&fn),
  1739  	)
  1740  	return
  1741  }
  1742  
  1743  // OffSignatureRequested calls the function "WEBEXT.certificateProvider.onSignatureRequested.removeListener" directly.
  1744  func OffSignatureRequested(callback js.Func[func(request *SignatureRequest)]) (ret js.Void) {
  1745  	bindings.CallOffSignatureRequested(
  1746  		js.Pointer(&ret),
  1747  		callback.Ref(),
  1748  	)
  1749  
  1750  	return
  1751  }
  1752  
  1753  // TryOffSignatureRequested calls the function "WEBEXT.certificateProvider.onSignatureRequested.removeListener"
  1754  // in a try/catch block and returns (_, err, ok = false) when it went through
  1755  // the catch clause.
  1756  func TryOffSignatureRequested(callback js.Func[func(request *SignatureRequest)]) (ret js.Void, exception js.Any, ok bool) {
  1757  	ok = js.True == bindings.TryOffSignatureRequested(
  1758  		js.Pointer(&ret), js.Pointer(&exception),
  1759  		callback.Ref(),
  1760  	)
  1761  
  1762  	return
  1763  }
  1764  
  1765  // HasFuncHasOnSignatureRequested returns true if the function "WEBEXT.certificateProvider.onSignatureRequested.hasListener" exists.
  1766  func HasFuncHasOnSignatureRequested() bool {
  1767  	return js.True == bindings.HasFuncHasOnSignatureRequested()
  1768  }
  1769  
  1770  // FuncHasOnSignatureRequested returns the function "WEBEXT.certificateProvider.onSignatureRequested.hasListener".
  1771  func FuncHasOnSignatureRequested() (fn js.Func[func(callback js.Func[func(request *SignatureRequest)]) bool]) {
  1772  	bindings.FuncHasOnSignatureRequested(
  1773  		js.Pointer(&fn),
  1774  	)
  1775  	return
  1776  }
  1777  
  1778  // HasOnSignatureRequested calls the function "WEBEXT.certificateProvider.onSignatureRequested.hasListener" directly.
  1779  func HasOnSignatureRequested(callback js.Func[func(request *SignatureRequest)]) (ret bool) {
  1780  	bindings.CallHasOnSignatureRequested(
  1781  		js.Pointer(&ret),
  1782  		callback.Ref(),
  1783  	)
  1784  
  1785  	return
  1786  }
  1787  
  1788  // TryHasOnSignatureRequested calls the function "WEBEXT.certificateProvider.onSignatureRequested.hasListener"
  1789  // in a try/catch block and returns (_, err, ok = false) when it went through
  1790  // the catch clause.
  1791  func TryHasOnSignatureRequested(callback js.Func[func(request *SignatureRequest)]) (ret bool, exception js.Any, ok bool) {
  1792  	ok = js.True == bindings.TryHasOnSignatureRequested(
  1793  		js.Pointer(&ret), js.Pointer(&exception),
  1794  		callback.Ref(),
  1795  	)
  1796  
  1797  	return
  1798  }
  1799  
  1800  // HasFuncReportSignature returns true if the function "WEBEXT.certificateProvider.reportSignature" exists.
  1801  func HasFuncReportSignature() bool {
  1802  	return js.True == bindings.HasFuncReportSignature()
  1803  }
  1804  
  1805  // FuncReportSignature returns the function "WEBEXT.certificateProvider.reportSignature".
  1806  func FuncReportSignature() (fn js.Func[func(details ReportSignatureDetails) js.Promise[js.Void]]) {
  1807  	bindings.FuncReportSignature(
  1808  		js.Pointer(&fn),
  1809  	)
  1810  	return
  1811  }
  1812  
  1813  // ReportSignature calls the function "WEBEXT.certificateProvider.reportSignature" directly.
  1814  func ReportSignature(details ReportSignatureDetails) (ret js.Promise[js.Void]) {
  1815  	bindings.CallReportSignature(
  1816  		js.Pointer(&ret),
  1817  		js.Pointer(&details),
  1818  	)
  1819  
  1820  	return
  1821  }
  1822  
  1823  // TryReportSignature calls the function "WEBEXT.certificateProvider.reportSignature"
  1824  // in a try/catch block and returns (_, err, ok = false) when it went through
  1825  // the catch clause.
  1826  func TryReportSignature(details ReportSignatureDetails) (ret js.Promise[js.Void], exception js.Any, ok bool) {
  1827  	ok = js.True == bindings.TryReportSignature(
  1828  		js.Pointer(&ret), js.Pointer(&exception),
  1829  		js.Pointer(&details),
  1830  	)
  1831  
  1832  	return
  1833  }
  1834  
  1835  // HasFuncRequestPin returns true if the function "WEBEXT.certificateProvider.requestPin" exists.
  1836  func HasFuncRequestPin() bool {
  1837  	return js.True == bindings.HasFuncRequestPin()
  1838  }
  1839  
  1840  // FuncRequestPin returns the function "WEBEXT.certificateProvider.requestPin".
  1841  func FuncRequestPin() (fn js.Func[func(details RequestPinDetails) js.Promise[PinResponseDetails]]) {
  1842  	bindings.FuncRequestPin(
  1843  		js.Pointer(&fn),
  1844  	)
  1845  	return
  1846  }
  1847  
  1848  // RequestPin calls the function "WEBEXT.certificateProvider.requestPin" directly.
  1849  func RequestPin(details RequestPinDetails) (ret js.Promise[PinResponseDetails]) {
  1850  	bindings.CallRequestPin(
  1851  		js.Pointer(&ret),
  1852  		js.Pointer(&details),
  1853  	)
  1854  
  1855  	return
  1856  }
  1857  
  1858  // TryRequestPin calls the function "WEBEXT.certificateProvider.requestPin"
  1859  // in a try/catch block and returns (_, err, ok = false) when it went through
  1860  // the catch clause.
  1861  func TryRequestPin(details RequestPinDetails) (ret js.Promise[PinResponseDetails], exception js.Any, ok bool) {
  1862  	ok = js.True == bindings.TryRequestPin(
  1863  		js.Pointer(&ret), js.Pointer(&exception),
  1864  		js.Pointer(&details),
  1865  	)
  1866  
  1867  	return
  1868  }
  1869  
  1870  // HasFuncSetCertificates returns true if the function "WEBEXT.certificateProvider.setCertificates" exists.
  1871  func HasFuncSetCertificates() bool {
  1872  	return js.True == bindings.HasFuncSetCertificates()
  1873  }
  1874  
  1875  // FuncSetCertificates returns the function "WEBEXT.certificateProvider.setCertificates".
  1876  func FuncSetCertificates() (fn js.Func[func(details SetCertificatesDetails) js.Promise[js.Void]]) {
  1877  	bindings.FuncSetCertificates(
  1878  		js.Pointer(&fn),
  1879  	)
  1880  	return
  1881  }
  1882  
  1883  // SetCertificates calls the function "WEBEXT.certificateProvider.setCertificates" directly.
  1884  func SetCertificates(details SetCertificatesDetails) (ret js.Promise[js.Void]) {
  1885  	bindings.CallSetCertificates(
  1886  		js.Pointer(&ret),
  1887  		js.Pointer(&details),
  1888  	)
  1889  
  1890  	return
  1891  }
  1892  
  1893  // TrySetCertificates calls the function "WEBEXT.certificateProvider.setCertificates"
  1894  // in a try/catch block and returns (_, err, ok = false) when it went through
  1895  // the catch clause.
  1896  func TrySetCertificates(details SetCertificatesDetails) (ret js.Promise[js.Void], exception js.Any, ok bool) {
  1897  	ok = js.True == bindings.TrySetCertificates(
  1898  		js.Pointer(&ret), js.Pointer(&exception),
  1899  		js.Pointer(&details),
  1900  	)
  1901  
  1902  	return
  1903  }
  1904  
  1905  // HasFuncStopPinRequest returns true if the function "WEBEXT.certificateProvider.stopPinRequest" exists.
  1906  func HasFuncStopPinRequest() bool {
  1907  	return js.True == bindings.HasFuncStopPinRequest()
  1908  }
  1909  
  1910  // FuncStopPinRequest returns the function "WEBEXT.certificateProvider.stopPinRequest".
  1911  func FuncStopPinRequest() (fn js.Func[func(details StopPinRequestDetails) js.Promise[js.Void]]) {
  1912  	bindings.FuncStopPinRequest(
  1913  		js.Pointer(&fn),
  1914  	)
  1915  	return
  1916  }
  1917  
  1918  // StopPinRequest calls the function "WEBEXT.certificateProvider.stopPinRequest" directly.
  1919  func StopPinRequest(details StopPinRequestDetails) (ret js.Promise[js.Void]) {
  1920  	bindings.CallStopPinRequest(
  1921  		js.Pointer(&ret),
  1922  		js.Pointer(&details),
  1923  	)
  1924  
  1925  	return
  1926  }
  1927  
  1928  // TryStopPinRequest calls the function "WEBEXT.certificateProvider.stopPinRequest"
  1929  // in a try/catch block and returns (_, err, ok = false) when it went through
  1930  // the catch clause.
  1931  func TryStopPinRequest(details StopPinRequestDetails) (ret js.Promise[js.Void], exception js.Any, ok bool) {
  1932  	ok = js.True == bindings.TryStopPinRequest(
  1933  		js.Pointer(&ret), js.Pointer(&exception),
  1934  		js.Pointer(&details),
  1935  	)
  1936  
  1937  	return
  1938  }