github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/smartcardproviderprivate/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package smartcardproviderprivate 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/smartcardproviderprivate/bindings" 11 ) 12 13 type ConnectionState uint32 14 15 const ( 16 _ ConnectionState = iota 17 18 ConnectionState_ABSENT 19 ConnectionState_PRESENT 20 ConnectionState_SWALLOWED 21 ConnectionState_POWERED 22 ConnectionState_NEGOTIABLE 23 ConnectionState_SPECIFIC 24 ) 25 26 func (ConnectionState) FromRef(str js.Ref) ConnectionState { 27 return ConnectionState(bindings.ConstOfConnectionState(str)) 28 } 29 30 func (x ConnectionState) String() (string, bool) { 31 switch x { 32 case ConnectionState_ABSENT: 33 return "ABSENT", true 34 case ConnectionState_PRESENT: 35 return "PRESENT", true 36 case ConnectionState_SWALLOWED: 37 return "SWALLOWED", true 38 case ConnectionState_POWERED: 39 return "POWERED", true 40 case ConnectionState_NEGOTIABLE: 41 return "NEGOTIABLE", true 42 case ConnectionState_SPECIFIC: 43 return "SPECIFIC", true 44 default: 45 return "", false 46 } 47 } 48 49 type Disposition uint32 50 51 const ( 52 _ Disposition = iota 53 54 Disposition_LEAVE_CARD 55 Disposition_RESET_CARD 56 Disposition_UNPOWER_CARD 57 Disposition_EJECT_CARD 58 ) 59 60 func (Disposition) FromRef(str js.Ref) Disposition { 61 return Disposition(bindings.ConstOfDisposition(str)) 62 } 63 64 func (x Disposition) String() (string, bool) { 65 switch x { 66 case Disposition_LEAVE_CARD: 67 return "LEAVE_CARD", true 68 case Disposition_RESET_CARD: 69 return "RESET_CARD", true 70 case Disposition_UNPOWER_CARD: 71 return "UNPOWER_CARD", true 72 case Disposition_EJECT_CARD: 73 return "EJECT_CARD", true 74 default: 75 return "", false 76 } 77 } 78 79 type Protocol uint32 80 81 const ( 82 _ Protocol = iota 83 84 Protocol_UNDEFINED 85 Protocol_T0 86 Protocol_T1 87 Protocol_RAW 88 ) 89 90 func (Protocol) FromRef(str js.Ref) Protocol { 91 return Protocol(bindings.ConstOfProtocol(str)) 92 } 93 94 func (x Protocol) String() (string, bool) { 95 switch x { 96 case Protocol_UNDEFINED: 97 return "UNDEFINED", true 98 case Protocol_T0: 99 return "T0", true 100 case Protocol_T1: 101 return "T1", true 102 case Protocol_RAW: 103 return "RAW", true 104 default: 105 return "", false 106 } 107 } 108 109 type Protocols struct { 110 // T0 is "Protocols.t0" 111 // 112 // Optional 113 // 114 // NOTE: FFI_USE_T0 MUST be set to true to make this field effective. 115 T0 bool 116 // T1 is "Protocols.t1" 117 // 118 // Optional 119 // 120 // NOTE: FFI_USE_T1 MUST be set to true to make this field effective. 121 T1 bool 122 // Raw is "Protocols.raw" 123 // 124 // Optional 125 // 126 // NOTE: FFI_USE_Raw MUST be set to true to make this field effective. 127 Raw bool 128 129 FFI_USE_T0 bool // for T0. 130 FFI_USE_T1 bool // for T1. 131 FFI_USE_Raw bool // for Raw. 132 133 FFI_USE bool 134 } 135 136 // FromRef calls UpdateFrom and returns a Protocols with all fields set. 137 func (p Protocols) FromRef(ref js.Ref) Protocols { 138 p.UpdateFrom(ref) 139 return p 140 } 141 142 // New creates a new Protocols in the application heap. 143 func (p Protocols) New() js.Ref { 144 return bindings.ProtocolsJSLoad( 145 js.Pointer(&p), js.True, 0, 146 ) 147 } 148 149 // UpdateFrom copies value of all fields of the heap object to p. 150 func (p *Protocols) UpdateFrom(ref js.Ref) { 151 bindings.ProtocolsJSStore( 152 js.Pointer(p), ref, 153 ) 154 } 155 156 // Update writes all fields of the p to the heap object referenced by ref. 157 func (p *Protocols) Update(ref js.Ref) { 158 bindings.ProtocolsJSLoad( 159 js.Pointer(p), js.False, ref, 160 ) 161 } 162 163 // FreeMembers frees fields with heap reference, if recursive is true 164 // free all heap references reachable from p. 165 func (p *Protocols) FreeMembers(recursive bool) { 166 } 167 168 type ReaderStateFlags struct { 169 // Unaware is "ReaderStateFlags.unaware" 170 // 171 // Optional 172 // 173 // NOTE: FFI_USE_Unaware MUST be set to true to make this field effective. 174 Unaware bool 175 // Ignore is "ReaderStateFlags.ignore" 176 // 177 // Optional 178 // 179 // NOTE: FFI_USE_Ignore MUST be set to true to make this field effective. 180 Ignore bool 181 // Changed is "ReaderStateFlags.changed" 182 // 183 // Optional 184 // 185 // NOTE: FFI_USE_Changed MUST be set to true to make this field effective. 186 Changed bool 187 // Unknown is "ReaderStateFlags.unknown" 188 // 189 // Optional 190 // 191 // NOTE: FFI_USE_Unknown MUST be set to true to make this field effective. 192 Unknown bool 193 // Unavailable is "ReaderStateFlags.unavailable" 194 // 195 // Optional 196 // 197 // NOTE: FFI_USE_Unavailable MUST be set to true to make this field effective. 198 Unavailable bool 199 // Empty is "ReaderStateFlags.empty" 200 // 201 // Optional 202 // 203 // NOTE: FFI_USE_Empty MUST be set to true to make this field effective. 204 Empty bool 205 // Present is "ReaderStateFlags.present" 206 // 207 // Optional 208 // 209 // NOTE: FFI_USE_Present MUST be set to true to make this field effective. 210 Present bool 211 // Exclusive is "ReaderStateFlags.exclusive" 212 // 213 // Optional 214 // 215 // NOTE: FFI_USE_Exclusive MUST be set to true to make this field effective. 216 Exclusive bool 217 // Inuse is "ReaderStateFlags.inuse" 218 // 219 // Optional 220 // 221 // NOTE: FFI_USE_Inuse MUST be set to true to make this field effective. 222 Inuse bool 223 // Mute is "ReaderStateFlags.mute" 224 // 225 // Optional 226 // 227 // NOTE: FFI_USE_Mute MUST be set to true to make this field effective. 228 Mute bool 229 // Unpowered is "ReaderStateFlags.unpowered" 230 // 231 // Optional 232 // 233 // NOTE: FFI_USE_Unpowered MUST be set to true to make this field effective. 234 Unpowered bool 235 236 FFI_USE_Unaware bool // for Unaware. 237 FFI_USE_Ignore bool // for Ignore. 238 FFI_USE_Changed bool // for Changed. 239 FFI_USE_Unknown bool // for Unknown. 240 FFI_USE_Unavailable bool // for Unavailable. 241 FFI_USE_Empty bool // for Empty. 242 FFI_USE_Present bool // for Present. 243 FFI_USE_Exclusive bool // for Exclusive. 244 FFI_USE_Inuse bool // for Inuse. 245 FFI_USE_Mute bool // for Mute. 246 FFI_USE_Unpowered bool // for Unpowered. 247 248 FFI_USE bool 249 } 250 251 // FromRef calls UpdateFrom and returns a ReaderStateFlags with all fields set. 252 func (p ReaderStateFlags) FromRef(ref js.Ref) ReaderStateFlags { 253 p.UpdateFrom(ref) 254 return p 255 } 256 257 // New creates a new ReaderStateFlags in the application heap. 258 func (p ReaderStateFlags) New() js.Ref { 259 return bindings.ReaderStateFlagsJSLoad( 260 js.Pointer(&p), js.True, 0, 261 ) 262 } 263 264 // UpdateFrom copies value of all fields of the heap object to p. 265 func (p *ReaderStateFlags) UpdateFrom(ref js.Ref) { 266 bindings.ReaderStateFlagsJSStore( 267 js.Pointer(p), ref, 268 ) 269 } 270 271 // Update writes all fields of the p to the heap object referenced by ref. 272 func (p *ReaderStateFlags) Update(ref js.Ref) { 273 bindings.ReaderStateFlagsJSLoad( 274 js.Pointer(p), js.False, ref, 275 ) 276 } 277 278 // FreeMembers frees fields with heap reference, if recursive is true 279 // free all heap references reachable from p. 280 func (p *ReaderStateFlags) FreeMembers(recursive bool) { 281 } 282 283 type ReaderStateIn struct { 284 // Reader is "ReaderStateIn.reader" 285 // 286 // Optional 287 Reader js.String 288 // CurrentState is "ReaderStateIn.currentState" 289 // 290 // Optional 291 // 292 // NOTE: CurrentState.FFI_USE MUST be set to true to get CurrentState used. 293 CurrentState ReaderStateFlags 294 // CurrentCount is "ReaderStateIn.currentCount" 295 // 296 // Optional 297 // 298 // NOTE: FFI_USE_CurrentCount MUST be set to true to make this field effective. 299 CurrentCount int32 300 301 FFI_USE_CurrentCount bool // for CurrentCount. 302 303 FFI_USE bool 304 } 305 306 // FromRef calls UpdateFrom and returns a ReaderStateIn with all fields set. 307 func (p ReaderStateIn) FromRef(ref js.Ref) ReaderStateIn { 308 p.UpdateFrom(ref) 309 return p 310 } 311 312 // New creates a new ReaderStateIn in the application heap. 313 func (p ReaderStateIn) New() js.Ref { 314 return bindings.ReaderStateInJSLoad( 315 js.Pointer(&p), js.True, 0, 316 ) 317 } 318 319 // UpdateFrom copies value of all fields of the heap object to p. 320 func (p *ReaderStateIn) UpdateFrom(ref js.Ref) { 321 bindings.ReaderStateInJSStore( 322 js.Pointer(p), ref, 323 ) 324 } 325 326 // Update writes all fields of the p to the heap object referenced by ref. 327 func (p *ReaderStateIn) Update(ref js.Ref) { 328 bindings.ReaderStateInJSLoad( 329 js.Pointer(p), js.False, ref, 330 ) 331 } 332 333 // FreeMembers frees fields with heap reference, if recursive is true 334 // free all heap references reachable from p. 335 func (p *ReaderStateIn) FreeMembers(recursive bool) { 336 js.Free( 337 p.Reader.Ref(), 338 ) 339 p.Reader = p.Reader.FromRef(js.Undefined) 340 if recursive { 341 p.CurrentState.FreeMembers(true) 342 } 343 } 344 345 type ReaderStateOut struct { 346 // Reader is "ReaderStateOut.reader" 347 // 348 // Optional 349 Reader js.String 350 // EventState is "ReaderStateOut.eventState" 351 // 352 // Optional 353 // 354 // NOTE: EventState.FFI_USE MUST be set to true to get EventState used. 355 EventState ReaderStateFlags 356 // EventCount is "ReaderStateOut.eventCount" 357 // 358 // Optional 359 // 360 // NOTE: FFI_USE_EventCount MUST be set to true to make this field effective. 361 EventCount int32 362 // Atr is "ReaderStateOut.atr" 363 // 364 // Optional 365 Atr js.ArrayBuffer 366 367 FFI_USE_EventCount bool // for EventCount. 368 369 FFI_USE bool 370 } 371 372 // FromRef calls UpdateFrom and returns a ReaderStateOut with all fields set. 373 func (p ReaderStateOut) FromRef(ref js.Ref) ReaderStateOut { 374 p.UpdateFrom(ref) 375 return p 376 } 377 378 // New creates a new ReaderStateOut in the application heap. 379 func (p ReaderStateOut) New() js.Ref { 380 return bindings.ReaderStateOutJSLoad( 381 js.Pointer(&p), js.True, 0, 382 ) 383 } 384 385 // UpdateFrom copies value of all fields of the heap object to p. 386 func (p *ReaderStateOut) UpdateFrom(ref js.Ref) { 387 bindings.ReaderStateOutJSStore( 388 js.Pointer(p), ref, 389 ) 390 } 391 392 // Update writes all fields of the p to the heap object referenced by ref. 393 func (p *ReaderStateOut) Update(ref js.Ref) { 394 bindings.ReaderStateOutJSLoad( 395 js.Pointer(p), js.False, ref, 396 ) 397 } 398 399 // FreeMembers frees fields with heap reference, if recursive is true 400 // free all heap references reachable from p. 401 func (p *ReaderStateOut) FreeMembers(recursive bool) { 402 js.Free( 403 p.Reader.Ref(), 404 p.Atr.Ref(), 405 ) 406 p.Reader = p.Reader.FromRef(js.Undefined) 407 p.Atr = p.Atr.FromRef(js.Undefined) 408 if recursive { 409 p.EventState.FreeMembers(true) 410 } 411 } 412 413 type ResultCode uint32 414 415 const ( 416 _ ResultCode = iota 417 418 ResultCode_SUCCESS 419 ResultCode_REMOVED_CARD 420 ResultCode_RESET_CARD 421 ResultCode_UNPOWERED_CARD 422 ResultCode_UNRESPONSIVE_CARD 423 ResultCode_UNSUPPORTED_CARD 424 ResultCode_READER_UNAVAILABLE 425 ResultCode_SHARING_VIOLATION 426 ResultCode_NOT_TRANSACTED 427 ResultCode_NO_SMARTCARD 428 ResultCode_PROTO_MISMATCH 429 ResultCode_SYSTEM_CANCELLED 430 ResultCode_NOT_READY 431 ResultCode_CANCELLED 432 ResultCode_INSUFFICIENT_BUFFER 433 ResultCode_INVALID_HANDLE 434 ResultCode_INVALID_PARAMETER 435 ResultCode_INVALID_VALUE 436 ResultCode_NO_MEMORY 437 ResultCode_TIMEOUT 438 ResultCode_UNKNOWN_READER 439 ResultCode_UNSUPPORTED_FEATURE 440 ResultCode_NO_READERS_AVAILABLE 441 ResultCode_SERVICE_STOPPED 442 ResultCode_NO_SERVICE 443 ResultCode_COMM_ERROR 444 ResultCode_INTERNAL_ERROR 445 ResultCode_UNKNOWN_ERROR 446 ResultCode_SERVER_TOO_BUSY 447 ResultCode_UNEXPECTED 448 ResultCode_SHUTDOWN 449 ResultCode_UNKNOWN 450 ) 451 452 func (ResultCode) FromRef(str js.Ref) ResultCode { 453 return ResultCode(bindings.ConstOfResultCode(str)) 454 } 455 456 func (x ResultCode) String() (string, bool) { 457 switch x { 458 case ResultCode_SUCCESS: 459 return "SUCCESS", true 460 case ResultCode_REMOVED_CARD: 461 return "REMOVED_CARD", true 462 case ResultCode_RESET_CARD: 463 return "RESET_CARD", true 464 case ResultCode_UNPOWERED_CARD: 465 return "UNPOWERED_CARD", true 466 case ResultCode_UNRESPONSIVE_CARD: 467 return "UNRESPONSIVE_CARD", true 468 case ResultCode_UNSUPPORTED_CARD: 469 return "UNSUPPORTED_CARD", true 470 case ResultCode_READER_UNAVAILABLE: 471 return "READER_UNAVAILABLE", true 472 case ResultCode_SHARING_VIOLATION: 473 return "SHARING_VIOLATION", true 474 case ResultCode_NOT_TRANSACTED: 475 return "NOT_TRANSACTED", true 476 case ResultCode_NO_SMARTCARD: 477 return "NO_SMARTCARD", true 478 case ResultCode_PROTO_MISMATCH: 479 return "PROTO_MISMATCH", true 480 case ResultCode_SYSTEM_CANCELLED: 481 return "SYSTEM_CANCELLED", true 482 case ResultCode_NOT_READY: 483 return "NOT_READY", true 484 case ResultCode_CANCELLED: 485 return "CANCELLED", true 486 case ResultCode_INSUFFICIENT_BUFFER: 487 return "INSUFFICIENT_BUFFER", true 488 case ResultCode_INVALID_HANDLE: 489 return "INVALID_HANDLE", true 490 case ResultCode_INVALID_PARAMETER: 491 return "INVALID_PARAMETER", true 492 case ResultCode_INVALID_VALUE: 493 return "INVALID_VALUE", true 494 case ResultCode_NO_MEMORY: 495 return "NO_MEMORY", true 496 case ResultCode_TIMEOUT: 497 return "TIMEOUT", true 498 case ResultCode_UNKNOWN_READER: 499 return "UNKNOWN_READER", true 500 case ResultCode_UNSUPPORTED_FEATURE: 501 return "UNSUPPORTED_FEATURE", true 502 case ResultCode_NO_READERS_AVAILABLE: 503 return "NO_READERS_AVAILABLE", true 504 case ResultCode_SERVICE_STOPPED: 505 return "SERVICE_STOPPED", true 506 case ResultCode_NO_SERVICE: 507 return "NO_SERVICE", true 508 case ResultCode_COMM_ERROR: 509 return "COMM_ERROR", true 510 case ResultCode_INTERNAL_ERROR: 511 return "INTERNAL_ERROR", true 512 case ResultCode_UNKNOWN_ERROR: 513 return "UNKNOWN_ERROR", true 514 case ResultCode_SERVER_TOO_BUSY: 515 return "SERVER_TOO_BUSY", true 516 case ResultCode_UNEXPECTED: 517 return "UNEXPECTED", true 518 case ResultCode_SHUTDOWN: 519 return "SHUTDOWN", true 520 case ResultCode_UNKNOWN: 521 return "UNKNOWN", true 522 default: 523 return "", false 524 } 525 } 526 527 type ShareMode uint32 528 529 const ( 530 _ ShareMode = iota 531 532 ShareMode_SHARED 533 ShareMode_EXCLUSIVE 534 ShareMode_DIRECT 535 ) 536 537 func (ShareMode) FromRef(str js.Ref) ShareMode { 538 return ShareMode(bindings.ConstOfShareMode(str)) 539 } 540 541 func (x ShareMode) String() (string, bool) { 542 switch x { 543 case ShareMode_SHARED: 544 return "SHARED", true 545 case ShareMode_EXCLUSIVE: 546 return "EXCLUSIVE", true 547 case ShareMode_DIRECT: 548 return "DIRECT", true 549 default: 550 return "", false 551 } 552 } 553 554 type Timeout struct { 555 // Milliseconds is "Timeout.milliseconds" 556 // 557 // Optional 558 // 559 // NOTE: FFI_USE_Milliseconds MUST be set to true to make this field effective. 560 Milliseconds int32 561 562 FFI_USE_Milliseconds bool // for Milliseconds. 563 564 FFI_USE bool 565 } 566 567 // FromRef calls UpdateFrom and returns a Timeout with all fields set. 568 func (p Timeout) FromRef(ref js.Ref) Timeout { 569 p.UpdateFrom(ref) 570 return p 571 } 572 573 // New creates a new Timeout in the application heap. 574 func (p Timeout) New() js.Ref { 575 return bindings.TimeoutJSLoad( 576 js.Pointer(&p), js.True, 0, 577 ) 578 } 579 580 // UpdateFrom copies value of all fields of the heap object to p. 581 func (p *Timeout) UpdateFrom(ref js.Ref) { 582 bindings.TimeoutJSStore( 583 js.Pointer(p), ref, 584 ) 585 } 586 587 // Update writes all fields of the p to the heap object referenced by ref. 588 func (p *Timeout) Update(ref js.Ref) { 589 bindings.TimeoutJSLoad( 590 js.Pointer(p), js.False, ref, 591 ) 592 } 593 594 // FreeMembers frees fields with heap reference, if recursive is true 595 // free all heap references reachable from p. 596 func (p *Timeout) FreeMembers(recursive bool) { 597 } 598 599 type OnBeginTransactionRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32) js.Ref 600 601 func (fn OnBeginTransactionRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32)] { 602 return js.RegisterCallback[func(requestId int32, scardHandle int32)]( 603 fn, abi.FuncPCABIInternal(fn), 604 ) 605 } 606 607 func (fn OnBeginTransactionRequestedEventCallbackFunc) DispatchCallback( 608 targetPC uintptr, ctx *js.CallbackContext, 609 ) { 610 args := ctx.Args() 611 if len(args) != 2+1 /* js this */ || 612 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 613 js.ThrowInvalidCallbackInvocation() 614 } 615 616 if ctx.Return(fn( 617 args[0], 618 619 js.Number[int32]{}.FromRef(args[0+1]).Get(), 620 js.Number[int32]{}.FromRef(args[1+1]).Get(), 621 )) { 622 return 623 } 624 625 js.ThrowCallbackValueNotReturned() 626 } 627 628 type OnBeginTransactionRequestedEventCallback[T any] struct { 629 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32) js.Ref 630 Arg T 631 } 632 633 func (cb *OnBeginTransactionRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32)] { 634 return js.RegisterCallback[func(requestId int32, scardHandle int32)]( 635 cb, abi.FuncPCABIInternal(cb.Fn), 636 ) 637 } 638 639 func (cb *OnBeginTransactionRequestedEventCallback[T]) DispatchCallback( 640 targetPC uintptr, ctx *js.CallbackContext, 641 ) { 642 args := ctx.Args() 643 if len(args) != 2+1 /* js this */ || 644 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 645 js.ThrowInvalidCallbackInvocation() 646 } 647 648 if ctx.Return(cb.Fn( 649 cb.Arg, 650 args[0], 651 652 js.Number[int32]{}.FromRef(args[0+1]).Get(), 653 js.Number[int32]{}.FromRef(args[1+1]).Get(), 654 )) { 655 return 656 } 657 658 js.ThrowCallbackValueNotReturned() 659 } 660 661 // HasFuncOnBeginTransactionRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.addListener" exists. 662 func HasFuncOnBeginTransactionRequested() bool { 663 return js.True == bindings.HasFuncOnBeginTransactionRequested() 664 } 665 666 // FuncOnBeginTransactionRequested returns the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.addListener". 667 func FuncOnBeginTransactionRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32)])]) { 668 bindings.FuncOnBeginTransactionRequested( 669 js.Pointer(&fn), 670 ) 671 return 672 } 673 674 // OnBeginTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.addListener" directly. 675 func OnBeginTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void) { 676 bindings.CallOnBeginTransactionRequested( 677 js.Pointer(&ret), 678 callback.Ref(), 679 ) 680 681 return 682 } 683 684 // TryOnBeginTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.addListener" 685 // in a try/catch block and returns (_, err, ok = false) when it went through 686 // the catch clause. 687 func TryOnBeginTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void, exception js.Any, ok bool) { 688 ok = js.True == bindings.TryOnBeginTransactionRequested( 689 js.Pointer(&ret), js.Pointer(&exception), 690 callback.Ref(), 691 ) 692 693 return 694 } 695 696 // HasFuncOffBeginTransactionRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.removeListener" exists. 697 func HasFuncOffBeginTransactionRequested() bool { 698 return js.True == bindings.HasFuncOffBeginTransactionRequested() 699 } 700 701 // FuncOffBeginTransactionRequested returns the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.removeListener". 702 func FuncOffBeginTransactionRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32)])]) { 703 bindings.FuncOffBeginTransactionRequested( 704 js.Pointer(&fn), 705 ) 706 return 707 } 708 709 // OffBeginTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.removeListener" directly. 710 func OffBeginTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void) { 711 bindings.CallOffBeginTransactionRequested( 712 js.Pointer(&ret), 713 callback.Ref(), 714 ) 715 716 return 717 } 718 719 // TryOffBeginTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.removeListener" 720 // in a try/catch block and returns (_, err, ok = false) when it went through 721 // the catch clause. 722 func TryOffBeginTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void, exception js.Any, ok bool) { 723 ok = js.True == bindings.TryOffBeginTransactionRequested( 724 js.Pointer(&ret), js.Pointer(&exception), 725 callback.Ref(), 726 ) 727 728 return 729 } 730 731 // HasFuncHasOnBeginTransactionRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.hasListener" exists. 732 func HasFuncHasOnBeginTransactionRequested() bool { 733 return js.True == bindings.HasFuncHasOnBeginTransactionRequested() 734 } 735 736 // FuncHasOnBeginTransactionRequested returns the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.hasListener". 737 func FuncHasOnBeginTransactionRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32)]) bool]) { 738 bindings.FuncHasOnBeginTransactionRequested( 739 js.Pointer(&fn), 740 ) 741 return 742 } 743 744 // HasOnBeginTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.hasListener" directly. 745 func HasOnBeginTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret bool) { 746 bindings.CallHasOnBeginTransactionRequested( 747 js.Pointer(&ret), 748 callback.Ref(), 749 ) 750 751 return 752 } 753 754 // TryHasOnBeginTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.hasListener" 755 // in a try/catch block and returns (_, err, ok = false) when it went through 756 // the catch clause. 757 func TryHasOnBeginTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret bool, exception js.Any, ok bool) { 758 ok = js.True == bindings.TryHasOnBeginTransactionRequested( 759 js.Pointer(&ret), js.Pointer(&exception), 760 callback.Ref(), 761 ) 762 763 return 764 } 765 766 type OnCancelRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardContext int32) js.Ref 767 768 func (fn OnCancelRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardContext int32)] { 769 return js.RegisterCallback[func(requestId int32, scardContext int32)]( 770 fn, abi.FuncPCABIInternal(fn), 771 ) 772 } 773 774 func (fn OnCancelRequestedEventCallbackFunc) DispatchCallback( 775 targetPC uintptr, ctx *js.CallbackContext, 776 ) { 777 args := ctx.Args() 778 if len(args) != 2+1 /* js this */ || 779 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 780 js.ThrowInvalidCallbackInvocation() 781 } 782 783 if ctx.Return(fn( 784 args[0], 785 786 js.Number[int32]{}.FromRef(args[0+1]).Get(), 787 js.Number[int32]{}.FromRef(args[1+1]).Get(), 788 )) { 789 return 790 } 791 792 js.ThrowCallbackValueNotReturned() 793 } 794 795 type OnCancelRequestedEventCallback[T any] struct { 796 Fn func(arg T, this js.Ref, requestId int32, scardContext int32) js.Ref 797 Arg T 798 } 799 800 func (cb *OnCancelRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardContext int32)] { 801 return js.RegisterCallback[func(requestId int32, scardContext int32)]( 802 cb, abi.FuncPCABIInternal(cb.Fn), 803 ) 804 } 805 806 func (cb *OnCancelRequestedEventCallback[T]) DispatchCallback( 807 targetPC uintptr, ctx *js.CallbackContext, 808 ) { 809 args := ctx.Args() 810 if len(args) != 2+1 /* js this */ || 811 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 812 js.ThrowInvalidCallbackInvocation() 813 } 814 815 if ctx.Return(cb.Fn( 816 cb.Arg, 817 args[0], 818 819 js.Number[int32]{}.FromRef(args[0+1]).Get(), 820 js.Number[int32]{}.FromRef(args[1+1]).Get(), 821 )) { 822 return 823 } 824 825 js.ThrowCallbackValueNotReturned() 826 } 827 828 // HasFuncOnCancelRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.addListener" exists. 829 func HasFuncOnCancelRequested() bool { 830 return js.True == bindings.HasFuncOnCancelRequested() 831 } 832 833 // FuncOnCancelRequested returns the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.addListener". 834 func FuncOnCancelRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)])]) { 835 bindings.FuncOnCancelRequested( 836 js.Pointer(&fn), 837 ) 838 return 839 } 840 841 // OnCancelRequested calls the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.addListener" directly. 842 func OnCancelRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void) { 843 bindings.CallOnCancelRequested( 844 js.Pointer(&ret), 845 callback.Ref(), 846 ) 847 848 return 849 } 850 851 // TryOnCancelRequested calls the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.addListener" 852 // in a try/catch block and returns (_, err, ok = false) when it went through 853 // the catch clause. 854 func TryOnCancelRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void, exception js.Any, ok bool) { 855 ok = js.True == bindings.TryOnCancelRequested( 856 js.Pointer(&ret), js.Pointer(&exception), 857 callback.Ref(), 858 ) 859 860 return 861 } 862 863 // HasFuncOffCancelRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.removeListener" exists. 864 func HasFuncOffCancelRequested() bool { 865 return js.True == bindings.HasFuncOffCancelRequested() 866 } 867 868 // FuncOffCancelRequested returns the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.removeListener". 869 func FuncOffCancelRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)])]) { 870 bindings.FuncOffCancelRequested( 871 js.Pointer(&fn), 872 ) 873 return 874 } 875 876 // OffCancelRequested calls the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.removeListener" directly. 877 func OffCancelRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void) { 878 bindings.CallOffCancelRequested( 879 js.Pointer(&ret), 880 callback.Ref(), 881 ) 882 883 return 884 } 885 886 // TryOffCancelRequested calls the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.removeListener" 887 // in a try/catch block and returns (_, err, ok = false) when it went through 888 // the catch clause. 889 func TryOffCancelRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void, exception js.Any, ok bool) { 890 ok = js.True == bindings.TryOffCancelRequested( 891 js.Pointer(&ret), js.Pointer(&exception), 892 callback.Ref(), 893 ) 894 895 return 896 } 897 898 // HasFuncHasOnCancelRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.hasListener" exists. 899 func HasFuncHasOnCancelRequested() bool { 900 return js.True == bindings.HasFuncHasOnCancelRequested() 901 } 902 903 // FuncHasOnCancelRequested returns the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.hasListener". 904 func FuncHasOnCancelRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)]) bool]) { 905 bindings.FuncHasOnCancelRequested( 906 js.Pointer(&fn), 907 ) 908 return 909 } 910 911 // HasOnCancelRequested calls the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.hasListener" directly. 912 func HasOnCancelRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret bool) { 913 bindings.CallHasOnCancelRequested( 914 js.Pointer(&ret), 915 callback.Ref(), 916 ) 917 918 return 919 } 920 921 // TryHasOnCancelRequested calls the function "WEBEXT.smartCardProviderPrivate.onCancelRequested.hasListener" 922 // in a try/catch block and returns (_, err, ok = false) when it went through 923 // the catch clause. 924 func TryHasOnCancelRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret bool, exception js.Any, ok bool) { 925 ok = js.True == bindings.TryHasOnCancelRequested( 926 js.Pointer(&ret), js.Pointer(&exception), 927 callback.Ref(), 928 ) 929 930 return 931 } 932 933 type OnConnectRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols) js.Ref 934 935 func (fn OnConnectRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)] { 936 return js.RegisterCallback[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]( 937 fn, abi.FuncPCABIInternal(fn), 938 ) 939 } 940 941 func (fn OnConnectRequestedEventCallbackFunc) DispatchCallback( 942 targetPC uintptr, ctx *js.CallbackContext, 943 ) { 944 args := ctx.Args() 945 if len(args) != 5+1 /* js this */ || 946 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 947 js.ThrowInvalidCallbackInvocation() 948 } 949 var arg4 Protocols 950 arg4.UpdateFrom(args[4+1]) 951 defer arg4.FreeMembers(true) 952 953 if ctx.Return(fn( 954 args[0], 955 956 js.Number[int32]{}.FromRef(args[0+1]).Get(), 957 js.Number[int32]{}.FromRef(args[1+1]).Get(), 958 js.String{}.FromRef(args[2+1]), 959 ShareMode(0).FromRef(args[3+1]), 960 mark.NoEscape(&arg4), 961 )) { 962 return 963 } 964 965 js.ThrowCallbackValueNotReturned() 966 } 967 968 type OnConnectRequestedEventCallback[T any] struct { 969 Fn func(arg T, this js.Ref, requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols) js.Ref 970 Arg T 971 } 972 973 func (cb *OnConnectRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)] { 974 return js.RegisterCallback[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]( 975 cb, abi.FuncPCABIInternal(cb.Fn), 976 ) 977 } 978 979 func (cb *OnConnectRequestedEventCallback[T]) DispatchCallback( 980 targetPC uintptr, ctx *js.CallbackContext, 981 ) { 982 args := ctx.Args() 983 if len(args) != 5+1 /* js this */ || 984 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 985 js.ThrowInvalidCallbackInvocation() 986 } 987 var arg4 Protocols 988 arg4.UpdateFrom(args[4+1]) 989 defer arg4.FreeMembers(true) 990 991 if ctx.Return(cb.Fn( 992 cb.Arg, 993 args[0], 994 995 js.Number[int32]{}.FromRef(args[0+1]).Get(), 996 js.Number[int32]{}.FromRef(args[1+1]).Get(), 997 js.String{}.FromRef(args[2+1]), 998 ShareMode(0).FromRef(args[3+1]), 999 mark.NoEscape(&arg4), 1000 )) { 1001 return 1002 } 1003 1004 js.ThrowCallbackValueNotReturned() 1005 } 1006 1007 // HasFuncOnConnectRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.addListener" exists. 1008 func HasFuncOnConnectRequested() bool { 1009 return js.True == bindings.HasFuncOnConnectRequested() 1010 } 1011 1012 // FuncOnConnectRequested returns the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.addListener". 1013 func FuncOnConnectRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)])]) { 1014 bindings.FuncOnConnectRequested( 1015 js.Pointer(&fn), 1016 ) 1017 return 1018 } 1019 1020 // OnConnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.addListener" directly. 1021 func OnConnectRequested(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]) (ret js.Void) { 1022 bindings.CallOnConnectRequested( 1023 js.Pointer(&ret), 1024 callback.Ref(), 1025 ) 1026 1027 return 1028 } 1029 1030 // TryOnConnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.addListener" 1031 // in a try/catch block and returns (_, err, ok = false) when it went through 1032 // the catch clause. 1033 func TryOnConnectRequested(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]) (ret js.Void, exception js.Any, ok bool) { 1034 ok = js.True == bindings.TryOnConnectRequested( 1035 js.Pointer(&ret), js.Pointer(&exception), 1036 callback.Ref(), 1037 ) 1038 1039 return 1040 } 1041 1042 // HasFuncOffConnectRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.removeListener" exists. 1043 func HasFuncOffConnectRequested() bool { 1044 return js.True == bindings.HasFuncOffConnectRequested() 1045 } 1046 1047 // FuncOffConnectRequested returns the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.removeListener". 1048 func FuncOffConnectRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)])]) { 1049 bindings.FuncOffConnectRequested( 1050 js.Pointer(&fn), 1051 ) 1052 return 1053 } 1054 1055 // OffConnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.removeListener" directly. 1056 func OffConnectRequested(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]) (ret js.Void) { 1057 bindings.CallOffConnectRequested( 1058 js.Pointer(&ret), 1059 callback.Ref(), 1060 ) 1061 1062 return 1063 } 1064 1065 // TryOffConnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.removeListener" 1066 // in a try/catch block and returns (_, err, ok = false) when it went through 1067 // the catch clause. 1068 func TryOffConnectRequested(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]) (ret js.Void, exception js.Any, ok bool) { 1069 ok = js.True == bindings.TryOffConnectRequested( 1070 js.Pointer(&ret), js.Pointer(&exception), 1071 callback.Ref(), 1072 ) 1073 1074 return 1075 } 1076 1077 // HasFuncHasOnConnectRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.hasListener" exists. 1078 func HasFuncHasOnConnectRequested() bool { 1079 return js.True == bindings.HasFuncHasOnConnectRequested() 1080 } 1081 1082 // FuncHasOnConnectRequested returns the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.hasListener". 1083 func FuncHasOnConnectRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]) bool]) { 1084 bindings.FuncHasOnConnectRequested( 1085 js.Pointer(&fn), 1086 ) 1087 return 1088 } 1089 1090 // HasOnConnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.hasListener" directly. 1091 func HasOnConnectRequested(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]) (ret bool) { 1092 bindings.CallHasOnConnectRequested( 1093 js.Pointer(&ret), 1094 callback.Ref(), 1095 ) 1096 1097 return 1098 } 1099 1100 // TryHasOnConnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onConnectRequested.hasListener" 1101 // in a try/catch block and returns (_, err, ok = false) when it went through 1102 // the catch clause. 1103 func TryHasOnConnectRequested(callback js.Func[func(requestId int32, scardContext int32, reader js.String, shareMode ShareMode, preferredProtocols *Protocols)]) (ret bool, exception js.Any, ok bool) { 1104 ok = js.True == bindings.TryHasOnConnectRequested( 1105 js.Pointer(&ret), js.Pointer(&exception), 1106 callback.Ref(), 1107 ) 1108 1109 return 1110 } 1111 1112 type OnControlRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer) js.Ref 1113 1114 func (fn OnControlRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)] { 1115 return js.RegisterCallback[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]( 1116 fn, abi.FuncPCABIInternal(fn), 1117 ) 1118 } 1119 1120 func (fn OnControlRequestedEventCallbackFunc) DispatchCallback( 1121 targetPC uintptr, ctx *js.CallbackContext, 1122 ) { 1123 args := ctx.Args() 1124 if len(args) != 4+1 /* js this */ || 1125 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1126 js.ThrowInvalidCallbackInvocation() 1127 } 1128 1129 if ctx.Return(fn( 1130 args[0], 1131 1132 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1133 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1134 js.Number[int32]{}.FromRef(args[2+1]).Get(), 1135 js.ArrayBuffer{}.FromRef(args[3+1]), 1136 )) { 1137 return 1138 } 1139 1140 js.ThrowCallbackValueNotReturned() 1141 } 1142 1143 type OnControlRequestedEventCallback[T any] struct { 1144 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer) js.Ref 1145 Arg T 1146 } 1147 1148 func (cb *OnControlRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)] { 1149 return js.RegisterCallback[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]( 1150 cb, abi.FuncPCABIInternal(cb.Fn), 1151 ) 1152 } 1153 1154 func (cb *OnControlRequestedEventCallback[T]) DispatchCallback( 1155 targetPC uintptr, ctx *js.CallbackContext, 1156 ) { 1157 args := ctx.Args() 1158 if len(args) != 4+1 /* js this */ || 1159 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1160 js.ThrowInvalidCallbackInvocation() 1161 } 1162 1163 if ctx.Return(cb.Fn( 1164 cb.Arg, 1165 args[0], 1166 1167 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1168 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1169 js.Number[int32]{}.FromRef(args[2+1]).Get(), 1170 js.ArrayBuffer{}.FromRef(args[3+1]), 1171 )) { 1172 return 1173 } 1174 1175 js.ThrowCallbackValueNotReturned() 1176 } 1177 1178 // HasFuncOnControlRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onControlRequested.addListener" exists. 1179 func HasFuncOnControlRequested() bool { 1180 return js.True == bindings.HasFuncOnControlRequested() 1181 } 1182 1183 // FuncOnControlRequested returns the function "WEBEXT.smartCardProviderPrivate.onControlRequested.addListener". 1184 func FuncOnControlRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)])]) { 1185 bindings.FuncOnControlRequested( 1186 js.Pointer(&fn), 1187 ) 1188 return 1189 } 1190 1191 // OnControlRequested calls the function "WEBEXT.smartCardProviderPrivate.onControlRequested.addListener" directly. 1192 func OnControlRequested(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]) (ret js.Void) { 1193 bindings.CallOnControlRequested( 1194 js.Pointer(&ret), 1195 callback.Ref(), 1196 ) 1197 1198 return 1199 } 1200 1201 // TryOnControlRequested calls the function "WEBEXT.smartCardProviderPrivate.onControlRequested.addListener" 1202 // in a try/catch block and returns (_, err, ok = false) when it went through 1203 // the catch clause. 1204 func TryOnControlRequested(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]) (ret js.Void, exception js.Any, ok bool) { 1205 ok = js.True == bindings.TryOnControlRequested( 1206 js.Pointer(&ret), js.Pointer(&exception), 1207 callback.Ref(), 1208 ) 1209 1210 return 1211 } 1212 1213 // HasFuncOffControlRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onControlRequested.removeListener" exists. 1214 func HasFuncOffControlRequested() bool { 1215 return js.True == bindings.HasFuncOffControlRequested() 1216 } 1217 1218 // FuncOffControlRequested returns the function "WEBEXT.smartCardProviderPrivate.onControlRequested.removeListener". 1219 func FuncOffControlRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)])]) { 1220 bindings.FuncOffControlRequested( 1221 js.Pointer(&fn), 1222 ) 1223 return 1224 } 1225 1226 // OffControlRequested calls the function "WEBEXT.smartCardProviderPrivate.onControlRequested.removeListener" directly. 1227 func OffControlRequested(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]) (ret js.Void) { 1228 bindings.CallOffControlRequested( 1229 js.Pointer(&ret), 1230 callback.Ref(), 1231 ) 1232 1233 return 1234 } 1235 1236 // TryOffControlRequested calls the function "WEBEXT.smartCardProviderPrivate.onControlRequested.removeListener" 1237 // in a try/catch block and returns (_, err, ok = false) when it went through 1238 // the catch clause. 1239 func TryOffControlRequested(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]) (ret js.Void, exception js.Any, ok bool) { 1240 ok = js.True == bindings.TryOffControlRequested( 1241 js.Pointer(&ret), js.Pointer(&exception), 1242 callback.Ref(), 1243 ) 1244 1245 return 1246 } 1247 1248 // HasFuncHasOnControlRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onControlRequested.hasListener" exists. 1249 func HasFuncHasOnControlRequested() bool { 1250 return js.True == bindings.HasFuncHasOnControlRequested() 1251 } 1252 1253 // FuncHasOnControlRequested returns the function "WEBEXT.smartCardProviderPrivate.onControlRequested.hasListener". 1254 func FuncHasOnControlRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]) bool]) { 1255 bindings.FuncHasOnControlRequested( 1256 js.Pointer(&fn), 1257 ) 1258 return 1259 } 1260 1261 // HasOnControlRequested calls the function "WEBEXT.smartCardProviderPrivate.onControlRequested.hasListener" directly. 1262 func HasOnControlRequested(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]) (ret bool) { 1263 bindings.CallHasOnControlRequested( 1264 js.Pointer(&ret), 1265 callback.Ref(), 1266 ) 1267 1268 return 1269 } 1270 1271 // TryHasOnControlRequested calls the function "WEBEXT.smartCardProviderPrivate.onControlRequested.hasListener" 1272 // in a try/catch block and returns (_, err, ok = false) when it went through 1273 // the catch clause. 1274 func TryHasOnControlRequested(callback js.Func[func(requestId int32, scardHandle int32, controlCode int32, data js.ArrayBuffer)]) (ret bool, exception js.Any, ok bool) { 1275 ok = js.True == bindings.TryHasOnControlRequested( 1276 js.Pointer(&ret), js.Pointer(&exception), 1277 callback.Ref(), 1278 ) 1279 1280 return 1281 } 1282 1283 type OnDisconnectRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32, disposition Disposition) js.Ref 1284 1285 func (fn OnDisconnectRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32, disposition Disposition)] { 1286 return js.RegisterCallback[func(requestId int32, scardHandle int32, disposition Disposition)]( 1287 fn, abi.FuncPCABIInternal(fn), 1288 ) 1289 } 1290 1291 func (fn OnDisconnectRequestedEventCallbackFunc) DispatchCallback( 1292 targetPC uintptr, ctx *js.CallbackContext, 1293 ) { 1294 args := ctx.Args() 1295 if len(args) != 3+1 /* js this */ || 1296 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1297 js.ThrowInvalidCallbackInvocation() 1298 } 1299 1300 if ctx.Return(fn( 1301 args[0], 1302 1303 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1304 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1305 Disposition(0).FromRef(args[2+1]), 1306 )) { 1307 return 1308 } 1309 1310 js.ThrowCallbackValueNotReturned() 1311 } 1312 1313 type OnDisconnectRequestedEventCallback[T any] struct { 1314 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32, disposition Disposition) js.Ref 1315 Arg T 1316 } 1317 1318 func (cb *OnDisconnectRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32, disposition Disposition)] { 1319 return js.RegisterCallback[func(requestId int32, scardHandle int32, disposition Disposition)]( 1320 cb, abi.FuncPCABIInternal(cb.Fn), 1321 ) 1322 } 1323 1324 func (cb *OnDisconnectRequestedEventCallback[T]) DispatchCallback( 1325 targetPC uintptr, ctx *js.CallbackContext, 1326 ) { 1327 args := ctx.Args() 1328 if len(args) != 3+1 /* js this */ || 1329 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1330 js.ThrowInvalidCallbackInvocation() 1331 } 1332 1333 if ctx.Return(cb.Fn( 1334 cb.Arg, 1335 args[0], 1336 1337 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1338 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1339 Disposition(0).FromRef(args[2+1]), 1340 )) { 1341 return 1342 } 1343 1344 js.ThrowCallbackValueNotReturned() 1345 } 1346 1347 // HasFuncOnDisconnectRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.addListener" exists. 1348 func HasFuncOnDisconnectRequested() bool { 1349 return js.True == bindings.HasFuncOnDisconnectRequested() 1350 } 1351 1352 // FuncOnDisconnectRequested returns the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.addListener". 1353 func FuncOnDisconnectRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)])]) { 1354 bindings.FuncOnDisconnectRequested( 1355 js.Pointer(&fn), 1356 ) 1357 return 1358 } 1359 1360 // OnDisconnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.addListener" directly. 1361 func OnDisconnectRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void) { 1362 bindings.CallOnDisconnectRequested( 1363 js.Pointer(&ret), 1364 callback.Ref(), 1365 ) 1366 1367 return 1368 } 1369 1370 // TryOnDisconnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.addListener" 1371 // in a try/catch block and returns (_, err, ok = false) when it went through 1372 // the catch clause. 1373 func TryOnDisconnectRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void, exception js.Any, ok bool) { 1374 ok = js.True == bindings.TryOnDisconnectRequested( 1375 js.Pointer(&ret), js.Pointer(&exception), 1376 callback.Ref(), 1377 ) 1378 1379 return 1380 } 1381 1382 // HasFuncOffDisconnectRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.removeListener" exists. 1383 func HasFuncOffDisconnectRequested() bool { 1384 return js.True == bindings.HasFuncOffDisconnectRequested() 1385 } 1386 1387 // FuncOffDisconnectRequested returns the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.removeListener". 1388 func FuncOffDisconnectRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)])]) { 1389 bindings.FuncOffDisconnectRequested( 1390 js.Pointer(&fn), 1391 ) 1392 return 1393 } 1394 1395 // OffDisconnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.removeListener" directly. 1396 func OffDisconnectRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void) { 1397 bindings.CallOffDisconnectRequested( 1398 js.Pointer(&ret), 1399 callback.Ref(), 1400 ) 1401 1402 return 1403 } 1404 1405 // TryOffDisconnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.removeListener" 1406 // in a try/catch block and returns (_, err, ok = false) when it went through 1407 // the catch clause. 1408 func TryOffDisconnectRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void, exception js.Any, ok bool) { 1409 ok = js.True == bindings.TryOffDisconnectRequested( 1410 js.Pointer(&ret), js.Pointer(&exception), 1411 callback.Ref(), 1412 ) 1413 1414 return 1415 } 1416 1417 // HasFuncHasOnDisconnectRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.hasListener" exists. 1418 func HasFuncHasOnDisconnectRequested() bool { 1419 return js.True == bindings.HasFuncHasOnDisconnectRequested() 1420 } 1421 1422 // FuncHasOnDisconnectRequested returns the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.hasListener". 1423 func FuncHasOnDisconnectRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) bool]) { 1424 bindings.FuncHasOnDisconnectRequested( 1425 js.Pointer(&fn), 1426 ) 1427 return 1428 } 1429 1430 // HasOnDisconnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.hasListener" directly. 1431 func HasOnDisconnectRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret bool) { 1432 bindings.CallHasOnDisconnectRequested( 1433 js.Pointer(&ret), 1434 callback.Ref(), 1435 ) 1436 1437 return 1438 } 1439 1440 // TryHasOnDisconnectRequested calls the function "WEBEXT.smartCardProviderPrivate.onDisconnectRequested.hasListener" 1441 // in a try/catch block and returns (_, err, ok = false) when it went through 1442 // the catch clause. 1443 func TryHasOnDisconnectRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret bool, exception js.Any, ok bool) { 1444 ok = js.True == bindings.TryHasOnDisconnectRequested( 1445 js.Pointer(&ret), js.Pointer(&exception), 1446 callback.Ref(), 1447 ) 1448 1449 return 1450 } 1451 1452 type OnEndTransactionRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32, disposition Disposition) js.Ref 1453 1454 func (fn OnEndTransactionRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32, disposition Disposition)] { 1455 return js.RegisterCallback[func(requestId int32, scardHandle int32, disposition Disposition)]( 1456 fn, abi.FuncPCABIInternal(fn), 1457 ) 1458 } 1459 1460 func (fn OnEndTransactionRequestedEventCallbackFunc) DispatchCallback( 1461 targetPC uintptr, ctx *js.CallbackContext, 1462 ) { 1463 args := ctx.Args() 1464 if len(args) != 3+1 /* js this */ || 1465 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1466 js.ThrowInvalidCallbackInvocation() 1467 } 1468 1469 if ctx.Return(fn( 1470 args[0], 1471 1472 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1473 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1474 Disposition(0).FromRef(args[2+1]), 1475 )) { 1476 return 1477 } 1478 1479 js.ThrowCallbackValueNotReturned() 1480 } 1481 1482 type OnEndTransactionRequestedEventCallback[T any] struct { 1483 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32, disposition Disposition) js.Ref 1484 Arg T 1485 } 1486 1487 func (cb *OnEndTransactionRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32, disposition Disposition)] { 1488 return js.RegisterCallback[func(requestId int32, scardHandle int32, disposition Disposition)]( 1489 cb, abi.FuncPCABIInternal(cb.Fn), 1490 ) 1491 } 1492 1493 func (cb *OnEndTransactionRequestedEventCallback[T]) DispatchCallback( 1494 targetPC uintptr, ctx *js.CallbackContext, 1495 ) { 1496 args := ctx.Args() 1497 if len(args) != 3+1 /* js this */ || 1498 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1499 js.ThrowInvalidCallbackInvocation() 1500 } 1501 1502 if ctx.Return(cb.Fn( 1503 cb.Arg, 1504 args[0], 1505 1506 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1507 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1508 Disposition(0).FromRef(args[2+1]), 1509 )) { 1510 return 1511 } 1512 1513 js.ThrowCallbackValueNotReturned() 1514 } 1515 1516 // HasFuncOnEndTransactionRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.addListener" exists. 1517 func HasFuncOnEndTransactionRequested() bool { 1518 return js.True == bindings.HasFuncOnEndTransactionRequested() 1519 } 1520 1521 // FuncOnEndTransactionRequested returns the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.addListener". 1522 func FuncOnEndTransactionRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)])]) { 1523 bindings.FuncOnEndTransactionRequested( 1524 js.Pointer(&fn), 1525 ) 1526 return 1527 } 1528 1529 // OnEndTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.addListener" directly. 1530 func OnEndTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void) { 1531 bindings.CallOnEndTransactionRequested( 1532 js.Pointer(&ret), 1533 callback.Ref(), 1534 ) 1535 1536 return 1537 } 1538 1539 // TryOnEndTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.addListener" 1540 // in a try/catch block and returns (_, err, ok = false) when it went through 1541 // the catch clause. 1542 func TryOnEndTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void, exception js.Any, ok bool) { 1543 ok = js.True == bindings.TryOnEndTransactionRequested( 1544 js.Pointer(&ret), js.Pointer(&exception), 1545 callback.Ref(), 1546 ) 1547 1548 return 1549 } 1550 1551 // HasFuncOffEndTransactionRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.removeListener" exists. 1552 func HasFuncOffEndTransactionRequested() bool { 1553 return js.True == bindings.HasFuncOffEndTransactionRequested() 1554 } 1555 1556 // FuncOffEndTransactionRequested returns the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.removeListener". 1557 func FuncOffEndTransactionRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)])]) { 1558 bindings.FuncOffEndTransactionRequested( 1559 js.Pointer(&fn), 1560 ) 1561 return 1562 } 1563 1564 // OffEndTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.removeListener" directly. 1565 func OffEndTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void) { 1566 bindings.CallOffEndTransactionRequested( 1567 js.Pointer(&ret), 1568 callback.Ref(), 1569 ) 1570 1571 return 1572 } 1573 1574 // TryOffEndTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.removeListener" 1575 // in a try/catch block and returns (_, err, ok = false) when it went through 1576 // the catch clause. 1577 func TryOffEndTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret js.Void, exception js.Any, ok bool) { 1578 ok = js.True == bindings.TryOffEndTransactionRequested( 1579 js.Pointer(&ret), js.Pointer(&exception), 1580 callback.Ref(), 1581 ) 1582 1583 return 1584 } 1585 1586 // HasFuncHasOnEndTransactionRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.hasListener" exists. 1587 func HasFuncHasOnEndTransactionRequested() bool { 1588 return js.True == bindings.HasFuncHasOnEndTransactionRequested() 1589 } 1590 1591 // FuncHasOnEndTransactionRequested returns the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.hasListener". 1592 func FuncHasOnEndTransactionRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) bool]) { 1593 bindings.FuncHasOnEndTransactionRequested( 1594 js.Pointer(&fn), 1595 ) 1596 return 1597 } 1598 1599 // HasOnEndTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.hasListener" directly. 1600 func HasOnEndTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret bool) { 1601 bindings.CallHasOnEndTransactionRequested( 1602 js.Pointer(&ret), 1603 callback.Ref(), 1604 ) 1605 1606 return 1607 } 1608 1609 // TryHasOnEndTransactionRequested calls the function "WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.hasListener" 1610 // in a try/catch block and returns (_, err, ok = false) when it went through 1611 // the catch clause. 1612 func TryHasOnEndTransactionRequested(callback js.Func[func(requestId int32, scardHandle int32, disposition Disposition)]) (ret bool, exception js.Any, ok bool) { 1613 ok = js.True == bindings.TryHasOnEndTransactionRequested( 1614 js.Pointer(&ret), js.Pointer(&exception), 1615 callback.Ref(), 1616 ) 1617 1618 return 1619 } 1620 1621 type OnEstablishContextRequestedEventCallbackFunc func(this js.Ref, requestId int32) js.Ref 1622 1623 func (fn OnEstablishContextRequestedEventCallbackFunc) Register() js.Func[func(requestId int32)] { 1624 return js.RegisterCallback[func(requestId int32)]( 1625 fn, abi.FuncPCABIInternal(fn), 1626 ) 1627 } 1628 1629 func (fn OnEstablishContextRequestedEventCallbackFunc) DispatchCallback( 1630 targetPC uintptr, ctx *js.CallbackContext, 1631 ) { 1632 args := ctx.Args() 1633 if len(args) != 1+1 /* js this */ || 1634 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1635 js.ThrowInvalidCallbackInvocation() 1636 } 1637 1638 if ctx.Return(fn( 1639 args[0], 1640 1641 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1642 )) { 1643 return 1644 } 1645 1646 js.ThrowCallbackValueNotReturned() 1647 } 1648 1649 type OnEstablishContextRequestedEventCallback[T any] struct { 1650 Fn func(arg T, this js.Ref, requestId int32) js.Ref 1651 Arg T 1652 } 1653 1654 func (cb *OnEstablishContextRequestedEventCallback[T]) Register() js.Func[func(requestId int32)] { 1655 return js.RegisterCallback[func(requestId int32)]( 1656 cb, abi.FuncPCABIInternal(cb.Fn), 1657 ) 1658 } 1659 1660 func (cb *OnEstablishContextRequestedEventCallback[T]) DispatchCallback( 1661 targetPC uintptr, ctx *js.CallbackContext, 1662 ) { 1663 args := ctx.Args() 1664 if len(args) != 1+1 /* js this */ || 1665 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1666 js.ThrowInvalidCallbackInvocation() 1667 } 1668 1669 if ctx.Return(cb.Fn( 1670 cb.Arg, 1671 args[0], 1672 1673 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1674 )) { 1675 return 1676 } 1677 1678 js.ThrowCallbackValueNotReturned() 1679 } 1680 1681 // HasFuncOnEstablishContextRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.addListener" exists. 1682 func HasFuncOnEstablishContextRequested() bool { 1683 return js.True == bindings.HasFuncOnEstablishContextRequested() 1684 } 1685 1686 // FuncOnEstablishContextRequested returns the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.addListener". 1687 func FuncOnEstablishContextRequested() (fn js.Func[func(callback js.Func[func(requestId int32)])]) { 1688 bindings.FuncOnEstablishContextRequested( 1689 js.Pointer(&fn), 1690 ) 1691 return 1692 } 1693 1694 // OnEstablishContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.addListener" directly. 1695 func OnEstablishContextRequested(callback js.Func[func(requestId int32)]) (ret js.Void) { 1696 bindings.CallOnEstablishContextRequested( 1697 js.Pointer(&ret), 1698 callback.Ref(), 1699 ) 1700 1701 return 1702 } 1703 1704 // TryOnEstablishContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.addListener" 1705 // in a try/catch block and returns (_, err, ok = false) when it went through 1706 // the catch clause. 1707 func TryOnEstablishContextRequested(callback js.Func[func(requestId int32)]) (ret js.Void, exception js.Any, ok bool) { 1708 ok = js.True == bindings.TryOnEstablishContextRequested( 1709 js.Pointer(&ret), js.Pointer(&exception), 1710 callback.Ref(), 1711 ) 1712 1713 return 1714 } 1715 1716 // HasFuncOffEstablishContextRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.removeListener" exists. 1717 func HasFuncOffEstablishContextRequested() bool { 1718 return js.True == bindings.HasFuncOffEstablishContextRequested() 1719 } 1720 1721 // FuncOffEstablishContextRequested returns the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.removeListener". 1722 func FuncOffEstablishContextRequested() (fn js.Func[func(callback js.Func[func(requestId int32)])]) { 1723 bindings.FuncOffEstablishContextRequested( 1724 js.Pointer(&fn), 1725 ) 1726 return 1727 } 1728 1729 // OffEstablishContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.removeListener" directly. 1730 func OffEstablishContextRequested(callback js.Func[func(requestId int32)]) (ret js.Void) { 1731 bindings.CallOffEstablishContextRequested( 1732 js.Pointer(&ret), 1733 callback.Ref(), 1734 ) 1735 1736 return 1737 } 1738 1739 // TryOffEstablishContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.removeListener" 1740 // in a try/catch block and returns (_, err, ok = false) when it went through 1741 // the catch clause. 1742 func TryOffEstablishContextRequested(callback js.Func[func(requestId int32)]) (ret js.Void, exception js.Any, ok bool) { 1743 ok = js.True == bindings.TryOffEstablishContextRequested( 1744 js.Pointer(&ret), js.Pointer(&exception), 1745 callback.Ref(), 1746 ) 1747 1748 return 1749 } 1750 1751 // HasFuncHasOnEstablishContextRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.hasListener" exists. 1752 func HasFuncHasOnEstablishContextRequested() bool { 1753 return js.True == bindings.HasFuncHasOnEstablishContextRequested() 1754 } 1755 1756 // FuncHasOnEstablishContextRequested returns the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.hasListener". 1757 func FuncHasOnEstablishContextRequested() (fn js.Func[func(callback js.Func[func(requestId int32)]) bool]) { 1758 bindings.FuncHasOnEstablishContextRequested( 1759 js.Pointer(&fn), 1760 ) 1761 return 1762 } 1763 1764 // HasOnEstablishContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.hasListener" directly. 1765 func HasOnEstablishContextRequested(callback js.Func[func(requestId int32)]) (ret bool) { 1766 bindings.CallHasOnEstablishContextRequested( 1767 js.Pointer(&ret), 1768 callback.Ref(), 1769 ) 1770 1771 return 1772 } 1773 1774 // TryHasOnEstablishContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.hasListener" 1775 // in a try/catch block and returns (_, err, ok = false) when it went through 1776 // the catch clause. 1777 func TryHasOnEstablishContextRequested(callback js.Func[func(requestId int32)]) (ret bool, exception js.Any, ok bool) { 1778 ok = js.True == bindings.TryHasOnEstablishContextRequested( 1779 js.Pointer(&ret), js.Pointer(&exception), 1780 callback.Ref(), 1781 ) 1782 1783 return 1784 } 1785 1786 type OnGetAttribRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32, attribId int32) js.Ref 1787 1788 func (fn OnGetAttribRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32, attribId int32)] { 1789 return js.RegisterCallback[func(requestId int32, scardHandle int32, attribId int32)]( 1790 fn, abi.FuncPCABIInternal(fn), 1791 ) 1792 } 1793 1794 func (fn OnGetAttribRequestedEventCallbackFunc) DispatchCallback( 1795 targetPC uintptr, ctx *js.CallbackContext, 1796 ) { 1797 args := ctx.Args() 1798 if len(args) != 3+1 /* js this */ || 1799 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1800 js.ThrowInvalidCallbackInvocation() 1801 } 1802 1803 if ctx.Return(fn( 1804 args[0], 1805 1806 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1807 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1808 js.Number[int32]{}.FromRef(args[2+1]).Get(), 1809 )) { 1810 return 1811 } 1812 1813 js.ThrowCallbackValueNotReturned() 1814 } 1815 1816 type OnGetAttribRequestedEventCallback[T any] struct { 1817 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32, attribId int32) js.Ref 1818 Arg T 1819 } 1820 1821 func (cb *OnGetAttribRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32, attribId int32)] { 1822 return js.RegisterCallback[func(requestId int32, scardHandle int32, attribId int32)]( 1823 cb, abi.FuncPCABIInternal(cb.Fn), 1824 ) 1825 } 1826 1827 func (cb *OnGetAttribRequestedEventCallback[T]) DispatchCallback( 1828 targetPC uintptr, ctx *js.CallbackContext, 1829 ) { 1830 args := ctx.Args() 1831 if len(args) != 3+1 /* js this */ || 1832 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1833 js.ThrowInvalidCallbackInvocation() 1834 } 1835 1836 if ctx.Return(cb.Fn( 1837 cb.Arg, 1838 args[0], 1839 1840 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1841 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1842 js.Number[int32]{}.FromRef(args[2+1]).Get(), 1843 )) { 1844 return 1845 } 1846 1847 js.ThrowCallbackValueNotReturned() 1848 } 1849 1850 // HasFuncOnGetAttribRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.addListener" exists. 1851 func HasFuncOnGetAttribRequested() bool { 1852 return js.True == bindings.HasFuncOnGetAttribRequested() 1853 } 1854 1855 // FuncOnGetAttribRequested returns the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.addListener". 1856 func FuncOnGetAttribRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)])]) { 1857 bindings.FuncOnGetAttribRequested( 1858 js.Pointer(&fn), 1859 ) 1860 return 1861 } 1862 1863 // OnGetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.addListener" directly. 1864 func OnGetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)]) (ret js.Void) { 1865 bindings.CallOnGetAttribRequested( 1866 js.Pointer(&ret), 1867 callback.Ref(), 1868 ) 1869 1870 return 1871 } 1872 1873 // TryOnGetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.addListener" 1874 // in a try/catch block and returns (_, err, ok = false) when it went through 1875 // the catch clause. 1876 func TryOnGetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)]) (ret js.Void, exception js.Any, ok bool) { 1877 ok = js.True == bindings.TryOnGetAttribRequested( 1878 js.Pointer(&ret), js.Pointer(&exception), 1879 callback.Ref(), 1880 ) 1881 1882 return 1883 } 1884 1885 // HasFuncOffGetAttribRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.removeListener" exists. 1886 func HasFuncOffGetAttribRequested() bool { 1887 return js.True == bindings.HasFuncOffGetAttribRequested() 1888 } 1889 1890 // FuncOffGetAttribRequested returns the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.removeListener". 1891 func FuncOffGetAttribRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)])]) { 1892 bindings.FuncOffGetAttribRequested( 1893 js.Pointer(&fn), 1894 ) 1895 return 1896 } 1897 1898 // OffGetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.removeListener" directly. 1899 func OffGetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)]) (ret js.Void) { 1900 bindings.CallOffGetAttribRequested( 1901 js.Pointer(&ret), 1902 callback.Ref(), 1903 ) 1904 1905 return 1906 } 1907 1908 // TryOffGetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.removeListener" 1909 // in a try/catch block and returns (_, err, ok = false) when it went through 1910 // the catch clause. 1911 func TryOffGetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)]) (ret js.Void, exception js.Any, ok bool) { 1912 ok = js.True == bindings.TryOffGetAttribRequested( 1913 js.Pointer(&ret), js.Pointer(&exception), 1914 callback.Ref(), 1915 ) 1916 1917 return 1918 } 1919 1920 // HasFuncHasOnGetAttribRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.hasListener" exists. 1921 func HasFuncHasOnGetAttribRequested() bool { 1922 return js.True == bindings.HasFuncHasOnGetAttribRequested() 1923 } 1924 1925 // FuncHasOnGetAttribRequested returns the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.hasListener". 1926 func FuncHasOnGetAttribRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)]) bool]) { 1927 bindings.FuncHasOnGetAttribRequested( 1928 js.Pointer(&fn), 1929 ) 1930 return 1931 } 1932 1933 // HasOnGetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.hasListener" directly. 1934 func HasOnGetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)]) (ret bool) { 1935 bindings.CallHasOnGetAttribRequested( 1936 js.Pointer(&ret), 1937 callback.Ref(), 1938 ) 1939 1940 return 1941 } 1942 1943 // TryHasOnGetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetAttribRequested.hasListener" 1944 // in a try/catch block and returns (_, err, ok = false) when it went through 1945 // the catch clause. 1946 func TryHasOnGetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32)]) (ret bool, exception js.Any, ok bool) { 1947 ok = js.True == bindings.TryHasOnGetAttribRequested( 1948 js.Pointer(&ret), js.Pointer(&exception), 1949 callback.Ref(), 1950 ) 1951 1952 return 1953 } 1954 1955 type OnGetStatusChangeRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn]) js.Ref 1956 1957 func (fn OnGetStatusChangeRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])] { 1958 return js.RegisterCallback[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]( 1959 fn, abi.FuncPCABIInternal(fn), 1960 ) 1961 } 1962 1963 func (fn OnGetStatusChangeRequestedEventCallbackFunc) DispatchCallback( 1964 targetPC uintptr, ctx *js.CallbackContext, 1965 ) { 1966 args := ctx.Args() 1967 if len(args) != 4+1 /* js this */ || 1968 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1969 js.ThrowInvalidCallbackInvocation() 1970 } 1971 var arg2 Timeout 1972 arg2.UpdateFrom(args[2+1]) 1973 defer arg2.FreeMembers(true) 1974 1975 if ctx.Return(fn( 1976 args[0], 1977 1978 js.Number[int32]{}.FromRef(args[0+1]).Get(), 1979 js.Number[int32]{}.FromRef(args[1+1]).Get(), 1980 mark.NoEscape(&arg2), 1981 js.Array[ReaderStateIn]{}.FromRef(args[3+1]), 1982 )) { 1983 return 1984 } 1985 1986 js.ThrowCallbackValueNotReturned() 1987 } 1988 1989 type OnGetStatusChangeRequestedEventCallback[T any] struct { 1990 Fn func(arg T, this js.Ref, requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn]) js.Ref 1991 Arg T 1992 } 1993 1994 func (cb *OnGetStatusChangeRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])] { 1995 return js.RegisterCallback[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]( 1996 cb, abi.FuncPCABIInternal(cb.Fn), 1997 ) 1998 } 1999 2000 func (cb *OnGetStatusChangeRequestedEventCallback[T]) DispatchCallback( 2001 targetPC uintptr, ctx *js.CallbackContext, 2002 ) { 2003 args := ctx.Args() 2004 if len(args) != 4+1 /* js this */ || 2005 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2006 js.ThrowInvalidCallbackInvocation() 2007 } 2008 var arg2 Timeout 2009 arg2.UpdateFrom(args[2+1]) 2010 defer arg2.FreeMembers(true) 2011 2012 if ctx.Return(cb.Fn( 2013 cb.Arg, 2014 args[0], 2015 2016 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2017 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2018 mark.NoEscape(&arg2), 2019 js.Array[ReaderStateIn]{}.FromRef(args[3+1]), 2020 )) { 2021 return 2022 } 2023 2024 js.ThrowCallbackValueNotReturned() 2025 } 2026 2027 // HasFuncOnGetStatusChangeRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.addListener" exists. 2028 func HasFuncOnGetStatusChangeRequested() bool { 2029 return js.True == bindings.HasFuncOnGetStatusChangeRequested() 2030 } 2031 2032 // FuncOnGetStatusChangeRequested returns the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.addListener". 2033 func FuncOnGetStatusChangeRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])])]) { 2034 bindings.FuncOnGetStatusChangeRequested( 2035 js.Pointer(&fn), 2036 ) 2037 return 2038 } 2039 2040 // OnGetStatusChangeRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.addListener" directly. 2041 func OnGetStatusChangeRequested(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]) (ret js.Void) { 2042 bindings.CallOnGetStatusChangeRequested( 2043 js.Pointer(&ret), 2044 callback.Ref(), 2045 ) 2046 2047 return 2048 } 2049 2050 // TryOnGetStatusChangeRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.addListener" 2051 // in a try/catch block and returns (_, err, ok = false) when it went through 2052 // the catch clause. 2053 func TryOnGetStatusChangeRequested(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]) (ret js.Void, exception js.Any, ok bool) { 2054 ok = js.True == bindings.TryOnGetStatusChangeRequested( 2055 js.Pointer(&ret), js.Pointer(&exception), 2056 callback.Ref(), 2057 ) 2058 2059 return 2060 } 2061 2062 // HasFuncOffGetStatusChangeRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.removeListener" exists. 2063 func HasFuncOffGetStatusChangeRequested() bool { 2064 return js.True == bindings.HasFuncOffGetStatusChangeRequested() 2065 } 2066 2067 // FuncOffGetStatusChangeRequested returns the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.removeListener". 2068 func FuncOffGetStatusChangeRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])])]) { 2069 bindings.FuncOffGetStatusChangeRequested( 2070 js.Pointer(&fn), 2071 ) 2072 return 2073 } 2074 2075 // OffGetStatusChangeRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.removeListener" directly. 2076 func OffGetStatusChangeRequested(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]) (ret js.Void) { 2077 bindings.CallOffGetStatusChangeRequested( 2078 js.Pointer(&ret), 2079 callback.Ref(), 2080 ) 2081 2082 return 2083 } 2084 2085 // TryOffGetStatusChangeRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.removeListener" 2086 // in a try/catch block and returns (_, err, ok = false) when it went through 2087 // the catch clause. 2088 func TryOffGetStatusChangeRequested(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]) (ret js.Void, exception js.Any, ok bool) { 2089 ok = js.True == bindings.TryOffGetStatusChangeRequested( 2090 js.Pointer(&ret), js.Pointer(&exception), 2091 callback.Ref(), 2092 ) 2093 2094 return 2095 } 2096 2097 // HasFuncHasOnGetStatusChangeRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.hasListener" exists. 2098 func HasFuncHasOnGetStatusChangeRequested() bool { 2099 return js.True == bindings.HasFuncHasOnGetStatusChangeRequested() 2100 } 2101 2102 // FuncHasOnGetStatusChangeRequested returns the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.hasListener". 2103 func FuncHasOnGetStatusChangeRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]) bool]) { 2104 bindings.FuncHasOnGetStatusChangeRequested( 2105 js.Pointer(&fn), 2106 ) 2107 return 2108 } 2109 2110 // HasOnGetStatusChangeRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.hasListener" directly. 2111 func HasOnGetStatusChangeRequested(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]) (ret bool) { 2112 bindings.CallHasOnGetStatusChangeRequested( 2113 js.Pointer(&ret), 2114 callback.Ref(), 2115 ) 2116 2117 return 2118 } 2119 2120 // TryHasOnGetStatusChangeRequested calls the function "WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.hasListener" 2121 // in a try/catch block and returns (_, err, ok = false) when it went through 2122 // the catch clause. 2123 func TryHasOnGetStatusChangeRequested(callback js.Func[func(requestId int32, scardContext int32, timeout *Timeout, readerStates js.Array[ReaderStateIn])]) (ret bool, exception js.Any, ok bool) { 2124 ok = js.True == bindings.TryHasOnGetStatusChangeRequested( 2125 js.Pointer(&ret), js.Pointer(&exception), 2126 callback.Ref(), 2127 ) 2128 2129 return 2130 } 2131 2132 type OnListReadersRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardContext int32) js.Ref 2133 2134 func (fn OnListReadersRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardContext int32)] { 2135 return js.RegisterCallback[func(requestId int32, scardContext int32)]( 2136 fn, abi.FuncPCABIInternal(fn), 2137 ) 2138 } 2139 2140 func (fn OnListReadersRequestedEventCallbackFunc) DispatchCallback( 2141 targetPC uintptr, ctx *js.CallbackContext, 2142 ) { 2143 args := ctx.Args() 2144 if len(args) != 2+1 /* js this */ || 2145 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2146 js.ThrowInvalidCallbackInvocation() 2147 } 2148 2149 if ctx.Return(fn( 2150 args[0], 2151 2152 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2153 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2154 )) { 2155 return 2156 } 2157 2158 js.ThrowCallbackValueNotReturned() 2159 } 2160 2161 type OnListReadersRequestedEventCallback[T any] struct { 2162 Fn func(arg T, this js.Ref, requestId int32, scardContext int32) js.Ref 2163 Arg T 2164 } 2165 2166 func (cb *OnListReadersRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardContext int32)] { 2167 return js.RegisterCallback[func(requestId int32, scardContext int32)]( 2168 cb, abi.FuncPCABIInternal(cb.Fn), 2169 ) 2170 } 2171 2172 func (cb *OnListReadersRequestedEventCallback[T]) DispatchCallback( 2173 targetPC uintptr, ctx *js.CallbackContext, 2174 ) { 2175 args := ctx.Args() 2176 if len(args) != 2+1 /* js this */ || 2177 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2178 js.ThrowInvalidCallbackInvocation() 2179 } 2180 2181 if ctx.Return(cb.Fn( 2182 cb.Arg, 2183 args[0], 2184 2185 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2186 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2187 )) { 2188 return 2189 } 2190 2191 js.ThrowCallbackValueNotReturned() 2192 } 2193 2194 // HasFuncOnListReadersRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.addListener" exists. 2195 func HasFuncOnListReadersRequested() bool { 2196 return js.True == bindings.HasFuncOnListReadersRequested() 2197 } 2198 2199 // FuncOnListReadersRequested returns the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.addListener". 2200 func FuncOnListReadersRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)])]) { 2201 bindings.FuncOnListReadersRequested( 2202 js.Pointer(&fn), 2203 ) 2204 return 2205 } 2206 2207 // OnListReadersRequested calls the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.addListener" directly. 2208 func OnListReadersRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void) { 2209 bindings.CallOnListReadersRequested( 2210 js.Pointer(&ret), 2211 callback.Ref(), 2212 ) 2213 2214 return 2215 } 2216 2217 // TryOnListReadersRequested calls the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.addListener" 2218 // in a try/catch block and returns (_, err, ok = false) when it went through 2219 // the catch clause. 2220 func TryOnListReadersRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void, exception js.Any, ok bool) { 2221 ok = js.True == bindings.TryOnListReadersRequested( 2222 js.Pointer(&ret), js.Pointer(&exception), 2223 callback.Ref(), 2224 ) 2225 2226 return 2227 } 2228 2229 // HasFuncOffListReadersRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.removeListener" exists. 2230 func HasFuncOffListReadersRequested() bool { 2231 return js.True == bindings.HasFuncOffListReadersRequested() 2232 } 2233 2234 // FuncOffListReadersRequested returns the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.removeListener". 2235 func FuncOffListReadersRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)])]) { 2236 bindings.FuncOffListReadersRequested( 2237 js.Pointer(&fn), 2238 ) 2239 return 2240 } 2241 2242 // OffListReadersRequested calls the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.removeListener" directly. 2243 func OffListReadersRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void) { 2244 bindings.CallOffListReadersRequested( 2245 js.Pointer(&ret), 2246 callback.Ref(), 2247 ) 2248 2249 return 2250 } 2251 2252 // TryOffListReadersRequested calls the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.removeListener" 2253 // in a try/catch block and returns (_, err, ok = false) when it went through 2254 // the catch clause. 2255 func TryOffListReadersRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void, exception js.Any, ok bool) { 2256 ok = js.True == bindings.TryOffListReadersRequested( 2257 js.Pointer(&ret), js.Pointer(&exception), 2258 callback.Ref(), 2259 ) 2260 2261 return 2262 } 2263 2264 // HasFuncHasOnListReadersRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.hasListener" exists. 2265 func HasFuncHasOnListReadersRequested() bool { 2266 return js.True == bindings.HasFuncHasOnListReadersRequested() 2267 } 2268 2269 // FuncHasOnListReadersRequested returns the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.hasListener". 2270 func FuncHasOnListReadersRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)]) bool]) { 2271 bindings.FuncHasOnListReadersRequested( 2272 js.Pointer(&fn), 2273 ) 2274 return 2275 } 2276 2277 // HasOnListReadersRequested calls the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.hasListener" directly. 2278 func HasOnListReadersRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret bool) { 2279 bindings.CallHasOnListReadersRequested( 2280 js.Pointer(&ret), 2281 callback.Ref(), 2282 ) 2283 2284 return 2285 } 2286 2287 // TryHasOnListReadersRequested calls the function "WEBEXT.smartCardProviderPrivate.onListReadersRequested.hasListener" 2288 // in a try/catch block and returns (_, err, ok = false) when it went through 2289 // the catch clause. 2290 func TryHasOnListReadersRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret bool, exception js.Any, ok bool) { 2291 ok = js.True == bindings.TryHasOnListReadersRequested( 2292 js.Pointer(&ret), js.Pointer(&exception), 2293 callback.Ref(), 2294 ) 2295 2296 return 2297 } 2298 2299 type OnReleaseContextRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardContext int32) js.Ref 2300 2301 func (fn OnReleaseContextRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardContext int32)] { 2302 return js.RegisterCallback[func(requestId int32, scardContext int32)]( 2303 fn, abi.FuncPCABIInternal(fn), 2304 ) 2305 } 2306 2307 func (fn OnReleaseContextRequestedEventCallbackFunc) DispatchCallback( 2308 targetPC uintptr, ctx *js.CallbackContext, 2309 ) { 2310 args := ctx.Args() 2311 if len(args) != 2+1 /* js this */ || 2312 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2313 js.ThrowInvalidCallbackInvocation() 2314 } 2315 2316 if ctx.Return(fn( 2317 args[0], 2318 2319 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2320 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2321 )) { 2322 return 2323 } 2324 2325 js.ThrowCallbackValueNotReturned() 2326 } 2327 2328 type OnReleaseContextRequestedEventCallback[T any] struct { 2329 Fn func(arg T, this js.Ref, requestId int32, scardContext int32) js.Ref 2330 Arg T 2331 } 2332 2333 func (cb *OnReleaseContextRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardContext int32)] { 2334 return js.RegisterCallback[func(requestId int32, scardContext int32)]( 2335 cb, abi.FuncPCABIInternal(cb.Fn), 2336 ) 2337 } 2338 2339 func (cb *OnReleaseContextRequestedEventCallback[T]) DispatchCallback( 2340 targetPC uintptr, ctx *js.CallbackContext, 2341 ) { 2342 args := ctx.Args() 2343 if len(args) != 2+1 /* js this */ || 2344 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2345 js.ThrowInvalidCallbackInvocation() 2346 } 2347 2348 if ctx.Return(cb.Fn( 2349 cb.Arg, 2350 args[0], 2351 2352 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2353 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2354 )) { 2355 return 2356 } 2357 2358 js.ThrowCallbackValueNotReturned() 2359 } 2360 2361 // HasFuncOnReleaseContextRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.addListener" exists. 2362 func HasFuncOnReleaseContextRequested() bool { 2363 return js.True == bindings.HasFuncOnReleaseContextRequested() 2364 } 2365 2366 // FuncOnReleaseContextRequested returns the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.addListener". 2367 func FuncOnReleaseContextRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)])]) { 2368 bindings.FuncOnReleaseContextRequested( 2369 js.Pointer(&fn), 2370 ) 2371 return 2372 } 2373 2374 // OnReleaseContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.addListener" directly. 2375 func OnReleaseContextRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void) { 2376 bindings.CallOnReleaseContextRequested( 2377 js.Pointer(&ret), 2378 callback.Ref(), 2379 ) 2380 2381 return 2382 } 2383 2384 // TryOnReleaseContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.addListener" 2385 // in a try/catch block and returns (_, err, ok = false) when it went through 2386 // the catch clause. 2387 func TryOnReleaseContextRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void, exception js.Any, ok bool) { 2388 ok = js.True == bindings.TryOnReleaseContextRequested( 2389 js.Pointer(&ret), js.Pointer(&exception), 2390 callback.Ref(), 2391 ) 2392 2393 return 2394 } 2395 2396 // HasFuncOffReleaseContextRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.removeListener" exists. 2397 func HasFuncOffReleaseContextRequested() bool { 2398 return js.True == bindings.HasFuncOffReleaseContextRequested() 2399 } 2400 2401 // FuncOffReleaseContextRequested returns the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.removeListener". 2402 func FuncOffReleaseContextRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)])]) { 2403 bindings.FuncOffReleaseContextRequested( 2404 js.Pointer(&fn), 2405 ) 2406 return 2407 } 2408 2409 // OffReleaseContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.removeListener" directly. 2410 func OffReleaseContextRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void) { 2411 bindings.CallOffReleaseContextRequested( 2412 js.Pointer(&ret), 2413 callback.Ref(), 2414 ) 2415 2416 return 2417 } 2418 2419 // TryOffReleaseContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.removeListener" 2420 // in a try/catch block and returns (_, err, ok = false) when it went through 2421 // the catch clause. 2422 func TryOffReleaseContextRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret js.Void, exception js.Any, ok bool) { 2423 ok = js.True == bindings.TryOffReleaseContextRequested( 2424 js.Pointer(&ret), js.Pointer(&exception), 2425 callback.Ref(), 2426 ) 2427 2428 return 2429 } 2430 2431 // HasFuncHasOnReleaseContextRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.hasListener" exists. 2432 func HasFuncHasOnReleaseContextRequested() bool { 2433 return js.True == bindings.HasFuncHasOnReleaseContextRequested() 2434 } 2435 2436 // FuncHasOnReleaseContextRequested returns the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.hasListener". 2437 func FuncHasOnReleaseContextRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardContext int32)]) bool]) { 2438 bindings.FuncHasOnReleaseContextRequested( 2439 js.Pointer(&fn), 2440 ) 2441 return 2442 } 2443 2444 // HasOnReleaseContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.hasListener" directly. 2445 func HasOnReleaseContextRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret bool) { 2446 bindings.CallHasOnReleaseContextRequested( 2447 js.Pointer(&ret), 2448 callback.Ref(), 2449 ) 2450 2451 return 2452 } 2453 2454 // TryHasOnReleaseContextRequested calls the function "WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.hasListener" 2455 // in a try/catch block and returns (_, err, ok = false) when it went through 2456 // the catch clause. 2457 func TryHasOnReleaseContextRequested(callback js.Func[func(requestId int32, scardContext int32)]) (ret bool, exception js.Any, ok bool) { 2458 ok = js.True == bindings.TryHasOnReleaseContextRequested( 2459 js.Pointer(&ret), js.Pointer(&exception), 2460 callback.Ref(), 2461 ) 2462 2463 return 2464 } 2465 2466 type OnSetAttribRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer) js.Ref 2467 2468 func (fn OnSetAttribRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)] { 2469 return js.RegisterCallback[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]( 2470 fn, abi.FuncPCABIInternal(fn), 2471 ) 2472 } 2473 2474 func (fn OnSetAttribRequestedEventCallbackFunc) DispatchCallback( 2475 targetPC uintptr, ctx *js.CallbackContext, 2476 ) { 2477 args := ctx.Args() 2478 if len(args) != 4+1 /* js this */ || 2479 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2480 js.ThrowInvalidCallbackInvocation() 2481 } 2482 2483 if ctx.Return(fn( 2484 args[0], 2485 2486 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2487 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2488 js.Number[int32]{}.FromRef(args[2+1]).Get(), 2489 js.ArrayBuffer{}.FromRef(args[3+1]), 2490 )) { 2491 return 2492 } 2493 2494 js.ThrowCallbackValueNotReturned() 2495 } 2496 2497 type OnSetAttribRequestedEventCallback[T any] struct { 2498 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer) js.Ref 2499 Arg T 2500 } 2501 2502 func (cb *OnSetAttribRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)] { 2503 return js.RegisterCallback[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]( 2504 cb, abi.FuncPCABIInternal(cb.Fn), 2505 ) 2506 } 2507 2508 func (cb *OnSetAttribRequestedEventCallback[T]) DispatchCallback( 2509 targetPC uintptr, ctx *js.CallbackContext, 2510 ) { 2511 args := ctx.Args() 2512 if len(args) != 4+1 /* js this */ || 2513 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2514 js.ThrowInvalidCallbackInvocation() 2515 } 2516 2517 if ctx.Return(cb.Fn( 2518 cb.Arg, 2519 args[0], 2520 2521 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2522 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2523 js.Number[int32]{}.FromRef(args[2+1]).Get(), 2524 js.ArrayBuffer{}.FromRef(args[3+1]), 2525 )) { 2526 return 2527 } 2528 2529 js.ThrowCallbackValueNotReturned() 2530 } 2531 2532 // HasFuncOnSetAttribRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.addListener" exists. 2533 func HasFuncOnSetAttribRequested() bool { 2534 return js.True == bindings.HasFuncOnSetAttribRequested() 2535 } 2536 2537 // FuncOnSetAttribRequested returns the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.addListener". 2538 func FuncOnSetAttribRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)])]) { 2539 bindings.FuncOnSetAttribRequested( 2540 js.Pointer(&fn), 2541 ) 2542 return 2543 } 2544 2545 // OnSetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.addListener" directly. 2546 func OnSetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]) (ret js.Void) { 2547 bindings.CallOnSetAttribRequested( 2548 js.Pointer(&ret), 2549 callback.Ref(), 2550 ) 2551 2552 return 2553 } 2554 2555 // TryOnSetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.addListener" 2556 // in a try/catch block and returns (_, err, ok = false) when it went through 2557 // the catch clause. 2558 func TryOnSetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]) (ret js.Void, exception js.Any, ok bool) { 2559 ok = js.True == bindings.TryOnSetAttribRequested( 2560 js.Pointer(&ret), js.Pointer(&exception), 2561 callback.Ref(), 2562 ) 2563 2564 return 2565 } 2566 2567 // HasFuncOffSetAttribRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.removeListener" exists. 2568 func HasFuncOffSetAttribRequested() bool { 2569 return js.True == bindings.HasFuncOffSetAttribRequested() 2570 } 2571 2572 // FuncOffSetAttribRequested returns the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.removeListener". 2573 func FuncOffSetAttribRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)])]) { 2574 bindings.FuncOffSetAttribRequested( 2575 js.Pointer(&fn), 2576 ) 2577 return 2578 } 2579 2580 // OffSetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.removeListener" directly. 2581 func OffSetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]) (ret js.Void) { 2582 bindings.CallOffSetAttribRequested( 2583 js.Pointer(&ret), 2584 callback.Ref(), 2585 ) 2586 2587 return 2588 } 2589 2590 // TryOffSetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.removeListener" 2591 // in a try/catch block and returns (_, err, ok = false) when it went through 2592 // the catch clause. 2593 func TryOffSetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]) (ret js.Void, exception js.Any, ok bool) { 2594 ok = js.True == bindings.TryOffSetAttribRequested( 2595 js.Pointer(&ret), js.Pointer(&exception), 2596 callback.Ref(), 2597 ) 2598 2599 return 2600 } 2601 2602 // HasFuncHasOnSetAttribRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.hasListener" exists. 2603 func HasFuncHasOnSetAttribRequested() bool { 2604 return js.True == bindings.HasFuncHasOnSetAttribRequested() 2605 } 2606 2607 // FuncHasOnSetAttribRequested returns the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.hasListener". 2608 func FuncHasOnSetAttribRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]) bool]) { 2609 bindings.FuncHasOnSetAttribRequested( 2610 js.Pointer(&fn), 2611 ) 2612 return 2613 } 2614 2615 // HasOnSetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.hasListener" directly. 2616 func HasOnSetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]) (ret bool) { 2617 bindings.CallHasOnSetAttribRequested( 2618 js.Pointer(&ret), 2619 callback.Ref(), 2620 ) 2621 2622 return 2623 } 2624 2625 // TryHasOnSetAttribRequested calls the function "WEBEXT.smartCardProviderPrivate.onSetAttribRequested.hasListener" 2626 // in a try/catch block and returns (_, err, ok = false) when it went through 2627 // the catch clause. 2628 func TryHasOnSetAttribRequested(callback js.Func[func(requestId int32, scardHandle int32, attribId int32, data js.ArrayBuffer)]) (ret bool, exception js.Any, ok bool) { 2629 ok = js.True == bindings.TryHasOnSetAttribRequested( 2630 js.Pointer(&ret), js.Pointer(&exception), 2631 callback.Ref(), 2632 ) 2633 2634 return 2635 } 2636 2637 type OnStatusRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32) js.Ref 2638 2639 func (fn OnStatusRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32)] { 2640 return js.RegisterCallback[func(requestId int32, scardHandle int32)]( 2641 fn, abi.FuncPCABIInternal(fn), 2642 ) 2643 } 2644 2645 func (fn OnStatusRequestedEventCallbackFunc) DispatchCallback( 2646 targetPC uintptr, ctx *js.CallbackContext, 2647 ) { 2648 args := ctx.Args() 2649 if len(args) != 2+1 /* js this */ || 2650 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2651 js.ThrowInvalidCallbackInvocation() 2652 } 2653 2654 if ctx.Return(fn( 2655 args[0], 2656 2657 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2658 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2659 )) { 2660 return 2661 } 2662 2663 js.ThrowCallbackValueNotReturned() 2664 } 2665 2666 type OnStatusRequestedEventCallback[T any] struct { 2667 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32) js.Ref 2668 Arg T 2669 } 2670 2671 func (cb *OnStatusRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32)] { 2672 return js.RegisterCallback[func(requestId int32, scardHandle int32)]( 2673 cb, abi.FuncPCABIInternal(cb.Fn), 2674 ) 2675 } 2676 2677 func (cb *OnStatusRequestedEventCallback[T]) DispatchCallback( 2678 targetPC uintptr, ctx *js.CallbackContext, 2679 ) { 2680 args := ctx.Args() 2681 if len(args) != 2+1 /* js this */ || 2682 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2683 js.ThrowInvalidCallbackInvocation() 2684 } 2685 2686 if ctx.Return(cb.Fn( 2687 cb.Arg, 2688 args[0], 2689 2690 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2691 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2692 )) { 2693 return 2694 } 2695 2696 js.ThrowCallbackValueNotReturned() 2697 } 2698 2699 // HasFuncOnStatusRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.addListener" exists. 2700 func HasFuncOnStatusRequested() bool { 2701 return js.True == bindings.HasFuncOnStatusRequested() 2702 } 2703 2704 // FuncOnStatusRequested returns the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.addListener". 2705 func FuncOnStatusRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32)])]) { 2706 bindings.FuncOnStatusRequested( 2707 js.Pointer(&fn), 2708 ) 2709 return 2710 } 2711 2712 // OnStatusRequested calls the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.addListener" directly. 2713 func OnStatusRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void) { 2714 bindings.CallOnStatusRequested( 2715 js.Pointer(&ret), 2716 callback.Ref(), 2717 ) 2718 2719 return 2720 } 2721 2722 // TryOnStatusRequested calls the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.addListener" 2723 // in a try/catch block and returns (_, err, ok = false) when it went through 2724 // the catch clause. 2725 func TryOnStatusRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void, exception js.Any, ok bool) { 2726 ok = js.True == bindings.TryOnStatusRequested( 2727 js.Pointer(&ret), js.Pointer(&exception), 2728 callback.Ref(), 2729 ) 2730 2731 return 2732 } 2733 2734 // HasFuncOffStatusRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.removeListener" exists. 2735 func HasFuncOffStatusRequested() bool { 2736 return js.True == bindings.HasFuncOffStatusRequested() 2737 } 2738 2739 // FuncOffStatusRequested returns the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.removeListener". 2740 func FuncOffStatusRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32)])]) { 2741 bindings.FuncOffStatusRequested( 2742 js.Pointer(&fn), 2743 ) 2744 return 2745 } 2746 2747 // OffStatusRequested calls the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.removeListener" directly. 2748 func OffStatusRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void) { 2749 bindings.CallOffStatusRequested( 2750 js.Pointer(&ret), 2751 callback.Ref(), 2752 ) 2753 2754 return 2755 } 2756 2757 // TryOffStatusRequested calls the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.removeListener" 2758 // in a try/catch block and returns (_, err, ok = false) when it went through 2759 // the catch clause. 2760 func TryOffStatusRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret js.Void, exception js.Any, ok bool) { 2761 ok = js.True == bindings.TryOffStatusRequested( 2762 js.Pointer(&ret), js.Pointer(&exception), 2763 callback.Ref(), 2764 ) 2765 2766 return 2767 } 2768 2769 // HasFuncHasOnStatusRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.hasListener" exists. 2770 func HasFuncHasOnStatusRequested() bool { 2771 return js.True == bindings.HasFuncHasOnStatusRequested() 2772 } 2773 2774 // FuncHasOnStatusRequested returns the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.hasListener". 2775 func FuncHasOnStatusRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32)]) bool]) { 2776 bindings.FuncHasOnStatusRequested( 2777 js.Pointer(&fn), 2778 ) 2779 return 2780 } 2781 2782 // HasOnStatusRequested calls the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.hasListener" directly. 2783 func HasOnStatusRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret bool) { 2784 bindings.CallHasOnStatusRequested( 2785 js.Pointer(&ret), 2786 callback.Ref(), 2787 ) 2788 2789 return 2790 } 2791 2792 // TryHasOnStatusRequested calls the function "WEBEXT.smartCardProviderPrivate.onStatusRequested.hasListener" 2793 // in a try/catch block and returns (_, err, ok = false) when it went through 2794 // the catch clause. 2795 func TryHasOnStatusRequested(callback js.Func[func(requestId int32, scardHandle int32)]) (ret bool, exception js.Any, ok bool) { 2796 ok = js.True == bindings.TryHasOnStatusRequested( 2797 js.Pointer(&ret), js.Pointer(&exception), 2798 callback.Ref(), 2799 ) 2800 2801 return 2802 } 2803 2804 type OnTransmitRequestedEventCallbackFunc func(this js.Ref, requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer) js.Ref 2805 2806 func (fn OnTransmitRequestedEventCallbackFunc) Register() js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)] { 2807 return js.RegisterCallback[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]( 2808 fn, abi.FuncPCABIInternal(fn), 2809 ) 2810 } 2811 2812 func (fn OnTransmitRequestedEventCallbackFunc) DispatchCallback( 2813 targetPC uintptr, ctx *js.CallbackContext, 2814 ) { 2815 args := ctx.Args() 2816 if len(args) != 4+1 /* js this */ || 2817 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2818 js.ThrowInvalidCallbackInvocation() 2819 } 2820 2821 if ctx.Return(fn( 2822 args[0], 2823 2824 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2825 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2826 Protocol(0).FromRef(args[2+1]), 2827 js.ArrayBuffer{}.FromRef(args[3+1]), 2828 )) { 2829 return 2830 } 2831 2832 js.ThrowCallbackValueNotReturned() 2833 } 2834 2835 type OnTransmitRequestedEventCallback[T any] struct { 2836 Fn func(arg T, this js.Ref, requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer) js.Ref 2837 Arg T 2838 } 2839 2840 func (cb *OnTransmitRequestedEventCallback[T]) Register() js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)] { 2841 return js.RegisterCallback[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]( 2842 cb, abi.FuncPCABIInternal(cb.Fn), 2843 ) 2844 } 2845 2846 func (cb *OnTransmitRequestedEventCallback[T]) DispatchCallback( 2847 targetPC uintptr, ctx *js.CallbackContext, 2848 ) { 2849 args := ctx.Args() 2850 if len(args) != 4+1 /* js this */ || 2851 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2852 js.ThrowInvalidCallbackInvocation() 2853 } 2854 2855 if ctx.Return(cb.Fn( 2856 cb.Arg, 2857 args[0], 2858 2859 js.Number[int32]{}.FromRef(args[0+1]).Get(), 2860 js.Number[int32]{}.FromRef(args[1+1]).Get(), 2861 Protocol(0).FromRef(args[2+1]), 2862 js.ArrayBuffer{}.FromRef(args[3+1]), 2863 )) { 2864 return 2865 } 2866 2867 js.ThrowCallbackValueNotReturned() 2868 } 2869 2870 // HasFuncOnTransmitRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.addListener" exists. 2871 func HasFuncOnTransmitRequested() bool { 2872 return js.True == bindings.HasFuncOnTransmitRequested() 2873 } 2874 2875 // FuncOnTransmitRequested returns the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.addListener". 2876 func FuncOnTransmitRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)])]) { 2877 bindings.FuncOnTransmitRequested( 2878 js.Pointer(&fn), 2879 ) 2880 return 2881 } 2882 2883 // OnTransmitRequested calls the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.addListener" directly. 2884 func OnTransmitRequested(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]) (ret js.Void) { 2885 bindings.CallOnTransmitRequested( 2886 js.Pointer(&ret), 2887 callback.Ref(), 2888 ) 2889 2890 return 2891 } 2892 2893 // TryOnTransmitRequested calls the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.addListener" 2894 // in a try/catch block and returns (_, err, ok = false) when it went through 2895 // the catch clause. 2896 func TryOnTransmitRequested(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]) (ret js.Void, exception js.Any, ok bool) { 2897 ok = js.True == bindings.TryOnTransmitRequested( 2898 js.Pointer(&ret), js.Pointer(&exception), 2899 callback.Ref(), 2900 ) 2901 2902 return 2903 } 2904 2905 // HasFuncOffTransmitRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.removeListener" exists. 2906 func HasFuncOffTransmitRequested() bool { 2907 return js.True == bindings.HasFuncOffTransmitRequested() 2908 } 2909 2910 // FuncOffTransmitRequested returns the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.removeListener". 2911 func FuncOffTransmitRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)])]) { 2912 bindings.FuncOffTransmitRequested( 2913 js.Pointer(&fn), 2914 ) 2915 return 2916 } 2917 2918 // OffTransmitRequested calls the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.removeListener" directly. 2919 func OffTransmitRequested(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]) (ret js.Void) { 2920 bindings.CallOffTransmitRequested( 2921 js.Pointer(&ret), 2922 callback.Ref(), 2923 ) 2924 2925 return 2926 } 2927 2928 // TryOffTransmitRequested calls the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.removeListener" 2929 // in a try/catch block and returns (_, err, ok = false) when it went through 2930 // the catch clause. 2931 func TryOffTransmitRequested(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]) (ret js.Void, exception js.Any, ok bool) { 2932 ok = js.True == bindings.TryOffTransmitRequested( 2933 js.Pointer(&ret), js.Pointer(&exception), 2934 callback.Ref(), 2935 ) 2936 2937 return 2938 } 2939 2940 // HasFuncHasOnTransmitRequested returns true if the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.hasListener" exists. 2941 func HasFuncHasOnTransmitRequested() bool { 2942 return js.True == bindings.HasFuncHasOnTransmitRequested() 2943 } 2944 2945 // FuncHasOnTransmitRequested returns the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.hasListener". 2946 func FuncHasOnTransmitRequested() (fn js.Func[func(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]) bool]) { 2947 bindings.FuncHasOnTransmitRequested( 2948 js.Pointer(&fn), 2949 ) 2950 return 2951 } 2952 2953 // HasOnTransmitRequested calls the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.hasListener" directly. 2954 func HasOnTransmitRequested(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]) (ret bool) { 2955 bindings.CallHasOnTransmitRequested( 2956 js.Pointer(&ret), 2957 callback.Ref(), 2958 ) 2959 2960 return 2961 } 2962 2963 // TryHasOnTransmitRequested calls the function "WEBEXT.smartCardProviderPrivate.onTransmitRequested.hasListener" 2964 // in a try/catch block and returns (_, err, ok = false) when it went through 2965 // the catch clause. 2966 func TryHasOnTransmitRequested(callback js.Func[func(requestId int32, scardHandle int32, protocol Protocol, data js.ArrayBuffer)]) (ret bool, exception js.Any, ok bool) { 2967 ok = js.True == bindings.TryHasOnTransmitRequested( 2968 js.Pointer(&ret), js.Pointer(&exception), 2969 callback.Ref(), 2970 ) 2971 2972 return 2973 } 2974 2975 // HasFuncReportConnectResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportConnectResult" exists. 2976 func HasFuncReportConnectResult() bool { 2977 return js.True == bindings.HasFuncReportConnectResult() 2978 } 2979 2980 // FuncReportConnectResult returns the function "WEBEXT.smartCardProviderPrivate.reportConnectResult". 2981 func FuncReportConnectResult() (fn js.Func[func(requestId int32, scardHandle int32, activeProtocol Protocol, resultCode ResultCode)]) { 2982 bindings.FuncReportConnectResult( 2983 js.Pointer(&fn), 2984 ) 2985 return 2986 } 2987 2988 // ReportConnectResult calls the function "WEBEXT.smartCardProviderPrivate.reportConnectResult" directly. 2989 func ReportConnectResult(requestId int32, scardHandle int32, activeProtocol Protocol, resultCode ResultCode) (ret js.Void) { 2990 bindings.CallReportConnectResult( 2991 js.Pointer(&ret), 2992 int32(requestId), 2993 int32(scardHandle), 2994 uint32(activeProtocol), 2995 uint32(resultCode), 2996 ) 2997 2998 return 2999 } 3000 3001 // TryReportConnectResult calls the function "WEBEXT.smartCardProviderPrivate.reportConnectResult" 3002 // in a try/catch block and returns (_, err, ok = false) when it went through 3003 // the catch clause. 3004 func TryReportConnectResult(requestId int32, scardHandle int32, activeProtocol Protocol, resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3005 ok = js.True == bindings.TryReportConnectResult( 3006 js.Pointer(&ret), js.Pointer(&exception), 3007 int32(requestId), 3008 int32(scardHandle), 3009 uint32(activeProtocol), 3010 uint32(resultCode), 3011 ) 3012 3013 return 3014 } 3015 3016 // HasFuncReportDataResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportDataResult" exists. 3017 func HasFuncReportDataResult() bool { 3018 return js.True == bindings.HasFuncReportDataResult() 3019 } 3020 3021 // FuncReportDataResult returns the function "WEBEXT.smartCardProviderPrivate.reportDataResult". 3022 func FuncReportDataResult() (fn js.Func[func(requestId int32, data js.ArrayBuffer, resultCode ResultCode)]) { 3023 bindings.FuncReportDataResult( 3024 js.Pointer(&fn), 3025 ) 3026 return 3027 } 3028 3029 // ReportDataResult calls the function "WEBEXT.smartCardProviderPrivate.reportDataResult" directly. 3030 func ReportDataResult(requestId int32, data js.ArrayBuffer, resultCode ResultCode) (ret js.Void) { 3031 bindings.CallReportDataResult( 3032 js.Pointer(&ret), 3033 int32(requestId), 3034 data.Ref(), 3035 uint32(resultCode), 3036 ) 3037 3038 return 3039 } 3040 3041 // TryReportDataResult calls the function "WEBEXT.smartCardProviderPrivate.reportDataResult" 3042 // in a try/catch block and returns (_, err, ok = false) when it went through 3043 // the catch clause. 3044 func TryReportDataResult(requestId int32, data js.ArrayBuffer, resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3045 ok = js.True == bindings.TryReportDataResult( 3046 js.Pointer(&ret), js.Pointer(&exception), 3047 int32(requestId), 3048 data.Ref(), 3049 uint32(resultCode), 3050 ) 3051 3052 return 3053 } 3054 3055 // HasFuncReportEstablishContextResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportEstablishContextResult" exists. 3056 func HasFuncReportEstablishContextResult() bool { 3057 return js.True == bindings.HasFuncReportEstablishContextResult() 3058 } 3059 3060 // FuncReportEstablishContextResult returns the function "WEBEXT.smartCardProviderPrivate.reportEstablishContextResult". 3061 func FuncReportEstablishContextResult() (fn js.Func[func(requestId int32, scardContext int32, resultCode ResultCode)]) { 3062 bindings.FuncReportEstablishContextResult( 3063 js.Pointer(&fn), 3064 ) 3065 return 3066 } 3067 3068 // ReportEstablishContextResult calls the function "WEBEXT.smartCardProviderPrivate.reportEstablishContextResult" directly. 3069 func ReportEstablishContextResult(requestId int32, scardContext int32, resultCode ResultCode) (ret js.Void) { 3070 bindings.CallReportEstablishContextResult( 3071 js.Pointer(&ret), 3072 int32(requestId), 3073 int32(scardContext), 3074 uint32(resultCode), 3075 ) 3076 3077 return 3078 } 3079 3080 // TryReportEstablishContextResult calls the function "WEBEXT.smartCardProviderPrivate.reportEstablishContextResult" 3081 // in a try/catch block and returns (_, err, ok = false) when it went through 3082 // the catch clause. 3083 func TryReportEstablishContextResult(requestId int32, scardContext int32, resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3084 ok = js.True == bindings.TryReportEstablishContextResult( 3085 js.Pointer(&ret), js.Pointer(&exception), 3086 int32(requestId), 3087 int32(scardContext), 3088 uint32(resultCode), 3089 ) 3090 3091 return 3092 } 3093 3094 // HasFuncReportGetStatusChangeResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportGetStatusChangeResult" exists. 3095 func HasFuncReportGetStatusChangeResult() bool { 3096 return js.True == bindings.HasFuncReportGetStatusChangeResult() 3097 } 3098 3099 // FuncReportGetStatusChangeResult returns the function "WEBEXT.smartCardProviderPrivate.reportGetStatusChangeResult". 3100 func FuncReportGetStatusChangeResult() (fn js.Func[func(requestId int32, readerStates js.Array[ReaderStateOut], resultCode ResultCode)]) { 3101 bindings.FuncReportGetStatusChangeResult( 3102 js.Pointer(&fn), 3103 ) 3104 return 3105 } 3106 3107 // ReportGetStatusChangeResult calls the function "WEBEXT.smartCardProviderPrivate.reportGetStatusChangeResult" directly. 3108 func ReportGetStatusChangeResult(requestId int32, readerStates js.Array[ReaderStateOut], resultCode ResultCode) (ret js.Void) { 3109 bindings.CallReportGetStatusChangeResult( 3110 js.Pointer(&ret), 3111 int32(requestId), 3112 readerStates.Ref(), 3113 uint32(resultCode), 3114 ) 3115 3116 return 3117 } 3118 3119 // TryReportGetStatusChangeResult calls the function "WEBEXT.smartCardProviderPrivate.reportGetStatusChangeResult" 3120 // in a try/catch block and returns (_, err, ok = false) when it went through 3121 // the catch clause. 3122 func TryReportGetStatusChangeResult(requestId int32, readerStates js.Array[ReaderStateOut], resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3123 ok = js.True == bindings.TryReportGetStatusChangeResult( 3124 js.Pointer(&ret), js.Pointer(&exception), 3125 int32(requestId), 3126 readerStates.Ref(), 3127 uint32(resultCode), 3128 ) 3129 3130 return 3131 } 3132 3133 // HasFuncReportListReadersResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportListReadersResult" exists. 3134 func HasFuncReportListReadersResult() bool { 3135 return js.True == bindings.HasFuncReportListReadersResult() 3136 } 3137 3138 // FuncReportListReadersResult returns the function "WEBEXT.smartCardProviderPrivate.reportListReadersResult". 3139 func FuncReportListReadersResult() (fn js.Func[func(requestId int32, readers js.Array[js.String], resultCode ResultCode)]) { 3140 bindings.FuncReportListReadersResult( 3141 js.Pointer(&fn), 3142 ) 3143 return 3144 } 3145 3146 // ReportListReadersResult calls the function "WEBEXT.smartCardProviderPrivate.reportListReadersResult" directly. 3147 func ReportListReadersResult(requestId int32, readers js.Array[js.String], resultCode ResultCode) (ret js.Void) { 3148 bindings.CallReportListReadersResult( 3149 js.Pointer(&ret), 3150 int32(requestId), 3151 readers.Ref(), 3152 uint32(resultCode), 3153 ) 3154 3155 return 3156 } 3157 3158 // TryReportListReadersResult calls the function "WEBEXT.smartCardProviderPrivate.reportListReadersResult" 3159 // in a try/catch block and returns (_, err, ok = false) when it went through 3160 // the catch clause. 3161 func TryReportListReadersResult(requestId int32, readers js.Array[js.String], resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3162 ok = js.True == bindings.TryReportListReadersResult( 3163 js.Pointer(&ret), js.Pointer(&exception), 3164 int32(requestId), 3165 readers.Ref(), 3166 uint32(resultCode), 3167 ) 3168 3169 return 3170 } 3171 3172 // HasFuncReportPlainResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportPlainResult" exists. 3173 func HasFuncReportPlainResult() bool { 3174 return js.True == bindings.HasFuncReportPlainResult() 3175 } 3176 3177 // FuncReportPlainResult returns the function "WEBEXT.smartCardProviderPrivate.reportPlainResult". 3178 func FuncReportPlainResult() (fn js.Func[func(requestId int32, resultCode ResultCode)]) { 3179 bindings.FuncReportPlainResult( 3180 js.Pointer(&fn), 3181 ) 3182 return 3183 } 3184 3185 // ReportPlainResult calls the function "WEBEXT.smartCardProviderPrivate.reportPlainResult" directly. 3186 func ReportPlainResult(requestId int32, resultCode ResultCode) (ret js.Void) { 3187 bindings.CallReportPlainResult( 3188 js.Pointer(&ret), 3189 int32(requestId), 3190 uint32(resultCode), 3191 ) 3192 3193 return 3194 } 3195 3196 // TryReportPlainResult calls the function "WEBEXT.smartCardProviderPrivate.reportPlainResult" 3197 // in a try/catch block and returns (_, err, ok = false) when it went through 3198 // the catch clause. 3199 func TryReportPlainResult(requestId int32, resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3200 ok = js.True == bindings.TryReportPlainResult( 3201 js.Pointer(&ret), js.Pointer(&exception), 3202 int32(requestId), 3203 uint32(resultCode), 3204 ) 3205 3206 return 3207 } 3208 3209 // HasFuncReportReleaseContextResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportReleaseContextResult" exists. 3210 func HasFuncReportReleaseContextResult() bool { 3211 return js.True == bindings.HasFuncReportReleaseContextResult() 3212 } 3213 3214 // FuncReportReleaseContextResult returns the function "WEBEXT.smartCardProviderPrivate.reportReleaseContextResult". 3215 func FuncReportReleaseContextResult() (fn js.Func[func(requestId int32, resultCode ResultCode)]) { 3216 bindings.FuncReportReleaseContextResult( 3217 js.Pointer(&fn), 3218 ) 3219 return 3220 } 3221 3222 // ReportReleaseContextResult calls the function "WEBEXT.smartCardProviderPrivate.reportReleaseContextResult" directly. 3223 func ReportReleaseContextResult(requestId int32, resultCode ResultCode) (ret js.Void) { 3224 bindings.CallReportReleaseContextResult( 3225 js.Pointer(&ret), 3226 int32(requestId), 3227 uint32(resultCode), 3228 ) 3229 3230 return 3231 } 3232 3233 // TryReportReleaseContextResult calls the function "WEBEXT.smartCardProviderPrivate.reportReleaseContextResult" 3234 // in a try/catch block and returns (_, err, ok = false) when it went through 3235 // the catch clause. 3236 func TryReportReleaseContextResult(requestId int32, resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3237 ok = js.True == bindings.TryReportReleaseContextResult( 3238 js.Pointer(&ret), js.Pointer(&exception), 3239 int32(requestId), 3240 uint32(resultCode), 3241 ) 3242 3243 return 3244 } 3245 3246 // HasFuncReportStatusResult returns true if the function "WEBEXT.smartCardProviderPrivate.reportStatusResult" exists. 3247 func HasFuncReportStatusResult() bool { 3248 return js.True == bindings.HasFuncReportStatusResult() 3249 } 3250 3251 // FuncReportStatusResult returns the function "WEBEXT.smartCardProviderPrivate.reportStatusResult". 3252 func FuncReportStatusResult() (fn js.Func[func(requestId int32, readerName js.String, state ConnectionState, protocol Protocol, atr js.ArrayBuffer, resultCode ResultCode)]) { 3253 bindings.FuncReportStatusResult( 3254 js.Pointer(&fn), 3255 ) 3256 return 3257 } 3258 3259 // ReportStatusResult calls the function "WEBEXT.smartCardProviderPrivate.reportStatusResult" directly. 3260 func ReportStatusResult(requestId int32, readerName js.String, state ConnectionState, protocol Protocol, atr js.ArrayBuffer, resultCode ResultCode) (ret js.Void) { 3261 bindings.CallReportStatusResult( 3262 js.Pointer(&ret), 3263 int32(requestId), 3264 readerName.Ref(), 3265 uint32(state), 3266 uint32(protocol), 3267 atr.Ref(), 3268 uint32(resultCode), 3269 ) 3270 3271 return 3272 } 3273 3274 // TryReportStatusResult calls the function "WEBEXT.smartCardProviderPrivate.reportStatusResult" 3275 // in a try/catch block and returns (_, err, ok = false) when it went through 3276 // the catch clause. 3277 func TryReportStatusResult(requestId int32, readerName js.String, state ConnectionState, protocol Protocol, atr js.ArrayBuffer, resultCode ResultCode) (ret js.Void, exception js.Any, ok bool) { 3278 ok = js.True == bindings.TryReportStatusResult( 3279 js.Pointer(&ret), js.Pointer(&exception), 3280 int32(requestId), 3281 readerName.Ref(), 3282 uint32(state), 3283 uint32(protocol), 3284 atr.Ref(), 3285 uint32(resultCode), 3286 ) 3287 3288 return 3289 }