github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis40_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/core/mark" 9 "github.com/primecitizens/pcz/std/ffi/js" 10 "github.com/primecitizens/pcz/std/plat/js/web/bindings" 11 ) 12 13 func NewInstance(module Module, importObject js.Object) (ret Instance) { 14 ret.ref = bindings.NewInstanceByInstance( 15 module.Ref(), 16 importObject.Ref()) 17 return 18 } 19 20 func NewInstanceByInstance1(module Module) (ret Instance) { 21 ret.ref = bindings.NewInstanceByInstance1( 22 module.Ref()) 23 return 24 } 25 26 type Instance struct { 27 ref js.Ref 28 } 29 30 func (this Instance) Once() Instance { 31 this.ref.Once() 32 return this 33 } 34 35 func (this Instance) Ref() js.Ref { 36 return this.ref 37 } 38 39 func (this Instance) FromRef(ref js.Ref) Instance { 40 this.ref = ref 41 return this 42 } 43 44 func (this Instance) Free() { 45 this.ref.Free() 46 } 47 48 // Exports returns the value of property "Instance.exports". 49 // 50 // It returns ok=false if there is no such property. 51 func (this Instance) Exports() (ret js.Object, ok bool) { 52 ok = js.True == bindings.GetInstanceExports( 53 this.ref, js.Pointer(&ret), 54 ) 55 return 56 } 57 58 type InterestGroupBiddingScriptRunnerGlobalScope struct { 59 InterestGroupScriptRunnerGlobalScope 60 } 61 62 func (this InterestGroupBiddingScriptRunnerGlobalScope) Once() InterestGroupBiddingScriptRunnerGlobalScope { 63 this.ref.Once() 64 return this 65 } 66 67 func (this InterestGroupBiddingScriptRunnerGlobalScope) Ref() js.Ref { 68 return this.InterestGroupScriptRunnerGlobalScope.Ref() 69 } 70 71 func (this InterestGroupBiddingScriptRunnerGlobalScope) FromRef(ref js.Ref) InterestGroupBiddingScriptRunnerGlobalScope { 72 this.InterestGroupScriptRunnerGlobalScope = this.InterestGroupScriptRunnerGlobalScope.FromRef(ref) 73 return this 74 } 75 76 func (this InterestGroupBiddingScriptRunnerGlobalScope) Free() { 77 this.ref.Free() 78 } 79 80 // HasFuncSetBid returns true if the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid" exists. 81 func (this InterestGroupBiddingScriptRunnerGlobalScope) HasFuncSetBid() bool { 82 return js.True == bindings.HasFuncInterestGroupBiddingScriptRunnerGlobalScopeSetBid( 83 this.ref, 84 ) 85 } 86 87 // FuncSetBid returns the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid". 88 func (this InterestGroupBiddingScriptRunnerGlobalScope) FuncSetBid() (fn js.Func[func(generateBidOutput GenerateBidOutput) bool]) { 89 bindings.FuncInterestGroupBiddingScriptRunnerGlobalScopeSetBid( 90 this.ref, js.Pointer(&fn), 91 ) 92 return 93 } 94 95 // SetBid calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid". 96 func (this InterestGroupBiddingScriptRunnerGlobalScope) SetBid(generateBidOutput GenerateBidOutput) (ret bool) { 97 bindings.CallInterestGroupBiddingScriptRunnerGlobalScopeSetBid( 98 this.ref, js.Pointer(&ret), 99 js.Pointer(&generateBidOutput), 100 ) 101 102 return 103 } 104 105 // TrySetBid calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid" 106 // in a try/catch block and returns (_, err, ok = false) when it went through 107 // the catch clause. 108 func (this InterestGroupBiddingScriptRunnerGlobalScope) TrySetBid(generateBidOutput GenerateBidOutput) (ret bool, exception js.Any, ok bool) { 109 ok = js.True == bindings.TryInterestGroupBiddingScriptRunnerGlobalScopeSetBid( 110 this.ref, js.Pointer(&ret), js.Pointer(&exception), 111 js.Pointer(&generateBidOutput), 112 ) 113 114 return 115 } 116 117 // HasFuncSetBid1 returns true if the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid" exists. 118 func (this InterestGroupBiddingScriptRunnerGlobalScope) HasFuncSetBid1() bool { 119 return js.True == bindings.HasFuncInterestGroupBiddingScriptRunnerGlobalScopeSetBid1( 120 this.ref, 121 ) 122 } 123 124 // FuncSetBid1 returns the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid". 125 func (this InterestGroupBiddingScriptRunnerGlobalScope) FuncSetBid1() (fn js.Func[func() bool]) { 126 bindings.FuncInterestGroupBiddingScriptRunnerGlobalScopeSetBid1( 127 this.ref, js.Pointer(&fn), 128 ) 129 return 130 } 131 132 // SetBid1 calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid". 133 func (this InterestGroupBiddingScriptRunnerGlobalScope) SetBid1() (ret bool) { 134 bindings.CallInterestGroupBiddingScriptRunnerGlobalScopeSetBid1( 135 this.ref, js.Pointer(&ret), 136 ) 137 138 return 139 } 140 141 // TrySetBid1 calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setBid" 142 // in a try/catch block and returns (_, err, ok = false) when it went through 143 // the catch clause. 144 func (this InterestGroupBiddingScriptRunnerGlobalScope) TrySetBid1() (ret bool, exception js.Any, ok bool) { 145 ok = js.True == bindings.TryInterestGroupBiddingScriptRunnerGlobalScopeSetBid1( 146 this.ref, js.Pointer(&ret), js.Pointer(&exception), 147 ) 148 149 return 150 } 151 152 // HasFuncSetPriority returns true if the method "InterestGroupBiddingScriptRunnerGlobalScope.setPriority" exists. 153 func (this InterestGroupBiddingScriptRunnerGlobalScope) HasFuncSetPriority() bool { 154 return js.True == bindings.HasFuncInterestGroupBiddingScriptRunnerGlobalScopeSetPriority( 155 this.ref, 156 ) 157 } 158 159 // FuncSetPriority returns the method "InterestGroupBiddingScriptRunnerGlobalScope.setPriority". 160 func (this InterestGroupBiddingScriptRunnerGlobalScope) FuncSetPriority() (fn js.Func[func(priority float64)]) { 161 bindings.FuncInterestGroupBiddingScriptRunnerGlobalScopeSetPriority( 162 this.ref, js.Pointer(&fn), 163 ) 164 return 165 } 166 167 // SetPriority calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setPriority". 168 func (this InterestGroupBiddingScriptRunnerGlobalScope) SetPriority(priority float64) (ret js.Void) { 169 bindings.CallInterestGroupBiddingScriptRunnerGlobalScopeSetPriority( 170 this.ref, js.Pointer(&ret), 171 float64(priority), 172 ) 173 174 return 175 } 176 177 // TrySetPriority calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setPriority" 178 // in a try/catch block and returns (_, err, ok = false) when it went through 179 // the catch clause. 180 func (this InterestGroupBiddingScriptRunnerGlobalScope) TrySetPriority(priority float64) (ret js.Void, exception js.Any, ok bool) { 181 ok = js.True == bindings.TryInterestGroupBiddingScriptRunnerGlobalScopeSetPriority( 182 this.ref, js.Pointer(&ret), js.Pointer(&exception), 183 float64(priority), 184 ) 185 186 return 187 } 188 189 // HasFuncSetPrioritySignalsOverride returns true if the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride" exists. 190 func (this InterestGroupBiddingScriptRunnerGlobalScope) HasFuncSetPrioritySignalsOverride() bool { 191 return js.True == bindings.HasFuncInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride( 192 this.ref, 193 ) 194 } 195 196 // FuncSetPrioritySignalsOverride returns the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride". 197 func (this InterestGroupBiddingScriptRunnerGlobalScope) FuncSetPrioritySignalsOverride() (fn js.Func[func(key js.String, priority float64)]) { 198 bindings.FuncInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride( 199 this.ref, js.Pointer(&fn), 200 ) 201 return 202 } 203 204 // SetPrioritySignalsOverride calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride". 205 func (this InterestGroupBiddingScriptRunnerGlobalScope) SetPrioritySignalsOverride(key js.String, priority float64) (ret js.Void) { 206 bindings.CallInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride( 207 this.ref, js.Pointer(&ret), 208 key.Ref(), 209 float64(priority), 210 ) 211 212 return 213 } 214 215 // TrySetPrioritySignalsOverride calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride" 216 // in a try/catch block and returns (_, err, ok = false) when it went through 217 // the catch clause. 218 func (this InterestGroupBiddingScriptRunnerGlobalScope) TrySetPrioritySignalsOverride(key js.String, priority float64) (ret js.Void, exception js.Any, ok bool) { 219 ok = js.True == bindings.TryInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride( 220 this.ref, js.Pointer(&ret), js.Pointer(&exception), 221 key.Ref(), 222 float64(priority), 223 ) 224 225 return 226 } 227 228 // HasFuncSetPrioritySignalsOverride1 returns true if the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride" exists. 229 func (this InterestGroupBiddingScriptRunnerGlobalScope) HasFuncSetPrioritySignalsOverride1() bool { 230 return js.True == bindings.HasFuncInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride1( 231 this.ref, 232 ) 233 } 234 235 // FuncSetPrioritySignalsOverride1 returns the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride". 236 func (this InterestGroupBiddingScriptRunnerGlobalScope) FuncSetPrioritySignalsOverride1() (fn js.Func[func(key js.String)]) { 237 bindings.FuncInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride1( 238 this.ref, js.Pointer(&fn), 239 ) 240 return 241 } 242 243 // SetPrioritySignalsOverride1 calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride". 244 func (this InterestGroupBiddingScriptRunnerGlobalScope) SetPrioritySignalsOverride1(key js.String) (ret js.Void) { 245 bindings.CallInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride1( 246 this.ref, js.Pointer(&ret), 247 key.Ref(), 248 ) 249 250 return 251 } 252 253 // TrySetPrioritySignalsOverride1 calls the method "InterestGroupBiddingScriptRunnerGlobalScope.setPrioritySignalsOverride" 254 // in a try/catch block and returns (_, err, ok = false) when it went through 255 // the catch clause. 256 func (this InterestGroupBiddingScriptRunnerGlobalScope) TrySetPrioritySignalsOverride1(key js.String) (ret js.Void, exception js.Any, ok bool) { 257 ok = js.True == bindings.TryInterestGroupBiddingScriptRunnerGlobalScopeSetPrioritySignalsOverride1( 258 this.ref, js.Pointer(&ret), js.Pointer(&exception), 259 key.Ref(), 260 ) 261 262 return 263 } 264 265 type InterestGroupReportingScriptRunnerGlobalScope struct { 266 InterestGroupScriptRunnerGlobalScope 267 } 268 269 func (this InterestGroupReportingScriptRunnerGlobalScope) Once() InterestGroupReportingScriptRunnerGlobalScope { 270 this.ref.Once() 271 return this 272 } 273 274 func (this InterestGroupReportingScriptRunnerGlobalScope) Ref() js.Ref { 275 return this.InterestGroupScriptRunnerGlobalScope.Ref() 276 } 277 278 func (this InterestGroupReportingScriptRunnerGlobalScope) FromRef(ref js.Ref) InterestGroupReportingScriptRunnerGlobalScope { 279 this.InterestGroupScriptRunnerGlobalScope = this.InterestGroupScriptRunnerGlobalScope.FromRef(ref) 280 return this 281 } 282 283 func (this InterestGroupReportingScriptRunnerGlobalScope) Free() { 284 this.ref.Free() 285 } 286 287 // HasFuncSendReportTo returns true if the method "InterestGroupReportingScriptRunnerGlobalScope.sendReportTo" exists. 288 func (this InterestGroupReportingScriptRunnerGlobalScope) HasFuncSendReportTo() bool { 289 return js.True == bindings.HasFuncInterestGroupReportingScriptRunnerGlobalScopeSendReportTo( 290 this.ref, 291 ) 292 } 293 294 // FuncSendReportTo returns the method "InterestGroupReportingScriptRunnerGlobalScope.sendReportTo". 295 func (this InterestGroupReportingScriptRunnerGlobalScope) FuncSendReportTo() (fn js.Func[func(url js.String)]) { 296 bindings.FuncInterestGroupReportingScriptRunnerGlobalScopeSendReportTo( 297 this.ref, js.Pointer(&fn), 298 ) 299 return 300 } 301 302 // SendReportTo calls the method "InterestGroupReportingScriptRunnerGlobalScope.sendReportTo". 303 func (this InterestGroupReportingScriptRunnerGlobalScope) SendReportTo(url js.String) (ret js.Void) { 304 bindings.CallInterestGroupReportingScriptRunnerGlobalScopeSendReportTo( 305 this.ref, js.Pointer(&ret), 306 url.Ref(), 307 ) 308 309 return 310 } 311 312 // TrySendReportTo calls the method "InterestGroupReportingScriptRunnerGlobalScope.sendReportTo" 313 // in a try/catch block and returns (_, err, ok = false) when it went through 314 // the catch clause. 315 func (this InterestGroupReportingScriptRunnerGlobalScope) TrySendReportTo(url js.String) (ret js.Void, exception js.Any, ok bool) { 316 ok = js.True == bindings.TryInterestGroupReportingScriptRunnerGlobalScopeSendReportTo( 317 this.ref, js.Pointer(&ret), js.Pointer(&exception), 318 url.Ref(), 319 ) 320 321 return 322 } 323 324 // HasFuncRegisterAdBeacon returns true if the method "InterestGroupReportingScriptRunnerGlobalScope.registerAdBeacon" exists. 325 func (this InterestGroupReportingScriptRunnerGlobalScope) HasFuncRegisterAdBeacon() bool { 326 return js.True == bindings.HasFuncInterestGroupReportingScriptRunnerGlobalScopeRegisterAdBeacon( 327 this.ref, 328 ) 329 } 330 331 // FuncRegisterAdBeacon returns the method "InterestGroupReportingScriptRunnerGlobalScope.registerAdBeacon". 332 func (this InterestGroupReportingScriptRunnerGlobalScope) FuncRegisterAdBeacon() (fn js.Func[func(mapping js.Record[js.String])]) { 333 bindings.FuncInterestGroupReportingScriptRunnerGlobalScopeRegisterAdBeacon( 334 this.ref, js.Pointer(&fn), 335 ) 336 return 337 } 338 339 // RegisterAdBeacon calls the method "InterestGroupReportingScriptRunnerGlobalScope.registerAdBeacon". 340 func (this InterestGroupReportingScriptRunnerGlobalScope) RegisterAdBeacon(mapping js.Record[js.String]) (ret js.Void) { 341 bindings.CallInterestGroupReportingScriptRunnerGlobalScopeRegisterAdBeacon( 342 this.ref, js.Pointer(&ret), 343 mapping.Ref(), 344 ) 345 346 return 347 } 348 349 // TryRegisterAdBeacon calls the method "InterestGroupReportingScriptRunnerGlobalScope.registerAdBeacon" 350 // in a try/catch block and returns (_, err, ok = false) when it went through 351 // the catch clause. 352 func (this InterestGroupReportingScriptRunnerGlobalScope) TryRegisterAdBeacon(mapping js.Record[js.String]) (ret js.Void, exception js.Any, ok bool) { 353 ok = js.True == bindings.TryInterestGroupReportingScriptRunnerGlobalScopeRegisterAdBeacon( 354 this.ref, js.Pointer(&ret), js.Pointer(&exception), 355 mapping.Ref(), 356 ) 357 358 return 359 } 360 361 type InterestGroupScoringScriptRunnerGlobalScope struct { 362 InterestGroupScriptRunnerGlobalScope 363 } 364 365 func (this InterestGroupScoringScriptRunnerGlobalScope) Once() InterestGroupScoringScriptRunnerGlobalScope { 366 this.ref.Once() 367 return this 368 } 369 370 func (this InterestGroupScoringScriptRunnerGlobalScope) Ref() js.Ref { 371 return this.InterestGroupScriptRunnerGlobalScope.Ref() 372 } 373 374 func (this InterestGroupScoringScriptRunnerGlobalScope) FromRef(ref js.Ref) InterestGroupScoringScriptRunnerGlobalScope { 375 this.InterestGroupScriptRunnerGlobalScope = this.InterestGroupScriptRunnerGlobalScope.FromRef(ref) 376 return this 377 } 378 379 func (this InterestGroupScoringScriptRunnerGlobalScope) Free() { 380 this.ref.Free() 381 } 382 383 type InterestGroupScriptRunnerGlobalScope struct { 384 ref js.Ref 385 } 386 387 func (this InterestGroupScriptRunnerGlobalScope) Once() InterestGroupScriptRunnerGlobalScope { 388 this.ref.Once() 389 return this 390 } 391 392 func (this InterestGroupScriptRunnerGlobalScope) Ref() js.Ref { 393 return this.ref 394 } 395 396 func (this InterestGroupScriptRunnerGlobalScope) FromRef(ref js.Ref) InterestGroupScriptRunnerGlobalScope { 397 this.ref = ref 398 return this 399 } 400 401 func (this InterestGroupScriptRunnerGlobalScope) Free() { 402 this.ref.Free() 403 } 404 405 type IntersectionObserverCallbackFunc func(this js.Ref, entries js.Array[IntersectionObserverEntry], observer IntersectionObserver) js.Ref 406 407 func (fn IntersectionObserverCallbackFunc) Register() js.Func[func(entries js.Array[IntersectionObserverEntry], observer IntersectionObserver)] { 408 return js.RegisterCallback[func(entries js.Array[IntersectionObserverEntry], observer IntersectionObserver)]( 409 fn, abi.FuncPCABIInternal(fn), 410 ) 411 } 412 413 func (fn IntersectionObserverCallbackFunc) DispatchCallback( 414 targetPC uintptr, ctx *js.CallbackContext, 415 ) { 416 args := ctx.Args() 417 if len(args) != 2+1 /* js this */ || 418 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 419 js.ThrowInvalidCallbackInvocation() 420 } 421 422 if ctx.Return(fn( 423 args[0], 424 425 js.Array[IntersectionObserverEntry]{}.FromRef(args[0+1]), 426 IntersectionObserver{}.FromRef(args[1+1]), 427 )) { 428 return 429 } 430 431 js.ThrowCallbackValueNotReturned() 432 } 433 434 type IntersectionObserverCallback[T any] struct { 435 Fn func(arg T, this js.Ref, entries js.Array[IntersectionObserverEntry], observer IntersectionObserver) js.Ref 436 Arg T 437 } 438 439 func (cb *IntersectionObserverCallback[T]) Register() js.Func[func(entries js.Array[IntersectionObserverEntry], observer IntersectionObserver)] { 440 return js.RegisterCallback[func(entries js.Array[IntersectionObserverEntry], observer IntersectionObserver)]( 441 cb, abi.FuncPCABIInternal(cb.Fn), 442 ) 443 } 444 445 func (cb *IntersectionObserverCallback[T]) DispatchCallback( 446 targetPC uintptr, ctx *js.CallbackContext, 447 ) { 448 args := ctx.Args() 449 if len(args) != 2+1 /* js this */ || 450 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 451 js.ThrowInvalidCallbackInvocation() 452 } 453 454 if ctx.Return(cb.Fn( 455 cb.Arg, 456 args[0], 457 458 js.Array[IntersectionObserverEntry]{}.FromRef(args[0+1]), 459 IntersectionObserver{}.FromRef(args[1+1]), 460 )) { 461 return 462 } 463 464 js.ThrowCallbackValueNotReturned() 465 } 466 467 type IntersectionObserverEntryInit struct { 468 // Time is "IntersectionObserverEntryInit.time" 469 // 470 // Required 471 Time DOMHighResTimeStamp 472 // RootBounds is "IntersectionObserverEntryInit.rootBounds" 473 // 474 // Required 475 // 476 // NOTE: RootBounds.FFI_USE MUST be set to true to get RootBounds used. 477 RootBounds DOMRectInit 478 // BoundingClientRect is "IntersectionObserverEntryInit.boundingClientRect" 479 // 480 // Required 481 // 482 // NOTE: BoundingClientRect.FFI_USE MUST be set to true to get BoundingClientRect used. 483 BoundingClientRect DOMRectInit 484 // IntersectionRect is "IntersectionObserverEntryInit.intersectionRect" 485 // 486 // Required 487 // 488 // NOTE: IntersectionRect.FFI_USE MUST be set to true to get IntersectionRect used. 489 IntersectionRect DOMRectInit 490 // IsIntersecting is "IntersectionObserverEntryInit.isIntersecting" 491 // 492 // Required 493 IsIntersecting bool 494 // IntersectionRatio is "IntersectionObserverEntryInit.intersectionRatio" 495 // 496 // Required 497 IntersectionRatio float64 498 // Target is "IntersectionObserverEntryInit.target" 499 // 500 // Required 501 Target Element 502 503 FFI_USE bool 504 } 505 506 // FromRef calls UpdateFrom and returns a IntersectionObserverEntryInit with all fields set. 507 func (p IntersectionObserverEntryInit) FromRef(ref js.Ref) IntersectionObserverEntryInit { 508 p.UpdateFrom(ref) 509 return p 510 } 511 512 // New creates a new IntersectionObserverEntryInit in the application heap. 513 func (p IntersectionObserverEntryInit) New() js.Ref { 514 return bindings.IntersectionObserverEntryInitJSLoad( 515 js.Pointer(&p), js.True, 0, 516 ) 517 } 518 519 // UpdateFrom copies value of all fields of the heap object to p. 520 func (p *IntersectionObserverEntryInit) UpdateFrom(ref js.Ref) { 521 bindings.IntersectionObserverEntryInitJSStore( 522 js.Pointer(p), ref, 523 ) 524 } 525 526 // Update writes all fields of the p to the heap object referenced by ref. 527 func (p *IntersectionObserverEntryInit) Update(ref js.Ref) { 528 bindings.IntersectionObserverEntryInitJSLoad( 529 js.Pointer(p), js.False, ref, 530 ) 531 } 532 533 // FreeMembers frees fields with heap reference, if recursive is true 534 // free all heap references reachable from p. 535 func (p *IntersectionObserverEntryInit) FreeMembers(recursive bool) { 536 js.Free( 537 p.Target.Ref(), 538 ) 539 p.Target = p.Target.FromRef(js.Undefined) 540 if recursive { 541 p.RootBounds.FreeMembers(true) 542 p.BoundingClientRect.FreeMembers(true) 543 p.IntersectionRect.FreeMembers(true) 544 } 545 } 546 547 func NewIntersectionObserverEntry(intersectionObserverEntryInit IntersectionObserverEntryInit) (ret IntersectionObserverEntry) { 548 ret.ref = bindings.NewIntersectionObserverEntryByIntersectionObserverEntry( 549 js.Pointer(&intersectionObserverEntryInit)) 550 return 551 } 552 553 type IntersectionObserverEntry struct { 554 ref js.Ref 555 } 556 557 func (this IntersectionObserverEntry) Once() IntersectionObserverEntry { 558 this.ref.Once() 559 return this 560 } 561 562 func (this IntersectionObserverEntry) Ref() js.Ref { 563 return this.ref 564 } 565 566 func (this IntersectionObserverEntry) FromRef(ref js.Ref) IntersectionObserverEntry { 567 this.ref = ref 568 return this 569 } 570 571 func (this IntersectionObserverEntry) Free() { 572 this.ref.Free() 573 } 574 575 // Time returns the value of property "IntersectionObserverEntry.time". 576 // 577 // It returns ok=false if there is no such property. 578 func (this IntersectionObserverEntry) Time() (ret DOMHighResTimeStamp, ok bool) { 579 ok = js.True == bindings.GetIntersectionObserverEntryTime( 580 this.ref, js.Pointer(&ret), 581 ) 582 return 583 } 584 585 // RootBounds returns the value of property "IntersectionObserverEntry.rootBounds". 586 // 587 // It returns ok=false if there is no such property. 588 func (this IntersectionObserverEntry) RootBounds() (ret DOMRectReadOnly, ok bool) { 589 ok = js.True == bindings.GetIntersectionObserverEntryRootBounds( 590 this.ref, js.Pointer(&ret), 591 ) 592 return 593 } 594 595 // BoundingClientRect returns the value of property "IntersectionObserverEntry.boundingClientRect". 596 // 597 // It returns ok=false if there is no such property. 598 func (this IntersectionObserverEntry) BoundingClientRect() (ret DOMRectReadOnly, ok bool) { 599 ok = js.True == bindings.GetIntersectionObserverEntryBoundingClientRect( 600 this.ref, js.Pointer(&ret), 601 ) 602 return 603 } 604 605 // IntersectionRect returns the value of property "IntersectionObserverEntry.intersectionRect". 606 // 607 // It returns ok=false if there is no such property. 608 func (this IntersectionObserverEntry) IntersectionRect() (ret DOMRectReadOnly, ok bool) { 609 ok = js.True == bindings.GetIntersectionObserverEntryIntersectionRect( 610 this.ref, js.Pointer(&ret), 611 ) 612 return 613 } 614 615 // IsIntersecting returns the value of property "IntersectionObserverEntry.isIntersecting". 616 // 617 // It returns ok=false if there is no such property. 618 func (this IntersectionObserverEntry) IsIntersecting() (ret bool, ok bool) { 619 ok = js.True == bindings.GetIntersectionObserverEntryIsIntersecting( 620 this.ref, js.Pointer(&ret), 621 ) 622 return 623 } 624 625 // IntersectionRatio returns the value of property "IntersectionObserverEntry.intersectionRatio". 626 // 627 // It returns ok=false if there is no such property. 628 func (this IntersectionObserverEntry) IntersectionRatio() (ret float64, ok bool) { 629 ok = js.True == bindings.GetIntersectionObserverEntryIntersectionRatio( 630 this.ref, js.Pointer(&ret), 631 ) 632 return 633 } 634 635 // Target returns the value of property "IntersectionObserverEntry.target". 636 // 637 // It returns ok=false if there is no such property. 638 func (this IntersectionObserverEntry) Target() (ret Element, ok bool) { 639 ok = js.True == bindings.GetIntersectionObserverEntryTarget( 640 this.ref, js.Pointer(&ret), 641 ) 642 return 643 } 644 645 type OneOf_Element_Document struct { 646 ref js.Ref 647 } 648 649 func (x OneOf_Element_Document) Ref() js.Ref { 650 return x.ref 651 } 652 653 func (x OneOf_Element_Document) Free() { 654 x.ref.Free() 655 } 656 657 func (x OneOf_Element_Document) FromRef(ref js.Ref) OneOf_Element_Document { 658 return OneOf_Element_Document{ 659 ref: ref, 660 } 661 } 662 663 func (x OneOf_Element_Document) Element() Element { 664 return Element{}.FromRef(x.ref) 665 } 666 667 func (x OneOf_Element_Document) Document() Document { 668 return Document{}.FromRef(x.ref) 669 } 670 671 type OneOf_Float64_ArrayFloat64 struct { 672 ref js.Ref 673 } 674 675 func (x OneOf_Float64_ArrayFloat64) Ref() js.Ref { 676 return x.ref 677 } 678 679 func (x OneOf_Float64_ArrayFloat64) Free() { 680 x.ref.Free() 681 } 682 683 func (x OneOf_Float64_ArrayFloat64) FromRef(ref js.Ref) OneOf_Float64_ArrayFloat64 { 684 return OneOf_Float64_ArrayFloat64{ 685 ref: ref, 686 } 687 } 688 689 func (x OneOf_Float64_ArrayFloat64) Float64() float64 { 690 return js.Number[float64]{}.FromRef(x.ref).Get() 691 } 692 693 func (x OneOf_Float64_ArrayFloat64) ArrayFloat64() js.Array[float64] { 694 return js.Array[float64]{}.FromRef(x.ref) 695 } 696 697 type IntersectionObserverInit struct { 698 // Root is "IntersectionObserverInit.root" 699 // 700 // Optional, defaults to null. 701 Root OneOf_Element_Document 702 // RootMargin is "IntersectionObserverInit.rootMargin" 703 // 704 // Optional, defaults to "0px". 705 RootMargin js.String 706 // Threshold is "IntersectionObserverInit.threshold" 707 // 708 // Optional, defaults to 0. 709 Threshold OneOf_Float64_ArrayFloat64 710 711 FFI_USE bool 712 } 713 714 // FromRef calls UpdateFrom and returns a IntersectionObserverInit with all fields set. 715 func (p IntersectionObserverInit) FromRef(ref js.Ref) IntersectionObserverInit { 716 p.UpdateFrom(ref) 717 return p 718 } 719 720 // New creates a new IntersectionObserverInit in the application heap. 721 func (p IntersectionObserverInit) New() js.Ref { 722 return bindings.IntersectionObserverInitJSLoad( 723 js.Pointer(&p), js.True, 0, 724 ) 725 } 726 727 // UpdateFrom copies value of all fields of the heap object to p. 728 func (p *IntersectionObserverInit) UpdateFrom(ref js.Ref) { 729 bindings.IntersectionObserverInitJSStore( 730 js.Pointer(p), ref, 731 ) 732 } 733 734 // Update writes all fields of the p to the heap object referenced by ref. 735 func (p *IntersectionObserverInit) Update(ref js.Ref) { 736 bindings.IntersectionObserverInitJSLoad( 737 js.Pointer(p), js.False, ref, 738 ) 739 } 740 741 // FreeMembers frees fields with heap reference, if recursive is true 742 // free all heap references reachable from p. 743 func (p *IntersectionObserverInit) FreeMembers(recursive bool) { 744 js.Free( 745 p.Root.Ref(), 746 p.RootMargin.Ref(), 747 p.Threshold.Ref(), 748 ) 749 p.Root = p.Root.FromRef(js.Undefined) 750 p.RootMargin = p.RootMargin.FromRef(js.Undefined) 751 p.Threshold = p.Threshold.FromRef(js.Undefined) 752 } 753 754 func NewIntersectionObserver(callback js.Func[func(entries js.Array[IntersectionObserverEntry], observer IntersectionObserver)], options IntersectionObserverInit) (ret IntersectionObserver) { 755 ret.ref = bindings.NewIntersectionObserverByIntersectionObserver( 756 callback.Ref(), 757 js.Pointer(&options)) 758 return 759 } 760 761 func NewIntersectionObserverByIntersectionObserver1(callback js.Func[func(entries js.Array[IntersectionObserverEntry], observer IntersectionObserver)]) (ret IntersectionObserver) { 762 ret.ref = bindings.NewIntersectionObserverByIntersectionObserver1( 763 callback.Ref()) 764 return 765 } 766 767 type IntersectionObserver struct { 768 ref js.Ref 769 } 770 771 func (this IntersectionObserver) Once() IntersectionObserver { 772 this.ref.Once() 773 return this 774 } 775 776 func (this IntersectionObserver) Ref() js.Ref { 777 return this.ref 778 } 779 780 func (this IntersectionObserver) FromRef(ref js.Ref) IntersectionObserver { 781 this.ref = ref 782 return this 783 } 784 785 func (this IntersectionObserver) Free() { 786 this.ref.Free() 787 } 788 789 // Root returns the value of property "IntersectionObserver.root". 790 // 791 // It returns ok=false if there is no such property. 792 func (this IntersectionObserver) Root() (ret OneOf_Element_Document, ok bool) { 793 ok = js.True == bindings.GetIntersectionObserverRoot( 794 this.ref, js.Pointer(&ret), 795 ) 796 return 797 } 798 799 // RootMargin returns the value of property "IntersectionObserver.rootMargin". 800 // 801 // It returns ok=false if there is no such property. 802 func (this IntersectionObserver) RootMargin() (ret js.String, ok bool) { 803 ok = js.True == bindings.GetIntersectionObserverRootMargin( 804 this.ref, js.Pointer(&ret), 805 ) 806 return 807 } 808 809 // Thresholds returns the value of property "IntersectionObserver.thresholds". 810 // 811 // It returns ok=false if there is no such property. 812 func (this IntersectionObserver) Thresholds() (ret js.FrozenArray[float64], ok bool) { 813 ok = js.True == bindings.GetIntersectionObserverThresholds( 814 this.ref, js.Pointer(&ret), 815 ) 816 return 817 } 818 819 // HasFuncObserve returns true if the method "IntersectionObserver.observe" exists. 820 func (this IntersectionObserver) HasFuncObserve() bool { 821 return js.True == bindings.HasFuncIntersectionObserverObserve( 822 this.ref, 823 ) 824 } 825 826 // FuncObserve returns the method "IntersectionObserver.observe". 827 func (this IntersectionObserver) FuncObserve() (fn js.Func[func(target Element)]) { 828 bindings.FuncIntersectionObserverObserve( 829 this.ref, js.Pointer(&fn), 830 ) 831 return 832 } 833 834 // Observe calls the method "IntersectionObserver.observe". 835 func (this IntersectionObserver) Observe(target Element) (ret js.Void) { 836 bindings.CallIntersectionObserverObserve( 837 this.ref, js.Pointer(&ret), 838 target.Ref(), 839 ) 840 841 return 842 } 843 844 // TryObserve calls the method "IntersectionObserver.observe" 845 // in a try/catch block and returns (_, err, ok = false) when it went through 846 // the catch clause. 847 func (this IntersectionObserver) TryObserve(target Element) (ret js.Void, exception js.Any, ok bool) { 848 ok = js.True == bindings.TryIntersectionObserverObserve( 849 this.ref, js.Pointer(&ret), js.Pointer(&exception), 850 target.Ref(), 851 ) 852 853 return 854 } 855 856 // HasFuncUnobserve returns true if the method "IntersectionObserver.unobserve" exists. 857 func (this IntersectionObserver) HasFuncUnobserve() bool { 858 return js.True == bindings.HasFuncIntersectionObserverUnobserve( 859 this.ref, 860 ) 861 } 862 863 // FuncUnobserve returns the method "IntersectionObserver.unobserve". 864 func (this IntersectionObserver) FuncUnobserve() (fn js.Func[func(target Element)]) { 865 bindings.FuncIntersectionObserverUnobserve( 866 this.ref, js.Pointer(&fn), 867 ) 868 return 869 } 870 871 // Unobserve calls the method "IntersectionObserver.unobserve". 872 func (this IntersectionObserver) Unobserve(target Element) (ret js.Void) { 873 bindings.CallIntersectionObserverUnobserve( 874 this.ref, js.Pointer(&ret), 875 target.Ref(), 876 ) 877 878 return 879 } 880 881 // TryUnobserve calls the method "IntersectionObserver.unobserve" 882 // in a try/catch block and returns (_, err, ok = false) when it went through 883 // the catch clause. 884 func (this IntersectionObserver) TryUnobserve(target Element) (ret js.Void, exception js.Any, ok bool) { 885 ok = js.True == bindings.TryIntersectionObserverUnobserve( 886 this.ref, js.Pointer(&ret), js.Pointer(&exception), 887 target.Ref(), 888 ) 889 890 return 891 } 892 893 // HasFuncDisconnect returns true if the method "IntersectionObserver.disconnect" exists. 894 func (this IntersectionObserver) HasFuncDisconnect() bool { 895 return js.True == bindings.HasFuncIntersectionObserverDisconnect( 896 this.ref, 897 ) 898 } 899 900 // FuncDisconnect returns the method "IntersectionObserver.disconnect". 901 func (this IntersectionObserver) FuncDisconnect() (fn js.Func[func()]) { 902 bindings.FuncIntersectionObserverDisconnect( 903 this.ref, js.Pointer(&fn), 904 ) 905 return 906 } 907 908 // Disconnect calls the method "IntersectionObserver.disconnect". 909 func (this IntersectionObserver) Disconnect() (ret js.Void) { 910 bindings.CallIntersectionObserverDisconnect( 911 this.ref, js.Pointer(&ret), 912 ) 913 914 return 915 } 916 917 // TryDisconnect calls the method "IntersectionObserver.disconnect" 918 // in a try/catch block and returns (_, err, ok = false) when it went through 919 // the catch clause. 920 func (this IntersectionObserver) TryDisconnect() (ret js.Void, exception js.Any, ok bool) { 921 ok = js.True == bindings.TryIntersectionObserverDisconnect( 922 this.ref, js.Pointer(&ret), js.Pointer(&exception), 923 ) 924 925 return 926 } 927 928 // HasFuncTakeRecords returns true if the method "IntersectionObserver.takeRecords" exists. 929 func (this IntersectionObserver) HasFuncTakeRecords() bool { 930 return js.True == bindings.HasFuncIntersectionObserverTakeRecords( 931 this.ref, 932 ) 933 } 934 935 // FuncTakeRecords returns the method "IntersectionObserver.takeRecords". 936 func (this IntersectionObserver) FuncTakeRecords() (fn js.Func[func() js.Array[IntersectionObserverEntry]]) { 937 bindings.FuncIntersectionObserverTakeRecords( 938 this.ref, js.Pointer(&fn), 939 ) 940 return 941 } 942 943 // TakeRecords calls the method "IntersectionObserver.takeRecords". 944 func (this IntersectionObserver) TakeRecords() (ret js.Array[IntersectionObserverEntry]) { 945 bindings.CallIntersectionObserverTakeRecords( 946 this.ref, js.Pointer(&ret), 947 ) 948 949 return 950 } 951 952 // TryTakeRecords calls the method "IntersectionObserver.takeRecords" 953 // in a try/catch block and returns (_, err, ok = false) when it went through 954 // the catch clause. 955 func (this IntersectionObserver) TryTakeRecords() (ret js.Array[IntersectionObserverEntry], exception js.Any, ok bool) { 956 ok = js.True == bindings.TryIntersectionObserverTakeRecords( 957 this.ref, js.Pointer(&ret), js.Pointer(&exception), 958 ) 959 960 return 961 } 962 963 type InterventionReportBody struct { 964 ReportBody 965 } 966 967 func (this InterventionReportBody) Once() InterventionReportBody { 968 this.ref.Once() 969 return this 970 } 971 972 func (this InterventionReportBody) Ref() js.Ref { 973 return this.ReportBody.Ref() 974 } 975 976 func (this InterventionReportBody) FromRef(ref js.Ref) InterventionReportBody { 977 this.ReportBody = this.ReportBody.FromRef(ref) 978 return this 979 } 980 981 func (this InterventionReportBody) Free() { 982 this.ref.Free() 983 } 984 985 // Id returns the value of property "InterventionReportBody.id". 986 // 987 // It returns ok=false if there is no such property. 988 func (this InterventionReportBody) Id() (ret js.String, ok bool) { 989 ok = js.True == bindings.GetInterventionReportBodyId( 990 this.ref, js.Pointer(&ret), 991 ) 992 return 993 } 994 995 // Message returns the value of property "InterventionReportBody.message". 996 // 997 // It returns ok=false if there is no such property. 998 func (this InterventionReportBody) Message() (ret js.String, ok bool) { 999 ok = js.True == bindings.GetInterventionReportBodyMessage( 1000 this.ref, js.Pointer(&ret), 1001 ) 1002 return 1003 } 1004 1005 // SourceFile returns the value of property "InterventionReportBody.sourceFile". 1006 // 1007 // It returns ok=false if there is no such property. 1008 func (this InterventionReportBody) SourceFile() (ret js.String, ok bool) { 1009 ok = js.True == bindings.GetInterventionReportBodySourceFile( 1010 this.ref, js.Pointer(&ret), 1011 ) 1012 return 1013 } 1014 1015 // LineNumber returns the value of property "InterventionReportBody.lineNumber". 1016 // 1017 // It returns ok=false if there is no such property. 1018 func (this InterventionReportBody) LineNumber() (ret uint32, ok bool) { 1019 ok = js.True == bindings.GetInterventionReportBodyLineNumber( 1020 this.ref, js.Pointer(&ret), 1021 ) 1022 return 1023 } 1024 1025 // ColumnNumber returns the value of property "InterventionReportBody.columnNumber". 1026 // 1027 // It returns ok=false if there is no such property. 1028 func (this InterventionReportBody) ColumnNumber() (ret uint32, ok bool) { 1029 ok = js.True == bindings.GetInterventionReportBodyColumnNumber( 1030 this.ref, js.Pointer(&ret), 1031 ) 1032 return 1033 } 1034 1035 // HasFuncToJSON returns true if the method "InterventionReportBody.toJSON" exists. 1036 func (this InterventionReportBody) HasFuncToJSON() bool { 1037 return js.True == bindings.HasFuncInterventionReportBodyToJSON( 1038 this.ref, 1039 ) 1040 } 1041 1042 // FuncToJSON returns the method "InterventionReportBody.toJSON". 1043 func (this InterventionReportBody) FuncToJSON() (fn js.Func[func() js.Object]) { 1044 bindings.FuncInterventionReportBodyToJSON( 1045 this.ref, js.Pointer(&fn), 1046 ) 1047 return 1048 } 1049 1050 // ToJSON calls the method "InterventionReportBody.toJSON". 1051 func (this InterventionReportBody) ToJSON() (ret js.Object) { 1052 bindings.CallInterventionReportBodyToJSON( 1053 this.ref, js.Pointer(&ret), 1054 ) 1055 1056 return 1057 } 1058 1059 // TryToJSON calls the method "InterventionReportBody.toJSON" 1060 // in a try/catch block and returns (_, err, ok = false) when it went through 1061 // the catch clause. 1062 func (this InterventionReportBody) TryToJSON() (ret js.Object, exception js.Any, ok bool) { 1063 ok = js.True == bindings.TryInterventionReportBodyToJSON( 1064 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1065 ) 1066 1067 return 1068 } 1069 1070 type IntrinsicSizesResultOptions struct { 1071 // MaxContentSize is "IntrinsicSizesResultOptions.maxContentSize" 1072 // 1073 // Optional 1074 // 1075 // NOTE: FFI_USE_MaxContentSize MUST be set to true to make this field effective. 1076 MaxContentSize float64 1077 // MinContentSize is "IntrinsicSizesResultOptions.minContentSize" 1078 // 1079 // Optional 1080 // 1081 // NOTE: FFI_USE_MinContentSize MUST be set to true to make this field effective. 1082 MinContentSize float64 1083 1084 FFI_USE_MaxContentSize bool // for MaxContentSize. 1085 FFI_USE_MinContentSize bool // for MinContentSize. 1086 1087 FFI_USE bool 1088 } 1089 1090 // FromRef calls UpdateFrom and returns a IntrinsicSizesResultOptions with all fields set. 1091 func (p IntrinsicSizesResultOptions) FromRef(ref js.Ref) IntrinsicSizesResultOptions { 1092 p.UpdateFrom(ref) 1093 return p 1094 } 1095 1096 // New creates a new IntrinsicSizesResultOptions in the application heap. 1097 func (p IntrinsicSizesResultOptions) New() js.Ref { 1098 return bindings.IntrinsicSizesResultOptionsJSLoad( 1099 js.Pointer(&p), js.True, 0, 1100 ) 1101 } 1102 1103 // UpdateFrom copies value of all fields of the heap object to p. 1104 func (p *IntrinsicSizesResultOptions) UpdateFrom(ref js.Ref) { 1105 bindings.IntrinsicSizesResultOptionsJSStore( 1106 js.Pointer(p), ref, 1107 ) 1108 } 1109 1110 // Update writes all fields of the p to the heap object referenced by ref. 1111 func (p *IntrinsicSizesResultOptions) Update(ref js.Ref) { 1112 bindings.IntrinsicSizesResultOptionsJSLoad( 1113 js.Pointer(p), js.False, ref, 1114 ) 1115 } 1116 1117 // FreeMembers frees fields with heap reference, if recursive is true 1118 // free all heap references reachable from p. 1119 func (p *IntrinsicSizesResultOptions) FreeMembers(recursive bool) { 1120 } 1121 1122 type JsonLd struct { 1123 ref js.Ref 1124 } 1125 1126 func (this JsonLd) Once() JsonLd { 1127 this.ref.Once() 1128 return this 1129 } 1130 1131 func (this JsonLd) Ref() js.Ref { 1132 return this.ref 1133 } 1134 1135 func (this JsonLd) FromRef(ref js.Ref) JsonLd { 1136 this.ref = ref 1137 return this 1138 } 1139 1140 func (this JsonLd) Free() { 1141 this.ref.Free() 1142 } 1143 1144 type OneOf_RecordAny_String struct { 1145 ref js.Ref 1146 } 1147 1148 func (x OneOf_RecordAny_String) Ref() js.Ref { 1149 return x.ref 1150 } 1151 1152 func (x OneOf_RecordAny_String) Free() { 1153 x.ref.Free() 1154 } 1155 1156 func (x OneOf_RecordAny_String) FromRef(ref js.Ref) OneOf_RecordAny_String { 1157 return OneOf_RecordAny_String{ 1158 ref: ref, 1159 } 1160 } 1161 1162 func (x OneOf_RecordAny_String) RecordAny() js.Record[js.Any] { 1163 return js.Record[js.Any]{}.FromRef(x.ref) 1164 } 1165 1166 func (x OneOf_RecordAny_String) String() js.String { 1167 return js.String{}.FromRef(x.ref) 1168 } 1169 1170 type OneOf_RecordAny_ArrayOneOf_RecordAny_String_String struct { 1171 ref js.Ref 1172 } 1173 1174 func (x OneOf_RecordAny_ArrayOneOf_RecordAny_String_String) Ref() js.Ref { 1175 return x.ref 1176 } 1177 1178 func (x OneOf_RecordAny_ArrayOneOf_RecordAny_String_String) Free() { 1179 x.ref.Free() 1180 } 1181 1182 func (x OneOf_RecordAny_ArrayOneOf_RecordAny_String_String) FromRef(ref js.Ref) OneOf_RecordAny_ArrayOneOf_RecordAny_String_String { 1183 return OneOf_RecordAny_ArrayOneOf_RecordAny_String_String{ 1184 ref: ref, 1185 } 1186 } 1187 1188 func (x OneOf_RecordAny_ArrayOneOf_RecordAny_String_String) RecordAny() js.Record[js.Any] { 1189 return js.Record[js.Any]{}.FromRef(x.ref) 1190 } 1191 1192 func (x OneOf_RecordAny_ArrayOneOf_RecordAny_String_String) ArrayOneOf_RecordAny_String() js.Array[OneOf_RecordAny_String] { 1193 return js.Array[OneOf_RecordAny_String]{}.FromRef(x.ref) 1194 } 1195 1196 func (x OneOf_RecordAny_ArrayOneOf_RecordAny_String_String) String() js.String { 1197 return js.String{}.FromRef(x.ref) 1198 } 1199 1200 type JsonLdContext = OneOf_RecordAny_ArrayOneOf_RecordAny_String_String 1201 1202 type JsonLdEmbed uint32 1203 1204 const ( 1205 _ JsonLdEmbed = iota 1206 1207 JsonLdEmbed__ALWAYS 1208 JsonLdEmbed__ONCE 1209 JsonLdEmbed__NEVER 1210 ) 1211 1212 func (JsonLdEmbed) FromRef(str js.Ref) JsonLdEmbed { 1213 return JsonLdEmbed(bindings.ConstOfJsonLdEmbed(str)) 1214 } 1215 1216 func (x JsonLdEmbed) String() (string, bool) { 1217 switch x { 1218 case JsonLdEmbed__ALWAYS: 1219 return "@always", true 1220 case JsonLdEmbed__ONCE: 1221 return "@once", true 1222 case JsonLdEmbed__NEVER: 1223 return "@never", true 1224 default: 1225 return "", false 1226 } 1227 } 1228 1229 type JsonLdErrorCode uint32 1230 1231 const ( 1232 _ JsonLdErrorCode = iota 1233 1234 JsonLdErrorCode_COLLIDING_KEYWORDS 1235 JsonLdErrorCode_CONFLICTING_INDEXES 1236 JsonLdErrorCode_CONTEXT_OVERFLOW 1237 JsonLdErrorCode_CYCLIC_IRI_MAPPING 1238 JsonLdErrorCode_INVALID__ID_VALUE 1239 JsonLdErrorCode_INVALID__IMPORT_VALUE 1240 JsonLdErrorCode_INVALID__INCLUDED_VALUE 1241 JsonLdErrorCode_INVALID__INDEX_VALUE 1242 JsonLdErrorCode_INVALID__NEST_VALUE 1243 JsonLdErrorCode_INVALID__PREFIX_VALUE 1244 JsonLdErrorCode_INVALID__PROPAGATE_VALUE 1245 JsonLdErrorCode_INVALID__PROTECTED_VALUE 1246 JsonLdErrorCode_INVALID__REVERSE_VALUE 1247 JsonLdErrorCode_INVALID__VERSION_VALUE 1248 JsonLdErrorCode_INVALID_BASE_DIRECTION 1249 JsonLdErrorCode_INVALID_BASE_IRI 1250 JsonLdErrorCode_INVALID_CONTAINER_MAPPING 1251 JsonLdErrorCode_INVALID_CONTEXT_ENTRY 1252 JsonLdErrorCode_INVALID_CONTEXT_NULLIFICATION 1253 JsonLdErrorCode_INVALID_DEFAULT_LANGUAGE 1254 JsonLdErrorCode_INVALID_IRI_MAPPING 1255 JsonLdErrorCode_INVALID_JSON_LITERAL 1256 JsonLdErrorCode_INVALID_KEYWORD_ALIAS 1257 JsonLdErrorCode_INVALID_LANGUAGE_MAP_VALUE 1258 JsonLdErrorCode_INVALID_LANGUAGE_MAPPING 1259 JsonLdErrorCode_INVALID_LANGUAGE_TAGGED_STRING 1260 JsonLdErrorCode_INVALID_LANGUAGE_TAGGED_VALUE 1261 JsonLdErrorCode_INVALID_LOCAL_CONTEXT 1262 JsonLdErrorCode_INVALID_REMOTE_CONTEXT 1263 JsonLdErrorCode_INVALID_REVERSE_PROPERTY_MAP 1264 JsonLdErrorCode_INVALID_REVERSE_PROPERTY_VALUE 1265 JsonLdErrorCode_INVALID_REVERSE_PROPERTY 1266 JsonLdErrorCode_INVALID_SCOPED_CONTEXT 1267 JsonLdErrorCode_INVALID_SCRIPT_ELEMENT 1268 JsonLdErrorCode_INVALID_SET_OR_LIST_OBJECT 1269 JsonLdErrorCode_INVALID_TERM_DEFINITION 1270 JsonLdErrorCode_INVALID_TYPE_MAPPING 1271 JsonLdErrorCode_INVALID_TYPE_VALUE 1272 JsonLdErrorCode_INVALID_TYPED_VALUE 1273 JsonLdErrorCode_INVALID_VALUE_OBJECT_VALUE 1274 JsonLdErrorCode_INVALID_VALUE_OBJECT 1275 JsonLdErrorCode_INVALID_VOCAB_MAPPING 1276 JsonLdErrorCode_IRI_CONFUSED_WITH_PREFIX 1277 JsonLdErrorCode_KEYWORD_REDEFINITION 1278 JsonLdErrorCode_LOADING_DOCUMENT_FAILED 1279 JsonLdErrorCode_LOADING_REMOTE_CONTEXT_FAILED 1280 JsonLdErrorCode_MULTIPLE_CONTEXT_LINK_HEADERS 1281 JsonLdErrorCode_PROCESSING_MODE_CONFLICT 1282 JsonLdErrorCode_PROTECTED_TERM_REDEFINITION 1283 ) 1284 1285 func (JsonLdErrorCode) FromRef(str js.Ref) JsonLdErrorCode { 1286 return JsonLdErrorCode(bindings.ConstOfJsonLdErrorCode(str)) 1287 } 1288 1289 func (x JsonLdErrorCode) String() (string, bool) { 1290 switch x { 1291 case JsonLdErrorCode_COLLIDING_KEYWORDS: 1292 return "colliding keywords", true 1293 case JsonLdErrorCode_CONFLICTING_INDEXES: 1294 return "conflicting indexes", true 1295 case JsonLdErrorCode_CONTEXT_OVERFLOW: 1296 return "context overflow", true 1297 case JsonLdErrorCode_CYCLIC_IRI_MAPPING: 1298 return "cyclic IRI mapping", true 1299 case JsonLdErrorCode_INVALID__ID_VALUE: 1300 return "invalid @id value", true 1301 case JsonLdErrorCode_INVALID__IMPORT_VALUE: 1302 return "invalid @import value", true 1303 case JsonLdErrorCode_INVALID__INCLUDED_VALUE: 1304 return "invalid @included value", true 1305 case JsonLdErrorCode_INVALID__INDEX_VALUE: 1306 return "invalid @index value", true 1307 case JsonLdErrorCode_INVALID__NEST_VALUE: 1308 return "invalid @nest value", true 1309 case JsonLdErrorCode_INVALID__PREFIX_VALUE: 1310 return "invalid @prefix value", true 1311 case JsonLdErrorCode_INVALID__PROPAGATE_VALUE: 1312 return "invalid @propagate value", true 1313 case JsonLdErrorCode_INVALID__PROTECTED_VALUE: 1314 return "invalid @protected value", true 1315 case JsonLdErrorCode_INVALID__REVERSE_VALUE: 1316 return "invalid @reverse value", true 1317 case JsonLdErrorCode_INVALID__VERSION_VALUE: 1318 return "invalid @version value", true 1319 case JsonLdErrorCode_INVALID_BASE_DIRECTION: 1320 return "invalid base direction", true 1321 case JsonLdErrorCode_INVALID_BASE_IRI: 1322 return "invalid base IRI", true 1323 case JsonLdErrorCode_INVALID_CONTAINER_MAPPING: 1324 return "invalid container mapping", true 1325 case JsonLdErrorCode_INVALID_CONTEXT_ENTRY: 1326 return "invalid context entry", true 1327 case JsonLdErrorCode_INVALID_CONTEXT_NULLIFICATION: 1328 return "invalid context nullification", true 1329 case JsonLdErrorCode_INVALID_DEFAULT_LANGUAGE: 1330 return "invalid default language", true 1331 case JsonLdErrorCode_INVALID_IRI_MAPPING: 1332 return "invalid IRI mapping", true 1333 case JsonLdErrorCode_INVALID_JSON_LITERAL: 1334 return "invalid JSON literal", true 1335 case JsonLdErrorCode_INVALID_KEYWORD_ALIAS: 1336 return "invalid keyword alias", true 1337 case JsonLdErrorCode_INVALID_LANGUAGE_MAP_VALUE: 1338 return "invalid language map value", true 1339 case JsonLdErrorCode_INVALID_LANGUAGE_MAPPING: 1340 return "invalid language mapping", true 1341 case JsonLdErrorCode_INVALID_LANGUAGE_TAGGED_STRING: 1342 return "invalid language-tagged string", true 1343 case JsonLdErrorCode_INVALID_LANGUAGE_TAGGED_VALUE: 1344 return "invalid language-tagged value", true 1345 case JsonLdErrorCode_INVALID_LOCAL_CONTEXT: 1346 return "invalid local context", true 1347 case JsonLdErrorCode_INVALID_REMOTE_CONTEXT: 1348 return "invalid remote context", true 1349 case JsonLdErrorCode_INVALID_REVERSE_PROPERTY_MAP: 1350 return "invalid reverse property map", true 1351 case JsonLdErrorCode_INVALID_REVERSE_PROPERTY_VALUE: 1352 return "invalid reverse property value", true 1353 case JsonLdErrorCode_INVALID_REVERSE_PROPERTY: 1354 return "invalid reverse property", true 1355 case JsonLdErrorCode_INVALID_SCOPED_CONTEXT: 1356 return "invalid scoped context", true 1357 case JsonLdErrorCode_INVALID_SCRIPT_ELEMENT: 1358 return "invalid script element", true 1359 case JsonLdErrorCode_INVALID_SET_OR_LIST_OBJECT: 1360 return "invalid set or list object", true 1361 case JsonLdErrorCode_INVALID_TERM_DEFINITION: 1362 return "invalid term definition", true 1363 case JsonLdErrorCode_INVALID_TYPE_MAPPING: 1364 return "invalid type mapping", true 1365 case JsonLdErrorCode_INVALID_TYPE_VALUE: 1366 return "invalid type value", true 1367 case JsonLdErrorCode_INVALID_TYPED_VALUE: 1368 return "invalid typed value", true 1369 case JsonLdErrorCode_INVALID_VALUE_OBJECT_VALUE: 1370 return "invalid value object value", true 1371 case JsonLdErrorCode_INVALID_VALUE_OBJECT: 1372 return "invalid value object", true 1373 case JsonLdErrorCode_INVALID_VOCAB_MAPPING: 1374 return "invalid vocab mapping", true 1375 case JsonLdErrorCode_IRI_CONFUSED_WITH_PREFIX: 1376 return "IRI confused with prefix", true 1377 case JsonLdErrorCode_KEYWORD_REDEFINITION: 1378 return "keyword redefinition", true 1379 case JsonLdErrorCode_LOADING_DOCUMENT_FAILED: 1380 return "loading document failed", true 1381 case JsonLdErrorCode_LOADING_REMOTE_CONTEXT_FAILED: 1382 return "loading remote context failed", true 1383 case JsonLdErrorCode_MULTIPLE_CONTEXT_LINK_HEADERS: 1384 return "multiple context link headers", true 1385 case JsonLdErrorCode_PROCESSING_MODE_CONFLICT: 1386 return "processing mode conflict", true 1387 case JsonLdErrorCode_PROTECTED_TERM_REDEFINITION: 1388 return "protected term redefinition", true 1389 default: 1390 return "", false 1391 } 1392 } 1393 1394 type JsonLdError struct { 1395 // Code is "JsonLdError.code" 1396 // 1397 // Optional 1398 Code JsonLdErrorCode 1399 // Message is "JsonLdError.message" 1400 // 1401 // Optional, defaults to null. 1402 Message js.String 1403 1404 FFI_USE bool 1405 } 1406 1407 // FromRef calls UpdateFrom and returns a JsonLdError with all fields set. 1408 func (p JsonLdError) FromRef(ref js.Ref) JsonLdError { 1409 p.UpdateFrom(ref) 1410 return p 1411 } 1412 1413 // New creates a new JsonLdError in the application heap. 1414 func (p JsonLdError) New() js.Ref { 1415 return bindings.JsonLdErrorJSLoad( 1416 js.Pointer(&p), js.True, 0, 1417 ) 1418 } 1419 1420 // UpdateFrom copies value of all fields of the heap object to p. 1421 func (p *JsonLdError) UpdateFrom(ref js.Ref) { 1422 bindings.JsonLdErrorJSStore( 1423 js.Pointer(p), ref, 1424 ) 1425 } 1426 1427 // Update writes all fields of the p to the heap object referenced by ref. 1428 func (p *JsonLdError) Update(ref js.Ref) { 1429 bindings.JsonLdErrorJSLoad( 1430 js.Pointer(p), js.False, ref, 1431 ) 1432 } 1433 1434 // FreeMembers frees fields with heap reference, if recursive is true 1435 // free all heap references reachable from p. 1436 func (p *JsonLdError) FreeMembers(recursive bool) { 1437 js.Free( 1438 p.Message.Ref(), 1439 ) 1440 p.Message = p.Message.FromRef(js.Undefined) 1441 } 1442 1443 type JsonLdFramingErrorCode uint32 1444 1445 const ( 1446 _ JsonLdFramingErrorCode = iota 1447 1448 JsonLdFramingErrorCode_INVALID_FRAME 1449 JsonLdFramingErrorCode_INVALID__EMBED_VALUE 1450 ) 1451 1452 func (JsonLdFramingErrorCode) FromRef(str js.Ref) JsonLdFramingErrorCode { 1453 return JsonLdFramingErrorCode(bindings.ConstOfJsonLdFramingErrorCode(str)) 1454 } 1455 1456 func (x JsonLdFramingErrorCode) String() (string, bool) { 1457 switch x { 1458 case JsonLdFramingErrorCode_INVALID_FRAME: 1459 return "invalid frame", true 1460 case JsonLdFramingErrorCode_INVALID__EMBED_VALUE: 1461 return "invalid @embed value", true 1462 default: 1463 return "", false 1464 } 1465 } 1466 1467 type JsonLdFramingError struct { 1468 // Code is "JsonLdFramingError.code" 1469 // 1470 // Optional 1471 Code JsonLdFramingErrorCode 1472 // Message is "JsonLdFramingError.message" 1473 // 1474 // Optional, defaults to null. 1475 Message js.String 1476 1477 FFI_USE bool 1478 } 1479 1480 // FromRef calls UpdateFrom and returns a JsonLdFramingError with all fields set. 1481 func (p JsonLdFramingError) FromRef(ref js.Ref) JsonLdFramingError { 1482 p.UpdateFrom(ref) 1483 return p 1484 } 1485 1486 // New creates a new JsonLdFramingError in the application heap. 1487 func (p JsonLdFramingError) New() js.Ref { 1488 return bindings.JsonLdFramingErrorJSLoad( 1489 js.Pointer(&p), js.True, 0, 1490 ) 1491 } 1492 1493 // UpdateFrom copies value of all fields of the heap object to p. 1494 func (p *JsonLdFramingError) UpdateFrom(ref js.Ref) { 1495 bindings.JsonLdFramingErrorJSStore( 1496 js.Pointer(p), ref, 1497 ) 1498 } 1499 1500 // Update writes all fields of the p to the heap object referenced by ref. 1501 func (p *JsonLdFramingError) Update(ref js.Ref) { 1502 bindings.JsonLdFramingErrorJSLoad( 1503 js.Pointer(p), js.False, ref, 1504 ) 1505 } 1506 1507 // FreeMembers frees fields with heap reference, if recursive is true 1508 // free all heap references reachable from p. 1509 func (p *JsonLdFramingError) FreeMembers(recursive bool) { 1510 js.Free( 1511 p.Message.Ref(), 1512 ) 1513 p.Message = p.Message.FromRef(js.Undefined) 1514 } 1515 1516 type JsonLdRecord = js.Record[js.Any] 1517 1518 type RemoteDocument struct { 1519 ref js.Ref 1520 } 1521 1522 func (this RemoteDocument) Once() RemoteDocument { 1523 this.ref.Once() 1524 return this 1525 } 1526 1527 func (this RemoteDocument) Ref() js.Ref { 1528 return this.ref 1529 } 1530 1531 func (this RemoteDocument) FromRef(ref js.Ref) RemoteDocument { 1532 this.ref = ref 1533 return this 1534 } 1535 1536 func (this RemoteDocument) Free() { 1537 this.ref.Free() 1538 } 1539 1540 // ContentType returns the value of property "RemoteDocument.contentType". 1541 // 1542 // It returns ok=false if there is no such property. 1543 func (this RemoteDocument) ContentType() (ret js.String, ok bool) { 1544 ok = js.True == bindings.GetRemoteDocumentContentType( 1545 this.ref, js.Pointer(&ret), 1546 ) 1547 return 1548 } 1549 1550 // ContextUrl returns the value of property "RemoteDocument.contextUrl". 1551 // 1552 // It returns ok=false if there is no such property. 1553 func (this RemoteDocument) ContextUrl() (ret js.String, ok bool) { 1554 ok = js.True == bindings.GetRemoteDocumentContextUrl( 1555 this.ref, js.Pointer(&ret), 1556 ) 1557 return 1558 } 1559 1560 // Document returns the value of property "RemoteDocument.document". 1561 // 1562 // It returns ok=false if there is no such property. 1563 func (this RemoteDocument) Document() (ret js.Any, ok bool) { 1564 ok = js.True == bindings.GetRemoteDocumentDocument( 1565 this.ref, js.Pointer(&ret), 1566 ) 1567 return 1568 } 1569 1570 // SetDocument sets the value of property "RemoteDocument.document" to val. 1571 // 1572 // It returns false if the property cannot be set. 1573 func (this RemoteDocument) SetDocument(val js.Any) bool { 1574 return js.True == bindings.SetRemoteDocumentDocument( 1575 this.ref, 1576 val.Ref(), 1577 ) 1578 } 1579 1580 // DocumentUrl returns the value of property "RemoteDocument.documentUrl". 1581 // 1582 // It returns ok=false if there is no such property. 1583 func (this RemoteDocument) DocumentUrl() (ret js.String, ok bool) { 1584 ok = js.True == bindings.GetRemoteDocumentDocumentUrl( 1585 this.ref, js.Pointer(&ret), 1586 ) 1587 return 1588 } 1589 1590 // Profile returns the value of property "RemoteDocument.profile". 1591 // 1592 // It returns ok=false if there is no such property. 1593 func (this RemoteDocument) Profile() (ret js.String, ok bool) { 1594 ok = js.True == bindings.GetRemoteDocumentProfile( 1595 this.ref, js.Pointer(&ret), 1596 ) 1597 return 1598 } 1599 1600 type OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument struct { 1601 ref js.Ref 1602 } 1603 1604 func (x OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument) Ref() js.Ref { 1605 return x.ref 1606 } 1607 1608 func (x OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument) Free() { 1609 x.ref.Free() 1610 } 1611 1612 func (x OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument) FromRef(ref js.Ref) OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument { 1613 return OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument{ 1614 ref: ref, 1615 } 1616 } 1617 1618 func (x OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument) RecordAny() js.Record[js.Any] { 1619 return js.Record[js.Any]{}.FromRef(x.ref) 1620 } 1621 1622 func (x OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument) ArrayJsonLdRecord() js.Array[JsonLdRecord] { 1623 return js.Array[JsonLdRecord]{}.FromRef(x.ref) 1624 } 1625 1626 func (x OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument) String() js.String { 1627 return js.String{}.FromRef(x.ref) 1628 } 1629 1630 func (x OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument) RemoteDocument() RemoteDocument { 1631 return RemoteDocument{}.FromRef(x.ref) 1632 } 1633 1634 type JsonLdInput = OneOf_RecordAny_ArrayJsonLdRecord_String_RemoteDocument 1635 1636 type LoadDocumentCallbackFunc func(this js.Ref, url js.String, options *LoadDocumentOptions) js.Ref 1637 1638 func (fn LoadDocumentCallbackFunc) Register() js.Func[func(url js.String, options *LoadDocumentOptions) js.Promise[RemoteDocument]] { 1639 return js.RegisterCallback[func(url js.String, options *LoadDocumentOptions) js.Promise[RemoteDocument]]( 1640 fn, abi.FuncPCABIInternal(fn), 1641 ) 1642 } 1643 1644 func (fn LoadDocumentCallbackFunc) DispatchCallback( 1645 targetPC uintptr, ctx *js.CallbackContext, 1646 ) { 1647 args := ctx.Args() 1648 if len(args) != 2+1 /* js this */ || 1649 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1650 js.ThrowInvalidCallbackInvocation() 1651 } 1652 var arg1 LoadDocumentOptions 1653 arg1.UpdateFrom(args[1+1]) 1654 defer arg1.FreeMembers(true) 1655 1656 if ctx.Return(fn( 1657 args[0], 1658 1659 js.String{}.FromRef(args[0+1]), 1660 mark.NoEscape(&arg1), 1661 )) { 1662 return 1663 } 1664 1665 js.ThrowCallbackValueNotReturned() 1666 } 1667 1668 type LoadDocumentCallback[T any] struct { 1669 Fn func(arg T, this js.Ref, url js.String, options *LoadDocumentOptions) js.Ref 1670 Arg T 1671 } 1672 1673 func (cb *LoadDocumentCallback[T]) Register() js.Func[func(url js.String, options *LoadDocumentOptions) js.Promise[RemoteDocument]] { 1674 return js.RegisterCallback[func(url js.String, options *LoadDocumentOptions) js.Promise[RemoteDocument]]( 1675 cb, abi.FuncPCABIInternal(cb.Fn), 1676 ) 1677 } 1678 1679 func (cb *LoadDocumentCallback[T]) DispatchCallback( 1680 targetPC uintptr, ctx *js.CallbackContext, 1681 ) { 1682 args := ctx.Args() 1683 if len(args) != 2+1 /* js this */ || 1684 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1685 js.ThrowInvalidCallbackInvocation() 1686 } 1687 var arg1 LoadDocumentOptions 1688 arg1.UpdateFrom(args[1+1]) 1689 defer arg1.FreeMembers(true) 1690 1691 if ctx.Return(cb.Fn( 1692 cb.Arg, 1693 args[0], 1694 1695 js.String{}.FromRef(args[0+1]), 1696 mark.NoEscape(&arg1), 1697 )) { 1698 return 1699 } 1700 1701 js.ThrowCallbackValueNotReturned() 1702 } 1703 1704 type LoadDocumentOptions struct { 1705 // ExtractAllScripts is "LoadDocumentOptions.extractAllScripts" 1706 // 1707 // Optional, defaults to false. 1708 // 1709 // NOTE: FFI_USE_ExtractAllScripts MUST be set to true to make this field effective. 1710 ExtractAllScripts bool 1711 // Profile is "LoadDocumentOptions.profile" 1712 // 1713 // Optional, defaults to null. 1714 Profile js.String 1715 // RequestProfile is "LoadDocumentOptions.requestProfile" 1716 // 1717 // Optional, defaults to null. 1718 RequestProfile OneOf_String_ArrayString 1719 1720 FFI_USE_ExtractAllScripts bool // for ExtractAllScripts. 1721 1722 FFI_USE bool 1723 } 1724 1725 // FromRef calls UpdateFrom and returns a LoadDocumentOptions with all fields set. 1726 func (p LoadDocumentOptions) FromRef(ref js.Ref) LoadDocumentOptions { 1727 p.UpdateFrom(ref) 1728 return p 1729 } 1730 1731 // New creates a new LoadDocumentOptions in the application heap. 1732 func (p LoadDocumentOptions) New() js.Ref { 1733 return bindings.LoadDocumentOptionsJSLoad( 1734 js.Pointer(&p), js.True, 0, 1735 ) 1736 } 1737 1738 // UpdateFrom copies value of all fields of the heap object to p. 1739 func (p *LoadDocumentOptions) UpdateFrom(ref js.Ref) { 1740 bindings.LoadDocumentOptionsJSStore( 1741 js.Pointer(p), ref, 1742 ) 1743 } 1744 1745 // Update writes all fields of the p to the heap object referenced by ref. 1746 func (p *LoadDocumentOptions) Update(ref js.Ref) { 1747 bindings.LoadDocumentOptionsJSLoad( 1748 js.Pointer(p), js.False, ref, 1749 ) 1750 } 1751 1752 // FreeMembers frees fields with heap reference, if recursive is true 1753 // free all heap references reachable from p. 1754 func (p *LoadDocumentOptions) FreeMembers(recursive bool) { 1755 js.Free( 1756 p.Profile.Ref(), 1757 p.RequestProfile.Ref(), 1758 ) 1759 p.Profile = p.Profile.FromRef(js.Undefined) 1760 p.RequestProfile = p.RequestProfile.FromRef(js.Undefined) 1761 } 1762 1763 type OneOf_JsonLdEmbed_Bool struct { 1764 ref js.Ref 1765 } 1766 1767 func (x OneOf_JsonLdEmbed_Bool) Ref() js.Ref { 1768 return x.ref 1769 } 1770 1771 func (x OneOf_JsonLdEmbed_Bool) Free() { 1772 x.ref.Free() 1773 } 1774 1775 func (x OneOf_JsonLdEmbed_Bool) FromRef(ref js.Ref) OneOf_JsonLdEmbed_Bool { 1776 return OneOf_JsonLdEmbed_Bool{ 1777 ref: ref, 1778 } 1779 } 1780 1781 func (x OneOf_JsonLdEmbed_Bool) JsonLdEmbed() JsonLdEmbed { 1782 return JsonLdEmbed(0).FromRef(x.ref) 1783 } 1784 1785 func (x OneOf_JsonLdEmbed_Bool) Bool() bool { 1786 return x.ref == js.True 1787 } 1788 1789 type JsonLdOptions struct { 1790 // Base is "JsonLdOptions.base" 1791 // 1792 // Optional, defaults to null. 1793 Base js.String 1794 // CompactArrays is "JsonLdOptions.compactArrays" 1795 // 1796 // Optional, defaults to true. 1797 // 1798 // NOTE: FFI_USE_CompactArrays MUST be set to true to make this field effective. 1799 CompactArrays bool 1800 // CompactToRelative is "JsonLdOptions.compactToRelative" 1801 // 1802 // Optional, defaults to true. 1803 // 1804 // NOTE: FFI_USE_CompactToRelative MUST be set to true to make this field effective. 1805 CompactToRelative bool 1806 // DocumentLoader is "JsonLdOptions.documentLoader" 1807 // 1808 // Optional, defaults to null. 1809 DocumentLoader js.Func[func(url js.String, options *LoadDocumentOptions) js.Promise[RemoteDocument]] 1810 // ExpandContext is "JsonLdOptions.expandContext" 1811 // 1812 // Optional, defaults to null. 1813 ExpandContext OneOf_RecordAny_String 1814 // ExtractAllScripts is "JsonLdOptions.extractAllScripts" 1815 // 1816 // Optional, defaults to false. 1817 // 1818 // NOTE: FFI_USE_ExtractAllScripts MUST be set to true to make this field effective. 1819 ExtractAllScripts bool 1820 // FrameExpansion is "JsonLdOptions.frameExpansion" 1821 // 1822 // Optional, defaults to false. 1823 // 1824 // NOTE: FFI_USE_FrameExpansion MUST be set to true to make this field effective. 1825 FrameExpansion bool 1826 // Ordered is "JsonLdOptions.ordered" 1827 // 1828 // Optional, defaults to false. 1829 // 1830 // NOTE: FFI_USE_Ordered MUST be set to true to make this field effective. 1831 Ordered bool 1832 // ProcessingMode is "JsonLdOptions.processingMode" 1833 // 1834 // Optional, defaults to "json-ld-1.1". 1835 ProcessingMode js.String 1836 // ProduceGeneralizedRdf is "JsonLdOptions.produceGeneralizedRdf" 1837 // 1838 // Optional, defaults to true. 1839 // 1840 // NOTE: FFI_USE_ProduceGeneralizedRdf MUST be set to true to make this field effective. 1841 ProduceGeneralizedRdf bool 1842 // RdfDirection is "JsonLdOptions.rdfDirection" 1843 // 1844 // Optional, defaults to null. 1845 RdfDirection js.String 1846 // UseNativeTypes is "JsonLdOptions.useNativeTypes" 1847 // 1848 // Optional, defaults to false. 1849 // 1850 // NOTE: FFI_USE_UseNativeTypes MUST be set to true to make this field effective. 1851 UseNativeTypes bool 1852 // UseRdfType is "JsonLdOptions.useRdfType" 1853 // 1854 // Optional, defaults to false. 1855 // 1856 // NOTE: FFI_USE_UseRdfType MUST be set to true to make this field effective. 1857 UseRdfType bool 1858 // Embed is "JsonLdOptions.embed" 1859 // 1860 // Optional, defaults to "@once". 1861 Embed OneOf_JsonLdEmbed_Bool 1862 // Explicit is "JsonLdOptions.explicit" 1863 // 1864 // Optional, defaults to false. 1865 // 1866 // NOTE: FFI_USE_Explicit MUST be set to true to make this field effective. 1867 Explicit bool 1868 // OmitDefault is "JsonLdOptions.omitDefault" 1869 // 1870 // Optional, defaults to false. 1871 // 1872 // NOTE: FFI_USE_OmitDefault MUST be set to true to make this field effective. 1873 OmitDefault bool 1874 // OmitGraph is "JsonLdOptions.omitGraph" 1875 // 1876 // Optional 1877 // 1878 // NOTE: FFI_USE_OmitGraph MUST be set to true to make this field effective. 1879 OmitGraph bool 1880 // RequireAll is "JsonLdOptions.requireAll" 1881 // 1882 // Optional, defaults to false. 1883 // 1884 // NOTE: FFI_USE_RequireAll MUST be set to true to make this field effective. 1885 RequireAll bool 1886 // FrameDefault is "JsonLdOptions.frameDefault" 1887 // 1888 // Optional, defaults to false. 1889 // 1890 // NOTE: FFI_USE_FrameDefault MUST be set to true to make this field effective. 1891 FrameDefault bool 1892 1893 FFI_USE_CompactArrays bool // for CompactArrays. 1894 FFI_USE_CompactToRelative bool // for CompactToRelative. 1895 FFI_USE_ExtractAllScripts bool // for ExtractAllScripts. 1896 FFI_USE_FrameExpansion bool // for FrameExpansion. 1897 FFI_USE_Ordered bool // for Ordered. 1898 FFI_USE_ProduceGeneralizedRdf bool // for ProduceGeneralizedRdf. 1899 FFI_USE_UseNativeTypes bool // for UseNativeTypes. 1900 FFI_USE_UseRdfType bool // for UseRdfType. 1901 FFI_USE_Explicit bool // for Explicit. 1902 FFI_USE_OmitDefault bool // for OmitDefault. 1903 FFI_USE_OmitGraph bool // for OmitGraph. 1904 FFI_USE_RequireAll bool // for RequireAll. 1905 FFI_USE_FrameDefault bool // for FrameDefault. 1906 1907 FFI_USE bool 1908 } 1909 1910 // FromRef calls UpdateFrom and returns a JsonLdOptions with all fields set. 1911 func (p JsonLdOptions) FromRef(ref js.Ref) JsonLdOptions { 1912 p.UpdateFrom(ref) 1913 return p 1914 } 1915 1916 // New creates a new JsonLdOptions in the application heap. 1917 func (p JsonLdOptions) New() js.Ref { 1918 return bindings.JsonLdOptionsJSLoad( 1919 js.Pointer(&p), js.True, 0, 1920 ) 1921 } 1922 1923 // UpdateFrom copies value of all fields of the heap object to p. 1924 func (p *JsonLdOptions) UpdateFrom(ref js.Ref) { 1925 bindings.JsonLdOptionsJSStore( 1926 js.Pointer(p), ref, 1927 ) 1928 } 1929 1930 // Update writes all fields of the p to the heap object referenced by ref. 1931 func (p *JsonLdOptions) Update(ref js.Ref) { 1932 bindings.JsonLdOptionsJSLoad( 1933 js.Pointer(p), js.False, ref, 1934 ) 1935 } 1936 1937 // FreeMembers frees fields with heap reference, if recursive is true 1938 // free all heap references reachable from p. 1939 func (p *JsonLdOptions) FreeMembers(recursive bool) { 1940 js.Free( 1941 p.Base.Ref(), 1942 p.DocumentLoader.Ref(), 1943 p.ExpandContext.Ref(), 1944 p.ProcessingMode.Ref(), 1945 p.RdfDirection.Ref(), 1946 p.Embed.Ref(), 1947 ) 1948 p.Base = p.Base.FromRef(js.Undefined) 1949 p.DocumentLoader = p.DocumentLoader.FromRef(js.Undefined) 1950 p.ExpandContext = p.ExpandContext.FromRef(js.Undefined) 1951 p.ProcessingMode = p.ProcessingMode.FromRef(js.Undefined) 1952 p.RdfDirection = p.RdfDirection.FromRef(js.Undefined) 1953 p.Embed = p.Embed.FromRef(js.Undefined) 1954 } 1955 1956 type RdfLiteral struct { 1957 ref js.Ref 1958 } 1959 1960 func (this RdfLiteral) Once() RdfLiteral { 1961 this.ref.Once() 1962 return this 1963 } 1964 1965 func (this RdfLiteral) Ref() js.Ref { 1966 return this.ref 1967 } 1968 1969 func (this RdfLiteral) FromRef(ref js.Ref) RdfLiteral { 1970 this.ref = ref 1971 return this 1972 } 1973 1974 func (this RdfLiteral) Free() { 1975 this.ref.Free() 1976 } 1977 1978 // Value returns the value of property "RdfLiteral.value". 1979 // 1980 // It returns ok=false if there is no such property. 1981 func (this RdfLiteral) Value() (ret js.String, ok bool) { 1982 ok = js.True == bindings.GetRdfLiteralValue( 1983 this.ref, js.Pointer(&ret), 1984 ) 1985 return 1986 } 1987 1988 // Datatype returns the value of property "RdfLiteral.datatype". 1989 // 1990 // It returns ok=false if there is no such property. 1991 func (this RdfLiteral) Datatype() (ret js.String, ok bool) { 1992 ok = js.True == bindings.GetRdfLiteralDatatype( 1993 this.ref, js.Pointer(&ret), 1994 ) 1995 return 1996 } 1997 1998 // Language returns the value of property "RdfLiteral.language". 1999 // 2000 // It returns ok=false if there is no such property. 2001 func (this RdfLiteral) Language() (ret js.String, ok bool) { 2002 ok = js.True == bindings.GetRdfLiteralLanguage( 2003 this.ref, js.Pointer(&ret), 2004 ) 2005 return 2006 } 2007 2008 type OneOf_String_RdfLiteral struct { 2009 ref js.Ref 2010 } 2011 2012 func (x OneOf_String_RdfLiteral) Ref() js.Ref { 2013 return x.ref 2014 } 2015 2016 func (x OneOf_String_RdfLiteral) Free() { 2017 x.ref.Free() 2018 } 2019 2020 func (x OneOf_String_RdfLiteral) FromRef(ref js.Ref) OneOf_String_RdfLiteral { 2021 return OneOf_String_RdfLiteral{ 2022 ref: ref, 2023 } 2024 } 2025 2026 func (x OneOf_String_RdfLiteral) String() js.String { 2027 return js.String{}.FromRef(x.ref) 2028 } 2029 2030 func (x OneOf_String_RdfLiteral) RdfLiteral() RdfLiteral { 2031 return RdfLiteral{}.FromRef(x.ref) 2032 } 2033 2034 type RdfTriple struct { 2035 ref js.Ref 2036 } 2037 2038 func (this RdfTriple) Once() RdfTriple { 2039 this.ref.Once() 2040 return this 2041 } 2042 2043 func (this RdfTriple) Ref() js.Ref { 2044 return this.ref 2045 } 2046 2047 func (this RdfTriple) FromRef(ref js.Ref) RdfTriple { 2048 this.ref = ref 2049 return this 2050 } 2051 2052 func (this RdfTriple) Free() { 2053 this.ref.Free() 2054 } 2055 2056 // Subject returns the value of property "RdfTriple.subject". 2057 // 2058 // It returns ok=false if there is no such property. 2059 func (this RdfTriple) Subject() (ret js.String, ok bool) { 2060 ok = js.True == bindings.GetRdfTripleSubject( 2061 this.ref, js.Pointer(&ret), 2062 ) 2063 return 2064 } 2065 2066 // Predicate returns the value of property "RdfTriple.predicate". 2067 // 2068 // It returns ok=false if there is no such property. 2069 func (this RdfTriple) Predicate() (ret js.String, ok bool) { 2070 ok = js.True == bindings.GetRdfTriplePredicate( 2071 this.ref, js.Pointer(&ret), 2072 ) 2073 return 2074 } 2075 2076 // Object returns the value of property "RdfTriple.object". 2077 // 2078 // It returns ok=false if there is no such property. 2079 func (this RdfTriple) Object() (ret OneOf_String_RdfLiteral, ok bool) { 2080 ok = js.True == bindings.GetRdfTripleObject( 2081 this.ref, js.Pointer(&ret), 2082 ) 2083 return 2084 } 2085 2086 type RdfGraph struct { 2087 ref js.Ref 2088 } 2089 2090 func (this RdfGraph) Once() RdfGraph { 2091 this.ref.Once() 2092 return this 2093 } 2094 2095 func (this RdfGraph) Ref() js.Ref { 2096 return this.ref 2097 } 2098 2099 func (this RdfGraph) FromRef(ref js.Ref) RdfGraph { 2100 this.ref = ref 2101 return this 2102 } 2103 2104 func (this RdfGraph) Free() { 2105 this.ref.Free() 2106 } 2107 2108 // HasFuncAdd returns true if the method "RdfGraph.add" exists. 2109 func (this RdfGraph) HasFuncAdd() bool { 2110 return js.True == bindings.HasFuncRdfGraphAdd( 2111 this.ref, 2112 ) 2113 } 2114 2115 // FuncAdd returns the method "RdfGraph.add". 2116 func (this RdfGraph) FuncAdd() (fn js.Func[func(triple RdfTriple)]) { 2117 bindings.FuncRdfGraphAdd( 2118 this.ref, js.Pointer(&fn), 2119 ) 2120 return 2121 } 2122 2123 // Add calls the method "RdfGraph.add". 2124 func (this RdfGraph) Add(triple RdfTriple) (ret js.Void) { 2125 bindings.CallRdfGraphAdd( 2126 this.ref, js.Pointer(&ret), 2127 triple.Ref(), 2128 ) 2129 2130 return 2131 } 2132 2133 // TryAdd calls the method "RdfGraph.add" 2134 // in a try/catch block and returns (_, err, ok = false) when it went through 2135 // the catch clause. 2136 func (this RdfGraph) TryAdd(triple RdfTriple) (ret js.Void, exception js.Any, ok bool) { 2137 ok = js.True == bindings.TryRdfGraphAdd( 2138 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2139 triple.Ref(), 2140 ) 2141 2142 return 2143 } 2144 2145 type RdfDataset struct { 2146 ref js.Ref 2147 } 2148 2149 func (this RdfDataset) Once() RdfDataset { 2150 this.ref.Once() 2151 return this 2152 } 2153 2154 func (this RdfDataset) Ref() js.Ref { 2155 return this.ref 2156 } 2157 2158 func (this RdfDataset) FromRef(ref js.Ref) RdfDataset { 2159 this.ref = ref 2160 return this 2161 } 2162 2163 func (this RdfDataset) Free() { 2164 this.ref.Free() 2165 } 2166 2167 // DefaultGraph returns the value of property "RdfDataset.defaultGraph". 2168 // 2169 // It returns ok=false if there is no such property. 2170 func (this RdfDataset) DefaultGraph() (ret RdfGraph, ok bool) { 2171 ok = js.True == bindings.GetRdfDatasetDefaultGraph( 2172 this.ref, js.Pointer(&ret), 2173 ) 2174 return 2175 } 2176 2177 // HasFuncAdd returns true if the method "RdfDataset.add" exists. 2178 func (this RdfDataset) HasFuncAdd() bool { 2179 return js.True == bindings.HasFuncRdfDatasetAdd( 2180 this.ref, 2181 ) 2182 } 2183 2184 // FuncAdd returns the method "RdfDataset.add". 2185 func (this RdfDataset) FuncAdd() (fn js.Func[func(graphName js.String, graph RdfGraph)]) { 2186 bindings.FuncRdfDatasetAdd( 2187 this.ref, js.Pointer(&fn), 2188 ) 2189 return 2190 } 2191 2192 // Add calls the method "RdfDataset.add". 2193 func (this RdfDataset) Add(graphName js.String, graph RdfGraph) (ret js.Void) { 2194 bindings.CallRdfDatasetAdd( 2195 this.ref, js.Pointer(&ret), 2196 graphName.Ref(), 2197 graph.Ref(), 2198 ) 2199 2200 return 2201 } 2202 2203 // TryAdd calls the method "RdfDataset.add" 2204 // in a try/catch block and returns (_, err, ok = false) when it went through 2205 // the catch clause. 2206 func (this RdfDataset) TryAdd(graphName js.String, graph RdfGraph) (ret js.Void, exception js.Any, ok bool) { 2207 ok = js.True == bindings.TryRdfDatasetAdd( 2208 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2209 graphName.Ref(), 2210 graph.Ref(), 2211 ) 2212 2213 return 2214 } 2215 2216 type JsonLdProcessor struct { 2217 ref js.Ref 2218 } 2219 2220 func (this JsonLdProcessor) Once() JsonLdProcessor { 2221 this.ref.Once() 2222 return this 2223 } 2224 2225 func (this JsonLdProcessor) Ref() js.Ref { 2226 return this.ref 2227 } 2228 2229 func (this JsonLdProcessor) FromRef(ref js.Ref) JsonLdProcessor { 2230 this.ref = ref 2231 return this 2232 } 2233 2234 func (this JsonLdProcessor) Free() { 2235 this.ref.Free() 2236 } 2237 2238 // HasFuncCompact returns true if the static method "JsonLdProcessor.compact" exists. 2239 func (this JsonLdProcessor) HasFuncCompact() bool { 2240 return js.True == bindings.HasFuncJsonLdProcessorCompact( 2241 this.ref, 2242 ) 2243 } 2244 2245 // FuncCompact returns the static method "JsonLdProcessor.compact". 2246 func (this JsonLdProcessor) FuncCompact() (fn js.Func[func(input JsonLdInput, context JsonLdContext, options JsonLdOptions) js.Promise[JsonLdRecord]]) { 2247 bindings.FuncJsonLdProcessorCompact( 2248 this.ref, js.Pointer(&fn), 2249 ) 2250 return 2251 } 2252 2253 // Compact calls the static method "JsonLdProcessor.compact". 2254 func (this JsonLdProcessor) Compact(input JsonLdInput, context JsonLdContext, options JsonLdOptions) (ret js.Promise[JsonLdRecord]) { 2255 bindings.CallJsonLdProcessorCompact( 2256 this.ref, js.Pointer(&ret), 2257 input.Ref(), 2258 context.Ref(), 2259 js.Pointer(&options), 2260 ) 2261 2262 return 2263 } 2264 2265 // TryCompact calls the static method "JsonLdProcessor.compact" 2266 // in a try/catch block and returns (_, err, ok = false) when it went through 2267 // the catch clause. 2268 func (this JsonLdProcessor) TryCompact(input JsonLdInput, context JsonLdContext, options JsonLdOptions) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2269 ok = js.True == bindings.TryJsonLdProcessorCompact( 2270 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2271 input.Ref(), 2272 context.Ref(), 2273 js.Pointer(&options), 2274 ) 2275 2276 return 2277 } 2278 2279 // HasFuncCompact1 returns true if the static method "JsonLdProcessor.compact" exists. 2280 func (this JsonLdProcessor) HasFuncCompact1() bool { 2281 return js.True == bindings.HasFuncJsonLdProcessorCompact1( 2282 this.ref, 2283 ) 2284 } 2285 2286 // FuncCompact1 returns the static method "JsonLdProcessor.compact". 2287 func (this JsonLdProcessor) FuncCompact1() (fn js.Func[func(input JsonLdInput, context JsonLdContext) js.Promise[JsonLdRecord]]) { 2288 bindings.FuncJsonLdProcessorCompact1( 2289 this.ref, js.Pointer(&fn), 2290 ) 2291 return 2292 } 2293 2294 // Compact1 calls the static method "JsonLdProcessor.compact". 2295 func (this JsonLdProcessor) Compact1(input JsonLdInput, context JsonLdContext) (ret js.Promise[JsonLdRecord]) { 2296 bindings.CallJsonLdProcessorCompact1( 2297 this.ref, js.Pointer(&ret), 2298 input.Ref(), 2299 context.Ref(), 2300 ) 2301 2302 return 2303 } 2304 2305 // TryCompact1 calls the static method "JsonLdProcessor.compact" 2306 // in a try/catch block and returns (_, err, ok = false) when it went through 2307 // the catch clause. 2308 func (this JsonLdProcessor) TryCompact1(input JsonLdInput, context JsonLdContext) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2309 ok = js.True == bindings.TryJsonLdProcessorCompact1( 2310 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2311 input.Ref(), 2312 context.Ref(), 2313 ) 2314 2315 return 2316 } 2317 2318 // HasFuncCompact2 returns true if the static method "JsonLdProcessor.compact" exists. 2319 func (this JsonLdProcessor) HasFuncCompact2() bool { 2320 return js.True == bindings.HasFuncJsonLdProcessorCompact2( 2321 this.ref, 2322 ) 2323 } 2324 2325 // FuncCompact2 returns the static method "JsonLdProcessor.compact". 2326 func (this JsonLdProcessor) FuncCompact2() (fn js.Func[func(input JsonLdInput) js.Promise[JsonLdRecord]]) { 2327 bindings.FuncJsonLdProcessorCompact2( 2328 this.ref, js.Pointer(&fn), 2329 ) 2330 return 2331 } 2332 2333 // Compact2 calls the static method "JsonLdProcessor.compact". 2334 func (this JsonLdProcessor) Compact2(input JsonLdInput) (ret js.Promise[JsonLdRecord]) { 2335 bindings.CallJsonLdProcessorCompact2( 2336 this.ref, js.Pointer(&ret), 2337 input.Ref(), 2338 ) 2339 2340 return 2341 } 2342 2343 // TryCompact2 calls the static method "JsonLdProcessor.compact" 2344 // in a try/catch block and returns (_, err, ok = false) when it went through 2345 // the catch clause. 2346 func (this JsonLdProcessor) TryCompact2(input JsonLdInput) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2347 ok = js.True == bindings.TryJsonLdProcessorCompact2( 2348 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2349 input.Ref(), 2350 ) 2351 2352 return 2353 } 2354 2355 // HasFuncExpand returns true if the static method "JsonLdProcessor.expand" exists. 2356 func (this JsonLdProcessor) HasFuncExpand() bool { 2357 return js.True == bindings.HasFuncJsonLdProcessorExpand( 2358 this.ref, 2359 ) 2360 } 2361 2362 // FuncExpand returns the static method "JsonLdProcessor.expand". 2363 func (this JsonLdProcessor) FuncExpand() (fn js.Func[func(input JsonLdInput, options JsonLdOptions) js.Promise[js.Array[JsonLdRecord]]]) { 2364 bindings.FuncJsonLdProcessorExpand( 2365 this.ref, js.Pointer(&fn), 2366 ) 2367 return 2368 } 2369 2370 // Expand calls the static method "JsonLdProcessor.expand". 2371 func (this JsonLdProcessor) Expand(input JsonLdInput, options JsonLdOptions) (ret js.Promise[js.Array[JsonLdRecord]]) { 2372 bindings.CallJsonLdProcessorExpand( 2373 this.ref, js.Pointer(&ret), 2374 input.Ref(), 2375 js.Pointer(&options), 2376 ) 2377 2378 return 2379 } 2380 2381 // TryExpand calls the static method "JsonLdProcessor.expand" 2382 // in a try/catch block and returns (_, err, ok = false) when it went through 2383 // the catch clause. 2384 func (this JsonLdProcessor) TryExpand(input JsonLdInput, options JsonLdOptions) (ret js.Promise[js.Array[JsonLdRecord]], exception js.Any, ok bool) { 2385 ok = js.True == bindings.TryJsonLdProcessorExpand( 2386 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2387 input.Ref(), 2388 js.Pointer(&options), 2389 ) 2390 2391 return 2392 } 2393 2394 // HasFuncExpand1 returns true if the static method "JsonLdProcessor.expand" exists. 2395 func (this JsonLdProcessor) HasFuncExpand1() bool { 2396 return js.True == bindings.HasFuncJsonLdProcessorExpand1( 2397 this.ref, 2398 ) 2399 } 2400 2401 // FuncExpand1 returns the static method "JsonLdProcessor.expand". 2402 func (this JsonLdProcessor) FuncExpand1() (fn js.Func[func(input JsonLdInput) js.Promise[js.Array[JsonLdRecord]]]) { 2403 bindings.FuncJsonLdProcessorExpand1( 2404 this.ref, js.Pointer(&fn), 2405 ) 2406 return 2407 } 2408 2409 // Expand1 calls the static method "JsonLdProcessor.expand". 2410 func (this JsonLdProcessor) Expand1(input JsonLdInput) (ret js.Promise[js.Array[JsonLdRecord]]) { 2411 bindings.CallJsonLdProcessorExpand1( 2412 this.ref, js.Pointer(&ret), 2413 input.Ref(), 2414 ) 2415 2416 return 2417 } 2418 2419 // TryExpand1 calls the static method "JsonLdProcessor.expand" 2420 // in a try/catch block and returns (_, err, ok = false) when it went through 2421 // the catch clause. 2422 func (this JsonLdProcessor) TryExpand1(input JsonLdInput) (ret js.Promise[js.Array[JsonLdRecord]], exception js.Any, ok bool) { 2423 ok = js.True == bindings.TryJsonLdProcessorExpand1( 2424 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2425 input.Ref(), 2426 ) 2427 2428 return 2429 } 2430 2431 // HasFuncFlatten returns true if the static method "JsonLdProcessor.flatten" exists. 2432 func (this JsonLdProcessor) HasFuncFlatten() bool { 2433 return js.True == bindings.HasFuncJsonLdProcessorFlatten( 2434 this.ref, 2435 ) 2436 } 2437 2438 // FuncFlatten returns the static method "JsonLdProcessor.flatten". 2439 func (this JsonLdProcessor) FuncFlatten() (fn js.Func[func(input JsonLdInput, context JsonLdContext, options JsonLdOptions) js.Promise[JsonLdRecord]]) { 2440 bindings.FuncJsonLdProcessorFlatten( 2441 this.ref, js.Pointer(&fn), 2442 ) 2443 return 2444 } 2445 2446 // Flatten calls the static method "JsonLdProcessor.flatten". 2447 func (this JsonLdProcessor) Flatten(input JsonLdInput, context JsonLdContext, options JsonLdOptions) (ret js.Promise[JsonLdRecord]) { 2448 bindings.CallJsonLdProcessorFlatten( 2449 this.ref, js.Pointer(&ret), 2450 input.Ref(), 2451 context.Ref(), 2452 js.Pointer(&options), 2453 ) 2454 2455 return 2456 } 2457 2458 // TryFlatten calls the static method "JsonLdProcessor.flatten" 2459 // in a try/catch block and returns (_, err, ok = false) when it went through 2460 // the catch clause. 2461 func (this JsonLdProcessor) TryFlatten(input JsonLdInput, context JsonLdContext, options JsonLdOptions) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2462 ok = js.True == bindings.TryJsonLdProcessorFlatten( 2463 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2464 input.Ref(), 2465 context.Ref(), 2466 js.Pointer(&options), 2467 ) 2468 2469 return 2470 } 2471 2472 // HasFuncFlatten1 returns true if the static method "JsonLdProcessor.flatten" exists. 2473 func (this JsonLdProcessor) HasFuncFlatten1() bool { 2474 return js.True == bindings.HasFuncJsonLdProcessorFlatten1( 2475 this.ref, 2476 ) 2477 } 2478 2479 // FuncFlatten1 returns the static method "JsonLdProcessor.flatten". 2480 func (this JsonLdProcessor) FuncFlatten1() (fn js.Func[func(input JsonLdInput, context JsonLdContext) js.Promise[JsonLdRecord]]) { 2481 bindings.FuncJsonLdProcessorFlatten1( 2482 this.ref, js.Pointer(&fn), 2483 ) 2484 return 2485 } 2486 2487 // Flatten1 calls the static method "JsonLdProcessor.flatten". 2488 func (this JsonLdProcessor) Flatten1(input JsonLdInput, context JsonLdContext) (ret js.Promise[JsonLdRecord]) { 2489 bindings.CallJsonLdProcessorFlatten1( 2490 this.ref, js.Pointer(&ret), 2491 input.Ref(), 2492 context.Ref(), 2493 ) 2494 2495 return 2496 } 2497 2498 // TryFlatten1 calls the static method "JsonLdProcessor.flatten" 2499 // in a try/catch block and returns (_, err, ok = false) when it went through 2500 // the catch clause. 2501 func (this JsonLdProcessor) TryFlatten1(input JsonLdInput, context JsonLdContext) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2502 ok = js.True == bindings.TryJsonLdProcessorFlatten1( 2503 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2504 input.Ref(), 2505 context.Ref(), 2506 ) 2507 2508 return 2509 } 2510 2511 // HasFuncFlatten2 returns true if the static method "JsonLdProcessor.flatten" exists. 2512 func (this JsonLdProcessor) HasFuncFlatten2() bool { 2513 return js.True == bindings.HasFuncJsonLdProcessorFlatten2( 2514 this.ref, 2515 ) 2516 } 2517 2518 // FuncFlatten2 returns the static method "JsonLdProcessor.flatten". 2519 func (this JsonLdProcessor) FuncFlatten2() (fn js.Func[func(input JsonLdInput) js.Promise[JsonLdRecord]]) { 2520 bindings.FuncJsonLdProcessorFlatten2( 2521 this.ref, js.Pointer(&fn), 2522 ) 2523 return 2524 } 2525 2526 // Flatten2 calls the static method "JsonLdProcessor.flatten". 2527 func (this JsonLdProcessor) Flatten2(input JsonLdInput) (ret js.Promise[JsonLdRecord]) { 2528 bindings.CallJsonLdProcessorFlatten2( 2529 this.ref, js.Pointer(&ret), 2530 input.Ref(), 2531 ) 2532 2533 return 2534 } 2535 2536 // TryFlatten2 calls the static method "JsonLdProcessor.flatten" 2537 // in a try/catch block and returns (_, err, ok = false) when it went through 2538 // the catch clause. 2539 func (this JsonLdProcessor) TryFlatten2(input JsonLdInput) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2540 ok = js.True == bindings.TryJsonLdProcessorFlatten2( 2541 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2542 input.Ref(), 2543 ) 2544 2545 return 2546 } 2547 2548 // HasFuncFromRdf returns true if the static method "JsonLdProcessor.fromRdf" exists. 2549 func (this JsonLdProcessor) HasFuncFromRdf() bool { 2550 return js.True == bindings.HasFuncJsonLdProcessorFromRdf( 2551 this.ref, 2552 ) 2553 } 2554 2555 // FuncFromRdf returns the static method "JsonLdProcessor.fromRdf". 2556 func (this JsonLdProcessor) FuncFromRdf() (fn js.Func[func(input RdfDataset, options JsonLdOptions) js.Promise[js.Array[JsonLdRecord]]]) { 2557 bindings.FuncJsonLdProcessorFromRdf( 2558 this.ref, js.Pointer(&fn), 2559 ) 2560 return 2561 } 2562 2563 // FromRdf calls the static method "JsonLdProcessor.fromRdf". 2564 func (this JsonLdProcessor) FromRdf(input RdfDataset, options JsonLdOptions) (ret js.Promise[js.Array[JsonLdRecord]]) { 2565 bindings.CallJsonLdProcessorFromRdf( 2566 this.ref, js.Pointer(&ret), 2567 input.Ref(), 2568 js.Pointer(&options), 2569 ) 2570 2571 return 2572 } 2573 2574 // TryFromRdf calls the static method "JsonLdProcessor.fromRdf" 2575 // in a try/catch block and returns (_, err, ok = false) when it went through 2576 // the catch clause. 2577 func (this JsonLdProcessor) TryFromRdf(input RdfDataset, options JsonLdOptions) (ret js.Promise[js.Array[JsonLdRecord]], exception js.Any, ok bool) { 2578 ok = js.True == bindings.TryJsonLdProcessorFromRdf( 2579 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2580 input.Ref(), 2581 js.Pointer(&options), 2582 ) 2583 2584 return 2585 } 2586 2587 // HasFuncFromRdf1 returns true if the static method "JsonLdProcessor.fromRdf" exists. 2588 func (this JsonLdProcessor) HasFuncFromRdf1() bool { 2589 return js.True == bindings.HasFuncJsonLdProcessorFromRdf1( 2590 this.ref, 2591 ) 2592 } 2593 2594 // FuncFromRdf1 returns the static method "JsonLdProcessor.fromRdf". 2595 func (this JsonLdProcessor) FuncFromRdf1() (fn js.Func[func(input RdfDataset) js.Promise[js.Array[JsonLdRecord]]]) { 2596 bindings.FuncJsonLdProcessorFromRdf1( 2597 this.ref, js.Pointer(&fn), 2598 ) 2599 return 2600 } 2601 2602 // FromRdf1 calls the static method "JsonLdProcessor.fromRdf". 2603 func (this JsonLdProcessor) FromRdf1(input RdfDataset) (ret js.Promise[js.Array[JsonLdRecord]]) { 2604 bindings.CallJsonLdProcessorFromRdf1( 2605 this.ref, js.Pointer(&ret), 2606 input.Ref(), 2607 ) 2608 2609 return 2610 } 2611 2612 // TryFromRdf1 calls the static method "JsonLdProcessor.fromRdf" 2613 // in a try/catch block and returns (_, err, ok = false) when it went through 2614 // the catch clause. 2615 func (this JsonLdProcessor) TryFromRdf1(input RdfDataset) (ret js.Promise[js.Array[JsonLdRecord]], exception js.Any, ok bool) { 2616 ok = js.True == bindings.TryJsonLdProcessorFromRdf1( 2617 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2618 input.Ref(), 2619 ) 2620 2621 return 2622 } 2623 2624 // HasFuncToRdf returns true if the static method "JsonLdProcessor.toRdf" exists. 2625 func (this JsonLdProcessor) HasFuncToRdf() bool { 2626 return js.True == bindings.HasFuncJsonLdProcessorToRdf( 2627 this.ref, 2628 ) 2629 } 2630 2631 // FuncToRdf returns the static method "JsonLdProcessor.toRdf". 2632 func (this JsonLdProcessor) FuncToRdf() (fn js.Func[func(input JsonLdInput, options JsonLdOptions) js.Promise[RdfDataset]]) { 2633 bindings.FuncJsonLdProcessorToRdf( 2634 this.ref, js.Pointer(&fn), 2635 ) 2636 return 2637 } 2638 2639 // ToRdf calls the static method "JsonLdProcessor.toRdf". 2640 func (this JsonLdProcessor) ToRdf(input JsonLdInput, options JsonLdOptions) (ret js.Promise[RdfDataset]) { 2641 bindings.CallJsonLdProcessorToRdf( 2642 this.ref, js.Pointer(&ret), 2643 input.Ref(), 2644 js.Pointer(&options), 2645 ) 2646 2647 return 2648 } 2649 2650 // TryToRdf calls the static method "JsonLdProcessor.toRdf" 2651 // in a try/catch block and returns (_, err, ok = false) when it went through 2652 // the catch clause. 2653 func (this JsonLdProcessor) TryToRdf(input JsonLdInput, options JsonLdOptions) (ret js.Promise[RdfDataset], exception js.Any, ok bool) { 2654 ok = js.True == bindings.TryJsonLdProcessorToRdf( 2655 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2656 input.Ref(), 2657 js.Pointer(&options), 2658 ) 2659 2660 return 2661 } 2662 2663 // HasFuncToRdf1 returns true if the static method "JsonLdProcessor.toRdf" exists. 2664 func (this JsonLdProcessor) HasFuncToRdf1() bool { 2665 return js.True == bindings.HasFuncJsonLdProcessorToRdf1( 2666 this.ref, 2667 ) 2668 } 2669 2670 // FuncToRdf1 returns the static method "JsonLdProcessor.toRdf". 2671 func (this JsonLdProcessor) FuncToRdf1() (fn js.Func[func(input JsonLdInput) js.Promise[RdfDataset]]) { 2672 bindings.FuncJsonLdProcessorToRdf1( 2673 this.ref, js.Pointer(&fn), 2674 ) 2675 return 2676 } 2677 2678 // ToRdf1 calls the static method "JsonLdProcessor.toRdf". 2679 func (this JsonLdProcessor) ToRdf1(input JsonLdInput) (ret js.Promise[RdfDataset]) { 2680 bindings.CallJsonLdProcessorToRdf1( 2681 this.ref, js.Pointer(&ret), 2682 input.Ref(), 2683 ) 2684 2685 return 2686 } 2687 2688 // TryToRdf1 calls the static method "JsonLdProcessor.toRdf" 2689 // in a try/catch block and returns (_, err, ok = false) when it went through 2690 // the catch clause. 2691 func (this JsonLdProcessor) TryToRdf1(input JsonLdInput) (ret js.Promise[RdfDataset], exception js.Any, ok bool) { 2692 ok = js.True == bindings.TryJsonLdProcessorToRdf1( 2693 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2694 input.Ref(), 2695 ) 2696 2697 return 2698 } 2699 2700 // HasFuncFrame returns true if the static method "JsonLdProcessor.frame" exists. 2701 func (this JsonLdProcessor) HasFuncFrame() bool { 2702 return js.True == bindings.HasFuncJsonLdProcessorFrame( 2703 this.ref, 2704 ) 2705 } 2706 2707 // FuncFrame returns the static method "JsonLdProcessor.frame". 2708 func (this JsonLdProcessor) FuncFrame() (fn js.Func[func(input JsonLdInput, frame JsonLdInput, options JsonLdOptions) js.Promise[JsonLdRecord]]) { 2709 bindings.FuncJsonLdProcessorFrame( 2710 this.ref, js.Pointer(&fn), 2711 ) 2712 return 2713 } 2714 2715 // Frame calls the static method "JsonLdProcessor.frame". 2716 func (this JsonLdProcessor) Frame(input JsonLdInput, frame JsonLdInput, options JsonLdOptions) (ret js.Promise[JsonLdRecord]) { 2717 bindings.CallJsonLdProcessorFrame( 2718 this.ref, js.Pointer(&ret), 2719 input.Ref(), 2720 frame.Ref(), 2721 js.Pointer(&options), 2722 ) 2723 2724 return 2725 } 2726 2727 // TryFrame calls the static method "JsonLdProcessor.frame" 2728 // in a try/catch block and returns (_, err, ok = false) when it went through 2729 // the catch clause. 2730 func (this JsonLdProcessor) TryFrame(input JsonLdInput, frame JsonLdInput, options JsonLdOptions) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2731 ok = js.True == bindings.TryJsonLdProcessorFrame( 2732 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2733 input.Ref(), 2734 frame.Ref(), 2735 js.Pointer(&options), 2736 ) 2737 2738 return 2739 } 2740 2741 // HasFuncFrame1 returns true if the static method "JsonLdProcessor.frame" exists. 2742 func (this JsonLdProcessor) HasFuncFrame1() bool { 2743 return js.True == bindings.HasFuncJsonLdProcessorFrame1( 2744 this.ref, 2745 ) 2746 } 2747 2748 // FuncFrame1 returns the static method "JsonLdProcessor.frame". 2749 func (this JsonLdProcessor) FuncFrame1() (fn js.Func[func(input JsonLdInput, frame JsonLdInput) js.Promise[JsonLdRecord]]) { 2750 bindings.FuncJsonLdProcessorFrame1( 2751 this.ref, js.Pointer(&fn), 2752 ) 2753 return 2754 } 2755 2756 // Frame1 calls the static method "JsonLdProcessor.frame". 2757 func (this JsonLdProcessor) Frame1(input JsonLdInput, frame JsonLdInput) (ret js.Promise[JsonLdRecord]) { 2758 bindings.CallJsonLdProcessorFrame1( 2759 this.ref, js.Pointer(&ret), 2760 input.Ref(), 2761 frame.Ref(), 2762 ) 2763 2764 return 2765 } 2766 2767 // TryFrame1 calls the static method "JsonLdProcessor.frame" 2768 // in a try/catch block and returns (_, err, ok = false) when it went through 2769 // the catch clause. 2770 func (this JsonLdProcessor) TryFrame1(input JsonLdInput, frame JsonLdInput) (ret js.Promise[JsonLdRecord], exception js.Any, ok bool) { 2771 ok = js.True == bindings.TryJsonLdProcessorFrame1( 2772 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2773 input.Ref(), 2774 frame.Ref(), 2775 ) 2776 2777 return 2778 } 2779 2780 const ( 2781 KHR_parallel_shader_compile_COMPLETION_STATUS_KHR GLenum = 0x91B1 2782 ) 2783 2784 type KHR_parallel_shader_compile struct { 2785 ref js.Ref 2786 } 2787 2788 func (this KHR_parallel_shader_compile) Once() KHR_parallel_shader_compile { 2789 this.ref.Once() 2790 return this 2791 } 2792 2793 func (this KHR_parallel_shader_compile) Ref() js.Ref { 2794 return this.ref 2795 } 2796 2797 func (this KHR_parallel_shader_compile) FromRef(ref js.Ref) KHR_parallel_shader_compile { 2798 this.ref = ref 2799 return this 2800 } 2801 2802 func (this KHR_parallel_shader_compile) Free() { 2803 this.ref.Free() 2804 } 2805 2806 const ( 2807 KeyboardEvent_DOM_KEY_LOCATION_STANDARD uint32 = 0x00 2808 KeyboardEvent_DOM_KEY_LOCATION_LEFT uint32 = 0x01 2809 KeyboardEvent_DOM_KEY_LOCATION_RIGHT uint32 = 0x02 2810 KeyboardEvent_DOM_KEY_LOCATION_NUMPAD uint32 = 0x03 2811 ) 2812 2813 type KeyboardEventInit struct { 2814 // Key is "KeyboardEventInit.key" 2815 // 2816 // Optional, defaults to "". 2817 Key js.String 2818 // Code is "KeyboardEventInit.code" 2819 // 2820 // Optional, defaults to "". 2821 Code js.String 2822 // Location is "KeyboardEventInit.location" 2823 // 2824 // Optional, defaults to 0. 2825 // 2826 // NOTE: FFI_USE_Location MUST be set to true to make this field effective. 2827 Location uint32 2828 // Repeat is "KeyboardEventInit.repeat" 2829 // 2830 // Optional, defaults to false. 2831 // 2832 // NOTE: FFI_USE_Repeat MUST be set to true to make this field effective. 2833 Repeat bool 2834 // IsComposing is "KeyboardEventInit.isComposing" 2835 // 2836 // Optional, defaults to false. 2837 // 2838 // NOTE: FFI_USE_IsComposing MUST be set to true to make this field effective. 2839 IsComposing bool 2840 // CtrlKey is "KeyboardEventInit.ctrlKey" 2841 // 2842 // Optional, defaults to false. 2843 // 2844 // NOTE: FFI_USE_CtrlKey MUST be set to true to make this field effective. 2845 CtrlKey bool 2846 // ShiftKey is "KeyboardEventInit.shiftKey" 2847 // 2848 // Optional, defaults to false. 2849 // 2850 // NOTE: FFI_USE_ShiftKey MUST be set to true to make this field effective. 2851 ShiftKey bool 2852 // AltKey is "KeyboardEventInit.altKey" 2853 // 2854 // Optional, defaults to false. 2855 // 2856 // NOTE: FFI_USE_AltKey MUST be set to true to make this field effective. 2857 AltKey bool 2858 // MetaKey is "KeyboardEventInit.metaKey" 2859 // 2860 // Optional, defaults to false. 2861 // 2862 // NOTE: FFI_USE_MetaKey MUST be set to true to make this field effective. 2863 MetaKey bool 2864 // ModifierAltGraph is "KeyboardEventInit.modifierAltGraph" 2865 // 2866 // Optional, defaults to false. 2867 // 2868 // NOTE: FFI_USE_ModifierAltGraph MUST be set to true to make this field effective. 2869 ModifierAltGraph bool 2870 // ModifierCapsLock is "KeyboardEventInit.modifierCapsLock" 2871 // 2872 // Optional, defaults to false. 2873 // 2874 // NOTE: FFI_USE_ModifierCapsLock MUST be set to true to make this field effective. 2875 ModifierCapsLock bool 2876 // ModifierFn is "KeyboardEventInit.modifierFn" 2877 // 2878 // Optional, defaults to false. 2879 // 2880 // NOTE: FFI_USE_ModifierFn MUST be set to true to make this field effective. 2881 ModifierFn bool 2882 // ModifierFnLock is "KeyboardEventInit.modifierFnLock" 2883 // 2884 // Optional, defaults to false. 2885 // 2886 // NOTE: FFI_USE_ModifierFnLock MUST be set to true to make this field effective. 2887 ModifierFnLock bool 2888 // ModifierHyper is "KeyboardEventInit.modifierHyper" 2889 // 2890 // Optional, defaults to false. 2891 // 2892 // NOTE: FFI_USE_ModifierHyper MUST be set to true to make this field effective. 2893 ModifierHyper bool 2894 // ModifierNumLock is "KeyboardEventInit.modifierNumLock" 2895 // 2896 // Optional, defaults to false. 2897 // 2898 // NOTE: FFI_USE_ModifierNumLock MUST be set to true to make this field effective. 2899 ModifierNumLock bool 2900 // ModifierScrollLock is "KeyboardEventInit.modifierScrollLock" 2901 // 2902 // Optional, defaults to false. 2903 // 2904 // NOTE: FFI_USE_ModifierScrollLock MUST be set to true to make this field effective. 2905 ModifierScrollLock bool 2906 // ModifierSuper is "KeyboardEventInit.modifierSuper" 2907 // 2908 // Optional, defaults to false. 2909 // 2910 // NOTE: FFI_USE_ModifierSuper MUST be set to true to make this field effective. 2911 ModifierSuper bool 2912 // ModifierSymbol is "KeyboardEventInit.modifierSymbol" 2913 // 2914 // Optional, defaults to false. 2915 // 2916 // NOTE: FFI_USE_ModifierSymbol MUST be set to true to make this field effective. 2917 ModifierSymbol bool 2918 // ModifierSymbolLock is "KeyboardEventInit.modifierSymbolLock" 2919 // 2920 // Optional, defaults to false. 2921 // 2922 // NOTE: FFI_USE_ModifierSymbolLock MUST be set to true to make this field effective. 2923 ModifierSymbolLock bool 2924 // View is "KeyboardEventInit.view" 2925 // 2926 // Optional, defaults to null. 2927 View Window 2928 // Detail is "KeyboardEventInit.detail" 2929 // 2930 // Optional, defaults to 0. 2931 // 2932 // NOTE: FFI_USE_Detail MUST be set to true to make this field effective. 2933 Detail int32 2934 // Bubbles is "KeyboardEventInit.bubbles" 2935 // 2936 // Optional, defaults to false. 2937 // 2938 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 2939 Bubbles bool 2940 // Cancelable is "KeyboardEventInit.cancelable" 2941 // 2942 // Optional, defaults to false. 2943 // 2944 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 2945 Cancelable bool 2946 // Composed is "KeyboardEventInit.composed" 2947 // 2948 // Optional, defaults to false. 2949 // 2950 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 2951 Composed bool 2952 // CharCode is "KeyboardEventInit.charCode" 2953 // 2954 // Optional, defaults to 0. 2955 // 2956 // NOTE: FFI_USE_CharCode MUST be set to true to make this field effective. 2957 CharCode uint32 2958 // KeyCode is "KeyboardEventInit.keyCode" 2959 // 2960 // Optional, defaults to 0. 2961 // 2962 // NOTE: FFI_USE_KeyCode MUST be set to true to make this field effective. 2963 KeyCode uint32 2964 2965 FFI_USE_Location bool // for Location. 2966 FFI_USE_Repeat bool // for Repeat. 2967 FFI_USE_IsComposing bool // for IsComposing. 2968 FFI_USE_CtrlKey bool // for CtrlKey. 2969 FFI_USE_ShiftKey bool // for ShiftKey. 2970 FFI_USE_AltKey bool // for AltKey. 2971 FFI_USE_MetaKey bool // for MetaKey. 2972 FFI_USE_ModifierAltGraph bool // for ModifierAltGraph. 2973 FFI_USE_ModifierCapsLock bool // for ModifierCapsLock. 2974 FFI_USE_ModifierFn bool // for ModifierFn. 2975 FFI_USE_ModifierFnLock bool // for ModifierFnLock. 2976 FFI_USE_ModifierHyper bool // for ModifierHyper. 2977 FFI_USE_ModifierNumLock bool // for ModifierNumLock. 2978 FFI_USE_ModifierScrollLock bool // for ModifierScrollLock. 2979 FFI_USE_ModifierSuper bool // for ModifierSuper. 2980 FFI_USE_ModifierSymbol bool // for ModifierSymbol. 2981 FFI_USE_ModifierSymbolLock bool // for ModifierSymbolLock. 2982 FFI_USE_Detail bool // for Detail. 2983 FFI_USE_Bubbles bool // for Bubbles. 2984 FFI_USE_Cancelable bool // for Cancelable. 2985 FFI_USE_Composed bool // for Composed. 2986 FFI_USE_CharCode bool // for CharCode. 2987 FFI_USE_KeyCode bool // for KeyCode. 2988 2989 FFI_USE bool 2990 } 2991 2992 // FromRef calls UpdateFrom and returns a KeyboardEventInit with all fields set. 2993 func (p KeyboardEventInit) FromRef(ref js.Ref) KeyboardEventInit { 2994 p.UpdateFrom(ref) 2995 return p 2996 } 2997 2998 // New creates a new KeyboardEventInit in the application heap. 2999 func (p KeyboardEventInit) New() js.Ref { 3000 return bindings.KeyboardEventInitJSLoad( 3001 js.Pointer(&p), js.True, 0, 3002 ) 3003 } 3004 3005 // UpdateFrom copies value of all fields of the heap object to p. 3006 func (p *KeyboardEventInit) UpdateFrom(ref js.Ref) { 3007 bindings.KeyboardEventInitJSStore( 3008 js.Pointer(p), ref, 3009 ) 3010 } 3011 3012 // Update writes all fields of the p to the heap object referenced by ref. 3013 func (p *KeyboardEventInit) Update(ref js.Ref) { 3014 bindings.KeyboardEventInitJSLoad( 3015 js.Pointer(p), js.False, ref, 3016 ) 3017 } 3018 3019 // FreeMembers frees fields with heap reference, if recursive is true 3020 // free all heap references reachable from p. 3021 func (p *KeyboardEventInit) FreeMembers(recursive bool) { 3022 js.Free( 3023 p.Key.Ref(), 3024 p.Code.Ref(), 3025 p.View.Ref(), 3026 ) 3027 p.Key = p.Key.FromRef(js.Undefined) 3028 p.Code = p.Code.FromRef(js.Undefined) 3029 p.View = p.View.FromRef(js.Undefined) 3030 } 3031 3032 func NewKeyboardEvent(typ js.String, eventInitDict KeyboardEventInit) (ret KeyboardEvent) { 3033 ret.ref = bindings.NewKeyboardEventByKeyboardEvent( 3034 typ.Ref(), 3035 js.Pointer(&eventInitDict)) 3036 return 3037 } 3038 3039 func NewKeyboardEventByKeyboardEvent1(typ js.String) (ret KeyboardEvent) { 3040 ret.ref = bindings.NewKeyboardEventByKeyboardEvent1( 3041 typ.Ref()) 3042 return 3043 } 3044 3045 type KeyboardEvent struct { 3046 UIEvent 3047 } 3048 3049 func (this KeyboardEvent) Once() KeyboardEvent { 3050 this.ref.Once() 3051 return this 3052 } 3053 3054 func (this KeyboardEvent) Ref() js.Ref { 3055 return this.UIEvent.Ref() 3056 } 3057 3058 func (this KeyboardEvent) FromRef(ref js.Ref) KeyboardEvent { 3059 this.UIEvent = this.UIEvent.FromRef(ref) 3060 return this 3061 } 3062 3063 func (this KeyboardEvent) Free() { 3064 this.ref.Free() 3065 } 3066 3067 // Key returns the value of property "KeyboardEvent.key". 3068 // 3069 // It returns ok=false if there is no such property. 3070 func (this KeyboardEvent) Key() (ret js.String, ok bool) { 3071 ok = js.True == bindings.GetKeyboardEventKey( 3072 this.ref, js.Pointer(&ret), 3073 ) 3074 return 3075 } 3076 3077 // Code returns the value of property "KeyboardEvent.code". 3078 // 3079 // It returns ok=false if there is no such property. 3080 func (this KeyboardEvent) Code() (ret js.String, ok bool) { 3081 ok = js.True == bindings.GetKeyboardEventCode( 3082 this.ref, js.Pointer(&ret), 3083 ) 3084 return 3085 } 3086 3087 // Location returns the value of property "KeyboardEvent.location". 3088 // 3089 // It returns ok=false if there is no such property. 3090 func (this KeyboardEvent) Location() (ret uint32, ok bool) { 3091 ok = js.True == bindings.GetKeyboardEventLocation( 3092 this.ref, js.Pointer(&ret), 3093 ) 3094 return 3095 } 3096 3097 // CtrlKey returns the value of property "KeyboardEvent.ctrlKey". 3098 // 3099 // It returns ok=false if there is no such property. 3100 func (this KeyboardEvent) CtrlKey() (ret bool, ok bool) { 3101 ok = js.True == bindings.GetKeyboardEventCtrlKey( 3102 this.ref, js.Pointer(&ret), 3103 ) 3104 return 3105 } 3106 3107 // ShiftKey returns the value of property "KeyboardEvent.shiftKey". 3108 // 3109 // It returns ok=false if there is no such property. 3110 func (this KeyboardEvent) ShiftKey() (ret bool, ok bool) { 3111 ok = js.True == bindings.GetKeyboardEventShiftKey( 3112 this.ref, js.Pointer(&ret), 3113 ) 3114 return 3115 } 3116 3117 // AltKey returns the value of property "KeyboardEvent.altKey". 3118 // 3119 // It returns ok=false if there is no such property. 3120 func (this KeyboardEvent) AltKey() (ret bool, ok bool) { 3121 ok = js.True == bindings.GetKeyboardEventAltKey( 3122 this.ref, js.Pointer(&ret), 3123 ) 3124 return 3125 } 3126 3127 // MetaKey returns the value of property "KeyboardEvent.metaKey". 3128 // 3129 // It returns ok=false if there is no such property. 3130 func (this KeyboardEvent) MetaKey() (ret bool, ok bool) { 3131 ok = js.True == bindings.GetKeyboardEventMetaKey( 3132 this.ref, js.Pointer(&ret), 3133 ) 3134 return 3135 } 3136 3137 // Repeat returns the value of property "KeyboardEvent.repeat". 3138 // 3139 // It returns ok=false if there is no such property. 3140 func (this KeyboardEvent) Repeat() (ret bool, ok bool) { 3141 ok = js.True == bindings.GetKeyboardEventRepeat( 3142 this.ref, js.Pointer(&ret), 3143 ) 3144 return 3145 } 3146 3147 // IsComposing returns the value of property "KeyboardEvent.isComposing". 3148 // 3149 // It returns ok=false if there is no such property. 3150 func (this KeyboardEvent) IsComposing() (ret bool, ok bool) { 3151 ok = js.True == bindings.GetKeyboardEventIsComposing( 3152 this.ref, js.Pointer(&ret), 3153 ) 3154 return 3155 } 3156 3157 // CharCode returns the value of property "KeyboardEvent.charCode". 3158 // 3159 // It returns ok=false if there is no such property. 3160 func (this KeyboardEvent) CharCode() (ret uint32, ok bool) { 3161 ok = js.True == bindings.GetKeyboardEventCharCode( 3162 this.ref, js.Pointer(&ret), 3163 ) 3164 return 3165 } 3166 3167 // KeyCode returns the value of property "KeyboardEvent.keyCode". 3168 // 3169 // It returns ok=false if there is no such property. 3170 func (this KeyboardEvent) KeyCode() (ret uint32, ok bool) { 3171 ok = js.True == bindings.GetKeyboardEventKeyCode( 3172 this.ref, js.Pointer(&ret), 3173 ) 3174 return 3175 } 3176 3177 // HasFuncGetModifierState returns true if the method "KeyboardEvent.getModifierState" exists. 3178 func (this KeyboardEvent) HasFuncGetModifierState() bool { 3179 return js.True == bindings.HasFuncKeyboardEventGetModifierState( 3180 this.ref, 3181 ) 3182 } 3183 3184 // FuncGetModifierState returns the method "KeyboardEvent.getModifierState". 3185 func (this KeyboardEvent) FuncGetModifierState() (fn js.Func[func(keyArg js.String) bool]) { 3186 bindings.FuncKeyboardEventGetModifierState( 3187 this.ref, js.Pointer(&fn), 3188 ) 3189 return 3190 } 3191 3192 // GetModifierState calls the method "KeyboardEvent.getModifierState". 3193 func (this KeyboardEvent) GetModifierState(keyArg js.String) (ret bool) { 3194 bindings.CallKeyboardEventGetModifierState( 3195 this.ref, js.Pointer(&ret), 3196 keyArg.Ref(), 3197 ) 3198 3199 return 3200 } 3201 3202 // TryGetModifierState calls the method "KeyboardEvent.getModifierState" 3203 // in a try/catch block and returns (_, err, ok = false) when it went through 3204 // the catch clause. 3205 func (this KeyboardEvent) TryGetModifierState(keyArg js.String) (ret bool, exception js.Any, ok bool) { 3206 ok = js.True == bindings.TryKeyboardEventGetModifierState( 3207 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3208 keyArg.Ref(), 3209 ) 3210 3211 return 3212 } 3213 3214 // HasFuncInitKeyboardEvent returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3215 func (this KeyboardEvent) HasFuncInitKeyboardEvent() bool { 3216 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent( 3217 this.ref, 3218 ) 3219 } 3220 3221 // FuncInitKeyboardEvent returns the method "KeyboardEvent.initKeyboardEvent". 3222 func (this KeyboardEvent) FuncInitKeyboardEvent() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool, shiftKey bool, metaKey bool)]) { 3223 bindings.FuncKeyboardEventInitKeyboardEvent( 3224 this.ref, js.Pointer(&fn), 3225 ) 3226 return 3227 } 3228 3229 // InitKeyboardEvent calls the method "KeyboardEvent.initKeyboardEvent". 3230 func (this KeyboardEvent) InitKeyboardEvent(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool, shiftKey bool, metaKey bool) (ret js.Void) { 3231 bindings.CallKeyboardEventInitKeyboardEvent( 3232 this.ref, js.Pointer(&ret), 3233 typeArg.Ref(), 3234 js.Bool(bool(bubblesArg)), 3235 js.Bool(bool(cancelableArg)), 3236 viewArg.Ref(), 3237 keyArg.Ref(), 3238 uint32(locationArg), 3239 js.Bool(bool(ctrlKey)), 3240 js.Bool(bool(altKey)), 3241 js.Bool(bool(shiftKey)), 3242 js.Bool(bool(metaKey)), 3243 ) 3244 3245 return 3246 } 3247 3248 // TryInitKeyboardEvent calls the method "KeyboardEvent.initKeyboardEvent" 3249 // in a try/catch block and returns (_, err, ok = false) when it went through 3250 // the catch clause. 3251 func (this KeyboardEvent) TryInitKeyboardEvent(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool, shiftKey bool, metaKey bool) (ret js.Void, exception js.Any, ok bool) { 3252 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent( 3253 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3254 typeArg.Ref(), 3255 js.Bool(bool(bubblesArg)), 3256 js.Bool(bool(cancelableArg)), 3257 viewArg.Ref(), 3258 keyArg.Ref(), 3259 uint32(locationArg), 3260 js.Bool(bool(ctrlKey)), 3261 js.Bool(bool(altKey)), 3262 js.Bool(bool(shiftKey)), 3263 js.Bool(bool(metaKey)), 3264 ) 3265 3266 return 3267 } 3268 3269 // HasFuncInitKeyboardEvent1 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3270 func (this KeyboardEvent) HasFuncInitKeyboardEvent1() bool { 3271 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent1( 3272 this.ref, 3273 ) 3274 } 3275 3276 // FuncInitKeyboardEvent1 returns the method "KeyboardEvent.initKeyboardEvent". 3277 func (this KeyboardEvent) FuncInitKeyboardEvent1() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool, shiftKey bool)]) { 3278 bindings.FuncKeyboardEventInitKeyboardEvent1( 3279 this.ref, js.Pointer(&fn), 3280 ) 3281 return 3282 } 3283 3284 // InitKeyboardEvent1 calls the method "KeyboardEvent.initKeyboardEvent". 3285 func (this KeyboardEvent) InitKeyboardEvent1(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool, shiftKey bool) (ret js.Void) { 3286 bindings.CallKeyboardEventInitKeyboardEvent1( 3287 this.ref, js.Pointer(&ret), 3288 typeArg.Ref(), 3289 js.Bool(bool(bubblesArg)), 3290 js.Bool(bool(cancelableArg)), 3291 viewArg.Ref(), 3292 keyArg.Ref(), 3293 uint32(locationArg), 3294 js.Bool(bool(ctrlKey)), 3295 js.Bool(bool(altKey)), 3296 js.Bool(bool(shiftKey)), 3297 ) 3298 3299 return 3300 } 3301 3302 // TryInitKeyboardEvent1 calls the method "KeyboardEvent.initKeyboardEvent" 3303 // in a try/catch block and returns (_, err, ok = false) when it went through 3304 // the catch clause. 3305 func (this KeyboardEvent) TryInitKeyboardEvent1(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool, shiftKey bool) (ret js.Void, exception js.Any, ok bool) { 3306 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent1( 3307 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3308 typeArg.Ref(), 3309 js.Bool(bool(bubblesArg)), 3310 js.Bool(bool(cancelableArg)), 3311 viewArg.Ref(), 3312 keyArg.Ref(), 3313 uint32(locationArg), 3314 js.Bool(bool(ctrlKey)), 3315 js.Bool(bool(altKey)), 3316 js.Bool(bool(shiftKey)), 3317 ) 3318 3319 return 3320 } 3321 3322 // HasFuncInitKeyboardEvent2 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3323 func (this KeyboardEvent) HasFuncInitKeyboardEvent2() bool { 3324 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent2( 3325 this.ref, 3326 ) 3327 } 3328 3329 // FuncInitKeyboardEvent2 returns the method "KeyboardEvent.initKeyboardEvent". 3330 func (this KeyboardEvent) FuncInitKeyboardEvent2() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool)]) { 3331 bindings.FuncKeyboardEventInitKeyboardEvent2( 3332 this.ref, js.Pointer(&fn), 3333 ) 3334 return 3335 } 3336 3337 // InitKeyboardEvent2 calls the method "KeyboardEvent.initKeyboardEvent". 3338 func (this KeyboardEvent) InitKeyboardEvent2(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool) (ret js.Void) { 3339 bindings.CallKeyboardEventInitKeyboardEvent2( 3340 this.ref, js.Pointer(&ret), 3341 typeArg.Ref(), 3342 js.Bool(bool(bubblesArg)), 3343 js.Bool(bool(cancelableArg)), 3344 viewArg.Ref(), 3345 keyArg.Ref(), 3346 uint32(locationArg), 3347 js.Bool(bool(ctrlKey)), 3348 js.Bool(bool(altKey)), 3349 ) 3350 3351 return 3352 } 3353 3354 // TryInitKeyboardEvent2 calls the method "KeyboardEvent.initKeyboardEvent" 3355 // in a try/catch block and returns (_, err, ok = false) when it went through 3356 // the catch clause. 3357 func (this KeyboardEvent) TryInitKeyboardEvent2(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool, altKey bool) (ret js.Void, exception js.Any, ok bool) { 3358 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent2( 3359 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3360 typeArg.Ref(), 3361 js.Bool(bool(bubblesArg)), 3362 js.Bool(bool(cancelableArg)), 3363 viewArg.Ref(), 3364 keyArg.Ref(), 3365 uint32(locationArg), 3366 js.Bool(bool(ctrlKey)), 3367 js.Bool(bool(altKey)), 3368 ) 3369 3370 return 3371 } 3372 3373 // HasFuncInitKeyboardEvent3 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3374 func (this KeyboardEvent) HasFuncInitKeyboardEvent3() bool { 3375 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent3( 3376 this.ref, 3377 ) 3378 } 3379 3380 // FuncInitKeyboardEvent3 returns the method "KeyboardEvent.initKeyboardEvent". 3381 func (this KeyboardEvent) FuncInitKeyboardEvent3() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool)]) { 3382 bindings.FuncKeyboardEventInitKeyboardEvent3( 3383 this.ref, js.Pointer(&fn), 3384 ) 3385 return 3386 } 3387 3388 // InitKeyboardEvent3 calls the method "KeyboardEvent.initKeyboardEvent". 3389 func (this KeyboardEvent) InitKeyboardEvent3(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool) (ret js.Void) { 3390 bindings.CallKeyboardEventInitKeyboardEvent3( 3391 this.ref, js.Pointer(&ret), 3392 typeArg.Ref(), 3393 js.Bool(bool(bubblesArg)), 3394 js.Bool(bool(cancelableArg)), 3395 viewArg.Ref(), 3396 keyArg.Ref(), 3397 uint32(locationArg), 3398 js.Bool(bool(ctrlKey)), 3399 ) 3400 3401 return 3402 } 3403 3404 // TryInitKeyboardEvent3 calls the method "KeyboardEvent.initKeyboardEvent" 3405 // in a try/catch block and returns (_, err, ok = false) when it went through 3406 // the catch clause. 3407 func (this KeyboardEvent) TryInitKeyboardEvent3(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32, ctrlKey bool) (ret js.Void, exception js.Any, ok bool) { 3408 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent3( 3409 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3410 typeArg.Ref(), 3411 js.Bool(bool(bubblesArg)), 3412 js.Bool(bool(cancelableArg)), 3413 viewArg.Ref(), 3414 keyArg.Ref(), 3415 uint32(locationArg), 3416 js.Bool(bool(ctrlKey)), 3417 ) 3418 3419 return 3420 } 3421 3422 // HasFuncInitKeyboardEvent4 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3423 func (this KeyboardEvent) HasFuncInitKeyboardEvent4() bool { 3424 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent4( 3425 this.ref, 3426 ) 3427 } 3428 3429 // FuncInitKeyboardEvent4 returns the method "KeyboardEvent.initKeyboardEvent". 3430 func (this KeyboardEvent) FuncInitKeyboardEvent4() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32)]) { 3431 bindings.FuncKeyboardEventInitKeyboardEvent4( 3432 this.ref, js.Pointer(&fn), 3433 ) 3434 return 3435 } 3436 3437 // InitKeyboardEvent4 calls the method "KeyboardEvent.initKeyboardEvent". 3438 func (this KeyboardEvent) InitKeyboardEvent4(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32) (ret js.Void) { 3439 bindings.CallKeyboardEventInitKeyboardEvent4( 3440 this.ref, js.Pointer(&ret), 3441 typeArg.Ref(), 3442 js.Bool(bool(bubblesArg)), 3443 js.Bool(bool(cancelableArg)), 3444 viewArg.Ref(), 3445 keyArg.Ref(), 3446 uint32(locationArg), 3447 ) 3448 3449 return 3450 } 3451 3452 // TryInitKeyboardEvent4 calls the method "KeyboardEvent.initKeyboardEvent" 3453 // in a try/catch block and returns (_, err, ok = false) when it went through 3454 // the catch clause. 3455 func (this KeyboardEvent) TryInitKeyboardEvent4(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String, locationArg uint32) (ret js.Void, exception js.Any, ok bool) { 3456 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent4( 3457 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3458 typeArg.Ref(), 3459 js.Bool(bool(bubblesArg)), 3460 js.Bool(bool(cancelableArg)), 3461 viewArg.Ref(), 3462 keyArg.Ref(), 3463 uint32(locationArg), 3464 ) 3465 3466 return 3467 } 3468 3469 // HasFuncInitKeyboardEvent5 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3470 func (this KeyboardEvent) HasFuncInitKeyboardEvent5() bool { 3471 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent5( 3472 this.ref, 3473 ) 3474 } 3475 3476 // FuncInitKeyboardEvent5 returns the method "KeyboardEvent.initKeyboardEvent". 3477 func (this KeyboardEvent) FuncInitKeyboardEvent5() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String)]) { 3478 bindings.FuncKeyboardEventInitKeyboardEvent5( 3479 this.ref, js.Pointer(&fn), 3480 ) 3481 return 3482 } 3483 3484 // InitKeyboardEvent5 calls the method "KeyboardEvent.initKeyboardEvent". 3485 func (this KeyboardEvent) InitKeyboardEvent5(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String) (ret js.Void) { 3486 bindings.CallKeyboardEventInitKeyboardEvent5( 3487 this.ref, js.Pointer(&ret), 3488 typeArg.Ref(), 3489 js.Bool(bool(bubblesArg)), 3490 js.Bool(bool(cancelableArg)), 3491 viewArg.Ref(), 3492 keyArg.Ref(), 3493 ) 3494 3495 return 3496 } 3497 3498 // TryInitKeyboardEvent5 calls the method "KeyboardEvent.initKeyboardEvent" 3499 // in a try/catch block and returns (_, err, ok = false) when it went through 3500 // the catch clause. 3501 func (this KeyboardEvent) TryInitKeyboardEvent5(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window, keyArg js.String) (ret js.Void, exception js.Any, ok bool) { 3502 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent5( 3503 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3504 typeArg.Ref(), 3505 js.Bool(bool(bubblesArg)), 3506 js.Bool(bool(cancelableArg)), 3507 viewArg.Ref(), 3508 keyArg.Ref(), 3509 ) 3510 3511 return 3512 } 3513 3514 // HasFuncInitKeyboardEvent6 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3515 func (this KeyboardEvent) HasFuncInitKeyboardEvent6() bool { 3516 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent6( 3517 this.ref, 3518 ) 3519 } 3520 3521 // FuncInitKeyboardEvent6 returns the method "KeyboardEvent.initKeyboardEvent". 3522 func (this KeyboardEvent) FuncInitKeyboardEvent6() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window)]) { 3523 bindings.FuncKeyboardEventInitKeyboardEvent6( 3524 this.ref, js.Pointer(&fn), 3525 ) 3526 return 3527 } 3528 3529 // InitKeyboardEvent6 calls the method "KeyboardEvent.initKeyboardEvent". 3530 func (this KeyboardEvent) InitKeyboardEvent6(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window) (ret js.Void) { 3531 bindings.CallKeyboardEventInitKeyboardEvent6( 3532 this.ref, js.Pointer(&ret), 3533 typeArg.Ref(), 3534 js.Bool(bool(bubblesArg)), 3535 js.Bool(bool(cancelableArg)), 3536 viewArg.Ref(), 3537 ) 3538 3539 return 3540 } 3541 3542 // TryInitKeyboardEvent6 calls the method "KeyboardEvent.initKeyboardEvent" 3543 // in a try/catch block and returns (_, err, ok = false) when it went through 3544 // the catch clause. 3545 func (this KeyboardEvent) TryInitKeyboardEvent6(typeArg js.String, bubblesArg bool, cancelableArg bool, viewArg Window) (ret js.Void, exception js.Any, ok bool) { 3546 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent6( 3547 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3548 typeArg.Ref(), 3549 js.Bool(bool(bubblesArg)), 3550 js.Bool(bool(cancelableArg)), 3551 viewArg.Ref(), 3552 ) 3553 3554 return 3555 } 3556 3557 // HasFuncInitKeyboardEvent7 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3558 func (this KeyboardEvent) HasFuncInitKeyboardEvent7() bool { 3559 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent7( 3560 this.ref, 3561 ) 3562 } 3563 3564 // FuncInitKeyboardEvent7 returns the method "KeyboardEvent.initKeyboardEvent". 3565 func (this KeyboardEvent) FuncInitKeyboardEvent7() (fn js.Func[func(typeArg js.String, bubblesArg bool, cancelableArg bool)]) { 3566 bindings.FuncKeyboardEventInitKeyboardEvent7( 3567 this.ref, js.Pointer(&fn), 3568 ) 3569 return 3570 } 3571 3572 // InitKeyboardEvent7 calls the method "KeyboardEvent.initKeyboardEvent". 3573 func (this KeyboardEvent) InitKeyboardEvent7(typeArg js.String, bubblesArg bool, cancelableArg bool) (ret js.Void) { 3574 bindings.CallKeyboardEventInitKeyboardEvent7( 3575 this.ref, js.Pointer(&ret), 3576 typeArg.Ref(), 3577 js.Bool(bool(bubblesArg)), 3578 js.Bool(bool(cancelableArg)), 3579 ) 3580 3581 return 3582 } 3583 3584 // TryInitKeyboardEvent7 calls the method "KeyboardEvent.initKeyboardEvent" 3585 // in a try/catch block and returns (_, err, ok = false) when it went through 3586 // the catch clause. 3587 func (this KeyboardEvent) TryInitKeyboardEvent7(typeArg js.String, bubblesArg bool, cancelableArg bool) (ret js.Void, exception js.Any, ok bool) { 3588 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent7( 3589 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3590 typeArg.Ref(), 3591 js.Bool(bool(bubblesArg)), 3592 js.Bool(bool(cancelableArg)), 3593 ) 3594 3595 return 3596 } 3597 3598 // HasFuncInitKeyboardEvent8 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3599 func (this KeyboardEvent) HasFuncInitKeyboardEvent8() bool { 3600 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent8( 3601 this.ref, 3602 ) 3603 } 3604 3605 // FuncInitKeyboardEvent8 returns the method "KeyboardEvent.initKeyboardEvent". 3606 func (this KeyboardEvent) FuncInitKeyboardEvent8() (fn js.Func[func(typeArg js.String, bubblesArg bool)]) { 3607 bindings.FuncKeyboardEventInitKeyboardEvent8( 3608 this.ref, js.Pointer(&fn), 3609 ) 3610 return 3611 } 3612 3613 // InitKeyboardEvent8 calls the method "KeyboardEvent.initKeyboardEvent". 3614 func (this KeyboardEvent) InitKeyboardEvent8(typeArg js.String, bubblesArg bool) (ret js.Void) { 3615 bindings.CallKeyboardEventInitKeyboardEvent8( 3616 this.ref, js.Pointer(&ret), 3617 typeArg.Ref(), 3618 js.Bool(bool(bubblesArg)), 3619 ) 3620 3621 return 3622 } 3623 3624 // TryInitKeyboardEvent8 calls the method "KeyboardEvent.initKeyboardEvent" 3625 // in a try/catch block and returns (_, err, ok = false) when it went through 3626 // the catch clause. 3627 func (this KeyboardEvent) TryInitKeyboardEvent8(typeArg js.String, bubblesArg bool) (ret js.Void, exception js.Any, ok bool) { 3628 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent8( 3629 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3630 typeArg.Ref(), 3631 js.Bool(bool(bubblesArg)), 3632 ) 3633 3634 return 3635 } 3636 3637 // HasFuncInitKeyboardEvent9 returns true if the method "KeyboardEvent.initKeyboardEvent" exists. 3638 func (this KeyboardEvent) HasFuncInitKeyboardEvent9() bool { 3639 return js.True == bindings.HasFuncKeyboardEventInitKeyboardEvent9( 3640 this.ref, 3641 ) 3642 } 3643 3644 // FuncInitKeyboardEvent9 returns the method "KeyboardEvent.initKeyboardEvent". 3645 func (this KeyboardEvent) FuncInitKeyboardEvent9() (fn js.Func[func(typeArg js.String)]) { 3646 bindings.FuncKeyboardEventInitKeyboardEvent9( 3647 this.ref, js.Pointer(&fn), 3648 ) 3649 return 3650 } 3651 3652 // InitKeyboardEvent9 calls the method "KeyboardEvent.initKeyboardEvent". 3653 func (this KeyboardEvent) InitKeyboardEvent9(typeArg js.String) (ret js.Void) { 3654 bindings.CallKeyboardEventInitKeyboardEvent9( 3655 this.ref, js.Pointer(&ret), 3656 typeArg.Ref(), 3657 ) 3658 3659 return 3660 } 3661 3662 // TryInitKeyboardEvent9 calls the method "KeyboardEvent.initKeyboardEvent" 3663 // in a try/catch block and returns (_, err, ok = false) when it went through 3664 // the catch clause. 3665 func (this KeyboardEvent) TryInitKeyboardEvent9(typeArg js.String) (ret js.Void, exception js.Any, ok bool) { 3666 ok = js.True == bindings.TryKeyboardEventInitKeyboardEvent9( 3667 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3668 typeArg.Ref(), 3669 ) 3670 3671 return 3672 } 3673 3674 type KeyframeEffectOptions struct { 3675 // Composite is "KeyframeEffectOptions.composite" 3676 // 3677 // Optional, defaults to "replace". 3678 Composite CompositeOperation 3679 // PseudoElement is "KeyframeEffectOptions.pseudoElement" 3680 // 3681 // Optional, defaults to null. 3682 PseudoElement js.String 3683 // Fill is "KeyframeEffectOptions.fill" 3684 // 3685 // Optional, defaults to "auto". 3686 Fill FillMode 3687 // IterationStart is "KeyframeEffectOptions.iterationStart" 3688 // 3689 // Optional, defaults to 0.0. 3690 // 3691 // NOTE: FFI_USE_IterationStart MUST be set to true to make this field effective. 3692 IterationStart float64 3693 // Iterations is "KeyframeEffectOptions.iterations" 3694 // 3695 // Optional, defaults to 1.0. 3696 // 3697 // NOTE: FFI_USE_Iterations MUST be set to true to make this field effective. 3698 Iterations float64 3699 // Direction is "KeyframeEffectOptions.direction" 3700 // 3701 // Optional, defaults to "normal". 3702 Direction PlaybackDirection 3703 // Easing is "KeyframeEffectOptions.easing" 3704 // 3705 // Optional, defaults to "linear". 3706 Easing js.String 3707 // IterationComposite is "KeyframeEffectOptions.iterationComposite" 3708 // 3709 // Optional, defaults to "replace". 3710 IterationComposite IterationCompositeOperation 3711 3712 FFI_USE_IterationStart bool // for IterationStart. 3713 FFI_USE_Iterations bool // for Iterations. 3714 3715 FFI_USE bool 3716 } 3717 3718 // FromRef calls UpdateFrom and returns a KeyframeEffectOptions with all fields set. 3719 func (p KeyframeEffectOptions) FromRef(ref js.Ref) KeyframeEffectOptions { 3720 p.UpdateFrom(ref) 3721 return p 3722 } 3723 3724 // New creates a new KeyframeEffectOptions in the application heap. 3725 func (p KeyframeEffectOptions) New() js.Ref { 3726 return bindings.KeyframeEffectOptionsJSLoad( 3727 js.Pointer(&p), js.True, 0, 3728 ) 3729 } 3730 3731 // UpdateFrom copies value of all fields of the heap object to p. 3732 func (p *KeyframeEffectOptions) UpdateFrom(ref js.Ref) { 3733 bindings.KeyframeEffectOptionsJSStore( 3734 js.Pointer(p), ref, 3735 ) 3736 } 3737 3738 // Update writes all fields of the p to the heap object referenced by ref. 3739 func (p *KeyframeEffectOptions) Update(ref js.Ref) { 3740 bindings.KeyframeEffectOptionsJSLoad( 3741 js.Pointer(p), js.False, ref, 3742 ) 3743 } 3744 3745 // FreeMembers frees fields with heap reference, if recursive is true 3746 // free all heap references reachable from p. 3747 func (p *KeyframeEffectOptions) FreeMembers(recursive bool) { 3748 js.Free( 3749 p.PseudoElement.Ref(), 3750 p.Easing.Ref(), 3751 ) 3752 p.PseudoElement = p.PseudoElement.FromRef(js.Undefined) 3753 p.Easing = p.Easing.FromRef(js.Undefined) 3754 } 3755 3756 type OneOf_Float64_KeyframeEffectOptions struct { 3757 ref js.Ref 3758 } 3759 3760 func (x OneOf_Float64_KeyframeEffectOptions) Ref() js.Ref { 3761 return x.ref 3762 } 3763 3764 func (x OneOf_Float64_KeyframeEffectOptions) Free() { 3765 x.ref.Free() 3766 } 3767 3768 func (x OneOf_Float64_KeyframeEffectOptions) FromRef(ref js.Ref) OneOf_Float64_KeyframeEffectOptions { 3769 return OneOf_Float64_KeyframeEffectOptions{ 3770 ref: ref, 3771 } 3772 } 3773 3774 func (x OneOf_Float64_KeyframeEffectOptions) Float64() float64 { 3775 return js.Number[float64]{}.FromRef(x.ref).Get() 3776 } 3777 3778 func (x OneOf_Float64_KeyframeEffectOptions) KeyframeEffectOptions() KeyframeEffectOptions { 3779 var ret KeyframeEffectOptions 3780 ret.UpdateFrom(x.ref) 3781 return ret 3782 } 3783 3784 func NewKeyframeEffect(target Element, keyframes js.Object, options OneOf_Float64_KeyframeEffectOptions) (ret KeyframeEffect) { 3785 ret.ref = bindings.NewKeyframeEffectByKeyframeEffect( 3786 target.Ref(), 3787 keyframes.Ref(), 3788 options.Ref()) 3789 return 3790 } 3791 3792 func NewKeyframeEffectByKeyframeEffect1(target Element, keyframes js.Object) (ret KeyframeEffect) { 3793 ret.ref = bindings.NewKeyframeEffectByKeyframeEffect1( 3794 target.Ref(), 3795 keyframes.Ref()) 3796 return 3797 } 3798 3799 func NewKeyframeEffectByKeyframeEffect2(source KeyframeEffect) (ret KeyframeEffect) { 3800 ret.ref = bindings.NewKeyframeEffectByKeyframeEffect2( 3801 source.Ref()) 3802 return 3803 } 3804 3805 type KeyframeEffect struct { 3806 AnimationEffect 3807 } 3808 3809 func (this KeyframeEffect) Once() KeyframeEffect { 3810 this.ref.Once() 3811 return this 3812 } 3813 3814 func (this KeyframeEffect) Ref() js.Ref { 3815 return this.AnimationEffect.Ref() 3816 } 3817 3818 func (this KeyframeEffect) FromRef(ref js.Ref) KeyframeEffect { 3819 this.AnimationEffect = this.AnimationEffect.FromRef(ref) 3820 return this 3821 } 3822 3823 func (this KeyframeEffect) Free() { 3824 this.ref.Free() 3825 } 3826 3827 // Target returns the value of property "KeyframeEffect.target". 3828 // 3829 // It returns ok=false if there is no such property. 3830 func (this KeyframeEffect) Target() (ret Element, ok bool) { 3831 ok = js.True == bindings.GetKeyframeEffectTarget( 3832 this.ref, js.Pointer(&ret), 3833 ) 3834 return 3835 } 3836 3837 // SetTarget sets the value of property "KeyframeEffect.target" to val. 3838 // 3839 // It returns false if the property cannot be set. 3840 func (this KeyframeEffect) SetTarget(val Element) bool { 3841 return js.True == bindings.SetKeyframeEffectTarget( 3842 this.ref, 3843 val.Ref(), 3844 ) 3845 } 3846 3847 // PseudoElement returns the value of property "KeyframeEffect.pseudoElement". 3848 // 3849 // It returns ok=false if there is no such property. 3850 func (this KeyframeEffect) PseudoElement() (ret js.String, ok bool) { 3851 ok = js.True == bindings.GetKeyframeEffectPseudoElement( 3852 this.ref, js.Pointer(&ret), 3853 ) 3854 return 3855 } 3856 3857 // SetPseudoElement sets the value of property "KeyframeEffect.pseudoElement" to val. 3858 // 3859 // It returns false if the property cannot be set. 3860 func (this KeyframeEffect) SetPseudoElement(val js.String) bool { 3861 return js.True == bindings.SetKeyframeEffectPseudoElement( 3862 this.ref, 3863 val.Ref(), 3864 ) 3865 } 3866 3867 // Composite returns the value of property "KeyframeEffect.composite". 3868 // 3869 // It returns ok=false if there is no such property. 3870 func (this KeyframeEffect) Composite() (ret CompositeOperation, ok bool) { 3871 ok = js.True == bindings.GetKeyframeEffectComposite( 3872 this.ref, js.Pointer(&ret), 3873 ) 3874 return 3875 } 3876 3877 // SetComposite sets the value of property "KeyframeEffect.composite" to val. 3878 // 3879 // It returns false if the property cannot be set. 3880 func (this KeyframeEffect) SetComposite(val CompositeOperation) bool { 3881 return js.True == bindings.SetKeyframeEffectComposite( 3882 this.ref, 3883 uint32(val), 3884 ) 3885 } 3886 3887 // IterationComposite returns the value of property "KeyframeEffect.iterationComposite". 3888 // 3889 // It returns ok=false if there is no such property. 3890 func (this KeyframeEffect) IterationComposite() (ret IterationCompositeOperation, ok bool) { 3891 ok = js.True == bindings.GetKeyframeEffectIterationComposite( 3892 this.ref, js.Pointer(&ret), 3893 ) 3894 return 3895 } 3896 3897 // SetIterationComposite sets the value of property "KeyframeEffect.iterationComposite" to val. 3898 // 3899 // It returns false if the property cannot be set. 3900 func (this KeyframeEffect) SetIterationComposite(val IterationCompositeOperation) bool { 3901 return js.True == bindings.SetKeyframeEffectIterationComposite( 3902 this.ref, 3903 uint32(val), 3904 ) 3905 } 3906 3907 // HasFuncGetKeyframes returns true if the method "KeyframeEffect.getKeyframes" exists. 3908 func (this KeyframeEffect) HasFuncGetKeyframes() bool { 3909 return js.True == bindings.HasFuncKeyframeEffectGetKeyframes( 3910 this.ref, 3911 ) 3912 } 3913 3914 // FuncGetKeyframes returns the method "KeyframeEffect.getKeyframes". 3915 func (this KeyframeEffect) FuncGetKeyframes() (fn js.Func[func() js.Array[js.Object]]) { 3916 bindings.FuncKeyframeEffectGetKeyframes( 3917 this.ref, js.Pointer(&fn), 3918 ) 3919 return 3920 } 3921 3922 // GetKeyframes calls the method "KeyframeEffect.getKeyframes". 3923 func (this KeyframeEffect) GetKeyframes() (ret js.Array[js.Object]) { 3924 bindings.CallKeyframeEffectGetKeyframes( 3925 this.ref, js.Pointer(&ret), 3926 ) 3927 3928 return 3929 } 3930 3931 // TryGetKeyframes calls the method "KeyframeEffect.getKeyframes" 3932 // in a try/catch block and returns (_, err, ok = false) when it went through 3933 // the catch clause. 3934 func (this KeyframeEffect) TryGetKeyframes() (ret js.Array[js.Object], exception js.Any, ok bool) { 3935 ok = js.True == bindings.TryKeyframeEffectGetKeyframes( 3936 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3937 ) 3938 3939 return 3940 } 3941 3942 // HasFuncSetKeyframes returns true if the method "KeyframeEffect.setKeyframes" exists. 3943 func (this KeyframeEffect) HasFuncSetKeyframes() bool { 3944 return js.True == bindings.HasFuncKeyframeEffectSetKeyframes( 3945 this.ref, 3946 ) 3947 } 3948 3949 // FuncSetKeyframes returns the method "KeyframeEffect.setKeyframes". 3950 func (this KeyframeEffect) FuncSetKeyframes() (fn js.Func[func(keyframes js.Object)]) { 3951 bindings.FuncKeyframeEffectSetKeyframes( 3952 this.ref, js.Pointer(&fn), 3953 ) 3954 return 3955 } 3956 3957 // SetKeyframes calls the method "KeyframeEffect.setKeyframes". 3958 func (this KeyframeEffect) SetKeyframes(keyframes js.Object) (ret js.Void) { 3959 bindings.CallKeyframeEffectSetKeyframes( 3960 this.ref, js.Pointer(&ret), 3961 keyframes.Ref(), 3962 ) 3963 3964 return 3965 } 3966 3967 // TrySetKeyframes calls the method "KeyframeEffect.setKeyframes" 3968 // in a try/catch block and returns (_, err, ok = false) when it went through 3969 // the catch clause. 3970 func (this KeyframeEffect) TrySetKeyframes(keyframes js.Object) (ret js.Void, exception js.Any, ok bool) { 3971 ok = js.True == bindings.TryKeyframeEffectSetKeyframes( 3972 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3973 keyframes.Ref(), 3974 ) 3975 3976 return 3977 } 3978 3979 type LargeBlobSupport uint32 3980 3981 const ( 3982 _ LargeBlobSupport = iota 3983 3984 LargeBlobSupport_REQUIRED 3985 LargeBlobSupport_PREFERRED 3986 ) 3987 3988 func (LargeBlobSupport) FromRef(str js.Ref) LargeBlobSupport { 3989 return LargeBlobSupport(bindings.ConstOfLargeBlobSupport(str)) 3990 } 3991 3992 func (x LargeBlobSupport) String() (string, bool) { 3993 switch x { 3994 case LargeBlobSupport_REQUIRED: 3995 return "required", true 3996 case LargeBlobSupport_PREFERRED: 3997 return "preferred", true 3998 default: 3999 return "", false 4000 } 4001 }