github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/usersprivate/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package usersprivate 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/usersprivate/bindings" 11 ) 12 13 type IsUserInListCallbackFunc func(this js.Ref, found bool) js.Ref 14 15 func (fn IsUserInListCallbackFunc) Register() js.Func[func(found bool)] { 16 return js.RegisterCallback[func(found bool)]( 17 fn, abi.FuncPCABIInternal(fn), 18 ) 19 } 20 21 func (fn IsUserInListCallbackFunc) DispatchCallback( 22 targetPC uintptr, ctx *js.CallbackContext, 23 ) { 24 args := ctx.Args() 25 if len(args) != 1+1 /* js this */ || 26 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 27 js.ThrowInvalidCallbackInvocation() 28 } 29 30 if ctx.Return(fn( 31 args[0], 32 33 args[0+1] == js.True, 34 )) { 35 return 36 } 37 38 js.ThrowCallbackValueNotReturned() 39 } 40 41 type IsUserInListCallback[T any] struct { 42 Fn func(arg T, this js.Ref, found bool) js.Ref 43 Arg T 44 } 45 46 func (cb *IsUserInListCallback[T]) Register() js.Func[func(found bool)] { 47 return js.RegisterCallback[func(found bool)]( 48 cb, abi.FuncPCABIInternal(cb.Fn), 49 ) 50 } 51 52 func (cb *IsUserInListCallback[T]) DispatchCallback( 53 targetPC uintptr, ctx *js.CallbackContext, 54 ) { 55 args := ctx.Args() 56 if len(args) != 1+1 /* js this */ || 57 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 58 js.ThrowInvalidCallbackInvocation() 59 } 60 61 if ctx.Return(cb.Fn( 62 cb.Arg, 63 args[0], 64 65 args[0+1] == js.True, 66 )) { 67 return 68 } 69 70 js.ThrowCallbackValueNotReturned() 71 } 72 73 type LoginStatusCallbackFunc func(this js.Ref, status *LoginStatusDict) js.Ref 74 75 func (fn LoginStatusCallbackFunc) Register() js.Func[func(status *LoginStatusDict)] { 76 return js.RegisterCallback[func(status *LoginStatusDict)]( 77 fn, abi.FuncPCABIInternal(fn), 78 ) 79 } 80 81 func (fn LoginStatusCallbackFunc) DispatchCallback( 82 targetPC uintptr, ctx *js.CallbackContext, 83 ) { 84 args := ctx.Args() 85 if len(args) != 1+1 /* js this */ || 86 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 87 js.ThrowInvalidCallbackInvocation() 88 } 89 var arg0 LoginStatusDict 90 arg0.UpdateFrom(args[0+1]) 91 defer arg0.FreeMembers(true) 92 93 if ctx.Return(fn( 94 args[0], 95 96 mark.NoEscape(&arg0), 97 )) { 98 return 99 } 100 101 js.ThrowCallbackValueNotReturned() 102 } 103 104 type LoginStatusCallback[T any] struct { 105 Fn func(arg T, this js.Ref, status *LoginStatusDict) js.Ref 106 Arg T 107 } 108 109 func (cb *LoginStatusCallback[T]) Register() js.Func[func(status *LoginStatusDict)] { 110 return js.RegisterCallback[func(status *LoginStatusDict)]( 111 cb, abi.FuncPCABIInternal(cb.Fn), 112 ) 113 } 114 115 func (cb *LoginStatusCallback[T]) DispatchCallback( 116 targetPC uintptr, ctx *js.CallbackContext, 117 ) { 118 args := ctx.Args() 119 if len(args) != 1+1 /* js this */ || 120 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 121 js.ThrowInvalidCallbackInvocation() 122 } 123 var arg0 LoginStatusDict 124 arg0.UpdateFrom(args[0+1]) 125 defer arg0.FreeMembers(true) 126 127 if ctx.Return(cb.Fn( 128 cb.Arg, 129 args[0], 130 131 mark.NoEscape(&arg0), 132 )) { 133 return 134 } 135 136 js.ThrowCallbackValueNotReturned() 137 } 138 139 type LoginStatusDict struct { 140 // IsLoggedIn is "LoginStatusDict.isLoggedIn" 141 // 142 // Optional 143 // 144 // NOTE: FFI_USE_IsLoggedIn MUST be set to true to make this field effective. 145 IsLoggedIn bool 146 // IsScreenLocked is "LoginStatusDict.isScreenLocked" 147 // 148 // Optional 149 // 150 // NOTE: FFI_USE_IsScreenLocked MUST be set to true to make this field effective. 151 IsScreenLocked bool 152 153 FFI_USE_IsLoggedIn bool // for IsLoggedIn. 154 FFI_USE_IsScreenLocked bool // for IsScreenLocked. 155 156 FFI_USE bool 157 } 158 159 // FromRef calls UpdateFrom and returns a LoginStatusDict with all fields set. 160 func (p LoginStatusDict) FromRef(ref js.Ref) LoginStatusDict { 161 p.UpdateFrom(ref) 162 return p 163 } 164 165 // New creates a new LoginStatusDict in the application heap. 166 func (p LoginStatusDict) New() js.Ref { 167 return bindings.LoginStatusDictJSLoad( 168 js.Pointer(&p), js.True, 0, 169 ) 170 } 171 172 // UpdateFrom copies value of all fields of the heap object to p. 173 func (p *LoginStatusDict) UpdateFrom(ref js.Ref) { 174 bindings.LoginStatusDictJSStore( 175 js.Pointer(p), ref, 176 ) 177 } 178 179 // Update writes all fields of the p to the heap object referenced by ref. 180 func (p *LoginStatusDict) Update(ref js.Ref) { 181 bindings.LoginStatusDictJSLoad( 182 js.Pointer(p), js.False, ref, 183 ) 184 } 185 186 // FreeMembers frees fields with heap reference, if recursive is true 187 // free all heap references reachable from p. 188 func (p *LoginStatusDict) FreeMembers(recursive bool) { 189 } 190 191 type ManagedCallbackFunc func(this js.Ref, managed bool) js.Ref 192 193 func (fn ManagedCallbackFunc) Register() js.Func[func(managed bool)] { 194 return js.RegisterCallback[func(managed bool)]( 195 fn, abi.FuncPCABIInternal(fn), 196 ) 197 } 198 199 func (fn ManagedCallbackFunc) DispatchCallback( 200 targetPC uintptr, ctx *js.CallbackContext, 201 ) { 202 args := ctx.Args() 203 if len(args) != 1+1 /* js this */ || 204 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 205 js.ThrowInvalidCallbackInvocation() 206 } 207 208 if ctx.Return(fn( 209 args[0], 210 211 args[0+1] == js.True, 212 )) { 213 return 214 } 215 216 js.ThrowCallbackValueNotReturned() 217 } 218 219 type ManagedCallback[T any] struct { 220 Fn func(arg T, this js.Ref, managed bool) js.Ref 221 Arg T 222 } 223 224 func (cb *ManagedCallback[T]) Register() js.Func[func(managed bool)] { 225 return js.RegisterCallback[func(managed bool)]( 226 cb, abi.FuncPCABIInternal(cb.Fn), 227 ) 228 } 229 230 func (cb *ManagedCallback[T]) DispatchCallback( 231 targetPC uintptr, ctx *js.CallbackContext, 232 ) { 233 args := ctx.Args() 234 if len(args) != 1+1 /* js this */ || 235 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 236 js.ThrowInvalidCallbackInvocation() 237 } 238 239 if ctx.Return(cb.Fn( 240 cb.Arg, 241 args[0], 242 243 args[0+1] == js.True, 244 )) { 245 return 246 } 247 248 js.ThrowCallbackValueNotReturned() 249 } 250 251 type User struct { 252 // Email is "User.email" 253 // 254 // Optional 255 Email js.String 256 // DisplayEmail is "User.displayEmail" 257 // 258 // Optional 259 DisplayEmail js.String 260 // Name is "User.name" 261 // 262 // Optional 263 Name js.String 264 // IsOwner is "User.isOwner" 265 // 266 // Optional 267 // 268 // NOTE: FFI_USE_IsOwner MUST be set to true to make this field effective. 269 IsOwner bool 270 // IsChild is "User.isChild" 271 // 272 // Optional 273 // 274 // NOTE: FFI_USE_IsChild MUST be set to true to make this field effective. 275 IsChild bool 276 277 FFI_USE_IsOwner bool // for IsOwner. 278 FFI_USE_IsChild bool // for IsChild. 279 280 FFI_USE bool 281 } 282 283 // FromRef calls UpdateFrom and returns a User with all fields set. 284 func (p User) FromRef(ref js.Ref) User { 285 p.UpdateFrom(ref) 286 return p 287 } 288 289 // New creates a new User in the application heap. 290 func (p User) New() js.Ref { 291 return bindings.UserJSLoad( 292 js.Pointer(&p), js.True, 0, 293 ) 294 } 295 296 // UpdateFrom copies value of all fields of the heap object to p. 297 func (p *User) UpdateFrom(ref js.Ref) { 298 bindings.UserJSStore( 299 js.Pointer(p), ref, 300 ) 301 } 302 303 // Update writes all fields of the p to the heap object referenced by ref. 304 func (p *User) Update(ref js.Ref) { 305 bindings.UserJSLoad( 306 js.Pointer(p), js.False, ref, 307 ) 308 } 309 310 // FreeMembers frees fields with heap reference, if recursive is true 311 // free all heap references reachable from p. 312 func (p *User) FreeMembers(recursive bool) { 313 js.Free( 314 p.Email.Ref(), 315 p.DisplayEmail.Ref(), 316 p.Name.Ref(), 317 ) 318 p.Email = p.Email.FromRef(js.Undefined) 319 p.DisplayEmail = p.DisplayEmail.FromRef(js.Undefined) 320 p.Name = p.Name.FromRef(js.Undefined) 321 } 322 323 type UserAddedCallbackFunc func(this js.Ref, success bool) js.Ref 324 325 func (fn UserAddedCallbackFunc) Register() js.Func[func(success bool)] { 326 return js.RegisterCallback[func(success bool)]( 327 fn, abi.FuncPCABIInternal(fn), 328 ) 329 } 330 331 func (fn UserAddedCallbackFunc) DispatchCallback( 332 targetPC uintptr, ctx *js.CallbackContext, 333 ) { 334 args := ctx.Args() 335 if len(args) != 1+1 /* js this */ || 336 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 337 js.ThrowInvalidCallbackInvocation() 338 } 339 340 if ctx.Return(fn( 341 args[0], 342 343 args[0+1] == js.True, 344 )) { 345 return 346 } 347 348 js.ThrowCallbackValueNotReturned() 349 } 350 351 type UserAddedCallback[T any] struct { 352 Fn func(arg T, this js.Ref, success bool) js.Ref 353 Arg T 354 } 355 356 func (cb *UserAddedCallback[T]) Register() js.Func[func(success bool)] { 357 return js.RegisterCallback[func(success bool)]( 358 cb, abi.FuncPCABIInternal(cb.Fn), 359 ) 360 } 361 362 func (cb *UserAddedCallback[T]) DispatchCallback( 363 targetPC uintptr, ctx *js.CallbackContext, 364 ) { 365 args := ctx.Args() 366 if len(args) != 1+1 /* js this */ || 367 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 368 js.ThrowInvalidCallbackInvocation() 369 } 370 371 if ctx.Return(cb.Fn( 372 cb.Arg, 373 args[0], 374 375 args[0+1] == js.True, 376 )) { 377 return 378 } 379 380 js.ThrowCallbackValueNotReturned() 381 } 382 383 type UserCallbackFunc func(this js.Ref, user *User) js.Ref 384 385 func (fn UserCallbackFunc) Register() js.Func[func(user *User)] { 386 return js.RegisterCallback[func(user *User)]( 387 fn, abi.FuncPCABIInternal(fn), 388 ) 389 } 390 391 func (fn UserCallbackFunc) DispatchCallback( 392 targetPC uintptr, ctx *js.CallbackContext, 393 ) { 394 args := ctx.Args() 395 if len(args) != 1+1 /* js this */ || 396 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 397 js.ThrowInvalidCallbackInvocation() 398 } 399 var arg0 User 400 arg0.UpdateFrom(args[0+1]) 401 defer arg0.FreeMembers(true) 402 403 if ctx.Return(fn( 404 args[0], 405 406 mark.NoEscape(&arg0), 407 )) { 408 return 409 } 410 411 js.ThrowCallbackValueNotReturned() 412 } 413 414 type UserCallback[T any] struct { 415 Fn func(arg T, this js.Ref, user *User) js.Ref 416 Arg T 417 } 418 419 func (cb *UserCallback[T]) Register() js.Func[func(user *User)] { 420 return js.RegisterCallback[func(user *User)]( 421 cb, abi.FuncPCABIInternal(cb.Fn), 422 ) 423 } 424 425 func (cb *UserCallback[T]) DispatchCallback( 426 targetPC uintptr, ctx *js.CallbackContext, 427 ) { 428 args := ctx.Args() 429 if len(args) != 1+1 /* js this */ || 430 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 431 js.ThrowInvalidCallbackInvocation() 432 } 433 var arg0 User 434 arg0.UpdateFrom(args[0+1]) 435 defer arg0.FreeMembers(true) 436 437 if ctx.Return(cb.Fn( 438 cb.Arg, 439 args[0], 440 441 mark.NoEscape(&arg0), 442 )) { 443 return 444 } 445 446 js.ThrowCallbackValueNotReturned() 447 } 448 449 type UserRemovedCallbackFunc func(this js.Ref, success bool) js.Ref 450 451 func (fn UserRemovedCallbackFunc) Register() js.Func[func(success bool)] { 452 return js.RegisterCallback[func(success bool)]( 453 fn, abi.FuncPCABIInternal(fn), 454 ) 455 } 456 457 func (fn UserRemovedCallbackFunc) DispatchCallback( 458 targetPC uintptr, ctx *js.CallbackContext, 459 ) { 460 args := ctx.Args() 461 if len(args) != 1+1 /* js this */ || 462 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 463 js.ThrowInvalidCallbackInvocation() 464 } 465 466 if ctx.Return(fn( 467 args[0], 468 469 args[0+1] == js.True, 470 )) { 471 return 472 } 473 474 js.ThrowCallbackValueNotReturned() 475 } 476 477 type UserRemovedCallback[T any] struct { 478 Fn func(arg T, this js.Ref, success bool) js.Ref 479 Arg T 480 } 481 482 func (cb *UserRemovedCallback[T]) Register() js.Func[func(success bool)] { 483 return js.RegisterCallback[func(success bool)]( 484 cb, abi.FuncPCABIInternal(cb.Fn), 485 ) 486 } 487 488 func (cb *UserRemovedCallback[T]) DispatchCallback( 489 targetPC uintptr, ctx *js.CallbackContext, 490 ) { 491 args := ctx.Args() 492 if len(args) != 1+1 /* js this */ || 493 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 494 js.ThrowInvalidCallbackInvocation() 495 } 496 497 if ctx.Return(cb.Fn( 498 cb.Arg, 499 args[0], 500 501 args[0+1] == js.True, 502 )) { 503 return 504 } 505 506 js.ThrowCallbackValueNotReturned() 507 } 508 509 type UsersCallbackFunc func(this js.Ref, users js.Array[User]) js.Ref 510 511 func (fn UsersCallbackFunc) Register() js.Func[func(users js.Array[User])] { 512 return js.RegisterCallback[func(users js.Array[User])]( 513 fn, abi.FuncPCABIInternal(fn), 514 ) 515 } 516 517 func (fn UsersCallbackFunc) DispatchCallback( 518 targetPC uintptr, ctx *js.CallbackContext, 519 ) { 520 args := ctx.Args() 521 if len(args) != 1+1 /* js this */ || 522 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 523 js.ThrowInvalidCallbackInvocation() 524 } 525 526 if ctx.Return(fn( 527 args[0], 528 529 js.Array[User]{}.FromRef(args[0+1]), 530 )) { 531 return 532 } 533 534 js.ThrowCallbackValueNotReturned() 535 } 536 537 type UsersCallback[T any] struct { 538 Fn func(arg T, this js.Ref, users js.Array[User]) js.Ref 539 Arg T 540 } 541 542 func (cb *UsersCallback[T]) Register() js.Func[func(users js.Array[User])] { 543 return js.RegisterCallback[func(users js.Array[User])]( 544 cb, abi.FuncPCABIInternal(cb.Fn), 545 ) 546 } 547 548 func (cb *UsersCallback[T]) DispatchCallback( 549 targetPC uintptr, ctx *js.CallbackContext, 550 ) { 551 args := ctx.Args() 552 if len(args) != 1+1 /* js this */ || 553 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 554 js.ThrowInvalidCallbackInvocation() 555 } 556 557 if ctx.Return(cb.Fn( 558 cb.Arg, 559 args[0], 560 561 js.Array[User]{}.FromRef(args[0+1]), 562 )) { 563 return 564 } 565 566 js.ThrowCallbackValueNotReturned() 567 } 568 569 // HasFuncAddUser returns true if the function "WEBEXT.usersPrivate.addUser" exists. 570 func HasFuncAddUser() bool { 571 return js.True == bindings.HasFuncAddUser() 572 } 573 574 // FuncAddUser returns the function "WEBEXT.usersPrivate.addUser". 575 func FuncAddUser() (fn js.Func[func(email js.String) js.Promise[js.Boolean]]) { 576 bindings.FuncAddUser( 577 js.Pointer(&fn), 578 ) 579 return 580 } 581 582 // AddUser calls the function "WEBEXT.usersPrivate.addUser" directly. 583 func AddUser(email js.String) (ret js.Promise[js.Boolean]) { 584 bindings.CallAddUser( 585 js.Pointer(&ret), 586 email.Ref(), 587 ) 588 589 return 590 } 591 592 // TryAddUser calls the function "WEBEXT.usersPrivate.addUser" 593 // in a try/catch block and returns (_, err, ok = false) when it went through 594 // the catch clause. 595 func TryAddUser(email js.String) (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 596 ok = js.True == bindings.TryAddUser( 597 js.Pointer(&ret), js.Pointer(&exception), 598 email.Ref(), 599 ) 600 601 return 602 } 603 604 // HasFuncGetCurrentUser returns true if the function "WEBEXT.usersPrivate.getCurrentUser" exists. 605 func HasFuncGetCurrentUser() bool { 606 return js.True == bindings.HasFuncGetCurrentUser() 607 } 608 609 // FuncGetCurrentUser returns the function "WEBEXT.usersPrivate.getCurrentUser". 610 func FuncGetCurrentUser() (fn js.Func[func() js.Promise[User]]) { 611 bindings.FuncGetCurrentUser( 612 js.Pointer(&fn), 613 ) 614 return 615 } 616 617 // GetCurrentUser calls the function "WEBEXT.usersPrivate.getCurrentUser" directly. 618 func GetCurrentUser() (ret js.Promise[User]) { 619 bindings.CallGetCurrentUser( 620 js.Pointer(&ret), 621 ) 622 623 return 624 } 625 626 // TryGetCurrentUser calls the function "WEBEXT.usersPrivate.getCurrentUser" 627 // in a try/catch block and returns (_, err, ok = false) when it went through 628 // the catch clause. 629 func TryGetCurrentUser() (ret js.Promise[User], exception js.Any, ok bool) { 630 ok = js.True == bindings.TryGetCurrentUser( 631 js.Pointer(&ret), js.Pointer(&exception), 632 ) 633 634 return 635 } 636 637 // HasFuncGetLoginStatus returns true if the function "WEBEXT.usersPrivate.getLoginStatus" exists. 638 func HasFuncGetLoginStatus() bool { 639 return js.True == bindings.HasFuncGetLoginStatus() 640 } 641 642 // FuncGetLoginStatus returns the function "WEBEXT.usersPrivate.getLoginStatus". 643 func FuncGetLoginStatus() (fn js.Func[func() js.Promise[LoginStatusDict]]) { 644 bindings.FuncGetLoginStatus( 645 js.Pointer(&fn), 646 ) 647 return 648 } 649 650 // GetLoginStatus calls the function "WEBEXT.usersPrivate.getLoginStatus" directly. 651 func GetLoginStatus() (ret js.Promise[LoginStatusDict]) { 652 bindings.CallGetLoginStatus( 653 js.Pointer(&ret), 654 ) 655 656 return 657 } 658 659 // TryGetLoginStatus calls the function "WEBEXT.usersPrivate.getLoginStatus" 660 // in a try/catch block and returns (_, err, ok = false) when it went through 661 // the catch clause. 662 func TryGetLoginStatus() (ret js.Promise[LoginStatusDict], exception js.Any, ok bool) { 663 ok = js.True == bindings.TryGetLoginStatus( 664 js.Pointer(&ret), js.Pointer(&exception), 665 ) 666 667 return 668 } 669 670 // HasFuncGetUsers returns true if the function "WEBEXT.usersPrivate.getUsers" exists. 671 func HasFuncGetUsers() bool { 672 return js.True == bindings.HasFuncGetUsers() 673 } 674 675 // FuncGetUsers returns the function "WEBEXT.usersPrivate.getUsers". 676 func FuncGetUsers() (fn js.Func[func() js.Promise[js.Array[User]]]) { 677 bindings.FuncGetUsers( 678 js.Pointer(&fn), 679 ) 680 return 681 } 682 683 // GetUsers calls the function "WEBEXT.usersPrivate.getUsers" directly. 684 func GetUsers() (ret js.Promise[js.Array[User]]) { 685 bindings.CallGetUsers( 686 js.Pointer(&ret), 687 ) 688 689 return 690 } 691 692 // TryGetUsers calls the function "WEBEXT.usersPrivate.getUsers" 693 // in a try/catch block and returns (_, err, ok = false) when it went through 694 // the catch clause. 695 func TryGetUsers() (ret js.Promise[js.Array[User]], exception js.Any, ok bool) { 696 ok = js.True == bindings.TryGetUsers( 697 js.Pointer(&ret), js.Pointer(&exception), 698 ) 699 700 return 701 } 702 703 // HasFuncIsUserInList returns true if the function "WEBEXT.usersPrivate.isUserInList" exists. 704 func HasFuncIsUserInList() bool { 705 return js.True == bindings.HasFuncIsUserInList() 706 } 707 708 // FuncIsUserInList returns the function "WEBEXT.usersPrivate.isUserInList". 709 func FuncIsUserInList() (fn js.Func[func(email js.String) js.Promise[js.Boolean]]) { 710 bindings.FuncIsUserInList( 711 js.Pointer(&fn), 712 ) 713 return 714 } 715 716 // IsUserInList calls the function "WEBEXT.usersPrivate.isUserInList" directly. 717 func IsUserInList(email js.String) (ret js.Promise[js.Boolean]) { 718 bindings.CallIsUserInList( 719 js.Pointer(&ret), 720 email.Ref(), 721 ) 722 723 return 724 } 725 726 // TryIsUserInList calls the function "WEBEXT.usersPrivate.isUserInList" 727 // in a try/catch block and returns (_, err, ok = false) when it went through 728 // the catch clause. 729 func TryIsUserInList(email js.String) (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 730 ok = js.True == bindings.TryIsUserInList( 731 js.Pointer(&ret), js.Pointer(&exception), 732 email.Ref(), 733 ) 734 735 return 736 } 737 738 // HasFuncIsUserListManaged returns true if the function "WEBEXT.usersPrivate.isUserListManaged" exists. 739 func HasFuncIsUserListManaged() bool { 740 return js.True == bindings.HasFuncIsUserListManaged() 741 } 742 743 // FuncIsUserListManaged returns the function "WEBEXT.usersPrivate.isUserListManaged". 744 func FuncIsUserListManaged() (fn js.Func[func() js.Promise[js.Boolean]]) { 745 bindings.FuncIsUserListManaged( 746 js.Pointer(&fn), 747 ) 748 return 749 } 750 751 // IsUserListManaged calls the function "WEBEXT.usersPrivate.isUserListManaged" directly. 752 func IsUserListManaged() (ret js.Promise[js.Boolean]) { 753 bindings.CallIsUserListManaged( 754 js.Pointer(&ret), 755 ) 756 757 return 758 } 759 760 // TryIsUserListManaged calls the function "WEBEXT.usersPrivate.isUserListManaged" 761 // in a try/catch block and returns (_, err, ok = false) when it went through 762 // the catch clause. 763 func TryIsUserListManaged() (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 764 ok = js.True == bindings.TryIsUserListManaged( 765 js.Pointer(&ret), js.Pointer(&exception), 766 ) 767 768 return 769 } 770 771 // HasFuncRemoveUser returns true if the function "WEBEXT.usersPrivate.removeUser" exists. 772 func HasFuncRemoveUser() bool { 773 return js.True == bindings.HasFuncRemoveUser() 774 } 775 776 // FuncRemoveUser returns the function "WEBEXT.usersPrivate.removeUser". 777 func FuncRemoveUser() (fn js.Func[func(email js.String) js.Promise[js.Boolean]]) { 778 bindings.FuncRemoveUser( 779 js.Pointer(&fn), 780 ) 781 return 782 } 783 784 // RemoveUser calls the function "WEBEXT.usersPrivate.removeUser" directly. 785 func RemoveUser(email js.String) (ret js.Promise[js.Boolean]) { 786 bindings.CallRemoveUser( 787 js.Pointer(&ret), 788 email.Ref(), 789 ) 790 791 return 792 } 793 794 // TryRemoveUser calls the function "WEBEXT.usersPrivate.removeUser" 795 // in a try/catch block and returns (_, err, ok = false) when it went through 796 // the catch clause. 797 func TryRemoveUser(email js.String) (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 798 ok = js.True == bindings.TryRemoveUser( 799 js.Pointer(&ret), js.Pointer(&exception), 800 email.Ref(), 801 ) 802 803 return 804 }