github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis32_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 SharedStorageWorklet struct { 13 Worklet 14 } 15 16 func (this SharedStorageWorklet) Once() SharedStorageWorklet { 17 this.ref.Once() 18 return this 19 } 20 21 func (this SharedStorageWorklet) Ref() js.Ref { 22 return this.Worklet.Ref() 23 } 24 25 func (this SharedStorageWorklet) FromRef(ref js.Ref) SharedStorageWorklet { 26 this.Worklet = this.Worklet.FromRef(ref) 27 return this 28 } 29 30 func (this SharedStorageWorklet) Free() { 31 this.ref.Free() 32 } 33 34 type WindowSharedStorage struct { 35 SharedStorage 36 } 37 38 func (this WindowSharedStorage) Once() WindowSharedStorage { 39 this.ref.Once() 40 return this 41 } 42 43 func (this WindowSharedStorage) Ref() js.Ref { 44 return this.SharedStorage.Ref() 45 } 46 47 func (this WindowSharedStorage) FromRef(ref js.Ref) WindowSharedStorage { 48 this.SharedStorage = this.SharedStorage.FromRef(ref) 49 return this 50 } 51 52 func (this WindowSharedStorage) Free() { 53 this.ref.Free() 54 } 55 56 // Worklet returns the value of property "WindowSharedStorage.worklet". 57 // 58 // It returns ok=false if there is no such property. 59 func (this WindowSharedStorage) Worklet() (ret SharedStorageWorklet, ok bool) { 60 ok = js.True == bindings.GetWindowSharedStorageWorklet( 61 this.ref, js.Pointer(&ret), 62 ) 63 return 64 } 65 66 // HasFuncRun returns true if the method "WindowSharedStorage.run" exists. 67 func (this WindowSharedStorage) HasFuncRun() bool { 68 return js.True == bindings.HasFuncWindowSharedStorageRun( 69 this.ref, 70 ) 71 } 72 73 // FuncRun returns the method "WindowSharedStorage.run". 74 func (this WindowSharedStorage) FuncRun() (fn js.Func[func(name js.String, options SharedStorageRunOperationMethodOptions) js.Promise[js.Any]]) { 75 bindings.FuncWindowSharedStorageRun( 76 this.ref, js.Pointer(&fn), 77 ) 78 return 79 } 80 81 // Run calls the method "WindowSharedStorage.run". 82 func (this WindowSharedStorage) Run(name js.String, options SharedStorageRunOperationMethodOptions) (ret js.Promise[js.Any]) { 83 bindings.CallWindowSharedStorageRun( 84 this.ref, js.Pointer(&ret), 85 name.Ref(), 86 js.Pointer(&options), 87 ) 88 89 return 90 } 91 92 // TryRun calls the method "WindowSharedStorage.run" 93 // in a try/catch block and returns (_, err, ok = false) when it went through 94 // the catch clause. 95 func (this WindowSharedStorage) TryRun(name js.String, options SharedStorageRunOperationMethodOptions) (ret js.Promise[js.Any], exception js.Any, ok bool) { 96 ok = js.True == bindings.TryWindowSharedStorageRun( 97 this.ref, js.Pointer(&ret), js.Pointer(&exception), 98 name.Ref(), 99 js.Pointer(&options), 100 ) 101 102 return 103 } 104 105 // HasFuncRun1 returns true if the method "WindowSharedStorage.run" exists. 106 func (this WindowSharedStorage) HasFuncRun1() bool { 107 return js.True == bindings.HasFuncWindowSharedStorageRun1( 108 this.ref, 109 ) 110 } 111 112 // FuncRun1 returns the method "WindowSharedStorage.run". 113 func (this WindowSharedStorage) FuncRun1() (fn js.Func[func(name js.String) js.Promise[js.Any]]) { 114 bindings.FuncWindowSharedStorageRun1( 115 this.ref, js.Pointer(&fn), 116 ) 117 return 118 } 119 120 // Run1 calls the method "WindowSharedStorage.run". 121 func (this WindowSharedStorage) Run1(name js.String) (ret js.Promise[js.Any]) { 122 bindings.CallWindowSharedStorageRun1( 123 this.ref, js.Pointer(&ret), 124 name.Ref(), 125 ) 126 127 return 128 } 129 130 // TryRun1 calls the method "WindowSharedStorage.run" 131 // in a try/catch block and returns (_, err, ok = false) when it went through 132 // the catch clause. 133 func (this WindowSharedStorage) TryRun1(name js.String) (ret js.Promise[js.Any], exception js.Any, ok bool) { 134 ok = js.True == bindings.TryWindowSharedStorageRun1( 135 this.ref, js.Pointer(&ret), js.Pointer(&exception), 136 name.Ref(), 137 ) 138 139 return 140 } 141 142 // HasFuncSelectURL returns true if the method "WindowSharedStorage.selectURL" exists. 143 func (this WindowSharedStorage) HasFuncSelectURL() bool { 144 return js.True == bindings.HasFuncWindowSharedStorageSelectURL( 145 this.ref, 146 ) 147 } 148 149 // FuncSelectURL returns the method "WindowSharedStorage.selectURL". 150 func (this WindowSharedStorage) FuncSelectURL() (fn js.Func[func(name js.String, urls js.FrozenArray[SharedStorageUrlWithMetadata], options SharedStorageRunOperationMethodOptions) js.Promise[SharedStorageResponse]]) { 151 bindings.FuncWindowSharedStorageSelectURL( 152 this.ref, js.Pointer(&fn), 153 ) 154 return 155 } 156 157 // SelectURL calls the method "WindowSharedStorage.selectURL". 158 func (this WindowSharedStorage) SelectURL(name js.String, urls js.FrozenArray[SharedStorageUrlWithMetadata], options SharedStorageRunOperationMethodOptions) (ret js.Promise[SharedStorageResponse]) { 159 bindings.CallWindowSharedStorageSelectURL( 160 this.ref, js.Pointer(&ret), 161 name.Ref(), 162 urls.Ref(), 163 js.Pointer(&options), 164 ) 165 166 return 167 } 168 169 // TrySelectURL calls the method "WindowSharedStorage.selectURL" 170 // in a try/catch block and returns (_, err, ok = false) when it went through 171 // the catch clause. 172 func (this WindowSharedStorage) TrySelectURL(name js.String, urls js.FrozenArray[SharedStorageUrlWithMetadata], options SharedStorageRunOperationMethodOptions) (ret js.Promise[SharedStorageResponse], exception js.Any, ok bool) { 173 ok = js.True == bindings.TryWindowSharedStorageSelectURL( 174 this.ref, js.Pointer(&ret), js.Pointer(&exception), 175 name.Ref(), 176 urls.Ref(), 177 js.Pointer(&options), 178 ) 179 180 return 181 } 182 183 // HasFuncSelectURL1 returns true if the method "WindowSharedStorage.selectURL" exists. 184 func (this WindowSharedStorage) HasFuncSelectURL1() bool { 185 return js.True == bindings.HasFuncWindowSharedStorageSelectURL1( 186 this.ref, 187 ) 188 } 189 190 // FuncSelectURL1 returns the method "WindowSharedStorage.selectURL". 191 func (this WindowSharedStorage) FuncSelectURL1() (fn js.Func[func(name js.String, urls js.FrozenArray[SharedStorageUrlWithMetadata]) js.Promise[SharedStorageResponse]]) { 192 bindings.FuncWindowSharedStorageSelectURL1( 193 this.ref, js.Pointer(&fn), 194 ) 195 return 196 } 197 198 // SelectURL1 calls the method "WindowSharedStorage.selectURL". 199 func (this WindowSharedStorage) SelectURL1(name js.String, urls js.FrozenArray[SharedStorageUrlWithMetadata]) (ret js.Promise[SharedStorageResponse]) { 200 bindings.CallWindowSharedStorageSelectURL1( 201 this.ref, js.Pointer(&ret), 202 name.Ref(), 203 urls.Ref(), 204 ) 205 206 return 207 } 208 209 // TrySelectURL1 calls the method "WindowSharedStorage.selectURL" 210 // in a try/catch block and returns (_, err, ok = false) when it went through 211 // the catch clause. 212 func (this WindowSharedStorage) TrySelectURL1(name js.String, urls js.FrozenArray[SharedStorageUrlWithMetadata]) (ret js.Promise[SharedStorageResponse], exception js.Any, ok bool) { 213 ok = js.True == bindings.TryWindowSharedStorageSelectURL1( 214 this.ref, js.Pointer(&ret), js.Pointer(&exception), 215 name.Ref(), 216 urls.Ref(), 217 ) 218 219 return 220 } 221 222 type OneOf_Event_undefined struct { 223 ref js.Ref 224 } 225 226 func (x OneOf_Event_undefined) Ref() js.Ref { 227 return x.ref 228 } 229 230 func (x OneOf_Event_undefined) Free() { 231 x.ref.Free() 232 } 233 234 func (x OneOf_Event_undefined) FromRef(ref js.Ref) OneOf_Event_undefined { 235 return OneOf_Event_undefined{ 236 ref: ref, 237 } 238 } 239 240 func (x OneOf_Event_undefined) Undefined() bool { 241 return x.ref == js.Undefined 242 } 243 244 func (x OneOf_Event_undefined) Event() Event { 245 return Event{}.FromRef(x.ref) 246 } 247 248 type CookieSameSite uint32 249 250 const ( 251 _ CookieSameSite = iota 252 253 CookieSameSite_STRICT 254 CookieSameSite_LAX 255 CookieSameSite_NONE 256 ) 257 258 func (CookieSameSite) FromRef(str js.Ref) CookieSameSite { 259 return CookieSameSite(bindings.ConstOfCookieSameSite(str)) 260 } 261 262 func (x CookieSameSite) String() (string, bool) { 263 switch x { 264 case CookieSameSite_STRICT: 265 return "strict", true 266 case CookieSameSite_LAX: 267 return "lax", true 268 case CookieSameSite_NONE: 269 return "none", true 270 default: 271 return "", false 272 } 273 } 274 275 type CookieListItem struct { 276 // Name is "CookieListItem.name" 277 // 278 // Optional 279 Name js.String 280 // Value is "CookieListItem.value" 281 // 282 // Optional 283 Value js.String 284 // Domain is "CookieListItem.domain" 285 // 286 // Optional 287 Domain js.String 288 // Path is "CookieListItem.path" 289 // 290 // Optional 291 Path js.String 292 // Expires is "CookieListItem.expires" 293 // 294 // Optional 295 // 296 // NOTE: FFI_USE_Expires MUST be set to true to make this field effective. 297 Expires DOMHighResTimeStamp 298 // Secure is "CookieListItem.secure" 299 // 300 // Optional 301 // 302 // NOTE: FFI_USE_Secure MUST be set to true to make this field effective. 303 Secure bool 304 // SameSite is "CookieListItem.sameSite" 305 // 306 // Optional 307 SameSite CookieSameSite 308 // Partitioned is "CookieListItem.partitioned" 309 // 310 // Optional 311 // 312 // NOTE: FFI_USE_Partitioned MUST be set to true to make this field effective. 313 Partitioned bool 314 315 FFI_USE_Expires bool // for Expires. 316 FFI_USE_Secure bool // for Secure. 317 FFI_USE_Partitioned bool // for Partitioned. 318 319 FFI_USE bool 320 } 321 322 // FromRef calls UpdateFrom and returns a CookieListItem with all fields set. 323 func (p CookieListItem) FromRef(ref js.Ref) CookieListItem { 324 p.UpdateFrom(ref) 325 return p 326 } 327 328 // New creates a new CookieListItem in the application heap. 329 func (p CookieListItem) New() js.Ref { 330 return bindings.CookieListItemJSLoad( 331 js.Pointer(&p), js.True, 0, 332 ) 333 } 334 335 // UpdateFrom copies value of all fields of the heap object to p. 336 func (p *CookieListItem) UpdateFrom(ref js.Ref) { 337 bindings.CookieListItemJSStore( 338 js.Pointer(p), ref, 339 ) 340 } 341 342 // Update writes all fields of the p to the heap object referenced by ref. 343 func (p *CookieListItem) Update(ref js.Ref) { 344 bindings.CookieListItemJSLoad( 345 js.Pointer(p), js.False, ref, 346 ) 347 } 348 349 // FreeMembers frees fields with heap reference, if recursive is true 350 // free all heap references reachable from p. 351 func (p *CookieListItem) FreeMembers(recursive bool) { 352 js.Free( 353 p.Name.Ref(), 354 p.Value.Ref(), 355 p.Domain.Ref(), 356 p.Path.Ref(), 357 ) 358 p.Name = p.Name.FromRef(js.Undefined) 359 p.Value = p.Value.FromRef(js.Undefined) 360 p.Domain = p.Domain.FromRef(js.Undefined) 361 p.Path = p.Path.FromRef(js.Undefined) 362 } 363 364 type CookieList = js.Array[CookieListItem] 365 366 type CookieInit struct { 367 // Name is "CookieInit.name" 368 // 369 // Required 370 Name js.String 371 // Value is "CookieInit.value" 372 // 373 // Required 374 Value js.String 375 // Expires is "CookieInit.expires" 376 // 377 // Optional, defaults to null. 378 // 379 // NOTE: FFI_USE_Expires MUST be set to true to make this field effective. 380 Expires DOMHighResTimeStamp 381 // Domain is "CookieInit.domain" 382 // 383 // Optional, defaults to null. 384 Domain js.String 385 // Path is "CookieInit.path" 386 // 387 // Optional, defaults to "/". 388 Path js.String 389 // SameSite is "CookieInit.sameSite" 390 // 391 // Optional, defaults to "strict". 392 SameSite CookieSameSite 393 // Partitioned is "CookieInit.partitioned" 394 // 395 // Optional, defaults to false. 396 // 397 // NOTE: FFI_USE_Partitioned MUST be set to true to make this field effective. 398 Partitioned bool 399 400 FFI_USE_Expires bool // for Expires. 401 FFI_USE_Partitioned bool // for Partitioned. 402 403 FFI_USE bool 404 } 405 406 // FromRef calls UpdateFrom and returns a CookieInit with all fields set. 407 func (p CookieInit) FromRef(ref js.Ref) CookieInit { 408 p.UpdateFrom(ref) 409 return p 410 } 411 412 // New creates a new CookieInit in the application heap. 413 func (p CookieInit) New() js.Ref { 414 return bindings.CookieInitJSLoad( 415 js.Pointer(&p), js.True, 0, 416 ) 417 } 418 419 // UpdateFrom copies value of all fields of the heap object to p. 420 func (p *CookieInit) UpdateFrom(ref js.Ref) { 421 bindings.CookieInitJSStore( 422 js.Pointer(p), ref, 423 ) 424 } 425 426 // Update writes all fields of the p to the heap object referenced by ref. 427 func (p *CookieInit) Update(ref js.Ref) { 428 bindings.CookieInitJSLoad( 429 js.Pointer(p), js.False, ref, 430 ) 431 } 432 433 // FreeMembers frees fields with heap reference, if recursive is true 434 // free all heap references reachable from p. 435 func (p *CookieInit) FreeMembers(recursive bool) { 436 js.Free( 437 p.Name.Ref(), 438 p.Value.Ref(), 439 p.Domain.Ref(), 440 p.Path.Ref(), 441 ) 442 p.Name = p.Name.FromRef(js.Undefined) 443 p.Value = p.Value.FromRef(js.Undefined) 444 p.Domain = p.Domain.FromRef(js.Undefined) 445 p.Path = p.Path.FromRef(js.Undefined) 446 } 447 448 type CookieStoreDeleteOptions struct { 449 // Name is "CookieStoreDeleteOptions.name" 450 // 451 // Required 452 Name js.String 453 // Domain is "CookieStoreDeleteOptions.domain" 454 // 455 // Optional, defaults to null. 456 Domain js.String 457 // Path is "CookieStoreDeleteOptions.path" 458 // 459 // Optional, defaults to "/". 460 Path js.String 461 // Partitioned is "CookieStoreDeleteOptions.partitioned" 462 // 463 // Optional, defaults to false. 464 // 465 // NOTE: FFI_USE_Partitioned MUST be set to true to make this field effective. 466 Partitioned bool 467 468 FFI_USE_Partitioned bool // for Partitioned. 469 470 FFI_USE bool 471 } 472 473 // FromRef calls UpdateFrom and returns a CookieStoreDeleteOptions with all fields set. 474 func (p CookieStoreDeleteOptions) FromRef(ref js.Ref) CookieStoreDeleteOptions { 475 p.UpdateFrom(ref) 476 return p 477 } 478 479 // New creates a new CookieStoreDeleteOptions in the application heap. 480 func (p CookieStoreDeleteOptions) New() js.Ref { 481 return bindings.CookieStoreDeleteOptionsJSLoad( 482 js.Pointer(&p), js.True, 0, 483 ) 484 } 485 486 // UpdateFrom copies value of all fields of the heap object to p. 487 func (p *CookieStoreDeleteOptions) UpdateFrom(ref js.Ref) { 488 bindings.CookieStoreDeleteOptionsJSStore( 489 js.Pointer(p), ref, 490 ) 491 } 492 493 // Update writes all fields of the p to the heap object referenced by ref. 494 func (p *CookieStoreDeleteOptions) Update(ref js.Ref) { 495 bindings.CookieStoreDeleteOptionsJSLoad( 496 js.Pointer(p), js.False, ref, 497 ) 498 } 499 500 // FreeMembers frees fields with heap reference, if recursive is true 501 // free all heap references reachable from p. 502 func (p *CookieStoreDeleteOptions) FreeMembers(recursive bool) { 503 js.Free( 504 p.Name.Ref(), 505 p.Domain.Ref(), 506 p.Path.Ref(), 507 ) 508 p.Name = p.Name.FromRef(js.Undefined) 509 p.Domain = p.Domain.FromRef(js.Undefined) 510 p.Path = p.Path.FromRef(js.Undefined) 511 } 512 513 type CookieStore struct { 514 EventTarget 515 } 516 517 func (this CookieStore) Once() CookieStore { 518 this.ref.Once() 519 return this 520 } 521 522 func (this CookieStore) Ref() js.Ref { 523 return this.EventTarget.Ref() 524 } 525 526 func (this CookieStore) FromRef(ref js.Ref) CookieStore { 527 this.EventTarget = this.EventTarget.FromRef(ref) 528 return this 529 } 530 531 func (this CookieStore) Free() { 532 this.ref.Free() 533 } 534 535 // HasFuncGet returns true if the method "CookieStore.get" exists. 536 func (this CookieStore) HasFuncGet() bool { 537 return js.True == bindings.HasFuncCookieStoreGet( 538 this.ref, 539 ) 540 } 541 542 // FuncGet returns the method "CookieStore.get". 543 func (this CookieStore) FuncGet() (fn js.Func[func(name js.String) js.Promise[CookieListItem]]) { 544 bindings.FuncCookieStoreGet( 545 this.ref, js.Pointer(&fn), 546 ) 547 return 548 } 549 550 // Get calls the method "CookieStore.get". 551 func (this CookieStore) Get(name js.String) (ret js.Promise[CookieListItem]) { 552 bindings.CallCookieStoreGet( 553 this.ref, js.Pointer(&ret), 554 name.Ref(), 555 ) 556 557 return 558 } 559 560 // TryGet calls the method "CookieStore.get" 561 // in a try/catch block and returns (_, err, ok = false) when it went through 562 // the catch clause. 563 func (this CookieStore) TryGet(name js.String) (ret js.Promise[CookieListItem], exception js.Any, ok bool) { 564 ok = js.True == bindings.TryCookieStoreGet( 565 this.ref, js.Pointer(&ret), js.Pointer(&exception), 566 name.Ref(), 567 ) 568 569 return 570 } 571 572 // HasFuncGet1 returns true if the method "CookieStore.get" exists. 573 func (this CookieStore) HasFuncGet1() bool { 574 return js.True == bindings.HasFuncCookieStoreGet1( 575 this.ref, 576 ) 577 } 578 579 // FuncGet1 returns the method "CookieStore.get". 580 func (this CookieStore) FuncGet1() (fn js.Func[func(options CookieStoreGetOptions) js.Promise[CookieListItem]]) { 581 bindings.FuncCookieStoreGet1( 582 this.ref, js.Pointer(&fn), 583 ) 584 return 585 } 586 587 // Get1 calls the method "CookieStore.get". 588 func (this CookieStore) Get1(options CookieStoreGetOptions) (ret js.Promise[CookieListItem]) { 589 bindings.CallCookieStoreGet1( 590 this.ref, js.Pointer(&ret), 591 js.Pointer(&options), 592 ) 593 594 return 595 } 596 597 // TryGet1 calls the method "CookieStore.get" 598 // in a try/catch block and returns (_, err, ok = false) when it went through 599 // the catch clause. 600 func (this CookieStore) TryGet1(options CookieStoreGetOptions) (ret js.Promise[CookieListItem], exception js.Any, ok bool) { 601 ok = js.True == bindings.TryCookieStoreGet1( 602 this.ref, js.Pointer(&ret), js.Pointer(&exception), 603 js.Pointer(&options), 604 ) 605 606 return 607 } 608 609 // HasFuncGet2 returns true if the method "CookieStore.get" exists. 610 func (this CookieStore) HasFuncGet2() bool { 611 return js.True == bindings.HasFuncCookieStoreGet2( 612 this.ref, 613 ) 614 } 615 616 // FuncGet2 returns the method "CookieStore.get". 617 func (this CookieStore) FuncGet2() (fn js.Func[func() js.Promise[CookieListItem]]) { 618 bindings.FuncCookieStoreGet2( 619 this.ref, js.Pointer(&fn), 620 ) 621 return 622 } 623 624 // Get2 calls the method "CookieStore.get". 625 func (this CookieStore) Get2() (ret js.Promise[CookieListItem]) { 626 bindings.CallCookieStoreGet2( 627 this.ref, js.Pointer(&ret), 628 ) 629 630 return 631 } 632 633 // TryGet2 calls the method "CookieStore.get" 634 // in a try/catch block and returns (_, err, ok = false) when it went through 635 // the catch clause. 636 func (this CookieStore) TryGet2() (ret js.Promise[CookieListItem], exception js.Any, ok bool) { 637 ok = js.True == bindings.TryCookieStoreGet2( 638 this.ref, js.Pointer(&ret), js.Pointer(&exception), 639 ) 640 641 return 642 } 643 644 // HasFuncGetAll returns true if the method "CookieStore.getAll" exists. 645 func (this CookieStore) HasFuncGetAll() bool { 646 return js.True == bindings.HasFuncCookieStoreGetAll( 647 this.ref, 648 ) 649 } 650 651 // FuncGetAll returns the method "CookieStore.getAll". 652 func (this CookieStore) FuncGetAll() (fn js.Func[func(name js.String) js.Promise[CookieList]]) { 653 bindings.FuncCookieStoreGetAll( 654 this.ref, js.Pointer(&fn), 655 ) 656 return 657 } 658 659 // GetAll calls the method "CookieStore.getAll". 660 func (this CookieStore) GetAll(name js.String) (ret js.Promise[CookieList]) { 661 bindings.CallCookieStoreGetAll( 662 this.ref, js.Pointer(&ret), 663 name.Ref(), 664 ) 665 666 return 667 } 668 669 // TryGetAll calls the method "CookieStore.getAll" 670 // in a try/catch block and returns (_, err, ok = false) when it went through 671 // the catch clause. 672 func (this CookieStore) TryGetAll(name js.String) (ret js.Promise[CookieList], exception js.Any, ok bool) { 673 ok = js.True == bindings.TryCookieStoreGetAll( 674 this.ref, js.Pointer(&ret), js.Pointer(&exception), 675 name.Ref(), 676 ) 677 678 return 679 } 680 681 // HasFuncGetAll1 returns true if the method "CookieStore.getAll" exists. 682 func (this CookieStore) HasFuncGetAll1() bool { 683 return js.True == bindings.HasFuncCookieStoreGetAll1( 684 this.ref, 685 ) 686 } 687 688 // FuncGetAll1 returns the method "CookieStore.getAll". 689 func (this CookieStore) FuncGetAll1() (fn js.Func[func(options CookieStoreGetOptions) js.Promise[CookieList]]) { 690 bindings.FuncCookieStoreGetAll1( 691 this.ref, js.Pointer(&fn), 692 ) 693 return 694 } 695 696 // GetAll1 calls the method "CookieStore.getAll". 697 func (this CookieStore) GetAll1(options CookieStoreGetOptions) (ret js.Promise[CookieList]) { 698 bindings.CallCookieStoreGetAll1( 699 this.ref, js.Pointer(&ret), 700 js.Pointer(&options), 701 ) 702 703 return 704 } 705 706 // TryGetAll1 calls the method "CookieStore.getAll" 707 // in a try/catch block and returns (_, err, ok = false) when it went through 708 // the catch clause. 709 func (this CookieStore) TryGetAll1(options CookieStoreGetOptions) (ret js.Promise[CookieList], exception js.Any, ok bool) { 710 ok = js.True == bindings.TryCookieStoreGetAll1( 711 this.ref, js.Pointer(&ret), js.Pointer(&exception), 712 js.Pointer(&options), 713 ) 714 715 return 716 } 717 718 // HasFuncGetAll2 returns true if the method "CookieStore.getAll" exists. 719 func (this CookieStore) HasFuncGetAll2() bool { 720 return js.True == bindings.HasFuncCookieStoreGetAll2( 721 this.ref, 722 ) 723 } 724 725 // FuncGetAll2 returns the method "CookieStore.getAll". 726 func (this CookieStore) FuncGetAll2() (fn js.Func[func() js.Promise[CookieList]]) { 727 bindings.FuncCookieStoreGetAll2( 728 this.ref, js.Pointer(&fn), 729 ) 730 return 731 } 732 733 // GetAll2 calls the method "CookieStore.getAll". 734 func (this CookieStore) GetAll2() (ret js.Promise[CookieList]) { 735 bindings.CallCookieStoreGetAll2( 736 this.ref, js.Pointer(&ret), 737 ) 738 739 return 740 } 741 742 // TryGetAll2 calls the method "CookieStore.getAll" 743 // in a try/catch block and returns (_, err, ok = false) when it went through 744 // the catch clause. 745 func (this CookieStore) TryGetAll2() (ret js.Promise[CookieList], exception js.Any, ok bool) { 746 ok = js.True == bindings.TryCookieStoreGetAll2( 747 this.ref, js.Pointer(&ret), js.Pointer(&exception), 748 ) 749 750 return 751 } 752 753 // HasFuncSet returns true if the method "CookieStore.set" exists. 754 func (this CookieStore) HasFuncSet() bool { 755 return js.True == bindings.HasFuncCookieStoreSet( 756 this.ref, 757 ) 758 } 759 760 // FuncSet returns the method "CookieStore.set". 761 func (this CookieStore) FuncSet() (fn js.Func[func(name js.String, value js.String) js.Promise[js.Void]]) { 762 bindings.FuncCookieStoreSet( 763 this.ref, js.Pointer(&fn), 764 ) 765 return 766 } 767 768 // Set calls the method "CookieStore.set". 769 func (this CookieStore) Set(name js.String, value js.String) (ret js.Promise[js.Void]) { 770 bindings.CallCookieStoreSet( 771 this.ref, js.Pointer(&ret), 772 name.Ref(), 773 value.Ref(), 774 ) 775 776 return 777 } 778 779 // TrySet calls the method "CookieStore.set" 780 // in a try/catch block and returns (_, err, ok = false) when it went through 781 // the catch clause. 782 func (this CookieStore) TrySet(name js.String, value js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 783 ok = js.True == bindings.TryCookieStoreSet( 784 this.ref, js.Pointer(&ret), js.Pointer(&exception), 785 name.Ref(), 786 value.Ref(), 787 ) 788 789 return 790 } 791 792 // HasFuncSet1 returns true if the method "CookieStore.set" exists. 793 func (this CookieStore) HasFuncSet1() bool { 794 return js.True == bindings.HasFuncCookieStoreSet1( 795 this.ref, 796 ) 797 } 798 799 // FuncSet1 returns the method "CookieStore.set". 800 func (this CookieStore) FuncSet1() (fn js.Func[func(options CookieInit) js.Promise[js.Void]]) { 801 bindings.FuncCookieStoreSet1( 802 this.ref, js.Pointer(&fn), 803 ) 804 return 805 } 806 807 // Set1 calls the method "CookieStore.set". 808 func (this CookieStore) Set1(options CookieInit) (ret js.Promise[js.Void]) { 809 bindings.CallCookieStoreSet1( 810 this.ref, js.Pointer(&ret), 811 js.Pointer(&options), 812 ) 813 814 return 815 } 816 817 // TrySet1 calls the method "CookieStore.set" 818 // in a try/catch block and returns (_, err, ok = false) when it went through 819 // the catch clause. 820 func (this CookieStore) TrySet1(options CookieInit) (ret js.Promise[js.Void], exception js.Any, ok bool) { 821 ok = js.True == bindings.TryCookieStoreSet1( 822 this.ref, js.Pointer(&ret), js.Pointer(&exception), 823 js.Pointer(&options), 824 ) 825 826 return 827 } 828 829 // HasFuncDelete returns true if the method "CookieStore.delete" exists. 830 func (this CookieStore) HasFuncDelete() bool { 831 return js.True == bindings.HasFuncCookieStoreDelete( 832 this.ref, 833 ) 834 } 835 836 // FuncDelete returns the method "CookieStore.delete". 837 func (this CookieStore) FuncDelete() (fn js.Func[func(name js.String) js.Promise[js.Void]]) { 838 bindings.FuncCookieStoreDelete( 839 this.ref, js.Pointer(&fn), 840 ) 841 return 842 } 843 844 // Delete calls the method "CookieStore.delete". 845 func (this CookieStore) Delete(name js.String) (ret js.Promise[js.Void]) { 846 bindings.CallCookieStoreDelete( 847 this.ref, js.Pointer(&ret), 848 name.Ref(), 849 ) 850 851 return 852 } 853 854 // TryDelete calls the method "CookieStore.delete" 855 // in a try/catch block and returns (_, err, ok = false) when it went through 856 // the catch clause. 857 func (this CookieStore) TryDelete(name js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) { 858 ok = js.True == bindings.TryCookieStoreDelete( 859 this.ref, js.Pointer(&ret), js.Pointer(&exception), 860 name.Ref(), 861 ) 862 863 return 864 } 865 866 // HasFuncDelete1 returns true if the method "CookieStore.delete" exists. 867 func (this CookieStore) HasFuncDelete1() bool { 868 return js.True == bindings.HasFuncCookieStoreDelete1( 869 this.ref, 870 ) 871 } 872 873 // FuncDelete1 returns the method "CookieStore.delete". 874 func (this CookieStore) FuncDelete1() (fn js.Func[func(options CookieStoreDeleteOptions) js.Promise[js.Void]]) { 875 bindings.FuncCookieStoreDelete1( 876 this.ref, js.Pointer(&fn), 877 ) 878 return 879 } 880 881 // Delete1 calls the method "CookieStore.delete". 882 func (this CookieStore) Delete1(options CookieStoreDeleteOptions) (ret js.Promise[js.Void]) { 883 bindings.CallCookieStoreDelete1( 884 this.ref, js.Pointer(&ret), 885 js.Pointer(&options), 886 ) 887 888 return 889 } 890 891 // TryDelete1 calls the method "CookieStore.delete" 892 // in a try/catch block and returns (_, err, ok = false) when it went through 893 // the catch clause. 894 func (this CookieStore) TryDelete1(options CookieStoreDeleteOptions) (ret js.Promise[js.Void], exception js.Any, ok bool) { 895 ok = js.True == bindings.TryCookieStoreDelete1( 896 this.ref, js.Pointer(&ret), js.Pointer(&exception), 897 js.Pointer(&options), 898 ) 899 900 return 901 } 902 903 type DocumentPictureInPictureOptions struct { 904 // Width is "DocumentPictureInPictureOptions.width" 905 // 906 // Optional, defaults to 0. 907 // 908 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 909 Width uint64 910 // Height is "DocumentPictureInPictureOptions.height" 911 // 912 // Optional, defaults to 0. 913 // 914 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 915 Height uint64 916 917 FFI_USE_Width bool // for Width. 918 FFI_USE_Height bool // for Height. 919 920 FFI_USE bool 921 } 922 923 // FromRef calls UpdateFrom and returns a DocumentPictureInPictureOptions with all fields set. 924 func (p DocumentPictureInPictureOptions) FromRef(ref js.Ref) DocumentPictureInPictureOptions { 925 p.UpdateFrom(ref) 926 return p 927 } 928 929 // New creates a new DocumentPictureInPictureOptions in the application heap. 930 func (p DocumentPictureInPictureOptions) New() js.Ref { 931 return bindings.DocumentPictureInPictureOptionsJSLoad( 932 js.Pointer(&p), js.True, 0, 933 ) 934 } 935 936 // UpdateFrom copies value of all fields of the heap object to p. 937 func (p *DocumentPictureInPictureOptions) UpdateFrom(ref js.Ref) { 938 bindings.DocumentPictureInPictureOptionsJSStore( 939 js.Pointer(p), ref, 940 ) 941 } 942 943 // Update writes all fields of the p to the heap object referenced by ref. 944 func (p *DocumentPictureInPictureOptions) Update(ref js.Ref) { 945 bindings.DocumentPictureInPictureOptionsJSLoad( 946 js.Pointer(p), js.False, ref, 947 ) 948 } 949 950 // FreeMembers frees fields with heap reference, if recursive is true 951 // free all heap references reachable from p. 952 func (p *DocumentPictureInPictureOptions) FreeMembers(recursive bool) { 953 } 954 955 type DocumentPictureInPicture struct { 956 EventTarget 957 } 958 959 func (this DocumentPictureInPicture) Once() DocumentPictureInPicture { 960 this.ref.Once() 961 return this 962 } 963 964 func (this DocumentPictureInPicture) Ref() js.Ref { 965 return this.EventTarget.Ref() 966 } 967 968 func (this DocumentPictureInPicture) FromRef(ref js.Ref) DocumentPictureInPicture { 969 this.EventTarget = this.EventTarget.FromRef(ref) 970 return this 971 } 972 973 func (this DocumentPictureInPicture) Free() { 974 this.ref.Free() 975 } 976 977 // Window returns the value of property "DocumentPictureInPicture.window". 978 // 979 // It returns ok=false if there is no such property. 980 func (this DocumentPictureInPicture) Window() (ret Window, ok bool) { 981 ok = js.True == bindings.GetDocumentPictureInPictureWindow( 982 this.ref, js.Pointer(&ret), 983 ) 984 return 985 } 986 987 // HasFuncRequestWindow returns true if the method "DocumentPictureInPicture.requestWindow" exists. 988 func (this DocumentPictureInPicture) HasFuncRequestWindow() bool { 989 return js.True == bindings.HasFuncDocumentPictureInPictureRequestWindow( 990 this.ref, 991 ) 992 } 993 994 // FuncRequestWindow returns the method "DocumentPictureInPicture.requestWindow". 995 func (this DocumentPictureInPicture) FuncRequestWindow() (fn js.Func[func(options DocumentPictureInPictureOptions) js.Promise[Window]]) { 996 bindings.FuncDocumentPictureInPictureRequestWindow( 997 this.ref, js.Pointer(&fn), 998 ) 999 return 1000 } 1001 1002 // RequestWindow calls the method "DocumentPictureInPicture.requestWindow". 1003 func (this DocumentPictureInPicture) RequestWindow(options DocumentPictureInPictureOptions) (ret js.Promise[Window]) { 1004 bindings.CallDocumentPictureInPictureRequestWindow( 1005 this.ref, js.Pointer(&ret), 1006 js.Pointer(&options), 1007 ) 1008 1009 return 1010 } 1011 1012 // TryRequestWindow calls the method "DocumentPictureInPicture.requestWindow" 1013 // in a try/catch block and returns (_, err, ok = false) when it went through 1014 // the catch clause. 1015 func (this DocumentPictureInPicture) TryRequestWindow(options DocumentPictureInPictureOptions) (ret js.Promise[Window], exception js.Any, ok bool) { 1016 ok = js.True == bindings.TryDocumentPictureInPictureRequestWindow( 1017 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1018 js.Pointer(&options), 1019 ) 1020 1021 return 1022 } 1023 1024 // HasFuncRequestWindow1 returns true if the method "DocumentPictureInPicture.requestWindow" exists. 1025 func (this DocumentPictureInPicture) HasFuncRequestWindow1() bool { 1026 return js.True == bindings.HasFuncDocumentPictureInPictureRequestWindow1( 1027 this.ref, 1028 ) 1029 } 1030 1031 // FuncRequestWindow1 returns the method "DocumentPictureInPicture.requestWindow". 1032 func (this DocumentPictureInPicture) FuncRequestWindow1() (fn js.Func[func() js.Promise[Window]]) { 1033 bindings.FuncDocumentPictureInPictureRequestWindow1( 1034 this.ref, js.Pointer(&fn), 1035 ) 1036 return 1037 } 1038 1039 // RequestWindow1 calls the method "DocumentPictureInPicture.requestWindow". 1040 func (this DocumentPictureInPicture) RequestWindow1() (ret js.Promise[Window]) { 1041 bindings.CallDocumentPictureInPictureRequestWindow1( 1042 this.ref, js.Pointer(&ret), 1043 ) 1044 1045 return 1046 } 1047 1048 // TryRequestWindow1 calls the method "DocumentPictureInPicture.requestWindow" 1049 // in a try/catch block and returns (_, err, ok = false) when it went through 1050 // the catch clause. 1051 func (this DocumentPictureInPicture) TryRequestWindow1() (ret js.Promise[Window], exception js.Any, ok bool) { 1052 ok = js.True == bindings.TryDocumentPictureInPictureRequestWindow1( 1053 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1054 ) 1055 1056 return 1057 } 1058 1059 type External struct { 1060 ref js.Ref 1061 } 1062 1063 func (this External) Once() External { 1064 this.ref.Once() 1065 return this 1066 } 1067 1068 func (this External) Ref() js.Ref { 1069 return this.ref 1070 } 1071 1072 func (this External) FromRef(ref js.Ref) External { 1073 this.ref = ref 1074 return this 1075 } 1076 1077 func (this External) Free() { 1078 this.ref.Free() 1079 } 1080 1081 // HasFuncAddSearchProvider returns true if the method "External.AddSearchProvider" exists. 1082 func (this External) HasFuncAddSearchProvider() bool { 1083 return js.True == bindings.HasFuncExternalAddSearchProvider( 1084 this.ref, 1085 ) 1086 } 1087 1088 // FuncAddSearchProvider returns the method "External.AddSearchProvider". 1089 func (this External) FuncAddSearchProvider() (fn js.Func[func()]) { 1090 bindings.FuncExternalAddSearchProvider( 1091 this.ref, js.Pointer(&fn), 1092 ) 1093 return 1094 } 1095 1096 // AddSearchProvider calls the method "External.AddSearchProvider". 1097 func (this External) AddSearchProvider() (ret js.Void) { 1098 bindings.CallExternalAddSearchProvider( 1099 this.ref, js.Pointer(&ret), 1100 ) 1101 1102 return 1103 } 1104 1105 // TryAddSearchProvider calls the method "External.AddSearchProvider" 1106 // in a try/catch block and returns (_, err, ok = false) when it went through 1107 // the catch clause. 1108 func (this External) TryAddSearchProvider() (ret js.Void, exception js.Any, ok bool) { 1109 ok = js.True == bindings.TryExternalAddSearchProvider( 1110 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1111 ) 1112 1113 return 1114 } 1115 1116 // HasFuncIsSearchProviderInstalled returns true if the method "External.IsSearchProviderInstalled" exists. 1117 func (this External) HasFuncIsSearchProviderInstalled() bool { 1118 return js.True == bindings.HasFuncExternalIsSearchProviderInstalled( 1119 this.ref, 1120 ) 1121 } 1122 1123 // FuncIsSearchProviderInstalled returns the method "External.IsSearchProviderInstalled". 1124 func (this External) FuncIsSearchProviderInstalled() (fn js.Func[func()]) { 1125 bindings.FuncExternalIsSearchProviderInstalled( 1126 this.ref, js.Pointer(&fn), 1127 ) 1128 return 1129 } 1130 1131 // IsSearchProviderInstalled calls the method "External.IsSearchProviderInstalled". 1132 func (this External) IsSearchProviderInstalled() (ret js.Void) { 1133 bindings.CallExternalIsSearchProviderInstalled( 1134 this.ref, js.Pointer(&ret), 1135 ) 1136 1137 return 1138 } 1139 1140 // TryIsSearchProviderInstalled calls the method "External.IsSearchProviderInstalled" 1141 // in a try/catch block and returns (_, err, ok = false) when it went through 1142 // the catch clause. 1143 func (this External) TryIsSearchProviderInstalled() (ret js.Void, exception js.Any, ok bool) { 1144 ok = js.True == bindings.TryExternalIsSearchProviderInstalled( 1145 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1146 ) 1147 1148 return 1149 } 1150 1151 type SpeechSynthesisVoice struct { 1152 ref js.Ref 1153 } 1154 1155 func (this SpeechSynthesisVoice) Once() SpeechSynthesisVoice { 1156 this.ref.Once() 1157 return this 1158 } 1159 1160 func (this SpeechSynthesisVoice) Ref() js.Ref { 1161 return this.ref 1162 } 1163 1164 func (this SpeechSynthesisVoice) FromRef(ref js.Ref) SpeechSynthesisVoice { 1165 this.ref = ref 1166 return this 1167 } 1168 1169 func (this SpeechSynthesisVoice) Free() { 1170 this.ref.Free() 1171 } 1172 1173 // VoiceURI returns the value of property "SpeechSynthesisVoice.voiceURI". 1174 // 1175 // It returns ok=false if there is no such property. 1176 func (this SpeechSynthesisVoice) VoiceURI() (ret js.String, ok bool) { 1177 ok = js.True == bindings.GetSpeechSynthesisVoiceVoiceURI( 1178 this.ref, js.Pointer(&ret), 1179 ) 1180 return 1181 } 1182 1183 // Name returns the value of property "SpeechSynthesisVoice.name". 1184 // 1185 // It returns ok=false if there is no such property. 1186 func (this SpeechSynthesisVoice) Name() (ret js.String, ok bool) { 1187 ok = js.True == bindings.GetSpeechSynthesisVoiceName( 1188 this.ref, js.Pointer(&ret), 1189 ) 1190 return 1191 } 1192 1193 // Lang returns the value of property "SpeechSynthesisVoice.lang". 1194 // 1195 // It returns ok=false if there is no such property. 1196 func (this SpeechSynthesisVoice) Lang() (ret js.String, ok bool) { 1197 ok = js.True == bindings.GetSpeechSynthesisVoiceLang( 1198 this.ref, js.Pointer(&ret), 1199 ) 1200 return 1201 } 1202 1203 // LocalService returns the value of property "SpeechSynthesisVoice.localService". 1204 // 1205 // It returns ok=false if there is no such property. 1206 func (this SpeechSynthesisVoice) LocalService() (ret bool, ok bool) { 1207 ok = js.True == bindings.GetSpeechSynthesisVoiceLocalService( 1208 this.ref, js.Pointer(&ret), 1209 ) 1210 return 1211 } 1212 1213 // Default returns the value of property "SpeechSynthesisVoice.default". 1214 // 1215 // It returns ok=false if there is no such property. 1216 func (this SpeechSynthesisVoice) Default() (ret bool, ok bool) { 1217 ok = js.True == bindings.GetSpeechSynthesisVoiceDefault( 1218 this.ref, js.Pointer(&ret), 1219 ) 1220 return 1221 } 1222 1223 func NewSpeechSynthesisUtterance(text js.String) (ret SpeechSynthesisUtterance) { 1224 ret.ref = bindings.NewSpeechSynthesisUtteranceBySpeechSynthesisUtterance( 1225 text.Ref()) 1226 return 1227 } 1228 1229 func NewSpeechSynthesisUtteranceBySpeechSynthesisUtterance1() (ret SpeechSynthesisUtterance) { 1230 ret.ref = bindings.NewSpeechSynthesisUtteranceBySpeechSynthesisUtterance1() 1231 return 1232 } 1233 1234 type SpeechSynthesisUtterance struct { 1235 EventTarget 1236 } 1237 1238 func (this SpeechSynthesisUtterance) Once() SpeechSynthesisUtterance { 1239 this.ref.Once() 1240 return this 1241 } 1242 1243 func (this SpeechSynthesisUtterance) Ref() js.Ref { 1244 return this.EventTarget.Ref() 1245 } 1246 1247 func (this SpeechSynthesisUtterance) FromRef(ref js.Ref) SpeechSynthesisUtterance { 1248 this.EventTarget = this.EventTarget.FromRef(ref) 1249 return this 1250 } 1251 1252 func (this SpeechSynthesisUtterance) Free() { 1253 this.ref.Free() 1254 } 1255 1256 // Text returns the value of property "SpeechSynthesisUtterance.text". 1257 // 1258 // It returns ok=false if there is no such property. 1259 func (this SpeechSynthesisUtterance) Text() (ret js.String, ok bool) { 1260 ok = js.True == bindings.GetSpeechSynthesisUtteranceText( 1261 this.ref, js.Pointer(&ret), 1262 ) 1263 return 1264 } 1265 1266 // SetText sets the value of property "SpeechSynthesisUtterance.text" to val. 1267 // 1268 // It returns false if the property cannot be set. 1269 func (this SpeechSynthesisUtterance) SetText(val js.String) bool { 1270 return js.True == bindings.SetSpeechSynthesisUtteranceText( 1271 this.ref, 1272 val.Ref(), 1273 ) 1274 } 1275 1276 // Lang returns the value of property "SpeechSynthesisUtterance.lang". 1277 // 1278 // It returns ok=false if there is no such property. 1279 func (this SpeechSynthesisUtterance) Lang() (ret js.String, ok bool) { 1280 ok = js.True == bindings.GetSpeechSynthesisUtteranceLang( 1281 this.ref, js.Pointer(&ret), 1282 ) 1283 return 1284 } 1285 1286 // SetLang sets the value of property "SpeechSynthesisUtterance.lang" to val. 1287 // 1288 // It returns false if the property cannot be set. 1289 func (this SpeechSynthesisUtterance) SetLang(val js.String) bool { 1290 return js.True == bindings.SetSpeechSynthesisUtteranceLang( 1291 this.ref, 1292 val.Ref(), 1293 ) 1294 } 1295 1296 // Voice returns the value of property "SpeechSynthesisUtterance.voice". 1297 // 1298 // It returns ok=false if there is no such property. 1299 func (this SpeechSynthesisUtterance) Voice() (ret SpeechSynthesisVoice, ok bool) { 1300 ok = js.True == bindings.GetSpeechSynthesisUtteranceVoice( 1301 this.ref, js.Pointer(&ret), 1302 ) 1303 return 1304 } 1305 1306 // SetVoice sets the value of property "SpeechSynthesisUtterance.voice" to val. 1307 // 1308 // It returns false if the property cannot be set. 1309 func (this SpeechSynthesisUtterance) SetVoice(val SpeechSynthesisVoice) bool { 1310 return js.True == bindings.SetSpeechSynthesisUtteranceVoice( 1311 this.ref, 1312 val.Ref(), 1313 ) 1314 } 1315 1316 // Volume returns the value of property "SpeechSynthesisUtterance.volume". 1317 // 1318 // It returns ok=false if there is no such property. 1319 func (this SpeechSynthesisUtterance) Volume() (ret float32, ok bool) { 1320 ok = js.True == bindings.GetSpeechSynthesisUtteranceVolume( 1321 this.ref, js.Pointer(&ret), 1322 ) 1323 return 1324 } 1325 1326 // SetVolume sets the value of property "SpeechSynthesisUtterance.volume" to val. 1327 // 1328 // It returns false if the property cannot be set. 1329 func (this SpeechSynthesisUtterance) SetVolume(val float32) bool { 1330 return js.True == bindings.SetSpeechSynthesisUtteranceVolume( 1331 this.ref, 1332 float32(val), 1333 ) 1334 } 1335 1336 // Rate returns the value of property "SpeechSynthesisUtterance.rate". 1337 // 1338 // It returns ok=false if there is no such property. 1339 func (this SpeechSynthesisUtterance) Rate() (ret float32, ok bool) { 1340 ok = js.True == bindings.GetSpeechSynthesisUtteranceRate( 1341 this.ref, js.Pointer(&ret), 1342 ) 1343 return 1344 } 1345 1346 // SetRate sets the value of property "SpeechSynthesisUtterance.rate" to val. 1347 // 1348 // It returns false if the property cannot be set. 1349 func (this SpeechSynthesisUtterance) SetRate(val float32) bool { 1350 return js.True == bindings.SetSpeechSynthesisUtteranceRate( 1351 this.ref, 1352 float32(val), 1353 ) 1354 } 1355 1356 // Pitch returns the value of property "SpeechSynthesisUtterance.pitch". 1357 // 1358 // It returns ok=false if there is no such property. 1359 func (this SpeechSynthesisUtterance) Pitch() (ret float32, ok bool) { 1360 ok = js.True == bindings.GetSpeechSynthesisUtterancePitch( 1361 this.ref, js.Pointer(&ret), 1362 ) 1363 return 1364 } 1365 1366 // SetPitch sets the value of property "SpeechSynthesisUtterance.pitch" to val. 1367 // 1368 // It returns false if the property cannot be set. 1369 func (this SpeechSynthesisUtterance) SetPitch(val float32) bool { 1370 return js.True == bindings.SetSpeechSynthesisUtterancePitch( 1371 this.ref, 1372 float32(val), 1373 ) 1374 } 1375 1376 type SpeechSynthesis struct { 1377 EventTarget 1378 } 1379 1380 func (this SpeechSynthesis) Once() SpeechSynthesis { 1381 this.ref.Once() 1382 return this 1383 } 1384 1385 func (this SpeechSynthesis) Ref() js.Ref { 1386 return this.EventTarget.Ref() 1387 } 1388 1389 func (this SpeechSynthesis) FromRef(ref js.Ref) SpeechSynthesis { 1390 this.EventTarget = this.EventTarget.FromRef(ref) 1391 return this 1392 } 1393 1394 func (this SpeechSynthesis) Free() { 1395 this.ref.Free() 1396 } 1397 1398 // Pending returns the value of property "SpeechSynthesis.pending". 1399 // 1400 // It returns ok=false if there is no such property. 1401 func (this SpeechSynthesis) Pending() (ret bool, ok bool) { 1402 ok = js.True == bindings.GetSpeechSynthesisPending( 1403 this.ref, js.Pointer(&ret), 1404 ) 1405 return 1406 } 1407 1408 // Speaking returns the value of property "SpeechSynthesis.speaking". 1409 // 1410 // It returns ok=false if there is no such property. 1411 func (this SpeechSynthesis) Speaking() (ret bool, ok bool) { 1412 ok = js.True == bindings.GetSpeechSynthesisSpeaking( 1413 this.ref, js.Pointer(&ret), 1414 ) 1415 return 1416 } 1417 1418 // Paused returns the value of property "SpeechSynthesis.paused". 1419 // 1420 // It returns ok=false if there is no such property. 1421 func (this SpeechSynthesis) Paused() (ret bool, ok bool) { 1422 ok = js.True == bindings.GetSpeechSynthesisPaused( 1423 this.ref, js.Pointer(&ret), 1424 ) 1425 return 1426 } 1427 1428 // HasFuncSpeak returns true if the method "SpeechSynthesis.speak" exists. 1429 func (this SpeechSynthesis) HasFuncSpeak() bool { 1430 return js.True == bindings.HasFuncSpeechSynthesisSpeak( 1431 this.ref, 1432 ) 1433 } 1434 1435 // FuncSpeak returns the method "SpeechSynthesis.speak". 1436 func (this SpeechSynthesis) FuncSpeak() (fn js.Func[func(utterance SpeechSynthesisUtterance)]) { 1437 bindings.FuncSpeechSynthesisSpeak( 1438 this.ref, js.Pointer(&fn), 1439 ) 1440 return 1441 } 1442 1443 // Speak calls the method "SpeechSynthesis.speak". 1444 func (this SpeechSynthesis) Speak(utterance SpeechSynthesisUtterance) (ret js.Void) { 1445 bindings.CallSpeechSynthesisSpeak( 1446 this.ref, js.Pointer(&ret), 1447 utterance.Ref(), 1448 ) 1449 1450 return 1451 } 1452 1453 // TrySpeak calls the method "SpeechSynthesis.speak" 1454 // in a try/catch block and returns (_, err, ok = false) when it went through 1455 // the catch clause. 1456 func (this SpeechSynthesis) TrySpeak(utterance SpeechSynthesisUtterance) (ret js.Void, exception js.Any, ok bool) { 1457 ok = js.True == bindings.TrySpeechSynthesisSpeak( 1458 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1459 utterance.Ref(), 1460 ) 1461 1462 return 1463 } 1464 1465 // HasFuncCancel returns true if the method "SpeechSynthesis.cancel" exists. 1466 func (this SpeechSynthesis) HasFuncCancel() bool { 1467 return js.True == bindings.HasFuncSpeechSynthesisCancel( 1468 this.ref, 1469 ) 1470 } 1471 1472 // FuncCancel returns the method "SpeechSynthesis.cancel". 1473 func (this SpeechSynthesis) FuncCancel() (fn js.Func[func()]) { 1474 bindings.FuncSpeechSynthesisCancel( 1475 this.ref, js.Pointer(&fn), 1476 ) 1477 return 1478 } 1479 1480 // Cancel calls the method "SpeechSynthesis.cancel". 1481 func (this SpeechSynthesis) Cancel() (ret js.Void) { 1482 bindings.CallSpeechSynthesisCancel( 1483 this.ref, js.Pointer(&ret), 1484 ) 1485 1486 return 1487 } 1488 1489 // TryCancel calls the method "SpeechSynthesis.cancel" 1490 // in a try/catch block and returns (_, err, ok = false) when it went through 1491 // the catch clause. 1492 func (this SpeechSynthesis) TryCancel() (ret js.Void, exception js.Any, ok bool) { 1493 ok = js.True == bindings.TrySpeechSynthesisCancel( 1494 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1495 ) 1496 1497 return 1498 } 1499 1500 // HasFuncPause returns true if the method "SpeechSynthesis.pause" exists. 1501 func (this SpeechSynthesis) HasFuncPause() bool { 1502 return js.True == bindings.HasFuncSpeechSynthesisPause( 1503 this.ref, 1504 ) 1505 } 1506 1507 // FuncPause returns the method "SpeechSynthesis.pause". 1508 func (this SpeechSynthesis) FuncPause() (fn js.Func[func()]) { 1509 bindings.FuncSpeechSynthesisPause( 1510 this.ref, js.Pointer(&fn), 1511 ) 1512 return 1513 } 1514 1515 // Pause calls the method "SpeechSynthesis.pause". 1516 func (this SpeechSynthesis) Pause() (ret js.Void) { 1517 bindings.CallSpeechSynthesisPause( 1518 this.ref, js.Pointer(&ret), 1519 ) 1520 1521 return 1522 } 1523 1524 // TryPause calls the method "SpeechSynthesis.pause" 1525 // in a try/catch block and returns (_, err, ok = false) when it went through 1526 // the catch clause. 1527 func (this SpeechSynthesis) TryPause() (ret js.Void, exception js.Any, ok bool) { 1528 ok = js.True == bindings.TrySpeechSynthesisPause( 1529 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1530 ) 1531 1532 return 1533 } 1534 1535 // HasFuncResume returns true if the method "SpeechSynthesis.resume" exists. 1536 func (this SpeechSynthesis) HasFuncResume() bool { 1537 return js.True == bindings.HasFuncSpeechSynthesisResume( 1538 this.ref, 1539 ) 1540 } 1541 1542 // FuncResume returns the method "SpeechSynthesis.resume". 1543 func (this SpeechSynthesis) FuncResume() (fn js.Func[func()]) { 1544 bindings.FuncSpeechSynthesisResume( 1545 this.ref, js.Pointer(&fn), 1546 ) 1547 return 1548 } 1549 1550 // Resume calls the method "SpeechSynthesis.resume". 1551 func (this SpeechSynthesis) Resume() (ret js.Void) { 1552 bindings.CallSpeechSynthesisResume( 1553 this.ref, js.Pointer(&ret), 1554 ) 1555 1556 return 1557 } 1558 1559 // TryResume calls the method "SpeechSynthesis.resume" 1560 // in a try/catch block and returns (_, err, ok = false) when it went through 1561 // the catch clause. 1562 func (this SpeechSynthesis) TryResume() (ret js.Void, exception js.Any, ok bool) { 1563 ok = js.True == bindings.TrySpeechSynthesisResume( 1564 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1565 ) 1566 1567 return 1568 } 1569 1570 // HasFuncGetVoices returns true if the method "SpeechSynthesis.getVoices" exists. 1571 func (this SpeechSynthesis) HasFuncGetVoices() bool { 1572 return js.True == bindings.HasFuncSpeechSynthesisGetVoices( 1573 this.ref, 1574 ) 1575 } 1576 1577 // FuncGetVoices returns the method "SpeechSynthesis.getVoices". 1578 func (this SpeechSynthesis) FuncGetVoices() (fn js.Func[func() js.Array[SpeechSynthesisVoice]]) { 1579 bindings.FuncSpeechSynthesisGetVoices( 1580 this.ref, js.Pointer(&fn), 1581 ) 1582 return 1583 } 1584 1585 // GetVoices calls the method "SpeechSynthesis.getVoices". 1586 func (this SpeechSynthesis) GetVoices() (ret js.Array[SpeechSynthesisVoice]) { 1587 bindings.CallSpeechSynthesisGetVoices( 1588 this.ref, js.Pointer(&ret), 1589 ) 1590 1591 return 1592 } 1593 1594 // TryGetVoices calls the method "SpeechSynthesis.getVoices" 1595 // in a try/catch block and returns (_, err, ok = false) when it went through 1596 // the catch clause. 1597 func (this SpeechSynthesis) TryGetVoices() (ret js.Array[SpeechSynthesisVoice], exception js.Any, ok bool) { 1598 ok = js.True == bindings.TrySpeechSynthesisGetVoices( 1599 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1600 ) 1601 1602 return 1603 } 1604 1605 type SchedulerPostTaskCallbackFunc func(this js.Ref) js.Ref 1606 1607 func (fn SchedulerPostTaskCallbackFunc) Register() js.Func[func() js.Any] { 1608 return js.RegisterCallback[func() js.Any]( 1609 fn, abi.FuncPCABIInternal(fn), 1610 ) 1611 } 1612 1613 func (fn SchedulerPostTaskCallbackFunc) DispatchCallback( 1614 targetPC uintptr, ctx *js.CallbackContext, 1615 ) { 1616 args := ctx.Args() 1617 if len(args) != 0+1 /* js this */ || 1618 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1619 js.ThrowInvalidCallbackInvocation() 1620 } 1621 1622 if ctx.Return(fn( 1623 args[0], 1624 )) { 1625 return 1626 } 1627 1628 js.ThrowCallbackValueNotReturned() 1629 } 1630 1631 type SchedulerPostTaskCallback[T any] struct { 1632 Fn func(arg T, this js.Ref) js.Ref 1633 Arg T 1634 } 1635 1636 func (cb *SchedulerPostTaskCallback[T]) Register() js.Func[func() js.Any] { 1637 return js.RegisterCallback[func() js.Any]( 1638 cb, abi.FuncPCABIInternal(cb.Fn), 1639 ) 1640 } 1641 1642 func (cb *SchedulerPostTaskCallback[T]) DispatchCallback( 1643 targetPC uintptr, ctx *js.CallbackContext, 1644 ) { 1645 args := ctx.Args() 1646 if len(args) != 0+1 /* js this */ || 1647 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1648 js.ThrowInvalidCallbackInvocation() 1649 } 1650 1651 if ctx.Return(cb.Fn( 1652 cb.Arg, 1653 args[0], 1654 )) { 1655 return 1656 } 1657 1658 js.ThrowCallbackValueNotReturned() 1659 } 1660 1661 type TaskPriority uint32 1662 1663 const ( 1664 _ TaskPriority = iota 1665 1666 TaskPriority_USER_BLOCKING 1667 TaskPriority_USER_VISIBLE 1668 TaskPriority_BACKGROUND 1669 ) 1670 1671 func (TaskPriority) FromRef(str js.Ref) TaskPriority { 1672 return TaskPriority(bindings.ConstOfTaskPriority(str)) 1673 } 1674 1675 func (x TaskPriority) String() (string, bool) { 1676 switch x { 1677 case TaskPriority_USER_BLOCKING: 1678 return "user-blocking", true 1679 case TaskPriority_USER_VISIBLE: 1680 return "user-visible", true 1681 case TaskPriority_BACKGROUND: 1682 return "background", true 1683 default: 1684 return "", false 1685 } 1686 } 1687 1688 type SchedulerPostTaskOptions struct { 1689 // Signal is "SchedulerPostTaskOptions.signal" 1690 // 1691 // Optional 1692 Signal AbortSignal 1693 // Priority is "SchedulerPostTaskOptions.priority" 1694 // 1695 // Optional 1696 Priority TaskPriority 1697 // Delay is "SchedulerPostTaskOptions.delay" 1698 // 1699 // Optional, defaults to 0. 1700 // 1701 // NOTE: FFI_USE_Delay MUST be set to true to make this field effective. 1702 Delay uint64 1703 1704 FFI_USE_Delay bool // for Delay. 1705 1706 FFI_USE bool 1707 } 1708 1709 // FromRef calls UpdateFrom and returns a SchedulerPostTaskOptions with all fields set. 1710 func (p SchedulerPostTaskOptions) FromRef(ref js.Ref) SchedulerPostTaskOptions { 1711 p.UpdateFrom(ref) 1712 return p 1713 } 1714 1715 // New creates a new SchedulerPostTaskOptions in the application heap. 1716 func (p SchedulerPostTaskOptions) New() js.Ref { 1717 return bindings.SchedulerPostTaskOptionsJSLoad( 1718 js.Pointer(&p), js.True, 0, 1719 ) 1720 } 1721 1722 // UpdateFrom copies value of all fields of the heap object to p. 1723 func (p *SchedulerPostTaskOptions) UpdateFrom(ref js.Ref) { 1724 bindings.SchedulerPostTaskOptionsJSStore( 1725 js.Pointer(p), ref, 1726 ) 1727 } 1728 1729 // Update writes all fields of the p to the heap object referenced by ref. 1730 func (p *SchedulerPostTaskOptions) Update(ref js.Ref) { 1731 bindings.SchedulerPostTaskOptionsJSLoad( 1732 js.Pointer(p), js.False, ref, 1733 ) 1734 } 1735 1736 // FreeMembers frees fields with heap reference, if recursive is true 1737 // free all heap references reachable from p. 1738 func (p *SchedulerPostTaskOptions) FreeMembers(recursive bool) { 1739 js.Free( 1740 p.Signal.Ref(), 1741 ) 1742 p.Signal = p.Signal.FromRef(js.Undefined) 1743 } 1744 1745 type Scheduler struct { 1746 ref js.Ref 1747 } 1748 1749 func (this Scheduler) Once() Scheduler { 1750 this.ref.Once() 1751 return this 1752 } 1753 1754 func (this Scheduler) Ref() js.Ref { 1755 return this.ref 1756 } 1757 1758 func (this Scheduler) FromRef(ref js.Ref) Scheduler { 1759 this.ref = ref 1760 return this 1761 } 1762 1763 func (this Scheduler) Free() { 1764 this.ref.Free() 1765 } 1766 1767 // HasFuncPostTask returns true if the method "Scheduler.postTask" exists. 1768 func (this Scheduler) HasFuncPostTask() bool { 1769 return js.True == bindings.HasFuncSchedulerPostTask( 1770 this.ref, 1771 ) 1772 } 1773 1774 // FuncPostTask returns the method "Scheduler.postTask". 1775 func (this Scheduler) FuncPostTask() (fn js.Func[func(callback js.Func[func() js.Any], options SchedulerPostTaskOptions) js.Promise[js.Any]]) { 1776 bindings.FuncSchedulerPostTask( 1777 this.ref, js.Pointer(&fn), 1778 ) 1779 return 1780 } 1781 1782 // PostTask calls the method "Scheduler.postTask". 1783 func (this Scheduler) PostTask(callback js.Func[func() js.Any], options SchedulerPostTaskOptions) (ret js.Promise[js.Any]) { 1784 bindings.CallSchedulerPostTask( 1785 this.ref, js.Pointer(&ret), 1786 callback.Ref(), 1787 js.Pointer(&options), 1788 ) 1789 1790 return 1791 } 1792 1793 // TryPostTask calls the method "Scheduler.postTask" 1794 // in a try/catch block and returns (_, err, ok = false) when it went through 1795 // the catch clause. 1796 func (this Scheduler) TryPostTask(callback js.Func[func() js.Any], options SchedulerPostTaskOptions) (ret js.Promise[js.Any], exception js.Any, ok bool) { 1797 ok = js.True == bindings.TrySchedulerPostTask( 1798 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1799 callback.Ref(), 1800 js.Pointer(&options), 1801 ) 1802 1803 return 1804 } 1805 1806 // HasFuncPostTask1 returns true if the method "Scheduler.postTask" exists. 1807 func (this Scheduler) HasFuncPostTask1() bool { 1808 return js.True == bindings.HasFuncSchedulerPostTask1( 1809 this.ref, 1810 ) 1811 } 1812 1813 // FuncPostTask1 returns the method "Scheduler.postTask". 1814 func (this Scheduler) FuncPostTask1() (fn js.Func[func(callback js.Func[func() js.Any]) js.Promise[js.Any]]) { 1815 bindings.FuncSchedulerPostTask1( 1816 this.ref, js.Pointer(&fn), 1817 ) 1818 return 1819 } 1820 1821 // PostTask1 calls the method "Scheduler.postTask". 1822 func (this Scheduler) PostTask1(callback js.Func[func() js.Any]) (ret js.Promise[js.Any]) { 1823 bindings.CallSchedulerPostTask1( 1824 this.ref, js.Pointer(&ret), 1825 callback.Ref(), 1826 ) 1827 1828 return 1829 } 1830 1831 // TryPostTask1 calls the method "Scheduler.postTask" 1832 // in a try/catch block and returns (_, err, ok = false) when it went through 1833 // the catch clause. 1834 func (this Scheduler) TryPostTask1(callback js.Func[func() js.Any]) (ret js.Promise[js.Any], exception js.Any, ok bool) { 1835 ok = js.True == bindings.TrySchedulerPostTask1( 1836 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1837 callback.Ref(), 1838 ) 1839 1840 return 1841 } 1842 1843 type TrustedHTML struct { 1844 ref js.Ref 1845 } 1846 1847 func (this TrustedHTML) Once() TrustedHTML { 1848 this.ref.Once() 1849 return this 1850 } 1851 1852 func (this TrustedHTML) Ref() js.Ref { 1853 return this.ref 1854 } 1855 1856 func (this TrustedHTML) FromRef(ref js.Ref) TrustedHTML { 1857 this.ref = ref 1858 return this 1859 } 1860 1861 func (this TrustedHTML) Free() { 1862 this.ref.Free() 1863 } 1864 1865 // HasFuncToString returns true if the method "TrustedHTML.toString" exists. 1866 func (this TrustedHTML) HasFuncToString() bool { 1867 return js.True == bindings.HasFuncTrustedHTMLToString( 1868 this.ref, 1869 ) 1870 } 1871 1872 // FuncToString returns the method "TrustedHTML.toString". 1873 func (this TrustedHTML) FuncToString() (fn js.Func[func() js.String]) { 1874 bindings.FuncTrustedHTMLToString( 1875 this.ref, js.Pointer(&fn), 1876 ) 1877 return 1878 } 1879 1880 // ToString calls the method "TrustedHTML.toString". 1881 func (this TrustedHTML) ToString() (ret js.String) { 1882 bindings.CallTrustedHTMLToString( 1883 this.ref, js.Pointer(&ret), 1884 ) 1885 1886 return 1887 } 1888 1889 // TryToString calls the method "TrustedHTML.toString" 1890 // in a try/catch block and returns (_, err, ok = false) when it went through 1891 // the catch clause. 1892 func (this TrustedHTML) TryToString() (ret js.String, exception js.Any, ok bool) { 1893 ok = js.True == bindings.TryTrustedHTMLToString( 1894 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1895 ) 1896 1897 return 1898 } 1899 1900 // HasFuncToJSON returns true if the method "TrustedHTML.toJSON" exists. 1901 func (this TrustedHTML) HasFuncToJSON() bool { 1902 return js.True == bindings.HasFuncTrustedHTMLToJSON( 1903 this.ref, 1904 ) 1905 } 1906 1907 // FuncToJSON returns the method "TrustedHTML.toJSON". 1908 func (this TrustedHTML) FuncToJSON() (fn js.Func[func() js.String]) { 1909 bindings.FuncTrustedHTMLToJSON( 1910 this.ref, js.Pointer(&fn), 1911 ) 1912 return 1913 } 1914 1915 // ToJSON calls the method "TrustedHTML.toJSON". 1916 func (this TrustedHTML) ToJSON() (ret js.String) { 1917 bindings.CallTrustedHTMLToJSON( 1918 this.ref, js.Pointer(&ret), 1919 ) 1920 1921 return 1922 } 1923 1924 // TryToJSON calls the method "TrustedHTML.toJSON" 1925 // in a try/catch block and returns (_, err, ok = false) when it went through 1926 // the catch clause. 1927 func (this TrustedHTML) TryToJSON() (ret js.String, exception js.Any, ok bool) { 1928 ok = js.True == bindings.TryTrustedHTMLToJSON( 1929 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1930 ) 1931 1932 return 1933 } 1934 1935 // HasFuncFromLiteral returns true if the static method "TrustedHTML.fromLiteral" exists. 1936 func (this TrustedHTML) HasFuncFromLiteral() bool { 1937 return js.True == bindings.HasFuncTrustedHTMLFromLiteral( 1938 this.ref, 1939 ) 1940 } 1941 1942 // FuncFromLiteral returns the static method "TrustedHTML.fromLiteral". 1943 func (this TrustedHTML) FuncFromLiteral() (fn js.Func[func(templateStringsArray js.Object) TrustedHTML]) { 1944 bindings.FuncTrustedHTMLFromLiteral( 1945 this.ref, js.Pointer(&fn), 1946 ) 1947 return 1948 } 1949 1950 // FromLiteral calls the static method "TrustedHTML.fromLiteral". 1951 func (this TrustedHTML) FromLiteral(templateStringsArray js.Object) (ret TrustedHTML) { 1952 bindings.CallTrustedHTMLFromLiteral( 1953 this.ref, js.Pointer(&ret), 1954 templateStringsArray.Ref(), 1955 ) 1956 1957 return 1958 } 1959 1960 // TryFromLiteral calls the static method "TrustedHTML.fromLiteral" 1961 // in a try/catch block and returns (_, err, ok = false) when it went through 1962 // the catch clause. 1963 func (this TrustedHTML) TryFromLiteral(templateStringsArray js.Object) (ret TrustedHTML, exception js.Any, ok bool) { 1964 ok = js.True == bindings.TryTrustedHTMLFromLiteral( 1965 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1966 templateStringsArray.Ref(), 1967 ) 1968 1969 return 1970 } 1971 1972 type TrustedScript struct { 1973 ref js.Ref 1974 } 1975 1976 func (this TrustedScript) Once() TrustedScript { 1977 this.ref.Once() 1978 return this 1979 } 1980 1981 func (this TrustedScript) Ref() js.Ref { 1982 return this.ref 1983 } 1984 1985 func (this TrustedScript) FromRef(ref js.Ref) TrustedScript { 1986 this.ref = ref 1987 return this 1988 } 1989 1990 func (this TrustedScript) Free() { 1991 this.ref.Free() 1992 } 1993 1994 // HasFuncToString returns true if the method "TrustedScript.toString" exists. 1995 func (this TrustedScript) HasFuncToString() bool { 1996 return js.True == bindings.HasFuncTrustedScriptToString( 1997 this.ref, 1998 ) 1999 } 2000 2001 // FuncToString returns the method "TrustedScript.toString". 2002 func (this TrustedScript) FuncToString() (fn js.Func[func() js.String]) { 2003 bindings.FuncTrustedScriptToString( 2004 this.ref, js.Pointer(&fn), 2005 ) 2006 return 2007 } 2008 2009 // ToString calls the method "TrustedScript.toString". 2010 func (this TrustedScript) ToString() (ret js.String) { 2011 bindings.CallTrustedScriptToString( 2012 this.ref, js.Pointer(&ret), 2013 ) 2014 2015 return 2016 } 2017 2018 // TryToString calls the method "TrustedScript.toString" 2019 // in a try/catch block and returns (_, err, ok = false) when it went through 2020 // the catch clause. 2021 func (this TrustedScript) TryToString() (ret js.String, exception js.Any, ok bool) { 2022 ok = js.True == bindings.TryTrustedScriptToString( 2023 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2024 ) 2025 2026 return 2027 } 2028 2029 // HasFuncToJSON returns true if the method "TrustedScript.toJSON" exists. 2030 func (this TrustedScript) HasFuncToJSON() bool { 2031 return js.True == bindings.HasFuncTrustedScriptToJSON( 2032 this.ref, 2033 ) 2034 } 2035 2036 // FuncToJSON returns the method "TrustedScript.toJSON". 2037 func (this TrustedScript) FuncToJSON() (fn js.Func[func() js.String]) { 2038 bindings.FuncTrustedScriptToJSON( 2039 this.ref, js.Pointer(&fn), 2040 ) 2041 return 2042 } 2043 2044 // ToJSON calls the method "TrustedScript.toJSON". 2045 func (this TrustedScript) ToJSON() (ret js.String) { 2046 bindings.CallTrustedScriptToJSON( 2047 this.ref, js.Pointer(&ret), 2048 ) 2049 2050 return 2051 } 2052 2053 // TryToJSON calls the method "TrustedScript.toJSON" 2054 // in a try/catch block and returns (_, err, ok = false) when it went through 2055 // the catch clause. 2056 func (this TrustedScript) TryToJSON() (ret js.String, exception js.Any, ok bool) { 2057 ok = js.True == bindings.TryTrustedScriptToJSON( 2058 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2059 ) 2060 2061 return 2062 } 2063 2064 // HasFuncFromLiteral returns true if the static method "TrustedScript.fromLiteral" exists. 2065 func (this TrustedScript) HasFuncFromLiteral() bool { 2066 return js.True == bindings.HasFuncTrustedScriptFromLiteral( 2067 this.ref, 2068 ) 2069 } 2070 2071 // FuncFromLiteral returns the static method "TrustedScript.fromLiteral". 2072 func (this TrustedScript) FuncFromLiteral() (fn js.Func[func(templateStringsArray js.Object) TrustedScript]) { 2073 bindings.FuncTrustedScriptFromLiteral( 2074 this.ref, js.Pointer(&fn), 2075 ) 2076 return 2077 } 2078 2079 // FromLiteral calls the static method "TrustedScript.fromLiteral". 2080 func (this TrustedScript) FromLiteral(templateStringsArray js.Object) (ret TrustedScript) { 2081 bindings.CallTrustedScriptFromLiteral( 2082 this.ref, js.Pointer(&ret), 2083 templateStringsArray.Ref(), 2084 ) 2085 2086 return 2087 } 2088 2089 // TryFromLiteral calls the static method "TrustedScript.fromLiteral" 2090 // in a try/catch block and returns (_, err, ok = false) when it went through 2091 // the catch clause. 2092 func (this TrustedScript) TryFromLiteral(templateStringsArray js.Object) (ret TrustedScript, exception js.Any, ok bool) { 2093 ok = js.True == bindings.TryTrustedScriptFromLiteral( 2094 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2095 templateStringsArray.Ref(), 2096 ) 2097 2098 return 2099 } 2100 2101 type TrustedScriptURL struct { 2102 ref js.Ref 2103 } 2104 2105 func (this TrustedScriptURL) Once() TrustedScriptURL { 2106 this.ref.Once() 2107 return this 2108 } 2109 2110 func (this TrustedScriptURL) Ref() js.Ref { 2111 return this.ref 2112 } 2113 2114 func (this TrustedScriptURL) FromRef(ref js.Ref) TrustedScriptURL { 2115 this.ref = ref 2116 return this 2117 } 2118 2119 func (this TrustedScriptURL) Free() { 2120 this.ref.Free() 2121 } 2122 2123 // HasFuncToString returns true if the method "TrustedScriptURL.toString" exists. 2124 func (this TrustedScriptURL) HasFuncToString() bool { 2125 return js.True == bindings.HasFuncTrustedScriptURLToString( 2126 this.ref, 2127 ) 2128 } 2129 2130 // FuncToString returns the method "TrustedScriptURL.toString". 2131 func (this TrustedScriptURL) FuncToString() (fn js.Func[func() js.String]) { 2132 bindings.FuncTrustedScriptURLToString( 2133 this.ref, js.Pointer(&fn), 2134 ) 2135 return 2136 } 2137 2138 // ToString calls the method "TrustedScriptURL.toString". 2139 func (this TrustedScriptURL) ToString() (ret js.String) { 2140 bindings.CallTrustedScriptURLToString( 2141 this.ref, js.Pointer(&ret), 2142 ) 2143 2144 return 2145 } 2146 2147 // TryToString calls the method "TrustedScriptURL.toString" 2148 // in a try/catch block and returns (_, err, ok = false) when it went through 2149 // the catch clause. 2150 func (this TrustedScriptURL) TryToString() (ret js.String, exception js.Any, ok bool) { 2151 ok = js.True == bindings.TryTrustedScriptURLToString( 2152 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2153 ) 2154 2155 return 2156 } 2157 2158 // HasFuncToJSON returns true if the method "TrustedScriptURL.toJSON" exists. 2159 func (this TrustedScriptURL) HasFuncToJSON() bool { 2160 return js.True == bindings.HasFuncTrustedScriptURLToJSON( 2161 this.ref, 2162 ) 2163 } 2164 2165 // FuncToJSON returns the method "TrustedScriptURL.toJSON". 2166 func (this TrustedScriptURL) FuncToJSON() (fn js.Func[func() js.String]) { 2167 bindings.FuncTrustedScriptURLToJSON( 2168 this.ref, js.Pointer(&fn), 2169 ) 2170 return 2171 } 2172 2173 // ToJSON calls the method "TrustedScriptURL.toJSON". 2174 func (this TrustedScriptURL) ToJSON() (ret js.String) { 2175 bindings.CallTrustedScriptURLToJSON( 2176 this.ref, js.Pointer(&ret), 2177 ) 2178 2179 return 2180 } 2181 2182 // TryToJSON calls the method "TrustedScriptURL.toJSON" 2183 // in a try/catch block and returns (_, err, ok = false) when it went through 2184 // the catch clause. 2185 func (this TrustedScriptURL) TryToJSON() (ret js.String, exception js.Any, ok bool) { 2186 ok = js.True == bindings.TryTrustedScriptURLToJSON( 2187 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2188 ) 2189 2190 return 2191 } 2192 2193 // HasFuncFromLiteral returns true if the static method "TrustedScriptURL.fromLiteral" exists. 2194 func (this TrustedScriptURL) HasFuncFromLiteral() bool { 2195 return js.True == bindings.HasFuncTrustedScriptURLFromLiteral( 2196 this.ref, 2197 ) 2198 } 2199 2200 // FuncFromLiteral returns the static method "TrustedScriptURL.fromLiteral". 2201 func (this TrustedScriptURL) FuncFromLiteral() (fn js.Func[func(templateStringsArray js.Object) TrustedScriptURL]) { 2202 bindings.FuncTrustedScriptURLFromLiteral( 2203 this.ref, js.Pointer(&fn), 2204 ) 2205 return 2206 } 2207 2208 // FromLiteral calls the static method "TrustedScriptURL.fromLiteral". 2209 func (this TrustedScriptURL) FromLiteral(templateStringsArray js.Object) (ret TrustedScriptURL) { 2210 bindings.CallTrustedScriptURLFromLiteral( 2211 this.ref, js.Pointer(&ret), 2212 templateStringsArray.Ref(), 2213 ) 2214 2215 return 2216 } 2217 2218 // TryFromLiteral calls the static method "TrustedScriptURL.fromLiteral" 2219 // in a try/catch block and returns (_, err, ok = false) when it went through 2220 // the catch clause. 2221 func (this TrustedScriptURL) TryFromLiteral(templateStringsArray js.Object) (ret TrustedScriptURL, exception js.Any, ok bool) { 2222 ok = js.True == bindings.TryTrustedScriptURLFromLiteral( 2223 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2224 templateStringsArray.Ref(), 2225 ) 2226 2227 return 2228 } 2229 2230 type TrustedTypePolicy struct { 2231 ref js.Ref 2232 } 2233 2234 func (this TrustedTypePolicy) Once() TrustedTypePolicy { 2235 this.ref.Once() 2236 return this 2237 } 2238 2239 func (this TrustedTypePolicy) Ref() js.Ref { 2240 return this.ref 2241 } 2242 2243 func (this TrustedTypePolicy) FromRef(ref js.Ref) TrustedTypePolicy { 2244 this.ref = ref 2245 return this 2246 } 2247 2248 func (this TrustedTypePolicy) Free() { 2249 this.ref.Free() 2250 } 2251 2252 // Name returns the value of property "TrustedTypePolicy.name". 2253 // 2254 // It returns ok=false if there is no such property. 2255 func (this TrustedTypePolicy) Name() (ret js.String, ok bool) { 2256 ok = js.True == bindings.GetTrustedTypePolicyName( 2257 this.ref, js.Pointer(&ret), 2258 ) 2259 return 2260 } 2261 2262 // HasFuncCreateHTML returns true if the method "TrustedTypePolicy.createHTML" exists. 2263 func (this TrustedTypePolicy) HasFuncCreateHTML() bool { 2264 return js.True == bindings.HasFuncTrustedTypePolicyCreateHTML( 2265 this.ref, 2266 ) 2267 } 2268 2269 // FuncCreateHTML returns the method "TrustedTypePolicy.createHTML". 2270 func (this TrustedTypePolicy) FuncCreateHTML() (fn js.Func[func(input js.String, arguments ...js.Any) TrustedHTML]) { 2271 bindings.FuncTrustedTypePolicyCreateHTML( 2272 this.ref, js.Pointer(&fn), 2273 ) 2274 return 2275 } 2276 2277 // CreateHTML calls the method "TrustedTypePolicy.createHTML". 2278 func (this TrustedTypePolicy) CreateHTML(input js.String, arguments ...js.Any) (ret TrustedHTML) { 2279 bindings.CallTrustedTypePolicyCreateHTML( 2280 this.ref, js.Pointer(&ret), 2281 input.Ref(), 2282 js.SliceData(arguments), 2283 js.SizeU(len(arguments)), 2284 ) 2285 2286 return 2287 } 2288 2289 // TryCreateHTML calls the method "TrustedTypePolicy.createHTML" 2290 // in a try/catch block and returns (_, err, ok = false) when it went through 2291 // the catch clause. 2292 func (this TrustedTypePolicy) TryCreateHTML(input js.String, arguments ...js.Any) (ret TrustedHTML, exception js.Any, ok bool) { 2293 ok = js.True == bindings.TryTrustedTypePolicyCreateHTML( 2294 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2295 input.Ref(), 2296 js.SliceData(arguments), 2297 js.SizeU(len(arguments)), 2298 ) 2299 2300 return 2301 } 2302 2303 // HasFuncCreateScript returns true if the method "TrustedTypePolicy.createScript" exists. 2304 func (this TrustedTypePolicy) HasFuncCreateScript() bool { 2305 return js.True == bindings.HasFuncTrustedTypePolicyCreateScript( 2306 this.ref, 2307 ) 2308 } 2309 2310 // FuncCreateScript returns the method "TrustedTypePolicy.createScript". 2311 func (this TrustedTypePolicy) FuncCreateScript() (fn js.Func[func(input js.String, arguments ...js.Any) TrustedScript]) { 2312 bindings.FuncTrustedTypePolicyCreateScript( 2313 this.ref, js.Pointer(&fn), 2314 ) 2315 return 2316 } 2317 2318 // CreateScript calls the method "TrustedTypePolicy.createScript". 2319 func (this TrustedTypePolicy) CreateScript(input js.String, arguments ...js.Any) (ret TrustedScript) { 2320 bindings.CallTrustedTypePolicyCreateScript( 2321 this.ref, js.Pointer(&ret), 2322 input.Ref(), 2323 js.SliceData(arguments), 2324 js.SizeU(len(arguments)), 2325 ) 2326 2327 return 2328 } 2329 2330 // TryCreateScript calls the method "TrustedTypePolicy.createScript" 2331 // in a try/catch block and returns (_, err, ok = false) when it went through 2332 // the catch clause. 2333 func (this TrustedTypePolicy) TryCreateScript(input js.String, arguments ...js.Any) (ret TrustedScript, exception js.Any, ok bool) { 2334 ok = js.True == bindings.TryTrustedTypePolicyCreateScript( 2335 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2336 input.Ref(), 2337 js.SliceData(arguments), 2338 js.SizeU(len(arguments)), 2339 ) 2340 2341 return 2342 } 2343 2344 // HasFuncCreateScriptURL returns true if the method "TrustedTypePolicy.createScriptURL" exists. 2345 func (this TrustedTypePolicy) HasFuncCreateScriptURL() bool { 2346 return js.True == bindings.HasFuncTrustedTypePolicyCreateScriptURL( 2347 this.ref, 2348 ) 2349 } 2350 2351 // FuncCreateScriptURL returns the method "TrustedTypePolicy.createScriptURL". 2352 func (this TrustedTypePolicy) FuncCreateScriptURL() (fn js.Func[func(input js.String, arguments ...js.Any) TrustedScriptURL]) { 2353 bindings.FuncTrustedTypePolicyCreateScriptURL( 2354 this.ref, js.Pointer(&fn), 2355 ) 2356 return 2357 } 2358 2359 // CreateScriptURL calls the method "TrustedTypePolicy.createScriptURL". 2360 func (this TrustedTypePolicy) CreateScriptURL(input js.String, arguments ...js.Any) (ret TrustedScriptURL) { 2361 bindings.CallTrustedTypePolicyCreateScriptURL( 2362 this.ref, js.Pointer(&ret), 2363 input.Ref(), 2364 js.SliceData(arguments), 2365 js.SizeU(len(arguments)), 2366 ) 2367 2368 return 2369 } 2370 2371 // TryCreateScriptURL calls the method "TrustedTypePolicy.createScriptURL" 2372 // in a try/catch block and returns (_, err, ok = false) when it went through 2373 // the catch clause. 2374 func (this TrustedTypePolicy) TryCreateScriptURL(input js.String, arguments ...js.Any) (ret TrustedScriptURL, exception js.Any, ok bool) { 2375 ok = js.True == bindings.TryTrustedTypePolicyCreateScriptURL( 2376 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2377 input.Ref(), 2378 js.SliceData(arguments), 2379 js.SizeU(len(arguments)), 2380 ) 2381 2382 return 2383 } 2384 2385 type CreateHTMLCallbackFunc func(this js.Ref, input js.String, arguments ...js.Any) js.Ref 2386 2387 func (fn CreateHTMLCallbackFunc) Register() js.Func[func(input js.String, arguments ...js.Any) js.String] { 2388 return js.RegisterCallback[func(input js.String, arguments ...js.Any) js.String]( 2389 fn, abi.FuncPCABIInternal(fn), 2390 ) 2391 } 2392 2393 func (fn CreateHTMLCallbackFunc) DispatchCallback( 2394 targetPC uintptr, ctx *js.CallbackContext, 2395 ) { 2396 args := ctx.Args() 2397 if len(args) != 2+1 /* js this */ || 2398 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2399 js.ThrowInvalidCallbackInvocation() 2400 } 2401 2402 if ctx.Return(fn( 2403 args[0], 2404 2405 js.String{}.FromRef(args[0+1]), 2406 js.Any{}.FromRef(args[1+1]), 2407 )) { 2408 return 2409 } 2410 2411 js.ThrowCallbackValueNotReturned() 2412 } 2413 2414 type CreateHTMLCallback[T any] struct { 2415 Fn func(arg T, this js.Ref, input js.String, arguments ...js.Any) js.Ref 2416 Arg T 2417 } 2418 2419 func (cb *CreateHTMLCallback[T]) Register() js.Func[func(input js.String, arguments ...js.Any) js.String] { 2420 return js.RegisterCallback[func(input js.String, arguments ...js.Any) js.String]( 2421 cb, abi.FuncPCABIInternal(cb.Fn), 2422 ) 2423 } 2424 2425 func (cb *CreateHTMLCallback[T]) DispatchCallback( 2426 targetPC uintptr, ctx *js.CallbackContext, 2427 ) { 2428 args := ctx.Args() 2429 if len(args) != 2+1 /* js this */ || 2430 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2431 js.ThrowInvalidCallbackInvocation() 2432 } 2433 2434 if ctx.Return(cb.Fn( 2435 cb.Arg, 2436 args[0], 2437 2438 js.String{}.FromRef(args[0+1]), 2439 js.Any{}.FromRef(args[1+1]), 2440 )) { 2441 return 2442 } 2443 2444 js.ThrowCallbackValueNotReturned() 2445 } 2446 2447 type CreateScriptCallbackFunc func(this js.Ref, input js.String, arguments ...js.Any) js.Ref 2448 2449 func (fn CreateScriptCallbackFunc) Register() js.Func[func(input js.String, arguments ...js.Any) js.String] { 2450 return js.RegisterCallback[func(input js.String, arguments ...js.Any) js.String]( 2451 fn, abi.FuncPCABIInternal(fn), 2452 ) 2453 } 2454 2455 func (fn CreateScriptCallbackFunc) DispatchCallback( 2456 targetPC uintptr, ctx *js.CallbackContext, 2457 ) { 2458 args := ctx.Args() 2459 if len(args) != 2+1 /* js this */ || 2460 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2461 js.ThrowInvalidCallbackInvocation() 2462 } 2463 2464 if ctx.Return(fn( 2465 args[0], 2466 2467 js.String{}.FromRef(args[0+1]), 2468 js.Any{}.FromRef(args[1+1]), 2469 )) { 2470 return 2471 } 2472 2473 js.ThrowCallbackValueNotReturned() 2474 } 2475 2476 type CreateScriptCallback[T any] struct { 2477 Fn func(arg T, this js.Ref, input js.String, arguments ...js.Any) js.Ref 2478 Arg T 2479 } 2480 2481 func (cb *CreateScriptCallback[T]) Register() js.Func[func(input js.String, arguments ...js.Any) js.String] { 2482 return js.RegisterCallback[func(input js.String, arguments ...js.Any) js.String]( 2483 cb, abi.FuncPCABIInternal(cb.Fn), 2484 ) 2485 } 2486 2487 func (cb *CreateScriptCallback[T]) DispatchCallback( 2488 targetPC uintptr, ctx *js.CallbackContext, 2489 ) { 2490 args := ctx.Args() 2491 if len(args) != 2+1 /* js this */ || 2492 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2493 js.ThrowInvalidCallbackInvocation() 2494 } 2495 2496 if ctx.Return(cb.Fn( 2497 cb.Arg, 2498 args[0], 2499 2500 js.String{}.FromRef(args[0+1]), 2501 js.Any{}.FromRef(args[1+1]), 2502 )) { 2503 return 2504 } 2505 2506 js.ThrowCallbackValueNotReturned() 2507 } 2508 2509 type CreateScriptURLCallbackFunc func(this js.Ref, input js.String, arguments ...js.Any) js.Ref 2510 2511 func (fn CreateScriptURLCallbackFunc) Register() js.Func[func(input js.String, arguments ...js.Any) js.String] { 2512 return js.RegisterCallback[func(input js.String, arguments ...js.Any) js.String]( 2513 fn, abi.FuncPCABIInternal(fn), 2514 ) 2515 } 2516 2517 func (fn CreateScriptURLCallbackFunc) DispatchCallback( 2518 targetPC uintptr, ctx *js.CallbackContext, 2519 ) { 2520 args := ctx.Args() 2521 if len(args) != 2+1 /* js this */ || 2522 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 2523 js.ThrowInvalidCallbackInvocation() 2524 } 2525 2526 if ctx.Return(fn( 2527 args[0], 2528 2529 js.String{}.FromRef(args[0+1]), 2530 js.Any{}.FromRef(args[1+1]), 2531 )) { 2532 return 2533 } 2534 2535 js.ThrowCallbackValueNotReturned() 2536 } 2537 2538 type CreateScriptURLCallback[T any] struct { 2539 Fn func(arg T, this js.Ref, input js.String, arguments ...js.Any) js.Ref 2540 Arg T 2541 } 2542 2543 func (cb *CreateScriptURLCallback[T]) Register() js.Func[func(input js.String, arguments ...js.Any) js.String] { 2544 return js.RegisterCallback[func(input js.String, arguments ...js.Any) js.String]( 2545 cb, abi.FuncPCABIInternal(cb.Fn), 2546 ) 2547 } 2548 2549 func (cb *CreateScriptURLCallback[T]) DispatchCallback( 2550 targetPC uintptr, ctx *js.CallbackContext, 2551 ) { 2552 args := ctx.Args() 2553 if len(args) != 2+1 /* js this */ || 2554 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 2555 js.ThrowInvalidCallbackInvocation() 2556 } 2557 2558 if ctx.Return(cb.Fn( 2559 cb.Arg, 2560 args[0], 2561 2562 js.String{}.FromRef(args[0+1]), 2563 js.Any{}.FromRef(args[1+1]), 2564 )) { 2565 return 2566 } 2567 2568 js.ThrowCallbackValueNotReturned() 2569 } 2570 2571 type TrustedTypePolicyOptions struct { 2572 // CreateHTML is "TrustedTypePolicyOptions.createHTML" 2573 // 2574 // Optional 2575 CreateHTML js.Func[func(input js.String, arguments ...js.Any) js.String] 2576 // CreateScript is "TrustedTypePolicyOptions.createScript" 2577 // 2578 // Optional 2579 CreateScript js.Func[func(input js.String, arguments ...js.Any) js.String] 2580 // CreateScriptURL is "TrustedTypePolicyOptions.createScriptURL" 2581 // 2582 // Optional 2583 CreateScriptURL js.Func[func(input js.String, arguments ...js.Any) js.String] 2584 2585 FFI_USE bool 2586 } 2587 2588 // FromRef calls UpdateFrom and returns a TrustedTypePolicyOptions with all fields set. 2589 func (p TrustedTypePolicyOptions) FromRef(ref js.Ref) TrustedTypePolicyOptions { 2590 p.UpdateFrom(ref) 2591 return p 2592 } 2593 2594 // New creates a new TrustedTypePolicyOptions in the application heap. 2595 func (p TrustedTypePolicyOptions) New() js.Ref { 2596 return bindings.TrustedTypePolicyOptionsJSLoad( 2597 js.Pointer(&p), js.True, 0, 2598 ) 2599 } 2600 2601 // UpdateFrom copies value of all fields of the heap object to p. 2602 func (p *TrustedTypePolicyOptions) UpdateFrom(ref js.Ref) { 2603 bindings.TrustedTypePolicyOptionsJSStore( 2604 js.Pointer(p), ref, 2605 ) 2606 } 2607 2608 // Update writes all fields of the p to the heap object referenced by ref. 2609 func (p *TrustedTypePolicyOptions) Update(ref js.Ref) { 2610 bindings.TrustedTypePolicyOptionsJSLoad( 2611 js.Pointer(p), js.False, ref, 2612 ) 2613 } 2614 2615 // FreeMembers frees fields with heap reference, if recursive is true 2616 // free all heap references reachable from p. 2617 func (p *TrustedTypePolicyOptions) FreeMembers(recursive bool) { 2618 js.Free( 2619 p.CreateHTML.Ref(), 2620 p.CreateScript.Ref(), 2621 p.CreateScriptURL.Ref(), 2622 ) 2623 p.CreateHTML = p.CreateHTML.FromRef(js.Undefined) 2624 p.CreateScript = p.CreateScript.FromRef(js.Undefined) 2625 p.CreateScriptURL = p.CreateScriptURL.FromRef(js.Undefined) 2626 } 2627 2628 type TrustedTypePolicyFactory struct { 2629 ref js.Ref 2630 } 2631 2632 func (this TrustedTypePolicyFactory) Once() TrustedTypePolicyFactory { 2633 this.ref.Once() 2634 return this 2635 } 2636 2637 func (this TrustedTypePolicyFactory) Ref() js.Ref { 2638 return this.ref 2639 } 2640 2641 func (this TrustedTypePolicyFactory) FromRef(ref js.Ref) TrustedTypePolicyFactory { 2642 this.ref = ref 2643 return this 2644 } 2645 2646 func (this TrustedTypePolicyFactory) Free() { 2647 this.ref.Free() 2648 } 2649 2650 // EmptyHTML returns the value of property "TrustedTypePolicyFactory.emptyHTML". 2651 // 2652 // It returns ok=false if there is no such property. 2653 func (this TrustedTypePolicyFactory) EmptyHTML() (ret TrustedHTML, ok bool) { 2654 ok = js.True == bindings.GetTrustedTypePolicyFactoryEmptyHTML( 2655 this.ref, js.Pointer(&ret), 2656 ) 2657 return 2658 } 2659 2660 // EmptyScript returns the value of property "TrustedTypePolicyFactory.emptyScript". 2661 // 2662 // It returns ok=false if there is no such property. 2663 func (this TrustedTypePolicyFactory) EmptyScript() (ret TrustedScript, ok bool) { 2664 ok = js.True == bindings.GetTrustedTypePolicyFactoryEmptyScript( 2665 this.ref, js.Pointer(&ret), 2666 ) 2667 return 2668 } 2669 2670 // DefaultPolicy returns the value of property "TrustedTypePolicyFactory.defaultPolicy". 2671 // 2672 // It returns ok=false if there is no such property. 2673 func (this TrustedTypePolicyFactory) DefaultPolicy() (ret TrustedTypePolicy, ok bool) { 2674 ok = js.True == bindings.GetTrustedTypePolicyFactoryDefaultPolicy( 2675 this.ref, js.Pointer(&ret), 2676 ) 2677 return 2678 } 2679 2680 // HasFuncCreatePolicy returns true if the method "TrustedTypePolicyFactory.createPolicy" exists. 2681 func (this TrustedTypePolicyFactory) HasFuncCreatePolicy() bool { 2682 return js.True == bindings.HasFuncTrustedTypePolicyFactoryCreatePolicy( 2683 this.ref, 2684 ) 2685 } 2686 2687 // FuncCreatePolicy returns the method "TrustedTypePolicyFactory.createPolicy". 2688 func (this TrustedTypePolicyFactory) FuncCreatePolicy() (fn js.Func[func(policyName js.String, policyOptions TrustedTypePolicyOptions) TrustedTypePolicy]) { 2689 bindings.FuncTrustedTypePolicyFactoryCreatePolicy( 2690 this.ref, js.Pointer(&fn), 2691 ) 2692 return 2693 } 2694 2695 // CreatePolicy calls the method "TrustedTypePolicyFactory.createPolicy". 2696 func (this TrustedTypePolicyFactory) CreatePolicy(policyName js.String, policyOptions TrustedTypePolicyOptions) (ret TrustedTypePolicy) { 2697 bindings.CallTrustedTypePolicyFactoryCreatePolicy( 2698 this.ref, js.Pointer(&ret), 2699 policyName.Ref(), 2700 js.Pointer(&policyOptions), 2701 ) 2702 2703 return 2704 } 2705 2706 // TryCreatePolicy calls the method "TrustedTypePolicyFactory.createPolicy" 2707 // in a try/catch block and returns (_, err, ok = false) when it went through 2708 // the catch clause. 2709 func (this TrustedTypePolicyFactory) TryCreatePolicy(policyName js.String, policyOptions TrustedTypePolicyOptions) (ret TrustedTypePolicy, exception js.Any, ok bool) { 2710 ok = js.True == bindings.TryTrustedTypePolicyFactoryCreatePolicy( 2711 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2712 policyName.Ref(), 2713 js.Pointer(&policyOptions), 2714 ) 2715 2716 return 2717 } 2718 2719 // HasFuncCreatePolicy1 returns true if the method "TrustedTypePolicyFactory.createPolicy" exists. 2720 func (this TrustedTypePolicyFactory) HasFuncCreatePolicy1() bool { 2721 return js.True == bindings.HasFuncTrustedTypePolicyFactoryCreatePolicy1( 2722 this.ref, 2723 ) 2724 } 2725 2726 // FuncCreatePolicy1 returns the method "TrustedTypePolicyFactory.createPolicy". 2727 func (this TrustedTypePolicyFactory) FuncCreatePolicy1() (fn js.Func[func(policyName js.String) TrustedTypePolicy]) { 2728 bindings.FuncTrustedTypePolicyFactoryCreatePolicy1( 2729 this.ref, js.Pointer(&fn), 2730 ) 2731 return 2732 } 2733 2734 // CreatePolicy1 calls the method "TrustedTypePolicyFactory.createPolicy". 2735 func (this TrustedTypePolicyFactory) CreatePolicy1(policyName js.String) (ret TrustedTypePolicy) { 2736 bindings.CallTrustedTypePolicyFactoryCreatePolicy1( 2737 this.ref, js.Pointer(&ret), 2738 policyName.Ref(), 2739 ) 2740 2741 return 2742 } 2743 2744 // TryCreatePolicy1 calls the method "TrustedTypePolicyFactory.createPolicy" 2745 // in a try/catch block and returns (_, err, ok = false) when it went through 2746 // the catch clause. 2747 func (this TrustedTypePolicyFactory) TryCreatePolicy1(policyName js.String) (ret TrustedTypePolicy, exception js.Any, ok bool) { 2748 ok = js.True == bindings.TryTrustedTypePolicyFactoryCreatePolicy1( 2749 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2750 policyName.Ref(), 2751 ) 2752 2753 return 2754 } 2755 2756 // HasFuncIsHTML returns true if the method "TrustedTypePolicyFactory.isHTML" exists. 2757 func (this TrustedTypePolicyFactory) HasFuncIsHTML() bool { 2758 return js.True == bindings.HasFuncTrustedTypePolicyFactoryIsHTML( 2759 this.ref, 2760 ) 2761 } 2762 2763 // FuncIsHTML returns the method "TrustedTypePolicyFactory.isHTML". 2764 func (this TrustedTypePolicyFactory) FuncIsHTML() (fn js.Func[func(value js.Any) bool]) { 2765 bindings.FuncTrustedTypePolicyFactoryIsHTML( 2766 this.ref, js.Pointer(&fn), 2767 ) 2768 return 2769 } 2770 2771 // IsHTML calls the method "TrustedTypePolicyFactory.isHTML". 2772 func (this TrustedTypePolicyFactory) IsHTML(value js.Any) (ret bool) { 2773 bindings.CallTrustedTypePolicyFactoryIsHTML( 2774 this.ref, js.Pointer(&ret), 2775 value.Ref(), 2776 ) 2777 2778 return 2779 } 2780 2781 // TryIsHTML calls the method "TrustedTypePolicyFactory.isHTML" 2782 // in a try/catch block and returns (_, err, ok = false) when it went through 2783 // the catch clause. 2784 func (this TrustedTypePolicyFactory) TryIsHTML(value js.Any) (ret bool, exception js.Any, ok bool) { 2785 ok = js.True == bindings.TryTrustedTypePolicyFactoryIsHTML( 2786 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2787 value.Ref(), 2788 ) 2789 2790 return 2791 } 2792 2793 // HasFuncIsScript returns true if the method "TrustedTypePolicyFactory.isScript" exists. 2794 func (this TrustedTypePolicyFactory) HasFuncIsScript() bool { 2795 return js.True == bindings.HasFuncTrustedTypePolicyFactoryIsScript( 2796 this.ref, 2797 ) 2798 } 2799 2800 // FuncIsScript returns the method "TrustedTypePolicyFactory.isScript". 2801 func (this TrustedTypePolicyFactory) FuncIsScript() (fn js.Func[func(value js.Any) bool]) { 2802 bindings.FuncTrustedTypePolicyFactoryIsScript( 2803 this.ref, js.Pointer(&fn), 2804 ) 2805 return 2806 } 2807 2808 // IsScript calls the method "TrustedTypePolicyFactory.isScript". 2809 func (this TrustedTypePolicyFactory) IsScript(value js.Any) (ret bool) { 2810 bindings.CallTrustedTypePolicyFactoryIsScript( 2811 this.ref, js.Pointer(&ret), 2812 value.Ref(), 2813 ) 2814 2815 return 2816 } 2817 2818 // TryIsScript calls the method "TrustedTypePolicyFactory.isScript" 2819 // in a try/catch block and returns (_, err, ok = false) when it went through 2820 // the catch clause. 2821 func (this TrustedTypePolicyFactory) TryIsScript(value js.Any) (ret bool, exception js.Any, ok bool) { 2822 ok = js.True == bindings.TryTrustedTypePolicyFactoryIsScript( 2823 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2824 value.Ref(), 2825 ) 2826 2827 return 2828 } 2829 2830 // HasFuncIsScriptURL returns true if the method "TrustedTypePolicyFactory.isScriptURL" exists. 2831 func (this TrustedTypePolicyFactory) HasFuncIsScriptURL() bool { 2832 return js.True == bindings.HasFuncTrustedTypePolicyFactoryIsScriptURL( 2833 this.ref, 2834 ) 2835 } 2836 2837 // FuncIsScriptURL returns the method "TrustedTypePolicyFactory.isScriptURL". 2838 func (this TrustedTypePolicyFactory) FuncIsScriptURL() (fn js.Func[func(value js.Any) bool]) { 2839 bindings.FuncTrustedTypePolicyFactoryIsScriptURL( 2840 this.ref, js.Pointer(&fn), 2841 ) 2842 return 2843 } 2844 2845 // IsScriptURL calls the method "TrustedTypePolicyFactory.isScriptURL". 2846 func (this TrustedTypePolicyFactory) IsScriptURL(value js.Any) (ret bool) { 2847 bindings.CallTrustedTypePolicyFactoryIsScriptURL( 2848 this.ref, js.Pointer(&ret), 2849 value.Ref(), 2850 ) 2851 2852 return 2853 } 2854 2855 // TryIsScriptURL calls the method "TrustedTypePolicyFactory.isScriptURL" 2856 // in a try/catch block and returns (_, err, ok = false) when it went through 2857 // the catch clause. 2858 func (this TrustedTypePolicyFactory) TryIsScriptURL(value js.Any) (ret bool, exception js.Any, ok bool) { 2859 ok = js.True == bindings.TryTrustedTypePolicyFactoryIsScriptURL( 2860 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2861 value.Ref(), 2862 ) 2863 2864 return 2865 } 2866 2867 // HasFuncGetAttributeType returns true if the method "TrustedTypePolicyFactory.getAttributeType" exists. 2868 func (this TrustedTypePolicyFactory) HasFuncGetAttributeType() bool { 2869 return js.True == bindings.HasFuncTrustedTypePolicyFactoryGetAttributeType( 2870 this.ref, 2871 ) 2872 } 2873 2874 // FuncGetAttributeType returns the method "TrustedTypePolicyFactory.getAttributeType". 2875 func (this TrustedTypePolicyFactory) FuncGetAttributeType() (fn js.Func[func(tagName js.String, attribute js.String, elementNs js.String, attrNs js.String) js.String]) { 2876 bindings.FuncTrustedTypePolicyFactoryGetAttributeType( 2877 this.ref, js.Pointer(&fn), 2878 ) 2879 return 2880 } 2881 2882 // GetAttributeType calls the method "TrustedTypePolicyFactory.getAttributeType". 2883 func (this TrustedTypePolicyFactory) GetAttributeType(tagName js.String, attribute js.String, elementNs js.String, attrNs js.String) (ret js.String) { 2884 bindings.CallTrustedTypePolicyFactoryGetAttributeType( 2885 this.ref, js.Pointer(&ret), 2886 tagName.Ref(), 2887 attribute.Ref(), 2888 elementNs.Ref(), 2889 attrNs.Ref(), 2890 ) 2891 2892 return 2893 } 2894 2895 // TryGetAttributeType calls the method "TrustedTypePolicyFactory.getAttributeType" 2896 // in a try/catch block and returns (_, err, ok = false) when it went through 2897 // the catch clause. 2898 func (this TrustedTypePolicyFactory) TryGetAttributeType(tagName js.String, attribute js.String, elementNs js.String, attrNs js.String) (ret js.String, exception js.Any, ok bool) { 2899 ok = js.True == bindings.TryTrustedTypePolicyFactoryGetAttributeType( 2900 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2901 tagName.Ref(), 2902 attribute.Ref(), 2903 elementNs.Ref(), 2904 attrNs.Ref(), 2905 ) 2906 2907 return 2908 } 2909 2910 // HasFuncGetAttributeType1 returns true if the method "TrustedTypePolicyFactory.getAttributeType" exists. 2911 func (this TrustedTypePolicyFactory) HasFuncGetAttributeType1() bool { 2912 return js.True == bindings.HasFuncTrustedTypePolicyFactoryGetAttributeType1( 2913 this.ref, 2914 ) 2915 } 2916 2917 // FuncGetAttributeType1 returns the method "TrustedTypePolicyFactory.getAttributeType". 2918 func (this TrustedTypePolicyFactory) FuncGetAttributeType1() (fn js.Func[func(tagName js.String, attribute js.String, elementNs js.String) js.String]) { 2919 bindings.FuncTrustedTypePolicyFactoryGetAttributeType1( 2920 this.ref, js.Pointer(&fn), 2921 ) 2922 return 2923 } 2924 2925 // GetAttributeType1 calls the method "TrustedTypePolicyFactory.getAttributeType". 2926 func (this TrustedTypePolicyFactory) GetAttributeType1(tagName js.String, attribute js.String, elementNs js.String) (ret js.String) { 2927 bindings.CallTrustedTypePolicyFactoryGetAttributeType1( 2928 this.ref, js.Pointer(&ret), 2929 tagName.Ref(), 2930 attribute.Ref(), 2931 elementNs.Ref(), 2932 ) 2933 2934 return 2935 } 2936 2937 // TryGetAttributeType1 calls the method "TrustedTypePolicyFactory.getAttributeType" 2938 // in a try/catch block and returns (_, err, ok = false) when it went through 2939 // the catch clause. 2940 func (this TrustedTypePolicyFactory) TryGetAttributeType1(tagName js.String, attribute js.String, elementNs js.String) (ret js.String, exception js.Any, ok bool) { 2941 ok = js.True == bindings.TryTrustedTypePolicyFactoryGetAttributeType1( 2942 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2943 tagName.Ref(), 2944 attribute.Ref(), 2945 elementNs.Ref(), 2946 ) 2947 2948 return 2949 } 2950 2951 // HasFuncGetAttributeType2 returns true if the method "TrustedTypePolicyFactory.getAttributeType" exists. 2952 func (this TrustedTypePolicyFactory) HasFuncGetAttributeType2() bool { 2953 return js.True == bindings.HasFuncTrustedTypePolicyFactoryGetAttributeType2( 2954 this.ref, 2955 ) 2956 } 2957 2958 // FuncGetAttributeType2 returns the method "TrustedTypePolicyFactory.getAttributeType". 2959 func (this TrustedTypePolicyFactory) FuncGetAttributeType2() (fn js.Func[func(tagName js.String, attribute js.String) js.String]) { 2960 bindings.FuncTrustedTypePolicyFactoryGetAttributeType2( 2961 this.ref, js.Pointer(&fn), 2962 ) 2963 return 2964 } 2965 2966 // GetAttributeType2 calls the method "TrustedTypePolicyFactory.getAttributeType". 2967 func (this TrustedTypePolicyFactory) GetAttributeType2(tagName js.String, attribute js.String) (ret js.String) { 2968 bindings.CallTrustedTypePolicyFactoryGetAttributeType2( 2969 this.ref, js.Pointer(&ret), 2970 tagName.Ref(), 2971 attribute.Ref(), 2972 ) 2973 2974 return 2975 } 2976 2977 // TryGetAttributeType2 calls the method "TrustedTypePolicyFactory.getAttributeType" 2978 // in a try/catch block and returns (_, err, ok = false) when it went through 2979 // the catch clause. 2980 func (this TrustedTypePolicyFactory) TryGetAttributeType2(tagName js.String, attribute js.String) (ret js.String, exception js.Any, ok bool) { 2981 ok = js.True == bindings.TryTrustedTypePolicyFactoryGetAttributeType2( 2982 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2983 tagName.Ref(), 2984 attribute.Ref(), 2985 ) 2986 2987 return 2988 } 2989 2990 // HasFuncGetPropertyType returns true if the method "TrustedTypePolicyFactory.getPropertyType" exists. 2991 func (this TrustedTypePolicyFactory) HasFuncGetPropertyType() bool { 2992 return js.True == bindings.HasFuncTrustedTypePolicyFactoryGetPropertyType( 2993 this.ref, 2994 ) 2995 } 2996 2997 // FuncGetPropertyType returns the method "TrustedTypePolicyFactory.getPropertyType". 2998 func (this TrustedTypePolicyFactory) FuncGetPropertyType() (fn js.Func[func(tagName js.String, property js.String, elementNs js.String) js.String]) { 2999 bindings.FuncTrustedTypePolicyFactoryGetPropertyType( 3000 this.ref, js.Pointer(&fn), 3001 ) 3002 return 3003 } 3004 3005 // GetPropertyType calls the method "TrustedTypePolicyFactory.getPropertyType". 3006 func (this TrustedTypePolicyFactory) GetPropertyType(tagName js.String, property js.String, elementNs js.String) (ret js.String) { 3007 bindings.CallTrustedTypePolicyFactoryGetPropertyType( 3008 this.ref, js.Pointer(&ret), 3009 tagName.Ref(), 3010 property.Ref(), 3011 elementNs.Ref(), 3012 ) 3013 3014 return 3015 } 3016 3017 // TryGetPropertyType calls the method "TrustedTypePolicyFactory.getPropertyType" 3018 // in a try/catch block and returns (_, err, ok = false) when it went through 3019 // the catch clause. 3020 func (this TrustedTypePolicyFactory) TryGetPropertyType(tagName js.String, property js.String, elementNs js.String) (ret js.String, exception js.Any, ok bool) { 3021 ok = js.True == bindings.TryTrustedTypePolicyFactoryGetPropertyType( 3022 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3023 tagName.Ref(), 3024 property.Ref(), 3025 elementNs.Ref(), 3026 ) 3027 3028 return 3029 } 3030 3031 // HasFuncGetPropertyType1 returns true if the method "TrustedTypePolicyFactory.getPropertyType" exists. 3032 func (this TrustedTypePolicyFactory) HasFuncGetPropertyType1() bool { 3033 return js.True == bindings.HasFuncTrustedTypePolicyFactoryGetPropertyType1( 3034 this.ref, 3035 ) 3036 } 3037 3038 // FuncGetPropertyType1 returns the method "TrustedTypePolicyFactory.getPropertyType". 3039 func (this TrustedTypePolicyFactory) FuncGetPropertyType1() (fn js.Func[func(tagName js.String, property js.String) js.String]) { 3040 bindings.FuncTrustedTypePolicyFactoryGetPropertyType1( 3041 this.ref, js.Pointer(&fn), 3042 ) 3043 return 3044 } 3045 3046 // GetPropertyType1 calls the method "TrustedTypePolicyFactory.getPropertyType". 3047 func (this TrustedTypePolicyFactory) GetPropertyType1(tagName js.String, property js.String) (ret js.String) { 3048 bindings.CallTrustedTypePolicyFactoryGetPropertyType1( 3049 this.ref, js.Pointer(&ret), 3050 tagName.Ref(), 3051 property.Ref(), 3052 ) 3053 3054 return 3055 } 3056 3057 // TryGetPropertyType1 calls the method "TrustedTypePolicyFactory.getPropertyType" 3058 // in a try/catch block and returns (_, err, ok = false) when it went through 3059 // the catch clause. 3060 func (this TrustedTypePolicyFactory) TryGetPropertyType1(tagName js.String, property js.String) (ret js.String, exception js.Any, ok bool) { 3061 ok = js.True == bindings.TryTrustedTypePolicyFactoryGetPropertyType1( 3062 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3063 tagName.Ref(), 3064 property.Ref(), 3065 ) 3066 3067 return 3068 } 3069 3070 type KeyType uint32 3071 3072 const ( 3073 _ KeyType = iota 3074 3075 KeyType_PUBLIC 3076 KeyType_PRIVATE 3077 KeyType_SECRET 3078 ) 3079 3080 func (KeyType) FromRef(str js.Ref) KeyType { 3081 return KeyType(bindings.ConstOfKeyType(str)) 3082 } 3083 3084 func (x KeyType) String() (string, bool) { 3085 switch x { 3086 case KeyType_PUBLIC: 3087 return "public", true 3088 case KeyType_PRIVATE: 3089 return "private", true 3090 case KeyType_SECRET: 3091 return "secret", true 3092 default: 3093 return "", false 3094 } 3095 } 3096 3097 type CryptoKey struct { 3098 ref js.Ref 3099 } 3100 3101 func (this CryptoKey) Once() CryptoKey { 3102 this.ref.Once() 3103 return this 3104 } 3105 3106 func (this CryptoKey) Ref() js.Ref { 3107 return this.ref 3108 } 3109 3110 func (this CryptoKey) FromRef(ref js.Ref) CryptoKey { 3111 this.ref = ref 3112 return this 3113 } 3114 3115 func (this CryptoKey) Free() { 3116 this.ref.Free() 3117 } 3118 3119 // Type returns the value of property "CryptoKey.type". 3120 // 3121 // It returns ok=false if there is no such property. 3122 func (this CryptoKey) Type() (ret KeyType, ok bool) { 3123 ok = js.True == bindings.GetCryptoKeyType( 3124 this.ref, js.Pointer(&ret), 3125 ) 3126 return 3127 } 3128 3129 // Extractable returns the value of property "CryptoKey.extractable". 3130 // 3131 // It returns ok=false if there is no such property. 3132 func (this CryptoKey) Extractable() (ret bool, ok bool) { 3133 ok = js.True == bindings.GetCryptoKeyExtractable( 3134 this.ref, js.Pointer(&ret), 3135 ) 3136 return 3137 } 3138 3139 // Algorithm returns the value of property "CryptoKey.algorithm". 3140 // 3141 // It returns ok=false if there is no such property. 3142 func (this CryptoKey) Algorithm() (ret js.Object, ok bool) { 3143 ok = js.True == bindings.GetCryptoKeyAlgorithm( 3144 this.ref, js.Pointer(&ret), 3145 ) 3146 return 3147 } 3148 3149 // Usages returns the value of property "CryptoKey.usages". 3150 // 3151 // It returns ok=false if there is no such property. 3152 func (this CryptoKey) Usages() (ret js.Object, ok bool) { 3153 ok = js.True == bindings.GetCryptoKeyUsages( 3154 this.ref, js.Pointer(&ret), 3155 ) 3156 return 3157 } 3158 3159 type KeyUsage uint32 3160 3161 const ( 3162 _ KeyUsage = iota 3163 3164 KeyUsage_ENCRYPT 3165 KeyUsage_DECRYPT 3166 KeyUsage_SIGN 3167 KeyUsage_VERIFY 3168 KeyUsage_DERIVE_KEY 3169 KeyUsage_DERIVE_BITS 3170 KeyUsage_WRAP_KEY 3171 KeyUsage_UNWRAP_KEY 3172 ) 3173 3174 func (KeyUsage) FromRef(str js.Ref) KeyUsage { 3175 return KeyUsage(bindings.ConstOfKeyUsage(str)) 3176 } 3177 3178 func (x KeyUsage) String() (string, bool) { 3179 switch x { 3180 case KeyUsage_ENCRYPT: 3181 return "encrypt", true 3182 case KeyUsage_DECRYPT: 3183 return "decrypt", true 3184 case KeyUsage_SIGN: 3185 return "sign", true 3186 case KeyUsage_VERIFY: 3187 return "verify", true 3188 case KeyUsage_DERIVE_KEY: 3189 return "deriveKey", true 3190 case KeyUsage_DERIVE_BITS: 3191 return "deriveBits", true 3192 case KeyUsage_WRAP_KEY: 3193 return "wrapKey", true 3194 case KeyUsage_UNWRAP_KEY: 3195 return "unwrapKey", true 3196 default: 3197 return "", false 3198 } 3199 } 3200 3201 type KeyFormat uint32 3202 3203 const ( 3204 _ KeyFormat = iota 3205 3206 KeyFormat_RAW 3207 KeyFormat_SPKI 3208 KeyFormat_PKCS8 3209 KeyFormat_JWK 3210 ) 3211 3212 func (KeyFormat) FromRef(str js.Ref) KeyFormat { 3213 return KeyFormat(bindings.ConstOfKeyFormat(str)) 3214 } 3215 3216 func (x KeyFormat) String() (string, bool) { 3217 switch x { 3218 case KeyFormat_RAW: 3219 return "raw", true 3220 case KeyFormat_SPKI: 3221 return "spki", true 3222 case KeyFormat_PKCS8: 3223 return "pkcs8", true 3224 case KeyFormat_JWK: 3225 return "jwk", true 3226 default: 3227 return "", false 3228 } 3229 } 3230 3231 type RsaOtherPrimesInfo struct { 3232 // R is "RsaOtherPrimesInfo.r" 3233 // 3234 // Optional 3235 R js.String 3236 // D is "RsaOtherPrimesInfo.d" 3237 // 3238 // Optional 3239 D js.String 3240 // T is "RsaOtherPrimesInfo.t" 3241 // 3242 // Optional 3243 T js.String 3244 3245 FFI_USE bool 3246 } 3247 3248 // FromRef calls UpdateFrom and returns a RsaOtherPrimesInfo with all fields set. 3249 func (p RsaOtherPrimesInfo) FromRef(ref js.Ref) RsaOtherPrimesInfo { 3250 p.UpdateFrom(ref) 3251 return p 3252 } 3253 3254 // New creates a new RsaOtherPrimesInfo in the application heap. 3255 func (p RsaOtherPrimesInfo) New() js.Ref { 3256 return bindings.RsaOtherPrimesInfoJSLoad( 3257 js.Pointer(&p), js.True, 0, 3258 ) 3259 } 3260 3261 // UpdateFrom copies value of all fields of the heap object to p. 3262 func (p *RsaOtherPrimesInfo) UpdateFrom(ref js.Ref) { 3263 bindings.RsaOtherPrimesInfoJSStore( 3264 js.Pointer(p), ref, 3265 ) 3266 } 3267 3268 // Update writes all fields of the p to the heap object referenced by ref. 3269 func (p *RsaOtherPrimesInfo) Update(ref js.Ref) { 3270 bindings.RsaOtherPrimesInfoJSLoad( 3271 js.Pointer(p), js.False, ref, 3272 ) 3273 } 3274 3275 // FreeMembers frees fields with heap reference, if recursive is true 3276 // free all heap references reachable from p. 3277 func (p *RsaOtherPrimesInfo) FreeMembers(recursive bool) { 3278 js.Free( 3279 p.R.Ref(), 3280 p.D.Ref(), 3281 p.T.Ref(), 3282 ) 3283 p.R = p.R.FromRef(js.Undefined) 3284 p.D = p.D.FromRef(js.Undefined) 3285 p.T = p.T.FromRef(js.Undefined) 3286 } 3287 3288 type JsonWebKey struct { 3289 // Kty is "JsonWebKey.kty" 3290 // 3291 // Optional 3292 Kty js.String 3293 // Use is "JsonWebKey.use" 3294 // 3295 // Optional 3296 Use js.String 3297 // KeyOps is "JsonWebKey.key_ops" 3298 // 3299 // Optional 3300 KeyOps js.Array[js.String] 3301 // Alg is "JsonWebKey.alg" 3302 // 3303 // Optional 3304 Alg js.String 3305 // Ext is "JsonWebKey.ext" 3306 // 3307 // Optional 3308 // 3309 // NOTE: FFI_USE_Ext MUST be set to true to make this field effective. 3310 Ext bool 3311 // Crv is "JsonWebKey.crv" 3312 // 3313 // Optional 3314 Crv js.String 3315 // X is "JsonWebKey.x" 3316 // 3317 // Optional 3318 X js.String 3319 // Y is "JsonWebKey.y" 3320 // 3321 // Optional 3322 Y js.String 3323 // D is "JsonWebKey.d" 3324 // 3325 // Optional 3326 D js.String 3327 // N is "JsonWebKey.n" 3328 // 3329 // Optional 3330 N js.String 3331 // E is "JsonWebKey.e" 3332 // 3333 // Optional 3334 E js.String 3335 // P is "JsonWebKey.p" 3336 // 3337 // Optional 3338 P js.String 3339 // Q is "JsonWebKey.q" 3340 // 3341 // Optional 3342 Q js.String 3343 // Dp is "JsonWebKey.dp" 3344 // 3345 // Optional 3346 Dp js.String 3347 // Dq is "JsonWebKey.dq" 3348 // 3349 // Optional 3350 Dq js.String 3351 // Qi is "JsonWebKey.qi" 3352 // 3353 // Optional 3354 Qi js.String 3355 // Oth is "JsonWebKey.oth" 3356 // 3357 // Optional 3358 Oth js.Array[RsaOtherPrimesInfo] 3359 // K is "JsonWebKey.k" 3360 // 3361 // Optional 3362 K js.String 3363 3364 FFI_USE_Ext bool // for Ext. 3365 3366 FFI_USE bool 3367 } 3368 3369 // FromRef calls UpdateFrom and returns a JsonWebKey with all fields set. 3370 func (p JsonWebKey) FromRef(ref js.Ref) JsonWebKey { 3371 p.UpdateFrom(ref) 3372 return p 3373 } 3374 3375 // New creates a new JsonWebKey in the application heap. 3376 func (p JsonWebKey) New() js.Ref { 3377 return bindings.JsonWebKeyJSLoad( 3378 js.Pointer(&p), js.True, 0, 3379 ) 3380 } 3381 3382 // UpdateFrom copies value of all fields of the heap object to p. 3383 func (p *JsonWebKey) UpdateFrom(ref js.Ref) { 3384 bindings.JsonWebKeyJSStore( 3385 js.Pointer(p), ref, 3386 ) 3387 } 3388 3389 // Update writes all fields of the p to the heap object referenced by ref. 3390 func (p *JsonWebKey) Update(ref js.Ref) { 3391 bindings.JsonWebKeyJSLoad( 3392 js.Pointer(p), js.False, ref, 3393 ) 3394 } 3395 3396 // FreeMembers frees fields with heap reference, if recursive is true 3397 // free all heap references reachable from p. 3398 func (p *JsonWebKey) FreeMembers(recursive bool) { 3399 js.Free( 3400 p.Kty.Ref(), 3401 p.Use.Ref(), 3402 p.KeyOps.Ref(), 3403 p.Alg.Ref(), 3404 p.Crv.Ref(), 3405 p.X.Ref(), 3406 p.Y.Ref(), 3407 p.D.Ref(), 3408 p.N.Ref(), 3409 p.E.Ref(), 3410 p.P.Ref(), 3411 p.Q.Ref(), 3412 p.Dp.Ref(), 3413 p.Dq.Ref(), 3414 p.Qi.Ref(), 3415 p.Oth.Ref(), 3416 p.K.Ref(), 3417 ) 3418 p.Kty = p.Kty.FromRef(js.Undefined) 3419 p.Use = p.Use.FromRef(js.Undefined) 3420 p.KeyOps = p.KeyOps.FromRef(js.Undefined) 3421 p.Alg = p.Alg.FromRef(js.Undefined) 3422 p.Crv = p.Crv.FromRef(js.Undefined) 3423 p.X = p.X.FromRef(js.Undefined) 3424 p.Y = p.Y.FromRef(js.Undefined) 3425 p.D = p.D.FromRef(js.Undefined) 3426 p.N = p.N.FromRef(js.Undefined) 3427 p.E = p.E.FromRef(js.Undefined) 3428 p.P = p.P.FromRef(js.Undefined) 3429 p.Q = p.Q.FromRef(js.Undefined) 3430 p.Dp = p.Dp.FromRef(js.Undefined) 3431 p.Dq = p.Dq.FromRef(js.Undefined) 3432 p.Qi = p.Qi.FromRef(js.Undefined) 3433 p.Oth = p.Oth.FromRef(js.Undefined) 3434 p.K = p.K.FromRef(js.Undefined) 3435 } 3436 3437 type OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey struct { 3438 ref js.Ref 3439 } 3440 3441 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) Ref() js.Ref { 3442 return x.ref 3443 } 3444 3445 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) Free() { 3446 x.ref.Free() 3447 } 3448 3449 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) FromRef(ref js.Ref) OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey { 3450 return OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey{ 3451 ref: ref, 3452 } 3453 } 3454 3455 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayInt8() js.TypedArray[int8] { 3456 return js.TypedArray[int8]{}.FromRef(x.ref) 3457 } 3458 3459 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayInt16() js.TypedArray[int16] { 3460 return js.TypedArray[int16]{}.FromRef(x.ref) 3461 } 3462 3463 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayInt32() js.TypedArray[int32] { 3464 return js.TypedArray[int32]{}.FromRef(x.ref) 3465 } 3466 3467 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayUint8() js.TypedArray[uint8] { 3468 return js.TypedArray[uint8]{}.FromRef(x.ref) 3469 } 3470 3471 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayUint16() js.TypedArray[uint16] { 3472 return js.TypedArray[uint16]{}.FromRef(x.ref) 3473 } 3474 3475 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayUint32() js.TypedArray[uint32] { 3476 return js.TypedArray[uint32]{}.FromRef(x.ref) 3477 } 3478 3479 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayInt64() js.TypedArray[int64] { 3480 return js.TypedArray[int64]{}.FromRef(x.ref) 3481 } 3482 3483 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayUint64() js.TypedArray[uint64] { 3484 return js.TypedArray[uint64]{}.FromRef(x.ref) 3485 } 3486 3487 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayFloat32() js.TypedArray[float32] { 3488 return js.TypedArray[float32]{}.FromRef(x.ref) 3489 } 3490 3491 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) TypedArrayFloat64() js.TypedArray[float64] { 3492 return js.TypedArray[float64]{}.FromRef(x.ref) 3493 } 3494 3495 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) DataView() js.DataView { 3496 return js.DataView{}.FromRef(x.ref) 3497 } 3498 3499 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) ArrayBuffer() js.ArrayBuffer { 3500 return js.ArrayBuffer{}.FromRef(x.ref) 3501 } 3502 3503 func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey) JsonWebKey() JsonWebKey { 3504 var ret JsonWebKey 3505 ret.UpdateFrom(x.ref) 3506 return ret 3507 } 3508 3509 type SubtleCrypto struct { 3510 ref js.Ref 3511 } 3512 3513 func (this SubtleCrypto) Once() SubtleCrypto { 3514 this.ref.Once() 3515 return this 3516 } 3517 3518 func (this SubtleCrypto) Ref() js.Ref { 3519 return this.ref 3520 } 3521 3522 func (this SubtleCrypto) FromRef(ref js.Ref) SubtleCrypto { 3523 this.ref = ref 3524 return this 3525 } 3526 3527 func (this SubtleCrypto) Free() { 3528 this.ref.Free() 3529 } 3530 3531 // HasFuncEncrypt returns true if the method "SubtleCrypto.encrypt" exists. 3532 func (this SubtleCrypto) HasFuncEncrypt() bool { 3533 return js.True == bindings.HasFuncSubtleCryptoEncrypt( 3534 this.ref, 3535 ) 3536 } 3537 3538 // FuncEncrypt returns the method "SubtleCrypto.encrypt". 3539 func (this SubtleCrypto) FuncEncrypt() (fn js.Func[func(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) js.Promise[js.Any]]) { 3540 bindings.FuncSubtleCryptoEncrypt( 3541 this.ref, js.Pointer(&fn), 3542 ) 3543 return 3544 } 3545 3546 // Encrypt calls the method "SubtleCrypto.encrypt". 3547 func (this SubtleCrypto) Encrypt(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) (ret js.Promise[js.Any]) { 3548 bindings.CallSubtleCryptoEncrypt( 3549 this.ref, js.Pointer(&ret), 3550 algorithm.Ref(), 3551 key.Ref(), 3552 data.Ref(), 3553 ) 3554 3555 return 3556 } 3557 3558 // TryEncrypt calls the method "SubtleCrypto.encrypt" 3559 // in a try/catch block and returns (_, err, ok = false) when it went through 3560 // the catch clause. 3561 func (this SubtleCrypto) TryEncrypt(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3562 ok = js.True == bindings.TrySubtleCryptoEncrypt( 3563 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3564 algorithm.Ref(), 3565 key.Ref(), 3566 data.Ref(), 3567 ) 3568 3569 return 3570 } 3571 3572 // HasFuncDecrypt returns true if the method "SubtleCrypto.decrypt" exists. 3573 func (this SubtleCrypto) HasFuncDecrypt() bool { 3574 return js.True == bindings.HasFuncSubtleCryptoDecrypt( 3575 this.ref, 3576 ) 3577 } 3578 3579 // FuncDecrypt returns the method "SubtleCrypto.decrypt". 3580 func (this SubtleCrypto) FuncDecrypt() (fn js.Func[func(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) js.Promise[js.Any]]) { 3581 bindings.FuncSubtleCryptoDecrypt( 3582 this.ref, js.Pointer(&fn), 3583 ) 3584 return 3585 } 3586 3587 // Decrypt calls the method "SubtleCrypto.decrypt". 3588 func (this SubtleCrypto) Decrypt(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) (ret js.Promise[js.Any]) { 3589 bindings.CallSubtleCryptoDecrypt( 3590 this.ref, js.Pointer(&ret), 3591 algorithm.Ref(), 3592 key.Ref(), 3593 data.Ref(), 3594 ) 3595 3596 return 3597 } 3598 3599 // TryDecrypt calls the method "SubtleCrypto.decrypt" 3600 // in a try/catch block and returns (_, err, ok = false) when it went through 3601 // the catch clause. 3602 func (this SubtleCrypto) TryDecrypt(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3603 ok = js.True == bindings.TrySubtleCryptoDecrypt( 3604 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3605 algorithm.Ref(), 3606 key.Ref(), 3607 data.Ref(), 3608 ) 3609 3610 return 3611 } 3612 3613 // HasFuncSign returns true if the method "SubtleCrypto.sign" exists. 3614 func (this SubtleCrypto) HasFuncSign() bool { 3615 return js.True == bindings.HasFuncSubtleCryptoSign( 3616 this.ref, 3617 ) 3618 } 3619 3620 // FuncSign returns the method "SubtleCrypto.sign". 3621 func (this SubtleCrypto) FuncSign() (fn js.Func[func(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) js.Promise[js.Any]]) { 3622 bindings.FuncSubtleCryptoSign( 3623 this.ref, js.Pointer(&fn), 3624 ) 3625 return 3626 } 3627 3628 // Sign calls the method "SubtleCrypto.sign". 3629 func (this SubtleCrypto) Sign(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) (ret js.Promise[js.Any]) { 3630 bindings.CallSubtleCryptoSign( 3631 this.ref, js.Pointer(&ret), 3632 algorithm.Ref(), 3633 key.Ref(), 3634 data.Ref(), 3635 ) 3636 3637 return 3638 } 3639 3640 // TrySign calls the method "SubtleCrypto.sign" 3641 // in a try/catch block and returns (_, err, ok = false) when it went through 3642 // the catch clause. 3643 func (this SubtleCrypto) TrySign(algorithm AlgorithmIdentifier, key CryptoKey, data BufferSource) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3644 ok = js.True == bindings.TrySubtleCryptoSign( 3645 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3646 algorithm.Ref(), 3647 key.Ref(), 3648 data.Ref(), 3649 ) 3650 3651 return 3652 } 3653 3654 // HasFuncVerify returns true if the method "SubtleCrypto.verify" exists. 3655 func (this SubtleCrypto) HasFuncVerify() bool { 3656 return js.True == bindings.HasFuncSubtleCryptoVerify( 3657 this.ref, 3658 ) 3659 } 3660 3661 // FuncVerify returns the method "SubtleCrypto.verify". 3662 func (this SubtleCrypto) FuncVerify() (fn js.Func[func(algorithm AlgorithmIdentifier, key CryptoKey, signature BufferSource, data BufferSource) js.Promise[js.Any]]) { 3663 bindings.FuncSubtleCryptoVerify( 3664 this.ref, js.Pointer(&fn), 3665 ) 3666 return 3667 } 3668 3669 // Verify calls the method "SubtleCrypto.verify". 3670 func (this SubtleCrypto) Verify(algorithm AlgorithmIdentifier, key CryptoKey, signature BufferSource, data BufferSource) (ret js.Promise[js.Any]) { 3671 bindings.CallSubtleCryptoVerify( 3672 this.ref, js.Pointer(&ret), 3673 algorithm.Ref(), 3674 key.Ref(), 3675 signature.Ref(), 3676 data.Ref(), 3677 ) 3678 3679 return 3680 } 3681 3682 // TryVerify calls the method "SubtleCrypto.verify" 3683 // in a try/catch block and returns (_, err, ok = false) when it went through 3684 // the catch clause. 3685 func (this SubtleCrypto) TryVerify(algorithm AlgorithmIdentifier, key CryptoKey, signature BufferSource, data BufferSource) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3686 ok = js.True == bindings.TrySubtleCryptoVerify( 3687 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3688 algorithm.Ref(), 3689 key.Ref(), 3690 signature.Ref(), 3691 data.Ref(), 3692 ) 3693 3694 return 3695 } 3696 3697 // HasFuncDigest returns true if the method "SubtleCrypto.digest" exists. 3698 func (this SubtleCrypto) HasFuncDigest() bool { 3699 return js.True == bindings.HasFuncSubtleCryptoDigest( 3700 this.ref, 3701 ) 3702 } 3703 3704 // FuncDigest returns the method "SubtleCrypto.digest". 3705 func (this SubtleCrypto) FuncDigest() (fn js.Func[func(algorithm AlgorithmIdentifier, data BufferSource) js.Promise[js.Any]]) { 3706 bindings.FuncSubtleCryptoDigest( 3707 this.ref, js.Pointer(&fn), 3708 ) 3709 return 3710 } 3711 3712 // Digest calls the method "SubtleCrypto.digest". 3713 func (this SubtleCrypto) Digest(algorithm AlgorithmIdentifier, data BufferSource) (ret js.Promise[js.Any]) { 3714 bindings.CallSubtleCryptoDigest( 3715 this.ref, js.Pointer(&ret), 3716 algorithm.Ref(), 3717 data.Ref(), 3718 ) 3719 3720 return 3721 } 3722 3723 // TryDigest calls the method "SubtleCrypto.digest" 3724 // in a try/catch block and returns (_, err, ok = false) when it went through 3725 // the catch clause. 3726 func (this SubtleCrypto) TryDigest(algorithm AlgorithmIdentifier, data BufferSource) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3727 ok = js.True == bindings.TrySubtleCryptoDigest( 3728 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3729 algorithm.Ref(), 3730 data.Ref(), 3731 ) 3732 3733 return 3734 } 3735 3736 // HasFuncGenerateKey returns true if the method "SubtleCrypto.generateKey" exists. 3737 func (this SubtleCrypto) HasFuncGenerateKey() bool { 3738 return js.True == bindings.HasFuncSubtleCryptoGenerateKey( 3739 this.ref, 3740 ) 3741 } 3742 3743 // FuncGenerateKey returns the method "SubtleCrypto.generateKey". 3744 func (this SubtleCrypto) FuncGenerateKey() (fn js.Func[func(algorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) js.Promise[js.Any]]) { 3745 bindings.FuncSubtleCryptoGenerateKey( 3746 this.ref, js.Pointer(&fn), 3747 ) 3748 return 3749 } 3750 3751 // GenerateKey calls the method "SubtleCrypto.generateKey". 3752 func (this SubtleCrypto) GenerateKey(algorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[js.Any]) { 3753 bindings.CallSubtleCryptoGenerateKey( 3754 this.ref, js.Pointer(&ret), 3755 algorithm.Ref(), 3756 js.Bool(bool(extractable)), 3757 keyUsages.Ref(), 3758 ) 3759 3760 return 3761 } 3762 3763 // TryGenerateKey calls the method "SubtleCrypto.generateKey" 3764 // in a try/catch block and returns (_, err, ok = false) when it went through 3765 // the catch clause. 3766 func (this SubtleCrypto) TryGenerateKey(algorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3767 ok = js.True == bindings.TrySubtleCryptoGenerateKey( 3768 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3769 algorithm.Ref(), 3770 js.Bool(bool(extractable)), 3771 keyUsages.Ref(), 3772 ) 3773 3774 return 3775 } 3776 3777 // HasFuncDeriveKey returns true if the method "SubtleCrypto.deriveKey" exists. 3778 func (this SubtleCrypto) HasFuncDeriveKey() bool { 3779 return js.True == bindings.HasFuncSubtleCryptoDeriveKey( 3780 this.ref, 3781 ) 3782 } 3783 3784 // FuncDeriveKey returns the method "SubtleCrypto.deriveKey". 3785 func (this SubtleCrypto) FuncDeriveKey() (fn js.Func[func(algorithm AlgorithmIdentifier, baseKey CryptoKey, derivedKeyType AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) js.Promise[js.Any]]) { 3786 bindings.FuncSubtleCryptoDeriveKey( 3787 this.ref, js.Pointer(&fn), 3788 ) 3789 return 3790 } 3791 3792 // DeriveKey calls the method "SubtleCrypto.deriveKey". 3793 func (this SubtleCrypto) DeriveKey(algorithm AlgorithmIdentifier, baseKey CryptoKey, derivedKeyType AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[js.Any]) { 3794 bindings.CallSubtleCryptoDeriveKey( 3795 this.ref, js.Pointer(&ret), 3796 algorithm.Ref(), 3797 baseKey.Ref(), 3798 derivedKeyType.Ref(), 3799 js.Bool(bool(extractable)), 3800 keyUsages.Ref(), 3801 ) 3802 3803 return 3804 } 3805 3806 // TryDeriveKey calls the method "SubtleCrypto.deriveKey" 3807 // in a try/catch block and returns (_, err, ok = false) when it went through 3808 // the catch clause. 3809 func (this SubtleCrypto) TryDeriveKey(algorithm AlgorithmIdentifier, baseKey CryptoKey, derivedKeyType AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3810 ok = js.True == bindings.TrySubtleCryptoDeriveKey( 3811 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3812 algorithm.Ref(), 3813 baseKey.Ref(), 3814 derivedKeyType.Ref(), 3815 js.Bool(bool(extractable)), 3816 keyUsages.Ref(), 3817 ) 3818 3819 return 3820 } 3821 3822 // HasFuncDeriveBits returns true if the method "SubtleCrypto.deriveBits" exists. 3823 func (this SubtleCrypto) HasFuncDeriveBits() bool { 3824 return js.True == bindings.HasFuncSubtleCryptoDeriveBits( 3825 this.ref, 3826 ) 3827 } 3828 3829 // FuncDeriveBits returns the method "SubtleCrypto.deriveBits". 3830 func (this SubtleCrypto) FuncDeriveBits() (fn js.Func[func(algorithm AlgorithmIdentifier, baseKey CryptoKey, length uint32) js.Promise[js.ArrayBuffer]]) { 3831 bindings.FuncSubtleCryptoDeriveBits( 3832 this.ref, js.Pointer(&fn), 3833 ) 3834 return 3835 } 3836 3837 // DeriveBits calls the method "SubtleCrypto.deriveBits". 3838 func (this SubtleCrypto) DeriveBits(algorithm AlgorithmIdentifier, baseKey CryptoKey, length uint32) (ret js.Promise[js.ArrayBuffer]) { 3839 bindings.CallSubtleCryptoDeriveBits( 3840 this.ref, js.Pointer(&ret), 3841 algorithm.Ref(), 3842 baseKey.Ref(), 3843 uint32(length), 3844 ) 3845 3846 return 3847 } 3848 3849 // TryDeriveBits calls the method "SubtleCrypto.deriveBits" 3850 // in a try/catch block and returns (_, err, ok = false) when it went through 3851 // the catch clause. 3852 func (this SubtleCrypto) TryDeriveBits(algorithm AlgorithmIdentifier, baseKey CryptoKey, length uint32) (ret js.Promise[js.ArrayBuffer], exception js.Any, ok bool) { 3853 ok = js.True == bindings.TrySubtleCryptoDeriveBits( 3854 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3855 algorithm.Ref(), 3856 baseKey.Ref(), 3857 uint32(length), 3858 ) 3859 3860 return 3861 } 3862 3863 // HasFuncImportKey returns true if the method "SubtleCrypto.importKey" exists. 3864 func (this SubtleCrypto) HasFuncImportKey() bool { 3865 return js.True == bindings.HasFuncSubtleCryptoImportKey( 3866 this.ref, 3867 ) 3868 } 3869 3870 // FuncImportKey returns the method "SubtleCrypto.importKey". 3871 func (this SubtleCrypto) FuncImportKey() (fn js.Func[func(format KeyFormat, keyData OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey, algorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) js.Promise[CryptoKey]]) { 3872 bindings.FuncSubtleCryptoImportKey( 3873 this.ref, js.Pointer(&fn), 3874 ) 3875 return 3876 } 3877 3878 // ImportKey calls the method "SubtleCrypto.importKey". 3879 func (this SubtleCrypto) ImportKey(format KeyFormat, keyData OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey, algorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[CryptoKey]) { 3880 bindings.CallSubtleCryptoImportKey( 3881 this.ref, js.Pointer(&ret), 3882 uint32(format), 3883 keyData.Ref(), 3884 algorithm.Ref(), 3885 js.Bool(bool(extractable)), 3886 keyUsages.Ref(), 3887 ) 3888 3889 return 3890 } 3891 3892 // TryImportKey calls the method "SubtleCrypto.importKey" 3893 // in a try/catch block and returns (_, err, ok = false) when it went through 3894 // the catch clause. 3895 func (this SubtleCrypto) TryImportKey(format KeyFormat, keyData OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_JsonWebKey, algorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[CryptoKey], exception js.Any, ok bool) { 3896 ok = js.True == bindings.TrySubtleCryptoImportKey( 3897 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3898 uint32(format), 3899 keyData.Ref(), 3900 algorithm.Ref(), 3901 js.Bool(bool(extractable)), 3902 keyUsages.Ref(), 3903 ) 3904 3905 return 3906 } 3907 3908 // HasFuncExportKey returns true if the method "SubtleCrypto.exportKey" exists. 3909 func (this SubtleCrypto) HasFuncExportKey() bool { 3910 return js.True == bindings.HasFuncSubtleCryptoExportKey( 3911 this.ref, 3912 ) 3913 } 3914 3915 // FuncExportKey returns the method "SubtleCrypto.exportKey". 3916 func (this SubtleCrypto) FuncExportKey() (fn js.Func[func(format KeyFormat, key CryptoKey) js.Promise[js.Any]]) { 3917 bindings.FuncSubtleCryptoExportKey( 3918 this.ref, js.Pointer(&fn), 3919 ) 3920 return 3921 } 3922 3923 // ExportKey calls the method "SubtleCrypto.exportKey". 3924 func (this SubtleCrypto) ExportKey(format KeyFormat, key CryptoKey) (ret js.Promise[js.Any]) { 3925 bindings.CallSubtleCryptoExportKey( 3926 this.ref, js.Pointer(&ret), 3927 uint32(format), 3928 key.Ref(), 3929 ) 3930 3931 return 3932 } 3933 3934 // TryExportKey calls the method "SubtleCrypto.exportKey" 3935 // in a try/catch block and returns (_, err, ok = false) when it went through 3936 // the catch clause. 3937 func (this SubtleCrypto) TryExportKey(format KeyFormat, key CryptoKey) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3938 ok = js.True == bindings.TrySubtleCryptoExportKey( 3939 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3940 uint32(format), 3941 key.Ref(), 3942 ) 3943 3944 return 3945 } 3946 3947 // HasFuncWrapKey returns true if the method "SubtleCrypto.wrapKey" exists. 3948 func (this SubtleCrypto) HasFuncWrapKey() bool { 3949 return js.True == bindings.HasFuncSubtleCryptoWrapKey( 3950 this.ref, 3951 ) 3952 } 3953 3954 // FuncWrapKey returns the method "SubtleCrypto.wrapKey". 3955 func (this SubtleCrypto) FuncWrapKey() (fn js.Func[func(format KeyFormat, key CryptoKey, wrappingKey CryptoKey, wrapAlgorithm AlgorithmIdentifier) js.Promise[js.Any]]) { 3956 bindings.FuncSubtleCryptoWrapKey( 3957 this.ref, js.Pointer(&fn), 3958 ) 3959 return 3960 } 3961 3962 // WrapKey calls the method "SubtleCrypto.wrapKey". 3963 func (this SubtleCrypto) WrapKey(format KeyFormat, key CryptoKey, wrappingKey CryptoKey, wrapAlgorithm AlgorithmIdentifier) (ret js.Promise[js.Any]) { 3964 bindings.CallSubtleCryptoWrapKey( 3965 this.ref, js.Pointer(&ret), 3966 uint32(format), 3967 key.Ref(), 3968 wrappingKey.Ref(), 3969 wrapAlgorithm.Ref(), 3970 ) 3971 3972 return 3973 } 3974 3975 // TryWrapKey calls the method "SubtleCrypto.wrapKey" 3976 // in a try/catch block and returns (_, err, ok = false) when it went through 3977 // the catch clause. 3978 func (this SubtleCrypto) TryWrapKey(format KeyFormat, key CryptoKey, wrappingKey CryptoKey, wrapAlgorithm AlgorithmIdentifier) (ret js.Promise[js.Any], exception js.Any, ok bool) { 3979 ok = js.True == bindings.TrySubtleCryptoWrapKey( 3980 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3981 uint32(format), 3982 key.Ref(), 3983 wrappingKey.Ref(), 3984 wrapAlgorithm.Ref(), 3985 ) 3986 3987 return 3988 } 3989 3990 // HasFuncUnwrapKey returns true if the method "SubtleCrypto.unwrapKey" exists. 3991 func (this SubtleCrypto) HasFuncUnwrapKey() bool { 3992 return js.True == bindings.HasFuncSubtleCryptoUnwrapKey( 3993 this.ref, 3994 ) 3995 } 3996 3997 // FuncUnwrapKey returns the method "SubtleCrypto.unwrapKey". 3998 func (this SubtleCrypto) FuncUnwrapKey() (fn js.Func[func(format KeyFormat, wrappedKey BufferSource, unwrappingKey CryptoKey, unwrapAlgorithm AlgorithmIdentifier, unwrappedKeyAlgorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) js.Promise[CryptoKey]]) { 3999 bindings.FuncSubtleCryptoUnwrapKey( 4000 this.ref, js.Pointer(&fn), 4001 ) 4002 return 4003 } 4004 4005 // UnwrapKey calls the method "SubtleCrypto.unwrapKey". 4006 func (this SubtleCrypto) UnwrapKey(format KeyFormat, wrappedKey BufferSource, unwrappingKey CryptoKey, unwrapAlgorithm AlgorithmIdentifier, unwrappedKeyAlgorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[CryptoKey]) { 4007 bindings.CallSubtleCryptoUnwrapKey( 4008 this.ref, js.Pointer(&ret), 4009 uint32(format), 4010 wrappedKey.Ref(), 4011 unwrappingKey.Ref(), 4012 unwrapAlgorithm.Ref(), 4013 unwrappedKeyAlgorithm.Ref(), 4014 js.Bool(bool(extractable)), 4015 keyUsages.Ref(), 4016 ) 4017 4018 return 4019 } 4020 4021 // TryUnwrapKey calls the method "SubtleCrypto.unwrapKey" 4022 // in a try/catch block and returns (_, err, ok = false) when it went through 4023 // the catch clause. 4024 func (this SubtleCrypto) TryUnwrapKey(format KeyFormat, wrappedKey BufferSource, unwrappingKey CryptoKey, unwrapAlgorithm AlgorithmIdentifier, unwrappedKeyAlgorithm AlgorithmIdentifier, extractable bool, keyUsages js.Array[KeyUsage]) (ret js.Promise[CryptoKey], exception js.Any, ok bool) { 4025 ok = js.True == bindings.TrySubtleCryptoUnwrapKey( 4026 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4027 uint32(format), 4028 wrappedKey.Ref(), 4029 unwrappingKey.Ref(), 4030 unwrapAlgorithm.Ref(), 4031 unwrappedKeyAlgorithm.Ref(), 4032 js.Bool(bool(extractable)), 4033 keyUsages.Ref(), 4034 ) 4035 4036 return 4037 } 4038 4039 type Crypto struct { 4040 ref js.Ref 4041 } 4042 4043 func (this Crypto) Once() Crypto { 4044 this.ref.Once() 4045 return this 4046 } 4047 4048 func (this Crypto) Ref() js.Ref { 4049 return this.ref 4050 } 4051 4052 func (this Crypto) FromRef(ref js.Ref) Crypto { 4053 this.ref = ref 4054 return this 4055 } 4056 4057 func (this Crypto) Free() { 4058 this.ref.Free() 4059 } 4060 4061 // Subtle returns the value of property "Crypto.subtle". 4062 // 4063 // It returns ok=false if there is no such property. 4064 func (this Crypto) Subtle() (ret SubtleCrypto, ok bool) { 4065 ok = js.True == bindings.GetCryptoSubtle( 4066 this.ref, js.Pointer(&ret), 4067 ) 4068 return 4069 } 4070 4071 // HasFuncGetRandomValues returns true if the method "Crypto.getRandomValues" exists. 4072 func (this Crypto) HasFuncGetRandomValues() bool { 4073 return js.True == bindings.HasFuncCryptoGetRandomValues( 4074 this.ref, 4075 ) 4076 } 4077 4078 // FuncGetRandomValues returns the method "Crypto.getRandomValues". 4079 func (this Crypto) FuncGetRandomValues() (fn js.Func[func(array js.ArrayBufferView) js.ArrayBufferView]) { 4080 bindings.FuncCryptoGetRandomValues( 4081 this.ref, js.Pointer(&fn), 4082 ) 4083 return 4084 } 4085 4086 // GetRandomValues calls the method "Crypto.getRandomValues". 4087 func (this Crypto) GetRandomValues(array js.ArrayBufferView) (ret js.ArrayBufferView) { 4088 bindings.CallCryptoGetRandomValues( 4089 this.ref, js.Pointer(&ret), 4090 array.Ref(), 4091 ) 4092 4093 return 4094 } 4095 4096 // TryGetRandomValues calls the method "Crypto.getRandomValues" 4097 // in a try/catch block and returns (_, err, ok = false) when it went through 4098 // the catch clause. 4099 func (this Crypto) TryGetRandomValues(array js.ArrayBufferView) (ret js.ArrayBufferView, exception js.Any, ok bool) { 4100 ok = js.True == bindings.TryCryptoGetRandomValues( 4101 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4102 array.Ref(), 4103 ) 4104 4105 return 4106 } 4107 4108 // HasFuncRandomUUID returns true if the method "Crypto.randomUUID" exists. 4109 func (this Crypto) HasFuncRandomUUID() bool { 4110 return js.True == bindings.HasFuncCryptoRandomUUID( 4111 this.ref, 4112 ) 4113 } 4114 4115 // FuncRandomUUID returns the method "Crypto.randomUUID". 4116 func (this Crypto) FuncRandomUUID() (fn js.Func[func() js.String]) { 4117 bindings.FuncCryptoRandomUUID( 4118 this.ref, js.Pointer(&fn), 4119 ) 4120 return 4121 } 4122 4123 // RandomUUID calls the method "Crypto.randomUUID". 4124 func (this Crypto) RandomUUID() (ret js.String) { 4125 bindings.CallCryptoRandomUUID( 4126 this.ref, js.Pointer(&ret), 4127 ) 4128 4129 return 4130 } 4131 4132 // TryRandomUUID calls the method "Crypto.randomUUID" 4133 // in a try/catch block and returns (_, err, ok = false) when it went through 4134 // the catch clause. 4135 func (this Crypto) TryRandomUUID() (ret js.String, exception js.Any, ok bool) { 4136 ok = js.True == bindings.TryCryptoRandomUUID( 4137 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4138 ) 4139 4140 return 4141 } 4142 4143 type MemoryAttributionContainer struct { 4144 // Id is "MemoryAttributionContainer.id" 4145 // 4146 // Optional 4147 Id js.String 4148 // Src is "MemoryAttributionContainer.src" 4149 // 4150 // Optional 4151 Src js.String 4152 4153 FFI_USE bool 4154 } 4155 4156 // FromRef calls UpdateFrom and returns a MemoryAttributionContainer with all fields set. 4157 func (p MemoryAttributionContainer) FromRef(ref js.Ref) MemoryAttributionContainer { 4158 p.UpdateFrom(ref) 4159 return p 4160 } 4161 4162 // New creates a new MemoryAttributionContainer in the application heap. 4163 func (p MemoryAttributionContainer) New() js.Ref { 4164 return bindings.MemoryAttributionContainerJSLoad( 4165 js.Pointer(&p), js.True, 0, 4166 ) 4167 } 4168 4169 // UpdateFrom copies value of all fields of the heap object to p. 4170 func (p *MemoryAttributionContainer) UpdateFrom(ref js.Ref) { 4171 bindings.MemoryAttributionContainerJSStore( 4172 js.Pointer(p), ref, 4173 ) 4174 } 4175 4176 // Update writes all fields of the p to the heap object referenced by ref. 4177 func (p *MemoryAttributionContainer) Update(ref js.Ref) { 4178 bindings.MemoryAttributionContainerJSLoad( 4179 js.Pointer(p), js.False, ref, 4180 ) 4181 } 4182 4183 // FreeMembers frees fields with heap reference, if recursive is true 4184 // free all heap references reachable from p. 4185 func (p *MemoryAttributionContainer) FreeMembers(recursive bool) { 4186 js.Free( 4187 p.Id.Ref(), 4188 p.Src.Ref(), 4189 ) 4190 p.Id = p.Id.FromRef(js.Undefined) 4191 p.Src = p.Src.FromRef(js.Undefined) 4192 } 4193 4194 type MemoryAttribution struct { 4195 // Url is "MemoryAttribution.url" 4196 // 4197 // Optional 4198 Url js.String 4199 // Container is "MemoryAttribution.container" 4200 // 4201 // Optional 4202 // 4203 // NOTE: Container.FFI_USE MUST be set to true to get Container used. 4204 Container MemoryAttributionContainer 4205 // Scope is "MemoryAttribution.scope" 4206 // 4207 // Optional 4208 Scope js.String 4209 4210 FFI_USE bool 4211 } 4212 4213 // FromRef calls UpdateFrom and returns a MemoryAttribution with all fields set. 4214 func (p MemoryAttribution) FromRef(ref js.Ref) MemoryAttribution { 4215 p.UpdateFrom(ref) 4216 return p 4217 } 4218 4219 // New creates a new MemoryAttribution in the application heap. 4220 func (p MemoryAttribution) New() js.Ref { 4221 return bindings.MemoryAttributionJSLoad( 4222 js.Pointer(&p), js.True, 0, 4223 ) 4224 } 4225 4226 // UpdateFrom copies value of all fields of the heap object to p. 4227 func (p *MemoryAttribution) UpdateFrom(ref js.Ref) { 4228 bindings.MemoryAttributionJSStore( 4229 js.Pointer(p), ref, 4230 ) 4231 } 4232 4233 // Update writes all fields of the p to the heap object referenced by ref. 4234 func (p *MemoryAttribution) Update(ref js.Ref) { 4235 bindings.MemoryAttributionJSLoad( 4236 js.Pointer(p), js.False, ref, 4237 ) 4238 } 4239 4240 // FreeMembers frees fields with heap reference, if recursive is true 4241 // free all heap references reachable from p. 4242 func (p *MemoryAttribution) FreeMembers(recursive bool) { 4243 js.Free( 4244 p.Url.Ref(), 4245 p.Scope.Ref(), 4246 ) 4247 p.Url = p.Url.FromRef(js.Undefined) 4248 p.Scope = p.Scope.FromRef(js.Undefined) 4249 if recursive { 4250 p.Container.FreeMembers(true) 4251 } 4252 } 4253 4254 type MemoryBreakdownEntry struct { 4255 // Bytes is "MemoryBreakdownEntry.bytes" 4256 // 4257 // Optional 4258 // 4259 // NOTE: FFI_USE_Bytes MUST be set to true to make this field effective. 4260 Bytes uint64 4261 // Attribution is "MemoryBreakdownEntry.attribution" 4262 // 4263 // Optional 4264 Attribution js.Array[MemoryAttribution] 4265 // Types is "MemoryBreakdownEntry.types" 4266 // 4267 // Optional 4268 Types js.Array[js.String] 4269 4270 FFI_USE_Bytes bool // for Bytes. 4271 4272 FFI_USE bool 4273 } 4274 4275 // FromRef calls UpdateFrom and returns a MemoryBreakdownEntry with all fields set. 4276 func (p MemoryBreakdownEntry) FromRef(ref js.Ref) MemoryBreakdownEntry { 4277 p.UpdateFrom(ref) 4278 return p 4279 } 4280 4281 // New creates a new MemoryBreakdownEntry in the application heap. 4282 func (p MemoryBreakdownEntry) New() js.Ref { 4283 return bindings.MemoryBreakdownEntryJSLoad( 4284 js.Pointer(&p), js.True, 0, 4285 ) 4286 } 4287 4288 // UpdateFrom copies value of all fields of the heap object to p. 4289 func (p *MemoryBreakdownEntry) UpdateFrom(ref js.Ref) { 4290 bindings.MemoryBreakdownEntryJSStore( 4291 js.Pointer(p), ref, 4292 ) 4293 } 4294 4295 // Update writes all fields of the p to the heap object referenced by ref. 4296 func (p *MemoryBreakdownEntry) Update(ref js.Ref) { 4297 bindings.MemoryBreakdownEntryJSLoad( 4298 js.Pointer(p), js.False, ref, 4299 ) 4300 } 4301 4302 // FreeMembers frees fields with heap reference, if recursive is true 4303 // free all heap references reachable from p. 4304 func (p *MemoryBreakdownEntry) FreeMembers(recursive bool) { 4305 js.Free( 4306 p.Attribution.Ref(), 4307 p.Types.Ref(), 4308 ) 4309 p.Attribution = p.Attribution.FromRef(js.Undefined) 4310 p.Types = p.Types.FromRef(js.Undefined) 4311 } 4312 4313 type MemoryMeasurement struct { 4314 // Bytes is "MemoryMeasurement.bytes" 4315 // 4316 // Optional 4317 // 4318 // NOTE: FFI_USE_Bytes MUST be set to true to make this field effective. 4319 Bytes uint64 4320 // Breakdown is "MemoryMeasurement.breakdown" 4321 // 4322 // Optional 4323 Breakdown js.Array[MemoryBreakdownEntry] 4324 4325 FFI_USE_Bytes bool // for Bytes. 4326 4327 FFI_USE bool 4328 } 4329 4330 // FromRef calls UpdateFrom and returns a MemoryMeasurement with all fields set. 4331 func (p MemoryMeasurement) FromRef(ref js.Ref) MemoryMeasurement { 4332 p.UpdateFrom(ref) 4333 return p 4334 } 4335 4336 // New creates a new MemoryMeasurement in the application heap. 4337 func (p MemoryMeasurement) New() js.Ref { 4338 return bindings.MemoryMeasurementJSLoad( 4339 js.Pointer(&p), js.True, 0, 4340 ) 4341 } 4342 4343 // UpdateFrom copies value of all fields of the heap object to p. 4344 func (p *MemoryMeasurement) UpdateFrom(ref js.Ref) { 4345 bindings.MemoryMeasurementJSStore( 4346 js.Pointer(p), ref, 4347 ) 4348 } 4349 4350 // Update writes all fields of the p to the heap object referenced by ref. 4351 func (p *MemoryMeasurement) Update(ref js.Ref) { 4352 bindings.MemoryMeasurementJSLoad( 4353 js.Pointer(p), js.False, ref, 4354 ) 4355 } 4356 4357 // FreeMembers frees fields with heap reference, if recursive is true 4358 // free all heap references reachable from p. 4359 func (p *MemoryMeasurement) FreeMembers(recursive bool) { 4360 js.Free( 4361 p.Breakdown.Ref(), 4362 ) 4363 p.Breakdown = p.Breakdown.FromRef(js.Undefined) 4364 } 4365 4366 type PerformanceMarkOptions struct { 4367 // Detail is "PerformanceMarkOptions.detail" 4368 // 4369 // Optional 4370 Detail js.Any 4371 // StartTime is "PerformanceMarkOptions.startTime" 4372 // 4373 // Optional 4374 // 4375 // NOTE: FFI_USE_StartTime MUST be set to true to make this field effective. 4376 StartTime DOMHighResTimeStamp 4377 4378 FFI_USE_StartTime bool // for StartTime. 4379 4380 FFI_USE bool 4381 } 4382 4383 // FromRef calls UpdateFrom and returns a PerformanceMarkOptions with all fields set. 4384 func (p PerformanceMarkOptions) FromRef(ref js.Ref) PerformanceMarkOptions { 4385 p.UpdateFrom(ref) 4386 return p 4387 } 4388 4389 // New creates a new PerformanceMarkOptions in the application heap. 4390 func (p PerformanceMarkOptions) New() js.Ref { 4391 return bindings.PerformanceMarkOptionsJSLoad( 4392 js.Pointer(&p), js.True, 0, 4393 ) 4394 } 4395 4396 // UpdateFrom copies value of all fields of the heap object to p. 4397 func (p *PerformanceMarkOptions) UpdateFrom(ref js.Ref) { 4398 bindings.PerformanceMarkOptionsJSStore( 4399 js.Pointer(p), ref, 4400 ) 4401 } 4402 4403 // Update writes all fields of the p to the heap object referenced by ref. 4404 func (p *PerformanceMarkOptions) Update(ref js.Ref) { 4405 bindings.PerformanceMarkOptionsJSLoad( 4406 js.Pointer(p), js.False, ref, 4407 ) 4408 } 4409 4410 // FreeMembers frees fields with heap reference, if recursive is true 4411 // free all heap references reachable from p. 4412 func (p *PerformanceMarkOptions) FreeMembers(recursive bool) { 4413 js.Free( 4414 p.Detail.Ref(), 4415 ) 4416 p.Detail = p.Detail.FromRef(js.Undefined) 4417 } 4418 4419 func NewPerformanceMark(markName js.String, markOptions PerformanceMarkOptions) (ret PerformanceMark) { 4420 ret.ref = bindings.NewPerformanceMarkByPerformanceMark( 4421 markName.Ref(), 4422 js.Pointer(&markOptions)) 4423 return 4424 } 4425 4426 func NewPerformanceMarkByPerformanceMark1(markName js.String) (ret PerformanceMark) { 4427 ret.ref = bindings.NewPerformanceMarkByPerformanceMark1( 4428 markName.Ref()) 4429 return 4430 } 4431 4432 type PerformanceMark struct { 4433 PerformanceEntry 4434 } 4435 4436 func (this PerformanceMark) Once() PerformanceMark { 4437 this.ref.Once() 4438 return this 4439 } 4440 4441 func (this PerformanceMark) Ref() js.Ref { 4442 return this.PerformanceEntry.Ref() 4443 } 4444 4445 func (this PerformanceMark) FromRef(ref js.Ref) PerformanceMark { 4446 this.PerformanceEntry = this.PerformanceEntry.FromRef(ref) 4447 return this 4448 } 4449 4450 func (this PerformanceMark) Free() { 4451 this.ref.Free() 4452 } 4453 4454 // Detail returns the value of property "PerformanceMark.detail". 4455 // 4456 // It returns ok=false if there is no such property. 4457 func (this PerformanceMark) Detail() (ret js.Any, ok bool) { 4458 ok = js.True == bindings.GetPerformanceMarkDetail( 4459 this.ref, js.Pointer(&ret), 4460 ) 4461 return 4462 } 4463 4464 type PerformanceMeasure struct { 4465 PerformanceEntry 4466 } 4467 4468 func (this PerformanceMeasure) Once() PerformanceMeasure { 4469 this.ref.Once() 4470 return this 4471 } 4472 4473 func (this PerformanceMeasure) Ref() js.Ref { 4474 return this.PerformanceEntry.Ref() 4475 } 4476 4477 func (this PerformanceMeasure) FromRef(ref js.Ref) PerformanceMeasure { 4478 this.PerformanceEntry = this.PerformanceEntry.FromRef(ref) 4479 return this 4480 } 4481 4482 func (this PerformanceMeasure) Free() { 4483 this.ref.Free() 4484 } 4485 4486 // Detail returns the value of property "PerformanceMeasure.detail". 4487 // 4488 // It returns ok=false if there is no such property. 4489 func (this PerformanceMeasure) Detail() (ret js.Any, ok bool) { 4490 ok = js.True == bindings.GetPerformanceMeasureDetail( 4491 this.ref, js.Pointer(&ret), 4492 ) 4493 return 4494 } 4495 4496 type OneOf_String_Float64 struct { 4497 ref js.Ref 4498 } 4499 4500 func (x OneOf_String_Float64) Ref() js.Ref { 4501 return x.ref 4502 } 4503 4504 func (x OneOf_String_Float64) Free() { 4505 x.ref.Free() 4506 } 4507 4508 func (x OneOf_String_Float64) FromRef(ref js.Ref) OneOf_String_Float64 { 4509 return OneOf_String_Float64{ 4510 ref: ref, 4511 } 4512 } 4513 4514 func (x OneOf_String_Float64) String() js.String { 4515 return js.String{}.FromRef(x.ref) 4516 } 4517 4518 func (x OneOf_String_Float64) Float64() float64 { 4519 return js.Number[float64]{}.FromRef(x.ref).Get() 4520 }