github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/bookmarks/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package bookmarks 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/bookmarks/bindings" 11 ) 12 13 type BookmarkTreeNodeUnmodifiable uint32 14 15 const ( 16 _ BookmarkTreeNodeUnmodifiable = iota 17 18 BookmarkTreeNodeUnmodifiable_MANAGED 19 ) 20 21 func (BookmarkTreeNodeUnmodifiable) FromRef(str js.Ref) BookmarkTreeNodeUnmodifiable { 22 return BookmarkTreeNodeUnmodifiable(bindings.ConstOfBookmarkTreeNodeUnmodifiable(str)) 23 } 24 25 func (x BookmarkTreeNodeUnmodifiable) String() (string, bool) { 26 switch x { 27 case BookmarkTreeNodeUnmodifiable_MANAGED: 28 return "managed", true 29 default: 30 return "", false 31 } 32 } 33 34 type BookmarkTreeNode struct { 35 // Children is "BookmarkTreeNode.children" 36 // 37 // Optional 38 Children js.Array[BookmarkTreeNode] 39 // DateAdded is "BookmarkTreeNode.dateAdded" 40 // 41 // Optional 42 // 43 // NOTE: FFI_USE_DateAdded MUST be set to true to make this field effective. 44 DateAdded float64 45 // DateGroupModified is "BookmarkTreeNode.dateGroupModified" 46 // 47 // Optional 48 // 49 // NOTE: FFI_USE_DateGroupModified MUST be set to true to make this field effective. 50 DateGroupModified float64 51 // DateLastUsed is "BookmarkTreeNode.dateLastUsed" 52 // 53 // Optional 54 // 55 // NOTE: FFI_USE_DateLastUsed MUST be set to true to make this field effective. 56 DateLastUsed float64 57 // Id is "BookmarkTreeNode.id" 58 // 59 // Required 60 Id js.String 61 // Index is "BookmarkTreeNode.index" 62 // 63 // Optional 64 // 65 // NOTE: FFI_USE_Index MUST be set to true to make this field effective. 66 Index int64 67 // ParentId is "BookmarkTreeNode.parentId" 68 // 69 // Optional 70 ParentId js.String 71 // Title is "BookmarkTreeNode.title" 72 // 73 // Required 74 Title js.String 75 // Unmodifiable is "BookmarkTreeNode.unmodifiable" 76 // 77 // Optional 78 Unmodifiable BookmarkTreeNodeUnmodifiable 79 // Url is "BookmarkTreeNode.url" 80 // 81 // Optional 82 Url js.String 83 84 FFI_USE_DateAdded bool // for DateAdded. 85 FFI_USE_DateGroupModified bool // for DateGroupModified. 86 FFI_USE_DateLastUsed bool // for DateLastUsed. 87 FFI_USE_Index bool // for Index. 88 89 FFI_USE bool 90 } 91 92 // FromRef calls UpdateFrom and returns a BookmarkTreeNode with all fields set. 93 func (p BookmarkTreeNode) FromRef(ref js.Ref) BookmarkTreeNode { 94 p.UpdateFrom(ref) 95 return p 96 } 97 98 // New creates a new BookmarkTreeNode in the application heap. 99 func (p BookmarkTreeNode) New() js.Ref { 100 return bindings.BookmarkTreeNodeJSLoad( 101 js.Pointer(&p), js.True, 0, 102 ) 103 } 104 105 // UpdateFrom copies value of all fields of the heap object to p. 106 func (p *BookmarkTreeNode) UpdateFrom(ref js.Ref) { 107 bindings.BookmarkTreeNodeJSStore( 108 js.Pointer(p), ref, 109 ) 110 } 111 112 // Update writes all fields of the p to the heap object referenced by ref. 113 func (p *BookmarkTreeNode) Update(ref js.Ref) { 114 bindings.BookmarkTreeNodeJSLoad( 115 js.Pointer(p), js.False, ref, 116 ) 117 } 118 119 // FreeMembers frees fields with heap reference, if recursive is true 120 // free all heap references reachable from p. 121 func (p *BookmarkTreeNode) FreeMembers(recursive bool) { 122 js.Free( 123 p.Children.Ref(), 124 p.Id.Ref(), 125 p.ParentId.Ref(), 126 p.Title.Ref(), 127 p.Url.Ref(), 128 ) 129 p.Children = p.Children.FromRef(js.Undefined) 130 p.Id = p.Id.FromRef(js.Undefined) 131 p.ParentId = p.ParentId.FromRef(js.Undefined) 132 p.Title = p.Title.FromRef(js.Undefined) 133 p.Url = p.Url.FromRef(js.Undefined) 134 } 135 136 type CreateDetails struct { 137 // Index is "CreateDetails.index" 138 // 139 // Optional 140 // 141 // NOTE: FFI_USE_Index MUST be set to true to make this field effective. 142 Index int64 143 // ParentId is "CreateDetails.parentId" 144 // 145 // Optional 146 ParentId js.String 147 // Title is "CreateDetails.title" 148 // 149 // Optional 150 Title js.String 151 // Url is "CreateDetails.url" 152 // 153 // Optional 154 Url js.String 155 156 FFI_USE_Index bool // for Index. 157 158 FFI_USE bool 159 } 160 161 // FromRef calls UpdateFrom and returns a CreateDetails with all fields set. 162 func (p CreateDetails) FromRef(ref js.Ref) CreateDetails { 163 p.UpdateFrom(ref) 164 return p 165 } 166 167 // New creates a new CreateDetails in the application heap. 168 func (p CreateDetails) New() js.Ref { 169 return bindings.CreateDetailsJSLoad( 170 js.Pointer(&p), js.True, 0, 171 ) 172 } 173 174 // UpdateFrom copies value of all fields of the heap object to p. 175 func (p *CreateDetails) UpdateFrom(ref js.Ref) { 176 bindings.CreateDetailsJSStore( 177 js.Pointer(p), ref, 178 ) 179 } 180 181 // Update writes all fields of the p to the heap object referenced by ref. 182 func (p *CreateDetails) Update(ref js.Ref) { 183 bindings.CreateDetailsJSLoad( 184 js.Pointer(p), js.False, ref, 185 ) 186 } 187 188 // FreeMembers frees fields with heap reference, if recursive is true 189 // free all heap references reachable from p. 190 func (p *CreateDetails) FreeMembers(recursive bool) { 191 js.Free( 192 p.ParentId.Ref(), 193 p.Title.Ref(), 194 p.Url.Ref(), 195 ) 196 p.ParentId = p.ParentId.FromRef(js.Undefined) 197 p.Title = p.Title.FromRef(js.Undefined) 198 p.Url = p.Url.FromRef(js.Undefined) 199 } 200 201 // MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE returns the value of property "WEBEXT.bookmarks.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE". 202 // 203 // The returned bool will be false if there is no such property. 204 func MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE() (ret js.String, ok bool) { 205 ok = js.True == bindings.GetMAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE( 206 js.Pointer(&ret), 207 ) 208 209 return 210 } 211 212 // SetMAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE sets the value of property "WEBEXT.bookmarks.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE" to val. 213 // 214 // It returns false if the property cannot be set. 215 func SetMAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE(val js.String) bool { 216 return js.True == bindings.SetMAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE( 217 val.Ref()) 218 } 219 220 // MAX_WRITE_OPERATIONS_PER_HOUR returns the value of property "WEBEXT.bookmarks.MAX_WRITE_OPERATIONS_PER_HOUR". 221 // 222 // The returned bool will be false if there is no such property. 223 func MAX_WRITE_OPERATIONS_PER_HOUR() (ret js.String, ok bool) { 224 ok = js.True == bindings.GetMAX_WRITE_OPERATIONS_PER_HOUR( 225 js.Pointer(&ret), 226 ) 227 228 return 229 } 230 231 // SetMAX_WRITE_OPERATIONS_PER_HOUR sets the value of property "WEBEXT.bookmarks.MAX_WRITE_OPERATIONS_PER_HOUR" to val. 232 // 233 // It returns false if the property cannot be set. 234 func SetMAX_WRITE_OPERATIONS_PER_HOUR(val js.String) bool { 235 return js.True == bindings.SetMAX_WRITE_OPERATIONS_PER_HOUR( 236 val.Ref()) 237 } 238 239 type MoveArgDestination struct { 240 // Index is "MoveArgDestination.index" 241 // 242 // Optional 243 // 244 // NOTE: FFI_USE_Index MUST be set to true to make this field effective. 245 Index int64 246 // ParentId is "MoveArgDestination.parentId" 247 // 248 // Optional 249 ParentId js.String 250 251 FFI_USE_Index bool // for Index. 252 253 FFI_USE bool 254 } 255 256 // FromRef calls UpdateFrom and returns a MoveArgDestination with all fields set. 257 func (p MoveArgDestination) FromRef(ref js.Ref) MoveArgDestination { 258 p.UpdateFrom(ref) 259 return p 260 } 261 262 // New creates a new MoveArgDestination in the application heap. 263 func (p MoveArgDestination) New() js.Ref { 264 return bindings.MoveArgDestinationJSLoad( 265 js.Pointer(&p), js.True, 0, 266 ) 267 } 268 269 // UpdateFrom copies value of all fields of the heap object to p. 270 func (p *MoveArgDestination) UpdateFrom(ref js.Ref) { 271 bindings.MoveArgDestinationJSStore( 272 js.Pointer(p), ref, 273 ) 274 } 275 276 // Update writes all fields of the p to the heap object referenced by ref. 277 func (p *MoveArgDestination) Update(ref js.Ref) { 278 bindings.MoveArgDestinationJSLoad( 279 js.Pointer(p), js.False, ref, 280 ) 281 } 282 283 // FreeMembers frees fields with heap reference, if recursive is true 284 // free all heap references reachable from p. 285 func (p *MoveArgDestination) FreeMembers(recursive bool) { 286 js.Free( 287 p.ParentId.Ref(), 288 ) 289 p.ParentId = p.ParentId.FromRef(js.Undefined) 290 } 291 292 type OnChangedArgChangeInfo struct { 293 // Title is "OnChangedArgChangeInfo.title" 294 // 295 // Required 296 Title js.String 297 // Url is "OnChangedArgChangeInfo.url" 298 // 299 // Optional 300 Url js.String 301 302 FFI_USE bool 303 } 304 305 // FromRef calls UpdateFrom and returns a OnChangedArgChangeInfo with all fields set. 306 func (p OnChangedArgChangeInfo) FromRef(ref js.Ref) OnChangedArgChangeInfo { 307 p.UpdateFrom(ref) 308 return p 309 } 310 311 // New creates a new OnChangedArgChangeInfo in the application heap. 312 func (p OnChangedArgChangeInfo) New() js.Ref { 313 return bindings.OnChangedArgChangeInfoJSLoad( 314 js.Pointer(&p), js.True, 0, 315 ) 316 } 317 318 // UpdateFrom copies value of all fields of the heap object to p. 319 func (p *OnChangedArgChangeInfo) UpdateFrom(ref js.Ref) { 320 bindings.OnChangedArgChangeInfoJSStore( 321 js.Pointer(p), ref, 322 ) 323 } 324 325 // Update writes all fields of the p to the heap object referenced by ref. 326 func (p *OnChangedArgChangeInfo) Update(ref js.Ref) { 327 bindings.OnChangedArgChangeInfoJSLoad( 328 js.Pointer(p), js.False, ref, 329 ) 330 } 331 332 // FreeMembers frees fields with heap reference, if recursive is true 333 // free all heap references reachable from p. 334 func (p *OnChangedArgChangeInfo) FreeMembers(recursive bool) { 335 js.Free( 336 p.Title.Ref(), 337 p.Url.Ref(), 338 ) 339 p.Title = p.Title.FromRef(js.Undefined) 340 p.Url = p.Url.FromRef(js.Undefined) 341 } 342 343 type OnChildrenReorderedArgReorderInfo struct { 344 // ChildIds is "OnChildrenReorderedArgReorderInfo.childIds" 345 // 346 // Required 347 ChildIds js.Array[js.String] 348 349 FFI_USE bool 350 } 351 352 // FromRef calls UpdateFrom and returns a OnChildrenReorderedArgReorderInfo with all fields set. 353 func (p OnChildrenReorderedArgReorderInfo) FromRef(ref js.Ref) OnChildrenReorderedArgReorderInfo { 354 p.UpdateFrom(ref) 355 return p 356 } 357 358 // New creates a new OnChildrenReorderedArgReorderInfo in the application heap. 359 func (p OnChildrenReorderedArgReorderInfo) New() js.Ref { 360 return bindings.OnChildrenReorderedArgReorderInfoJSLoad( 361 js.Pointer(&p), js.True, 0, 362 ) 363 } 364 365 // UpdateFrom copies value of all fields of the heap object to p. 366 func (p *OnChildrenReorderedArgReorderInfo) UpdateFrom(ref js.Ref) { 367 bindings.OnChildrenReorderedArgReorderInfoJSStore( 368 js.Pointer(p), ref, 369 ) 370 } 371 372 // Update writes all fields of the p to the heap object referenced by ref. 373 func (p *OnChildrenReorderedArgReorderInfo) Update(ref js.Ref) { 374 bindings.OnChildrenReorderedArgReorderInfoJSLoad( 375 js.Pointer(p), js.False, ref, 376 ) 377 } 378 379 // FreeMembers frees fields with heap reference, if recursive is true 380 // free all heap references reachable from p. 381 func (p *OnChildrenReorderedArgReorderInfo) FreeMembers(recursive bool) { 382 js.Free( 383 p.ChildIds.Ref(), 384 ) 385 p.ChildIds = p.ChildIds.FromRef(js.Undefined) 386 } 387 388 type OnMovedArgMoveInfo struct { 389 // Index is "OnMovedArgMoveInfo.index" 390 // 391 // Required 392 Index int64 393 // OldIndex is "OnMovedArgMoveInfo.oldIndex" 394 // 395 // Required 396 OldIndex int64 397 // OldParentId is "OnMovedArgMoveInfo.oldParentId" 398 // 399 // Required 400 OldParentId js.String 401 // ParentId is "OnMovedArgMoveInfo.parentId" 402 // 403 // Required 404 ParentId js.String 405 406 FFI_USE bool 407 } 408 409 // FromRef calls UpdateFrom and returns a OnMovedArgMoveInfo with all fields set. 410 func (p OnMovedArgMoveInfo) FromRef(ref js.Ref) OnMovedArgMoveInfo { 411 p.UpdateFrom(ref) 412 return p 413 } 414 415 // New creates a new OnMovedArgMoveInfo in the application heap. 416 func (p OnMovedArgMoveInfo) New() js.Ref { 417 return bindings.OnMovedArgMoveInfoJSLoad( 418 js.Pointer(&p), js.True, 0, 419 ) 420 } 421 422 // UpdateFrom copies value of all fields of the heap object to p. 423 func (p *OnMovedArgMoveInfo) UpdateFrom(ref js.Ref) { 424 bindings.OnMovedArgMoveInfoJSStore( 425 js.Pointer(p), ref, 426 ) 427 } 428 429 // Update writes all fields of the p to the heap object referenced by ref. 430 func (p *OnMovedArgMoveInfo) Update(ref js.Ref) { 431 bindings.OnMovedArgMoveInfoJSLoad( 432 js.Pointer(p), js.False, ref, 433 ) 434 } 435 436 // FreeMembers frees fields with heap reference, if recursive is true 437 // free all heap references reachable from p. 438 func (p *OnMovedArgMoveInfo) FreeMembers(recursive bool) { 439 js.Free( 440 p.OldParentId.Ref(), 441 p.ParentId.Ref(), 442 ) 443 p.OldParentId = p.OldParentId.FromRef(js.Undefined) 444 p.ParentId = p.ParentId.FromRef(js.Undefined) 445 } 446 447 type OnRemovedArgRemoveInfo struct { 448 // Index is "OnRemovedArgRemoveInfo.index" 449 // 450 // Required 451 Index int64 452 // Node is "OnRemovedArgRemoveInfo.node" 453 // 454 // Required 455 // 456 // NOTE: Node.FFI_USE MUST be set to true to get Node used. 457 Node BookmarkTreeNode 458 // ParentId is "OnRemovedArgRemoveInfo.parentId" 459 // 460 // Required 461 ParentId js.String 462 463 FFI_USE bool 464 } 465 466 // FromRef calls UpdateFrom and returns a OnRemovedArgRemoveInfo with all fields set. 467 func (p OnRemovedArgRemoveInfo) FromRef(ref js.Ref) OnRemovedArgRemoveInfo { 468 p.UpdateFrom(ref) 469 return p 470 } 471 472 // New creates a new OnRemovedArgRemoveInfo in the application heap. 473 func (p OnRemovedArgRemoveInfo) New() js.Ref { 474 return bindings.OnRemovedArgRemoveInfoJSLoad( 475 js.Pointer(&p), js.True, 0, 476 ) 477 } 478 479 // UpdateFrom copies value of all fields of the heap object to p. 480 func (p *OnRemovedArgRemoveInfo) UpdateFrom(ref js.Ref) { 481 bindings.OnRemovedArgRemoveInfoJSStore( 482 js.Pointer(p), ref, 483 ) 484 } 485 486 // Update writes all fields of the p to the heap object referenced by ref. 487 func (p *OnRemovedArgRemoveInfo) Update(ref js.Ref) { 488 bindings.OnRemovedArgRemoveInfoJSLoad( 489 js.Pointer(p), js.False, ref, 490 ) 491 } 492 493 // FreeMembers frees fields with heap reference, if recursive is true 494 // free all heap references reachable from p. 495 func (p *OnRemovedArgRemoveInfo) FreeMembers(recursive bool) { 496 js.Free( 497 p.ParentId.Ref(), 498 ) 499 p.ParentId = p.ParentId.FromRef(js.Undefined) 500 if recursive { 501 p.Node.FreeMembers(true) 502 } 503 } 504 505 type SearchArgQueryChoice1 struct { 506 // Query is "SearchArgQueryChoice1.query" 507 // 508 // Optional 509 Query js.String 510 // Title is "SearchArgQueryChoice1.title" 511 // 512 // Optional 513 Title js.String 514 // Url is "SearchArgQueryChoice1.url" 515 // 516 // Optional 517 Url js.String 518 519 FFI_USE bool 520 } 521 522 // FromRef calls UpdateFrom and returns a SearchArgQueryChoice1 with all fields set. 523 func (p SearchArgQueryChoice1) FromRef(ref js.Ref) SearchArgQueryChoice1 { 524 p.UpdateFrom(ref) 525 return p 526 } 527 528 // New creates a new SearchArgQueryChoice1 in the application heap. 529 func (p SearchArgQueryChoice1) New() js.Ref { 530 return bindings.SearchArgQueryChoice1JSLoad( 531 js.Pointer(&p), js.True, 0, 532 ) 533 } 534 535 // UpdateFrom copies value of all fields of the heap object to p. 536 func (p *SearchArgQueryChoice1) UpdateFrom(ref js.Ref) { 537 bindings.SearchArgQueryChoice1JSStore( 538 js.Pointer(p), ref, 539 ) 540 } 541 542 // Update writes all fields of the p to the heap object referenced by ref. 543 func (p *SearchArgQueryChoice1) Update(ref js.Ref) { 544 bindings.SearchArgQueryChoice1JSLoad( 545 js.Pointer(p), js.False, ref, 546 ) 547 } 548 549 // FreeMembers frees fields with heap reference, if recursive is true 550 // free all heap references reachable from p. 551 func (p *SearchArgQueryChoice1) FreeMembers(recursive bool) { 552 js.Free( 553 p.Query.Ref(), 554 p.Title.Ref(), 555 p.Url.Ref(), 556 ) 557 p.Query = p.Query.FromRef(js.Undefined) 558 p.Title = p.Title.FromRef(js.Undefined) 559 p.Url = p.Url.FromRef(js.Undefined) 560 } 561 562 type UpdateArgChanges struct { 563 // Title is "UpdateArgChanges.title" 564 // 565 // Optional 566 Title js.String 567 // Url is "UpdateArgChanges.url" 568 // 569 // Optional 570 Url js.String 571 572 FFI_USE bool 573 } 574 575 // FromRef calls UpdateFrom and returns a UpdateArgChanges with all fields set. 576 func (p UpdateArgChanges) FromRef(ref js.Ref) UpdateArgChanges { 577 p.UpdateFrom(ref) 578 return p 579 } 580 581 // New creates a new UpdateArgChanges in the application heap. 582 func (p UpdateArgChanges) New() js.Ref { 583 return bindings.UpdateArgChangesJSLoad( 584 js.Pointer(&p), js.True, 0, 585 ) 586 } 587 588 // UpdateFrom copies value of all fields of the heap object to p. 589 func (p *UpdateArgChanges) UpdateFrom(ref js.Ref) { 590 bindings.UpdateArgChangesJSStore( 591 js.Pointer(p), ref, 592 ) 593 } 594 595 // Update writes all fields of the p to the heap object referenced by ref. 596 func (p *UpdateArgChanges) Update(ref js.Ref) { 597 bindings.UpdateArgChangesJSLoad( 598 js.Pointer(p), js.False, ref, 599 ) 600 } 601 602 // FreeMembers frees fields with heap reference, if recursive is true 603 // free all heap references reachable from p. 604 func (p *UpdateArgChanges) FreeMembers(recursive bool) { 605 js.Free( 606 p.Title.Ref(), 607 p.Url.Ref(), 608 ) 609 p.Title = p.Title.FromRef(js.Undefined) 610 p.Url = p.Url.FromRef(js.Undefined) 611 } 612 613 // HasFuncCreate returns true if the function "WEBEXT.bookmarks.create" exists. 614 func HasFuncCreate() bool { 615 return js.True == bindings.HasFuncCreate() 616 } 617 618 // FuncCreate returns the function "WEBEXT.bookmarks.create". 619 func FuncCreate() (fn js.Func[func(bookmark CreateDetails) js.Promise[BookmarkTreeNode]]) { 620 bindings.FuncCreate( 621 js.Pointer(&fn), 622 ) 623 return 624 } 625 626 // Create calls the function "WEBEXT.bookmarks.create" directly. 627 func Create(bookmark CreateDetails) (ret js.Promise[BookmarkTreeNode]) { 628 bindings.CallCreate( 629 js.Pointer(&ret), 630 js.Pointer(&bookmark), 631 ) 632 633 return 634 } 635 636 // TryCreate calls the function "WEBEXT.bookmarks.create" 637 // in a try/catch block and returns (_, err, ok = false) when it went through 638 // the catch clause. 639 func TryCreate(bookmark CreateDetails) (ret js.Promise[BookmarkTreeNode], exception js.Any, ok bool) { 640 ok = js.True == bindings.TryCreate( 641 js.Pointer(&ret), js.Pointer(&exception), 642 js.Pointer(&bookmark), 643 ) 644 645 return 646 } 647 648 type OneOf_String_ArrayString struct { 649 ref js.Ref 650 } 651 652 func (x OneOf_String_ArrayString) Ref() js.Ref { 653 return x.ref 654 } 655 656 func (x OneOf_String_ArrayString) Free() { 657 x.ref.Free() 658 } 659 660 func (x OneOf_String_ArrayString) FromRef(ref js.Ref) OneOf_String_ArrayString { 661 return OneOf_String_ArrayString{ 662 ref: ref, 663 } 664 } 665 666 func (x OneOf_String_ArrayString) String() js.String { 667 return js.String{}.FromRef(x.ref) 668 } 669 670 func (x OneOf_String_ArrayString) ArrayString() js.Array[js.String] { 671 return js.Array[js.String]{}.FromRef(x.ref) 672 } 673 674 // HasFuncGet returns true if the function "WEBEXT.bookmarks.get" exists. 675 func HasFuncGet() bool { 676 return js.True == bindings.HasFuncGet() 677 } 678 679 // FuncGet returns the function "WEBEXT.bookmarks.get". 680 func FuncGet() (fn js.Func[func(idOrIdList OneOf_String_ArrayString) js.Promise[js.Array[BookmarkTreeNode]]]) { 681 bindings.FuncGet( 682 js.Pointer(&fn), 683 ) 684 return 685 } 686 687 // Get calls the function "WEBEXT.bookmarks.get" directly. 688 func Get(idOrIdList OneOf_String_ArrayString) (ret js.Promise[js.Array[BookmarkTreeNode]]) { 689 bindings.CallGet( 690 js.Pointer(&ret), 691 idOrIdList.Ref(), 692 ) 693 694 return 695 } 696 697 // TryGet calls the function "WEBEXT.bookmarks.get" 698 // in a try/catch block and returns (_, err, ok = false) when it went through 699 // the catch clause. 700 func TryGet(idOrIdList OneOf_String_ArrayString) (ret js.Promise[js.Array[BookmarkTreeNode]], exception js.Any, ok bool) { 701 ok = js.True == bindings.TryGet( 702 js.Pointer(&ret), js.Pointer(&exception), 703 idOrIdList.Ref(), 704 ) 705 706 return 707 } 708 709 // HasFuncGetChildren returns true if the function "WEBEXT.bookmarks.getChildren" exists. 710 func HasFuncGetChildren() bool { 711 return js.True == bindings.HasFuncGetChildren() 712 } 713 714 // FuncGetChildren returns the function "WEBEXT.bookmarks.getChildren". 715 func FuncGetChildren() (fn js.Func[func(id js.String) js.Promise[js.Array[BookmarkTreeNode]]]) { 716 bindings.FuncGetChildren( 717 js.Pointer(&fn), 718 ) 719 return 720 } 721 722 // GetChildren calls the function "WEBEXT.bookmarks.getChildren" directly. 723 func GetChildren(id js.String) (ret js.Promise[js.Array[BookmarkTreeNode]]) { 724 bindings.CallGetChildren( 725 js.Pointer(&ret), 726 id.Ref(), 727 ) 728 729 return 730 } 731 732 // TryGetChildren calls the function "WEBEXT.bookmarks.getChildren" 733 // in a try/catch block and returns (_, err, ok = false) when it went through 734 // the catch clause. 735 func TryGetChildren(id js.String) (ret js.Promise[js.Array[BookmarkTreeNode]], exception js.Any, ok bool) { 736 ok = js.True == bindings.TryGetChildren( 737 js.Pointer(&ret), js.Pointer(&exception), 738 id.Ref(), 739 ) 740 741 return 742 } 743 744 // HasFuncGetRecent returns true if the function "WEBEXT.bookmarks.getRecent" exists. 745 func HasFuncGetRecent() bool { 746 return js.True == bindings.HasFuncGetRecent() 747 } 748 749 // FuncGetRecent returns the function "WEBEXT.bookmarks.getRecent". 750 func FuncGetRecent() (fn js.Func[func(numberOfItems int64) js.Promise[js.Array[BookmarkTreeNode]]]) { 751 bindings.FuncGetRecent( 752 js.Pointer(&fn), 753 ) 754 return 755 } 756 757 // GetRecent calls the function "WEBEXT.bookmarks.getRecent" directly. 758 func GetRecent(numberOfItems int64) (ret js.Promise[js.Array[BookmarkTreeNode]]) { 759 bindings.CallGetRecent( 760 js.Pointer(&ret), 761 float64(numberOfItems), 762 ) 763 764 return 765 } 766 767 // TryGetRecent calls the function "WEBEXT.bookmarks.getRecent" 768 // in a try/catch block and returns (_, err, ok = false) when it went through 769 // the catch clause. 770 func TryGetRecent(numberOfItems int64) (ret js.Promise[js.Array[BookmarkTreeNode]], exception js.Any, ok bool) { 771 ok = js.True == bindings.TryGetRecent( 772 js.Pointer(&ret), js.Pointer(&exception), 773 float64(numberOfItems), 774 ) 775 776 return 777 } 778 779 // HasFuncGetSubTree returns true if the function "WEBEXT.bookmarks.getSubTree" exists. 780 func HasFuncGetSubTree() bool { 781 return js.True == bindings.HasFuncGetSubTree() 782 } 783 784 // FuncGetSubTree returns the function "WEBEXT.bookmarks.getSubTree". 785 func FuncGetSubTree() (fn js.Func[func(id js.String) js.Promise[js.Array[BookmarkTreeNode]]]) { 786 bindings.FuncGetSubTree( 787 js.Pointer(&fn), 788 ) 789 return 790 } 791 792 // GetSubTree calls the function "WEBEXT.bookmarks.getSubTree" directly. 793 func GetSubTree(id js.String) (ret js.Promise[js.Array[BookmarkTreeNode]]) { 794 bindings.CallGetSubTree( 795 js.Pointer(&ret), 796 id.Ref(), 797 ) 798 799 return 800 } 801 802 // TryGetSubTree calls the function "WEBEXT.bookmarks.getSubTree" 803 // in a try/catch block and returns (_, err, ok = false) when it went through 804 // the catch clause. 805 func TryGetSubTree(id js.String) (ret js.Promise[js.Array[BookmarkTreeNode]], exception js.Any, ok bool) { 806 ok = js.True == bindings.TryGetSubTree( 807 js.Pointer(&ret), js.Pointer(&exception), 808 id.Ref(), 809 ) 810 811 return 812 } 813 814 // HasFuncGetTree returns true if the function "WEBEXT.bookmarks.getTree" exists. 815 func HasFuncGetTree() bool { 816 return js.True == bindings.HasFuncGetTree() 817 } 818 819 // FuncGetTree returns the function "WEBEXT.bookmarks.getTree". 820 func FuncGetTree() (fn js.Func[func() js.Promise[js.Array[BookmarkTreeNode]]]) { 821 bindings.FuncGetTree( 822 js.Pointer(&fn), 823 ) 824 return 825 } 826 827 // GetTree calls the function "WEBEXT.bookmarks.getTree" directly. 828 func GetTree() (ret js.Promise[js.Array[BookmarkTreeNode]]) { 829 bindings.CallGetTree( 830 js.Pointer(&ret), 831 ) 832 833 return 834 } 835 836 // TryGetTree calls the function "WEBEXT.bookmarks.getTree" 837 // in a try/catch block and returns (_, err, ok = false) when it went through 838 // the catch clause. 839 func TryGetTree() (ret js.Promise[js.Array[BookmarkTreeNode]], exception js.Any, ok bool) { 840 ok = js.True == bindings.TryGetTree( 841 js.Pointer(&ret), js.Pointer(&exception), 842 ) 843 844 return 845 } 846 847 // HasFuncMove returns true if the function "WEBEXT.bookmarks.move" exists. 848 func HasFuncMove() bool { 849 return js.True == bindings.HasFuncMove() 850 } 851 852 // FuncMove returns the function "WEBEXT.bookmarks.move". 853 func FuncMove() (fn js.Func[func(id js.String, destination MoveArgDestination) js.Promise[BookmarkTreeNode]]) { 854 bindings.FuncMove( 855 js.Pointer(&fn), 856 ) 857 return 858 } 859 860 // Move calls the function "WEBEXT.bookmarks.move" directly. 861 func Move(id js.String, destination MoveArgDestination) (ret js.Promise[BookmarkTreeNode]) { 862 bindings.CallMove( 863 js.Pointer(&ret), 864 id.Ref(), 865 js.Pointer(&destination), 866 ) 867 868 return 869 } 870 871 // TryMove calls the function "WEBEXT.bookmarks.move" 872 // in a try/catch block and returns (_, err, ok = false) when it went through 873 // the catch clause. 874 func TryMove(id js.String, destination MoveArgDestination) (ret js.Promise[BookmarkTreeNode], exception js.Any, ok bool) { 875 ok = js.True == bindings.TryMove( 876 js.Pointer(&ret), js.Pointer(&exception), 877 id.Ref(), 878 js.Pointer(&destination), 879 ) 880 881 return 882 } 883 884 type OnChangedEventCallbackFunc func(this js.Ref, id js.String, changeInfo *OnChangedArgChangeInfo) js.Ref 885 886 func (fn OnChangedEventCallbackFunc) Register() js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)] { 887 return js.RegisterCallback[func(id js.String, changeInfo *OnChangedArgChangeInfo)]( 888 fn, abi.FuncPCABIInternal(fn), 889 ) 890 } 891 892 func (fn OnChangedEventCallbackFunc) DispatchCallback( 893 targetPC uintptr, ctx *js.CallbackContext, 894 ) { 895 args := ctx.Args() 896 if len(args) != 2+1 /* js this */ || 897 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 898 js.ThrowInvalidCallbackInvocation() 899 } 900 var arg1 OnChangedArgChangeInfo 901 arg1.UpdateFrom(args[1+1]) 902 defer arg1.FreeMembers(true) 903 904 if ctx.Return(fn( 905 args[0], 906 907 js.String{}.FromRef(args[0+1]), 908 mark.NoEscape(&arg1), 909 )) { 910 return 911 } 912 913 js.ThrowCallbackValueNotReturned() 914 } 915 916 type OnChangedEventCallback[T any] struct { 917 Fn func(arg T, this js.Ref, id js.String, changeInfo *OnChangedArgChangeInfo) js.Ref 918 Arg T 919 } 920 921 func (cb *OnChangedEventCallback[T]) Register() js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)] { 922 return js.RegisterCallback[func(id js.String, changeInfo *OnChangedArgChangeInfo)]( 923 cb, abi.FuncPCABIInternal(cb.Fn), 924 ) 925 } 926 927 func (cb *OnChangedEventCallback[T]) DispatchCallback( 928 targetPC uintptr, ctx *js.CallbackContext, 929 ) { 930 args := ctx.Args() 931 if len(args) != 2+1 /* js this */ || 932 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 933 js.ThrowInvalidCallbackInvocation() 934 } 935 var arg1 OnChangedArgChangeInfo 936 arg1.UpdateFrom(args[1+1]) 937 defer arg1.FreeMembers(true) 938 939 if ctx.Return(cb.Fn( 940 cb.Arg, 941 args[0], 942 943 js.String{}.FromRef(args[0+1]), 944 mark.NoEscape(&arg1), 945 )) { 946 return 947 } 948 949 js.ThrowCallbackValueNotReturned() 950 } 951 952 // HasFuncOnChanged returns true if the function "WEBEXT.bookmarks.onChanged.addListener" exists. 953 func HasFuncOnChanged() bool { 954 return js.True == bindings.HasFuncOnChanged() 955 } 956 957 // FuncOnChanged returns the function "WEBEXT.bookmarks.onChanged.addListener". 958 func FuncOnChanged() (fn js.Func[func(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)])]) { 959 bindings.FuncOnChanged( 960 js.Pointer(&fn), 961 ) 962 return 963 } 964 965 // OnChanged calls the function "WEBEXT.bookmarks.onChanged.addListener" directly. 966 func OnChanged(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)]) (ret js.Void) { 967 bindings.CallOnChanged( 968 js.Pointer(&ret), 969 callback.Ref(), 970 ) 971 972 return 973 } 974 975 // TryOnChanged calls the function "WEBEXT.bookmarks.onChanged.addListener" 976 // in a try/catch block and returns (_, err, ok = false) when it went through 977 // the catch clause. 978 func TryOnChanged(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)]) (ret js.Void, exception js.Any, ok bool) { 979 ok = js.True == bindings.TryOnChanged( 980 js.Pointer(&ret), js.Pointer(&exception), 981 callback.Ref(), 982 ) 983 984 return 985 } 986 987 // HasFuncOffChanged returns true if the function "WEBEXT.bookmarks.onChanged.removeListener" exists. 988 func HasFuncOffChanged() bool { 989 return js.True == bindings.HasFuncOffChanged() 990 } 991 992 // FuncOffChanged returns the function "WEBEXT.bookmarks.onChanged.removeListener". 993 func FuncOffChanged() (fn js.Func[func(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)])]) { 994 bindings.FuncOffChanged( 995 js.Pointer(&fn), 996 ) 997 return 998 } 999 1000 // OffChanged calls the function "WEBEXT.bookmarks.onChanged.removeListener" directly. 1001 func OffChanged(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)]) (ret js.Void) { 1002 bindings.CallOffChanged( 1003 js.Pointer(&ret), 1004 callback.Ref(), 1005 ) 1006 1007 return 1008 } 1009 1010 // TryOffChanged calls the function "WEBEXT.bookmarks.onChanged.removeListener" 1011 // in a try/catch block and returns (_, err, ok = false) when it went through 1012 // the catch clause. 1013 func TryOffChanged(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)]) (ret js.Void, exception js.Any, ok bool) { 1014 ok = js.True == bindings.TryOffChanged( 1015 js.Pointer(&ret), js.Pointer(&exception), 1016 callback.Ref(), 1017 ) 1018 1019 return 1020 } 1021 1022 // HasFuncHasOnChanged returns true if the function "WEBEXT.bookmarks.onChanged.hasListener" exists. 1023 func HasFuncHasOnChanged() bool { 1024 return js.True == bindings.HasFuncHasOnChanged() 1025 } 1026 1027 // FuncHasOnChanged returns the function "WEBEXT.bookmarks.onChanged.hasListener". 1028 func FuncHasOnChanged() (fn js.Func[func(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)]) bool]) { 1029 bindings.FuncHasOnChanged( 1030 js.Pointer(&fn), 1031 ) 1032 return 1033 } 1034 1035 // HasOnChanged calls the function "WEBEXT.bookmarks.onChanged.hasListener" directly. 1036 func HasOnChanged(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)]) (ret bool) { 1037 bindings.CallHasOnChanged( 1038 js.Pointer(&ret), 1039 callback.Ref(), 1040 ) 1041 1042 return 1043 } 1044 1045 // TryHasOnChanged calls the function "WEBEXT.bookmarks.onChanged.hasListener" 1046 // in a try/catch block and returns (_, err, ok = false) when it went through 1047 // the catch clause. 1048 func TryHasOnChanged(callback js.Func[func(id js.String, changeInfo *OnChangedArgChangeInfo)]) (ret bool, exception js.Any, ok bool) { 1049 ok = js.True == bindings.TryHasOnChanged( 1050 js.Pointer(&ret), js.Pointer(&exception), 1051 callback.Ref(), 1052 ) 1053 1054 return 1055 } 1056 1057 type OnChildrenReorderedEventCallbackFunc func(this js.Ref, id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo) js.Ref 1058 1059 func (fn OnChildrenReorderedEventCallbackFunc) Register() js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)] { 1060 return js.RegisterCallback[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]( 1061 fn, abi.FuncPCABIInternal(fn), 1062 ) 1063 } 1064 1065 func (fn OnChildrenReorderedEventCallbackFunc) DispatchCallback( 1066 targetPC uintptr, ctx *js.CallbackContext, 1067 ) { 1068 args := ctx.Args() 1069 if len(args) != 2+1 /* js this */ || 1070 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1071 js.ThrowInvalidCallbackInvocation() 1072 } 1073 var arg1 OnChildrenReorderedArgReorderInfo 1074 arg1.UpdateFrom(args[1+1]) 1075 defer arg1.FreeMembers(true) 1076 1077 if ctx.Return(fn( 1078 args[0], 1079 1080 js.String{}.FromRef(args[0+1]), 1081 mark.NoEscape(&arg1), 1082 )) { 1083 return 1084 } 1085 1086 js.ThrowCallbackValueNotReturned() 1087 } 1088 1089 type OnChildrenReorderedEventCallback[T any] struct { 1090 Fn func(arg T, this js.Ref, id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo) js.Ref 1091 Arg T 1092 } 1093 1094 func (cb *OnChildrenReorderedEventCallback[T]) Register() js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)] { 1095 return js.RegisterCallback[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]( 1096 cb, abi.FuncPCABIInternal(cb.Fn), 1097 ) 1098 } 1099 1100 func (cb *OnChildrenReorderedEventCallback[T]) DispatchCallback( 1101 targetPC uintptr, ctx *js.CallbackContext, 1102 ) { 1103 args := ctx.Args() 1104 if len(args) != 2+1 /* js this */ || 1105 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1106 js.ThrowInvalidCallbackInvocation() 1107 } 1108 var arg1 OnChildrenReorderedArgReorderInfo 1109 arg1.UpdateFrom(args[1+1]) 1110 defer arg1.FreeMembers(true) 1111 1112 if ctx.Return(cb.Fn( 1113 cb.Arg, 1114 args[0], 1115 1116 js.String{}.FromRef(args[0+1]), 1117 mark.NoEscape(&arg1), 1118 )) { 1119 return 1120 } 1121 1122 js.ThrowCallbackValueNotReturned() 1123 } 1124 1125 // HasFuncOnChildrenReordered returns true if the function "WEBEXT.bookmarks.onChildrenReordered.addListener" exists. 1126 func HasFuncOnChildrenReordered() bool { 1127 return js.True == bindings.HasFuncOnChildrenReordered() 1128 } 1129 1130 // FuncOnChildrenReordered returns the function "WEBEXT.bookmarks.onChildrenReordered.addListener". 1131 func FuncOnChildrenReordered() (fn js.Func[func(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)])]) { 1132 bindings.FuncOnChildrenReordered( 1133 js.Pointer(&fn), 1134 ) 1135 return 1136 } 1137 1138 // OnChildrenReordered calls the function "WEBEXT.bookmarks.onChildrenReordered.addListener" directly. 1139 func OnChildrenReordered(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]) (ret js.Void) { 1140 bindings.CallOnChildrenReordered( 1141 js.Pointer(&ret), 1142 callback.Ref(), 1143 ) 1144 1145 return 1146 } 1147 1148 // TryOnChildrenReordered calls the function "WEBEXT.bookmarks.onChildrenReordered.addListener" 1149 // in a try/catch block and returns (_, err, ok = false) when it went through 1150 // the catch clause. 1151 func TryOnChildrenReordered(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]) (ret js.Void, exception js.Any, ok bool) { 1152 ok = js.True == bindings.TryOnChildrenReordered( 1153 js.Pointer(&ret), js.Pointer(&exception), 1154 callback.Ref(), 1155 ) 1156 1157 return 1158 } 1159 1160 // HasFuncOffChildrenReordered returns true if the function "WEBEXT.bookmarks.onChildrenReordered.removeListener" exists. 1161 func HasFuncOffChildrenReordered() bool { 1162 return js.True == bindings.HasFuncOffChildrenReordered() 1163 } 1164 1165 // FuncOffChildrenReordered returns the function "WEBEXT.bookmarks.onChildrenReordered.removeListener". 1166 func FuncOffChildrenReordered() (fn js.Func[func(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)])]) { 1167 bindings.FuncOffChildrenReordered( 1168 js.Pointer(&fn), 1169 ) 1170 return 1171 } 1172 1173 // OffChildrenReordered calls the function "WEBEXT.bookmarks.onChildrenReordered.removeListener" directly. 1174 func OffChildrenReordered(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]) (ret js.Void) { 1175 bindings.CallOffChildrenReordered( 1176 js.Pointer(&ret), 1177 callback.Ref(), 1178 ) 1179 1180 return 1181 } 1182 1183 // TryOffChildrenReordered calls the function "WEBEXT.bookmarks.onChildrenReordered.removeListener" 1184 // in a try/catch block and returns (_, err, ok = false) when it went through 1185 // the catch clause. 1186 func TryOffChildrenReordered(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]) (ret js.Void, exception js.Any, ok bool) { 1187 ok = js.True == bindings.TryOffChildrenReordered( 1188 js.Pointer(&ret), js.Pointer(&exception), 1189 callback.Ref(), 1190 ) 1191 1192 return 1193 } 1194 1195 // HasFuncHasOnChildrenReordered returns true if the function "WEBEXT.bookmarks.onChildrenReordered.hasListener" exists. 1196 func HasFuncHasOnChildrenReordered() bool { 1197 return js.True == bindings.HasFuncHasOnChildrenReordered() 1198 } 1199 1200 // FuncHasOnChildrenReordered returns the function "WEBEXT.bookmarks.onChildrenReordered.hasListener". 1201 func FuncHasOnChildrenReordered() (fn js.Func[func(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]) bool]) { 1202 bindings.FuncHasOnChildrenReordered( 1203 js.Pointer(&fn), 1204 ) 1205 return 1206 } 1207 1208 // HasOnChildrenReordered calls the function "WEBEXT.bookmarks.onChildrenReordered.hasListener" directly. 1209 func HasOnChildrenReordered(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]) (ret bool) { 1210 bindings.CallHasOnChildrenReordered( 1211 js.Pointer(&ret), 1212 callback.Ref(), 1213 ) 1214 1215 return 1216 } 1217 1218 // TryHasOnChildrenReordered calls the function "WEBEXT.bookmarks.onChildrenReordered.hasListener" 1219 // in a try/catch block and returns (_, err, ok = false) when it went through 1220 // the catch clause. 1221 func TryHasOnChildrenReordered(callback js.Func[func(id js.String, reorderInfo *OnChildrenReorderedArgReorderInfo)]) (ret bool, exception js.Any, ok bool) { 1222 ok = js.True == bindings.TryHasOnChildrenReordered( 1223 js.Pointer(&ret), js.Pointer(&exception), 1224 callback.Ref(), 1225 ) 1226 1227 return 1228 } 1229 1230 type OnCreatedEventCallbackFunc func(this js.Ref, id js.String, bookmark *BookmarkTreeNode) js.Ref 1231 1232 func (fn OnCreatedEventCallbackFunc) Register() js.Func[func(id js.String, bookmark *BookmarkTreeNode)] { 1233 return js.RegisterCallback[func(id js.String, bookmark *BookmarkTreeNode)]( 1234 fn, abi.FuncPCABIInternal(fn), 1235 ) 1236 } 1237 1238 func (fn OnCreatedEventCallbackFunc) DispatchCallback( 1239 targetPC uintptr, ctx *js.CallbackContext, 1240 ) { 1241 args := ctx.Args() 1242 if len(args) != 2+1 /* js this */ || 1243 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1244 js.ThrowInvalidCallbackInvocation() 1245 } 1246 var arg1 BookmarkTreeNode 1247 arg1.UpdateFrom(args[1+1]) 1248 defer arg1.FreeMembers(true) 1249 1250 if ctx.Return(fn( 1251 args[0], 1252 1253 js.String{}.FromRef(args[0+1]), 1254 mark.NoEscape(&arg1), 1255 )) { 1256 return 1257 } 1258 1259 js.ThrowCallbackValueNotReturned() 1260 } 1261 1262 type OnCreatedEventCallback[T any] struct { 1263 Fn func(arg T, this js.Ref, id js.String, bookmark *BookmarkTreeNode) js.Ref 1264 Arg T 1265 } 1266 1267 func (cb *OnCreatedEventCallback[T]) Register() js.Func[func(id js.String, bookmark *BookmarkTreeNode)] { 1268 return js.RegisterCallback[func(id js.String, bookmark *BookmarkTreeNode)]( 1269 cb, abi.FuncPCABIInternal(cb.Fn), 1270 ) 1271 } 1272 1273 func (cb *OnCreatedEventCallback[T]) DispatchCallback( 1274 targetPC uintptr, ctx *js.CallbackContext, 1275 ) { 1276 args := ctx.Args() 1277 if len(args) != 2+1 /* js this */ || 1278 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1279 js.ThrowInvalidCallbackInvocation() 1280 } 1281 var arg1 BookmarkTreeNode 1282 arg1.UpdateFrom(args[1+1]) 1283 defer arg1.FreeMembers(true) 1284 1285 if ctx.Return(cb.Fn( 1286 cb.Arg, 1287 args[0], 1288 1289 js.String{}.FromRef(args[0+1]), 1290 mark.NoEscape(&arg1), 1291 )) { 1292 return 1293 } 1294 1295 js.ThrowCallbackValueNotReturned() 1296 } 1297 1298 // HasFuncOnCreated returns true if the function "WEBEXT.bookmarks.onCreated.addListener" exists. 1299 func HasFuncOnCreated() bool { 1300 return js.True == bindings.HasFuncOnCreated() 1301 } 1302 1303 // FuncOnCreated returns the function "WEBEXT.bookmarks.onCreated.addListener". 1304 func FuncOnCreated() (fn js.Func[func(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)])]) { 1305 bindings.FuncOnCreated( 1306 js.Pointer(&fn), 1307 ) 1308 return 1309 } 1310 1311 // OnCreated calls the function "WEBEXT.bookmarks.onCreated.addListener" directly. 1312 func OnCreated(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)]) (ret js.Void) { 1313 bindings.CallOnCreated( 1314 js.Pointer(&ret), 1315 callback.Ref(), 1316 ) 1317 1318 return 1319 } 1320 1321 // TryOnCreated calls the function "WEBEXT.bookmarks.onCreated.addListener" 1322 // in a try/catch block and returns (_, err, ok = false) when it went through 1323 // the catch clause. 1324 func TryOnCreated(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)]) (ret js.Void, exception js.Any, ok bool) { 1325 ok = js.True == bindings.TryOnCreated( 1326 js.Pointer(&ret), js.Pointer(&exception), 1327 callback.Ref(), 1328 ) 1329 1330 return 1331 } 1332 1333 // HasFuncOffCreated returns true if the function "WEBEXT.bookmarks.onCreated.removeListener" exists. 1334 func HasFuncOffCreated() bool { 1335 return js.True == bindings.HasFuncOffCreated() 1336 } 1337 1338 // FuncOffCreated returns the function "WEBEXT.bookmarks.onCreated.removeListener". 1339 func FuncOffCreated() (fn js.Func[func(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)])]) { 1340 bindings.FuncOffCreated( 1341 js.Pointer(&fn), 1342 ) 1343 return 1344 } 1345 1346 // OffCreated calls the function "WEBEXT.bookmarks.onCreated.removeListener" directly. 1347 func OffCreated(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)]) (ret js.Void) { 1348 bindings.CallOffCreated( 1349 js.Pointer(&ret), 1350 callback.Ref(), 1351 ) 1352 1353 return 1354 } 1355 1356 // TryOffCreated calls the function "WEBEXT.bookmarks.onCreated.removeListener" 1357 // in a try/catch block and returns (_, err, ok = false) when it went through 1358 // the catch clause. 1359 func TryOffCreated(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)]) (ret js.Void, exception js.Any, ok bool) { 1360 ok = js.True == bindings.TryOffCreated( 1361 js.Pointer(&ret), js.Pointer(&exception), 1362 callback.Ref(), 1363 ) 1364 1365 return 1366 } 1367 1368 // HasFuncHasOnCreated returns true if the function "WEBEXT.bookmarks.onCreated.hasListener" exists. 1369 func HasFuncHasOnCreated() bool { 1370 return js.True == bindings.HasFuncHasOnCreated() 1371 } 1372 1373 // FuncHasOnCreated returns the function "WEBEXT.bookmarks.onCreated.hasListener". 1374 func FuncHasOnCreated() (fn js.Func[func(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)]) bool]) { 1375 bindings.FuncHasOnCreated( 1376 js.Pointer(&fn), 1377 ) 1378 return 1379 } 1380 1381 // HasOnCreated calls the function "WEBEXT.bookmarks.onCreated.hasListener" directly. 1382 func HasOnCreated(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)]) (ret bool) { 1383 bindings.CallHasOnCreated( 1384 js.Pointer(&ret), 1385 callback.Ref(), 1386 ) 1387 1388 return 1389 } 1390 1391 // TryHasOnCreated calls the function "WEBEXT.bookmarks.onCreated.hasListener" 1392 // in a try/catch block and returns (_, err, ok = false) when it went through 1393 // the catch clause. 1394 func TryHasOnCreated(callback js.Func[func(id js.String, bookmark *BookmarkTreeNode)]) (ret bool, exception js.Any, ok bool) { 1395 ok = js.True == bindings.TryHasOnCreated( 1396 js.Pointer(&ret), js.Pointer(&exception), 1397 callback.Ref(), 1398 ) 1399 1400 return 1401 } 1402 1403 type OnImportBeganEventCallbackFunc func(this js.Ref) js.Ref 1404 1405 func (fn OnImportBeganEventCallbackFunc) Register() js.Func[func()] { 1406 return js.RegisterCallback[func()]( 1407 fn, abi.FuncPCABIInternal(fn), 1408 ) 1409 } 1410 1411 func (fn OnImportBeganEventCallbackFunc) DispatchCallback( 1412 targetPC uintptr, ctx *js.CallbackContext, 1413 ) { 1414 args := ctx.Args() 1415 if len(args) != 0+1 /* js this */ || 1416 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1417 js.ThrowInvalidCallbackInvocation() 1418 } 1419 1420 if ctx.Return(fn( 1421 args[0], 1422 )) { 1423 return 1424 } 1425 1426 js.ThrowCallbackValueNotReturned() 1427 } 1428 1429 type OnImportBeganEventCallback[T any] struct { 1430 Fn func(arg T, this js.Ref) js.Ref 1431 Arg T 1432 } 1433 1434 func (cb *OnImportBeganEventCallback[T]) Register() js.Func[func()] { 1435 return js.RegisterCallback[func()]( 1436 cb, abi.FuncPCABIInternal(cb.Fn), 1437 ) 1438 } 1439 1440 func (cb *OnImportBeganEventCallback[T]) DispatchCallback( 1441 targetPC uintptr, ctx *js.CallbackContext, 1442 ) { 1443 args := ctx.Args() 1444 if len(args) != 0+1 /* js this */ || 1445 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1446 js.ThrowInvalidCallbackInvocation() 1447 } 1448 1449 if ctx.Return(cb.Fn( 1450 cb.Arg, 1451 args[0], 1452 )) { 1453 return 1454 } 1455 1456 js.ThrowCallbackValueNotReturned() 1457 } 1458 1459 // HasFuncOnImportBegan returns true if the function "WEBEXT.bookmarks.onImportBegan.addListener" exists. 1460 func HasFuncOnImportBegan() bool { 1461 return js.True == bindings.HasFuncOnImportBegan() 1462 } 1463 1464 // FuncOnImportBegan returns the function "WEBEXT.bookmarks.onImportBegan.addListener". 1465 func FuncOnImportBegan() (fn js.Func[func(callback js.Func[func()])]) { 1466 bindings.FuncOnImportBegan( 1467 js.Pointer(&fn), 1468 ) 1469 return 1470 } 1471 1472 // OnImportBegan calls the function "WEBEXT.bookmarks.onImportBegan.addListener" directly. 1473 func OnImportBegan(callback js.Func[func()]) (ret js.Void) { 1474 bindings.CallOnImportBegan( 1475 js.Pointer(&ret), 1476 callback.Ref(), 1477 ) 1478 1479 return 1480 } 1481 1482 // TryOnImportBegan calls the function "WEBEXT.bookmarks.onImportBegan.addListener" 1483 // in a try/catch block and returns (_, err, ok = false) when it went through 1484 // the catch clause. 1485 func TryOnImportBegan(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 1486 ok = js.True == bindings.TryOnImportBegan( 1487 js.Pointer(&ret), js.Pointer(&exception), 1488 callback.Ref(), 1489 ) 1490 1491 return 1492 } 1493 1494 // HasFuncOffImportBegan returns true if the function "WEBEXT.bookmarks.onImportBegan.removeListener" exists. 1495 func HasFuncOffImportBegan() bool { 1496 return js.True == bindings.HasFuncOffImportBegan() 1497 } 1498 1499 // FuncOffImportBegan returns the function "WEBEXT.bookmarks.onImportBegan.removeListener". 1500 func FuncOffImportBegan() (fn js.Func[func(callback js.Func[func()])]) { 1501 bindings.FuncOffImportBegan( 1502 js.Pointer(&fn), 1503 ) 1504 return 1505 } 1506 1507 // OffImportBegan calls the function "WEBEXT.bookmarks.onImportBegan.removeListener" directly. 1508 func OffImportBegan(callback js.Func[func()]) (ret js.Void) { 1509 bindings.CallOffImportBegan( 1510 js.Pointer(&ret), 1511 callback.Ref(), 1512 ) 1513 1514 return 1515 } 1516 1517 // TryOffImportBegan calls the function "WEBEXT.bookmarks.onImportBegan.removeListener" 1518 // in a try/catch block and returns (_, err, ok = false) when it went through 1519 // the catch clause. 1520 func TryOffImportBegan(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 1521 ok = js.True == bindings.TryOffImportBegan( 1522 js.Pointer(&ret), js.Pointer(&exception), 1523 callback.Ref(), 1524 ) 1525 1526 return 1527 } 1528 1529 // HasFuncHasOnImportBegan returns true if the function "WEBEXT.bookmarks.onImportBegan.hasListener" exists. 1530 func HasFuncHasOnImportBegan() bool { 1531 return js.True == bindings.HasFuncHasOnImportBegan() 1532 } 1533 1534 // FuncHasOnImportBegan returns the function "WEBEXT.bookmarks.onImportBegan.hasListener". 1535 func FuncHasOnImportBegan() (fn js.Func[func(callback js.Func[func()]) bool]) { 1536 bindings.FuncHasOnImportBegan( 1537 js.Pointer(&fn), 1538 ) 1539 return 1540 } 1541 1542 // HasOnImportBegan calls the function "WEBEXT.bookmarks.onImportBegan.hasListener" directly. 1543 func HasOnImportBegan(callback js.Func[func()]) (ret bool) { 1544 bindings.CallHasOnImportBegan( 1545 js.Pointer(&ret), 1546 callback.Ref(), 1547 ) 1548 1549 return 1550 } 1551 1552 // TryHasOnImportBegan calls the function "WEBEXT.bookmarks.onImportBegan.hasListener" 1553 // in a try/catch block and returns (_, err, ok = false) when it went through 1554 // the catch clause. 1555 func TryHasOnImportBegan(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 1556 ok = js.True == bindings.TryHasOnImportBegan( 1557 js.Pointer(&ret), js.Pointer(&exception), 1558 callback.Ref(), 1559 ) 1560 1561 return 1562 } 1563 1564 type OnImportEndedEventCallbackFunc func(this js.Ref) js.Ref 1565 1566 func (fn OnImportEndedEventCallbackFunc) Register() js.Func[func()] { 1567 return js.RegisterCallback[func()]( 1568 fn, abi.FuncPCABIInternal(fn), 1569 ) 1570 } 1571 1572 func (fn OnImportEndedEventCallbackFunc) DispatchCallback( 1573 targetPC uintptr, ctx *js.CallbackContext, 1574 ) { 1575 args := ctx.Args() 1576 if len(args) != 0+1 /* js this */ || 1577 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1578 js.ThrowInvalidCallbackInvocation() 1579 } 1580 1581 if ctx.Return(fn( 1582 args[0], 1583 )) { 1584 return 1585 } 1586 1587 js.ThrowCallbackValueNotReturned() 1588 } 1589 1590 type OnImportEndedEventCallback[T any] struct { 1591 Fn func(arg T, this js.Ref) js.Ref 1592 Arg T 1593 } 1594 1595 func (cb *OnImportEndedEventCallback[T]) Register() js.Func[func()] { 1596 return js.RegisterCallback[func()]( 1597 cb, abi.FuncPCABIInternal(cb.Fn), 1598 ) 1599 } 1600 1601 func (cb *OnImportEndedEventCallback[T]) DispatchCallback( 1602 targetPC uintptr, ctx *js.CallbackContext, 1603 ) { 1604 args := ctx.Args() 1605 if len(args) != 0+1 /* js this */ || 1606 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1607 js.ThrowInvalidCallbackInvocation() 1608 } 1609 1610 if ctx.Return(cb.Fn( 1611 cb.Arg, 1612 args[0], 1613 )) { 1614 return 1615 } 1616 1617 js.ThrowCallbackValueNotReturned() 1618 } 1619 1620 // HasFuncOnImportEnded returns true if the function "WEBEXT.bookmarks.onImportEnded.addListener" exists. 1621 func HasFuncOnImportEnded() bool { 1622 return js.True == bindings.HasFuncOnImportEnded() 1623 } 1624 1625 // FuncOnImportEnded returns the function "WEBEXT.bookmarks.onImportEnded.addListener". 1626 func FuncOnImportEnded() (fn js.Func[func(callback js.Func[func()])]) { 1627 bindings.FuncOnImportEnded( 1628 js.Pointer(&fn), 1629 ) 1630 return 1631 } 1632 1633 // OnImportEnded calls the function "WEBEXT.bookmarks.onImportEnded.addListener" directly. 1634 func OnImportEnded(callback js.Func[func()]) (ret js.Void) { 1635 bindings.CallOnImportEnded( 1636 js.Pointer(&ret), 1637 callback.Ref(), 1638 ) 1639 1640 return 1641 } 1642 1643 // TryOnImportEnded calls the function "WEBEXT.bookmarks.onImportEnded.addListener" 1644 // in a try/catch block and returns (_, err, ok = false) when it went through 1645 // the catch clause. 1646 func TryOnImportEnded(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 1647 ok = js.True == bindings.TryOnImportEnded( 1648 js.Pointer(&ret), js.Pointer(&exception), 1649 callback.Ref(), 1650 ) 1651 1652 return 1653 } 1654 1655 // HasFuncOffImportEnded returns true if the function "WEBEXT.bookmarks.onImportEnded.removeListener" exists. 1656 func HasFuncOffImportEnded() bool { 1657 return js.True == bindings.HasFuncOffImportEnded() 1658 } 1659 1660 // FuncOffImportEnded returns the function "WEBEXT.bookmarks.onImportEnded.removeListener". 1661 func FuncOffImportEnded() (fn js.Func[func(callback js.Func[func()])]) { 1662 bindings.FuncOffImportEnded( 1663 js.Pointer(&fn), 1664 ) 1665 return 1666 } 1667 1668 // OffImportEnded calls the function "WEBEXT.bookmarks.onImportEnded.removeListener" directly. 1669 func OffImportEnded(callback js.Func[func()]) (ret js.Void) { 1670 bindings.CallOffImportEnded( 1671 js.Pointer(&ret), 1672 callback.Ref(), 1673 ) 1674 1675 return 1676 } 1677 1678 // TryOffImportEnded calls the function "WEBEXT.bookmarks.onImportEnded.removeListener" 1679 // in a try/catch block and returns (_, err, ok = false) when it went through 1680 // the catch clause. 1681 func TryOffImportEnded(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) { 1682 ok = js.True == bindings.TryOffImportEnded( 1683 js.Pointer(&ret), js.Pointer(&exception), 1684 callback.Ref(), 1685 ) 1686 1687 return 1688 } 1689 1690 // HasFuncHasOnImportEnded returns true if the function "WEBEXT.bookmarks.onImportEnded.hasListener" exists. 1691 func HasFuncHasOnImportEnded() bool { 1692 return js.True == bindings.HasFuncHasOnImportEnded() 1693 } 1694 1695 // FuncHasOnImportEnded returns the function "WEBEXT.bookmarks.onImportEnded.hasListener". 1696 func FuncHasOnImportEnded() (fn js.Func[func(callback js.Func[func()]) bool]) { 1697 bindings.FuncHasOnImportEnded( 1698 js.Pointer(&fn), 1699 ) 1700 return 1701 } 1702 1703 // HasOnImportEnded calls the function "WEBEXT.bookmarks.onImportEnded.hasListener" directly. 1704 func HasOnImportEnded(callback js.Func[func()]) (ret bool) { 1705 bindings.CallHasOnImportEnded( 1706 js.Pointer(&ret), 1707 callback.Ref(), 1708 ) 1709 1710 return 1711 } 1712 1713 // TryHasOnImportEnded calls the function "WEBEXT.bookmarks.onImportEnded.hasListener" 1714 // in a try/catch block and returns (_, err, ok = false) when it went through 1715 // the catch clause. 1716 func TryHasOnImportEnded(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) { 1717 ok = js.True == bindings.TryHasOnImportEnded( 1718 js.Pointer(&ret), js.Pointer(&exception), 1719 callback.Ref(), 1720 ) 1721 1722 return 1723 } 1724 1725 type OnMovedEventCallbackFunc func(this js.Ref, id js.String, moveInfo *OnMovedArgMoveInfo) js.Ref 1726 1727 func (fn OnMovedEventCallbackFunc) Register() js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)] { 1728 return js.RegisterCallback[func(id js.String, moveInfo *OnMovedArgMoveInfo)]( 1729 fn, abi.FuncPCABIInternal(fn), 1730 ) 1731 } 1732 1733 func (fn OnMovedEventCallbackFunc) DispatchCallback( 1734 targetPC uintptr, ctx *js.CallbackContext, 1735 ) { 1736 args := ctx.Args() 1737 if len(args) != 2+1 /* js this */ || 1738 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1739 js.ThrowInvalidCallbackInvocation() 1740 } 1741 var arg1 OnMovedArgMoveInfo 1742 arg1.UpdateFrom(args[1+1]) 1743 defer arg1.FreeMembers(true) 1744 1745 if ctx.Return(fn( 1746 args[0], 1747 1748 js.String{}.FromRef(args[0+1]), 1749 mark.NoEscape(&arg1), 1750 )) { 1751 return 1752 } 1753 1754 js.ThrowCallbackValueNotReturned() 1755 } 1756 1757 type OnMovedEventCallback[T any] struct { 1758 Fn func(arg T, this js.Ref, id js.String, moveInfo *OnMovedArgMoveInfo) js.Ref 1759 Arg T 1760 } 1761 1762 func (cb *OnMovedEventCallback[T]) Register() js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)] { 1763 return js.RegisterCallback[func(id js.String, moveInfo *OnMovedArgMoveInfo)]( 1764 cb, abi.FuncPCABIInternal(cb.Fn), 1765 ) 1766 } 1767 1768 func (cb *OnMovedEventCallback[T]) DispatchCallback( 1769 targetPC uintptr, ctx *js.CallbackContext, 1770 ) { 1771 args := ctx.Args() 1772 if len(args) != 2+1 /* js this */ || 1773 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1774 js.ThrowInvalidCallbackInvocation() 1775 } 1776 var arg1 OnMovedArgMoveInfo 1777 arg1.UpdateFrom(args[1+1]) 1778 defer arg1.FreeMembers(true) 1779 1780 if ctx.Return(cb.Fn( 1781 cb.Arg, 1782 args[0], 1783 1784 js.String{}.FromRef(args[0+1]), 1785 mark.NoEscape(&arg1), 1786 )) { 1787 return 1788 } 1789 1790 js.ThrowCallbackValueNotReturned() 1791 } 1792 1793 // HasFuncOnMoved returns true if the function "WEBEXT.bookmarks.onMoved.addListener" exists. 1794 func HasFuncOnMoved() bool { 1795 return js.True == bindings.HasFuncOnMoved() 1796 } 1797 1798 // FuncOnMoved returns the function "WEBEXT.bookmarks.onMoved.addListener". 1799 func FuncOnMoved() (fn js.Func[func(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)])]) { 1800 bindings.FuncOnMoved( 1801 js.Pointer(&fn), 1802 ) 1803 return 1804 } 1805 1806 // OnMoved calls the function "WEBEXT.bookmarks.onMoved.addListener" directly. 1807 func OnMoved(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)]) (ret js.Void) { 1808 bindings.CallOnMoved( 1809 js.Pointer(&ret), 1810 callback.Ref(), 1811 ) 1812 1813 return 1814 } 1815 1816 // TryOnMoved calls the function "WEBEXT.bookmarks.onMoved.addListener" 1817 // in a try/catch block and returns (_, err, ok = false) when it went through 1818 // the catch clause. 1819 func TryOnMoved(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)]) (ret js.Void, exception js.Any, ok bool) { 1820 ok = js.True == bindings.TryOnMoved( 1821 js.Pointer(&ret), js.Pointer(&exception), 1822 callback.Ref(), 1823 ) 1824 1825 return 1826 } 1827 1828 // HasFuncOffMoved returns true if the function "WEBEXT.bookmarks.onMoved.removeListener" exists. 1829 func HasFuncOffMoved() bool { 1830 return js.True == bindings.HasFuncOffMoved() 1831 } 1832 1833 // FuncOffMoved returns the function "WEBEXT.bookmarks.onMoved.removeListener". 1834 func FuncOffMoved() (fn js.Func[func(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)])]) { 1835 bindings.FuncOffMoved( 1836 js.Pointer(&fn), 1837 ) 1838 return 1839 } 1840 1841 // OffMoved calls the function "WEBEXT.bookmarks.onMoved.removeListener" directly. 1842 func OffMoved(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)]) (ret js.Void) { 1843 bindings.CallOffMoved( 1844 js.Pointer(&ret), 1845 callback.Ref(), 1846 ) 1847 1848 return 1849 } 1850 1851 // TryOffMoved calls the function "WEBEXT.bookmarks.onMoved.removeListener" 1852 // in a try/catch block and returns (_, err, ok = false) when it went through 1853 // the catch clause. 1854 func TryOffMoved(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)]) (ret js.Void, exception js.Any, ok bool) { 1855 ok = js.True == bindings.TryOffMoved( 1856 js.Pointer(&ret), js.Pointer(&exception), 1857 callback.Ref(), 1858 ) 1859 1860 return 1861 } 1862 1863 // HasFuncHasOnMoved returns true if the function "WEBEXT.bookmarks.onMoved.hasListener" exists. 1864 func HasFuncHasOnMoved() bool { 1865 return js.True == bindings.HasFuncHasOnMoved() 1866 } 1867 1868 // FuncHasOnMoved returns the function "WEBEXT.bookmarks.onMoved.hasListener". 1869 func FuncHasOnMoved() (fn js.Func[func(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)]) bool]) { 1870 bindings.FuncHasOnMoved( 1871 js.Pointer(&fn), 1872 ) 1873 return 1874 } 1875 1876 // HasOnMoved calls the function "WEBEXT.bookmarks.onMoved.hasListener" directly. 1877 func HasOnMoved(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)]) (ret bool) { 1878 bindings.CallHasOnMoved( 1879 js.Pointer(&ret), 1880 callback.Ref(), 1881 ) 1882 1883 return 1884 } 1885 1886 // TryHasOnMoved calls the function "WEBEXT.bookmarks.onMoved.hasListener" 1887 // in a try/catch block and returns (_, err, ok = false) when it went through 1888 // the catch clause. 1889 func TryHasOnMoved(callback js.Func[func(id js.String, moveInfo *OnMovedArgMoveInfo)]) (ret bool, exception js.Any, ok bool) { 1890 ok = js.True == bindings.TryHasOnMoved( 1891 js.Pointer(&ret), js.Pointer(&exception), 1892 callback.Ref(), 1893 ) 1894 1895 return 1896 } 1897 1898 type OnRemovedEventCallbackFunc func(this js.Ref, id js.String, removeInfo *OnRemovedArgRemoveInfo) js.Ref 1899 1900 func (fn OnRemovedEventCallbackFunc) Register() js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)] { 1901 return js.RegisterCallback[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]( 1902 fn, abi.FuncPCABIInternal(fn), 1903 ) 1904 } 1905 1906 func (fn OnRemovedEventCallbackFunc) DispatchCallback( 1907 targetPC uintptr, ctx *js.CallbackContext, 1908 ) { 1909 args := ctx.Args() 1910 if len(args) != 2+1 /* js this */ || 1911 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1912 js.ThrowInvalidCallbackInvocation() 1913 } 1914 var arg1 OnRemovedArgRemoveInfo 1915 arg1.UpdateFrom(args[1+1]) 1916 defer arg1.FreeMembers(true) 1917 1918 if ctx.Return(fn( 1919 args[0], 1920 1921 js.String{}.FromRef(args[0+1]), 1922 mark.NoEscape(&arg1), 1923 )) { 1924 return 1925 } 1926 1927 js.ThrowCallbackValueNotReturned() 1928 } 1929 1930 type OnRemovedEventCallback[T any] struct { 1931 Fn func(arg T, this js.Ref, id js.String, removeInfo *OnRemovedArgRemoveInfo) js.Ref 1932 Arg T 1933 } 1934 1935 func (cb *OnRemovedEventCallback[T]) Register() js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)] { 1936 return js.RegisterCallback[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]( 1937 cb, abi.FuncPCABIInternal(cb.Fn), 1938 ) 1939 } 1940 1941 func (cb *OnRemovedEventCallback[T]) DispatchCallback( 1942 targetPC uintptr, ctx *js.CallbackContext, 1943 ) { 1944 args := ctx.Args() 1945 if len(args) != 2+1 /* js this */ || 1946 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1947 js.ThrowInvalidCallbackInvocation() 1948 } 1949 var arg1 OnRemovedArgRemoveInfo 1950 arg1.UpdateFrom(args[1+1]) 1951 defer arg1.FreeMembers(true) 1952 1953 if ctx.Return(cb.Fn( 1954 cb.Arg, 1955 args[0], 1956 1957 js.String{}.FromRef(args[0+1]), 1958 mark.NoEscape(&arg1), 1959 )) { 1960 return 1961 } 1962 1963 js.ThrowCallbackValueNotReturned() 1964 } 1965 1966 // HasFuncOnRemoved returns true if the function "WEBEXT.bookmarks.onRemoved.addListener" exists. 1967 func HasFuncOnRemoved() bool { 1968 return js.True == bindings.HasFuncOnRemoved() 1969 } 1970 1971 // FuncOnRemoved returns the function "WEBEXT.bookmarks.onRemoved.addListener". 1972 func FuncOnRemoved() (fn js.Func[func(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)])]) { 1973 bindings.FuncOnRemoved( 1974 js.Pointer(&fn), 1975 ) 1976 return 1977 } 1978 1979 // OnRemoved calls the function "WEBEXT.bookmarks.onRemoved.addListener" directly. 1980 func OnRemoved(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]) (ret js.Void) { 1981 bindings.CallOnRemoved( 1982 js.Pointer(&ret), 1983 callback.Ref(), 1984 ) 1985 1986 return 1987 } 1988 1989 // TryOnRemoved calls the function "WEBEXT.bookmarks.onRemoved.addListener" 1990 // in a try/catch block and returns (_, err, ok = false) when it went through 1991 // the catch clause. 1992 func TryOnRemoved(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]) (ret js.Void, exception js.Any, ok bool) { 1993 ok = js.True == bindings.TryOnRemoved( 1994 js.Pointer(&ret), js.Pointer(&exception), 1995 callback.Ref(), 1996 ) 1997 1998 return 1999 } 2000 2001 // HasFuncOffRemoved returns true if the function "WEBEXT.bookmarks.onRemoved.removeListener" exists. 2002 func HasFuncOffRemoved() bool { 2003 return js.True == bindings.HasFuncOffRemoved() 2004 } 2005 2006 // FuncOffRemoved returns the function "WEBEXT.bookmarks.onRemoved.removeListener". 2007 func FuncOffRemoved() (fn js.Func[func(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)])]) { 2008 bindings.FuncOffRemoved( 2009 js.Pointer(&fn), 2010 ) 2011 return 2012 } 2013 2014 // OffRemoved calls the function "WEBEXT.bookmarks.onRemoved.removeListener" directly. 2015 func OffRemoved(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]) (ret js.Void) { 2016 bindings.CallOffRemoved( 2017 js.Pointer(&ret), 2018 callback.Ref(), 2019 ) 2020 2021 return 2022 } 2023 2024 // TryOffRemoved calls the function "WEBEXT.bookmarks.onRemoved.removeListener" 2025 // in a try/catch block and returns (_, err, ok = false) when it went through 2026 // the catch clause. 2027 func TryOffRemoved(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]) (ret js.Void, exception js.Any, ok bool) { 2028 ok = js.True == bindings.TryOffRemoved( 2029 js.Pointer(&ret), js.Pointer(&exception), 2030 callback.Ref(), 2031 ) 2032 2033 return 2034 } 2035 2036 // HasFuncHasOnRemoved returns true if the function "WEBEXT.bookmarks.onRemoved.hasListener" exists. 2037 func HasFuncHasOnRemoved() bool { 2038 return js.True == bindings.HasFuncHasOnRemoved() 2039 } 2040 2041 // FuncHasOnRemoved returns the function "WEBEXT.bookmarks.onRemoved.hasListener". 2042 func FuncHasOnRemoved() (fn js.Func[func(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]) bool]) { 2043 bindings.FuncHasOnRemoved( 2044 js.Pointer(&fn), 2045 ) 2046 return 2047 } 2048 2049 // HasOnRemoved calls the function "WEBEXT.bookmarks.onRemoved.hasListener" directly. 2050 func HasOnRemoved(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]) (ret bool) { 2051 bindings.CallHasOnRemoved( 2052 js.Pointer(&ret), 2053 callback.Ref(), 2054 ) 2055 2056 return 2057 } 2058 2059 // TryHasOnRemoved calls the function "WEBEXT.bookmarks.onRemoved.hasListener" 2060 // in a try/catch block and returns (_, err, ok = false) when it went through 2061 // the catch clause. 2062 func TryHasOnRemoved(callback js.Func[func(id js.String, removeInfo *OnRemovedArgRemoveInfo)]) (ret bool, exception js.Any, ok bool) { 2063 ok = js.True == bindings.TryHasOnRemoved( 2064 js.Pointer(&ret), js.Pointer(&exception), 2065 callback.Ref(), 2066 ) 2067 2068 return 2069 } 2070 2071 // HasFuncRemove returns true if the function "WEBEXT.bookmarks.remove" exists. 2072 func HasFuncRemove() bool { 2073 return js.True == bindings.HasFuncRemove() 2074 } 2075 2076 // FuncRemove returns the function "WEBEXT.bookmarks.remove". 2077 func FuncRemove() (fn js.Func[func(id js.String) js.Promise[js.Void]]) { 2078 bindings.FuncRemove( 2079 js.Pointer(&fn), 2080 ) 2081 return 2082 } 2083 2084 // Remove calls the function "WEBEXT.bookmarks.remove" directly. 2085 func Remove(id js.String) (ret js.Promise[js.Void]) { 2086 bindings.CallRemove( 2087 js.Pointer(&ret), 2088 id.Ref(), 2089 ) 2090 2091 return 2092 } 2093 2094 // TryRemove calls the function "WEBEXT.bookmarks.remove" 2095 // in a try/catch block and returns (_, err, ok = false) when it went through 2096 // the catch clause. 2097 func TryRemove(id js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2098 ok = js.True == bindings.TryRemove( 2099 js.Pointer(&ret), js.Pointer(&exception), 2100 id.Ref(), 2101 ) 2102 2103 return 2104 } 2105 2106 // HasFuncRemoveTree returns true if the function "WEBEXT.bookmarks.removeTree" exists. 2107 func HasFuncRemoveTree() bool { 2108 return js.True == bindings.HasFuncRemoveTree() 2109 } 2110 2111 // FuncRemoveTree returns the function "WEBEXT.bookmarks.removeTree". 2112 func FuncRemoveTree() (fn js.Func[func(id js.String) js.Promise[js.Void]]) { 2113 bindings.FuncRemoveTree( 2114 js.Pointer(&fn), 2115 ) 2116 return 2117 } 2118 2119 // RemoveTree calls the function "WEBEXT.bookmarks.removeTree" directly. 2120 func RemoveTree(id js.String) (ret js.Promise[js.Void]) { 2121 bindings.CallRemoveTree( 2122 js.Pointer(&ret), 2123 id.Ref(), 2124 ) 2125 2126 return 2127 } 2128 2129 // TryRemoveTree calls the function "WEBEXT.bookmarks.removeTree" 2130 // in a try/catch block and returns (_, err, ok = false) when it went through 2131 // the catch clause. 2132 func TryRemoveTree(id js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2133 ok = js.True == bindings.TryRemoveTree( 2134 js.Pointer(&ret), js.Pointer(&exception), 2135 id.Ref(), 2136 ) 2137 2138 return 2139 } 2140 2141 type OneOf_String_SearchArgQueryChoice1 struct { 2142 ref js.Ref 2143 } 2144 2145 func (x OneOf_String_SearchArgQueryChoice1) Ref() js.Ref { 2146 return x.ref 2147 } 2148 2149 func (x OneOf_String_SearchArgQueryChoice1) Free() { 2150 x.ref.Free() 2151 } 2152 2153 func (x OneOf_String_SearchArgQueryChoice1) FromRef(ref js.Ref) OneOf_String_SearchArgQueryChoice1 { 2154 return OneOf_String_SearchArgQueryChoice1{ 2155 ref: ref, 2156 } 2157 } 2158 2159 func (x OneOf_String_SearchArgQueryChoice1) String() js.String { 2160 return js.String{}.FromRef(x.ref) 2161 } 2162 2163 func (x OneOf_String_SearchArgQueryChoice1) SearchArgQueryChoice1() SearchArgQueryChoice1 { 2164 var ret SearchArgQueryChoice1 2165 ret.UpdateFrom(x.ref) 2166 return ret 2167 } 2168 2169 // HasFuncSearch returns true if the function "WEBEXT.bookmarks.search" exists. 2170 func HasFuncSearch() bool { 2171 return js.True == bindings.HasFuncSearch() 2172 } 2173 2174 // FuncSearch returns the function "WEBEXT.bookmarks.search". 2175 func FuncSearch() (fn js.Func[func(query OneOf_String_SearchArgQueryChoice1) js.Promise[js.Array[BookmarkTreeNode]]]) { 2176 bindings.FuncSearch( 2177 js.Pointer(&fn), 2178 ) 2179 return 2180 } 2181 2182 // Search calls the function "WEBEXT.bookmarks.search" directly. 2183 func Search(query OneOf_String_SearchArgQueryChoice1) (ret js.Promise[js.Array[BookmarkTreeNode]]) { 2184 bindings.CallSearch( 2185 js.Pointer(&ret), 2186 query.Ref(), 2187 ) 2188 2189 return 2190 } 2191 2192 // TrySearch calls the function "WEBEXT.bookmarks.search" 2193 // in a try/catch block and returns (_, err, ok = false) when it went through 2194 // the catch clause. 2195 func TrySearch(query OneOf_String_SearchArgQueryChoice1) (ret js.Promise[js.Array[BookmarkTreeNode]], exception js.Any, ok bool) { 2196 ok = js.True == bindings.TrySearch( 2197 js.Pointer(&ret), js.Pointer(&exception), 2198 query.Ref(), 2199 ) 2200 2201 return 2202 } 2203 2204 // HasFuncUpdate returns true if the function "WEBEXT.bookmarks.update" exists. 2205 func HasFuncUpdate() bool { 2206 return js.True == bindings.HasFuncUpdate() 2207 } 2208 2209 // FuncUpdate returns the function "WEBEXT.bookmarks.update". 2210 func FuncUpdate() (fn js.Func[func(id js.String, changes UpdateArgChanges) js.Promise[BookmarkTreeNode]]) { 2211 bindings.FuncUpdate( 2212 js.Pointer(&fn), 2213 ) 2214 return 2215 } 2216 2217 // Update calls the function "WEBEXT.bookmarks.update" directly. 2218 func Update(id js.String, changes UpdateArgChanges) (ret js.Promise[BookmarkTreeNode]) { 2219 bindings.CallUpdate( 2220 js.Pointer(&ret), 2221 id.Ref(), 2222 js.Pointer(&changes), 2223 ) 2224 2225 return 2226 } 2227 2228 // TryUpdate calls the function "WEBEXT.bookmarks.update" 2229 // in a try/catch block and returns (_, err, ok = false) when it went through 2230 // the catch clause. 2231 func TryUpdate(id js.String, changes UpdateArgChanges) (ret js.Promise[BookmarkTreeNode], exception js.Any, ok bool) { 2232 ok = js.True == bindings.TryUpdate( 2233 js.Pointer(&ret), js.Pointer(&exception), 2234 id.Ref(), 2235 js.Pointer(&changes), 2236 ) 2237 2238 return 2239 }