github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis00_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package web 5 6 import ( 7 "github.com/primecitizens/pcz/std/core/abi" 8 "github.com/primecitizens/pcz/std/ffi/js" 9 "github.com/primecitizens/pcz/std/plat/js/web/bindings" 10 ) 11 12 type GLenum uint32 13 14 const ( 15 ANGLE_instanced_arrays_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE GLenum = 0x88FE 16 ) 17 18 type GLint int32 19 20 type GLsizei int32 21 22 type GLintptr int64 23 24 type GLuint uint32 25 26 type ANGLE_instanced_arrays struct { 27 ref js.Ref 28 } 29 30 func (this ANGLE_instanced_arrays) Once() ANGLE_instanced_arrays { 31 this.ref.Once() 32 return this 33 } 34 35 func (this ANGLE_instanced_arrays) Ref() js.Ref { 36 return this.ref 37 } 38 39 func (this ANGLE_instanced_arrays) FromRef(ref js.Ref) ANGLE_instanced_arrays { 40 this.ref = ref 41 return this 42 } 43 44 func (this ANGLE_instanced_arrays) Free() { 45 this.ref.Free() 46 } 47 48 // HasFuncDrawArraysInstancedANGLE returns true if the method "ANGLE_instanced_arrays.drawArraysInstancedANGLE" exists. 49 func (this ANGLE_instanced_arrays) HasFuncDrawArraysInstancedANGLE() bool { 50 return js.True == bindings.HasFuncANGLE_instanced_arraysDrawArraysInstancedANGLE( 51 this.ref, 52 ) 53 } 54 55 // FuncDrawArraysInstancedANGLE returns the method "ANGLE_instanced_arrays.drawArraysInstancedANGLE". 56 func (this ANGLE_instanced_arrays) FuncDrawArraysInstancedANGLE() (fn js.Func[func(mode GLenum, first GLint, count GLsizei, primcount GLsizei)]) { 57 bindings.FuncANGLE_instanced_arraysDrawArraysInstancedANGLE( 58 this.ref, js.Pointer(&fn), 59 ) 60 return 61 } 62 63 // DrawArraysInstancedANGLE calls the method "ANGLE_instanced_arrays.drawArraysInstancedANGLE". 64 func (this ANGLE_instanced_arrays) DrawArraysInstancedANGLE(mode GLenum, first GLint, count GLsizei, primcount GLsizei) (ret js.Void) { 65 bindings.CallANGLE_instanced_arraysDrawArraysInstancedANGLE( 66 this.ref, js.Pointer(&ret), 67 uint32(mode), 68 int32(first), 69 int32(count), 70 int32(primcount), 71 ) 72 73 return 74 } 75 76 // TryDrawArraysInstancedANGLE calls the method "ANGLE_instanced_arrays.drawArraysInstancedANGLE" 77 // in a try/catch block and returns (_, err, ok = false) when it went through 78 // the catch clause. 79 func (this ANGLE_instanced_arrays) TryDrawArraysInstancedANGLE(mode GLenum, first GLint, count GLsizei, primcount GLsizei) (ret js.Void, exception js.Any, ok bool) { 80 ok = js.True == bindings.TryANGLE_instanced_arraysDrawArraysInstancedANGLE( 81 this.ref, js.Pointer(&ret), js.Pointer(&exception), 82 uint32(mode), 83 int32(first), 84 int32(count), 85 int32(primcount), 86 ) 87 88 return 89 } 90 91 // HasFuncDrawElementsInstancedANGLE returns true if the method "ANGLE_instanced_arrays.drawElementsInstancedANGLE" exists. 92 func (this ANGLE_instanced_arrays) HasFuncDrawElementsInstancedANGLE() bool { 93 return js.True == bindings.HasFuncANGLE_instanced_arraysDrawElementsInstancedANGLE( 94 this.ref, 95 ) 96 } 97 98 // FuncDrawElementsInstancedANGLE returns the method "ANGLE_instanced_arrays.drawElementsInstancedANGLE". 99 func (this ANGLE_instanced_arrays) FuncDrawElementsInstancedANGLE() (fn js.Func[func(mode GLenum, count GLsizei, typ GLenum, offset GLintptr, primcount GLsizei)]) { 100 bindings.FuncANGLE_instanced_arraysDrawElementsInstancedANGLE( 101 this.ref, js.Pointer(&fn), 102 ) 103 return 104 } 105 106 // DrawElementsInstancedANGLE calls the method "ANGLE_instanced_arrays.drawElementsInstancedANGLE". 107 func (this ANGLE_instanced_arrays) DrawElementsInstancedANGLE(mode GLenum, count GLsizei, typ GLenum, offset GLintptr, primcount GLsizei) (ret js.Void) { 108 bindings.CallANGLE_instanced_arraysDrawElementsInstancedANGLE( 109 this.ref, js.Pointer(&ret), 110 uint32(mode), 111 int32(count), 112 uint32(typ), 113 float64(offset), 114 int32(primcount), 115 ) 116 117 return 118 } 119 120 // TryDrawElementsInstancedANGLE calls the method "ANGLE_instanced_arrays.drawElementsInstancedANGLE" 121 // in a try/catch block and returns (_, err, ok = false) when it went through 122 // the catch clause. 123 func (this ANGLE_instanced_arrays) TryDrawElementsInstancedANGLE(mode GLenum, count GLsizei, typ GLenum, offset GLintptr, primcount GLsizei) (ret js.Void, exception js.Any, ok bool) { 124 ok = js.True == bindings.TryANGLE_instanced_arraysDrawElementsInstancedANGLE( 125 this.ref, js.Pointer(&ret), js.Pointer(&exception), 126 uint32(mode), 127 int32(count), 128 uint32(typ), 129 float64(offset), 130 int32(primcount), 131 ) 132 133 return 134 } 135 136 // HasFuncVertexAttribDivisorANGLE returns true if the method "ANGLE_instanced_arrays.vertexAttribDivisorANGLE" exists. 137 func (this ANGLE_instanced_arrays) HasFuncVertexAttribDivisorANGLE() bool { 138 return js.True == bindings.HasFuncANGLE_instanced_arraysVertexAttribDivisorANGLE( 139 this.ref, 140 ) 141 } 142 143 // FuncVertexAttribDivisorANGLE returns the method "ANGLE_instanced_arrays.vertexAttribDivisorANGLE". 144 func (this ANGLE_instanced_arrays) FuncVertexAttribDivisorANGLE() (fn js.Func[func(index GLuint, divisor GLuint)]) { 145 bindings.FuncANGLE_instanced_arraysVertexAttribDivisorANGLE( 146 this.ref, js.Pointer(&fn), 147 ) 148 return 149 } 150 151 // VertexAttribDivisorANGLE calls the method "ANGLE_instanced_arrays.vertexAttribDivisorANGLE". 152 func (this ANGLE_instanced_arrays) VertexAttribDivisorANGLE(index GLuint, divisor GLuint) (ret js.Void) { 153 bindings.CallANGLE_instanced_arraysVertexAttribDivisorANGLE( 154 this.ref, js.Pointer(&ret), 155 uint32(index), 156 uint32(divisor), 157 ) 158 159 return 160 } 161 162 // TryVertexAttribDivisorANGLE calls the method "ANGLE_instanced_arrays.vertexAttribDivisorANGLE" 163 // in a try/catch block and returns (_, err, ok = false) when it went through 164 // the catch clause. 165 func (this ANGLE_instanced_arrays) TryVertexAttribDivisorANGLE(index GLuint, divisor GLuint) (ret js.Void, exception js.Any, ok bool) { 166 ok = js.True == bindings.TryANGLE_instanced_arraysVertexAttribDivisorANGLE( 167 this.ref, js.Pointer(&ret), js.Pointer(&exception), 168 uint32(index), 169 uint32(divisor), 170 ) 171 172 return 173 } 174 175 type AV1EncoderConfig struct { 176 // ForceScreenContentTools is "AV1EncoderConfig.forceScreenContentTools" 177 // 178 // Optional, defaults to false. 179 // 180 // NOTE: FFI_USE_ForceScreenContentTools MUST be set to true to make this field effective. 181 ForceScreenContentTools bool 182 183 FFI_USE_ForceScreenContentTools bool // for ForceScreenContentTools. 184 185 FFI_USE bool 186 } 187 188 // FromRef calls UpdateFrom and returns a AV1EncoderConfig with all fields set. 189 func (p AV1EncoderConfig) FromRef(ref js.Ref) AV1EncoderConfig { 190 p.UpdateFrom(ref) 191 return p 192 } 193 194 // New creates a new AV1EncoderConfig in the application heap. 195 func (p AV1EncoderConfig) New() js.Ref { 196 return bindings.AV1EncoderConfigJSLoad( 197 js.Pointer(&p), js.True, 0, 198 ) 199 } 200 201 // UpdateFrom copies value of all fields of the heap object to p. 202 func (p *AV1EncoderConfig) UpdateFrom(ref js.Ref) { 203 bindings.AV1EncoderConfigJSStore( 204 js.Pointer(p), ref, 205 ) 206 } 207 208 // Update writes all fields of the p to the heap object referenced by ref. 209 func (p *AV1EncoderConfig) Update(ref js.Ref) { 210 bindings.AV1EncoderConfigJSLoad( 211 js.Pointer(p), js.False, ref, 212 ) 213 } 214 215 // FreeMembers frees fields with heap reference, if recursive is true 216 // free all heap references reachable from p. 217 func (p *AV1EncoderConfig) FreeMembers(recursive bool) { 218 } 219 220 type AacBitstreamFormat uint32 221 222 const ( 223 _ AacBitstreamFormat = iota 224 225 AacBitstreamFormat_AAC 226 AacBitstreamFormat_ADTS 227 ) 228 229 func (AacBitstreamFormat) FromRef(str js.Ref) AacBitstreamFormat { 230 return AacBitstreamFormat(bindings.ConstOfAacBitstreamFormat(str)) 231 } 232 233 func (x AacBitstreamFormat) String() (string, bool) { 234 switch x { 235 case AacBitstreamFormat_AAC: 236 return "aac", true 237 case AacBitstreamFormat_ADTS: 238 return "adts", true 239 default: 240 return "", false 241 } 242 } 243 244 type AacEncoderConfig struct { 245 // Format is "AacEncoderConfig.format" 246 // 247 // Optional, defaults to "aac". 248 Format AacBitstreamFormat 249 250 FFI_USE bool 251 } 252 253 // FromRef calls UpdateFrom and returns a AacEncoderConfig with all fields set. 254 func (p AacEncoderConfig) FromRef(ref js.Ref) AacEncoderConfig { 255 p.UpdateFrom(ref) 256 return p 257 } 258 259 // New creates a new AacEncoderConfig in the application heap. 260 func (p AacEncoderConfig) New() js.Ref { 261 return bindings.AacEncoderConfigJSLoad( 262 js.Pointer(&p), js.True, 0, 263 ) 264 } 265 266 // UpdateFrom copies value of all fields of the heap object to p. 267 func (p *AacEncoderConfig) UpdateFrom(ref js.Ref) { 268 bindings.AacEncoderConfigJSStore( 269 js.Pointer(p), ref, 270 ) 271 } 272 273 // Update writes all fields of the p to the heap object referenced by ref. 274 func (p *AacEncoderConfig) Update(ref js.Ref) { 275 bindings.AacEncoderConfigJSLoad( 276 js.Pointer(p), js.False, ref, 277 ) 278 } 279 280 // FreeMembers frees fields with heap reference, if recursive is true 281 // free all heap references reachable from p. 282 func (p *AacEncoderConfig) FreeMembers(recursive bool) { 283 } 284 285 type EventHandlerNonNullFunc func(this js.Ref, event Event) js.Ref 286 287 func (fn EventHandlerNonNullFunc) Register() js.Func[func(event Event) js.Any] { 288 return js.RegisterCallback[func(event Event) js.Any]( 289 fn, abi.FuncPCABIInternal(fn), 290 ) 291 } 292 293 func (fn EventHandlerNonNullFunc) DispatchCallback( 294 targetPC uintptr, ctx *js.CallbackContext, 295 ) { 296 args := ctx.Args() 297 if len(args) != 1+1 /* js this */ || 298 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 299 js.ThrowInvalidCallbackInvocation() 300 } 301 302 if ctx.Return(fn( 303 args[0], 304 305 Event{}.FromRef(args[0+1]), 306 )) { 307 return 308 } 309 310 js.ThrowCallbackValueNotReturned() 311 } 312 313 type EventHandlerNonNull[T any] struct { 314 Fn func(arg T, this js.Ref, event Event) js.Ref 315 Arg T 316 } 317 318 func (cb *EventHandlerNonNull[T]) Register() js.Func[func(event Event) js.Any] { 319 return js.RegisterCallback[func(event Event) js.Any]( 320 cb, abi.FuncPCABIInternal(cb.Fn), 321 ) 322 } 323 324 func (cb *EventHandlerNonNull[T]) DispatchCallback( 325 targetPC uintptr, ctx *js.CallbackContext, 326 ) { 327 args := ctx.Args() 328 if len(args) != 1+1 /* js this */ || 329 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 330 js.ThrowInvalidCallbackInvocation() 331 } 332 333 if ctx.Return(cb.Fn( 334 cb.Arg, 335 args[0], 336 337 Event{}.FromRef(args[0+1]), 338 )) { 339 return 340 } 341 342 js.ThrowCallbackValueNotReturned() 343 } 344 345 const ( 346 Event_NONE uint16 = 0 347 Event_CAPTURING_PHASE uint16 = 1 348 Event_AT_TARGET uint16 = 2 349 Event_BUBBLING_PHASE uint16 = 3 350 ) 351 352 type EventInit struct { 353 // Bubbles is "EventInit.bubbles" 354 // 355 // Optional, defaults to false. 356 // 357 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 358 Bubbles bool 359 // Cancelable is "EventInit.cancelable" 360 // 361 // Optional, defaults to false. 362 // 363 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 364 Cancelable bool 365 // Composed is "EventInit.composed" 366 // 367 // Optional, defaults to false. 368 // 369 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 370 Composed bool 371 372 FFI_USE_Bubbles bool // for Bubbles. 373 FFI_USE_Cancelable bool // for Cancelable. 374 FFI_USE_Composed bool // for Composed. 375 376 FFI_USE bool 377 } 378 379 // FromRef calls UpdateFrom and returns a EventInit with all fields set. 380 func (p EventInit) FromRef(ref js.Ref) EventInit { 381 p.UpdateFrom(ref) 382 return p 383 } 384 385 // New creates a new EventInit in the application heap. 386 func (p EventInit) New() js.Ref { 387 return bindings.EventInitJSLoad( 388 js.Pointer(&p), js.True, 0, 389 ) 390 } 391 392 // UpdateFrom copies value of all fields of the heap object to p. 393 func (p *EventInit) UpdateFrom(ref js.Ref) { 394 bindings.EventInitJSStore( 395 js.Pointer(p), ref, 396 ) 397 } 398 399 // Update writes all fields of the p to the heap object referenced by ref. 400 func (p *EventInit) Update(ref js.Ref) { 401 bindings.EventInitJSLoad( 402 js.Pointer(p), js.False, ref, 403 ) 404 } 405 406 // FreeMembers frees fields with heap reference, if recursive is true 407 // free all heap references reachable from p. 408 func (p *EventInit) FreeMembers(recursive bool) { 409 } 410 411 type EventListenerFunc func(this js.Ref, event Event) js.Ref 412 413 func (fn EventListenerFunc) Register() js.Func[func(event Event)] { 414 return js.RegisterCallback[func(event Event)]( 415 fn, abi.FuncPCABIInternal(fn), 416 ) 417 } 418 419 func (fn EventListenerFunc) DispatchCallback( 420 targetPC uintptr, ctx *js.CallbackContext, 421 ) { 422 args := ctx.Args() 423 if len(args) != 1+1 /* js this */ || 424 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 425 js.ThrowInvalidCallbackInvocation() 426 } 427 428 if ctx.Return(fn( 429 args[0], 430 431 Event{}.FromRef(args[0+1]), 432 )) { 433 return 434 } 435 436 js.ThrowCallbackValueNotReturned() 437 } 438 439 type EventListener[T any] struct { 440 Fn func(arg T, this js.Ref, event Event) js.Ref 441 Arg T 442 } 443 444 func (cb *EventListener[T]) Register() js.Func[func(event Event)] { 445 return js.RegisterCallback[func(event Event)]( 446 cb, abi.FuncPCABIInternal(cb.Fn), 447 ) 448 } 449 450 func (cb *EventListener[T]) DispatchCallback( 451 targetPC uintptr, ctx *js.CallbackContext, 452 ) { 453 args := ctx.Args() 454 if len(args) != 1+1 /* js this */ || 455 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 456 js.ThrowInvalidCallbackInvocation() 457 } 458 459 if ctx.Return(cb.Fn( 460 cb.Arg, 461 args[0], 462 463 Event{}.FromRef(args[0+1]), 464 )) { 465 return 466 } 467 468 js.ThrowCallbackValueNotReturned() 469 } 470 471 type AddEventListenerOptions struct { 472 // Passive is "AddEventListenerOptions.passive" 473 // 474 // Optional 475 // 476 // NOTE: FFI_USE_Passive MUST be set to true to make this field effective. 477 Passive bool 478 // Once is "AddEventListenerOptions.once" 479 // 480 // Optional, defaults to false. 481 // 482 // NOTE: FFI_USE_Once MUST be set to true to make this field effective. 483 Once bool 484 // Signal is "AddEventListenerOptions.signal" 485 // 486 // Optional 487 Signal AbortSignal 488 // Capture is "AddEventListenerOptions.capture" 489 // 490 // Optional, defaults to false. 491 // 492 // NOTE: FFI_USE_Capture MUST be set to true to make this field effective. 493 Capture bool 494 495 FFI_USE_Passive bool // for Passive. 496 FFI_USE_Once bool // for Once. 497 FFI_USE_Capture bool // for Capture. 498 499 FFI_USE bool 500 } 501 502 // FromRef calls UpdateFrom and returns a AddEventListenerOptions with all fields set. 503 func (p AddEventListenerOptions) FromRef(ref js.Ref) AddEventListenerOptions { 504 p.UpdateFrom(ref) 505 return p 506 } 507 508 // New creates a new AddEventListenerOptions in the application heap. 509 func (p AddEventListenerOptions) New() js.Ref { 510 return bindings.AddEventListenerOptionsJSLoad( 511 js.Pointer(&p), js.True, 0, 512 ) 513 } 514 515 // UpdateFrom copies value of all fields of the heap object to p. 516 func (p *AddEventListenerOptions) UpdateFrom(ref js.Ref) { 517 bindings.AddEventListenerOptionsJSStore( 518 js.Pointer(p), ref, 519 ) 520 } 521 522 // Update writes all fields of the p to the heap object referenced by ref. 523 func (p *AddEventListenerOptions) Update(ref js.Ref) { 524 bindings.AddEventListenerOptionsJSLoad( 525 js.Pointer(p), js.False, ref, 526 ) 527 } 528 529 // FreeMembers frees fields with heap reference, if recursive is true 530 // free all heap references reachable from p. 531 func (p *AddEventListenerOptions) FreeMembers(recursive bool) { 532 js.Free( 533 p.Signal.Ref(), 534 ) 535 p.Signal = p.Signal.FromRef(js.Undefined) 536 } 537 538 type OneOf_AddEventListenerOptions_Bool struct { 539 ref js.Ref 540 } 541 542 func (x OneOf_AddEventListenerOptions_Bool) Ref() js.Ref { 543 return x.ref 544 } 545 546 func (x OneOf_AddEventListenerOptions_Bool) Free() { 547 x.ref.Free() 548 } 549 550 func (x OneOf_AddEventListenerOptions_Bool) FromRef(ref js.Ref) OneOf_AddEventListenerOptions_Bool { 551 return OneOf_AddEventListenerOptions_Bool{ 552 ref: ref, 553 } 554 } 555 556 func (x OneOf_AddEventListenerOptions_Bool) AddEventListenerOptions() AddEventListenerOptions { 557 var ret AddEventListenerOptions 558 ret.UpdateFrom(x.ref) 559 return ret 560 } 561 562 func (x OneOf_AddEventListenerOptions_Bool) Bool() bool { 563 return x.ref == js.True 564 } 565 566 type EventListenerOptions struct { 567 // Capture is "EventListenerOptions.capture" 568 // 569 // Optional, defaults to false. 570 // 571 // NOTE: FFI_USE_Capture MUST be set to true to make this field effective. 572 Capture bool 573 574 FFI_USE_Capture bool // for Capture. 575 576 FFI_USE bool 577 } 578 579 // FromRef calls UpdateFrom and returns a EventListenerOptions with all fields set. 580 func (p EventListenerOptions) FromRef(ref js.Ref) EventListenerOptions { 581 p.UpdateFrom(ref) 582 return p 583 } 584 585 // New creates a new EventListenerOptions in the application heap. 586 func (p EventListenerOptions) New() js.Ref { 587 return bindings.EventListenerOptionsJSLoad( 588 js.Pointer(&p), js.True, 0, 589 ) 590 } 591 592 // UpdateFrom copies value of all fields of the heap object to p. 593 func (p *EventListenerOptions) UpdateFrom(ref js.Ref) { 594 bindings.EventListenerOptionsJSStore( 595 js.Pointer(p), ref, 596 ) 597 } 598 599 // Update writes all fields of the p to the heap object referenced by ref. 600 func (p *EventListenerOptions) Update(ref js.Ref) { 601 bindings.EventListenerOptionsJSLoad( 602 js.Pointer(p), js.False, ref, 603 ) 604 } 605 606 // FreeMembers frees fields with heap reference, if recursive is true 607 // free all heap references reachable from p. 608 func (p *EventListenerOptions) FreeMembers(recursive bool) { 609 } 610 611 type OneOf_EventListenerOptions_Bool struct { 612 ref js.Ref 613 } 614 615 func (x OneOf_EventListenerOptions_Bool) Ref() js.Ref { 616 return x.ref 617 } 618 619 func (x OneOf_EventListenerOptions_Bool) Free() { 620 x.ref.Free() 621 } 622 623 func (x OneOf_EventListenerOptions_Bool) FromRef(ref js.Ref) OneOf_EventListenerOptions_Bool { 624 return OneOf_EventListenerOptions_Bool{ 625 ref: ref, 626 } 627 } 628 629 func (x OneOf_EventListenerOptions_Bool) EventListenerOptions() EventListenerOptions { 630 var ret EventListenerOptions 631 ret.UpdateFrom(x.ref) 632 return ret 633 } 634 635 func (x OneOf_EventListenerOptions_Bool) Bool() bool { 636 return x.ref == js.True 637 } 638 639 type EventTarget struct { 640 ref js.Ref 641 } 642 643 func (this EventTarget) Once() EventTarget { 644 this.ref.Once() 645 return this 646 } 647 648 func (this EventTarget) Ref() js.Ref { 649 return this.ref 650 } 651 652 func (this EventTarget) FromRef(ref js.Ref) EventTarget { 653 this.ref = ref 654 return this 655 } 656 657 func (this EventTarget) Free() { 658 this.ref.Free() 659 } 660 661 // HasFuncAddEventListener returns true if the method "EventTarget.addEventListener" exists. 662 func (this EventTarget) HasFuncAddEventListener() bool { 663 return js.True == bindings.HasFuncEventTargetAddEventListener( 664 this.ref, 665 ) 666 } 667 668 // FuncAddEventListener returns the method "EventTarget.addEventListener". 669 func (this EventTarget) FuncAddEventListener() (fn js.Func[func(typ js.String, callback js.Func[func(event Event)], options OneOf_AddEventListenerOptions_Bool)]) { 670 bindings.FuncEventTargetAddEventListener( 671 this.ref, js.Pointer(&fn), 672 ) 673 return 674 } 675 676 // AddEventListener calls the method "EventTarget.addEventListener". 677 func (this EventTarget) AddEventListener(typ js.String, callback js.Func[func(event Event)], options OneOf_AddEventListenerOptions_Bool) (ret js.Void) { 678 bindings.CallEventTargetAddEventListener( 679 this.ref, js.Pointer(&ret), 680 typ.Ref(), 681 callback.Ref(), 682 options.Ref(), 683 ) 684 685 return 686 } 687 688 // TryAddEventListener calls the method "EventTarget.addEventListener" 689 // in a try/catch block and returns (_, err, ok = false) when it went through 690 // the catch clause. 691 func (this EventTarget) TryAddEventListener(typ js.String, callback js.Func[func(event Event)], options OneOf_AddEventListenerOptions_Bool) (ret js.Void, exception js.Any, ok bool) { 692 ok = js.True == bindings.TryEventTargetAddEventListener( 693 this.ref, js.Pointer(&ret), js.Pointer(&exception), 694 typ.Ref(), 695 callback.Ref(), 696 options.Ref(), 697 ) 698 699 return 700 } 701 702 // HasFuncAddEventListener1 returns true if the method "EventTarget.addEventListener" exists. 703 func (this EventTarget) HasFuncAddEventListener1() bool { 704 return js.True == bindings.HasFuncEventTargetAddEventListener1( 705 this.ref, 706 ) 707 } 708 709 // FuncAddEventListener1 returns the method "EventTarget.addEventListener". 710 func (this EventTarget) FuncAddEventListener1() (fn js.Func[func(typ js.String, callback js.Func[func(event Event)])]) { 711 bindings.FuncEventTargetAddEventListener1( 712 this.ref, js.Pointer(&fn), 713 ) 714 return 715 } 716 717 // AddEventListener1 calls the method "EventTarget.addEventListener". 718 func (this EventTarget) AddEventListener1(typ js.String, callback js.Func[func(event Event)]) (ret js.Void) { 719 bindings.CallEventTargetAddEventListener1( 720 this.ref, js.Pointer(&ret), 721 typ.Ref(), 722 callback.Ref(), 723 ) 724 725 return 726 } 727 728 // TryAddEventListener1 calls the method "EventTarget.addEventListener" 729 // in a try/catch block and returns (_, err, ok = false) when it went through 730 // the catch clause. 731 func (this EventTarget) TryAddEventListener1(typ js.String, callback js.Func[func(event Event)]) (ret js.Void, exception js.Any, ok bool) { 732 ok = js.True == bindings.TryEventTargetAddEventListener1( 733 this.ref, js.Pointer(&ret), js.Pointer(&exception), 734 typ.Ref(), 735 callback.Ref(), 736 ) 737 738 return 739 } 740 741 // HasFuncRemoveEventListener returns true if the method "EventTarget.removeEventListener" exists. 742 func (this EventTarget) HasFuncRemoveEventListener() bool { 743 return js.True == bindings.HasFuncEventTargetRemoveEventListener( 744 this.ref, 745 ) 746 } 747 748 // FuncRemoveEventListener returns the method "EventTarget.removeEventListener". 749 func (this EventTarget) FuncRemoveEventListener() (fn js.Func[func(typ js.String, callback js.Func[func(event Event)], options OneOf_EventListenerOptions_Bool)]) { 750 bindings.FuncEventTargetRemoveEventListener( 751 this.ref, js.Pointer(&fn), 752 ) 753 return 754 } 755 756 // RemoveEventListener calls the method "EventTarget.removeEventListener". 757 func (this EventTarget) RemoveEventListener(typ js.String, callback js.Func[func(event Event)], options OneOf_EventListenerOptions_Bool) (ret js.Void) { 758 bindings.CallEventTargetRemoveEventListener( 759 this.ref, js.Pointer(&ret), 760 typ.Ref(), 761 callback.Ref(), 762 options.Ref(), 763 ) 764 765 return 766 } 767 768 // TryRemoveEventListener calls the method "EventTarget.removeEventListener" 769 // in a try/catch block and returns (_, err, ok = false) when it went through 770 // the catch clause. 771 func (this EventTarget) TryRemoveEventListener(typ js.String, callback js.Func[func(event Event)], options OneOf_EventListenerOptions_Bool) (ret js.Void, exception js.Any, ok bool) { 772 ok = js.True == bindings.TryEventTargetRemoveEventListener( 773 this.ref, js.Pointer(&ret), js.Pointer(&exception), 774 typ.Ref(), 775 callback.Ref(), 776 options.Ref(), 777 ) 778 779 return 780 } 781 782 // HasFuncRemoveEventListener1 returns true if the method "EventTarget.removeEventListener" exists. 783 func (this EventTarget) HasFuncRemoveEventListener1() bool { 784 return js.True == bindings.HasFuncEventTargetRemoveEventListener1( 785 this.ref, 786 ) 787 } 788 789 // FuncRemoveEventListener1 returns the method "EventTarget.removeEventListener". 790 func (this EventTarget) FuncRemoveEventListener1() (fn js.Func[func(typ js.String, callback js.Func[func(event Event)])]) { 791 bindings.FuncEventTargetRemoveEventListener1( 792 this.ref, js.Pointer(&fn), 793 ) 794 return 795 } 796 797 // RemoveEventListener1 calls the method "EventTarget.removeEventListener". 798 func (this EventTarget) RemoveEventListener1(typ js.String, callback js.Func[func(event Event)]) (ret js.Void) { 799 bindings.CallEventTargetRemoveEventListener1( 800 this.ref, js.Pointer(&ret), 801 typ.Ref(), 802 callback.Ref(), 803 ) 804 805 return 806 } 807 808 // TryRemoveEventListener1 calls the method "EventTarget.removeEventListener" 809 // in a try/catch block and returns (_, err, ok = false) when it went through 810 // the catch clause. 811 func (this EventTarget) TryRemoveEventListener1(typ js.String, callback js.Func[func(event Event)]) (ret js.Void, exception js.Any, ok bool) { 812 ok = js.True == bindings.TryEventTargetRemoveEventListener1( 813 this.ref, js.Pointer(&ret), js.Pointer(&exception), 814 typ.Ref(), 815 callback.Ref(), 816 ) 817 818 return 819 } 820 821 // HasFuncDispatchEvent returns true if the method "EventTarget.dispatchEvent" exists. 822 func (this EventTarget) HasFuncDispatchEvent() bool { 823 return js.True == bindings.HasFuncEventTargetDispatchEvent( 824 this.ref, 825 ) 826 } 827 828 // FuncDispatchEvent returns the method "EventTarget.dispatchEvent". 829 func (this EventTarget) FuncDispatchEvent() (fn js.Func[func(event Event) bool]) { 830 bindings.FuncEventTargetDispatchEvent( 831 this.ref, js.Pointer(&fn), 832 ) 833 return 834 } 835 836 // DispatchEvent calls the method "EventTarget.dispatchEvent". 837 func (this EventTarget) DispatchEvent(event Event) (ret bool) { 838 bindings.CallEventTargetDispatchEvent( 839 this.ref, js.Pointer(&ret), 840 event.Ref(), 841 ) 842 843 return 844 } 845 846 // TryDispatchEvent calls the method "EventTarget.dispatchEvent" 847 // in a try/catch block and returns (_, err, ok = false) when it went through 848 // the catch clause. 849 func (this EventTarget) TryDispatchEvent(event Event) (ret bool, exception js.Any, ok bool) { 850 ok = js.True == bindings.TryEventTargetDispatchEvent( 851 this.ref, js.Pointer(&ret), js.Pointer(&exception), 852 event.Ref(), 853 ) 854 855 return 856 } 857 858 type DOMHighResTimeStamp float64 859 860 func NewEvent(typ js.String, eventInitDict EventInit) (ret Event) { 861 ret.ref = bindings.NewEventByEvent( 862 typ.Ref(), 863 js.Pointer(&eventInitDict)) 864 return 865 } 866 867 func NewEventByEvent1(typ js.String) (ret Event) { 868 ret.ref = bindings.NewEventByEvent1( 869 typ.Ref()) 870 return 871 } 872 873 type Event struct { 874 ref js.Ref 875 } 876 877 func (this Event) Once() Event { 878 this.ref.Once() 879 return this 880 } 881 882 func (this Event) Ref() js.Ref { 883 return this.ref 884 } 885 886 func (this Event) FromRef(ref js.Ref) Event { 887 this.ref = ref 888 return this 889 } 890 891 func (this Event) Free() { 892 this.ref.Free() 893 } 894 895 // Type returns the value of property "Event.type". 896 // 897 // It returns ok=false if there is no such property. 898 func (this Event) Type() (ret js.String, ok bool) { 899 ok = js.True == bindings.GetEventType( 900 this.ref, js.Pointer(&ret), 901 ) 902 return 903 } 904 905 // Target returns the value of property "Event.target". 906 // 907 // It returns ok=false if there is no such property. 908 func (this Event) Target() (ret EventTarget, ok bool) { 909 ok = js.True == bindings.GetEventTarget( 910 this.ref, js.Pointer(&ret), 911 ) 912 return 913 } 914 915 // SrcElement returns the value of property "Event.srcElement". 916 // 917 // It returns ok=false if there is no such property. 918 func (this Event) SrcElement() (ret EventTarget, ok bool) { 919 ok = js.True == bindings.GetEventSrcElement( 920 this.ref, js.Pointer(&ret), 921 ) 922 return 923 } 924 925 // CurrentTarget returns the value of property "Event.currentTarget". 926 // 927 // It returns ok=false if there is no such property. 928 func (this Event) CurrentTarget() (ret EventTarget, ok bool) { 929 ok = js.True == bindings.GetEventCurrentTarget( 930 this.ref, js.Pointer(&ret), 931 ) 932 return 933 } 934 935 // EventPhase returns the value of property "Event.eventPhase". 936 // 937 // It returns ok=false if there is no such property. 938 func (this Event) EventPhase() (ret uint16, ok bool) { 939 ok = js.True == bindings.GetEventEventPhase( 940 this.ref, js.Pointer(&ret), 941 ) 942 return 943 } 944 945 // CancelBubble returns the value of property "Event.cancelBubble". 946 // 947 // It returns ok=false if there is no such property. 948 func (this Event) CancelBubble() (ret bool, ok bool) { 949 ok = js.True == bindings.GetEventCancelBubble( 950 this.ref, js.Pointer(&ret), 951 ) 952 return 953 } 954 955 // SetCancelBubble sets the value of property "Event.cancelBubble" to val. 956 // 957 // It returns false if the property cannot be set. 958 func (this Event) SetCancelBubble(val bool) bool { 959 return js.True == bindings.SetEventCancelBubble( 960 this.ref, 961 js.Bool(bool(val)), 962 ) 963 } 964 965 // Bubbles returns the value of property "Event.bubbles". 966 // 967 // It returns ok=false if there is no such property. 968 func (this Event) Bubbles() (ret bool, ok bool) { 969 ok = js.True == bindings.GetEventBubbles( 970 this.ref, js.Pointer(&ret), 971 ) 972 return 973 } 974 975 // Cancelable returns the value of property "Event.cancelable". 976 // 977 // It returns ok=false if there is no such property. 978 func (this Event) Cancelable() (ret bool, ok bool) { 979 ok = js.True == bindings.GetEventCancelable( 980 this.ref, js.Pointer(&ret), 981 ) 982 return 983 } 984 985 // ReturnValue returns the value of property "Event.returnValue". 986 // 987 // It returns ok=false if there is no such property. 988 func (this Event) ReturnValue() (ret bool, ok bool) { 989 ok = js.True == bindings.GetEventReturnValue( 990 this.ref, js.Pointer(&ret), 991 ) 992 return 993 } 994 995 // SetReturnValue sets the value of property "Event.returnValue" to val. 996 // 997 // It returns false if the property cannot be set. 998 func (this Event) SetReturnValue(val bool) bool { 999 return js.True == bindings.SetEventReturnValue( 1000 this.ref, 1001 js.Bool(bool(val)), 1002 ) 1003 } 1004 1005 // DefaultPrevented returns the value of property "Event.defaultPrevented". 1006 // 1007 // It returns ok=false if there is no such property. 1008 func (this Event) DefaultPrevented() (ret bool, ok bool) { 1009 ok = js.True == bindings.GetEventDefaultPrevented( 1010 this.ref, js.Pointer(&ret), 1011 ) 1012 return 1013 } 1014 1015 // Composed returns the value of property "Event.composed". 1016 // 1017 // It returns ok=false if there is no such property. 1018 func (this Event) Composed() (ret bool, ok bool) { 1019 ok = js.True == bindings.GetEventComposed( 1020 this.ref, js.Pointer(&ret), 1021 ) 1022 return 1023 } 1024 1025 // IsTrusted returns the value of property "Event.isTrusted". 1026 // 1027 // It returns ok=false if there is no such property. 1028 func (this Event) IsTrusted() (ret bool, ok bool) { 1029 ok = js.True == bindings.GetEventIsTrusted( 1030 this.ref, js.Pointer(&ret), 1031 ) 1032 return 1033 } 1034 1035 // TimeStamp returns the value of property "Event.timeStamp". 1036 // 1037 // It returns ok=false if there is no such property. 1038 func (this Event) TimeStamp() (ret DOMHighResTimeStamp, ok bool) { 1039 ok = js.True == bindings.GetEventTimeStamp( 1040 this.ref, js.Pointer(&ret), 1041 ) 1042 return 1043 } 1044 1045 // HasFuncComposedPath returns true if the method "Event.composedPath" exists. 1046 func (this Event) HasFuncComposedPath() bool { 1047 return js.True == bindings.HasFuncEventComposedPath( 1048 this.ref, 1049 ) 1050 } 1051 1052 // FuncComposedPath returns the method "Event.composedPath". 1053 func (this Event) FuncComposedPath() (fn js.Func[func() js.Array[EventTarget]]) { 1054 bindings.FuncEventComposedPath( 1055 this.ref, js.Pointer(&fn), 1056 ) 1057 return 1058 } 1059 1060 // ComposedPath calls the method "Event.composedPath". 1061 func (this Event) ComposedPath() (ret js.Array[EventTarget]) { 1062 bindings.CallEventComposedPath( 1063 this.ref, js.Pointer(&ret), 1064 ) 1065 1066 return 1067 } 1068 1069 // TryComposedPath calls the method "Event.composedPath" 1070 // in a try/catch block and returns (_, err, ok = false) when it went through 1071 // the catch clause. 1072 func (this Event) TryComposedPath() (ret js.Array[EventTarget], exception js.Any, ok bool) { 1073 ok = js.True == bindings.TryEventComposedPath( 1074 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1075 ) 1076 1077 return 1078 } 1079 1080 // HasFuncStopPropagation returns true if the method "Event.stopPropagation" exists. 1081 func (this Event) HasFuncStopPropagation() bool { 1082 return js.True == bindings.HasFuncEventStopPropagation( 1083 this.ref, 1084 ) 1085 } 1086 1087 // FuncStopPropagation returns the method "Event.stopPropagation". 1088 func (this Event) FuncStopPropagation() (fn js.Func[func()]) { 1089 bindings.FuncEventStopPropagation( 1090 this.ref, js.Pointer(&fn), 1091 ) 1092 return 1093 } 1094 1095 // StopPropagation calls the method "Event.stopPropagation". 1096 func (this Event) StopPropagation() (ret js.Void) { 1097 bindings.CallEventStopPropagation( 1098 this.ref, js.Pointer(&ret), 1099 ) 1100 1101 return 1102 } 1103 1104 // TryStopPropagation calls the method "Event.stopPropagation" 1105 // in a try/catch block and returns (_, err, ok = false) when it went through 1106 // the catch clause. 1107 func (this Event) TryStopPropagation() (ret js.Void, exception js.Any, ok bool) { 1108 ok = js.True == bindings.TryEventStopPropagation( 1109 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1110 ) 1111 1112 return 1113 } 1114 1115 // HasFuncStopImmediatePropagation returns true if the method "Event.stopImmediatePropagation" exists. 1116 func (this Event) HasFuncStopImmediatePropagation() bool { 1117 return js.True == bindings.HasFuncEventStopImmediatePropagation( 1118 this.ref, 1119 ) 1120 } 1121 1122 // FuncStopImmediatePropagation returns the method "Event.stopImmediatePropagation". 1123 func (this Event) FuncStopImmediatePropagation() (fn js.Func[func()]) { 1124 bindings.FuncEventStopImmediatePropagation( 1125 this.ref, js.Pointer(&fn), 1126 ) 1127 return 1128 } 1129 1130 // StopImmediatePropagation calls the method "Event.stopImmediatePropagation". 1131 func (this Event) StopImmediatePropagation() (ret js.Void) { 1132 bindings.CallEventStopImmediatePropagation( 1133 this.ref, js.Pointer(&ret), 1134 ) 1135 1136 return 1137 } 1138 1139 // TryStopImmediatePropagation calls the method "Event.stopImmediatePropagation" 1140 // in a try/catch block and returns (_, err, ok = false) when it went through 1141 // the catch clause. 1142 func (this Event) TryStopImmediatePropagation() (ret js.Void, exception js.Any, ok bool) { 1143 ok = js.True == bindings.TryEventStopImmediatePropagation( 1144 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1145 ) 1146 1147 return 1148 } 1149 1150 // HasFuncPreventDefault returns true if the method "Event.preventDefault" exists. 1151 func (this Event) HasFuncPreventDefault() bool { 1152 return js.True == bindings.HasFuncEventPreventDefault( 1153 this.ref, 1154 ) 1155 } 1156 1157 // FuncPreventDefault returns the method "Event.preventDefault". 1158 func (this Event) FuncPreventDefault() (fn js.Func[func()]) { 1159 bindings.FuncEventPreventDefault( 1160 this.ref, js.Pointer(&fn), 1161 ) 1162 return 1163 } 1164 1165 // PreventDefault calls the method "Event.preventDefault". 1166 func (this Event) PreventDefault() (ret js.Void) { 1167 bindings.CallEventPreventDefault( 1168 this.ref, js.Pointer(&ret), 1169 ) 1170 1171 return 1172 } 1173 1174 // TryPreventDefault calls the method "Event.preventDefault" 1175 // in a try/catch block and returns (_, err, ok = false) when it went through 1176 // the catch clause. 1177 func (this Event) TryPreventDefault() (ret js.Void, exception js.Any, ok bool) { 1178 ok = js.True == bindings.TryEventPreventDefault( 1179 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1180 ) 1181 1182 return 1183 } 1184 1185 // HasFuncInitEvent returns true if the method "Event.initEvent" exists. 1186 func (this Event) HasFuncInitEvent() bool { 1187 return js.True == bindings.HasFuncEventInitEvent( 1188 this.ref, 1189 ) 1190 } 1191 1192 // FuncInitEvent returns the method "Event.initEvent". 1193 func (this Event) FuncInitEvent() (fn js.Func[func(typ js.String, bubbles bool, cancelable bool)]) { 1194 bindings.FuncEventInitEvent( 1195 this.ref, js.Pointer(&fn), 1196 ) 1197 return 1198 } 1199 1200 // InitEvent calls the method "Event.initEvent". 1201 func (this Event) InitEvent(typ js.String, bubbles bool, cancelable bool) (ret js.Void) { 1202 bindings.CallEventInitEvent( 1203 this.ref, js.Pointer(&ret), 1204 typ.Ref(), 1205 js.Bool(bool(bubbles)), 1206 js.Bool(bool(cancelable)), 1207 ) 1208 1209 return 1210 } 1211 1212 // TryInitEvent calls the method "Event.initEvent" 1213 // in a try/catch block and returns (_, err, ok = false) when it went through 1214 // the catch clause. 1215 func (this Event) TryInitEvent(typ js.String, bubbles bool, cancelable bool) (ret js.Void, exception js.Any, ok bool) { 1216 ok = js.True == bindings.TryEventInitEvent( 1217 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1218 typ.Ref(), 1219 js.Bool(bool(bubbles)), 1220 js.Bool(bool(cancelable)), 1221 ) 1222 1223 return 1224 } 1225 1226 // HasFuncInitEvent1 returns true if the method "Event.initEvent" exists. 1227 func (this Event) HasFuncInitEvent1() bool { 1228 return js.True == bindings.HasFuncEventInitEvent1( 1229 this.ref, 1230 ) 1231 } 1232 1233 // FuncInitEvent1 returns the method "Event.initEvent". 1234 func (this Event) FuncInitEvent1() (fn js.Func[func(typ js.String, bubbles bool)]) { 1235 bindings.FuncEventInitEvent1( 1236 this.ref, js.Pointer(&fn), 1237 ) 1238 return 1239 } 1240 1241 // InitEvent1 calls the method "Event.initEvent". 1242 func (this Event) InitEvent1(typ js.String, bubbles bool) (ret js.Void) { 1243 bindings.CallEventInitEvent1( 1244 this.ref, js.Pointer(&ret), 1245 typ.Ref(), 1246 js.Bool(bool(bubbles)), 1247 ) 1248 1249 return 1250 } 1251 1252 // TryInitEvent1 calls the method "Event.initEvent" 1253 // in a try/catch block and returns (_, err, ok = false) when it went through 1254 // the catch clause. 1255 func (this Event) TryInitEvent1(typ js.String, bubbles bool) (ret js.Void, exception js.Any, ok bool) { 1256 ok = js.True == bindings.TryEventInitEvent1( 1257 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1258 typ.Ref(), 1259 js.Bool(bool(bubbles)), 1260 ) 1261 1262 return 1263 } 1264 1265 // HasFuncInitEvent2 returns true if the method "Event.initEvent" exists. 1266 func (this Event) HasFuncInitEvent2() bool { 1267 return js.True == bindings.HasFuncEventInitEvent2( 1268 this.ref, 1269 ) 1270 } 1271 1272 // FuncInitEvent2 returns the method "Event.initEvent". 1273 func (this Event) FuncInitEvent2() (fn js.Func[func(typ js.String)]) { 1274 bindings.FuncEventInitEvent2( 1275 this.ref, js.Pointer(&fn), 1276 ) 1277 return 1278 } 1279 1280 // InitEvent2 calls the method "Event.initEvent". 1281 func (this Event) InitEvent2(typ js.String) (ret js.Void) { 1282 bindings.CallEventInitEvent2( 1283 this.ref, js.Pointer(&ret), 1284 typ.Ref(), 1285 ) 1286 1287 return 1288 } 1289 1290 // TryInitEvent2 calls the method "Event.initEvent" 1291 // in a try/catch block and returns (_, err, ok = false) when it went through 1292 // the catch clause. 1293 func (this Event) TryInitEvent2(typ js.String) (ret js.Void, exception js.Any, ok bool) { 1294 ok = js.True == bindings.TryEventInitEvent2( 1295 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1296 typ.Ref(), 1297 ) 1298 1299 return 1300 } 1301 1302 type EventHandler = js.Func[func(event Event) js.Any] 1303 1304 type AbortSignal struct { 1305 EventTarget 1306 } 1307 1308 func (this AbortSignal) Once() AbortSignal { 1309 this.ref.Once() 1310 return this 1311 } 1312 1313 func (this AbortSignal) Ref() js.Ref { 1314 return this.EventTarget.Ref() 1315 } 1316 1317 func (this AbortSignal) FromRef(ref js.Ref) AbortSignal { 1318 this.EventTarget = this.EventTarget.FromRef(ref) 1319 return this 1320 } 1321 1322 func (this AbortSignal) Free() { 1323 this.ref.Free() 1324 } 1325 1326 // Aborted returns the value of property "AbortSignal.aborted". 1327 // 1328 // It returns ok=false if there is no such property. 1329 func (this AbortSignal) Aborted() (ret bool, ok bool) { 1330 ok = js.True == bindings.GetAbortSignalAborted( 1331 this.ref, js.Pointer(&ret), 1332 ) 1333 return 1334 } 1335 1336 // Reason returns the value of property "AbortSignal.reason". 1337 // 1338 // It returns ok=false if there is no such property. 1339 func (this AbortSignal) Reason() (ret js.Any, ok bool) { 1340 ok = js.True == bindings.GetAbortSignalReason( 1341 this.ref, js.Pointer(&ret), 1342 ) 1343 return 1344 } 1345 1346 // HasFuncAbort returns true if the static method "AbortSignal.abort" exists. 1347 func (this AbortSignal) HasFuncAbort() bool { 1348 return js.True == bindings.HasFuncAbortSignalAbort( 1349 this.ref, 1350 ) 1351 } 1352 1353 // FuncAbort returns the static method "AbortSignal.abort". 1354 func (this AbortSignal) FuncAbort() (fn js.Func[func(reason js.Any) AbortSignal]) { 1355 bindings.FuncAbortSignalAbort( 1356 this.ref, js.Pointer(&fn), 1357 ) 1358 return 1359 } 1360 1361 // Abort calls the static method "AbortSignal.abort". 1362 func (this AbortSignal) Abort(reason js.Any) (ret AbortSignal) { 1363 bindings.CallAbortSignalAbort( 1364 this.ref, js.Pointer(&ret), 1365 reason.Ref(), 1366 ) 1367 1368 return 1369 } 1370 1371 // TryAbort calls the static method "AbortSignal.abort" 1372 // in a try/catch block and returns (_, err, ok = false) when it went through 1373 // the catch clause. 1374 func (this AbortSignal) TryAbort(reason js.Any) (ret AbortSignal, exception js.Any, ok bool) { 1375 ok = js.True == bindings.TryAbortSignalAbort( 1376 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1377 reason.Ref(), 1378 ) 1379 1380 return 1381 } 1382 1383 // HasFuncAbort1 returns true if the static method "AbortSignal.abort" exists. 1384 func (this AbortSignal) HasFuncAbort1() bool { 1385 return js.True == bindings.HasFuncAbortSignalAbort1( 1386 this.ref, 1387 ) 1388 } 1389 1390 // FuncAbort1 returns the static method "AbortSignal.abort". 1391 func (this AbortSignal) FuncAbort1() (fn js.Func[func() AbortSignal]) { 1392 bindings.FuncAbortSignalAbort1( 1393 this.ref, js.Pointer(&fn), 1394 ) 1395 return 1396 } 1397 1398 // Abort1 calls the static method "AbortSignal.abort". 1399 func (this AbortSignal) Abort1() (ret AbortSignal) { 1400 bindings.CallAbortSignalAbort1( 1401 this.ref, js.Pointer(&ret), 1402 ) 1403 1404 return 1405 } 1406 1407 // TryAbort1 calls the static method "AbortSignal.abort" 1408 // in a try/catch block and returns (_, err, ok = false) when it went through 1409 // the catch clause. 1410 func (this AbortSignal) TryAbort1() (ret AbortSignal, exception js.Any, ok bool) { 1411 ok = js.True == bindings.TryAbortSignalAbort1( 1412 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1413 ) 1414 1415 return 1416 } 1417 1418 // HasFuncTimeout returns true if the static method "AbortSignal.timeout" exists. 1419 func (this AbortSignal) HasFuncTimeout() bool { 1420 return js.True == bindings.HasFuncAbortSignalTimeout( 1421 this.ref, 1422 ) 1423 } 1424 1425 // FuncTimeout returns the static method "AbortSignal.timeout". 1426 func (this AbortSignal) FuncTimeout() (fn js.Func[func(milliseconds uint64) AbortSignal]) { 1427 bindings.FuncAbortSignalTimeout( 1428 this.ref, js.Pointer(&fn), 1429 ) 1430 return 1431 } 1432 1433 // Timeout calls the static method "AbortSignal.timeout". 1434 func (this AbortSignal) Timeout(milliseconds uint64) (ret AbortSignal) { 1435 bindings.CallAbortSignalTimeout( 1436 this.ref, js.Pointer(&ret), 1437 float64(milliseconds), 1438 ) 1439 1440 return 1441 } 1442 1443 // TryTimeout calls the static method "AbortSignal.timeout" 1444 // in a try/catch block and returns (_, err, ok = false) when it went through 1445 // the catch clause. 1446 func (this AbortSignal) TryTimeout(milliseconds uint64) (ret AbortSignal, exception js.Any, ok bool) { 1447 ok = js.True == bindings.TryAbortSignalTimeout( 1448 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1449 float64(milliseconds), 1450 ) 1451 1452 return 1453 } 1454 1455 // HasFuncAny returns true if the static method "AbortSignal.any" exists. 1456 func (this AbortSignal) HasFuncAny() bool { 1457 return js.True == bindings.HasFuncAbortSignalAny( 1458 this.ref, 1459 ) 1460 } 1461 1462 // FuncAny returns the static method "AbortSignal.any". 1463 func (this AbortSignal) FuncAny() (fn js.Func[func(signals js.Array[AbortSignal]) AbortSignal]) { 1464 bindings.FuncAbortSignalAny( 1465 this.ref, js.Pointer(&fn), 1466 ) 1467 return 1468 } 1469 1470 // Any calls the static method "AbortSignal.any". 1471 func (this AbortSignal) Any(signals js.Array[AbortSignal]) (ret AbortSignal) { 1472 bindings.CallAbortSignalAny( 1473 this.ref, js.Pointer(&ret), 1474 signals.Ref(), 1475 ) 1476 1477 return 1478 } 1479 1480 // TryAny calls the static method "AbortSignal.any" 1481 // in a try/catch block and returns (_, err, ok = false) when it went through 1482 // the catch clause. 1483 func (this AbortSignal) TryAny(signals js.Array[AbortSignal]) (ret AbortSignal, exception js.Any, ok bool) { 1484 ok = js.True == bindings.TryAbortSignalAny( 1485 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1486 signals.Ref(), 1487 ) 1488 1489 return 1490 } 1491 1492 // HasFuncThrowIfAborted returns true if the method "AbortSignal.throwIfAborted" exists. 1493 func (this AbortSignal) HasFuncThrowIfAborted() bool { 1494 return js.True == bindings.HasFuncAbortSignalThrowIfAborted( 1495 this.ref, 1496 ) 1497 } 1498 1499 // FuncThrowIfAborted returns the method "AbortSignal.throwIfAborted". 1500 func (this AbortSignal) FuncThrowIfAborted() (fn js.Func[func()]) { 1501 bindings.FuncAbortSignalThrowIfAborted( 1502 this.ref, js.Pointer(&fn), 1503 ) 1504 return 1505 } 1506 1507 // ThrowIfAborted calls the method "AbortSignal.throwIfAborted". 1508 func (this AbortSignal) ThrowIfAborted() (ret js.Void) { 1509 bindings.CallAbortSignalThrowIfAborted( 1510 this.ref, js.Pointer(&ret), 1511 ) 1512 1513 return 1514 } 1515 1516 // TryThrowIfAborted calls the method "AbortSignal.throwIfAborted" 1517 // in a try/catch block and returns (_, err, ok = false) when it went through 1518 // the catch clause. 1519 func (this AbortSignal) TryThrowIfAborted() (ret js.Void, exception js.Any, ok bool) { 1520 ok = js.True == bindings.TryAbortSignalThrowIfAborted( 1521 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1522 ) 1523 1524 return 1525 } 1526 1527 type AbortController struct { 1528 ref js.Ref 1529 } 1530 1531 func (this AbortController) Once() AbortController { 1532 this.ref.Once() 1533 return this 1534 } 1535 1536 func (this AbortController) Ref() js.Ref { 1537 return this.ref 1538 } 1539 1540 func (this AbortController) FromRef(ref js.Ref) AbortController { 1541 this.ref = ref 1542 return this 1543 } 1544 1545 func (this AbortController) Free() { 1546 this.ref.Free() 1547 } 1548 1549 // Signal returns the value of property "AbortController.signal". 1550 // 1551 // It returns ok=false if there is no such property. 1552 func (this AbortController) Signal() (ret AbortSignal, ok bool) { 1553 ok = js.True == bindings.GetAbortControllerSignal( 1554 this.ref, js.Pointer(&ret), 1555 ) 1556 return 1557 } 1558 1559 // HasFuncAbort returns true if the method "AbortController.abort" exists. 1560 func (this AbortController) HasFuncAbort() bool { 1561 return js.True == bindings.HasFuncAbortControllerAbort( 1562 this.ref, 1563 ) 1564 } 1565 1566 // FuncAbort returns the method "AbortController.abort". 1567 func (this AbortController) FuncAbort() (fn js.Func[func(reason js.Any)]) { 1568 bindings.FuncAbortControllerAbort( 1569 this.ref, js.Pointer(&fn), 1570 ) 1571 return 1572 } 1573 1574 // Abort calls the method "AbortController.abort". 1575 func (this AbortController) Abort(reason js.Any) (ret js.Void) { 1576 bindings.CallAbortControllerAbort( 1577 this.ref, js.Pointer(&ret), 1578 reason.Ref(), 1579 ) 1580 1581 return 1582 } 1583 1584 // TryAbort calls the method "AbortController.abort" 1585 // in a try/catch block and returns (_, err, ok = false) when it went through 1586 // the catch clause. 1587 func (this AbortController) TryAbort(reason js.Any) (ret js.Void, exception js.Any, ok bool) { 1588 ok = js.True == bindings.TryAbortControllerAbort( 1589 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1590 reason.Ref(), 1591 ) 1592 1593 return 1594 } 1595 1596 // HasFuncAbort1 returns true if the method "AbortController.abort" exists. 1597 func (this AbortController) HasFuncAbort1() bool { 1598 return js.True == bindings.HasFuncAbortControllerAbort1( 1599 this.ref, 1600 ) 1601 } 1602 1603 // FuncAbort1 returns the method "AbortController.abort". 1604 func (this AbortController) FuncAbort1() (fn js.Func[func()]) { 1605 bindings.FuncAbortControllerAbort1( 1606 this.ref, js.Pointer(&fn), 1607 ) 1608 return 1609 } 1610 1611 // Abort1 calls the method "AbortController.abort". 1612 func (this AbortController) Abort1() (ret js.Void) { 1613 bindings.CallAbortControllerAbort1( 1614 this.ref, js.Pointer(&ret), 1615 ) 1616 1617 return 1618 } 1619 1620 // TryAbort1 calls the method "AbortController.abort" 1621 // in a try/catch block and returns (_, err, ok = false) when it went through 1622 // the catch clause. 1623 func (this AbortController) TryAbort1() (ret js.Void, exception js.Any, ok bool) { 1624 ok = js.True == bindings.TryAbortControllerAbort1( 1625 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1626 ) 1627 1628 return 1629 } 1630 1631 type AbsoluteOrientationReadingValues struct { 1632 // Quaternion is "AbsoluteOrientationReadingValues.quaternion" 1633 // 1634 // Required 1635 Quaternion js.FrozenArray[float64] 1636 1637 FFI_USE bool 1638 } 1639 1640 // FromRef calls UpdateFrom and returns a AbsoluteOrientationReadingValues with all fields set. 1641 func (p AbsoluteOrientationReadingValues) FromRef(ref js.Ref) AbsoluteOrientationReadingValues { 1642 p.UpdateFrom(ref) 1643 return p 1644 } 1645 1646 // New creates a new AbsoluteOrientationReadingValues in the application heap. 1647 func (p AbsoluteOrientationReadingValues) New() js.Ref { 1648 return bindings.AbsoluteOrientationReadingValuesJSLoad( 1649 js.Pointer(&p), js.True, 0, 1650 ) 1651 } 1652 1653 // UpdateFrom copies value of all fields of the heap object to p. 1654 func (p *AbsoluteOrientationReadingValues) UpdateFrom(ref js.Ref) { 1655 bindings.AbsoluteOrientationReadingValuesJSStore( 1656 js.Pointer(p), ref, 1657 ) 1658 } 1659 1660 // Update writes all fields of the p to the heap object referenced by ref. 1661 func (p *AbsoluteOrientationReadingValues) Update(ref js.Ref) { 1662 bindings.AbsoluteOrientationReadingValuesJSLoad( 1663 js.Pointer(p), js.False, ref, 1664 ) 1665 } 1666 1667 // FreeMembers frees fields with heap reference, if recursive is true 1668 // free all heap references reachable from p. 1669 func (p *AbsoluteOrientationReadingValues) FreeMembers(recursive bool) { 1670 js.Free( 1671 p.Quaternion.Ref(), 1672 ) 1673 p.Quaternion = p.Quaternion.FromRef(js.Undefined) 1674 } 1675 1676 type OrientationSensorLocalCoordinateSystem uint32 1677 1678 const ( 1679 _ OrientationSensorLocalCoordinateSystem = iota 1680 1681 OrientationSensorLocalCoordinateSystem_DEVICE 1682 OrientationSensorLocalCoordinateSystem_SCREEN 1683 ) 1684 1685 func (OrientationSensorLocalCoordinateSystem) FromRef(str js.Ref) OrientationSensorLocalCoordinateSystem { 1686 return OrientationSensorLocalCoordinateSystem(bindings.ConstOfOrientationSensorLocalCoordinateSystem(str)) 1687 } 1688 1689 func (x OrientationSensorLocalCoordinateSystem) String() (string, bool) { 1690 switch x { 1691 case OrientationSensorLocalCoordinateSystem_DEVICE: 1692 return "device", true 1693 case OrientationSensorLocalCoordinateSystem_SCREEN: 1694 return "screen", true 1695 default: 1696 return "", false 1697 } 1698 } 1699 1700 type OrientationSensorOptions struct { 1701 // ReferenceFrame is "OrientationSensorOptions.referenceFrame" 1702 // 1703 // Optional, defaults to "device". 1704 ReferenceFrame OrientationSensorLocalCoordinateSystem 1705 // Frequency is "OrientationSensorOptions.frequency" 1706 // 1707 // Optional 1708 // 1709 // NOTE: FFI_USE_Frequency MUST be set to true to make this field effective. 1710 Frequency float64 1711 1712 FFI_USE_Frequency bool // for Frequency. 1713 1714 FFI_USE bool 1715 } 1716 1717 // FromRef calls UpdateFrom and returns a OrientationSensorOptions with all fields set. 1718 func (p OrientationSensorOptions) FromRef(ref js.Ref) OrientationSensorOptions { 1719 p.UpdateFrom(ref) 1720 return p 1721 } 1722 1723 // New creates a new OrientationSensorOptions in the application heap. 1724 func (p OrientationSensorOptions) New() js.Ref { 1725 return bindings.OrientationSensorOptionsJSLoad( 1726 js.Pointer(&p), js.True, 0, 1727 ) 1728 } 1729 1730 // UpdateFrom copies value of all fields of the heap object to p. 1731 func (p *OrientationSensorOptions) UpdateFrom(ref js.Ref) { 1732 bindings.OrientationSensorOptionsJSStore( 1733 js.Pointer(p), ref, 1734 ) 1735 } 1736 1737 // Update writes all fields of the p to the heap object referenced by ref. 1738 func (p *OrientationSensorOptions) Update(ref js.Ref) { 1739 bindings.OrientationSensorOptionsJSLoad( 1740 js.Pointer(p), js.False, ref, 1741 ) 1742 } 1743 1744 // FreeMembers frees fields with heap reference, if recursive is true 1745 // free all heap references reachable from p. 1746 func (p *OrientationSensorOptions) FreeMembers(recursive bool) { 1747 } 1748 1749 func NewAbsoluteOrientationSensor(sensorOptions OrientationSensorOptions) (ret AbsoluteOrientationSensor) { 1750 ret.ref = bindings.NewAbsoluteOrientationSensorByAbsoluteOrientationSensor( 1751 js.Pointer(&sensorOptions)) 1752 return 1753 } 1754 1755 func NewAbsoluteOrientationSensorByAbsoluteOrientationSensor1() (ret AbsoluteOrientationSensor) { 1756 ret.ref = bindings.NewAbsoluteOrientationSensorByAbsoluteOrientationSensor1() 1757 return 1758 } 1759 1760 type AbsoluteOrientationSensor struct { 1761 OrientationSensor 1762 } 1763 1764 func (this AbsoluteOrientationSensor) Once() AbsoluteOrientationSensor { 1765 this.ref.Once() 1766 return this 1767 } 1768 1769 func (this AbsoluteOrientationSensor) Ref() js.Ref { 1770 return this.OrientationSensor.Ref() 1771 } 1772 1773 func (this AbsoluteOrientationSensor) FromRef(ref js.Ref) AbsoluteOrientationSensor { 1774 this.OrientationSensor = this.OrientationSensor.FromRef(ref) 1775 return this 1776 } 1777 1778 func (this AbsoluteOrientationSensor) Free() { 1779 this.ref.Free() 1780 } 1781 1782 const ( 1783 Node_ELEMENT_NODE uint16 = 1 1784 Node_ATTRIBUTE_NODE uint16 = 2 1785 Node_TEXT_NODE uint16 = 3 1786 Node_CDATA_SECTION_NODE uint16 = 4 1787 Node_ENTITY_REFERENCE_NODE uint16 = 5 1788 Node_ENTITY_NODE uint16 = 6 1789 Node_PROCESSING_INSTRUCTION_NODE uint16 = 7 1790 Node_COMMENT_NODE uint16 = 8 1791 Node_DOCUMENT_NODE uint16 = 9 1792 Node_DOCUMENT_TYPE_NODE uint16 = 10 1793 Node_DOCUMENT_FRAGMENT_NODE uint16 = 11 1794 Node_NOTATION_NODE uint16 = 12 1795 Node_DOCUMENT_POSITION_DISCONNECTED uint16 = 0x01 1796 Node_DOCUMENT_POSITION_PRECEDING uint16 = 0x02 1797 Node_DOCUMENT_POSITION_FOLLOWING uint16 = 0x04 1798 Node_DOCUMENT_POSITION_CONTAINS uint16 = 0x08 1799 Node_DOCUMENT_POSITION_CONTAINED_BY uint16 = 0x10 1800 Node_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC uint16 = 0x20 1801 ) 1802 1803 type GetRootNodeOptions struct { 1804 // Composed is "GetRootNodeOptions.composed" 1805 // 1806 // Optional, defaults to false. 1807 // 1808 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 1809 Composed bool 1810 1811 FFI_USE_Composed bool // for Composed. 1812 1813 FFI_USE bool 1814 } 1815 1816 // FromRef calls UpdateFrom and returns a GetRootNodeOptions with all fields set. 1817 func (p GetRootNodeOptions) FromRef(ref js.Ref) GetRootNodeOptions { 1818 p.UpdateFrom(ref) 1819 return p 1820 } 1821 1822 // New creates a new GetRootNodeOptions in the application heap. 1823 func (p GetRootNodeOptions) New() js.Ref { 1824 return bindings.GetRootNodeOptionsJSLoad( 1825 js.Pointer(&p), js.True, 0, 1826 ) 1827 } 1828 1829 // UpdateFrom copies value of all fields of the heap object to p. 1830 func (p *GetRootNodeOptions) UpdateFrom(ref js.Ref) { 1831 bindings.GetRootNodeOptionsJSStore( 1832 js.Pointer(p), ref, 1833 ) 1834 } 1835 1836 // Update writes all fields of the p to the heap object referenced by ref. 1837 func (p *GetRootNodeOptions) Update(ref js.Ref) { 1838 bindings.GetRootNodeOptionsJSLoad( 1839 js.Pointer(p), js.False, ref, 1840 ) 1841 } 1842 1843 // FreeMembers frees fields with heap reference, if recursive is true 1844 // free all heap references reachable from p. 1845 func (p *GetRootNodeOptions) FreeMembers(recursive bool) { 1846 } 1847 1848 type Attr struct { 1849 Node 1850 } 1851 1852 func (this Attr) Once() Attr { 1853 this.ref.Once() 1854 return this 1855 } 1856 1857 func (this Attr) Ref() js.Ref { 1858 return this.Node.Ref() 1859 } 1860 1861 func (this Attr) FromRef(ref js.Ref) Attr { 1862 this.Node = this.Node.FromRef(ref) 1863 return this 1864 } 1865 1866 func (this Attr) Free() { 1867 this.ref.Free() 1868 } 1869 1870 // NamespaceURI returns the value of property "Attr.namespaceURI". 1871 // 1872 // It returns ok=false if there is no such property. 1873 func (this Attr) NamespaceURI() (ret js.String, ok bool) { 1874 ok = js.True == bindings.GetAttrNamespaceURI( 1875 this.ref, js.Pointer(&ret), 1876 ) 1877 return 1878 } 1879 1880 // Prefix returns the value of property "Attr.prefix". 1881 // 1882 // It returns ok=false if there is no such property. 1883 func (this Attr) Prefix() (ret js.String, ok bool) { 1884 ok = js.True == bindings.GetAttrPrefix( 1885 this.ref, js.Pointer(&ret), 1886 ) 1887 return 1888 } 1889 1890 // LocalName returns the value of property "Attr.localName". 1891 // 1892 // It returns ok=false if there is no such property. 1893 func (this Attr) LocalName() (ret js.String, ok bool) { 1894 ok = js.True == bindings.GetAttrLocalName( 1895 this.ref, js.Pointer(&ret), 1896 ) 1897 return 1898 } 1899 1900 // Name returns the value of property "Attr.name". 1901 // 1902 // It returns ok=false if there is no such property. 1903 func (this Attr) Name() (ret js.String, ok bool) { 1904 ok = js.True == bindings.GetAttrName( 1905 this.ref, js.Pointer(&ret), 1906 ) 1907 return 1908 } 1909 1910 // Value returns the value of property "Attr.value". 1911 // 1912 // It returns ok=false if there is no such property. 1913 func (this Attr) Value() (ret js.String, ok bool) { 1914 ok = js.True == bindings.GetAttrValue( 1915 this.ref, js.Pointer(&ret), 1916 ) 1917 return 1918 } 1919 1920 // SetValue sets the value of property "Attr.value" to val. 1921 // 1922 // It returns false if the property cannot be set. 1923 func (this Attr) SetValue(val js.String) bool { 1924 return js.True == bindings.SetAttrValue( 1925 this.ref, 1926 val.Ref(), 1927 ) 1928 } 1929 1930 // OwnerElement returns the value of property "Attr.ownerElement". 1931 // 1932 // It returns ok=false if there is no such property. 1933 func (this Attr) OwnerElement() (ret Element, ok bool) { 1934 ok = js.True == bindings.GetAttrOwnerElement( 1935 this.ref, js.Pointer(&ret), 1936 ) 1937 return 1938 } 1939 1940 // Specified returns the value of property "Attr.specified". 1941 // 1942 // It returns ok=false if there is no such property. 1943 func (this Attr) Specified() (ret bool, ok bool) { 1944 ok = js.True == bindings.GetAttrSpecified( 1945 this.ref, js.Pointer(&ret), 1946 ) 1947 return 1948 } 1949 1950 type FillMode uint32 1951 1952 const ( 1953 _ FillMode = iota 1954 1955 FillMode_NONE 1956 FillMode_FORWARDS 1957 FillMode_BACKWARDS 1958 FillMode_BOTH 1959 FillMode_AUTO 1960 ) 1961 1962 func (FillMode) FromRef(str js.Ref) FillMode { 1963 return FillMode(bindings.ConstOfFillMode(str)) 1964 } 1965 1966 func (x FillMode) String() (string, bool) { 1967 switch x { 1968 case FillMode_NONE: 1969 return "none", true 1970 case FillMode_FORWARDS: 1971 return "forwards", true 1972 case FillMode_BACKWARDS: 1973 return "backwards", true 1974 case FillMode_BOTH: 1975 return "both", true 1976 case FillMode_AUTO: 1977 return "auto", true 1978 default: 1979 return "", false 1980 } 1981 } 1982 1983 type PlaybackDirection uint32 1984 1985 const ( 1986 _ PlaybackDirection = iota 1987 1988 PlaybackDirection_NORMAL 1989 PlaybackDirection_REVERSE 1990 PlaybackDirection_ALTERNATE 1991 PlaybackDirection_ALTERNATE_REVERSE 1992 ) 1993 1994 func (PlaybackDirection) FromRef(str js.Ref) PlaybackDirection { 1995 return PlaybackDirection(bindings.ConstOfPlaybackDirection(str)) 1996 } 1997 1998 func (x PlaybackDirection) String() (string, bool) { 1999 switch x { 2000 case PlaybackDirection_NORMAL: 2001 return "normal", true 2002 case PlaybackDirection_REVERSE: 2003 return "reverse", true 2004 case PlaybackDirection_ALTERNATE: 2005 return "alternate", true 2006 case PlaybackDirection_ALTERNATE_REVERSE: 2007 return "alternate-reverse", true 2008 default: 2009 return "", false 2010 } 2011 } 2012 2013 type OneOf_Float64_CSSNumericValue struct { 2014 ref js.Ref 2015 } 2016 2017 func (x OneOf_Float64_CSSNumericValue) Ref() js.Ref { 2018 return x.ref 2019 } 2020 2021 func (x OneOf_Float64_CSSNumericValue) Free() { 2022 x.ref.Free() 2023 } 2024 2025 func (x OneOf_Float64_CSSNumericValue) FromRef(ref js.Ref) OneOf_Float64_CSSNumericValue { 2026 return OneOf_Float64_CSSNumericValue{ 2027 ref: ref, 2028 } 2029 } 2030 2031 func (x OneOf_Float64_CSSNumericValue) Float64() float64 { 2032 return js.Number[float64]{}.FromRef(x.ref).Get() 2033 } 2034 2035 func (x OneOf_Float64_CSSNumericValue) CSSNumericValue() CSSNumericValue { 2036 return CSSNumericValue{}.FromRef(x.ref) 2037 } 2038 2039 type CSSNumberish = OneOf_Float64_CSSNumericValue 2040 2041 func NewCSSUnitValue(value float64, unit js.String) (ret CSSUnitValue) { 2042 ret.ref = bindings.NewCSSUnitValueByCSSUnitValue( 2043 float64(value), 2044 unit.Ref()) 2045 return 2046 } 2047 2048 type CSSUnitValue struct { 2049 CSSNumericValue 2050 } 2051 2052 func (this CSSUnitValue) Once() CSSUnitValue { 2053 this.ref.Once() 2054 return this 2055 } 2056 2057 func (this CSSUnitValue) Ref() js.Ref { 2058 return this.CSSNumericValue.Ref() 2059 } 2060 2061 func (this CSSUnitValue) FromRef(ref js.Ref) CSSUnitValue { 2062 this.CSSNumericValue = this.CSSNumericValue.FromRef(ref) 2063 return this 2064 } 2065 2066 func (this CSSUnitValue) Free() { 2067 this.ref.Free() 2068 } 2069 2070 // Value returns the value of property "CSSUnitValue.value". 2071 // 2072 // It returns ok=false if there is no such property. 2073 func (this CSSUnitValue) Value() (ret float64, ok bool) { 2074 ok = js.True == bindings.GetCSSUnitValueValue( 2075 this.ref, js.Pointer(&ret), 2076 ) 2077 return 2078 } 2079 2080 // SetValue sets the value of property "CSSUnitValue.value" to val. 2081 // 2082 // It returns false if the property cannot be set. 2083 func (this CSSUnitValue) SetValue(val float64) bool { 2084 return js.True == bindings.SetCSSUnitValueValue( 2085 this.ref, 2086 float64(val), 2087 ) 2088 } 2089 2090 // Unit returns the value of property "CSSUnitValue.unit". 2091 // 2092 // It returns ok=false if there is no such property. 2093 func (this CSSUnitValue) Unit() (ret js.String, ok bool) { 2094 ok = js.True == bindings.GetCSSUnitValueUnit( 2095 this.ref, js.Pointer(&ret), 2096 ) 2097 return 2098 } 2099 2100 type CSSNumericArray struct { 2101 ref js.Ref 2102 } 2103 2104 func (this CSSNumericArray) Once() CSSNumericArray { 2105 this.ref.Once() 2106 return this 2107 } 2108 2109 func (this CSSNumericArray) Ref() js.Ref { 2110 return this.ref 2111 } 2112 2113 func (this CSSNumericArray) FromRef(ref js.Ref) CSSNumericArray { 2114 this.ref = ref 2115 return this 2116 } 2117 2118 func (this CSSNumericArray) Free() { 2119 this.ref.Free() 2120 } 2121 2122 // Length returns the value of property "CSSNumericArray.length". 2123 // 2124 // It returns ok=false if there is no such property. 2125 func (this CSSNumericArray) Length() (ret uint32, ok bool) { 2126 ok = js.True == bindings.GetCSSNumericArrayLength( 2127 this.ref, js.Pointer(&ret), 2128 ) 2129 return 2130 } 2131 2132 // HasFuncGet returns true if the method "CSSNumericArray." exists. 2133 func (this CSSNumericArray) HasFuncGet() bool { 2134 return js.True == bindings.HasFuncCSSNumericArrayGet( 2135 this.ref, 2136 ) 2137 } 2138 2139 // FuncGet returns the method "CSSNumericArray.". 2140 func (this CSSNumericArray) FuncGet() (fn js.Func[func(index uint32) CSSNumericValue]) { 2141 bindings.FuncCSSNumericArrayGet( 2142 this.ref, js.Pointer(&fn), 2143 ) 2144 return 2145 } 2146 2147 // Get calls the method "CSSNumericArray.". 2148 func (this CSSNumericArray) Get(index uint32) (ret CSSNumericValue) { 2149 bindings.CallCSSNumericArrayGet( 2150 this.ref, js.Pointer(&ret), 2151 uint32(index), 2152 ) 2153 2154 return 2155 } 2156 2157 // TryGet calls the method "CSSNumericArray." 2158 // in a try/catch block and returns (_, err, ok = false) when it went through 2159 // the catch clause. 2160 func (this CSSNumericArray) TryGet(index uint32) (ret CSSNumericValue, exception js.Any, ok bool) { 2161 ok = js.True == bindings.TryCSSNumericArrayGet( 2162 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2163 uint32(index), 2164 ) 2165 2166 return 2167 } 2168 2169 func NewCSSMathSum(args ...CSSNumberish) (ret CSSMathSum) { 2170 ret.ref = bindings.NewCSSMathSumByCSSMathSum( 2171 js.SliceData(args), 2172 js.SizeU(len(args))) 2173 return 2174 } 2175 2176 type CSSMathSum struct { 2177 CSSMathValue 2178 } 2179 2180 func (this CSSMathSum) Once() CSSMathSum { 2181 this.ref.Once() 2182 return this 2183 } 2184 2185 func (this CSSMathSum) Ref() js.Ref { 2186 return this.CSSMathValue.Ref() 2187 } 2188 2189 func (this CSSMathSum) FromRef(ref js.Ref) CSSMathSum { 2190 this.CSSMathValue = this.CSSMathValue.FromRef(ref) 2191 return this 2192 } 2193 2194 func (this CSSMathSum) Free() { 2195 this.ref.Free() 2196 } 2197 2198 // Values returns the value of property "CSSMathSum.values". 2199 // 2200 // It returns ok=false if there is no such property. 2201 func (this CSSMathSum) Values() (ret CSSNumericArray, ok bool) { 2202 ok = js.True == bindings.GetCSSMathSumValues( 2203 this.ref, js.Pointer(&ret), 2204 ) 2205 return 2206 } 2207 2208 type CSSNumericBaseType uint32 2209 2210 const ( 2211 _ CSSNumericBaseType = iota 2212 2213 CSSNumericBaseType_LENGTH 2214 CSSNumericBaseType_ANGLE 2215 CSSNumericBaseType_TIME 2216 CSSNumericBaseType_FREQUENCY 2217 CSSNumericBaseType_RESOLUTION 2218 CSSNumericBaseType_FLEX 2219 CSSNumericBaseType_PERCENT 2220 ) 2221 2222 func (CSSNumericBaseType) FromRef(str js.Ref) CSSNumericBaseType { 2223 return CSSNumericBaseType(bindings.ConstOfCSSNumericBaseType(str)) 2224 } 2225 2226 func (x CSSNumericBaseType) String() (string, bool) { 2227 switch x { 2228 case CSSNumericBaseType_LENGTH: 2229 return "length", true 2230 case CSSNumericBaseType_ANGLE: 2231 return "angle", true 2232 case CSSNumericBaseType_TIME: 2233 return "time", true 2234 case CSSNumericBaseType_FREQUENCY: 2235 return "frequency", true 2236 case CSSNumericBaseType_RESOLUTION: 2237 return "resolution", true 2238 case CSSNumericBaseType_FLEX: 2239 return "flex", true 2240 case CSSNumericBaseType_PERCENT: 2241 return "percent", true 2242 default: 2243 return "", false 2244 } 2245 } 2246 2247 type CSSNumericType struct { 2248 // Length is "CSSNumericType.length" 2249 // 2250 // Optional 2251 // 2252 // NOTE: FFI_USE_Length MUST be set to true to make this field effective. 2253 Length int32 2254 // Angle is "CSSNumericType.angle" 2255 // 2256 // Optional 2257 // 2258 // NOTE: FFI_USE_Angle MUST be set to true to make this field effective. 2259 Angle int32 2260 // Time is "CSSNumericType.time" 2261 // 2262 // Optional 2263 // 2264 // NOTE: FFI_USE_Time MUST be set to true to make this field effective. 2265 Time int32 2266 // Frequency is "CSSNumericType.frequency" 2267 // 2268 // Optional 2269 // 2270 // NOTE: FFI_USE_Frequency MUST be set to true to make this field effective. 2271 Frequency int32 2272 // Resolution is "CSSNumericType.resolution" 2273 // 2274 // Optional 2275 // 2276 // NOTE: FFI_USE_Resolution MUST be set to true to make this field effective. 2277 Resolution int32 2278 // Flex is "CSSNumericType.flex" 2279 // 2280 // Optional 2281 // 2282 // NOTE: FFI_USE_Flex MUST be set to true to make this field effective. 2283 Flex int32 2284 // Percent is "CSSNumericType.percent" 2285 // 2286 // Optional 2287 // 2288 // NOTE: FFI_USE_Percent MUST be set to true to make this field effective. 2289 Percent int32 2290 // PercentHint is "CSSNumericType.percentHint" 2291 // 2292 // Optional 2293 PercentHint CSSNumericBaseType 2294 2295 FFI_USE_Length bool // for Length. 2296 FFI_USE_Angle bool // for Angle. 2297 FFI_USE_Time bool // for Time. 2298 FFI_USE_Frequency bool // for Frequency. 2299 FFI_USE_Resolution bool // for Resolution. 2300 FFI_USE_Flex bool // for Flex. 2301 FFI_USE_Percent bool // for Percent. 2302 2303 FFI_USE bool 2304 } 2305 2306 // FromRef calls UpdateFrom and returns a CSSNumericType with all fields set. 2307 func (p CSSNumericType) FromRef(ref js.Ref) CSSNumericType { 2308 p.UpdateFrom(ref) 2309 return p 2310 } 2311 2312 // New creates a new CSSNumericType in the application heap. 2313 func (p CSSNumericType) New() js.Ref { 2314 return bindings.CSSNumericTypeJSLoad( 2315 js.Pointer(&p), js.True, 0, 2316 ) 2317 } 2318 2319 // UpdateFrom copies value of all fields of the heap object to p. 2320 func (p *CSSNumericType) UpdateFrom(ref js.Ref) { 2321 bindings.CSSNumericTypeJSStore( 2322 js.Pointer(p), ref, 2323 ) 2324 } 2325 2326 // Update writes all fields of the p to the heap object referenced by ref. 2327 func (p *CSSNumericType) Update(ref js.Ref) { 2328 bindings.CSSNumericTypeJSLoad( 2329 js.Pointer(p), js.False, ref, 2330 ) 2331 } 2332 2333 // FreeMembers frees fields with heap reference, if recursive is true 2334 // free all heap references reachable from p. 2335 func (p *CSSNumericType) FreeMembers(recursive bool) { 2336 } 2337 2338 type CSSNumericValue struct { 2339 CSSStyleValue 2340 } 2341 2342 func (this CSSNumericValue) Once() CSSNumericValue { 2343 this.ref.Once() 2344 return this 2345 } 2346 2347 func (this CSSNumericValue) Ref() js.Ref { 2348 return this.CSSStyleValue.Ref() 2349 } 2350 2351 func (this CSSNumericValue) FromRef(ref js.Ref) CSSNumericValue { 2352 this.CSSStyleValue = this.CSSStyleValue.FromRef(ref) 2353 return this 2354 } 2355 2356 func (this CSSNumericValue) Free() { 2357 this.ref.Free() 2358 } 2359 2360 // HasFuncAdd returns true if the method "CSSNumericValue.add" exists. 2361 func (this CSSNumericValue) HasFuncAdd() bool { 2362 return js.True == bindings.HasFuncCSSNumericValueAdd( 2363 this.ref, 2364 ) 2365 } 2366 2367 // FuncAdd returns the method "CSSNumericValue.add". 2368 func (this CSSNumericValue) FuncAdd() (fn js.Func[func(values ...CSSNumberish) CSSNumericValue]) { 2369 bindings.FuncCSSNumericValueAdd( 2370 this.ref, js.Pointer(&fn), 2371 ) 2372 return 2373 } 2374 2375 // Add calls the method "CSSNumericValue.add". 2376 func (this CSSNumericValue) Add(values ...CSSNumberish) (ret CSSNumericValue) { 2377 bindings.CallCSSNumericValueAdd( 2378 this.ref, js.Pointer(&ret), 2379 js.SliceData(values), 2380 js.SizeU(len(values)), 2381 ) 2382 2383 return 2384 } 2385 2386 // TryAdd calls the method "CSSNumericValue.add" 2387 // in a try/catch block and returns (_, err, ok = false) when it went through 2388 // the catch clause. 2389 func (this CSSNumericValue) TryAdd(values ...CSSNumberish) (ret CSSNumericValue, exception js.Any, ok bool) { 2390 ok = js.True == bindings.TryCSSNumericValueAdd( 2391 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2392 js.SliceData(values), 2393 js.SizeU(len(values)), 2394 ) 2395 2396 return 2397 } 2398 2399 // HasFuncSub returns true if the method "CSSNumericValue.sub" exists. 2400 func (this CSSNumericValue) HasFuncSub() bool { 2401 return js.True == bindings.HasFuncCSSNumericValueSub( 2402 this.ref, 2403 ) 2404 } 2405 2406 // FuncSub returns the method "CSSNumericValue.sub". 2407 func (this CSSNumericValue) FuncSub() (fn js.Func[func(values ...CSSNumberish) CSSNumericValue]) { 2408 bindings.FuncCSSNumericValueSub( 2409 this.ref, js.Pointer(&fn), 2410 ) 2411 return 2412 } 2413 2414 // Sub calls the method "CSSNumericValue.sub". 2415 func (this CSSNumericValue) Sub(values ...CSSNumberish) (ret CSSNumericValue) { 2416 bindings.CallCSSNumericValueSub( 2417 this.ref, js.Pointer(&ret), 2418 js.SliceData(values), 2419 js.SizeU(len(values)), 2420 ) 2421 2422 return 2423 } 2424 2425 // TrySub calls the method "CSSNumericValue.sub" 2426 // in a try/catch block and returns (_, err, ok = false) when it went through 2427 // the catch clause. 2428 func (this CSSNumericValue) TrySub(values ...CSSNumberish) (ret CSSNumericValue, exception js.Any, ok bool) { 2429 ok = js.True == bindings.TryCSSNumericValueSub( 2430 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2431 js.SliceData(values), 2432 js.SizeU(len(values)), 2433 ) 2434 2435 return 2436 } 2437 2438 // HasFuncMul returns true if the method "CSSNumericValue.mul" exists. 2439 func (this CSSNumericValue) HasFuncMul() bool { 2440 return js.True == bindings.HasFuncCSSNumericValueMul( 2441 this.ref, 2442 ) 2443 } 2444 2445 // FuncMul returns the method "CSSNumericValue.mul". 2446 func (this CSSNumericValue) FuncMul() (fn js.Func[func(values ...CSSNumberish) CSSNumericValue]) { 2447 bindings.FuncCSSNumericValueMul( 2448 this.ref, js.Pointer(&fn), 2449 ) 2450 return 2451 } 2452 2453 // Mul calls the method "CSSNumericValue.mul". 2454 func (this CSSNumericValue) Mul(values ...CSSNumberish) (ret CSSNumericValue) { 2455 bindings.CallCSSNumericValueMul( 2456 this.ref, js.Pointer(&ret), 2457 js.SliceData(values), 2458 js.SizeU(len(values)), 2459 ) 2460 2461 return 2462 } 2463 2464 // TryMul calls the method "CSSNumericValue.mul" 2465 // in a try/catch block and returns (_, err, ok = false) when it went through 2466 // the catch clause. 2467 func (this CSSNumericValue) TryMul(values ...CSSNumberish) (ret CSSNumericValue, exception js.Any, ok bool) { 2468 ok = js.True == bindings.TryCSSNumericValueMul( 2469 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2470 js.SliceData(values), 2471 js.SizeU(len(values)), 2472 ) 2473 2474 return 2475 } 2476 2477 // HasFuncDiv returns true if the method "CSSNumericValue.div" exists. 2478 func (this CSSNumericValue) HasFuncDiv() bool { 2479 return js.True == bindings.HasFuncCSSNumericValueDiv( 2480 this.ref, 2481 ) 2482 } 2483 2484 // FuncDiv returns the method "CSSNumericValue.div". 2485 func (this CSSNumericValue) FuncDiv() (fn js.Func[func(values ...CSSNumberish) CSSNumericValue]) { 2486 bindings.FuncCSSNumericValueDiv( 2487 this.ref, js.Pointer(&fn), 2488 ) 2489 return 2490 } 2491 2492 // Div calls the method "CSSNumericValue.div". 2493 func (this CSSNumericValue) Div(values ...CSSNumberish) (ret CSSNumericValue) { 2494 bindings.CallCSSNumericValueDiv( 2495 this.ref, js.Pointer(&ret), 2496 js.SliceData(values), 2497 js.SizeU(len(values)), 2498 ) 2499 2500 return 2501 } 2502 2503 // TryDiv calls the method "CSSNumericValue.div" 2504 // in a try/catch block and returns (_, err, ok = false) when it went through 2505 // the catch clause. 2506 func (this CSSNumericValue) TryDiv(values ...CSSNumberish) (ret CSSNumericValue, exception js.Any, ok bool) { 2507 ok = js.True == bindings.TryCSSNumericValueDiv( 2508 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2509 js.SliceData(values), 2510 js.SizeU(len(values)), 2511 ) 2512 2513 return 2514 } 2515 2516 // HasFuncMin returns true if the method "CSSNumericValue.min" exists. 2517 func (this CSSNumericValue) HasFuncMin() bool { 2518 return js.True == bindings.HasFuncCSSNumericValueMin( 2519 this.ref, 2520 ) 2521 } 2522 2523 // FuncMin returns the method "CSSNumericValue.min". 2524 func (this CSSNumericValue) FuncMin() (fn js.Func[func(values ...CSSNumberish) CSSNumericValue]) { 2525 bindings.FuncCSSNumericValueMin( 2526 this.ref, js.Pointer(&fn), 2527 ) 2528 return 2529 } 2530 2531 // Min calls the method "CSSNumericValue.min". 2532 func (this CSSNumericValue) Min(values ...CSSNumberish) (ret CSSNumericValue) { 2533 bindings.CallCSSNumericValueMin( 2534 this.ref, js.Pointer(&ret), 2535 js.SliceData(values), 2536 js.SizeU(len(values)), 2537 ) 2538 2539 return 2540 } 2541 2542 // TryMin calls the method "CSSNumericValue.min" 2543 // in a try/catch block and returns (_, err, ok = false) when it went through 2544 // the catch clause. 2545 func (this CSSNumericValue) TryMin(values ...CSSNumberish) (ret CSSNumericValue, exception js.Any, ok bool) { 2546 ok = js.True == bindings.TryCSSNumericValueMin( 2547 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2548 js.SliceData(values), 2549 js.SizeU(len(values)), 2550 ) 2551 2552 return 2553 } 2554 2555 // HasFuncMax returns true if the method "CSSNumericValue.max" exists. 2556 func (this CSSNumericValue) HasFuncMax() bool { 2557 return js.True == bindings.HasFuncCSSNumericValueMax( 2558 this.ref, 2559 ) 2560 } 2561 2562 // FuncMax returns the method "CSSNumericValue.max". 2563 func (this CSSNumericValue) FuncMax() (fn js.Func[func(values ...CSSNumberish) CSSNumericValue]) { 2564 bindings.FuncCSSNumericValueMax( 2565 this.ref, js.Pointer(&fn), 2566 ) 2567 return 2568 } 2569 2570 // Max calls the method "CSSNumericValue.max". 2571 func (this CSSNumericValue) Max(values ...CSSNumberish) (ret CSSNumericValue) { 2572 bindings.CallCSSNumericValueMax( 2573 this.ref, js.Pointer(&ret), 2574 js.SliceData(values), 2575 js.SizeU(len(values)), 2576 ) 2577 2578 return 2579 } 2580 2581 // TryMax calls the method "CSSNumericValue.max" 2582 // in a try/catch block and returns (_, err, ok = false) when it went through 2583 // the catch clause. 2584 func (this CSSNumericValue) TryMax(values ...CSSNumberish) (ret CSSNumericValue, exception js.Any, ok bool) { 2585 ok = js.True == bindings.TryCSSNumericValueMax( 2586 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2587 js.SliceData(values), 2588 js.SizeU(len(values)), 2589 ) 2590 2591 return 2592 } 2593 2594 // HasFuncEquals returns true if the method "CSSNumericValue.equals" exists. 2595 func (this CSSNumericValue) HasFuncEquals() bool { 2596 return js.True == bindings.HasFuncCSSNumericValueEquals( 2597 this.ref, 2598 ) 2599 } 2600 2601 // FuncEquals returns the method "CSSNumericValue.equals". 2602 func (this CSSNumericValue) FuncEquals() (fn js.Func[func(value ...CSSNumberish) bool]) { 2603 bindings.FuncCSSNumericValueEquals( 2604 this.ref, js.Pointer(&fn), 2605 ) 2606 return 2607 } 2608 2609 // Equals calls the method "CSSNumericValue.equals". 2610 func (this CSSNumericValue) Equals(value ...CSSNumberish) (ret bool) { 2611 bindings.CallCSSNumericValueEquals( 2612 this.ref, js.Pointer(&ret), 2613 js.SliceData(value), 2614 js.SizeU(len(value)), 2615 ) 2616 2617 return 2618 } 2619 2620 // TryEquals calls the method "CSSNumericValue.equals" 2621 // in a try/catch block and returns (_, err, ok = false) when it went through 2622 // the catch clause. 2623 func (this CSSNumericValue) TryEquals(value ...CSSNumberish) (ret bool, exception js.Any, ok bool) { 2624 ok = js.True == bindings.TryCSSNumericValueEquals( 2625 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2626 js.SliceData(value), 2627 js.SizeU(len(value)), 2628 ) 2629 2630 return 2631 } 2632 2633 // HasFuncTo returns true if the method "CSSNumericValue.to" exists. 2634 func (this CSSNumericValue) HasFuncTo() bool { 2635 return js.True == bindings.HasFuncCSSNumericValueTo( 2636 this.ref, 2637 ) 2638 } 2639 2640 // FuncTo returns the method "CSSNumericValue.to". 2641 func (this CSSNumericValue) FuncTo() (fn js.Func[func(unit js.String) CSSUnitValue]) { 2642 bindings.FuncCSSNumericValueTo( 2643 this.ref, js.Pointer(&fn), 2644 ) 2645 return 2646 } 2647 2648 // To calls the method "CSSNumericValue.to". 2649 func (this CSSNumericValue) To(unit js.String) (ret CSSUnitValue) { 2650 bindings.CallCSSNumericValueTo( 2651 this.ref, js.Pointer(&ret), 2652 unit.Ref(), 2653 ) 2654 2655 return 2656 } 2657 2658 // TryTo calls the method "CSSNumericValue.to" 2659 // in a try/catch block and returns (_, err, ok = false) when it went through 2660 // the catch clause. 2661 func (this CSSNumericValue) TryTo(unit js.String) (ret CSSUnitValue, exception js.Any, ok bool) { 2662 ok = js.True == bindings.TryCSSNumericValueTo( 2663 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2664 unit.Ref(), 2665 ) 2666 2667 return 2668 } 2669 2670 // HasFuncToSum returns true if the method "CSSNumericValue.toSum" exists. 2671 func (this CSSNumericValue) HasFuncToSum() bool { 2672 return js.True == bindings.HasFuncCSSNumericValueToSum( 2673 this.ref, 2674 ) 2675 } 2676 2677 // FuncToSum returns the method "CSSNumericValue.toSum". 2678 func (this CSSNumericValue) FuncToSum() (fn js.Func[func(units ...js.String) CSSMathSum]) { 2679 bindings.FuncCSSNumericValueToSum( 2680 this.ref, js.Pointer(&fn), 2681 ) 2682 return 2683 } 2684 2685 // ToSum calls the method "CSSNumericValue.toSum". 2686 func (this CSSNumericValue) ToSum(units ...js.String) (ret CSSMathSum) { 2687 bindings.CallCSSNumericValueToSum( 2688 this.ref, js.Pointer(&ret), 2689 js.SliceData(units), 2690 js.SizeU(len(units)), 2691 ) 2692 2693 return 2694 } 2695 2696 // TryToSum calls the method "CSSNumericValue.toSum" 2697 // in a try/catch block and returns (_, err, ok = false) when it went through 2698 // the catch clause. 2699 func (this CSSNumericValue) TryToSum(units ...js.String) (ret CSSMathSum, exception js.Any, ok bool) { 2700 ok = js.True == bindings.TryCSSNumericValueToSum( 2701 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2702 js.SliceData(units), 2703 js.SizeU(len(units)), 2704 ) 2705 2706 return 2707 } 2708 2709 // HasFuncType returns true if the method "CSSNumericValue.type" exists. 2710 func (this CSSNumericValue) HasFuncType() bool { 2711 return js.True == bindings.HasFuncCSSNumericValueType( 2712 this.ref, 2713 ) 2714 } 2715 2716 // FuncType returns the method "CSSNumericValue.type". 2717 func (this CSSNumericValue) FuncType() (fn js.Func[func() CSSNumericType]) { 2718 bindings.FuncCSSNumericValueType( 2719 this.ref, js.Pointer(&fn), 2720 ) 2721 return 2722 } 2723 2724 // Type calls the method "CSSNumericValue.type". 2725 func (this CSSNumericValue) Type() (ret CSSNumericType) { 2726 bindings.CallCSSNumericValueType( 2727 this.ref, js.Pointer(&ret), 2728 ) 2729 2730 return 2731 } 2732 2733 // TryType calls the method "CSSNumericValue.type" 2734 // in a try/catch block and returns (_, err, ok = false) when it went through 2735 // the catch clause. 2736 func (this CSSNumericValue) TryType() (ret CSSNumericType, exception js.Any, ok bool) { 2737 ok = js.True == bindings.TryCSSNumericValueType( 2738 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2739 ) 2740 2741 return 2742 } 2743 2744 // HasFuncParse returns true if the static method "CSSNumericValue.parse" exists. 2745 func (this CSSNumericValue) HasFuncParse() bool { 2746 return js.True == bindings.HasFuncCSSNumericValueParse( 2747 this.ref, 2748 ) 2749 } 2750 2751 // FuncParse returns the static method "CSSNumericValue.parse". 2752 func (this CSSNumericValue) FuncParse() (fn js.Func[func(cssText js.String) CSSNumericValue]) { 2753 bindings.FuncCSSNumericValueParse( 2754 this.ref, js.Pointer(&fn), 2755 ) 2756 return 2757 } 2758 2759 // Parse calls the static method "CSSNumericValue.parse". 2760 func (this CSSNumericValue) Parse(cssText js.String) (ret CSSNumericValue) { 2761 bindings.CallCSSNumericValueParse( 2762 this.ref, js.Pointer(&ret), 2763 cssText.Ref(), 2764 ) 2765 2766 return 2767 } 2768 2769 // TryParse calls the static method "CSSNumericValue.parse" 2770 // in a try/catch block and returns (_, err, ok = false) when it went through 2771 // the catch clause. 2772 func (this CSSNumericValue) TryParse(cssText js.String) (ret CSSNumericValue, exception js.Any, ok bool) { 2773 ok = js.True == bindings.TryCSSNumericValueParse( 2774 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2775 cssText.Ref(), 2776 ) 2777 2778 return 2779 } 2780 2781 type OneOf_Float64_CSSNumericValue_String struct { 2782 ref js.Ref 2783 } 2784 2785 func (x OneOf_Float64_CSSNumericValue_String) Ref() js.Ref { 2786 return x.ref 2787 } 2788 2789 func (x OneOf_Float64_CSSNumericValue_String) Free() { 2790 x.ref.Free() 2791 } 2792 2793 func (x OneOf_Float64_CSSNumericValue_String) FromRef(ref js.Ref) OneOf_Float64_CSSNumericValue_String { 2794 return OneOf_Float64_CSSNumericValue_String{ 2795 ref: ref, 2796 } 2797 } 2798 2799 func (x OneOf_Float64_CSSNumericValue_String) Float64() float64 { 2800 return js.Number[float64]{}.FromRef(x.ref).Get() 2801 } 2802 2803 func (x OneOf_Float64_CSSNumericValue_String) CSSNumericValue() CSSNumericValue { 2804 return CSSNumericValue{}.FromRef(x.ref) 2805 } 2806 2807 func (x OneOf_Float64_CSSNumericValue_String) String() js.String { 2808 return js.String{}.FromRef(x.ref) 2809 } 2810 2811 type EffectTiming struct { 2812 // Fill is "EffectTiming.fill" 2813 // 2814 // Optional, defaults to "auto". 2815 Fill FillMode 2816 // IterationStart is "EffectTiming.iterationStart" 2817 // 2818 // Optional, defaults to 0.0. 2819 // 2820 // NOTE: FFI_USE_IterationStart MUST be set to true to make this field effective. 2821 IterationStart float64 2822 // Iterations is "EffectTiming.iterations" 2823 // 2824 // Optional, defaults to 1.0. 2825 // 2826 // NOTE: FFI_USE_Iterations MUST be set to true to make this field effective. 2827 Iterations float64 2828 // Direction is "EffectTiming.direction" 2829 // 2830 // Optional, defaults to "normal". 2831 Direction PlaybackDirection 2832 // Easing is "EffectTiming.easing" 2833 // 2834 // Optional, defaults to "linear". 2835 Easing js.String 2836 // Delay is "EffectTiming.delay" 2837 // 2838 // Optional 2839 // 2840 // NOTE: FFI_USE_Delay MUST be set to true to make this field effective. 2841 Delay float64 2842 // EndDelay is "EffectTiming.endDelay" 2843 // 2844 // Optional 2845 // 2846 // NOTE: FFI_USE_EndDelay MUST be set to true to make this field effective. 2847 EndDelay float64 2848 // PlaybackRate is "EffectTiming.playbackRate" 2849 // 2850 // Optional, defaults to 1.0. 2851 // 2852 // NOTE: FFI_USE_PlaybackRate MUST be set to true to make this field effective. 2853 PlaybackRate float64 2854 // Duration is "EffectTiming.duration" 2855 // 2856 // Optional, defaults to "auto". 2857 Duration OneOf_Float64_CSSNumericValue_String 2858 2859 FFI_USE_IterationStart bool // for IterationStart. 2860 FFI_USE_Iterations bool // for Iterations. 2861 FFI_USE_Delay bool // for Delay. 2862 FFI_USE_EndDelay bool // for EndDelay. 2863 FFI_USE_PlaybackRate bool // for PlaybackRate. 2864 2865 FFI_USE bool 2866 } 2867 2868 // FromRef calls UpdateFrom and returns a EffectTiming with all fields set. 2869 func (p EffectTiming) FromRef(ref js.Ref) EffectTiming { 2870 p.UpdateFrom(ref) 2871 return p 2872 } 2873 2874 // New creates a new EffectTiming in the application heap. 2875 func (p EffectTiming) New() js.Ref { 2876 return bindings.EffectTimingJSLoad( 2877 js.Pointer(&p), js.True, 0, 2878 ) 2879 } 2880 2881 // UpdateFrom copies value of all fields of the heap object to p. 2882 func (p *EffectTiming) UpdateFrom(ref js.Ref) { 2883 bindings.EffectTimingJSStore( 2884 js.Pointer(p), ref, 2885 ) 2886 } 2887 2888 // Update writes all fields of the p to the heap object referenced by ref. 2889 func (p *EffectTiming) Update(ref js.Ref) { 2890 bindings.EffectTimingJSLoad( 2891 js.Pointer(p), js.False, ref, 2892 ) 2893 } 2894 2895 // FreeMembers frees fields with heap reference, if recursive is true 2896 // free all heap references reachable from p. 2897 func (p *EffectTiming) FreeMembers(recursive bool) { 2898 js.Free( 2899 p.Easing.Ref(), 2900 p.Duration.Ref(), 2901 ) 2902 p.Easing = p.Easing.FromRef(js.Undefined) 2903 p.Duration = p.Duration.FromRef(js.Undefined) 2904 } 2905 2906 type ComputedEffectTiming struct { 2907 // Progress is "ComputedEffectTiming.progress" 2908 // 2909 // Optional 2910 // 2911 // NOTE: FFI_USE_Progress MUST be set to true to make this field effective. 2912 Progress float64 2913 // CurrentIteration is "ComputedEffectTiming.currentIteration" 2914 // 2915 // Optional 2916 // 2917 // NOTE: FFI_USE_CurrentIteration MUST be set to true to make this field effective. 2918 CurrentIteration float64 2919 // Fill is "ComputedEffectTiming.fill" 2920 // 2921 // Optional, defaults to "auto". 2922 Fill FillMode 2923 // IterationStart is "ComputedEffectTiming.iterationStart" 2924 // 2925 // Optional, defaults to 0.0. 2926 // 2927 // NOTE: FFI_USE_IterationStart MUST be set to true to make this field effective. 2928 IterationStart float64 2929 // Iterations is "ComputedEffectTiming.iterations" 2930 // 2931 // Optional, defaults to 1.0. 2932 // 2933 // NOTE: FFI_USE_Iterations MUST be set to true to make this field effective. 2934 Iterations float64 2935 // Direction is "ComputedEffectTiming.direction" 2936 // 2937 // Optional, defaults to "normal". 2938 Direction PlaybackDirection 2939 // Easing is "ComputedEffectTiming.easing" 2940 // 2941 // Optional, defaults to "linear". 2942 Easing js.String 2943 // StartTime is "ComputedEffectTiming.startTime" 2944 // 2945 // Optional 2946 StartTime CSSNumberish 2947 // EndTime is "ComputedEffectTiming.endTime" 2948 // 2949 // Optional 2950 EndTime CSSNumberish 2951 // ActiveDuration is "ComputedEffectTiming.activeDuration" 2952 // 2953 // Optional 2954 ActiveDuration CSSNumberish 2955 // LocalTime is "ComputedEffectTiming.localTime" 2956 // 2957 // Optional 2958 LocalTime CSSNumberish 2959 2960 FFI_USE_Progress bool // for Progress. 2961 FFI_USE_CurrentIteration bool // for CurrentIteration. 2962 FFI_USE_IterationStart bool // for IterationStart. 2963 FFI_USE_Iterations bool // for Iterations. 2964 2965 FFI_USE bool 2966 } 2967 2968 // FromRef calls UpdateFrom and returns a ComputedEffectTiming with all fields set. 2969 func (p ComputedEffectTiming) FromRef(ref js.Ref) ComputedEffectTiming { 2970 p.UpdateFrom(ref) 2971 return p 2972 } 2973 2974 // New creates a new ComputedEffectTiming in the application heap. 2975 func (p ComputedEffectTiming) New() js.Ref { 2976 return bindings.ComputedEffectTimingJSLoad( 2977 js.Pointer(&p), js.True, 0, 2978 ) 2979 } 2980 2981 // UpdateFrom copies value of all fields of the heap object to p. 2982 func (p *ComputedEffectTiming) UpdateFrom(ref js.Ref) { 2983 bindings.ComputedEffectTimingJSStore( 2984 js.Pointer(p), ref, 2985 ) 2986 } 2987 2988 // Update writes all fields of the p to the heap object referenced by ref. 2989 func (p *ComputedEffectTiming) Update(ref js.Ref) { 2990 bindings.ComputedEffectTimingJSLoad( 2991 js.Pointer(p), js.False, ref, 2992 ) 2993 } 2994 2995 // FreeMembers frees fields with heap reference, if recursive is true 2996 // free all heap references reachable from p. 2997 func (p *ComputedEffectTiming) FreeMembers(recursive bool) { 2998 js.Free( 2999 p.Easing.Ref(), 3000 p.StartTime.Ref(), 3001 p.EndTime.Ref(), 3002 p.ActiveDuration.Ref(), 3003 p.LocalTime.Ref(), 3004 ) 3005 p.Easing = p.Easing.FromRef(js.Undefined) 3006 p.StartTime = p.StartTime.FromRef(js.Undefined) 3007 p.EndTime = p.EndTime.FromRef(js.Undefined) 3008 p.ActiveDuration = p.ActiveDuration.FromRef(js.Undefined) 3009 p.LocalTime = p.LocalTime.FromRef(js.Undefined) 3010 } 3011 3012 type OneOf_Float64_String struct { 3013 ref js.Ref 3014 } 3015 3016 func (x OneOf_Float64_String) Ref() js.Ref { 3017 return x.ref 3018 } 3019 3020 func (x OneOf_Float64_String) Free() { 3021 x.ref.Free() 3022 } 3023 3024 func (x OneOf_Float64_String) FromRef(ref js.Ref) OneOf_Float64_String { 3025 return OneOf_Float64_String{ 3026 ref: ref, 3027 } 3028 } 3029 3030 func (x OneOf_Float64_String) Float64() float64 { 3031 return js.Number[float64]{}.FromRef(x.ref).Get() 3032 } 3033 3034 func (x OneOf_Float64_String) String() js.String { 3035 return js.String{}.FromRef(x.ref) 3036 }