github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis28_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/ffi/js" 8 "github.com/primecitizens/pcz/std/plat/js/web/bindings" 9 ) 10 11 type ServiceWorkerState uint32 12 13 const ( 14 _ ServiceWorkerState = iota 15 16 ServiceWorkerState_PARSED 17 ServiceWorkerState_INSTALLING 18 ServiceWorkerState_INSTALLED 19 ServiceWorkerState_ACTIVATING 20 ServiceWorkerState_ACTIVATED 21 ServiceWorkerState_REDUNDANT 22 ) 23 24 func (ServiceWorkerState) FromRef(str js.Ref) ServiceWorkerState { 25 return ServiceWorkerState(bindings.ConstOfServiceWorkerState(str)) 26 } 27 28 func (x ServiceWorkerState) String() (string, bool) { 29 switch x { 30 case ServiceWorkerState_PARSED: 31 return "parsed", true 32 case ServiceWorkerState_INSTALLING: 33 return "installing", true 34 case ServiceWorkerState_INSTALLED: 35 return "installed", true 36 case ServiceWorkerState_ACTIVATING: 37 return "activating", true 38 case ServiceWorkerState_ACTIVATED: 39 return "activated", true 40 case ServiceWorkerState_REDUNDANT: 41 return "redundant", true 42 default: 43 return "", false 44 } 45 } 46 47 type ServiceWorker struct { 48 EventTarget 49 } 50 51 func (this ServiceWorker) Once() ServiceWorker { 52 this.ref.Once() 53 return this 54 } 55 56 func (this ServiceWorker) Ref() js.Ref { 57 return this.EventTarget.Ref() 58 } 59 60 func (this ServiceWorker) FromRef(ref js.Ref) ServiceWorker { 61 this.EventTarget = this.EventTarget.FromRef(ref) 62 return this 63 } 64 65 func (this ServiceWorker) Free() { 66 this.ref.Free() 67 } 68 69 // ScriptURL returns the value of property "ServiceWorker.scriptURL". 70 // 71 // It returns ok=false if there is no such property. 72 func (this ServiceWorker) ScriptURL() (ret js.String, ok bool) { 73 ok = js.True == bindings.GetServiceWorkerScriptURL( 74 this.ref, js.Pointer(&ret), 75 ) 76 return 77 } 78 79 // State returns the value of property "ServiceWorker.state". 80 // 81 // It returns ok=false if there is no such property. 82 func (this ServiceWorker) State() (ret ServiceWorkerState, ok bool) { 83 ok = js.True == bindings.GetServiceWorkerState( 84 this.ref, js.Pointer(&ret), 85 ) 86 return 87 } 88 89 // HasFuncPostMessage returns true if the method "ServiceWorker.postMessage" exists. 90 func (this ServiceWorker) HasFuncPostMessage() bool { 91 return js.True == bindings.HasFuncServiceWorkerPostMessage( 92 this.ref, 93 ) 94 } 95 96 // FuncPostMessage returns the method "ServiceWorker.postMessage". 97 func (this ServiceWorker) FuncPostMessage() (fn js.Func[func(message js.Any, transfer js.Array[js.Object])]) { 98 bindings.FuncServiceWorkerPostMessage( 99 this.ref, js.Pointer(&fn), 100 ) 101 return 102 } 103 104 // PostMessage calls the method "ServiceWorker.postMessage". 105 func (this ServiceWorker) PostMessage(message js.Any, transfer js.Array[js.Object]) (ret js.Void) { 106 bindings.CallServiceWorkerPostMessage( 107 this.ref, js.Pointer(&ret), 108 message.Ref(), 109 transfer.Ref(), 110 ) 111 112 return 113 } 114 115 // TryPostMessage calls the method "ServiceWorker.postMessage" 116 // in a try/catch block and returns (_, err, ok = false) when it went through 117 // the catch clause. 118 func (this ServiceWorker) TryPostMessage(message js.Any, transfer js.Array[js.Object]) (ret js.Void, exception js.Any, ok bool) { 119 ok = js.True == bindings.TryServiceWorkerPostMessage( 120 this.ref, js.Pointer(&ret), js.Pointer(&exception), 121 message.Ref(), 122 transfer.Ref(), 123 ) 124 125 return 126 } 127 128 // HasFuncPostMessage1 returns true if the method "ServiceWorker.postMessage" exists. 129 func (this ServiceWorker) HasFuncPostMessage1() bool { 130 return js.True == bindings.HasFuncServiceWorkerPostMessage1( 131 this.ref, 132 ) 133 } 134 135 // FuncPostMessage1 returns the method "ServiceWorker.postMessage". 136 func (this ServiceWorker) FuncPostMessage1() (fn js.Func[func(message js.Any, options StructuredSerializeOptions)]) { 137 bindings.FuncServiceWorkerPostMessage1( 138 this.ref, js.Pointer(&fn), 139 ) 140 return 141 } 142 143 // PostMessage1 calls the method "ServiceWorker.postMessage". 144 func (this ServiceWorker) PostMessage1(message js.Any, options StructuredSerializeOptions) (ret js.Void) { 145 bindings.CallServiceWorkerPostMessage1( 146 this.ref, js.Pointer(&ret), 147 message.Ref(), 148 js.Pointer(&options), 149 ) 150 151 return 152 } 153 154 // TryPostMessage1 calls the method "ServiceWorker.postMessage" 155 // in a try/catch block and returns (_, err, ok = false) when it went through 156 // the catch clause. 157 func (this ServiceWorker) TryPostMessage1(message js.Any, options StructuredSerializeOptions) (ret js.Void, exception js.Any, ok bool) { 158 ok = js.True == bindings.TryServiceWorkerPostMessage1( 159 this.ref, js.Pointer(&ret), js.Pointer(&exception), 160 message.Ref(), 161 js.Pointer(&options), 162 ) 163 164 return 165 } 166 167 // HasFuncPostMessage2 returns true if the method "ServiceWorker.postMessage" exists. 168 func (this ServiceWorker) HasFuncPostMessage2() bool { 169 return js.True == bindings.HasFuncServiceWorkerPostMessage2( 170 this.ref, 171 ) 172 } 173 174 // FuncPostMessage2 returns the method "ServiceWorker.postMessage". 175 func (this ServiceWorker) FuncPostMessage2() (fn js.Func[func(message js.Any)]) { 176 bindings.FuncServiceWorkerPostMessage2( 177 this.ref, js.Pointer(&fn), 178 ) 179 return 180 } 181 182 // PostMessage2 calls the method "ServiceWorker.postMessage". 183 func (this ServiceWorker) PostMessage2(message js.Any) (ret js.Void) { 184 bindings.CallServiceWorkerPostMessage2( 185 this.ref, js.Pointer(&ret), 186 message.Ref(), 187 ) 188 189 return 190 } 191 192 // TryPostMessage2 calls the method "ServiceWorker.postMessage" 193 // in a try/catch block and returns (_, err, ok = false) when it went through 194 // the catch clause. 195 func (this ServiceWorker) TryPostMessage2(message js.Any) (ret js.Void, exception js.Any, ok bool) { 196 ok = js.True == bindings.TryServiceWorkerPostMessage2( 197 this.ref, js.Pointer(&ret), js.Pointer(&exception), 198 message.Ref(), 199 ) 200 201 return 202 } 203 204 type NavigationPreloadState struct { 205 // Enabled is "NavigationPreloadState.enabled" 206 // 207 // Optional, defaults to false. 208 // 209 // NOTE: FFI_USE_Enabled MUST be set to true to make this field effective. 210 Enabled bool 211 // HeaderValue is "NavigationPreloadState.headerValue" 212 // 213 // Optional 214 HeaderValue js.String 215 216 FFI_USE_Enabled bool // for Enabled. 217 218 FFI_USE bool 219 } 220 221 // FromRef calls UpdateFrom and returns a NavigationPreloadState with all fields set. 222 func (p NavigationPreloadState) FromRef(ref js.Ref) NavigationPreloadState { 223 p.UpdateFrom(ref) 224 return p 225 } 226 227 // New creates a new NavigationPreloadState in the application heap. 228 func (p NavigationPreloadState) New() js.Ref { 229 return bindings.NavigationPreloadStateJSLoad( 230 js.Pointer(&p), js.True, 0, 231 ) 232 } 233 234 // UpdateFrom copies value of all fields of the heap object to p. 235 func (p *NavigationPreloadState) UpdateFrom(ref js.Ref) { 236 bindings.NavigationPreloadStateJSStore( 237 js.Pointer(p), ref, 238 ) 239 } 240 241 // Update writes all fields of the p to the heap object referenced by ref. 242 func (p *NavigationPreloadState) Update(ref js.Ref) { 243 bindings.NavigationPreloadStateJSLoad( 244 js.Pointer(p), js.False, ref, 245 ) 246 } 247 248 // FreeMembers frees fields with heap reference, if recursive is true 249 // free all heap references reachable from p. 250 func (p *NavigationPreloadState) FreeMembers(recursive bool) { 251 js.Free( 252 p.HeaderValue.Ref(), 253 ) 254 p.HeaderValue = p.HeaderValue.FromRef(js.Undefined) 255 } 256 257 type NavigationPreloadManager struct { 258 ref js.Ref 259 } 260 261 func (this NavigationPreloadManager) Once() NavigationPreloadManager { 262 this.ref.Once() 263 return this 264 } 265 266 func (this NavigationPreloadManager) Ref() js.Ref { 267 return this.ref 268 } 269 270 func (this NavigationPreloadManager) FromRef(ref js.Ref) NavigationPreloadManager { 271 this.ref = ref 272 return this 273 } 274 275 func (this NavigationPreloadManager) Free() { 276 this.ref.Free() 277 } 278 279 // HasFuncEnable returns true if the method "NavigationPreloadManager.enable" exists. 280 func (this NavigationPreloadManager) HasFuncEnable() bool { 281 return js.True == bindings.HasFuncNavigationPreloadManagerEnable( 282 this.ref, 283 ) 284 } 285 286 // FuncEnable returns the method "NavigationPreloadManager.enable". 287 func (this NavigationPreloadManager) FuncEnable() (fn js.Func[func() js.Promise[js.Void]]) { 288 bindings.FuncNavigationPreloadManagerEnable( 289 this.ref, js.Pointer(&fn), 290 ) 291 return 292 } 293 294 // Enable calls the method "NavigationPreloadManager.enable". 295 func (this NavigationPreloadManager) Enable() (ret js.Promise[js.Void]) { 296 bindings.CallNavigationPreloadManagerEnable( 297 this.ref, js.Pointer(&ret), 298 ) 299 300 return 301 } 302 303 // TryEnable calls the method "NavigationPreloadManager.enable" 304 // in a try/catch block and returns (_, err, ok = false) when it went through 305 // the catch clause. 306 func (this NavigationPreloadManager) TryEnable() (ret js.Promise[js.Void], exception js.Any, ok bool) { 307 ok = js.True == bindings.TryNavigationPreloadManagerEnable( 308 this.ref, js.Pointer(&ret), js.Pointer(&exception), 309 ) 310 311 return 312 } 313 314 // HasFuncDisable returns true if the method "NavigationPreloadManager.disable" exists. 315 func (this NavigationPreloadManager) HasFuncDisable() bool { 316 return js.True == bindings.HasFuncNavigationPreloadManagerDisable( 317 this.ref, 318 ) 319 } 320 321 // FuncDisable returns the method "NavigationPreloadManager.disable". 322 func (this NavigationPreloadManager) FuncDisable() (fn js.Func[func() js.Promise[js.Void]]) { 323 bindings.FuncNavigationPreloadManagerDisable( 324 this.ref, js.Pointer(&fn), 325 ) 326 return 327 } 328 329 // Disable calls the method "NavigationPreloadManager.disable". 330 func (this NavigationPreloadManager) Disable() (ret js.Promise[js.Void]) { 331 bindings.CallNavigationPreloadManagerDisable( 332 this.ref, js.Pointer(&ret), 333 ) 334 335 return 336 } 337 338 // TryDisable calls the method "NavigationPreloadManager.disable" 339 // in a try/catch block and returns (_, err, ok = false) when it went through 340 // the catch clause. 341 func (this NavigationPreloadManager) TryDisable() (ret js.Promise[js.Void], exception js.Any, ok bool) { 342 ok = js.True == bindings.TryNavigationPreloadManagerDisable( 343 this.ref, js.Pointer(&ret), js.Pointer(&exception), 344 ) 345 346 return 347 } 348 349 // HasFuncSetHeaderValue returns true if the method "NavigationPreloadManager.setHeaderValue" exists. 350 func (this NavigationPreloadManager) HasFuncSetHeaderValue() bool { 351 return js.True == bindings.HasFuncNavigationPreloadManagerSetHeaderValue( 352 this.ref, 353 ) 354 } 355 356 // FuncSetHeaderValue returns the method "NavigationPreloadManager.setHeaderValue". 357 func (this NavigationPreloadManager) FuncSetHeaderValue() (fn js.Func[func(value js.String) js.Promise[js.Void]]) { 358 bindings.FuncNavigationPreloadManagerSetHeaderValue( 359 this.ref, js.Pointer(&fn), 360 ) 361 return 362 } 363 364 // SetHeaderValue calls the method "NavigationPreloadManager.setHeaderValue". 365 func (this NavigationPreloadManager) SetHeaderValue(value js.String) (ret js.Promise[js.Void]) { 366 bindings.CallNavigationPreloadManagerSetHeaderValue( 367 this.ref, js.Pointer(&ret), 368 value.Ref(), 369 ) 370 371 return 372 } 373 374 // TrySetHeaderValue calls the method "NavigationPreloadManager.setHeaderValue" 375 // in a try/catch block and returns (_, err, ok = false) when it went through 376 // the catch clause. 377 func (this NavigationPreloadManager) TrySetHeaderValue(value js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 378 ok = js.True == bindings.TryNavigationPreloadManagerSetHeaderValue( 379 this.ref, js.Pointer(&ret), js.Pointer(&exception), 380 value.Ref(), 381 ) 382 383 return 384 } 385 386 // HasFuncGetState returns true if the method "NavigationPreloadManager.getState" exists. 387 func (this NavigationPreloadManager) HasFuncGetState() bool { 388 return js.True == bindings.HasFuncNavigationPreloadManagerGetState( 389 this.ref, 390 ) 391 } 392 393 // FuncGetState returns the method "NavigationPreloadManager.getState". 394 func (this NavigationPreloadManager) FuncGetState() (fn js.Func[func() js.Promise[NavigationPreloadState]]) { 395 bindings.FuncNavigationPreloadManagerGetState( 396 this.ref, js.Pointer(&fn), 397 ) 398 return 399 } 400 401 // GetState calls the method "NavigationPreloadManager.getState". 402 func (this NavigationPreloadManager) GetState() (ret js.Promise[NavigationPreloadState]) { 403 bindings.CallNavigationPreloadManagerGetState( 404 this.ref, js.Pointer(&ret), 405 ) 406 407 return 408 } 409 410 // TryGetState calls the method "NavigationPreloadManager.getState" 411 // in a try/catch block and returns (_, err, ok = false) when it went through 412 // the catch clause. 413 func (this NavigationPreloadManager) TryGetState() (ret js.Promise[NavigationPreloadState], exception js.Any, ok bool) { 414 ok = js.True == bindings.TryNavigationPreloadManagerGetState( 415 this.ref, js.Pointer(&ret), js.Pointer(&exception), 416 ) 417 418 return 419 } 420 421 type ServiceWorkerUpdateViaCache uint32 422 423 const ( 424 _ ServiceWorkerUpdateViaCache = iota 425 426 ServiceWorkerUpdateViaCache_IMPORTS 427 ServiceWorkerUpdateViaCache_ALL 428 ServiceWorkerUpdateViaCache_NONE 429 ) 430 431 func (ServiceWorkerUpdateViaCache) FromRef(str js.Ref) ServiceWorkerUpdateViaCache { 432 return ServiceWorkerUpdateViaCache(bindings.ConstOfServiceWorkerUpdateViaCache(str)) 433 } 434 435 func (x ServiceWorkerUpdateViaCache) String() (string, bool) { 436 switch x { 437 case ServiceWorkerUpdateViaCache_IMPORTS: 438 return "imports", true 439 case ServiceWorkerUpdateViaCache_ALL: 440 return "all", true 441 case ServiceWorkerUpdateViaCache_NONE: 442 return "none", true 443 default: 444 return "", false 445 } 446 } 447 448 type SyncManager struct { 449 ref js.Ref 450 } 451 452 func (this SyncManager) Once() SyncManager { 453 this.ref.Once() 454 return this 455 } 456 457 func (this SyncManager) Ref() js.Ref { 458 return this.ref 459 } 460 461 func (this SyncManager) FromRef(ref js.Ref) SyncManager { 462 this.ref = ref 463 return this 464 } 465 466 func (this SyncManager) Free() { 467 this.ref.Free() 468 } 469 470 // HasFuncRegister returns true if the method "SyncManager.register" exists. 471 func (this SyncManager) HasFuncRegister() bool { 472 return js.True == bindings.HasFuncSyncManagerRegister( 473 this.ref, 474 ) 475 } 476 477 // FuncRegister returns the method "SyncManager.register". 478 func (this SyncManager) FuncRegister() (fn js.Func[func(tag js.String) js.Promise[js.Void]]) { 479 bindings.FuncSyncManagerRegister( 480 this.ref, js.Pointer(&fn), 481 ) 482 return 483 } 484 485 // Register calls the method "SyncManager.register". 486 func (this SyncManager) Register(tag js.String) (ret js.Promise[js.Void]) { 487 bindings.CallSyncManagerRegister( 488 this.ref, js.Pointer(&ret), 489 tag.Ref(), 490 ) 491 492 return 493 } 494 495 // TryRegister calls the method "SyncManager.register" 496 // in a try/catch block and returns (_, err, ok = false) when it went through 497 // the catch clause. 498 func (this SyncManager) TryRegister(tag js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 499 ok = js.True == bindings.TrySyncManagerRegister( 500 this.ref, js.Pointer(&ret), js.Pointer(&exception), 501 tag.Ref(), 502 ) 503 504 return 505 } 506 507 // HasFuncGetTags returns true if the method "SyncManager.getTags" exists. 508 func (this SyncManager) HasFuncGetTags() bool { 509 return js.True == bindings.HasFuncSyncManagerGetTags( 510 this.ref, 511 ) 512 } 513 514 // FuncGetTags returns the method "SyncManager.getTags". 515 func (this SyncManager) FuncGetTags() (fn js.Func[func() js.Promise[js.Array[js.String]]]) { 516 bindings.FuncSyncManagerGetTags( 517 this.ref, js.Pointer(&fn), 518 ) 519 return 520 } 521 522 // GetTags calls the method "SyncManager.getTags". 523 func (this SyncManager) GetTags() (ret js.Promise[js.Array[js.String]]) { 524 bindings.CallSyncManagerGetTags( 525 this.ref, js.Pointer(&ret), 526 ) 527 528 return 529 } 530 531 // TryGetTags calls the method "SyncManager.getTags" 532 // in a try/catch block and returns (_, err, ok = false) when it went through 533 // the catch clause. 534 func (this SyncManager) TryGetTags() (ret js.Promise[js.Array[js.String]], exception js.Any, ok bool) { 535 ok = js.True == bindings.TrySyncManagerGetTags( 536 this.ref, js.Pointer(&ret), js.Pointer(&exception), 537 ) 538 539 return 540 } 541 542 type PushEncryptionKeyName uint32 543 544 const ( 545 _ PushEncryptionKeyName = iota 546 547 PushEncryptionKeyName_P_256DH 548 PushEncryptionKeyName_AUTH 549 ) 550 551 func (PushEncryptionKeyName) FromRef(str js.Ref) PushEncryptionKeyName { 552 return PushEncryptionKeyName(bindings.ConstOfPushEncryptionKeyName(str)) 553 } 554 555 func (x PushEncryptionKeyName) String() (string, bool) { 556 switch x { 557 case PushEncryptionKeyName_P_256DH: 558 return "p256dh", true 559 case PushEncryptionKeyName_AUTH: 560 return "auth", true 561 default: 562 return "", false 563 } 564 } 565 566 type PushSubscriptionJSON struct { 567 // Endpoint is "PushSubscriptionJSON.endpoint" 568 // 569 // Optional 570 Endpoint js.String 571 // ExpirationTime is "PushSubscriptionJSON.expirationTime" 572 // 573 // Optional, defaults to null. 574 // 575 // NOTE: FFI_USE_ExpirationTime MUST be set to true to make this field effective. 576 ExpirationTime EpochTimeStamp 577 // Keys is "PushSubscriptionJSON.keys" 578 // 579 // Optional 580 Keys js.Record[js.String] 581 582 FFI_USE_ExpirationTime bool // for ExpirationTime. 583 584 FFI_USE bool 585 } 586 587 // FromRef calls UpdateFrom and returns a PushSubscriptionJSON with all fields set. 588 func (p PushSubscriptionJSON) FromRef(ref js.Ref) PushSubscriptionJSON { 589 p.UpdateFrom(ref) 590 return p 591 } 592 593 // New creates a new PushSubscriptionJSON in the application heap. 594 func (p PushSubscriptionJSON) New() js.Ref { 595 return bindings.PushSubscriptionJSONJSLoad( 596 js.Pointer(&p), js.True, 0, 597 ) 598 } 599 600 // UpdateFrom copies value of all fields of the heap object to p. 601 func (p *PushSubscriptionJSON) UpdateFrom(ref js.Ref) { 602 bindings.PushSubscriptionJSONJSStore( 603 js.Pointer(p), ref, 604 ) 605 } 606 607 // Update writes all fields of the p to the heap object referenced by ref. 608 func (p *PushSubscriptionJSON) Update(ref js.Ref) { 609 bindings.PushSubscriptionJSONJSLoad( 610 js.Pointer(p), js.False, ref, 611 ) 612 } 613 614 // FreeMembers frees fields with heap reference, if recursive is true 615 // free all heap references reachable from p. 616 func (p *PushSubscriptionJSON) FreeMembers(recursive bool) { 617 js.Free( 618 p.Endpoint.Ref(), 619 p.Keys.Ref(), 620 ) 621 p.Endpoint = p.Endpoint.FromRef(js.Undefined) 622 p.Keys = p.Keys.FromRef(js.Undefined) 623 } 624 625 type PushSubscriptionOptions struct { 626 ref js.Ref 627 } 628 629 func (this PushSubscriptionOptions) Once() PushSubscriptionOptions { 630 this.ref.Once() 631 return this 632 } 633 634 func (this PushSubscriptionOptions) Ref() js.Ref { 635 return this.ref 636 } 637 638 func (this PushSubscriptionOptions) FromRef(ref js.Ref) PushSubscriptionOptions { 639 this.ref = ref 640 return this 641 } 642 643 func (this PushSubscriptionOptions) Free() { 644 this.ref.Free() 645 } 646 647 // UserVisibleOnly returns the value of property "PushSubscriptionOptions.userVisibleOnly". 648 // 649 // It returns ok=false if there is no such property. 650 func (this PushSubscriptionOptions) UserVisibleOnly() (ret bool, ok bool) { 651 ok = js.True == bindings.GetPushSubscriptionOptionsUserVisibleOnly( 652 this.ref, js.Pointer(&ret), 653 ) 654 return 655 } 656 657 // ApplicationServerKey returns the value of property "PushSubscriptionOptions.applicationServerKey". 658 // 659 // It returns ok=false if there is no such property. 660 func (this PushSubscriptionOptions) ApplicationServerKey() (ret js.ArrayBuffer, ok bool) { 661 ok = js.True == bindings.GetPushSubscriptionOptionsApplicationServerKey( 662 this.ref, js.Pointer(&ret), 663 ) 664 return 665 } 666 667 type PushSubscription struct { 668 ref js.Ref 669 } 670 671 func (this PushSubscription) Once() PushSubscription { 672 this.ref.Once() 673 return this 674 } 675 676 func (this PushSubscription) Ref() js.Ref { 677 return this.ref 678 } 679 680 func (this PushSubscription) FromRef(ref js.Ref) PushSubscription { 681 this.ref = ref 682 return this 683 } 684 685 func (this PushSubscription) Free() { 686 this.ref.Free() 687 } 688 689 // Endpoint returns the value of property "PushSubscription.endpoint". 690 // 691 // It returns ok=false if there is no such property. 692 func (this PushSubscription) Endpoint() (ret js.String, ok bool) { 693 ok = js.True == bindings.GetPushSubscriptionEndpoint( 694 this.ref, js.Pointer(&ret), 695 ) 696 return 697 } 698 699 // ExpirationTime returns the value of property "PushSubscription.expirationTime". 700 // 701 // It returns ok=false if there is no such property. 702 func (this PushSubscription) ExpirationTime() (ret EpochTimeStamp, ok bool) { 703 ok = js.True == bindings.GetPushSubscriptionExpirationTime( 704 this.ref, js.Pointer(&ret), 705 ) 706 return 707 } 708 709 // Options returns the value of property "PushSubscription.options". 710 // 711 // It returns ok=false if there is no such property. 712 func (this PushSubscription) Options() (ret PushSubscriptionOptions, ok bool) { 713 ok = js.True == bindings.GetPushSubscriptionOptions( 714 this.ref, js.Pointer(&ret), 715 ) 716 return 717 } 718 719 // HasFuncGetKey returns true if the method "PushSubscription.getKey" exists. 720 func (this PushSubscription) HasFuncGetKey() bool { 721 return js.True == bindings.HasFuncPushSubscriptionGetKey( 722 this.ref, 723 ) 724 } 725 726 // FuncGetKey returns the method "PushSubscription.getKey". 727 func (this PushSubscription) FuncGetKey() (fn js.Func[func(name PushEncryptionKeyName) js.ArrayBuffer]) { 728 bindings.FuncPushSubscriptionGetKey( 729 this.ref, js.Pointer(&fn), 730 ) 731 return 732 } 733 734 // GetKey calls the method "PushSubscription.getKey". 735 func (this PushSubscription) GetKey(name PushEncryptionKeyName) (ret js.ArrayBuffer) { 736 bindings.CallPushSubscriptionGetKey( 737 this.ref, js.Pointer(&ret), 738 uint32(name), 739 ) 740 741 return 742 } 743 744 // TryGetKey calls the method "PushSubscription.getKey" 745 // in a try/catch block and returns (_, err, ok = false) when it went through 746 // the catch clause. 747 func (this PushSubscription) TryGetKey(name PushEncryptionKeyName) (ret js.ArrayBuffer, exception js.Any, ok bool) { 748 ok = js.True == bindings.TryPushSubscriptionGetKey( 749 this.ref, js.Pointer(&ret), js.Pointer(&exception), 750 uint32(name), 751 ) 752 753 return 754 } 755 756 // HasFuncUnsubscribe returns true if the method "PushSubscription.unsubscribe" exists. 757 func (this PushSubscription) HasFuncUnsubscribe() bool { 758 return js.True == bindings.HasFuncPushSubscriptionUnsubscribe( 759 this.ref, 760 ) 761 } 762 763 // FuncUnsubscribe returns the method "PushSubscription.unsubscribe". 764 func (this PushSubscription) FuncUnsubscribe() (fn js.Func[func() js.Promise[js.Boolean]]) { 765 bindings.FuncPushSubscriptionUnsubscribe( 766 this.ref, js.Pointer(&fn), 767 ) 768 return 769 } 770 771 // Unsubscribe calls the method "PushSubscription.unsubscribe". 772 func (this PushSubscription) Unsubscribe() (ret js.Promise[js.Boolean]) { 773 bindings.CallPushSubscriptionUnsubscribe( 774 this.ref, js.Pointer(&ret), 775 ) 776 777 return 778 } 779 780 // TryUnsubscribe calls the method "PushSubscription.unsubscribe" 781 // in a try/catch block and returns (_, err, ok = false) when it went through 782 // the catch clause. 783 func (this PushSubscription) TryUnsubscribe() (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 784 ok = js.True == bindings.TryPushSubscriptionUnsubscribe( 785 this.ref, js.Pointer(&ret), js.Pointer(&exception), 786 ) 787 788 return 789 } 790 791 // HasFuncToJSON returns true if the method "PushSubscription.toJSON" exists. 792 func (this PushSubscription) HasFuncToJSON() bool { 793 return js.True == bindings.HasFuncPushSubscriptionToJSON( 794 this.ref, 795 ) 796 } 797 798 // FuncToJSON returns the method "PushSubscription.toJSON". 799 func (this PushSubscription) FuncToJSON() (fn js.Func[func() PushSubscriptionJSON]) { 800 bindings.FuncPushSubscriptionToJSON( 801 this.ref, js.Pointer(&fn), 802 ) 803 return 804 } 805 806 // ToJSON calls the method "PushSubscription.toJSON". 807 func (this PushSubscription) ToJSON() (ret PushSubscriptionJSON) { 808 bindings.CallPushSubscriptionToJSON( 809 this.ref, js.Pointer(&ret), 810 ) 811 812 return 813 } 814 815 // TryToJSON calls the method "PushSubscription.toJSON" 816 // in a try/catch block and returns (_, err, ok = false) when it went through 817 // the catch clause. 818 func (this PushSubscription) TryToJSON() (ret PushSubscriptionJSON, exception js.Any, ok bool) { 819 ok = js.True == bindings.TryPushSubscriptionToJSON( 820 this.ref, js.Pointer(&ret), js.Pointer(&exception), 821 ) 822 823 return 824 } 825 826 type OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String struct { 827 ref js.Ref 828 } 829 830 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) Ref() js.Ref { 831 return x.ref 832 } 833 834 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) Free() { 835 x.ref.Free() 836 } 837 838 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) FromRef(ref js.Ref) OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String { 839 return OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String{ 840 ref: ref, 841 } 842 } 843 844 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayInt8() js.TypedArray[int8] { 845 return js.TypedArray[int8]{}.FromRef(x.ref) 846 } 847 848 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayInt16() js.TypedArray[int16] { 849 return js.TypedArray[int16]{}.FromRef(x.ref) 850 } 851 852 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayInt32() js.TypedArray[int32] { 853 return js.TypedArray[int32]{}.FromRef(x.ref) 854 } 855 856 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayUint8() js.TypedArray[uint8] { 857 return js.TypedArray[uint8]{}.FromRef(x.ref) 858 } 859 860 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayUint16() js.TypedArray[uint16] { 861 return js.TypedArray[uint16]{}.FromRef(x.ref) 862 } 863 864 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayUint32() js.TypedArray[uint32] { 865 return js.TypedArray[uint32]{}.FromRef(x.ref) 866 } 867 868 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayInt64() js.TypedArray[int64] { 869 return js.TypedArray[int64]{}.FromRef(x.ref) 870 } 871 872 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayUint64() js.TypedArray[uint64] { 873 return js.TypedArray[uint64]{}.FromRef(x.ref) 874 } 875 876 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayFloat32() js.TypedArray[float32] { 877 return js.TypedArray[float32]{}.FromRef(x.ref) 878 } 879 880 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) TypedArrayFloat64() js.TypedArray[float64] { 881 return js.TypedArray[float64]{}.FromRef(x.ref) 882 } 883 884 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) DataView() js.DataView { 885 return js.DataView{}.FromRef(x.ref) 886 } 887 888 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) ArrayBuffer() js.ArrayBuffer { 889 return js.ArrayBuffer{}.FromRef(x.ref) 890 } 891 892 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String) String() js.String { 893 return js.String{}.FromRef(x.ref) 894 } 895 896 type PushSubscriptionOptionsInit struct { 897 // UserVisibleOnly is "PushSubscriptionOptionsInit.userVisibleOnly" 898 // 899 // Optional, defaults to false. 900 // 901 // NOTE: FFI_USE_UserVisibleOnly MUST be set to true to make this field effective. 902 UserVisibleOnly bool 903 // ApplicationServerKey is "PushSubscriptionOptionsInit.applicationServerKey" 904 // 905 // Optional, defaults to null. 906 ApplicationServerKey OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_String 907 908 FFI_USE_UserVisibleOnly bool // for UserVisibleOnly. 909 910 FFI_USE bool 911 } 912 913 // FromRef calls UpdateFrom and returns a PushSubscriptionOptionsInit with all fields set. 914 func (p PushSubscriptionOptionsInit) FromRef(ref js.Ref) PushSubscriptionOptionsInit { 915 p.UpdateFrom(ref) 916 return p 917 } 918 919 // New creates a new PushSubscriptionOptionsInit in the application heap. 920 func (p PushSubscriptionOptionsInit) New() js.Ref { 921 return bindings.PushSubscriptionOptionsInitJSLoad( 922 js.Pointer(&p), js.True, 0, 923 ) 924 } 925 926 // UpdateFrom copies value of all fields of the heap object to p. 927 func (p *PushSubscriptionOptionsInit) UpdateFrom(ref js.Ref) { 928 bindings.PushSubscriptionOptionsInitJSStore( 929 js.Pointer(p), ref, 930 ) 931 } 932 933 // Update writes all fields of the p to the heap object referenced by ref. 934 func (p *PushSubscriptionOptionsInit) Update(ref js.Ref) { 935 bindings.PushSubscriptionOptionsInitJSLoad( 936 js.Pointer(p), js.False, ref, 937 ) 938 } 939 940 // FreeMembers frees fields with heap reference, if recursive is true 941 // free all heap references reachable from p. 942 func (p *PushSubscriptionOptionsInit) FreeMembers(recursive bool) { 943 js.Free( 944 p.ApplicationServerKey.Ref(), 945 ) 946 p.ApplicationServerKey = p.ApplicationServerKey.FromRef(js.Undefined) 947 } 948 949 type PushManager struct { 950 ref js.Ref 951 } 952 953 func (this PushManager) Once() PushManager { 954 this.ref.Once() 955 return this 956 } 957 958 func (this PushManager) Ref() js.Ref { 959 return this.ref 960 } 961 962 func (this PushManager) FromRef(ref js.Ref) PushManager { 963 this.ref = ref 964 return this 965 } 966 967 func (this PushManager) Free() { 968 this.ref.Free() 969 } 970 971 // SupportedContentEncodings returns the value of property "PushManager.supportedContentEncodings". 972 // 973 // It returns ok=false if there is no such property. 974 func (this PushManager) SupportedContentEncodings() (ret js.FrozenArray[js.String], ok bool) { 975 ok = js.True == bindings.GetPushManagerSupportedContentEncodings( 976 this.ref, js.Pointer(&ret), 977 ) 978 return 979 } 980 981 // HasFuncSubscribe returns true if the method "PushManager.subscribe" exists. 982 func (this PushManager) HasFuncSubscribe() bool { 983 return js.True == bindings.HasFuncPushManagerSubscribe( 984 this.ref, 985 ) 986 } 987 988 // FuncSubscribe returns the method "PushManager.subscribe". 989 func (this PushManager) FuncSubscribe() (fn js.Func[func(options PushSubscriptionOptionsInit) js.Promise[PushSubscription]]) { 990 bindings.FuncPushManagerSubscribe( 991 this.ref, js.Pointer(&fn), 992 ) 993 return 994 } 995 996 // Subscribe calls the method "PushManager.subscribe". 997 func (this PushManager) Subscribe(options PushSubscriptionOptionsInit) (ret js.Promise[PushSubscription]) { 998 bindings.CallPushManagerSubscribe( 999 this.ref, js.Pointer(&ret), 1000 js.Pointer(&options), 1001 ) 1002 1003 return 1004 } 1005 1006 // TrySubscribe calls the method "PushManager.subscribe" 1007 // in a try/catch block and returns (_, err, ok = false) when it went through 1008 // the catch clause. 1009 func (this PushManager) TrySubscribe(options PushSubscriptionOptionsInit) (ret js.Promise[PushSubscription], exception js.Any, ok bool) { 1010 ok = js.True == bindings.TryPushManagerSubscribe( 1011 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1012 js.Pointer(&options), 1013 ) 1014 1015 return 1016 } 1017 1018 // HasFuncSubscribe1 returns true if the method "PushManager.subscribe" exists. 1019 func (this PushManager) HasFuncSubscribe1() bool { 1020 return js.True == bindings.HasFuncPushManagerSubscribe1( 1021 this.ref, 1022 ) 1023 } 1024 1025 // FuncSubscribe1 returns the method "PushManager.subscribe". 1026 func (this PushManager) FuncSubscribe1() (fn js.Func[func() js.Promise[PushSubscription]]) { 1027 bindings.FuncPushManagerSubscribe1( 1028 this.ref, js.Pointer(&fn), 1029 ) 1030 return 1031 } 1032 1033 // Subscribe1 calls the method "PushManager.subscribe". 1034 func (this PushManager) Subscribe1() (ret js.Promise[PushSubscription]) { 1035 bindings.CallPushManagerSubscribe1( 1036 this.ref, js.Pointer(&ret), 1037 ) 1038 1039 return 1040 } 1041 1042 // TrySubscribe1 calls the method "PushManager.subscribe" 1043 // in a try/catch block and returns (_, err, ok = false) when it went through 1044 // the catch clause. 1045 func (this PushManager) TrySubscribe1() (ret js.Promise[PushSubscription], exception js.Any, ok bool) { 1046 ok = js.True == bindings.TryPushManagerSubscribe1( 1047 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1048 ) 1049 1050 return 1051 } 1052 1053 // HasFuncGetSubscription returns true if the method "PushManager.getSubscription" exists. 1054 func (this PushManager) HasFuncGetSubscription() bool { 1055 return js.True == bindings.HasFuncPushManagerGetSubscription( 1056 this.ref, 1057 ) 1058 } 1059 1060 // FuncGetSubscription returns the method "PushManager.getSubscription". 1061 func (this PushManager) FuncGetSubscription() (fn js.Func[func() js.Promise[PushSubscription]]) { 1062 bindings.FuncPushManagerGetSubscription( 1063 this.ref, js.Pointer(&fn), 1064 ) 1065 return 1066 } 1067 1068 // GetSubscription calls the method "PushManager.getSubscription". 1069 func (this PushManager) GetSubscription() (ret js.Promise[PushSubscription]) { 1070 bindings.CallPushManagerGetSubscription( 1071 this.ref, js.Pointer(&ret), 1072 ) 1073 1074 return 1075 } 1076 1077 // TryGetSubscription calls the method "PushManager.getSubscription" 1078 // in a try/catch block and returns (_, err, ok = false) when it went through 1079 // the catch clause. 1080 func (this PushManager) TryGetSubscription() (ret js.Promise[PushSubscription], exception js.Any, ok bool) { 1081 ok = js.True == bindings.TryPushManagerGetSubscription( 1082 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1083 ) 1084 1085 return 1086 } 1087 1088 // HasFuncPermissionState returns true if the method "PushManager.permissionState" exists. 1089 func (this PushManager) HasFuncPermissionState() bool { 1090 return js.True == bindings.HasFuncPushManagerPermissionState( 1091 this.ref, 1092 ) 1093 } 1094 1095 // FuncPermissionState returns the method "PushManager.permissionState". 1096 func (this PushManager) FuncPermissionState() (fn js.Func[func(options PushSubscriptionOptionsInit) js.Promise[PermissionState]]) { 1097 bindings.FuncPushManagerPermissionState( 1098 this.ref, js.Pointer(&fn), 1099 ) 1100 return 1101 } 1102 1103 // PermissionState calls the method "PushManager.permissionState". 1104 func (this PushManager) PermissionState(options PushSubscriptionOptionsInit) (ret js.Promise[PermissionState]) { 1105 bindings.CallPushManagerPermissionState( 1106 this.ref, js.Pointer(&ret), 1107 js.Pointer(&options), 1108 ) 1109 1110 return 1111 } 1112 1113 // TryPermissionState calls the method "PushManager.permissionState" 1114 // in a try/catch block and returns (_, err, ok = false) when it went through 1115 // the catch clause. 1116 func (this PushManager) TryPermissionState(options PushSubscriptionOptionsInit) (ret js.Promise[PermissionState], exception js.Any, ok bool) { 1117 ok = js.True == bindings.TryPushManagerPermissionState( 1118 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1119 js.Pointer(&options), 1120 ) 1121 1122 return 1123 } 1124 1125 // HasFuncPermissionState1 returns true if the method "PushManager.permissionState" exists. 1126 func (this PushManager) HasFuncPermissionState1() bool { 1127 return js.True == bindings.HasFuncPushManagerPermissionState1( 1128 this.ref, 1129 ) 1130 } 1131 1132 // FuncPermissionState1 returns the method "PushManager.permissionState". 1133 func (this PushManager) FuncPermissionState1() (fn js.Func[func() js.Promise[PermissionState]]) { 1134 bindings.FuncPushManagerPermissionState1( 1135 this.ref, js.Pointer(&fn), 1136 ) 1137 return 1138 } 1139 1140 // PermissionState1 calls the method "PushManager.permissionState". 1141 func (this PushManager) PermissionState1() (ret js.Promise[PermissionState]) { 1142 bindings.CallPushManagerPermissionState1( 1143 this.ref, js.Pointer(&ret), 1144 ) 1145 1146 return 1147 } 1148 1149 // TryPermissionState1 calls the method "PushManager.permissionState" 1150 // in a try/catch block and returns (_, err, ok = false) when it went through 1151 // the catch clause. 1152 func (this PushManager) TryPermissionState1() (ret js.Promise[PermissionState], exception js.Any, ok bool) { 1153 ok = js.True == bindings.TryPushManagerPermissionState1( 1154 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1155 ) 1156 1157 return 1158 } 1159 1160 type PaymentDelegation uint32 1161 1162 const ( 1163 _ PaymentDelegation = iota 1164 1165 PaymentDelegation_SHIPPING_ADDRESS 1166 PaymentDelegation_PAYER_NAME 1167 PaymentDelegation_PAYER_PHONE 1168 PaymentDelegation_PAYER_EMAIL 1169 ) 1170 1171 func (PaymentDelegation) FromRef(str js.Ref) PaymentDelegation { 1172 return PaymentDelegation(bindings.ConstOfPaymentDelegation(str)) 1173 } 1174 1175 func (x PaymentDelegation) String() (string, bool) { 1176 switch x { 1177 case PaymentDelegation_SHIPPING_ADDRESS: 1178 return "shippingAddress", true 1179 case PaymentDelegation_PAYER_NAME: 1180 return "payerName", true 1181 case PaymentDelegation_PAYER_PHONE: 1182 return "payerPhone", true 1183 case PaymentDelegation_PAYER_EMAIL: 1184 return "payerEmail", true 1185 default: 1186 return "", false 1187 } 1188 } 1189 1190 type PaymentManager struct { 1191 ref js.Ref 1192 } 1193 1194 func (this PaymentManager) Once() PaymentManager { 1195 this.ref.Once() 1196 return this 1197 } 1198 1199 func (this PaymentManager) Ref() js.Ref { 1200 return this.ref 1201 } 1202 1203 func (this PaymentManager) FromRef(ref js.Ref) PaymentManager { 1204 this.ref = ref 1205 return this 1206 } 1207 1208 func (this PaymentManager) Free() { 1209 this.ref.Free() 1210 } 1211 1212 // UserHint returns the value of property "PaymentManager.userHint". 1213 // 1214 // It returns ok=false if there is no such property. 1215 func (this PaymentManager) UserHint() (ret js.String, ok bool) { 1216 ok = js.True == bindings.GetPaymentManagerUserHint( 1217 this.ref, js.Pointer(&ret), 1218 ) 1219 return 1220 } 1221 1222 // SetUserHint sets the value of property "PaymentManager.userHint" to val. 1223 // 1224 // It returns false if the property cannot be set. 1225 func (this PaymentManager) SetUserHint(val js.String) bool { 1226 return js.True == bindings.SetPaymentManagerUserHint( 1227 this.ref, 1228 val.Ref(), 1229 ) 1230 } 1231 1232 // HasFuncEnableDelegations returns true if the method "PaymentManager.enableDelegations" exists. 1233 func (this PaymentManager) HasFuncEnableDelegations() bool { 1234 return js.True == bindings.HasFuncPaymentManagerEnableDelegations( 1235 this.ref, 1236 ) 1237 } 1238 1239 // FuncEnableDelegations returns the method "PaymentManager.enableDelegations". 1240 func (this PaymentManager) FuncEnableDelegations() (fn js.Func[func(delegations js.Array[PaymentDelegation]) js.Promise[js.Void]]) { 1241 bindings.FuncPaymentManagerEnableDelegations( 1242 this.ref, js.Pointer(&fn), 1243 ) 1244 return 1245 } 1246 1247 // EnableDelegations calls the method "PaymentManager.enableDelegations". 1248 func (this PaymentManager) EnableDelegations(delegations js.Array[PaymentDelegation]) (ret js.Promise[js.Void]) { 1249 bindings.CallPaymentManagerEnableDelegations( 1250 this.ref, js.Pointer(&ret), 1251 delegations.Ref(), 1252 ) 1253 1254 return 1255 } 1256 1257 // TryEnableDelegations calls the method "PaymentManager.enableDelegations" 1258 // in a try/catch block and returns (_, err, ok = false) when it went through 1259 // the catch clause. 1260 func (this PaymentManager) TryEnableDelegations(delegations js.Array[PaymentDelegation]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1261 ok = js.True == bindings.TryPaymentManagerEnableDelegations( 1262 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1263 delegations.Ref(), 1264 ) 1265 1266 return 1267 } 1268 1269 type PeriodicSyncManager struct { 1270 ref js.Ref 1271 } 1272 1273 func (this PeriodicSyncManager) Once() PeriodicSyncManager { 1274 this.ref.Once() 1275 return this 1276 } 1277 1278 func (this PeriodicSyncManager) Ref() js.Ref { 1279 return this.ref 1280 } 1281 1282 func (this PeriodicSyncManager) FromRef(ref js.Ref) PeriodicSyncManager { 1283 this.ref = ref 1284 return this 1285 } 1286 1287 func (this PeriodicSyncManager) Free() { 1288 this.ref.Free() 1289 } 1290 1291 // HasFuncRegister returns true if the method "PeriodicSyncManager.register" exists. 1292 func (this PeriodicSyncManager) HasFuncRegister() bool { 1293 return js.True == bindings.HasFuncPeriodicSyncManagerRegister( 1294 this.ref, 1295 ) 1296 } 1297 1298 // FuncRegister returns the method "PeriodicSyncManager.register". 1299 func (this PeriodicSyncManager) FuncRegister() (fn js.Func[func(tag js.String, options BackgroundSyncOptions) js.Promise[js.Void]]) { 1300 bindings.FuncPeriodicSyncManagerRegister( 1301 this.ref, js.Pointer(&fn), 1302 ) 1303 return 1304 } 1305 1306 // Register calls the method "PeriodicSyncManager.register". 1307 func (this PeriodicSyncManager) Register(tag js.String, options BackgroundSyncOptions) (ret js.Promise[js.Void]) { 1308 bindings.CallPeriodicSyncManagerRegister( 1309 this.ref, js.Pointer(&ret), 1310 tag.Ref(), 1311 js.Pointer(&options), 1312 ) 1313 1314 return 1315 } 1316 1317 // TryRegister calls the method "PeriodicSyncManager.register" 1318 // in a try/catch block and returns (_, err, ok = false) when it went through 1319 // the catch clause. 1320 func (this PeriodicSyncManager) TryRegister(tag js.String, options BackgroundSyncOptions) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1321 ok = js.True == bindings.TryPeriodicSyncManagerRegister( 1322 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1323 tag.Ref(), 1324 js.Pointer(&options), 1325 ) 1326 1327 return 1328 } 1329 1330 // HasFuncRegister1 returns true if the method "PeriodicSyncManager.register" exists. 1331 func (this PeriodicSyncManager) HasFuncRegister1() bool { 1332 return js.True == bindings.HasFuncPeriodicSyncManagerRegister1( 1333 this.ref, 1334 ) 1335 } 1336 1337 // FuncRegister1 returns the method "PeriodicSyncManager.register". 1338 func (this PeriodicSyncManager) FuncRegister1() (fn js.Func[func(tag js.String) js.Promise[js.Void]]) { 1339 bindings.FuncPeriodicSyncManagerRegister1( 1340 this.ref, js.Pointer(&fn), 1341 ) 1342 return 1343 } 1344 1345 // Register1 calls the method "PeriodicSyncManager.register". 1346 func (this PeriodicSyncManager) Register1(tag js.String) (ret js.Promise[js.Void]) { 1347 bindings.CallPeriodicSyncManagerRegister1( 1348 this.ref, js.Pointer(&ret), 1349 tag.Ref(), 1350 ) 1351 1352 return 1353 } 1354 1355 // TryRegister1 calls the method "PeriodicSyncManager.register" 1356 // in a try/catch block and returns (_, err, ok = false) when it went through 1357 // the catch clause. 1358 func (this PeriodicSyncManager) TryRegister1(tag js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1359 ok = js.True == bindings.TryPeriodicSyncManagerRegister1( 1360 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1361 tag.Ref(), 1362 ) 1363 1364 return 1365 } 1366 1367 // HasFuncGetTags returns true if the method "PeriodicSyncManager.getTags" exists. 1368 func (this PeriodicSyncManager) HasFuncGetTags() bool { 1369 return js.True == bindings.HasFuncPeriodicSyncManagerGetTags( 1370 this.ref, 1371 ) 1372 } 1373 1374 // FuncGetTags returns the method "PeriodicSyncManager.getTags". 1375 func (this PeriodicSyncManager) FuncGetTags() (fn js.Func[func() js.Promise[js.Array[js.String]]]) { 1376 bindings.FuncPeriodicSyncManagerGetTags( 1377 this.ref, js.Pointer(&fn), 1378 ) 1379 return 1380 } 1381 1382 // GetTags calls the method "PeriodicSyncManager.getTags". 1383 func (this PeriodicSyncManager) GetTags() (ret js.Promise[js.Array[js.String]]) { 1384 bindings.CallPeriodicSyncManagerGetTags( 1385 this.ref, js.Pointer(&ret), 1386 ) 1387 1388 return 1389 } 1390 1391 // TryGetTags calls the method "PeriodicSyncManager.getTags" 1392 // in a try/catch block and returns (_, err, ok = false) when it went through 1393 // the catch clause. 1394 func (this PeriodicSyncManager) TryGetTags() (ret js.Promise[js.Array[js.String]], exception js.Any, ok bool) { 1395 ok = js.True == bindings.TryPeriodicSyncManagerGetTags( 1396 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1397 ) 1398 1399 return 1400 } 1401 1402 // HasFuncUnregister returns true if the method "PeriodicSyncManager.unregister" exists. 1403 func (this PeriodicSyncManager) HasFuncUnregister() bool { 1404 return js.True == bindings.HasFuncPeriodicSyncManagerUnregister( 1405 this.ref, 1406 ) 1407 } 1408 1409 // FuncUnregister returns the method "PeriodicSyncManager.unregister". 1410 func (this PeriodicSyncManager) FuncUnregister() (fn js.Func[func(tag js.String) js.Promise[js.Void]]) { 1411 bindings.FuncPeriodicSyncManagerUnregister( 1412 this.ref, js.Pointer(&fn), 1413 ) 1414 return 1415 } 1416 1417 // Unregister calls the method "PeriodicSyncManager.unregister". 1418 func (this PeriodicSyncManager) Unregister(tag js.String) (ret js.Promise[js.Void]) { 1419 bindings.CallPeriodicSyncManagerUnregister( 1420 this.ref, js.Pointer(&ret), 1421 tag.Ref(), 1422 ) 1423 1424 return 1425 } 1426 1427 // TryUnregister calls the method "PeriodicSyncManager.unregister" 1428 // in a try/catch block and returns (_, err, ok = false) when it went through 1429 // the catch clause. 1430 func (this PeriodicSyncManager) TryUnregister(tag js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1431 ok = js.True == bindings.TryPeriodicSyncManagerUnregister( 1432 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1433 tag.Ref(), 1434 ) 1435 1436 return 1437 } 1438 1439 type CookieStoreGetOptions struct { 1440 // Name is "CookieStoreGetOptions.name" 1441 // 1442 // Optional 1443 Name js.String 1444 // Url is "CookieStoreGetOptions.url" 1445 // 1446 // Optional 1447 Url js.String 1448 1449 FFI_USE bool 1450 } 1451 1452 // FromRef calls UpdateFrom and returns a CookieStoreGetOptions with all fields set. 1453 func (p CookieStoreGetOptions) FromRef(ref js.Ref) CookieStoreGetOptions { 1454 p.UpdateFrom(ref) 1455 return p 1456 } 1457 1458 // New creates a new CookieStoreGetOptions in the application heap. 1459 func (p CookieStoreGetOptions) New() js.Ref { 1460 return bindings.CookieStoreGetOptionsJSLoad( 1461 js.Pointer(&p), js.True, 0, 1462 ) 1463 } 1464 1465 // UpdateFrom copies value of all fields of the heap object to p. 1466 func (p *CookieStoreGetOptions) UpdateFrom(ref js.Ref) { 1467 bindings.CookieStoreGetOptionsJSStore( 1468 js.Pointer(p), ref, 1469 ) 1470 } 1471 1472 // Update writes all fields of the p to the heap object referenced by ref. 1473 func (p *CookieStoreGetOptions) Update(ref js.Ref) { 1474 bindings.CookieStoreGetOptionsJSLoad( 1475 js.Pointer(p), js.False, ref, 1476 ) 1477 } 1478 1479 // FreeMembers frees fields with heap reference, if recursive is true 1480 // free all heap references reachable from p. 1481 func (p *CookieStoreGetOptions) FreeMembers(recursive bool) { 1482 js.Free( 1483 p.Name.Ref(), 1484 p.Url.Ref(), 1485 ) 1486 p.Name = p.Name.FromRef(js.Undefined) 1487 p.Url = p.Url.FromRef(js.Undefined) 1488 } 1489 1490 type CookieStoreManager struct { 1491 ref js.Ref 1492 } 1493 1494 func (this CookieStoreManager) Once() CookieStoreManager { 1495 this.ref.Once() 1496 return this 1497 } 1498 1499 func (this CookieStoreManager) Ref() js.Ref { 1500 return this.ref 1501 } 1502 1503 func (this CookieStoreManager) FromRef(ref js.Ref) CookieStoreManager { 1504 this.ref = ref 1505 return this 1506 } 1507 1508 func (this CookieStoreManager) Free() { 1509 this.ref.Free() 1510 } 1511 1512 // HasFuncSubscribe returns true if the method "CookieStoreManager.subscribe" exists. 1513 func (this CookieStoreManager) HasFuncSubscribe() bool { 1514 return js.True == bindings.HasFuncCookieStoreManagerSubscribe( 1515 this.ref, 1516 ) 1517 } 1518 1519 // FuncSubscribe returns the method "CookieStoreManager.subscribe". 1520 func (this CookieStoreManager) FuncSubscribe() (fn js.Func[func(subscriptions js.Array[CookieStoreGetOptions]) js.Promise[js.Void]]) { 1521 bindings.FuncCookieStoreManagerSubscribe( 1522 this.ref, js.Pointer(&fn), 1523 ) 1524 return 1525 } 1526 1527 // Subscribe calls the method "CookieStoreManager.subscribe". 1528 func (this CookieStoreManager) Subscribe(subscriptions js.Array[CookieStoreGetOptions]) (ret js.Promise[js.Void]) { 1529 bindings.CallCookieStoreManagerSubscribe( 1530 this.ref, js.Pointer(&ret), 1531 subscriptions.Ref(), 1532 ) 1533 1534 return 1535 } 1536 1537 // TrySubscribe calls the method "CookieStoreManager.subscribe" 1538 // in a try/catch block and returns (_, err, ok = false) when it went through 1539 // the catch clause. 1540 func (this CookieStoreManager) TrySubscribe(subscriptions js.Array[CookieStoreGetOptions]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1541 ok = js.True == bindings.TryCookieStoreManagerSubscribe( 1542 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1543 subscriptions.Ref(), 1544 ) 1545 1546 return 1547 } 1548 1549 // HasFuncGetSubscriptions returns true if the method "CookieStoreManager.getSubscriptions" exists. 1550 func (this CookieStoreManager) HasFuncGetSubscriptions() bool { 1551 return js.True == bindings.HasFuncCookieStoreManagerGetSubscriptions( 1552 this.ref, 1553 ) 1554 } 1555 1556 // FuncGetSubscriptions returns the method "CookieStoreManager.getSubscriptions". 1557 func (this CookieStoreManager) FuncGetSubscriptions() (fn js.Func[func() js.Promise[js.Array[CookieStoreGetOptions]]]) { 1558 bindings.FuncCookieStoreManagerGetSubscriptions( 1559 this.ref, js.Pointer(&fn), 1560 ) 1561 return 1562 } 1563 1564 // GetSubscriptions calls the method "CookieStoreManager.getSubscriptions". 1565 func (this CookieStoreManager) GetSubscriptions() (ret js.Promise[js.Array[CookieStoreGetOptions]]) { 1566 bindings.CallCookieStoreManagerGetSubscriptions( 1567 this.ref, js.Pointer(&ret), 1568 ) 1569 1570 return 1571 } 1572 1573 // TryGetSubscriptions calls the method "CookieStoreManager.getSubscriptions" 1574 // in a try/catch block and returns (_, err, ok = false) when it went through 1575 // the catch clause. 1576 func (this CookieStoreManager) TryGetSubscriptions() (ret js.Promise[js.Array[CookieStoreGetOptions]], exception js.Any, ok bool) { 1577 ok = js.True == bindings.TryCookieStoreManagerGetSubscriptions( 1578 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1579 ) 1580 1581 return 1582 } 1583 1584 // HasFuncUnsubscribe returns true if the method "CookieStoreManager.unsubscribe" exists. 1585 func (this CookieStoreManager) HasFuncUnsubscribe() bool { 1586 return js.True == bindings.HasFuncCookieStoreManagerUnsubscribe( 1587 this.ref, 1588 ) 1589 } 1590 1591 // FuncUnsubscribe returns the method "CookieStoreManager.unsubscribe". 1592 func (this CookieStoreManager) FuncUnsubscribe() (fn js.Func[func(subscriptions js.Array[CookieStoreGetOptions]) js.Promise[js.Void]]) { 1593 bindings.FuncCookieStoreManagerUnsubscribe( 1594 this.ref, js.Pointer(&fn), 1595 ) 1596 return 1597 } 1598 1599 // Unsubscribe calls the method "CookieStoreManager.unsubscribe". 1600 func (this CookieStoreManager) Unsubscribe(subscriptions js.Array[CookieStoreGetOptions]) (ret js.Promise[js.Void]) { 1601 bindings.CallCookieStoreManagerUnsubscribe( 1602 this.ref, js.Pointer(&ret), 1603 subscriptions.Ref(), 1604 ) 1605 1606 return 1607 } 1608 1609 // TryUnsubscribe calls the method "CookieStoreManager.unsubscribe" 1610 // in a try/catch block and returns (_, err, ok = false) when it went through 1611 // the catch clause. 1612 func (this CookieStoreManager) TryUnsubscribe(subscriptions js.Array[CookieStoreGetOptions]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1613 ok = js.True == bindings.TryCookieStoreManagerUnsubscribe( 1614 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1615 subscriptions.Ref(), 1616 ) 1617 1618 return 1619 } 1620 1621 type ContentCategory uint32 1622 1623 const ( 1624 _ ContentCategory = iota 1625 1626 ContentCategory_ 1627 ContentCategory_HOMEPAGE 1628 ContentCategory_ARTICLE 1629 ContentCategory_VIDEO 1630 ContentCategory_AUDIO 1631 ) 1632 1633 func (ContentCategory) FromRef(str js.Ref) ContentCategory { 1634 return ContentCategory(bindings.ConstOfContentCategory(str)) 1635 } 1636 1637 func (x ContentCategory) String() (string, bool) { 1638 switch x { 1639 case ContentCategory_: 1640 return "", true 1641 case ContentCategory_HOMEPAGE: 1642 return "homepage", true 1643 case ContentCategory_ARTICLE: 1644 return "article", true 1645 case ContentCategory_VIDEO: 1646 return "video", true 1647 case ContentCategory_AUDIO: 1648 return "audio", true 1649 default: 1650 return "", false 1651 } 1652 } 1653 1654 type ContentDescription struct { 1655 // Id is "ContentDescription.id" 1656 // 1657 // Required 1658 Id js.String 1659 // Title is "ContentDescription.title" 1660 // 1661 // Required 1662 Title js.String 1663 // Description is "ContentDescription.description" 1664 // 1665 // Required 1666 Description js.String 1667 // Category is "ContentDescription.category" 1668 // 1669 // Optional, defaults to "". 1670 Category ContentCategory 1671 // Icons is "ContentDescription.icons" 1672 // 1673 // Optional, defaults to []. 1674 Icons js.Array[ImageResource] 1675 // Url is "ContentDescription.url" 1676 // 1677 // Required 1678 Url js.String 1679 1680 FFI_USE bool 1681 } 1682 1683 // FromRef calls UpdateFrom and returns a ContentDescription with all fields set. 1684 func (p ContentDescription) FromRef(ref js.Ref) ContentDescription { 1685 p.UpdateFrom(ref) 1686 return p 1687 } 1688 1689 // New creates a new ContentDescription in the application heap. 1690 func (p ContentDescription) New() js.Ref { 1691 return bindings.ContentDescriptionJSLoad( 1692 js.Pointer(&p), js.True, 0, 1693 ) 1694 } 1695 1696 // UpdateFrom copies value of all fields of the heap object to p. 1697 func (p *ContentDescription) UpdateFrom(ref js.Ref) { 1698 bindings.ContentDescriptionJSStore( 1699 js.Pointer(p), ref, 1700 ) 1701 } 1702 1703 // Update writes all fields of the p to the heap object referenced by ref. 1704 func (p *ContentDescription) Update(ref js.Ref) { 1705 bindings.ContentDescriptionJSLoad( 1706 js.Pointer(p), js.False, ref, 1707 ) 1708 } 1709 1710 // FreeMembers frees fields with heap reference, if recursive is true 1711 // free all heap references reachable from p. 1712 func (p *ContentDescription) FreeMembers(recursive bool) { 1713 js.Free( 1714 p.Id.Ref(), 1715 p.Title.Ref(), 1716 p.Description.Ref(), 1717 p.Icons.Ref(), 1718 p.Url.Ref(), 1719 ) 1720 p.Id = p.Id.FromRef(js.Undefined) 1721 p.Title = p.Title.FromRef(js.Undefined) 1722 p.Description = p.Description.FromRef(js.Undefined) 1723 p.Icons = p.Icons.FromRef(js.Undefined) 1724 p.Url = p.Url.FromRef(js.Undefined) 1725 } 1726 1727 type ContentIndex struct { 1728 ref js.Ref 1729 } 1730 1731 func (this ContentIndex) Once() ContentIndex { 1732 this.ref.Once() 1733 return this 1734 } 1735 1736 func (this ContentIndex) Ref() js.Ref { 1737 return this.ref 1738 } 1739 1740 func (this ContentIndex) FromRef(ref js.Ref) ContentIndex { 1741 this.ref = ref 1742 return this 1743 } 1744 1745 func (this ContentIndex) Free() { 1746 this.ref.Free() 1747 } 1748 1749 // HasFuncAdd returns true if the method "ContentIndex.add" exists. 1750 func (this ContentIndex) HasFuncAdd() bool { 1751 return js.True == bindings.HasFuncContentIndexAdd( 1752 this.ref, 1753 ) 1754 } 1755 1756 // FuncAdd returns the method "ContentIndex.add". 1757 func (this ContentIndex) FuncAdd() (fn js.Func[func(description ContentDescription) js.Promise[js.Void]]) { 1758 bindings.FuncContentIndexAdd( 1759 this.ref, js.Pointer(&fn), 1760 ) 1761 return 1762 } 1763 1764 // Add calls the method "ContentIndex.add". 1765 func (this ContentIndex) Add(description ContentDescription) (ret js.Promise[js.Void]) { 1766 bindings.CallContentIndexAdd( 1767 this.ref, js.Pointer(&ret), 1768 js.Pointer(&description), 1769 ) 1770 1771 return 1772 } 1773 1774 // TryAdd calls the method "ContentIndex.add" 1775 // in a try/catch block and returns (_, err, ok = false) when it went through 1776 // the catch clause. 1777 func (this ContentIndex) TryAdd(description ContentDescription) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1778 ok = js.True == bindings.TryContentIndexAdd( 1779 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1780 js.Pointer(&description), 1781 ) 1782 1783 return 1784 } 1785 1786 // HasFuncDelete returns true if the method "ContentIndex.delete" exists. 1787 func (this ContentIndex) HasFuncDelete() bool { 1788 return js.True == bindings.HasFuncContentIndexDelete( 1789 this.ref, 1790 ) 1791 } 1792 1793 // FuncDelete returns the method "ContentIndex.delete". 1794 func (this ContentIndex) FuncDelete() (fn js.Func[func(id js.String) js.Promise[js.Void]]) { 1795 bindings.FuncContentIndexDelete( 1796 this.ref, js.Pointer(&fn), 1797 ) 1798 return 1799 } 1800 1801 // Delete calls the method "ContentIndex.delete". 1802 func (this ContentIndex) Delete(id js.String) (ret js.Promise[js.Void]) { 1803 bindings.CallContentIndexDelete( 1804 this.ref, js.Pointer(&ret), 1805 id.Ref(), 1806 ) 1807 1808 return 1809 } 1810 1811 // TryDelete calls the method "ContentIndex.delete" 1812 // in a try/catch block and returns (_, err, ok = false) when it went through 1813 // the catch clause. 1814 func (this ContentIndex) TryDelete(id js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1815 ok = js.True == bindings.TryContentIndexDelete( 1816 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1817 id.Ref(), 1818 ) 1819 1820 return 1821 } 1822 1823 // HasFuncGetAll returns true if the method "ContentIndex.getAll" exists. 1824 func (this ContentIndex) HasFuncGetAll() bool { 1825 return js.True == bindings.HasFuncContentIndexGetAll( 1826 this.ref, 1827 ) 1828 } 1829 1830 // FuncGetAll returns the method "ContentIndex.getAll". 1831 func (this ContentIndex) FuncGetAll() (fn js.Func[func() js.Promise[js.Array[ContentDescription]]]) { 1832 bindings.FuncContentIndexGetAll( 1833 this.ref, js.Pointer(&fn), 1834 ) 1835 return 1836 } 1837 1838 // GetAll calls the method "ContentIndex.getAll". 1839 func (this ContentIndex) GetAll() (ret js.Promise[js.Array[ContentDescription]]) { 1840 bindings.CallContentIndexGetAll( 1841 this.ref, js.Pointer(&ret), 1842 ) 1843 1844 return 1845 } 1846 1847 // TryGetAll calls the method "ContentIndex.getAll" 1848 // in a try/catch block and returns (_, err, ok = false) when it went through 1849 // the catch clause. 1850 func (this ContentIndex) TryGetAll() (ret js.Promise[js.Array[ContentDescription]], exception js.Any, ok bool) { 1851 ok = js.True == bindings.TryContentIndexGetAll( 1852 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1853 ) 1854 1855 return 1856 } 1857 1858 type ServiceWorkerRegistration struct { 1859 EventTarget 1860 } 1861 1862 func (this ServiceWorkerRegistration) Once() ServiceWorkerRegistration { 1863 this.ref.Once() 1864 return this 1865 } 1866 1867 func (this ServiceWorkerRegistration) Ref() js.Ref { 1868 return this.EventTarget.Ref() 1869 } 1870 1871 func (this ServiceWorkerRegistration) FromRef(ref js.Ref) ServiceWorkerRegistration { 1872 this.EventTarget = this.EventTarget.FromRef(ref) 1873 return this 1874 } 1875 1876 func (this ServiceWorkerRegistration) Free() { 1877 this.ref.Free() 1878 } 1879 1880 // Installing returns the value of property "ServiceWorkerRegistration.installing". 1881 // 1882 // It returns ok=false if there is no such property. 1883 func (this ServiceWorkerRegistration) Installing() (ret ServiceWorker, ok bool) { 1884 ok = js.True == bindings.GetServiceWorkerRegistrationInstalling( 1885 this.ref, js.Pointer(&ret), 1886 ) 1887 return 1888 } 1889 1890 // Waiting returns the value of property "ServiceWorkerRegistration.waiting". 1891 // 1892 // It returns ok=false if there is no such property. 1893 func (this ServiceWorkerRegistration) Waiting() (ret ServiceWorker, ok bool) { 1894 ok = js.True == bindings.GetServiceWorkerRegistrationWaiting( 1895 this.ref, js.Pointer(&ret), 1896 ) 1897 return 1898 } 1899 1900 // Active returns the value of property "ServiceWorkerRegistration.active". 1901 // 1902 // It returns ok=false if there is no such property. 1903 func (this ServiceWorkerRegistration) Active() (ret ServiceWorker, ok bool) { 1904 ok = js.True == bindings.GetServiceWorkerRegistrationActive( 1905 this.ref, js.Pointer(&ret), 1906 ) 1907 return 1908 } 1909 1910 // NavigationPreload returns the value of property "ServiceWorkerRegistration.navigationPreload". 1911 // 1912 // It returns ok=false if there is no such property. 1913 func (this ServiceWorkerRegistration) NavigationPreload() (ret NavigationPreloadManager, ok bool) { 1914 ok = js.True == bindings.GetServiceWorkerRegistrationNavigationPreload( 1915 this.ref, js.Pointer(&ret), 1916 ) 1917 return 1918 } 1919 1920 // Scope returns the value of property "ServiceWorkerRegistration.scope". 1921 // 1922 // It returns ok=false if there is no such property. 1923 func (this ServiceWorkerRegistration) Scope() (ret js.String, ok bool) { 1924 ok = js.True == bindings.GetServiceWorkerRegistrationScope( 1925 this.ref, js.Pointer(&ret), 1926 ) 1927 return 1928 } 1929 1930 // UpdateViaCache returns the value of property "ServiceWorkerRegistration.updateViaCache". 1931 // 1932 // It returns ok=false if there is no such property. 1933 func (this ServiceWorkerRegistration) UpdateViaCache() (ret ServiceWorkerUpdateViaCache, ok bool) { 1934 ok = js.True == bindings.GetServiceWorkerRegistrationUpdateViaCache( 1935 this.ref, js.Pointer(&ret), 1936 ) 1937 return 1938 } 1939 1940 // Sync returns the value of property "ServiceWorkerRegistration.sync". 1941 // 1942 // It returns ok=false if there is no such property. 1943 func (this ServiceWorkerRegistration) Sync() (ret SyncManager, ok bool) { 1944 ok = js.True == bindings.GetServiceWorkerRegistrationSync( 1945 this.ref, js.Pointer(&ret), 1946 ) 1947 return 1948 } 1949 1950 // BackgroundFetch returns the value of property "ServiceWorkerRegistration.backgroundFetch". 1951 // 1952 // It returns ok=false if there is no such property. 1953 func (this ServiceWorkerRegistration) BackgroundFetch() (ret BackgroundFetchManager, ok bool) { 1954 ok = js.True == bindings.GetServiceWorkerRegistrationBackgroundFetch( 1955 this.ref, js.Pointer(&ret), 1956 ) 1957 return 1958 } 1959 1960 // PushManager returns the value of property "ServiceWorkerRegistration.pushManager". 1961 // 1962 // It returns ok=false if there is no such property. 1963 func (this ServiceWorkerRegistration) PushManager() (ret PushManager, ok bool) { 1964 ok = js.True == bindings.GetServiceWorkerRegistrationPushManager( 1965 this.ref, js.Pointer(&ret), 1966 ) 1967 return 1968 } 1969 1970 // PaymentManager returns the value of property "ServiceWorkerRegistration.paymentManager". 1971 // 1972 // It returns ok=false if there is no such property. 1973 func (this ServiceWorkerRegistration) PaymentManager() (ret PaymentManager, ok bool) { 1974 ok = js.True == bindings.GetServiceWorkerRegistrationPaymentManager( 1975 this.ref, js.Pointer(&ret), 1976 ) 1977 return 1978 } 1979 1980 // PeriodicSync returns the value of property "ServiceWorkerRegistration.periodicSync". 1981 // 1982 // It returns ok=false if there is no such property. 1983 func (this ServiceWorkerRegistration) PeriodicSync() (ret PeriodicSyncManager, ok bool) { 1984 ok = js.True == bindings.GetServiceWorkerRegistrationPeriodicSync( 1985 this.ref, js.Pointer(&ret), 1986 ) 1987 return 1988 } 1989 1990 // Cookies returns the value of property "ServiceWorkerRegistration.cookies". 1991 // 1992 // It returns ok=false if there is no such property. 1993 func (this ServiceWorkerRegistration) Cookies() (ret CookieStoreManager, ok bool) { 1994 ok = js.True == bindings.GetServiceWorkerRegistrationCookies( 1995 this.ref, js.Pointer(&ret), 1996 ) 1997 return 1998 } 1999 2000 // Index returns the value of property "ServiceWorkerRegistration.index". 2001 // 2002 // It returns ok=false if there is no such property. 2003 func (this ServiceWorkerRegistration) Index() (ret ContentIndex, ok bool) { 2004 ok = js.True == bindings.GetServiceWorkerRegistrationIndex( 2005 this.ref, js.Pointer(&ret), 2006 ) 2007 return 2008 } 2009 2010 // HasFuncUpdate returns true if the method "ServiceWorkerRegistration.update" exists. 2011 func (this ServiceWorkerRegistration) HasFuncUpdate() bool { 2012 return js.True == bindings.HasFuncServiceWorkerRegistrationUpdate( 2013 this.ref, 2014 ) 2015 } 2016 2017 // FuncUpdate returns the method "ServiceWorkerRegistration.update". 2018 func (this ServiceWorkerRegistration) FuncUpdate() (fn js.Func[func() js.Promise[js.Void]]) { 2019 bindings.FuncServiceWorkerRegistrationUpdate( 2020 this.ref, js.Pointer(&fn), 2021 ) 2022 return 2023 } 2024 2025 // Update calls the method "ServiceWorkerRegistration.update". 2026 func (this ServiceWorkerRegistration) Update() (ret js.Promise[js.Void]) { 2027 bindings.CallServiceWorkerRegistrationUpdate( 2028 this.ref, js.Pointer(&ret), 2029 ) 2030 2031 return 2032 } 2033 2034 // TryUpdate calls the method "ServiceWorkerRegistration.update" 2035 // in a try/catch block and returns (_, err, ok = false) when it went through 2036 // the catch clause. 2037 func (this ServiceWorkerRegistration) TryUpdate() (ret js.Promise[js.Void], exception js.Any, ok bool) { 2038 ok = js.True == bindings.TryServiceWorkerRegistrationUpdate( 2039 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2040 ) 2041 2042 return 2043 } 2044 2045 // HasFuncUnregister returns true if the method "ServiceWorkerRegistration.unregister" exists. 2046 func (this ServiceWorkerRegistration) HasFuncUnregister() bool { 2047 return js.True == bindings.HasFuncServiceWorkerRegistrationUnregister( 2048 this.ref, 2049 ) 2050 } 2051 2052 // FuncUnregister returns the method "ServiceWorkerRegistration.unregister". 2053 func (this ServiceWorkerRegistration) FuncUnregister() (fn js.Func[func() js.Promise[js.Boolean]]) { 2054 bindings.FuncServiceWorkerRegistrationUnregister( 2055 this.ref, js.Pointer(&fn), 2056 ) 2057 return 2058 } 2059 2060 // Unregister calls the method "ServiceWorkerRegistration.unregister". 2061 func (this ServiceWorkerRegistration) Unregister() (ret js.Promise[js.Boolean]) { 2062 bindings.CallServiceWorkerRegistrationUnregister( 2063 this.ref, js.Pointer(&ret), 2064 ) 2065 2066 return 2067 } 2068 2069 // TryUnregister calls the method "ServiceWorkerRegistration.unregister" 2070 // in a try/catch block and returns (_, err, ok = false) when it went through 2071 // the catch clause. 2072 func (this ServiceWorkerRegistration) TryUnregister() (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 2073 ok = js.True == bindings.TryServiceWorkerRegistrationUnregister( 2074 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2075 ) 2076 2077 return 2078 } 2079 2080 // HasFuncShowNotification returns true if the method "ServiceWorkerRegistration.showNotification" exists. 2081 func (this ServiceWorkerRegistration) HasFuncShowNotification() bool { 2082 return js.True == bindings.HasFuncServiceWorkerRegistrationShowNotification( 2083 this.ref, 2084 ) 2085 } 2086 2087 // FuncShowNotification returns the method "ServiceWorkerRegistration.showNotification". 2088 func (this ServiceWorkerRegistration) FuncShowNotification() (fn js.Func[func(title js.String, options NotificationOptions) js.Promise[js.Void]]) { 2089 bindings.FuncServiceWorkerRegistrationShowNotification( 2090 this.ref, js.Pointer(&fn), 2091 ) 2092 return 2093 } 2094 2095 // ShowNotification calls the method "ServiceWorkerRegistration.showNotification". 2096 func (this ServiceWorkerRegistration) ShowNotification(title js.String, options NotificationOptions) (ret js.Promise[js.Void]) { 2097 bindings.CallServiceWorkerRegistrationShowNotification( 2098 this.ref, js.Pointer(&ret), 2099 title.Ref(), 2100 js.Pointer(&options), 2101 ) 2102 2103 return 2104 } 2105 2106 // TryShowNotification calls the method "ServiceWorkerRegistration.showNotification" 2107 // in a try/catch block and returns (_, err, ok = false) when it went through 2108 // the catch clause. 2109 func (this ServiceWorkerRegistration) TryShowNotification(title js.String, options NotificationOptions) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2110 ok = js.True == bindings.TryServiceWorkerRegistrationShowNotification( 2111 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2112 title.Ref(), 2113 js.Pointer(&options), 2114 ) 2115 2116 return 2117 } 2118 2119 // HasFuncShowNotification1 returns true if the method "ServiceWorkerRegistration.showNotification" exists. 2120 func (this ServiceWorkerRegistration) HasFuncShowNotification1() bool { 2121 return js.True == bindings.HasFuncServiceWorkerRegistrationShowNotification1( 2122 this.ref, 2123 ) 2124 } 2125 2126 // FuncShowNotification1 returns the method "ServiceWorkerRegistration.showNotification". 2127 func (this ServiceWorkerRegistration) FuncShowNotification1() (fn js.Func[func(title js.String) js.Promise[js.Void]]) { 2128 bindings.FuncServiceWorkerRegistrationShowNotification1( 2129 this.ref, js.Pointer(&fn), 2130 ) 2131 return 2132 } 2133 2134 // ShowNotification1 calls the method "ServiceWorkerRegistration.showNotification". 2135 func (this ServiceWorkerRegistration) ShowNotification1(title js.String) (ret js.Promise[js.Void]) { 2136 bindings.CallServiceWorkerRegistrationShowNotification1( 2137 this.ref, js.Pointer(&ret), 2138 title.Ref(), 2139 ) 2140 2141 return 2142 } 2143 2144 // TryShowNotification1 calls the method "ServiceWorkerRegistration.showNotification" 2145 // in a try/catch block and returns (_, err, ok = false) when it went through 2146 // the catch clause. 2147 func (this ServiceWorkerRegistration) TryShowNotification1(title js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2148 ok = js.True == bindings.TryServiceWorkerRegistrationShowNotification1( 2149 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2150 title.Ref(), 2151 ) 2152 2153 return 2154 } 2155 2156 // HasFuncGetNotifications returns true if the method "ServiceWorkerRegistration.getNotifications" exists. 2157 func (this ServiceWorkerRegistration) HasFuncGetNotifications() bool { 2158 return js.True == bindings.HasFuncServiceWorkerRegistrationGetNotifications( 2159 this.ref, 2160 ) 2161 } 2162 2163 // FuncGetNotifications returns the method "ServiceWorkerRegistration.getNotifications". 2164 func (this ServiceWorkerRegistration) FuncGetNotifications() (fn js.Func[func(filter GetNotificationOptions) js.Promise[js.Array[Notification]]]) { 2165 bindings.FuncServiceWorkerRegistrationGetNotifications( 2166 this.ref, js.Pointer(&fn), 2167 ) 2168 return 2169 } 2170 2171 // GetNotifications calls the method "ServiceWorkerRegistration.getNotifications". 2172 func (this ServiceWorkerRegistration) GetNotifications(filter GetNotificationOptions) (ret js.Promise[js.Array[Notification]]) { 2173 bindings.CallServiceWorkerRegistrationGetNotifications( 2174 this.ref, js.Pointer(&ret), 2175 js.Pointer(&filter), 2176 ) 2177 2178 return 2179 } 2180 2181 // TryGetNotifications calls the method "ServiceWorkerRegistration.getNotifications" 2182 // in a try/catch block and returns (_, err, ok = false) when it went through 2183 // the catch clause. 2184 func (this ServiceWorkerRegistration) TryGetNotifications(filter GetNotificationOptions) (ret js.Promise[js.Array[Notification]], exception js.Any, ok bool) { 2185 ok = js.True == bindings.TryServiceWorkerRegistrationGetNotifications( 2186 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2187 js.Pointer(&filter), 2188 ) 2189 2190 return 2191 } 2192 2193 // HasFuncGetNotifications1 returns true if the method "ServiceWorkerRegistration.getNotifications" exists. 2194 func (this ServiceWorkerRegistration) HasFuncGetNotifications1() bool { 2195 return js.True == bindings.HasFuncServiceWorkerRegistrationGetNotifications1( 2196 this.ref, 2197 ) 2198 } 2199 2200 // FuncGetNotifications1 returns the method "ServiceWorkerRegistration.getNotifications". 2201 func (this ServiceWorkerRegistration) FuncGetNotifications1() (fn js.Func[func() js.Promise[js.Array[Notification]]]) { 2202 bindings.FuncServiceWorkerRegistrationGetNotifications1( 2203 this.ref, js.Pointer(&fn), 2204 ) 2205 return 2206 } 2207 2208 // GetNotifications1 calls the method "ServiceWorkerRegistration.getNotifications". 2209 func (this ServiceWorkerRegistration) GetNotifications1() (ret js.Promise[js.Array[Notification]]) { 2210 bindings.CallServiceWorkerRegistrationGetNotifications1( 2211 this.ref, js.Pointer(&ret), 2212 ) 2213 2214 return 2215 } 2216 2217 // TryGetNotifications1 calls the method "ServiceWorkerRegistration.getNotifications" 2218 // in a try/catch block and returns (_, err, ok = false) when it went through 2219 // the catch clause. 2220 func (this ServiceWorkerRegistration) TryGetNotifications1() (ret js.Promise[js.Array[Notification]], exception js.Any, ok bool) { 2221 ok = js.True == bindings.TryServiceWorkerRegistrationGetNotifications1( 2222 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2223 ) 2224 2225 return 2226 } 2227 2228 type WorkerType uint32 2229 2230 const ( 2231 _ WorkerType = iota 2232 2233 WorkerType_CLASSIC 2234 WorkerType_MODULE 2235 ) 2236 2237 func (WorkerType) FromRef(str js.Ref) WorkerType { 2238 return WorkerType(bindings.ConstOfWorkerType(str)) 2239 } 2240 2241 func (x WorkerType) String() (string, bool) { 2242 switch x { 2243 case WorkerType_CLASSIC: 2244 return "classic", true 2245 case WorkerType_MODULE: 2246 return "module", true 2247 default: 2248 return "", false 2249 } 2250 } 2251 2252 type RegistrationOptions struct { 2253 // Scope is "RegistrationOptions.scope" 2254 // 2255 // Optional 2256 Scope js.String 2257 // Type is "RegistrationOptions.type" 2258 // 2259 // Optional, defaults to "classic". 2260 Type WorkerType 2261 // UpdateViaCache is "RegistrationOptions.updateViaCache" 2262 // 2263 // Optional, defaults to "imports". 2264 UpdateViaCache ServiceWorkerUpdateViaCache 2265 2266 FFI_USE bool 2267 } 2268 2269 // FromRef calls UpdateFrom and returns a RegistrationOptions with all fields set. 2270 func (p RegistrationOptions) FromRef(ref js.Ref) RegistrationOptions { 2271 p.UpdateFrom(ref) 2272 return p 2273 } 2274 2275 // New creates a new RegistrationOptions in the application heap. 2276 func (p RegistrationOptions) New() js.Ref { 2277 return bindings.RegistrationOptionsJSLoad( 2278 js.Pointer(&p), js.True, 0, 2279 ) 2280 } 2281 2282 // UpdateFrom copies value of all fields of the heap object to p. 2283 func (p *RegistrationOptions) UpdateFrom(ref js.Ref) { 2284 bindings.RegistrationOptionsJSStore( 2285 js.Pointer(p), ref, 2286 ) 2287 } 2288 2289 // Update writes all fields of the p to the heap object referenced by ref. 2290 func (p *RegistrationOptions) Update(ref js.Ref) { 2291 bindings.RegistrationOptionsJSLoad( 2292 js.Pointer(p), js.False, ref, 2293 ) 2294 } 2295 2296 // FreeMembers frees fields with heap reference, if recursive is true 2297 // free all heap references reachable from p. 2298 func (p *RegistrationOptions) FreeMembers(recursive bool) { 2299 js.Free( 2300 p.Scope.Ref(), 2301 ) 2302 p.Scope = p.Scope.FromRef(js.Undefined) 2303 } 2304 2305 type OneOf_ServiceWorkerRegistration_undefined struct { 2306 ref js.Ref 2307 } 2308 2309 func (x OneOf_ServiceWorkerRegistration_undefined) Ref() js.Ref { 2310 return x.ref 2311 } 2312 2313 func (x OneOf_ServiceWorkerRegistration_undefined) Free() { 2314 x.ref.Free() 2315 } 2316 2317 func (x OneOf_ServiceWorkerRegistration_undefined) FromRef(ref js.Ref) OneOf_ServiceWorkerRegistration_undefined { 2318 return OneOf_ServiceWorkerRegistration_undefined{ 2319 ref: ref, 2320 } 2321 } 2322 2323 func (x OneOf_ServiceWorkerRegistration_undefined) Undefined() bool { 2324 return x.ref == js.Undefined 2325 } 2326 2327 func (x OneOf_ServiceWorkerRegistration_undefined) ServiceWorkerRegistration() ServiceWorkerRegistration { 2328 return ServiceWorkerRegistration{}.FromRef(x.ref) 2329 } 2330 2331 type ServiceWorkerContainer struct { 2332 EventTarget 2333 } 2334 2335 func (this ServiceWorkerContainer) Once() ServiceWorkerContainer { 2336 this.ref.Once() 2337 return this 2338 } 2339 2340 func (this ServiceWorkerContainer) Ref() js.Ref { 2341 return this.EventTarget.Ref() 2342 } 2343 2344 func (this ServiceWorkerContainer) FromRef(ref js.Ref) ServiceWorkerContainer { 2345 this.EventTarget = this.EventTarget.FromRef(ref) 2346 return this 2347 } 2348 2349 func (this ServiceWorkerContainer) Free() { 2350 this.ref.Free() 2351 } 2352 2353 // Controller returns the value of property "ServiceWorkerContainer.controller". 2354 // 2355 // It returns ok=false if there is no such property. 2356 func (this ServiceWorkerContainer) Controller() (ret ServiceWorker, ok bool) { 2357 ok = js.True == bindings.GetServiceWorkerContainerController( 2358 this.ref, js.Pointer(&ret), 2359 ) 2360 return 2361 } 2362 2363 // Ready returns the value of property "ServiceWorkerContainer.ready". 2364 // 2365 // It returns ok=false if there is no such property. 2366 func (this ServiceWorkerContainer) Ready() (ret js.Promise[ServiceWorkerRegistration], ok bool) { 2367 ok = js.True == bindings.GetServiceWorkerContainerReady( 2368 this.ref, js.Pointer(&ret), 2369 ) 2370 return 2371 } 2372 2373 // HasFuncRegister returns true if the method "ServiceWorkerContainer.register" exists. 2374 func (this ServiceWorkerContainer) HasFuncRegister() bool { 2375 return js.True == bindings.HasFuncServiceWorkerContainerRegister( 2376 this.ref, 2377 ) 2378 } 2379 2380 // FuncRegister returns the method "ServiceWorkerContainer.register". 2381 func (this ServiceWorkerContainer) FuncRegister() (fn js.Func[func(scriptURL js.String, options RegistrationOptions) js.Promise[ServiceWorkerRegistration]]) { 2382 bindings.FuncServiceWorkerContainerRegister( 2383 this.ref, js.Pointer(&fn), 2384 ) 2385 return 2386 } 2387 2388 // Register calls the method "ServiceWorkerContainer.register". 2389 func (this ServiceWorkerContainer) Register(scriptURL js.String, options RegistrationOptions) (ret js.Promise[ServiceWorkerRegistration]) { 2390 bindings.CallServiceWorkerContainerRegister( 2391 this.ref, js.Pointer(&ret), 2392 scriptURL.Ref(), 2393 js.Pointer(&options), 2394 ) 2395 2396 return 2397 } 2398 2399 // TryRegister calls the method "ServiceWorkerContainer.register" 2400 // in a try/catch block and returns (_, err, ok = false) when it went through 2401 // the catch clause. 2402 func (this ServiceWorkerContainer) TryRegister(scriptURL js.String, options RegistrationOptions) (ret js.Promise[ServiceWorkerRegistration], exception js.Any, ok bool) { 2403 ok = js.True == bindings.TryServiceWorkerContainerRegister( 2404 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2405 scriptURL.Ref(), 2406 js.Pointer(&options), 2407 ) 2408 2409 return 2410 } 2411 2412 // HasFuncRegister1 returns true if the method "ServiceWorkerContainer.register" exists. 2413 func (this ServiceWorkerContainer) HasFuncRegister1() bool { 2414 return js.True == bindings.HasFuncServiceWorkerContainerRegister1( 2415 this.ref, 2416 ) 2417 } 2418 2419 // FuncRegister1 returns the method "ServiceWorkerContainer.register". 2420 func (this ServiceWorkerContainer) FuncRegister1() (fn js.Func[func(scriptURL js.String) js.Promise[ServiceWorkerRegistration]]) { 2421 bindings.FuncServiceWorkerContainerRegister1( 2422 this.ref, js.Pointer(&fn), 2423 ) 2424 return 2425 } 2426 2427 // Register1 calls the method "ServiceWorkerContainer.register". 2428 func (this ServiceWorkerContainer) Register1(scriptURL js.String) (ret js.Promise[ServiceWorkerRegistration]) { 2429 bindings.CallServiceWorkerContainerRegister1( 2430 this.ref, js.Pointer(&ret), 2431 scriptURL.Ref(), 2432 ) 2433 2434 return 2435 } 2436 2437 // TryRegister1 calls the method "ServiceWorkerContainer.register" 2438 // in a try/catch block and returns (_, err, ok = false) when it went through 2439 // the catch clause. 2440 func (this ServiceWorkerContainer) TryRegister1(scriptURL js.String) (ret js.Promise[ServiceWorkerRegistration], exception js.Any, ok bool) { 2441 ok = js.True == bindings.TryServiceWorkerContainerRegister1( 2442 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2443 scriptURL.Ref(), 2444 ) 2445 2446 return 2447 } 2448 2449 // HasFuncGetRegistration returns true if the method "ServiceWorkerContainer.getRegistration" exists. 2450 func (this ServiceWorkerContainer) HasFuncGetRegistration() bool { 2451 return js.True == bindings.HasFuncServiceWorkerContainerGetRegistration( 2452 this.ref, 2453 ) 2454 } 2455 2456 // FuncGetRegistration returns the method "ServiceWorkerContainer.getRegistration". 2457 func (this ServiceWorkerContainer) FuncGetRegistration() (fn js.Func[func(clientURL js.String) js.Promise[OneOf_ServiceWorkerRegistration_undefined]]) { 2458 bindings.FuncServiceWorkerContainerGetRegistration( 2459 this.ref, js.Pointer(&fn), 2460 ) 2461 return 2462 } 2463 2464 // GetRegistration calls the method "ServiceWorkerContainer.getRegistration". 2465 func (this ServiceWorkerContainer) GetRegistration(clientURL js.String) (ret js.Promise[OneOf_ServiceWorkerRegistration_undefined]) { 2466 bindings.CallServiceWorkerContainerGetRegistration( 2467 this.ref, js.Pointer(&ret), 2468 clientURL.Ref(), 2469 ) 2470 2471 return 2472 } 2473 2474 // TryGetRegistration calls the method "ServiceWorkerContainer.getRegistration" 2475 // in a try/catch block and returns (_, err, ok = false) when it went through 2476 // the catch clause. 2477 func (this ServiceWorkerContainer) TryGetRegistration(clientURL js.String) (ret js.Promise[OneOf_ServiceWorkerRegistration_undefined], exception js.Any, ok bool) { 2478 ok = js.True == bindings.TryServiceWorkerContainerGetRegistration( 2479 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2480 clientURL.Ref(), 2481 ) 2482 2483 return 2484 } 2485 2486 // HasFuncGetRegistration1 returns true if the method "ServiceWorkerContainer.getRegistration" exists. 2487 func (this ServiceWorkerContainer) HasFuncGetRegistration1() bool { 2488 return js.True == bindings.HasFuncServiceWorkerContainerGetRegistration1( 2489 this.ref, 2490 ) 2491 } 2492 2493 // FuncGetRegistration1 returns the method "ServiceWorkerContainer.getRegistration". 2494 func (this ServiceWorkerContainer) FuncGetRegistration1() (fn js.Func[func() js.Promise[OneOf_ServiceWorkerRegistration_undefined]]) { 2495 bindings.FuncServiceWorkerContainerGetRegistration1( 2496 this.ref, js.Pointer(&fn), 2497 ) 2498 return 2499 } 2500 2501 // GetRegistration1 calls the method "ServiceWorkerContainer.getRegistration". 2502 func (this ServiceWorkerContainer) GetRegistration1() (ret js.Promise[OneOf_ServiceWorkerRegistration_undefined]) { 2503 bindings.CallServiceWorkerContainerGetRegistration1( 2504 this.ref, js.Pointer(&ret), 2505 ) 2506 2507 return 2508 } 2509 2510 // TryGetRegistration1 calls the method "ServiceWorkerContainer.getRegistration" 2511 // in a try/catch block and returns (_, err, ok = false) when it went through 2512 // the catch clause. 2513 func (this ServiceWorkerContainer) TryGetRegistration1() (ret js.Promise[OneOf_ServiceWorkerRegistration_undefined], exception js.Any, ok bool) { 2514 ok = js.True == bindings.TryServiceWorkerContainerGetRegistration1( 2515 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2516 ) 2517 2518 return 2519 } 2520 2521 // HasFuncGetRegistrations returns true if the method "ServiceWorkerContainer.getRegistrations" exists. 2522 func (this ServiceWorkerContainer) HasFuncGetRegistrations() bool { 2523 return js.True == bindings.HasFuncServiceWorkerContainerGetRegistrations( 2524 this.ref, 2525 ) 2526 } 2527 2528 // FuncGetRegistrations returns the method "ServiceWorkerContainer.getRegistrations". 2529 func (this ServiceWorkerContainer) FuncGetRegistrations() (fn js.Func[func() js.Promise[js.FrozenArray[ServiceWorkerRegistration]]]) { 2530 bindings.FuncServiceWorkerContainerGetRegistrations( 2531 this.ref, js.Pointer(&fn), 2532 ) 2533 return 2534 } 2535 2536 // GetRegistrations calls the method "ServiceWorkerContainer.getRegistrations". 2537 func (this ServiceWorkerContainer) GetRegistrations() (ret js.Promise[js.FrozenArray[ServiceWorkerRegistration]]) { 2538 bindings.CallServiceWorkerContainerGetRegistrations( 2539 this.ref, js.Pointer(&ret), 2540 ) 2541 2542 return 2543 } 2544 2545 // TryGetRegistrations calls the method "ServiceWorkerContainer.getRegistrations" 2546 // in a try/catch block and returns (_, err, ok = false) when it went through 2547 // the catch clause. 2548 func (this ServiceWorkerContainer) TryGetRegistrations() (ret js.Promise[js.FrozenArray[ServiceWorkerRegistration]], exception js.Any, ok bool) { 2549 ok = js.True == bindings.TryServiceWorkerContainerGetRegistrations( 2550 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2551 ) 2552 2553 return 2554 } 2555 2556 // HasFuncStartMessages returns true if the method "ServiceWorkerContainer.startMessages" exists. 2557 func (this ServiceWorkerContainer) HasFuncStartMessages() bool { 2558 return js.True == bindings.HasFuncServiceWorkerContainerStartMessages( 2559 this.ref, 2560 ) 2561 } 2562 2563 // FuncStartMessages returns the method "ServiceWorkerContainer.startMessages". 2564 func (this ServiceWorkerContainer) FuncStartMessages() (fn js.Func[func()]) { 2565 bindings.FuncServiceWorkerContainerStartMessages( 2566 this.ref, js.Pointer(&fn), 2567 ) 2568 return 2569 } 2570 2571 // StartMessages calls the method "ServiceWorkerContainer.startMessages". 2572 func (this ServiceWorkerContainer) StartMessages() (ret js.Void) { 2573 bindings.CallServiceWorkerContainerStartMessages( 2574 this.ref, js.Pointer(&ret), 2575 ) 2576 2577 return 2578 } 2579 2580 // TryStartMessages calls the method "ServiceWorkerContainer.startMessages" 2581 // in a try/catch block and returns (_, err, ok = false) when it went through 2582 // the catch clause. 2583 func (this ServiceWorkerContainer) TryStartMessages() (ret js.Void, exception js.Any, ok bool) { 2584 ok = js.True == bindings.TryServiceWorkerContainerStartMessages( 2585 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2586 ) 2587 2588 return 2589 } 2590 2591 type MediaDeviceKind uint32 2592 2593 const ( 2594 _ MediaDeviceKind = iota 2595 2596 MediaDeviceKind_AUDIOINPUT 2597 MediaDeviceKind_AUDIOOUTPUT 2598 MediaDeviceKind_VIDEOINPUT 2599 ) 2600 2601 func (MediaDeviceKind) FromRef(str js.Ref) MediaDeviceKind { 2602 return MediaDeviceKind(bindings.ConstOfMediaDeviceKind(str)) 2603 } 2604 2605 func (x MediaDeviceKind) String() (string, bool) { 2606 switch x { 2607 case MediaDeviceKind_AUDIOINPUT: 2608 return "audioinput", true 2609 case MediaDeviceKind_AUDIOOUTPUT: 2610 return "audiooutput", true 2611 case MediaDeviceKind_VIDEOINPUT: 2612 return "videoinput", true 2613 default: 2614 return "", false 2615 } 2616 } 2617 2618 type MediaDeviceInfo struct { 2619 ref js.Ref 2620 } 2621 2622 func (this MediaDeviceInfo) Once() MediaDeviceInfo { 2623 this.ref.Once() 2624 return this 2625 } 2626 2627 func (this MediaDeviceInfo) Ref() js.Ref { 2628 return this.ref 2629 } 2630 2631 func (this MediaDeviceInfo) FromRef(ref js.Ref) MediaDeviceInfo { 2632 this.ref = ref 2633 return this 2634 } 2635 2636 func (this MediaDeviceInfo) Free() { 2637 this.ref.Free() 2638 } 2639 2640 // DeviceId returns the value of property "MediaDeviceInfo.deviceId". 2641 // 2642 // It returns ok=false if there is no such property. 2643 func (this MediaDeviceInfo) DeviceId() (ret js.String, ok bool) { 2644 ok = js.True == bindings.GetMediaDeviceInfoDeviceId( 2645 this.ref, js.Pointer(&ret), 2646 ) 2647 return 2648 } 2649 2650 // Kind returns the value of property "MediaDeviceInfo.kind". 2651 // 2652 // It returns ok=false if there is no such property. 2653 func (this MediaDeviceInfo) Kind() (ret MediaDeviceKind, ok bool) { 2654 ok = js.True == bindings.GetMediaDeviceInfoKind( 2655 this.ref, js.Pointer(&ret), 2656 ) 2657 return 2658 } 2659 2660 // Label returns the value of property "MediaDeviceInfo.label". 2661 // 2662 // It returns ok=false if there is no such property. 2663 func (this MediaDeviceInfo) Label() (ret js.String, ok bool) { 2664 ok = js.True == bindings.GetMediaDeviceInfoLabel( 2665 this.ref, js.Pointer(&ret), 2666 ) 2667 return 2668 } 2669 2670 // GroupId returns the value of property "MediaDeviceInfo.groupId". 2671 // 2672 // It returns ok=false if there is no such property. 2673 func (this MediaDeviceInfo) GroupId() (ret js.String, ok bool) { 2674 ok = js.True == bindings.GetMediaDeviceInfoGroupId( 2675 this.ref, js.Pointer(&ret), 2676 ) 2677 return 2678 } 2679 2680 // HasFuncToJSON returns true if the method "MediaDeviceInfo.toJSON" exists. 2681 func (this MediaDeviceInfo) HasFuncToJSON() bool { 2682 return js.True == bindings.HasFuncMediaDeviceInfoToJSON( 2683 this.ref, 2684 ) 2685 } 2686 2687 // FuncToJSON returns the method "MediaDeviceInfo.toJSON". 2688 func (this MediaDeviceInfo) FuncToJSON() (fn js.Func[func() js.Object]) { 2689 bindings.FuncMediaDeviceInfoToJSON( 2690 this.ref, js.Pointer(&fn), 2691 ) 2692 return 2693 } 2694 2695 // ToJSON calls the method "MediaDeviceInfo.toJSON". 2696 func (this MediaDeviceInfo) ToJSON() (ret js.Object) { 2697 bindings.CallMediaDeviceInfoToJSON( 2698 this.ref, js.Pointer(&ret), 2699 ) 2700 2701 return 2702 } 2703 2704 // TryToJSON calls the method "MediaDeviceInfo.toJSON" 2705 // in a try/catch block and returns (_, err, ok = false) when it went through 2706 // the catch clause. 2707 func (this MediaDeviceInfo) TryToJSON() (ret js.Object, exception js.Any, ok bool) { 2708 ok = js.True == bindings.TryMediaDeviceInfoToJSON( 2709 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2710 ) 2711 2712 return 2713 } 2714 2715 type SelfCapturePreferenceEnum uint32 2716 2717 const ( 2718 _ SelfCapturePreferenceEnum = iota 2719 2720 SelfCapturePreferenceEnum_INCLUDE 2721 SelfCapturePreferenceEnum_EXCLUDE 2722 ) 2723 2724 func (SelfCapturePreferenceEnum) FromRef(str js.Ref) SelfCapturePreferenceEnum { 2725 return SelfCapturePreferenceEnum(bindings.ConstOfSelfCapturePreferenceEnum(str)) 2726 } 2727 2728 func (x SelfCapturePreferenceEnum) String() (string, bool) { 2729 switch x { 2730 case SelfCapturePreferenceEnum_INCLUDE: 2731 return "include", true 2732 case SelfCapturePreferenceEnum_EXCLUDE: 2733 return "exclude", true 2734 default: 2735 return "", false 2736 } 2737 } 2738 2739 type SystemAudioPreferenceEnum uint32 2740 2741 const ( 2742 _ SystemAudioPreferenceEnum = iota 2743 2744 SystemAudioPreferenceEnum_INCLUDE 2745 SystemAudioPreferenceEnum_EXCLUDE 2746 ) 2747 2748 func (SystemAudioPreferenceEnum) FromRef(str js.Ref) SystemAudioPreferenceEnum { 2749 return SystemAudioPreferenceEnum(bindings.ConstOfSystemAudioPreferenceEnum(str)) 2750 } 2751 2752 func (x SystemAudioPreferenceEnum) String() (string, bool) { 2753 switch x { 2754 case SystemAudioPreferenceEnum_INCLUDE: 2755 return "include", true 2756 case SystemAudioPreferenceEnum_EXCLUDE: 2757 return "exclude", true 2758 default: 2759 return "", false 2760 } 2761 } 2762 2763 type SurfaceSwitchingPreferenceEnum uint32 2764 2765 const ( 2766 _ SurfaceSwitchingPreferenceEnum = iota 2767 2768 SurfaceSwitchingPreferenceEnum_INCLUDE 2769 SurfaceSwitchingPreferenceEnum_EXCLUDE 2770 ) 2771 2772 func (SurfaceSwitchingPreferenceEnum) FromRef(str js.Ref) SurfaceSwitchingPreferenceEnum { 2773 return SurfaceSwitchingPreferenceEnum(bindings.ConstOfSurfaceSwitchingPreferenceEnum(str)) 2774 } 2775 2776 func (x SurfaceSwitchingPreferenceEnum) String() (string, bool) { 2777 switch x { 2778 case SurfaceSwitchingPreferenceEnum_INCLUDE: 2779 return "include", true 2780 case SurfaceSwitchingPreferenceEnum_EXCLUDE: 2781 return "exclude", true 2782 default: 2783 return "", false 2784 } 2785 } 2786 2787 type MonitorTypeSurfacesEnum uint32 2788 2789 const ( 2790 _ MonitorTypeSurfacesEnum = iota 2791 2792 MonitorTypeSurfacesEnum_INCLUDE 2793 MonitorTypeSurfacesEnum_EXCLUDE 2794 ) 2795 2796 func (MonitorTypeSurfacesEnum) FromRef(str js.Ref) MonitorTypeSurfacesEnum { 2797 return MonitorTypeSurfacesEnum(bindings.ConstOfMonitorTypeSurfacesEnum(str)) 2798 } 2799 2800 func (x MonitorTypeSurfacesEnum) String() (string, bool) { 2801 switch x { 2802 case MonitorTypeSurfacesEnum_INCLUDE: 2803 return "include", true 2804 case MonitorTypeSurfacesEnum_EXCLUDE: 2805 return "exclude", true 2806 default: 2807 return "", false 2808 } 2809 } 2810 2811 type DisplayMediaStreamOptions struct { 2812 // Video is "DisplayMediaStreamOptions.video" 2813 // 2814 // Optional, defaults to true. 2815 Video OneOf_Bool_MediaTrackConstraints 2816 // Audio is "DisplayMediaStreamOptions.audio" 2817 // 2818 // Optional, defaults to false. 2819 Audio OneOf_Bool_MediaTrackConstraints 2820 // Controller is "DisplayMediaStreamOptions.controller" 2821 // 2822 // Optional 2823 Controller CaptureController 2824 // SelfBrowserSurface is "DisplayMediaStreamOptions.selfBrowserSurface" 2825 // 2826 // Optional 2827 SelfBrowserSurface SelfCapturePreferenceEnum 2828 // SystemAudio is "DisplayMediaStreamOptions.systemAudio" 2829 // 2830 // Optional 2831 SystemAudio SystemAudioPreferenceEnum 2832 // SurfaceSwitching is "DisplayMediaStreamOptions.surfaceSwitching" 2833 // 2834 // Optional 2835 SurfaceSwitching SurfaceSwitchingPreferenceEnum 2836 // MonitorTypeSurfaces is "DisplayMediaStreamOptions.monitorTypeSurfaces" 2837 // 2838 // Optional 2839 MonitorTypeSurfaces MonitorTypeSurfacesEnum 2840 2841 FFI_USE bool 2842 } 2843 2844 // FromRef calls UpdateFrom and returns a DisplayMediaStreamOptions with all fields set. 2845 func (p DisplayMediaStreamOptions) FromRef(ref js.Ref) DisplayMediaStreamOptions { 2846 p.UpdateFrom(ref) 2847 return p 2848 } 2849 2850 // New creates a new DisplayMediaStreamOptions in the application heap. 2851 func (p DisplayMediaStreamOptions) New() js.Ref { 2852 return bindings.DisplayMediaStreamOptionsJSLoad( 2853 js.Pointer(&p), js.True, 0, 2854 ) 2855 } 2856 2857 // UpdateFrom copies value of all fields of the heap object to p. 2858 func (p *DisplayMediaStreamOptions) UpdateFrom(ref js.Ref) { 2859 bindings.DisplayMediaStreamOptionsJSStore( 2860 js.Pointer(p), ref, 2861 ) 2862 } 2863 2864 // Update writes all fields of the p to the heap object referenced by ref. 2865 func (p *DisplayMediaStreamOptions) Update(ref js.Ref) { 2866 bindings.DisplayMediaStreamOptionsJSLoad( 2867 js.Pointer(p), js.False, ref, 2868 ) 2869 } 2870 2871 // FreeMembers frees fields with heap reference, if recursive is true 2872 // free all heap references reachable from p. 2873 func (p *DisplayMediaStreamOptions) FreeMembers(recursive bool) { 2874 js.Free( 2875 p.Video.Ref(), 2876 p.Audio.Ref(), 2877 p.Controller.Ref(), 2878 ) 2879 p.Video = p.Video.FromRef(js.Undefined) 2880 p.Audio = p.Audio.FromRef(js.Undefined) 2881 p.Controller = p.Controller.FromRef(js.Undefined) 2882 } 2883 2884 type ViewportMediaStreamConstraints struct { 2885 // Video is "ViewportMediaStreamConstraints.video" 2886 // 2887 // Optional, defaults to true. 2888 Video OneOf_Bool_MediaTrackConstraints 2889 // Audio is "ViewportMediaStreamConstraints.audio" 2890 // 2891 // Optional, defaults to false. 2892 Audio OneOf_Bool_MediaTrackConstraints 2893 2894 FFI_USE bool 2895 } 2896 2897 // FromRef calls UpdateFrom and returns a ViewportMediaStreamConstraints with all fields set. 2898 func (p ViewportMediaStreamConstraints) FromRef(ref js.Ref) ViewportMediaStreamConstraints { 2899 p.UpdateFrom(ref) 2900 return p 2901 } 2902 2903 // New creates a new ViewportMediaStreamConstraints in the application heap. 2904 func (p ViewportMediaStreamConstraints) New() js.Ref { 2905 return bindings.ViewportMediaStreamConstraintsJSLoad( 2906 js.Pointer(&p), js.True, 0, 2907 ) 2908 } 2909 2910 // UpdateFrom copies value of all fields of the heap object to p. 2911 func (p *ViewportMediaStreamConstraints) UpdateFrom(ref js.Ref) { 2912 bindings.ViewportMediaStreamConstraintsJSStore( 2913 js.Pointer(p), ref, 2914 ) 2915 } 2916 2917 // Update writes all fields of the p to the heap object referenced by ref. 2918 func (p *ViewportMediaStreamConstraints) Update(ref js.Ref) { 2919 bindings.ViewportMediaStreamConstraintsJSLoad( 2920 js.Pointer(p), js.False, ref, 2921 ) 2922 } 2923 2924 // FreeMembers frees fields with heap reference, if recursive is true 2925 // free all heap references reachable from p. 2926 func (p *ViewportMediaStreamConstraints) FreeMembers(recursive bool) { 2927 js.Free( 2928 p.Video.Ref(), 2929 p.Audio.Ref(), 2930 ) 2931 p.Video = p.Video.FromRef(js.Undefined) 2932 p.Audio = p.Audio.FromRef(js.Undefined) 2933 } 2934 2935 type MediaTrackSupportedConstraints struct { 2936 // Width is "MediaTrackSupportedConstraints.width" 2937 // 2938 // Optional, defaults to true. 2939 // 2940 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 2941 Width bool 2942 // Height is "MediaTrackSupportedConstraints.height" 2943 // 2944 // Optional, defaults to true. 2945 // 2946 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 2947 Height bool 2948 // AspectRatio is "MediaTrackSupportedConstraints.aspectRatio" 2949 // 2950 // Optional, defaults to true. 2951 // 2952 // NOTE: FFI_USE_AspectRatio MUST be set to true to make this field effective. 2953 AspectRatio bool 2954 // FrameRate is "MediaTrackSupportedConstraints.frameRate" 2955 // 2956 // Optional, defaults to true. 2957 // 2958 // NOTE: FFI_USE_FrameRate MUST be set to true to make this field effective. 2959 FrameRate bool 2960 // FacingMode is "MediaTrackSupportedConstraints.facingMode" 2961 // 2962 // Optional, defaults to true. 2963 // 2964 // NOTE: FFI_USE_FacingMode MUST be set to true to make this field effective. 2965 FacingMode bool 2966 // ResizeMode is "MediaTrackSupportedConstraints.resizeMode" 2967 // 2968 // Optional, defaults to true. 2969 // 2970 // NOTE: FFI_USE_ResizeMode MUST be set to true to make this field effective. 2971 ResizeMode bool 2972 // SampleRate is "MediaTrackSupportedConstraints.sampleRate" 2973 // 2974 // Optional, defaults to true. 2975 // 2976 // NOTE: FFI_USE_SampleRate MUST be set to true to make this field effective. 2977 SampleRate bool 2978 // SampleSize is "MediaTrackSupportedConstraints.sampleSize" 2979 // 2980 // Optional, defaults to true. 2981 // 2982 // NOTE: FFI_USE_SampleSize MUST be set to true to make this field effective. 2983 SampleSize bool 2984 // EchoCancellation is "MediaTrackSupportedConstraints.echoCancellation" 2985 // 2986 // Optional, defaults to true. 2987 // 2988 // NOTE: FFI_USE_EchoCancellation MUST be set to true to make this field effective. 2989 EchoCancellation bool 2990 // AutoGainControl is "MediaTrackSupportedConstraints.autoGainControl" 2991 // 2992 // Optional, defaults to true. 2993 // 2994 // NOTE: FFI_USE_AutoGainControl MUST be set to true to make this field effective. 2995 AutoGainControl bool 2996 // NoiseSuppression is "MediaTrackSupportedConstraints.noiseSuppression" 2997 // 2998 // Optional, defaults to true. 2999 // 3000 // NOTE: FFI_USE_NoiseSuppression MUST be set to true to make this field effective. 3001 NoiseSuppression bool 3002 // Latency is "MediaTrackSupportedConstraints.latency" 3003 // 3004 // Optional, defaults to true. 3005 // 3006 // NOTE: FFI_USE_Latency MUST be set to true to make this field effective. 3007 Latency bool 3008 // ChannelCount is "MediaTrackSupportedConstraints.channelCount" 3009 // 3010 // Optional, defaults to true. 3011 // 3012 // NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective. 3013 ChannelCount bool 3014 // DeviceId is "MediaTrackSupportedConstraints.deviceId" 3015 // 3016 // Optional, defaults to true. 3017 // 3018 // NOTE: FFI_USE_DeviceId MUST be set to true to make this field effective. 3019 DeviceId bool 3020 // GroupId is "MediaTrackSupportedConstraints.groupId" 3021 // 3022 // Optional, defaults to true. 3023 // 3024 // NOTE: FFI_USE_GroupId MUST be set to true to make this field effective. 3025 GroupId bool 3026 // WhiteBalanceMode is "MediaTrackSupportedConstraints.whiteBalanceMode" 3027 // 3028 // Optional, defaults to true. 3029 // 3030 // NOTE: FFI_USE_WhiteBalanceMode MUST be set to true to make this field effective. 3031 WhiteBalanceMode bool 3032 // ExposureMode is "MediaTrackSupportedConstraints.exposureMode" 3033 // 3034 // Optional, defaults to true. 3035 // 3036 // NOTE: FFI_USE_ExposureMode MUST be set to true to make this field effective. 3037 ExposureMode bool 3038 // FocusMode is "MediaTrackSupportedConstraints.focusMode" 3039 // 3040 // Optional, defaults to true. 3041 // 3042 // NOTE: FFI_USE_FocusMode MUST be set to true to make this field effective. 3043 FocusMode bool 3044 // PointsOfInterest is "MediaTrackSupportedConstraints.pointsOfInterest" 3045 // 3046 // Optional, defaults to true. 3047 // 3048 // NOTE: FFI_USE_PointsOfInterest MUST be set to true to make this field effective. 3049 PointsOfInterest bool 3050 // ExposureCompensation is "MediaTrackSupportedConstraints.exposureCompensation" 3051 // 3052 // Optional, defaults to true. 3053 // 3054 // NOTE: FFI_USE_ExposureCompensation MUST be set to true to make this field effective. 3055 ExposureCompensation bool 3056 // ExposureTime is "MediaTrackSupportedConstraints.exposureTime" 3057 // 3058 // Optional, defaults to true. 3059 // 3060 // NOTE: FFI_USE_ExposureTime MUST be set to true to make this field effective. 3061 ExposureTime bool 3062 // ColorTemperature is "MediaTrackSupportedConstraints.colorTemperature" 3063 // 3064 // Optional, defaults to true. 3065 // 3066 // NOTE: FFI_USE_ColorTemperature MUST be set to true to make this field effective. 3067 ColorTemperature bool 3068 // Iso is "MediaTrackSupportedConstraints.iso" 3069 // 3070 // Optional, defaults to true. 3071 // 3072 // NOTE: FFI_USE_Iso MUST be set to true to make this field effective. 3073 Iso bool 3074 // Brightness is "MediaTrackSupportedConstraints.brightness" 3075 // 3076 // Optional, defaults to true. 3077 // 3078 // NOTE: FFI_USE_Brightness MUST be set to true to make this field effective. 3079 Brightness bool 3080 // Contrast is "MediaTrackSupportedConstraints.contrast" 3081 // 3082 // Optional, defaults to true. 3083 // 3084 // NOTE: FFI_USE_Contrast MUST be set to true to make this field effective. 3085 Contrast bool 3086 // Pan is "MediaTrackSupportedConstraints.pan" 3087 // 3088 // Optional, defaults to true. 3089 // 3090 // NOTE: FFI_USE_Pan MUST be set to true to make this field effective. 3091 Pan bool 3092 // Saturation is "MediaTrackSupportedConstraints.saturation" 3093 // 3094 // Optional, defaults to true. 3095 // 3096 // NOTE: FFI_USE_Saturation MUST be set to true to make this field effective. 3097 Saturation bool 3098 // Sharpness is "MediaTrackSupportedConstraints.sharpness" 3099 // 3100 // Optional, defaults to true. 3101 // 3102 // NOTE: FFI_USE_Sharpness MUST be set to true to make this field effective. 3103 Sharpness bool 3104 // FocusDistance is "MediaTrackSupportedConstraints.focusDistance" 3105 // 3106 // Optional, defaults to true. 3107 // 3108 // NOTE: FFI_USE_FocusDistance MUST be set to true to make this field effective. 3109 FocusDistance bool 3110 // Tilt is "MediaTrackSupportedConstraints.tilt" 3111 // 3112 // Optional, defaults to true. 3113 // 3114 // NOTE: FFI_USE_Tilt MUST be set to true to make this field effective. 3115 Tilt bool 3116 // Zoom is "MediaTrackSupportedConstraints.zoom" 3117 // 3118 // Optional, defaults to true. 3119 // 3120 // NOTE: FFI_USE_Zoom MUST be set to true to make this field effective. 3121 Zoom bool 3122 // Torch is "MediaTrackSupportedConstraints.torch" 3123 // 3124 // Optional, defaults to true. 3125 // 3126 // NOTE: FFI_USE_Torch MUST be set to true to make this field effective. 3127 Torch bool 3128 // DisplaySurface is "MediaTrackSupportedConstraints.displaySurface" 3129 // 3130 // Optional, defaults to true. 3131 // 3132 // NOTE: FFI_USE_DisplaySurface MUST be set to true to make this field effective. 3133 DisplaySurface bool 3134 // LogicalSurface is "MediaTrackSupportedConstraints.logicalSurface" 3135 // 3136 // Optional, defaults to true. 3137 // 3138 // NOTE: FFI_USE_LogicalSurface MUST be set to true to make this field effective. 3139 LogicalSurface bool 3140 // Cursor is "MediaTrackSupportedConstraints.cursor" 3141 // 3142 // Optional, defaults to true. 3143 // 3144 // NOTE: FFI_USE_Cursor MUST be set to true to make this field effective. 3145 Cursor bool 3146 // RestrictOwnAudio is "MediaTrackSupportedConstraints.restrictOwnAudio" 3147 // 3148 // Optional, defaults to true. 3149 // 3150 // NOTE: FFI_USE_RestrictOwnAudio MUST be set to true to make this field effective. 3151 RestrictOwnAudio bool 3152 // SuppressLocalAudioPlayback is "MediaTrackSupportedConstraints.suppressLocalAudioPlayback" 3153 // 3154 // Optional, defaults to true. 3155 // 3156 // NOTE: FFI_USE_SuppressLocalAudioPlayback MUST be set to true to make this field effective. 3157 SuppressLocalAudioPlayback bool 3158 3159 FFI_USE_Width bool // for Width. 3160 FFI_USE_Height bool // for Height. 3161 FFI_USE_AspectRatio bool // for AspectRatio. 3162 FFI_USE_FrameRate bool // for FrameRate. 3163 FFI_USE_FacingMode bool // for FacingMode. 3164 FFI_USE_ResizeMode bool // for ResizeMode. 3165 FFI_USE_SampleRate bool // for SampleRate. 3166 FFI_USE_SampleSize bool // for SampleSize. 3167 FFI_USE_EchoCancellation bool // for EchoCancellation. 3168 FFI_USE_AutoGainControl bool // for AutoGainControl. 3169 FFI_USE_NoiseSuppression bool // for NoiseSuppression. 3170 FFI_USE_Latency bool // for Latency. 3171 FFI_USE_ChannelCount bool // for ChannelCount. 3172 FFI_USE_DeviceId bool // for DeviceId. 3173 FFI_USE_GroupId bool // for GroupId. 3174 FFI_USE_WhiteBalanceMode bool // for WhiteBalanceMode. 3175 FFI_USE_ExposureMode bool // for ExposureMode. 3176 FFI_USE_FocusMode bool // for FocusMode. 3177 FFI_USE_PointsOfInterest bool // for PointsOfInterest. 3178 FFI_USE_ExposureCompensation bool // for ExposureCompensation. 3179 FFI_USE_ExposureTime bool // for ExposureTime. 3180 FFI_USE_ColorTemperature bool // for ColorTemperature. 3181 FFI_USE_Iso bool // for Iso. 3182 FFI_USE_Brightness bool // for Brightness. 3183 FFI_USE_Contrast bool // for Contrast. 3184 FFI_USE_Pan bool // for Pan. 3185 FFI_USE_Saturation bool // for Saturation. 3186 FFI_USE_Sharpness bool // for Sharpness. 3187 FFI_USE_FocusDistance bool // for FocusDistance. 3188 FFI_USE_Tilt bool // for Tilt. 3189 FFI_USE_Zoom bool // for Zoom. 3190 FFI_USE_Torch bool // for Torch. 3191 FFI_USE_DisplaySurface bool // for DisplaySurface. 3192 FFI_USE_LogicalSurface bool // for LogicalSurface. 3193 FFI_USE_Cursor bool // for Cursor. 3194 FFI_USE_RestrictOwnAudio bool // for RestrictOwnAudio. 3195 FFI_USE_SuppressLocalAudioPlayback bool // for SuppressLocalAudioPlayback. 3196 3197 FFI_USE bool 3198 } 3199 3200 // FromRef calls UpdateFrom and returns a MediaTrackSupportedConstraints with all fields set. 3201 func (p MediaTrackSupportedConstraints) FromRef(ref js.Ref) MediaTrackSupportedConstraints { 3202 p.UpdateFrom(ref) 3203 return p 3204 } 3205 3206 // New creates a new MediaTrackSupportedConstraints in the application heap. 3207 func (p MediaTrackSupportedConstraints) New() js.Ref { 3208 return bindings.MediaTrackSupportedConstraintsJSLoad( 3209 js.Pointer(&p), js.True, 0, 3210 ) 3211 } 3212 3213 // UpdateFrom copies value of all fields of the heap object to p. 3214 func (p *MediaTrackSupportedConstraints) UpdateFrom(ref js.Ref) { 3215 bindings.MediaTrackSupportedConstraintsJSStore( 3216 js.Pointer(p), ref, 3217 ) 3218 } 3219 3220 // Update writes all fields of the p to the heap object referenced by ref. 3221 func (p *MediaTrackSupportedConstraints) Update(ref js.Ref) { 3222 bindings.MediaTrackSupportedConstraintsJSLoad( 3223 js.Pointer(p), js.False, ref, 3224 ) 3225 } 3226 3227 // FreeMembers frees fields with heap reference, if recursive is true 3228 // free all heap references reachable from p. 3229 func (p *MediaTrackSupportedConstraints) FreeMembers(recursive bool) { 3230 } 3231 3232 type MediaDevices struct { 3233 EventTarget 3234 } 3235 3236 func (this MediaDevices) Once() MediaDevices { 3237 this.ref.Once() 3238 return this 3239 } 3240 3241 func (this MediaDevices) Ref() js.Ref { 3242 return this.EventTarget.Ref() 3243 } 3244 3245 func (this MediaDevices) FromRef(ref js.Ref) MediaDevices { 3246 this.EventTarget = this.EventTarget.FromRef(ref) 3247 return this 3248 } 3249 3250 func (this MediaDevices) Free() { 3251 this.ref.Free() 3252 } 3253 3254 // HasFuncEnumerateDevices returns true if the method "MediaDevices.enumerateDevices" exists. 3255 func (this MediaDevices) HasFuncEnumerateDevices() bool { 3256 return js.True == bindings.HasFuncMediaDevicesEnumerateDevices( 3257 this.ref, 3258 ) 3259 } 3260 3261 // FuncEnumerateDevices returns the method "MediaDevices.enumerateDevices". 3262 func (this MediaDevices) FuncEnumerateDevices() (fn js.Func[func() js.Promise[js.Array[MediaDeviceInfo]]]) { 3263 bindings.FuncMediaDevicesEnumerateDevices( 3264 this.ref, js.Pointer(&fn), 3265 ) 3266 return 3267 } 3268 3269 // EnumerateDevices calls the method "MediaDevices.enumerateDevices". 3270 func (this MediaDevices) EnumerateDevices() (ret js.Promise[js.Array[MediaDeviceInfo]]) { 3271 bindings.CallMediaDevicesEnumerateDevices( 3272 this.ref, js.Pointer(&ret), 3273 ) 3274 3275 return 3276 } 3277 3278 // TryEnumerateDevices calls the method "MediaDevices.enumerateDevices" 3279 // in a try/catch block and returns (_, err, ok = false) when it went through 3280 // the catch clause. 3281 func (this MediaDevices) TryEnumerateDevices() (ret js.Promise[js.Array[MediaDeviceInfo]], exception js.Any, ok bool) { 3282 ok = js.True == bindings.TryMediaDevicesEnumerateDevices( 3283 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3284 ) 3285 3286 return 3287 } 3288 3289 // HasFuncGetDisplayMedia returns true if the method "MediaDevices.getDisplayMedia" exists. 3290 func (this MediaDevices) HasFuncGetDisplayMedia() bool { 3291 return js.True == bindings.HasFuncMediaDevicesGetDisplayMedia( 3292 this.ref, 3293 ) 3294 } 3295 3296 // FuncGetDisplayMedia returns the method "MediaDevices.getDisplayMedia". 3297 func (this MediaDevices) FuncGetDisplayMedia() (fn js.Func[func(options DisplayMediaStreamOptions) js.Promise[MediaStream]]) { 3298 bindings.FuncMediaDevicesGetDisplayMedia( 3299 this.ref, js.Pointer(&fn), 3300 ) 3301 return 3302 } 3303 3304 // GetDisplayMedia calls the method "MediaDevices.getDisplayMedia". 3305 func (this MediaDevices) GetDisplayMedia(options DisplayMediaStreamOptions) (ret js.Promise[MediaStream]) { 3306 bindings.CallMediaDevicesGetDisplayMedia( 3307 this.ref, js.Pointer(&ret), 3308 js.Pointer(&options), 3309 ) 3310 3311 return 3312 } 3313 3314 // TryGetDisplayMedia calls the method "MediaDevices.getDisplayMedia" 3315 // in a try/catch block and returns (_, err, ok = false) when it went through 3316 // the catch clause. 3317 func (this MediaDevices) TryGetDisplayMedia(options DisplayMediaStreamOptions) (ret js.Promise[MediaStream], exception js.Any, ok bool) { 3318 ok = js.True == bindings.TryMediaDevicesGetDisplayMedia( 3319 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3320 js.Pointer(&options), 3321 ) 3322 3323 return 3324 } 3325 3326 // HasFuncGetDisplayMedia1 returns true if the method "MediaDevices.getDisplayMedia" exists. 3327 func (this MediaDevices) HasFuncGetDisplayMedia1() bool { 3328 return js.True == bindings.HasFuncMediaDevicesGetDisplayMedia1( 3329 this.ref, 3330 ) 3331 } 3332 3333 // FuncGetDisplayMedia1 returns the method "MediaDevices.getDisplayMedia". 3334 func (this MediaDevices) FuncGetDisplayMedia1() (fn js.Func[func() js.Promise[MediaStream]]) { 3335 bindings.FuncMediaDevicesGetDisplayMedia1( 3336 this.ref, js.Pointer(&fn), 3337 ) 3338 return 3339 } 3340 3341 // GetDisplayMedia1 calls the method "MediaDevices.getDisplayMedia". 3342 func (this MediaDevices) GetDisplayMedia1() (ret js.Promise[MediaStream]) { 3343 bindings.CallMediaDevicesGetDisplayMedia1( 3344 this.ref, js.Pointer(&ret), 3345 ) 3346 3347 return 3348 } 3349 3350 // TryGetDisplayMedia1 calls the method "MediaDevices.getDisplayMedia" 3351 // in a try/catch block and returns (_, err, ok = false) when it went through 3352 // the catch clause. 3353 func (this MediaDevices) TryGetDisplayMedia1() (ret js.Promise[MediaStream], exception js.Any, ok bool) { 3354 ok = js.True == bindings.TryMediaDevicesGetDisplayMedia1( 3355 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3356 ) 3357 3358 return 3359 } 3360 3361 // HasFuncSetSupportedCaptureActions returns true if the method "MediaDevices.setSupportedCaptureActions" exists. 3362 func (this MediaDevices) HasFuncSetSupportedCaptureActions() bool { 3363 return js.True == bindings.HasFuncMediaDevicesSetSupportedCaptureActions( 3364 this.ref, 3365 ) 3366 } 3367 3368 // FuncSetSupportedCaptureActions returns the method "MediaDevices.setSupportedCaptureActions". 3369 func (this MediaDevices) FuncSetSupportedCaptureActions() (fn js.Func[func(actions js.Array[js.String])]) { 3370 bindings.FuncMediaDevicesSetSupportedCaptureActions( 3371 this.ref, js.Pointer(&fn), 3372 ) 3373 return 3374 } 3375 3376 // SetSupportedCaptureActions calls the method "MediaDevices.setSupportedCaptureActions". 3377 func (this MediaDevices) SetSupportedCaptureActions(actions js.Array[js.String]) (ret js.Void) { 3378 bindings.CallMediaDevicesSetSupportedCaptureActions( 3379 this.ref, js.Pointer(&ret), 3380 actions.Ref(), 3381 ) 3382 3383 return 3384 } 3385 3386 // TrySetSupportedCaptureActions calls the method "MediaDevices.setSupportedCaptureActions" 3387 // in a try/catch block and returns (_, err, ok = false) when it went through 3388 // the catch clause. 3389 func (this MediaDevices) TrySetSupportedCaptureActions(actions js.Array[js.String]) (ret js.Void, exception js.Any, ok bool) { 3390 ok = js.True == bindings.TryMediaDevicesSetSupportedCaptureActions( 3391 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3392 actions.Ref(), 3393 ) 3394 3395 return 3396 } 3397 3398 // HasFuncSelectAudioOutput returns true if the method "MediaDevices.selectAudioOutput" exists. 3399 func (this MediaDevices) HasFuncSelectAudioOutput() bool { 3400 return js.True == bindings.HasFuncMediaDevicesSelectAudioOutput( 3401 this.ref, 3402 ) 3403 } 3404 3405 // FuncSelectAudioOutput returns the method "MediaDevices.selectAudioOutput". 3406 func (this MediaDevices) FuncSelectAudioOutput() (fn js.Func[func(options AudioOutputOptions) js.Promise[MediaDeviceInfo]]) { 3407 bindings.FuncMediaDevicesSelectAudioOutput( 3408 this.ref, js.Pointer(&fn), 3409 ) 3410 return 3411 } 3412 3413 // SelectAudioOutput calls the method "MediaDevices.selectAudioOutput". 3414 func (this MediaDevices) SelectAudioOutput(options AudioOutputOptions) (ret js.Promise[MediaDeviceInfo]) { 3415 bindings.CallMediaDevicesSelectAudioOutput( 3416 this.ref, js.Pointer(&ret), 3417 js.Pointer(&options), 3418 ) 3419 3420 return 3421 } 3422 3423 // TrySelectAudioOutput calls the method "MediaDevices.selectAudioOutput" 3424 // in a try/catch block and returns (_, err, ok = false) when it went through 3425 // the catch clause. 3426 func (this MediaDevices) TrySelectAudioOutput(options AudioOutputOptions) (ret js.Promise[MediaDeviceInfo], exception js.Any, ok bool) { 3427 ok = js.True == bindings.TryMediaDevicesSelectAudioOutput( 3428 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3429 js.Pointer(&options), 3430 ) 3431 3432 return 3433 } 3434 3435 // HasFuncSelectAudioOutput1 returns true if the method "MediaDevices.selectAudioOutput" exists. 3436 func (this MediaDevices) HasFuncSelectAudioOutput1() bool { 3437 return js.True == bindings.HasFuncMediaDevicesSelectAudioOutput1( 3438 this.ref, 3439 ) 3440 } 3441 3442 // FuncSelectAudioOutput1 returns the method "MediaDevices.selectAudioOutput". 3443 func (this MediaDevices) FuncSelectAudioOutput1() (fn js.Func[func() js.Promise[MediaDeviceInfo]]) { 3444 bindings.FuncMediaDevicesSelectAudioOutput1( 3445 this.ref, js.Pointer(&fn), 3446 ) 3447 return 3448 } 3449 3450 // SelectAudioOutput1 calls the method "MediaDevices.selectAudioOutput". 3451 func (this MediaDevices) SelectAudioOutput1() (ret js.Promise[MediaDeviceInfo]) { 3452 bindings.CallMediaDevicesSelectAudioOutput1( 3453 this.ref, js.Pointer(&ret), 3454 ) 3455 3456 return 3457 } 3458 3459 // TrySelectAudioOutput1 calls the method "MediaDevices.selectAudioOutput" 3460 // in a try/catch block and returns (_, err, ok = false) when it went through 3461 // the catch clause. 3462 func (this MediaDevices) TrySelectAudioOutput1() (ret js.Promise[MediaDeviceInfo], exception js.Any, ok bool) { 3463 ok = js.True == bindings.TryMediaDevicesSelectAudioOutput1( 3464 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3465 ) 3466 3467 return 3468 } 3469 3470 // HasFuncSetCaptureHandleConfig returns true if the method "MediaDevices.setCaptureHandleConfig" exists. 3471 func (this MediaDevices) HasFuncSetCaptureHandleConfig() bool { 3472 return js.True == bindings.HasFuncMediaDevicesSetCaptureHandleConfig( 3473 this.ref, 3474 ) 3475 } 3476 3477 // FuncSetCaptureHandleConfig returns the method "MediaDevices.setCaptureHandleConfig". 3478 func (this MediaDevices) FuncSetCaptureHandleConfig() (fn js.Func[func(config CaptureHandleConfig)]) { 3479 bindings.FuncMediaDevicesSetCaptureHandleConfig( 3480 this.ref, js.Pointer(&fn), 3481 ) 3482 return 3483 } 3484 3485 // SetCaptureHandleConfig calls the method "MediaDevices.setCaptureHandleConfig". 3486 func (this MediaDevices) SetCaptureHandleConfig(config CaptureHandleConfig) (ret js.Void) { 3487 bindings.CallMediaDevicesSetCaptureHandleConfig( 3488 this.ref, js.Pointer(&ret), 3489 js.Pointer(&config), 3490 ) 3491 3492 return 3493 } 3494 3495 // TrySetCaptureHandleConfig calls the method "MediaDevices.setCaptureHandleConfig" 3496 // in a try/catch block and returns (_, err, ok = false) when it went through 3497 // the catch clause. 3498 func (this MediaDevices) TrySetCaptureHandleConfig(config CaptureHandleConfig) (ret js.Void, exception js.Any, ok bool) { 3499 ok = js.True == bindings.TryMediaDevicesSetCaptureHandleConfig( 3500 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3501 js.Pointer(&config), 3502 ) 3503 3504 return 3505 } 3506 3507 // HasFuncSetCaptureHandleConfig1 returns true if the method "MediaDevices.setCaptureHandleConfig" exists. 3508 func (this MediaDevices) HasFuncSetCaptureHandleConfig1() bool { 3509 return js.True == bindings.HasFuncMediaDevicesSetCaptureHandleConfig1( 3510 this.ref, 3511 ) 3512 } 3513 3514 // FuncSetCaptureHandleConfig1 returns the method "MediaDevices.setCaptureHandleConfig". 3515 func (this MediaDevices) FuncSetCaptureHandleConfig1() (fn js.Func[func()]) { 3516 bindings.FuncMediaDevicesSetCaptureHandleConfig1( 3517 this.ref, js.Pointer(&fn), 3518 ) 3519 return 3520 } 3521 3522 // SetCaptureHandleConfig1 calls the method "MediaDevices.setCaptureHandleConfig". 3523 func (this MediaDevices) SetCaptureHandleConfig1() (ret js.Void) { 3524 bindings.CallMediaDevicesSetCaptureHandleConfig1( 3525 this.ref, js.Pointer(&ret), 3526 ) 3527 3528 return 3529 } 3530 3531 // TrySetCaptureHandleConfig1 calls the method "MediaDevices.setCaptureHandleConfig" 3532 // in a try/catch block and returns (_, err, ok = false) when it went through 3533 // the catch clause. 3534 func (this MediaDevices) TrySetCaptureHandleConfig1() (ret js.Void, exception js.Any, ok bool) { 3535 ok = js.True == bindings.TryMediaDevicesSetCaptureHandleConfig1( 3536 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3537 ) 3538 3539 return 3540 } 3541 3542 // HasFuncGetViewportMedia returns true if the method "MediaDevices.getViewportMedia" exists. 3543 func (this MediaDevices) HasFuncGetViewportMedia() bool { 3544 return js.True == bindings.HasFuncMediaDevicesGetViewportMedia( 3545 this.ref, 3546 ) 3547 } 3548 3549 // FuncGetViewportMedia returns the method "MediaDevices.getViewportMedia". 3550 func (this MediaDevices) FuncGetViewportMedia() (fn js.Func[func(constraints ViewportMediaStreamConstraints) js.Promise[MediaStream]]) { 3551 bindings.FuncMediaDevicesGetViewportMedia( 3552 this.ref, js.Pointer(&fn), 3553 ) 3554 return 3555 } 3556 3557 // GetViewportMedia calls the method "MediaDevices.getViewportMedia". 3558 func (this MediaDevices) GetViewportMedia(constraints ViewportMediaStreamConstraints) (ret js.Promise[MediaStream]) { 3559 bindings.CallMediaDevicesGetViewportMedia( 3560 this.ref, js.Pointer(&ret), 3561 js.Pointer(&constraints), 3562 ) 3563 3564 return 3565 } 3566 3567 // TryGetViewportMedia calls the method "MediaDevices.getViewportMedia" 3568 // in a try/catch block and returns (_, err, ok = false) when it went through 3569 // the catch clause. 3570 func (this MediaDevices) TryGetViewportMedia(constraints ViewportMediaStreamConstraints) (ret js.Promise[MediaStream], exception js.Any, ok bool) { 3571 ok = js.True == bindings.TryMediaDevicesGetViewportMedia( 3572 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3573 js.Pointer(&constraints), 3574 ) 3575 3576 return 3577 } 3578 3579 // HasFuncGetViewportMedia1 returns true if the method "MediaDevices.getViewportMedia" exists. 3580 func (this MediaDevices) HasFuncGetViewportMedia1() bool { 3581 return js.True == bindings.HasFuncMediaDevicesGetViewportMedia1( 3582 this.ref, 3583 ) 3584 } 3585 3586 // FuncGetViewportMedia1 returns the method "MediaDevices.getViewportMedia". 3587 func (this MediaDevices) FuncGetViewportMedia1() (fn js.Func[func() js.Promise[MediaStream]]) { 3588 bindings.FuncMediaDevicesGetViewportMedia1( 3589 this.ref, js.Pointer(&fn), 3590 ) 3591 return 3592 } 3593 3594 // GetViewportMedia1 calls the method "MediaDevices.getViewportMedia". 3595 func (this MediaDevices) GetViewportMedia1() (ret js.Promise[MediaStream]) { 3596 bindings.CallMediaDevicesGetViewportMedia1( 3597 this.ref, js.Pointer(&ret), 3598 ) 3599 3600 return 3601 } 3602 3603 // TryGetViewportMedia1 calls the method "MediaDevices.getViewportMedia" 3604 // in a try/catch block and returns (_, err, ok = false) when it went through 3605 // the catch clause. 3606 func (this MediaDevices) TryGetViewportMedia1() (ret js.Promise[MediaStream], exception js.Any, ok bool) { 3607 ok = js.True == bindings.TryMediaDevicesGetViewportMedia1( 3608 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3609 ) 3610 3611 return 3612 } 3613 3614 // HasFuncGetSupportedConstraints returns true if the method "MediaDevices.getSupportedConstraints" exists. 3615 func (this MediaDevices) HasFuncGetSupportedConstraints() bool { 3616 return js.True == bindings.HasFuncMediaDevicesGetSupportedConstraints( 3617 this.ref, 3618 ) 3619 } 3620 3621 // FuncGetSupportedConstraints returns the method "MediaDevices.getSupportedConstraints". 3622 func (this MediaDevices) FuncGetSupportedConstraints() (fn js.Func[func() MediaTrackSupportedConstraints]) { 3623 bindings.FuncMediaDevicesGetSupportedConstraints( 3624 this.ref, js.Pointer(&fn), 3625 ) 3626 return 3627 } 3628 3629 // GetSupportedConstraints calls the method "MediaDevices.getSupportedConstraints". 3630 func (this MediaDevices) GetSupportedConstraints() (ret MediaTrackSupportedConstraints) { 3631 bindings.CallMediaDevicesGetSupportedConstraints( 3632 this.ref, js.Pointer(&ret), 3633 ) 3634 3635 return 3636 } 3637 3638 // TryGetSupportedConstraints calls the method "MediaDevices.getSupportedConstraints" 3639 // in a try/catch block and returns (_, err, ok = false) when it went through 3640 // the catch clause. 3641 func (this MediaDevices) TryGetSupportedConstraints() (ret MediaTrackSupportedConstraints, exception js.Any, ok bool) { 3642 ok = js.True == bindings.TryMediaDevicesGetSupportedConstraints( 3643 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3644 ) 3645 3646 return 3647 } 3648 3649 // HasFuncGetUserMedia returns true if the method "MediaDevices.getUserMedia" exists. 3650 func (this MediaDevices) HasFuncGetUserMedia() bool { 3651 return js.True == bindings.HasFuncMediaDevicesGetUserMedia( 3652 this.ref, 3653 ) 3654 } 3655 3656 // FuncGetUserMedia returns the method "MediaDevices.getUserMedia". 3657 func (this MediaDevices) FuncGetUserMedia() (fn js.Func[func(constraints MediaStreamConstraints) js.Promise[MediaStream]]) { 3658 bindings.FuncMediaDevicesGetUserMedia( 3659 this.ref, js.Pointer(&fn), 3660 ) 3661 return 3662 } 3663 3664 // GetUserMedia calls the method "MediaDevices.getUserMedia". 3665 func (this MediaDevices) GetUserMedia(constraints MediaStreamConstraints) (ret js.Promise[MediaStream]) { 3666 bindings.CallMediaDevicesGetUserMedia( 3667 this.ref, js.Pointer(&ret), 3668 js.Pointer(&constraints), 3669 ) 3670 3671 return 3672 } 3673 3674 // TryGetUserMedia calls the method "MediaDevices.getUserMedia" 3675 // in a try/catch block and returns (_, err, ok = false) when it went through 3676 // the catch clause. 3677 func (this MediaDevices) TryGetUserMedia(constraints MediaStreamConstraints) (ret js.Promise[MediaStream], exception js.Any, ok bool) { 3678 ok = js.True == bindings.TryMediaDevicesGetUserMedia( 3679 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3680 js.Pointer(&constraints), 3681 ) 3682 3683 return 3684 } 3685 3686 // HasFuncGetUserMedia1 returns true if the method "MediaDevices.getUserMedia" exists. 3687 func (this MediaDevices) HasFuncGetUserMedia1() bool { 3688 return js.True == bindings.HasFuncMediaDevicesGetUserMedia1( 3689 this.ref, 3690 ) 3691 } 3692 3693 // FuncGetUserMedia1 returns the method "MediaDevices.getUserMedia". 3694 func (this MediaDevices) FuncGetUserMedia1() (fn js.Func[func() js.Promise[MediaStream]]) { 3695 bindings.FuncMediaDevicesGetUserMedia1( 3696 this.ref, js.Pointer(&fn), 3697 ) 3698 return 3699 } 3700 3701 // GetUserMedia1 calls the method "MediaDevices.getUserMedia". 3702 func (this MediaDevices) GetUserMedia1() (ret js.Promise[MediaStream]) { 3703 bindings.CallMediaDevicesGetUserMedia1( 3704 this.ref, js.Pointer(&ret), 3705 ) 3706 3707 return 3708 } 3709 3710 // TryGetUserMedia1 calls the method "MediaDevices.getUserMedia" 3711 // in a try/catch block and returns (_, err, ok = false) when it went through 3712 // the catch clause. 3713 func (this MediaDevices) TryGetUserMedia1() (ret js.Promise[MediaStream], exception js.Any, ok bool) { 3714 ok = js.True == bindings.TryMediaDevicesGetUserMedia1( 3715 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3716 ) 3717 3718 return 3719 } 3720 3721 type SerialPortInfo struct { 3722 // UsbVendorId is "SerialPortInfo.usbVendorId" 3723 // 3724 // Optional 3725 // 3726 // NOTE: FFI_USE_UsbVendorId MUST be set to true to make this field effective. 3727 UsbVendorId uint16 3728 // UsbProductId is "SerialPortInfo.usbProductId" 3729 // 3730 // Optional 3731 // 3732 // NOTE: FFI_USE_UsbProductId MUST be set to true to make this field effective. 3733 UsbProductId uint16 3734 // BluetoothServiceClassId is "SerialPortInfo.bluetoothServiceClassId" 3735 // 3736 // Optional 3737 BluetoothServiceClassId BluetoothServiceUUID 3738 3739 FFI_USE_UsbVendorId bool // for UsbVendorId. 3740 FFI_USE_UsbProductId bool // for UsbProductId. 3741 3742 FFI_USE bool 3743 } 3744 3745 // FromRef calls UpdateFrom and returns a SerialPortInfo with all fields set. 3746 func (p SerialPortInfo) FromRef(ref js.Ref) SerialPortInfo { 3747 p.UpdateFrom(ref) 3748 return p 3749 } 3750 3751 // New creates a new SerialPortInfo in the application heap. 3752 func (p SerialPortInfo) New() js.Ref { 3753 return bindings.SerialPortInfoJSLoad( 3754 js.Pointer(&p), js.True, 0, 3755 ) 3756 } 3757 3758 // UpdateFrom copies value of all fields of the heap object to p. 3759 func (p *SerialPortInfo) UpdateFrom(ref js.Ref) { 3760 bindings.SerialPortInfoJSStore( 3761 js.Pointer(p), ref, 3762 ) 3763 } 3764 3765 // Update writes all fields of the p to the heap object referenced by ref. 3766 func (p *SerialPortInfo) Update(ref js.Ref) { 3767 bindings.SerialPortInfoJSLoad( 3768 js.Pointer(p), js.False, ref, 3769 ) 3770 } 3771 3772 // FreeMembers frees fields with heap reference, if recursive is true 3773 // free all heap references reachable from p. 3774 func (p *SerialPortInfo) FreeMembers(recursive bool) { 3775 js.Free( 3776 p.BluetoothServiceClassId.Ref(), 3777 ) 3778 p.BluetoothServiceClassId = p.BluetoothServiceClassId.FromRef(js.Undefined) 3779 } 3780 3781 type ParityType uint32 3782 3783 const ( 3784 _ ParityType = iota 3785 3786 ParityType_NONE 3787 ParityType_EVEN 3788 ParityType_ODD 3789 ) 3790 3791 func (ParityType) FromRef(str js.Ref) ParityType { 3792 return ParityType(bindings.ConstOfParityType(str)) 3793 } 3794 3795 func (x ParityType) String() (string, bool) { 3796 switch x { 3797 case ParityType_NONE: 3798 return "none", true 3799 case ParityType_EVEN: 3800 return "even", true 3801 case ParityType_ODD: 3802 return "odd", true 3803 default: 3804 return "", false 3805 } 3806 }