github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis26_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 const ( 13 _ USBRecipient = iota 14 15 USBRecipient_DEVICE 16 USBRecipient_INTERFACE 17 USBRecipient_ENDPOINT 18 USBRecipient_OTHER 19 ) 20 21 func (USBRecipient) FromRef(str js.Ref) USBRecipient { 22 return USBRecipient(bindings.ConstOfUSBRecipient(str)) 23 } 24 25 func (x USBRecipient) String() (string, bool) { 26 switch x { 27 case USBRecipient_DEVICE: 28 return "device", true 29 case USBRecipient_INTERFACE: 30 return "interface", true 31 case USBRecipient_ENDPOINT: 32 return "endpoint", true 33 case USBRecipient_OTHER: 34 return "other", true 35 default: 36 return "", false 37 } 38 } 39 40 type USBControlTransferParameters struct { 41 // RequestType is "USBControlTransferParameters.requestType" 42 // 43 // Required 44 RequestType USBRequestType 45 // Recipient is "USBControlTransferParameters.recipient" 46 // 47 // Required 48 Recipient USBRecipient 49 // Request is "USBControlTransferParameters.request" 50 // 51 // Required 52 Request uint8 53 // Value is "USBControlTransferParameters.value" 54 // 55 // Required 56 Value uint16 57 // Index is "USBControlTransferParameters.index" 58 // 59 // Required 60 Index uint16 61 62 FFI_USE bool 63 } 64 65 // FromRef calls UpdateFrom and returns a USBControlTransferParameters with all fields set. 66 func (p USBControlTransferParameters) FromRef(ref js.Ref) USBControlTransferParameters { 67 p.UpdateFrom(ref) 68 return p 69 } 70 71 // New creates a new USBControlTransferParameters in the application heap. 72 func (p USBControlTransferParameters) New() js.Ref { 73 return bindings.USBControlTransferParametersJSLoad( 74 js.Pointer(&p), js.True, 0, 75 ) 76 } 77 78 // UpdateFrom copies value of all fields of the heap object to p. 79 func (p *USBControlTransferParameters) UpdateFrom(ref js.Ref) { 80 bindings.USBControlTransferParametersJSStore( 81 js.Pointer(p), ref, 82 ) 83 } 84 85 // Update writes all fields of the p to the heap object referenced by ref. 86 func (p *USBControlTransferParameters) Update(ref js.Ref) { 87 bindings.USBControlTransferParametersJSLoad( 88 js.Pointer(p), js.False, ref, 89 ) 90 } 91 92 // FreeMembers frees fields with heap reference, if recursive is true 93 // free all heap references reachable from p. 94 func (p *USBControlTransferParameters) FreeMembers(recursive bool) { 95 } 96 97 func NewUSBOutTransferResult(status USBTransferStatus, bytesWritten uint32) (ret USBOutTransferResult) { 98 ret.ref = bindings.NewUSBOutTransferResultByUSBOutTransferResult( 99 uint32(status), 100 uint32(bytesWritten)) 101 return 102 } 103 104 func NewUSBOutTransferResultByUSBOutTransferResult1(status USBTransferStatus) (ret USBOutTransferResult) { 105 ret.ref = bindings.NewUSBOutTransferResultByUSBOutTransferResult1( 106 uint32(status)) 107 return 108 } 109 110 type USBOutTransferResult struct { 111 ref js.Ref 112 } 113 114 func (this USBOutTransferResult) Once() USBOutTransferResult { 115 this.ref.Once() 116 return this 117 } 118 119 func (this USBOutTransferResult) Ref() js.Ref { 120 return this.ref 121 } 122 123 func (this USBOutTransferResult) FromRef(ref js.Ref) USBOutTransferResult { 124 this.ref = ref 125 return this 126 } 127 128 func (this USBOutTransferResult) Free() { 129 this.ref.Free() 130 } 131 132 // BytesWritten returns the value of property "USBOutTransferResult.bytesWritten". 133 // 134 // It returns ok=false if there is no such property. 135 func (this USBOutTransferResult) BytesWritten() (ret uint32, ok bool) { 136 ok = js.True == bindings.GetUSBOutTransferResultBytesWritten( 137 this.ref, js.Pointer(&ret), 138 ) 139 return 140 } 141 142 // Status returns the value of property "USBOutTransferResult.status". 143 // 144 // It returns ok=false if there is no such property. 145 func (this USBOutTransferResult) Status() (ret USBTransferStatus, ok bool) { 146 ok = js.True == bindings.GetUSBOutTransferResultStatus( 147 this.ref, js.Pointer(&ret), 148 ) 149 return 150 } 151 152 type USBDirection uint32 153 154 const ( 155 _ USBDirection = iota 156 157 USBDirection_IN 158 USBDirection_OUT 159 ) 160 161 func (USBDirection) FromRef(str js.Ref) USBDirection { 162 return USBDirection(bindings.ConstOfUSBDirection(str)) 163 } 164 165 func (x USBDirection) String() (string, bool) { 166 switch x { 167 case USBDirection_IN: 168 return "in", true 169 case USBDirection_OUT: 170 return "out", true 171 default: 172 return "", false 173 } 174 } 175 176 func NewUSBIsochronousInTransferPacket(status USBTransferStatus, data js.DataView) (ret USBIsochronousInTransferPacket) { 177 ret.ref = bindings.NewUSBIsochronousInTransferPacketByUSBIsochronousInTransferPacket( 178 uint32(status), 179 data.Ref()) 180 return 181 } 182 183 func NewUSBIsochronousInTransferPacketByUSBIsochronousInTransferPacket1(status USBTransferStatus) (ret USBIsochronousInTransferPacket) { 184 ret.ref = bindings.NewUSBIsochronousInTransferPacketByUSBIsochronousInTransferPacket1( 185 uint32(status)) 186 return 187 } 188 189 type USBIsochronousInTransferPacket struct { 190 ref js.Ref 191 } 192 193 func (this USBIsochronousInTransferPacket) Once() USBIsochronousInTransferPacket { 194 this.ref.Once() 195 return this 196 } 197 198 func (this USBIsochronousInTransferPacket) Ref() js.Ref { 199 return this.ref 200 } 201 202 func (this USBIsochronousInTransferPacket) FromRef(ref js.Ref) USBIsochronousInTransferPacket { 203 this.ref = ref 204 return this 205 } 206 207 func (this USBIsochronousInTransferPacket) Free() { 208 this.ref.Free() 209 } 210 211 // Data returns the value of property "USBIsochronousInTransferPacket.data". 212 // 213 // It returns ok=false if there is no such property. 214 func (this USBIsochronousInTransferPacket) Data() (ret js.DataView, ok bool) { 215 ok = js.True == bindings.GetUSBIsochronousInTransferPacketData( 216 this.ref, js.Pointer(&ret), 217 ) 218 return 219 } 220 221 // Status returns the value of property "USBIsochronousInTransferPacket.status". 222 // 223 // It returns ok=false if there is no such property. 224 func (this USBIsochronousInTransferPacket) Status() (ret USBTransferStatus, ok bool) { 225 ok = js.True == bindings.GetUSBIsochronousInTransferPacketStatus( 226 this.ref, js.Pointer(&ret), 227 ) 228 return 229 } 230 231 func NewUSBIsochronousInTransferResult(packets js.Array[USBIsochronousInTransferPacket], data js.DataView) (ret USBIsochronousInTransferResult) { 232 ret.ref = bindings.NewUSBIsochronousInTransferResultByUSBIsochronousInTransferResult( 233 packets.Ref(), 234 data.Ref()) 235 return 236 } 237 238 func NewUSBIsochronousInTransferResultByUSBIsochronousInTransferResult1(packets js.Array[USBIsochronousInTransferPacket]) (ret USBIsochronousInTransferResult) { 239 ret.ref = bindings.NewUSBIsochronousInTransferResultByUSBIsochronousInTransferResult1( 240 packets.Ref()) 241 return 242 } 243 244 type USBIsochronousInTransferResult struct { 245 ref js.Ref 246 } 247 248 func (this USBIsochronousInTransferResult) Once() USBIsochronousInTransferResult { 249 this.ref.Once() 250 return this 251 } 252 253 func (this USBIsochronousInTransferResult) Ref() js.Ref { 254 return this.ref 255 } 256 257 func (this USBIsochronousInTransferResult) FromRef(ref js.Ref) USBIsochronousInTransferResult { 258 this.ref = ref 259 return this 260 } 261 262 func (this USBIsochronousInTransferResult) Free() { 263 this.ref.Free() 264 } 265 266 // Data returns the value of property "USBIsochronousInTransferResult.data". 267 // 268 // It returns ok=false if there is no such property. 269 func (this USBIsochronousInTransferResult) Data() (ret js.DataView, ok bool) { 270 ok = js.True == bindings.GetUSBIsochronousInTransferResultData( 271 this.ref, js.Pointer(&ret), 272 ) 273 return 274 } 275 276 // Packets returns the value of property "USBIsochronousInTransferResult.packets". 277 // 278 // It returns ok=false if there is no such property. 279 func (this USBIsochronousInTransferResult) Packets() (ret js.FrozenArray[USBIsochronousInTransferPacket], ok bool) { 280 ok = js.True == bindings.GetUSBIsochronousInTransferResultPackets( 281 this.ref, js.Pointer(&ret), 282 ) 283 return 284 } 285 286 func NewUSBIsochronousOutTransferPacket(status USBTransferStatus, bytesWritten uint32) (ret USBIsochronousOutTransferPacket) { 287 ret.ref = bindings.NewUSBIsochronousOutTransferPacketByUSBIsochronousOutTransferPacket( 288 uint32(status), 289 uint32(bytesWritten)) 290 return 291 } 292 293 func NewUSBIsochronousOutTransferPacketByUSBIsochronousOutTransferPacket1(status USBTransferStatus) (ret USBIsochronousOutTransferPacket) { 294 ret.ref = bindings.NewUSBIsochronousOutTransferPacketByUSBIsochronousOutTransferPacket1( 295 uint32(status)) 296 return 297 } 298 299 type USBIsochronousOutTransferPacket struct { 300 ref js.Ref 301 } 302 303 func (this USBIsochronousOutTransferPacket) Once() USBIsochronousOutTransferPacket { 304 this.ref.Once() 305 return this 306 } 307 308 func (this USBIsochronousOutTransferPacket) Ref() js.Ref { 309 return this.ref 310 } 311 312 func (this USBIsochronousOutTransferPacket) FromRef(ref js.Ref) USBIsochronousOutTransferPacket { 313 this.ref = ref 314 return this 315 } 316 317 func (this USBIsochronousOutTransferPacket) Free() { 318 this.ref.Free() 319 } 320 321 // BytesWritten returns the value of property "USBIsochronousOutTransferPacket.bytesWritten". 322 // 323 // It returns ok=false if there is no such property. 324 func (this USBIsochronousOutTransferPacket) BytesWritten() (ret uint32, ok bool) { 325 ok = js.True == bindings.GetUSBIsochronousOutTransferPacketBytesWritten( 326 this.ref, js.Pointer(&ret), 327 ) 328 return 329 } 330 331 // Status returns the value of property "USBIsochronousOutTransferPacket.status". 332 // 333 // It returns ok=false if there is no such property. 334 func (this USBIsochronousOutTransferPacket) Status() (ret USBTransferStatus, ok bool) { 335 ok = js.True == bindings.GetUSBIsochronousOutTransferPacketStatus( 336 this.ref, js.Pointer(&ret), 337 ) 338 return 339 } 340 341 func NewUSBIsochronousOutTransferResult(packets js.Array[USBIsochronousOutTransferPacket]) (ret USBIsochronousOutTransferResult) { 342 ret.ref = bindings.NewUSBIsochronousOutTransferResultByUSBIsochronousOutTransferResult( 343 packets.Ref()) 344 return 345 } 346 347 type USBIsochronousOutTransferResult struct { 348 ref js.Ref 349 } 350 351 func (this USBIsochronousOutTransferResult) Once() USBIsochronousOutTransferResult { 352 this.ref.Once() 353 return this 354 } 355 356 func (this USBIsochronousOutTransferResult) Ref() js.Ref { 357 return this.ref 358 } 359 360 func (this USBIsochronousOutTransferResult) FromRef(ref js.Ref) USBIsochronousOutTransferResult { 361 this.ref = ref 362 return this 363 } 364 365 func (this USBIsochronousOutTransferResult) Free() { 366 this.ref.Free() 367 } 368 369 // Packets returns the value of property "USBIsochronousOutTransferResult.packets". 370 // 371 // It returns ok=false if there is no such property. 372 func (this USBIsochronousOutTransferResult) Packets() (ret js.FrozenArray[USBIsochronousOutTransferPacket], ok bool) { 373 ok = js.True == bindings.GetUSBIsochronousOutTransferResultPackets( 374 this.ref, js.Pointer(&ret), 375 ) 376 return 377 } 378 379 type USBEndpointType uint32 380 381 const ( 382 _ USBEndpointType = iota 383 384 USBEndpointType_BULK 385 USBEndpointType_INTERRUPT 386 USBEndpointType_ISOCHRONOUS 387 ) 388 389 func (USBEndpointType) FromRef(str js.Ref) USBEndpointType { 390 return USBEndpointType(bindings.ConstOfUSBEndpointType(str)) 391 } 392 393 func (x USBEndpointType) String() (string, bool) { 394 switch x { 395 case USBEndpointType_BULK: 396 return "bulk", true 397 case USBEndpointType_INTERRUPT: 398 return "interrupt", true 399 case USBEndpointType_ISOCHRONOUS: 400 return "isochronous", true 401 default: 402 return "", false 403 } 404 } 405 406 func NewUSBEndpoint(alternate USBAlternateInterface, endpointNumber uint8, direction USBDirection) (ret USBEndpoint) { 407 ret.ref = bindings.NewUSBEndpointByUSBEndpoint( 408 alternate.Ref(), 409 uint32(endpointNumber), 410 uint32(direction)) 411 return 412 } 413 414 type USBEndpoint struct { 415 ref js.Ref 416 } 417 418 func (this USBEndpoint) Once() USBEndpoint { 419 this.ref.Once() 420 return this 421 } 422 423 func (this USBEndpoint) Ref() js.Ref { 424 return this.ref 425 } 426 427 func (this USBEndpoint) FromRef(ref js.Ref) USBEndpoint { 428 this.ref = ref 429 return this 430 } 431 432 func (this USBEndpoint) Free() { 433 this.ref.Free() 434 } 435 436 // EndpointNumber returns the value of property "USBEndpoint.endpointNumber". 437 // 438 // It returns ok=false if there is no such property. 439 func (this USBEndpoint) EndpointNumber() (ret uint8, ok bool) { 440 ok = js.True == bindings.GetUSBEndpointEndpointNumber( 441 this.ref, js.Pointer(&ret), 442 ) 443 return 444 } 445 446 // Direction returns the value of property "USBEndpoint.direction". 447 // 448 // It returns ok=false if there is no such property. 449 func (this USBEndpoint) Direction() (ret USBDirection, ok bool) { 450 ok = js.True == bindings.GetUSBEndpointDirection( 451 this.ref, js.Pointer(&ret), 452 ) 453 return 454 } 455 456 // Type returns the value of property "USBEndpoint.type". 457 // 458 // It returns ok=false if there is no such property. 459 func (this USBEndpoint) Type() (ret USBEndpointType, ok bool) { 460 ok = js.True == bindings.GetUSBEndpointType( 461 this.ref, js.Pointer(&ret), 462 ) 463 return 464 } 465 466 // PacketSize returns the value of property "USBEndpoint.packetSize". 467 // 468 // It returns ok=false if there is no such property. 469 func (this USBEndpoint) PacketSize() (ret uint32, ok bool) { 470 ok = js.True == bindings.GetUSBEndpointPacketSize( 471 this.ref, js.Pointer(&ret), 472 ) 473 return 474 } 475 476 func NewUSBAlternateInterface(deviceInterface USBInterface, alternateSetting uint8) (ret USBAlternateInterface) { 477 ret.ref = bindings.NewUSBAlternateInterfaceByUSBAlternateInterface( 478 deviceInterface.Ref(), 479 uint32(alternateSetting)) 480 return 481 } 482 483 type USBAlternateInterface struct { 484 ref js.Ref 485 } 486 487 func (this USBAlternateInterface) Once() USBAlternateInterface { 488 this.ref.Once() 489 return this 490 } 491 492 func (this USBAlternateInterface) Ref() js.Ref { 493 return this.ref 494 } 495 496 func (this USBAlternateInterface) FromRef(ref js.Ref) USBAlternateInterface { 497 this.ref = ref 498 return this 499 } 500 501 func (this USBAlternateInterface) Free() { 502 this.ref.Free() 503 } 504 505 // AlternateSetting returns the value of property "USBAlternateInterface.alternateSetting". 506 // 507 // It returns ok=false if there is no such property. 508 func (this USBAlternateInterface) AlternateSetting() (ret uint8, ok bool) { 509 ok = js.True == bindings.GetUSBAlternateInterfaceAlternateSetting( 510 this.ref, js.Pointer(&ret), 511 ) 512 return 513 } 514 515 // InterfaceClass returns the value of property "USBAlternateInterface.interfaceClass". 516 // 517 // It returns ok=false if there is no such property. 518 func (this USBAlternateInterface) InterfaceClass() (ret uint8, ok bool) { 519 ok = js.True == bindings.GetUSBAlternateInterfaceInterfaceClass( 520 this.ref, js.Pointer(&ret), 521 ) 522 return 523 } 524 525 // InterfaceSubclass returns the value of property "USBAlternateInterface.interfaceSubclass". 526 // 527 // It returns ok=false if there is no such property. 528 func (this USBAlternateInterface) InterfaceSubclass() (ret uint8, ok bool) { 529 ok = js.True == bindings.GetUSBAlternateInterfaceInterfaceSubclass( 530 this.ref, js.Pointer(&ret), 531 ) 532 return 533 } 534 535 // InterfaceProtocol returns the value of property "USBAlternateInterface.interfaceProtocol". 536 // 537 // It returns ok=false if there is no such property. 538 func (this USBAlternateInterface) InterfaceProtocol() (ret uint8, ok bool) { 539 ok = js.True == bindings.GetUSBAlternateInterfaceInterfaceProtocol( 540 this.ref, js.Pointer(&ret), 541 ) 542 return 543 } 544 545 // InterfaceName returns the value of property "USBAlternateInterface.interfaceName". 546 // 547 // It returns ok=false if there is no such property. 548 func (this USBAlternateInterface) InterfaceName() (ret js.String, ok bool) { 549 ok = js.True == bindings.GetUSBAlternateInterfaceInterfaceName( 550 this.ref, js.Pointer(&ret), 551 ) 552 return 553 } 554 555 // Endpoints returns the value of property "USBAlternateInterface.endpoints". 556 // 557 // It returns ok=false if there is no such property. 558 func (this USBAlternateInterface) Endpoints() (ret js.FrozenArray[USBEndpoint], ok bool) { 559 ok = js.True == bindings.GetUSBAlternateInterfaceEndpoints( 560 this.ref, js.Pointer(&ret), 561 ) 562 return 563 } 564 565 func NewUSBInterface(configuration USBConfiguration, interfaceNumber uint8) (ret USBInterface) { 566 ret.ref = bindings.NewUSBInterfaceByUSBInterface( 567 configuration.Ref(), 568 uint32(interfaceNumber)) 569 return 570 } 571 572 type USBInterface struct { 573 ref js.Ref 574 } 575 576 func (this USBInterface) Once() USBInterface { 577 this.ref.Once() 578 return this 579 } 580 581 func (this USBInterface) Ref() js.Ref { 582 return this.ref 583 } 584 585 func (this USBInterface) FromRef(ref js.Ref) USBInterface { 586 this.ref = ref 587 return this 588 } 589 590 func (this USBInterface) Free() { 591 this.ref.Free() 592 } 593 594 // InterfaceNumber returns the value of property "USBInterface.interfaceNumber". 595 // 596 // It returns ok=false if there is no such property. 597 func (this USBInterface) InterfaceNumber() (ret uint8, ok bool) { 598 ok = js.True == bindings.GetUSBInterfaceInterfaceNumber( 599 this.ref, js.Pointer(&ret), 600 ) 601 return 602 } 603 604 // Alternate returns the value of property "USBInterface.alternate". 605 // 606 // It returns ok=false if there is no such property. 607 func (this USBInterface) Alternate() (ret USBAlternateInterface, ok bool) { 608 ok = js.True == bindings.GetUSBInterfaceAlternate( 609 this.ref, js.Pointer(&ret), 610 ) 611 return 612 } 613 614 // Alternates returns the value of property "USBInterface.alternates". 615 // 616 // It returns ok=false if there is no such property. 617 func (this USBInterface) Alternates() (ret js.FrozenArray[USBAlternateInterface], ok bool) { 618 ok = js.True == bindings.GetUSBInterfaceAlternates( 619 this.ref, js.Pointer(&ret), 620 ) 621 return 622 } 623 624 // Claimed returns the value of property "USBInterface.claimed". 625 // 626 // It returns ok=false if there is no such property. 627 func (this USBInterface) Claimed() (ret bool, ok bool) { 628 ok = js.True == bindings.GetUSBInterfaceClaimed( 629 this.ref, js.Pointer(&ret), 630 ) 631 return 632 } 633 634 func NewUSBConfiguration(device USBDevice, configurationValue uint8) (ret USBConfiguration) { 635 ret.ref = bindings.NewUSBConfigurationByUSBConfiguration( 636 device.Ref(), 637 uint32(configurationValue)) 638 return 639 } 640 641 type USBConfiguration struct { 642 ref js.Ref 643 } 644 645 func (this USBConfiguration) Once() USBConfiguration { 646 this.ref.Once() 647 return this 648 } 649 650 func (this USBConfiguration) Ref() js.Ref { 651 return this.ref 652 } 653 654 func (this USBConfiguration) FromRef(ref js.Ref) USBConfiguration { 655 this.ref = ref 656 return this 657 } 658 659 func (this USBConfiguration) Free() { 660 this.ref.Free() 661 } 662 663 // ConfigurationValue returns the value of property "USBConfiguration.configurationValue". 664 // 665 // It returns ok=false if there is no such property. 666 func (this USBConfiguration) ConfigurationValue() (ret uint8, ok bool) { 667 ok = js.True == bindings.GetUSBConfigurationConfigurationValue( 668 this.ref, js.Pointer(&ret), 669 ) 670 return 671 } 672 673 // ConfigurationName returns the value of property "USBConfiguration.configurationName". 674 // 675 // It returns ok=false if there is no such property. 676 func (this USBConfiguration) ConfigurationName() (ret js.String, ok bool) { 677 ok = js.True == bindings.GetUSBConfigurationConfigurationName( 678 this.ref, js.Pointer(&ret), 679 ) 680 return 681 } 682 683 // Interfaces returns the value of property "USBConfiguration.interfaces". 684 // 685 // It returns ok=false if there is no such property. 686 func (this USBConfiguration) Interfaces() (ret js.FrozenArray[USBInterface], ok bool) { 687 ok = js.True == bindings.GetUSBConfigurationInterfaces( 688 this.ref, js.Pointer(&ret), 689 ) 690 return 691 } 692 693 type USBDevice struct { 694 ref js.Ref 695 } 696 697 func (this USBDevice) Once() USBDevice { 698 this.ref.Once() 699 return this 700 } 701 702 func (this USBDevice) Ref() js.Ref { 703 return this.ref 704 } 705 706 func (this USBDevice) FromRef(ref js.Ref) USBDevice { 707 this.ref = ref 708 return this 709 } 710 711 func (this USBDevice) Free() { 712 this.ref.Free() 713 } 714 715 // UsbVersionMajor returns the value of property "USBDevice.usbVersionMajor". 716 // 717 // It returns ok=false if there is no such property. 718 func (this USBDevice) UsbVersionMajor() (ret uint8, ok bool) { 719 ok = js.True == bindings.GetUSBDeviceUsbVersionMajor( 720 this.ref, js.Pointer(&ret), 721 ) 722 return 723 } 724 725 // UsbVersionMinor returns the value of property "USBDevice.usbVersionMinor". 726 // 727 // It returns ok=false if there is no such property. 728 func (this USBDevice) UsbVersionMinor() (ret uint8, ok bool) { 729 ok = js.True == bindings.GetUSBDeviceUsbVersionMinor( 730 this.ref, js.Pointer(&ret), 731 ) 732 return 733 } 734 735 // UsbVersionSubminor returns the value of property "USBDevice.usbVersionSubminor". 736 // 737 // It returns ok=false if there is no such property. 738 func (this USBDevice) UsbVersionSubminor() (ret uint8, ok bool) { 739 ok = js.True == bindings.GetUSBDeviceUsbVersionSubminor( 740 this.ref, js.Pointer(&ret), 741 ) 742 return 743 } 744 745 // DeviceClass returns the value of property "USBDevice.deviceClass". 746 // 747 // It returns ok=false if there is no such property. 748 func (this USBDevice) DeviceClass() (ret uint8, ok bool) { 749 ok = js.True == bindings.GetUSBDeviceDeviceClass( 750 this.ref, js.Pointer(&ret), 751 ) 752 return 753 } 754 755 // DeviceSubclass returns the value of property "USBDevice.deviceSubclass". 756 // 757 // It returns ok=false if there is no such property. 758 func (this USBDevice) DeviceSubclass() (ret uint8, ok bool) { 759 ok = js.True == bindings.GetUSBDeviceDeviceSubclass( 760 this.ref, js.Pointer(&ret), 761 ) 762 return 763 } 764 765 // DeviceProtocol returns the value of property "USBDevice.deviceProtocol". 766 // 767 // It returns ok=false if there is no such property. 768 func (this USBDevice) DeviceProtocol() (ret uint8, ok bool) { 769 ok = js.True == bindings.GetUSBDeviceDeviceProtocol( 770 this.ref, js.Pointer(&ret), 771 ) 772 return 773 } 774 775 // VendorId returns the value of property "USBDevice.vendorId". 776 // 777 // It returns ok=false if there is no such property. 778 func (this USBDevice) VendorId() (ret uint16, ok bool) { 779 ok = js.True == bindings.GetUSBDeviceVendorId( 780 this.ref, js.Pointer(&ret), 781 ) 782 return 783 } 784 785 // ProductId returns the value of property "USBDevice.productId". 786 // 787 // It returns ok=false if there is no such property. 788 func (this USBDevice) ProductId() (ret uint16, ok bool) { 789 ok = js.True == bindings.GetUSBDeviceProductId( 790 this.ref, js.Pointer(&ret), 791 ) 792 return 793 } 794 795 // DeviceVersionMajor returns the value of property "USBDevice.deviceVersionMajor". 796 // 797 // It returns ok=false if there is no such property. 798 func (this USBDevice) DeviceVersionMajor() (ret uint8, ok bool) { 799 ok = js.True == bindings.GetUSBDeviceDeviceVersionMajor( 800 this.ref, js.Pointer(&ret), 801 ) 802 return 803 } 804 805 // DeviceVersionMinor returns the value of property "USBDevice.deviceVersionMinor". 806 // 807 // It returns ok=false if there is no such property. 808 func (this USBDevice) DeviceVersionMinor() (ret uint8, ok bool) { 809 ok = js.True == bindings.GetUSBDeviceDeviceVersionMinor( 810 this.ref, js.Pointer(&ret), 811 ) 812 return 813 } 814 815 // DeviceVersionSubminor returns the value of property "USBDevice.deviceVersionSubminor". 816 // 817 // It returns ok=false if there is no such property. 818 func (this USBDevice) DeviceVersionSubminor() (ret uint8, ok bool) { 819 ok = js.True == bindings.GetUSBDeviceDeviceVersionSubminor( 820 this.ref, js.Pointer(&ret), 821 ) 822 return 823 } 824 825 // ManufacturerName returns the value of property "USBDevice.manufacturerName". 826 // 827 // It returns ok=false if there is no such property. 828 func (this USBDevice) ManufacturerName() (ret js.String, ok bool) { 829 ok = js.True == bindings.GetUSBDeviceManufacturerName( 830 this.ref, js.Pointer(&ret), 831 ) 832 return 833 } 834 835 // ProductName returns the value of property "USBDevice.productName". 836 // 837 // It returns ok=false if there is no such property. 838 func (this USBDevice) ProductName() (ret js.String, ok bool) { 839 ok = js.True == bindings.GetUSBDeviceProductName( 840 this.ref, js.Pointer(&ret), 841 ) 842 return 843 } 844 845 // SerialNumber returns the value of property "USBDevice.serialNumber". 846 // 847 // It returns ok=false if there is no such property. 848 func (this USBDevice) SerialNumber() (ret js.String, ok bool) { 849 ok = js.True == bindings.GetUSBDeviceSerialNumber( 850 this.ref, js.Pointer(&ret), 851 ) 852 return 853 } 854 855 // Configuration returns the value of property "USBDevice.configuration". 856 // 857 // It returns ok=false if there is no such property. 858 func (this USBDevice) Configuration() (ret USBConfiguration, ok bool) { 859 ok = js.True == bindings.GetUSBDeviceConfiguration( 860 this.ref, js.Pointer(&ret), 861 ) 862 return 863 } 864 865 // Configurations returns the value of property "USBDevice.configurations". 866 // 867 // It returns ok=false if there is no such property. 868 func (this USBDevice) Configurations() (ret js.FrozenArray[USBConfiguration], ok bool) { 869 ok = js.True == bindings.GetUSBDeviceConfigurations( 870 this.ref, js.Pointer(&ret), 871 ) 872 return 873 } 874 875 // Opened returns the value of property "USBDevice.opened". 876 // 877 // It returns ok=false if there is no such property. 878 func (this USBDevice) Opened() (ret bool, ok bool) { 879 ok = js.True == bindings.GetUSBDeviceOpened( 880 this.ref, js.Pointer(&ret), 881 ) 882 return 883 } 884 885 // HasFuncOpen returns true if the method "USBDevice.open" exists. 886 func (this USBDevice) HasFuncOpen() bool { 887 return js.True == bindings.HasFuncUSBDeviceOpen( 888 this.ref, 889 ) 890 } 891 892 // FuncOpen returns the method "USBDevice.open". 893 func (this USBDevice) FuncOpen() (fn js.Func[func() js.Promise[js.Void]]) { 894 bindings.FuncUSBDeviceOpen( 895 this.ref, js.Pointer(&fn), 896 ) 897 return 898 } 899 900 // Open calls the method "USBDevice.open". 901 func (this USBDevice) Open() (ret js.Promise[js.Void]) { 902 bindings.CallUSBDeviceOpen( 903 this.ref, js.Pointer(&ret), 904 ) 905 906 return 907 } 908 909 // TryOpen calls the method "USBDevice.open" 910 // in a try/catch block and returns (_, err, ok = false) when it went through 911 // the catch clause. 912 func (this USBDevice) TryOpen() (ret js.Promise[js.Void], exception js.Any, ok bool) { 913 ok = js.True == bindings.TryUSBDeviceOpen( 914 this.ref, js.Pointer(&ret), js.Pointer(&exception), 915 ) 916 917 return 918 } 919 920 // HasFuncClose returns true if the method "USBDevice.close" exists. 921 func (this USBDevice) HasFuncClose() bool { 922 return js.True == bindings.HasFuncUSBDeviceClose( 923 this.ref, 924 ) 925 } 926 927 // FuncClose returns the method "USBDevice.close". 928 func (this USBDevice) FuncClose() (fn js.Func[func() js.Promise[js.Void]]) { 929 bindings.FuncUSBDeviceClose( 930 this.ref, js.Pointer(&fn), 931 ) 932 return 933 } 934 935 // Close calls the method "USBDevice.close". 936 func (this USBDevice) Close() (ret js.Promise[js.Void]) { 937 bindings.CallUSBDeviceClose( 938 this.ref, js.Pointer(&ret), 939 ) 940 941 return 942 } 943 944 // TryClose calls the method "USBDevice.close" 945 // in a try/catch block and returns (_, err, ok = false) when it went through 946 // the catch clause. 947 func (this USBDevice) TryClose() (ret js.Promise[js.Void], exception js.Any, ok bool) { 948 ok = js.True == bindings.TryUSBDeviceClose( 949 this.ref, js.Pointer(&ret), js.Pointer(&exception), 950 ) 951 952 return 953 } 954 955 // HasFuncForget returns true if the method "USBDevice.forget" exists. 956 func (this USBDevice) HasFuncForget() bool { 957 return js.True == bindings.HasFuncUSBDeviceForget( 958 this.ref, 959 ) 960 } 961 962 // FuncForget returns the method "USBDevice.forget". 963 func (this USBDevice) FuncForget() (fn js.Func[func() js.Promise[js.Void]]) { 964 bindings.FuncUSBDeviceForget( 965 this.ref, js.Pointer(&fn), 966 ) 967 return 968 } 969 970 // Forget calls the method "USBDevice.forget". 971 func (this USBDevice) Forget() (ret js.Promise[js.Void]) { 972 bindings.CallUSBDeviceForget( 973 this.ref, js.Pointer(&ret), 974 ) 975 976 return 977 } 978 979 // TryForget calls the method "USBDevice.forget" 980 // in a try/catch block and returns (_, err, ok = false) when it went through 981 // the catch clause. 982 func (this USBDevice) TryForget() (ret js.Promise[js.Void], exception js.Any, ok bool) { 983 ok = js.True == bindings.TryUSBDeviceForget( 984 this.ref, js.Pointer(&ret), js.Pointer(&exception), 985 ) 986 987 return 988 } 989 990 // HasFuncSelectConfiguration returns true if the method "USBDevice.selectConfiguration" exists. 991 func (this USBDevice) HasFuncSelectConfiguration() bool { 992 return js.True == bindings.HasFuncUSBDeviceSelectConfiguration( 993 this.ref, 994 ) 995 } 996 997 // FuncSelectConfiguration returns the method "USBDevice.selectConfiguration". 998 func (this USBDevice) FuncSelectConfiguration() (fn js.Func[func(configurationValue uint8) js.Promise[js.Void]]) { 999 bindings.FuncUSBDeviceSelectConfiguration( 1000 this.ref, js.Pointer(&fn), 1001 ) 1002 return 1003 } 1004 1005 // SelectConfiguration calls the method "USBDevice.selectConfiguration". 1006 func (this USBDevice) SelectConfiguration(configurationValue uint8) (ret js.Promise[js.Void]) { 1007 bindings.CallUSBDeviceSelectConfiguration( 1008 this.ref, js.Pointer(&ret), 1009 uint32(configurationValue), 1010 ) 1011 1012 return 1013 } 1014 1015 // TrySelectConfiguration calls the method "USBDevice.selectConfiguration" 1016 // in a try/catch block and returns (_, err, ok = false) when it went through 1017 // the catch clause. 1018 func (this USBDevice) TrySelectConfiguration(configurationValue uint8) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1019 ok = js.True == bindings.TryUSBDeviceSelectConfiguration( 1020 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1021 uint32(configurationValue), 1022 ) 1023 1024 return 1025 } 1026 1027 // HasFuncClaimInterface returns true if the method "USBDevice.claimInterface" exists. 1028 func (this USBDevice) HasFuncClaimInterface() bool { 1029 return js.True == bindings.HasFuncUSBDeviceClaimInterface( 1030 this.ref, 1031 ) 1032 } 1033 1034 // FuncClaimInterface returns the method "USBDevice.claimInterface". 1035 func (this USBDevice) FuncClaimInterface() (fn js.Func[func(interfaceNumber uint8) js.Promise[js.Void]]) { 1036 bindings.FuncUSBDeviceClaimInterface( 1037 this.ref, js.Pointer(&fn), 1038 ) 1039 return 1040 } 1041 1042 // ClaimInterface calls the method "USBDevice.claimInterface". 1043 func (this USBDevice) ClaimInterface(interfaceNumber uint8) (ret js.Promise[js.Void]) { 1044 bindings.CallUSBDeviceClaimInterface( 1045 this.ref, js.Pointer(&ret), 1046 uint32(interfaceNumber), 1047 ) 1048 1049 return 1050 } 1051 1052 // TryClaimInterface calls the method "USBDevice.claimInterface" 1053 // in a try/catch block and returns (_, err, ok = false) when it went through 1054 // the catch clause. 1055 func (this USBDevice) TryClaimInterface(interfaceNumber uint8) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1056 ok = js.True == bindings.TryUSBDeviceClaimInterface( 1057 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1058 uint32(interfaceNumber), 1059 ) 1060 1061 return 1062 } 1063 1064 // HasFuncReleaseInterface returns true if the method "USBDevice.releaseInterface" exists. 1065 func (this USBDevice) HasFuncReleaseInterface() bool { 1066 return js.True == bindings.HasFuncUSBDeviceReleaseInterface( 1067 this.ref, 1068 ) 1069 } 1070 1071 // FuncReleaseInterface returns the method "USBDevice.releaseInterface". 1072 func (this USBDevice) FuncReleaseInterface() (fn js.Func[func(interfaceNumber uint8) js.Promise[js.Void]]) { 1073 bindings.FuncUSBDeviceReleaseInterface( 1074 this.ref, js.Pointer(&fn), 1075 ) 1076 return 1077 } 1078 1079 // ReleaseInterface calls the method "USBDevice.releaseInterface". 1080 func (this USBDevice) ReleaseInterface(interfaceNumber uint8) (ret js.Promise[js.Void]) { 1081 bindings.CallUSBDeviceReleaseInterface( 1082 this.ref, js.Pointer(&ret), 1083 uint32(interfaceNumber), 1084 ) 1085 1086 return 1087 } 1088 1089 // TryReleaseInterface calls the method "USBDevice.releaseInterface" 1090 // in a try/catch block and returns (_, err, ok = false) when it went through 1091 // the catch clause. 1092 func (this USBDevice) TryReleaseInterface(interfaceNumber uint8) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1093 ok = js.True == bindings.TryUSBDeviceReleaseInterface( 1094 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1095 uint32(interfaceNumber), 1096 ) 1097 1098 return 1099 } 1100 1101 // HasFuncSelectAlternateInterface returns true if the method "USBDevice.selectAlternateInterface" exists. 1102 func (this USBDevice) HasFuncSelectAlternateInterface() bool { 1103 return js.True == bindings.HasFuncUSBDeviceSelectAlternateInterface( 1104 this.ref, 1105 ) 1106 } 1107 1108 // FuncSelectAlternateInterface returns the method "USBDevice.selectAlternateInterface". 1109 func (this USBDevice) FuncSelectAlternateInterface() (fn js.Func[func(interfaceNumber uint8, alternateSetting uint8) js.Promise[js.Void]]) { 1110 bindings.FuncUSBDeviceSelectAlternateInterface( 1111 this.ref, js.Pointer(&fn), 1112 ) 1113 return 1114 } 1115 1116 // SelectAlternateInterface calls the method "USBDevice.selectAlternateInterface". 1117 func (this USBDevice) SelectAlternateInterface(interfaceNumber uint8, alternateSetting uint8) (ret js.Promise[js.Void]) { 1118 bindings.CallUSBDeviceSelectAlternateInterface( 1119 this.ref, js.Pointer(&ret), 1120 uint32(interfaceNumber), 1121 uint32(alternateSetting), 1122 ) 1123 1124 return 1125 } 1126 1127 // TrySelectAlternateInterface calls the method "USBDevice.selectAlternateInterface" 1128 // in a try/catch block and returns (_, err, ok = false) when it went through 1129 // the catch clause. 1130 func (this USBDevice) TrySelectAlternateInterface(interfaceNumber uint8, alternateSetting uint8) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1131 ok = js.True == bindings.TryUSBDeviceSelectAlternateInterface( 1132 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1133 uint32(interfaceNumber), 1134 uint32(alternateSetting), 1135 ) 1136 1137 return 1138 } 1139 1140 // HasFuncControlTransferIn returns true if the method "USBDevice.controlTransferIn" exists. 1141 func (this USBDevice) HasFuncControlTransferIn() bool { 1142 return js.True == bindings.HasFuncUSBDeviceControlTransferIn( 1143 this.ref, 1144 ) 1145 } 1146 1147 // FuncControlTransferIn returns the method "USBDevice.controlTransferIn". 1148 func (this USBDevice) FuncControlTransferIn() (fn js.Func[func(setup USBControlTransferParameters, length uint16) js.Promise[USBInTransferResult]]) { 1149 bindings.FuncUSBDeviceControlTransferIn( 1150 this.ref, js.Pointer(&fn), 1151 ) 1152 return 1153 } 1154 1155 // ControlTransferIn calls the method "USBDevice.controlTransferIn". 1156 func (this USBDevice) ControlTransferIn(setup USBControlTransferParameters, length uint16) (ret js.Promise[USBInTransferResult]) { 1157 bindings.CallUSBDeviceControlTransferIn( 1158 this.ref, js.Pointer(&ret), 1159 js.Pointer(&setup), 1160 uint32(length), 1161 ) 1162 1163 return 1164 } 1165 1166 // TryControlTransferIn calls the method "USBDevice.controlTransferIn" 1167 // in a try/catch block and returns (_, err, ok = false) when it went through 1168 // the catch clause. 1169 func (this USBDevice) TryControlTransferIn(setup USBControlTransferParameters, length uint16) (ret js.Promise[USBInTransferResult], exception js.Any, ok bool) { 1170 ok = js.True == bindings.TryUSBDeviceControlTransferIn( 1171 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1172 js.Pointer(&setup), 1173 uint32(length), 1174 ) 1175 1176 return 1177 } 1178 1179 // HasFuncControlTransferOut returns true if the method "USBDevice.controlTransferOut" exists. 1180 func (this USBDevice) HasFuncControlTransferOut() bool { 1181 return js.True == bindings.HasFuncUSBDeviceControlTransferOut( 1182 this.ref, 1183 ) 1184 } 1185 1186 // FuncControlTransferOut returns the method "USBDevice.controlTransferOut". 1187 func (this USBDevice) FuncControlTransferOut() (fn js.Func[func(setup USBControlTransferParameters, data BufferSource) js.Promise[USBOutTransferResult]]) { 1188 bindings.FuncUSBDeviceControlTransferOut( 1189 this.ref, js.Pointer(&fn), 1190 ) 1191 return 1192 } 1193 1194 // ControlTransferOut calls the method "USBDevice.controlTransferOut". 1195 func (this USBDevice) ControlTransferOut(setup USBControlTransferParameters, data BufferSource) (ret js.Promise[USBOutTransferResult]) { 1196 bindings.CallUSBDeviceControlTransferOut( 1197 this.ref, js.Pointer(&ret), 1198 js.Pointer(&setup), 1199 data.Ref(), 1200 ) 1201 1202 return 1203 } 1204 1205 // TryControlTransferOut calls the method "USBDevice.controlTransferOut" 1206 // in a try/catch block and returns (_, err, ok = false) when it went through 1207 // the catch clause. 1208 func (this USBDevice) TryControlTransferOut(setup USBControlTransferParameters, data BufferSource) (ret js.Promise[USBOutTransferResult], exception js.Any, ok bool) { 1209 ok = js.True == bindings.TryUSBDeviceControlTransferOut( 1210 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1211 js.Pointer(&setup), 1212 data.Ref(), 1213 ) 1214 1215 return 1216 } 1217 1218 // HasFuncControlTransferOut1 returns true if the method "USBDevice.controlTransferOut" exists. 1219 func (this USBDevice) HasFuncControlTransferOut1() bool { 1220 return js.True == bindings.HasFuncUSBDeviceControlTransferOut1( 1221 this.ref, 1222 ) 1223 } 1224 1225 // FuncControlTransferOut1 returns the method "USBDevice.controlTransferOut". 1226 func (this USBDevice) FuncControlTransferOut1() (fn js.Func[func(setup USBControlTransferParameters) js.Promise[USBOutTransferResult]]) { 1227 bindings.FuncUSBDeviceControlTransferOut1( 1228 this.ref, js.Pointer(&fn), 1229 ) 1230 return 1231 } 1232 1233 // ControlTransferOut1 calls the method "USBDevice.controlTransferOut". 1234 func (this USBDevice) ControlTransferOut1(setup USBControlTransferParameters) (ret js.Promise[USBOutTransferResult]) { 1235 bindings.CallUSBDeviceControlTransferOut1( 1236 this.ref, js.Pointer(&ret), 1237 js.Pointer(&setup), 1238 ) 1239 1240 return 1241 } 1242 1243 // TryControlTransferOut1 calls the method "USBDevice.controlTransferOut" 1244 // in a try/catch block and returns (_, err, ok = false) when it went through 1245 // the catch clause. 1246 func (this USBDevice) TryControlTransferOut1(setup USBControlTransferParameters) (ret js.Promise[USBOutTransferResult], exception js.Any, ok bool) { 1247 ok = js.True == bindings.TryUSBDeviceControlTransferOut1( 1248 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1249 js.Pointer(&setup), 1250 ) 1251 1252 return 1253 } 1254 1255 // HasFuncClearHalt returns true if the method "USBDevice.clearHalt" exists. 1256 func (this USBDevice) HasFuncClearHalt() bool { 1257 return js.True == bindings.HasFuncUSBDeviceClearHalt( 1258 this.ref, 1259 ) 1260 } 1261 1262 // FuncClearHalt returns the method "USBDevice.clearHalt". 1263 func (this USBDevice) FuncClearHalt() (fn js.Func[func(direction USBDirection, endpointNumber uint8) js.Promise[js.Void]]) { 1264 bindings.FuncUSBDeviceClearHalt( 1265 this.ref, js.Pointer(&fn), 1266 ) 1267 return 1268 } 1269 1270 // ClearHalt calls the method "USBDevice.clearHalt". 1271 func (this USBDevice) ClearHalt(direction USBDirection, endpointNumber uint8) (ret js.Promise[js.Void]) { 1272 bindings.CallUSBDeviceClearHalt( 1273 this.ref, js.Pointer(&ret), 1274 uint32(direction), 1275 uint32(endpointNumber), 1276 ) 1277 1278 return 1279 } 1280 1281 // TryClearHalt calls the method "USBDevice.clearHalt" 1282 // in a try/catch block and returns (_, err, ok = false) when it went through 1283 // the catch clause. 1284 func (this USBDevice) TryClearHalt(direction USBDirection, endpointNumber uint8) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1285 ok = js.True == bindings.TryUSBDeviceClearHalt( 1286 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1287 uint32(direction), 1288 uint32(endpointNumber), 1289 ) 1290 1291 return 1292 } 1293 1294 // HasFuncTransferIn returns true if the method "USBDevice.transferIn" exists. 1295 func (this USBDevice) HasFuncTransferIn() bool { 1296 return js.True == bindings.HasFuncUSBDeviceTransferIn( 1297 this.ref, 1298 ) 1299 } 1300 1301 // FuncTransferIn returns the method "USBDevice.transferIn". 1302 func (this USBDevice) FuncTransferIn() (fn js.Func[func(endpointNumber uint8, length uint32) js.Promise[USBInTransferResult]]) { 1303 bindings.FuncUSBDeviceTransferIn( 1304 this.ref, js.Pointer(&fn), 1305 ) 1306 return 1307 } 1308 1309 // TransferIn calls the method "USBDevice.transferIn". 1310 func (this USBDevice) TransferIn(endpointNumber uint8, length uint32) (ret js.Promise[USBInTransferResult]) { 1311 bindings.CallUSBDeviceTransferIn( 1312 this.ref, js.Pointer(&ret), 1313 uint32(endpointNumber), 1314 uint32(length), 1315 ) 1316 1317 return 1318 } 1319 1320 // TryTransferIn calls the method "USBDevice.transferIn" 1321 // in a try/catch block and returns (_, err, ok = false) when it went through 1322 // the catch clause. 1323 func (this USBDevice) TryTransferIn(endpointNumber uint8, length uint32) (ret js.Promise[USBInTransferResult], exception js.Any, ok bool) { 1324 ok = js.True == bindings.TryUSBDeviceTransferIn( 1325 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1326 uint32(endpointNumber), 1327 uint32(length), 1328 ) 1329 1330 return 1331 } 1332 1333 // HasFuncTransferOut returns true if the method "USBDevice.transferOut" exists. 1334 func (this USBDevice) HasFuncTransferOut() bool { 1335 return js.True == bindings.HasFuncUSBDeviceTransferOut( 1336 this.ref, 1337 ) 1338 } 1339 1340 // FuncTransferOut returns the method "USBDevice.transferOut". 1341 func (this USBDevice) FuncTransferOut() (fn js.Func[func(endpointNumber uint8, data BufferSource) js.Promise[USBOutTransferResult]]) { 1342 bindings.FuncUSBDeviceTransferOut( 1343 this.ref, js.Pointer(&fn), 1344 ) 1345 return 1346 } 1347 1348 // TransferOut calls the method "USBDevice.transferOut". 1349 func (this USBDevice) TransferOut(endpointNumber uint8, data BufferSource) (ret js.Promise[USBOutTransferResult]) { 1350 bindings.CallUSBDeviceTransferOut( 1351 this.ref, js.Pointer(&ret), 1352 uint32(endpointNumber), 1353 data.Ref(), 1354 ) 1355 1356 return 1357 } 1358 1359 // TryTransferOut calls the method "USBDevice.transferOut" 1360 // in a try/catch block and returns (_, err, ok = false) when it went through 1361 // the catch clause. 1362 func (this USBDevice) TryTransferOut(endpointNumber uint8, data BufferSource) (ret js.Promise[USBOutTransferResult], exception js.Any, ok bool) { 1363 ok = js.True == bindings.TryUSBDeviceTransferOut( 1364 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1365 uint32(endpointNumber), 1366 data.Ref(), 1367 ) 1368 1369 return 1370 } 1371 1372 // HasFuncIsochronousTransferIn returns true if the method "USBDevice.isochronousTransferIn" exists. 1373 func (this USBDevice) HasFuncIsochronousTransferIn() bool { 1374 return js.True == bindings.HasFuncUSBDeviceIsochronousTransferIn( 1375 this.ref, 1376 ) 1377 } 1378 1379 // FuncIsochronousTransferIn returns the method "USBDevice.isochronousTransferIn". 1380 func (this USBDevice) FuncIsochronousTransferIn() (fn js.Func[func(endpointNumber uint8, packetLengths js.Array[uint32]) js.Promise[USBIsochronousInTransferResult]]) { 1381 bindings.FuncUSBDeviceIsochronousTransferIn( 1382 this.ref, js.Pointer(&fn), 1383 ) 1384 return 1385 } 1386 1387 // IsochronousTransferIn calls the method "USBDevice.isochronousTransferIn". 1388 func (this USBDevice) IsochronousTransferIn(endpointNumber uint8, packetLengths js.Array[uint32]) (ret js.Promise[USBIsochronousInTransferResult]) { 1389 bindings.CallUSBDeviceIsochronousTransferIn( 1390 this.ref, js.Pointer(&ret), 1391 uint32(endpointNumber), 1392 packetLengths.Ref(), 1393 ) 1394 1395 return 1396 } 1397 1398 // TryIsochronousTransferIn calls the method "USBDevice.isochronousTransferIn" 1399 // in a try/catch block and returns (_, err, ok = false) when it went through 1400 // the catch clause. 1401 func (this USBDevice) TryIsochronousTransferIn(endpointNumber uint8, packetLengths js.Array[uint32]) (ret js.Promise[USBIsochronousInTransferResult], exception js.Any, ok bool) { 1402 ok = js.True == bindings.TryUSBDeviceIsochronousTransferIn( 1403 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1404 uint32(endpointNumber), 1405 packetLengths.Ref(), 1406 ) 1407 1408 return 1409 } 1410 1411 // HasFuncIsochronousTransferOut returns true if the method "USBDevice.isochronousTransferOut" exists. 1412 func (this USBDevice) HasFuncIsochronousTransferOut() bool { 1413 return js.True == bindings.HasFuncUSBDeviceIsochronousTransferOut( 1414 this.ref, 1415 ) 1416 } 1417 1418 // FuncIsochronousTransferOut returns the method "USBDevice.isochronousTransferOut". 1419 func (this USBDevice) FuncIsochronousTransferOut() (fn js.Func[func(endpointNumber uint8, data BufferSource, packetLengths js.Array[uint32]) js.Promise[USBIsochronousOutTransferResult]]) { 1420 bindings.FuncUSBDeviceIsochronousTransferOut( 1421 this.ref, js.Pointer(&fn), 1422 ) 1423 return 1424 } 1425 1426 // IsochronousTransferOut calls the method "USBDevice.isochronousTransferOut". 1427 func (this USBDevice) IsochronousTransferOut(endpointNumber uint8, data BufferSource, packetLengths js.Array[uint32]) (ret js.Promise[USBIsochronousOutTransferResult]) { 1428 bindings.CallUSBDeviceIsochronousTransferOut( 1429 this.ref, js.Pointer(&ret), 1430 uint32(endpointNumber), 1431 data.Ref(), 1432 packetLengths.Ref(), 1433 ) 1434 1435 return 1436 } 1437 1438 // TryIsochronousTransferOut calls the method "USBDevice.isochronousTransferOut" 1439 // in a try/catch block and returns (_, err, ok = false) when it went through 1440 // the catch clause. 1441 func (this USBDevice) TryIsochronousTransferOut(endpointNumber uint8, data BufferSource, packetLengths js.Array[uint32]) (ret js.Promise[USBIsochronousOutTransferResult], exception js.Any, ok bool) { 1442 ok = js.True == bindings.TryUSBDeviceIsochronousTransferOut( 1443 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1444 uint32(endpointNumber), 1445 data.Ref(), 1446 packetLengths.Ref(), 1447 ) 1448 1449 return 1450 } 1451 1452 // HasFuncReset returns true if the method "USBDevice.reset" exists. 1453 func (this USBDevice) HasFuncReset() bool { 1454 return js.True == bindings.HasFuncUSBDeviceReset( 1455 this.ref, 1456 ) 1457 } 1458 1459 // FuncReset returns the method "USBDevice.reset". 1460 func (this USBDevice) FuncReset() (fn js.Func[func() js.Promise[js.Void]]) { 1461 bindings.FuncUSBDeviceReset( 1462 this.ref, js.Pointer(&fn), 1463 ) 1464 return 1465 } 1466 1467 // Reset calls the method "USBDevice.reset". 1468 func (this USBDevice) Reset() (ret js.Promise[js.Void]) { 1469 bindings.CallUSBDeviceReset( 1470 this.ref, js.Pointer(&ret), 1471 ) 1472 1473 return 1474 } 1475 1476 // TryReset calls the method "USBDevice.reset" 1477 // in a try/catch block and returns (_, err, ok = false) when it went through 1478 // the catch clause. 1479 func (this USBDevice) TryReset() (ret js.Promise[js.Void], exception js.Any, ok bool) { 1480 ok = js.True == bindings.TryUSBDeviceReset( 1481 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1482 ) 1483 1484 return 1485 } 1486 1487 type USBDeviceFilter struct { 1488 // VendorId is "USBDeviceFilter.vendorId" 1489 // 1490 // Optional 1491 // 1492 // NOTE: FFI_USE_VendorId MUST be set to true to make this field effective. 1493 VendorId uint16 1494 // ProductId is "USBDeviceFilter.productId" 1495 // 1496 // Optional 1497 // 1498 // NOTE: FFI_USE_ProductId MUST be set to true to make this field effective. 1499 ProductId uint16 1500 // ClassCode is "USBDeviceFilter.classCode" 1501 // 1502 // Optional 1503 // 1504 // NOTE: FFI_USE_ClassCode MUST be set to true to make this field effective. 1505 ClassCode uint8 1506 // SubclassCode is "USBDeviceFilter.subclassCode" 1507 // 1508 // Optional 1509 // 1510 // NOTE: FFI_USE_SubclassCode MUST be set to true to make this field effective. 1511 SubclassCode uint8 1512 // ProtocolCode is "USBDeviceFilter.protocolCode" 1513 // 1514 // Optional 1515 // 1516 // NOTE: FFI_USE_ProtocolCode MUST be set to true to make this field effective. 1517 ProtocolCode uint8 1518 // SerialNumber is "USBDeviceFilter.serialNumber" 1519 // 1520 // Optional 1521 SerialNumber js.String 1522 1523 FFI_USE_VendorId bool // for VendorId. 1524 FFI_USE_ProductId bool // for ProductId. 1525 FFI_USE_ClassCode bool // for ClassCode. 1526 FFI_USE_SubclassCode bool // for SubclassCode. 1527 FFI_USE_ProtocolCode bool // for ProtocolCode. 1528 1529 FFI_USE bool 1530 } 1531 1532 // FromRef calls UpdateFrom and returns a USBDeviceFilter with all fields set. 1533 func (p USBDeviceFilter) FromRef(ref js.Ref) USBDeviceFilter { 1534 p.UpdateFrom(ref) 1535 return p 1536 } 1537 1538 // New creates a new USBDeviceFilter in the application heap. 1539 func (p USBDeviceFilter) New() js.Ref { 1540 return bindings.USBDeviceFilterJSLoad( 1541 js.Pointer(&p), js.True, 0, 1542 ) 1543 } 1544 1545 // UpdateFrom copies value of all fields of the heap object to p. 1546 func (p *USBDeviceFilter) UpdateFrom(ref js.Ref) { 1547 bindings.USBDeviceFilterJSStore( 1548 js.Pointer(p), ref, 1549 ) 1550 } 1551 1552 // Update writes all fields of the p to the heap object referenced by ref. 1553 func (p *USBDeviceFilter) Update(ref js.Ref) { 1554 bindings.USBDeviceFilterJSLoad( 1555 js.Pointer(p), js.False, ref, 1556 ) 1557 } 1558 1559 // FreeMembers frees fields with heap reference, if recursive is true 1560 // free all heap references reachable from p. 1561 func (p *USBDeviceFilter) FreeMembers(recursive bool) { 1562 js.Free( 1563 p.SerialNumber.Ref(), 1564 ) 1565 p.SerialNumber = p.SerialNumber.FromRef(js.Undefined) 1566 } 1567 1568 type USBDeviceRequestOptions struct { 1569 // Filters is "USBDeviceRequestOptions.filters" 1570 // 1571 // Required 1572 Filters js.Array[USBDeviceFilter] 1573 // ExclusionFilters is "USBDeviceRequestOptions.exclusionFilters" 1574 // 1575 // Optional, defaults to []. 1576 ExclusionFilters js.Array[USBDeviceFilter] 1577 1578 FFI_USE bool 1579 } 1580 1581 // FromRef calls UpdateFrom and returns a USBDeviceRequestOptions with all fields set. 1582 func (p USBDeviceRequestOptions) FromRef(ref js.Ref) USBDeviceRequestOptions { 1583 p.UpdateFrom(ref) 1584 return p 1585 } 1586 1587 // New creates a new USBDeviceRequestOptions in the application heap. 1588 func (p USBDeviceRequestOptions) New() js.Ref { 1589 return bindings.USBDeviceRequestOptionsJSLoad( 1590 js.Pointer(&p), js.True, 0, 1591 ) 1592 } 1593 1594 // UpdateFrom copies value of all fields of the heap object to p. 1595 func (p *USBDeviceRequestOptions) UpdateFrom(ref js.Ref) { 1596 bindings.USBDeviceRequestOptionsJSStore( 1597 js.Pointer(p), ref, 1598 ) 1599 } 1600 1601 // Update writes all fields of the p to the heap object referenced by ref. 1602 func (p *USBDeviceRequestOptions) Update(ref js.Ref) { 1603 bindings.USBDeviceRequestOptionsJSLoad( 1604 js.Pointer(p), js.False, ref, 1605 ) 1606 } 1607 1608 // FreeMembers frees fields with heap reference, if recursive is true 1609 // free all heap references reachable from p. 1610 func (p *USBDeviceRequestOptions) FreeMembers(recursive bool) { 1611 js.Free( 1612 p.Filters.Ref(), 1613 p.ExclusionFilters.Ref(), 1614 ) 1615 p.Filters = p.Filters.FromRef(js.Undefined) 1616 p.ExclusionFilters = p.ExclusionFilters.FromRef(js.Undefined) 1617 } 1618 1619 type USB struct { 1620 EventTarget 1621 } 1622 1623 func (this USB) Once() USB { 1624 this.ref.Once() 1625 return this 1626 } 1627 1628 func (this USB) Ref() js.Ref { 1629 return this.EventTarget.Ref() 1630 } 1631 1632 func (this USB) FromRef(ref js.Ref) USB { 1633 this.EventTarget = this.EventTarget.FromRef(ref) 1634 return this 1635 } 1636 1637 func (this USB) Free() { 1638 this.ref.Free() 1639 } 1640 1641 // HasFuncGetDevices returns true if the method "USB.getDevices" exists. 1642 func (this USB) HasFuncGetDevices() bool { 1643 return js.True == bindings.HasFuncUSBGetDevices( 1644 this.ref, 1645 ) 1646 } 1647 1648 // FuncGetDevices returns the method "USB.getDevices". 1649 func (this USB) FuncGetDevices() (fn js.Func[func() js.Promise[js.Array[USBDevice]]]) { 1650 bindings.FuncUSBGetDevices( 1651 this.ref, js.Pointer(&fn), 1652 ) 1653 return 1654 } 1655 1656 // GetDevices calls the method "USB.getDevices". 1657 func (this USB) GetDevices() (ret js.Promise[js.Array[USBDevice]]) { 1658 bindings.CallUSBGetDevices( 1659 this.ref, js.Pointer(&ret), 1660 ) 1661 1662 return 1663 } 1664 1665 // TryGetDevices calls the method "USB.getDevices" 1666 // in a try/catch block and returns (_, err, ok = false) when it went through 1667 // the catch clause. 1668 func (this USB) TryGetDevices() (ret js.Promise[js.Array[USBDevice]], exception js.Any, ok bool) { 1669 ok = js.True == bindings.TryUSBGetDevices( 1670 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1671 ) 1672 1673 return 1674 } 1675 1676 // HasFuncRequestDevice returns true if the method "USB.requestDevice" exists. 1677 func (this USB) HasFuncRequestDevice() bool { 1678 return js.True == bindings.HasFuncUSBRequestDevice( 1679 this.ref, 1680 ) 1681 } 1682 1683 // FuncRequestDevice returns the method "USB.requestDevice". 1684 func (this USB) FuncRequestDevice() (fn js.Func[func(options USBDeviceRequestOptions) js.Promise[USBDevice]]) { 1685 bindings.FuncUSBRequestDevice( 1686 this.ref, js.Pointer(&fn), 1687 ) 1688 return 1689 } 1690 1691 // RequestDevice calls the method "USB.requestDevice". 1692 func (this USB) RequestDevice(options USBDeviceRequestOptions) (ret js.Promise[USBDevice]) { 1693 bindings.CallUSBRequestDevice( 1694 this.ref, js.Pointer(&ret), 1695 js.Pointer(&options), 1696 ) 1697 1698 return 1699 } 1700 1701 // TryRequestDevice calls the method "USB.requestDevice" 1702 // in a try/catch block and returns (_, err, ok = false) when it went through 1703 // the catch clause. 1704 func (this USB) TryRequestDevice(options USBDeviceRequestOptions) (ret js.Promise[USBDevice], exception js.Any, ok bool) { 1705 ok = js.True == bindings.TryUSBRequestDevice( 1706 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1707 js.Pointer(&options), 1708 ) 1709 1710 return 1711 } 1712 1713 type EpubReadingSystem struct { 1714 ref js.Ref 1715 } 1716 1717 func (this EpubReadingSystem) Once() EpubReadingSystem { 1718 this.ref.Once() 1719 return this 1720 } 1721 1722 func (this EpubReadingSystem) Ref() js.Ref { 1723 return this.ref 1724 } 1725 1726 func (this EpubReadingSystem) FromRef(ref js.Ref) EpubReadingSystem { 1727 this.ref = ref 1728 return this 1729 } 1730 1731 func (this EpubReadingSystem) Free() { 1732 this.ref.Free() 1733 } 1734 1735 // HasFuncHasFeature returns true if the method "EpubReadingSystem.hasFeature" exists. 1736 func (this EpubReadingSystem) HasFuncHasFeature() bool { 1737 return js.True == bindings.HasFuncEpubReadingSystemHasFeature( 1738 this.ref, 1739 ) 1740 } 1741 1742 // FuncHasFeature returns the method "EpubReadingSystem.hasFeature". 1743 func (this EpubReadingSystem) FuncHasFeature() (fn js.Func[func(feature js.String, version js.String) bool]) { 1744 bindings.FuncEpubReadingSystemHasFeature( 1745 this.ref, js.Pointer(&fn), 1746 ) 1747 return 1748 } 1749 1750 // HasFeature calls the method "EpubReadingSystem.hasFeature". 1751 func (this EpubReadingSystem) HasFeature(feature js.String, version js.String) (ret bool) { 1752 bindings.CallEpubReadingSystemHasFeature( 1753 this.ref, js.Pointer(&ret), 1754 feature.Ref(), 1755 version.Ref(), 1756 ) 1757 1758 return 1759 } 1760 1761 // TryHasFeature calls the method "EpubReadingSystem.hasFeature" 1762 // in a try/catch block and returns (_, err, ok = false) when it went through 1763 // the catch clause. 1764 func (this EpubReadingSystem) TryHasFeature(feature js.String, version js.String) (ret bool, exception js.Any, ok bool) { 1765 ok = js.True == bindings.TryEpubReadingSystemHasFeature( 1766 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1767 feature.Ref(), 1768 version.Ref(), 1769 ) 1770 1771 return 1772 } 1773 1774 // HasFuncHasFeature1 returns true if the method "EpubReadingSystem.hasFeature" exists. 1775 func (this EpubReadingSystem) HasFuncHasFeature1() bool { 1776 return js.True == bindings.HasFuncEpubReadingSystemHasFeature1( 1777 this.ref, 1778 ) 1779 } 1780 1781 // FuncHasFeature1 returns the method "EpubReadingSystem.hasFeature". 1782 func (this EpubReadingSystem) FuncHasFeature1() (fn js.Func[func(feature js.String) bool]) { 1783 bindings.FuncEpubReadingSystemHasFeature1( 1784 this.ref, js.Pointer(&fn), 1785 ) 1786 return 1787 } 1788 1789 // HasFeature1 calls the method "EpubReadingSystem.hasFeature". 1790 func (this EpubReadingSystem) HasFeature1(feature js.String) (ret bool) { 1791 bindings.CallEpubReadingSystemHasFeature1( 1792 this.ref, js.Pointer(&ret), 1793 feature.Ref(), 1794 ) 1795 1796 return 1797 } 1798 1799 // TryHasFeature1 calls the method "EpubReadingSystem.hasFeature" 1800 // in a try/catch block and returns (_, err, ok = false) when it went through 1801 // the catch clause. 1802 func (this EpubReadingSystem) TryHasFeature1(feature js.String) (ret bool, exception js.Any, ok bool) { 1803 ok = js.True == bindings.TryEpubReadingSystemHasFeature1( 1804 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1805 feature.Ref(), 1806 ) 1807 1808 return 1809 } 1810 1811 type XRSessionMode uint32 1812 1813 const ( 1814 _ XRSessionMode = iota 1815 1816 XRSessionMode_INLINE 1817 XRSessionMode_IMMERSIVE_VR 1818 XRSessionMode_IMMERSIVE_AR 1819 ) 1820 1821 func (XRSessionMode) FromRef(str js.Ref) XRSessionMode { 1822 return XRSessionMode(bindings.ConstOfXRSessionMode(str)) 1823 } 1824 1825 func (x XRSessionMode) String() (string, bool) { 1826 switch x { 1827 case XRSessionMode_INLINE: 1828 return "inline", true 1829 case XRSessionMode_IMMERSIVE_VR: 1830 return "immersive-vr", true 1831 case XRSessionMode_IMMERSIVE_AR: 1832 return "immersive-ar", true 1833 default: 1834 return "", false 1835 } 1836 } 1837 1838 type OneOf_WebGLRenderingContext_WebGL2RenderingContext struct { 1839 ref js.Ref 1840 } 1841 1842 func (x OneOf_WebGLRenderingContext_WebGL2RenderingContext) Ref() js.Ref { 1843 return x.ref 1844 } 1845 1846 func (x OneOf_WebGLRenderingContext_WebGL2RenderingContext) Free() { 1847 x.ref.Free() 1848 } 1849 1850 func (x OneOf_WebGLRenderingContext_WebGL2RenderingContext) FromRef(ref js.Ref) OneOf_WebGLRenderingContext_WebGL2RenderingContext { 1851 return OneOf_WebGLRenderingContext_WebGL2RenderingContext{ 1852 ref: ref, 1853 } 1854 } 1855 1856 func (x OneOf_WebGLRenderingContext_WebGL2RenderingContext) WebGLRenderingContext() WebGLRenderingContext { 1857 return WebGLRenderingContext{}.FromRef(x.ref) 1858 } 1859 1860 func (x OneOf_WebGLRenderingContext_WebGL2RenderingContext) WebGL2RenderingContext() WebGL2RenderingContext { 1861 return WebGL2RenderingContext{}.FromRef(x.ref) 1862 } 1863 1864 type XRWebGLRenderingContext = OneOf_WebGLRenderingContext_WebGL2RenderingContext 1865 1866 type XRWebGLLayerInit struct { 1867 // Antialias is "XRWebGLLayerInit.antialias" 1868 // 1869 // Optional, defaults to true. 1870 // 1871 // NOTE: FFI_USE_Antialias MUST be set to true to make this field effective. 1872 Antialias bool 1873 // Depth is "XRWebGLLayerInit.depth" 1874 // 1875 // Optional, defaults to true. 1876 // 1877 // NOTE: FFI_USE_Depth MUST be set to true to make this field effective. 1878 Depth bool 1879 // Stencil is "XRWebGLLayerInit.stencil" 1880 // 1881 // Optional, defaults to false. 1882 // 1883 // NOTE: FFI_USE_Stencil MUST be set to true to make this field effective. 1884 Stencil bool 1885 // Alpha is "XRWebGLLayerInit.alpha" 1886 // 1887 // Optional, defaults to true. 1888 // 1889 // NOTE: FFI_USE_Alpha MUST be set to true to make this field effective. 1890 Alpha bool 1891 // IgnoreDepthValues is "XRWebGLLayerInit.ignoreDepthValues" 1892 // 1893 // Optional, defaults to false. 1894 // 1895 // NOTE: FFI_USE_IgnoreDepthValues MUST be set to true to make this field effective. 1896 IgnoreDepthValues bool 1897 // FramebufferScaleFactor is "XRWebGLLayerInit.framebufferScaleFactor" 1898 // 1899 // Optional, defaults to 1.0. 1900 // 1901 // NOTE: FFI_USE_FramebufferScaleFactor MUST be set to true to make this field effective. 1902 FramebufferScaleFactor float64 1903 1904 FFI_USE_Antialias bool // for Antialias. 1905 FFI_USE_Depth bool // for Depth. 1906 FFI_USE_Stencil bool // for Stencil. 1907 FFI_USE_Alpha bool // for Alpha. 1908 FFI_USE_IgnoreDepthValues bool // for IgnoreDepthValues. 1909 FFI_USE_FramebufferScaleFactor bool // for FramebufferScaleFactor. 1910 1911 FFI_USE bool 1912 } 1913 1914 // FromRef calls UpdateFrom and returns a XRWebGLLayerInit with all fields set. 1915 func (p XRWebGLLayerInit) FromRef(ref js.Ref) XRWebGLLayerInit { 1916 p.UpdateFrom(ref) 1917 return p 1918 } 1919 1920 // New creates a new XRWebGLLayerInit in the application heap. 1921 func (p XRWebGLLayerInit) New() js.Ref { 1922 return bindings.XRWebGLLayerInitJSLoad( 1923 js.Pointer(&p), js.True, 0, 1924 ) 1925 } 1926 1927 // UpdateFrom copies value of all fields of the heap object to p. 1928 func (p *XRWebGLLayerInit) UpdateFrom(ref js.Ref) { 1929 bindings.XRWebGLLayerInitJSStore( 1930 js.Pointer(p), ref, 1931 ) 1932 } 1933 1934 // Update writes all fields of the p to the heap object referenced by ref. 1935 func (p *XRWebGLLayerInit) Update(ref js.Ref) { 1936 bindings.XRWebGLLayerInitJSLoad( 1937 js.Pointer(p), js.False, ref, 1938 ) 1939 } 1940 1941 // FreeMembers frees fields with heap reference, if recursive is true 1942 // free all heap references reachable from p. 1943 func (p *XRWebGLLayerInit) FreeMembers(recursive bool) { 1944 } 1945 1946 type XRViewport struct { 1947 ref js.Ref 1948 } 1949 1950 func (this XRViewport) Once() XRViewport { 1951 this.ref.Once() 1952 return this 1953 } 1954 1955 func (this XRViewport) Ref() js.Ref { 1956 return this.ref 1957 } 1958 1959 func (this XRViewport) FromRef(ref js.Ref) XRViewport { 1960 this.ref = ref 1961 return this 1962 } 1963 1964 func (this XRViewport) Free() { 1965 this.ref.Free() 1966 } 1967 1968 // X returns the value of property "XRViewport.x". 1969 // 1970 // It returns ok=false if there is no such property. 1971 func (this XRViewport) X() (ret int32, ok bool) { 1972 ok = js.True == bindings.GetXRViewportX( 1973 this.ref, js.Pointer(&ret), 1974 ) 1975 return 1976 } 1977 1978 // Y returns the value of property "XRViewport.y". 1979 // 1980 // It returns ok=false if there is no such property. 1981 func (this XRViewport) Y() (ret int32, ok bool) { 1982 ok = js.True == bindings.GetXRViewportY( 1983 this.ref, js.Pointer(&ret), 1984 ) 1985 return 1986 } 1987 1988 // Width returns the value of property "XRViewport.width". 1989 // 1990 // It returns ok=false if there is no such property. 1991 func (this XRViewport) Width() (ret int32, ok bool) { 1992 ok = js.True == bindings.GetXRViewportWidth( 1993 this.ref, js.Pointer(&ret), 1994 ) 1995 return 1996 } 1997 1998 // Height returns the value of property "XRViewport.height". 1999 // 2000 // It returns ok=false if there is no such property. 2001 func (this XRViewport) Height() (ret int32, ok bool) { 2002 ok = js.True == bindings.GetXRViewportHeight( 2003 this.ref, js.Pointer(&ret), 2004 ) 2005 return 2006 } 2007 2008 type XREye uint32 2009 2010 const ( 2011 _ XREye = iota 2012 2013 XREye_NONE 2014 XREye_LEFT 2015 XREye_RIGHT 2016 ) 2017 2018 func (XREye) FromRef(str js.Ref) XREye { 2019 return XREye(bindings.ConstOfXREye(str)) 2020 } 2021 2022 func (x XREye) String() (string, bool) { 2023 switch x { 2024 case XREye_NONE: 2025 return "none", true 2026 case XREye_LEFT: 2027 return "left", true 2028 case XREye_RIGHT: 2029 return "right", true 2030 default: 2031 return "", false 2032 } 2033 } 2034 2035 func NewXRRigidTransform(position DOMPointInit, orientation DOMPointInit) (ret XRRigidTransform) { 2036 ret.ref = bindings.NewXRRigidTransformByXRRigidTransform( 2037 js.Pointer(&position), 2038 js.Pointer(&orientation)) 2039 return 2040 } 2041 2042 func NewXRRigidTransformByXRRigidTransform1(position DOMPointInit) (ret XRRigidTransform) { 2043 ret.ref = bindings.NewXRRigidTransformByXRRigidTransform1( 2044 js.Pointer(&position)) 2045 return 2046 } 2047 2048 func NewXRRigidTransformByXRRigidTransform2() (ret XRRigidTransform) { 2049 ret.ref = bindings.NewXRRigidTransformByXRRigidTransform2() 2050 return 2051 } 2052 2053 type XRRigidTransform struct { 2054 ref js.Ref 2055 } 2056 2057 func (this XRRigidTransform) Once() XRRigidTransform { 2058 this.ref.Once() 2059 return this 2060 } 2061 2062 func (this XRRigidTransform) Ref() js.Ref { 2063 return this.ref 2064 } 2065 2066 func (this XRRigidTransform) FromRef(ref js.Ref) XRRigidTransform { 2067 this.ref = ref 2068 return this 2069 } 2070 2071 func (this XRRigidTransform) Free() { 2072 this.ref.Free() 2073 } 2074 2075 // Position returns the value of property "XRRigidTransform.position". 2076 // 2077 // It returns ok=false if there is no such property. 2078 func (this XRRigidTransform) Position() (ret DOMPointReadOnly, ok bool) { 2079 ok = js.True == bindings.GetXRRigidTransformPosition( 2080 this.ref, js.Pointer(&ret), 2081 ) 2082 return 2083 } 2084 2085 // Orientation returns the value of property "XRRigidTransform.orientation". 2086 // 2087 // It returns ok=false if there is no such property. 2088 func (this XRRigidTransform) Orientation() (ret DOMPointReadOnly, ok bool) { 2089 ok = js.True == bindings.GetXRRigidTransformOrientation( 2090 this.ref, js.Pointer(&ret), 2091 ) 2092 return 2093 } 2094 2095 // Matrix returns the value of property "XRRigidTransform.matrix". 2096 // 2097 // It returns ok=false if there is no such property. 2098 func (this XRRigidTransform) Matrix() (ret js.TypedArray[float32], ok bool) { 2099 ok = js.True == bindings.GetXRRigidTransformMatrix( 2100 this.ref, js.Pointer(&ret), 2101 ) 2102 return 2103 } 2104 2105 // Inverse returns the value of property "XRRigidTransform.inverse". 2106 // 2107 // It returns ok=false if there is no such property. 2108 func (this XRRigidTransform) Inverse() (ret XRRigidTransform, ok bool) { 2109 ok = js.True == bindings.GetXRRigidTransformInverse( 2110 this.ref, js.Pointer(&ret), 2111 ) 2112 return 2113 } 2114 2115 type XRCamera struct { 2116 ref js.Ref 2117 } 2118 2119 func (this XRCamera) Once() XRCamera { 2120 this.ref.Once() 2121 return this 2122 } 2123 2124 func (this XRCamera) Ref() js.Ref { 2125 return this.ref 2126 } 2127 2128 func (this XRCamera) FromRef(ref js.Ref) XRCamera { 2129 this.ref = ref 2130 return this 2131 } 2132 2133 func (this XRCamera) Free() { 2134 this.ref.Free() 2135 } 2136 2137 // Width returns the value of property "XRCamera.width". 2138 // 2139 // It returns ok=false if there is no such property. 2140 func (this XRCamera) Width() (ret uint32, ok bool) { 2141 ok = js.True == bindings.GetXRCameraWidth( 2142 this.ref, js.Pointer(&ret), 2143 ) 2144 return 2145 } 2146 2147 // Height returns the value of property "XRCamera.height". 2148 // 2149 // It returns ok=false if there is no such property. 2150 func (this XRCamera) Height() (ret uint32, ok bool) { 2151 ok = js.True == bindings.GetXRCameraHeight( 2152 this.ref, js.Pointer(&ret), 2153 ) 2154 return 2155 } 2156 2157 type XRView struct { 2158 ref js.Ref 2159 } 2160 2161 func (this XRView) Once() XRView { 2162 this.ref.Once() 2163 return this 2164 } 2165 2166 func (this XRView) Ref() js.Ref { 2167 return this.ref 2168 } 2169 2170 func (this XRView) FromRef(ref js.Ref) XRView { 2171 this.ref = ref 2172 return this 2173 } 2174 2175 func (this XRView) Free() { 2176 this.ref.Free() 2177 } 2178 2179 // Eye returns the value of property "XRView.eye". 2180 // 2181 // It returns ok=false if there is no such property. 2182 func (this XRView) Eye() (ret XREye, ok bool) { 2183 ok = js.True == bindings.GetXRViewEye( 2184 this.ref, js.Pointer(&ret), 2185 ) 2186 return 2187 } 2188 2189 // ProjectionMatrix returns the value of property "XRView.projectionMatrix". 2190 // 2191 // It returns ok=false if there is no such property. 2192 func (this XRView) ProjectionMatrix() (ret js.TypedArray[float32], ok bool) { 2193 ok = js.True == bindings.GetXRViewProjectionMatrix( 2194 this.ref, js.Pointer(&ret), 2195 ) 2196 return 2197 } 2198 2199 // Transform returns the value of property "XRView.transform". 2200 // 2201 // It returns ok=false if there is no such property. 2202 func (this XRView) Transform() (ret XRRigidTransform, ok bool) { 2203 ok = js.True == bindings.GetXRViewTransform( 2204 this.ref, js.Pointer(&ret), 2205 ) 2206 return 2207 } 2208 2209 // RecommendedViewportScale returns the value of property "XRView.recommendedViewportScale". 2210 // 2211 // It returns ok=false if there is no such property. 2212 func (this XRView) RecommendedViewportScale() (ret float64, ok bool) { 2213 ok = js.True == bindings.GetXRViewRecommendedViewportScale( 2214 this.ref, js.Pointer(&ret), 2215 ) 2216 return 2217 } 2218 2219 // IsFirstPersonObserver returns the value of property "XRView.isFirstPersonObserver". 2220 // 2221 // It returns ok=false if there is no such property. 2222 func (this XRView) IsFirstPersonObserver() (ret bool, ok bool) { 2223 ok = js.True == bindings.GetXRViewIsFirstPersonObserver( 2224 this.ref, js.Pointer(&ret), 2225 ) 2226 return 2227 } 2228 2229 // Camera returns the value of property "XRView.camera". 2230 // 2231 // It returns ok=false if there is no such property. 2232 func (this XRView) Camera() (ret XRCamera, ok bool) { 2233 ok = js.True == bindings.GetXRViewCamera( 2234 this.ref, js.Pointer(&ret), 2235 ) 2236 return 2237 } 2238 2239 // HasFuncRequestViewportScale returns true if the method "XRView.requestViewportScale" exists. 2240 func (this XRView) HasFuncRequestViewportScale() bool { 2241 return js.True == bindings.HasFuncXRViewRequestViewportScale( 2242 this.ref, 2243 ) 2244 } 2245 2246 // FuncRequestViewportScale returns the method "XRView.requestViewportScale". 2247 func (this XRView) FuncRequestViewportScale() (fn js.Func[func(scale float64)]) { 2248 bindings.FuncXRViewRequestViewportScale( 2249 this.ref, js.Pointer(&fn), 2250 ) 2251 return 2252 } 2253 2254 // RequestViewportScale calls the method "XRView.requestViewportScale". 2255 func (this XRView) RequestViewportScale(scale float64) (ret js.Void) { 2256 bindings.CallXRViewRequestViewportScale( 2257 this.ref, js.Pointer(&ret), 2258 float64(scale), 2259 ) 2260 2261 return 2262 } 2263 2264 // TryRequestViewportScale calls the method "XRView.requestViewportScale" 2265 // in a try/catch block and returns (_, err, ok = false) when it went through 2266 // the catch clause. 2267 func (this XRView) TryRequestViewportScale(scale float64) (ret js.Void, exception js.Any, ok bool) { 2268 ok = js.True == bindings.TryXRViewRequestViewportScale( 2269 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2270 float64(scale), 2271 ) 2272 2273 return 2274 } 2275 2276 func NewXRWebGLLayer(session XRSession, context XRWebGLRenderingContext, layerInit XRWebGLLayerInit) (ret XRWebGLLayer) { 2277 ret.ref = bindings.NewXRWebGLLayerByXRWebGLLayer( 2278 session.Ref(), 2279 context.Ref(), 2280 js.Pointer(&layerInit)) 2281 return 2282 } 2283 2284 func NewXRWebGLLayerByXRWebGLLayer1(session XRSession, context XRWebGLRenderingContext) (ret XRWebGLLayer) { 2285 ret.ref = bindings.NewXRWebGLLayerByXRWebGLLayer1( 2286 session.Ref(), 2287 context.Ref()) 2288 return 2289 } 2290 2291 type XRWebGLLayer struct { 2292 XRLayer 2293 } 2294 2295 func (this XRWebGLLayer) Once() XRWebGLLayer { 2296 this.ref.Once() 2297 return this 2298 } 2299 2300 func (this XRWebGLLayer) Ref() js.Ref { 2301 return this.XRLayer.Ref() 2302 } 2303 2304 func (this XRWebGLLayer) FromRef(ref js.Ref) XRWebGLLayer { 2305 this.XRLayer = this.XRLayer.FromRef(ref) 2306 return this 2307 } 2308 2309 func (this XRWebGLLayer) Free() { 2310 this.ref.Free() 2311 } 2312 2313 // Antialias returns the value of property "XRWebGLLayer.antialias". 2314 // 2315 // It returns ok=false if there is no such property. 2316 func (this XRWebGLLayer) Antialias() (ret bool, ok bool) { 2317 ok = js.True == bindings.GetXRWebGLLayerAntialias( 2318 this.ref, js.Pointer(&ret), 2319 ) 2320 return 2321 } 2322 2323 // IgnoreDepthValues returns the value of property "XRWebGLLayer.ignoreDepthValues". 2324 // 2325 // It returns ok=false if there is no such property. 2326 func (this XRWebGLLayer) IgnoreDepthValues() (ret bool, ok bool) { 2327 ok = js.True == bindings.GetXRWebGLLayerIgnoreDepthValues( 2328 this.ref, js.Pointer(&ret), 2329 ) 2330 return 2331 } 2332 2333 // FixedFoveation returns the value of property "XRWebGLLayer.fixedFoveation". 2334 // 2335 // It returns ok=false if there is no such property. 2336 func (this XRWebGLLayer) FixedFoveation() (ret float32, ok bool) { 2337 ok = js.True == bindings.GetXRWebGLLayerFixedFoveation( 2338 this.ref, js.Pointer(&ret), 2339 ) 2340 return 2341 } 2342 2343 // SetFixedFoveation sets the value of property "XRWebGLLayer.fixedFoveation" to val. 2344 // 2345 // It returns false if the property cannot be set. 2346 func (this XRWebGLLayer) SetFixedFoveation(val float32) bool { 2347 return js.True == bindings.SetXRWebGLLayerFixedFoveation( 2348 this.ref, 2349 float32(val), 2350 ) 2351 } 2352 2353 // Framebuffer returns the value of property "XRWebGLLayer.framebuffer". 2354 // 2355 // It returns ok=false if there is no such property. 2356 func (this XRWebGLLayer) Framebuffer() (ret WebGLFramebuffer, ok bool) { 2357 ok = js.True == bindings.GetXRWebGLLayerFramebuffer( 2358 this.ref, js.Pointer(&ret), 2359 ) 2360 return 2361 } 2362 2363 // FramebufferWidth returns the value of property "XRWebGLLayer.framebufferWidth". 2364 // 2365 // It returns ok=false if there is no such property. 2366 func (this XRWebGLLayer) FramebufferWidth() (ret uint32, ok bool) { 2367 ok = js.True == bindings.GetXRWebGLLayerFramebufferWidth( 2368 this.ref, js.Pointer(&ret), 2369 ) 2370 return 2371 } 2372 2373 // FramebufferHeight returns the value of property "XRWebGLLayer.framebufferHeight". 2374 // 2375 // It returns ok=false if there is no such property. 2376 func (this XRWebGLLayer) FramebufferHeight() (ret uint32, ok bool) { 2377 ok = js.True == bindings.GetXRWebGLLayerFramebufferHeight( 2378 this.ref, js.Pointer(&ret), 2379 ) 2380 return 2381 } 2382 2383 // HasFuncGetViewport returns true if the method "XRWebGLLayer.getViewport" exists. 2384 func (this XRWebGLLayer) HasFuncGetViewport() bool { 2385 return js.True == bindings.HasFuncXRWebGLLayerGetViewport( 2386 this.ref, 2387 ) 2388 } 2389 2390 // FuncGetViewport returns the method "XRWebGLLayer.getViewport". 2391 func (this XRWebGLLayer) FuncGetViewport() (fn js.Func[func(view XRView) XRViewport]) { 2392 bindings.FuncXRWebGLLayerGetViewport( 2393 this.ref, js.Pointer(&fn), 2394 ) 2395 return 2396 } 2397 2398 // GetViewport calls the method "XRWebGLLayer.getViewport". 2399 func (this XRWebGLLayer) GetViewport(view XRView) (ret XRViewport) { 2400 bindings.CallXRWebGLLayerGetViewport( 2401 this.ref, js.Pointer(&ret), 2402 view.Ref(), 2403 ) 2404 2405 return 2406 } 2407 2408 // TryGetViewport calls the method "XRWebGLLayer.getViewport" 2409 // in a try/catch block and returns (_, err, ok = false) when it went through 2410 // the catch clause. 2411 func (this XRWebGLLayer) TryGetViewport(view XRView) (ret XRViewport, exception js.Any, ok bool) { 2412 ok = js.True == bindings.TryXRWebGLLayerGetViewport( 2413 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2414 view.Ref(), 2415 ) 2416 2417 return 2418 } 2419 2420 // HasFuncGetNativeFramebufferScaleFactor returns true if the static method "XRWebGLLayer.getNativeFramebufferScaleFactor" exists. 2421 func (this XRWebGLLayer) HasFuncGetNativeFramebufferScaleFactor() bool { 2422 return js.True == bindings.HasFuncXRWebGLLayerGetNativeFramebufferScaleFactor( 2423 this.ref, 2424 ) 2425 } 2426 2427 // FuncGetNativeFramebufferScaleFactor returns the static method "XRWebGLLayer.getNativeFramebufferScaleFactor". 2428 func (this XRWebGLLayer) FuncGetNativeFramebufferScaleFactor() (fn js.Func[func(session XRSession) float64]) { 2429 bindings.FuncXRWebGLLayerGetNativeFramebufferScaleFactor( 2430 this.ref, js.Pointer(&fn), 2431 ) 2432 return 2433 } 2434 2435 // GetNativeFramebufferScaleFactor calls the static method "XRWebGLLayer.getNativeFramebufferScaleFactor". 2436 func (this XRWebGLLayer) GetNativeFramebufferScaleFactor(session XRSession) (ret float64) { 2437 bindings.CallXRWebGLLayerGetNativeFramebufferScaleFactor( 2438 this.ref, js.Pointer(&ret), 2439 session.Ref(), 2440 ) 2441 2442 return 2443 } 2444 2445 // TryGetNativeFramebufferScaleFactor calls the static method "XRWebGLLayer.getNativeFramebufferScaleFactor" 2446 // in a try/catch block and returns (_, err, ok = false) when it went through 2447 // the catch clause. 2448 func (this XRWebGLLayer) TryGetNativeFramebufferScaleFactor(session XRSession) (ret float64, exception js.Any, ok bool) { 2449 ok = js.True == bindings.TryXRWebGLLayerGetNativeFramebufferScaleFactor( 2450 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2451 session.Ref(), 2452 ) 2453 2454 return 2455 } 2456 2457 type XRLayer struct { 2458 EventTarget 2459 } 2460 2461 func (this XRLayer) Once() XRLayer { 2462 this.ref.Once() 2463 return this 2464 } 2465 2466 func (this XRLayer) Ref() js.Ref { 2467 return this.EventTarget.Ref() 2468 } 2469 2470 func (this XRLayer) FromRef(ref js.Ref) XRLayer { 2471 this.EventTarget = this.EventTarget.FromRef(ref) 2472 return this 2473 } 2474 2475 func (this XRLayer) Free() { 2476 this.ref.Free() 2477 } 2478 2479 type XRRenderStateInit struct { 2480 // DepthNear is "XRRenderStateInit.depthNear" 2481 // 2482 // Optional 2483 // 2484 // NOTE: FFI_USE_DepthNear MUST be set to true to make this field effective. 2485 DepthNear float64 2486 // DepthFar is "XRRenderStateInit.depthFar" 2487 // 2488 // Optional 2489 // 2490 // NOTE: FFI_USE_DepthFar MUST be set to true to make this field effective. 2491 DepthFar float64 2492 // InlineVerticalFieldOfView is "XRRenderStateInit.inlineVerticalFieldOfView" 2493 // 2494 // Optional 2495 // 2496 // NOTE: FFI_USE_InlineVerticalFieldOfView MUST be set to true to make this field effective. 2497 InlineVerticalFieldOfView float64 2498 // BaseLayer is "XRRenderStateInit.baseLayer" 2499 // 2500 // Optional 2501 BaseLayer XRWebGLLayer 2502 // Layers is "XRRenderStateInit.layers" 2503 // 2504 // Optional 2505 Layers js.Array[XRLayer] 2506 2507 FFI_USE_DepthNear bool // for DepthNear. 2508 FFI_USE_DepthFar bool // for DepthFar. 2509 FFI_USE_InlineVerticalFieldOfView bool // for InlineVerticalFieldOfView. 2510 2511 FFI_USE bool 2512 } 2513 2514 // FromRef calls UpdateFrom and returns a XRRenderStateInit with all fields set. 2515 func (p XRRenderStateInit) FromRef(ref js.Ref) XRRenderStateInit { 2516 p.UpdateFrom(ref) 2517 return p 2518 } 2519 2520 // New creates a new XRRenderStateInit in the application heap. 2521 func (p XRRenderStateInit) New() js.Ref { 2522 return bindings.XRRenderStateInitJSLoad( 2523 js.Pointer(&p), js.True, 0, 2524 ) 2525 } 2526 2527 // UpdateFrom copies value of all fields of the heap object to p. 2528 func (p *XRRenderStateInit) UpdateFrom(ref js.Ref) { 2529 bindings.XRRenderStateInitJSStore( 2530 js.Pointer(p), ref, 2531 ) 2532 } 2533 2534 // Update writes all fields of the p to the heap object referenced by ref. 2535 func (p *XRRenderStateInit) Update(ref js.Ref) { 2536 bindings.XRRenderStateInitJSLoad( 2537 js.Pointer(p), js.False, ref, 2538 ) 2539 } 2540 2541 // FreeMembers frees fields with heap reference, if recursive is true 2542 // free all heap references reachable from p. 2543 func (p *XRRenderStateInit) FreeMembers(recursive bool) { 2544 js.Free( 2545 p.BaseLayer.Ref(), 2546 p.Layers.Ref(), 2547 ) 2548 p.BaseLayer = p.BaseLayer.FromRef(js.Undefined) 2549 p.Layers = p.Layers.FromRef(js.Undefined) 2550 } 2551 2552 type XRReferenceSpace struct { 2553 XRSpace 2554 } 2555 2556 func (this XRReferenceSpace) Once() XRReferenceSpace { 2557 this.ref.Once() 2558 return this 2559 } 2560 2561 func (this XRReferenceSpace) Ref() js.Ref { 2562 return this.XRSpace.Ref() 2563 } 2564 2565 func (this XRReferenceSpace) FromRef(ref js.Ref) XRReferenceSpace { 2566 this.XRSpace = this.XRSpace.FromRef(ref) 2567 return this 2568 } 2569 2570 func (this XRReferenceSpace) Free() { 2571 this.ref.Free() 2572 } 2573 2574 // HasFuncGetOffsetReferenceSpace returns true if the method "XRReferenceSpace.getOffsetReferenceSpace" exists. 2575 func (this XRReferenceSpace) HasFuncGetOffsetReferenceSpace() bool { 2576 return js.True == bindings.HasFuncXRReferenceSpaceGetOffsetReferenceSpace( 2577 this.ref, 2578 ) 2579 } 2580 2581 // FuncGetOffsetReferenceSpace returns the method "XRReferenceSpace.getOffsetReferenceSpace". 2582 func (this XRReferenceSpace) FuncGetOffsetReferenceSpace() (fn js.Func[func(originOffset XRRigidTransform) XRReferenceSpace]) { 2583 bindings.FuncXRReferenceSpaceGetOffsetReferenceSpace( 2584 this.ref, js.Pointer(&fn), 2585 ) 2586 return 2587 } 2588 2589 // GetOffsetReferenceSpace calls the method "XRReferenceSpace.getOffsetReferenceSpace". 2590 func (this XRReferenceSpace) GetOffsetReferenceSpace(originOffset XRRigidTransform) (ret XRReferenceSpace) { 2591 bindings.CallXRReferenceSpaceGetOffsetReferenceSpace( 2592 this.ref, js.Pointer(&ret), 2593 originOffset.Ref(), 2594 ) 2595 2596 return 2597 } 2598 2599 // TryGetOffsetReferenceSpace calls the method "XRReferenceSpace.getOffsetReferenceSpace" 2600 // in a try/catch block and returns (_, err, ok = false) when it went through 2601 // the catch clause. 2602 func (this XRReferenceSpace) TryGetOffsetReferenceSpace(originOffset XRRigidTransform) (ret XRReferenceSpace, exception js.Any, ok bool) { 2603 ok = js.True == bindings.TryXRReferenceSpaceGetOffsetReferenceSpace( 2604 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2605 originOffset.Ref(), 2606 ) 2607 2608 return 2609 } 2610 2611 type XRReferenceSpaceType uint32 2612 2613 const ( 2614 _ XRReferenceSpaceType = iota 2615 2616 XRReferenceSpaceType_VIEWER 2617 XRReferenceSpaceType_LOCAL 2618 XRReferenceSpaceType_LOCAL_FLOOR 2619 XRReferenceSpaceType_BOUNDED_FLOOR 2620 XRReferenceSpaceType_UNBOUNDED 2621 ) 2622 2623 func (XRReferenceSpaceType) FromRef(str js.Ref) XRReferenceSpaceType { 2624 return XRReferenceSpaceType(bindings.ConstOfXRReferenceSpaceType(str)) 2625 } 2626 2627 func (x XRReferenceSpaceType) String() (string, bool) { 2628 switch x { 2629 case XRReferenceSpaceType_VIEWER: 2630 return "viewer", true 2631 case XRReferenceSpaceType_LOCAL: 2632 return "local", true 2633 case XRReferenceSpaceType_LOCAL_FLOOR: 2634 return "local-floor", true 2635 case XRReferenceSpaceType_BOUNDED_FLOOR: 2636 return "bounded-floor", true 2637 case XRReferenceSpaceType_UNBOUNDED: 2638 return "unbounded", true 2639 default: 2640 return "", false 2641 } 2642 } 2643 2644 type XRFrameRequestCallbackFunc func(this js.Ref, time DOMHighResTimeStamp, frame XRFrame) js.Ref 2645 2646 func (fn XRFrameRequestCallbackFunc) Register() js.Func[func(time DOMHighResTimeStamp, frame XRFrame)] { 2647 return js.RegisterCallback[func(time DOMHighResTimeStamp, frame XRFrame)]( 2648 fn, abi.FuncPCABIInternal(fn), 2649 ) 2650 } 2651 2652 func (fn XRFrameRequestCallbackFunc) DispatchCallback( 2653 targetPC uintptr, ctx *js.CallbackContext, 2654 ) { 2655 args := ctx.Args() 2656 if len(args) != 2+1 /* js this */ || 2657 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2658 js.ThrowInvalidCallbackInvocation() 2659 } 2660 2661 if ctx.Return(fn( 2662 args[0], 2663 2664 js.Number[DOMHighResTimeStamp]{}.FromRef(args[0+1]).Get(), 2665 XRFrame{}.FromRef(args[1+1]), 2666 )) { 2667 return 2668 } 2669 2670 js.ThrowCallbackValueNotReturned() 2671 } 2672 2673 type XRFrameRequestCallback[T any] struct { 2674 Fn func(arg T, this js.Ref, time DOMHighResTimeStamp, frame XRFrame) js.Ref 2675 Arg T 2676 } 2677 2678 func (cb *XRFrameRequestCallback[T]) Register() js.Func[func(time DOMHighResTimeStamp, frame XRFrame)] { 2679 return js.RegisterCallback[func(time DOMHighResTimeStamp, frame XRFrame)]( 2680 cb, abi.FuncPCABIInternal(cb.Fn), 2681 ) 2682 } 2683 2684 func (cb *XRFrameRequestCallback[T]) DispatchCallback( 2685 targetPC uintptr, ctx *js.CallbackContext, 2686 ) { 2687 args := ctx.Args() 2688 if len(args) != 2+1 /* js this */ || 2689 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2690 js.ThrowInvalidCallbackInvocation() 2691 } 2692 2693 if ctx.Return(cb.Fn( 2694 cb.Arg, 2695 args[0], 2696 2697 js.Number[DOMHighResTimeStamp]{}.FromRef(args[0+1]).Get(), 2698 XRFrame{}.FromRef(args[1+1]), 2699 )) { 2700 return 2701 } 2702 2703 js.ThrowCallbackValueNotReturned() 2704 } 2705 2706 type XRViewerPose struct { 2707 XRPose 2708 } 2709 2710 func (this XRViewerPose) Once() XRViewerPose { 2711 this.ref.Once() 2712 return this 2713 } 2714 2715 func (this XRViewerPose) Ref() js.Ref { 2716 return this.XRPose.Ref() 2717 } 2718 2719 func (this XRViewerPose) FromRef(ref js.Ref) XRViewerPose { 2720 this.XRPose = this.XRPose.FromRef(ref) 2721 return this 2722 } 2723 2724 func (this XRViewerPose) Free() { 2725 this.ref.Free() 2726 } 2727 2728 // Views returns the value of property "XRViewerPose.views". 2729 // 2730 // It returns ok=false if there is no such property. 2731 func (this XRViewerPose) Views() (ret js.FrozenArray[XRView], ok bool) { 2732 ok = js.True == bindings.GetXRViewerPoseViews( 2733 this.ref, js.Pointer(&ret), 2734 ) 2735 return 2736 } 2737 2738 type XRPose struct { 2739 ref js.Ref 2740 } 2741 2742 func (this XRPose) Once() XRPose { 2743 this.ref.Once() 2744 return this 2745 } 2746 2747 func (this XRPose) Ref() js.Ref { 2748 return this.ref 2749 } 2750 2751 func (this XRPose) FromRef(ref js.Ref) XRPose { 2752 this.ref = ref 2753 return this 2754 } 2755 2756 func (this XRPose) Free() { 2757 this.ref.Free() 2758 } 2759 2760 // Transform returns the value of property "XRPose.transform". 2761 // 2762 // It returns ok=false if there is no such property. 2763 func (this XRPose) Transform() (ret XRRigidTransform, ok bool) { 2764 ok = js.True == bindings.GetXRPoseTransform( 2765 this.ref, js.Pointer(&ret), 2766 ) 2767 return 2768 } 2769 2770 // LinearVelocity returns the value of property "XRPose.linearVelocity". 2771 // 2772 // It returns ok=false if there is no such property. 2773 func (this XRPose) LinearVelocity() (ret DOMPointReadOnly, ok bool) { 2774 ok = js.True == bindings.GetXRPoseLinearVelocity( 2775 this.ref, js.Pointer(&ret), 2776 ) 2777 return 2778 } 2779 2780 // AngularVelocity returns the value of property "XRPose.angularVelocity". 2781 // 2782 // It returns ok=false if there is no such property. 2783 func (this XRPose) AngularVelocity() (ret DOMPointReadOnly, ok bool) { 2784 ok = js.True == bindings.GetXRPoseAngularVelocity( 2785 this.ref, js.Pointer(&ret), 2786 ) 2787 return 2788 } 2789 2790 // EmulatedPosition returns the value of property "XRPose.emulatedPosition". 2791 // 2792 // It returns ok=false if there is no such property. 2793 func (this XRPose) EmulatedPosition() (ret bool, ok bool) { 2794 ok = js.True == bindings.GetXRPoseEmulatedPosition( 2795 this.ref, js.Pointer(&ret), 2796 ) 2797 return 2798 } 2799 2800 type XRSpace struct { 2801 EventTarget 2802 } 2803 2804 func (this XRSpace) Once() XRSpace { 2805 this.ref.Once() 2806 return this 2807 } 2808 2809 func (this XRSpace) Ref() js.Ref { 2810 return this.EventTarget.Ref() 2811 } 2812 2813 func (this XRSpace) FromRef(ref js.Ref) XRSpace { 2814 this.EventTarget = this.EventTarget.FromRef(ref) 2815 return this 2816 } 2817 2818 func (this XRSpace) Free() { 2819 this.ref.Free() 2820 } 2821 2822 type XRAnchor struct { 2823 ref js.Ref 2824 } 2825 2826 func (this XRAnchor) Once() XRAnchor { 2827 this.ref.Once() 2828 return this 2829 } 2830 2831 func (this XRAnchor) Ref() js.Ref { 2832 return this.ref 2833 } 2834 2835 func (this XRAnchor) FromRef(ref js.Ref) XRAnchor { 2836 this.ref = ref 2837 return this 2838 } 2839 2840 func (this XRAnchor) Free() { 2841 this.ref.Free() 2842 } 2843 2844 // AnchorSpace returns the value of property "XRAnchor.anchorSpace". 2845 // 2846 // It returns ok=false if there is no such property. 2847 func (this XRAnchor) AnchorSpace() (ret XRSpace, ok bool) { 2848 ok = js.True == bindings.GetXRAnchorAnchorSpace( 2849 this.ref, js.Pointer(&ret), 2850 ) 2851 return 2852 } 2853 2854 // HasFuncRequestPersistentHandle returns true if the method "XRAnchor.requestPersistentHandle" exists. 2855 func (this XRAnchor) HasFuncRequestPersistentHandle() bool { 2856 return js.True == bindings.HasFuncXRAnchorRequestPersistentHandle( 2857 this.ref, 2858 ) 2859 } 2860 2861 // FuncRequestPersistentHandle returns the method "XRAnchor.requestPersistentHandle". 2862 func (this XRAnchor) FuncRequestPersistentHandle() (fn js.Func[func() js.Promise[js.String]]) { 2863 bindings.FuncXRAnchorRequestPersistentHandle( 2864 this.ref, js.Pointer(&fn), 2865 ) 2866 return 2867 } 2868 2869 // RequestPersistentHandle calls the method "XRAnchor.requestPersistentHandle". 2870 func (this XRAnchor) RequestPersistentHandle() (ret js.Promise[js.String]) { 2871 bindings.CallXRAnchorRequestPersistentHandle( 2872 this.ref, js.Pointer(&ret), 2873 ) 2874 2875 return 2876 } 2877 2878 // TryRequestPersistentHandle calls the method "XRAnchor.requestPersistentHandle" 2879 // in a try/catch block and returns (_, err, ok = false) when it went through 2880 // the catch clause. 2881 func (this XRAnchor) TryRequestPersistentHandle() (ret js.Promise[js.String], exception js.Any, ok bool) { 2882 ok = js.True == bindings.TryXRAnchorRequestPersistentHandle( 2883 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2884 ) 2885 2886 return 2887 } 2888 2889 // HasFuncDelete returns true if the method "XRAnchor.delete" exists. 2890 func (this XRAnchor) HasFuncDelete() bool { 2891 return js.True == bindings.HasFuncXRAnchorDelete( 2892 this.ref, 2893 ) 2894 } 2895 2896 // FuncDelete returns the method "XRAnchor.delete". 2897 func (this XRAnchor) FuncDelete() (fn js.Func[func()]) { 2898 bindings.FuncXRAnchorDelete( 2899 this.ref, js.Pointer(&fn), 2900 ) 2901 return 2902 } 2903 2904 // Delete calls the method "XRAnchor.delete". 2905 func (this XRAnchor) Delete() (ret js.Void) { 2906 bindings.CallXRAnchorDelete( 2907 this.ref, js.Pointer(&ret), 2908 ) 2909 2910 return 2911 } 2912 2913 // TryDelete calls the method "XRAnchor.delete" 2914 // in a try/catch block and returns (_, err, ok = false) when it went through 2915 // the catch clause. 2916 func (this XRAnchor) TryDelete() (ret js.Void, exception js.Any, ok bool) { 2917 ok = js.True == bindings.TryXRAnchorDelete( 2918 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2919 ) 2920 2921 return 2922 } 2923 2924 type XRLightEstimate struct { 2925 ref js.Ref 2926 } 2927 2928 func (this XRLightEstimate) Once() XRLightEstimate { 2929 this.ref.Once() 2930 return this 2931 } 2932 2933 func (this XRLightEstimate) Ref() js.Ref { 2934 return this.ref 2935 } 2936 2937 func (this XRLightEstimate) FromRef(ref js.Ref) XRLightEstimate { 2938 this.ref = ref 2939 return this 2940 } 2941 2942 func (this XRLightEstimate) Free() { 2943 this.ref.Free() 2944 } 2945 2946 // SphericalHarmonicsCoefficients returns the value of property "XRLightEstimate.sphericalHarmonicsCoefficients". 2947 // 2948 // It returns ok=false if there is no such property. 2949 func (this XRLightEstimate) SphericalHarmonicsCoefficients() (ret js.TypedArray[float32], ok bool) { 2950 ok = js.True == bindings.GetXRLightEstimateSphericalHarmonicsCoefficients( 2951 this.ref, js.Pointer(&ret), 2952 ) 2953 return 2954 } 2955 2956 // PrimaryLightDirection returns the value of property "XRLightEstimate.primaryLightDirection". 2957 // 2958 // It returns ok=false if there is no such property. 2959 func (this XRLightEstimate) PrimaryLightDirection() (ret DOMPointReadOnly, ok bool) { 2960 ok = js.True == bindings.GetXRLightEstimatePrimaryLightDirection( 2961 this.ref, js.Pointer(&ret), 2962 ) 2963 return 2964 } 2965 2966 // PrimaryLightIntensity returns the value of property "XRLightEstimate.primaryLightIntensity". 2967 // 2968 // It returns ok=false if there is no such property. 2969 func (this XRLightEstimate) PrimaryLightIntensity() (ret DOMPointReadOnly, ok bool) { 2970 ok = js.True == bindings.GetXRLightEstimatePrimaryLightIntensity( 2971 this.ref, js.Pointer(&ret), 2972 ) 2973 return 2974 } 2975 2976 type XRLightProbe struct { 2977 EventTarget 2978 } 2979 2980 func (this XRLightProbe) Once() XRLightProbe { 2981 this.ref.Once() 2982 return this 2983 } 2984 2985 func (this XRLightProbe) Ref() js.Ref { 2986 return this.EventTarget.Ref() 2987 } 2988 2989 func (this XRLightProbe) FromRef(ref js.Ref) XRLightProbe { 2990 this.EventTarget = this.EventTarget.FromRef(ref) 2991 return this 2992 } 2993 2994 func (this XRLightProbe) Free() { 2995 this.ref.Free() 2996 } 2997 2998 // ProbeSpace returns the value of property "XRLightProbe.probeSpace". 2999 // 3000 // It returns ok=false if there is no such property. 3001 func (this XRLightProbe) ProbeSpace() (ret XRSpace, ok bool) { 3002 ok = js.True == bindings.GetXRLightProbeProbeSpace( 3003 this.ref, js.Pointer(&ret), 3004 ) 3005 return 3006 } 3007 3008 type XRCPUDepthInformation struct { 3009 XRDepthInformation 3010 } 3011 3012 func (this XRCPUDepthInformation) Once() XRCPUDepthInformation { 3013 this.ref.Once() 3014 return this 3015 } 3016 3017 func (this XRCPUDepthInformation) Ref() js.Ref { 3018 return this.XRDepthInformation.Ref() 3019 } 3020 3021 func (this XRCPUDepthInformation) FromRef(ref js.Ref) XRCPUDepthInformation { 3022 this.XRDepthInformation = this.XRDepthInformation.FromRef(ref) 3023 return this 3024 } 3025 3026 func (this XRCPUDepthInformation) Free() { 3027 this.ref.Free() 3028 } 3029 3030 // Data returns the value of property "XRCPUDepthInformation.data". 3031 // 3032 // It returns ok=false if there is no such property. 3033 func (this XRCPUDepthInformation) Data() (ret js.ArrayBuffer, ok bool) { 3034 ok = js.True == bindings.GetXRCPUDepthInformationData( 3035 this.ref, js.Pointer(&ret), 3036 ) 3037 return 3038 } 3039 3040 // HasFuncGetDepthInMeters returns true if the method "XRCPUDepthInformation.getDepthInMeters" exists. 3041 func (this XRCPUDepthInformation) HasFuncGetDepthInMeters() bool { 3042 return js.True == bindings.HasFuncXRCPUDepthInformationGetDepthInMeters( 3043 this.ref, 3044 ) 3045 } 3046 3047 // FuncGetDepthInMeters returns the method "XRCPUDepthInformation.getDepthInMeters". 3048 func (this XRCPUDepthInformation) FuncGetDepthInMeters() (fn js.Func[func(x float32, y float32) float32]) { 3049 bindings.FuncXRCPUDepthInformationGetDepthInMeters( 3050 this.ref, js.Pointer(&fn), 3051 ) 3052 return 3053 } 3054 3055 // GetDepthInMeters calls the method "XRCPUDepthInformation.getDepthInMeters". 3056 func (this XRCPUDepthInformation) GetDepthInMeters(x float32, y float32) (ret float32) { 3057 bindings.CallXRCPUDepthInformationGetDepthInMeters( 3058 this.ref, js.Pointer(&ret), 3059 float32(x), 3060 float32(y), 3061 ) 3062 3063 return 3064 } 3065 3066 // TryGetDepthInMeters calls the method "XRCPUDepthInformation.getDepthInMeters" 3067 // in a try/catch block and returns (_, err, ok = false) when it went through 3068 // the catch clause. 3069 func (this XRCPUDepthInformation) TryGetDepthInMeters(x float32, y float32) (ret float32, exception js.Any, ok bool) { 3070 ok = js.True == bindings.TryXRCPUDepthInformationGetDepthInMeters( 3071 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3072 float32(x), 3073 float32(y), 3074 ) 3075 3076 return 3077 } 3078 3079 type XRJointPose struct { 3080 XRPose 3081 } 3082 3083 func (this XRJointPose) Once() XRJointPose { 3084 this.ref.Once() 3085 return this 3086 } 3087 3088 func (this XRJointPose) Ref() js.Ref { 3089 return this.XRPose.Ref() 3090 } 3091 3092 func (this XRJointPose) FromRef(ref js.Ref) XRJointPose { 3093 this.XRPose = this.XRPose.FromRef(ref) 3094 return this 3095 } 3096 3097 func (this XRJointPose) Free() { 3098 this.ref.Free() 3099 } 3100 3101 // Radius returns the value of property "XRJointPose.radius". 3102 // 3103 // It returns ok=false if there is no such property. 3104 func (this XRJointPose) Radius() (ret float32, ok bool) { 3105 ok = js.True == bindings.GetXRJointPoseRadius( 3106 this.ref, js.Pointer(&ret), 3107 ) 3108 return 3109 } 3110 3111 type XRHandJoint uint32 3112 3113 const ( 3114 _ XRHandJoint = iota 3115 3116 XRHandJoint_WRIST 3117 XRHandJoint_THUMB_METACARPAL 3118 XRHandJoint_THUMB_PHALANX_PROXIMAL 3119 XRHandJoint_THUMB_PHALANX_DISTAL 3120 XRHandJoint_THUMB_TIP 3121 XRHandJoint_INDEX_FINGER_METACARPAL 3122 XRHandJoint_INDEX_FINGER_PHALANX_PROXIMAL 3123 XRHandJoint_INDEX_FINGER_PHALANX_INTERMEDIATE 3124 XRHandJoint_INDEX_FINGER_PHALANX_DISTAL 3125 XRHandJoint_INDEX_FINGER_TIP 3126 XRHandJoint_MIDDLE_FINGER_METACARPAL 3127 XRHandJoint_MIDDLE_FINGER_PHALANX_PROXIMAL 3128 XRHandJoint_MIDDLE_FINGER_PHALANX_INTERMEDIATE 3129 XRHandJoint_MIDDLE_FINGER_PHALANX_DISTAL 3130 XRHandJoint_MIDDLE_FINGER_TIP 3131 XRHandJoint_RING_FINGER_METACARPAL 3132 XRHandJoint_RING_FINGER_PHALANX_PROXIMAL 3133 XRHandJoint_RING_FINGER_PHALANX_INTERMEDIATE 3134 XRHandJoint_RING_FINGER_PHALANX_DISTAL 3135 XRHandJoint_RING_FINGER_TIP 3136 XRHandJoint_PINKY_FINGER_METACARPAL 3137 XRHandJoint_PINKY_FINGER_PHALANX_PROXIMAL 3138 XRHandJoint_PINKY_FINGER_PHALANX_INTERMEDIATE 3139 XRHandJoint_PINKY_FINGER_PHALANX_DISTAL 3140 XRHandJoint_PINKY_FINGER_TIP 3141 ) 3142 3143 func (XRHandJoint) FromRef(str js.Ref) XRHandJoint { 3144 return XRHandJoint(bindings.ConstOfXRHandJoint(str)) 3145 } 3146 3147 func (x XRHandJoint) String() (string, bool) { 3148 switch x { 3149 case XRHandJoint_WRIST: 3150 return "wrist", true 3151 case XRHandJoint_THUMB_METACARPAL: 3152 return "thumb-metacarpal", true 3153 case XRHandJoint_THUMB_PHALANX_PROXIMAL: 3154 return "thumb-phalanx-proximal", true 3155 case XRHandJoint_THUMB_PHALANX_DISTAL: 3156 return "thumb-phalanx-distal", true 3157 case XRHandJoint_THUMB_TIP: 3158 return "thumb-tip", true 3159 case XRHandJoint_INDEX_FINGER_METACARPAL: 3160 return "index-finger-metacarpal", true 3161 case XRHandJoint_INDEX_FINGER_PHALANX_PROXIMAL: 3162 return "index-finger-phalanx-proximal", true 3163 case XRHandJoint_INDEX_FINGER_PHALANX_INTERMEDIATE: 3164 return "index-finger-phalanx-intermediate", true 3165 case XRHandJoint_INDEX_FINGER_PHALANX_DISTAL: 3166 return "index-finger-phalanx-distal", true 3167 case XRHandJoint_INDEX_FINGER_TIP: 3168 return "index-finger-tip", true 3169 case XRHandJoint_MIDDLE_FINGER_METACARPAL: 3170 return "middle-finger-metacarpal", true 3171 case XRHandJoint_MIDDLE_FINGER_PHALANX_PROXIMAL: 3172 return "middle-finger-phalanx-proximal", true 3173 case XRHandJoint_MIDDLE_FINGER_PHALANX_INTERMEDIATE: 3174 return "middle-finger-phalanx-intermediate", true 3175 case XRHandJoint_MIDDLE_FINGER_PHALANX_DISTAL: 3176 return "middle-finger-phalanx-distal", true 3177 case XRHandJoint_MIDDLE_FINGER_TIP: 3178 return "middle-finger-tip", true 3179 case XRHandJoint_RING_FINGER_METACARPAL: 3180 return "ring-finger-metacarpal", true 3181 case XRHandJoint_RING_FINGER_PHALANX_PROXIMAL: 3182 return "ring-finger-phalanx-proximal", true 3183 case XRHandJoint_RING_FINGER_PHALANX_INTERMEDIATE: 3184 return "ring-finger-phalanx-intermediate", true 3185 case XRHandJoint_RING_FINGER_PHALANX_DISTAL: 3186 return "ring-finger-phalanx-distal", true 3187 case XRHandJoint_RING_FINGER_TIP: 3188 return "ring-finger-tip", true 3189 case XRHandJoint_PINKY_FINGER_METACARPAL: 3190 return "pinky-finger-metacarpal", true 3191 case XRHandJoint_PINKY_FINGER_PHALANX_PROXIMAL: 3192 return "pinky-finger-phalanx-proximal", true 3193 case XRHandJoint_PINKY_FINGER_PHALANX_INTERMEDIATE: 3194 return "pinky-finger-phalanx-intermediate", true 3195 case XRHandJoint_PINKY_FINGER_PHALANX_DISTAL: 3196 return "pinky-finger-phalanx-distal", true 3197 case XRHandJoint_PINKY_FINGER_TIP: 3198 return "pinky-finger-tip", true 3199 default: 3200 return "", false 3201 } 3202 } 3203 3204 type XRJointSpace struct { 3205 XRSpace 3206 } 3207 3208 func (this XRJointSpace) Once() XRJointSpace { 3209 this.ref.Once() 3210 return this 3211 } 3212 3213 func (this XRJointSpace) Ref() js.Ref { 3214 return this.XRSpace.Ref() 3215 } 3216 3217 func (this XRJointSpace) FromRef(ref js.Ref) XRJointSpace { 3218 this.XRSpace = this.XRSpace.FromRef(ref) 3219 return this 3220 } 3221 3222 func (this XRJointSpace) Free() { 3223 this.ref.Free() 3224 } 3225 3226 // JointName returns the value of property "XRJointSpace.jointName". 3227 // 3228 // It returns ok=false if there is no such property. 3229 func (this XRJointSpace) JointName() (ret XRHandJoint, ok bool) { 3230 ok = js.True == bindings.GetXRJointSpaceJointName( 3231 this.ref, js.Pointer(&ret), 3232 ) 3233 return 3234 } 3235 3236 type XRHitTestResult struct { 3237 ref js.Ref 3238 } 3239 3240 func (this XRHitTestResult) Once() XRHitTestResult { 3241 this.ref.Once() 3242 return this 3243 } 3244 3245 func (this XRHitTestResult) Ref() js.Ref { 3246 return this.ref 3247 } 3248 3249 func (this XRHitTestResult) FromRef(ref js.Ref) XRHitTestResult { 3250 this.ref = ref 3251 return this 3252 } 3253 3254 func (this XRHitTestResult) Free() { 3255 this.ref.Free() 3256 } 3257 3258 // HasFuncGetPose returns true if the method "XRHitTestResult.getPose" exists. 3259 func (this XRHitTestResult) HasFuncGetPose() bool { 3260 return js.True == bindings.HasFuncXRHitTestResultGetPose( 3261 this.ref, 3262 ) 3263 } 3264 3265 // FuncGetPose returns the method "XRHitTestResult.getPose". 3266 func (this XRHitTestResult) FuncGetPose() (fn js.Func[func(baseSpace XRSpace) XRPose]) { 3267 bindings.FuncXRHitTestResultGetPose( 3268 this.ref, js.Pointer(&fn), 3269 ) 3270 return 3271 } 3272 3273 // GetPose calls the method "XRHitTestResult.getPose". 3274 func (this XRHitTestResult) GetPose(baseSpace XRSpace) (ret XRPose) { 3275 bindings.CallXRHitTestResultGetPose( 3276 this.ref, js.Pointer(&ret), 3277 baseSpace.Ref(), 3278 ) 3279 3280 return 3281 } 3282 3283 // TryGetPose calls the method "XRHitTestResult.getPose" 3284 // in a try/catch block and returns (_, err, ok = false) when it went through 3285 // the catch clause. 3286 func (this XRHitTestResult) TryGetPose(baseSpace XRSpace) (ret XRPose, exception js.Any, ok bool) { 3287 ok = js.True == bindings.TryXRHitTestResultGetPose( 3288 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3289 baseSpace.Ref(), 3290 ) 3291 3292 return 3293 } 3294 3295 // HasFuncCreateAnchor returns true if the method "XRHitTestResult.createAnchor" exists. 3296 func (this XRHitTestResult) HasFuncCreateAnchor() bool { 3297 return js.True == bindings.HasFuncXRHitTestResultCreateAnchor( 3298 this.ref, 3299 ) 3300 } 3301 3302 // FuncCreateAnchor returns the method "XRHitTestResult.createAnchor". 3303 func (this XRHitTestResult) FuncCreateAnchor() (fn js.Func[func() js.Promise[XRAnchor]]) { 3304 bindings.FuncXRHitTestResultCreateAnchor( 3305 this.ref, js.Pointer(&fn), 3306 ) 3307 return 3308 } 3309 3310 // CreateAnchor calls the method "XRHitTestResult.createAnchor". 3311 func (this XRHitTestResult) CreateAnchor() (ret js.Promise[XRAnchor]) { 3312 bindings.CallXRHitTestResultCreateAnchor( 3313 this.ref, js.Pointer(&ret), 3314 ) 3315 3316 return 3317 } 3318 3319 // TryCreateAnchor calls the method "XRHitTestResult.createAnchor" 3320 // in a try/catch block and returns (_, err, ok = false) when it went through 3321 // the catch clause. 3322 func (this XRHitTestResult) TryCreateAnchor() (ret js.Promise[XRAnchor], exception js.Any, ok bool) { 3323 ok = js.True == bindings.TryXRHitTestResultCreateAnchor( 3324 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3325 ) 3326 3327 return 3328 }