github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis12_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package web 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/web/bindings" 11 ) 12 13 const ( 14 _ RequestDestination = iota 15 16 RequestDestination_ 17 RequestDestination_AUDIO 18 RequestDestination_AUDIOWORKLET 19 RequestDestination_DOCUMENT 20 RequestDestination_EMBED 21 RequestDestination_FONT 22 RequestDestination_FRAME 23 RequestDestination_IFRAME 24 RequestDestination_IMAGE 25 RequestDestination_MANIFEST 26 RequestDestination_OBJECT 27 RequestDestination_PAINTWORKLET 28 RequestDestination_REPORT 29 RequestDestination_SCRIPT 30 RequestDestination_SHAREDWORKER 31 RequestDestination_STYLE 32 RequestDestination_TRACK 33 RequestDestination_VIDEO 34 RequestDestination_WORKER 35 RequestDestination_XSLT 36 ) 37 38 func (RequestDestination) FromRef(str js.Ref) RequestDestination { 39 return RequestDestination(bindings.ConstOfRequestDestination(str)) 40 } 41 42 func (x RequestDestination) String() (string, bool) { 43 switch x { 44 case RequestDestination_: 45 return "", true 46 case RequestDestination_AUDIO: 47 return "audio", true 48 case RequestDestination_AUDIOWORKLET: 49 return "audioworklet", true 50 case RequestDestination_DOCUMENT: 51 return "document", true 52 case RequestDestination_EMBED: 53 return "embed", true 54 case RequestDestination_FONT: 55 return "font", true 56 case RequestDestination_FRAME: 57 return "frame", true 58 case RequestDestination_IFRAME: 59 return "iframe", true 60 case RequestDestination_IMAGE: 61 return "image", true 62 case RequestDestination_MANIFEST: 63 return "manifest", true 64 case RequestDestination_OBJECT: 65 return "object", true 66 case RequestDestination_PAINTWORKLET: 67 return "paintworklet", true 68 case RequestDestination_REPORT: 69 return "report", true 70 case RequestDestination_SCRIPT: 71 return "script", true 72 case RequestDestination_SHAREDWORKER: 73 return "sharedworker", true 74 case RequestDestination_STYLE: 75 return "style", true 76 case RequestDestination_TRACK: 77 return "track", true 78 case RequestDestination_VIDEO: 79 return "video", true 80 case RequestDestination_WORKER: 81 return "worker", true 82 case RequestDestination_XSLT: 83 return "xslt", true 84 default: 85 return "", false 86 } 87 } 88 89 func NewRequest(input RequestInfo, init RequestInit) (ret Request) { 90 ret.ref = bindings.NewRequestByRequest( 91 input.Ref(), 92 js.Pointer(&init)) 93 return 94 } 95 96 func NewRequestByRequest1(input RequestInfo) (ret Request) { 97 ret.ref = bindings.NewRequestByRequest1( 98 input.Ref()) 99 return 100 } 101 102 type Request struct { 103 ref js.Ref 104 } 105 106 func (this Request) Once() Request { 107 this.ref.Once() 108 return this 109 } 110 111 func (this Request) Ref() js.Ref { 112 return this.ref 113 } 114 115 func (this Request) FromRef(ref js.Ref) Request { 116 this.ref = ref 117 return this 118 } 119 120 func (this Request) Free() { 121 this.ref.Free() 122 } 123 124 // Method returns the value of property "Request.method". 125 // 126 // It returns ok=false if there is no such property. 127 func (this Request) Method() (ret js.String, ok bool) { 128 ok = js.True == bindings.GetRequestMethod( 129 this.ref, js.Pointer(&ret), 130 ) 131 return 132 } 133 134 // Url returns the value of property "Request.url". 135 // 136 // It returns ok=false if there is no such property. 137 func (this Request) Url() (ret js.String, ok bool) { 138 ok = js.True == bindings.GetRequestUrl( 139 this.ref, js.Pointer(&ret), 140 ) 141 return 142 } 143 144 // Headers returns the value of property "Request.headers". 145 // 146 // It returns ok=false if there is no such property. 147 func (this Request) Headers() (ret Headers, ok bool) { 148 ok = js.True == bindings.GetRequestHeaders( 149 this.ref, js.Pointer(&ret), 150 ) 151 return 152 } 153 154 // Destination returns the value of property "Request.destination". 155 // 156 // It returns ok=false if there is no such property. 157 func (this Request) Destination() (ret RequestDestination, ok bool) { 158 ok = js.True == bindings.GetRequestDestination( 159 this.ref, js.Pointer(&ret), 160 ) 161 return 162 } 163 164 // Referrer returns the value of property "Request.referrer". 165 // 166 // It returns ok=false if there is no such property. 167 func (this Request) Referrer() (ret js.String, ok bool) { 168 ok = js.True == bindings.GetRequestReferrer( 169 this.ref, js.Pointer(&ret), 170 ) 171 return 172 } 173 174 // ReferrerPolicy returns the value of property "Request.referrerPolicy". 175 // 176 // It returns ok=false if there is no such property. 177 func (this Request) ReferrerPolicy() (ret ReferrerPolicy, ok bool) { 178 ok = js.True == bindings.GetRequestReferrerPolicy( 179 this.ref, js.Pointer(&ret), 180 ) 181 return 182 } 183 184 // Mode returns the value of property "Request.mode". 185 // 186 // It returns ok=false if there is no such property. 187 func (this Request) Mode() (ret RequestMode, ok bool) { 188 ok = js.True == bindings.GetRequestMode( 189 this.ref, js.Pointer(&ret), 190 ) 191 return 192 } 193 194 // Credentials returns the value of property "Request.credentials". 195 // 196 // It returns ok=false if there is no such property. 197 func (this Request) Credentials() (ret RequestCredentials, ok bool) { 198 ok = js.True == bindings.GetRequestCredentials( 199 this.ref, js.Pointer(&ret), 200 ) 201 return 202 } 203 204 // Cache returns the value of property "Request.cache". 205 // 206 // It returns ok=false if there is no such property. 207 func (this Request) Cache() (ret RequestCache, ok bool) { 208 ok = js.True == bindings.GetRequestCache( 209 this.ref, js.Pointer(&ret), 210 ) 211 return 212 } 213 214 // Redirect returns the value of property "Request.redirect". 215 // 216 // It returns ok=false if there is no such property. 217 func (this Request) Redirect() (ret RequestRedirect, ok bool) { 218 ok = js.True == bindings.GetRequestRedirect( 219 this.ref, js.Pointer(&ret), 220 ) 221 return 222 } 223 224 // Integrity returns the value of property "Request.integrity". 225 // 226 // It returns ok=false if there is no such property. 227 func (this Request) Integrity() (ret js.String, ok bool) { 228 ok = js.True == bindings.GetRequestIntegrity( 229 this.ref, js.Pointer(&ret), 230 ) 231 return 232 } 233 234 // Keepalive returns the value of property "Request.keepalive". 235 // 236 // It returns ok=false if there is no such property. 237 func (this Request) Keepalive() (ret bool, ok bool) { 238 ok = js.True == bindings.GetRequestKeepalive( 239 this.ref, js.Pointer(&ret), 240 ) 241 return 242 } 243 244 // IsReloadNavigation returns the value of property "Request.isReloadNavigation". 245 // 246 // It returns ok=false if there is no such property. 247 func (this Request) IsReloadNavigation() (ret bool, ok bool) { 248 ok = js.True == bindings.GetRequestIsReloadNavigation( 249 this.ref, js.Pointer(&ret), 250 ) 251 return 252 } 253 254 // IsHistoryNavigation returns the value of property "Request.isHistoryNavigation". 255 // 256 // It returns ok=false if there is no such property. 257 func (this Request) IsHistoryNavigation() (ret bool, ok bool) { 258 ok = js.True == bindings.GetRequestIsHistoryNavigation( 259 this.ref, js.Pointer(&ret), 260 ) 261 return 262 } 263 264 // Signal returns the value of property "Request.signal". 265 // 266 // It returns ok=false if there is no such property. 267 func (this Request) Signal() (ret AbortSignal, ok bool) { 268 ok = js.True == bindings.GetRequestSignal( 269 this.ref, js.Pointer(&ret), 270 ) 271 return 272 } 273 274 // Duplex returns the value of property "Request.duplex". 275 // 276 // It returns ok=false if there is no such property. 277 func (this Request) Duplex() (ret RequestDuplex, ok bool) { 278 ok = js.True == bindings.GetRequestDuplex( 279 this.ref, js.Pointer(&ret), 280 ) 281 return 282 } 283 284 // Body returns the value of property "Request.body". 285 // 286 // It returns ok=false if there is no such property. 287 func (this Request) Body() (ret ReadableStream, ok bool) { 288 ok = js.True == bindings.GetRequestBody( 289 this.ref, js.Pointer(&ret), 290 ) 291 return 292 } 293 294 // BodyUsed returns the value of property "Request.bodyUsed". 295 // 296 // It returns ok=false if there is no such property. 297 func (this Request) BodyUsed() (ret bool, ok bool) { 298 ok = js.True == bindings.GetRequestBodyUsed( 299 this.ref, js.Pointer(&ret), 300 ) 301 return 302 } 303 304 // HasFuncClone returns true if the method "Request.clone" exists. 305 func (this Request) HasFuncClone() bool { 306 return js.True == bindings.HasFuncRequestClone( 307 this.ref, 308 ) 309 } 310 311 // FuncClone returns the method "Request.clone". 312 func (this Request) FuncClone() (fn js.Func[func() Request]) { 313 bindings.FuncRequestClone( 314 this.ref, js.Pointer(&fn), 315 ) 316 return 317 } 318 319 // Clone calls the method "Request.clone". 320 func (this Request) Clone() (ret Request) { 321 bindings.CallRequestClone( 322 this.ref, js.Pointer(&ret), 323 ) 324 325 return 326 } 327 328 // TryClone calls the method "Request.clone" 329 // in a try/catch block and returns (_, err, ok = false) when it went through 330 // the catch clause. 331 func (this Request) TryClone() (ret Request, exception js.Any, ok bool) { 332 ok = js.True == bindings.TryRequestClone( 333 this.ref, js.Pointer(&ret), js.Pointer(&exception), 334 ) 335 336 return 337 } 338 339 // HasFuncArrayBuffer returns true if the method "Request.arrayBuffer" exists. 340 func (this Request) HasFuncArrayBuffer() bool { 341 return js.True == bindings.HasFuncRequestArrayBuffer( 342 this.ref, 343 ) 344 } 345 346 // FuncArrayBuffer returns the method "Request.arrayBuffer". 347 func (this Request) FuncArrayBuffer() (fn js.Func[func() js.Promise[js.ArrayBuffer]]) { 348 bindings.FuncRequestArrayBuffer( 349 this.ref, js.Pointer(&fn), 350 ) 351 return 352 } 353 354 // ArrayBuffer calls the method "Request.arrayBuffer". 355 func (this Request) ArrayBuffer() (ret js.Promise[js.ArrayBuffer]) { 356 bindings.CallRequestArrayBuffer( 357 this.ref, js.Pointer(&ret), 358 ) 359 360 return 361 } 362 363 // TryArrayBuffer calls the method "Request.arrayBuffer" 364 // in a try/catch block and returns (_, err, ok = false) when it went through 365 // the catch clause. 366 func (this Request) TryArrayBuffer() (ret js.Promise[js.ArrayBuffer], exception js.Any, ok bool) { 367 ok = js.True == bindings.TryRequestArrayBuffer( 368 this.ref, js.Pointer(&ret), js.Pointer(&exception), 369 ) 370 371 return 372 } 373 374 // HasFuncBlob returns true if the method "Request.blob" exists. 375 func (this Request) HasFuncBlob() bool { 376 return js.True == bindings.HasFuncRequestBlob( 377 this.ref, 378 ) 379 } 380 381 // FuncBlob returns the method "Request.blob". 382 func (this Request) FuncBlob() (fn js.Func[func() js.Promise[Blob]]) { 383 bindings.FuncRequestBlob( 384 this.ref, js.Pointer(&fn), 385 ) 386 return 387 } 388 389 // Blob calls the method "Request.blob". 390 func (this Request) Blob() (ret js.Promise[Blob]) { 391 bindings.CallRequestBlob( 392 this.ref, js.Pointer(&ret), 393 ) 394 395 return 396 } 397 398 // TryBlob calls the method "Request.blob" 399 // in a try/catch block and returns (_, err, ok = false) when it went through 400 // the catch clause. 401 func (this Request) TryBlob() (ret js.Promise[Blob], exception js.Any, ok bool) { 402 ok = js.True == bindings.TryRequestBlob( 403 this.ref, js.Pointer(&ret), js.Pointer(&exception), 404 ) 405 406 return 407 } 408 409 // HasFuncFormData returns true if the method "Request.formData" exists. 410 func (this Request) HasFuncFormData() bool { 411 return js.True == bindings.HasFuncRequestFormData( 412 this.ref, 413 ) 414 } 415 416 // FuncFormData returns the method "Request.formData". 417 func (this Request) FuncFormData() (fn js.Func[func() js.Promise[FormData]]) { 418 bindings.FuncRequestFormData( 419 this.ref, js.Pointer(&fn), 420 ) 421 return 422 } 423 424 // FormData calls the method "Request.formData". 425 func (this Request) FormData() (ret js.Promise[FormData]) { 426 bindings.CallRequestFormData( 427 this.ref, js.Pointer(&ret), 428 ) 429 430 return 431 } 432 433 // TryFormData calls the method "Request.formData" 434 // in a try/catch block and returns (_, err, ok = false) when it went through 435 // the catch clause. 436 func (this Request) TryFormData() (ret js.Promise[FormData], exception js.Any, ok bool) { 437 ok = js.True == bindings.TryRequestFormData( 438 this.ref, js.Pointer(&ret), js.Pointer(&exception), 439 ) 440 441 return 442 } 443 444 // HasFuncJson returns true if the method "Request.json" exists. 445 func (this Request) HasFuncJson() bool { 446 return js.True == bindings.HasFuncRequestJson( 447 this.ref, 448 ) 449 } 450 451 // FuncJson returns the method "Request.json". 452 func (this Request) FuncJson() (fn js.Func[func() js.Promise[js.Any]]) { 453 bindings.FuncRequestJson( 454 this.ref, js.Pointer(&fn), 455 ) 456 return 457 } 458 459 // Json calls the method "Request.json". 460 func (this Request) Json() (ret js.Promise[js.Any]) { 461 bindings.CallRequestJson( 462 this.ref, js.Pointer(&ret), 463 ) 464 465 return 466 } 467 468 // TryJson calls the method "Request.json" 469 // in a try/catch block and returns (_, err, ok = false) when it went through 470 // the catch clause. 471 func (this Request) TryJson() (ret js.Promise[js.Any], exception js.Any, ok bool) { 472 ok = js.True == bindings.TryRequestJson( 473 this.ref, js.Pointer(&ret), js.Pointer(&exception), 474 ) 475 476 return 477 } 478 479 // HasFuncText returns true if the method "Request.text" exists. 480 func (this Request) HasFuncText() bool { 481 return js.True == bindings.HasFuncRequestText( 482 this.ref, 483 ) 484 } 485 486 // FuncText returns the method "Request.text". 487 func (this Request) FuncText() (fn js.Func[func() js.Promise[js.String]]) { 488 bindings.FuncRequestText( 489 this.ref, js.Pointer(&fn), 490 ) 491 return 492 } 493 494 // Text calls the method "Request.text". 495 func (this Request) Text() (ret js.Promise[js.String]) { 496 bindings.CallRequestText( 497 this.ref, js.Pointer(&ret), 498 ) 499 500 return 501 } 502 503 // TryText calls the method "Request.text" 504 // in a try/catch block and returns (_, err, ok = false) when it went through 505 // the catch clause. 506 func (this Request) TryText() (ret js.Promise[js.String], exception js.Any, ok bool) { 507 ok = js.True == bindings.TryRequestText( 508 this.ref, js.Pointer(&ret), js.Pointer(&exception), 509 ) 510 511 return 512 } 513 514 type ResponseInit struct { 515 // Status is "ResponseInit.status" 516 // 517 // Optional, defaults to 200. 518 // 519 // NOTE: FFI_USE_Status MUST be set to true to make this field effective. 520 Status uint16 521 // StatusText is "ResponseInit.statusText" 522 // 523 // Optional, defaults to "". 524 StatusText js.String 525 // Headers is "ResponseInit.headers" 526 // 527 // Optional 528 Headers HeadersInit 529 530 FFI_USE_Status bool // for Status. 531 532 FFI_USE bool 533 } 534 535 // FromRef calls UpdateFrom and returns a ResponseInit with all fields set. 536 func (p ResponseInit) FromRef(ref js.Ref) ResponseInit { 537 p.UpdateFrom(ref) 538 return p 539 } 540 541 // New creates a new ResponseInit in the application heap. 542 func (p ResponseInit) New() js.Ref { 543 return bindings.ResponseInitJSLoad( 544 js.Pointer(&p), js.True, 0, 545 ) 546 } 547 548 // UpdateFrom copies value of all fields of the heap object to p. 549 func (p *ResponseInit) UpdateFrom(ref js.Ref) { 550 bindings.ResponseInitJSStore( 551 js.Pointer(p), ref, 552 ) 553 } 554 555 // Update writes all fields of the p to the heap object referenced by ref. 556 func (p *ResponseInit) Update(ref js.Ref) { 557 bindings.ResponseInitJSLoad( 558 js.Pointer(p), js.False, ref, 559 ) 560 } 561 562 // FreeMembers frees fields with heap reference, if recursive is true 563 // free all heap references reachable from p. 564 func (p *ResponseInit) FreeMembers(recursive bool) { 565 js.Free( 566 p.StatusText.Ref(), 567 p.Headers.Ref(), 568 ) 569 p.StatusText = p.StatusText.FromRef(js.Undefined) 570 p.Headers = p.Headers.FromRef(js.Undefined) 571 } 572 573 type ResponseType uint32 574 575 const ( 576 _ ResponseType = iota 577 578 ResponseType_BASIC 579 ResponseType_CORS 580 ResponseType_DEFAULT 581 ResponseType_ERROR 582 ResponseType_OPAQUE 583 ResponseType_OPAQUEREDIRECT 584 ) 585 586 func (ResponseType) FromRef(str js.Ref) ResponseType { 587 return ResponseType(bindings.ConstOfResponseType(str)) 588 } 589 590 func (x ResponseType) String() (string, bool) { 591 switch x { 592 case ResponseType_BASIC: 593 return "basic", true 594 case ResponseType_CORS: 595 return "cors", true 596 case ResponseType_DEFAULT: 597 return "default", true 598 case ResponseType_ERROR: 599 return "error", true 600 case ResponseType_OPAQUE: 601 return "opaque", true 602 case ResponseType_OPAQUEREDIRECT: 603 return "opaqueredirect", true 604 default: 605 return "", false 606 } 607 } 608 609 func NewResponse(body BodyInit, init ResponseInit) (ret Response) { 610 ret.ref = bindings.NewResponseByResponse( 611 body.Ref(), 612 js.Pointer(&init)) 613 return 614 } 615 616 func NewResponseByResponse1(body BodyInit) (ret Response) { 617 ret.ref = bindings.NewResponseByResponse1( 618 body.Ref()) 619 return 620 } 621 622 func NewResponseByResponse2() (ret Response) { 623 ret.ref = bindings.NewResponseByResponse2() 624 return 625 } 626 627 type Response struct { 628 ref js.Ref 629 } 630 631 func (this Response) Once() Response { 632 this.ref.Once() 633 return this 634 } 635 636 func (this Response) Ref() js.Ref { 637 return this.ref 638 } 639 640 func (this Response) FromRef(ref js.Ref) Response { 641 this.ref = ref 642 return this 643 } 644 645 func (this Response) Free() { 646 this.ref.Free() 647 } 648 649 // Type returns the value of property "Response.type". 650 // 651 // It returns ok=false if there is no such property. 652 func (this Response) Type() (ret ResponseType, ok bool) { 653 ok = js.True == bindings.GetResponseType( 654 this.ref, js.Pointer(&ret), 655 ) 656 return 657 } 658 659 // Url returns the value of property "Response.url". 660 // 661 // It returns ok=false if there is no such property. 662 func (this Response) Url() (ret js.String, ok bool) { 663 ok = js.True == bindings.GetResponseUrl( 664 this.ref, js.Pointer(&ret), 665 ) 666 return 667 } 668 669 // Redirected returns the value of property "Response.redirected". 670 // 671 // It returns ok=false if there is no such property. 672 func (this Response) Redirected() (ret bool, ok bool) { 673 ok = js.True == bindings.GetResponseRedirected( 674 this.ref, js.Pointer(&ret), 675 ) 676 return 677 } 678 679 // Status returns the value of property "Response.status". 680 // 681 // It returns ok=false if there is no such property. 682 func (this Response) Status() (ret uint16, ok bool) { 683 ok = js.True == bindings.GetResponseStatus( 684 this.ref, js.Pointer(&ret), 685 ) 686 return 687 } 688 689 // Ok returns the value of property "Response.ok". 690 // 691 // It returns ok=false if there is no such property. 692 func (this Response) Ok() (ret bool, ok bool) { 693 ok = js.True == bindings.GetResponseOk( 694 this.ref, js.Pointer(&ret), 695 ) 696 return 697 } 698 699 // StatusText returns the value of property "Response.statusText". 700 // 701 // It returns ok=false if there is no such property. 702 func (this Response) StatusText() (ret js.String, ok bool) { 703 ok = js.True == bindings.GetResponseStatusText( 704 this.ref, js.Pointer(&ret), 705 ) 706 return 707 } 708 709 // Headers returns the value of property "Response.headers". 710 // 711 // It returns ok=false if there is no such property. 712 func (this Response) Headers() (ret Headers, ok bool) { 713 ok = js.True == bindings.GetResponseHeaders( 714 this.ref, js.Pointer(&ret), 715 ) 716 return 717 } 718 719 // Body returns the value of property "Response.body". 720 // 721 // It returns ok=false if there is no such property. 722 func (this Response) Body() (ret ReadableStream, ok bool) { 723 ok = js.True == bindings.GetResponseBody( 724 this.ref, js.Pointer(&ret), 725 ) 726 return 727 } 728 729 // BodyUsed returns the value of property "Response.bodyUsed". 730 // 731 // It returns ok=false if there is no such property. 732 func (this Response) BodyUsed() (ret bool, ok bool) { 733 ok = js.True == bindings.GetResponseBodyUsed( 734 this.ref, js.Pointer(&ret), 735 ) 736 return 737 } 738 739 // HasFuncError returns true if the static method "Response.error" exists. 740 func (this Response) HasFuncError() bool { 741 return js.True == bindings.HasFuncResponseError( 742 this.ref, 743 ) 744 } 745 746 // FuncError returns the static method "Response.error". 747 func (this Response) FuncError() (fn js.Func[func() Response]) { 748 bindings.FuncResponseError( 749 this.ref, js.Pointer(&fn), 750 ) 751 return 752 } 753 754 // Error calls the static method "Response.error". 755 func (this Response) Error() (ret Response) { 756 bindings.CallResponseError( 757 this.ref, js.Pointer(&ret), 758 ) 759 760 return 761 } 762 763 // TryError calls the static method "Response.error" 764 // in a try/catch block and returns (_, err, ok = false) when it went through 765 // the catch clause. 766 func (this Response) TryError() (ret Response, exception js.Any, ok bool) { 767 ok = js.True == bindings.TryResponseError( 768 this.ref, js.Pointer(&ret), js.Pointer(&exception), 769 ) 770 771 return 772 } 773 774 // HasFuncRedirect returns true if the static method "Response.redirect" exists. 775 func (this Response) HasFuncRedirect() bool { 776 return js.True == bindings.HasFuncResponseRedirect( 777 this.ref, 778 ) 779 } 780 781 // FuncRedirect returns the static method "Response.redirect". 782 func (this Response) FuncRedirect() (fn js.Func[func(url js.String, status uint16) Response]) { 783 bindings.FuncResponseRedirect( 784 this.ref, js.Pointer(&fn), 785 ) 786 return 787 } 788 789 // Redirect calls the static method "Response.redirect". 790 func (this Response) Redirect(url js.String, status uint16) (ret Response) { 791 bindings.CallResponseRedirect( 792 this.ref, js.Pointer(&ret), 793 url.Ref(), 794 uint32(status), 795 ) 796 797 return 798 } 799 800 // TryRedirect calls the static method "Response.redirect" 801 // in a try/catch block and returns (_, err, ok = false) when it went through 802 // the catch clause. 803 func (this Response) TryRedirect(url js.String, status uint16) (ret Response, exception js.Any, ok bool) { 804 ok = js.True == bindings.TryResponseRedirect( 805 this.ref, js.Pointer(&ret), js.Pointer(&exception), 806 url.Ref(), 807 uint32(status), 808 ) 809 810 return 811 } 812 813 // HasFuncRedirect1 returns true if the static method "Response.redirect" exists. 814 func (this Response) HasFuncRedirect1() bool { 815 return js.True == bindings.HasFuncResponseRedirect1( 816 this.ref, 817 ) 818 } 819 820 // FuncRedirect1 returns the static method "Response.redirect". 821 func (this Response) FuncRedirect1() (fn js.Func[func(url js.String) Response]) { 822 bindings.FuncResponseRedirect1( 823 this.ref, js.Pointer(&fn), 824 ) 825 return 826 } 827 828 // Redirect1 calls the static method "Response.redirect". 829 func (this Response) Redirect1(url js.String) (ret Response) { 830 bindings.CallResponseRedirect1( 831 this.ref, js.Pointer(&ret), 832 url.Ref(), 833 ) 834 835 return 836 } 837 838 // TryRedirect1 calls the static method "Response.redirect" 839 // in a try/catch block and returns (_, err, ok = false) when it went through 840 // the catch clause. 841 func (this Response) TryRedirect1(url js.String) (ret Response, exception js.Any, ok bool) { 842 ok = js.True == bindings.TryResponseRedirect1( 843 this.ref, js.Pointer(&ret), js.Pointer(&exception), 844 url.Ref(), 845 ) 846 847 return 848 } 849 850 // HasFuncJson returns true if the static method "Response.json" exists. 851 func (this Response) HasFuncJson() bool { 852 return js.True == bindings.HasFuncResponseJson( 853 this.ref, 854 ) 855 } 856 857 // FuncJson returns the static method "Response.json". 858 func (this Response) FuncJson() (fn js.Func[func(data js.Any, init ResponseInit) Response]) { 859 bindings.FuncResponseJson( 860 this.ref, js.Pointer(&fn), 861 ) 862 return 863 } 864 865 // Json calls the static method "Response.json". 866 func (this Response) Json(data js.Any, init ResponseInit) (ret Response) { 867 bindings.CallResponseJson( 868 this.ref, js.Pointer(&ret), 869 data.Ref(), 870 js.Pointer(&init), 871 ) 872 873 return 874 } 875 876 // TryJson calls the static method "Response.json" 877 // in a try/catch block and returns (_, err, ok = false) when it went through 878 // the catch clause. 879 func (this Response) TryJson(data js.Any, init ResponseInit) (ret Response, exception js.Any, ok bool) { 880 ok = js.True == bindings.TryResponseJson( 881 this.ref, js.Pointer(&ret), js.Pointer(&exception), 882 data.Ref(), 883 js.Pointer(&init), 884 ) 885 886 return 887 } 888 889 // HasFuncJson1 returns true if the static method "Response.json" exists. 890 func (this Response) HasFuncJson1() bool { 891 return js.True == bindings.HasFuncResponseJson1( 892 this.ref, 893 ) 894 } 895 896 // FuncJson1 returns the static method "Response.json". 897 func (this Response) FuncJson1() (fn js.Func[func(data js.Any) Response]) { 898 bindings.FuncResponseJson1( 899 this.ref, js.Pointer(&fn), 900 ) 901 return 902 } 903 904 // Json1 calls the static method "Response.json". 905 func (this Response) Json1(data js.Any) (ret Response) { 906 bindings.CallResponseJson1( 907 this.ref, js.Pointer(&ret), 908 data.Ref(), 909 ) 910 911 return 912 } 913 914 // TryJson1 calls the static method "Response.json" 915 // in a try/catch block and returns (_, err, ok = false) when it went through 916 // the catch clause. 917 func (this Response) TryJson1(data js.Any) (ret Response, exception js.Any, ok bool) { 918 ok = js.True == bindings.TryResponseJson1( 919 this.ref, js.Pointer(&ret), js.Pointer(&exception), 920 data.Ref(), 921 ) 922 923 return 924 } 925 926 // HasFuncClone returns true if the method "Response.clone" exists. 927 func (this Response) HasFuncClone() bool { 928 return js.True == bindings.HasFuncResponseClone( 929 this.ref, 930 ) 931 } 932 933 // FuncClone returns the method "Response.clone". 934 func (this Response) FuncClone() (fn js.Func[func() Response]) { 935 bindings.FuncResponseClone( 936 this.ref, js.Pointer(&fn), 937 ) 938 return 939 } 940 941 // Clone calls the method "Response.clone". 942 func (this Response) Clone() (ret Response) { 943 bindings.CallResponseClone( 944 this.ref, js.Pointer(&ret), 945 ) 946 947 return 948 } 949 950 // TryClone calls the method "Response.clone" 951 // in a try/catch block and returns (_, err, ok = false) when it went through 952 // the catch clause. 953 func (this Response) TryClone() (ret Response, exception js.Any, ok bool) { 954 ok = js.True == bindings.TryResponseClone( 955 this.ref, js.Pointer(&ret), js.Pointer(&exception), 956 ) 957 958 return 959 } 960 961 // HasFuncArrayBuffer returns true if the method "Response.arrayBuffer" exists. 962 func (this Response) HasFuncArrayBuffer() bool { 963 return js.True == bindings.HasFuncResponseArrayBuffer( 964 this.ref, 965 ) 966 } 967 968 // FuncArrayBuffer returns the method "Response.arrayBuffer". 969 func (this Response) FuncArrayBuffer() (fn js.Func[func() js.Promise[js.ArrayBuffer]]) { 970 bindings.FuncResponseArrayBuffer( 971 this.ref, js.Pointer(&fn), 972 ) 973 return 974 } 975 976 // ArrayBuffer calls the method "Response.arrayBuffer". 977 func (this Response) ArrayBuffer() (ret js.Promise[js.ArrayBuffer]) { 978 bindings.CallResponseArrayBuffer( 979 this.ref, js.Pointer(&ret), 980 ) 981 982 return 983 } 984 985 // TryArrayBuffer calls the method "Response.arrayBuffer" 986 // in a try/catch block and returns (_, err, ok = false) when it went through 987 // the catch clause. 988 func (this Response) TryArrayBuffer() (ret js.Promise[js.ArrayBuffer], exception js.Any, ok bool) { 989 ok = js.True == bindings.TryResponseArrayBuffer( 990 this.ref, js.Pointer(&ret), js.Pointer(&exception), 991 ) 992 993 return 994 } 995 996 // HasFuncBlob returns true if the method "Response.blob" exists. 997 func (this Response) HasFuncBlob() bool { 998 return js.True == bindings.HasFuncResponseBlob( 999 this.ref, 1000 ) 1001 } 1002 1003 // FuncBlob returns the method "Response.blob". 1004 func (this Response) FuncBlob() (fn js.Func[func() js.Promise[Blob]]) { 1005 bindings.FuncResponseBlob( 1006 this.ref, js.Pointer(&fn), 1007 ) 1008 return 1009 } 1010 1011 // Blob calls the method "Response.blob". 1012 func (this Response) Blob() (ret js.Promise[Blob]) { 1013 bindings.CallResponseBlob( 1014 this.ref, js.Pointer(&ret), 1015 ) 1016 1017 return 1018 } 1019 1020 // TryBlob calls the method "Response.blob" 1021 // in a try/catch block and returns (_, err, ok = false) when it went through 1022 // the catch clause. 1023 func (this Response) TryBlob() (ret js.Promise[Blob], exception js.Any, ok bool) { 1024 ok = js.True == bindings.TryResponseBlob( 1025 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1026 ) 1027 1028 return 1029 } 1030 1031 // HasFuncFormData returns true if the method "Response.formData" exists. 1032 func (this Response) HasFuncFormData() bool { 1033 return js.True == bindings.HasFuncResponseFormData( 1034 this.ref, 1035 ) 1036 } 1037 1038 // FuncFormData returns the method "Response.formData". 1039 func (this Response) FuncFormData() (fn js.Func[func() js.Promise[FormData]]) { 1040 bindings.FuncResponseFormData( 1041 this.ref, js.Pointer(&fn), 1042 ) 1043 return 1044 } 1045 1046 // FormData calls the method "Response.formData". 1047 func (this Response) FormData() (ret js.Promise[FormData]) { 1048 bindings.CallResponseFormData( 1049 this.ref, js.Pointer(&ret), 1050 ) 1051 1052 return 1053 } 1054 1055 // TryFormData calls the method "Response.formData" 1056 // in a try/catch block and returns (_, err, ok = false) when it went through 1057 // the catch clause. 1058 func (this Response) TryFormData() (ret js.Promise[FormData], exception js.Any, ok bool) { 1059 ok = js.True == bindings.TryResponseFormData( 1060 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1061 ) 1062 1063 return 1064 } 1065 1066 // HasFuncJson2 returns true if the method "Response.json" exists. 1067 func (this Response) HasFuncJson2() bool { 1068 return js.True == bindings.HasFuncResponseJson2( 1069 this.ref, 1070 ) 1071 } 1072 1073 // FuncJson2 returns the method "Response.json". 1074 func (this Response) FuncJson2() (fn js.Func[func() js.Promise[js.Any]]) { 1075 bindings.FuncResponseJson2( 1076 this.ref, js.Pointer(&fn), 1077 ) 1078 return 1079 } 1080 1081 // Json2 calls the method "Response.json". 1082 func (this Response) Json2() (ret js.Promise[js.Any]) { 1083 bindings.CallResponseJson2( 1084 this.ref, js.Pointer(&ret), 1085 ) 1086 1087 return 1088 } 1089 1090 // TryJson2 calls the method "Response.json" 1091 // in a try/catch block and returns (_, err, ok = false) when it went through 1092 // the catch clause. 1093 func (this Response) TryJson2() (ret js.Promise[js.Any], exception js.Any, ok bool) { 1094 ok = js.True == bindings.TryResponseJson2( 1095 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1096 ) 1097 1098 return 1099 } 1100 1101 // HasFuncText returns true if the method "Response.text" exists. 1102 func (this Response) HasFuncText() bool { 1103 return js.True == bindings.HasFuncResponseText( 1104 this.ref, 1105 ) 1106 } 1107 1108 // FuncText returns the method "Response.text". 1109 func (this Response) FuncText() (fn js.Func[func() js.Promise[js.String]]) { 1110 bindings.FuncResponseText( 1111 this.ref, js.Pointer(&fn), 1112 ) 1113 return 1114 } 1115 1116 // Text calls the method "Response.text". 1117 func (this Response) Text() (ret js.Promise[js.String]) { 1118 bindings.CallResponseText( 1119 this.ref, js.Pointer(&ret), 1120 ) 1121 1122 return 1123 } 1124 1125 // TryText calls the method "Response.text" 1126 // in a try/catch block and returns (_, err, ok = false) when it went through 1127 // the catch clause. 1128 func (this Response) TryText() (ret js.Promise[js.String], exception js.Any, ok bool) { 1129 ok = js.True == bindings.TryResponseText( 1130 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1131 ) 1132 1133 return 1134 } 1135 1136 type BackgroundFetchRecord struct { 1137 ref js.Ref 1138 } 1139 1140 func (this BackgroundFetchRecord) Once() BackgroundFetchRecord { 1141 this.ref.Once() 1142 return this 1143 } 1144 1145 func (this BackgroundFetchRecord) Ref() js.Ref { 1146 return this.ref 1147 } 1148 1149 func (this BackgroundFetchRecord) FromRef(ref js.Ref) BackgroundFetchRecord { 1150 this.ref = ref 1151 return this 1152 } 1153 1154 func (this BackgroundFetchRecord) Free() { 1155 this.ref.Free() 1156 } 1157 1158 // Request returns the value of property "BackgroundFetchRecord.request". 1159 // 1160 // It returns ok=false if there is no such property. 1161 func (this BackgroundFetchRecord) Request() (ret Request, ok bool) { 1162 ok = js.True == bindings.GetBackgroundFetchRecordRequest( 1163 this.ref, js.Pointer(&ret), 1164 ) 1165 return 1166 } 1167 1168 // ResponseReady returns the value of property "BackgroundFetchRecord.responseReady". 1169 // 1170 // It returns ok=false if there is no such property. 1171 func (this BackgroundFetchRecord) ResponseReady() (ret js.Promise[Response], ok bool) { 1172 ok = js.True == bindings.GetBackgroundFetchRecordResponseReady( 1173 this.ref, js.Pointer(&ret), 1174 ) 1175 return 1176 } 1177 1178 type CacheQueryOptions struct { 1179 // IgnoreSearch is "CacheQueryOptions.ignoreSearch" 1180 // 1181 // Optional, defaults to false. 1182 // 1183 // NOTE: FFI_USE_IgnoreSearch MUST be set to true to make this field effective. 1184 IgnoreSearch bool 1185 // IgnoreMethod is "CacheQueryOptions.ignoreMethod" 1186 // 1187 // Optional, defaults to false. 1188 // 1189 // NOTE: FFI_USE_IgnoreMethod MUST be set to true to make this field effective. 1190 IgnoreMethod bool 1191 // IgnoreVary is "CacheQueryOptions.ignoreVary" 1192 // 1193 // Optional, defaults to false. 1194 // 1195 // NOTE: FFI_USE_IgnoreVary MUST be set to true to make this field effective. 1196 IgnoreVary bool 1197 1198 FFI_USE_IgnoreSearch bool // for IgnoreSearch. 1199 FFI_USE_IgnoreMethod bool // for IgnoreMethod. 1200 FFI_USE_IgnoreVary bool // for IgnoreVary. 1201 1202 FFI_USE bool 1203 } 1204 1205 // FromRef calls UpdateFrom and returns a CacheQueryOptions with all fields set. 1206 func (p CacheQueryOptions) FromRef(ref js.Ref) CacheQueryOptions { 1207 p.UpdateFrom(ref) 1208 return p 1209 } 1210 1211 // New creates a new CacheQueryOptions in the application heap. 1212 func (p CacheQueryOptions) New() js.Ref { 1213 return bindings.CacheQueryOptionsJSLoad( 1214 js.Pointer(&p), js.True, 0, 1215 ) 1216 } 1217 1218 // UpdateFrom copies value of all fields of the heap object to p. 1219 func (p *CacheQueryOptions) UpdateFrom(ref js.Ref) { 1220 bindings.CacheQueryOptionsJSStore( 1221 js.Pointer(p), ref, 1222 ) 1223 } 1224 1225 // Update writes all fields of the p to the heap object referenced by ref. 1226 func (p *CacheQueryOptions) Update(ref js.Ref) { 1227 bindings.CacheQueryOptionsJSLoad( 1228 js.Pointer(p), js.False, ref, 1229 ) 1230 } 1231 1232 // FreeMembers frees fields with heap reference, if recursive is true 1233 // free all heap references reachable from p. 1234 func (p *CacheQueryOptions) FreeMembers(recursive bool) { 1235 } 1236 1237 type BackgroundFetchResult uint32 1238 1239 const ( 1240 _ BackgroundFetchResult = iota 1241 1242 BackgroundFetchResult_ 1243 BackgroundFetchResult_SUCCESS 1244 BackgroundFetchResult_FAILURE 1245 ) 1246 1247 func (BackgroundFetchResult) FromRef(str js.Ref) BackgroundFetchResult { 1248 return BackgroundFetchResult(bindings.ConstOfBackgroundFetchResult(str)) 1249 } 1250 1251 func (x BackgroundFetchResult) String() (string, bool) { 1252 switch x { 1253 case BackgroundFetchResult_: 1254 return "", true 1255 case BackgroundFetchResult_SUCCESS: 1256 return "success", true 1257 case BackgroundFetchResult_FAILURE: 1258 return "failure", true 1259 default: 1260 return "", false 1261 } 1262 } 1263 1264 type BackgroundFetchFailureReason uint32 1265 1266 const ( 1267 _ BackgroundFetchFailureReason = iota 1268 1269 BackgroundFetchFailureReason_ 1270 BackgroundFetchFailureReason_ABORTED 1271 BackgroundFetchFailureReason_BAD_STATUS 1272 BackgroundFetchFailureReason_FETCH_ERROR 1273 BackgroundFetchFailureReason_QUOTA_EXCEEDED 1274 BackgroundFetchFailureReason_DOWNLOAD_TOTAL_EXCEEDED 1275 ) 1276 1277 func (BackgroundFetchFailureReason) FromRef(str js.Ref) BackgroundFetchFailureReason { 1278 return BackgroundFetchFailureReason(bindings.ConstOfBackgroundFetchFailureReason(str)) 1279 } 1280 1281 func (x BackgroundFetchFailureReason) String() (string, bool) { 1282 switch x { 1283 case BackgroundFetchFailureReason_: 1284 return "", true 1285 case BackgroundFetchFailureReason_ABORTED: 1286 return "aborted", true 1287 case BackgroundFetchFailureReason_BAD_STATUS: 1288 return "bad-status", true 1289 case BackgroundFetchFailureReason_FETCH_ERROR: 1290 return "fetch-error", true 1291 case BackgroundFetchFailureReason_QUOTA_EXCEEDED: 1292 return "quota-exceeded", true 1293 case BackgroundFetchFailureReason_DOWNLOAD_TOTAL_EXCEEDED: 1294 return "download-total-exceeded", true 1295 default: 1296 return "", false 1297 } 1298 } 1299 1300 type BackgroundFetchRegistration struct { 1301 EventTarget 1302 } 1303 1304 func (this BackgroundFetchRegistration) Once() BackgroundFetchRegistration { 1305 this.ref.Once() 1306 return this 1307 } 1308 1309 func (this BackgroundFetchRegistration) Ref() js.Ref { 1310 return this.EventTarget.Ref() 1311 } 1312 1313 func (this BackgroundFetchRegistration) FromRef(ref js.Ref) BackgroundFetchRegistration { 1314 this.EventTarget = this.EventTarget.FromRef(ref) 1315 return this 1316 } 1317 1318 func (this BackgroundFetchRegistration) Free() { 1319 this.ref.Free() 1320 } 1321 1322 // Id returns the value of property "BackgroundFetchRegistration.id". 1323 // 1324 // It returns ok=false if there is no such property. 1325 func (this BackgroundFetchRegistration) Id() (ret js.String, ok bool) { 1326 ok = js.True == bindings.GetBackgroundFetchRegistrationId( 1327 this.ref, js.Pointer(&ret), 1328 ) 1329 return 1330 } 1331 1332 // UploadTotal returns the value of property "BackgroundFetchRegistration.uploadTotal". 1333 // 1334 // It returns ok=false if there is no such property. 1335 func (this BackgroundFetchRegistration) UploadTotal() (ret uint64, ok bool) { 1336 ok = js.True == bindings.GetBackgroundFetchRegistrationUploadTotal( 1337 this.ref, js.Pointer(&ret), 1338 ) 1339 return 1340 } 1341 1342 // Uploaded returns the value of property "BackgroundFetchRegistration.uploaded". 1343 // 1344 // It returns ok=false if there is no such property. 1345 func (this BackgroundFetchRegistration) Uploaded() (ret uint64, ok bool) { 1346 ok = js.True == bindings.GetBackgroundFetchRegistrationUploaded( 1347 this.ref, js.Pointer(&ret), 1348 ) 1349 return 1350 } 1351 1352 // DownloadTotal returns the value of property "BackgroundFetchRegistration.downloadTotal". 1353 // 1354 // It returns ok=false if there is no such property. 1355 func (this BackgroundFetchRegistration) DownloadTotal() (ret uint64, ok bool) { 1356 ok = js.True == bindings.GetBackgroundFetchRegistrationDownloadTotal( 1357 this.ref, js.Pointer(&ret), 1358 ) 1359 return 1360 } 1361 1362 // Downloaded returns the value of property "BackgroundFetchRegistration.downloaded". 1363 // 1364 // It returns ok=false if there is no such property. 1365 func (this BackgroundFetchRegistration) Downloaded() (ret uint64, ok bool) { 1366 ok = js.True == bindings.GetBackgroundFetchRegistrationDownloaded( 1367 this.ref, js.Pointer(&ret), 1368 ) 1369 return 1370 } 1371 1372 // Result returns the value of property "BackgroundFetchRegistration.result". 1373 // 1374 // It returns ok=false if there is no such property. 1375 func (this BackgroundFetchRegistration) Result() (ret BackgroundFetchResult, ok bool) { 1376 ok = js.True == bindings.GetBackgroundFetchRegistrationResult( 1377 this.ref, js.Pointer(&ret), 1378 ) 1379 return 1380 } 1381 1382 // FailureReason returns the value of property "BackgroundFetchRegistration.failureReason". 1383 // 1384 // It returns ok=false if there is no such property. 1385 func (this BackgroundFetchRegistration) FailureReason() (ret BackgroundFetchFailureReason, ok bool) { 1386 ok = js.True == bindings.GetBackgroundFetchRegistrationFailureReason( 1387 this.ref, js.Pointer(&ret), 1388 ) 1389 return 1390 } 1391 1392 // RecordsAvailable returns the value of property "BackgroundFetchRegistration.recordsAvailable". 1393 // 1394 // It returns ok=false if there is no such property. 1395 func (this BackgroundFetchRegistration) RecordsAvailable() (ret bool, ok bool) { 1396 ok = js.True == bindings.GetBackgroundFetchRegistrationRecordsAvailable( 1397 this.ref, js.Pointer(&ret), 1398 ) 1399 return 1400 } 1401 1402 // HasFuncAbort returns true if the method "BackgroundFetchRegistration.abort" exists. 1403 func (this BackgroundFetchRegistration) HasFuncAbort() bool { 1404 return js.True == bindings.HasFuncBackgroundFetchRegistrationAbort( 1405 this.ref, 1406 ) 1407 } 1408 1409 // FuncAbort returns the method "BackgroundFetchRegistration.abort". 1410 func (this BackgroundFetchRegistration) FuncAbort() (fn js.Func[func() js.Promise[js.Boolean]]) { 1411 bindings.FuncBackgroundFetchRegistrationAbort( 1412 this.ref, js.Pointer(&fn), 1413 ) 1414 return 1415 } 1416 1417 // Abort calls the method "BackgroundFetchRegistration.abort". 1418 func (this BackgroundFetchRegistration) Abort() (ret js.Promise[js.Boolean]) { 1419 bindings.CallBackgroundFetchRegistrationAbort( 1420 this.ref, js.Pointer(&ret), 1421 ) 1422 1423 return 1424 } 1425 1426 // TryAbort calls the method "BackgroundFetchRegistration.abort" 1427 // in a try/catch block and returns (_, err, ok = false) when it went through 1428 // the catch clause. 1429 func (this BackgroundFetchRegistration) TryAbort() (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 1430 ok = js.True == bindings.TryBackgroundFetchRegistrationAbort( 1431 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1432 ) 1433 1434 return 1435 } 1436 1437 // HasFuncMatch returns true if the method "BackgroundFetchRegistration.match" exists. 1438 func (this BackgroundFetchRegistration) HasFuncMatch() bool { 1439 return js.True == bindings.HasFuncBackgroundFetchRegistrationMatch( 1440 this.ref, 1441 ) 1442 } 1443 1444 // FuncMatch returns the method "BackgroundFetchRegistration.match". 1445 func (this BackgroundFetchRegistration) FuncMatch() (fn js.Func[func(request RequestInfo, options CacheQueryOptions) js.Promise[BackgroundFetchRecord]]) { 1446 bindings.FuncBackgroundFetchRegistrationMatch( 1447 this.ref, js.Pointer(&fn), 1448 ) 1449 return 1450 } 1451 1452 // Match calls the method "BackgroundFetchRegistration.match". 1453 func (this BackgroundFetchRegistration) Match(request RequestInfo, options CacheQueryOptions) (ret js.Promise[BackgroundFetchRecord]) { 1454 bindings.CallBackgroundFetchRegistrationMatch( 1455 this.ref, js.Pointer(&ret), 1456 request.Ref(), 1457 js.Pointer(&options), 1458 ) 1459 1460 return 1461 } 1462 1463 // TryMatch calls the method "BackgroundFetchRegistration.match" 1464 // in a try/catch block and returns (_, err, ok = false) when it went through 1465 // the catch clause. 1466 func (this BackgroundFetchRegistration) TryMatch(request RequestInfo, options CacheQueryOptions) (ret js.Promise[BackgroundFetchRecord], exception js.Any, ok bool) { 1467 ok = js.True == bindings.TryBackgroundFetchRegistrationMatch( 1468 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1469 request.Ref(), 1470 js.Pointer(&options), 1471 ) 1472 1473 return 1474 } 1475 1476 // HasFuncMatch1 returns true if the method "BackgroundFetchRegistration.match" exists. 1477 func (this BackgroundFetchRegistration) HasFuncMatch1() bool { 1478 return js.True == bindings.HasFuncBackgroundFetchRegistrationMatch1( 1479 this.ref, 1480 ) 1481 } 1482 1483 // FuncMatch1 returns the method "BackgroundFetchRegistration.match". 1484 func (this BackgroundFetchRegistration) FuncMatch1() (fn js.Func[func(request RequestInfo) js.Promise[BackgroundFetchRecord]]) { 1485 bindings.FuncBackgroundFetchRegistrationMatch1( 1486 this.ref, js.Pointer(&fn), 1487 ) 1488 return 1489 } 1490 1491 // Match1 calls the method "BackgroundFetchRegistration.match". 1492 func (this BackgroundFetchRegistration) Match1(request RequestInfo) (ret js.Promise[BackgroundFetchRecord]) { 1493 bindings.CallBackgroundFetchRegistrationMatch1( 1494 this.ref, js.Pointer(&ret), 1495 request.Ref(), 1496 ) 1497 1498 return 1499 } 1500 1501 // TryMatch1 calls the method "BackgroundFetchRegistration.match" 1502 // in a try/catch block and returns (_, err, ok = false) when it went through 1503 // the catch clause. 1504 func (this BackgroundFetchRegistration) TryMatch1(request RequestInfo) (ret js.Promise[BackgroundFetchRecord], exception js.Any, ok bool) { 1505 ok = js.True == bindings.TryBackgroundFetchRegistrationMatch1( 1506 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1507 request.Ref(), 1508 ) 1509 1510 return 1511 } 1512 1513 // HasFuncMatchAll returns true if the method "BackgroundFetchRegistration.matchAll" exists. 1514 func (this BackgroundFetchRegistration) HasFuncMatchAll() bool { 1515 return js.True == bindings.HasFuncBackgroundFetchRegistrationMatchAll( 1516 this.ref, 1517 ) 1518 } 1519 1520 // FuncMatchAll returns the method "BackgroundFetchRegistration.matchAll". 1521 func (this BackgroundFetchRegistration) FuncMatchAll() (fn js.Func[func(request RequestInfo, options CacheQueryOptions) js.Promise[js.Array[BackgroundFetchRecord]]]) { 1522 bindings.FuncBackgroundFetchRegistrationMatchAll( 1523 this.ref, js.Pointer(&fn), 1524 ) 1525 return 1526 } 1527 1528 // MatchAll calls the method "BackgroundFetchRegistration.matchAll". 1529 func (this BackgroundFetchRegistration) MatchAll(request RequestInfo, options CacheQueryOptions) (ret js.Promise[js.Array[BackgroundFetchRecord]]) { 1530 bindings.CallBackgroundFetchRegistrationMatchAll( 1531 this.ref, js.Pointer(&ret), 1532 request.Ref(), 1533 js.Pointer(&options), 1534 ) 1535 1536 return 1537 } 1538 1539 // TryMatchAll calls the method "BackgroundFetchRegistration.matchAll" 1540 // in a try/catch block and returns (_, err, ok = false) when it went through 1541 // the catch clause. 1542 func (this BackgroundFetchRegistration) TryMatchAll(request RequestInfo, options CacheQueryOptions) (ret js.Promise[js.Array[BackgroundFetchRecord]], exception js.Any, ok bool) { 1543 ok = js.True == bindings.TryBackgroundFetchRegistrationMatchAll( 1544 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1545 request.Ref(), 1546 js.Pointer(&options), 1547 ) 1548 1549 return 1550 } 1551 1552 // HasFuncMatchAll1 returns true if the method "BackgroundFetchRegistration.matchAll" exists. 1553 func (this BackgroundFetchRegistration) HasFuncMatchAll1() bool { 1554 return js.True == bindings.HasFuncBackgroundFetchRegistrationMatchAll1( 1555 this.ref, 1556 ) 1557 } 1558 1559 // FuncMatchAll1 returns the method "BackgroundFetchRegistration.matchAll". 1560 func (this BackgroundFetchRegistration) FuncMatchAll1() (fn js.Func[func(request RequestInfo) js.Promise[js.Array[BackgroundFetchRecord]]]) { 1561 bindings.FuncBackgroundFetchRegistrationMatchAll1( 1562 this.ref, js.Pointer(&fn), 1563 ) 1564 return 1565 } 1566 1567 // MatchAll1 calls the method "BackgroundFetchRegistration.matchAll". 1568 func (this BackgroundFetchRegistration) MatchAll1(request RequestInfo) (ret js.Promise[js.Array[BackgroundFetchRecord]]) { 1569 bindings.CallBackgroundFetchRegistrationMatchAll1( 1570 this.ref, js.Pointer(&ret), 1571 request.Ref(), 1572 ) 1573 1574 return 1575 } 1576 1577 // TryMatchAll1 calls the method "BackgroundFetchRegistration.matchAll" 1578 // in a try/catch block and returns (_, err, ok = false) when it went through 1579 // the catch clause. 1580 func (this BackgroundFetchRegistration) TryMatchAll1(request RequestInfo) (ret js.Promise[js.Array[BackgroundFetchRecord]], exception js.Any, ok bool) { 1581 ok = js.True == bindings.TryBackgroundFetchRegistrationMatchAll1( 1582 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1583 request.Ref(), 1584 ) 1585 1586 return 1587 } 1588 1589 // HasFuncMatchAll2 returns true if the method "BackgroundFetchRegistration.matchAll" exists. 1590 func (this BackgroundFetchRegistration) HasFuncMatchAll2() bool { 1591 return js.True == bindings.HasFuncBackgroundFetchRegistrationMatchAll2( 1592 this.ref, 1593 ) 1594 } 1595 1596 // FuncMatchAll2 returns the method "BackgroundFetchRegistration.matchAll". 1597 func (this BackgroundFetchRegistration) FuncMatchAll2() (fn js.Func[func() js.Promise[js.Array[BackgroundFetchRecord]]]) { 1598 bindings.FuncBackgroundFetchRegistrationMatchAll2( 1599 this.ref, js.Pointer(&fn), 1600 ) 1601 return 1602 } 1603 1604 // MatchAll2 calls the method "BackgroundFetchRegistration.matchAll". 1605 func (this BackgroundFetchRegistration) MatchAll2() (ret js.Promise[js.Array[BackgroundFetchRecord]]) { 1606 bindings.CallBackgroundFetchRegistrationMatchAll2( 1607 this.ref, js.Pointer(&ret), 1608 ) 1609 1610 return 1611 } 1612 1613 // TryMatchAll2 calls the method "BackgroundFetchRegistration.matchAll" 1614 // in a try/catch block and returns (_, err, ok = false) when it went through 1615 // the catch clause. 1616 func (this BackgroundFetchRegistration) TryMatchAll2() (ret js.Promise[js.Array[BackgroundFetchRecord]], exception js.Any, ok bool) { 1617 ok = js.True == bindings.TryBackgroundFetchRegistrationMatchAll2( 1618 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1619 ) 1620 1621 return 1622 } 1623 1624 type BackgroundFetchEventInit struct { 1625 // Registration is "BackgroundFetchEventInit.registration" 1626 // 1627 // Required 1628 Registration BackgroundFetchRegistration 1629 // Bubbles is "BackgroundFetchEventInit.bubbles" 1630 // 1631 // Optional, defaults to false. 1632 // 1633 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 1634 Bubbles bool 1635 // Cancelable is "BackgroundFetchEventInit.cancelable" 1636 // 1637 // Optional, defaults to false. 1638 // 1639 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 1640 Cancelable bool 1641 // Composed is "BackgroundFetchEventInit.composed" 1642 // 1643 // Optional, defaults to false. 1644 // 1645 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 1646 Composed bool 1647 1648 FFI_USE_Bubbles bool // for Bubbles. 1649 FFI_USE_Cancelable bool // for Cancelable. 1650 FFI_USE_Composed bool // for Composed. 1651 1652 FFI_USE bool 1653 } 1654 1655 // FromRef calls UpdateFrom and returns a BackgroundFetchEventInit with all fields set. 1656 func (p BackgroundFetchEventInit) FromRef(ref js.Ref) BackgroundFetchEventInit { 1657 p.UpdateFrom(ref) 1658 return p 1659 } 1660 1661 // New creates a new BackgroundFetchEventInit in the application heap. 1662 func (p BackgroundFetchEventInit) New() js.Ref { 1663 return bindings.BackgroundFetchEventInitJSLoad( 1664 js.Pointer(&p), js.True, 0, 1665 ) 1666 } 1667 1668 // UpdateFrom copies value of all fields of the heap object to p. 1669 func (p *BackgroundFetchEventInit) UpdateFrom(ref js.Ref) { 1670 bindings.BackgroundFetchEventInitJSStore( 1671 js.Pointer(p), ref, 1672 ) 1673 } 1674 1675 // Update writes all fields of the p to the heap object referenced by ref. 1676 func (p *BackgroundFetchEventInit) Update(ref js.Ref) { 1677 bindings.BackgroundFetchEventInitJSLoad( 1678 js.Pointer(p), js.False, ref, 1679 ) 1680 } 1681 1682 // FreeMembers frees fields with heap reference, if recursive is true 1683 // free all heap references reachable from p. 1684 func (p *BackgroundFetchEventInit) FreeMembers(recursive bool) { 1685 js.Free( 1686 p.Registration.Ref(), 1687 ) 1688 p.Registration = p.Registration.FromRef(js.Undefined) 1689 } 1690 1691 func NewBackgroundFetchEvent(typ js.String, init BackgroundFetchEventInit) (ret BackgroundFetchEvent) { 1692 ret.ref = bindings.NewBackgroundFetchEventByBackgroundFetchEvent( 1693 typ.Ref(), 1694 js.Pointer(&init)) 1695 return 1696 } 1697 1698 type BackgroundFetchEvent struct { 1699 ExtendableEvent 1700 } 1701 1702 func (this BackgroundFetchEvent) Once() BackgroundFetchEvent { 1703 this.ref.Once() 1704 return this 1705 } 1706 1707 func (this BackgroundFetchEvent) Ref() js.Ref { 1708 return this.ExtendableEvent.Ref() 1709 } 1710 1711 func (this BackgroundFetchEvent) FromRef(ref js.Ref) BackgroundFetchEvent { 1712 this.ExtendableEvent = this.ExtendableEvent.FromRef(ref) 1713 return this 1714 } 1715 1716 func (this BackgroundFetchEvent) Free() { 1717 this.ref.Free() 1718 } 1719 1720 // Registration returns the value of property "BackgroundFetchEvent.registration". 1721 // 1722 // It returns ok=false if there is no such property. 1723 func (this BackgroundFetchEvent) Registration() (ret BackgroundFetchRegistration, ok bool) { 1724 ok = js.True == bindings.GetBackgroundFetchEventRegistration( 1725 this.ref, js.Pointer(&ret), 1726 ) 1727 return 1728 } 1729 1730 type OneOf_Request_String_ArrayRequestInfo struct { 1731 ref js.Ref 1732 } 1733 1734 func (x OneOf_Request_String_ArrayRequestInfo) Ref() js.Ref { 1735 return x.ref 1736 } 1737 1738 func (x OneOf_Request_String_ArrayRequestInfo) Free() { 1739 x.ref.Free() 1740 } 1741 1742 func (x OneOf_Request_String_ArrayRequestInfo) FromRef(ref js.Ref) OneOf_Request_String_ArrayRequestInfo { 1743 return OneOf_Request_String_ArrayRequestInfo{ 1744 ref: ref, 1745 } 1746 } 1747 1748 func (x OneOf_Request_String_ArrayRequestInfo) Request() Request { 1749 return Request{}.FromRef(x.ref) 1750 } 1751 1752 func (x OneOf_Request_String_ArrayRequestInfo) String() js.String { 1753 return js.String{}.FromRef(x.ref) 1754 } 1755 1756 func (x OneOf_Request_String_ArrayRequestInfo) ArrayRequestInfo() js.Array[RequestInfo] { 1757 return js.Array[RequestInfo]{}.FromRef(x.ref) 1758 } 1759 1760 type ImageResource struct { 1761 // Src is "ImageResource.src" 1762 // 1763 // Required 1764 Src js.String 1765 // Sizes is "ImageResource.sizes" 1766 // 1767 // Optional 1768 Sizes js.String 1769 // Type is "ImageResource.type" 1770 // 1771 // Optional 1772 Type js.String 1773 // Label is "ImageResource.label" 1774 // 1775 // Optional 1776 Label js.String 1777 1778 FFI_USE bool 1779 } 1780 1781 // FromRef calls UpdateFrom and returns a ImageResource with all fields set. 1782 func (p ImageResource) FromRef(ref js.Ref) ImageResource { 1783 p.UpdateFrom(ref) 1784 return p 1785 } 1786 1787 // New creates a new ImageResource in the application heap. 1788 func (p ImageResource) New() js.Ref { 1789 return bindings.ImageResourceJSLoad( 1790 js.Pointer(&p), js.True, 0, 1791 ) 1792 } 1793 1794 // UpdateFrom copies value of all fields of the heap object to p. 1795 func (p *ImageResource) UpdateFrom(ref js.Ref) { 1796 bindings.ImageResourceJSStore( 1797 js.Pointer(p), ref, 1798 ) 1799 } 1800 1801 // Update writes all fields of the p to the heap object referenced by ref. 1802 func (p *ImageResource) Update(ref js.Ref) { 1803 bindings.ImageResourceJSLoad( 1804 js.Pointer(p), js.False, ref, 1805 ) 1806 } 1807 1808 // FreeMembers frees fields with heap reference, if recursive is true 1809 // free all heap references reachable from p. 1810 func (p *ImageResource) FreeMembers(recursive bool) { 1811 js.Free( 1812 p.Src.Ref(), 1813 p.Sizes.Ref(), 1814 p.Type.Ref(), 1815 p.Label.Ref(), 1816 ) 1817 p.Src = p.Src.FromRef(js.Undefined) 1818 p.Sizes = p.Sizes.FromRef(js.Undefined) 1819 p.Type = p.Type.FromRef(js.Undefined) 1820 p.Label = p.Label.FromRef(js.Undefined) 1821 } 1822 1823 type BackgroundFetchOptions struct { 1824 // DownloadTotal is "BackgroundFetchOptions.downloadTotal" 1825 // 1826 // Optional, defaults to 0. 1827 // 1828 // NOTE: FFI_USE_DownloadTotal MUST be set to true to make this field effective. 1829 DownloadTotal uint64 1830 // Icons is "BackgroundFetchOptions.icons" 1831 // 1832 // Optional 1833 Icons js.Array[ImageResource] 1834 // Title is "BackgroundFetchOptions.title" 1835 // 1836 // Optional 1837 Title js.String 1838 1839 FFI_USE_DownloadTotal bool // for DownloadTotal. 1840 1841 FFI_USE bool 1842 } 1843 1844 // FromRef calls UpdateFrom and returns a BackgroundFetchOptions with all fields set. 1845 func (p BackgroundFetchOptions) FromRef(ref js.Ref) BackgroundFetchOptions { 1846 p.UpdateFrom(ref) 1847 return p 1848 } 1849 1850 // New creates a new BackgroundFetchOptions in the application heap. 1851 func (p BackgroundFetchOptions) New() js.Ref { 1852 return bindings.BackgroundFetchOptionsJSLoad( 1853 js.Pointer(&p), js.True, 0, 1854 ) 1855 } 1856 1857 // UpdateFrom copies value of all fields of the heap object to p. 1858 func (p *BackgroundFetchOptions) UpdateFrom(ref js.Ref) { 1859 bindings.BackgroundFetchOptionsJSStore( 1860 js.Pointer(p), ref, 1861 ) 1862 } 1863 1864 // Update writes all fields of the p to the heap object referenced by ref. 1865 func (p *BackgroundFetchOptions) Update(ref js.Ref) { 1866 bindings.BackgroundFetchOptionsJSLoad( 1867 js.Pointer(p), js.False, ref, 1868 ) 1869 } 1870 1871 // FreeMembers frees fields with heap reference, if recursive is true 1872 // free all heap references reachable from p. 1873 func (p *BackgroundFetchOptions) FreeMembers(recursive bool) { 1874 js.Free( 1875 p.Icons.Ref(), 1876 p.Title.Ref(), 1877 ) 1878 p.Icons = p.Icons.FromRef(js.Undefined) 1879 p.Title = p.Title.FromRef(js.Undefined) 1880 } 1881 1882 type BackgroundFetchManager struct { 1883 ref js.Ref 1884 } 1885 1886 func (this BackgroundFetchManager) Once() BackgroundFetchManager { 1887 this.ref.Once() 1888 return this 1889 } 1890 1891 func (this BackgroundFetchManager) Ref() js.Ref { 1892 return this.ref 1893 } 1894 1895 func (this BackgroundFetchManager) FromRef(ref js.Ref) BackgroundFetchManager { 1896 this.ref = ref 1897 return this 1898 } 1899 1900 func (this BackgroundFetchManager) Free() { 1901 this.ref.Free() 1902 } 1903 1904 // HasFuncFetch returns true if the method "BackgroundFetchManager.fetch" exists. 1905 func (this BackgroundFetchManager) HasFuncFetch() bool { 1906 return js.True == bindings.HasFuncBackgroundFetchManagerFetch( 1907 this.ref, 1908 ) 1909 } 1910 1911 // FuncFetch returns the method "BackgroundFetchManager.fetch". 1912 func (this BackgroundFetchManager) FuncFetch() (fn js.Func[func(id js.String, requests OneOf_Request_String_ArrayRequestInfo, options BackgroundFetchOptions) js.Promise[BackgroundFetchRegistration]]) { 1913 bindings.FuncBackgroundFetchManagerFetch( 1914 this.ref, js.Pointer(&fn), 1915 ) 1916 return 1917 } 1918 1919 // Fetch calls the method "BackgroundFetchManager.fetch". 1920 func (this BackgroundFetchManager) Fetch(id js.String, requests OneOf_Request_String_ArrayRequestInfo, options BackgroundFetchOptions) (ret js.Promise[BackgroundFetchRegistration]) { 1921 bindings.CallBackgroundFetchManagerFetch( 1922 this.ref, js.Pointer(&ret), 1923 id.Ref(), 1924 requests.Ref(), 1925 js.Pointer(&options), 1926 ) 1927 1928 return 1929 } 1930 1931 // TryFetch calls the method "BackgroundFetchManager.fetch" 1932 // in a try/catch block and returns (_, err, ok = false) when it went through 1933 // the catch clause. 1934 func (this BackgroundFetchManager) TryFetch(id js.String, requests OneOf_Request_String_ArrayRequestInfo, options BackgroundFetchOptions) (ret js.Promise[BackgroundFetchRegistration], exception js.Any, ok bool) { 1935 ok = js.True == bindings.TryBackgroundFetchManagerFetch( 1936 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1937 id.Ref(), 1938 requests.Ref(), 1939 js.Pointer(&options), 1940 ) 1941 1942 return 1943 } 1944 1945 // HasFuncFetch1 returns true if the method "BackgroundFetchManager.fetch" exists. 1946 func (this BackgroundFetchManager) HasFuncFetch1() bool { 1947 return js.True == bindings.HasFuncBackgroundFetchManagerFetch1( 1948 this.ref, 1949 ) 1950 } 1951 1952 // FuncFetch1 returns the method "BackgroundFetchManager.fetch". 1953 func (this BackgroundFetchManager) FuncFetch1() (fn js.Func[func(id js.String, requests OneOf_Request_String_ArrayRequestInfo) js.Promise[BackgroundFetchRegistration]]) { 1954 bindings.FuncBackgroundFetchManagerFetch1( 1955 this.ref, js.Pointer(&fn), 1956 ) 1957 return 1958 } 1959 1960 // Fetch1 calls the method "BackgroundFetchManager.fetch". 1961 func (this BackgroundFetchManager) Fetch1(id js.String, requests OneOf_Request_String_ArrayRequestInfo) (ret js.Promise[BackgroundFetchRegistration]) { 1962 bindings.CallBackgroundFetchManagerFetch1( 1963 this.ref, js.Pointer(&ret), 1964 id.Ref(), 1965 requests.Ref(), 1966 ) 1967 1968 return 1969 } 1970 1971 // TryFetch1 calls the method "BackgroundFetchManager.fetch" 1972 // in a try/catch block and returns (_, err, ok = false) when it went through 1973 // the catch clause. 1974 func (this BackgroundFetchManager) TryFetch1(id js.String, requests OneOf_Request_String_ArrayRequestInfo) (ret js.Promise[BackgroundFetchRegistration], exception js.Any, ok bool) { 1975 ok = js.True == bindings.TryBackgroundFetchManagerFetch1( 1976 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1977 id.Ref(), 1978 requests.Ref(), 1979 ) 1980 1981 return 1982 } 1983 1984 // HasFuncGet returns true if the method "BackgroundFetchManager.get" exists. 1985 func (this BackgroundFetchManager) HasFuncGet() bool { 1986 return js.True == bindings.HasFuncBackgroundFetchManagerGet( 1987 this.ref, 1988 ) 1989 } 1990 1991 // FuncGet returns the method "BackgroundFetchManager.get". 1992 func (this BackgroundFetchManager) FuncGet() (fn js.Func[func(id js.String) js.Promise[BackgroundFetchRegistration]]) { 1993 bindings.FuncBackgroundFetchManagerGet( 1994 this.ref, js.Pointer(&fn), 1995 ) 1996 return 1997 } 1998 1999 // Get calls the method "BackgroundFetchManager.get". 2000 func (this BackgroundFetchManager) Get(id js.String) (ret js.Promise[BackgroundFetchRegistration]) { 2001 bindings.CallBackgroundFetchManagerGet( 2002 this.ref, js.Pointer(&ret), 2003 id.Ref(), 2004 ) 2005 2006 return 2007 } 2008 2009 // TryGet calls the method "BackgroundFetchManager.get" 2010 // in a try/catch block and returns (_, err, ok = false) when it went through 2011 // the catch clause. 2012 func (this BackgroundFetchManager) TryGet(id js.String) (ret js.Promise[BackgroundFetchRegistration], exception js.Any, ok bool) { 2013 ok = js.True == bindings.TryBackgroundFetchManagerGet( 2014 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2015 id.Ref(), 2016 ) 2017 2018 return 2019 } 2020 2021 // HasFuncGetIds returns true if the method "BackgroundFetchManager.getIds" exists. 2022 func (this BackgroundFetchManager) HasFuncGetIds() bool { 2023 return js.True == bindings.HasFuncBackgroundFetchManagerGetIds( 2024 this.ref, 2025 ) 2026 } 2027 2028 // FuncGetIds returns the method "BackgroundFetchManager.getIds". 2029 func (this BackgroundFetchManager) FuncGetIds() (fn js.Func[func() js.Promise[js.Array[js.String]]]) { 2030 bindings.FuncBackgroundFetchManagerGetIds( 2031 this.ref, js.Pointer(&fn), 2032 ) 2033 return 2034 } 2035 2036 // GetIds calls the method "BackgroundFetchManager.getIds". 2037 func (this BackgroundFetchManager) GetIds() (ret js.Promise[js.Array[js.String]]) { 2038 bindings.CallBackgroundFetchManagerGetIds( 2039 this.ref, js.Pointer(&ret), 2040 ) 2041 2042 return 2043 } 2044 2045 // TryGetIds calls the method "BackgroundFetchManager.getIds" 2046 // in a try/catch block and returns (_, err, ok = false) when it went through 2047 // the catch clause. 2048 func (this BackgroundFetchManager) TryGetIds() (ret js.Promise[js.Array[js.String]], exception js.Any, ok bool) { 2049 ok = js.True == bindings.TryBackgroundFetchManagerGetIds( 2050 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2051 ) 2052 2053 return 2054 } 2055 2056 type BackgroundFetchUIOptions struct { 2057 // Icons is "BackgroundFetchUIOptions.icons" 2058 // 2059 // Optional 2060 Icons js.Array[ImageResource] 2061 // Title is "BackgroundFetchUIOptions.title" 2062 // 2063 // Optional 2064 Title js.String 2065 2066 FFI_USE bool 2067 } 2068 2069 // FromRef calls UpdateFrom and returns a BackgroundFetchUIOptions with all fields set. 2070 func (p BackgroundFetchUIOptions) FromRef(ref js.Ref) BackgroundFetchUIOptions { 2071 p.UpdateFrom(ref) 2072 return p 2073 } 2074 2075 // New creates a new BackgroundFetchUIOptions in the application heap. 2076 func (p BackgroundFetchUIOptions) New() js.Ref { 2077 return bindings.BackgroundFetchUIOptionsJSLoad( 2078 js.Pointer(&p), js.True, 0, 2079 ) 2080 } 2081 2082 // UpdateFrom copies value of all fields of the heap object to p. 2083 func (p *BackgroundFetchUIOptions) UpdateFrom(ref js.Ref) { 2084 bindings.BackgroundFetchUIOptionsJSStore( 2085 js.Pointer(p), ref, 2086 ) 2087 } 2088 2089 // Update writes all fields of the p to the heap object referenced by ref. 2090 func (p *BackgroundFetchUIOptions) Update(ref js.Ref) { 2091 bindings.BackgroundFetchUIOptionsJSLoad( 2092 js.Pointer(p), js.False, ref, 2093 ) 2094 } 2095 2096 // FreeMembers frees fields with heap reference, if recursive is true 2097 // free all heap references reachable from p. 2098 func (p *BackgroundFetchUIOptions) FreeMembers(recursive bool) { 2099 js.Free( 2100 p.Icons.Ref(), 2101 p.Title.Ref(), 2102 ) 2103 p.Icons = p.Icons.FromRef(js.Undefined) 2104 p.Title = p.Title.FromRef(js.Undefined) 2105 } 2106 2107 func NewBackgroundFetchUpdateUIEvent(typ js.String, init BackgroundFetchEventInit) (ret BackgroundFetchUpdateUIEvent) { 2108 ret.ref = bindings.NewBackgroundFetchUpdateUIEventByBackgroundFetchUpdateUIEvent( 2109 typ.Ref(), 2110 js.Pointer(&init)) 2111 return 2112 } 2113 2114 type BackgroundFetchUpdateUIEvent struct { 2115 BackgroundFetchEvent 2116 } 2117 2118 func (this BackgroundFetchUpdateUIEvent) Once() BackgroundFetchUpdateUIEvent { 2119 this.ref.Once() 2120 return this 2121 } 2122 2123 func (this BackgroundFetchUpdateUIEvent) Ref() js.Ref { 2124 return this.BackgroundFetchEvent.Ref() 2125 } 2126 2127 func (this BackgroundFetchUpdateUIEvent) FromRef(ref js.Ref) BackgroundFetchUpdateUIEvent { 2128 this.BackgroundFetchEvent = this.BackgroundFetchEvent.FromRef(ref) 2129 return this 2130 } 2131 2132 func (this BackgroundFetchUpdateUIEvent) Free() { 2133 this.ref.Free() 2134 } 2135 2136 // HasFuncUpdateUI returns true if the method "BackgroundFetchUpdateUIEvent.updateUI" exists. 2137 func (this BackgroundFetchUpdateUIEvent) HasFuncUpdateUI() bool { 2138 return js.True == bindings.HasFuncBackgroundFetchUpdateUIEventUpdateUI( 2139 this.ref, 2140 ) 2141 } 2142 2143 // FuncUpdateUI returns the method "BackgroundFetchUpdateUIEvent.updateUI". 2144 func (this BackgroundFetchUpdateUIEvent) FuncUpdateUI() (fn js.Func[func(options BackgroundFetchUIOptions) js.Promise[js.Void]]) { 2145 bindings.FuncBackgroundFetchUpdateUIEventUpdateUI( 2146 this.ref, js.Pointer(&fn), 2147 ) 2148 return 2149 } 2150 2151 // UpdateUI calls the method "BackgroundFetchUpdateUIEvent.updateUI". 2152 func (this BackgroundFetchUpdateUIEvent) UpdateUI(options BackgroundFetchUIOptions) (ret js.Promise[js.Void]) { 2153 bindings.CallBackgroundFetchUpdateUIEventUpdateUI( 2154 this.ref, js.Pointer(&ret), 2155 js.Pointer(&options), 2156 ) 2157 2158 return 2159 } 2160 2161 // TryUpdateUI calls the method "BackgroundFetchUpdateUIEvent.updateUI" 2162 // in a try/catch block and returns (_, err, ok = false) when it went through 2163 // the catch clause. 2164 func (this BackgroundFetchUpdateUIEvent) TryUpdateUI(options BackgroundFetchUIOptions) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2165 ok = js.True == bindings.TryBackgroundFetchUpdateUIEventUpdateUI( 2166 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2167 js.Pointer(&options), 2168 ) 2169 2170 return 2171 } 2172 2173 // HasFuncUpdateUI1 returns true if the method "BackgroundFetchUpdateUIEvent.updateUI" exists. 2174 func (this BackgroundFetchUpdateUIEvent) HasFuncUpdateUI1() bool { 2175 return js.True == bindings.HasFuncBackgroundFetchUpdateUIEventUpdateUI1( 2176 this.ref, 2177 ) 2178 } 2179 2180 // FuncUpdateUI1 returns the method "BackgroundFetchUpdateUIEvent.updateUI". 2181 func (this BackgroundFetchUpdateUIEvent) FuncUpdateUI1() (fn js.Func[func() js.Promise[js.Void]]) { 2182 bindings.FuncBackgroundFetchUpdateUIEventUpdateUI1( 2183 this.ref, js.Pointer(&fn), 2184 ) 2185 return 2186 } 2187 2188 // UpdateUI1 calls the method "BackgroundFetchUpdateUIEvent.updateUI". 2189 func (this BackgroundFetchUpdateUIEvent) UpdateUI1() (ret js.Promise[js.Void]) { 2190 bindings.CallBackgroundFetchUpdateUIEventUpdateUI1( 2191 this.ref, js.Pointer(&ret), 2192 ) 2193 2194 return 2195 } 2196 2197 // TryUpdateUI1 calls the method "BackgroundFetchUpdateUIEvent.updateUI" 2198 // in a try/catch block and returns (_, err, ok = false) when it went through 2199 // the catch clause. 2200 func (this BackgroundFetchUpdateUIEvent) TryUpdateUI1() (ret js.Promise[js.Void], exception js.Any, ok bool) { 2201 ok = js.True == bindings.TryBackgroundFetchUpdateUIEventUpdateUI1( 2202 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2203 ) 2204 2205 return 2206 } 2207 2208 type BackgroundSyncOptions struct { 2209 // MinInterval is "BackgroundSyncOptions.minInterval" 2210 // 2211 // Optional, defaults to 0. 2212 // 2213 // NOTE: FFI_USE_MinInterval MUST be set to true to make this field effective. 2214 MinInterval uint64 2215 2216 FFI_USE_MinInterval bool // for MinInterval. 2217 2218 FFI_USE bool 2219 } 2220 2221 // FromRef calls UpdateFrom and returns a BackgroundSyncOptions with all fields set. 2222 func (p BackgroundSyncOptions) FromRef(ref js.Ref) BackgroundSyncOptions { 2223 p.UpdateFrom(ref) 2224 return p 2225 } 2226 2227 // New creates a new BackgroundSyncOptions in the application heap. 2228 func (p BackgroundSyncOptions) New() js.Ref { 2229 return bindings.BackgroundSyncOptionsJSLoad( 2230 js.Pointer(&p), js.True, 0, 2231 ) 2232 } 2233 2234 // UpdateFrom copies value of all fields of the heap object to p. 2235 func (p *BackgroundSyncOptions) UpdateFrom(ref js.Ref) { 2236 bindings.BackgroundSyncOptionsJSStore( 2237 js.Pointer(p), ref, 2238 ) 2239 } 2240 2241 // Update writes all fields of the p to the heap object referenced by ref. 2242 func (p *BackgroundSyncOptions) Update(ref js.Ref) { 2243 bindings.BackgroundSyncOptionsJSLoad( 2244 js.Pointer(p), js.False, ref, 2245 ) 2246 } 2247 2248 // FreeMembers frees fields with heap reference, if recursive is true 2249 // free all heap references reachable from p. 2250 func (p *BackgroundSyncOptions) FreeMembers(recursive bool) { 2251 } 2252 2253 type BarProp struct { 2254 ref js.Ref 2255 } 2256 2257 func (this BarProp) Once() BarProp { 2258 this.ref.Once() 2259 return this 2260 } 2261 2262 func (this BarProp) Ref() js.Ref { 2263 return this.ref 2264 } 2265 2266 func (this BarProp) FromRef(ref js.Ref) BarProp { 2267 this.ref = ref 2268 return this 2269 } 2270 2271 func (this BarProp) Free() { 2272 this.ref.Free() 2273 } 2274 2275 // Visible returns the value of property "BarProp.visible". 2276 // 2277 // It returns ok=false if there is no such property. 2278 func (this BarProp) Visible() (ret bool, ok bool) { 2279 ok = js.True == bindings.GetBarPropVisible( 2280 this.ref, js.Pointer(&ret), 2281 ) 2282 return 2283 } 2284 2285 type BarcodeFormat uint32 2286 2287 const ( 2288 _ BarcodeFormat = iota 2289 2290 BarcodeFormat_AZTEC 2291 BarcodeFormat_CODE_128 2292 BarcodeFormat_CODE_39 2293 BarcodeFormat_CODE_93 2294 BarcodeFormat_CODABAR 2295 BarcodeFormat_DATA_MATRIX 2296 BarcodeFormat_EAN_13 2297 BarcodeFormat_EAN_8 2298 BarcodeFormat_ITF 2299 BarcodeFormat_PDF417 2300 BarcodeFormat_QR_CODE 2301 BarcodeFormat_UNKNOWN 2302 BarcodeFormat_UPC_A 2303 BarcodeFormat_UPC_E 2304 ) 2305 2306 func (BarcodeFormat) FromRef(str js.Ref) BarcodeFormat { 2307 return BarcodeFormat(bindings.ConstOfBarcodeFormat(str)) 2308 } 2309 2310 func (x BarcodeFormat) String() (string, bool) { 2311 switch x { 2312 case BarcodeFormat_AZTEC: 2313 return "aztec", true 2314 case BarcodeFormat_CODE_128: 2315 return "code_128", true 2316 case BarcodeFormat_CODE_39: 2317 return "code_39", true 2318 case BarcodeFormat_CODE_93: 2319 return "code_93", true 2320 case BarcodeFormat_CODABAR: 2321 return "codabar", true 2322 case BarcodeFormat_DATA_MATRIX: 2323 return "data_matrix", true 2324 case BarcodeFormat_EAN_13: 2325 return "ean_13", true 2326 case BarcodeFormat_EAN_8: 2327 return "ean_8", true 2328 case BarcodeFormat_ITF: 2329 return "itf", true 2330 case BarcodeFormat_PDF417: 2331 return "pdf417", true 2332 case BarcodeFormat_QR_CODE: 2333 return "qr_code", true 2334 case BarcodeFormat_UNKNOWN: 2335 return "unknown", true 2336 case BarcodeFormat_UPC_A: 2337 return "upc_a", true 2338 case BarcodeFormat_UPC_E: 2339 return "upc_e", true 2340 default: 2341 return "", false 2342 } 2343 } 2344 2345 type BarcodeDetectorOptions struct { 2346 // Formats is "BarcodeDetectorOptions.formats" 2347 // 2348 // Optional 2349 Formats js.Array[BarcodeFormat] 2350 2351 FFI_USE bool 2352 } 2353 2354 // FromRef calls UpdateFrom and returns a BarcodeDetectorOptions with all fields set. 2355 func (p BarcodeDetectorOptions) FromRef(ref js.Ref) BarcodeDetectorOptions { 2356 p.UpdateFrom(ref) 2357 return p 2358 } 2359 2360 // New creates a new BarcodeDetectorOptions in the application heap. 2361 func (p BarcodeDetectorOptions) New() js.Ref { 2362 return bindings.BarcodeDetectorOptionsJSLoad( 2363 js.Pointer(&p), js.True, 0, 2364 ) 2365 } 2366 2367 // UpdateFrom copies value of all fields of the heap object to p. 2368 func (p *BarcodeDetectorOptions) UpdateFrom(ref js.Ref) { 2369 bindings.BarcodeDetectorOptionsJSStore( 2370 js.Pointer(p), ref, 2371 ) 2372 } 2373 2374 // Update writes all fields of the p to the heap object referenced by ref. 2375 func (p *BarcodeDetectorOptions) Update(ref js.Ref) { 2376 bindings.BarcodeDetectorOptionsJSLoad( 2377 js.Pointer(p), js.False, ref, 2378 ) 2379 } 2380 2381 // FreeMembers frees fields with heap reference, if recursive is true 2382 // free all heap references reachable from p. 2383 func (p *BarcodeDetectorOptions) FreeMembers(recursive bool) { 2384 js.Free( 2385 p.Formats.Ref(), 2386 ) 2387 p.Formats = p.Formats.FromRef(js.Undefined) 2388 } 2389 2390 type DetectedBarcode struct { 2391 // BoundingBox is "DetectedBarcode.boundingBox" 2392 // 2393 // Required 2394 BoundingBox DOMRectReadOnly 2395 // RawValue is "DetectedBarcode.rawValue" 2396 // 2397 // Required 2398 RawValue js.String 2399 // Format is "DetectedBarcode.format" 2400 // 2401 // Required 2402 Format BarcodeFormat 2403 // CornerPoints is "DetectedBarcode.cornerPoints" 2404 // 2405 // Required 2406 CornerPoints js.FrozenArray[Point2D] 2407 2408 FFI_USE bool 2409 } 2410 2411 // FromRef calls UpdateFrom and returns a DetectedBarcode with all fields set. 2412 func (p DetectedBarcode) FromRef(ref js.Ref) DetectedBarcode { 2413 p.UpdateFrom(ref) 2414 return p 2415 } 2416 2417 // New creates a new DetectedBarcode in the application heap. 2418 func (p DetectedBarcode) New() js.Ref { 2419 return bindings.DetectedBarcodeJSLoad( 2420 js.Pointer(&p), js.True, 0, 2421 ) 2422 } 2423 2424 // UpdateFrom copies value of all fields of the heap object to p. 2425 func (p *DetectedBarcode) UpdateFrom(ref js.Ref) { 2426 bindings.DetectedBarcodeJSStore( 2427 js.Pointer(p), ref, 2428 ) 2429 } 2430 2431 // Update writes all fields of the p to the heap object referenced by ref. 2432 func (p *DetectedBarcode) Update(ref js.Ref) { 2433 bindings.DetectedBarcodeJSLoad( 2434 js.Pointer(p), js.False, ref, 2435 ) 2436 } 2437 2438 // FreeMembers frees fields with heap reference, if recursive is true 2439 // free all heap references reachable from p. 2440 func (p *DetectedBarcode) FreeMembers(recursive bool) { 2441 js.Free( 2442 p.BoundingBox.Ref(), 2443 p.RawValue.Ref(), 2444 p.CornerPoints.Ref(), 2445 ) 2446 p.BoundingBox = p.BoundingBox.FromRef(js.Undefined) 2447 p.RawValue = p.RawValue.FromRef(js.Undefined) 2448 p.CornerPoints = p.CornerPoints.FromRef(js.Undefined) 2449 } 2450 2451 type HTMLImageElement struct { 2452 HTMLElement 2453 } 2454 2455 func (this HTMLImageElement) Once() HTMLImageElement { 2456 this.ref.Once() 2457 return this 2458 } 2459 2460 func (this HTMLImageElement) Ref() js.Ref { 2461 return this.HTMLElement.Ref() 2462 } 2463 2464 func (this HTMLImageElement) FromRef(ref js.Ref) HTMLImageElement { 2465 this.HTMLElement = this.HTMLElement.FromRef(ref) 2466 return this 2467 } 2468 2469 func (this HTMLImageElement) Free() { 2470 this.ref.Free() 2471 } 2472 2473 // Alt returns the value of property "HTMLImageElement.alt". 2474 // 2475 // It returns ok=false if there is no such property. 2476 func (this HTMLImageElement) Alt() (ret js.String, ok bool) { 2477 ok = js.True == bindings.GetHTMLImageElementAlt( 2478 this.ref, js.Pointer(&ret), 2479 ) 2480 return 2481 } 2482 2483 // SetAlt sets the value of property "HTMLImageElement.alt" to val. 2484 // 2485 // It returns false if the property cannot be set. 2486 func (this HTMLImageElement) SetAlt(val js.String) bool { 2487 return js.True == bindings.SetHTMLImageElementAlt( 2488 this.ref, 2489 val.Ref(), 2490 ) 2491 } 2492 2493 // Src returns the value of property "HTMLImageElement.src". 2494 // 2495 // It returns ok=false if there is no such property. 2496 func (this HTMLImageElement) Src() (ret js.String, ok bool) { 2497 ok = js.True == bindings.GetHTMLImageElementSrc( 2498 this.ref, js.Pointer(&ret), 2499 ) 2500 return 2501 } 2502 2503 // SetSrc sets the value of property "HTMLImageElement.src" to val. 2504 // 2505 // It returns false if the property cannot be set. 2506 func (this HTMLImageElement) SetSrc(val js.String) bool { 2507 return js.True == bindings.SetHTMLImageElementSrc( 2508 this.ref, 2509 val.Ref(), 2510 ) 2511 } 2512 2513 // Srcset returns the value of property "HTMLImageElement.srcset". 2514 // 2515 // It returns ok=false if there is no such property. 2516 func (this HTMLImageElement) Srcset() (ret js.String, ok bool) { 2517 ok = js.True == bindings.GetHTMLImageElementSrcset( 2518 this.ref, js.Pointer(&ret), 2519 ) 2520 return 2521 } 2522 2523 // SetSrcset sets the value of property "HTMLImageElement.srcset" to val. 2524 // 2525 // It returns false if the property cannot be set. 2526 func (this HTMLImageElement) SetSrcset(val js.String) bool { 2527 return js.True == bindings.SetHTMLImageElementSrcset( 2528 this.ref, 2529 val.Ref(), 2530 ) 2531 } 2532 2533 // Sizes returns the value of property "HTMLImageElement.sizes". 2534 // 2535 // It returns ok=false if there is no such property. 2536 func (this HTMLImageElement) Sizes() (ret js.String, ok bool) { 2537 ok = js.True == bindings.GetHTMLImageElementSizes( 2538 this.ref, js.Pointer(&ret), 2539 ) 2540 return 2541 } 2542 2543 // SetSizes sets the value of property "HTMLImageElement.sizes" to val. 2544 // 2545 // It returns false if the property cannot be set. 2546 func (this HTMLImageElement) SetSizes(val js.String) bool { 2547 return js.True == bindings.SetHTMLImageElementSizes( 2548 this.ref, 2549 val.Ref(), 2550 ) 2551 } 2552 2553 // CrossOrigin returns the value of property "HTMLImageElement.crossOrigin". 2554 // 2555 // It returns ok=false if there is no such property. 2556 func (this HTMLImageElement) CrossOrigin() (ret js.String, ok bool) { 2557 ok = js.True == bindings.GetHTMLImageElementCrossOrigin( 2558 this.ref, js.Pointer(&ret), 2559 ) 2560 return 2561 } 2562 2563 // SetCrossOrigin sets the value of property "HTMLImageElement.crossOrigin" to val. 2564 // 2565 // It returns false if the property cannot be set. 2566 func (this HTMLImageElement) SetCrossOrigin(val js.String) bool { 2567 return js.True == bindings.SetHTMLImageElementCrossOrigin( 2568 this.ref, 2569 val.Ref(), 2570 ) 2571 } 2572 2573 // UseMap returns the value of property "HTMLImageElement.useMap". 2574 // 2575 // It returns ok=false if there is no such property. 2576 func (this HTMLImageElement) UseMap() (ret js.String, ok bool) { 2577 ok = js.True == bindings.GetHTMLImageElementUseMap( 2578 this.ref, js.Pointer(&ret), 2579 ) 2580 return 2581 } 2582 2583 // SetUseMap sets the value of property "HTMLImageElement.useMap" to val. 2584 // 2585 // It returns false if the property cannot be set. 2586 func (this HTMLImageElement) SetUseMap(val js.String) bool { 2587 return js.True == bindings.SetHTMLImageElementUseMap( 2588 this.ref, 2589 val.Ref(), 2590 ) 2591 } 2592 2593 // IsMap returns the value of property "HTMLImageElement.isMap". 2594 // 2595 // It returns ok=false if there is no such property. 2596 func (this HTMLImageElement) IsMap() (ret bool, ok bool) { 2597 ok = js.True == bindings.GetHTMLImageElementIsMap( 2598 this.ref, js.Pointer(&ret), 2599 ) 2600 return 2601 } 2602 2603 // SetIsMap sets the value of property "HTMLImageElement.isMap" to val. 2604 // 2605 // It returns false if the property cannot be set. 2606 func (this HTMLImageElement) SetIsMap(val bool) bool { 2607 return js.True == bindings.SetHTMLImageElementIsMap( 2608 this.ref, 2609 js.Bool(bool(val)), 2610 ) 2611 } 2612 2613 // Width returns the value of property "HTMLImageElement.width". 2614 // 2615 // It returns ok=false if there is no such property. 2616 func (this HTMLImageElement) Width() (ret uint32, ok bool) { 2617 ok = js.True == bindings.GetHTMLImageElementWidth( 2618 this.ref, js.Pointer(&ret), 2619 ) 2620 return 2621 } 2622 2623 // SetWidth sets the value of property "HTMLImageElement.width" to val. 2624 // 2625 // It returns false if the property cannot be set. 2626 func (this HTMLImageElement) SetWidth(val uint32) bool { 2627 return js.True == bindings.SetHTMLImageElementWidth( 2628 this.ref, 2629 uint32(val), 2630 ) 2631 } 2632 2633 // Height returns the value of property "HTMLImageElement.height". 2634 // 2635 // It returns ok=false if there is no such property. 2636 func (this HTMLImageElement) Height() (ret uint32, ok bool) { 2637 ok = js.True == bindings.GetHTMLImageElementHeight( 2638 this.ref, js.Pointer(&ret), 2639 ) 2640 return 2641 } 2642 2643 // SetHeight sets the value of property "HTMLImageElement.height" to val. 2644 // 2645 // It returns false if the property cannot be set. 2646 func (this HTMLImageElement) SetHeight(val uint32) bool { 2647 return js.True == bindings.SetHTMLImageElementHeight( 2648 this.ref, 2649 uint32(val), 2650 ) 2651 } 2652 2653 // NaturalWidth returns the value of property "HTMLImageElement.naturalWidth". 2654 // 2655 // It returns ok=false if there is no such property. 2656 func (this HTMLImageElement) NaturalWidth() (ret uint32, ok bool) { 2657 ok = js.True == bindings.GetHTMLImageElementNaturalWidth( 2658 this.ref, js.Pointer(&ret), 2659 ) 2660 return 2661 } 2662 2663 // NaturalHeight returns the value of property "HTMLImageElement.naturalHeight". 2664 // 2665 // It returns ok=false if there is no such property. 2666 func (this HTMLImageElement) NaturalHeight() (ret uint32, ok bool) { 2667 ok = js.True == bindings.GetHTMLImageElementNaturalHeight( 2668 this.ref, js.Pointer(&ret), 2669 ) 2670 return 2671 } 2672 2673 // Complete returns the value of property "HTMLImageElement.complete". 2674 // 2675 // It returns ok=false if there is no such property. 2676 func (this HTMLImageElement) Complete() (ret bool, ok bool) { 2677 ok = js.True == bindings.GetHTMLImageElementComplete( 2678 this.ref, js.Pointer(&ret), 2679 ) 2680 return 2681 } 2682 2683 // CurrentSrc returns the value of property "HTMLImageElement.currentSrc". 2684 // 2685 // It returns ok=false if there is no such property. 2686 func (this HTMLImageElement) CurrentSrc() (ret js.String, ok bool) { 2687 ok = js.True == bindings.GetHTMLImageElementCurrentSrc( 2688 this.ref, js.Pointer(&ret), 2689 ) 2690 return 2691 } 2692 2693 // ReferrerPolicy returns the value of property "HTMLImageElement.referrerPolicy". 2694 // 2695 // It returns ok=false if there is no such property. 2696 func (this HTMLImageElement) ReferrerPolicy() (ret js.String, ok bool) { 2697 ok = js.True == bindings.GetHTMLImageElementReferrerPolicy( 2698 this.ref, js.Pointer(&ret), 2699 ) 2700 return 2701 } 2702 2703 // SetReferrerPolicy sets the value of property "HTMLImageElement.referrerPolicy" to val. 2704 // 2705 // It returns false if the property cannot be set. 2706 func (this HTMLImageElement) SetReferrerPolicy(val js.String) bool { 2707 return js.True == bindings.SetHTMLImageElementReferrerPolicy( 2708 this.ref, 2709 val.Ref(), 2710 ) 2711 } 2712 2713 // Decoding returns the value of property "HTMLImageElement.decoding". 2714 // 2715 // It returns ok=false if there is no such property. 2716 func (this HTMLImageElement) Decoding() (ret js.String, ok bool) { 2717 ok = js.True == bindings.GetHTMLImageElementDecoding( 2718 this.ref, js.Pointer(&ret), 2719 ) 2720 return 2721 } 2722 2723 // SetDecoding sets the value of property "HTMLImageElement.decoding" to val. 2724 // 2725 // It returns false if the property cannot be set. 2726 func (this HTMLImageElement) SetDecoding(val js.String) bool { 2727 return js.True == bindings.SetHTMLImageElementDecoding( 2728 this.ref, 2729 val.Ref(), 2730 ) 2731 } 2732 2733 // Loading returns the value of property "HTMLImageElement.loading". 2734 // 2735 // It returns ok=false if there is no such property. 2736 func (this HTMLImageElement) Loading() (ret js.String, ok bool) { 2737 ok = js.True == bindings.GetHTMLImageElementLoading( 2738 this.ref, js.Pointer(&ret), 2739 ) 2740 return 2741 } 2742 2743 // SetLoading sets the value of property "HTMLImageElement.loading" to val. 2744 // 2745 // It returns false if the property cannot be set. 2746 func (this HTMLImageElement) SetLoading(val js.String) bool { 2747 return js.True == bindings.SetHTMLImageElementLoading( 2748 this.ref, 2749 val.Ref(), 2750 ) 2751 } 2752 2753 // FetchPriority returns the value of property "HTMLImageElement.fetchPriority". 2754 // 2755 // It returns ok=false if there is no such property. 2756 func (this HTMLImageElement) FetchPriority() (ret js.String, ok bool) { 2757 ok = js.True == bindings.GetHTMLImageElementFetchPriority( 2758 this.ref, js.Pointer(&ret), 2759 ) 2760 return 2761 } 2762 2763 // SetFetchPriority sets the value of property "HTMLImageElement.fetchPriority" to val. 2764 // 2765 // It returns false if the property cannot be set. 2766 func (this HTMLImageElement) SetFetchPriority(val js.String) bool { 2767 return js.True == bindings.SetHTMLImageElementFetchPriority( 2768 this.ref, 2769 val.Ref(), 2770 ) 2771 } 2772 2773 // X returns the value of property "HTMLImageElement.x". 2774 // 2775 // It returns ok=false if there is no such property. 2776 func (this HTMLImageElement) X() (ret int32, ok bool) { 2777 ok = js.True == bindings.GetHTMLImageElementX( 2778 this.ref, js.Pointer(&ret), 2779 ) 2780 return 2781 } 2782 2783 // Y returns the value of property "HTMLImageElement.y". 2784 // 2785 // It returns ok=false if there is no such property. 2786 func (this HTMLImageElement) Y() (ret int32, ok bool) { 2787 ok = js.True == bindings.GetHTMLImageElementY( 2788 this.ref, js.Pointer(&ret), 2789 ) 2790 return 2791 } 2792 2793 // Name returns the value of property "HTMLImageElement.name". 2794 // 2795 // It returns ok=false if there is no such property. 2796 func (this HTMLImageElement) Name() (ret js.String, ok bool) { 2797 ok = js.True == bindings.GetHTMLImageElementName( 2798 this.ref, js.Pointer(&ret), 2799 ) 2800 return 2801 } 2802 2803 // SetName sets the value of property "HTMLImageElement.name" to val. 2804 // 2805 // It returns false if the property cannot be set. 2806 func (this HTMLImageElement) SetName(val js.String) bool { 2807 return js.True == bindings.SetHTMLImageElementName( 2808 this.ref, 2809 val.Ref(), 2810 ) 2811 } 2812 2813 // Lowsrc returns the value of property "HTMLImageElement.lowsrc". 2814 // 2815 // It returns ok=false if there is no such property. 2816 func (this HTMLImageElement) Lowsrc() (ret js.String, ok bool) { 2817 ok = js.True == bindings.GetHTMLImageElementLowsrc( 2818 this.ref, js.Pointer(&ret), 2819 ) 2820 return 2821 } 2822 2823 // SetLowsrc sets the value of property "HTMLImageElement.lowsrc" to val. 2824 // 2825 // It returns false if the property cannot be set. 2826 func (this HTMLImageElement) SetLowsrc(val js.String) bool { 2827 return js.True == bindings.SetHTMLImageElementLowsrc( 2828 this.ref, 2829 val.Ref(), 2830 ) 2831 } 2832 2833 // Align returns the value of property "HTMLImageElement.align". 2834 // 2835 // It returns ok=false if there is no such property. 2836 func (this HTMLImageElement) Align() (ret js.String, ok bool) { 2837 ok = js.True == bindings.GetHTMLImageElementAlign( 2838 this.ref, js.Pointer(&ret), 2839 ) 2840 return 2841 } 2842 2843 // SetAlign sets the value of property "HTMLImageElement.align" to val. 2844 // 2845 // It returns false if the property cannot be set. 2846 func (this HTMLImageElement) SetAlign(val js.String) bool { 2847 return js.True == bindings.SetHTMLImageElementAlign( 2848 this.ref, 2849 val.Ref(), 2850 ) 2851 } 2852 2853 // Hspace returns the value of property "HTMLImageElement.hspace". 2854 // 2855 // It returns ok=false if there is no such property. 2856 func (this HTMLImageElement) Hspace() (ret uint32, ok bool) { 2857 ok = js.True == bindings.GetHTMLImageElementHspace( 2858 this.ref, js.Pointer(&ret), 2859 ) 2860 return 2861 } 2862 2863 // SetHspace sets the value of property "HTMLImageElement.hspace" to val. 2864 // 2865 // It returns false if the property cannot be set. 2866 func (this HTMLImageElement) SetHspace(val uint32) bool { 2867 return js.True == bindings.SetHTMLImageElementHspace( 2868 this.ref, 2869 uint32(val), 2870 ) 2871 } 2872 2873 // Vspace returns the value of property "HTMLImageElement.vspace". 2874 // 2875 // It returns ok=false if there is no such property. 2876 func (this HTMLImageElement) Vspace() (ret uint32, ok bool) { 2877 ok = js.True == bindings.GetHTMLImageElementVspace( 2878 this.ref, js.Pointer(&ret), 2879 ) 2880 return 2881 } 2882 2883 // SetVspace sets the value of property "HTMLImageElement.vspace" to val. 2884 // 2885 // It returns false if the property cannot be set. 2886 func (this HTMLImageElement) SetVspace(val uint32) bool { 2887 return js.True == bindings.SetHTMLImageElementVspace( 2888 this.ref, 2889 uint32(val), 2890 ) 2891 } 2892 2893 // LongDesc returns the value of property "HTMLImageElement.longDesc". 2894 // 2895 // It returns ok=false if there is no such property. 2896 func (this HTMLImageElement) LongDesc() (ret js.String, ok bool) { 2897 ok = js.True == bindings.GetHTMLImageElementLongDesc( 2898 this.ref, js.Pointer(&ret), 2899 ) 2900 return 2901 } 2902 2903 // SetLongDesc sets the value of property "HTMLImageElement.longDesc" to val. 2904 // 2905 // It returns false if the property cannot be set. 2906 func (this HTMLImageElement) SetLongDesc(val js.String) bool { 2907 return js.True == bindings.SetHTMLImageElementLongDesc( 2908 this.ref, 2909 val.Ref(), 2910 ) 2911 } 2912 2913 // Border returns the value of property "HTMLImageElement.border". 2914 // 2915 // It returns ok=false if there is no such property. 2916 func (this HTMLImageElement) Border() (ret js.String, ok bool) { 2917 ok = js.True == bindings.GetHTMLImageElementBorder( 2918 this.ref, js.Pointer(&ret), 2919 ) 2920 return 2921 } 2922 2923 // SetBorder sets the value of property "HTMLImageElement.border" to val. 2924 // 2925 // It returns false if the property cannot be set. 2926 func (this HTMLImageElement) SetBorder(val js.String) bool { 2927 return js.True == bindings.SetHTMLImageElementBorder( 2928 this.ref, 2929 val.Ref(), 2930 ) 2931 } 2932 2933 // AttributionSrc returns the value of property "HTMLImageElement.attributionSrc". 2934 // 2935 // It returns ok=false if there is no such property. 2936 func (this HTMLImageElement) AttributionSrc() (ret js.String, ok bool) { 2937 ok = js.True == bindings.GetHTMLImageElementAttributionSrc( 2938 this.ref, js.Pointer(&ret), 2939 ) 2940 return 2941 } 2942 2943 // SetAttributionSrc sets the value of property "HTMLImageElement.attributionSrc" to val. 2944 // 2945 // It returns false if the property cannot be set. 2946 func (this HTMLImageElement) SetAttributionSrc(val js.String) bool { 2947 return js.True == bindings.SetHTMLImageElementAttributionSrc( 2948 this.ref, 2949 val.Ref(), 2950 ) 2951 } 2952 2953 // HasFuncDecode returns true if the method "HTMLImageElement.decode" exists. 2954 func (this HTMLImageElement) HasFuncDecode() bool { 2955 return js.True == bindings.HasFuncHTMLImageElementDecode( 2956 this.ref, 2957 ) 2958 } 2959 2960 // FuncDecode returns the method "HTMLImageElement.decode". 2961 func (this HTMLImageElement) FuncDecode() (fn js.Func[func() js.Promise[js.Void]]) { 2962 bindings.FuncHTMLImageElementDecode( 2963 this.ref, js.Pointer(&fn), 2964 ) 2965 return 2966 } 2967 2968 // Decode calls the method "HTMLImageElement.decode". 2969 func (this HTMLImageElement) Decode() (ret js.Promise[js.Void]) { 2970 bindings.CallHTMLImageElementDecode( 2971 this.ref, js.Pointer(&ret), 2972 ) 2973 2974 return 2975 } 2976 2977 // TryDecode calls the method "HTMLImageElement.decode" 2978 // in a try/catch block and returns (_, err, ok = false) when it went through 2979 // the catch clause. 2980 func (this HTMLImageElement) TryDecode() (ret js.Promise[js.Void], exception js.Any, ok bool) { 2981 ok = js.True == bindings.TryHTMLImageElementDecode( 2982 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2983 ) 2984 2985 return 2986 } 2987 2988 type SVGImageElement struct { 2989 SVGGraphicsElement 2990 } 2991 2992 func (this SVGImageElement) Once() SVGImageElement { 2993 this.ref.Once() 2994 return this 2995 } 2996 2997 func (this SVGImageElement) Ref() js.Ref { 2998 return this.SVGGraphicsElement.Ref() 2999 } 3000 3001 func (this SVGImageElement) FromRef(ref js.Ref) SVGImageElement { 3002 this.SVGGraphicsElement = this.SVGGraphicsElement.FromRef(ref) 3003 return this 3004 } 3005 3006 func (this SVGImageElement) Free() { 3007 this.ref.Free() 3008 } 3009 3010 // X returns the value of property "SVGImageElement.x". 3011 // 3012 // It returns ok=false if there is no such property. 3013 func (this SVGImageElement) X() (ret SVGAnimatedLength, ok bool) { 3014 ok = js.True == bindings.GetSVGImageElementX( 3015 this.ref, js.Pointer(&ret), 3016 ) 3017 return 3018 } 3019 3020 // Y returns the value of property "SVGImageElement.y". 3021 // 3022 // It returns ok=false if there is no such property. 3023 func (this SVGImageElement) Y() (ret SVGAnimatedLength, ok bool) { 3024 ok = js.True == bindings.GetSVGImageElementY( 3025 this.ref, js.Pointer(&ret), 3026 ) 3027 return 3028 } 3029 3030 // Width returns the value of property "SVGImageElement.width". 3031 // 3032 // It returns ok=false if there is no such property. 3033 func (this SVGImageElement) Width() (ret SVGAnimatedLength, ok bool) { 3034 ok = js.True == bindings.GetSVGImageElementWidth( 3035 this.ref, js.Pointer(&ret), 3036 ) 3037 return 3038 } 3039 3040 // Height returns the value of property "SVGImageElement.height". 3041 // 3042 // It returns ok=false if there is no such property. 3043 func (this SVGImageElement) Height() (ret SVGAnimatedLength, ok bool) { 3044 ok = js.True == bindings.GetSVGImageElementHeight( 3045 this.ref, js.Pointer(&ret), 3046 ) 3047 return 3048 } 3049 3050 // PreserveAspectRatio returns the value of property "SVGImageElement.preserveAspectRatio". 3051 // 3052 // It returns ok=false if there is no such property. 3053 func (this SVGImageElement) PreserveAspectRatio() (ret SVGAnimatedPreserveAspectRatio, ok bool) { 3054 ok = js.True == bindings.GetSVGImageElementPreserveAspectRatio( 3055 this.ref, js.Pointer(&ret), 3056 ) 3057 return 3058 } 3059 3060 // CrossOrigin returns the value of property "SVGImageElement.crossOrigin". 3061 // 3062 // It returns ok=false if there is no such property. 3063 func (this SVGImageElement) CrossOrigin() (ret js.String, ok bool) { 3064 ok = js.True == bindings.GetSVGImageElementCrossOrigin( 3065 this.ref, js.Pointer(&ret), 3066 ) 3067 return 3068 } 3069 3070 // SetCrossOrigin sets the value of property "SVGImageElement.crossOrigin" to val. 3071 // 3072 // It returns false if the property cannot be set. 3073 func (this SVGImageElement) SetCrossOrigin(val js.String) bool { 3074 return js.True == bindings.SetSVGImageElementCrossOrigin( 3075 this.ref, 3076 val.Ref(), 3077 ) 3078 } 3079 3080 // Href returns the value of property "SVGImageElement.href". 3081 // 3082 // It returns ok=false if there is no such property. 3083 func (this SVGImageElement) Href() (ret SVGAnimatedString, ok bool) { 3084 ok = js.True == bindings.GetSVGImageElementHref( 3085 this.ref, js.Pointer(&ret), 3086 ) 3087 return 3088 } 3089 3090 type VideoFrameRequestCallbackFunc func(this js.Ref, now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata) js.Ref 3091 3092 func (fn VideoFrameRequestCallbackFunc) Register() js.Func[func(now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata)] { 3093 return js.RegisterCallback[func(now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata)]( 3094 fn, abi.FuncPCABIInternal(fn), 3095 ) 3096 } 3097 3098 func (fn VideoFrameRequestCallbackFunc) DispatchCallback( 3099 targetPC uintptr, ctx *js.CallbackContext, 3100 ) { 3101 args := ctx.Args() 3102 if len(args) != 2+1 /* js this */ || 3103 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3104 js.ThrowInvalidCallbackInvocation() 3105 } 3106 var arg1 VideoFrameCallbackMetadata 3107 arg1.UpdateFrom(args[1+1]) 3108 defer arg1.FreeMembers(true) 3109 3110 if ctx.Return(fn( 3111 args[0], 3112 3113 js.Number[DOMHighResTimeStamp]{}.FromRef(args[0+1]).Get(), 3114 mark.NoEscape(&arg1), 3115 )) { 3116 return 3117 } 3118 3119 js.ThrowCallbackValueNotReturned() 3120 } 3121 3122 type VideoFrameRequestCallback[T any] struct { 3123 Fn func(arg T, this js.Ref, now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata) js.Ref 3124 Arg T 3125 } 3126 3127 func (cb *VideoFrameRequestCallback[T]) Register() js.Func[func(now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata)] { 3128 return js.RegisterCallback[func(now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata)]( 3129 cb, abi.FuncPCABIInternal(cb.Fn), 3130 ) 3131 } 3132 3133 func (cb *VideoFrameRequestCallback[T]) DispatchCallback( 3134 targetPC uintptr, ctx *js.CallbackContext, 3135 ) { 3136 args := ctx.Args() 3137 if len(args) != 2+1 /* js this */ || 3138 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3139 js.ThrowInvalidCallbackInvocation() 3140 } 3141 var arg1 VideoFrameCallbackMetadata 3142 arg1.UpdateFrom(args[1+1]) 3143 defer arg1.FreeMembers(true) 3144 3145 if ctx.Return(cb.Fn( 3146 cb.Arg, 3147 args[0], 3148 3149 js.Number[DOMHighResTimeStamp]{}.FromRef(args[0+1]).Get(), 3150 mark.NoEscape(&arg1), 3151 )) { 3152 return 3153 } 3154 3155 js.ThrowCallbackValueNotReturned() 3156 } 3157 3158 type VideoFrameCallbackMetadata struct { 3159 // PresentationTime is "VideoFrameCallbackMetadata.presentationTime" 3160 // 3161 // Required 3162 PresentationTime DOMHighResTimeStamp 3163 // ExpectedDisplayTime is "VideoFrameCallbackMetadata.expectedDisplayTime" 3164 // 3165 // Required 3166 ExpectedDisplayTime DOMHighResTimeStamp 3167 // Width is "VideoFrameCallbackMetadata.width" 3168 // 3169 // Required 3170 Width uint32 3171 // Height is "VideoFrameCallbackMetadata.height" 3172 // 3173 // Required 3174 Height uint32 3175 // MediaTime is "VideoFrameCallbackMetadata.mediaTime" 3176 // 3177 // Required 3178 MediaTime float64 3179 // PresentedFrames is "VideoFrameCallbackMetadata.presentedFrames" 3180 // 3181 // Required 3182 PresentedFrames uint32 3183 // ProcessingDuration is "VideoFrameCallbackMetadata.processingDuration" 3184 // 3185 // Optional 3186 // 3187 // NOTE: FFI_USE_ProcessingDuration MUST be set to true to make this field effective. 3188 ProcessingDuration float64 3189 // CaptureTime is "VideoFrameCallbackMetadata.captureTime" 3190 // 3191 // Optional 3192 // 3193 // NOTE: FFI_USE_CaptureTime MUST be set to true to make this field effective. 3194 CaptureTime DOMHighResTimeStamp 3195 // ReceiveTime is "VideoFrameCallbackMetadata.receiveTime" 3196 // 3197 // Optional 3198 // 3199 // NOTE: FFI_USE_ReceiveTime MUST be set to true to make this field effective. 3200 ReceiveTime DOMHighResTimeStamp 3201 // RtpTimestamp is "VideoFrameCallbackMetadata.rtpTimestamp" 3202 // 3203 // Optional 3204 // 3205 // NOTE: FFI_USE_RtpTimestamp MUST be set to true to make this field effective. 3206 RtpTimestamp uint32 3207 3208 FFI_USE_ProcessingDuration bool // for ProcessingDuration. 3209 FFI_USE_CaptureTime bool // for CaptureTime. 3210 FFI_USE_ReceiveTime bool // for ReceiveTime. 3211 FFI_USE_RtpTimestamp bool // for RtpTimestamp. 3212 3213 FFI_USE bool 3214 } 3215 3216 // FromRef calls UpdateFrom and returns a VideoFrameCallbackMetadata with all fields set. 3217 func (p VideoFrameCallbackMetadata) FromRef(ref js.Ref) VideoFrameCallbackMetadata { 3218 p.UpdateFrom(ref) 3219 return p 3220 } 3221 3222 // New creates a new VideoFrameCallbackMetadata in the application heap. 3223 func (p VideoFrameCallbackMetadata) New() js.Ref { 3224 return bindings.VideoFrameCallbackMetadataJSLoad( 3225 js.Pointer(&p), js.True, 0, 3226 ) 3227 } 3228 3229 // UpdateFrom copies value of all fields of the heap object to p. 3230 func (p *VideoFrameCallbackMetadata) UpdateFrom(ref js.Ref) { 3231 bindings.VideoFrameCallbackMetadataJSStore( 3232 js.Pointer(p), ref, 3233 ) 3234 } 3235 3236 // Update writes all fields of the p to the heap object referenced by ref. 3237 func (p *VideoFrameCallbackMetadata) Update(ref js.Ref) { 3238 bindings.VideoFrameCallbackMetadataJSLoad( 3239 js.Pointer(p), js.False, ref, 3240 ) 3241 } 3242 3243 // FreeMembers frees fields with heap reference, if recursive is true 3244 // free all heap references reachable from p. 3245 func (p *VideoFrameCallbackMetadata) FreeMembers(recursive bool) { 3246 } 3247 3248 type PictureInPictureWindow struct { 3249 EventTarget 3250 } 3251 3252 func (this PictureInPictureWindow) Once() PictureInPictureWindow { 3253 this.ref.Once() 3254 return this 3255 } 3256 3257 func (this PictureInPictureWindow) Ref() js.Ref { 3258 return this.EventTarget.Ref() 3259 } 3260 3261 func (this PictureInPictureWindow) FromRef(ref js.Ref) PictureInPictureWindow { 3262 this.EventTarget = this.EventTarget.FromRef(ref) 3263 return this 3264 } 3265 3266 func (this PictureInPictureWindow) Free() { 3267 this.ref.Free() 3268 } 3269 3270 // Width returns the value of property "PictureInPictureWindow.width". 3271 // 3272 // It returns ok=false if there is no such property. 3273 func (this PictureInPictureWindow) Width() (ret int32, ok bool) { 3274 ok = js.True == bindings.GetPictureInPictureWindowWidth( 3275 this.ref, js.Pointer(&ret), 3276 ) 3277 return 3278 } 3279 3280 // Height returns the value of property "PictureInPictureWindow.height". 3281 // 3282 // It returns ok=false if there is no such property. 3283 func (this PictureInPictureWindow) Height() (ret int32, ok bool) { 3284 ok = js.True == bindings.GetPictureInPictureWindowHeight( 3285 this.ref, js.Pointer(&ret), 3286 ) 3287 return 3288 } 3289 3290 type VideoPlaybackQuality struct { 3291 ref js.Ref 3292 } 3293 3294 func (this VideoPlaybackQuality) Once() VideoPlaybackQuality { 3295 this.ref.Once() 3296 return this 3297 } 3298 3299 func (this VideoPlaybackQuality) Ref() js.Ref { 3300 return this.ref 3301 } 3302 3303 func (this VideoPlaybackQuality) FromRef(ref js.Ref) VideoPlaybackQuality { 3304 this.ref = ref 3305 return this 3306 } 3307 3308 func (this VideoPlaybackQuality) Free() { 3309 this.ref.Free() 3310 } 3311 3312 // CreationTime returns the value of property "VideoPlaybackQuality.creationTime". 3313 // 3314 // It returns ok=false if there is no such property. 3315 func (this VideoPlaybackQuality) CreationTime() (ret DOMHighResTimeStamp, ok bool) { 3316 ok = js.True == bindings.GetVideoPlaybackQualityCreationTime( 3317 this.ref, js.Pointer(&ret), 3318 ) 3319 return 3320 } 3321 3322 // DroppedVideoFrames returns the value of property "VideoPlaybackQuality.droppedVideoFrames". 3323 // 3324 // It returns ok=false if there is no such property. 3325 func (this VideoPlaybackQuality) DroppedVideoFrames() (ret uint32, ok bool) { 3326 ok = js.True == bindings.GetVideoPlaybackQualityDroppedVideoFrames( 3327 this.ref, js.Pointer(&ret), 3328 ) 3329 return 3330 } 3331 3332 // TotalVideoFrames returns the value of property "VideoPlaybackQuality.totalVideoFrames". 3333 // 3334 // It returns ok=false if there is no such property. 3335 func (this VideoPlaybackQuality) TotalVideoFrames() (ret uint32, ok bool) { 3336 ok = js.True == bindings.GetVideoPlaybackQualityTotalVideoFrames( 3337 this.ref, js.Pointer(&ret), 3338 ) 3339 return 3340 } 3341 3342 // CorruptedVideoFrames returns the value of property "VideoPlaybackQuality.corruptedVideoFrames". 3343 // 3344 // It returns ok=false if there is no such property. 3345 func (this VideoPlaybackQuality) CorruptedVideoFrames() (ret uint32, ok bool) { 3346 ok = js.True == bindings.GetVideoPlaybackQualityCorruptedVideoFrames( 3347 this.ref, js.Pointer(&ret), 3348 ) 3349 return 3350 } 3351 3352 type HTMLVideoElement struct { 3353 HTMLMediaElement 3354 } 3355 3356 func (this HTMLVideoElement) Once() HTMLVideoElement { 3357 this.ref.Once() 3358 return this 3359 } 3360 3361 func (this HTMLVideoElement) Ref() js.Ref { 3362 return this.HTMLMediaElement.Ref() 3363 } 3364 3365 func (this HTMLVideoElement) FromRef(ref js.Ref) HTMLVideoElement { 3366 this.HTMLMediaElement = this.HTMLMediaElement.FromRef(ref) 3367 return this 3368 } 3369 3370 func (this HTMLVideoElement) Free() { 3371 this.ref.Free() 3372 } 3373 3374 // Width returns the value of property "HTMLVideoElement.width". 3375 // 3376 // It returns ok=false if there is no such property. 3377 func (this HTMLVideoElement) Width() (ret uint32, ok bool) { 3378 ok = js.True == bindings.GetHTMLVideoElementWidth( 3379 this.ref, js.Pointer(&ret), 3380 ) 3381 return 3382 } 3383 3384 // SetWidth sets the value of property "HTMLVideoElement.width" to val. 3385 // 3386 // It returns false if the property cannot be set. 3387 func (this HTMLVideoElement) SetWidth(val uint32) bool { 3388 return js.True == bindings.SetHTMLVideoElementWidth( 3389 this.ref, 3390 uint32(val), 3391 ) 3392 } 3393 3394 // Height returns the value of property "HTMLVideoElement.height". 3395 // 3396 // It returns ok=false if there is no such property. 3397 func (this HTMLVideoElement) Height() (ret uint32, ok bool) { 3398 ok = js.True == bindings.GetHTMLVideoElementHeight( 3399 this.ref, js.Pointer(&ret), 3400 ) 3401 return 3402 } 3403 3404 // SetHeight sets the value of property "HTMLVideoElement.height" to val. 3405 // 3406 // It returns false if the property cannot be set. 3407 func (this HTMLVideoElement) SetHeight(val uint32) bool { 3408 return js.True == bindings.SetHTMLVideoElementHeight( 3409 this.ref, 3410 uint32(val), 3411 ) 3412 } 3413 3414 // VideoWidth returns the value of property "HTMLVideoElement.videoWidth". 3415 // 3416 // It returns ok=false if there is no such property. 3417 func (this HTMLVideoElement) VideoWidth() (ret uint32, ok bool) { 3418 ok = js.True == bindings.GetHTMLVideoElementVideoWidth( 3419 this.ref, js.Pointer(&ret), 3420 ) 3421 return 3422 } 3423 3424 // VideoHeight returns the value of property "HTMLVideoElement.videoHeight". 3425 // 3426 // It returns ok=false if there is no such property. 3427 func (this HTMLVideoElement) VideoHeight() (ret uint32, ok bool) { 3428 ok = js.True == bindings.GetHTMLVideoElementVideoHeight( 3429 this.ref, js.Pointer(&ret), 3430 ) 3431 return 3432 } 3433 3434 // Poster returns the value of property "HTMLVideoElement.poster". 3435 // 3436 // It returns ok=false if there is no such property. 3437 func (this HTMLVideoElement) Poster() (ret js.String, ok bool) { 3438 ok = js.True == bindings.GetHTMLVideoElementPoster( 3439 this.ref, js.Pointer(&ret), 3440 ) 3441 return 3442 } 3443 3444 // SetPoster sets the value of property "HTMLVideoElement.poster" to val. 3445 // 3446 // It returns false if the property cannot be set. 3447 func (this HTMLVideoElement) SetPoster(val js.String) bool { 3448 return js.True == bindings.SetHTMLVideoElementPoster( 3449 this.ref, 3450 val.Ref(), 3451 ) 3452 } 3453 3454 // PlaysInline returns the value of property "HTMLVideoElement.playsInline". 3455 // 3456 // It returns ok=false if there is no such property. 3457 func (this HTMLVideoElement) PlaysInline() (ret bool, ok bool) { 3458 ok = js.True == bindings.GetHTMLVideoElementPlaysInline( 3459 this.ref, js.Pointer(&ret), 3460 ) 3461 return 3462 } 3463 3464 // SetPlaysInline sets the value of property "HTMLVideoElement.playsInline" to val. 3465 // 3466 // It returns false if the property cannot be set. 3467 func (this HTMLVideoElement) SetPlaysInline(val bool) bool { 3468 return js.True == bindings.SetHTMLVideoElementPlaysInline( 3469 this.ref, 3470 js.Bool(bool(val)), 3471 ) 3472 } 3473 3474 // DisablePictureInPicture returns the value of property "HTMLVideoElement.disablePictureInPicture". 3475 // 3476 // It returns ok=false if there is no such property. 3477 func (this HTMLVideoElement) DisablePictureInPicture() (ret bool, ok bool) { 3478 ok = js.True == bindings.GetHTMLVideoElementDisablePictureInPicture( 3479 this.ref, js.Pointer(&ret), 3480 ) 3481 return 3482 } 3483 3484 // SetDisablePictureInPicture sets the value of property "HTMLVideoElement.disablePictureInPicture" to val. 3485 // 3486 // It returns false if the property cannot be set. 3487 func (this HTMLVideoElement) SetDisablePictureInPicture(val bool) bool { 3488 return js.True == bindings.SetHTMLVideoElementDisablePictureInPicture( 3489 this.ref, 3490 js.Bool(bool(val)), 3491 ) 3492 } 3493 3494 // HasFuncRequestVideoFrameCallback returns true if the method "HTMLVideoElement.requestVideoFrameCallback" exists. 3495 func (this HTMLVideoElement) HasFuncRequestVideoFrameCallback() bool { 3496 return js.True == bindings.HasFuncHTMLVideoElementRequestVideoFrameCallback( 3497 this.ref, 3498 ) 3499 } 3500 3501 // FuncRequestVideoFrameCallback returns the method "HTMLVideoElement.requestVideoFrameCallback". 3502 func (this HTMLVideoElement) FuncRequestVideoFrameCallback() (fn js.Func[func(callback js.Func[func(now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata)]) uint32]) { 3503 bindings.FuncHTMLVideoElementRequestVideoFrameCallback( 3504 this.ref, js.Pointer(&fn), 3505 ) 3506 return 3507 } 3508 3509 // RequestVideoFrameCallback calls the method "HTMLVideoElement.requestVideoFrameCallback". 3510 func (this HTMLVideoElement) RequestVideoFrameCallback(callback js.Func[func(now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata)]) (ret uint32) { 3511 bindings.CallHTMLVideoElementRequestVideoFrameCallback( 3512 this.ref, js.Pointer(&ret), 3513 callback.Ref(), 3514 ) 3515 3516 return 3517 } 3518 3519 // TryRequestVideoFrameCallback calls the method "HTMLVideoElement.requestVideoFrameCallback" 3520 // in a try/catch block and returns (_, err, ok = false) when it went through 3521 // the catch clause. 3522 func (this HTMLVideoElement) TryRequestVideoFrameCallback(callback js.Func[func(now DOMHighResTimeStamp, metadata *VideoFrameCallbackMetadata)]) (ret uint32, exception js.Any, ok bool) { 3523 ok = js.True == bindings.TryHTMLVideoElementRequestVideoFrameCallback( 3524 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3525 callback.Ref(), 3526 ) 3527 3528 return 3529 } 3530 3531 // HasFuncCancelVideoFrameCallback returns true if the method "HTMLVideoElement.cancelVideoFrameCallback" exists. 3532 func (this HTMLVideoElement) HasFuncCancelVideoFrameCallback() bool { 3533 return js.True == bindings.HasFuncHTMLVideoElementCancelVideoFrameCallback( 3534 this.ref, 3535 ) 3536 } 3537 3538 // FuncCancelVideoFrameCallback returns the method "HTMLVideoElement.cancelVideoFrameCallback". 3539 func (this HTMLVideoElement) FuncCancelVideoFrameCallback() (fn js.Func[func(handle uint32)]) { 3540 bindings.FuncHTMLVideoElementCancelVideoFrameCallback( 3541 this.ref, js.Pointer(&fn), 3542 ) 3543 return 3544 } 3545 3546 // CancelVideoFrameCallback calls the method "HTMLVideoElement.cancelVideoFrameCallback". 3547 func (this HTMLVideoElement) CancelVideoFrameCallback(handle uint32) (ret js.Void) { 3548 bindings.CallHTMLVideoElementCancelVideoFrameCallback( 3549 this.ref, js.Pointer(&ret), 3550 uint32(handle), 3551 ) 3552 3553 return 3554 } 3555 3556 // TryCancelVideoFrameCallback calls the method "HTMLVideoElement.cancelVideoFrameCallback" 3557 // in a try/catch block and returns (_, err, ok = false) when it went through 3558 // the catch clause. 3559 func (this HTMLVideoElement) TryCancelVideoFrameCallback(handle uint32) (ret js.Void, exception js.Any, ok bool) { 3560 ok = js.True == bindings.TryHTMLVideoElementCancelVideoFrameCallback( 3561 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3562 uint32(handle), 3563 ) 3564 3565 return 3566 } 3567 3568 // HasFuncRequestPictureInPicture returns true if the method "HTMLVideoElement.requestPictureInPicture" exists. 3569 func (this HTMLVideoElement) HasFuncRequestPictureInPicture() bool { 3570 return js.True == bindings.HasFuncHTMLVideoElementRequestPictureInPicture( 3571 this.ref, 3572 ) 3573 } 3574 3575 // FuncRequestPictureInPicture returns the method "HTMLVideoElement.requestPictureInPicture". 3576 func (this HTMLVideoElement) FuncRequestPictureInPicture() (fn js.Func[func() js.Promise[PictureInPictureWindow]]) { 3577 bindings.FuncHTMLVideoElementRequestPictureInPicture( 3578 this.ref, js.Pointer(&fn), 3579 ) 3580 return 3581 } 3582 3583 // RequestPictureInPicture calls the method "HTMLVideoElement.requestPictureInPicture". 3584 func (this HTMLVideoElement) RequestPictureInPicture() (ret js.Promise[PictureInPictureWindow]) { 3585 bindings.CallHTMLVideoElementRequestPictureInPicture( 3586 this.ref, js.Pointer(&ret), 3587 ) 3588 3589 return 3590 } 3591 3592 // TryRequestPictureInPicture calls the method "HTMLVideoElement.requestPictureInPicture" 3593 // in a try/catch block and returns (_, err, ok = false) when it went through 3594 // the catch clause. 3595 func (this HTMLVideoElement) TryRequestPictureInPicture() (ret js.Promise[PictureInPictureWindow], exception js.Any, ok bool) { 3596 ok = js.True == bindings.TryHTMLVideoElementRequestPictureInPicture( 3597 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3598 ) 3599 3600 return 3601 } 3602 3603 // HasFuncGetVideoPlaybackQuality returns true if the method "HTMLVideoElement.getVideoPlaybackQuality" exists. 3604 func (this HTMLVideoElement) HasFuncGetVideoPlaybackQuality() bool { 3605 return js.True == bindings.HasFuncHTMLVideoElementGetVideoPlaybackQuality( 3606 this.ref, 3607 ) 3608 } 3609 3610 // FuncGetVideoPlaybackQuality returns the method "HTMLVideoElement.getVideoPlaybackQuality". 3611 func (this HTMLVideoElement) FuncGetVideoPlaybackQuality() (fn js.Func[func() VideoPlaybackQuality]) { 3612 bindings.FuncHTMLVideoElementGetVideoPlaybackQuality( 3613 this.ref, js.Pointer(&fn), 3614 ) 3615 return 3616 } 3617 3618 // GetVideoPlaybackQuality calls the method "HTMLVideoElement.getVideoPlaybackQuality". 3619 func (this HTMLVideoElement) GetVideoPlaybackQuality() (ret VideoPlaybackQuality) { 3620 bindings.CallHTMLVideoElementGetVideoPlaybackQuality( 3621 this.ref, js.Pointer(&ret), 3622 ) 3623 3624 return 3625 } 3626 3627 // TryGetVideoPlaybackQuality calls the method "HTMLVideoElement.getVideoPlaybackQuality" 3628 // in a try/catch block and returns (_, err, ok = false) when it went through 3629 // the catch clause. 3630 func (this HTMLVideoElement) TryGetVideoPlaybackQuality() (ret VideoPlaybackQuality, exception js.Any, ok bool) { 3631 ok = js.True == bindings.TryHTMLVideoElementGetVideoPlaybackQuality( 3632 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3633 ) 3634 3635 return 3636 } 3637 3638 type PredefinedColorSpace uint32 3639 3640 const ( 3641 _ PredefinedColorSpace = iota 3642 3643 PredefinedColorSpace_SRGB 3644 PredefinedColorSpace_DISPLAY_P3 3645 ) 3646 3647 func (PredefinedColorSpace) FromRef(str js.Ref) PredefinedColorSpace { 3648 return PredefinedColorSpace(bindings.ConstOfPredefinedColorSpace(str)) 3649 } 3650 3651 func (x PredefinedColorSpace) String() (string, bool) { 3652 switch x { 3653 case PredefinedColorSpace_SRGB: 3654 return "srgb", true 3655 case PredefinedColorSpace_DISPLAY_P3: 3656 return "display-p3", true 3657 default: 3658 return "", false 3659 } 3660 } 3661 3662 type CanvasRenderingContext2DSettings struct { 3663 // Alpha is "CanvasRenderingContext2DSettings.alpha" 3664 // 3665 // Optional, defaults to true. 3666 // 3667 // NOTE: FFI_USE_Alpha MUST be set to true to make this field effective. 3668 Alpha bool 3669 // Desynchronized is "CanvasRenderingContext2DSettings.desynchronized" 3670 // 3671 // Optional, defaults to false. 3672 // 3673 // NOTE: FFI_USE_Desynchronized MUST be set to true to make this field effective. 3674 Desynchronized bool 3675 // ColorSpace is "CanvasRenderingContext2DSettings.colorSpace" 3676 // 3677 // Optional, defaults to "srgb". 3678 ColorSpace PredefinedColorSpace 3679 // WillReadFrequently is "CanvasRenderingContext2DSettings.willReadFrequently" 3680 // 3681 // Optional, defaults to false. 3682 // 3683 // NOTE: FFI_USE_WillReadFrequently MUST be set to true to make this field effective. 3684 WillReadFrequently bool 3685 3686 FFI_USE_Alpha bool // for Alpha. 3687 FFI_USE_Desynchronized bool // for Desynchronized. 3688 FFI_USE_WillReadFrequently bool // for WillReadFrequently. 3689 3690 FFI_USE bool 3691 } 3692 3693 // FromRef calls UpdateFrom and returns a CanvasRenderingContext2DSettings with all fields set. 3694 func (p CanvasRenderingContext2DSettings) FromRef(ref js.Ref) CanvasRenderingContext2DSettings { 3695 p.UpdateFrom(ref) 3696 return p 3697 } 3698 3699 // New creates a new CanvasRenderingContext2DSettings in the application heap. 3700 func (p CanvasRenderingContext2DSettings) New() js.Ref { 3701 return bindings.CanvasRenderingContext2DSettingsJSLoad( 3702 js.Pointer(&p), js.True, 0, 3703 ) 3704 } 3705 3706 // UpdateFrom copies value of all fields of the heap object to p. 3707 func (p *CanvasRenderingContext2DSettings) UpdateFrom(ref js.Ref) { 3708 bindings.CanvasRenderingContext2DSettingsJSStore( 3709 js.Pointer(p), ref, 3710 ) 3711 } 3712 3713 // Update writes all fields of the p to the heap object referenced by ref. 3714 func (p *CanvasRenderingContext2DSettings) Update(ref js.Ref) { 3715 bindings.CanvasRenderingContext2DSettingsJSLoad( 3716 js.Pointer(p), js.False, ref, 3717 ) 3718 } 3719 3720 // FreeMembers frees fields with heap reference, if recursive is true 3721 // free all heap references reachable from p. 3722 func (p *CanvasRenderingContext2DSettings) FreeMembers(recursive bool) { 3723 } 3724 3725 type CanvasGradient struct { 3726 ref js.Ref 3727 } 3728 3729 func (this CanvasGradient) Once() CanvasGradient { 3730 this.ref.Once() 3731 return this 3732 } 3733 3734 func (this CanvasGradient) Ref() js.Ref { 3735 return this.ref 3736 } 3737 3738 func (this CanvasGradient) FromRef(ref js.Ref) CanvasGradient { 3739 this.ref = ref 3740 return this 3741 } 3742 3743 func (this CanvasGradient) Free() { 3744 this.ref.Free() 3745 } 3746 3747 // HasFuncAddColorStop returns true if the method "CanvasGradient.addColorStop" exists. 3748 func (this CanvasGradient) HasFuncAddColorStop() bool { 3749 return js.True == bindings.HasFuncCanvasGradientAddColorStop( 3750 this.ref, 3751 ) 3752 } 3753 3754 // FuncAddColorStop returns the method "CanvasGradient.addColorStop". 3755 func (this CanvasGradient) FuncAddColorStop() (fn js.Func[func(offset float64, color js.String)]) { 3756 bindings.FuncCanvasGradientAddColorStop( 3757 this.ref, js.Pointer(&fn), 3758 ) 3759 return 3760 } 3761 3762 // AddColorStop calls the method "CanvasGradient.addColorStop". 3763 func (this CanvasGradient) AddColorStop(offset float64, color js.String) (ret js.Void) { 3764 bindings.CallCanvasGradientAddColorStop( 3765 this.ref, js.Pointer(&ret), 3766 float64(offset), 3767 color.Ref(), 3768 ) 3769 3770 return 3771 } 3772 3773 // TryAddColorStop calls the method "CanvasGradient.addColorStop" 3774 // in a try/catch block and returns (_, err, ok = false) when it went through 3775 // the catch clause. 3776 func (this CanvasGradient) TryAddColorStop(offset float64, color js.String) (ret js.Void, exception js.Any, ok bool) { 3777 ok = js.True == bindings.TryCanvasGradientAddColorStop( 3778 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3779 float64(offset), 3780 color.Ref(), 3781 ) 3782 3783 return 3784 } 3785 3786 type CanvasPattern struct { 3787 ref js.Ref 3788 } 3789 3790 func (this CanvasPattern) Once() CanvasPattern { 3791 this.ref.Once() 3792 return this 3793 } 3794 3795 func (this CanvasPattern) Ref() js.Ref { 3796 return this.ref 3797 } 3798 3799 func (this CanvasPattern) FromRef(ref js.Ref) CanvasPattern { 3800 this.ref = ref 3801 return this 3802 } 3803 3804 func (this CanvasPattern) Free() { 3805 this.ref.Free() 3806 } 3807 3808 // HasFuncSetTransform returns true if the method "CanvasPattern.setTransform" exists. 3809 func (this CanvasPattern) HasFuncSetTransform() bool { 3810 return js.True == bindings.HasFuncCanvasPatternSetTransform( 3811 this.ref, 3812 ) 3813 } 3814 3815 // FuncSetTransform returns the method "CanvasPattern.setTransform". 3816 func (this CanvasPattern) FuncSetTransform() (fn js.Func[func(transform DOMMatrix2DInit)]) { 3817 bindings.FuncCanvasPatternSetTransform( 3818 this.ref, js.Pointer(&fn), 3819 ) 3820 return 3821 } 3822 3823 // SetTransform calls the method "CanvasPattern.setTransform". 3824 func (this CanvasPattern) SetTransform(transform DOMMatrix2DInit) (ret js.Void) { 3825 bindings.CallCanvasPatternSetTransform( 3826 this.ref, js.Pointer(&ret), 3827 js.Pointer(&transform), 3828 ) 3829 3830 return 3831 } 3832 3833 // TrySetTransform calls the method "CanvasPattern.setTransform" 3834 // in a try/catch block and returns (_, err, ok = false) when it went through 3835 // the catch clause. 3836 func (this CanvasPattern) TrySetTransform(transform DOMMatrix2DInit) (ret js.Void, exception js.Any, ok bool) { 3837 ok = js.True == bindings.TryCanvasPatternSetTransform( 3838 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3839 js.Pointer(&transform), 3840 ) 3841 3842 return 3843 } 3844 3845 // HasFuncSetTransform1 returns true if the method "CanvasPattern.setTransform" exists. 3846 func (this CanvasPattern) HasFuncSetTransform1() bool { 3847 return js.True == bindings.HasFuncCanvasPatternSetTransform1( 3848 this.ref, 3849 ) 3850 } 3851 3852 // FuncSetTransform1 returns the method "CanvasPattern.setTransform". 3853 func (this CanvasPattern) FuncSetTransform1() (fn js.Func[func()]) { 3854 bindings.FuncCanvasPatternSetTransform1( 3855 this.ref, js.Pointer(&fn), 3856 ) 3857 return 3858 } 3859 3860 // SetTransform1 calls the method "CanvasPattern.setTransform". 3861 func (this CanvasPattern) SetTransform1() (ret js.Void) { 3862 bindings.CallCanvasPatternSetTransform1( 3863 this.ref, js.Pointer(&ret), 3864 ) 3865 3866 return 3867 } 3868 3869 // TrySetTransform1 calls the method "CanvasPattern.setTransform" 3870 // in a try/catch block and returns (_, err, ok = false) when it went through 3871 // the catch clause. 3872 func (this CanvasPattern) TrySetTransform1() (ret js.Void, exception js.Any, ok bool) { 3873 ok = js.True == bindings.TryCanvasPatternSetTransform1( 3874 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3875 ) 3876 3877 return 3878 } 3879 3880 type ImageBitmap struct { 3881 ref js.Ref 3882 } 3883 3884 func (this ImageBitmap) Once() ImageBitmap { 3885 this.ref.Once() 3886 return this 3887 } 3888 3889 func (this ImageBitmap) Ref() js.Ref { 3890 return this.ref 3891 } 3892 3893 func (this ImageBitmap) FromRef(ref js.Ref) ImageBitmap { 3894 this.ref = ref 3895 return this 3896 } 3897 3898 func (this ImageBitmap) Free() { 3899 this.ref.Free() 3900 } 3901 3902 // Width returns the value of property "ImageBitmap.width". 3903 // 3904 // It returns ok=false if there is no such property. 3905 func (this ImageBitmap) Width() (ret uint32, ok bool) { 3906 ok = js.True == bindings.GetImageBitmapWidth( 3907 this.ref, js.Pointer(&ret), 3908 ) 3909 return 3910 } 3911 3912 // Height returns the value of property "ImageBitmap.height". 3913 // 3914 // It returns ok=false if there is no such property. 3915 func (this ImageBitmap) Height() (ret uint32, ok bool) { 3916 ok = js.True == bindings.GetImageBitmapHeight( 3917 this.ref, js.Pointer(&ret), 3918 ) 3919 return 3920 } 3921 3922 // HasFuncClose returns true if the method "ImageBitmap.close" exists. 3923 func (this ImageBitmap) HasFuncClose() bool { 3924 return js.True == bindings.HasFuncImageBitmapClose( 3925 this.ref, 3926 ) 3927 } 3928 3929 // FuncClose returns the method "ImageBitmap.close". 3930 func (this ImageBitmap) FuncClose() (fn js.Func[func()]) { 3931 bindings.FuncImageBitmapClose( 3932 this.ref, js.Pointer(&fn), 3933 ) 3934 return 3935 } 3936 3937 // Close calls the method "ImageBitmap.close". 3938 func (this ImageBitmap) Close() (ret js.Void) { 3939 bindings.CallImageBitmapClose( 3940 this.ref, js.Pointer(&ret), 3941 ) 3942 3943 return 3944 } 3945 3946 // TryClose calls the method "ImageBitmap.close" 3947 // in a try/catch block and returns (_, err, ok = false) when it went through 3948 // the catch clause. 3949 func (this ImageBitmap) TryClose() (ret js.Void, exception js.Any, ok bool) { 3950 ok = js.True == bindings.TryImageBitmapClose( 3951 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3952 ) 3953 3954 return 3955 } 3956 3957 type CanvasFillRule uint32 3958 3959 const ( 3960 _ CanvasFillRule = iota 3961 3962 CanvasFillRule_NONZERO 3963 CanvasFillRule_EVENODD 3964 ) 3965 3966 func (CanvasFillRule) FromRef(str js.Ref) CanvasFillRule { 3967 return CanvasFillRule(bindings.ConstOfCanvasFillRule(str)) 3968 } 3969 3970 func (x CanvasFillRule) String() (string, bool) { 3971 switch x { 3972 case CanvasFillRule_NONZERO: 3973 return "nonzero", true 3974 case CanvasFillRule_EVENODD: 3975 return "evenodd", true 3976 default: 3977 return "", false 3978 } 3979 } 3980 3981 type OneOf_Path2D_String struct { 3982 ref js.Ref 3983 } 3984 3985 func (x OneOf_Path2D_String) Ref() js.Ref { 3986 return x.ref 3987 } 3988 3989 func (x OneOf_Path2D_String) Free() { 3990 x.ref.Free() 3991 } 3992 3993 func (x OneOf_Path2D_String) FromRef(ref js.Ref) OneOf_Path2D_String { 3994 return OneOf_Path2D_String{ 3995 ref: ref, 3996 } 3997 } 3998 3999 func (x OneOf_Path2D_String) Path2D() Path2D { 4000 return Path2D{}.FromRef(x.ref) 4001 } 4002 4003 func (x OneOf_Path2D_String) String() js.String { 4004 return js.String{}.FromRef(x.ref) 4005 } 4006 4007 type OneOf_Float64_DOMPointInit struct { 4008 ref js.Ref 4009 } 4010 4011 func (x OneOf_Float64_DOMPointInit) Ref() js.Ref { 4012 return x.ref 4013 } 4014 4015 func (x OneOf_Float64_DOMPointInit) Free() { 4016 x.ref.Free() 4017 } 4018 4019 func (x OneOf_Float64_DOMPointInit) FromRef(ref js.Ref) OneOf_Float64_DOMPointInit { 4020 return OneOf_Float64_DOMPointInit{ 4021 ref: ref, 4022 } 4023 } 4024 4025 func (x OneOf_Float64_DOMPointInit) Float64() float64 { 4026 return js.Number[float64]{}.FromRef(x.ref).Get() 4027 } 4028 4029 func (x OneOf_Float64_DOMPointInit) DOMPointInit() DOMPointInit { 4030 var ret DOMPointInit 4031 ret.UpdateFrom(x.ref) 4032 return ret 4033 } 4034 4035 type OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit struct { 4036 ref js.Ref 4037 } 4038 4039 func (x OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) Ref() js.Ref { 4040 return x.ref 4041 } 4042 4043 func (x OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) Free() { 4044 x.ref.Free() 4045 } 4046 4047 func (x OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) FromRef(ref js.Ref) OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit { 4048 return OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit{ 4049 ref: ref, 4050 } 4051 } 4052 4053 func (x OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) Float64() float64 { 4054 return js.Number[float64]{}.FromRef(x.ref).Get() 4055 } 4056 4057 func (x OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) DOMPointInit() DOMPointInit { 4058 var ret DOMPointInit 4059 ret.UpdateFrom(x.ref) 4060 return ret 4061 } 4062 4063 func (x OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) ArrayOneOf_Float64_DOMPointInit() js.Array[OneOf_Float64_DOMPointInit] { 4064 return js.Array[OneOf_Float64_DOMPointInit]{}.FromRef(x.ref) 4065 } 4066 4067 func NewPath2D(path OneOf_Path2D_String) (ret Path2D) { 4068 ret.ref = bindings.NewPath2DByPath2D( 4069 path.Ref()) 4070 return 4071 } 4072 4073 func NewPath2DByPath2D1() (ret Path2D) { 4074 ret.ref = bindings.NewPath2DByPath2D1() 4075 return 4076 } 4077 4078 type Path2D struct { 4079 ref js.Ref 4080 } 4081 4082 func (this Path2D) Once() Path2D { 4083 this.ref.Once() 4084 return this 4085 } 4086 4087 func (this Path2D) Ref() js.Ref { 4088 return this.ref 4089 } 4090 4091 func (this Path2D) FromRef(ref js.Ref) Path2D { 4092 this.ref = ref 4093 return this 4094 } 4095 4096 func (this Path2D) Free() { 4097 this.ref.Free() 4098 } 4099 4100 // HasFuncAddPath returns true if the method "Path2D.addPath" exists. 4101 func (this Path2D) HasFuncAddPath() bool { 4102 return js.True == bindings.HasFuncPath2DAddPath( 4103 this.ref, 4104 ) 4105 } 4106 4107 // FuncAddPath returns the method "Path2D.addPath". 4108 func (this Path2D) FuncAddPath() (fn js.Func[func(path Path2D, transform DOMMatrix2DInit)]) { 4109 bindings.FuncPath2DAddPath( 4110 this.ref, js.Pointer(&fn), 4111 ) 4112 return 4113 } 4114 4115 // AddPath calls the method "Path2D.addPath". 4116 func (this Path2D) AddPath(path Path2D, transform DOMMatrix2DInit) (ret js.Void) { 4117 bindings.CallPath2DAddPath( 4118 this.ref, js.Pointer(&ret), 4119 path.Ref(), 4120 js.Pointer(&transform), 4121 ) 4122 4123 return 4124 } 4125 4126 // TryAddPath calls the method "Path2D.addPath" 4127 // in a try/catch block and returns (_, err, ok = false) when it went through 4128 // the catch clause. 4129 func (this Path2D) TryAddPath(path Path2D, transform DOMMatrix2DInit) (ret js.Void, exception js.Any, ok bool) { 4130 ok = js.True == bindings.TryPath2DAddPath( 4131 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4132 path.Ref(), 4133 js.Pointer(&transform), 4134 ) 4135 4136 return 4137 } 4138 4139 // HasFuncAddPath1 returns true if the method "Path2D.addPath" exists. 4140 func (this Path2D) HasFuncAddPath1() bool { 4141 return js.True == bindings.HasFuncPath2DAddPath1( 4142 this.ref, 4143 ) 4144 } 4145 4146 // FuncAddPath1 returns the method "Path2D.addPath". 4147 func (this Path2D) FuncAddPath1() (fn js.Func[func(path Path2D)]) { 4148 bindings.FuncPath2DAddPath1( 4149 this.ref, js.Pointer(&fn), 4150 ) 4151 return 4152 } 4153 4154 // AddPath1 calls the method "Path2D.addPath". 4155 func (this Path2D) AddPath1(path Path2D) (ret js.Void) { 4156 bindings.CallPath2DAddPath1( 4157 this.ref, js.Pointer(&ret), 4158 path.Ref(), 4159 ) 4160 4161 return 4162 } 4163 4164 // TryAddPath1 calls the method "Path2D.addPath" 4165 // in a try/catch block and returns (_, err, ok = false) when it went through 4166 // the catch clause. 4167 func (this Path2D) TryAddPath1(path Path2D) (ret js.Void, exception js.Any, ok bool) { 4168 ok = js.True == bindings.TryPath2DAddPath1( 4169 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4170 path.Ref(), 4171 ) 4172 4173 return 4174 } 4175 4176 // HasFuncClosePath returns true if the method "Path2D.closePath" exists. 4177 func (this Path2D) HasFuncClosePath() bool { 4178 return js.True == bindings.HasFuncPath2DClosePath( 4179 this.ref, 4180 ) 4181 } 4182 4183 // FuncClosePath returns the method "Path2D.closePath". 4184 func (this Path2D) FuncClosePath() (fn js.Func[func()]) { 4185 bindings.FuncPath2DClosePath( 4186 this.ref, js.Pointer(&fn), 4187 ) 4188 return 4189 } 4190 4191 // ClosePath calls the method "Path2D.closePath". 4192 func (this Path2D) ClosePath() (ret js.Void) { 4193 bindings.CallPath2DClosePath( 4194 this.ref, js.Pointer(&ret), 4195 ) 4196 4197 return 4198 } 4199 4200 // TryClosePath calls the method "Path2D.closePath" 4201 // in a try/catch block and returns (_, err, ok = false) when it went through 4202 // the catch clause. 4203 func (this Path2D) TryClosePath() (ret js.Void, exception js.Any, ok bool) { 4204 ok = js.True == bindings.TryPath2DClosePath( 4205 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4206 ) 4207 4208 return 4209 } 4210 4211 // HasFuncMoveTo returns true if the method "Path2D.moveTo" exists. 4212 func (this Path2D) HasFuncMoveTo() bool { 4213 return js.True == bindings.HasFuncPath2DMoveTo( 4214 this.ref, 4215 ) 4216 } 4217 4218 // FuncMoveTo returns the method "Path2D.moveTo". 4219 func (this Path2D) FuncMoveTo() (fn js.Func[func(x float64, y float64)]) { 4220 bindings.FuncPath2DMoveTo( 4221 this.ref, js.Pointer(&fn), 4222 ) 4223 return 4224 } 4225 4226 // MoveTo calls the method "Path2D.moveTo". 4227 func (this Path2D) MoveTo(x float64, y float64) (ret js.Void) { 4228 bindings.CallPath2DMoveTo( 4229 this.ref, js.Pointer(&ret), 4230 float64(x), 4231 float64(y), 4232 ) 4233 4234 return 4235 } 4236 4237 // TryMoveTo calls the method "Path2D.moveTo" 4238 // in a try/catch block and returns (_, err, ok = false) when it went through 4239 // the catch clause. 4240 func (this Path2D) TryMoveTo(x float64, y float64) (ret js.Void, exception js.Any, ok bool) { 4241 ok = js.True == bindings.TryPath2DMoveTo( 4242 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4243 float64(x), 4244 float64(y), 4245 ) 4246 4247 return 4248 } 4249 4250 // HasFuncLineTo returns true if the method "Path2D.lineTo" exists. 4251 func (this Path2D) HasFuncLineTo() bool { 4252 return js.True == bindings.HasFuncPath2DLineTo( 4253 this.ref, 4254 ) 4255 } 4256 4257 // FuncLineTo returns the method "Path2D.lineTo". 4258 func (this Path2D) FuncLineTo() (fn js.Func[func(x float64, y float64)]) { 4259 bindings.FuncPath2DLineTo( 4260 this.ref, js.Pointer(&fn), 4261 ) 4262 return 4263 } 4264 4265 // LineTo calls the method "Path2D.lineTo". 4266 func (this Path2D) LineTo(x float64, y float64) (ret js.Void) { 4267 bindings.CallPath2DLineTo( 4268 this.ref, js.Pointer(&ret), 4269 float64(x), 4270 float64(y), 4271 ) 4272 4273 return 4274 } 4275 4276 // TryLineTo calls the method "Path2D.lineTo" 4277 // in a try/catch block and returns (_, err, ok = false) when it went through 4278 // the catch clause. 4279 func (this Path2D) TryLineTo(x float64, y float64) (ret js.Void, exception js.Any, ok bool) { 4280 ok = js.True == bindings.TryPath2DLineTo( 4281 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4282 float64(x), 4283 float64(y), 4284 ) 4285 4286 return 4287 } 4288 4289 // HasFuncQuadraticCurveTo returns true if the method "Path2D.quadraticCurveTo" exists. 4290 func (this Path2D) HasFuncQuadraticCurveTo() bool { 4291 return js.True == bindings.HasFuncPath2DQuadraticCurveTo( 4292 this.ref, 4293 ) 4294 } 4295 4296 // FuncQuadraticCurveTo returns the method "Path2D.quadraticCurveTo". 4297 func (this Path2D) FuncQuadraticCurveTo() (fn js.Func[func(cpx float64, cpy float64, x float64, y float64)]) { 4298 bindings.FuncPath2DQuadraticCurveTo( 4299 this.ref, js.Pointer(&fn), 4300 ) 4301 return 4302 } 4303 4304 // QuadraticCurveTo calls the method "Path2D.quadraticCurveTo". 4305 func (this Path2D) QuadraticCurveTo(cpx float64, cpy float64, x float64, y float64) (ret js.Void) { 4306 bindings.CallPath2DQuadraticCurveTo( 4307 this.ref, js.Pointer(&ret), 4308 float64(cpx), 4309 float64(cpy), 4310 float64(x), 4311 float64(y), 4312 ) 4313 4314 return 4315 } 4316 4317 // TryQuadraticCurveTo calls the method "Path2D.quadraticCurveTo" 4318 // in a try/catch block and returns (_, err, ok = false) when it went through 4319 // the catch clause. 4320 func (this Path2D) TryQuadraticCurveTo(cpx float64, cpy float64, x float64, y float64) (ret js.Void, exception js.Any, ok bool) { 4321 ok = js.True == bindings.TryPath2DQuadraticCurveTo( 4322 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4323 float64(cpx), 4324 float64(cpy), 4325 float64(x), 4326 float64(y), 4327 ) 4328 4329 return 4330 } 4331 4332 // HasFuncBezierCurveTo returns true if the method "Path2D.bezierCurveTo" exists. 4333 func (this Path2D) HasFuncBezierCurveTo() bool { 4334 return js.True == bindings.HasFuncPath2DBezierCurveTo( 4335 this.ref, 4336 ) 4337 } 4338 4339 // FuncBezierCurveTo returns the method "Path2D.bezierCurveTo". 4340 func (this Path2D) FuncBezierCurveTo() (fn js.Func[func(cp1x float64, cp1y float64, cp2x float64, cp2y float64, x float64, y float64)]) { 4341 bindings.FuncPath2DBezierCurveTo( 4342 this.ref, js.Pointer(&fn), 4343 ) 4344 return 4345 } 4346 4347 // BezierCurveTo calls the method "Path2D.bezierCurveTo". 4348 func (this Path2D) BezierCurveTo(cp1x float64, cp1y float64, cp2x float64, cp2y float64, x float64, y float64) (ret js.Void) { 4349 bindings.CallPath2DBezierCurveTo( 4350 this.ref, js.Pointer(&ret), 4351 float64(cp1x), 4352 float64(cp1y), 4353 float64(cp2x), 4354 float64(cp2y), 4355 float64(x), 4356 float64(y), 4357 ) 4358 4359 return 4360 } 4361 4362 // TryBezierCurveTo calls the method "Path2D.bezierCurveTo" 4363 // in a try/catch block and returns (_, err, ok = false) when it went through 4364 // the catch clause. 4365 func (this Path2D) TryBezierCurveTo(cp1x float64, cp1y float64, cp2x float64, cp2y float64, x float64, y float64) (ret js.Void, exception js.Any, ok bool) { 4366 ok = js.True == bindings.TryPath2DBezierCurveTo( 4367 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4368 float64(cp1x), 4369 float64(cp1y), 4370 float64(cp2x), 4371 float64(cp2y), 4372 float64(x), 4373 float64(y), 4374 ) 4375 4376 return 4377 } 4378 4379 // HasFuncArcTo returns true if the method "Path2D.arcTo" exists. 4380 func (this Path2D) HasFuncArcTo() bool { 4381 return js.True == bindings.HasFuncPath2DArcTo( 4382 this.ref, 4383 ) 4384 } 4385 4386 // FuncArcTo returns the method "Path2D.arcTo". 4387 func (this Path2D) FuncArcTo() (fn js.Func[func(x1 float64, y1 float64, x2 float64, y2 float64, radius float64)]) { 4388 bindings.FuncPath2DArcTo( 4389 this.ref, js.Pointer(&fn), 4390 ) 4391 return 4392 } 4393 4394 // ArcTo calls the method "Path2D.arcTo". 4395 func (this Path2D) ArcTo(x1 float64, y1 float64, x2 float64, y2 float64, radius float64) (ret js.Void) { 4396 bindings.CallPath2DArcTo( 4397 this.ref, js.Pointer(&ret), 4398 float64(x1), 4399 float64(y1), 4400 float64(x2), 4401 float64(y2), 4402 float64(radius), 4403 ) 4404 4405 return 4406 } 4407 4408 // TryArcTo calls the method "Path2D.arcTo" 4409 // in a try/catch block and returns (_, err, ok = false) when it went through 4410 // the catch clause. 4411 func (this Path2D) TryArcTo(x1 float64, y1 float64, x2 float64, y2 float64, radius float64) (ret js.Void, exception js.Any, ok bool) { 4412 ok = js.True == bindings.TryPath2DArcTo( 4413 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4414 float64(x1), 4415 float64(y1), 4416 float64(x2), 4417 float64(y2), 4418 float64(radius), 4419 ) 4420 4421 return 4422 } 4423 4424 // HasFuncRect returns true if the method "Path2D.rect" exists. 4425 func (this Path2D) HasFuncRect() bool { 4426 return js.True == bindings.HasFuncPath2DRect( 4427 this.ref, 4428 ) 4429 } 4430 4431 // FuncRect returns the method "Path2D.rect". 4432 func (this Path2D) FuncRect() (fn js.Func[func(x float64, y float64, w float64, h float64)]) { 4433 bindings.FuncPath2DRect( 4434 this.ref, js.Pointer(&fn), 4435 ) 4436 return 4437 } 4438 4439 // Rect calls the method "Path2D.rect". 4440 func (this Path2D) Rect(x float64, y float64, w float64, h float64) (ret js.Void) { 4441 bindings.CallPath2DRect( 4442 this.ref, js.Pointer(&ret), 4443 float64(x), 4444 float64(y), 4445 float64(w), 4446 float64(h), 4447 ) 4448 4449 return 4450 } 4451 4452 // TryRect calls the method "Path2D.rect" 4453 // in a try/catch block and returns (_, err, ok = false) when it went through 4454 // the catch clause. 4455 func (this Path2D) TryRect(x float64, y float64, w float64, h float64) (ret js.Void, exception js.Any, ok bool) { 4456 ok = js.True == bindings.TryPath2DRect( 4457 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4458 float64(x), 4459 float64(y), 4460 float64(w), 4461 float64(h), 4462 ) 4463 4464 return 4465 } 4466 4467 // HasFuncRoundRect returns true if the method "Path2D.roundRect" exists. 4468 func (this Path2D) HasFuncRoundRect() bool { 4469 return js.True == bindings.HasFuncPath2DRoundRect( 4470 this.ref, 4471 ) 4472 } 4473 4474 // FuncRoundRect returns the method "Path2D.roundRect". 4475 func (this Path2D) FuncRoundRect() (fn js.Func[func(x float64, y float64, w float64, h float64, radii OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit)]) { 4476 bindings.FuncPath2DRoundRect( 4477 this.ref, js.Pointer(&fn), 4478 ) 4479 return 4480 } 4481 4482 // RoundRect calls the method "Path2D.roundRect". 4483 func (this Path2D) RoundRect(x float64, y float64, w float64, h float64, radii OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) (ret js.Void) { 4484 bindings.CallPath2DRoundRect( 4485 this.ref, js.Pointer(&ret), 4486 float64(x), 4487 float64(y), 4488 float64(w), 4489 float64(h), 4490 radii.Ref(), 4491 ) 4492 4493 return 4494 } 4495 4496 // TryRoundRect calls the method "Path2D.roundRect" 4497 // in a try/catch block and returns (_, err, ok = false) when it went through 4498 // the catch clause. 4499 func (this Path2D) TryRoundRect(x float64, y float64, w float64, h float64, radii OneOf_Float64_DOMPointInit_ArrayOneOf_Float64_DOMPointInit) (ret js.Void, exception js.Any, ok bool) { 4500 ok = js.True == bindings.TryPath2DRoundRect( 4501 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4502 float64(x), 4503 float64(y), 4504 float64(w), 4505 float64(h), 4506 radii.Ref(), 4507 ) 4508 4509 return 4510 } 4511 4512 // HasFuncRoundRect1 returns true if the method "Path2D.roundRect" exists. 4513 func (this Path2D) HasFuncRoundRect1() bool { 4514 return js.True == bindings.HasFuncPath2DRoundRect1( 4515 this.ref, 4516 ) 4517 } 4518 4519 // FuncRoundRect1 returns the method "Path2D.roundRect". 4520 func (this Path2D) FuncRoundRect1() (fn js.Func[func(x float64, y float64, w float64, h float64)]) { 4521 bindings.FuncPath2DRoundRect1( 4522 this.ref, js.Pointer(&fn), 4523 ) 4524 return 4525 } 4526 4527 // RoundRect1 calls the method "Path2D.roundRect". 4528 func (this Path2D) RoundRect1(x float64, y float64, w float64, h float64) (ret js.Void) { 4529 bindings.CallPath2DRoundRect1( 4530 this.ref, js.Pointer(&ret), 4531 float64(x), 4532 float64(y), 4533 float64(w), 4534 float64(h), 4535 ) 4536 4537 return 4538 } 4539 4540 // TryRoundRect1 calls the method "Path2D.roundRect" 4541 // in a try/catch block and returns (_, err, ok = false) when it went through 4542 // the catch clause. 4543 func (this Path2D) TryRoundRect1(x float64, y float64, w float64, h float64) (ret js.Void, exception js.Any, ok bool) { 4544 ok = js.True == bindings.TryPath2DRoundRect1( 4545 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4546 float64(x), 4547 float64(y), 4548 float64(w), 4549 float64(h), 4550 ) 4551 4552 return 4553 } 4554 4555 // HasFuncArc returns true if the method "Path2D.arc" exists. 4556 func (this Path2D) HasFuncArc() bool { 4557 return js.True == bindings.HasFuncPath2DArc( 4558 this.ref, 4559 ) 4560 } 4561 4562 // FuncArc returns the method "Path2D.arc". 4563 func (this Path2D) FuncArc() (fn js.Func[func(x float64, y float64, radius float64, startAngle float64, endAngle float64, counterclockwise bool)]) { 4564 bindings.FuncPath2DArc( 4565 this.ref, js.Pointer(&fn), 4566 ) 4567 return 4568 } 4569 4570 // Arc calls the method "Path2D.arc". 4571 func (this Path2D) Arc(x float64, y float64, radius float64, startAngle float64, endAngle float64, counterclockwise bool) (ret js.Void) { 4572 bindings.CallPath2DArc( 4573 this.ref, js.Pointer(&ret), 4574 float64(x), 4575 float64(y), 4576 float64(radius), 4577 float64(startAngle), 4578 float64(endAngle), 4579 js.Bool(bool(counterclockwise)), 4580 ) 4581 4582 return 4583 } 4584 4585 // TryArc calls the method "Path2D.arc" 4586 // in a try/catch block and returns (_, err, ok = false) when it went through 4587 // the catch clause. 4588 func (this Path2D) TryArc(x float64, y float64, radius float64, startAngle float64, endAngle float64, counterclockwise bool) (ret js.Void, exception js.Any, ok bool) { 4589 ok = js.True == bindings.TryPath2DArc( 4590 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4591 float64(x), 4592 float64(y), 4593 float64(radius), 4594 float64(startAngle), 4595 float64(endAngle), 4596 js.Bool(bool(counterclockwise)), 4597 ) 4598 4599 return 4600 } 4601 4602 // HasFuncArc1 returns true if the method "Path2D.arc" exists. 4603 func (this Path2D) HasFuncArc1() bool { 4604 return js.True == bindings.HasFuncPath2DArc1( 4605 this.ref, 4606 ) 4607 } 4608 4609 // FuncArc1 returns the method "Path2D.arc". 4610 func (this Path2D) FuncArc1() (fn js.Func[func(x float64, y float64, radius float64, startAngle float64, endAngle float64)]) { 4611 bindings.FuncPath2DArc1( 4612 this.ref, js.Pointer(&fn), 4613 ) 4614 return 4615 } 4616 4617 // Arc1 calls the method "Path2D.arc". 4618 func (this Path2D) Arc1(x float64, y float64, radius float64, startAngle float64, endAngle float64) (ret js.Void) { 4619 bindings.CallPath2DArc1( 4620 this.ref, js.Pointer(&ret), 4621 float64(x), 4622 float64(y), 4623 float64(radius), 4624 float64(startAngle), 4625 float64(endAngle), 4626 ) 4627 4628 return 4629 } 4630 4631 // TryArc1 calls the method "Path2D.arc" 4632 // in a try/catch block and returns (_, err, ok = false) when it went through 4633 // the catch clause. 4634 func (this Path2D) TryArc1(x float64, y float64, radius float64, startAngle float64, endAngle float64) (ret js.Void, exception js.Any, ok bool) { 4635 ok = js.True == bindings.TryPath2DArc1( 4636 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4637 float64(x), 4638 float64(y), 4639 float64(radius), 4640 float64(startAngle), 4641 float64(endAngle), 4642 ) 4643 4644 return 4645 } 4646 4647 // HasFuncEllipse returns true if the method "Path2D.ellipse" exists. 4648 func (this Path2D) HasFuncEllipse() bool { 4649 return js.True == bindings.HasFuncPath2DEllipse( 4650 this.ref, 4651 ) 4652 } 4653 4654 // FuncEllipse returns the method "Path2D.ellipse". 4655 func (this Path2D) FuncEllipse() (fn js.Func[func(x float64, y float64, radiusX float64, radiusY float64, rotation float64, startAngle float64, endAngle float64, counterclockwise bool)]) { 4656 bindings.FuncPath2DEllipse( 4657 this.ref, js.Pointer(&fn), 4658 ) 4659 return 4660 } 4661 4662 // Ellipse calls the method "Path2D.ellipse". 4663 func (this Path2D) Ellipse(x float64, y float64, radiusX float64, radiusY float64, rotation float64, startAngle float64, endAngle float64, counterclockwise bool) (ret js.Void) { 4664 bindings.CallPath2DEllipse( 4665 this.ref, js.Pointer(&ret), 4666 float64(x), 4667 float64(y), 4668 float64(radiusX), 4669 float64(radiusY), 4670 float64(rotation), 4671 float64(startAngle), 4672 float64(endAngle), 4673 js.Bool(bool(counterclockwise)), 4674 ) 4675 4676 return 4677 } 4678 4679 // TryEllipse calls the method "Path2D.ellipse" 4680 // in a try/catch block and returns (_, err, ok = false) when it went through 4681 // the catch clause. 4682 func (this Path2D) TryEllipse(x float64, y float64, radiusX float64, radiusY float64, rotation float64, startAngle float64, endAngle float64, counterclockwise bool) (ret js.Void, exception js.Any, ok bool) { 4683 ok = js.True == bindings.TryPath2DEllipse( 4684 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4685 float64(x), 4686 float64(y), 4687 float64(radiusX), 4688 float64(radiusY), 4689 float64(rotation), 4690 float64(startAngle), 4691 float64(endAngle), 4692 js.Bool(bool(counterclockwise)), 4693 ) 4694 4695 return 4696 } 4697 4698 // HasFuncEllipse1 returns true if the method "Path2D.ellipse" exists. 4699 func (this Path2D) HasFuncEllipse1() bool { 4700 return js.True == bindings.HasFuncPath2DEllipse1( 4701 this.ref, 4702 ) 4703 } 4704 4705 // FuncEllipse1 returns the method "Path2D.ellipse". 4706 func (this Path2D) FuncEllipse1() (fn js.Func[func(x float64, y float64, radiusX float64, radiusY float64, rotation float64, startAngle float64, endAngle float64)]) { 4707 bindings.FuncPath2DEllipse1( 4708 this.ref, js.Pointer(&fn), 4709 ) 4710 return 4711 } 4712 4713 // Ellipse1 calls the method "Path2D.ellipse". 4714 func (this Path2D) Ellipse1(x float64, y float64, radiusX float64, radiusY float64, rotation float64, startAngle float64, endAngle float64) (ret js.Void) { 4715 bindings.CallPath2DEllipse1( 4716 this.ref, js.Pointer(&ret), 4717 float64(x), 4718 float64(y), 4719 float64(radiusX), 4720 float64(radiusY), 4721 float64(rotation), 4722 float64(startAngle), 4723 float64(endAngle), 4724 ) 4725 4726 return 4727 } 4728 4729 // TryEllipse1 calls the method "Path2D.ellipse" 4730 // in a try/catch block and returns (_, err, ok = false) when it went through 4731 // the catch clause. 4732 func (this Path2D) TryEllipse1(x float64, y float64, radiusX float64, radiusY float64, rotation float64, startAngle float64, endAngle float64) (ret js.Void, exception js.Any, ok bool) { 4733 ok = js.True == bindings.TryPath2DEllipse1( 4734 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4735 float64(x), 4736 float64(y), 4737 float64(radiusX), 4738 float64(radiusY), 4739 float64(rotation), 4740 float64(startAngle), 4741 float64(endAngle), 4742 ) 4743 4744 return 4745 } 4746 4747 type TextMetrics struct { 4748 ref js.Ref 4749 } 4750 4751 func (this TextMetrics) Once() TextMetrics { 4752 this.ref.Once() 4753 return this 4754 } 4755 4756 func (this TextMetrics) Ref() js.Ref { 4757 return this.ref 4758 } 4759 4760 func (this TextMetrics) FromRef(ref js.Ref) TextMetrics { 4761 this.ref = ref 4762 return this 4763 } 4764 4765 func (this TextMetrics) Free() { 4766 this.ref.Free() 4767 } 4768 4769 // Width returns the value of property "TextMetrics.width". 4770 // 4771 // It returns ok=false if there is no such property. 4772 func (this TextMetrics) Width() (ret float64, ok bool) { 4773 ok = js.True == bindings.GetTextMetricsWidth( 4774 this.ref, js.Pointer(&ret), 4775 ) 4776 return 4777 } 4778 4779 // ActualBoundingBoxLeft returns the value of property "TextMetrics.actualBoundingBoxLeft". 4780 // 4781 // It returns ok=false if there is no such property. 4782 func (this TextMetrics) ActualBoundingBoxLeft() (ret float64, ok bool) { 4783 ok = js.True == bindings.GetTextMetricsActualBoundingBoxLeft( 4784 this.ref, js.Pointer(&ret), 4785 ) 4786 return 4787 } 4788 4789 // ActualBoundingBoxRight returns the value of property "TextMetrics.actualBoundingBoxRight". 4790 // 4791 // It returns ok=false if there is no such property. 4792 func (this TextMetrics) ActualBoundingBoxRight() (ret float64, ok bool) { 4793 ok = js.True == bindings.GetTextMetricsActualBoundingBoxRight( 4794 this.ref, js.Pointer(&ret), 4795 ) 4796 return 4797 } 4798 4799 // FontBoundingBoxAscent returns the value of property "TextMetrics.fontBoundingBoxAscent". 4800 // 4801 // It returns ok=false if there is no such property. 4802 func (this TextMetrics) FontBoundingBoxAscent() (ret float64, ok bool) { 4803 ok = js.True == bindings.GetTextMetricsFontBoundingBoxAscent( 4804 this.ref, js.Pointer(&ret), 4805 ) 4806 return 4807 } 4808 4809 // FontBoundingBoxDescent returns the value of property "TextMetrics.fontBoundingBoxDescent". 4810 // 4811 // It returns ok=false if there is no such property. 4812 func (this TextMetrics) FontBoundingBoxDescent() (ret float64, ok bool) { 4813 ok = js.True == bindings.GetTextMetricsFontBoundingBoxDescent( 4814 this.ref, js.Pointer(&ret), 4815 ) 4816 return 4817 } 4818 4819 // ActualBoundingBoxAscent returns the value of property "TextMetrics.actualBoundingBoxAscent". 4820 // 4821 // It returns ok=false if there is no such property. 4822 func (this TextMetrics) ActualBoundingBoxAscent() (ret float64, ok bool) { 4823 ok = js.True == bindings.GetTextMetricsActualBoundingBoxAscent( 4824 this.ref, js.Pointer(&ret), 4825 ) 4826 return 4827 } 4828 4829 // ActualBoundingBoxDescent returns the value of property "TextMetrics.actualBoundingBoxDescent". 4830 // 4831 // It returns ok=false if there is no such property. 4832 func (this TextMetrics) ActualBoundingBoxDescent() (ret float64, ok bool) { 4833 ok = js.True == bindings.GetTextMetricsActualBoundingBoxDescent( 4834 this.ref, js.Pointer(&ret), 4835 ) 4836 return 4837 } 4838 4839 // EmHeightAscent returns the value of property "TextMetrics.emHeightAscent". 4840 // 4841 // It returns ok=false if there is no such property. 4842 func (this TextMetrics) EmHeightAscent() (ret float64, ok bool) { 4843 ok = js.True == bindings.GetTextMetricsEmHeightAscent( 4844 this.ref, js.Pointer(&ret), 4845 ) 4846 return 4847 } 4848 4849 // EmHeightDescent returns the value of property "TextMetrics.emHeightDescent". 4850 // 4851 // It returns ok=false if there is no such property. 4852 func (this TextMetrics) EmHeightDescent() (ret float64, ok bool) { 4853 ok = js.True == bindings.GetTextMetricsEmHeightDescent( 4854 this.ref, js.Pointer(&ret), 4855 ) 4856 return 4857 } 4858 4859 // HangingBaseline returns the value of property "TextMetrics.hangingBaseline". 4860 // 4861 // It returns ok=false if there is no such property. 4862 func (this TextMetrics) HangingBaseline() (ret float64, ok bool) { 4863 ok = js.True == bindings.GetTextMetricsHangingBaseline( 4864 this.ref, js.Pointer(&ret), 4865 ) 4866 return 4867 } 4868 4869 // AlphabeticBaseline returns the value of property "TextMetrics.alphabeticBaseline". 4870 // 4871 // It returns ok=false if there is no such property. 4872 func (this TextMetrics) AlphabeticBaseline() (ret float64, ok bool) { 4873 ok = js.True == bindings.GetTextMetricsAlphabeticBaseline( 4874 this.ref, js.Pointer(&ret), 4875 ) 4876 return 4877 } 4878 4879 // IdeographicBaseline returns the value of property "TextMetrics.ideographicBaseline". 4880 // 4881 // It returns ok=false if there is no such property. 4882 func (this TextMetrics) IdeographicBaseline() (ret float64, ok bool) { 4883 ok = js.True == bindings.GetTextMetricsIdeographicBaseline( 4884 this.ref, js.Pointer(&ret), 4885 ) 4886 return 4887 } 4888 4889 type ImageDataSettings struct { 4890 // ColorSpace is "ImageDataSettings.colorSpace" 4891 // 4892 // Optional 4893 ColorSpace PredefinedColorSpace 4894 4895 FFI_USE bool 4896 } 4897 4898 // FromRef calls UpdateFrom and returns a ImageDataSettings with all fields set. 4899 func (p ImageDataSettings) FromRef(ref js.Ref) ImageDataSettings { 4900 p.UpdateFrom(ref) 4901 return p 4902 } 4903 4904 // New creates a new ImageDataSettings in the application heap. 4905 func (p ImageDataSettings) New() js.Ref { 4906 return bindings.ImageDataSettingsJSLoad( 4907 js.Pointer(&p), js.True, 0, 4908 ) 4909 } 4910 4911 // UpdateFrom copies value of all fields of the heap object to p. 4912 func (p *ImageDataSettings) UpdateFrom(ref js.Ref) { 4913 bindings.ImageDataSettingsJSStore( 4914 js.Pointer(p), ref, 4915 ) 4916 } 4917 4918 // Update writes all fields of the p to the heap object referenced by ref. 4919 func (p *ImageDataSettings) Update(ref js.Ref) { 4920 bindings.ImageDataSettingsJSLoad( 4921 js.Pointer(p), js.False, ref, 4922 ) 4923 } 4924 4925 // FreeMembers frees fields with heap reference, if recursive is true 4926 // free all heap references reachable from p. 4927 func (p *ImageDataSettings) FreeMembers(recursive bool) { 4928 } 4929 4930 func NewImageData(sw uint32, sh uint32, settings ImageDataSettings) (ret ImageData) { 4931 ret.ref = bindings.NewImageDataByImageData( 4932 uint32(sw), 4933 uint32(sh), 4934 js.Pointer(&settings)) 4935 return 4936 } 4937 4938 func NewImageDataByImageData1(sw uint32, sh uint32) (ret ImageData) { 4939 ret.ref = bindings.NewImageDataByImageData1( 4940 uint32(sw), 4941 uint32(sh)) 4942 return 4943 } 4944 4945 func NewImageDataByImageData2(data js.TypedArray[uint8], sw uint32, sh uint32, settings ImageDataSettings) (ret ImageData) { 4946 ret.ref = bindings.NewImageDataByImageData2( 4947 data.Ref(), 4948 uint32(sw), 4949 uint32(sh), 4950 js.Pointer(&settings)) 4951 return 4952 } 4953 4954 func NewImageDataByImageData3(data js.TypedArray[uint8], sw uint32, sh uint32) (ret ImageData) { 4955 ret.ref = bindings.NewImageDataByImageData3( 4956 data.Ref(), 4957 uint32(sw), 4958 uint32(sh)) 4959 return 4960 } 4961 4962 func NewImageDataByImageData4(data js.TypedArray[uint8], sw uint32) (ret ImageData) { 4963 ret.ref = bindings.NewImageDataByImageData4( 4964 data.Ref(), 4965 uint32(sw)) 4966 return 4967 } 4968 4969 type ImageData struct { 4970 ref js.Ref 4971 } 4972 4973 func (this ImageData) Once() ImageData { 4974 this.ref.Once() 4975 return this 4976 } 4977 4978 func (this ImageData) Ref() js.Ref { 4979 return this.ref 4980 } 4981 4982 func (this ImageData) FromRef(ref js.Ref) ImageData { 4983 this.ref = ref 4984 return this 4985 } 4986 4987 func (this ImageData) Free() { 4988 this.ref.Free() 4989 } 4990 4991 // Width returns the value of property "ImageData.width". 4992 // 4993 // It returns ok=false if there is no such property. 4994 func (this ImageData) Width() (ret uint32, ok bool) { 4995 ok = js.True == bindings.GetImageDataWidth( 4996 this.ref, js.Pointer(&ret), 4997 ) 4998 return 4999 } 5000 5001 // Height returns the value of property "ImageData.height". 5002 // 5003 // It returns ok=false if there is no such property. 5004 func (this ImageData) Height() (ret uint32, ok bool) { 5005 ok = js.True == bindings.GetImageDataHeight( 5006 this.ref, js.Pointer(&ret), 5007 ) 5008 return 5009 } 5010 5011 // Data returns the value of property "ImageData.data". 5012 // 5013 // It returns ok=false if there is no such property. 5014 func (this ImageData) Data() (ret js.TypedArray[uint8], ok bool) { 5015 ok = js.True == bindings.GetImageDataData( 5016 this.ref, js.Pointer(&ret), 5017 ) 5018 return 5019 } 5020 5021 // ColorSpace returns the value of property "ImageData.colorSpace". 5022 // 5023 // It returns ok=false if there is no such property. 5024 func (this ImageData) ColorSpace() (ret PredefinedColorSpace, ok bool) { 5025 ok = js.True == bindings.GetImageDataColorSpace( 5026 this.ref, js.Pointer(&ret), 5027 ) 5028 return 5029 } 5030 5031 type ImageSmoothingQuality uint32