github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis55_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/ffi/js" 9 "github.com/primecitizens/pcz/std/plat/js/web/bindings" 10 ) 11 12 type Transformer struct { 13 // Start is "Transformer.start" 14 // 15 // Optional 16 Start js.Func[func(controller TransformStreamDefaultController) js.Any] 17 // Transform is "Transformer.transform" 18 // 19 // Optional 20 Transform js.Func[func(chunk js.Any, controller TransformStreamDefaultController) js.Promise[js.Void]] 21 // Flush is "Transformer.flush" 22 // 23 // Optional 24 Flush js.Func[func(controller TransformStreamDefaultController) js.Promise[js.Void]] 25 // ReadableType is "Transformer.readableType" 26 // 27 // Optional 28 ReadableType js.Any 29 // WritableType is "Transformer.writableType" 30 // 31 // Optional 32 WritableType js.Any 33 34 FFI_USE bool 35 } 36 37 // FromRef calls UpdateFrom and returns a Transformer with all fields set. 38 func (p Transformer) FromRef(ref js.Ref) Transformer { 39 p.UpdateFrom(ref) 40 return p 41 } 42 43 // New creates a new Transformer in the application heap. 44 func (p Transformer) New() js.Ref { 45 return bindings.TransformerJSLoad( 46 js.Pointer(&p), js.True, 0, 47 ) 48 } 49 50 // UpdateFrom copies value of all fields of the heap object to p. 51 func (p *Transformer) UpdateFrom(ref js.Ref) { 52 bindings.TransformerJSStore( 53 js.Pointer(p), ref, 54 ) 55 } 56 57 // Update writes all fields of the p to the heap object referenced by ref. 58 func (p *Transformer) Update(ref js.Ref) { 59 bindings.TransformerJSLoad( 60 js.Pointer(p), js.False, ref, 61 ) 62 } 63 64 // FreeMembers frees fields with heap reference, if recursive is true 65 // free all heap references reachable from p. 66 func (p *Transformer) FreeMembers(recursive bool) { 67 js.Free( 68 p.Start.Ref(), 69 p.Transform.Ref(), 70 p.Flush.Ref(), 71 p.ReadableType.Ref(), 72 p.WritableType.Ref(), 73 ) 74 p.Start = p.Start.FromRef(js.Undefined) 75 p.Transform = p.Transform.FromRef(js.Undefined) 76 p.Flush = p.Flush.FromRef(js.Undefined) 77 p.ReadableType = p.ReadableType.FromRef(js.Undefined) 78 p.WritableType = p.WritableType.FromRef(js.Undefined) 79 } 80 81 type TransitionEventInit struct { 82 // PropertyName is "TransitionEventInit.propertyName" 83 // 84 // Optional, defaults to "". 85 PropertyName js.String 86 // ElapsedTime is "TransitionEventInit.elapsedTime" 87 // 88 // Optional, defaults to 0.0. 89 // 90 // NOTE: FFI_USE_ElapsedTime MUST be set to true to make this field effective. 91 ElapsedTime float64 92 // PseudoElement is "TransitionEventInit.pseudoElement" 93 // 94 // Optional, defaults to "". 95 PseudoElement js.String 96 // Bubbles is "TransitionEventInit.bubbles" 97 // 98 // Optional, defaults to false. 99 // 100 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 101 Bubbles bool 102 // Cancelable is "TransitionEventInit.cancelable" 103 // 104 // Optional, defaults to false. 105 // 106 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 107 Cancelable bool 108 // Composed is "TransitionEventInit.composed" 109 // 110 // Optional, defaults to false. 111 // 112 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 113 Composed bool 114 115 FFI_USE_ElapsedTime bool // for ElapsedTime. 116 FFI_USE_Bubbles bool // for Bubbles. 117 FFI_USE_Cancelable bool // for Cancelable. 118 FFI_USE_Composed bool // for Composed. 119 120 FFI_USE bool 121 } 122 123 // FromRef calls UpdateFrom and returns a TransitionEventInit with all fields set. 124 func (p TransitionEventInit) FromRef(ref js.Ref) TransitionEventInit { 125 p.UpdateFrom(ref) 126 return p 127 } 128 129 // New creates a new TransitionEventInit in the application heap. 130 func (p TransitionEventInit) New() js.Ref { 131 return bindings.TransitionEventInitJSLoad( 132 js.Pointer(&p), js.True, 0, 133 ) 134 } 135 136 // UpdateFrom copies value of all fields of the heap object to p. 137 func (p *TransitionEventInit) UpdateFrom(ref js.Ref) { 138 bindings.TransitionEventInitJSStore( 139 js.Pointer(p), ref, 140 ) 141 } 142 143 // Update writes all fields of the p to the heap object referenced by ref. 144 func (p *TransitionEventInit) Update(ref js.Ref) { 145 bindings.TransitionEventInitJSLoad( 146 js.Pointer(p), js.False, ref, 147 ) 148 } 149 150 // FreeMembers frees fields with heap reference, if recursive is true 151 // free all heap references reachable from p. 152 func (p *TransitionEventInit) FreeMembers(recursive bool) { 153 js.Free( 154 p.PropertyName.Ref(), 155 p.PseudoElement.Ref(), 156 ) 157 p.PropertyName = p.PropertyName.FromRef(js.Undefined) 158 p.PseudoElement = p.PseudoElement.FromRef(js.Undefined) 159 } 160 161 func NewTransitionEvent(typ js.String, transitionEventInitDict TransitionEventInit) (ret TransitionEvent) { 162 ret.ref = bindings.NewTransitionEventByTransitionEvent( 163 typ.Ref(), 164 js.Pointer(&transitionEventInitDict)) 165 return 166 } 167 168 func NewTransitionEventByTransitionEvent1(typ js.String) (ret TransitionEvent) { 169 ret.ref = bindings.NewTransitionEventByTransitionEvent1( 170 typ.Ref()) 171 return 172 } 173 174 type TransitionEvent struct { 175 Event 176 } 177 178 func (this TransitionEvent) Once() TransitionEvent { 179 this.ref.Once() 180 return this 181 } 182 183 func (this TransitionEvent) Ref() js.Ref { 184 return this.Event.Ref() 185 } 186 187 func (this TransitionEvent) FromRef(ref js.Ref) TransitionEvent { 188 this.Event = this.Event.FromRef(ref) 189 return this 190 } 191 192 func (this TransitionEvent) Free() { 193 this.ref.Free() 194 } 195 196 // PropertyName returns the value of property "TransitionEvent.propertyName". 197 // 198 // It returns ok=false if there is no such property. 199 func (this TransitionEvent) PropertyName() (ret js.String, ok bool) { 200 ok = js.True == bindings.GetTransitionEventPropertyName( 201 this.ref, js.Pointer(&ret), 202 ) 203 return 204 } 205 206 // ElapsedTime returns the value of property "TransitionEvent.elapsedTime". 207 // 208 // It returns ok=false if there is no such property. 209 func (this TransitionEvent) ElapsedTime() (ret float64, ok bool) { 210 ok = js.True == bindings.GetTransitionEventElapsedTime( 211 this.ref, js.Pointer(&ret), 212 ) 213 return 214 } 215 216 // PseudoElement returns the value of property "TransitionEvent.pseudoElement". 217 // 218 // It returns ok=false if there is no such property. 219 func (this TransitionEvent) PseudoElement() (ret js.String, ok bool) { 220 ok = js.True == bindings.GetTransitionEventPseudoElement( 221 this.ref, js.Pointer(&ret), 222 ) 223 return 224 } 225 226 type OneOf_TrustedHTML_TrustedScript_TrustedScriptURL struct { 227 ref js.Ref 228 } 229 230 func (x OneOf_TrustedHTML_TrustedScript_TrustedScriptURL) Ref() js.Ref { 231 return x.ref 232 } 233 234 func (x OneOf_TrustedHTML_TrustedScript_TrustedScriptURL) Free() { 235 x.ref.Free() 236 } 237 238 func (x OneOf_TrustedHTML_TrustedScript_TrustedScriptURL) FromRef(ref js.Ref) OneOf_TrustedHTML_TrustedScript_TrustedScriptURL { 239 return OneOf_TrustedHTML_TrustedScript_TrustedScriptURL{ 240 ref: ref, 241 } 242 } 243 244 func (x OneOf_TrustedHTML_TrustedScript_TrustedScriptURL) TrustedHTML() TrustedHTML { 245 return TrustedHTML{}.FromRef(x.ref) 246 } 247 248 func (x OneOf_TrustedHTML_TrustedScript_TrustedScriptURL) TrustedScript() TrustedScript { 249 return TrustedScript{}.FromRef(x.ref) 250 } 251 252 func (x OneOf_TrustedHTML_TrustedScript_TrustedScriptURL) TrustedScriptURL() TrustedScriptURL { 253 return TrustedScriptURL{}.FromRef(x.ref) 254 } 255 256 type TrustedType = OneOf_TrustedHTML_TrustedScript_TrustedScriptURL 257 258 type UIEventInit struct { 259 // View is "UIEventInit.view" 260 // 261 // Optional, defaults to null. 262 View Window 263 // Detail is "UIEventInit.detail" 264 // 265 // Optional, defaults to 0. 266 // 267 // NOTE: FFI_USE_Detail MUST be set to true to make this field effective. 268 Detail int32 269 // Bubbles is "UIEventInit.bubbles" 270 // 271 // Optional, defaults to false. 272 // 273 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 274 Bubbles bool 275 // Cancelable is "UIEventInit.cancelable" 276 // 277 // Optional, defaults to false. 278 // 279 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 280 Cancelable bool 281 // Composed is "UIEventInit.composed" 282 // 283 // Optional, defaults to false. 284 // 285 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 286 Composed bool 287 // SourceCapabilities is "UIEventInit.sourceCapabilities" 288 // 289 // Optional, defaults to null. 290 SourceCapabilities InputDeviceCapabilities 291 // Which is "UIEventInit.which" 292 // 293 // Optional, defaults to 0. 294 // 295 // NOTE: FFI_USE_Which MUST be set to true to make this field effective. 296 Which uint32 297 298 FFI_USE_Detail bool // for Detail. 299 FFI_USE_Bubbles bool // for Bubbles. 300 FFI_USE_Cancelable bool // for Cancelable. 301 FFI_USE_Composed bool // for Composed. 302 FFI_USE_Which bool // for Which. 303 304 FFI_USE bool 305 } 306 307 // FromRef calls UpdateFrom and returns a UIEventInit with all fields set. 308 func (p UIEventInit) FromRef(ref js.Ref) UIEventInit { 309 p.UpdateFrom(ref) 310 return p 311 } 312 313 // New creates a new UIEventInit in the application heap. 314 func (p UIEventInit) New() js.Ref { 315 return bindings.UIEventInitJSLoad( 316 js.Pointer(&p), js.True, 0, 317 ) 318 } 319 320 // UpdateFrom copies value of all fields of the heap object to p. 321 func (p *UIEventInit) UpdateFrom(ref js.Ref) { 322 bindings.UIEventInitJSStore( 323 js.Pointer(p), ref, 324 ) 325 } 326 327 // Update writes all fields of the p to the heap object referenced by ref. 328 func (p *UIEventInit) Update(ref js.Ref) { 329 bindings.UIEventInitJSLoad( 330 js.Pointer(p), js.False, ref, 331 ) 332 } 333 334 // FreeMembers frees fields with heap reference, if recursive is true 335 // free all heap references reachable from p. 336 func (p *UIEventInit) FreeMembers(recursive bool) { 337 js.Free( 338 p.View.Ref(), 339 p.SourceCapabilities.Ref(), 340 ) 341 p.View = p.View.FromRef(js.Undefined) 342 p.SourceCapabilities = p.SourceCapabilities.FromRef(js.Undefined) 343 } 344 345 func NewUIEvent(typ js.String, eventInitDict UIEventInit) (ret UIEvent) { 346 ret.ref = bindings.NewUIEventByUIEvent( 347 typ.Ref(), 348 js.Pointer(&eventInitDict)) 349 return 350 } 351 352 func NewUIEventByUIEvent1(typ js.String) (ret UIEvent) { 353 ret.ref = bindings.NewUIEventByUIEvent1( 354 typ.Ref()) 355 return 356 } 357 358 type UIEvent struct { 359 Event 360 } 361 362 func (this UIEvent) Once() UIEvent { 363 this.ref.Once() 364 return this 365 } 366 367 func (this UIEvent) Ref() js.Ref { 368 return this.Event.Ref() 369 } 370 371 func (this UIEvent) FromRef(ref js.Ref) UIEvent { 372 this.Event = this.Event.FromRef(ref) 373 return this 374 } 375 376 func (this UIEvent) Free() { 377 this.ref.Free() 378 } 379 380 // View returns the value of property "UIEvent.view". 381 // 382 // It returns ok=false if there is no such property. 383 func (this UIEvent) View() (ret Window, ok bool) { 384 ok = js.True == bindings.GetUIEventView( 385 this.ref, js.Pointer(&ret), 386 ) 387 return 388 } 389 390 // Detail returns the value of property "UIEvent.detail". 391 // 392 // It returns ok=false if there is no such property. 393 func (this UIEvent) Detail() (ret int32, ok bool) { 394 ok = js.True == bindings.GetUIEventDetail( 395 this.ref, js.Pointer(&ret), 396 ) 397 return 398 } 399 400 // Which returns the value of property "UIEvent.which". 401 // 402 // It returns ok=false if there is no such property. 403 func (this UIEvent) Which() (ret uint32, ok bool) { 404 ok = js.True == bindings.GetUIEventWhich( 405 this.ref, js.Pointer(&ret), 406 ) 407 return 408 } 409 410 // SourceCapabilities returns the value of property "UIEvent.sourceCapabilities". 411 // 412 // It returns ok=false if there is no such property. 413 func (this UIEvent) SourceCapabilities() (ret InputDeviceCapabilities, ok bool) { 414 ok = js.True == bindings.GetUIEventSourceCapabilities( 415 this.ref, js.Pointer(&ret), 416 ) 417 return 418 } 419 420 // HasFuncInitUIEvent returns true if the method "UIEvent.initUIEvent" exists. 421 func (this UIEvent) HasFuncInitUIEvent() bool { 422 return js.True == bindings.HasFuncUIEventInitUIEvent( 423 this.ref, 424 ) 425 } 426 427 // FuncInitUIEvent returns the method "UIEvent.initUIEvent". 428 func (this UIEvent) FuncInitUIEvent() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, detailArg int32)]) { 429 bindings.FuncUIEventInitUIEvent( 430 this.ref, js.Pointer(&fn), 431 ) 432 return 433 } 434 435 // InitUIEvent calls the method "UIEvent.initUIEvent". 436 func (this UIEvent) InitUIEvent(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, detailArg int32) (ret js.Void) { 437 bindings.CallUIEventInitUIEvent( 438 this.ref, js.Pointer(&ret), 439 typeArg.Ref(), 440 js.Bool(bool(bubblesArg)), 441 js.Bool(bool(cancelableArg)), 442 viewArg.Ref(), 443 int32(detailArg), 444 ) 445 446 return 447 } 448 449 // TryInitUIEvent calls the method "UIEvent.initUIEvent" 450 // in a try/catch block and returns (_, err, ok = false) when it went through 451 // the catch clause. 452 func (this UIEvent) TryInitUIEvent(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, detailArg int32) (ret js.Void, exception js.Any, ok bool) { 453 ok = js.True == bindings.TryUIEventInitUIEvent( 454 this.ref, js.Pointer(&ret), js.Pointer(&exception), 455 typeArg.Ref(), 456 js.Bool(bool(bubblesArg)), 457 js.Bool(bool(cancelableArg)), 458 viewArg.Ref(), 459 int32(detailArg), 460 ) 461 462 return 463 } 464 465 // HasFuncInitUIEvent1 returns true if the method "UIEvent.initUIEvent" exists. 466 func (this UIEvent) HasFuncInitUIEvent1() bool { 467 return js.True == bindings.HasFuncUIEventInitUIEvent1( 468 this.ref, 469 ) 470 } 471 472 // FuncInitUIEvent1 returns the method "UIEvent.initUIEvent". 473 func (this UIEvent) FuncInitUIEvent1() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window)]) { 474 bindings.FuncUIEventInitUIEvent1( 475 this.ref, js.Pointer(&fn), 476 ) 477 return 478 } 479 480 // InitUIEvent1 calls the method "UIEvent.initUIEvent". 481 func (this UIEvent) InitUIEvent1(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window) (ret js.Void) { 482 bindings.CallUIEventInitUIEvent1( 483 this.ref, js.Pointer(&ret), 484 typeArg.Ref(), 485 js.Bool(bool(bubblesArg)), 486 js.Bool(bool(cancelableArg)), 487 viewArg.Ref(), 488 ) 489 490 return 491 } 492 493 // TryInitUIEvent1 calls the method "UIEvent.initUIEvent" 494 // in a try/catch block and returns (_, err, ok = false) when it went through 495 // the catch clause. 496 func (this UIEvent) TryInitUIEvent1(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window) (ret js.Void, exception js.Any, ok bool) { 497 ok = js.True == bindings.TryUIEventInitUIEvent1( 498 this.ref, js.Pointer(&ret), js.Pointer(&exception), 499 typeArg.Ref(), 500 js.Bool(bool(bubblesArg)), 501 js.Bool(bool(cancelableArg)), 502 viewArg.Ref(), 503 ) 504 505 return 506 } 507 508 // HasFuncInitUIEvent2 returns true if the method "UIEvent.initUIEvent" exists. 509 func (this UIEvent) HasFuncInitUIEvent2() bool { 510 return js.True == bindings.HasFuncUIEventInitUIEvent2( 511 this.ref, 512 ) 513 } 514 515 // FuncInitUIEvent2 returns the method "UIEvent.initUIEvent". 516 func (this UIEvent) FuncInitUIEvent2() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool)]) { 517 bindings.FuncUIEventInitUIEvent2( 518 this.ref, js.Pointer(&fn), 519 ) 520 return 521 } 522 523 // InitUIEvent2 calls the method "UIEvent.initUIEvent". 524 func (this UIEvent) InitUIEvent2(typeArg js.String, bubblesArg bool, cancelableArg bool) (ret js.Void) { 525 bindings.CallUIEventInitUIEvent2( 526 this.ref, js.Pointer(&ret), 527 typeArg.Ref(), 528 js.Bool(bool(bubblesArg)), 529 js.Bool(bool(cancelableArg)), 530 ) 531 532 return 533 } 534 535 // TryInitUIEvent2 calls the method "UIEvent.initUIEvent" 536 // in a try/catch block and returns (_, err, ok = false) when it went through 537 // the catch clause. 538 func (this UIEvent) TryInitUIEvent2(typeArg js.String, bubblesArg bool, cancelableArg bool) (ret js.Void, exception js.Any, ok bool) { 539 ok = js.True == bindings.TryUIEventInitUIEvent2( 540 this.ref, js.Pointer(&ret), js.Pointer(&exception), 541 typeArg.Ref(), 542 js.Bool(bool(bubblesArg)), 543 js.Bool(bool(cancelableArg)), 544 ) 545 546 return 547 } 548 549 // HasFuncInitUIEvent3 returns true if the method "UIEvent.initUIEvent" exists. 550 func (this UIEvent) HasFuncInitUIEvent3() bool { 551 return js.True == bindings.HasFuncUIEventInitUIEvent3( 552 this.ref, 553 ) 554 } 555 556 // FuncInitUIEvent3 returns the method "UIEvent.initUIEvent". 557 func (this UIEvent) FuncInitUIEvent3() (fn js.Func[func(typeArg js.String, bubblesArg bool)]) { 558 bindings.FuncUIEventInitUIEvent3( 559 this.ref, js.Pointer(&fn), 560 ) 561 return 562 } 563 564 // InitUIEvent3 calls the method "UIEvent.initUIEvent". 565 func (this UIEvent) InitUIEvent3(typeArg js.String, bubblesArg bool) (ret js.Void) { 566 bindings.CallUIEventInitUIEvent3( 567 this.ref, js.Pointer(&ret), 568 typeArg.Ref(), 569 js.Bool(bool(bubblesArg)), 570 ) 571 572 return 573 } 574 575 // TryInitUIEvent3 calls the method "UIEvent.initUIEvent" 576 // in a try/catch block and returns (_, err, ok = false) when it went through 577 // the catch clause. 578 func (this UIEvent) TryInitUIEvent3(typeArg js.String, bubblesArg bool) (ret js.Void, exception js.Any, ok bool) { 579 ok = js.True == bindings.TryUIEventInitUIEvent3( 580 this.ref, js.Pointer(&ret), js.Pointer(&exception), 581 typeArg.Ref(), 582 js.Bool(bool(bubblesArg)), 583 ) 584 585 return 586 } 587 588 // HasFuncInitUIEvent4 returns true if the method "UIEvent.initUIEvent" exists. 589 func (this UIEvent) HasFuncInitUIEvent4() bool { 590 return js.True == bindings.HasFuncUIEventInitUIEvent4( 591 this.ref, 592 ) 593 } 594 595 // FuncInitUIEvent4 returns the method "UIEvent.initUIEvent". 596 func (this UIEvent) FuncInitUIEvent4() (fn js.Func[func(typeArg js.String)]) { 597 bindings.FuncUIEventInitUIEvent4( 598 this.ref, js.Pointer(&fn), 599 ) 600 return 601 } 602 603 // InitUIEvent4 calls the method "UIEvent.initUIEvent". 604 func (this UIEvent) InitUIEvent4(typeArg js.String) (ret js.Void) { 605 bindings.CallUIEventInitUIEvent4( 606 this.ref, js.Pointer(&ret), 607 typeArg.Ref(), 608 ) 609 610 return 611 } 612 613 // TryInitUIEvent4 calls the method "UIEvent.initUIEvent" 614 // in a try/catch block and returns (_, err, ok = false) when it went through 615 // the catch clause. 616 func (this UIEvent) TryInitUIEvent4(typeArg js.String) (ret js.Void, exception js.Any, ok bool) { 617 ok = js.True == bindings.TryUIEventInitUIEvent4( 618 this.ref, js.Pointer(&ret), js.Pointer(&exception), 619 typeArg.Ref(), 620 ) 621 622 return 623 } 624 625 type OneOf_Blob_MediaSource struct { 626 ref js.Ref 627 } 628 629 func (x OneOf_Blob_MediaSource) Ref() js.Ref { 630 return x.ref 631 } 632 633 func (x OneOf_Blob_MediaSource) Free() { 634 x.ref.Free() 635 } 636 637 func (x OneOf_Blob_MediaSource) FromRef(ref js.Ref) OneOf_Blob_MediaSource { 638 return OneOf_Blob_MediaSource{ 639 ref: ref, 640 } 641 } 642 643 func (x OneOf_Blob_MediaSource) Blob() Blob { 644 return Blob{}.FromRef(x.ref) 645 } 646 647 func (x OneOf_Blob_MediaSource) MediaSource() MediaSource { 648 return MediaSource{}.FromRef(x.ref) 649 } 650 651 func NewURL(url js.String, base js.String) (ret URL) { 652 ret.ref = bindings.NewURLByURL( 653 url.Ref(), 654 base.Ref()) 655 return 656 } 657 658 func NewURLByURL1(url js.String) (ret URL) { 659 ret.ref = bindings.NewURLByURL1( 660 url.Ref()) 661 return 662 } 663 664 type URL struct { 665 ref js.Ref 666 } 667 668 func (this URL) Once() URL { 669 this.ref.Once() 670 return this 671 } 672 673 func (this URL) Ref() js.Ref { 674 return this.ref 675 } 676 677 func (this URL) FromRef(ref js.Ref) URL { 678 this.ref = ref 679 return this 680 } 681 682 func (this URL) Free() { 683 this.ref.Free() 684 } 685 686 // Href returns the value of property "URL.href". 687 // 688 // It returns ok=false if there is no such property. 689 func (this URL) Href() (ret js.String, ok bool) { 690 ok = js.True == bindings.GetURLHref( 691 this.ref, js.Pointer(&ret), 692 ) 693 return 694 } 695 696 // SetHref sets the value of property "URL.href" to val. 697 // 698 // It returns false if the property cannot be set. 699 func (this URL) SetHref(val js.String) bool { 700 return js.True == bindings.SetURLHref( 701 this.ref, 702 val.Ref(), 703 ) 704 } 705 706 // Origin returns the value of property "URL.origin". 707 // 708 // It returns ok=false if there is no such property. 709 func (this URL) Origin() (ret js.String, ok bool) { 710 ok = js.True == bindings.GetURLOrigin( 711 this.ref, js.Pointer(&ret), 712 ) 713 return 714 } 715 716 // Protocol returns the value of property "URL.protocol". 717 // 718 // It returns ok=false if there is no such property. 719 func (this URL) Protocol() (ret js.String, ok bool) { 720 ok = js.True == bindings.GetURLProtocol( 721 this.ref, js.Pointer(&ret), 722 ) 723 return 724 } 725 726 // SetProtocol sets the value of property "URL.protocol" to val. 727 // 728 // It returns false if the property cannot be set. 729 func (this URL) SetProtocol(val js.String) bool { 730 return js.True == bindings.SetURLProtocol( 731 this.ref, 732 val.Ref(), 733 ) 734 } 735 736 // Username returns the value of property "URL.username". 737 // 738 // It returns ok=false if there is no such property. 739 func (this URL) Username() (ret js.String, ok bool) { 740 ok = js.True == bindings.GetURLUsername( 741 this.ref, js.Pointer(&ret), 742 ) 743 return 744 } 745 746 // SetUsername sets the value of property "URL.username" to val. 747 // 748 // It returns false if the property cannot be set. 749 func (this URL) SetUsername(val js.String) bool { 750 return js.True == bindings.SetURLUsername( 751 this.ref, 752 val.Ref(), 753 ) 754 } 755 756 // Password returns the value of property "URL.password". 757 // 758 // It returns ok=false if there is no such property. 759 func (this URL) Password() (ret js.String, ok bool) { 760 ok = js.True == bindings.GetURLPassword( 761 this.ref, js.Pointer(&ret), 762 ) 763 return 764 } 765 766 // SetPassword sets the value of property "URL.password" to val. 767 // 768 // It returns false if the property cannot be set. 769 func (this URL) SetPassword(val js.String) bool { 770 return js.True == bindings.SetURLPassword( 771 this.ref, 772 val.Ref(), 773 ) 774 } 775 776 // Host returns the value of property "URL.host". 777 // 778 // It returns ok=false if there is no such property. 779 func (this URL) Host() (ret js.String, ok bool) { 780 ok = js.True == bindings.GetURLHost( 781 this.ref, js.Pointer(&ret), 782 ) 783 return 784 } 785 786 // SetHost sets the value of property "URL.host" to val. 787 // 788 // It returns false if the property cannot be set. 789 func (this URL) SetHost(val js.String) bool { 790 return js.True == bindings.SetURLHost( 791 this.ref, 792 val.Ref(), 793 ) 794 } 795 796 // Hostname returns the value of property "URL.hostname". 797 // 798 // It returns ok=false if there is no such property. 799 func (this URL) Hostname() (ret js.String, ok bool) { 800 ok = js.True == bindings.GetURLHostname( 801 this.ref, js.Pointer(&ret), 802 ) 803 return 804 } 805 806 // SetHostname sets the value of property "URL.hostname" to val. 807 // 808 // It returns false if the property cannot be set. 809 func (this URL) SetHostname(val js.String) bool { 810 return js.True == bindings.SetURLHostname( 811 this.ref, 812 val.Ref(), 813 ) 814 } 815 816 // Port returns the value of property "URL.port". 817 // 818 // It returns ok=false if there is no such property. 819 func (this URL) Port() (ret js.String, ok bool) { 820 ok = js.True == bindings.GetURLPort( 821 this.ref, js.Pointer(&ret), 822 ) 823 return 824 } 825 826 // SetPort sets the value of property "URL.port" to val. 827 // 828 // It returns false if the property cannot be set. 829 func (this URL) SetPort(val js.String) bool { 830 return js.True == bindings.SetURLPort( 831 this.ref, 832 val.Ref(), 833 ) 834 } 835 836 // Pathname returns the value of property "URL.pathname". 837 // 838 // It returns ok=false if there is no such property. 839 func (this URL) Pathname() (ret js.String, ok bool) { 840 ok = js.True == bindings.GetURLPathname( 841 this.ref, js.Pointer(&ret), 842 ) 843 return 844 } 845 846 // SetPathname sets the value of property "URL.pathname" to val. 847 // 848 // It returns false if the property cannot be set. 849 func (this URL) SetPathname(val js.String) bool { 850 return js.True == bindings.SetURLPathname( 851 this.ref, 852 val.Ref(), 853 ) 854 } 855 856 // Search returns the value of property "URL.search". 857 // 858 // It returns ok=false if there is no such property. 859 func (this URL) Search() (ret js.String, ok bool) { 860 ok = js.True == bindings.GetURLSearch( 861 this.ref, js.Pointer(&ret), 862 ) 863 return 864 } 865 866 // SetSearch sets the value of property "URL.search" to val. 867 // 868 // It returns false if the property cannot be set. 869 func (this URL) SetSearch(val js.String) bool { 870 return js.True == bindings.SetURLSearch( 871 this.ref, 872 val.Ref(), 873 ) 874 } 875 876 // SearchParams returns the value of property "URL.searchParams". 877 // 878 // It returns ok=false if there is no such property. 879 func (this URL) SearchParams() (ret URLSearchParams, ok bool) { 880 ok = js.True == bindings.GetURLSearchParams( 881 this.ref, js.Pointer(&ret), 882 ) 883 return 884 } 885 886 // Hash returns the value of property "URL.hash". 887 // 888 // It returns ok=false if there is no such property. 889 func (this URL) Hash() (ret js.String, ok bool) { 890 ok = js.True == bindings.GetURLHash( 891 this.ref, js.Pointer(&ret), 892 ) 893 return 894 } 895 896 // SetHash sets the value of property "URL.hash" to val. 897 // 898 // It returns false if the property cannot be set. 899 func (this URL) SetHash(val js.String) bool { 900 return js.True == bindings.SetURLHash( 901 this.ref, 902 val.Ref(), 903 ) 904 } 905 906 // HasFuncCanParse returns true if the static method "URL.canParse" exists. 907 func (this URL) HasFuncCanParse() bool { 908 return js.True == bindings.HasFuncURLCanParse( 909 this.ref, 910 ) 911 } 912 913 // FuncCanParse returns the static method "URL.canParse". 914 func (this URL) FuncCanParse() (fn js.Func[func(url js.String, base js.String) bool]) { 915 bindings.FuncURLCanParse( 916 this.ref, js.Pointer(&fn), 917 ) 918 return 919 } 920 921 // CanParse calls the static method "URL.canParse". 922 func (this URL) CanParse(url js.String, base js.String) (ret bool) { 923 bindings.CallURLCanParse( 924 this.ref, js.Pointer(&ret), 925 url.Ref(), 926 base.Ref(), 927 ) 928 929 return 930 } 931 932 // TryCanParse calls the static method "URL.canParse" 933 // in a try/catch block and returns (_, err, ok = false) when it went through 934 // the catch clause. 935 func (this URL) TryCanParse(url js.String, base js.String) (ret bool, exception js.Any, ok bool) { 936 ok = js.True == bindings.TryURLCanParse( 937 this.ref, js.Pointer(&ret), js.Pointer(&exception), 938 url.Ref(), 939 base.Ref(), 940 ) 941 942 return 943 } 944 945 // HasFuncCanParse1 returns true if the static method "URL.canParse" exists. 946 func (this URL) HasFuncCanParse1() bool { 947 return js.True == bindings.HasFuncURLCanParse1( 948 this.ref, 949 ) 950 } 951 952 // FuncCanParse1 returns the static method "URL.canParse". 953 func (this URL) FuncCanParse1() (fn js.Func[func(url js.String) bool]) { 954 bindings.FuncURLCanParse1( 955 this.ref, js.Pointer(&fn), 956 ) 957 return 958 } 959 960 // CanParse1 calls the static method "URL.canParse". 961 func (this URL) CanParse1(url js.String) (ret bool) { 962 bindings.CallURLCanParse1( 963 this.ref, js.Pointer(&ret), 964 url.Ref(), 965 ) 966 967 return 968 } 969 970 // TryCanParse1 calls the static method "URL.canParse" 971 // in a try/catch block and returns (_, err, ok = false) when it went through 972 // the catch clause. 973 func (this URL) TryCanParse1(url js.String) (ret bool, exception js.Any, ok bool) { 974 ok = js.True == bindings.TryURLCanParse1( 975 this.ref, js.Pointer(&ret), js.Pointer(&exception), 976 url.Ref(), 977 ) 978 979 return 980 } 981 982 // HasFuncToJSON returns true if the method "URL.toJSON" exists. 983 func (this URL) HasFuncToJSON() bool { 984 return js.True == bindings.HasFuncURLToJSON( 985 this.ref, 986 ) 987 } 988 989 // FuncToJSON returns the method "URL.toJSON". 990 func (this URL) FuncToJSON() (fn js.Func[func() js.String]) { 991 bindings.FuncURLToJSON( 992 this.ref, js.Pointer(&fn), 993 ) 994 return 995 } 996 997 // ToJSON calls the method "URL.toJSON". 998 func (this URL) ToJSON() (ret js.String) { 999 bindings.CallURLToJSON( 1000 this.ref, js.Pointer(&ret), 1001 ) 1002 1003 return 1004 } 1005 1006 // TryToJSON calls the method "URL.toJSON" 1007 // in a try/catch block and returns (_, err, ok = false) when it went through 1008 // the catch clause. 1009 func (this URL) TryToJSON() (ret js.String, exception js.Any, ok bool) { 1010 ok = js.True == bindings.TryURLToJSON( 1011 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1012 ) 1013 1014 return 1015 } 1016 1017 // HasFuncCreateObjectURL returns true if the static method "URL.createObjectURL" exists. 1018 func (this URL) HasFuncCreateObjectURL() bool { 1019 return js.True == bindings.HasFuncURLCreateObjectURL( 1020 this.ref, 1021 ) 1022 } 1023 1024 // FuncCreateObjectURL returns the static method "URL.createObjectURL". 1025 func (this URL) FuncCreateObjectURL() (fn js.Func[func(obj OneOf_Blob_MediaSource) js.String]) { 1026 bindings.FuncURLCreateObjectURL( 1027 this.ref, js.Pointer(&fn), 1028 ) 1029 return 1030 } 1031 1032 // CreateObjectURL calls the static method "URL.createObjectURL". 1033 func (this URL) CreateObjectURL(obj OneOf_Blob_MediaSource) (ret js.String) { 1034 bindings.CallURLCreateObjectURL( 1035 this.ref, js.Pointer(&ret), 1036 obj.Ref(), 1037 ) 1038 1039 return 1040 } 1041 1042 // TryCreateObjectURL calls the static method "URL.createObjectURL" 1043 // in a try/catch block and returns (_, err, ok = false) when it went through 1044 // the catch clause. 1045 func (this URL) TryCreateObjectURL(obj OneOf_Blob_MediaSource) (ret js.String, exception js.Any, ok bool) { 1046 ok = js.True == bindings.TryURLCreateObjectURL( 1047 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1048 obj.Ref(), 1049 ) 1050 1051 return 1052 } 1053 1054 // HasFuncRevokeObjectURL returns true if the static method "URL.revokeObjectURL" exists. 1055 func (this URL) HasFuncRevokeObjectURL() bool { 1056 return js.True == bindings.HasFuncURLRevokeObjectURL( 1057 this.ref, 1058 ) 1059 } 1060 1061 // FuncRevokeObjectURL returns the static method "URL.revokeObjectURL". 1062 func (this URL) FuncRevokeObjectURL() (fn js.Func[func(url js.String)]) { 1063 bindings.FuncURLRevokeObjectURL( 1064 this.ref, js.Pointer(&fn), 1065 ) 1066 return 1067 } 1068 1069 // RevokeObjectURL calls the static method "URL.revokeObjectURL". 1070 func (this URL) RevokeObjectURL(url js.String) (ret js.Void) { 1071 bindings.CallURLRevokeObjectURL( 1072 this.ref, js.Pointer(&ret), 1073 url.Ref(), 1074 ) 1075 1076 return 1077 } 1078 1079 // TryRevokeObjectURL calls the static method "URL.revokeObjectURL" 1080 // in a try/catch block and returns (_, err, ok = false) when it went through 1081 // the catch clause. 1082 func (this URL) TryRevokeObjectURL(url js.String) (ret js.Void, exception js.Any, ok bool) { 1083 ok = js.True == bindings.TryURLRevokeObjectURL( 1084 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1085 url.Ref(), 1086 ) 1087 1088 return 1089 } 1090 1091 type URLPatternInit struct { 1092 // Protocol is "URLPatternInit.protocol" 1093 // 1094 // Optional 1095 Protocol js.String 1096 // Username is "URLPatternInit.username" 1097 // 1098 // Optional 1099 Username js.String 1100 // Password is "URLPatternInit.password" 1101 // 1102 // Optional 1103 Password js.String 1104 // Hostname is "URLPatternInit.hostname" 1105 // 1106 // Optional 1107 Hostname js.String 1108 // Port is "URLPatternInit.port" 1109 // 1110 // Optional 1111 Port js.String 1112 // Pathname is "URLPatternInit.pathname" 1113 // 1114 // Optional 1115 Pathname js.String 1116 // Search is "URLPatternInit.search" 1117 // 1118 // Optional 1119 Search js.String 1120 // Hash is "URLPatternInit.hash" 1121 // 1122 // Optional 1123 Hash js.String 1124 // BaseURL is "URLPatternInit.baseURL" 1125 // 1126 // Optional 1127 BaseURL js.String 1128 1129 FFI_USE bool 1130 } 1131 1132 // FromRef calls UpdateFrom and returns a URLPatternInit with all fields set. 1133 func (p URLPatternInit) FromRef(ref js.Ref) URLPatternInit { 1134 p.UpdateFrom(ref) 1135 return p 1136 } 1137 1138 // New creates a new URLPatternInit in the application heap. 1139 func (p URLPatternInit) New() js.Ref { 1140 return bindings.URLPatternInitJSLoad( 1141 js.Pointer(&p), js.True, 0, 1142 ) 1143 } 1144 1145 // UpdateFrom copies value of all fields of the heap object to p. 1146 func (p *URLPatternInit) UpdateFrom(ref js.Ref) { 1147 bindings.URLPatternInitJSStore( 1148 js.Pointer(p), ref, 1149 ) 1150 } 1151 1152 // Update writes all fields of the p to the heap object referenced by ref. 1153 func (p *URLPatternInit) Update(ref js.Ref) { 1154 bindings.URLPatternInitJSLoad( 1155 js.Pointer(p), js.False, ref, 1156 ) 1157 } 1158 1159 // FreeMembers frees fields with heap reference, if recursive is true 1160 // free all heap references reachable from p. 1161 func (p *URLPatternInit) FreeMembers(recursive bool) { 1162 js.Free( 1163 p.Protocol.Ref(), 1164 p.Username.Ref(), 1165 p.Password.Ref(), 1166 p.Hostname.Ref(), 1167 p.Port.Ref(), 1168 p.Pathname.Ref(), 1169 p.Search.Ref(), 1170 p.Hash.Ref(), 1171 p.BaseURL.Ref(), 1172 ) 1173 p.Protocol = p.Protocol.FromRef(js.Undefined) 1174 p.Username = p.Username.FromRef(js.Undefined) 1175 p.Password = p.Password.FromRef(js.Undefined) 1176 p.Hostname = p.Hostname.FromRef(js.Undefined) 1177 p.Port = p.Port.FromRef(js.Undefined) 1178 p.Pathname = p.Pathname.FromRef(js.Undefined) 1179 p.Search = p.Search.FromRef(js.Undefined) 1180 p.Hash = p.Hash.FromRef(js.Undefined) 1181 p.BaseURL = p.BaseURL.FromRef(js.Undefined) 1182 } 1183 1184 type OneOf_String_URLPatternInit struct { 1185 ref js.Ref 1186 } 1187 1188 func (x OneOf_String_URLPatternInit) Ref() js.Ref { 1189 return x.ref 1190 } 1191 1192 func (x OneOf_String_URLPatternInit) Free() { 1193 x.ref.Free() 1194 } 1195 1196 func (x OneOf_String_URLPatternInit) FromRef(ref js.Ref) OneOf_String_URLPatternInit { 1197 return OneOf_String_URLPatternInit{ 1198 ref: ref, 1199 } 1200 } 1201 1202 func (x OneOf_String_URLPatternInit) String() js.String { 1203 return js.String{}.FromRef(x.ref) 1204 } 1205 1206 func (x OneOf_String_URLPatternInit) URLPatternInit() URLPatternInit { 1207 var ret URLPatternInit 1208 ret.UpdateFrom(x.ref) 1209 return ret 1210 } 1211 1212 type URLPatternInput = OneOf_String_URLPatternInit 1213 1214 type URLPatternOptions struct { 1215 // IgnoreCase is "URLPatternOptions.ignoreCase" 1216 // 1217 // Optional, defaults to false. 1218 // 1219 // NOTE: FFI_USE_IgnoreCase MUST be set to true to make this field effective. 1220 IgnoreCase bool 1221 1222 FFI_USE_IgnoreCase bool // for IgnoreCase. 1223 1224 FFI_USE bool 1225 } 1226 1227 // FromRef calls UpdateFrom and returns a URLPatternOptions with all fields set. 1228 func (p URLPatternOptions) FromRef(ref js.Ref) URLPatternOptions { 1229 p.UpdateFrom(ref) 1230 return p 1231 } 1232 1233 // New creates a new URLPatternOptions in the application heap. 1234 func (p URLPatternOptions) New() js.Ref { 1235 return bindings.URLPatternOptionsJSLoad( 1236 js.Pointer(&p), js.True, 0, 1237 ) 1238 } 1239 1240 // UpdateFrom copies value of all fields of the heap object to p. 1241 func (p *URLPatternOptions) UpdateFrom(ref js.Ref) { 1242 bindings.URLPatternOptionsJSStore( 1243 js.Pointer(p), ref, 1244 ) 1245 } 1246 1247 // Update writes all fields of the p to the heap object referenced by ref. 1248 func (p *URLPatternOptions) Update(ref js.Ref) { 1249 bindings.URLPatternOptionsJSLoad( 1250 js.Pointer(p), js.False, ref, 1251 ) 1252 } 1253 1254 // FreeMembers frees fields with heap reference, if recursive is true 1255 // free all heap references reachable from p. 1256 func (p *URLPatternOptions) FreeMembers(recursive bool) { 1257 } 1258 1259 type OneOf_String_undefined struct { 1260 ref js.Ref 1261 } 1262 1263 func (x OneOf_String_undefined) Ref() js.Ref { 1264 return x.ref 1265 } 1266 1267 func (x OneOf_String_undefined) Free() { 1268 x.ref.Free() 1269 } 1270 1271 func (x OneOf_String_undefined) FromRef(ref js.Ref) OneOf_String_undefined { 1272 return OneOf_String_undefined{ 1273 ref: ref, 1274 } 1275 } 1276 1277 func (x OneOf_String_undefined) Undefined() bool { 1278 return x.ref == js.Undefined 1279 } 1280 1281 func (x OneOf_String_undefined) String() js.String { 1282 return js.String{}.FromRef(x.ref) 1283 } 1284 1285 type URLPatternComponentResult struct { 1286 // Input is "URLPatternComponentResult.input" 1287 // 1288 // Optional 1289 Input js.String 1290 // Groups is "URLPatternComponentResult.groups" 1291 // 1292 // Optional 1293 Groups js.Record[OneOf_String_undefined] 1294 1295 FFI_USE bool 1296 } 1297 1298 // FromRef calls UpdateFrom and returns a URLPatternComponentResult with all fields set. 1299 func (p URLPatternComponentResult) FromRef(ref js.Ref) URLPatternComponentResult { 1300 p.UpdateFrom(ref) 1301 return p 1302 } 1303 1304 // New creates a new URLPatternComponentResult in the application heap. 1305 func (p URLPatternComponentResult) New() js.Ref { 1306 return bindings.URLPatternComponentResultJSLoad( 1307 js.Pointer(&p), js.True, 0, 1308 ) 1309 } 1310 1311 // UpdateFrom copies value of all fields of the heap object to p. 1312 func (p *URLPatternComponentResult) UpdateFrom(ref js.Ref) { 1313 bindings.URLPatternComponentResultJSStore( 1314 js.Pointer(p), ref, 1315 ) 1316 } 1317 1318 // Update writes all fields of the p to the heap object referenced by ref. 1319 func (p *URLPatternComponentResult) Update(ref js.Ref) { 1320 bindings.URLPatternComponentResultJSLoad( 1321 js.Pointer(p), js.False, ref, 1322 ) 1323 } 1324 1325 // FreeMembers frees fields with heap reference, if recursive is true 1326 // free all heap references reachable from p. 1327 func (p *URLPatternComponentResult) FreeMembers(recursive bool) { 1328 js.Free( 1329 p.Input.Ref(), 1330 p.Groups.Ref(), 1331 ) 1332 p.Input = p.Input.FromRef(js.Undefined) 1333 p.Groups = p.Groups.FromRef(js.Undefined) 1334 } 1335 1336 type URLPatternResult struct { 1337 // Inputs is "URLPatternResult.inputs" 1338 // 1339 // Optional 1340 Inputs js.Array[URLPatternInput] 1341 // Protocol is "URLPatternResult.protocol" 1342 // 1343 // Optional 1344 // 1345 // NOTE: Protocol.FFI_USE MUST be set to true to get Protocol used. 1346 Protocol URLPatternComponentResult 1347 // Username is "URLPatternResult.username" 1348 // 1349 // Optional 1350 // 1351 // NOTE: Username.FFI_USE MUST be set to true to get Username used. 1352 Username URLPatternComponentResult 1353 // Password is "URLPatternResult.password" 1354 // 1355 // Optional 1356 // 1357 // NOTE: Password.FFI_USE MUST be set to true to get Password used. 1358 Password URLPatternComponentResult 1359 // Hostname is "URLPatternResult.hostname" 1360 // 1361 // Optional 1362 // 1363 // NOTE: Hostname.FFI_USE MUST be set to true to get Hostname used. 1364 Hostname URLPatternComponentResult 1365 // Port is "URLPatternResult.port" 1366 // 1367 // Optional 1368 // 1369 // NOTE: Port.FFI_USE MUST be set to true to get Port used. 1370 Port URLPatternComponentResult 1371 // Pathname is "URLPatternResult.pathname" 1372 // 1373 // Optional 1374 // 1375 // NOTE: Pathname.FFI_USE MUST be set to true to get Pathname used. 1376 Pathname URLPatternComponentResult 1377 // Search is "URLPatternResult.search" 1378 // 1379 // Optional 1380 // 1381 // NOTE: Search.FFI_USE MUST be set to true to get Search used. 1382 Search URLPatternComponentResult 1383 // Hash is "URLPatternResult.hash" 1384 // 1385 // Optional 1386 // 1387 // NOTE: Hash.FFI_USE MUST be set to true to get Hash used. 1388 Hash URLPatternComponentResult 1389 1390 FFI_USE bool 1391 } 1392 1393 // FromRef calls UpdateFrom and returns a URLPatternResult with all fields set. 1394 func (p URLPatternResult) FromRef(ref js.Ref) URLPatternResult { 1395 p.UpdateFrom(ref) 1396 return p 1397 } 1398 1399 // New creates a new URLPatternResult in the application heap. 1400 func (p URLPatternResult) New() js.Ref { 1401 return bindings.URLPatternResultJSLoad( 1402 js.Pointer(&p), js.True, 0, 1403 ) 1404 } 1405 1406 // UpdateFrom copies value of all fields of the heap object to p. 1407 func (p *URLPatternResult) UpdateFrom(ref js.Ref) { 1408 bindings.URLPatternResultJSStore( 1409 js.Pointer(p), ref, 1410 ) 1411 } 1412 1413 // Update writes all fields of the p to the heap object referenced by ref. 1414 func (p *URLPatternResult) Update(ref js.Ref) { 1415 bindings.URLPatternResultJSLoad( 1416 js.Pointer(p), js.False, ref, 1417 ) 1418 } 1419 1420 // FreeMembers frees fields with heap reference, if recursive is true 1421 // free all heap references reachable from p. 1422 func (p *URLPatternResult) FreeMembers(recursive bool) { 1423 js.Free( 1424 p.Inputs.Ref(), 1425 ) 1426 p.Inputs = p.Inputs.FromRef(js.Undefined) 1427 if recursive { 1428 p.Protocol.FreeMembers(true) 1429 p.Username.FreeMembers(true) 1430 p.Password.FreeMembers(true) 1431 p.Hostname.FreeMembers(true) 1432 p.Port.FreeMembers(true) 1433 p.Pathname.FreeMembers(true) 1434 p.Search.FreeMembers(true) 1435 p.Hash.FreeMembers(true) 1436 } 1437 } 1438 1439 func NewURLPattern(input URLPatternInput, baseURL js.String, options URLPatternOptions) (ret URLPattern) { 1440 ret.ref = bindings.NewURLPatternByURLPattern( 1441 input.Ref(), 1442 baseURL.Ref(), 1443 js.Pointer(&options)) 1444 return 1445 } 1446 1447 func NewURLPatternByURLPattern1(input URLPatternInput, baseURL js.String) (ret URLPattern) { 1448 ret.ref = bindings.NewURLPatternByURLPattern1( 1449 input.Ref(), 1450 baseURL.Ref()) 1451 return 1452 } 1453 1454 func NewURLPatternByURLPattern2(input URLPatternInput, options URLPatternOptions) (ret URLPattern) { 1455 ret.ref = bindings.NewURLPatternByURLPattern2( 1456 input.Ref(), 1457 js.Pointer(&options)) 1458 return 1459 } 1460 1461 func NewURLPatternByURLPattern3(input URLPatternInput) (ret URLPattern) { 1462 ret.ref = bindings.NewURLPatternByURLPattern3( 1463 input.Ref()) 1464 return 1465 } 1466 1467 func NewURLPatternByURLPattern4() (ret URLPattern) { 1468 ret.ref = bindings.NewURLPatternByURLPattern4() 1469 return 1470 } 1471 1472 type URLPattern struct { 1473 ref js.Ref 1474 } 1475 1476 func (this URLPattern) Once() URLPattern { 1477 this.ref.Once() 1478 return this 1479 } 1480 1481 func (this URLPattern) Ref() js.Ref { 1482 return this.ref 1483 } 1484 1485 func (this URLPattern) FromRef(ref js.Ref) URLPattern { 1486 this.ref = ref 1487 return this 1488 } 1489 1490 func (this URLPattern) Free() { 1491 this.ref.Free() 1492 } 1493 1494 // Protocol returns the value of property "URLPattern.protocol". 1495 // 1496 // It returns ok=false if there is no such property. 1497 func (this URLPattern) Protocol() (ret js.String, ok bool) { 1498 ok = js.True == bindings.GetURLPatternProtocol( 1499 this.ref, js.Pointer(&ret), 1500 ) 1501 return 1502 } 1503 1504 // Username returns the value of property "URLPattern.username". 1505 // 1506 // It returns ok=false if there is no such property. 1507 func (this URLPattern) Username() (ret js.String, ok bool) { 1508 ok = js.True == bindings.GetURLPatternUsername( 1509 this.ref, js.Pointer(&ret), 1510 ) 1511 return 1512 } 1513 1514 // Password returns the value of property "URLPattern.password". 1515 // 1516 // It returns ok=false if there is no such property. 1517 func (this URLPattern) Password() (ret js.String, ok bool) { 1518 ok = js.True == bindings.GetURLPatternPassword( 1519 this.ref, js.Pointer(&ret), 1520 ) 1521 return 1522 } 1523 1524 // Hostname returns the value of property "URLPattern.hostname". 1525 // 1526 // It returns ok=false if there is no such property. 1527 func (this URLPattern) Hostname() (ret js.String, ok bool) { 1528 ok = js.True == bindings.GetURLPatternHostname( 1529 this.ref, js.Pointer(&ret), 1530 ) 1531 return 1532 } 1533 1534 // Port returns the value of property "URLPattern.port". 1535 // 1536 // It returns ok=false if there is no such property. 1537 func (this URLPattern) Port() (ret js.String, ok bool) { 1538 ok = js.True == bindings.GetURLPatternPort( 1539 this.ref, js.Pointer(&ret), 1540 ) 1541 return 1542 } 1543 1544 // Pathname returns the value of property "URLPattern.pathname". 1545 // 1546 // It returns ok=false if there is no such property. 1547 func (this URLPattern) Pathname() (ret js.String, ok bool) { 1548 ok = js.True == bindings.GetURLPatternPathname( 1549 this.ref, js.Pointer(&ret), 1550 ) 1551 return 1552 } 1553 1554 // Search returns the value of property "URLPattern.search". 1555 // 1556 // It returns ok=false if there is no such property. 1557 func (this URLPattern) Search() (ret js.String, ok bool) { 1558 ok = js.True == bindings.GetURLPatternSearch( 1559 this.ref, js.Pointer(&ret), 1560 ) 1561 return 1562 } 1563 1564 // Hash returns the value of property "URLPattern.hash". 1565 // 1566 // It returns ok=false if there is no such property. 1567 func (this URLPattern) Hash() (ret js.String, ok bool) { 1568 ok = js.True == bindings.GetURLPatternHash( 1569 this.ref, js.Pointer(&ret), 1570 ) 1571 return 1572 } 1573 1574 // HasFuncTest returns true if the method "URLPattern.test" exists. 1575 func (this URLPattern) HasFuncTest() bool { 1576 return js.True == bindings.HasFuncURLPatternTest( 1577 this.ref, 1578 ) 1579 } 1580 1581 // FuncTest returns the method "URLPattern.test". 1582 func (this URLPattern) FuncTest() (fn js.Func[func(input URLPatternInput, baseURL js.String) bool]) { 1583 bindings.FuncURLPatternTest( 1584 this.ref, js.Pointer(&fn), 1585 ) 1586 return 1587 } 1588 1589 // Test calls the method "URLPattern.test". 1590 func (this URLPattern) Test(input URLPatternInput, baseURL js.String) (ret bool) { 1591 bindings.CallURLPatternTest( 1592 this.ref, js.Pointer(&ret), 1593 input.Ref(), 1594 baseURL.Ref(), 1595 ) 1596 1597 return 1598 } 1599 1600 // TryTest calls the method "URLPattern.test" 1601 // in a try/catch block and returns (_, err, ok = false) when it went through 1602 // the catch clause. 1603 func (this URLPattern) TryTest(input URLPatternInput, baseURL js.String) (ret bool, exception js.Any, ok bool) { 1604 ok = js.True == bindings.TryURLPatternTest( 1605 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1606 input.Ref(), 1607 baseURL.Ref(), 1608 ) 1609 1610 return 1611 } 1612 1613 // HasFuncTest1 returns true if the method "URLPattern.test" exists. 1614 func (this URLPattern) HasFuncTest1() bool { 1615 return js.True == bindings.HasFuncURLPatternTest1( 1616 this.ref, 1617 ) 1618 } 1619 1620 // FuncTest1 returns the method "URLPattern.test". 1621 func (this URLPattern) FuncTest1() (fn js.Func[func(input URLPatternInput) bool]) { 1622 bindings.FuncURLPatternTest1( 1623 this.ref, js.Pointer(&fn), 1624 ) 1625 return 1626 } 1627 1628 // Test1 calls the method "URLPattern.test". 1629 func (this URLPattern) Test1(input URLPatternInput) (ret bool) { 1630 bindings.CallURLPatternTest1( 1631 this.ref, js.Pointer(&ret), 1632 input.Ref(), 1633 ) 1634 1635 return 1636 } 1637 1638 // TryTest1 calls the method "URLPattern.test" 1639 // in a try/catch block and returns (_, err, ok = false) when it went through 1640 // the catch clause. 1641 func (this URLPattern) TryTest1(input URLPatternInput) (ret bool, exception js.Any, ok bool) { 1642 ok = js.True == bindings.TryURLPatternTest1( 1643 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1644 input.Ref(), 1645 ) 1646 1647 return 1648 } 1649 1650 // HasFuncTest2 returns true if the method "URLPattern.test" exists. 1651 func (this URLPattern) HasFuncTest2() bool { 1652 return js.True == bindings.HasFuncURLPatternTest2( 1653 this.ref, 1654 ) 1655 } 1656 1657 // FuncTest2 returns the method "URLPattern.test". 1658 func (this URLPattern) FuncTest2() (fn js.Func[func() bool]) { 1659 bindings.FuncURLPatternTest2( 1660 this.ref, js.Pointer(&fn), 1661 ) 1662 return 1663 } 1664 1665 // Test2 calls the method "URLPattern.test". 1666 func (this URLPattern) Test2() (ret bool) { 1667 bindings.CallURLPatternTest2( 1668 this.ref, js.Pointer(&ret), 1669 ) 1670 1671 return 1672 } 1673 1674 // TryTest2 calls the method "URLPattern.test" 1675 // in a try/catch block and returns (_, err, ok = false) when it went through 1676 // the catch clause. 1677 func (this URLPattern) TryTest2() (ret bool, exception js.Any, ok bool) { 1678 ok = js.True == bindings.TryURLPatternTest2( 1679 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1680 ) 1681 1682 return 1683 } 1684 1685 // HasFuncExec returns true if the method "URLPattern.exec" exists. 1686 func (this URLPattern) HasFuncExec() bool { 1687 return js.True == bindings.HasFuncURLPatternExec( 1688 this.ref, 1689 ) 1690 } 1691 1692 // FuncExec returns the method "URLPattern.exec". 1693 func (this URLPattern) FuncExec() (fn js.Func[func(input URLPatternInput, baseURL js.String) URLPatternResult]) { 1694 bindings.FuncURLPatternExec( 1695 this.ref, js.Pointer(&fn), 1696 ) 1697 return 1698 } 1699 1700 // Exec calls the method "URLPattern.exec". 1701 func (this URLPattern) Exec(input URLPatternInput, baseURL js.String) (ret URLPatternResult) { 1702 bindings.CallURLPatternExec( 1703 this.ref, js.Pointer(&ret), 1704 input.Ref(), 1705 baseURL.Ref(), 1706 ) 1707 1708 return 1709 } 1710 1711 // TryExec calls the method "URLPattern.exec" 1712 // in a try/catch block and returns (_, err, ok = false) when it went through 1713 // the catch clause. 1714 func (this URLPattern) TryExec(input URLPatternInput, baseURL js.String) (ret URLPatternResult, exception js.Any, ok bool) { 1715 ok = js.True == bindings.TryURLPatternExec( 1716 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1717 input.Ref(), 1718 baseURL.Ref(), 1719 ) 1720 1721 return 1722 } 1723 1724 // HasFuncExec1 returns true if the method "URLPattern.exec" exists. 1725 func (this URLPattern) HasFuncExec1() bool { 1726 return js.True == bindings.HasFuncURLPatternExec1( 1727 this.ref, 1728 ) 1729 } 1730 1731 // FuncExec1 returns the method "URLPattern.exec". 1732 func (this URLPattern) FuncExec1() (fn js.Func[func(input URLPatternInput) URLPatternResult]) { 1733 bindings.FuncURLPatternExec1( 1734 this.ref, js.Pointer(&fn), 1735 ) 1736 return 1737 } 1738 1739 // Exec1 calls the method "URLPattern.exec". 1740 func (this URLPattern) Exec1(input URLPatternInput) (ret URLPatternResult) { 1741 bindings.CallURLPatternExec1( 1742 this.ref, js.Pointer(&ret), 1743 input.Ref(), 1744 ) 1745 1746 return 1747 } 1748 1749 // TryExec1 calls the method "URLPattern.exec" 1750 // in a try/catch block and returns (_, err, ok = false) when it went through 1751 // the catch clause. 1752 func (this URLPattern) TryExec1(input URLPatternInput) (ret URLPatternResult, exception js.Any, ok bool) { 1753 ok = js.True == bindings.TryURLPatternExec1( 1754 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1755 input.Ref(), 1756 ) 1757 1758 return 1759 } 1760 1761 // HasFuncExec2 returns true if the method "URLPattern.exec" exists. 1762 func (this URLPattern) HasFuncExec2() bool { 1763 return js.True == bindings.HasFuncURLPatternExec2( 1764 this.ref, 1765 ) 1766 } 1767 1768 // FuncExec2 returns the method "URLPattern.exec". 1769 func (this URLPattern) FuncExec2() (fn js.Func[func() URLPatternResult]) { 1770 bindings.FuncURLPatternExec2( 1771 this.ref, js.Pointer(&fn), 1772 ) 1773 return 1774 } 1775 1776 // Exec2 calls the method "URLPattern.exec". 1777 func (this URLPattern) Exec2() (ret URLPatternResult) { 1778 bindings.CallURLPatternExec2( 1779 this.ref, js.Pointer(&ret), 1780 ) 1781 1782 return 1783 } 1784 1785 // TryExec2 calls the method "URLPattern.exec" 1786 // in a try/catch block and returns (_, err, ok = false) when it went through 1787 // the catch clause. 1788 func (this URLPattern) TryExec2() (ret URLPatternResult, exception js.Any, ok bool) { 1789 ok = js.True == bindings.TryURLPatternExec2( 1790 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1791 ) 1792 1793 return 1794 } 1795 1796 type USBConnectionEventInit struct { 1797 // Device is "USBConnectionEventInit.device" 1798 // 1799 // Required 1800 Device USBDevice 1801 // Bubbles is "USBConnectionEventInit.bubbles" 1802 // 1803 // Optional, defaults to false. 1804 // 1805 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 1806 Bubbles bool 1807 // Cancelable is "USBConnectionEventInit.cancelable" 1808 // 1809 // Optional, defaults to false. 1810 // 1811 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 1812 Cancelable bool 1813 // Composed is "USBConnectionEventInit.composed" 1814 // 1815 // Optional, defaults to false. 1816 // 1817 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 1818 Composed bool 1819 1820 FFI_USE_Bubbles bool // for Bubbles. 1821 FFI_USE_Cancelable bool // for Cancelable. 1822 FFI_USE_Composed bool // for Composed. 1823 1824 FFI_USE bool 1825 } 1826 1827 // FromRef calls UpdateFrom and returns a USBConnectionEventInit with all fields set. 1828 func (p USBConnectionEventInit) FromRef(ref js.Ref) USBConnectionEventInit { 1829 p.UpdateFrom(ref) 1830 return p 1831 } 1832 1833 // New creates a new USBConnectionEventInit in the application heap. 1834 func (p USBConnectionEventInit) New() js.Ref { 1835 return bindings.USBConnectionEventInitJSLoad( 1836 js.Pointer(&p), js.True, 0, 1837 ) 1838 } 1839 1840 // UpdateFrom copies value of all fields of the heap object to p. 1841 func (p *USBConnectionEventInit) UpdateFrom(ref js.Ref) { 1842 bindings.USBConnectionEventInitJSStore( 1843 js.Pointer(p), ref, 1844 ) 1845 } 1846 1847 // Update writes all fields of the p to the heap object referenced by ref. 1848 func (p *USBConnectionEventInit) Update(ref js.Ref) { 1849 bindings.USBConnectionEventInitJSLoad( 1850 js.Pointer(p), js.False, ref, 1851 ) 1852 } 1853 1854 // FreeMembers frees fields with heap reference, if recursive is true 1855 // free all heap references reachable from p. 1856 func (p *USBConnectionEventInit) FreeMembers(recursive bool) { 1857 js.Free( 1858 p.Device.Ref(), 1859 ) 1860 p.Device = p.Device.FromRef(js.Undefined) 1861 } 1862 1863 func NewUSBConnectionEvent(typ js.String, eventInitDict USBConnectionEventInit) (ret USBConnectionEvent) { 1864 ret.ref = bindings.NewUSBConnectionEventByUSBConnectionEvent( 1865 typ.Ref(), 1866 js.Pointer(&eventInitDict)) 1867 return 1868 } 1869 1870 type USBConnectionEvent struct { 1871 Event 1872 } 1873 1874 func (this USBConnectionEvent) Once() USBConnectionEvent { 1875 this.ref.Once() 1876 return this 1877 } 1878 1879 func (this USBConnectionEvent) Ref() js.Ref { 1880 return this.Event.Ref() 1881 } 1882 1883 func (this USBConnectionEvent) FromRef(ref js.Ref) USBConnectionEvent { 1884 this.Event = this.Event.FromRef(ref) 1885 return this 1886 } 1887 1888 func (this USBConnectionEvent) Free() { 1889 this.ref.Free() 1890 } 1891 1892 // Device returns the value of property "USBConnectionEvent.device". 1893 // 1894 // It returns ok=false if there is no such property. 1895 func (this USBConnectionEvent) Device() (ret USBDevice, ok bool) { 1896 ok = js.True == bindings.GetUSBConnectionEventDevice( 1897 this.ref, js.Pointer(&ret), 1898 ) 1899 return 1900 } 1901 1902 type USBPermissionDescriptor struct { 1903 // Filters is "USBPermissionDescriptor.filters" 1904 // 1905 // Optional 1906 Filters js.Array[USBDeviceFilter] 1907 // ExclusionFilters is "USBPermissionDescriptor.exclusionFilters" 1908 // 1909 // Optional 1910 ExclusionFilters js.Array[USBDeviceFilter] 1911 // Name is "USBPermissionDescriptor.name" 1912 // 1913 // Required 1914 Name js.String 1915 1916 FFI_USE bool 1917 } 1918 1919 // FromRef calls UpdateFrom and returns a USBPermissionDescriptor with all fields set. 1920 func (p USBPermissionDescriptor) FromRef(ref js.Ref) USBPermissionDescriptor { 1921 p.UpdateFrom(ref) 1922 return p 1923 } 1924 1925 // New creates a new USBPermissionDescriptor in the application heap. 1926 func (p USBPermissionDescriptor) New() js.Ref { 1927 return bindings.USBPermissionDescriptorJSLoad( 1928 js.Pointer(&p), js.True, 0, 1929 ) 1930 } 1931 1932 // UpdateFrom copies value of all fields of the heap object to p. 1933 func (p *USBPermissionDescriptor) UpdateFrom(ref js.Ref) { 1934 bindings.USBPermissionDescriptorJSStore( 1935 js.Pointer(p), ref, 1936 ) 1937 } 1938 1939 // Update writes all fields of the p to the heap object referenced by ref. 1940 func (p *USBPermissionDescriptor) Update(ref js.Ref) { 1941 bindings.USBPermissionDescriptorJSLoad( 1942 js.Pointer(p), js.False, ref, 1943 ) 1944 } 1945 1946 // FreeMembers frees fields with heap reference, if recursive is true 1947 // free all heap references reachable from p. 1948 func (p *USBPermissionDescriptor) FreeMembers(recursive bool) { 1949 js.Free( 1950 p.Filters.Ref(), 1951 p.ExclusionFilters.Ref(), 1952 p.Name.Ref(), 1953 ) 1954 p.Filters = p.Filters.FromRef(js.Undefined) 1955 p.ExclusionFilters = p.ExclusionFilters.FromRef(js.Undefined) 1956 p.Name = p.Name.FromRef(js.Undefined) 1957 } 1958 1959 type USBPermissionResult struct { 1960 PermissionStatus 1961 } 1962 1963 func (this USBPermissionResult) Once() USBPermissionResult { 1964 this.ref.Once() 1965 return this 1966 } 1967 1968 func (this USBPermissionResult) Ref() js.Ref { 1969 return this.PermissionStatus.Ref() 1970 } 1971 1972 func (this USBPermissionResult) FromRef(ref js.Ref) USBPermissionResult { 1973 this.PermissionStatus = this.PermissionStatus.FromRef(ref) 1974 return this 1975 } 1976 1977 func (this USBPermissionResult) Free() { 1978 this.ref.Free() 1979 } 1980 1981 // Devices returns the value of property "USBPermissionResult.devices". 1982 // 1983 // It returns ok=false if there is no such property. 1984 func (this USBPermissionResult) Devices() (ret js.FrozenArray[USBDevice], ok bool) { 1985 ok = js.True == bindings.GetUSBPermissionResultDevices( 1986 this.ref, js.Pointer(&ret), 1987 ) 1988 return 1989 } 1990 1991 // SetDevices sets the value of property "USBPermissionResult.devices" to val. 1992 // 1993 // It returns false if the property cannot be set. 1994 func (this USBPermissionResult) SetDevices(val js.FrozenArray[USBDevice]) bool { 1995 return js.True == bindings.SetUSBPermissionResultDevices( 1996 this.ref, 1997 val.Ref(), 1998 ) 1999 } 2000 2001 type USBPermissionStorage struct { 2002 // AllowedDevices is "USBPermissionStorage.allowedDevices" 2003 // 2004 // Optional, defaults to []. 2005 AllowedDevices js.Array[AllowedUSBDevice] 2006 2007 FFI_USE bool 2008 } 2009 2010 // FromRef calls UpdateFrom and returns a USBPermissionStorage with all fields set. 2011 func (p USBPermissionStorage) FromRef(ref js.Ref) USBPermissionStorage { 2012 p.UpdateFrom(ref) 2013 return p 2014 } 2015 2016 // New creates a new USBPermissionStorage in the application heap. 2017 func (p USBPermissionStorage) New() js.Ref { 2018 return bindings.USBPermissionStorageJSLoad( 2019 js.Pointer(&p), js.True, 0, 2020 ) 2021 } 2022 2023 // UpdateFrom copies value of all fields of the heap object to p. 2024 func (p *USBPermissionStorage) UpdateFrom(ref js.Ref) { 2025 bindings.USBPermissionStorageJSStore( 2026 js.Pointer(p), ref, 2027 ) 2028 } 2029 2030 // Update writes all fields of the p to the heap object referenced by ref. 2031 func (p *USBPermissionStorage) Update(ref js.Ref) { 2032 bindings.USBPermissionStorageJSLoad( 2033 js.Pointer(p), js.False, ref, 2034 ) 2035 } 2036 2037 // FreeMembers frees fields with heap reference, if recursive is true 2038 // free all heap references reachable from p. 2039 func (p *USBPermissionStorage) FreeMembers(recursive bool) { 2040 js.Free( 2041 p.AllowedDevices.Ref(), 2042 ) 2043 p.AllowedDevices = p.AllowedDevices.FromRef(js.Undefined) 2044 } 2045 2046 func NewUncalibratedMagnetometer(sensorOptions MagnetometerSensorOptions) (ret UncalibratedMagnetometer) { 2047 ret.ref = bindings.NewUncalibratedMagnetometerByUncalibratedMagnetometer( 2048 js.Pointer(&sensorOptions)) 2049 return 2050 } 2051 2052 func NewUncalibratedMagnetometerByUncalibratedMagnetometer1() (ret UncalibratedMagnetometer) { 2053 ret.ref = bindings.NewUncalibratedMagnetometerByUncalibratedMagnetometer1() 2054 return 2055 } 2056 2057 type UncalibratedMagnetometer struct { 2058 Sensor 2059 } 2060 2061 func (this UncalibratedMagnetometer) Once() UncalibratedMagnetometer { 2062 this.ref.Once() 2063 return this 2064 } 2065 2066 func (this UncalibratedMagnetometer) Ref() js.Ref { 2067 return this.Sensor.Ref() 2068 } 2069 2070 func (this UncalibratedMagnetometer) FromRef(ref js.Ref) UncalibratedMagnetometer { 2071 this.Sensor = this.Sensor.FromRef(ref) 2072 return this 2073 } 2074 2075 func (this UncalibratedMagnetometer) Free() { 2076 this.ref.Free() 2077 } 2078 2079 // X returns the value of property "UncalibratedMagnetometer.x". 2080 // 2081 // It returns ok=false if there is no such property. 2082 func (this UncalibratedMagnetometer) X() (ret float64, ok bool) { 2083 ok = js.True == bindings.GetUncalibratedMagnetometerX( 2084 this.ref, js.Pointer(&ret), 2085 ) 2086 return 2087 } 2088 2089 // Y returns the value of property "UncalibratedMagnetometer.y". 2090 // 2091 // It returns ok=false if there is no such property. 2092 func (this UncalibratedMagnetometer) Y() (ret float64, ok bool) { 2093 ok = js.True == bindings.GetUncalibratedMagnetometerY( 2094 this.ref, js.Pointer(&ret), 2095 ) 2096 return 2097 } 2098 2099 // Z returns the value of property "UncalibratedMagnetometer.z". 2100 // 2101 // It returns ok=false if there is no such property. 2102 func (this UncalibratedMagnetometer) Z() (ret float64, ok bool) { 2103 ok = js.True == bindings.GetUncalibratedMagnetometerZ( 2104 this.ref, js.Pointer(&ret), 2105 ) 2106 return 2107 } 2108 2109 // XBias returns the value of property "UncalibratedMagnetometer.xBias". 2110 // 2111 // It returns ok=false if there is no such property. 2112 func (this UncalibratedMagnetometer) XBias() (ret float64, ok bool) { 2113 ok = js.True == bindings.GetUncalibratedMagnetometerXBias( 2114 this.ref, js.Pointer(&ret), 2115 ) 2116 return 2117 } 2118 2119 // YBias returns the value of property "UncalibratedMagnetometer.yBias". 2120 // 2121 // It returns ok=false if there is no such property. 2122 func (this UncalibratedMagnetometer) YBias() (ret float64, ok bool) { 2123 ok = js.True == bindings.GetUncalibratedMagnetometerYBias( 2124 this.ref, js.Pointer(&ret), 2125 ) 2126 return 2127 } 2128 2129 // ZBias returns the value of property "UncalibratedMagnetometer.zBias". 2130 // 2131 // It returns ok=false if there is no such property. 2132 func (this UncalibratedMagnetometer) ZBias() (ret float64, ok bool) { 2133 ok = js.True == bindings.GetUncalibratedMagnetometerZBias( 2134 this.ref, js.Pointer(&ret), 2135 ) 2136 return 2137 } 2138 2139 type UncalibratedMagnetometerReadingValues struct { 2140 // X is "UncalibratedMagnetometerReadingValues.x" 2141 // 2142 // Required 2143 X float64 2144 // Y is "UncalibratedMagnetometerReadingValues.y" 2145 // 2146 // Required 2147 Y float64 2148 // Z is "UncalibratedMagnetometerReadingValues.z" 2149 // 2150 // Required 2151 Z float64 2152 // XBias is "UncalibratedMagnetometerReadingValues.xBias" 2153 // 2154 // Required 2155 XBias float64 2156 // YBias is "UncalibratedMagnetometerReadingValues.yBias" 2157 // 2158 // Required 2159 YBias float64 2160 // ZBias is "UncalibratedMagnetometerReadingValues.zBias" 2161 // 2162 // Required 2163 ZBias float64 2164 2165 FFI_USE bool 2166 } 2167 2168 // FromRef calls UpdateFrom and returns a UncalibratedMagnetometerReadingValues with all fields set. 2169 func (p UncalibratedMagnetometerReadingValues) FromRef(ref js.Ref) UncalibratedMagnetometerReadingValues { 2170 p.UpdateFrom(ref) 2171 return p 2172 } 2173 2174 // New creates a new UncalibratedMagnetometerReadingValues in the application heap. 2175 func (p UncalibratedMagnetometerReadingValues) New() js.Ref { 2176 return bindings.UncalibratedMagnetometerReadingValuesJSLoad( 2177 js.Pointer(&p), js.True, 0, 2178 ) 2179 } 2180 2181 // UpdateFrom copies value of all fields of the heap object to p. 2182 func (p *UncalibratedMagnetometerReadingValues) UpdateFrom(ref js.Ref) { 2183 bindings.UncalibratedMagnetometerReadingValuesJSStore( 2184 js.Pointer(p), ref, 2185 ) 2186 } 2187 2188 // Update writes all fields of the p to the heap object referenced by ref. 2189 func (p *UncalibratedMagnetometerReadingValues) Update(ref js.Ref) { 2190 bindings.UncalibratedMagnetometerReadingValuesJSLoad( 2191 js.Pointer(p), js.False, ref, 2192 ) 2193 } 2194 2195 // FreeMembers frees fields with heap reference, if recursive is true 2196 // free all heap references reachable from p. 2197 func (p *UncalibratedMagnetometerReadingValues) FreeMembers(recursive bool) { 2198 } 2199 2200 type UnderlyingSinkStartCallbackFunc func(this js.Ref, controller WritableStreamDefaultController) js.Ref 2201 2202 func (fn UnderlyingSinkStartCallbackFunc) Register() js.Func[func(controller WritableStreamDefaultController) js.Any] { 2203 return js.RegisterCallback[func(controller WritableStreamDefaultController) js.Any]( 2204 fn, abi.FuncPCABIInternal(fn), 2205 ) 2206 } 2207 2208 func (fn UnderlyingSinkStartCallbackFunc) DispatchCallback( 2209 targetPC uintptr, ctx *js.CallbackContext, 2210 ) { 2211 args := ctx.Args() 2212 if len(args) != 1+1 /* js this */ || 2213 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2214 js.ThrowInvalidCallbackInvocation() 2215 } 2216 2217 if ctx.Return(fn( 2218 args[0], 2219 2220 WritableStreamDefaultController{}.FromRef(args[0+1]), 2221 )) { 2222 return 2223 } 2224 2225 js.ThrowCallbackValueNotReturned() 2226 } 2227 2228 type UnderlyingSinkStartCallback[T any] struct { 2229 Fn func(arg T, this js.Ref, controller WritableStreamDefaultController) js.Ref 2230 Arg T 2231 } 2232 2233 func (cb *UnderlyingSinkStartCallback[T]) Register() js.Func[func(controller WritableStreamDefaultController) js.Any] { 2234 return js.RegisterCallback[func(controller WritableStreamDefaultController) js.Any]( 2235 cb, abi.FuncPCABIInternal(cb.Fn), 2236 ) 2237 } 2238 2239 func (cb *UnderlyingSinkStartCallback[T]) DispatchCallback( 2240 targetPC uintptr, ctx *js.CallbackContext, 2241 ) { 2242 args := ctx.Args() 2243 if len(args) != 1+1 /* js this */ || 2244 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2245 js.ThrowInvalidCallbackInvocation() 2246 } 2247 2248 if ctx.Return(cb.Fn( 2249 cb.Arg, 2250 args[0], 2251 2252 WritableStreamDefaultController{}.FromRef(args[0+1]), 2253 )) { 2254 return 2255 } 2256 2257 js.ThrowCallbackValueNotReturned() 2258 } 2259 2260 type WritableStreamDefaultController struct { 2261 ref js.Ref 2262 } 2263 2264 func (this WritableStreamDefaultController) Once() WritableStreamDefaultController { 2265 this.ref.Once() 2266 return this 2267 } 2268 2269 func (this WritableStreamDefaultController) Ref() js.Ref { 2270 return this.ref 2271 } 2272 2273 func (this WritableStreamDefaultController) FromRef(ref js.Ref) WritableStreamDefaultController { 2274 this.ref = ref 2275 return this 2276 } 2277 2278 func (this WritableStreamDefaultController) Free() { 2279 this.ref.Free() 2280 } 2281 2282 // Signal returns the value of property "WritableStreamDefaultController.signal". 2283 // 2284 // It returns ok=false if there is no such property. 2285 func (this WritableStreamDefaultController) Signal() (ret AbortSignal, ok bool) { 2286 ok = js.True == bindings.GetWritableStreamDefaultControllerSignal( 2287 this.ref, js.Pointer(&ret), 2288 ) 2289 return 2290 } 2291 2292 // HasFuncError returns true if the method "WritableStreamDefaultController.error" exists. 2293 func (this WritableStreamDefaultController) HasFuncError() bool { 2294 return js.True == bindings.HasFuncWritableStreamDefaultControllerError( 2295 this.ref, 2296 ) 2297 } 2298 2299 // FuncError returns the method "WritableStreamDefaultController.error". 2300 func (this WritableStreamDefaultController) FuncError() (fn js.Func[func(e js.Any)]) { 2301 bindings.FuncWritableStreamDefaultControllerError( 2302 this.ref, js.Pointer(&fn), 2303 ) 2304 return 2305 } 2306 2307 // Error calls the method "WritableStreamDefaultController.error". 2308 func (this WritableStreamDefaultController) Error(e js.Any) (ret js.Void) { 2309 bindings.CallWritableStreamDefaultControllerError( 2310 this.ref, js.Pointer(&ret), 2311 e.Ref(), 2312 ) 2313 2314 return 2315 } 2316 2317 // TryError calls the method "WritableStreamDefaultController.error" 2318 // in a try/catch block and returns (_, err, ok = false) when it went through 2319 // the catch clause. 2320 func (this WritableStreamDefaultController) TryError(e js.Any) (ret js.Void, exception js.Any, ok bool) { 2321 ok = js.True == bindings.TryWritableStreamDefaultControllerError( 2322 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2323 e.Ref(), 2324 ) 2325 2326 return 2327 } 2328 2329 // HasFuncError1 returns true if the method "WritableStreamDefaultController.error" exists. 2330 func (this WritableStreamDefaultController) HasFuncError1() bool { 2331 return js.True == bindings.HasFuncWritableStreamDefaultControllerError1( 2332 this.ref, 2333 ) 2334 } 2335 2336 // FuncError1 returns the method "WritableStreamDefaultController.error". 2337 func (this WritableStreamDefaultController) FuncError1() (fn js.Func[func()]) { 2338 bindings.FuncWritableStreamDefaultControllerError1( 2339 this.ref, js.Pointer(&fn), 2340 ) 2341 return 2342 } 2343 2344 // Error1 calls the method "WritableStreamDefaultController.error". 2345 func (this WritableStreamDefaultController) Error1() (ret js.Void) { 2346 bindings.CallWritableStreamDefaultControllerError1( 2347 this.ref, js.Pointer(&ret), 2348 ) 2349 2350 return 2351 } 2352 2353 // TryError1 calls the method "WritableStreamDefaultController.error" 2354 // in a try/catch block and returns (_, err, ok = false) when it went through 2355 // the catch clause. 2356 func (this WritableStreamDefaultController) TryError1() (ret js.Void, exception js.Any, ok bool) { 2357 ok = js.True == bindings.TryWritableStreamDefaultControllerError1( 2358 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2359 ) 2360 2361 return 2362 } 2363 2364 type UnderlyingSinkWriteCallbackFunc func(this js.Ref, chunk js.Any, controller WritableStreamDefaultController) js.Ref 2365 2366 func (fn UnderlyingSinkWriteCallbackFunc) Register() js.Func[func(chunk js.Any, controller WritableStreamDefaultController) js.Promise[js.Void]] { 2367 return js.RegisterCallback[func(chunk js.Any, controller WritableStreamDefaultController) js.Promise[js.Void]]( 2368 fn, abi.FuncPCABIInternal(fn), 2369 ) 2370 } 2371 2372 func (fn UnderlyingSinkWriteCallbackFunc) DispatchCallback( 2373 targetPC uintptr, ctx *js.CallbackContext, 2374 ) { 2375 args := ctx.Args() 2376 if len(args) != 2+1 /* js this */ || 2377 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2378 js.ThrowInvalidCallbackInvocation() 2379 } 2380 2381 if ctx.Return(fn( 2382 args[0], 2383 2384 js.Any{}.FromRef(args[0+1]), 2385 WritableStreamDefaultController{}.FromRef(args[1+1]), 2386 )) { 2387 return 2388 } 2389 2390 js.ThrowCallbackValueNotReturned() 2391 } 2392 2393 type UnderlyingSinkWriteCallback[T any] struct { 2394 Fn func(arg T, this js.Ref, chunk js.Any, controller WritableStreamDefaultController) js.Ref 2395 Arg T 2396 } 2397 2398 func (cb *UnderlyingSinkWriteCallback[T]) Register() js.Func[func(chunk js.Any, controller WritableStreamDefaultController) js.Promise[js.Void]] { 2399 return js.RegisterCallback[func(chunk js.Any, controller WritableStreamDefaultController) js.Promise[js.Void]]( 2400 cb, abi.FuncPCABIInternal(cb.Fn), 2401 ) 2402 } 2403 2404 func (cb *UnderlyingSinkWriteCallback[T]) DispatchCallback( 2405 targetPC uintptr, ctx *js.CallbackContext, 2406 ) { 2407 args := ctx.Args() 2408 if len(args) != 2+1 /* js this */ || 2409 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2410 js.ThrowInvalidCallbackInvocation() 2411 } 2412 2413 if ctx.Return(cb.Fn( 2414 cb.Arg, 2415 args[0], 2416 2417 js.Any{}.FromRef(args[0+1]), 2418 WritableStreamDefaultController{}.FromRef(args[1+1]), 2419 )) { 2420 return 2421 } 2422 2423 js.ThrowCallbackValueNotReturned() 2424 } 2425 2426 type UnderlyingSinkCloseCallbackFunc func(this js.Ref) js.Ref 2427 2428 func (fn UnderlyingSinkCloseCallbackFunc) Register() js.Func[func() js.Promise[js.Void]] { 2429 return js.RegisterCallback[func() js.Promise[js.Void]]( 2430 fn, abi.FuncPCABIInternal(fn), 2431 ) 2432 } 2433 2434 func (fn UnderlyingSinkCloseCallbackFunc) DispatchCallback( 2435 targetPC uintptr, ctx *js.CallbackContext, 2436 ) { 2437 args := ctx.Args() 2438 if len(args) != 0+1 /* js this */ || 2439 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2440 js.ThrowInvalidCallbackInvocation() 2441 } 2442 2443 if ctx.Return(fn( 2444 args[0], 2445 )) { 2446 return 2447 } 2448 2449 js.ThrowCallbackValueNotReturned() 2450 } 2451 2452 type UnderlyingSinkCloseCallback[T any] struct { 2453 Fn func(arg T, this js.Ref) js.Ref 2454 Arg T 2455 } 2456 2457 func (cb *UnderlyingSinkCloseCallback[T]) Register() js.Func[func() js.Promise[js.Void]] { 2458 return js.RegisterCallback[func() js.Promise[js.Void]]( 2459 cb, abi.FuncPCABIInternal(cb.Fn), 2460 ) 2461 } 2462 2463 func (cb *UnderlyingSinkCloseCallback[T]) DispatchCallback( 2464 targetPC uintptr, ctx *js.CallbackContext, 2465 ) { 2466 args := ctx.Args() 2467 if len(args) != 0+1 /* js this */ || 2468 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2469 js.ThrowInvalidCallbackInvocation() 2470 } 2471 2472 if ctx.Return(cb.Fn( 2473 cb.Arg, 2474 args[0], 2475 )) { 2476 return 2477 } 2478 2479 js.ThrowCallbackValueNotReturned() 2480 } 2481 2482 type UnderlyingSinkAbortCallbackFunc func(this js.Ref, reason js.Any) js.Ref 2483 2484 func (fn UnderlyingSinkAbortCallbackFunc) Register() js.Func[func(reason js.Any) js.Promise[js.Void]] { 2485 return js.RegisterCallback[func(reason js.Any) js.Promise[js.Void]]( 2486 fn, abi.FuncPCABIInternal(fn), 2487 ) 2488 } 2489 2490 func (fn UnderlyingSinkAbortCallbackFunc) DispatchCallback( 2491 targetPC uintptr, ctx *js.CallbackContext, 2492 ) { 2493 args := ctx.Args() 2494 if len(args) != 1+1 /* js this */ || 2495 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2496 js.ThrowInvalidCallbackInvocation() 2497 } 2498 2499 if ctx.Return(fn( 2500 args[0], 2501 2502 js.Any{}.FromRef(args[0+1]), 2503 )) { 2504 return 2505 } 2506 2507 js.ThrowCallbackValueNotReturned() 2508 } 2509 2510 type UnderlyingSinkAbortCallback[T any] struct { 2511 Fn func(arg T, this js.Ref, reason js.Any) js.Ref 2512 Arg T 2513 } 2514 2515 func (cb *UnderlyingSinkAbortCallback[T]) Register() js.Func[func(reason js.Any) js.Promise[js.Void]] { 2516 return js.RegisterCallback[func(reason js.Any) js.Promise[js.Void]]( 2517 cb, abi.FuncPCABIInternal(cb.Fn), 2518 ) 2519 } 2520 2521 func (cb *UnderlyingSinkAbortCallback[T]) DispatchCallback( 2522 targetPC uintptr, ctx *js.CallbackContext, 2523 ) { 2524 args := ctx.Args() 2525 if len(args) != 1+1 /* js this */ || 2526 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2527 js.ThrowInvalidCallbackInvocation() 2528 } 2529 2530 if ctx.Return(cb.Fn( 2531 cb.Arg, 2532 args[0], 2533 2534 js.Any{}.FromRef(args[0+1]), 2535 )) { 2536 return 2537 } 2538 2539 js.ThrowCallbackValueNotReturned() 2540 } 2541 2542 type UnderlyingSink struct { 2543 // Start is "UnderlyingSink.start" 2544 // 2545 // Optional 2546 Start js.Func[func(controller WritableStreamDefaultController) js.Any] 2547 // Write is "UnderlyingSink.write" 2548 // 2549 // Optional 2550 Write js.Func[func(chunk js.Any, controller WritableStreamDefaultController) js.Promise[js.Void]] 2551 // Close is "UnderlyingSink.close" 2552 // 2553 // Optional 2554 Close js.Func[func() js.Promise[js.Void]] 2555 // Abort is "UnderlyingSink.abort" 2556 // 2557 // Optional 2558 Abort js.Func[func(reason js.Any) js.Promise[js.Void]] 2559 // Type is "UnderlyingSink.type" 2560 // 2561 // Optional 2562 Type js.Any 2563 2564 FFI_USE bool 2565 } 2566 2567 // FromRef calls UpdateFrom and returns a UnderlyingSink with all fields set. 2568 func (p UnderlyingSink) FromRef(ref js.Ref) UnderlyingSink { 2569 p.UpdateFrom(ref) 2570 return p 2571 } 2572 2573 // New creates a new UnderlyingSink in the application heap. 2574 func (p UnderlyingSink) New() js.Ref { 2575 return bindings.UnderlyingSinkJSLoad( 2576 js.Pointer(&p), js.True, 0, 2577 ) 2578 } 2579 2580 // UpdateFrom copies value of all fields of the heap object to p. 2581 func (p *UnderlyingSink) UpdateFrom(ref js.Ref) { 2582 bindings.UnderlyingSinkJSStore( 2583 js.Pointer(p), ref, 2584 ) 2585 } 2586 2587 // Update writes all fields of the p to the heap object referenced by ref. 2588 func (p *UnderlyingSink) Update(ref js.Ref) { 2589 bindings.UnderlyingSinkJSLoad( 2590 js.Pointer(p), js.False, ref, 2591 ) 2592 } 2593 2594 // FreeMembers frees fields with heap reference, if recursive is true 2595 // free all heap references reachable from p. 2596 func (p *UnderlyingSink) FreeMembers(recursive bool) { 2597 js.Free( 2598 p.Start.Ref(), 2599 p.Write.Ref(), 2600 p.Close.Ref(), 2601 p.Abort.Ref(), 2602 p.Type.Ref(), 2603 ) 2604 p.Start = p.Start.FromRef(js.Undefined) 2605 p.Write = p.Write.FromRef(js.Undefined) 2606 p.Close = p.Close.FromRef(js.Undefined) 2607 p.Abort = p.Abort.FromRef(js.Undefined) 2608 p.Type = p.Type.FromRef(js.Undefined) 2609 } 2610 2611 type UnderlyingSourceStartCallbackFunc func(this js.Ref, controller ReadableStreamController) js.Ref 2612 2613 func (fn UnderlyingSourceStartCallbackFunc) Register() js.Func[func(controller ReadableStreamController) js.Any] { 2614 return js.RegisterCallback[func(controller ReadableStreamController) js.Any]( 2615 fn, abi.FuncPCABIInternal(fn), 2616 ) 2617 } 2618 2619 func (fn UnderlyingSourceStartCallbackFunc) DispatchCallback( 2620 targetPC uintptr, ctx *js.CallbackContext, 2621 ) { 2622 args := ctx.Args() 2623 if len(args) != 1+1 /* js this */ || 2624 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2625 js.ThrowInvalidCallbackInvocation() 2626 } 2627 2628 if ctx.Return(fn( 2629 args[0], 2630 2631 ReadableStreamController{}.FromRef(args[0+1]), 2632 )) { 2633 return 2634 } 2635 2636 js.ThrowCallbackValueNotReturned() 2637 } 2638 2639 type UnderlyingSourceStartCallback[T any] struct { 2640 Fn func(arg T, this js.Ref, controller ReadableStreamController) js.Ref 2641 Arg T 2642 } 2643 2644 func (cb *UnderlyingSourceStartCallback[T]) Register() js.Func[func(controller ReadableStreamController) js.Any] { 2645 return js.RegisterCallback[func(controller ReadableStreamController) js.Any]( 2646 cb, abi.FuncPCABIInternal(cb.Fn), 2647 ) 2648 } 2649 2650 func (cb *UnderlyingSourceStartCallback[T]) DispatchCallback( 2651 targetPC uintptr, ctx *js.CallbackContext, 2652 ) { 2653 args := ctx.Args() 2654 if len(args) != 1+1 /* js this */ || 2655 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2656 js.ThrowInvalidCallbackInvocation() 2657 } 2658 2659 if ctx.Return(cb.Fn( 2660 cb.Arg, 2661 args[0], 2662 2663 ReadableStreamController{}.FromRef(args[0+1]), 2664 )) { 2665 return 2666 } 2667 2668 js.ThrowCallbackValueNotReturned() 2669 } 2670 2671 type UnderlyingSourcePullCallbackFunc func(this js.Ref, controller ReadableStreamController) js.Ref 2672 2673 func (fn UnderlyingSourcePullCallbackFunc) Register() js.Func[func(controller ReadableStreamController) js.Promise[js.Void]] { 2674 return js.RegisterCallback[func(controller ReadableStreamController) js.Promise[js.Void]]( 2675 fn, abi.FuncPCABIInternal(fn), 2676 ) 2677 } 2678 2679 func (fn UnderlyingSourcePullCallbackFunc) DispatchCallback( 2680 targetPC uintptr, ctx *js.CallbackContext, 2681 ) { 2682 args := ctx.Args() 2683 if len(args) != 1+1 /* js this */ || 2684 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2685 js.ThrowInvalidCallbackInvocation() 2686 } 2687 2688 if ctx.Return(fn( 2689 args[0], 2690 2691 ReadableStreamController{}.FromRef(args[0+1]), 2692 )) { 2693 return 2694 } 2695 2696 js.ThrowCallbackValueNotReturned() 2697 } 2698 2699 type UnderlyingSourcePullCallback[T any] struct { 2700 Fn func(arg T, this js.Ref, controller ReadableStreamController) js.Ref 2701 Arg T 2702 } 2703 2704 func (cb *UnderlyingSourcePullCallback[T]) Register() js.Func[func(controller ReadableStreamController) js.Promise[js.Void]] { 2705 return js.RegisterCallback[func(controller ReadableStreamController) js.Promise[js.Void]]( 2706 cb, abi.FuncPCABIInternal(cb.Fn), 2707 ) 2708 } 2709 2710 func (cb *UnderlyingSourcePullCallback[T]) DispatchCallback( 2711 targetPC uintptr, ctx *js.CallbackContext, 2712 ) { 2713 args := ctx.Args() 2714 if len(args) != 1+1 /* js this */ || 2715 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2716 js.ThrowInvalidCallbackInvocation() 2717 } 2718 2719 if ctx.Return(cb.Fn( 2720 cb.Arg, 2721 args[0], 2722 2723 ReadableStreamController{}.FromRef(args[0+1]), 2724 )) { 2725 return 2726 } 2727 2728 js.ThrowCallbackValueNotReturned() 2729 } 2730 2731 type UnderlyingSourceCancelCallbackFunc func(this js.Ref, reason js.Any) js.Ref 2732 2733 func (fn UnderlyingSourceCancelCallbackFunc) Register() js.Func[func(reason js.Any) js.Promise[js.Void]] { 2734 return js.RegisterCallback[func(reason js.Any) js.Promise[js.Void]]( 2735 fn, abi.FuncPCABIInternal(fn), 2736 ) 2737 } 2738 2739 func (fn UnderlyingSourceCancelCallbackFunc) DispatchCallback( 2740 targetPC uintptr, ctx *js.CallbackContext, 2741 ) { 2742 args := ctx.Args() 2743 if len(args) != 1+1 /* js this */ || 2744 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2745 js.ThrowInvalidCallbackInvocation() 2746 } 2747 2748 if ctx.Return(fn( 2749 args[0], 2750 2751 js.Any{}.FromRef(args[0+1]), 2752 )) { 2753 return 2754 } 2755 2756 js.ThrowCallbackValueNotReturned() 2757 } 2758 2759 type UnderlyingSourceCancelCallback[T any] struct { 2760 Fn func(arg T, this js.Ref, reason js.Any) js.Ref 2761 Arg T 2762 } 2763 2764 func (cb *UnderlyingSourceCancelCallback[T]) Register() js.Func[func(reason js.Any) js.Promise[js.Void]] { 2765 return js.RegisterCallback[func(reason js.Any) js.Promise[js.Void]]( 2766 cb, abi.FuncPCABIInternal(cb.Fn), 2767 ) 2768 } 2769 2770 func (cb *UnderlyingSourceCancelCallback[T]) DispatchCallback( 2771 targetPC uintptr, ctx *js.CallbackContext, 2772 ) { 2773 args := ctx.Args() 2774 if len(args) != 1+1 /* js this */ || 2775 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2776 js.ThrowInvalidCallbackInvocation() 2777 } 2778 2779 if ctx.Return(cb.Fn( 2780 cb.Arg, 2781 args[0], 2782 2783 js.Any{}.FromRef(args[0+1]), 2784 )) { 2785 return 2786 } 2787 2788 js.ThrowCallbackValueNotReturned() 2789 } 2790 2791 type UnderlyingSource struct { 2792 // Start is "UnderlyingSource.start" 2793 // 2794 // Optional 2795 Start js.Func[func(controller ReadableStreamController) js.Any] 2796 // Pull is "UnderlyingSource.pull" 2797 // 2798 // Optional 2799 Pull js.Func[func(controller ReadableStreamController) js.Promise[js.Void]] 2800 // Cancel is "UnderlyingSource.cancel" 2801 // 2802 // Optional 2803 Cancel js.Func[func(reason js.Any) js.Promise[js.Void]] 2804 // Type is "UnderlyingSource.type" 2805 // 2806 // Optional 2807 Type ReadableStreamType 2808 // AutoAllocateChunkSize is "UnderlyingSource.autoAllocateChunkSize" 2809 // 2810 // Optional 2811 // 2812 // NOTE: FFI_USE_AutoAllocateChunkSize MUST be set to true to make this field effective. 2813 AutoAllocateChunkSize uint64 2814 2815 FFI_USE_AutoAllocateChunkSize bool // for AutoAllocateChunkSize. 2816 2817 FFI_USE bool 2818 } 2819 2820 // FromRef calls UpdateFrom and returns a UnderlyingSource with all fields set. 2821 func (p UnderlyingSource) FromRef(ref js.Ref) UnderlyingSource { 2822 p.UpdateFrom(ref) 2823 return p 2824 } 2825 2826 // New creates a new UnderlyingSource in the application heap. 2827 func (p UnderlyingSource) New() js.Ref { 2828 return bindings.UnderlyingSourceJSLoad( 2829 js.Pointer(&p), js.True, 0, 2830 ) 2831 } 2832 2833 // UpdateFrom copies value of all fields of the heap object to p. 2834 func (p *UnderlyingSource) UpdateFrom(ref js.Ref) { 2835 bindings.UnderlyingSourceJSStore( 2836 js.Pointer(p), ref, 2837 ) 2838 } 2839 2840 // Update writes all fields of the p to the heap object referenced by ref. 2841 func (p *UnderlyingSource) Update(ref js.Ref) { 2842 bindings.UnderlyingSourceJSLoad( 2843 js.Pointer(p), js.False, ref, 2844 ) 2845 } 2846 2847 // FreeMembers frees fields with heap reference, if recursive is true 2848 // free all heap references reachable from p. 2849 func (p *UnderlyingSource) FreeMembers(recursive bool) { 2850 js.Free( 2851 p.Start.Ref(), 2852 p.Pull.Ref(), 2853 p.Cancel.Ref(), 2854 ) 2855 p.Start = p.Start.FromRef(js.Undefined) 2856 p.Pull = p.Pull.FromRef(js.Undefined) 2857 p.Cancel = p.Cancel.FromRef(js.Undefined) 2858 } 2859 2860 type UserVerificationRequirement uint32 2861 2862 const ( 2863 _ UserVerificationRequirement = iota 2864 2865 UserVerificationRequirement_REQUIRED 2866 UserVerificationRequirement_PREFERRED 2867 UserVerificationRequirement_DISCOURAGED 2868 ) 2869 2870 func (UserVerificationRequirement) FromRef(str js.Ref) UserVerificationRequirement { 2871 return UserVerificationRequirement(bindings.ConstOfUserVerificationRequirement(str)) 2872 } 2873 2874 func (x UserVerificationRequirement) String() (string, bool) { 2875 switch x { 2876 case UserVerificationRequirement_REQUIRED: 2877 return "required", true 2878 case UserVerificationRequirement_PREFERRED: 2879 return "preferred", true 2880 case UserVerificationRequirement_DISCOURAGED: 2881 return "discouraged", true 2882 default: 2883 return "", false 2884 } 2885 } 2886 2887 type VTTRegion struct { 2888 ref js.Ref 2889 } 2890 2891 func (this VTTRegion) Once() VTTRegion { 2892 this.ref.Once() 2893 return this 2894 } 2895 2896 func (this VTTRegion) Ref() js.Ref { 2897 return this.ref 2898 } 2899 2900 func (this VTTRegion) FromRef(ref js.Ref) VTTRegion { 2901 this.ref = ref 2902 return this 2903 } 2904 2905 func (this VTTRegion) Free() { 2906 this.ref.Free() 2907 } 2908 2909 // Id returns the value of property "VTTRegion.id". 2910 // 2911 // It returns ok=false if there is no such property. 2912 func (this VTTRegion) Id() (ret js.String, ok bool) { 2913 ok = js.True == bindings.GetVTTRegionId( 2914 this.ref, js.Pointer(&ret), 2915 ) 2916 return 2917 } 2918 2919 // SetId sets the value of property "VTTRegion.id" to val. 2920 // 2921 // It returns false if the property cannot be set. 2922 func (this VTTRegion) SetId(val js.String) bool { 2923 return js.True == bindings.SetVTTRegionId( 2924 this.ref, 2925 val.Ref(), 2926 ) 2927 } 2928 2929 // Width returns the value of property "VTTRegion.width". 2930 // 2931 // It returns ok=false if there is no such property. 2932 func (this VTTRegion) Width() (ret float64, ok bool) { 2933 ok = js.True == bindings.GetVTTRegionWidth( 2934 this.ref, js.Pointer(&ret), 2935 ) 2936 return 2937 } 2938 2939 // SetWidth sets the value of property "VTTRegion.width" to val. 2940 // 2941 // It returns false if the property cannot be set. 2942 func (this VTTRegion) SetWidth(val float64) bool { 2943 return js.True == bindings.SetVTTRegionWidth( 2944 this.ref, 2945 float64(val), 2946 ) 2947 } 2948 2949 // Lines returns the value of property "VTTRegion.lines". 2950 // 2951 // It returns ok=false if there is no such property. 2952 func (this VTTRegion) Lines() (ret uint32, ok bool) { 2953 ok = js.True == bindings.GetVTTRegionLines( 2954 this.ref, js.Pointer(&ret), 2955 ) 2956 return 2957 } 2958 2959 // SetLines sets the value of property "VTTRegion.lines" to val. 2960 // 2961 // It returns false if the property cannot be set. 2962 func (this VTTRegion) SetLines(val uint32) bool { 2963 return js.True == bindings.SetVTTRegionLines( 2964 this.ref, 2965 uint32(val), 2966 ) 2967 } 2968 2969 // RegionAnchorX returns the value of property "VTTRegion.regionAnchorX". 2970 // 2971 // It returns ok=false if there is no such property. 2972 func (this VTTRegion) RegionAnchorX() (ret float64, ok bool) { 2973 ok = js.True == bindings.GetVTTRegionRegionAnchorX( 2974 this.ref, js.Pointer(&ret), 2975 ) 2976 return 2977 } 2978 2979 // SetRegionAnchorX sets the value of property "VTTRegion.regionAnchorX" to val. 2980 // 2981 // It returns false if the property cannot be set. 2982 func (this VTTRegion) SetRegionAnchorX(val float64) bool { 2983 return js.True == bindings.SetVTTRegionRegionAnchorX( 2984 this.ref, 2985 float64(val), 2986 ) 2987 } 2988 2989 // RegionAnchorY returns the value of property "VTTRegion.regionAnchorY". 2990 // 2991 // It returns ok=false if there is no such property. 2992 func (this VTTRegion) RegionAnchorY() (ret float64, ok bool) { 2993 ok = js.True == bindings.GetVTTRegionRegionAnchorY( 2994 this.ref, js.Pointer(&ret), 2995 ) 2996 return 2997 } 2998 2999 // SetRegionAnchorY sets the value of property "VTTRegion.regionAnchorY" to val. 3000 // 3001 // It returns false if the property cannot be set. 3002 func (this VTTRegion) SetRegionAnchorY(val float64) bool { 3003 return js.True == bindings.SetVTTRegionRegionAnchorY( 3004 this.ref, 3005 float64(val), 3006 ) 3007 } 3008 3009 // ViewportAnchorX returns the value of property "VTTRegion.viewportAnchorX". 3010 // 3011 // It returns ok=false if there is no such property. 3012 func (this VTTRegion) ViewportAnchorX() (ret float64, ok bool) { 3013 ok = js.True == bindings.GetVTTRegionViewportAnchorX( 3014 this.ref, js.Pointer(&ret), 3015 ) 3016 return 3017 } 3018 3019 // SetViewportAnchorX sets the value of property "VTTRegion.viewportAnchorX" to val. 3020 // 3021 // It returns false if the property cannot be set. 3022 func (this VTTRegion) SetViewportAnchorX(val float64) bool { 3023 return js.True == bindings.SetVTTRegionViewportAnchorX( 3024 this.ref, 3025 float64(val), 3026 ) 3027 } 3028 3029 // ViewportAnchorY returns the value of property "VTTRegion.viewportAnchorY". 3030 // 3031 // It returns ok=false if there is no such property. 3032 func (this VTTRegion) ViewportAnchorY() (ret float64, ok bool) { 3033 ok = js.True == bindings.GetVTTRegionViewportAnchorY( 3034 this.ref, js.Pointer(&ret), 3035 ) 3036 return 3037 } 3038 3039 // SetViewportAnchorY sets the value of property "VTTRegion.viewportAnchorY" to val. 3040 // 3041 // It returns false if the property cannot be set. 3042 func (this VTTRegion) SetViewportAnchorY(val float64) bool { 3043 return js.True == bindings.SetVTTRegionViewportAnchorY( 3044 this.ref, 3045 float64(val), 3046 ) 3047 } 3048 3049 // Scroll returns the value of property "VTTRegion.scroll". 3050 // 3051 // It returns ok=false if there is no such property. 3052 func (this VTTRegion) Scroll() (ret ScrollSetting, ok bool) { 3053 ok = js.True == bindings.GetVTTRegionScroll( 3054 this.ref, js.Pointer(&ret), 3055 ) 3056 return 3057 } 3058 3059 // SetScroll sets the value of property "VTTRegion.scroll" to val. 3060 // 3061 // It returns false if the property cannot be set. 3062 func (this VTTRegion) SetScroll(val ScrollSetting) bool { 3063 return js.True == bindings.SetVTTRegionScroll( 3064 this.ref, 3065 uint32(val), 3066 ) 3067 } 3068 3069 func NewVTTCue(startTime float64, endTime float64, text js.String) (ret VTTCue) { 3070 ret.ref = bindings.NewVTTCueByVTTCue( 3071 float64(startTime), 3072 float64(endTime), 3073 text.Ref()) 3074 return 3075 } 3076 3077 type VTTCue struct { 3078 TextTrackCue 3079 } 3080 3081 func (this VTTCue) Once() VTTCue { 3082 this.ref.Once() 3083 return this 3084 } 3085 3086 func (this VTTCue) Ref() js.Ref { 3087 return this.TextTrackCue.Ref() 3088 } 3089 3090 func (this VTTCue) FromRef(ref js.Ref) VTTCue { 3091 this.TextTrackCue = this.TextTrackCue.FromRef(ref) 3092 return this 3093 } 3094 3095 func (this VTTCue) Free() { 3096 this.ref.Free() 3097 } 3098 3099 // Region returns the value of property "VTTCue.region". 3100 // 3101 // It returns ok=false if there is no such property. 3102 func (this VTTCue) Region() (ret VTTRegion, ok bool) { 3103 ok = js.True == bindings.GetVTTCueRegion( 3104 this.ref, js.Pointer(&ret), 3105 ) 3106 return 3107 } 3108 3109 // SetRegion sets the value of property "VTTCue.region" to val. 3110 // 3111 // It returns false if the property cannot be set. 3112 func (this VTTCue) SetRegion(val VTTRegion) bool { 3113 return js.True == bindings.SetVTTCueRegion( 3114 this.ref, 3115 val.Ref(), 3116 ) 3117 } 3118 3119 // Vertical returns the value of property "VTTCue.vertical". 3120 // 3121 // It returns ok=false if there is no such property. 3122 func (this VTTCue) Vertical() (ret DirectionSetting, ok bool) { 3123 ok = js.True == bindings.GetVTTCueVertical( 3124 this.ref, js.Pointer(&ret), 3125 ) 3126 return 3127 } 3128 3129 // SetVertical sets the value of property "VTTCue.vertical" to val. 3130 // 3131 // It returns false if the property cannot be set. 3132 func (this VTTCue) SetVertical(val DirectionSetting) bool { 3133 return js.True == bindings.SetVTTCueVertical( 3134 this.ref, 3135 uint32(val), 3136 ) 3137 } 3138 3139 // SnapToLines returns the value of property "VTTCue.snapToLines". 3140 // 3141 // It returns ok=false if there is no such property. 3142 func (this VTTCue) SnapToLines() (ret bool, ok bool) { 3143 ok = js.True == bindings.GetVTTCueSnapToLines( 3144 this.ref, js.Pointer(&ret), 3145 ) 3146 return 3147 } 3148 3149 // SetSnapToLines sets the value of property "VTTCue.snapToLines" to val. 3150 // 3151 // It returns false if the property cannot be set. 3152 func (this VTTCue) SetSnapToLines(val bool) bool { 3153 return js.True == bindings.SetVTTCueSnapToLines( 3154 this.ref, 3155 js.Bool(bool(val)), 3156 ) 3157 } 3158 3159 // Line returns the value of property "VTTCue.line". 3160 // 3161 // It returns ok=false if there is no such property. 3162 func (this VTTCue) Line() (ret LineAndPositionSetting, ok bool) { 3163 ok = js.True == bindings.GetVTTCueLine( 3164 this.ref, js.Pointer(&ret), 3165 ) 3166 return 3167 } 3168 3169 // SetLine sets the value of property "VTTCue.line" to val. 3170 // 3171 // It returns false if the property cannot be set. 3172 func (this VTTCue) SetLine(val LineAndPositionSetting) bool { 3173 return js.True == bindings.SetVTTCueLine( 3174 this.ref, 3175 val.Ref(), 3176 ) 3177 } 3178 3179 // LineAlign returns the value of property "VTTCue.lineAlign". 3180 // 3181 // It returns ok=false if there is no such property. 3182 func (this VTTCue) LineAlign() (ret LineAlignSetting, ok bool) { 3183 ok = js.True == bindings.GetVTTCueLineAlign( 3184 this.ref, js.Pointer(&ret), 3185 ) 3186 return 3187 } 3188 3189 // SetLineAlign sets the value of property "VTTCue.lineAlign" to val. 3190 // 3191 // It returns false if the property cannot be set. 3192 func (this VTTCue) SetLineAlign(val LineAlignSetting) bool { 3193 return js.True == bindings.SetVTTCueLineAlign( 3194 this.ref, 3195 uint32(val), 3196 ) 3197 } 3198 3199 // Position returns the value of property "VTTCue.position". 3200 // 3201 // It returns ok=false if there is no such property. 3202 func (this VTTCue) Position() (ret LineAndPositionSetting, ok bool) { 3203 ok = js.True == bindings.GetVTTCuePosition( 3204 this.ref, js.Pointer(&ret), 3205 ) 3206 return 3207 } 3208 3209 // SetPosition sets the value of property "VTTCue.position" to val. 3210 // 3211 // It returns false if the property cannot be set. 3212 func (this VTTCue) SetPosition(val LineAndPositionSetting) bool { 3213 return js.True == bindings.SetVTTCuePosition( 3214 this.ref, 3215 val.Ref(), 3216 ) 3217 } 3218 3219 // PositionAlign returns the value of property "VTTCue.positionAlign". 3220 // 3221 // It returns ok=false if there is no such property. 3222 func (this VTTCue) PositionAlign() (ret PositionAlignSetting, ok bool) { 3223 ok = js.True == bindings.GetVTTCuePositionAlign( 3224 this.ref, js.Pointer(&ret), 3225 ) 3226 return 3227 } 3228 3229 // SetPositionAlign sets the value of property "VTTCue.positionAlign" to val. 3230 // 3231 // It returns false if the property cannot be set. 3232 func (this VTTCue) SetPositionAlign(val PositionAlignSetting) bool { 3233 return js.True == bindings.SetVTTCuePositionAlign( 3234 this.ref, 3235 uint32(val), 3236 ) 3237 } 3238 3239 // Size returns the value of property "VTTCue.size". 3240 // 3241 // It returns ok=false if there is no such property. 3242 func (this VTTCue) Size() (ret float64, ok bool) { 3243 ok = js.True == bindings.GetVTTCueSize( 3244 this.ref, js.Pointer(&ret), 3245 ) 3246 return 3247 } 3248 3249 // SetSize sets the value of property "VTTCue.size" to val. 3250 // 3251 // It returns false if the property cannot be set. 3252 func (this VTTCue) SetSize(val float64) bool { 3253 return js.True == bindings.SetVTTCueSize( 3254 this.ref, 3255 float64(val), 3256 ) 3257 } 3258 3259 // Align returns the value of property "VTTCue.align". 3260 // 3261 // It returns ok=false if there is no such property. 3262 func (this VTTCue) Align() (ret AlignSetting, ok bool) { 3263 ok = js.True == bindings.GetVTTCueAlign( 3264 this.ref, js.Pointer(&ret), 3265 ) 3266 return 3267 } 3268 3269 // SetAlign sets the value of property "VTTCue.align" to val. 3270 // 3271 // It returns false if the property cannot be set. 3272 func (this VTTCue) SetAlign(val AlignSetting) bool { 3273 return js.True == bindings.SetVTTCueAlign( 3274 this.ref, 3275 uint32(val), 3276 ) 3277 } 3278 3279 // Text returns the value of property "VTTCue.text". 3280 // 3281 // It returns ok=false if there is no such property. 3282 func (this VTTCue) Text() (ret js.String, ok bool) { 3283 ok = js.True == bindings.GetVTTCueText( 3284 this.ref, js.Pointer(&ret), 3285 ) 3286 return 3287 } 3288 3289 // SetText sets the value of property "VTTCue.text" to val. 3290 // 3291 // It returns false if the property cannot be set. 3292 func (this VTTCue) SetText(val js.String) bool { 3293 return js.True == bindings.SetVTTCueText( 3294 this.ref, 3295 val.Ref(), 3296 ) 3297 } 3298 3299 // HasFuncGetCueAsHTML returns true if the method "VTTCue.getCueAsHTML" exists. 3300 func (this VTTCue) HasFuncGetCueAsHTML() bool { 3301 return js.True == bindings.HasFuncVTTCueGetCueAsHTML( 3302 this.ref, 3303 ) 3304 } 3305 3306 // FuncGetCueAsHTML returns the method "VTTCue.getCueAsHTML". 3307 func (this VTTCue) FuncGetCueAsHTML() (fn js.Func[func() DocumentFragment]) { 3308 bindings.FuncVTTCueGetCueAsHTML( 3309 this.ref, js.Pointer(&fn), 3310 ) 3311 return 3312 } 3313 3314 // GetCueAsHTML calls the method "VTTCue.getCueAsHTML". 3315 func (this VTTCue) GetCueAsHTML() (ret DocumentFragment) { 3316 bindings.CallVTTCueGetCueAsHTML( 3317 this.ref, js.Pointer(&ret), 3318 ) 3319 3320 return 3321 } 3322 3323 // TryGetCueAsHTML calls the method "VTTCue.getCueAsHTML" 3324 // in a try/catch block and returns (_, err, ok = false) when it went through 3325 // the catch clause. 3326 func (this VTTCue) TryGetCueAsHTML() (ret DocumentFragment, exception js.Any, ok bool) { 3327 ok = js.True == bindings.TryVTTCueGetCueAsHTML( 3328 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3329 ) 3330 3331 return 3332 } 3333 3334 type ValueEventInit struct { 3335 // Value is "ValueEventInit.value" 3336 // 3337 // Optional, defaults to null. 3338 Value js.Any 3339 // Bubbles is "ValueEventInit.bubbles" 3340 // 3341 // Optional, defaults to false. 3342 // 3343 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 3344 Bubbles bool 3345 // Cancelable is "ValueEventInit.cancelable" 3346 // 3347 // Optional, defaults to false. 3348 // 3349 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 3350 Cancelable bool 3351 // Composed is "ValueEventInit.composed" 3352 // 3353 // Optional, defaults to false. 3354 // 3355 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 3356 Composed bool 3357 3358 FFI_USE_Bubbles bool // for Bubbles. 3359 FFI_USE_Cancelable bool // for Cancelable. 3360 FFI_USE_Composed bool // for Composed. 3361 3362 FFI_USE bool 3363 } 3364 3365 // FromRef calls UpdateFrom and returns a ValueEventInit with all fields set. 3366 func (p ValueEventInit) FromRef(ref js.Ref) ValueEventInit { 3367 p.UpdateFrom(ref) 3368 return p 3369 } 3370 3371 // New creates a new ValueEventInit in the application heap. 3372 func (p ValueEventInit) New() js.Ref { 3373 return bindings.ValueEventInitJSLoad( 3374 js.Pointer(&p), js.True, 0, 3375 ) 3376 } 3377 3378 // UpdateFrom copies value of all fields of the heap object to p. 3379 func (p *ValueEventInit) UpdateFrom(ref js.Ref) { 3380 bindings.ValueEventInitJSStore( 3381 js.Pointer(p), ref, 3382 ) 3383 } 3384 3385 // Update writes all fields of the p to the heap object referenced by ref. 3386 func (p *ValueEventInit) Update(ref js.Ref) { 3387 bindings.ValueEventInitJSLoad( 3388 js.Pointer(p), js.False, ref, 3389 ) 3390 } 3391 3392 // FreeMembers frees fields with heap reference, if recursive is true 3393 // free all heap references reachable from p. 3394 func (p *ValueEventInit) FreeMembers(recursive bool) { 3395 js.Free( 3396 p.Value.Ref(), 3397 ) 3398 p.Value = p.Value.FromRef(js.Undefined) 3399 } 3400 3401 func NewValueEvent(typ js.String, initDict ValueEventInit) (ret ValueEvent) { 3402 ret.ref = bindings.NewValueEventByValueEvent( 3403 typ.Ref(), 3404 js.Pointer(&initDict)) 3405 return 3406 } 3407 3408 func NewValueEventByValueEvent1(typ js.String) (ret ValueEvent) { 3409 ret.ref = bindings.NewValueEventByValueEvent1( 3410 typ.Ref()) 3411 return 3412 } 3413 3414 type ValueEvent struct { 3415 Event 3416 } 3417 3418 func (this ValueEvent) Once() ValueEvent { 3419 this.ref.Once() 3420 return this 3421 } 3422 3423 func (this ValueEvent) Ref() js.Ref { 3424 return this.Event.Ref() 3425 } 3426 3427 func (this ValueEvent) FromRef(ref js.Ref) ValueEvent { 3428 this.Event = this.Event.FromRef(ref) 3429 return this 3430 } 3431 3432 func (this ValueEvent) Free() { 3433 this.ref.Free() 3434 } 3435 3436 // Value returns the value of property "ValueEvent.value". 3437 // 3438 // It returns ok=false if there is no such property. 3439 func (this ValueEvent) Value() (ret js.Any, ok bool) { 3440 ok = js.True == bindings.GetValueEventValue( 3441 this.ref, js.Pointer(&ret), 3442 ) 3443 return 3444 } 3445 3446 type VideoFrameOutputCallbackFunc func(this js.Ref, output VideoFrame) js.Ref 3447 3448 func (fn VideoFrameOutputCallbackFunc) Register() js.Func[func(output VideoFrame)] { 3449 return js.RegisterCallback[func(output VideoFrame)]( 3450 fn, abi.FuncPCABIInternal(fn), 3451 ) 3452 } 3453 3454 func (fn VideoFrameOutputCallbackFunc) DispatchCallback( 3455 targetPC uintptr, ctx *js.CallbackContext, 3456 ) { 3457 args := ctx.Args() 3458 if len(args) != 1+1 /* js this */ || 3459 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3460 js.ThrowInvalidCallbackInvocation() 3461 } 3462 3463 if ctx.Return(fn( 3464 args[0], 3465 3466 VideoFrame{}.FromRef(args[0+1]), 3467 )) { 3468 return 3469 } 3470 3471 js.ThrowCallbackValueNotReturned() 3472 } 3473 3474 type VideoFrameOutputCallback[T any] struct { 3475 Fn func(arg T, this js.Ref, output VideoFrame) js.Ref 3476 Arg T 3477 } 3478 3479 func (cb *VideoFrameOutputCallback[T]) Register() js.Func[func(output VideoFrame)] { 3480 return js.RegisterCallback[func(output VideoFrame)]( 3481 cb, abi.FuncPCABIInternal(cb.Fn), 3482 ) 3483 } 3484 3485 func (cb *VideoFrameOutputCallback[T]) DispatchCallback( 3486 targetPC uintptr, ctx *js.CallbackContext, 3487 ) { 3488 args := ctx.Args() 3489 if len(args) != 1+1 /* js this */ || 3490 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3491 js.ThrowInvalidCallbackInvocation() 3492 } 3493 3494 if ctx.Return(cb.Fn( 3495 cb.Arg, 3496 args[0], 3497 3498 VideoFrame{}.FromRef(args[0+1]), 3499 )) { 3500 return 3501 } 3502 3503 js.ThrowCallbackValueNotReturned() 3504 } 3505 3506 type VideoDecoderInit struct { 3507 // Output is "VideoDecoderInit.output" 3508 // 3509 // Required 3510 Output js.Func[func(output VideoFrame)] 3511 // Error is "VideoDecoderInit.error" 3512 // 3513 // Required 3514 Error js.Func[func(err DOMException)] 3515 3516 FFI_USE bool 3517 } 3518 3519 // FromRef calls UpdateFrom and returns a VideoDecoderInit with all fields set. 3520 func (p VideoDecoderInit) FromRef(ref js.Ref) VideoDecoderInit { 3521 p.UpdateFrom(ref) 3522 return p 3523 } 3524 3525 // New creates a new VideoDecoderInit in the application heap. 3526 func (p VideoDecoderInit) New() js.Ref { 3527 return bindings.VideoDecoderInitJSLoad( 3528 js.Pointer(&p), js.True, 0, 3529 ) 3530 } 3531 3532 // UpdateFrom copies value of all fields of the heap object to p. 3533 func (p *VideoDecoderInit) UpdateFrom(ref js.Ref) { 3534 bindings.VideoDecoderInitJSStore( 3535 js.Pointer(p), ref, 3536 ) 3537 } 3538 3539 // Update writes all fields of the p to the heap object referenced by ref. 3540 func (p *VideoDecoderInit) Update(ref js.Ref) { 3541 bindings.VideoDecoderInitJSLoad( 3542 js.Pointer(p), js.False, ref, 3543 ) 3544 } 3545 3546 // FreeMembers frees fields with heap reference, if recursive is true 3547 // free all heap references reachable from p. 3548 func (p *VideoDecoderInit) FreeMembers(recursive bool) { 3549 js.Free( 3550 p.Output.Ref(), 3551 p.Error.Ref(), 3552 ) 3553 p.Output = p.Output.FromRef(js.Undefined) 3554 p.Error = p.Error.FromRef(js.Undefined) 3555 } 3556 3557 type VideoDecoderSupport struct { 3558 // Supported is "VideoDecoderSupport.supported" 3559 // 3560 // Optional 3561 // 3562 // NOTE: FFI_USE_Supported MUST be set to true to make this field effective. 3563 Supported bool 3564 // Config is "VideoDecoderSupport.config" 3565 // 3566 // Optional 3567 // 3568 // NOTE: Config.FFI_USE MUST be set to true to get Config used. 3569 Config VideoDecoderConfig 3570 3571 FFI_USE_Supported bool // for Supported. 3572 3573 FFI_USE bool 3574 } 3575 3576 // FromRef calls UpdateFrom and returns a VideoDecoderSupport with all fields set. 3577 func (p VideoDecoderSupport) FromRef(ref js.Ref) VideoDecoderSupport { 3578 p.UpdateFrom(ref) 3579 return p 3580 } 3581 3582 // New creates a new VideoDecoderSupport in the application heap. 3583 func (p VideoDecoderSupport) New() js.Ref { 3584 return bindings.VideoDecoderSupportJSLoad( 3585 js.Pointer(&p), js.True, 0, 3586 ) 3587 } 3588 3589 // UpdateFrom copies value of all fields of the heap object to p. 3590 func (p *VideoDecoderSupport) UpdateFrom(ref js.Ref) { 3591 bindings.VideoDecoderSupportJSStore( 3592 js.Pointer(p), ref, 3593 ) 3594 } 3595 3596 // Update writes all fields of the p to the heap object referenced by ref. 3597 func (p *VideoDecoderSupport) Update(ref js.Ref) { 3598 bindings.VideoDecoderSupportJSLoad( 3599 js.Pointer(p), js.False, ref, 3600 ) 3601 } 3602 3603 // FreeMembers frees fields with heap reference, if recursive is true 3604 // free all heap references reachable from p. 3605 func (p *VideoDecoderSupport) FreeMembers(recursive bool) { 3606 if recursive { 3607 p.Config.FreeMembers(true) 3608 } 3609 } 3610 3611 func NewVideoDecoder(init VideoDecoderInit) (ret VideoDecoder) { 3612 ret.ref = bindings.NewVideoDecoderByVideoDecoder( 3613 js.Pointer(&init)) 3614 return 3615 } 3616 3617 type VideoDecoder struct { 3618 EventTarget 3619 } 3620 3621 func (this VideoDecoder) Once() VideoDecoder { 3622 this.ref.Once() 3623 return this 3624 } 3625 3626 func (this VideoDecoder) Ref() js.Ref { 3627 return this.EventTarget.Ref() 3628 } 3629 3630 func (this VideoDecoder) FromRef(ref js.Ref) VideoDecoder { 3631 this.EventTarget = this.EventTarget.FromRef(ref) 3632 return this 3633 } 3634 3635 func (this VideoDecoder) Free() { 3636 this.ref.Free() 3637 } 3638 3639 // State returns the value of property "VideoDecoder.state". 3640 // 3641 // It returns ok=false if there is no such property. 3642 func (this VideoDecoder) State() (ret CodecState, ok bool) { 3643 ok = js.True == bindings.GetVideoDecoderState( 3644 this.ref, js.Pointer(&ret), 3645 ) 3646 return 3647 } 3648 3649 // DecodeQueueSize returns the value of property "VideoDecoder.decodeQueueSize". 3650 // 3651 // It returns ok=false if there is no such property. 3652 func (this VideoDecoder) DecodeQueueSize() (ret uint32, ok bool) { 3653 ok = js.True == bindings.GetVideoDecoderDecodeQueueSize( 3654 this.ref, js.Pointer(&ret), 3655 ) 3656 return 3657 } 3658 3659 // HasFuncConfigure returns true if the method "VideoDecoder.configure" exists. 3660 func (this VideoDecoder) HasFuncConfigure() bool { 3661 return js.True == bindings.HasFuncVideoDecoderConfigure( 3662 this.ref, 3663 ) 3664 } 3665 3666 // FuncConfigure returns the method "VideoDecoder.configure". 3667 func (this VideoDecoder) FuncConfigure() (fn js.Func[func(config VideoDecoderConfig)]) { 3668 bindings.FuncVideoDecoderConfigure( 3669 this.ref, js.Pointer(&fn), 3670 ) 3671 return 3672 } 3673 3674 // Configure calls the method "VideoDecoder.configure". 3675 func (this VideoDecoder) Configure(config VideoDecoderConfig) (ret js.Void) { 3676 bindings.CallVideoDecoderConfigure( 3677 this.ref, js.Pointer(&ret), 3678 js.Pointer(&config), 3679 ) 3680 3681 return 3682 } 3683 3684 // TryConfigure calls the method "VideoDecoder.configure" 3685 // in a try/catch block and returns (_, err, ok = false) when it went through 3686 // the catch clause. 3687 func (this VideoDecoder) TryConfigure(config VideoDecoderConfig) (ret js.Void, exception js.Any, ok bool) { 3688 ok = js.True == bindings.TryVideoDecoderConfigure( 3689 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3690 js.Pointer(&config), 3691 ) 3692 3693 return 3694 } 3695 3696 // HasFuncDecode returns true if the method "VideoDecoder.decode" exists. 3697 func (this VideoDecoder) HasFuncDecode() bool { 3698 return js.True == bindings.HasFuncVideoDecoderDecode( 3699 this.ref, 3700 ) 3701 } 3702 3703 // FuncDecode returns the method "VideoDecoder.decode". 3704 func (this VideoDecoder) FuncDecode() (fn js.Func[func(chunk EncodedVideoChunk)]) { 3705 bindings.FuncVideoDecoderDecode( 3706 this.ref, js.Pointer(&fn), 3707 ) 3708 return 3709 } 3710 3711 // Decode calls the method "VideoDecoder.decode". 3712 func (this VideoDecoder) Decode(chunk EncodedVideoChunk) (ret js.Void) { 3713 bindings.CallVideoDecoderDecode( 3714 this.ref, js.Pointer(&ret), 3715 chunk.Ref(), 3716 ) 3717 3718 return 3719 } 3720 3721 // TryDecode calls the method "VideoDecoder.decode" 3722 // in a try/catch block and returns (_, err, ok = false) when it went through 3723 // the catch clause. 3724 func (this VideoDecoder) TryDecode(chunk EncodedVideoChunk) (ret js.Void, exception js.Any, ok bool) { 3725 ok = js.True == bindings.TryVideoDecoderDecode( 3726 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3727 chunk.Ref(), 3728 ) 3729 3730 return 3731 } 3732 3733 // HasFuncFlush returns true if the method "VideoDecoder.flush" exists. 3734 func (this VideoDecoder) HasFuncFlush() bool { 3735 return js.True == bindings.HasFuncVideoDecoderFlush( 3736 this.ref, 3737 ) 3738 } 3739 3740 // FuncFlush returns the method "VideoDecoder.flush". 3741 func (this VideoDecoder) FuncFlush() (fn js.Func[func() js.Promise[js.Void]]) { 3742 bindings.FuncVideoDecoderFlush( 3743 this.ref, js.Pointer(&fn), 3744 ) 3745 return 3746 } 3747 3748 // Flush calls the method "VideoDecoder.flush". 3749 func (this VideoDecoder) Flush() (ret js.Promise[js.Void]) { 3750 bindings.CallVideoDecoderFlush( 3751 this.ref, js.Pointer(&ret), 3752 ) 3753 3754 return 3755 } 3756 3757 // TryFlush calls the method "VideoDecoder.flush" 3758 // in a try/catch block and returns (_, err, ok = false) when it went through 3759 // the catch clause. 3760 func (this VideoDecoder) TryFlush() (ret js.Promise[js.Void], exception js.Any, ok bool) { 3761 ok = js.True == bindings.TryVideoDecoderFlush( 3762 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3763 ) 3764 3765 return 3766 } 3767 3768 // HasFuncReset returns true if the method "VideoDecoder.reset" exists. 3769 func (this VideoDecoder) HasFuncReset() bool { 3770 return js.True == bindings.HasFuncVideoDecoderReset( 3771 this.ref, 3772 ) 3773 } 3774 3775 // FuncReset returns the method "VideoDecoder.reset". 3776 func (this VideoDecoder) FuncReset() (fn js.Func[func()]) { 3777 bindings.FuncVideoDecoderReset( 3778 this.ref, js.Pointer(&fn), 3779 ) 3780 return 3781 } 3782 3783 // Reset calls the method "VideoDecoder.reset". 3784 func (this VideoDecoder) Reset() (ret js.Void) { 3785 bindings.CallVideoDecoderReset( 3786 this.ref, js.Pointer(&ret), 3787 ) 3788 3789 return 3790 } 3791 3792 // TryReset calls the method "VideoDecoder.reset" 3793 // in a try/catch block and returns (_, err, ok = false) when it went through 3794 // the catch clause. 3795 func (this VideoDecoder) TryReset() (ret js.Void, exception js.Any, ok bool) { 3796 ok = js.True == bindings.TryVideoDecoderReset( 3797 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3798 ) 3799 3800 return 3801 } 3802 3803 // HasFuncClose returns true if the method "VideoDecoder.close" exists. 3804 func (this VideoDecoder) HasFuncClose() bool { 3805 return js.True == bindings.HasFuncVideoDecoderClose( 3806 this.ref, 3807 ) 3808 } 3809 3810 // FuncClose returns the method "VideoDecoder.close". 3811 func (this VideoDecoder) FuncClose() (fn js.Func[func()]) { 3812 bindings.FuncVideoDecoderClose( 3813 this.ref, js.Pointer(&fn), 3814 ) 3815 return 3816 } 3817 3818 // Close calls the method "VideoDecoder.close". 3819 func (this VideoDecoder) Close() (ret js.Void) { 3820 bindings.CallVideoDecoderClose( 3821 this.ref, js.Pointer(&ret), 3822 ) 3823 3824 return 3825 } 3826 3827 // TryClose calls the method "VideoDecoder.close" 3828 // in a try/catch block and returns (_, err, ok = false) when it went through 3829 // the catch clause. 3830 func (this VideoDecoder) TryClose() (ret js.Void, exception js.Any, ok bool) { 3831 ok = js.True == bindings.TryVideoDecoderClose( 3832 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3833 ) 3834 3835 return 3836 } 3837 3838 // HasFuncIsConfigSupported returns true if the static method "VideoDecoder.isConfigSupported" exists. 3839 func (this VideoDecoder) HasFuncIsConfigSupported() bool { 3840 return js.True == bindings.HasFuncVideoDecoderIsConfigSupported( 3841 this.ref, 3842 ) 3843 } 3844 3845 // FuncIsConfigSupported returns the static method "VideoDecoder.isConfigSupported". 3846 func (this VideoDecoder) FuncIsConfigSupported() (fn js.Func[func(config VideoDecoderConfig) js.Promise[VideoDecoderSupport]]) { 3847 bindings.FuncVideoDecoderIsConfigSupported( 3848 this.ref, js.Pointer(&fn), 3849 ) 3850 return 3851 } 3852 3853 // IsConfigSupported calls the static method "VideoDecoder.isConfigSupported". 3854 func (this VideoDecoder) IsConfigSupported(config VideoDecoderConfig) (ret js.Promise[VideoDecoderSupport]) { 3855 bindings.CallVideoDecoderIsConfigSupported( 3856 this.ref, js.Pointer(&ret), 3857 js.Pointer(&config), 3858 ) 3859 3860 return 3861 } 3862 3863 // TryIsConfigSupported calls the static method "VideoDecoder.isConfigSupported" 3864 // in a try/catch block and returns (_, err, ok = false) when it went through 3865 // the catch clause. 3866 func (this VideoDecoder) TryIsConfigSupported(config VideoDecoderConfig) (ret js.Promise[VideoDecoderSupport], exception js.Any, ok bool) { 3867 ok = js.True == bindings.TryVideoDecoderIsConfigSupported( 3868 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3869 js.Pointer(&config), 3870 ) 3871 3872 return 3873 } 3874 3875 type VideoEncoderInit struct { 3876 // Output is "VideoEncoderInit.output" 3877 // 3878 // Required 3879 Output js.Func[func(chunk EncodedVideoChunk, metadata *EncodedVideoChunkMetadata)] 3880 // Error is "VideoEncoderInit.error" 3881 // 3882 // Required 3883 Error js.Func[func(err DOMException)] 3884 3885 FFI_USE bool 3886 } 3887 3888 // FromRef calls UpdateFrom and returns a VideoEncoderInit with all fields set. 3889 func (p VideoEncoderInit) FromRef(ref js.Ref) VideoEncoderInit { 3890 p.UpdateFrom(ref) 3891 return p 3892 } 3893 3894 // New creates a new VideoEncoderInit in the application heap. 3895 func (p VideoEncoderInit) New() js.Ref { 3896 return bindings.VideoEncoderInitJSLoad( 3897 js.Pointer(&p), js.True, 0, 3898 ) 3899 } 3900 3901 // UpdateFrom copies value of all fields of the heap object to p. 3902 func (p *VideoEncoderInit) UpdateFrom(ref js.Ref) { 3903 bindings.VideoEncoderInitJSStore( 3904 js.Pointer(p), ref, 3905 ) 3906 } 3907 3908 // Update writes all fields of the p to the heap object referenced by ref. 3909 func (p *VideoEncoderInit) Update(ref js.Ref) { 3910 bindings.VideoEncoderInitJSLoad( 3911 js.Pointer(p), js.False, ref, 3912 ) 3913 } 3914 3915 // FreeMembers frees fields with heap reference, if recursive is true 3916 // free all heap references reachable from p. 3917 func (p *VideoEncoderInit) FreeMembers(recursive bool) { 3918 js.Free( 3919 p.Output.Ref(), 3920 p.Error.Ref(), 3921 ) 3922 p.Output = p.Output.FromRef(js.Undefined) 3923 p.Error = p.Error.FromRef(js.Undefined) 3924 } 3925 3926 type VideoEncoderBitrateMode uint32 3927 3928 const ( 3929 _ VideoEncoderBitrateMode = iota 3930 3931 VideoEncoderBitrateMode_CONSTANT 3932 VideoEncoderBitrateMode_VARIABLE 3933 VideoEncoderBitrateMode_QUANTIZER 3934 ) 3935 3936 func (VideoEncoderBitrateMode) FromRef(str js.Ref) VideoEncoderBitrateMode { 3937 return VideoEncoderBitrateMode(bindings.ConstOfVideoEncoderBitrateMode(str)) 3938 } 3939 3940 func (x VideoEncoderBitrateMode) String() (string, bool) { 3941 switch x { 3942 case VideoEncoderBitrateMode_CONSTANT: 3943 return "constant", true 3944 case VideoEncoderBitrateMode_VARIABLE: 3945 return "variable", true 3946 case VideoEncoderBitrateMode_QUANTIZER: 3947 return "quantizer", true 3948 default: 3949 return "", false 3950 } 3951 } 3952 3953 type VideoEncoderConfig struct { 3954 // Codec is "VideoEncoderConfig.codec" 3955 // 3956 // Required 3957 Codec js.String 3958 // Width is "VideoEncoderConfig.width" 3959 // 3960 // Required 3961 Width uint32 3962 // Height is "VideoEncoderConfig.height" 3963 // 3964 // Required 3965 Height uint32 3966 // DisplayWidth is "VideoEncoderConfig.displayWidth" 3967 // 3968 // Optional 3969 // 3970 // NOTE: FFI_USE_DisplayWidth MUST be set to true to make this field effective. 3971 DisplayWidth uint32 3972 // DisplayHeight is "VideoEncoderConfig.displayHeight" 3973 // 3974 // Optional 3975 // 3976 // NOTE: FFI_USE_DisplayHeight MUST be set to true to make this field effective. 3977 DisplayHeight uint32 3978 // Bitrate is "VideoEncoderConfig.bitrate" 3979 // 3980 // Optional 3981 // 3982 // NOTE: FFI_USE_Bitrate MUST be set to true to make this field effective. 3983 Bitrate uint64 3984 // Framerate is "VideoEncoderConfig.framerate" 3985 // 3986 // Optional 3987 // 3988 // NOTE: FFI_USE_Framerate MUST be set to true to make this field effective. 3989 Framerate float64 3990 // HardwareAcceleration is "VideoEncoderConfig.hardwareAcceleration" 3991 // 3992 // Optional, defaults to "no-preference". 3993 HardwareAcceleration HardwareAcceleration 3994 // Alpha is "VideoEncoderConfig.alpha" 3995 // 3996 // Optional, defaults to "discard". 3997 Alpha AlphaOption 3998 // ScalabilityMode is "VideoEncoderConfig.scalabilityMode" 3999 // 4000 // Optional 4001 ScalabilityMode js.String 4002 // BitrateMode is "VideoEncoderConfig.bitrateMode" 4003 // 4004 // Optional, defaults to "variable". 4005 BitrateMode VideoEncoderBitrateMode 4006 // LatencyMode is "VideoEncoderConfig.latencyMode" 4007 // 4008 // Optional, defaults to "quality". 4009 LatencyMode LatencyMode 4010 // Hevc is "VideoEncoderConfig.hevc" 4011 // 4012 // Optional 4013 // 4014 // NOTE: Hevc.FFI_USE MUST be set to true to get Hevc used. 4015 Hevc HevcEncoderConfig 4016 // Avc is "VideoEncoderConfig.avc" 4017 // 4018 // Optional 4019 // 4020 // NOTE: Avc.FFI_USE MUST be set to true to get Avc used. 4021 Avc AvcEncoderConfig 4022 // Av1 is "VideoEncoderConfig.av1" 4023 // 4024 // Optional 4025 // 4026 // NOTE: Av1.FFI_USE MUST be set to true to get Av1 used. 4027 Av1 AV1EncoderConfig 4028 4029 FFI_USE_DisplayWidth bool // for DisplayWidth. 4030 FFI_USE_DisplayHeight bool // for DisplayHeight. 4031 FFI_USE_Bitrate bool // for Bitrate. 4032 FFI_USE_Framerate bool // for Framerate. 4033 4034 FFI_USE bool 4035 } 4036 4037 // FromRef calls UpdateFrom and returns a VideoEncoderConfig with all fields set. 4038 func (p VideoEncoderConfig) FromRef(ref js.Ref) VideoEncoderConfig { 4039 p.UpdateFrom(ref) 4040 return p 4041 } 4042 4043 // New creates a new VideoEncoderConfig in the application heap. 4044 func (p VideoEncoderConfig) New() js.Ref { 4045 return bindings.VideoEncoderConfigJSLoad( 4046 js.Pointer(&p), js.True, 0, 4047 ) 4048 } 4049 4050 // UpdateFrom copies value of all fields of the heap object to p. 4051 func (p *VideoEncoderConfig) UpdateFrom(ref js.Ref) { 4052 bindings.VideoEncoderConfigJSStore( 4053 js.Pointer(p), ref, 4054 ) 4055 } 4056 4057 // Update writes all fields of the p to the heap object referenced by ref. 4058 func (p *VideoEncoderConfig) Update(ref js.Ref) { 4059 bindings.VideoEncoderConfigJSLoad( 4060 js.Pointer(p), js.False, ref, 4061 ) 4062 } 4063 4064 // FreeMembers frees fields with heap reference, if recursive is true 4065 // free all heap references reachable from p. 4066 func (p *VideoEncoderConfig) FreeMembers(recursive bool) { 4067 js.Free( 4068 p.Codec.Ref(), 4069 p.ScalabilityMode.Ref(), 4070 ) 4071 p.Codec = p.Codec.FromRef(js.Undefined) 4072 p.ScalabilityMode = p.ScalabilityMode.FromRef(js.Undefined) 4073 if recursive { 4074 p.Hevc.FreeMembers(true) 4075 p.Avc.FreeMembers(true) 4076 p.Av1.FreeMembers(true) 4077 } 4078 } 4079 4080 type VideoEncoderEncodeOptionsForHevc struct { 4081 // Quantizer is "VideoEncoderEncodeOptionsForHevc.quantizer" 4082 // 4083 // Optional 4084 // 4085 // NOTE: FFI_USE_Quantizer MUST be set to true to make this field effective. 4086 Quantizer uint16 4087 4088 FFI_USE_Quantizer bool // for Quantizer. 4089 4090 FFI_USE bool 4091 } 4092 4093 // FromRef calls UpdateFrom and returns a VideoEncoderEncodeOptionsForHevc with all fields set. 4094 func (p VideoEncoderEncodeOptionsForHevc) FromRef(ref js.Ref) VideoEncoderEncodeOptionsForHevc { 4095 p.UpdateFrom(ref) 4096 return p 4097 } 4098 4099 // New creates a new VideoEncoderEncodeOptionsForHevc in the application heap. 4100 func (p VideoEncoderEncodeOptionsForHevc) New() js.Ref { 4101 return bindings.VideoEncoderEncodeOptionsForHevcJSLoad( 4102 js.Pointer(&p), js.True, 0, 4103 ) 4104 } 4105 4106 // UpdateFrom copies value of all fields of the heap object to p. 4107 func (p *VideoEncoderEncodeOptionsForHevc) UpdateFrom(ref js.Ref) { 4108 bindings.VideoEncoderEncodeOptionsForHevcJSStore( 4109 js.Pointer(p), ref, 4110 ) 4111 } 4112 4113 // Update writes all fields of the p to the heap object referenced by ref. 4114 func (p *VideoEncoderEncodeOptionsForHevc) Update(ref js.Ref) { 4115 bindings.VideoEncoderEncodeOptionsForHevcJSLoad( 4116 js.Pointer(p), js.False, ref, 4117 ) 4118 } 4119 4120 // FreeMembers frees fields with heap reference, if recursive is true 4121 // free all heap references reachable from p. 4122 func (p *VideoEncoderEncodeOptionsForHevc) FreeMembers(recursive bool) { 4123 } 4124 4125 type VideoEncoderEncodeOptionsForVp9 struct { 4126 // Quantizer is "VideoEncoderEncodeOptionsForVp9.quantizer" 4127 // 4128 // Optional 4129 // 4130 // NOTE: FFI_USE_Quantizer MUST be set to true to make this field effective. 4131 Quantizer uint16 4132 4133 FFI_USE_Quantizer bool // for Quantizer. 4134 4135 FFI_USE bool 4136 } 4137 4138 // FromRef calls UpdateFrom and returns a VideoEncoderEncodeOptionsForVp9 with all fields set. 4139 func (p VideoEncoderEncodeOptionsForVp9) FromRef(ref js.Ref) VideoEncoderEncodeOptionsForVp9 { 4140 p.UpdateFrom(ref) 4141 return p 4142 } 4143 4144 // New creates a new VideoEncoderEncodeOptionsForVp9 in the application heap. 4145 func (p VideoEncoderEncodeOptionsForVp9) New() js.Ref { 4146 return bindings.VideoEncoderEncodeOptionsForVp9JSLoad( 4147 js.Pointer(&p), js.True, 0, 4148 ) 4149 } 4150 4151 // UpdateFrom copies value of all fields of the heap object to p. 4152 func (p *VideoEncoderEncodeOptionsForVp9) UpdateFrom(ref js.Ref) { 4153 bindings.VideoEncoderEncodeOptionsForVp9JSStore( 4154 js.Pointer(p), ref, 4155 ) 4156 } 4157 4158 // Update writes all fields of the p to the heap object referenced by ref. 4159 func (p *VideoEncoderEncodeOptionsForVp9) Update(ref js.Ref) { 4160 bindings.VideoEncoderEncodeOptionsForVp9JSLoad( 4161 js.Pointer(p), js.False, ref, 4162 ) 4163 } 4164 4165 // FreeMembers frees fields with heap reference, if recursive is true 4166 // free all heap references reachable from p. 4167 func (p *VideoEncoderEncodeOptionsForVp9) FreeMembers(recursive bool) { 4168 }