github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis31_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package web 5 6 import ( 7 "github.com/primecitizens/pcz/std/core/abi" 8 "github.com/primecitizens/pcz/std/ffi/js" 9 "github.com/primecitizens/pcz/std/plat/js/web/bindings" 10 ) 11 12 type OneOf_GPUBuffer_GPUTexture struct { 13 ref js.Ref 14 } 15 16 func (x OneOf_GPUBuffer_GPUTexture) Ref() js.Ref { 17 return x.ref 18 } 19 20 func (x OneOf_GPUBuffer_GPUTexture) Free() { 21 x.ref.Free() 22 } 23 24 func (x OneOf_GPUBuffer_GPUTexture) FromRef(ref js.Ref) OneOf_GPUBuffer_GPUTexture { 25 return OneOf_GPUBuffer_GPUTexture{ 26 ref: ref, 27 } 28 } 29 30 func (x OneOf_GPUBuffer_GPUTexture) GPUBuffer() GPUBuffer { 31 return GPUBuffer{}.FromRef(x.ref) 32 } 33 34 func (x OneOf_GPUBuffer_GPUTexture) GPUTexture() GPUTexture { 35 return GPUTexture{}.FromRef(x.ref) 36 } 37 38 type MLGPUResource = OneOf_GPUBuffer_GPUTexture 39 40 type MLNamedGPUResources = js.Record[MLGPUResource] 41 42 type MLCommandEncoder struct { 43 ref js.Ref 44 } 45 46 func (this MLCommandEncoder) Once() MLCommandEncoder { 47 this.ref.Once() 48 return this 49 } 50 51 func (this MLCommandEncoder) Ref() js.Ref { 52 return this.ref 53 } 54 55 func (this MLCommandEncoder) FromRef(ref js.Ref) MLCommandEncoder { 56 this.ref = ref 57 return this 58 } 59 60 func (this MLCommandEncoder) Free() { 61 this.ref.Free() 62 } 63 64 // HasFuncDispatch returns true if the method "MLCommandEncoder.dispatch" exists. 65 func (this MLCommandEncoder) HasFuncDispatch() bool { 66 return js.True == bindings.HasFuncMLCommandEncoderDispatch( 67 this.ref, 68 ) 69 } 70 71 // FuncDispatch returns the method "MLCommandEncoder.dispatch". 72 func (this MLCommandEncoder) FuncDispatch() (fn js.Func[func(graph MLGraph, inputs MLNamedGPUResources, outputs MLNamedGPUResources)]) { 73 bindings.FuncMLCommandEncoderDispatch( 74 this.ref, js.Pointer(&fn), 75 ) 76 return 77 } 78 79 // Dispatch calls the method "MLCommandEncoder.dispatch". 80 func (this MLCommandEncoder) Dispatch(graph MLGraph, inputs MLNamedGPUResources, outputs MLNamedGPUResources) (ret js.Void) { 81 bindings.CallMLCommandEncoderDispatch( 82 this.ref, js.Pointer(&ret), 83 graph.Ref(), 84 inputs.Ref(), 85 outputs.Ref(), 86 ) 87 88 return 89 } 90 91 // TryDispatch calls the method "MLCommandEncoder.dispatch" 92 // in a try/catch block and returns (_, err, ok = false) when it went through 93 // the catch clause. 94 func (this MLCommandEncoder) TryDispatch(graph MLGraph, inputs MLNamedGPUResources, outputs MLNamedGPUResources) (ret js.Void, exception js.Any, ok bool) { 95 ok = js.True == bindings.TryMLCommandEncoderDispatch( 96 this.ref, js.Pointer(&ret), js.Pointer(&exception), 97 graph.Ref(), 98 inputs.Ref(), 99 outputs.Ref(), 100 ) 101 102 return 103 } 104 105 // HasFuncFinish returns true if the method "MLCommandEncoder.finish" exists. 106 func (this MLCommandEncoder) HasFuncFinish() bool { 107 return js.True == bindings.HasFuncMLCommandEncoderFinish( 108 this.ref, 109 ) 110 } 111 112 // FuncFinish returns the method "MLCommandEncoder.finish". 113 func (this MLCommandEncoder) FuncFinish() (fn js.Func[func(descriptor GPUCommandBufferDescriptor) GPUCommandBuffer]) { 114 bindings.FuncMLCommandEncoderFinish( 115 this.ref, js.Pointer(&fn), 116 ) 117 return 118 } 119 120 // Finish calls the method "MLCommandEncoder.finish". 121 func (this MLCommandEncoder) Finish(descriptor GPUCommandBufferDescriptor) (ret GPUCommandBuffer) { 122 bindings.CallMLCommandEncoderFinish( 123 this.ref, js.Pointer(&ret), 124 js.Pointer(&descriptor), 125 ) 126 127 return 128 } 129 130 // TryFinish calls the method "MLCommandEncoder.finish" 131 // in a try/catch block and returns (_, err, ok = false) when it went through 132 // the catch clause. 133 func (this MLCommandEncoder) TryFinish(descriptor GPUCommandBufferDescriptor) (ret GPUCommandBuffer, exception js.Any, ok bool) { 134 ok = js.True == bindings.TryMLCommandEncoderFinish( 135 this.ref, js.Pointer(&ret), js.Pointer(&exception), 136 js.Pointer(&descriptor), 137 ) 138 139 return 140 } 141 142 // HasFuncFinish1 returns true if the method "MLCommandEncoder.finish" exists. 143 func (this MLCommandEncoder) HasFuncFinish1() bool { 144 return js.True == bindings.HasFuncMLCommandEncoderFinish1( 145 this.ref, 146 ) 147 } 148 149 // FuncFinish1 returns the method "MLCommandEncoder.finish". 150 func (this MLCommandEncoder) FuncFinish1() (fn js.Func[func() GPUCommandBuffer]) { 151 bindings.FuncMLCommandEncoderFinish1( 152 this.ref, js.Pointer(&fn), 153 ) 154 return 155 } 156 157 // Finish1 calls the method "MLCommandEncoder.finish". 158 func (this MLCommandEncoder) Finish1() (ret GPUCommandBuffer) { 159 bindings.CallMLCommandEncoderFinish1( 160 this.ref, js.Pointer(&ret), 161 ) 162 163 return 164 } 165 166 // TryFinish1 calls the method "MLCommandEncoder.finish" 167 // in a try/catch block and returns (_, err, ok = false) when it went through 168 // the catch clause. 169 func (this MLCommandEncoder) TryFinish1() (ret GPUCommandBuffer, exception js.Any, ok bool) { 170 ok = js.True == bindings.TryMLCommandEncoderFinish1( 171 this.ref, js.Pointer(&ret), js.Pointer(&exception), 172 ) 173 174 return 175 } 176 177 // HasFuncInitializeGraph returns true if the method "MLCommandEncoder.initializeGraph" exists. 178 func (this MLCommandEncoder) HasFuncInitializeGraph() bool { 179 return js.True == bindings.HasFuncMLCommandEncoderInitializeGraph( 180 this.ref, 181 ) 182 } 183 184 // FuncInitializeGraph returns the method "MLCommandEncoder.initializeGraph". 185 func (this MLCommandEncoder) FuncInitializeGraph() (fn js.Func[func(graph MLGraph)]) { 186 bindings.FuncMLCommandEncoderInitializeGraph( 187 this.ref, js.Pointer(&fn), 188 ) 189 return 190 } 191 192 // InitializeGraph calls the method "MLCommandEncoder.initializeGraph". 193 func (this MLCommandEncoder) InitializeGraph(graph MLGraph) (ret js.Void) { 194 bindings.CallMLCommandEncoderInitializeGraph( 195 this.ref, js.Pointer(&ret), 196 graph.Ref(), 197 ) 198 199 return 200 } 201 202 // TryInitializeGraph calls the method "MLCommandEncoder.initializeGraph" 203 // in a try/catch block and returns (_, err, ok = false) when it went through 204 // the catch clause. 205 func (this MLCommandEncoder) TryInitializeGraph(graph MLGraph) (ret js.Void, exception js.Any, ok bool) { 206 ok = js.True == bindings.TryMLCommandEncoderInitializeGraph( 207 this.ref, js.Pointer(&ret), js.Pointer(&exception), 208 graph.Ref(), 209 ) 210 211 return 212 } 213 214 type MLContext struct { 215 ref js.Ref 216 } 217 218 func (this MLContext) Once() MLContext { 219 this.ref.Once() 220 return this 221 } 222 223 func (this MLContext) Ref() js.Ref { 224 return this.ref 225 } 226 227 func (this MLContext) FromRef(ref js.Ref) MLContext { 228 this.ref = ref 229 return this 230 } 231 232 func (this MLContext) Free() { 233 this.ref.Free() 234 } 235 236 // HasFuncCompute returns true if the method "MLContext.compute" exists. 237 func (this MLContext) HasFuncCompute() bool { 238 return js.True == bindings.HasFuncMLContextCompute( 239 this.ref, 240 ) 241 } 242 243 // FuncCompute returns the method "MLContext.compute". 244 func (this MLContext) FuncCompute() (fn js.Func[func(graph MLGraph, inputs MLNamedArrayBufferViews, outputs MLNamedArrayBufferViews) js.Promise[MLComputeResult]]) { 245 bindings.FuncMLContextCompute( 246 this.ref, js.Pointer(&fn), 247 ) 248 return 249 } 250 251 // Compute calls the method "MLContext.compute". 252 func (this MLContext) Compute(graph MLGraph, inputs MLNamedArrayBufferViews, outputs MLNamedArrayBufferViews) (ret js.Promise[MLComputeResult]) { 253 bindings.CallMLContextCompute( 254 this.ref, js.Pointer(&ret), 255 graph.Ref(), 256 inputs.Ref(), 257 outputs.Ref(), 258 ) 259 260 return 261 } 262 263 // TryCompute calls the method "MLContext.compute" 264 // in a try/catch block and returns (_, err, ok = false) when it went through 265 // the catch clause. 266 func (this MLContext) TryCompute(graph MLGraph, inputs MLNamedArrayBufferViews, outputs MLNamedArrayBufferViews) (ret js.Promise[MLComputeResult], exception js.Any, ok bool) { 267 ok = js.True == bindings.TryMLContextCompute( 268 this.ref, js.Pointer(&ret), js.Pointer(&exception), 269 graph.Ref(), 270 inputs.Ref(), 271 outputs.Ref(), 272 ) 273 274 return 275 } 276 277 // HasFuncComputeSync returns true if the method "MLContext.computeSync" exists. 278 func (this MLContext) HasFuncComputeSync() bool { 279 return js.True == bindings.HasFuncMLContextComputeSync( 280 this.ref, 281 ) 282 } 283 284 // FuncComputeSync returns the method "MLContext.computeSync". 285 func (this MLContext) FuncComputeSync() (fn js.Func[func(graph MLGraph, inputs MLNamedArrayBufferViews, outputs MLNamedArrayBufferViews)]) { 286 bindings.FuncMLContextComputeSync( 287 this.ref, js.Pointer(&fn), 288 ) 289 return 290 } 291 292 // ComputeSync calls the method "MLContext.computeSync". 293 func (this MLContext) ComputeSync(graph MLGraph, inputs MLNamedArrayBufferViews, outputs MLNamedArrayBufferViews) (ret js.Void) { 294 bindings.CallMLContextComputeSync( 295 this.ref, js.Pointer(&ret), 296 graph.Ref(), 297 inputs.Ref(), 298 outputs.Ref(), 299 ) 300 301 return 302 } 303 304 // TryComputeSync calls the method "MLContext.computeSync" 305 // in a try/catch block and returns (_, err, ok = false) when it went through 306 // the catch clause. 307 func (this MLContext) TryComputeSync(graph MLGraph, inputs MLNamedArrayBufferViews, outputs MLNamedArrayBufferViews) (ret js.Void, exception js.Any, ok bool) { 308 ok = js.True == bindings.TryMLContextComputeSync( 309 this.ref, js.Pointer(&ret), js.Pointer(&exception), 310 graph.Ref(), 311 inputs.Ref(), 312 outputs.Ref(), 313 ) 314 315 return 316 } 317 318 // HasFuncCreateCommandEncoder returns true if the method "MLContext.createCommandEncoder" exists. 319 func (this MLContext) HasFuncCreateCommandEncoder() bool { 320 return js.True == bindings.HasFuncMLContextCreateCommandEncoder( 321 this.ref, 322 ) 323 } 324 325 // FuncCreateCommandEncoder returns the method "MLContext.createCommandEncoder". 326 func (this MLContext) FuncCreateCommandEncoder() (fn js.Func[func() MLCommandEncoder]) { 327 bindings.FuncMLContextCreateCommandEncoder( 328 this.ref, js.Pointer(&fn), 329 ) 330 return 331 } 332 333 // CreateCommandEncoder calls the method "MLContext.createCommandEncoder". 334 func (this MLContext) CreateCommandEncoder() (ret MLCommandEncoder) { 335 bindings.CallMLContextCreateCommandEncoder( 336 this.ref, js.Pointer(&ret), 337 ) 338 339 return 340 } 341 342 // TryCreateCommandEncoder calls the method "MLContext.createCommandEncoder" 343 // in a try/catch block and returns (_, err, ok = false) when it went through 344 // the catch clause. 345 func (this MLContext) TryCreateCommandEncoder() (ret MLCommandEncoder, exception js.Any, ok bool) { 346 ok = js.True == bindings.TryMLContextCreateCommandEncoder( 347 this.ref, js.Pointer(&ret), js.Pointer(&exception), 348 ) 349 350 return 351 } 352 353 type MLDeviceType uint32 354 355 const ( 356 _ MLDeviceType = iota 357 358 MLDeviceType_CPU 359 MLDeviceType_GPU 360 ) 361 362 func (MLDeviceType) FromRef(str js.Ref) MLDeviceType { 363 return MLDeviceType(bindings.ConstOfMLDeviceType(str)) 364 } 365 366 func (x MLDeviceType) String() (string, bool) { 367 switch x { 368 case MLDeviceType_CPU: 369 return "cpu", true 370 case MLDeviceType_GPU: 371 return "gpu", true 372 default: 373 return "", false 374 } 375 } 376 377 type MLPowerPreference uint32 378 379 const ( 380 _ MLPowerPreference = iota 381 382 MLPowerPreference_DEFAULT 383 MLPowerPreference_HIGH_PERFORMANCE 384 MLPowerPreference_LOW_POWER 385 ) 386 387 func (MLPowerPreference) FromRef(str js.Ref) MLPowerPreference { 388 return MLPowerPreference(bindings.ConstOfMLPowerPreference(str)) 389 } 390 391 func (x MLPowerPreference) String() (string, bool) { 392 switch x { 393 case MLPowerPreference_DEFAULT: 394 return "default", true 395 case MLPowerPreference_HIGH_PERFORMANCE: 396 return "high-performance", true 397 case MLPowerPreference_LOW_POWER: 398 return "low-power", true 399 default: 400 return "", false 401 } 402 } 403 404 type MLContextOptions struct { 405 // DeviceType is "MLContextOptions.deviceType" 406 // 407 // Optional, defaults to "cpu". 408 DeviceType MLDeviceType 409 // PowerPreference is "MLContextOptions.powerPreference" 410 // 411 // Optional, defaults to "default". 412 PowerPreference MLPowerPreference 413 414 FFI_USE bool 415 } 416 417 // FromRef calls UpdateFrom and returns a MLContextOptions with all fields set. 418 func (p MLContextOptions) FromRef(ref js.Ref) MLContextOptions { 419 p.UpdateFrom(ref) 420 return p 421 } 422 423 // New creates a new MLContextOptions in the application heap. 424 func (p MLContextOptions) New() js.Ref { 425 return bindings.MLContextOptionsJSLoad( 426 js.Pointer(&p), js.True, 0, 427 ) 428 } 429 430 // UpdateFrom copies value of all fields of the heap object to p. 431 func (p *MLContextOptions) UpdateFrom(ref js.Ref) { 432 bindings.MLContextOptionsJSStore( 433 js.Pointer(p), ref, 434 ) 435 } 436 437 // Update writes all fields of the p to the heap object referenced by ref. 438 func (p *MLContextOptions) Update(ref js.Ref) { 439 bindings.MLContextOptionsJSLoad( 440 js.Pointer(p), js.False, ref, 441 ) 442 } 443 444 // FreeMembers frees fields with heap reference, if recursive is true 445 // free all heap references reachable from p. 446 func (p *MLContextOptions) FreeMembers(recursive bool) { 447 } 448 449 type ML struct { 450 ref js.Ref 451 } 452 453 func (this ML) Once() ML { 454 this.ref.Once() 455 return this 456 } 457 458 func (this ML) Ref() js.Ref { 459 return this.ref 460 } 461 462 func (this ML) FromRef(ref js.Ref) ML { 463 this.ref = ref 464 return this 465 } 466 467 func (this ML) Free() { 468 this.ref.Free() 469 } 470 471 // HasFuncCreateContext returns true if the method "ML.createContext" exists. 472 func (this ML) HasFuncCreateContext() bool { 473 return js.True == bindings.HasFuncMLCreateContext( 474 this.ref, 475 ) 476 } 477 478 // FuncCreateContext returns the method "ML.createContext". 479 func (this ML) FuncCreateContext() (fn js.Func[func(options MLContextOptions) js.Promise[MLContext]]) { 480 bindings.FuncMLCreateContext( 481 this.ref, js.Pointer(&fn), 482 ) 483 return 484 } 485 486 // CreateContext calls the method "ML.createContext". 487 func (this ML) CreateContext(options MLContextOptions) (ret js.Promise[MLContext]) { 488 bindings.CallMLCreateContext( 489 this.ref, js.Pointer(&ret), 490 js.Pointer(&options), 491 ) 492 493 return 494 } 495 496 // TryCreateContext calls the method "ML.createContext" 497 // in a try/catch block and returns (_, err, ok = false) when it went through 498 // the catch clause. 499 func (this ML) TryCreateContext(options MLContextOptions) (ret js.Promise[MLContext], exception js.Any, ok bool) { 500 ok = js.True == bindings.TryMLCreateContext( 501 this.ref, js.Pointer(&ret), js.Pointer(&exception), 502 js.Pointer(&options), 503 ) 504 505 return 506 } 507 508 // HasFuncCreateContext1 returns true if the method "ML.createContext" exists. 509 func (this ML) HasFuncCreateContext1() bool { 510 return js.True == bindings.HasFuncMLCreateContext1( 511 this.ref, 512 ) 513 } 514 515 // FuncCreateContext1 returns the method "ML.createContext". 516 func (this ML) FuncCreateContext1() (fn js.Func[func() js.Promise[MLContext]]) { 517 bindings.FuncMLCreateContext1( 518 this.ref, js.Pointer(&fn), 519 ) 520 return 521 } 522 523 // CreateContext1 calls the method "ML.createContext". 524 func (this ML) CreateContext1() (ret js.Promise[MLContext]) { 525 bindings.CallMLCreateContext1( 526 this.ref, js.Pointer(&ret), 527 ) 528 529 return 530 } 531 532 // TryCreateContext1 calls the method "ML.createContext" 533 // in a try/catch block and returns (_, err, ok = false) when it went through 534 // the catch clause. 535 func (this ML) TryCreateContext1() (ret js.Promise[MLContext], exception js.Any, ok bool) { 536 ok = js.True == bindings.TryMLCreateContext1( 537 this.ref, js.Pointer(&ret), js.Pointer(&exception), 538 ) 539 540 return 541 } 542 543 // HasFuncCreateContext2 returns true if the method "ML.createContext" exists. 544 func (this ML) HasFuncCreateContext2() bool { 545 return js.True == bindings.HasFuncMLCreateContext2( 546 this.ref, 547 ) 548 } 549 550 // FuncCreateContext2 returns the method "ML.createContext". 551 func (this ML) FuncCreateContext2() (fn js.Func[func(gpuDevice GPUDevice) js.Promise[MLContext]]) { 552 bindings.FuncMLCreateContext2( 553 this.ref, js.Pointer(&fn), 554 ) 555 return 556 } 557 558 // CreateContext2 calls the method "ML.createContext". 559 func (this ML) CreateContext2(gpuDevice GPUDevice) (ret js.Promise[MLContext]) { 560 bindings.CallMLCreateContext2( 561 this.ref, js.Pointer(&ret), 562 gpuDevice.Ref(), 563 ) 564 565 return 566 } 567 568 // TryCreateContext2 calls the method "ML.createContext" 569 // in a try/catch block and returns (_, err, ok = false) when it went through 570 // the catch clause. 571 func (this ML) TryCreateContext2(gpuDevice GPUDevice) (ret js.Promise[MLContext], exception js.Any, ok bool) { 572 ok = js.True == bindings.TryMLCreateContext2( 573 this.ref, js.Pointer(&ret), js.Pointer(&exception), 574 gpuDevice.Ref(), 575 ) 576 577 return 578 } 579 580 // HasFuncCreateContextSync returns true if the method "ML.createContextSync" exists. 581 func (this ML) HasFuncCreateContextSync() bool { 582 return js.True == bindings.HasFuncMLCreateContextSync( 583 this.ref, 584 ) 585 } 586 587 // FuncCreateContextSync returns the method "ML.createContextSync". 588 func (this ML) FuncCreateContextSync() (fn js.Func[func(options MLContextOptions) MLContext]) { 589 bindings.FuncMLCreateContextSync( 590 this.ref, js.Pointer(&fn), 591 ) 592 return 593 } 594 595 // CreateContextSync calls the method "ML.createContextSync". 596 func (this ML) CreateContextSync(options MLContextOptions) (ret MLContext) { 597 bindings.CallMLCreateContextSync( 598 this.ref, js.Pointer(&ret), 599 js.Pointer(&options), 600 ) 601 602 return 603 } 604 605 // TryCreateContextSync calls the method "ML.createContextSync" 606 // in a try/catch block and returns (_, err, ok = false) when it went through 607 // the catch clause. 608 func (this ML) TryCreateContextSync(options MLContextOptions) (ret MLContext, exception js.Any, ok bool) { 609 ok = js.True == bindings.TryMLCreateContextSync( 610 this.ref, js.Pointer(&ret), js.Pointer(&exception), 611 js.Pointer(&options), 612 ) 613 614 return 615 } 616 617 // HasFuncCreateContextSync1 returns true if the method "ML.createContextSync" exists. 618 func (this ML) HasFuncCreateContextSync1() bool { 619 return js.True == bindings.HasFuncMLCreateContextSync1( 620 this.ref, 621 ) 622 } 623 624 // FuncCreateContextSync1 returns the method "ML.createContextSync". 625 func (this ML) FuncCreateContextSync1() (fn js.Func[func() MLContext]) { 626 bindings.FuncMLCreateContextSync1( 627 this.ref, js.Pointer(&fn), 628 ) 629 return 630 } 631 632 // CreateContextSync1 calls the method "ML.createContextSync". 633 func (this ML) CreateContextSync1() (ret MLContext) { 634 bindings.CallMLCreateContextSync1( 635 this.ref, js.Pointer(&ret), 636 ) 637 638 return 639 } 640 641 // TryCreateContextSync1 calls the method "ML.createContextSync" 642 // in a try/catch block and returns (_, err, ok = false) when it went through 643 // the catch clause. 644 func (this ML) TryCreateContextSync1() (ret MLContext, exception js.Any, ok bool) { 645 ok = js.True == bindings.TryMLCreateContextSync1( 646 this.ref, js.Pointer(&ret), js.Pointer(&exception), 647 ) 648 649 return 650 } 651 652 // HasFuncCreateContextSync2 returns true if the method "ML.createContextSync" exists. 653 func (this ML) HasFuncCreateContextSync2() bool { 654 return js.True == bindings.HasFuncMLCreateContextSync2( 655 this.ref, 656 ) 657 } 658 659 // FuncCreateContextSync2 returns the method "ML.createContextSync". 660 func (this ML) FuncCreateContextSync2() (fn js.Func[func(gpuDevice GPUDevice) MLContext]) { 661 bindings.FuncMLCreateContextSync2( 662 this.ref, js.Pointer(&fn), 663 ) 664 return 665 } 666 667 // CreateContextSync2 calls the method "ML.createContextSync". 668 func (this ML) CreateContextSync2(gpuDevice GPUDevice) (ret MLContext) { 669 bindings.CallMLCreateContextSync2( 670 this.ref, js.Pointer(&ret), 671 gpuDevice.Ref(), 672 ) 673 674 return 675 } 676 677 // TryCreateContextSync2 calls the method "ML.createContextSync" 678 // in a try/catch block and returns (_, err, ok = false) when it went through 679 // the catch clause. 680 func (this ML) TryCreateContextSync2(gpuDevice GPUDevice) (ret MLContext, exception js.Any, ok bool) { 681 ok = js.True == bindings.TryMLCreateContextSync2( 682 this.ref, js.Pointer(&ret), js.Pointer(&exception), 683 gpuDevice.Ref(), 684 ) 685 686 return 687 } 688 689 type ConnectionType uint32 690 691 const ( 692 _ ConnectionType = iota 693 694 ConnectionType_BLUETOOTH 695 ConnectionType_CELLULAR 696 ConnectionType_ETHERNET 697 ConnectionType_MIXED 698 ConnectionType_NONE 699 ConnectionType_OTHER 700 ConnectionType_UNKNOWN 701 ConnectionType_WIFI 702 ConnectionType_WIMAX 703 ) 704 705 func (ConnectionType) FromRef(str js.Ref) ConnectionType { 706 return ConnectionType(bindings.ConstOfConnectionType(str)) 707 } 708 709 func (x ConnectionType) String() (string, bool) { 710 switch x { 711 case ConnectionType_BLUETOOTH: 712 return "bluetooth", true 713 case ConnectionType_CELLULAR: 714 return "cellular", true 715 case ConnectionType_ETHERNET: 716 return "ethernet", true 717 case ConnectionType_MIXED: 718 return "mixed", true 719 case ConnectionType_NONE: 720 return "none", true 721 case ConnectionType_OTHER: 722 return "other", true 723 case ConnectionType_UNKNOWN: 724 return "unknown", true 725 case ConnectionType_WIFI: 726 return "wifi", true 727 case ConnectionType_WIMAX: 728 return "wimax", true 729 default: 730 return "", false 731 } 732 } 733 734 type EffectiveConnectionType uint32 735 736 const ( 737 _ EffectiveConnectionType = iota 738 739 EffectiveConnectionType_2G 740 EffectiveConnectionType_3G 741 EffectiveConnectionType_4G 742 EffectiveConnectionType_SLOW_2G 743 ) 744 745 func (EffectiveConnectionType) FromRef(str js.Ref) EffectiveConnectionType { 746 return EffectiveConnectionType(bindings.ConstOfEffectiveConnectionType(str)) 747 } 748 749 func (x EffectiveConnectionType) String() (string, bool) { 750 switch x { 751 case EffectiveConnectionType_2G: 752 return "2g", true 753 case EffectiveConnectionType_3G: 754 return "3g", true 755 case EffectiveConnectionType_4G: 756 return "4g", true 757 case EffectiveConnectionType_SLOW_2G: 758 return "slow-2g", true 759 default: 760 return "", false 761 } 762 } 763 764 type Megabit float64 765 766 type Millisecond uint64 767 768 type NetworkInformation struct { 769 EventTarget 770 } 771 772 func (this NetworkInformation) Once() NetworkInformation { 773 this.ref.Once() 774 return this 775 } 776 777 func (this NetworkInformation) Ref() js.Ref { 778 return this.EventTarget.Ref() 779 } 780 781 func (this NetworkInformation) FromRef(ref js.Ref) NetworkInformation { 782 this.EventTarget = this.EventTarget.FromRef(ref) 783 return this 784 } 785 786 func (this NetworkInformation) Free() { 787 this.ref.Free() 788 } 789 790 // Type returns the value of property "NetworkInformation.type". 791 // 792 // It returns ok=false if there is no such property. 793 func (this NetworkInformation) Type() (ret ConnectionType, ok bool) { 794 ok = js.True == bindings.GetNetworkInformationType( 795 this.ref, js.Pointer(&ret), 796 ) 797 return 798 } 799 800 // EffectiveType returns the value of property "NetworkInformation.effectiveType". 801 // 802 // It returns ok=false if there is no such property. 803 func (this NetworkInformation) EffectiveType() (ret EffectiveConnectionType, ok bool) { 804 ok = js.True == bindings.GetNetworkInformationEffectiveType( 805 this.ref, js.Pointer(&ret), 806 ) 807 return 808 } 809 810 // DownlinkMax returns the value of property "NetworkInformation.downlinkMax". 811 // 812 // It returns ok=false if there is no such property. 813 func (this NetworkInformation) DownlinkMax() (ret Megabit, ok bool) { 814 ok = js.True == bindings.GetNetworkInformationDownlinkMax( 815 this.ref, js.Pointer(&ret), 816 ) 817 return 818 } 819 820 // Downlink returns the value of property "NetworkInformation.downlink". 821 // 822 // It returns ok=false if there is no such property. 823 func (this NetworkInformation) Downlink() (ret Megabit, ok bool) { 824 ok = js.True == bindings.GetNetworkInformationDownlink( 825 this.ref, js.Pointer(&ret), 826 ) 827 return 828 } 829 830 // Rtt returns the value of property "NetworkInformation.rtt". 831 // 832 // It returns ok=false if there is no such property. 833 func (this NetworkInformation) Rtt() (ret Millisecond, ok bool) { 834 ok = js.True == bindings.GetNetworkInformationRtt( 835 this.ref, js.Pointer(&ret), 836 ) 837 return 838 } 839 840 // SaveData returns the value of property "NetworkInformation.saveData". 841 // 842 // It returns ok=false if there is no such property. 843 func (this NetworkInformation) SaveData() (ret bool, ok bool) { 844 ok = js.True == bindings.GetNetworkInformationSaveData( 845 this.ref, js.Pointer(&ret), 846 ) 847 return 848 } 849 850 type GPUFeatureName uint32 851 852 const ( 853 _ GPUFeatureName = iota 854 855 GPUFeatureName_DEPTH_CLIP_CONTROL 856 GPUFeatureName_DEPTH_32FLOAT_STENCIL8 857 GPUFeatureName_TEXTURE_COMPRESSION_BC 858 GPUFeatureName_TEXTURE_COMPRESSION_ETC2 859 GPUFeatureName_TEXTURE_COMPRESSION_ASTC 860 GPUFeatureName_TIMESTAMP_QUERY 861 GPUFeatureName_INDIRECT_FIRST_INSTANCE 862 GPUFeatureName_SHADER_F16 863 GPUFeatureName_RG_11B10UFLOAT_RENDERABLE 864 GPUFeatureName_BGRA_8UNORM_STORAGE 865 GPUFeatureName_FLOAT32_FILTERABLE 866 ) 867 868 func (GPUFeatureName) FromRef(str js.Ref) GPUFeatureName { 869 return GPUFeatureName(bindings.ConstOfGPUFeatureName(str)) 870 } 871 872 func (x GPUFeatureName) String() (string, bool) { 873 switch x { 874 case GPUFeatureName_DEPTH_CLIP_CONTROL: 875 return "depth-clip-control", true 876 case GPUFeatureName_DEPTH_32FLOAT_STENCIL8: 877 return "depth32float-stencil8", true 878 case GPUFeatureName_TEXTURE_COMPRESSION_BC: 879 return "texture-compression-bc", true 880 case GPUFeatureName_TEXTURE_COMPRESSION_ETC2: 881 return "texture-compression-etc2", true 882 case GPUFeatureName_TEXTURE_COMPRESSION_ASTC: 883 return "texture-compression-astc", true 884 case GPUFeatureName_TIMESTAMP_QUERY: 885 return "timestamp-query", true 886 case GPUFeatureName_INDIRECT_FIRST_INSTANCE: 887 return "indirect-first-instance", true 888 case GPUFeatureName_SHADER_F16: 889 return "shader-f16", true 890 case GPUFeatureName_RG_11B10UFLOAT_RENDERABLE: 891 return "rg11b10ufloat-renderable", true 892 case GPUFeatureName_BGRA_8UNORM_STORAGE: 893 return "bgra8unorm-storage", true 894 case GPUFeatureName_FLOAT32_FILTERABLE: 895 return "float32-filterable", true 896 default: 897 return "", false 898 } 899 } 900 901 type GPUQueueDescriptor struct { 902 // Label is "GPUQueueDescriptor.label" 903 // 904 // Optional, defaults to "". 905 Label js.String 906 907 FFI_USE bool 908 } 909 910 // FromRef calls UpdateFrom and returns a GPUQueueDescriptor with all fields set. 911 func (p GPUQueueDescriptor) FromRef(ref js.Ref) GPUQueueDescriptor { 912 p.UpdateFrom(ref) 913 return p 914 } 915 916 // New creates a new GPUQueueDescriptor in the application heap. 917 func (p GPUQueueDescriptor) New() js.Ref { 918 return bindings.GPUQueueDescriptorJSLoad( 919 js.Pointer(&p), js.True, 0, 920 ) 921 } 922 923 // UpdateFrom copies value of all fields of the heap object to p. 924 func (p *GPUQueueDescriptor) UpdateFrom(ref js.Ref) { 925 bindings.GPUQueueDescriptorJSStore( 926 js.Pointer(p), ref, 927 ) 928 } 929 930 // Update writes all fields of the p to the heap object referenced by ref. 931 func (p *GPUQueueDescriptor) Update(ref js.Ref) { 932 bindings.GPUQueueDescriptorJSLoad( 933 js.Pointer(p), js.False, ref, 934 ) 935 } 936 937 // FreeMembers frees fields with heap reference, if recursive is true 938 // free all heap references reachable from p. 939 func (p *GPUQueueDescriptor) FreeMembers(recursive bool) { 940 js.Free( 941 p.Label.Ref(), 942 ) 943 p.Label = p.Label.FromRef(js.Undefined) 944 } 945 946 type GPUDeviceDescriptor struct { 947 // RequiredFeatures is "GPUDeviceDescriptor.requiredFeatures" 948 // 949 // Optional, defaults to []. 950 RequiredFeatures js.Array[GPUFeatureName] 951 // RequiredLimits is "GPUDeviceDescriptor.requiredLimits" 952 // 953 // Optional, defaults to {}. 954 RequiredLimits js.Record[GPUSize64] 955 // DefaultQueue is "GPUDeviceDescriptor.defaultQueue" 956 // 957 // Optional, defaults to {}. 958 // 959 // NOTE: DefaultQueue.FFI_USE MUST be set to true to get DefaultQueue used. 960 DefaultQueue GPUQueueDescriptor 961 // Label is "GPUDeviceDescriptor.label" 962 // 963 // Optional, defaults to "". 964 Label js.String 965 966 FFI_USE bool 967 } 968 969 // FromRef calls UpdateFrom and returns a GPUDeviceDescriptor with all fields set. 970 func (p GPUDeviceDescriptor) FromRef(ref js.Ref) GPUDeviceDescriptor { 971 p.UpdateFrom(ref) 972 return p 973 } 974 975 // New creates a new GPUDeviceDescriptor in the application heap. 976 func (p GPUDeviceDescriptor) New() js.Ref { 977 return bindings.GPUDeviceDescriptorJSLoad( 978 js.Pointer(&p), js.True, 0, 979 ) 980 } 981 982 // UpdateFrom copies value of all fields of the heap object to p. 983 func (p *GPUDeviceDescriptor) UpdateFrom(ref js.Ref) { 984 bindings.GPUDeviceDescriptorJSStore( 985 js.Pointer(p), ref, 986 ) 987 } 988 989 // Update writes all fields of the p to the heap object referenced by ref. 990 func (p *GPUDeviceDescriptor) Update(ref js.Ref) { 991 bindings.GPUDeviceDescriptorJSLoad( 992 js.Pointer(p), js.False, ref, 993 ) 994 } 995 996 // FreeMembers frees fields with heap reference, if recursive is true 997 // free all heap references reachable from p. 998 func (p *GPUDeviceDescriptor) FreeMembers(recursive bool) { 999 js.Free( 1000 p.RequiredFeatures.Ref(), 1001 p.RequiredLimits.Ref(), 1002 p.Label.Ref(), 1003 ) 1004 p.RequiredFeatures = p.RequiredFeatures.FromRef(js.Undefined) 1005 p.RequiredLimits = p.RequiredLimits.FromRef(js.Undefined) 1006 p.Label = p.Label.FromRef(js.Undefined) 1007 if recursive { 1008 p.DefaultQueue.FreeMembers(true) 1009 } 1010 } 1011 1012 type GPUAdapterInfo struct { 1013 ref js.Ref 1014 } 1015 1016 func (this GPUAdapterInfo) Once() GPUAdapterInfo { 1017 this.ref.Once() 1018 return this 1019 } 1020 1021 func (this GPUAdapterInfo) Ref() js.Ref { 1022 return this.ref 1023 } 1024 1025 func (this GPUAdapterInfo) FromRef(ref js.Ref) GPUAdapterInfo { 1026 this.ref = ref 1027 return this 1028 } 1029 1030 func (this GPUAdapterInfo) Free() { 1031 this.ref.Free() 1032 } 1033 1034 // Vendor returns the value of property "GPUAdapterInfo.vendor". 1035 // 1036 // It returns ok=false if there is no such property. 1037 func (this GPUAdapterInfo) Vendor() (ret js.String, ok bool) { 1038 ok = js.True == bindings.GetGPUAdapterInfoVendor( 1039 this.ref, js.Pointer(&ret), 1040 ) 1041 return 1042 } 1043 1044 // Architecture returns the value of property "GPUAdapterInfo.architecture". 1045 // 1046 // It returns ok=false if there is no such property. 1047 func (this GPUAdapterInfo) Architecture() (ret js.String, ok bool) { 1048 ok = js.True == bindings.GetGPUAdapterInfoArchitecture( 1049 this.ref, js.Pointer(&ret), 1050 ) 1051 return 1052 } 1053 1054 // Device returns the value of property "GPUAdapterInfo.device". 1055 // 1056 // It returns ok=false if there is no such property. 1057 func (this GPUAdapterInfo) Device() (ret js.String, ok bool) { 1058 ok = js.True == bindings.GetGPUAdapterInfoDevice( 1059 this.ref, js.Pointer(&ret), 1060 ) 1061 return 1062 } 1063 1064 // Description returns the value of property "GPUAdapterInfo.description". 1065 // 1066 // It returns ok=false if there is no such property. 1067 func (this GPUAdapterInfo) Description() (ret js.String, ok bool) { 1068 ok = js.True == bindings.GetGPUAdapterInfoDescription( 1069 this.ref, js.Pointer(&ret), 1070 ) 1071 return 1072 } 1073 1074 type GPUAdapter struct { 1075 ref js.Ref 1076 } 1077 1078 func (this GPUAdapter) Once() GPUAdapter { 1079 this.ref.Once() 1080 return this 1081 } 1082 1083 func (this GPUAdapter) Ref() js.Ref { 1084 return this.ref 1085 } 1086 1087 func (this GPUAdapter) FromRef(ref js.Ref) GPUAdapter { 1088 this.ref = ref 1089 return this 1090 } 1091 1092 func (this GPUAdapter) Free() { 1093 this.ref.Free() 1094 } 1095 1096 // Features returns the value of property "GPUAdapter.features". 1097 // 1098 // It returns ok=false if there is no such property. 1099 func (this GPUAdapter) Features() (ret GPUSupportedFeatures, ok bool) { 1100 ok = js.True == bindings.GetGPUAdapterFeatures( 1101 this.ref, js.Pointer(&ret), 1102 ) 1103 return 1104 } 1105 1106 // Limits returns the value of property "GPUAdapter.limits". 1107 // 1108 // It returns ok=false if there is no such property. 1109 func (this GPUAdapter) Limits() (ret GPUSupportedLimits, ok bool) { 1110 ok = js.True == bindings.GetGPUAdapterLimits( 1111 this.ref, js.Pointer(&ret), 1112 ) 1113 return 1114 } 1115 1116 // IsFallbackAdapter returns the value of property "GPUAdapter.isFallbackAdapter". 1117 // 1118 // It returns ok=false if there is no such property. 1119 func (this GPUAdapter) IsFallbackAdapter() (ret bool, ok bool) { 1120 ok = js.True == bindings.GetGPUAdapterIsFallbackAdapter( 1121 this.ref, js.Pointer(&ret), 1122 ) 1123 return 1124 } 1125 1126 // HasFuncRequestDevice returns true if the method "GPUAdapter.requestDevice" exists. 1127 func (this GPUAdapter) HasFuncRequestDevice() bool { 1128 return js.True == bindings.HasFuncGPUAdapterRequestDevice( 1129 this.ref, 1130 ) 1131 } 1132 1133 // FuncRequestDevice returns the method "GPUAdapter.requestDevice". 1134 func (this GPUAdapter) FuncRequestDevice() (fn js.Func[func(descriptor GPUDeviceDescriptor) js.Promise[GPUDevice]]) { 1135 bindings.FuncGPUAdapterRequestDevice( 1136 this.ref, js.Pointer(&fn), 1137 ) 1138 return 1139 } 1140 1141 // RequestDevice calls the method "GPUAdapter.requestDevice". 1142 func (this GPUAdapter) RequestDevice(descriptor GPUDeviceDescriptor) (ret js.Promise[GPUDevice]) { 1143 bindings.CallGPUAdapterRequestDevice( 1144 this.ref, js.Pointer(&ret), 1145 js.Pointer(&descriptor), 1146 ) 1147 1148 return 1149 } 1150 1151 // TryRequestDevice calls the method "GPUAdapter.requestDevice" 1152 // in a try/catch block and returns (_, err, ok = false) when it went through 1153 // the catch clause. 1154 func (this GPUAdapter) TryRequestDevice(descriptor GPUDeviceDescriptor) (ret js.Promise[GPUDevice], exception js.Any, ok bool) { 1155 ok = js.True == bindings.TryGPUAdapterRequestDevice( 1156 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1157 js.Pointer(&descriptor), 1158 ) 1159 1160 return 1161 } 1162 1163 // HasFuncRequestDevice1 returns true if the method "GPUAdapter.requestDevice" exists. 1164 func (this GPUAdapter) HasFuncRequestDevice1() bool { 1165 return js.True == bindings.HasFuncGPUAdapterRequestDevice1( 1166 this.ref, 1167 ) 1168 } 1169 1170 // FuncRequestDevice1 returns the method "GPUAdapter.requestDevice". 1171 func (this GPUAdapter) FuncRequestDevice1() (fn js.Func[func() js.Promise[GPUDevice]]) { 1172 bindings.FuncGPUAdapterRequestDevice1( 1173 this.ref, js.Pointer(&fn), 1174 ) 1175 return 1176 } 1177 1178 // RequestDevice1 calls the method "GPUAdapter.requestDevice". 1179 func (this GPUAdapter) RequestDevice1() (ret js.Promise[GPUDevice]) { 1180 bindings.CallGPUAdapterRequestDevice1( 1181 this.ref, js.Pointer(&ret), 1182 ) 1183 1184 return 1185 } 1186 1187 // TryRequestDevice1 calls the method "GPUAdapter.requestDevice" 1188 // in a try/catch block and returns (_, err, ok = false) when it went through 1189 // the catch clause. 1190 func (this GPUAdapter) TryRequestDevice1() (ret js.Promise[GPUDevice], exception js.Any, ok bool) { 1191 ok = js.True == bindings.TryGPUAdapterRequestDevice1( 1192 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1193 ) 1194 1195 return 1196 } 1197 1198 // HasFuncRequestAdapterInfo returns true if the method "GPUAdapter.requestAdapterInfo" exists. 1199 func (this GPUAdapter) HasFuncRequestAdapterInfo() bool { 1200 return js.True == bindings.HasFuncGPUAdapterRequestAdapterInfo( 1201 this.ref, 1202 ) 1203 } 1204 1205 // FuncRequestAdapterInfo returns the method "GPUAdapter.requestAdapterInfo". 1206 func (this GPUAdapter) FuncRequestAdapterInfo() (fn js.Func[func(unmaskHints js.Array[js.String]) js.Promise[GPUAdapterInfo]]) { 1207 bindings.FuncGPUAdapterRequestAdapterInfo( 1208 this.ref, js.Pointer(&fn), 1209 ) 1210 return 1211 } 1212 1213 // RequestAdapterInfo calls the method "GPUAdapter.requestAdapterInfo". 1214 func (this GPUAdapter) RequestAdapterInfo(unmaskHints js.Array[js.String]) (ret js.Promise[GPUAdapterInfo]) { 1215 bindings.CallGPUAdapterRequestAdapterInfo( 1216 this.ref, js.Pointer(&ret), 1217 unmaskHints.Ref(), 1218 ) 1219 1220 return 1221 } 1222 1223 // TryRequestAdapterInfo calls the method "GPUAdapter.requestAdapterInfo" 1224 // in a try/catch block and returns (_, err, ok = false) when it went through 1225 // the catch clause. 1226 func (this GPUAdapter) TryRequestAdapterInfo(unmaskHints js.Array[js.String]) (ret js.Promise[GPUAdapterInfo], exception js.Any, ok bool) { 1227 ok = js.True == bindings.TryGPUAdapterRequestAdapterInfo( 1228 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1229 unmaskHints.Ref(), 1230 ) 1231 1232 return 1233 } 1234 1235 // HasFuncRequestAdapterInfo1 returns true if the method "GPUAdapter.requestAdapterInfo" exists. 1236 func (this GPUAdapter) HasFuncRequestAdapterInfo1() bool { 1237 return js.True == bindings.HasFuncGPUAdapterRequestAdapterInfo1( 1238 this.ref, 1239 ) 1240 } 1241 1242 // FuncRequestAdapterInfo1 returns the method "GPUAdapter.requestAdapterInfo". 1243 func (this GPUAdapter) FuncRequestAdapterInfo1() (fn js.Func[func() js.Promise[GPUAdapterInfo]]) { 1244 bindings.FuncGPUAdapterRequestAdapterInfo1( 1245 this.ref, js.Pointer(&fn), 1246 ) 1247 return 1248 } 1249 1250 // RequestAdapterInfo1 calls the method "GPUAdapter.requestAdapterInfo". 1251 func (this GPUAdapter) RequestAdapterInfo1() (ret js.Promise[GPUAdapterInfo]) { 1252 bindings.CallGPUAdapterRequestAdapterInfo1( 1253 this.ref, js.Pointer(&ret), 1254 ) 1255 1256 return 1257 } 1258 1259 // TryRequestAdapterInfo1 calls the method "GPUAdapter.requestAdapterInfo" 1260 // in a try/catch block and returns (_, err, ok = false) when it went through 1261 // the catch clause. 1262 func (this GPUAdapter) TryRequestAdapterInfo1() (ret js.Promise[GPUAdapterInfo], exception js.Any, ok bool) { 1263 ok = js.True == bindings.TryGPUAdapterRequestAdapterInfo1( 1264 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1265 ) 1266 1267 return 1268 } 1269 1270 type GPUPowerPreference uint32 1271 1272 const ( 1273 _ GPUPowerPreference = iota 1274 1275 GPUPowerPreference_LOW_POWER 1276 GPUPowerPreference_HIGH_PERFORMANCE 1277 ) 1278 1279 func (GPUPowerPreference) FromRef(str js.Ref) GPUPowerPreference { 1280 return GPUPowerPreference(bindings.ConstOfGPUPowerPreference(str)) 1281 } 1282 1283 func (x GPUPowerPreference) String() (string, bool) { 1284 switch x { 1285 case GPUPowerPreference_LOW_POWER: 1286 return "low-power", true 1287 case GPUPowerPreference_HIGH_PERFORMANCE: 1288 return "high-performance", true 1289 default: 1290 return "", false 1291 } 1292 } 1293 1294 type GPURequestAdapterOptions struct { 1295 // PowerPreference is "GPURequestAdapterOptions.powerPreference" 1296 // 1297 // Optional 1298 PowerPreference GPUPowerPreference 1299 // ForceFallbackAdapter is "GPURequestAdapterOptions.forceFallbackAdapter" 1300 // 1301 // Optional, defaults to false. 1302 // 1303 // NOTE: FFI_USE_ForceFallbackAdapter MUST be set to true to make this field effective. 1304 ForceFallbackAdapter bool 1305 1306 FFI_USE_ForceFallbackAdapter bool // for ForceFallbackAdapter. 1307 1308 FFI_USE bool 1309 } 1310 1311 // FromRef calls UpdateFrom and returns a GPURequestAdapterOptions with all fields set. 1312 func (p GPURequestAdapterOptions) FromRef(ref js.Ref) GPURequestAdapterOptions { 1313 p.UpdateFrom(ref) 1314 return p 1315 } 1316 1317 // New creates a new GPURequestAdapterOptions in the application heap. 1318 func (p GPURequestAdapterOptions) New() js.Ref { 1319 return bindings.GPURequestAdapterOptionsJSLoad( 1320 js.Pointer(&p), js.True, 0, 1321 ) 1322 } 1323 1324 // UpdateFrom copies value of all fields of the heap object to p. 1325 func (p *GPURequestAdapterOptions) UpdateFrom(ref js.Ref) { 1326 bindings.GPURequestAdapterOptionsJSStore( 1327 js.Pointer(p), ref, 1328 ) 1329 } 1330 1331 // Update writes all fields of the p to the heap object referenced by ref. 1332 func (p *GPURequestAdapterOptions) Update(ref js.Ref) { 1333 bindings.GPURequestAdapterOptionsJSLoad( 1334 js.Pointer(p), js.False, ref, 1335 ) 1336 } 1337 1338 // FreeMembers frees fields with heap reference, if recursive is true 1339 // free all heap references reachable from p. 1340 func (p *GPURequestAdapterOptions) FreeMembers(recursive bool) { 1341 } 1342 1343 type WGSLLanguageFeatures struct { 1344 ref js.Ref 1345 } 1346 1347 func (this WGSLLanguageFeatures) Once() WGSLLanguageFeatures { 1348 this.ref.Once() 1349 return this 1350 } 1351 1352 func (this WGSLLanguageFeatures) Ref() js.Ref { 1353 return this.ref 1354 } 1355 1356 func (this WGSLLanguageFeatures) FromRef(ref js.Ref) WGSLLanguageFeatures { 1357 this.ref = ref 1358 return this 1359 } 1360 1361 func (this WGSLLanguageFeatures) Free() { 1362 this.ref.Free() 1363 } 1364 1365 type GPU struct { 1366 ref js.Ref 1367 } 1368 1369 func (this GPU) Once() GPU { 1370 this.ref.Once() 1371 return this 1372 } 1373 1374 func (this GPU) Ref() js.Ref { 1375 return this.ref 1376 } 1377 1378 func (this GPU) FromRef(ref js.Ref) GPU { 1379 this.ref = ref 1380 return this 1381 } 1382 1383 func (this GPU) Free() { 1384 this.ref.Free() 1385 } 1386 1387 // WgslLanguageFeatures returns the value of property "GPU.wgslLanguageFeatures". 1388 // 1389 // It returns ok=false if there is no such property. 1390 func (this GPU) WgslLanguageFeatures() (ret WGSLLanguageFeatures, ok bool) { 1391 ok = js.True == bindings.GetGPUWgslLanguageFeatures( 1392 this.ref, js.Pointer(&ret), 1393 ) 1394 return 1395 } 1396 1397 // HasFuncRequestAdapter returns true if the method "GPU.requestAdapter" exists. 1398 func (this GPU) HasFuncRequestAdapter() bool { 1399 return js.True == bindings.HasFuncGPURequestAdapter( 1400 this.ref, 1401 ) 1402 } 1403 1404 // FuncRequestAdapter returns the method "GPU.requestAdapter". 1405 func (this GPU) FuncRequestAdapter() (fn js.Func[func(options GPURequestAdapterOptions) js.Promise[GPUAdapter]]) { 1406 bindings.FuncGPURequestAdapter( 1407 this.ref, js.Pointer(&fn), 1408 ) 1409 return 1410 } 1411 1412 // RequestAdapter calls the method "GPU.requestAdapter". 1413 func (this GPU) RequestAdapter(options GPURequestAdapterOptions) (ret js.Promise[GPUAdapter]) { 1414 bindings.CallGPURequestAdapter( 1415 this.ref, js.Pointer(&ret), 1416 js.Pointer(&options), 1417 ) 1418 1419 return 1420 } 1421 1422 // TryRequestAdapter calls the method "GPU.requestAdapter" 1423 // in a try/catch block and returns (_, err, ok = false) when it went through 1424 // the catch clause. 1425 func (this GPU) TryRequestAdapter(options GPURequestAdapterOptions) (ret js.Promise[GPUAdapter], exception js.Any, ok bool) { 1426 ok = js.True == bindings.TryGPURequestAdapter( 1427 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1428 js.Pointer(&options), 1429 ) 1430 1431 return 1432 } 1433 1434 // HasFuncRequestAdapter1 returns true if the method "GPU.requestAdapter" exists. 1435 func (this GPU) HasFuncRequestAdapter1() bool { 1436 return js.True == bindings.HasFuncGPURequestAdapter1( 1437 this.ref, 1438 ) 1439 } 1440 1441 // FuncRequestAdapter1 returns the method "GPU.requestAdapter". 1442 func (this GPU) FuncRequestAdapter1() (fn js.Func[func() js.Promise[GPUAdapter]]) { 1443 bindings.FuncGPURequestAdapter1( 1444 this.ref, js.Pointer(&fn), 1445 ) 1446 return 1447 } 1448 1449 // RequestAdapter1 calls the method "GPU.requestAdapter". 1450 func (this GPU) RequestAdapter1() (ret js.Promise[GPUAdapter]) { 1451 bindings.CallGPURequestAdapter1( 1452 this.ref, js.Pointer(&ret), 1453 ) 1454 1455 return 1456 } 1457 1458 // TryRequestAdapter1 calls the method "GPU.requestAdapter" 1459 // in a try/catch block and returns (_, err, ok = false) when it went through 1460 // the catch clause. 1461 func (this GPU) TryRequestAdapter1() (ret js.Promise[GPUAdapter], exception js.Any, ok bool) { 1462 ok = js.True == bindings.TryGPURequestAdapter1( 1463 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1464 ) 1465 1466 return 1467 } 1468 1469 // HasFuncGetPreferredCanvasFormat returns true if the method "GPU.getPreferredCanvasFormat" exists. 1470 func (this GPU) HasFuncGetPreferredCanvasFormat() bool { 1471 return js.True == bindings.HasFuncGPUGetPreferredCanvasFormat( 1472 this.ref, 1473 ) 1474 } 1475 1476 // FuncGetPreferredCanvasFormat returns the method "GPU.getPreferredCanvasFormat". 1477 func (this GPU) FuncGetPreferredCanvasFormat() (fn js.Func[func() GPUTextureFormat]) { 1478 bindings.FuncGPUGetPreferredCanvasFormat( 1479 this.ref, js.Pointer(&fn), 1480 ) 1481 return 1482 } 1483 1484 // GetPreferredCanvasFormat calls the method "GPU.getPreferredCanvasFormat". 1485 func (this GPU) GetPreferredCanvasFormat() (ret GPUTextureFormat) { 1486 bindings.CallGPUGetPreferredCanvasFormat( 1487 this.ref, js.Pointer(&ret), 1488 ) 1489 1490 return 1491 } 1492 1493 // TryGetPreferredCanvasFormat calls the method "GPU.getPreferredCanvasFormat" 1494 // in a try/catch block and returns (_, err, ok = false) when it went through 1495 // the catch clause. 1496 func (this GPU) TryGetPreferredCanvasFormat() (ret GPUTextureFormat, exception js.Any, ok bool) { 1497 ok = js.True == bindings.TryGPUGetPreferredCanvasFormat( 1498 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1499 ) 1500 1501 return 1502 } 1503 1504 type Navigator struct { 1505 ref js.Ref 1506 } 1507 1508 func (this Navigator) Once() Navigator { 1509 this.ref.Once() 1510 return this 1511 } 1512 1513 func (this Navigator) Ref() js.Ref { 1514 return this.ref 1515 } 1516 1517 func (this Navigator) FromRef(ref js.Ref) Navigator { 1518 this.ref = ref 1519 return this 1520 } 1521 1522 func (this Navigator) Free() { 1523 this.ref.Free() 1524 } 1525 1526 // Hid returns the value of property "Navigator.hid". 1527 // 1528 // It returns ok=false if there is no such property. 1529 func (this Navigator) Hid() (ret HID, ok bool) { 1530 ok = js.True == bindings.GetNavigatorHid( 1531 this.ref, js.Pointer(&ret), 1532 ) 1533 return 1534 } 1535 1536 // WindowControlsOverlay returns the value of property "Navigator.windowControlsOverlay". 1537 // 1538 // It returns ok=false if there is no such property. 1539 func (this Navigator) WindowControlsOverlay() (ret WindowControlsOverlay, ok bool) { 1540 ok = js.True == bindings.GetNavigatorWindowControlsOverlay( 1541 this.ref, js.Pointer(&ret), 1542 ) 1543 return 1544 } 1545 1546 // Credentials returns the value of property "Navigator.credentials". 1547 // 1548 // It returns ok=false if there is no such property. 1549 func (this Navigator) Credentials() (ret CredentialsContainer, ok bool) { 1550 ok = js.True == bindings.GetNavigatorCredentials( 1551 this.ref, js.Pointer(&ret), 1552 ) 1553 return 1554 } 1555 1556 // Clipboard returns the value of property "Navigator.clipboard". 1557 // 1558 // It returns ok=false if there is no such property. 1559 func (this Navigator) Clipboard() (ret Clipboard, ok bool) { 1560 ok = js.True == bindings.GetNavigatorClipboard( 1561 this.ref, js.Pointer(&ret), 1562 ) 1563 return 1564 } 1565 1566 // Geolocation returns the value of property "Navigator.geolocation". 1567 // 1568 // It returns ok=false if there is no such property. 1569 func (this Navigator) Geolocation() (ret Geolocation, ok bool) { 1570 ok = js.True == bindings.GetNavigatorGeolocation( 1571 this.ref, js.Pointer(&ret), 1572 ) 1573 return 1574 } 1575 1576 // Usb returns the value of property "Navigator.usb". 1577 // 1578 // It returns ok=false if there is no such property. 1579 func (this Navigator) Usb() (ret USB, ok bool) { 1580 ok = js.True == bindings.GetNavigatorUsb( 1581 this.ref, js.Pointer(&ret), 1582 ) 1583 return 1584 } 1585 1586 // EpubReadingSystem returns the value of property "Navigator.epubReadingSystem". 1587 // 1588 // It returns ok=false if there is no such property. 1589 func (this Navigator) EpubReadingSystem() (ret EpubReadingSystem, ok bool) { 1590 ok = js.True == bindings.GetNavigatorEpubReadingSystem( 1591 this.ref, js.Pointer(&ret), 1592 ) 1593 return 1594 } 1595 1596 // Xr returns the value of property "Navigator.xr". 1597 // 1598 // It returns ok=false if there is no such property. 1599 func (this Navigator) Xr() (ret XRSystem, ok bool) { 1600 ok = js.True == bindings.GetNavigatorXr( 1601 this.ref, js.Pointer(&ret), 1602 ) 1603 return 1604 } 1605 1606 // ServiceWorker returns the value of property "Navigator.serviceWorker". 1607 // 1608 // It returns ok=false if there is no such property. 1609 func (this Navigator) ServiceWorker() (ret ServiceWorkerContainer, ok bool) { 1610 ok = js.True == bindings.GetNavigatorServiceWorker( 1611 this.ref, js.Pointer(&ret), 1612 ) 1613 return 1614 } 1615 1616 // MediaDevices returns the value of property "Navigator.mediaDevices". 1617 // 1618 // It returns ok=false if there is no such property. 1619 func (this Navigator) MediaDevices() (ret MediaDevices, ok bool) { 1620 ok = js.True == bindings.GetNavigatorMediaDevices( 1621 this.ref, js.Pointer(&ret), 1622 ) 1623 return 1624 } 1625 1626 // Bluetooth returns the value of property "Navigator.bluetooth". 1627 // 1628 // It returns ok=false if there is no such property. 1629 func (this Navigator) Bluetooth() (ret Bluetooth, ok bool) { 1630 ok = js.True == bindings.GetNavigatorBluetooth( 1631 this.ref, js.Pointer(&ret), 1632 ) 1633 return 1634 } 1635 1636 // Serial returns the value of property "Navigator.serial". 1637 // 1638 // It returns ok=false if there is no such property. 1639 func (this Navigator) Serial() (ret Serial, ok bool) { 1640 ok = js.True == bindings.GetNavigatorSerial( 1641 this.ref, js.Pointer(&ret), 1642 ) 1643 return 1644 } 1645 1646 // MediaCapabilities returns the value of property "Navigator.mediaCapabilities". 1647 // 1648 // It returns ok=false if there is no such property. 1649 func (this Navigator) MediaCapabilities() (ret MediaCapabilities, ok bool) { 1650 ok = js.True == bindings.GetNavigatorMediaCapabilities( 1651 this.ref, js.Pointer(&ret), 1652 ) 1653 return 1654 } 1655 1656 // UserActivation returns the value of property "Navigator.userActivation". 1657 // 1658 // It returns ok=false if there is no such property. 1659 func (this Navigator) UserActivation() (ret UserActivation, ok bool) { 1660 ok = js.True == bindings.GetNavigatorUserActivation( 1661 this.ref, js.Pointer(&ret), 1662 ) 1663 return 1664 } 1665 1666 // Permissions returns the value of property "Navigator.permissions". 1667 // 1668 // It returns ok=false if there is no such property. 1669 func (this Navigator) Permissions() (ret Permissions, ok bool) { 1670 ok = js.True == bindings.GetNavigatorPermissions( 1671 this.ref, js.Pointer(&ret), 1672 ) 1673 return 1674 } 1675 1676 // Contacts returns the value of property "Navigator.contacts". 1677 // 1678 // It returns ok=false if there is no such property. 1679 func (this Navigator) Contacts() (ret ContactsManager, ok bool) { 1680 ok = js.True == bindings.GetNavigatorContacts( 1681 this.ref, js.Pointer(&ret), 1682 ) 1683 return 1684 } 1685 1686 // Keyboard returns the value of property "Navigator.keyboard". 1687 // 1688 // It returns ok=false if there is no such property. 1689 func (this Navigator) Keyboard() (ret Keyboard, ok bool) { 1690 ok = js.True == bindings.GetNavigatorKeyboard( 1691 this.ref, js.Pointer(&ret), 1692 ) 1693 return 1694 } 1695 1696 // MediaSession returns the value of property "Navigator.mediaSession". 1697 // 1698 // It returns ok=false if there is no such property. 1699 func (this Navigator) MediaSession() (ret MediaSession, ok bool) { 1700 ok = js.True == bindings.GetNavigatorMediaSession( 1701 this.ref, js.Pointer(&ret), 1702 ) 1703 return 1704 } 1705 1706 // DevicePosture returns the value of property "Navigator.devicePosture". 1707 // 1708 // It returns ok=false if there is no such property. 1709 func (this Navigator) DevicePosture() (ret DevicePosture, ok bool) { 1710 ok = js.True == bindings.GetNavigatorDevicePosture( 1711 this.ref, js.Pointer(&ret), 1712 ) 1713 return 1714 } 1715 1716 // MaxTouchPoints returns the value of property "Navigator.maxTouchPoints". 1717 // 1718 // It returns ok=false if there is no such property. 1719 func (this Navigator) MaxTouchPoints() (ret int32, ok bool) { 1720 ok = js.True == bindings.GetNavigatorMaxTouchPoints( 1721 this.ref, js.Pointer(&ret), 1722 ) 1723 return 1724 } 1725 1726 // Scheduling returns the value of property "Navigator.scheduling". 1727 // 1728 // It returns ok=false if there is no such property. 1729 func (this Navigator) Scheduling() (ret Scheduling, ok bool) { 1730 ok = js.True == bindings.GetNavigatorScheduling( 1731 this.ref, js.Pointer(&ret), 1732 ) 1733 return 1734 } 1735 1736 // WakeLock returns the value of property "Navigator.wakeLock". 1737 // 1738 // It returns ok=false if there is no such property. 1739 func (this Navigator) WakeLock() (ret WakeLock, ok bool) { 1740 ok = js.True == bindings.GetNavigatorWakeLock( 1741 this.ref, js.Pointer(&ret), 1742 ) 1743 return 1744 } 1745 1746 // Ink returns the value of property "Navigator.ink". 1747 // 1748 // It returns ok=false if there is no such property. 1749 func (this Navigator) Ink() (ret Ink, ok bool) { 1750 ok = js.True == bindings.GetNavigatorInk( 1751 this.ref, js.Pointer(&ret), 1752 ) 1753 return 1754 } 1755 1756 // Presentation returns the value of property "Navigator.presentation". 1757 // 1758 // It returns ok=false if there is no such property. 1759 func (this Navigator) Presentation() (ret Presentation, ok bool) { 1760 ok = js.True == bindings.GetNavigatorPresentation( 1761 this.ref, js.Pointer(&ret), 1762 ) 1763 return 1764 } 1765 1766 // VirtualKeyboard returns the value of property "Navigator.virtualKeyboard". 1767 // 1768 // It returns ok=false if there is no such property. 1769 func (this Navigator) VirtualKeyboard() (ret VirtualKeyboard, ok bool) { 1770 ok = js.True == bindings.GetNavigatorVirtualKeyboard( 1771 this.ref, js.Pointer(&ret), 1772 ) 1773 return 1774 } 1775 1776 // UserAgentData returns the value of property "Navigator.userAgentData". 1777 // 1778 // It returns ok=false if there is no such property. 1779 func (this Navigator) UserAgentData() (ret NavigatorUAData, ok bool) { 1780 ok = js.True == bindings.GetNavigatorUserAgentData( 1781 this.ref, js.Pointer(&ret), 1782 ) 1783 return 1784 } 1785 1786 // HardwareConcurrency returns the value of property "Navigator.hardwareConcurrency". 1787 // 1788 // It returns ok=false if there is no such property. 1789 func (this Navigator) HardwareConcurrency() (ret uint64, ok bool) { 1790 ok = js.True == bindings.GetNavigatorHardwareConcurrency( 1791 this.ref, js.Pointer(&ret), 1792 ) 1793 return 1794 } 1795 1796 // DeviceMemory returns the value of property "Navigator.deviceMemory". 1797 // 1798 // It returns ok=false if there is no such property. 1799 func (this Navigator) DeviceMemory() (ret float64, ok bool) { 1800 ok = js.True == bindings.GetNavigatorDeviceMemory( 1801 this.ref, js.Pointer(&ret), 1802 ) 1803 return 1804 } 1805 1806 // Storage returns the value of property "Navigator.storage". 1807 // 1808 // It returns ok=false if there is no such property. 1809 func (this Navigator) Storage() (ret StorageManager, ok bool) { 1810 ok = js.True == bindings.GetNavigatorStorage( 1811 this.ref, js.Pointer(&ret), 1812 ) 1813 return 1814 } 1815 1816 // StorageBuckets returns the value of property "Navigator.storageBuckets". 1817 // 1818 // It returns ok=false if there is no such property. 1819 func (this Navigator) StorageBuckets() (ret StorageBucketManager, ok bool) { 1820 ok = js.True == bindings.GetNavigatorStorageBuckets( 1821 this.ref, js.Pointer(&ret), 1822 ) 1823 return 1824 } 1825 1826 // Locks returns the value of property "Navigator.locks". 1827 // 1828 // It returns ok=false if there is no such property. 1829 func (this Navigator) Locks() (ret LockManager, ok bool) { 1830 ok = js.True == bindings.GetNavigatorLocks( 1831 this.ref, js.Pointer(&ret), 1832 ) 1833 return 1834 } 1835 1836 // AppCodeName returns the value of property "Navigator.appCodeName". 1837 // 1838 // It returns ok=false if there is no such property. 1839 func (this Navigator) AppCodeName() (ret js.String, ok bool) { 1840 ok = js.True == bindings.GetNavigatorAppCodeName( 1841 this.ref, js.Pointer(&ret), 1842 ) 1843 return 1844 } 1845 1846 // AppName returns the value of property "Navigator.appName". 1847 // 1848 // It returns ok=false if there is no such property. 1849 func (this Navigator) AppName() (ret js.String, ok bool) { 1850 ok = js.True == bindings.GetNavigatorAppName( 1851 this.ref, js.Pointer(&ret), 1852 ) 1853 return 1854 } 1855 1856 // AppVersion returns the value of property "Navigator.appVersion". 1857 // 1858 // It returns ok=false if there is no such property. 1859 func (this Navigator) AppVersion() (ret js.String, ok bool) { 1860 ok = js.True == bindings.GetNavigatorAppVersion( 1861 this.ref, js.Pointer(&ret), 1862 ) 1863 return 1864 } 1865 1866 // Platform returns the value of property "Navigator.platform". 1867 // 1868 // It returns ok=false if there is no such property. 1869 func (this Navigator) Platform() (ret js.String, ok bool) { 1870 ok = js.True == bindings.GetNavigatorPlatform( 1871 this.ref, js.Pointer(&ret), 1872 ) 1873 return 1874 } 1875 1876 // Product returns the value of property "Navigator.product". 1877 // 1878 // It returns ok=false if there is no such property. 1879 func (this Navigator) Product() (ret js.String, ok bool) { 1880 ok = js.True == bindings.GetNavigatorProduct( 1881 this.ref, js.Pointer(&ret), 1882 ) 1883 return 1884 } 1885 1886 // ProductSub returns the value of property "Navigator.productSub". 1887 // 1888 // It returns ok=false if there is no such property. 1889 func (this Navigator) ProductSub() (ret js.String, ok bool) { 1890 ok = js.True == bindings.GetNavigatorProductSub( 1891 this.ref, js.Pointer(&ret), 1892 ) 1893 return 1894 } 1895 1896 // UserAgent returns the value of property "Navigator.userAgent". 1897 // 1898 // It returns ok=false if there is no such property. 1899 func (this Navigator) UserAgent() (ret js.String, ok bool) { 1900 ok = js.True == bindings.GetNavigatorUserAgent( 1901 this.ref, js.Pointer(&ret), 1902 ) 1903 return 1904 } 1905 1906 // Vendor returns the value of property "Navigator.vendor". 1907 // 1908 // It returns ok=false if there is no such property. 1909 func (this Navigator) Vendor() (ret js.String, ok bool) { 1910 ok = js.True == bindings.GetNavigatorVendor( 1911 this.ref, js.Pointer(&ret), 1912 ) 1913 return 1914 } 1915 1916 // VendorSub returns the value of property "Navigator.vendorSub". 1917 // 1918 // It returns ok=false if there is no such property. 1919 func (this Navigator) VendorSub() (ret js.String, ok bool) { 1920 ok = js.True == bindings.GetNavigatorVendorSub( 1921 this.ref, js.Pointer(&ret), 1922 ) 1923 return 1924 } 1925 1926 // Oscpu returns the value of property "Navigator.oscpu". 1927 // 1928 // It returns ok=false if there is no such property. 1929 func (this Navigator) Oscpu() (ret js.String, ok bool) { 1930 ok = js.True == bindings.GetNavigatorOscpu( 1931 this.ref, js.Pointer(&ret), 1932 ) 1933 return 1934 } 1935 1936 // Language returns the value of property "Navigator.language". 1937 // 1938 // It returns ok=false if there is no such property. 1939 func (this Navigator) Language() (ret js.String, ok bool) { 1940 ok = js.True == bindings.GetNavigatorLanguage( 1941 this.ref, js.Pointer(&ret), 1942 ) 1943 return 1944 } 1945 1946 // Languages returns the value of property "Navigator.languages". 1947 // 1948 // It returns ok=false if there is no such property. 1949 func (this Navigator) Languages() (ret js.FrozenArray[js.String], ok bool) { 1950 ok = js.True == bindings.GetNavigatorLanguages( 1951 this.ref, js.Pointer(&ret), 1952 ) 1953 return 1954 } 1955 1956 // OnLine returns the value of property "Navigator.onLine". 1957 // 1958 // It returns ok=false if there is no such property. 1959 func (this Navigator) OnLine() (ret bool, ok bool) { 1960 ok = js.True == bindings.GetNavigatorOnLine( 1961 this.ref, js.Pointer(&ret), 1962 ) 1963 return 1964 } 1965 1966 // CookieEnabled returns the value of property "Navigator.cookieEnabled". 1967 // 1968 // It returns ok=false if there is no such property. 1969 func (this Navigator) CookieEnabled() (ret bool, ok bool) { 1970 ok = js.True == bindings.GetNavigatorCookieEnabled( 1971 this.ref, js.Pointer(&ret), 1972 ) 1973 return 1974 } 1975 1976 // Plugins returns the value of property "Navigator.plugins". 1977 // 1978 // It returns ok=false if there is no such property. 1979 func (this Navigator) Plugins() (ret PluginArray, ok bool) { 1980 ok = js.True == bindings.GetNavigatorPlugins( 1981 this.ref, js.Pointer(&ret), 1982 ) 1983 return 1984 } 1985 1986 // MimeTypes returns the value of property "Navigator.mimeTypes". 1987 // 1988 // It returns ok=false if there is no such property. 1989 func (this Navigator) MimeTypes() (ret MimeTypeArray, ok bool) { 1990 ok = js.True == bindings.GetNavigatorMimeTypes( 1991 this.ref, js.Pointer(&ret), 1992 ) 1993 return 1994 } 1995 1996 // PdfViewerEnabled returns the value of property "Navigator.pdfViewerEnabled". 1997 // 1998 // It returns ok=false if there is no such property. 1999 func (this Navigator) PdfViewerEnabled() (ret bool, ok bool) { 2000 ok = js.True == bindings.GetNavigatorPdfViewerEnabled( 2001 this.ref, js.Pointer(&ret), 2002 ) 2003 return 2004 } 2005 2006 // Webdriver returns the value of property "Navigator.webdriver". 2007 // 2008 // It returns ok=false if there is no such property. 2009 func (this Navigator) Webdriver() (ret bool, ok bool) { 2010 ok = js.True == bindings.GetNavigatorWebdriver( 2011 this.ref, js.Pointer(&ret), 2012 ) 2013 return 2014 } 2015 2016 // Ml returns the value of property "Navigator.ml". 2017 // 2018 // It returns ok=false if there is no such property. 2019 func (this Navigator) Ml() (ret ML, ok bool) { 2020 ok = js.True == bindings.GetNavigatorMl( 2021 this.ref, js.Pointer(&ret), 2022 ) 2023 return 2024 } 2025 2026 // Connection returns the value of property "Navigator.connection". 2027 // 2028 // It returns ok=false if there is no such property. 2029 func (this Navigator) Connection() (ret NetworkInformation, ok bool) { 2030 ok = js.True == bindings.GetNavigatorConnection( 2031 this.ref, js.Pointer(&ret), 2032 ) 2033 return 2034 } 2035 2036 // Gpu returns the value of property "Navigator.gpu". 2037 // 2038 // It returns ok=false if there is no such property. 2039 func (this Navigator) Gpu() (ret GPU, ok bool) { 2040 ok = js.True == bindings.GetNavigatorGpu( 2041 this.ref, js.Pointer(&ret), 2042 ) 2043 return 2044 } 2045 2046 // HasFuncUpdateAdInterestGroups returns true if the method "Navigator.updateAdInterestGroups" exists. 2047 func (this Navigator) HasFuncUpdateAdInterestGroups() bool { 2048 return js.True == bindings.HasFuncNavigatorUpdateAdInterestGroups( 2049 this.ref, 2050 ) 2051 } 2052 2053 // FuncUpdateAdInterestGroups returns the method "Navigator.updateAdInterestGroups". 2054 func (this Navigator) FuncUpdateAdInterestGroups() (fn js.Func[func()]) { 2055 bindings.FuncNavigatorUpdateAdInterestGroups( 2056 this.ref, js.Pointer(&fn), 2057 ) 2058 return 2059 } 2060 2061 // UpdateAdInterestGroups calls the method "Navigator.updateAdInterestGroups". 2062 func (this Navigator) UpdateAdInterestGroups() (ret js.Void) { 2063 bindings.CallNavigatorUpdateAdInterestGroups( 2064 this.ref, js.Pointer(&ret), 2065 ) 2066 2067 return 2068 } 2069 2070 // TryUpdateAdInterestGroups calls the method "Navigator.updateAdInterestGroups" 2071 // in a try/catch block and returns (_, err, ok = false) when it went through 2072 // the catch clause. 2073 func (this Navigator) TryUpdateAdInterestGroups() (ret js.Void, exception js.Any, ok bool) { 2074 ok = js.True == bindings.TryNavigatorUpdateAdInterestGroups( 2075 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2076 ) 2077 2078 return 2079 } 2080 2081 // HasFuncSendBeacon returns true if the method "Navigator.sendBeacon" exists. 2082 func (this Navigator) HasFuncSendBeacon() bool { 2083 return js.True == bindings.HasFuncNavigatorSendBeacon( 2084 this.ref, 2085 ) 2086 } 2087 2088 // FuncSendBeacon returns the method "Navigator.sendBeacon". 2089 func (this Navigator) FuncSendBeacon() (fn js.Func[func(url js.String, data BodyInit) bool]) { 2090 bindings.FuncNavigatorSendBeacon( 2091 this.ref, js.Pointer(&fn), 2092 ) 2093 return 2094 } 2095 2096 // SendBeacon calls the method "Navigator.sendBeacon". 2097 func (this Navigator) SendBeacon(url js.String, data BodyInit) (ret bool) { 2098 bindings.CallNavigatorSendBeacon( 2099 this.ref, js.Pointer(&ret), 2100 url.Ref(), 2101 data.Ref(), 2102 ) 2103 2104 return 2105 } 2106 2107 // TrySendBeacon calls the method "Navigator.sendBeacon" 2108 // in a try/catch block and returns (_, err, ok = false) when it went through 2109 // the catch clause. 2110 func (this Navigator) TrySendBeacon(url js.String, data BodyInit) (ret bool, exception js.Any, ok bool) { 2111 ok = js.True == bindings.TryNavigatorSendBeacon( 2112 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2113 url.Ref(), 2114 data.Ref(), 2115 ) 2116 2117 return 2118 } 2119 2120 // HasFuncSendBeacon1 returns true if the method "Navigator.sendBeacon" exists. 2121 func (this Navigator) HasFuncSendBeacon1() bool { 2122 return js.True == bindings.HasFuncNavigatorSendBeacon1( 2123 this.ref, 2124 ) 2125 } 2126 2127 // FuncSendBeacon1 returns the method "Navigator.sendBeacon". 2128 func (this Navigator) FuncSendBeacon1() (fn js.Func[func(url js.String) bool]) { 2129 bindings.FuncNavigatorSendBeacon1( 2130 this.ref, js.Pointer(&fn), 2131 ) 2132 return 2133 } 2134 2135 // SendBeacon1 calls the method "Navigator.sendBeacon". 2136 func (this Navigator) SendBeacon1(url js.String) (ret bool) { 2137 bindings.CallNavigatorSendBeacon1( 2138 this.ref, js.Pointer(&ret), 2139 url.Ref(), 2140 ) 2141 2142 return 2143 } 2144 2145 // TrySendBeacon1 calls the method "Navigator.sendBeacon" 2146 // in a try/catch block and returns (_, err, ok = false) when it went through 2147 // the catch clause. 2148 func (this Navigator) TrySendBeacon1(url js.String) (ret bool, exception js.Any, ok bool) { 2149 ok = js.True == bindings.TryNavigatorSendBeacon1( 2150 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2151 url.Ref(), 2152 ) 2153 2154 return 2155 } 2156 2157 // HasFuncGetBattery returns true if the method "Navigator.getBattery" exists. 2158 func (this Navigator) HasFuncGetBattery() bool { 2159 return js.True == bindings.HasFuncNavigatorGetBattery( 2160 this.ref, 2161 ) 2162 } 2163 2164 // FuncGetBattery returns the method "Navigator.getBattery". 2165 func (this Navigator) FuncGetBattery() (fn js.Func[func() js.Promise[BatteryManager]]) { 2166 bindings.FuncNavigatorGetBattery( 2167 this.ref, js.Pointer(&fn), 2168 ) 2169 return 2170 } 2171 2172 // GetBattery calls the method "Navigator.getBattery". 2173 func (this Navigator) GetBattery() (ret js.Promise[BatteryManager]) { 2174 bindings.CallNavigatorGetBattery( 2175 this.ref, js.Pointer(&ret), 2176 ) 2177 2178 return 2179 } 2180 2181 // TryGetBattery calls the method "Navigator.getBattery" 2182 // in a try/catch block and returns (_, err, ok = false) when it went through 2183 // the catch clause. 2184 func (this Navigator) TryGetBattery() (ret js.Promise[BatteryManager], exception js.Any, ok bool) { 2185 ok = js.True == bindings.TryNavigatorGetBattery( 2186 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2187 ) 2188 2189 return 2190 } 2191 2192 // HasFuncVibrate returns true if the method "Navigator.vibrate" exists. 2193 func (this Navigator) HasFuncVibrate() bool { 2194 return js.True == bindings.HasFuncNavigatorVibrate( 2195 this.ref, 2196 ) 2197 } 2198 2199 // FuncVibrate returns the method "Navigator.vibrate". 2200 func (this Navigator) FuncVibrate() (fn js.Func[func(pattern VibratePattern) bool]) { 2201 bindings.FuncNavigatorVibrate( 2202 this.ref, js.Pointer(&fn), 2203 ) 2204 return 2205 } 2206 2207 // Vibrate calls the method "Navigator.vibrate". 2208 func (this Navigator) Vibrate(pattern VibratePattern) (ret bool) { 2209 bindings.CallNavigatorVibrate( 2210 this.ref, js.Pointer(&ret), 2211 pattern.Ref(), 2212 ) 2213 2214 return 2215 } 2216 2217 // TryVibrate calls the method "Navigator.vibrate" 2218 // in a try/catch block and returns (_, err, ok = false) when it went through 2219 // the catch clause. 2220 func (this Navigator) TryVibrate(pattern VibratePattern) (ret bool, exception js.Any, ok bool) { 2221 ok = js.True == bindings.TryNavigatorVibrate( 2222 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2223 pattern.Ref(), 2224 ) 2225 2226 return 2227 } 2228 2229 // HasFuncGetGamepads returns true if the method "Navigator.getGamepads" exists. 2230 func (this Navigator) HasFuncGetGamepads() bool { 2231 return js.True == bindings.HasFuncNavigatorGetGamepads( 2232 this.ref, 2233 ) 2234 } 2235 2236 // FuncGetGamepads returns the method "Navigator.getGamepads". 2237 func (this Navigator) FuncGetGamepads() (fn js.Func[func() js.Array[Gamepad]]) { 2238 bindings.FuncNavigatorGetGamepads( 2239 this.ref, js.Pointer(&fn), 2240 ) 2241 return 2242 } 2243 2244 // GetGamepads calls the method "Navigator.getGamepads". 2245 func (this Navigator) GetGamepads() (ret js.Array[Gamepad]) { 2246 bindings.CallNavigatorGetGamepads( 2247 this.ref, js.Pointer(&ret), 2248 ) 2249 2250 return 2251 } 2252 2253 // TryGetGamepads calls the method "Navigator.getGamepads" 2254 // in a try/catch block and returns (_, err, ok = false) when it went through 2255 // the catch clause. 2256 func (this Navigator) TryGetGamepads() (ret js.Array[Gamepad], exception js.Any, ok bool) { 2257 ok = js.True == bindings.TryNavigatorGetGamepads( 2258 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2259 ) 2260 2261 return 2262 } 2263 2264 // HasFuncGetInstalledRelatedApps returns true if the method "Navigator.getInstalledRelatedApps" exists. 2265 func (this Navigator) HasFuncGetInstalledRelatedApps() bool { 2266 return js.True == bindings.HasFuncNavigatorGetInstalledRelatedApps( 2267 this.ref, 2268 ) 2269 } 2270 2271 // FuncGetInstalledRelatedApps returns the method "Navigator.getInstalledRelatedApps". 2272 func (this Navigator) FuncGetInstalledRelatedApps() (fn js.Func[func() js.Promise[js.Array[RelatedApplication]]]) { 2273 bindings.FuncNavigatorGetInstalledRelatedApps( 2274 this.ref, js.Pointer(&fn), 2275 ) 2276 return 2277 } 2278 2279 // GetInstalledRelatedApps calls the method "Navigator.getInstalledRelatedApps". 2280 func (this Navigator) GetInstalledRelatedApps() (ret js.Promise[js.Array[RelatedApplication]]) { 2281 bindings.CallNavigatorGetInstalledRelatedApps( 2282 this.ref, js.Pointer(&ret), 2283 ) 2284 2285 return 2286 } 2287 2288 // TryGetInstalledRelatedApps calls the method "Navigator.getInstalledRelatedApps" 2289 // in a try/catch block and returns (_, err, ok = false) when it went through 2290 // the catch clause. 2291 func (this Navigator) TryGetInstalledRelatedApps() (ret js.Promise[js.Array[RelatedApplication]], exception js.Any, ok bool) { 2292 ok = js.True == bindings.TryNavigatorGetInstalledRelatedApps( 2293 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2294 ) 2295 2296 return 2297 } 2298 2299 // HasFuncRequestMediaKeySystemAccess returns true if the method "Navigator.requestMediaKeySystemAccess" exists. 2300 func (this Navigator) HasFuncRequestMediaKeySystemAccess() bool { 2301 return js.True == bindings.HasFuncNavigatorRequestMediaKeySystemAccess( 2302 this.ref, 2303 ) 2304 } 2305 2306 // FuncRequestMediaKeySystemAccess returns the method "Navigator.requestMediaKeySystemAccess". 2307 func (this Navigator) FuncRequestMediaKeySystemAccess() (fn js.Func[func(keySystem js.String, supportedConfigurations js.Array[MediaKeySystemConfiguration]) js.Promise[MediaKeySystemAccess]]) { 2308 bindings.FuncNavigatorRequestMediaKeySystemAccess( 2309 this.ref, js.Pointer(&fn), 2310 ) 2311 return 2312 } 2313 2314 // RequestMediaKeySystemAccess calls the method "Navigator.requestMediaKeySystemAccess". 2315 func (this Navigator) RequestMediaKeySystemAccess(keySystem js.String, supportedConfigurations js.Array[MediaKeySystemConfiguration]) (ret js.Promise[MediaKeySystemAccess]) { 2316 bindings.CallNavigatorRequestMediaKeySystemAccess( 2317 this.ref, js.Pointer(&ret), 2318 keySystem.Ref(), 2319 supportedConfigurations.Ref(), 2320 ) 2321 2322 return 2323 } 2324 2325 // TryRequestMediaKeySystemAccess calls the method "Navigator.requestMediaKeySystemAccess" 2326 // in a try/catch block and returns (_, err, ok = false) when it went through 2327 // the catch clause. 2328 func (this Navigator) TryRequestMediaKeySystemAccess(keySystem js.String, supportedConfigurations js.Array[MediaKeySystemConfiguration]) (ret js.Promise[MediaKeySystemAccess], exception js.Any, ok bool) { 2329 ok = js.True == bindings.TryNavigatorRequestMediaKeySystemAccess( 2330 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2331 keySystem.Ref(), 2332 supportedConfigurations.Ref(), 2333 ) 2334 2335 return 2336 } 2337 2338 // HasFuncJoinAdInterestGroup returns true if the method "Navigator.joinAdInterestGroup" exists. 2339 func (this Navigator) HasFuncJoinAdInterestGroup() bool { 2340 return js.True == bindings.HasFuncNavigatorJoinAdInterestGroup( 2341 this.ref, 2342 ) 2343 } 2344 2345 // FuncJoinAdInterestGroup returns the method "Navigator.joinAdInterestGroup". 2346 func (this Navigator) FuncJoinAdInterestGroup() (fn js.Func[func(group AuctionAdInterestGroup) js.Promise[js.Void]]) { 2347 bindings.FuncNavigatorJoinAdInterestGroup( 2348 this.ref, js.Pointer(&fn), 2349 ) 2350 return 2351 } 2352 2353 // JoinAdInterestGroup calls the method "Navigator.joinAdInterestGroup". 2354 func (this Navigator) JoinAdInterestGroup(group AuctionAdInterestGroup) (ret js.Promise[js.Void]) { 2355 bindings.CallNavigatorJoinAdInterestGroup( 2356 this.ref, js.Pointer(&ret), 2357 js.Pointer(&group), 2358 ) 2359 2360 return 2361 } 2362 2363 // TryJoinAdInterestGroup calls the method "Navigator.joinAdInterestGroup" 2364 // in a try/catch block and returns (_, err, ok = false) when it went through 2365 // the catch clause. 2366 func (this Navigator) TryJoinAdInterestGroup(group AuctionAdInterestGroup) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2367 ok = js.True == bindings.TryNavigatorJoinAdInterestGroup( 2368 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2369 js.Pointer(&group), 2370 ) 2371 2372 return 2373 } 2374 2375 // HasFuncGetUserMedia returns true if the method "Navigator.getUserMedia" exists. 2376 func (this Navigator) HasFuncGetUserMedia() bool { 2377 return js.True == bindings.HasFuncNavigatorGetUserMedia( 2378 this.ref, 2379 ) 2380 } 2381 2382 // FuncGetUserMedia returns the method "Navigator.getUserMedia". 2383 func (this Navigator) FuncGetUserMedia() (fn js.Func[func(constraints MediaStreamConstraints, successCallback js.Func[func(stream MediaStream)], errorCallback js.Func[func(err DOMException)])]) { 2384 bindings.FuncNavigatorGetUserMedia( 2385 this.ref, js.Pointer(&fn), 2386 ) 2387 return 2388 } 2389 2390 // GetUserMedia calls the method "Navigator.getUserMedia". 2391 func (this Navigator) GetUserMedia(constraints MediaStreamConstraints, successCallback js.Func[func(stream MediaStream)], errorCallback js.Func[func(err DOMException)]) (ret js.Void) { 2392 bindings.CallNavigatorGetUserMedia( 2393 this.ref, js.Pointer(&ret), 2394 js.Pointer(&constraints), 2395 successCallback.Ref(), 2396 errorCallback.Ref(), 2397 ) 2398 2399 return 2400 } 2401 2402 // TryGetUserMedia calls the method "Navigator.getUserMedia" 2403 // in a try/catch block and returns (_, err, ok = false) when it went through 2404 // the catch clause. 2405 func (this Navigator) TryGetUserMedia(constraints MediaStreamConstraints, successCallback js.Func[func(stream MediaStream)], errorCallback js.Func[func(err DOMException)]) (ret js.Void, exception js.Any, ok bool) { 2406 ok = js.True == bindings.TryNavigatorGetUserMedia( 2407 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2408 js.Pointer(&constraints), 2409 successCallback.Ref(), 2410 errorCallback.Ref(), 2411 ) 2412 2413 return 2414 } 2415 2416 // HasFuncLeaveAdInterestGroup returns true if the method "Navigator.leaveAdInterestGroup" exists. 2417 func (this Navigator) HasFuncLeaveAdInterestGroup() bool { 2418 return js.True == bindings.HasFuncNavigatorLeaveAdInterestGroup( 2419 this.ref, 2420 ) 2421 } 2422 2423 // FuncLeaveAdInterestGroup returns the method "Navigator.leaveAdInterestGroup". 2424 func (this Navigator) FuncLeaveAdInterestGroup() (fn js.Func[func(group AuctionAdInterestGroupKey) js.Promise[js.Void]]) { 2425 bindings.FuncNavigatorLeaveAdInterestGroup( 2426 this.ref, js.Pointer(&fn), 2427 ) 2428 return 2429 } 2430 2431 // LeaveAdInterestGroup calls the method "Navigator.leaveAdInterestGroup". 2432 func (this Navigator) LeaveAdInterestGroup(group AuctionAdInterestGroupKey) (ret js.Promise[js.Void]) { 2433 bindings.CallNavigatorLeaveAdInterestGroup( 2434 this.ref, js.Pointer(&ret), 2435 js.Pointer(&group), 2436 ) 2437 2438 return 2439 } 2440 2441 // TryLeaveAdInterestGroup calls the method "Navigator.leaveAdInterestGroup" 2442 // in a try/catch block and returns (_, err, ok = false) when it went through 2443 // the catch clause. 2444 func (this Navigator) TryLeaveAdInterestGroup(group AuctionAdInterestGroupKey) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2445 ok = js.True == bindings.TryNavigatorLeaveAdInterestGroup( 2446 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2447 js.Pointer(&group), 2448 ) 2449 2450 return 2451 } 2452 2453 // HasFuncLeaveAdInterestGroup1 returns true if the method "Navigator.leaveAdInterestGroup" exists. 2454 func (this Navigator) HasFuncLeaveAdInterestGroup1() bool { 2455 return js.True == bindings.HasFuncNavigatorLeaveAdInterestGroup1( 2456 this.ref, 2457 ) 2458 } 2459 2460 // FuncLeaveAdInterestGroup1 returns the method "Navigator.leaveAdInterestGroup". 2461 func (this Navigator) FuncLeaveAdInterestGroup1() (fn js.Func[func() js.Promise[js.Void]]) { 2462 bindings.FuncNavigatorLeaveAdInterestGroup1( 2463 this.ref, js.Pointer(&fn), 2464 ) 2465 return 2466 } 2467 2468 // LeaveAdInterestGroup1 calls the method "Navigator.leaveAdInterestGroup". 2469 func (this Navigator) LeaveAdInterestGroup1() (ret js.Promise[js.Void]) { 2470 bindings.CallNavigatorLeaveAdInterestGroup1( 2471 this.ref, js.Pointer(&ret), 2472 ) 2473 2474 return 2475 } 2476 2477 // TryLeaveAdInterestGroup1 calls the method "Navigator.leaveAdInterestGroup" 2478 // in a try/catch block and returns (_, err, ok = false) when it went through 2479 // the catch clause. 2480 func (this Navigator) TryLeaveAdInterestGroup1() (ret js.Promise[js.Void], exception js.Any, ok bool) { 2481 ok = js.True == bindings.TryNavigatorLeaveAdInterestGroup1( 2482 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2483 ) 2484 2485 return 2486 } 2487 2488 // HasFuncRunAdAuction returns true if the method "Navigator.runAdAuction" exists. 2489 func (this Navigator) HasFuncRunAdAuction() bool { 2490 return js.True == bindings.HasFuncNavigatorRunAdAuction( 2491 this.ref, 2492 ) 2493 } 2494 2495 // FuncRunAdAuction returns the method "Navigator.runAdAuction". 2496 func (this Navigator) FuncRunAdAuction() (fn js.Func[func(config AuctionAdConfig) js.Promise[OneOf_String_FencedFrameConfig]]) { 2497 bindings.FuncNavigatorRunAdAuction( 2498 this.ref, js.Pointer(&fn), 2499 ) 2500 return 2501 } 2502 2503 // RunAdAuction calls the method "Navigator.runAdAuction". 2504 func (this Navigator) RunAdAuction(config AuctionAdConfig) (ret js.Promise[OneOf_String_FencedFrameConfig]) { 2505 bindings.CallNavigatorRunAdAuction( 2506 this.ref, js.Pointer(&ret), 2507 js.Pointer(&config), 2508 ) 2509 2510 return 2511 } 2512 2513 // TryRunAdAuction calls the method "Navigator.runAdAuction" 2514 // in a try/catch block and returns (_, err, ok = false) when it went through 2515 // the catch clause. 2516 func (this Navigator) TryRunAdAuction(config AuctionAdConfig) (ret js.Promise[OneOf_String_FencedFrameConfig], exception js.Any, ok bool) { 2517 ok = js.True == bindings.TryNavigatorRunAdAuction( 2518 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2519 js.Pointer(&config), 2520 ) 2521 2522 return 2523 } 2524 2525 // HasFuncShare returns true if the method "Navigator.share" exists. 2526 func (this Navigator) HasFuncShare() bool { 2527 return js.True == bindings.HasFuncNavigatorShare( 2528 this.ref, 2529 ) 2530 } 2531 2532 // FuncShare returns the method "Navigator.share". 2533 func (this Navigator) FuncShare() (fn js.Func[func(data ShareData) js.Promise[js.Void]]) { 2534 bindings.FuncNavigatorShare( 2535 this.ref, js.Pointer(&fn), 2536 ) 2537 return 2538 } 2539 2540 // Share calls the method "Navigator.share". 2541 func (this Navigator) Share(data ShareData) (ret js.Promise[js.Void]) { 2542 bindings.CallNavigatorShare( 2543 this.ref, js.Pointer(&ret), 2544 js.Pointer(&data), 2545 ) 2546 2547 return 2548 } 2549 2550 // TryShare calls the method "Navigator.share" 2551 // in a try/catch block and returns (_, err, ok = false) when it went through 2552 // the catch clause. 2553 func (this Navigator) TryShare(data ShareData) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2554 ok = js.True == bindings.TryNavigatorShare( 2555 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2556 js.Pointer(&data), 2557 ) 2558 2559 return 2560 } 2561 2562 // HasFuncShare1 returns true if the method "Navigator.share" exists. 2563 func (this Navigator) HasFuncShare1() bool { 2564 return js.True == bindings.HasFuncNavigatorShare1( 2565 this.ref, 2566 ) 2567 } 2568 2569 // FuncShare1 returns the method "Navigator.share". 2570 func (this Navigator) FuncShare1() (fn js.Func[func() js.Promise[js.Void]]) { 2571 bindings.FuncNavigatorShare1( 2572 this.ref, js.Pointer(&fn), 2573 ) 2574 return 2575 } 2576 2577 // Share1 calls the method "Navigator.share". 2578 func (this Navigator) Share1() (ret js.Promise[js.Void]) { 2579 bindings.CallNavigatorShare1( 2580 this.ref, js.Pointer(&ret), 2581 ) 2582 2583 return 2584 } 2585 2586 // TryShare1 calls the method "Navigator.share" 2587 // in a try/catch block and returns (_, err, ok = false) when it went through 2588 // the catch clause. 2589 func (this Navigator) TryShare1() (ret js.Promise[js.Void], exception js.Any, ok bool) { 2590 ok = js.True == bindings.TryNavigatorShare1( 2591 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2592 ) 2593 2594 return 2595 } 2596 2597 // HasFuncCanShare returns true if the method "Navigator.canShare" exists. 2598 func (this Navigator) HasFuncCanShare() bool { 2599 return js.True == bindings.HasFuncNavigatorCanShare( 2600 this.ref, 2601 ) 2602 } 2603 2604 // FuncCanShare returns the method "Navigator.canShare". 2605 func (this Navigator) FuncCanShare() (fn js.Func[func(data ShareData) bool]) { 2606 bindings.FuncNavigatorCanShare( 2607 this.ref, js.Pointer(&fn), 2608 ) 2609 return 2610 } 2611 2612 // CanShare calls the method "Navigator.canShare". 2613 func (this Navigator) CanShare(data ShareData) (ret bool) { 2614 bindings.CallNavigatorCanShare( 2615 this.ref, js.Pointer(&ret), 2616 js.Pointer(&data), 2617 ) 2618 2619 return 2620 } 2621 2622 // TryCanShare calls the method "Navigator.canShare" 2623 // in a try/catch block and returns (_, err, ok = false) when it went through 2624 // the catch clause. 2625 func (this Navigator) TryCanShare(data ShareData) (ret bool, exception js.Any, ok bool) { 2626 ok = js.True == bindings.TryNavigatorCanShare( 2627 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2628 js.Pointer(&data), 2629 ) 2630 2631 return 2632 } 2633 2634 // HasFuncCanShare1 returns true if the method "Navigator.canShare" exists. 2635 func (this Navigator) HasFuncCanShare1() bool { 2636 return js.True == bindings.HasFuncNavigatorCanShare1( 2637 this.ref, 2638 ) 2639 } 2640 2641 // FuncCanShare1 returns the method "Navigator.canShare". 2642 func (this Navigator) FuncCanShare1() (fn js.Func[func() bool]) { 2643 bindings.FuncNavigatorCanShare1( 2644 this.ref, js.Pointer(&fn), 2645 ) 2646 return 2647 } 2648 2649 // CanShare1 calls the method "Navigator.canShare". 2650 func (this Navigator) CanShare1() (ret bool) { 2651 bindings.CallNavigatorCanShare1( 2652 this.ref, js.Pointer(&ret), 2653 ) 2654 2655 return 2656 } 2657 2658 // TryCanShare1 calls the method "Navigator.canShare" 2659 // in a try/catch block and returns (_, err, ok = false) when it went through 2660 // the catch clause. 2661 func (this Navigator) TryCanShare1() (ret bool, exception js.Any, ok bool) { 2662 ok = js.True == bindings.TryNavigatorCanShare1( 2663 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2664 ) 2665 2666 return 2667 } 2668 2669 // HasFuncRequestMIDIAccess returns true if the method "Navigator.requestMIDIAccess" exists. 2670 func (this Navigator) HasFuncRequestMIDIAccess() bool { 2671 return js.True == bindings.HasFuncNavigatorRequestMIDIAccess( 2672 this.ref, 2673 ) 2674 } 2675 2676 // FuncRequestMIDIAccess returns the method "Navigator.requestMIDIAccess". 2677 func (this Navigator) FuncRequestMIDIAccess() (fn js.Func[func(options MIDIOptions) js.Promise[MIDIAccess]]) { 2678 bindings.FuncNavigatorRequestMIDIAccess( 2679 this.ref, js.Pointer(&fn), 2680 ) 2681 return 2682 } 2683 2684 // RequestMIDIAccess calls the method "Navigator.requestMIDIAccess". 2685 func (this Navigator) RequestMIDIAccess(options MIDIOptions) (ret js.Promise[MIDIAccess]) { 2686 bindings.CallNavigatorRequestMIDIAccess( 2687 this.ref, js.Pointer(&ret), 2688 js.Pointer(&options), 2689 ) 2690 2691 return 2692 } 2693 2694 // TryRequestMIDIAccess calls the method "Navigator.requestMIDIAccess" 2695 // in a try/catch block and returns (_, err, ok = false) when it went through 2696 // the catch clause. 2697 func (this Navigator) TryRequestMIDIAccess(options MIDIOptions) (ret js.Promise[MIDIAccess], exception js.Any, ok bool) { 2698 ok = js.True == bindings.TryNavigatorRequestMIDIAccess( 2699 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2700 js.Pointer(&options), 2701 ) 2702 2703 return 2704 } 2705 2706 // HasFuncRequestMIDIAccess1 returns true if the method "Navigator.requestMIDIAccess" exists. 2707 func (this Navigator) HasFuncRequestMIDIAccess1() bool { 2708 return js.True == bindings.HasFuncNavigatorRequestMIDIAccess1( 2709 this.ref, 2710 ) 2711 } 2712 2713 // FuncRequestMIDIAccess1 returns the method "Navigator.requestMIDIAccess". 2714 func (this Navigator) FuncRequestMIDIAccess1() (fn js.Func[func() js.Promise[MIDIAccess]]) { 2715 bindings.FuncNavigatorRequestMIDIAccess1( 2716 this.ref, js.Pointer(&fn), 2717 ) 2718 return 2719 } 2720 2721 // RequestMIDIAccess1 calls the method "Navigator.requestMIDIAccess". 2722 func (this Navigator) RequestMIDIAccess1() (ret js.Promise[MIDIAccess]) { 2723 bindings.CallNavigatorRequestMIDIAccess1( 2724 this.ref, js.Pointer(&ret), 2725 ) 2726 2727 return 2728 } 2729 2730 // TryRequestMIDIAccess1 calls the method "Navigator.requestMIDIAccess" 2731 // in a try/catch block and returns (_, err, ok = false) when it went through 2732 // the catch clause. 2733 func (this Navigator) TryRequestMIDIAccess1() (ret js.Promise[MIDIAccess], exception js.Any, ok bool) { 2734 ok = js.True == bindings.TryNavigatorRequestMIDIAccess1( 2735 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2736 ) 2737 2738 return 2739 } 2740 2741 // HasFuncGetAutoplayPolicy returns true if the method "Navigator.getAutoplayPolicy" exists. 2742 func (this Navigator) HasFuncGetAutoplayPolicy() bool { 2743 return js.True == bindings.HasFuncNavigatorGetAutoplayPolicy( 2744 this.ref, 2745 ) 2746 } 2747 2748 // FuncGetAutoplayPolicy returns the method "Navigator.getAutoplayPolicy". 2749 func (this Navigator) FuncGetAutoplayPolicy() (fn js.Func[func(typ AutoplayPolicyMediaType) AutoplayPolicy]) { 2750 bindings.FuncNavigatorGetAutoplayPolicy( 2751 this.ref, js.Pointer(&fn), 2752 ) 2753 return 2754 } 2755 2756 // GetAutoplayPolicy calls the method "Navigator.getAutoplayPolicy". 2757 func (this Navigator) GetAutoplayPolicy(typ AutoplayPolicyMediaType) (ret AutoplayPolicy) { 2758 bindings.CallNavigatorGetAutoplayPolicy( 2759 this.ref, js.Pointer(&ret), 2760 uint32(typ), 2761 ) 2762 2763 return 2764 } 2765 2766 // TryGetAutoplayPolicy calls the method "Navigator.getAutoplayPolicy" 2767 // in a try/catch block and returns (_, err, ok = false) when it went through 2768 // the catch clause. 2769 func (this Navigator) TryGetAutoplayPolicy(typ AutoplayPolicyMediaType) (ret AutoplayPolicy, exception js.Any, ok bool) { 2770 ok = js.True == bindings.TryNavigatorGetAutoplayPolicy( 2771 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2772 uint32(typ), 2773 ) 2774 2775 return 2776 } 2777 2778 // HasFuncGetAutoplayPolicy1 returns true if the method "Navigator.getAutoplayPolicy" exists. 2779 func (this Navigator) HasFuncGetAutoplayPolicy1() bool { 2780 return js.True == bindings.HasFuncNavigatorGetAutoplayPolicy1( 2781 this.ref, 2782 ) 2783 } 2784 2785 // FuncGetAutoplayPolicy1 returns the method "Navigator.getAutoplayPolicy". 2786 func (this Navigator) FuncGetAutoplayPolicy1() (fn js.Func[func(element HTMLMediaElement) AutoplayPolicy]) { 2787 bindings.FuncNavigatorGetAutoplayPolicy1( 2788 this.ref, js.Pointer(&fn), 2789 ) 2790 return 2791 } 2792 2793 // GetAutoplayPolicy1 calls the method "Navigator.getAutoplayPolicy". 2794 func (this Navigator) GetAutoplayPolicy1(element HTMLMediaElement) (ret AutoplayPolicy) { 2795 bindings.CallNavigatorGetAutoplayPolicy1( 2796 this.ref, js.Pointer(&ret), 2797 element.Ref(), 2798 ) 2799 2800 return 2801 } 2802 2803 // TryGetAutoplayPolicy1 calls the method "Navigator.getAutoplayPolicy" 2804 // in a try/catch block and returns (_, err, ok = false) when it went through 2805 // the catch clause. 2806 func (this Navigator) TryGetAutoplayPolicy1(element HTMLMediaElement) (ret AutoplayPolicy, exception js.Any, ok bool) { 2807 ok = js.True == bindings.TryNavigatorGetAutoplayPolicy1( 2808 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2809 element.Ref(), 2810 ) 2811 2812 return 2813 } 2814 2815 // HasFuncGetAutoplayPolicy2 returns true if the method "Navigator.getAutoplayPolicy" exists. 2816 func (this Navigator) HasFuncGetAutoplayPolicy2() bool { 2817 return js.True == bindings.HasFuncNavigatorGetAutoplayPolicy2( 2818 this.ref, 2819 ) 2820 } 2821 2822 // FuncGetAutoplayPolicy2 returns the method "Navigator.getAutoplayPolicy". 2823 func (this Navigator) FuncGetAutoplayPolicy2() (fn js.Func[func(context AudioContext) AutoplayPolicy]) { 2824 bindings.FuncNavigatorGetAutoplayPolicy2( 2825 this.ref, js.Pointer(&fn), 2826 ) 2827 return 2828 } 2829 2830 // GetAutoplayPolicy2 calls the method "Navigator.getAutoplayPolicy". 2831 func (this Navigator) GetAutoplayPolicy2(context AudioContext) (ret AutoplayPolicy) { 2832 bindings.CallNavigatorGetAutoplayPolicy2( 2833 this.ref, js.Pointer(&ret), 2834 context.Ref(), 2835 ) 2836 2837 return 2838 } 2839 2840 // TryGetAutoplayPolicy2 calls the method "Navigator.getAutoplayPolicy" 2841 // in a try/catch block and returns (_, err, ok = false) when it went through 2842 // the catch clause. 2843 func (this Navigator) TryGetAutoplayPolicy2(context AudioContext) (ret AutoplayPolicy, exception js.Any, ok bool) { 2844 ok = js.True == bindings.TryNavigatorGetAutoplayPolicy2( 2845 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2846 context.Ref(), 2847 ) 2848 2849 return 2850 } 2851 2852 // HasFuncTaintEnabled returns true if the method "Navigator.taintEnabled" exists. 2853 func (this Navigator) HasFuncTaintEnabled() bool { 2854 return js.True == bindings.HasFuncNavigatorTaintEnabled( 2855 this.ref, 2856 ) 2857 } 2858 2859 // FuncTaintEnabled returns the method "Navigator.taintEnabled". 2860 func (this Navigator) FuncTaintEnabled() (fn js.Func[func() bool]) { 2861 bindings.FuncNavigatorTaintEnabled( 2862 this.ref, js.Pointer(&fn), 2863 ) 2864 return 2865 } 2866 2867 // TaintEnabled calls the method "Navigator.taintEnabled". 2868 func (this Navigator) TaintEnabled() (ret bool) { 2869 bindings.CallNavigatorTaintEnabled( 2870 this.ref, js.Pointer(&ret), 2871 ) 2872 2873 return 2874 } 2875 2876 // TryTaintEnabled calls the method "Navigator.taintEnabled" 2877 // in a try/catch block and returns (_, err, ok = false) when it went through 2878 // the catch clause. 2879 func (this Navigator) TryTaintEnabled() (ret bool, exception js.Any, ok bool) { 2880 ok = js.True == bindings.TryNavigatorTaintEnabled( 2881 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2882 ) 2883 2884 return 2885 } 2886 2887 // HasFuncRegisterProtocolHandler returns true if the method "Navigator.registerProtocolHandler" exists. 2888 func (this Navigator) HasFuncRegisterProtocolHandler() bool { 2889 return js.True == bindings.HasFuncNavigatorRegisterProtocolHandler( 2890 this.ref, 2891 ) 2892 } 2893 2894 // FuncRegisterProtocolHandler returns the method "Navigator.registerProtocolHandler". 2895 func (this Navigator) FuncRegisterProtocolHandler() (fn js.Func[func(scheme js.String, url js.String)]) { 2896 bindings.FuncNavigatorRegisterProtocolHandler( 2897 this.ref, js.Pointer(&fn), 2898 ) 2899 return 2900 } 2901 2902 // RegisterProtocolHandler calls the method "Navigator.registerProtocolHandler". 2903 func (this Navigator) RegisterProtocolHandler(scheme js.String, url js.String) (ret js.Void) { 2904 bindings.CallNavigatorRegisterProtocolHandler( 2905 this.ref, js.Pointer(&ret), 2906 scheme.Ref(), 2907 url.Ref(), 2908 ) 2909 2910 return 2911 } 2912 2913 // TryRegisterProtocolHandler calls the method "Navigator.registerProtocolHandler" 2914 // in a try/catch block and returns (_, err, ok = false) when it went through 2915 // the catch clause. 2916 func (this Navigator) TryRegisterProtocolHandler(scheme js.String, url js.String) (ret js.Void, exception js.Any, ok bool) { 2917 ok = js.True == bindings.TryNavigatorRegisterProtocolHandler( 2918 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2919 scheme.Ref(), 2920 url.Ref(), 2921 ) 2922 2923 return 2924 } 2925 2926 // HasFuncUnregisterProtocolHandler returns true if the method "Navigator.unregisterProtocolHandler" exists. 2927 func (this Navigator) HasFuncUnregisterProtocolHandler() bool { 2928 return js.True == bindings.HasFuncNavigatorUnregisterProtocolHandler( 2929 this.ref, 2930 ) 2931 } 2932 2933 // FuncUnregisterProtocolHandler returns the method "Navigator.unregisterProtocolHandler". 2934 func (this Navigator) FuncUnregisterProtocolHandler() (fn js.Func[func(scheme js.String, url js.String)]) { 2935 bindings.FuncNavigatorUnregisterProtocolHandler( 2936 this.ref, js.Pointer(&fn), 2937 ) 2938 return 2939 } 2940 2941 // UnregisterProtocolHandler calls the method "Navigator.unregisterProtocolHandler". 2942 func (this Navigator) UnregisterProtocolHandler(scheme js.String, url js.String) (ret js.Void) { 2943 bindings.CallNavigatorUnregisterProtocolHandler( 2944 this.ref, js.Pointer(&ret), 2945 scheme.Ref(), 2946 url.Ref(), 2947 ) 2948 2949 return 2950 } 2951 2952 // TryUnregisterProtocolHandler calls the method "Navigator.unregisterProtocolHandler" 2953 // in a try/catch block and returns (_, err, ok = false) when it went through 2954 // the catch clause. 2955 func (this Navigator) TryUnregisterProtocolHandler(scheme js.String, url js.String) (ret js.Void, exception js.Any, ok bool) { 2956 ok = js.True == bindings.TryNavigatorUnregisterProtocolHandler( 2957 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2958 scheme.Ref(), 2959 url.Ref(), 2960 ) 2961 2962 return 2963 } 2964 2965 // HasFuncJavaEnabled returns true if the method "Navigator.javaEnabled" exists. 2966 func (this Navigator) HasFuncJavaEnabled() bool { 2967 return js.True == bindings.HasFuncNavigatorJavaEnabled( 2968 this.ref, 2969 ) 2970 } 2971 2972 // FuncJavaEnabled returns the method "Navigator.javaEnabled". 2973 func (this Navigator) FuncJavaEnabled() (fn js.Func[func() bool]) { 2974 bindings.FuncNavigatorJavaEnabled( 2975 this.ref, js.Pointer(&fn), 2976 ) 2977 return 2978 } 2979 2980 // JavaEnabled calls the method "Navigator.javaEnabled". 2981 func (this Navigator) JavaEnabled() (ret bool) { 2982 bindings.CallNavigatorJavaEnabled( 2983 this.ref, js.Pointer(&ret), 2984 ) 2985 2986 return 2987 } 2988 2989 // TryJavaEnabled calls the method "Navigator.javaEnabled" 2990 // in a try/catch block and returns (_, err, ok = false) when it went through 2991 // the catch clause. 2992 func (this Navigator) TryJavaEnabled() (ret bool, exception js.Any, ok bool) { 2993 ok = js.True == bindings.TryNavigatorJavaEnabled( 2994 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2995 ) 2996 2997 return 2998 } 2999 3000 // HasFuncSetAppBadge returns true if the method "Navigator.setAppBadge" exists. 3001 func (this Navigator) HasFuncSetAppBadge() bool { 3002 return js.True == bindings.HasFuncNavigatorSetAppBadge( 3003 this.ref, 3004 ) 3005 } 3006 3007 // FuncSetAppBadge returns the method "Navigator.setAppBadge". 3008 func (this Navigator) FuncSetAppBadge() (fn js.Func[func(contents uint64) js.Promise[js.Void]]) { 3009 bindings.FuncNavigatorSetAppBadge( 3010 this.ref, js.Pointer(&fn), 3011 ) 3012 return 3013 } 3014 3015 // SetAppBadge calls the method "Navigator.setAppBadge". 3016 func (this Navigator) SetAppBadge(contents uint64) (ret js.Promise[js.Void]) { 3017 bindings.CallNavigatorSetAppBadge( 3018 this.ref, js.Pointer(&ret), 3019 float64(contents), 3020 ) 3021 3022 return 3023 } 3024 3025 // TrySetAppBadge calls the method "Navigator.setAppBadge" 3026 // in a try/catch block and returns (_, err, ok = false) when it went through 3027 // the catch clause. 3028 func (this Navigator) TrySetAppBadge(contents uint64) (ret js.Promise[js.Void], exception js.Any, ok bool) { 3029 ok = js.True == bindings.TryNavigatorSetAppBadge( 3030 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3031 float64(contents), 3032 ) 3033 3034 return 3035 } 3036 3037 // HasFuncSetAppBadge1 returns true if the method "Navigator.setAppBadge" exists. 3038 func (this Navigator) HasFuncSetAppBadge1() bool { 3039 return js.True == bindings.HasFuncNavigatorSetAppBadge1( 3040 this.ref, 3041 ) 3042 } 3043 3044 // FuncSetAppBadge1 returns the method "Navigator.setAppBadge". 3045 func (this Navigator) FuncSetAppBadge1() (fn js.Func[func() js.Promise[js.Void]]) { 3046 bindings.FuncNavigatorSetAppBadge1( 3047 this.ref, js.Pointer(&fn), 3048 ) 3049 return 3050 } 3051 3052 // SetAppBadge1 calls the method "Navigator.setAppBadge". 3053 func (this Navigator) SetAppBadge1() (ret js.Promise[js.Void]) { 3054 bindings.CallNavigatorSetAppBadge1( 3055 this.ref, js.Pointer(&ret), 3056 ) 3057 3058 return 3059 } 3060 3061 // TrySetAppBadge1 calls the method "Navigator.setAppBadge" 3062 // in a try/catch block and returns (_, err, ok = false) when it went through 3063 // the catch clause. 3064 func (this Navigator) TrySetAppBadge1() (ret js.Promise[js.Void], exception js.Any, ok bool) { 3065 ok = js.True == bindings.TryNavigatorSetAppBadge1( 3066 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3067 ) 3068 3069 return 3070 } 3071 3072 // HasFuncClearAppBadge returns true if the method "Navigator.clearAppBadge" exists. 3073 func (this Navigator) HasFuncClearAppBadge() bool { 3074 return js.True == bindings.HasFuncNavigatorClearAppBadge( 3075 this.ref, 3076 ) 3077 } 3078 3079 // FuncClearAppBadge returns the method "Navigator.clearAppBadge". 3080 func (this Navigator) FuncClearAppBadge() (fn js.Func[func() js.Promise[js.Void]]) { 3081 bindings.FuncNavigatorClearAppBadge( 3082 this.ref, js.Pointer(&fn), 3083 ) 3084 return 3085 } 3086 3087 // ClearAppBadge calls the method "Navigator.clearAppBadge". 3088 func (this Navigator) ClearAppBadge() (ret js.Promise[js.Void]) { 3089 bindings.CallNavigatorClearAppBadge( 3090 this.ref, js.Pointer(&ret), 3091 ) 3092 3093 return 3094 } 3095 3096 // TryClearAppBadge calls the method "Navigator.clearAppBadge" 3097 // in a try/catch block and returns (_, err, ok = false) when it went through 3098 // the catch clause. 3099 func (this Navigator) TryClearAppBadge() (ret js.Promise[js.Void], exception js.Any, ok bool) { 3100 ok = js.True == bindings.TryNavigatorClearAppBadge( 3101 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3102 ) 3103 3104 return 3105 } 3106 3107 type LaunchConsumerFunc func(this js.Ref, params LaunchParams) js.Ref 3108 3109 func (fn LaunchConsumerFunc) Register() js.Func[func(params LaunchParams) js.Any] { 3110 return js.RegisterCallback[func(params LaunchParams) js.Any]( 3111 fn, abi.FuncPCABIInternal(fn), 3112 ) 3113 } 3114 3115 func (fn LaunchConsumerFunc) DispatchCallback( 3116 targetPC uintptr, ctx *js.CallbackContext, 3117 ) { 3118 args := ctx.Args() 3119 if len(args) != 1+1 /* js this */ || 3120 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3121 js.ThrowInvalidCallbackInvocation() 3122 } 3123 3124 if ctx.Return(fn( 3125 args[0], 3126 3127 LaunchParams{}.FromRef(args[0+1]), 3128 )) { 3129 return 3130 } 3131 3132 js.ThrowCallbackValueNotReturned() 3133 } 3134 3135 type LaunchConsumer[T any] struct { 3136 Fn func(arg T, this js.Ref, params LaunchParams) js.Ref 3137 Arg T 3138 } 3139 3140 func (cb *LaunchConsumer[T]) Register() js.Func[func(params LaunchParams) js.Any] { 3141 return js.RegisterCallback[func(params LaunchParams) js.Any]( 3142 cb, abi.FuncPCABIInternal(cb.Fn), 3143 ) 3144 } 3145 3146 func (cb *LaunchConsumer[T]) DispatchCallback( 3147 targetPC uintptr, ctx *js.CallbackContext, 3148 ) { 3149 args := ctx.Args() 3150 if len(args) != 1+1 /* js this */ || 3151 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3152 js.ThrowInvalidCallbackInvocation() 3153 } 3154 3155 if ctx.Return(cb.Fn( 3156 cb.Arg, 3157 args[0], 3158 3159 LaunchParams{}.FromRef(args[0+1]), 3160 )) { 3161 return 3162 } 3163 3164 js.ThrowCallbackValueNotReturned() 3165 } 3166 3167 type LaunchParams struct { 3168 ref js.Ref 3169 } 3170 3171 func (this LaunchParams) Once() LaunchParams { 3172 this.ref.Once() 3173 return this 3174 } 3175 3176 func (this LaunchParams) Ref() js.Ref { 3177 return this.ref 3178 } 3179 3180 func (this LaunchParams) FromRef(ref js.Ref) LaunchParams { 3181 this.ref = ref 3182 return this 3183 } 3184 3185 func (this LaunchParams) Free() { 3186 this.ref.Free() 3187 } 3188 3189 // TargetURL returns the value of property "LaunchParams.targetURL". 3190 // 3191 // It returns ok=false if there is no such property. 3192 func (this LaunchParams) TargetURL() (ret js.String, ok bool) { 3193 ok = js.True == bindings.GetLaunchParamsTargetURL( 3194 this.ref, js.Pointer(&ret), 3195 ) 3196 return 3197 } 3198 3199 // Files returns the value of property "LaunchParams.files". 3200 // 3201 // It returns ok=false if there is no such property. 3202 func (this LaunchParams) Files() (ret js.FrozenArray[FileSystemHandle], ok bool) { 3203 ok = js.True == bindings.GetLaunchParamsFiles( 3204 this.ref, js.Pointer(&ret), 3205 ) 3206 return 3207 } 3208 3209 type LaunchQueue struct { 3210 ref js.Ref 3211 } 3212 3213 func (this LaunchQueue) Once() LaunchQueue { 3214 this.ref.Once() 3215 return this 3216 } 3217 3218 func (this LaunchQueue) Ref() js.Ref { 3219 return this.ref 3220 } 3221 3222 func (this LaunchQueue) FromRef(ref js.Ref) LaunchQueue { 3223 this.ref = ref 3224 return this 3225 } 3226 3227 func (this LaunchQueue) Free() { 3228 this.ref.Free() 3229 } 3230 3231 // HasFuncSetConsumer returns true if the method "LaunchQueue.setConsumer" exists. 3232 func (this LaunchQueue) HasFuncSetConsumer() bool { 3233 return js.True == bindings.HasFuncLaunchQueueSetConsumer( 3234 this.ref, 3235 ) 3236 } 3237 3238 // FuncSetConsumer returns the method "LaunchQueue.setConsumer". 3239 func (this LaunchQueue) FuncSetConsumer() (fn js.Func[func(consumer js.Func[func(params LaunchParams) js.Any])]) { 3240 bindings.FuncLaunchQueueSetConsumer( 3241 this.ref, js.Pointer(&fn), 3242 ) 3243 return 3244 } 3245 3246 // SetConsumer calls the method "LaunchQueue.setConsumer". 3247 func (this LaunchQueue) SetConsumer(consumer js.Func[func(params LaunchParams) js.Any]) (ret js.Void) { 3248 bindings.CallLaunchQueueSetConsumer( 3249 this.ref, js.Pointer(&ret), 3250 consumer.Ref(), 3251 ) 3252 3253 return 3254 } 3255 3256 // TrySetConsumer calls the method "LaunchQueue.setConsumer" 3257 // in a try/catch block and returns (_, err, ok = false) when it went through 3258 // the catch clause. 3259 func (this LaunchQueue) TrySetConsumer(consumer js.Func[func(params LaunchParams) js.Any]) (ret js.Void, exception js.Any, ok bool) { 3260 ok = js.True == bindings.TryLaunchQueueSetConsumer( 3261 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3262 consumer.Ref(), 3263 ) 3264 3265 return 3266 } 3267 3268 type FenceReportingDestination uint32 3269 3270 const ( 3271 _ FenceReportingDestination = iota 3272 3273 FenceReportingDestination_BUYER 3274 FenceReportingDestination_SELLER 3275 FenceReportingDestination_COMPONENT_SELLER 3276 FenceReportingDestination_DIRECT_SELLER 3277 FenceReportingDestination_SHARED_STORAGE_SELECT_URL 3278 ) 3279 3280 func (FenceReportingDestination) FromRef(str js.Ref) FenceReportingDestination { 3281 return FenceReportingDestination(bindings.ConstOfFenceReportingDestination(str)) 3282 } 3283 3284 func (x FenceReportingDestination) String() (string, bool) { 3285 switch x { 3286 case FenceReportingDestination_BUYER: 3287 return "buyer", true 3288 case FenceReportingDestination_SELLER: 3289 return "seller", true 3290 case FenceReportingDestination_COMPONENT_SELLER: 3291 return "component-seller", true 3292 case FenceReportingDestination_DIRECT_SELLER: 3293 return "direct-seller", true 3294 case FenceReportingDestination_SHARED_STORAGE_SELECT_URL: 3295 return "shared-storage-select-url", true 3296 default: 3297 return "", false 3298 } 3299 } 3300 3301 type FenceEvent struct { 3302 // EventType is "FenceEvent.eventType" 3303 // 3304 // Required 3305 EventType js.String 3306 // EventData is "FenceEvent.eventData" 3307 // 3308 // Required 3309 EventData js.String 3310 // Destination is "FenceEvent.destination" 3311 // 3312 // Required 3313 Destination js.Array[FenceReportingDestination] 3314 // Once is "FenceEvent.once" 3315 // 3316 // Optional, defaults to false. 3317 // 3318 // NOTE: FFI_USE_Once MUST be set to true to make this field effective. 3319 Once bool 3320 3321 FFI_USE_Once bool // for Once. 3322 3323 FFI_USE bool 3324 } 3325 3326 // FromRef calls UpdateFrom and returns a FenceEvent with all fields set. 3327 func (p FenceEvent) FromRef(ref js.Ref) FenceEvent { 3328 p.UpdateFrom(ref) 3329 return p 3330 } 3331 3332 // New creates a new FenceEvent in the application heap. 3333 func (p FenceEvent) New() js.Ref { 3334 return bindings.FenceEventJSLoad( 3335 js.Pointer(&p), js.True, 0, 3336 ) 3337 } 3338 3339 // UpdateFrom copies value of all fields of the heap object to p. 3340 func (p *FenceEvent) UpdateFrom(ref js.Ref) { 3341 bindings.FenceEventJSStore( 3342 js.Pointer(p), ref, 3343 ) 3344 } 3345 3346 // Update writes all fields of the p to the heap object referenced by ref. 3347 func (p *FenceEvent) Update(ref js.Ref) { 3348 bindings.FenceEventJSLoad( 3349 js.Pointer(p), js.False, ref, 3350 ) 3351 } 3352 3353 // FreeMembers frees fields with heap reference, if recursive is true 3354 // free all heap references reachable from p. 3355 func (p *FenceEvent) FreeMembers(recursive bool) { 3356 js.Free( 3357 p.EventType.Ref(), 3358 p.EventData.Ref(), 3359 p.Destination.Ref(), 3360 ) 3361 p.EventType = p.EventType.FromRef(js.Undefined) 3362 p.EventData = p.EventData.FromRef(js.Undefined) 3363 p.Destination = p.Destination.FromRef(js.Undefined) 3364 } 3365 3366 type OneOf_FenceEvent_String struct { 3367 ref js.Ref 3368 } 3369 3370 func (x OneOf_FenceEvent_String) Ref() js.Ref { 3371 return x.ref 3372 } 3373 3374 func (x OneOf_FenceEvent_String) Free() { 3375 x.ref.Free() 3376 } 3377 3378 func (x OneOf_FenceEvent_String) FromRef(ref js.Ref) OneOf_FenceEvent_String { 3379 return OneOf_FenceEvent_String{ 3380 ref: ref, 3381 } 3382 } 3383 3384 func (x OneOf_FenceEvent_String) FenceEvent() FenceEvent { 3385 var ret FenceEvent 3386 ret.UpdateFrom(x.ref) 3387 return ret 3388 } 3389 3390 func (x OneOf_FenceEvent_String) String() js.String { 3391 return js.String{}.FromRef(x.ref) 3392 } 3393 3394 type ReportEventType = OneOf_FenceEvent_String 3395 3396 type Fence struct { 3397 ref js.Ref 3398 } 3399 3400 func (this Fence) Once() Fence { 3401 this.ref.Once() 3402 return this 3403 } 3404 3405 func (this Fence) Ref() js.Ref { 3406 return this.ref 3407 } 3408 3409 func (this Fence) FromRef(ref js.Ref) Fence { 3410 this.ref = ref 3411 return this 3412 } 3413 3414 func (this Fence) Free() { 3415 this.ref.Free() 3416 } 3417 3418 // HasFuncReportEvent returns true if the method "Fence.reportEvent" exists. 3419 func (this Fence) HasFuncReportEvent() bool { 3420 return js.True == bindings.HasFuncFenceReportEvent( 3421 this.ref, 3422 ) 3423 } 3424 3425 // FuncReportEvent returns the method "Fence.reportEvent". 3426 func (this Fence) FuncReportEvent() (fn js.Func[func(event ReportEventType)]) { 3427 bindings.FuncFenceReportEvent( 3428 this.ref, js.Pointer(&fn), 3429 ) 3430 return 3431 } 3432 3433 // ReportEvent calls the method "Fence.reportEvent". 3434 func (this Fence) ReportEvent(event ReportEventType) (ret js.Void) { 3435 bindings.CallFenceReportEvent( 3436 this.ref, js.Pointer(&ret), 3437 event.Ref(), 3438 ) 3439 3440 return 3441 } 3442 3443 // TryReportEvent calls the method "Fence.reportEvent" 3444 // in a try/catch block and returns (_, err, ok = false) when it went through 3445 // the catch clause. 3446 func (this Fence) TryReportEvent(event ReportEventType) (ret js.Void, exception js.Any, ok bool) { 3447 ok = js.True == bindings.TryFenceReportEvent( 3448 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3449 event.Ref(), 3450 ) 3451 3452 return 3453 } 3454 3455 // HasFuncSetReportEventDataForAutomaticBeacons returns true if the method "Fence.setReportEventDataForAutomaticBeacons" exists. 3456 func (this Fence) HasFuncSetReportEventDataForAutomaticBeacons() bool { 3457 return js.True == bindings.HasFuncFenceSetReportEventDataForAutomaticBeacons( 3458 this.ref, 3459 ) 3460 } 3461 3462 // FuncSetReportEventDataForAutomaticBeacons returns the method "Fence.setReportEventDataForAutomaticBeacons". 3463 func (this Fence) FuncSetReportEventDataForAutomaticBeacons() (fn js.Func[func(event FenceEvent)]) { 3464 bindings.FuncFenceSetReportEventDataForAutomaticBeacons( 3465 this.ref, js.Pointer(&fn), 3466 ) 3467 return 3468 } 3469 3470 // SetReportEventDataForAutomaticBeacons calls the method "Fence.setReportEventDataForAutomaticBeacons". 3471 func (this Fence) SetReportEventDataForAutomaticBeacons(event FenceEvent) (ret js.Void) { 3472 bindings.CallFenceSetReportEventDataForAutomaticBeacons( 3473 this.ref, js.Pointer(&ret), 3474 js.Pointer(&event), 3475 ) 3476 3477 return 3478 } 3479 3480 // TrySetReportEventDataForAutomaticBeacons calls the method "Fence.setReportEventDataForAutomaticBeacons" 3481 // in a try/catch block and returns (_, err, ok = false) when it went through 3482 // the catch clause. 3483 func (this Fence) TrySetReportEventDataForAutomaticBeacons(event FenceEvent) (ret js.Void, exception js.Any, ok bool) { 3484 ok = js.True == bindings.TryFenceSetReportEventDataForAutomaticBeacons( 3485 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3486 js.Pointer(&event), 3487 ) 3488 3489 return 3490 } 3491 3492 // HasFuncGetNestedConfigs returns true if the method "Fence.getNestedConfigs" exists. 3493 func (this Fence) HasFuncGetNestedConfigs() bool { 3494 return js.True == bindings.HasFuncFenceGetNestedConfigs( 3495 this.ref, 3496 ) 3497 } 3498 3499 // FuncGetNestedConfigs returns the method "Fence.getNestedConfigs". 3500 func (this Fence) FuncGetNestedConfigs() (fn js.Func[func() js.Array[FencedFrameConfig]]) { 3501 bindings.FuncFenceGetNestedConfigs( 3502 this.ref, js.Pointer(&fn), 3503 ) 3504 return 3505 } 3506 3507 // GetNestedConfigs calls the method "Fence.getNestedConfigs". 3508 func (this Fence) GetNestedConfigs() (ret js.Array[FencedFrameConfig]) { 3509 bindings.CallFenceGetNestedConfigs( 3510 this.ref, js.Pointer(&ret), 3511 ) 3512 3513 return 3514 } 3515 3516 // TryGetNestedConfigs calls the method "Fence.getNestedConfigs" 3517 // in a try/catch block and returns (_, err, ok = false) when it went through 3518 // the catch clause. 3519 func (this Fence) TryGetNestedConfigs() (ret js.Array[FencedFrameConfig], exception js.Any, ok bool) { 3520 ok = js.True == bindings.TryFenceGetNestedConfigs( 3521 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3522 ) 3523 3524 return 3525 } 3526 3527 type PortalHost struct { 3528 EventTarget 3529 } 3530 3531 func (this PortalHost) Once() PortalHost { 3532 this.ref.Once() 3533 return this 3534 } 3535 3536 func (this PortalHost) Ref() js.Ref { 3537 return this.EventTarget.Ref() 3538 } 3539 3540 func (this PortalHost) FromRef(ref js.Ref) PortalHost { 3541 this.EventTarget = this.EventTarget.FromRef(ref) 3542 return this 3543 } 3544 3545 func (this PortalHost) Free() { 3546 this.ref.Free() 3547 } 3548 3549 // HasFuncPostMessage returns true if the method "PortalHost.postMessage" exists. 3550 func (this PortalHost) HasFuncPostMessage() bool { 3551 return js.True == bindings.HasFuncPortalHostPostMessage( 3552 this.ref, 3553 ) 3554 } 3555 3556 // FuncPostMessage returns the method "PortalHost.postMessage". 3557 func (this PortalHost) FuncPostMessage() (fn js.Func[func(message js.Any, options StructuredSerializeOptions)]) { 3558 bindings.FuncPortalHostPostMessage( 3559 this.ref, js.Pointer(&fn), 3560 ) 3561 return 3562 } 3563 3564 // PostMessage calls the method "PortalHost.postMessage". 3565 func (this PortalHost) PostMessage(message js.Any, options StructuredSerializeOptions) (ret js.Void) { 3566 bindings.CallPortalHostPostMessage( 3567 this.ref, js.Pointer(&ret), 3568 message.Ref(), 3569 js.Pointer(&options), 3570 ) 3571 3572 return 3573 } 3574 3575 // TryPostMessage calls the method "PortalHost.postMessage" 3576 // in a try/catch block and returns (_, err, ok = false) when it went through 3577 // the catch clause. 3578 func (this PortalHost) TryPostMessage(message js.Any, options StructuredSerializeOptions) (ret js.Void, exception js.Any, ok bool) { 3579 ok = js.True == bindings.TryPortalHostPostMessage( 3580 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3581 message.Ref(), 3582 js.Pointer(&options), 3583 ) 3584 3585 return 3586 } 3587 3588 // HasFuncPostMessage1 returns true if the method "PortalHost.postMessage" exists. 3589 func (this PortalHost) HasFuncPostMessage1() bool { 3590 return js.True == bindings.HasFuncPortalHostPostMessage1( 3591 this.ref, 3592 ) 3593 } 3594 3595 // FuncPostMessage1 returns the method "PortalHost.postMessage". 3596 func (this PortalHost) FuncPostMessage1() (fn js.Func[func(message js.Any)]) { 3597 bindings.FuncPortalHostPostMessage1( 3598 this.ref, js.Pointer(&fn), 3599 ) 3600 return 3601 } 3602 3603 // PostMessage1 calls the method "PortalHost.postMessage". 3604 func (this PortalHost) PostMessage1(message js.Any) (ret js.Void) { 3605 bindings.CallPortalHostPostMessage1( 3606 this.ref, js.Pointer(&ret), 3607 message.Ref(), 3608 ) 3609 3610 return 3611 } 3612 3613 // TryPostMessage1 calls the method "PortalHost.postMessage" 3614 // in a try/catch block and returns (_, err, ok = false) when it went through 3615 // the catch clause. 3616 func (this PortalHost) TryPostMessage1(message js.Any) (ret js.Void, exception js.Any, ok bool) { 3617 ok = js.True == bindings.TryPortalHostPostMessage1( 3618 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3619 message.Ref(), 3620 ) 3621 3622 return 3623 } 3624 3625 type OrientationLockType uint32 3626 3627 const ( 3628 _ OrientationLockType = iota 3629 3630 OrientationLockType_ANY 3631 OrientationLockType_NATURAL 3632 OrientationLockType_LANDSCAPE 3633 OrientationLockType_PORTRAIT 3634 OrientationLockType_PORTRAIT_PRIMARY 3635 OrientationLockType_PORTRAIT_SECONDARY 3636 OrientationLockType_LANDSCAPE_PRIMARY 3637 OrientationLockType_LANDSCAPE_SECONDARY 3638 ) 3639 3640 func (OrientationLockType) FromRef(str js.Ref) OrientationLockType { 3641 return OrientationLockType(bindings.ConstOfOrientationLockType(str)) 3642 } 3643 3644 func (x OrientationLockType) String() (string, bool) { 3645 switch x { 3646 case OrientationLockType_ANY: 3647 return "any", true 3648 case OrientationLockType_NATURAL: 3649 return "natural", true 3650 case OrientationLockType_LANDSCAPE: 3651 return "landscape", true 3652 case OrientationLockType_PORTRAIT: 3653 return "portrait", true 3654 case OrientationLockType_PORTRAIT_PRIMARY: 3655 return "portrait-primary", true 3656 case OrientationLockType_PORTRAIT_SECONDARY: 3657 return "portrait-secondary", true 3658 case OrientationLockType_LANDSCAPE_PRIMARY: 3659 return "landscape-primary", true 3660 case OrientationLockType_LANDSCAPE_SECONDARY: 3661 return "landscape-secondary", true 3662 default: 3663 return "", false 3664 } 3665 } 3666 3667 type OrientationType uint32 3668 3669 const ( 3670 _ OrientationType = iota 3671 3672 OrientationType_PORTRAIT_PRIMARY 3673 OrientationType_PORTRAIT_SECONDARY 3674 OrientationType_LANDSCAPE_PRIMARY 3675 OrientationType_LANDSCAPE_SECONDARY 3676 ) 3677 3678 func (OrientationType) FromRef(str js.Ref) OrientationType { 3679 return OrientationType(bindings.ConstOfOrientationType(str)) 3680 } 3681 3682 func (x OrientationType) String() (string, bool) { 3683 switch x { 3684 case OrientationType_PORTRAIT_PRIMARY: 3685 return "portrait-primary", true 3686 case OrientationType_PORTRAIT_SECONDARY: 3687 return "portrait-secondary", true 3688 case OrientationType_LANDSCAPE_PRIMARY: 3689 return "landscape-primary", true 3690 case OrientationType_LANDSCAPE_SECONDARY: 3691 return "landscape-secondary", true 3692 default: 3693 return "", false 3694 } 3695 } 3696 3697 type ScreenOrientation struct { 3698 EventTarget 3699 } 3700 3701 func (this ScreenOrientation) Once() ScreenOrientation { 3702 this.ref.Once() 3703 return this 3704 } 3705 3706 func (this ScreenOrientation) Ref() js.Ref { 3707 return this.EventTarget.Ref() 3708 } 3709 3710 func (this ScreenOrientation) FromRef(ref js.Ref) ScreenOrientation { 3711 this.EventTarget = this.EventTarget.FromRef(ref) 3712 return this 3713 } 3714 3715 func (this ScreenOrientation) Free() { 3716 this.ref.Free() 3717 } 3718 3719 // Type returns the value of property "ScreenOrientation.type". 3720 // 3721 // It returns ok=false if there is no such property. 3722 func (this ScreenOrientation) Type() (ret OrientationType, ok bool) { 3723 ok = js.True == bindings.GetScreenOrientationType( 3724 this.ref, js.Pointer(&ret), 3725 ) 3726 return 3727 } 3728 3729 // Angle returns the value of property "ScreenOrientation.angle". 3730 // 3731 // It returns ok=false if there is no such property. 3732 func (this ScreenOrientation) Angle() (ret uint16, ok bool) { 3733 ok = js.True == bindings.GetScreenOrientationAngle( 3734 this.ref, js.Pointer(&ret), 3735 ) 3736 return 3737 } 3738 3739 // HasFuncLock returns true if the method "ScreenOrientation.lock" exists. 3740 func (this ScreenOrientation) HasFuncLock() bool { 3741 return js.True == bindings.HasFuncScreenOrientationLock( 3742 this.ref, 3743 ) 3744 } 3745 3746 // FuncLock returns the method "ScreenOrientation.lock". 3747 func (this ScreenOrientation) FuncLock() (fn js.Func[func(orientation OrientationLockType) js.Promise[js.Void]]) { 3748 bindings.FuncScreenOrientationLock( 3749 this.ref, js.Pointer(&fn), 3750 ) 3751 return 3752 } 3753 3754 // Lock calls the method "ScreenOrientation.lock". 3755 func (this ScreenOrientation) Lock(orientation OrientationLockType) (ret js.Promise[js.Void]) { 3756 bindings.CallScreenOrientationLock( 3757 this.ref, js.Pointer(&ret), 3758 uint32(orientation), 3759 ) 3760 3761 return 3762 } 3763 3764 // TryLock calls the method "ScreenOrientation.lock" 3765 // in a try/catch block and returns (_, err, ok = false) when it went through 3766 // the catch clause. 3767 func (this ScreenOrientation) TryLock(orientation OrientationLockType) (ret js.Promise[js.Void], exception js.Any, ok bool) { 3768 ok = js.True == bindings.TryScreenOrientationLock( 3769 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3770 uint32(orientation), 3771 ) 3772 3773 return 3774 } 3775 3776 // HasFuncUnlock returns true if the method "ScreenOrientation.unlock" exists. 3777 func (this ScreenOrientation) HasFuncUnlock() bool { 3778 return js.True == bindings.HasFuncScreenOrientationUnlock( 3779 this.ref, 3780 ) 3781 } 3782 3783 // FuncUnlock returns the method "ScreenOrientation.unlock". 3784 func (this ScreenOrientation) FuncUnlock() (fn js.Func[func()]) { 3785 bindings.FuncScreenOrientationUnlock( 3786 this.ref, js.Pointer(&fn), 3787 ) 3788 return 3789 } 3790 3791 // Unlock calls the method "ScreenOrientation.unlock". 3792 func (this ScreenOrientation) Unlock() (ret js.Void) { 3793 bindings.CallScreenOrientationUnlock( 3794 this.ref, js.Pointer(&ret), 3795 ) 3796 3797 return 3798 } 3799 3800 // TryUnlock calls the method "ScreenOrientation.unlock" 3801 // in a try/catch block and returns (_, err, ok = false) when it went through 3802 // the catch clause. 3803 func (this ScreenOrientation) TryUnlock() (ret js.Void, exception js.Any, ok bool) { 3804 ok = js.True == bindings.TryScreenOrientationUnlock( 3805 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3806 ) 3807 3808 return 3809 } 3810 3811 type Screen struct { 3812 ref js.Ref 3813 } 3814 3815 func (this Screen) Once() Screen { 3816 this.ref.Once() 3817 return this 3818 } 3819 3820 func (this Screen) Ref() js.Ref { 3821 return this.ref 3822 } 3823 3824 func (this Screen) FromRef(ref js.Ref) Screen { 3825 this.ref = ref 3826 return this 3827 } 3828 3829 func (this Screen) Free() { 3830 this.ref.Free() 3831 } 3832 3833 // AvailWidth returns the value of property "Screen.availWidth". 3834 // 3835 // It returns ok=false if there is no such property. 3836 func (this Screen) AvailWidth() (ret int32, ok bool) { 3837 ok = js.True == bindings.GetScreenAvailWidth( 3838 this.ref, js.Pointer(&ret), 3839 ) 3840 return 3841 } 3842 3843 // AvailHeight returns the value of property "Screen.availHeight". 3844 // 3845 // It returns ok=false if there is no such property. 3846 func (this Screen) AvailHeight() (ret int32, ok bool) { 3847 ok = js.True == bindings.GetScreenAvailHeight( 3848 this.ref, js.Pointer(&ret), 3849 ) 3850 return 3851 } 3852 3853 // Width returns the value of property "Screen.width". 3854 // 3855 // It returns ok=false if there is no such property. 3856 func (this Screen) Width() (ret int32, ok bool) { 3857 ok = js.True == bindings.GetScreenWidth( 3858 this.ref, js.Pointer(&ret), 3859 ) 3860 return 3861 } 3862 3863 // Height returns the value of property "Screen.height". 3864 // 3865 // It returns ok=false if there is no such property. 3866 func (this Screen) Height() (ret int32, ok bool) { 3867 ok = js.True == bindings.GetScreenHeight( 3868 this.ref, js.Pointer(&ret), 3869 ) 3870 return 3871 } 3872 3873 // ColorDepth returns the value of property "Screen.colorDepth". 3874 // 3875 // It returns ok=false if there is no such property. 3876 func (this Screen) ColorDepth() (ret uint32, ok bool) { 3877 ok = js.True == bindings.GetScreenColorDepth( 3878 this.ref, js.Pointer(&ret), 3879 ) 3880 return 3881 } 3882 3883 // PixelDepth returns the value of property "Screen.pixelDepth". 3884 // 3885 // It returns ok=false if there is no such property. 3886 func (this Screen) PixelDepth() (ret uint32, ok bool) { 3887 ok = js.True == bindings.GetScreenPixelDepth( 3888 this.ref, js.Pointer(&ret), 3889 ) 3890 return 3891 } 3892 3893 // IsExtended returns the value of property "Screen.isExtended". 3894 // 3895 // It returns ok=false if there is no such property. 3896 func (this Screen) IsExtended() (ret bool, ok bool) { 3897 ok = js.True == bindings.GetScreenIsExtended( 3898 this.ref, js.Pointer(&ret), 3899 ) 3900 return 3901 } 3902 3903 // Orientation returns the value of property "Screen.orientation". 3904 // 3905 // It returns ok=false if there is no such property. 3906 func (this Screen) Orientation() (ret ScreenOrientation, ok bool) { 3907 ok = js.True == bindings.GetScreenOrientation( 3908 this.ref, js.Pointer(&ret), 3909 ) 3910 return 3911 } 3912 3913 type VisualViewport struct { 3914 EventTarget 3915 } 3916 3917 func (this VisualViewport) Once() VisualViewport { 3918 this.ref.Once() 3919 return this 3920 } 3921 3922 func (this VisualViewport) Ref() js.Ref { 3923 return this.EventTarget.Ref() 3924 } 3925 3926 func (this VisualViewport) FromRef(ref js.Ref) VisualViewport { 3927 this.EventTarget = this.EventTarget.FromRef(ref) 3928 return this 3929 } 3930 3931 func (this VisualViewport) Free() { 3932 this.ref.Free() 3933 } 3934 3935 // OffsetLeft returns the value of property "VisualViewport.offsetLeft". 3936 // 3937 // It returns ok=false if there is no such property. 3938 func (this VisualViewport) OffsetLeft() (ret float64, ok bool) { 3939 ok = js.True == bindings.GetVisualViewportOffsetLeft( 3940 this.ref, js.Pointer(&ret), 3941 ) 3942 return 3943 } 3944 3945 // OffsetTop returns the value of property "VisualViewport.offsetTop". 3946 // 3947 // It returns ok=false if there is no such property. 3948 func (this VisualViewport) OffsetTop() (ret float64, ok bool) { 3949 ok = js.True == bindings.GetVisualViewportOffsetTop( 3950 this.ref, js.Pointer(&ret), 3951 ) 3952 return 3953 } 3954 3955 // PageLeft returns the value of property "VisualViewport.pageLeft". 3956 // 3957 // It returns ok=false if there is no such property. 3958 func (this VisualViewport) PageLeft() (ret float64, ok bool) { 3959 ok = js.True == bindings.GetVisualViewportPageLeft( 3960 this.ref, js.Pointer(&ret), 3961 ) 3962 return 3963 } 3964 3965 // PageTop returns the value of property "VisualViewport.pageTop". 3966 // 3967 // It returns ok=false if there is no such property. 3968 func (this VisualViewport) PageTop() (ret float64, ok bool) { 3969 ok = js.True == bindings.GetVisualViewportPageTop( 3970 this.ref, js.Pointer(&ret), 3971 ) 3972 return 3973 } 3974 3975 // Width returns the value of property "VisualViewport.width". 3976 // 3977 // It returns ok=false if there is no such property. 3978 func (this VisualViewport) Width() (ret float64, ok bool) { 3979 ok = js.True == bindings.GetVisualViewportWidth( 3980 this.ref, js.Pointer(&ret), 3981 ) 3982 return 3983 } 3984 3985 // Height returns the value of property "VisualViewport.height". 3986 // 3987 // It returns ok=false if there is no such property. 3988 func (this VisualViewport) Height() (ret float64, ok bool) { 3989 ok = js.True == bindings.GetVisualViewportHeight( 3990 this.ref, js.Pointer(&ret), 3991 ) 3992 return 3993 } 3994 3995 // Scale returns the value of property "VisualViewport.scale". 3996 // 3997 // It returns ok=false if there is no such property. 3998 func (this VisualViewport) Scale() (ret float64, ok bool) { 3999 ok = js.True == bindings.GetVisualViewportScale( 4000 this.ref, js.Pointer(&ret), 4001 ) 4002 return 4003 } 4004 4005 type SharedStorageRunOperationMethodOptions struct { 4006 // Data is "SharedStorageRunOperationMethodOptions.data" 4007 // 4008 // Optional 4009 Data js.Object 4010 // ResolveToConfig is "SharedStorageRunOperationMethodOptions.resolveToConfig" 4011 // 4012 // Optional, defaults to false. 4013 // 4014 // NOTE: FFI_USE_ResolveToConfig MUST be set to true to make this field effective. 4015 ResolveToConfig bool 4016 // KeepAlive is "SharedStorageRunOperationMethodOptions.keepAlive" 4017 // 4018 // Optional, defaults to false. 4019 // 4020 // NOTE: FFI_USE_KeepAlive MUST be set to true to make this field effective. 4021 KeepAlive bool 4022 4023 FFI_USE_ResolveToConfig bool // for ResolveToConfig. 4024 FFI_USE_KeepAlive bool // for KeepAlive. 4025 4026 FFI_USE bool 4027 } 4028 4029 // FromRef calls UpdateFrom and returns a SharedStorageRunOperationMethodOptions with all fields set. 4030 func (p SharedStorageRunOperationMethodOptions) FromRef(ref js.Ref) SharedStorageRunOperationMethodOptions { 4031 p.UpdateFrom(ref) 4032 return p 4033 } 4034 4035 // New creates a new SharedStorageRunOperationMethodOptions in the application heap. 4036 func (p SharedStorageRunOperationMethodOptions) New() js.Ref { 4037 return bindings.SharedStorageRunOperationMethodOptionsJSLoad( 4038 js.Pointer(&p), js.True, 0, 4039 ) 4040 } 4041 4042 // UpdateFrom copies value of all fields of the heap object to p. 4043 func (p *SharedStorageRunOperationMethodOptions) UpdateFrom(ref js.Ref) { 4044 bindings.SharedStorageRunOperationMethodOptionsJSStore( 4045 js.Pointer(p), ref, 4046 ) 4047 } 4048 4049 // Update writes all fields of the p to the heap object referenced by ref. 4050 func (p *SharedStorageRunOperationMethodOptions) Update(ref js.Ref) { 4051 bindings.SharedStorageRunOperationMethodOptionsJSLoad( 4052 js.Pointer(p), js.False, ref, 4053 ) 4054 } 4055 4056 // FreeMembers frees fields with heap reference, if recursive is true 4057 // free all heap references reachable from p. 4058 func (p *SharedStorageRunOperationMethodOptions) FreeMembers(recursive bool) { 4059 js.Free( 4060 p.Data.Ref(), 4061 ) 4062 p.Data = p.Data.FromRef(js.Undefined) 4063 } 4064 4065 type SharedStorageResponse = OneOf_String_FencedFrameConfig 4066 4067 type SharedStorageUrlWithMetadata struct { 4068 // Url is "SharedStorageUrlWithMetadata.url" 4069 // 4070 // Required 4071 Url js.String 4072 // ReportingMetadata is "SharedStorageUrlWithMetadata.reportingMetadata" 4073 // 4074 // Optional 4075 ReportingMetadata js.Object 4076 4077 FFI_USE bool 4078 } 4079 4080 // FromRef calls UpdateFrom and returns a SharedStorageUrlWithMetadata with all fields set. 4081 func (p SharedStorageUrlWithMetadata) FromRef(ref js.Ref) SharedStorageUrlWithMetadata { 4082 p.UpdateFrom(ref) 4083 return p 4084 } 4085 4086 // New creates a new SharedStorageUrlWithMetadata in the application heap. 4087 func (p SharedStorageUrlWithMetadata) New() js.Ref { 4088 return bindings.SharedStorageUrlWithMetadataJSLoad( 4089 js.Pointer(&p), js.True, 0, 4090 ) 4091 } 4092 4093 // UpdateFrom copies value of all fields of the heap object to p. 4094 func (p *SharedStorageUrlWithMetadata) UpdateFrom(ref js.Ref) { 4095 bindings.SharedStorageUrlWithMetadataJSStore( 4096 js.Pointer(p), ref, 4097 ) 4098 } 4099 4100 // Update writes all fields of the p to the heap object referenced by ref. 4101 func (p *SharedStorageUrlWithMetadata) Update(ref js.Ref) { 4102 bindings.SharedStorageUrlWithMetadataJSLoad( 4103 js.Pointer(p), js.False, ref, 4104 ) 4105 } 4106 4107 // FreeMembers frees fields with heap reference, if recursive is true 4108 // free all heap references reachable from p. 4109 func (p *SharedStorageUrlWithMetadata) FreeMembers(recursive bool) { 4110 js.Free( 4111 p.Url.Ref(), 4112 p.ReportingMetadata.Ref(), 4113 ) 4114 p.Url = p.Url.FromRef(js.Undefined) 4115 p.ReportingMetadata = p.ReportingMetadata.FromRef(js.Undefined) 4116 }