github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis54_js_wasm.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package web
     5  
     6  import (
     7  	"github.com/primecitizens/pcz/std/core/abi"
     8  	"github.com/primecitizens/pcz/std/ffi/js"
     9  	"github.com/primecitizens/pcz/std/plat/js/web/bindings"
    10  )
    11  
    12  type SyncEventInit struct {
    13  	// Tag is "SyncEventInit.tag"
    14  	//
    15  	// Required
    16  	Tag js.String
    17  	// LastChance is "SyncEventInit.lastChance"
    18  	//
    19  	// Optional, defaults to false.
    20  	//
    21  	// NOTE: FFI_USE_LastChance MUST be set to true to make this field effective.
    22  	LastChance bool
    23  	// Bubbles is "SyncEventInit.bubbles"
    24  	//
    25  	// Optional, defaults to false.
    26  	//
    27  	// NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective.
    28  	Bubbles bool
    29  	// Cancelable is "SyncEventInit.cancelable"
    30  	//
    31  	// Optional, defaults to false.
    32  	//
    33  	// NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective.
    34  	Cancelable bool
    35  	// Composed is "SyncEventInit.composed"
    36  	//
    37  	// Optional, defaults to false.
    38  	//
    39  	// NOTE: FFI_USE_Composed MUST be set to true to make this field effective.
    40  	Composed bool
    41  
    42  	FFI_USE_LastChance bool // for LastChance.
    43  	FFI_USE_Bubbles    bool // for Bubbles.
    44  	FFI_USE_Cancelable bool // for Cancelable.
    45  	FFI_USE_Composed   bool // for Composed.
    46  
    47  	FFI_USE bool
    48  }
    49  
    50  // FromRef calls UpdateFrom and returns a SyncEventInit with all fields set.
    51  func (p SyncEventInit) FromRef(ref js.Ref) SyncEventInit {
    52  	p.UpdateFrom(ref)
    53  	return p
    54  }
    55  
    56  // New creates a new SyncEventInit in the application heap.
    57  func (p SyncEventInit) New() js.Ref {
    58  	return bindings.SyncEventInitJSLoad(
    59  		js.Pointer(&p), js.True, 0,
    60  	)
    61  }
    62  
    63  // UpdateFrom copies value of all fields of the heap object to p.
    64  func (p *SyncEventInit) UpdateFrom(ref js.Ref) {
    65  	bindings.SyncEventInitJSStore(
    66  		js.Pointer(p), ref,
    67  	)
    68  }
    69  
    70  // Update writes all fields of the p to the heap object referenced by ref.
    71  func (p *SyncEventInit) Update(ref js.Ref) {
    72  	bindings.SyncEventInitJSLoad(
    73  		js.Pointer(p), js.False, ref,
    74  	)
    75  }
    76  
    77  // FreeMembers frees fields with heap reference, if recursive is true
    78  // free all heap references reachable from p.
    79  func (p *SyncEventInit) FreeMembers(recursive bool) {
    80  	js.Free(
    81  		p.Tag.Ref(),
    82  	)
    83  	p.Tag = p.Tag.FromRef(js.Undefined)
    84  }
    85  
    86  func NewSyncEvent(typ js.String, init SyncEventInit) (ret SyncEvent) {
    87  	ret.ref = bindings.NewSyncEventBySyncEvent(
    88  		typ.Ref(),
    89  		js.Pointer(&init))
    90  	return
    91  }
    92  
    93  type SyncEvent struct {
    94  	ExtendableEvent
    95  }
    96  
    97  func (this SyncEvent) Once() SyncEvent {
    98  	this.ref.Once()
    99  	return this
   100  }
   101  
   102  func (this SyncEvent) Ref() js.Ref {
   103  	return this.ExtendableEvent.Ref()
   104  }
   105  
   106  func (this SyncEvent) FromRef(ref js.Ref) SyncEvent {
   107  	this.ExtendableEvent = this.ExtendableEvent.FromRef(ref)
   108  	return this
   109  }
   110  
   111  func (this SyncEvent) Free() {
   112  	this.ref.Free()
   113  }
   114  
   115  // Tag returns the value of property "SyncEvent.tag".
   116  //
   117  // It returns ok=false if there is no such property.
   118  func (this SyncEvent) Tag() (ret js.String, ok bool) {
   119  	ok = js.True == bindings.GetSyncEventTag(
   120  		this.ref, js.Pointer(&ret),
   121  	)
   122  	return
   123  }
   124  
   125  // LastChance returns the value of property "SyncEvent.lastChance".
   126  //
   127  // It returns ok=false if there is no such property.
   128  func (this SyncEvent) LastChance() (ret bool, ok bool) {
   129  	ok = js.True == bindings.GetSyncEventLastChance(
   130  		this.ref, js.Pointer(&ret),
   131  	)
   132  	return
   133  }
   134  
   135  type TableKind uint32
   136  
   137  const (
   138  	_ TableKind = iota
   139  
   140  	TableKind_EXTERNREF
   141  	TableKind_ANYFUNC
   142  )
   143  
   144  func (TableKind) FromRef(str js.Ref) TableKind {
   145  	return TableKind(bindings.ConstOfTableKind(str))
   146  }
   147  
   148  func (x TableKind) String() (string, bool) {
   149  	switch x {
   150  	case TableKind_EXTERNREF:
   151  		return "externref", true
   152  	case TableKind_ANYFUNC:
   153  		return "anyfunc", true
   154  	default:
   155  		return "", false
   156  	}
   157  }
   158  
   159  type TableDescriptor struct {
   160  	// Element is "TableDescriptor.element"
   161  	//
   162  	// Required
   163  	Element TableKind
   164  	// Initial is "TableDescriptor.initial"
   165  	//
   166  	// Required
   167  	Initial uint32
   168  	// Maximum is "TableDescriptor.maximum"
   169  	//
   170  	// Optional
   171  	//
   172  	// NOTE: FFI_USE_Maximum MUST be set to true to make this field effective.
   173  	Maximum uint32
   174  
   175  	FFI_USE_Maximum bool // for Maximum.
   176  
   177  	FFI_USE bool
   178  }
   179  
   180  // FromRef calls UpdateFrom and returns a TableDescriptor with all fields set.
   181  func (p TableDescriptor) FromRef(ref js.Ref) TableDescriptor {
   182  	p.UpdateFrom(ref)
   183  	return p
   184  }
   185  
   186  // New creates a new TableDescriptor in the application heap.
   187  func (p TableDescriptor) New() js.Ref {
   188  	return bindings.TableDescriptorJSLoad(
   189  		js.Pointer(&p), js.True, 0,
   190  	)
   191  }
   192  
   193  // UpdateFrom copies value of all fields of the heap object to p.
   194  func (p *TableDescriptor) UpdateFrom(ref js.Ref) {
   195  	bindings.TableDescriptorJSStore(
   196  		js.Pointer(p), ref,
   197  	)
   198  }
   199  
   200  // Update writes all fields of the p to the heap object referenced by ref.
   201  func (p *TableDescriptor) Update(ref js.Ref) {
   202  	bindings.TableDescriptorJSLoad(
   203  		js.Pointer(p), js.False, ref,
   204  	)
   205  }
   206  
   207  // FreeMembers frees fields with heap reference, if recursive is true
   208  // free all heap references reachable from p.
   209  func (p *TableDescriptor) FreeMembers(recursive bool) {
   210  }
   211  
   212  func NewTable(descriptor TableDescriptor, value js.Any) (ret Table) {
   213  	ret.ref = bindings.NewTableByTable(
   214  		js.Pointer(&descriptor),
   215  		value.Ref())
   216  	return
   217  }
   218  
   219  func NewTableByTable1(descriptor TableDescriptor) (ret Table) {
   220  	ret.ref = bindings.NewTableByTable1(
   221  		js.Pointer(&descriptor))
   222  	return
   223  }
   224  
   225  type Table struct {
   226  	ref js.Ref
   227  }
   228  
   229  func (this Table) Once() Table {
   230  	this.ref.Once()
   231  	return this
   232  }
   233  
   234  func (this Table) Ref() js.Ref {
   235  	return this.ref
   236  }
   237  
   238  func (this Table) FromRef(ref js.Ref) Table {
   239  	this.ref = ref
   240  	return this
   241  }
   242  
   243  func (this Table) Free() {
   244  	this.ref.Free()
   245  }
   246  
   247  // Length returns the value of property "Table.length".
   248  //
   249  // It returns ok=false if there is no such property.
   250  func (this Table) Length() (ret uint32, ok bool) {
   251  	ok = js.True == bindings.GetTableLength(
   252  		this.ref, js.Pointer(&ret),
   253  	)
   254  	return
   255  }
   256  
   257  // HasFuncGrow returns true if the method "Table.grow" exists.
   258  func (this Table) HasFuncGrow() bool {
   259  	return js.True == bindings.HasFuncTableGrow(
   260  		this.ref,
   261  	)
   262  }
   263  
   264  // FuncGrow returns the method "Table.grow".
   265  func (this Table) FuncGrow() (fn js.Func[func(delta uint32, value js.Any) uint32]) {
   266  	bindings.FuncTableGrow(
   267  		this.ref, js.Pointer(&fn),
   268  	)
   269  	return
   270  }
   271  
   272  // Grow calls the method "Table.grow".
   273  func (this Table) Grow(delta uint32, value js.Any) (ret uint32) {
   274  	bindings.CallTableGrow(
   275  		this.ref, js.Pointer(&ret),
   276  		uint32(delta),
   277  		value.Ref(),
   278  	)
   279  
   280  	return
   281  }
   282  
   283  // TryGrow calls the method "Table.grow"
   284  // in a try/catch block and returns (_, err, ok = false) when it went through
   285  // the catch clause.
   286  func (this Table) TryGrow(delta uint32, value js.Any) (ret uint32, exception js.Any, ok bool) {
   287  	ok = js.True == bindings.TryTableGrow(
   288  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   289  		uint32(delta),
   290  		value.Ref(),
   291  	)
   292  
   293  	return
   294  }
   295  
   296  // HasFuncGrow1 returns true if the method "Table.grow" exists.
   297  func (this Table) HasFuncGrow1() bool {
   298  	return js.True == bindings.HasFuncTableGrow1(
   299  		this.ref,
   300  	)
   301  }
   302  
   303  // FuncGrow1 returns the method "Table.grow".
   304  func (this Table) FuncGrow1() (fn js.Func[func(delta uint32) uint32]) {
   305  	bindings.FuncTableGrow1(
   306  		this.ref, js.Pointer(&fn),
   307  	)
   308  	return
   309  }
   310  
   311  // Grow1 calls the method "Table.grow".
   312  func (this Table) Grow1(delta uint32) (ret uint32) {
   313  	bindings.CallTableGrow1(
   314  		this.ref, js.Pointer(&ret),
   315  		uint32(delta),
   316  	)
   317  
   318  	return
   319  }
   320  
   321  // TryGrow1 calls the method "Table.grow"
   322  // in a try/catch block and returns (_, err, ok = false) when it went through
   323  // the catch clause.
   324  func (this Table) TryGrow1(delta uint32) (ret uint32, exception js.Any, ok bool) {
   325  	ok = js.True == bindings.TryTableGrow1(
   326  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   327  		uint32(delta),
   328  	)
   329  
   330  	return
   331  }
   332  
   333  // HasFuncGet returns true if the method "Table.get" exists.
   334  func (this Table) HasFuncGet() bool {
   335  	return js.True == bindings.HasFuncTableGet(
   336  		this.ref,
   337  	)
   338  }
   339  
   340  // FuncGet returns the method "Table.get".
   341  func (this Table) FuncGet() (fn js.Func[func(index uint32) js.Any]) {
   342  	bindings.FuncTableGet(
   343  		this.ref, js.Pointer(&fn),
   344  	)
   345  	return
   346  }
   347  
   348  // Get calls the method "Table.get".
   349  func (this Table) Get(index uint32) (ret js.Any) {
   350  	bindings.CallTableGet(
   351  		this.ref, js.Pointer(&ret),
   352  		uint32(index),
   353  	)
   354  
   355  	return
   356  }
   357  
   358  // TryGet calls the method "Table.get"
   359  // in a try/catch block and returns (_, err, ok = false) when it went through
   360  // the catch clause.
   361  func (this Table) TryGet(index uint32) (ret js.Any, exception js.Any, ok bool) {
   362  	ok = js.True == bindings.TryTableGet(
   363  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   364  		uint32(index),
   365  	)
   366  
   367  	return
   368  }
   369  
   370  // HasFuncSet returns true if the method "Table.set" exists.
   371  func (this Table) HasFuncSet() bool {
   372  	return js.True == bindings.HasFuncTableSet(
   373  		this.ref,
   374  	)
   375  }
   376  
   377  // FuncSet returns the method "Table.set".
   378  func (this Table) FuncSet() (fn js.Func[func(index uint32, value js.Any)]) {
   379  	bindings.FuncTableSet(
   380  		this.ref, js.Pointer(&fn),
   381  	)
   382  	return
   383  }
   384  
   385  // Set calls the method "Table.set".
   386  func (this Table) Set(index uint32, value js.Any) (ret js.Void) {
   387  	bindings.CallTableSet(
   388  		this.ref, js.Pointer(&ret),
   389  		uint32(index),
   390  		value.Ref(),
   391  	)
   392  
   393  	return
   394  }
   395  
   396  // TrySet calls the method "Table.set"
   397  // in a try/catch block and returns (_, err, ok = false) when it went through
   398  // the catch clause.
   399  func (this Table) TrySet(index uint32, value js.Any) (ret js.Void, exception js.Any, ok bool) {
   400  	ok = js.True == bindings.TryTableSet(
   401  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   402  		uint32(index),
   403  		value.Ref(),
   404  	)
   405  
   406  	return
   407  }
   408  
   409  // HasFuncSet1 returns true if the method "Table.set" exists.
   410  func (this Table) HasFuncSet1() bool {
   411  	return js.True == bindings.HasFuncTableSet1(
   412  		this.ref,
   413  	)
   414  }
   415  
   416  // FuncSet1 returns the method "Table.set".
   417  func (this Table) FuncSet1() (fn js.Func[func(index uint32)]) {
   418  	bindings.FuncTableSet1(
   419  		this.ref, js.Pointer(&fn),
   420  	)
   421  	return
   422  }
   423  
   424  // Set1 calls the method "Table.set".
   425  func (this Table) Set1(index uint32) (ret js.Void) {
   426  	bindings.CallTableSet1(
   427  		this.ref, js.Pointer(&ret),
   428  		uint32(index),
   429  	)
   430  
   431  	return
   432  }
   433  
   434  // TrySet1 calls the method "Table.set"
   435  // in a try/catch block and returns (_, err, ok = false) when it went through
   436  // the catch clause.
   437  func (this Table) TrySet1(index uint32) (ret js.Void, exception js.Any, ok bool) {
   438  	ok = js.True == bindings.TryTableSet1(
   439  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   440  		uint32(index),
   441  	)
   442  
   443  	return
   444  }
   445  
   446  type TaskControllerInit struct {
   447  	// Priority is "TaskControllerInit.priority"
   448  	//
   449  	// Optional, defaults to "user-visible".
   450  	Priority TaskPriority
   451  
   452  	FFI_USE bool
   453  }
   454  
   455  // FromRef calls UpdateFrom and returns a TaskControllerInit with all fields set.
   456  func (p TaskControllerInit) FromRef(ref js.Ref) TaskControllerInit {
   457  	p.UpdateFrom(ref)
   458  	return p
   459  }
   460  
   461  // New creates a new TaskControllerInit in the application heap.
   462  func (p TaskControllerInit) New() js.Ref {
   463  	return bindings.TaskControllerInitJSLoad(
   464  		js.Pointer(&p), js.True, 0,
   465  	)
   466  }
   467  
   468  // UpdateFrom copies value of all fields of the heap object to p.
   469  func (p *TaskControllerInit) UpdateFrom(ref js.Ref) {
   470  	bindings.TaskControllerInitJSStore(
   471  		js.Pointer(p), ref,
   472  	)
   473  }
   474  
   475  // Update writes all fields of the p to the heap object referenced by ref.
   476  func (p *TaskControllerInit) Update(ref js.Ref) {
   477  	bindings.TaskControllerInitJSLoad(
   478  		js.Pointer(p), js.False, ref,
   479  	)
   480  }
   481  
   482  // FreeMembers frees fields with heap reference, if recursive is true
   483  // free all heap references reachable from p.
   484  func (p *TaskControllerInit) FreeMembers(recursive bool) {
   485  }
   486  
   487  func NewTaskController(init TaskControllerInit) (ret TaskController) {
   488  	ret.ref = bindings.NewTaskControllerByTaskController(
   489  		js.Pointer(&init))
   490  	return
   491  }
   492  
   493  func NewTaskControllerByTaskController1() (ret TaskController) {
   494  	ret.ref = bindings.NewTaskControllerByTaskController1()
   495  	return
   496  }
   497  
   498  type TaskController struct {
   499  	AbortController
   500  }
   501  
   502  func (this TaskController) Once() TaskController {
   503  	this.ref.Once()
   504  	return this
   505  }
   506  
   507  func (this TaskController) Ref() js.Ref {
   508  	return this.AbortController.Ref()
   509  }
   510  
   511  func (this TaskController) FromRef(ref js.Ref) TaskController {
   512  	this.AbortController = this.AbortController.FromRef(ref)
   513  	return this
   514  }
   515  
   516  func (this TaskController) Free() {
   517  	this.ref.Free()
   518  }
   519  
   520  // HasFuncSetPriority returns true if the method "TaskController.setPriority" exists.
   521  func (this TaskController) HasFuncSetPriority() bool {
   522  	return js.True == bindings.HasFuncTaskControllerSetPriority(
   523  		this.ref,
   524  	)
   525  }
   526  
   527  // FuncSetPriority returns the method "TaskController.setPriority".
   528  func (this TaskController) FuncSetPriority() (fn js.Func[func(priority TaskPriority)]) {
   529  	bindings.FuncTaskControllerSetPriority(
   530  		this.ref, js.Pointer(&fn),
   531  	)
   532  	return
   533  }
   534  
   535  // SetPriority calls the method "TaskController.setPriority".
   536  func (this TaskController) SetPriority(priority TaskPriority) (ret js.Void) {
   537  	bindings.CallTaskControllerSetPriority(
   538  		this.ref, js.Pointer(&ret),
   539  		uint32(priority),
   540  	)
   541  
   542  	return
   543  }
   544  
   545  // TrySetPriority calls the method "TaskController.setPriority"
   546  // in a try/catch block and returns (_, err, ok = false) when it went through
   547  // the catch clause.
   548  func (this TaskController) TrySetPriority(priority TaskPriority) (ret js.Void, exception js.Any, ok bool) {
   549  	ok = js.True == bindings.TryTaskControllerSetPriority(
   550  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   551  		uint32(priority),
   552  	)
   553  
   554  	return
   555  }
   556  
   557  type TaskPriorityChangeEventInit struct {
   558  	// PreviousPriority is "TaskPriorityChangeEventInit.previousPriority"
   559  	//
   560  	// Required
   561  	PreviousPriority TaskPriority
   562  	// Bubbles is "TaskPriorityChangeEventInit.bubbles"
   563  	//
   564  	// Optional, defaults to false.
   565  	//
   566  	// NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective.
   567  	Bubbles bool
   568  	// Cancelable is "TaskPriorityChangeEventInit.cancelable"
   569  	//
   570  	// Optional, defaults to false.
   571  	//
   572  	// NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective.
   573  	Cancelable bool
   574  	// Composed is "TaskPriorityChangeEventInit.composed"
   575  	//
   576  	// Optional, defaults to false.
   577  	//
   578  	// NOTE: FFI_USE_Composed MUST be set to true to make this field effective.
   579  	Composed bool
   580  
   581  	FFI_USE_Bubbles    bool // for Bubbles.
   582  	FFI_USE_Cancelable bool // for Cancelable.
   583  	FFI_USE_Composed   bool // for Composed.
   584  
   585  	FFI_USE bool
   586  }
   587  
   588  // FromRef calls UpdateFrom and returns a TaskPriorityChangeEventInit with all fields set.
   589  func (p TaskPriorityChangeEventInit) FromRef(ref js.Ref) TaskPriorityChangeEventInit {
   590  	p.UpdateFrom(ref)
   591  	return p
   592  }
   593  
   594  // New creates a new TaskPriorityChangeEventInit in the application heap.
   595  func (p TaskPriorityChangeEventInit) New() js.Ref {
   596  	return bindings.TaskPriorityChangeEventInitJSLoad(
   597  		js.Pointer(&p), js.True, 0,
   598  	)
   599  }
   600  
   601  // UpdateFrom copies value of all fields of the heap object to p.
   602  func (p *TaskPriorityChangeEventInit) UpdateFrom(ref js.Ref) {
   603  	bindings.TaskPriorityChangeEventInitJSStore(
   604  		js.Pointer(p), ref,
   605  	)
   606  }
   607  
   608  // Update writes all fields of the p to the heap object referenced by ref.
   609  func (p *TaskPriorityChangeEventInit) Update(ref js.Ref) {
   610  	bindings.TaskPriorityChangeEventInitJSLoad(
   611  		js.Pointer(p), js.False, ref,
   612  	)
   613  }
   614  
   615  // FreeMembers frees fields with heap reference, if recursive is true
   616  // free all heap references reachable from p.
   617  func (p *TaskPriorityChangeEventInit) FreeMembers(recursive bool) {
   618  }
   619  
   620  func NewTaskPriorityChangeEvent(typ js.String, priorityChangeEventInitDict TaskPriorityChangeEventInit) (ret TaskPriorityChangeEvent) {
   621  	ret.ref = bindings.NewTaskPriorityChangeEventByTaskPriorityChangeEvent(
   622  		typ.Ref(),
   623  		js.Pointer(&priorityChangeEventInitDict))
   624  	return
   625  }
   626  
   627  type TaskPriorityChangeEvent struct {
   628  	Event
   629  }
   630  
   631  func (this TaskPriorityChangeEvent) Once() TaskPriorityChangeEvent {
   632  	this.ref.Once()
   633  	return this
   634  }
   635  
   636  func (this TaskPriorityChangeEvent) Ref() js.Ref {
   637  	return this.Event.Ref()
   638  }
   639  
   640  func (this TaskPriorityChangeEvent) FromRef(ref js.Ref) TaskPriorityChangeEvent {
   641  	this.Event = this.Event.FromRef(ref)
   642  	return this
   643  }
   644  
   645  func (this TaskPriorityChangeEvent) Free() {
   646  	this.ref.Free()
   647  }
   648  
   649  // PreviousPriority returns the value of property "TaskPriorityChangeEvent.previousPriority".
   650  //
   651  // It returns ok=false if there is no such property.
   652  func (this TaskPriorityChangeEvent) PreviousPriority() (ret TaskPriority, ok bool) {
   653  	ok = js.True == bindings.GetTaskPriorityChangeEventPreviousPriority(
   654  		this.ref, js.Pointer(&ret),
   655  	)
   656  	return
   657  }
   658  
   659  type OneOf_TaskPriority_TaskSignal struct {
   660  	ref js.Ref
   661  }
   662  
   663  func (x OneOf_TaskPriority_TaskSignal) Ref() js.Ref {
   664  	return x.ref
   665  }
   666  
   667  func (x OneOf_TaskPriority_TaskSignal) Free() {
   668  	x.ref.Free()
   669  }
   670  
   671  func (x OneOf_TaskPriority_TaskSignal) FromRef(ref js.Ref) OneOf_TaskPriority_TaskSignal {
   672  	return OneOf_TaskPriority_TaskSignal{
   673  		ref: ref,
   674  	}
   675  }
   676  
   677  func (x OneOf_TaskPriority_TaskSignal) TaskPriority() TaskPriority {
   678  	return TaskPriority(0).FromRef(x.ref)
   679  }
   680  
   681  func (x OneOf_TaskPriority_TaskSignal) TaskSignal() TaskSignal {
   682  	return TaskSignal{}.FromRef(x.ref)
   683  }
   684  
   685  type TaskSignalAnyInit struct {
   686  	// Priority is "TaskSignalAnyInit.priority"
   687  	//
   688  	// Optional, defaults to "user-visible".
   689  	Priority OneOf_TaskPriority_TaskSignal
   690  
   691  	FFI_USE bool
   692  }
   693  
   694  // FromRef calls UpdateFrom and returns a TaskSignalAnyInit with all fields set.
   695  func (p TaskSignalAnyInit) FromRef(ref js.Ref) TaskSignalAnyInit {
   696  	p.UpdateFrom(ref)
   697  	return p
   698  }
   699  
   700  // New creates a new TaskSignalAnyInit in the application heap.
   701  func (p TaskSignalAnyInit) New() js.Ref {
   702  	return bindings.TaskSignalAnyInitJSLoad(
   703  		js.Pointer(&p), js.True, 0,
   704  	)
   705  }
   706  
   707  // UpdateFrom copies value of all fields of the heap object to p.
   708  func (p *TaskSignalAnyInit) UpdateFrom(ref js.Ref) {
   709  	bindings.TaskSignalAnyInitJSStore(
   710  		js.Pointer(p), ref,
   711  	)
   712  }
   713  
   714  // Update writes all fields of the p to the heap object referenced by ref.
   715  func (p *TaskSignalAnyInit) Update(ref js.Ref) {
   716  	bindings.TaskSignalAnyInitJSLoad(
   717  		js.Pointer(p), js.False, ref,
   718  	)
   719  }
   720  
   721  // FreeMembers frees fields with heap reference, if recursive is true
   722  // free all heap references reachable from p.
   723  func (p *TaskSignalAnyInit) FreeMembers(recursive bool) {
   724  	js.Free(
   725  		p.Priority.Ref(),
   726  	)
   727  	p.Priority = p.Priority.FromRef(js.Undefined)
   728  }
   729  
   730  type TaskSignal struct {
   731  	AbortSignal
   732  }
   733  
   734  func (this TaskSignal) Once() TaskSignal {
   735  	this.ref.Once()
   736  	return this
   737  }
   738  
   739  func (this TaskSignal) Ref() js.Ref {
   740  	return this.AbortSignal.Ref()
   741  }
   742  
   743  func (this TaskSignal) FromRef(ref js.Ref) TaskSignal {
   744  	this.AbortSignal = this.AbortSignal.FromRef(ref)
   745  	return this
   746  }
   747  
   748  func (this TaskSignal) Free() {
   749  	this.ref.Free()
   750  }
   751  
   752  // Priority returns the value of property "TaskSignal.priority".
   753  //
   754  // It returns ok=false if there is no such property.
   755  func (this TaskSignal) Priority() (ret TaskPriority, ok bool) {
   756  	ok = js.True == bindings.GetTaskSignalPriority(
   757  		this.ref, js.Pointer(&ret),
   758  	)
   759  	return
   760  }
   761  
   762  // HasFuncAny returns true if the static method "TaskSignal.any" exists.
   763  func (this TaskSignal) HasFuncAny() bool {
   764  	return js.True == bindings.HasFuncTaskSignalAny(
   765  		this.ref,
   766  	)
   767  }
   768  
   769  // FuncAny returns the static method "TaskSignal.any".
   770  func (this TaskSignal) FuncAny() (fn js.Func[func(signals js.Array[AbortSignal], init TaskSignalAnyInit) TaskSignal]) {
   771  	bindings.FuncTaskSignalAny(
   772  		this.ref, js.Pointer(&fn),
   773  	)
   774  	return
   775  }
   776  
   777  // Any calls the static method "TaskSignal.any".
   778  func (this TaskSignal) Any(signals js.Array[AbortSignal], init TaskSignalAnyInit) (ret TaskSignal) {
   779  	bindings.CallTaskSignalAny(
   780  		this.ref, js.Pointer(&ret),
   781  		signals.Ref(),
   782  		js.Pointer(&init),
   783  	)
   784  
   785  	return
   786  }
   787  
   788  // TryAny calls the static method "TaskSignal.any"
   789  // in a try/catch block and returns (_, err, ok = false) when it went through
   790  // the catch clause.
   791  func (this TaskSignal) TryAny(signals js.Array[AbortSignal], init TaskSignalAnyInit) (ret TaskSignal, exception js.Any, ok bool) {
   792  	ok = js.True == bindings.TryTaskSignalAny(
   793  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   794  		signals.Ref(),
   795  		js.Pointer(&init),
   796  	)
   797  
   798  	return
   799  }
   800  
   801  // HasFuncAny1 returns true if the static method "TaskSignal.any" exists.
   802  func (this TaskSignal) HasFuncAny1() bool {
   803  	return js.True == bindings.HasFuncTaskSignalAny1(
   804  		this.ref,
   805  	)
   806  }
   807  
   808  // FuncAny1 returns the static method "TaskSignal.any".
   809  func (this TaskSignal) FuncAny1() (fn js.Func[func(signals js.Array[AbortSignal]) TaskSignal]) {
   810  	bindings.FuncTaskSignalAny1(
   811  		this.ref, js.Pointer(&fn),
   812  	)
   813  	return
   814  }
   815  
   816  // Any1 calls the static method "TaskSignal.any".
   817  func (this TaskSignal) Any1(signals js.Array[AbortSignal]) (ret TaskSignal) {
   818  	bindings.CallTaskSignalAny1(
   819  		this.ref, js.Pointer(&ret),
   820  		signals.Ref(),
   821  	)
   822  
   823  	return
   824  }
   825  
   826  // TryAny1 calls the static method "TaskSignal.any"
   827  // in a try/catch block and returns (_, err, ok = false) when it went through
   828  // the catch clause.
   829  func (this TaskSignal) TryAny1(signals js.Array[AbortSignal]) (ret TaskSignal, exception js.Any, ok bool) {
   830  	ok = js.True == bindings.TryTaskSignalAny1(
   831  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   832  		signals.Ref(),
   833  	)
   834  
   835  	return
   836  }
   837  
   838  type TestUtils struct{}
   839  
   840  // HasFuncGc returns ture if the function "TestUtils.gc" exists.
   841  func (TestUtils) HasFuncGc() bool {
   842  	return js.True == bindings.HasFuncTestUtilsGc()
   843  }
   844  
   845  // FuncGc returns the function "TestUtils.gc".
   846  func (TestUtils) FuncGc() (fn js.Func[func() js.Promise[js.Void]]) {
   847  	bindings.FuncTestUtilsGc(
   848  		js.Pointer(&fn),
   849  	)
   850  	return
   851  }
   852  
   853  // Gc calls the function "TestUtils.gc".
   854  func (TestUtils) Gc() (ret js.Promise[js.Void]) {
   855  	bindings.CallTestUtilsGc(
   856  		js.Pointer(&ret),
   857  	)
   858  	return
   859  }
   860  
   861  // TryGc calls the function "TestUtils.gc"
   862  // in a try/catch block and returns (_, err, ok = true) when it went through
   863  // the catch clause.
   864  func (TestUtils) TryGc() (ret js.Promise[js.Void], exception js.Any, ok bool) {
   865  	ok = js.True == bindings.TryTestUtilsGc(
   866  		js.Pointer(&ret), js.Pointer(&exception),
   867  	)
   868  	return
   869  }
   870  
   871  type TextDecodeOptions struct {
   872  	// Stream is "TextDecodeOptions.stream"
   873  	//
   874  	// Optional, defaults to false.
   875  	//
   876  	// NOTE: FFI_USE_Stream MUST be set to true to make this field effective.
   877  	Stream bool
   878  
   879  	FFI_USE_Stream bool // for Stream.
   880  
   881  	FFI_USE bool
   882  }
   883  
   884  // FromRef calls UpdateFrom and returns a TextDecodeOptions with all fields set.
   885  func (p TextDecodeOptions) FromRef(ref js.Ref) TextDecodeOptions {
   886  	p.UpdateFrom(ref)
   887  	return p
   888  }
   889  
   890  // New creates a new TextDecodeOptions in the application heap.
   891  func (p TextDecodeOptions) New() js.Ref {
   892  	return bindings.TextDecodeOptionsJSLoad(
   893  		js.Pointer(&p), js.True, 0,
   894  	)
   895  }
   896  
   897  // UpdateFrom copies value of all fields of the heap object to p.
   898  func (p *TextDecodeOptions) UpdateFrom(ref js.Ref) {
   899  	bindings.TextDecodeOptionsJSStore(
   900  		js.Pointer(p), ref,
   901  	)
   902  }
   903  
   904  // Update writes all fields of the p to the heap object referenced by ref.
   905  func (p *TextDecodeOptions) Update(ref js.Ref) {
   906  	bindings.TextDecodeOptionsJSLoad(
   907  		js.Pointer(p), js.False, ref,
   908  	)
   909  }
   910  
   911  // FreeMembers frees fields with heap reference, if recursive is true
   912  // free all heap references reachable from p.
   913  func (p *TextDecodeOptions) FreeMembers(recursive bool) {
   914  }
   915  
   916  type TextDecoderOptions struct {
   917  	// Fatal is "TextDecoderOptions.fatal"
   918  	//
   919  	// Optional, defaults to false.
   920  	//
   921  	// NOTE: FFI_USE_Fatal MUST be set to true to make this field effective.
   922  	Fatal bool
   923  	// IgnoreBOM is "TextDecoderOptions.ignoreBOM"
   924  	//
   925  	// Optional, defaults to false.
   926  	//
   927  	// NOTE: FFI_USE_IgnoreBOM MUST be set to true to make this field effective.
   928  	IgnoreBOM bool
   929  
   930  	FFI_USE_Fatal     bool // for Fatal.
   931  	FFI_USE_IgnoreBOM bool // for IgnoreBOM.
   932  
   933  	FFI_USE bool
   934  }
   935  
   936  // FromRef calls UpdateFrom and returns a TextDecoderOptions with all fields set.
   937  func (p TextDecoderOptions) FromRef(ref js.Ref) TextDecoderOptions {
   938  	p.UpdateFrom(ref)
   939  	return p
   940  }
   941  
   942  // New creates a new TextDecoderOptions in the application heap.
   943  func (p TextDecoderOptions) New() js.Ref {
   944  	return bindings.TextDecoderOptionsJSLoad(
   945  		js.Pointer(&p), js.True, 0,
   946  	)
   947  }
   948  
   949  // UpdateFrom copies value of all fields of the heap object to p.
   950  func (p *TextDecoderOptions) UpdateFrom(ref js.Ref) {
   951  	bindings.TextDecoderOptionsJSStore(
   952  		js.Pointer(p), ref,
   953  	)
   954  }
   955  
   956  // Update writes all fields of the p to the heap object referenced by ref.
   957  func (p *TextDecoderOptions) Update(ref js.Ref) {
   958  	bindings.TextDecoderOptionsJSLoad(
   959  		js.Pointer(p), js.False, ref,
   960  	)
   961  }
   962  
   963  // FreeMembers frees fields with heap reference, if recursive is true
   964  // free all heap references reachable from p.
   965  func (p *TextDecoderOptions) FreeMembers(recursive bool) {
   966  }
   967  
   968  func NewTextDecoder(label js.String, options TextDecoderOptions) (ret TextDecoder) {
   969  	ret.ref = bindings.NewTextDecoderByTextDecoder(
   970  		label.Ref(),
   971  		js.Pointer(&options))
   972  	return
   973  }
   974  
   975  func NewTextDecoderByTextDecoder1(label js.String) (ret TextDecoder) {
   976  	ret.ref = bindings.NewTextDecoderByTextDecoder1(
   977  		label.Ref())
   978  	return
   979  }
   980  
   981  func NewTextDecoderByTextDecoder2() (ret TextDecoder) {
   982  	ret.ref = bindings.NewTextDecoderByTextDecoder2()
   983  	return
   984  }
   985  
   986  type TextDecoder struct {
   987  	ref js.Ref
   988  }
   989  
   990  func (this TextDecoder) Once() TextDecoder {
   991  	this.ref.Once()
   992  	return this
   993  }
   994  
   995  func (this TextDecoder) Ref() js.Ref {
   996  	return this.ref
   997  }
   998  
   999  func (this TextDecoder) FromRef(ref js.Ref) TextDecoder {
  1000  	this.ref = ref
  1001  	return this
  1002  }
  1003  
  1004  func (this TextDecoder) Free() {
  1005  	this.ref.Free()
  1006  }
  1007  
  1008  // Encoding returns the value of property "TextDecoder.encoding".
  1009  //
  1010  // It returns ok=false if there is no such property.
  1011  func (this TextDecoder) Encoding() (ret js.String, ok bool) {
  1012  	ok = js.True == bindings.GetTextDecoderEncoding(
  1013  		this.ref, js.Pointer(&ret),
  1014  	)
  1015  	return
  1016  }
  1017  
  1018  // Fatal returns the value of property "TextDecoder.fatal".
  1019  //
  1020  // It returns ok=false if there is no such property.
  1021  func (this TextDecoder) Fatal() (ret bool, ok bool) {
  1022  	ok = js.True == bindings.GetTextDecoderFatal(
  1023  		this.ref, js.Pointer(&ret),
  1024  	)
  1025  	return
  1026  }
  1027  
  1028  // IgnoreBOM returns the value of property "TextDecoder.ignoreBOM".
  1029  //
  1030  // It returns ok=false if there is no such property.
  1031  func (this TextDecoder) IgnoreBOM() (ret bool, ok bool) {
  1032  	ok = js.True == bindings.GetTextDecoderIgnoreBOM(
  1033  		this.ref, js.Pointer(&ret),
  1034  	)
  1035  	return
  1036  }
  1037  
  1038  // HasFuncDecode returns true if the method "TextDecoder.decode" exists.
  1039  func (this TextDecoder) HasFuncDecode() bool {
  1040  	return js.True == bindings.HasFuncTextDecoderDecode(
  1041  		this.ref,
  1042  	)
  1043  }
  1044  
  1045  // FuncDecode returns the method "TextDecoder.decode".
  1046  func (this TextDecoder) FuncDecode() (fn js.Func[func(input AllowSharedBufferSource, options TextDecodeOptions) js.String]) {
  1047  	bindings.FuncTextDecoderDecode(
  1048  		this.ref, js.Pointer(&fn),
  1049  	)
  1050  	return
  1051  }
  1052  
  1053  // Decode calls the method "TextDecoder.decode".
  1054  func (this TextDecoder) Decode(input AllowSharedBufferSource, options TextDecodeOptions) (ret js.String) {
  1055  	bindings.CallTextDecoderDecode(
  1056  		this.ref, js.Pointer(&ret),
  1057  		input.Ref(),
  1058  		js.Pointer(&options),
  1059  	)
  1060  
  1061  	return
  1062  }
  1063  
  1064  // TryDecode calls the method "TextDecoder.decode"
  1065  // in a try/catch block and returns (_, err, ok = false) when it went through
  1066  // the catch clause.
  1067  func (this TextDecoder) TryDecode(input AllowSharedBufferSource, options TextDecodeOptions) (ret js.String, exception js.Any, ok bool) {
  1068  	ok = js.True == bindings.TryTextDecoderDecode(
  1069  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1070  		input.Ref(),
  1071  		js.Pointer(&options),
  1072  	)
  1073  
  1074  	return
  1075  }
  1076  
  1077  // HasFuncDecode1 returns true if the method "TextDecoder.decode" exists.
  1078  func (this TextDecoder) HasFuncDecode1() bool {
  1079  	return js.True == bindings.HasFuncTextDecoderDecode1(
  1080  		this.ref,
  1081  	)
  1082  }
  1083  
  1084  // FuncDecode1 returns the method "TextDecoder.decode".
  1085  func (this TextDecoder) FuncDecode1() (fn js.Func[func(input AllowSharedBufferSource) js.String]) {
  1086  	bindings.FuncTextDecoderDecode1(
  1087  		this.ref, js.Pointer(&fn),
  1088  	)
  1089  	return
  1090  }
  1091  
  1092  // Decode1 calls the method "TextDecoder.decode".
  1093  func (this TextDecoder) Decode1(input AllowSharedBufferSource) (ret js.String) {
  1094  	bindings.CallTextDecoderDecode1(
  1095  		this.ref, js.Pointer(&ret),
  1096  		input.Ref(),
  1097  	)
  1098  
  1099  	return
  1100  }
  1101  
  1102  // TryDecode1 calls the method "TextDecoder.decode"
  1103  // in a try/catch block and returns (_, err, ok = false) when it went through
  1104  // the catch clause.
  1105  func (this TextDecoder) TryDecode1(input AllowSharedBufferSource) (ret js.String, exception js.Any, ok bool) {
  1106  	ok = js.True == bindings.TryTextDecoderDecode1(
  1107  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1108  		input.Ref(),
  1109  	)
  1110  
  1111  	return
  1112  }
  1113  
  1114  // HasFuncDecode2 returns true if the method "TextDecoder.decode" exists.
  1115  func (this TextDecoder) HasFuncDecode2() bool {
  1116  	return js.True == bindings.HasFuncTextDecoderDecode2(
  1117  		this.ref,
  1118  	)
  1119  }
  1120  
  1121  // FuncDecode2 returns the method "TextDecoder.decode".
  1122  func (this TextDecoder) FuncDecode2() (fn js.Func[func() js.String]) {
  1123  	bindings.FuncTextDecoderDecode2(
  1124  		this.ref, js.Pointer(&fn),
  1125  	)
  1126  	return
  1127  }
  1128  
  1129  // Decode2 calls the method "TextDecoder.decode".
  1130  func (this TextDecoder) Decode2() (ret js.String) {
  1131  	bindings.CallTextDecoderDecode2(
  1132  		this.ref, js.Pointer(&ret),
  1133  	)
  1134  
  1135  	return
  1136  }
  1137  
  1138  // TryDecode2 calls the method "TextDecoder.decode"
  1139  // in a try/catch block and returns (_, err, ok = false) when it went through
  1140  // the catch clause.
  1141  func (this TextDecoder) TryDecode2() (ret js.String, exception js.Any, ok bool) {
  1142  	ok = js.True == bindings.TryTextDecoderDecode2(
  1143  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1144  	)
  1145  
  1146  	return
  1147  }
  1148  
  1149  func NewTextDecoderStream(label js.String, options TextDecoderOptions) (ret TextDecoderStream) {
  1150  	ret.ref = bindings.NewTextDecoderStreamByTextDecoderStream(
  1151  		label.Ref(),
  1152  		js.Pointer(&options))
  1153  	return
  1154  }
  1155  
  1156  func NewTextDecoderStreamByTextDecoderStream1(label js.String) (ret TextDecoderStream) {
  1157  	ret.ref = bindings.NewTextDecoderStreamByTextDecoderStream1(
  1158  		label.Ref())
  1159  	return
  1160  }
  1161  
  1162  func NewTextDecoderStreamByTextDecoderStream2() (ret TextDecoderStream) {
  1163  	ret.ref = bindings.NewTextDecoderStreamByTextDecoderStream2()
  1164  	return
  1165  }
  1166  
  1167  type TextDecoderStream struct {
  1168  	ref js.Ref
  1169  }
  1170  
  1171  func (this TextDecoderStream) Once() TextDecoderStream {
  1172  	this.ref.Once()
  1173  	return this
  1174  }
  1175  
  1176  func (this TextDecoderStream) Ref() js.Ref {
  1177  	return this.ref
  1178  }
  1179  
  1180  func (this TextDecoderStream) FromRef(ref js.Ref) TextDecoderStream {
  1181  	this.ref = ref
  1182  	return this
  1183  }
  1184  
  1185  func (this TextDecoderStream) Free() {
  1186  	this.ref.Free()
  1187  }
  1188  
  1189  // Encoding returns the value of property "TextDecoderStream.encoding".
  1190  //
  1191  // It returns ok=false if there is no such property.
  1192  func (this TextDecoderStream) Encoding() (ret js.String, ok bool) {
  1193  	ok = js.True == bindings.GetTextDecoderStreamEncoding(
  1194  		this.ref, js.Pointer(&ret),
  1195  	)
  1196  	return
  1197  }
  1198  
  1199  // Fatal returns the value of property "TextDecoderStream.fatal".
  1200  //
  1201  // It returns ok=false if there is no such property.
  1202  func (this TextDecoderStream) Fatal() (ret bool, ok bool) {
  1203  	ok = js.True == bindings.GetTextDecoderStreamFatal(
  1204  		this.ref, js.Pointer(&ret),
  1205  	)
  1206  	return
  1207  }
  1208  
  1209  // IgnoreBOM returns the value of property "TextDecoderStream.ignoreBOM".
  1210  //
  1211  // It returns ok=false if there is no such property.
  1212  func (this TextDecoderStream) IgnoreBOM() (ret bool, ok bool) {
  1213  	ok = js.True == bindings.GetTextDecoderStreamIgnoreBOM(
  1214  		this.ref, js.Pointer(&ret),
  1215  	)
  1216  	return
  1217  }
  1218  
  1219  // Readable returns the value of property "TextDecoderStream.readable".
  1220  //
  1221  // It returns ok=false if there is no such property.
  1222  func (this TextDecoderStream) Readable() (ret ReadableStream, ok bool) {
  1223  	ok = js.True == bindings.GetTextDecoderStreamReadable(
  1224  		this.ref, js.Pointer(&ret),
  1225  	)
  1226  	return
  1227  }
  1228  
  1229  // Writable returns the value of property "TextDecoderStream.writable".
  1230  //
  1231  // It returns ok=false if there is no such property.
  1232  func (this TextDecoderStream) Writable() (ret WritableStream, ok bool) {
  1233  	ok = js.True == bindings.GetTextDecoderStreamWritable(
  1234  		this.ref, js.Pointer(&ret),
  1235  	)
  1236  	return
  1237  }
  1238  
  1239  type TextDetector struct {
  1240  	ref js.Ref
  1241  }
  1242  
  1243  func (this TextDetector) Once() TextDetector {
  1244  	this.ref.Once()
  1245  	return this
  1246  }
  1247  
  1248  func (this TextDetector) Ref() js.Ref {
  1249  	return this.ref
  1250  }
  1251  
  1252  func (this TextDetector) FromRef(ref js.Ref) TextDetector {
  1253  	this.ref = ref
  1254  	return this
  1255  }
  1256  
  1257  func (this TextDetector) Free() {
  1258  	this.ref.Free()
  1259  }
  1260  
  1261  // HasFuncDetect returns true if the method "TextDetector.detect" exists.
  1262  func (this TextDetector) HasFuncDetect() bool {
  1263  	return js.True == bindings.HasFuncTextDetectorDetect(
  1264  		this.ref,
  1265  	)
  1266  }
  1267  
  1268  // FuncDetect returns the method "TextDetector.detect".
  1269  func (this TextDetector) FuncDetect() (fn js.Func[func(image ImageBitmapSource) js.Promise[js.Array[DetectedText]]]) {
  1270  	bindings.FuncTextDetectorDetect(
  1271  		this.ref, js.Pointer(&fn),
  1272  	)
  1273  	return
  1274  }
  1275  
  1276  // Detect calls the method "TextDetector.detect".
  1277  func (this TextDetector) Detect(image ImageBitmapSource) (ret js.Promise[js.Array[DetectedText]]) {
  1278  	bindings.CallTextDetectorDetect(
  1279  		this.ref, js.Pointer(&ret),
  1280  		image.Ref(),
  1281  	)
  1282  
  1283  	return
  1284  }
  1285  
  1286  // TryDetect calls the method "TextDetector.detect"
  1287  // in a try/catch block and returns (_, err, ok = false) when it went through
  1288  // the catch clause.
  1289  func (this TextDetector) TryDetect(image ImageBitmapSource) (ret js.Promise[js.Array[DetectedText]], exception js.Any, ok bool) {
  1290  	ok = js.True == bindings.TryTextDetectorDetect(
  1291  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1292  		image.Ref(),
  1293  	)
  1294  
  1295  	return
  1296  }
  1297  
  1298  type TextEncoderEncodeIntoResult struct {
  1299  	// Read is "TextEncoderEncodeIntoResult.read"
  1300  	//
  1301  	// Optional
  1302  	//
  1303  	// NOTE: FFI_USE_Read MUST be set to true to make this field effective.
  1304  	Read uint64
  1305  	// Written is "TextEncoderEncodeIntoResult.written"
  1306  	//
  1307  	// Optional
  1308  	//
  1309  	// NOTE: FFI_USE_Written MUST be set to true to make this field effective.
  1310  	Written uint64
  1311  
  1312  	FFI_USE_Read    bool // for Read.
  1313  	FFI_USE_Written bool // for Written.
  1314  
  1315  	FFI_USE bool
  1316  }
  1317  
  1318  // FromRef calls UpdateFrom and returns a TextEncoderEncodeIntoResult with all fields set.
  1319  func (p TextEncoderEncodeIntoResult) FromRef(ref js.Ref) TextEncoderEncodeIntoResult {
  1320  	p.UpdateFrom(ref)
  1321  	return p
  1322  }
  1323  
  1324  // New creates a new TextEncoderEncodeIntoResult in the application heap.
  1325  func (p TextEncoderEncodeIntoResult) New() js.Ref {
  1326  	return bindings.TextEncoderEncodeIntoResultJSLoad(
  1327  		js.Pointer(&p), js.True, 0,
  1328  	)
  1329  }
  1330  
  1331  // UpdateFrom copies value of all fields of the heap object to p.
  1332  func (p *TextEncoderEncodeIntoResult) UpdateFrom(ref js.Ref) {
  1333  	bindings.TextEncoderEncodeIntoResultJSStore(
  1334  		js.Pointer(p), ref,
  1335  	)
  1336  }
  1337  
  1338  // Update writes all fields of the p to the heap object referenced by ref.
  1339  func (p *TextEncoderEncodeIntoResult) Update(ref js.Ref) {
  1340  	bindings.TextEncoderEncodeIntoResultJSLoad(
  1341  		js.Pointer(p), js.False, ref,
  1342  	)
  1343  }
  1344  
  1345  // FreeMembers frees fields with heap reference, if recursive is true
  1346  // free all heap references reachable from p.
  1347  func (p *TextEncoderEncodeIntoResult) FreeMembers(recursive bool) {
  1348  }
  1349  
  1350  type TextEncoder struct {
  1351  	ref js.Ref
  1352  }
  1353  
  1354  func (this TextEncoder) Once() TextEncoder {
  1355  	this.ref.Once()
  1356  	return this
  1357  }
  1358  
  1359  func (this TextEncoder) Ref() js.Ref {
  1360  	return this.ref
  1361  }
  1362  
  1363  func (this TextEncoder) FromRef(ref js.Ref) TextEncoder {
  1364  	this.ref = ref
  1365  	return this
  1366  }
  1367  
  1368  func (this TextEncoder) Free() {
  1369  	this.ref.Free()
  1370  }
  1371  
  1372  // Encoding returns the value of property "TextEncoder.encoding".
  1373  //
  1374  // It returns ok=false if there is no such property.
  1375  func (this TextEncoder) Encoding() (ret js.String, ok bool) {
  1376  	ok = js.True == bindings.GetTextEncoderEncoding(
  1377  		this.ref, js.Pointer(&ret),
  1378  	)
  1379  	return
  1380  }
  1381  
  1382  // HasFuncEncode returns true if the method "TextEncoder.encode" exists.
  1383  func (this TextEncoder) HasFuncEncode() bool {
  1384  	return js.True == bindings.HasFuncTextEncoderEncode(
  1385  		this.ref,
  1386  	)
  1387  }
  1388  
  1389  // FuncEncode returns the method "TextEncoder.encode".
  1390  func (this TextEncoder) FuncEncode() (fn js.Func[func(input js.String) js.TypedArray[uint8]]) {
  1391  	bindings.FuncTextEncoderEncode(
  1392  		this.ref, js.Pointer(&fn),
  1393  	)
  1394  	return
  1395  }
  1396  
  1397  // Encode calls the method "TextEncoder.encode".
  1398  func (this TextEncoder) Encode(input js.String) (ret js.TypedArray[uint8]) {
  1399  	bindings.CallTextEncoderEncode(
  1400  		this.ref, js.Pointer(&ret),
  1401  		input.Ref(),
  1402  	)
  1403  
  1404  	return
  1405  }
  1406  
  1407  // TryEncode calls the method "TextEncoder.encode"
  1408  // in a try/catch block and returns (_, err, ok = false) when it went through
  1409  // the catch clause.
  1410  func (this TextEncoder) TryEncode(input js.String) (ret js.TypedArray[uint8], exception js.Any, ok bool) {
  1411  	ok = js.True == bindings.TryTextEncoderEncode(
  1412  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1413  		input.Ref(),
  1414  	)
  1415  
  1416  	return
  1417  }
  1418  
  1419  // HasFuncEncode1 returns true if the method "TextEncoder.encode" exists.
  1420  func (this TextEncoder) HasFuncEncode1() bool {
  1421  	return js.True == bindings.HasFuncTextEncoderEncode1(
  1422  		this.ref,
  1423  	)
  1424  }
  1425  
  1426  // FuncEncode1 returns the method "TextEncoder.encode".
  1427  func (this TextEncoder) FuncEncode1() (fn js.Func[func() js.TypedArray[uint8]]) {
  1428  	bindings.FuncTextEncoderEncode1(
  1429  		this.ref, js.Pointer(&fn),
  1430  	)
  1431  	return
  1432  }
  1433  
  1434  // Encode1 calls the method "TextEncoder.encode".
  1435  func (this TextEncoder) Encode1() (ret js.TypedArray[uint8]) {
  1436  	bindings.CallTextEncoderEncode1(
  1437  		this.ref, js.Pointer(&ret),
  1438  	)
  1439  
  1440  	return
  1441  }
  1442  
  1443  // TryEncode1 calls the method "TextEncoder.encode"
  1444  // in a try/catch block and returns (_, err, ok = false) when it went through
  1445  // the catch clause.
  1446  func (this TextEncoder) TryEncode1() (ret js.TypedArray[uint8], exception js.Any, ok bool) {
  1447  	ok = js.True == bindings.TryTextEncoderEncode1(
  1448  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1449  	)
  1450  
  1451  	return
  1452  }
  1453  
  1454  // HasFuncEncodeInto returns true if the method "TextEncoder.encodeInto" exists.
  1455  func (this TextEncoder) HasFuncEncodeInto() bool {
  1456  	return js.True == bindings.HasFuncTextEncoderEncodeInto(
  1457  		this.ref,
  1458  	)
  1459  }
  1460  
  1461  // FuncEncodeInto returns the method "TextEncoder.encodeInto".
  1462  func (this TextEncoder) FuncEncodeInto() (fn js.Func[func(source js.String, destination js.TypedArray[uint8]) TextEncoderEncodeIntoResult]) {
  1463  	bindings.FuncTextEncoderEncodeInto(
  1464  		this.ref, js.Pointer(&fn),
  1465  	)
  1466  	return
  1467  }
  1468  
  1469  // EncodeInto calls the method "TextEncoder.encodeInto".
  1470  func (this TextEncoder) EncodeInto(source js.String, destination js.TypedArray[uint8]) (ret TextEncoderEncodeIntoResult) {
  1471  	bindings.CallTextEncoderEncodeInto(
  1472  		this.ref, js.Pointer(&ret),
  1473  		source.Ref(),
  1474  		destination.Ref(),
  1475  	)
  1476  
  1477  	return
  1478  }
  1479  
  1480  // TryEncodeInto calls the method "TextEncoder.encodeInto"
  1481  // in a try/catch block and returns (_, err, ok = false) when it went through
  1482  // the catch clause.
  1483  func (this TextEncoder) TryEncodeInto(source js.String, destination js.TypedArray[uint8]) (ret TextEncoderEncodeIntoResult, exception js.Any, ok bool) {
  1484  	ok = js.True == bindings.TryTextEncoderEncodeInto(
  1485  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1486  		source.Ref(),
  1487  		destination.Ref(),
  1488  	)
  1489  
  1490  	return
  1491  }
  1492  
  1493  type TextEncoderStream struct {
  1494  	ref js.Ref
  1495  }
  1496  
  1497  func (this TextEncoderStream) Once() TextEncoderStream {
  1498  	this.ref.Once()
  1499  	return this
  1500  }
  1501  
  1502  func (this TextEncoderStream) Ref() js.Ref {
  1503  	return this.ref
  1504  }
  1505  
  1506  func (this TextEncoderStream) FromRef(ref js.Ref) TextEncoderStream {
  1507  	this.ref = ref
  1508  	return this
  1509  }
  1510  
  1511  func (this TextEncoderStream) Free() {
  1512  	this.ref.Free()
  1513  }
  1514  
  1515  // Encoding returns the value of property "TextEncoderStream.encoding".
  1516  //
  1517  // It returns ok=false if there is no such property.
  1518  func (this TextEncoderStream) Encoding() (ret js.String, ok bool) {
  1519  	ok = js.True == bindings.GetTextEncoderStreamEncoding(
  1520  		this.ref, js.Pointer(&ret),
  1521  	)
  1522  	return
  1523  }
  1524  
  1525  // Readable returns the value of property "TextEncoderStream.readable".
  1526  //
  1527  // It returns ok=false if there is no such property.
  1528  func (this TextEncoderStream) Readable() (ret ReadableStream, ok bool) {
  1529  	ok = js.True == bindings.GetTextEncoderStreamReadable(
  1530  		this.ref, js.Pointer(&ret),
  1531  	)
  1532  	return
  1533  }
  1534  
  1535  // Writable returns the value of property "TextEncoderStream.writable".
  1536  //
  1537  // It returns ok=false if there is no such property.
  1538  func (this TextEncoderStream) Writable() (ret WritableStream, ok bool) {
  1539  	ok = js.True == bindings.GetTextEncoderStreamWritable(
  1540  		this.ref, js.Pointer(&ret),
  1541  	)
  1542  	return
  1543  }
  1544  
  1545  type TextFormatInit struct {
  1546  	// RangeStart is "TextFormatInit.rangeStart"
  1547  	//
  1548  	// Optional
  1549  	//
  1550  	// NOTE: FFI_USE_RangeStart MUST be set to true to make this field effective.
  1551  	RangeStart uint32
  1552  	// RangeEnd is "TextFormatInit.rangeEnd"
  1553  	//
  1554  	// Optional
  1555  	//
  1556  	// NOTE: FFI_USE_RangeEnd MUST be set to true to make this field effective.
  1557  	RangeEnd uint32
  1558  	// UnderlineStyle is "TextFormatInit.underlineStyle"
  1559  	//
  1560  	// Optional
  1561  	UnderlineStyle js.String
  1562  	// UnderlineThickness is "TextFormatInit.underlineThickness"
  1563  	//
  1564  	// Optional
  1565  	UnderlineThickness js.String
  1566  
  1567  	FFI_USE_RangeStart bool // for RangeStart.
  1568  	FFI_USE_RangeEnd   bool // for RangeEnd.
  1569  
  1570  	FFI_USE bool
  1571  }
  1572  
  1573  // FromRef calls UpdateFrom and returns a TextFormatInit with all fields set.
  1574  func (p TextFormatInit) FromRef(ref js.Ref) TextFormatInit {
  1575  	p.UpdateFrom(ref)
  1576  	return p
  1577  }
  1578  
  1579  // New creates a new TextFormatInit in the application heap.
  1580  func (p TextFormatInit) New() js.Ref {
  1581  	return bindings.TextFormatInitJSLoad(
  1582  		js.Pointer(&p), js.True, 0,
  1583  	)
  1584  }
  1585  
  1586  // UpdateFrom copies value of all fields of the heap object to p.
  1587  func (p *TextFormatInit) UpdateFrom(ref js.Ref) {
  1588  	bindings.TextFormatInitJSStore(
  1589  		js.Pointer(p), ref,
  1590  	)
  1591  }
  1592  
  1593  // Update writes all fields of the p to the heap object referenced by ref.
  1594  func (p *TextFormatInit) Update(ref js.Ref) {
  1595  	bindings.TextFormatInitJSLoad(
  1596  		js.Pointer(p), js.False, ref,
  1597  	)
  1598  }
  1599  
  1600  // FreeMembers frees fields with heap reference, if recursive is true
  1601  // free all heap references reachable from p.
  1602  func (p *TextFormatInit) FreeMembers(recursive bool) {
  1603  	js.Free(
  1604  		p.UnderlineStyle.Ref(),
  1605  		p.UnderlineThickness.Ref(),
  1606  	)
  1607  	p.UnderlineStyle = p.UnderlineStyle.FromRef(js.Undefined)
  1608  	p.UnderlineThickness = p.UnderlineThickness.FromRef(js.Undefined)
  1609  }
  1610  
  1611  func NewTextFormat(options TextFormatInit) (ret TextFormat) {
  1612  	ret.ref = bindings.NewTextFormatByTextFormat(
  1613  		js.Pointer(&options))
  1614  	return
  1615  }
  1616  
  1617  func NewTextFormatByTextFormat1() (ret TextFormat) {
  1618  	ret.ref = bindings.NewTextFormatByTextFormat1()
  1619  	return
  1620  }
  1621  
  1622  type TextFormat struct {
  1623  	ref js.Ref
  1624  }
  1625  
  1626  func (this TextFormat) Once() TextFormat {
  1627  	this.ref.Once()
  1628  	return this
  1629  }
  1630  
  1631  func (this TextFormat) Ref() js.Ref {
  1632  	return this.ref
  1633  }
  1634  
  1635  func (this TextFormat) FromRef(ref js.Ref) TextFormat {
  1636  	this.ref = ref
  1637  	return this
  1638  }
  1639  
  1640  func (this TextFormat) Free() {
  1641  	this.ref.Free()
  1642  }
  1643  
  1644  // RangeStart returns the value of property "TextFormat.rangeStart".
  1645  //
  1646  // It returns ok=false if there is no such property.
  1647  func (this TextFormat) RangeStart() (ret uint32, ok bool) {
  1648  	ok = js.True == bindings.GetTextFormatRangeStart(
  1649  		this.ref, js.Pointer(&ret),
  1650  	)
  1651  	return
  1652  }
  1653  
  1654  // RangeEnd returns the value of property "TextFormat.rangeEnd".
  1655  //
  1656  // It returns ok=false if there is no such property.
  1657  func (this TextFormat) RangeEnd() (ret uint32, ok bool) {
  1658  	ok = js.True == bindings.GetTextFormatRangeEnd(
  1659  		this.ref, js.Pointer(&ret),
  1660  	)
  1661  	return
  1662  }
  1663  
  1664  // UnderlineStyle returns the value of property "TextFormat.underlineStyle".
  1665  //
  1666  // It returns ok=false if there is no such property.
  1667  func (this TextFormat) UnderlineStyle() (ret js.String, ok bool) {
  1668  	ok = js.True == bindings.GetTextFormatUnderlineStyle(
  1669  		this.ref, js.Pointer(&ret),
  1670  	)
  1671  	return
  1672  }
  1673  
  1674  // UnderlineThickness returns the value of property "TextFormat.underlineThickness".
  1675  //
  1676  // It returns ok=false if there is no such property.
  1677  func (this TextFormat) UnderlineThickness() (ret js.String, ok bool) {
  1678  	ok = js.True == bindings.GetTextFormatUnderlineThickness(
  1679  		this.ref, js.Pointer(&ret),
  1680  	)
  1681  	return
  1682  }
  1683  
  1684  type TextFormatUpdateEventInit struct {
  1685  	// TextFormats is "TextFormatUpdateEventInit.textFormats"
  1686  	//
  1687  	// Optional
  1688  	TextFormats js.Array[TextFormat]
  1689  	// Bubbles is "TextFormatUpdateEventInit.bubbles"
  1690  	//
  1691  	// Optional, defaults to false.
  1692  	//
  1693  	// NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective.
  1694  	Bubbles bool
  1695  	// Cancelable is "TextFormatUpdateEventInit.cancelable"
  1696  	//
  1697  	// Optional, defaults to false.
  1698  	//
  1699  	// NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective.
  1700  	Cancelable bool
  1701  	// Composed is "TextFormatUpdateEventInit.composed"
  1702  	//
  1703  	// Optional, defaults to false.
  1704  	//
  1705  	// NOTE: FFI_USE_Composed MUST be set to true to make this field effective.
  1706  	Composed bool
  1707  
  1708  	FFI_USE_Bubbles    bool // for Bubbles.
  1709  	FFI_USE_Cancelable bool // for Cancelable.
  1710  	FFI_USE_Composed   bool // for Composed.
  1711  
  1712  	FFI_USE bool
  1713  }
  1714  
  1715  // FromRef calls UpdateFrom and returns a TextFormatUpdateEventInit with all fields set.
  1716  func (p TextFormatUpdateEventInit) FromRef(ref js.Ref) TextFormatUpdateEventInit {
  1717  	p.UpdateFrom(ref)
  1718  	return p
  1719  }
  1720  
  1721  // New creates a new TextFormatUpdateEventInit in the application heap.
  1722  func (p TextFormatUpdateEventInit) New() js.Ref {
  1723  	return bindings.TextFormatUpdateEventInitJSLoad(
  1724  		js.Pointer(&p), js.True, 0,
  1725  	)
  1726  }
  1727  
  1728  // UpdateFrom copies value of all fields of the heap object to p.
  1729  func (p *TextFormatUpdateEventInit) UpdateFrom(ref js.Ref) {
  1730  	bindings.TextFormatUpdateEventInitJSStore(
  1731  		js.Pointer(p), ref,
  1732  	)
  1733  }
  1734  
  1735  // Update writes all fields of the p to the heap object referenced by ref.
  1736  func (p *TextFormatUpdateEventInit) Update(ref js.Ref) {
  1737  	bindings.TextFormatUpdateEventInitJSLoad(
  1738  		js.Pointer(p), js.False, ref,
  1739  	)
  1740  }
  1741  
  1742  // FreeMembers frees fields with heap reference, if recursive is true
  1743  // free all heap references reachable from p.
  1744  func (p *TextFormatUpdateEventInit) FreeMembers(recursive bool) {
  1745  	js.Free(
  1746  		p.TextFormats.Ref(),
  1747  	)
  1748  	p.TextFormats = p.TextFormats.FromRef(js.Undefined)
  1749  }
  1750  
  1751  func NewTextFormatUpdateEvent(typ js.String, options TextFormatUpdateEventInit) (ret TextFormatUpdateEvent) {
  1752  	ret.ref = bindings.NewTextFormatUpdateEventByTextFormatUpdateEvent(
  1753  		typ.Ref(),
  1754  		js.Pointer(&options))
  1755  	return
  1756  }
  1757  
  1758  func NewTextFormatUpdateEventByTextFormatUpdateEvent1(typ js.String) (ret TextFormatUpdateEvent) {
  1759  	ret.ref = bindings.NewTextFormatUpdateEventByTextFormatUpdateEvent1(
  1760  		typ.Ref())
  1761  	return
  1762  }
  1763  
  1764  type TextFormatUpdateEvent struct {
  1765  	Event
  1766  }
  1767  
  1768  func (this TextFormatUpdateEvent) Once() TextFormatUpdateEvent {
  1769  	this.ref.Once()
  1770  	return this
  1771  }
  1772  
  1773  func (this TextFormatUpdateEvent) Ref() js.Ref {
  1774  	return this.Event.Ref()
  1775  }
  1776  
  1777  func (this TextFormatUpdateEvent) FromRef(ref js.Ref) TextFormatUpdateEvent {
  1778  	this.Event = this.Event.FromRef(ref)
  1779  	return this
  1780  }
  1781  
  1782  func (this TextFormatUpdateEvent) Free() {
  1783  	this.ref.Free()
  1784  }
  1785  
  1786  // HasFuncGetTextFormats returns true if the method "TextFormatUpdateEvent.getTextFormats" exists.
  1787  func (this TextFormatUpdateEvent) HasFuncGetTextFormats() bool {
  1788  	return js.True == bindings.HasFuncTextFormatUpdateEventGetTextFormats(
  1789  		this.ref,
  1790  	)
  1791  }
  1792  
  1793  // FuncGetTextFormats returns the method "TextFormatUpdateEvent.getTextFormats".
  1794  func (this TextFormatUpdateEvent) FuncGetTextFormats() (fn js.Func[func() js.Array[TextFormat]]) {
  1795  	bindings.FuncTextFormatUpdateEventGetTextFormats(
  1796  		this.ref, js.Pointer(&fn),
  1797  	)
  1798  	return
  1799  }
  1800  
  1801  // GetTextFormats calls the method "TextFormatUpdateEvent.getTextFormats".
  1802  func (this TextFormatUpdateEvent) GetTextFormats() (ret js.Array[TextFormat]) {
  1803  	bindings.CallTextFormatUpdateEventGetTextFormats(
  1804  		this.ref, js.Pointer(&ret),
  1805  	)
  1806  
  1807  	return
  1808  }
  1809  
  1810  // TryGetTextFormats calls the method "TextFormatUpdateEvent.getTextFormats"
  1811  // in a try/catch block and returns (_, err, ok = false) when it went through
  1812  // the catch clause.
  1813  func (this TextFormatUpdateEvent) TryGetTextFormats() (ret js.Array[TextFormat], exception js.Any, ok bool) {
  1814  	ok = js.True == bindings.TryTextFormatUpdateEventGetTextFormats(
  1815  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1816  	)
  1817  
  1818  	return
  1819  }
  1820  
  1821  type TextUpdateEventInit struct {
  1822  	// UpdateRangeStart is "TextUpdateEventInit.updateRangeStart"
  1823  	//
  1824  	// Optional
  1825  	//
  1826  	// NOTE: FFI_USE_UpdateRangeStart MUST be set to true to make this field effective.
  1827  	UpdateRangeStart uint32
  1828  	// UpdateRangeEnd is "TextUpdateEventInit.updateRangeEnd"
  1829  	//
  1830  	// Optional
  1831  	//
  1832  	// NOTE: FFI_USE_UpdateRangeEnd MUST be set to true to make this field effective.
  1833  	UpdateRangeEnd uint32
  1834  	// Text is "TextUpdateEventInit.text"
  1835  	//
  1836  	// Optional
  1837  	Text js.String
  1838  	// SelectionStart is "TextUpdateEventInit.selectionStart"
  1839  	//
  1840  	// Optional
  1841  	//
  1842  	// NOTE: FFI_USE_SelectionStart MUST be set to true to make this field effective.
  1843  	SelectionStart uint32
  1844  	// SelectionEnd is "TextUpdateEventInit.selectionEnd"
  1845  	//
  1846  	// Optional
  1847  	//
  1848  	// NOTE: FFI_USE_SelectionEnd MUST be set to true to make this field effective.
  1849  	SelectionEnd uint32
  1850  	// CompositionStart is "TextUpdateEventInit.compositionStart"
  1851  	//
  1852  	// Optional
  1853  	//
  1854  	// NOTE: FFI_USE_CompositionStart MUST be set to true to make this field effective.
  1855  	CompositionStart uint32
  1856  	// CompositionEnd is "TextUpdateEventInit.compositionEnd"
  1857  	//
  1858  	// Optional
  1859  	//
  1860  	// NOTE: FFI_USE_CompositionEnd MUST be set to true to make this field effective.
  1861  	CompositionEnd uint32
  1862  	// Bubbles is "TextUpdateEventInit.bubbles"
  1863  	//
  1864  	// Optional, defaults to false.
  1865  	//
  1866  	// NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective.
  1867  	Bubbles bool
  1868  	// Cancelable is "TextUpdateEventInit.cancelable"
  1869  	//
  1870  	// Optional, defaults to false.
  1871  	//
  1872  	// NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective.
  1873  	Cancelable bool
  1874  	// Composed is "TextUpdateEventInit.composed"
  1875  	//
  1876  	// Optional, defaults to false.
  1877  	//
  1878  	// NOTE: FFI_USE_Composed MUST be set to true to make this field effective.
  1879  	Composed bool
  1880  
  1881  	FFI_USE_UpdateRangeStart bool // for UpdateRangeStart.
  1882  	FFI_USE_UpdateRangeEnd   bool // for UpdateRangeEnd.
  1883  	FFI_USE_SelectionStart   bool // for SelectionStart.
  1884  	FFI_USE_SelectionEnd     bool // for SelectionEnd.
  1885  	FFI_USE_CompositionStart bool // for CompositionStart.
  1886  	FFI_USE_CompositionEnd   bool // for CompositionEnd.
  1887  	FFI_USE_Bubbles          bool // for Bubbles.
  1888  	FFI_USE_Cancelable       bool // for Cancelable.
  1889  	FFI_USE_Composed         bool // for Composed.
  1890  
  1891  	FFI_USE bool
  1892  }
  1893  
  1894  // FromRef calls UpdateFrom and returns a TextUpdateEventInit with all fields set.
  1895  func (p TextUpdateEventInit) FromRef(ref js.Ref) TextUpdateEventInit {
  1896  	p.UpdateFrom(ref)
  1897  	return p
  1898  }
  1899  
  1900  // New creates a new TextUpdateEventInit in the application heap.
  1901  func (p TextUpdateEventInit) New() js.Ref {
  1902  	return bindings.TextUpdateEventInitJSLoad(
  1903  		js.Pointer(&p), js.True, 0,
  1904  	)
  1905  }
  1906  
  1907  // UpdateFrom copies value of all fields of the heap object to p.
  1908  func (p *TextUpdateEventInit) UpdateFrom(ref js.Ref) {
  1909  	bindings.TextUpdateEventInitJSStore(
  1910  		js.Pointer(p), ref,
  1911  	)
  1912  }
  1913  
  1914  // Update writes all fields of the p to the heap object referenced by ref.
  1915  func (p *TextUpdateEventInit) Update(ref js.Ref) {
  1916  	bindings.TextUpdateEventInitJSLoad(
  1917  		js.Pointer(p), js.False, ref,
  1918  	)
  1919  }
  1920  
  1921  // FreeMembers frees fields with heap reference, if recursive is true
  1922  // free all heap references reachable from p.
  1923  func (p *TextUpdateEventInit) FreeMembers(recursive bool) {
  1924  	js.Free(
  1925  		p.Text.Ref(),
  1926  	)
  1927  	p.Text = p.Text.FromRef(js.Undefined)
  1928  }
  1929  
  1930  func NewTextUpdateEvent(typ js.String, options TextUpdateEventInit) (ret TextUpdateEvent) {
  1931  	ret.ref = bindings.NewTextUpdateEventByTextUpdateEvent(
  1932  		typ.Ref(),
  1933  		js.Pointer(&options))
  1934  	return
  1935  }
  1936  
  1937  func NewTextUpdateEventByTextUpdateEvent1(typ js.String) (ret TextUpdateEvent) {
  1938  	ret.ref = bindings.NewTextUpdateEventByTextUpdateEvent1(
  1939  		typ.Ref())
  1940  	return
  1941  }
  1942  
  1943  type TextUpdateEvent struct {
  1944  	Event
  1945  }
  1946  
  1947  func (this TextUpdateEvent) Once() TextUpdateEvent {
  1948  	this.ref.Once()
  1949  	return this
  1950  }
  1951  
  1952  func (this TextUpdateEvent) Ref() js.Ref {
  1953  	return this.Event.Ref()
  1954  }
  1955  
  1956  func (this TextUpdateEvent) FromRef(ref js.Ref) TextUpdateEvent {
  1957  	this.Event = this.Event.FromRef(ref)
  1958  	return this
  1959  }
  1960  
  1961  func (this TextUpdateEvent) Free() {
  1962  	this.ref.Free()
  1963  }
  1964  
  1965  // UpdateRangeStart returns the value of property "TextUpdateEvent.updateRangeStart".
  1966  //
  1967  // It returns ok=false if there is no such property.
  1968  func (this TextUpdateEvent) UpdateRangeStart() (ret uint32, ok bool) {
  1969  	ok = js.True == bindings.GetTextUpdateEventUpdateRangeStart(
  1970  		this.ref, js.Pointer(&ret),
  1971  	)
  1972  	return
  1973  }
  1974  
  1975  // UpdateRangeEnd returns the value of property "TextUpdateEvent.updateRangeEnd".
  1976  //
  1977  // It returns ok=false if there is no such property.
  1978  func (this TextUpdateEvent) UpdateRangeEnd() (ret uint32, ok bool) {
  1979  	ok = js.True == bindings.GetTextUpdateEventUpdateRangeEnd(
  1980  		this.ref, js.Pointer(&ret),
  1981  	)
  1982  	return
  1983  }
  1984  
  1985  // Text returns the value of property "TextUpdateEvent.text".
  1986  //
  1987  // It returns ok=false if there is no such property.
  1988  func (this TextUpdateEvent) Text() (ret js.String, ok bool) {
  1989  	ok = js.True == bindings.GetTextUpdateEventText(
  1990  		this.ref, js.Pointer(&ret),
  1991  	)
  1992  	return
  1993  }
  1994  
  1995  // SelectionStart returns the value of property "TextUpdateEvent.selectionStart".
  1996  //
  1997  // It returns ok=false if there is no such property.
  1998  func (this TextUpdateEvent) SelectionStart() (ret uint32, ok bool) {
  1999  	ok = js.True == bindings.GetTextUpdateEventSelectionStart(
  2000  		this.ref, js.Pointer(&ret),
  2001  	)
  2002  	return
  2003  }
  2004  
  2005  // SelectionEnd returns the value of property "TextUpdateEvent.selectionEnd".
  2006  //
  2007  // It returns ok=false if there is no such property.
  2008  func (this TextUpdateEvent) SelectionEnd() (ret uint32, ok bool) {
  2009  	ok = js.True == bindings.GetTextUpdateEventSelectionEnd(
  2010  		this.ref, js.Pointer(&ret),
  2011  	)
  2012  	return
  2013  }
  2014  
  2015  // CompositionStart returns the value of property "TextUpdateEvent.compositionStart".
  2016  //
  2017  // It returns ok=false if there is no such property.
  2018  func (this TextUpdateEvent) CompositionStart() (ret uint32, ok bool) {
  2019  	ok = js.True == bindings.GetTextUpdateEventCompositionStart(
  2020  		this.ref, js.Pointer(&ret),
  2021  	)
  2022  	return
  2023  }
  2024  
  2025  // CompositionEnd returns the value of property "TextUpdateEvent.compositionEnd".
  2026  //
  2027  // It returns ok=false if there is no such property.
  2028  func (this TextUpdateEvent) CompositionEnd() (ret uint32, ok bool) {
  2029  	ok = js.True == bindings.GetTextUpdateEventCompositionEnd(
  2030  		this.ref, js.Pointer(&ret),
  2031  	)
  2032  	return
  2033  }
  2034  
  2035  func NewTimeEvent(typ js.String, eventInitDict EventInit) (ret TimeEvent) {
  2036  	ret.ref = bindings.NewTimeEventByTimeEvent(
  2037  		typ.Ref(),
  2038  		js.Pointer(&eventInitDict))
  2039  	return
  2040  }
  2041  
  2042  func NewTimeEventByTimeEvent1(typ js.String) (ret TimeEvent) {
  2043  	ret.ref = bindings.NewTimeEventByTimeEvent1(
  2044  		typ.Ref())
  2045  	return
  2046  }
  2047  
  2048  type TimeEvent struct {
  2049  	Event
  2050  }
  2051  
  2052  func (this TimeEvent) Once() TimeEvent {
  2053  	this.ref.Once()
  2054  	return this
  2055  }
  2056  
  2057  func (this TimeEvent) Ref() js.Ref {
  2058  	return this.Event.Ref()
  2059  }
  2060  
  2061  func (this TimeEvent) FromRef(ref js.Ref) TimeEvent {
  2062  	this.Event = this.Event.FromRef(ref)
  2063  	return this
  2064  }
  2065  
  2066  func (this TimeEvent) Free() {
  2067  	this.ref.Free()
  2068  }
  2069  
  2070  // View returns the value of property "TimeEvent.view".
  2071  //
  2072  // It returns ok=false if there is no such property.
  2073  func (this TimeEvent) View() (ret js.Object, ok bool) {
  2074  	ok = js.True == bindings.GetTimeEventView(
  2075  		this.ref, js.Pointer(&ret),
  2076  	)
  2077  	return
  2078  }
  2079  
  2080  // Detail returns the value of property "TimeEvent.detail".
  2081  //
  2082  // It returns ok=false if there is no such property.
  2083  func (this TimeEvent) Detail() (ret int32, ok bool) {
  2084  	ok = js.True == bindings.GetTimeEventDetail(
  2085  		this.ref, js.Pointer(&ret),
  2086  	)
  2087  	return
  2088  }
  2089  
  2090  // HasFuncInitTimeEvent returns true if the method "TimeEvent.initTimeEvent" exists.
  2091  func (this TimeEvent) HasFuncInitTimeEvent() bool {
  2092  	return js.True == bindings.HasFuncTimeEventInitTimeEvent(
  2093  		this.ref,
  2094  	)
  2095  }
  2096  
  2097  // FuncInitTimeEvent returns the method "TimeEvent.initTimeEvent".
  2098  func (this TimeEvent) FuncInitTimeEvent() (fn js.Func[func(typeArg js.String, viewArg Window, detailArg int32)]) {
  2099  	bindings.FuncTimeEventInitTimeEvent(
  2100  		this.ref, js.Pointer(&fn),
  2101  	)
  2102  	return
  2103  }
  2104  
  2105  // InitTimeEvent calls the method "TimeEvent.initTimeEvent".
  2106  func (this TimeEvent) InitTimeEvent(typeArg js.String, viewArg Window, detailArg int32) (ret js.Void) {
  2107  	bindings.CallTimeEventInitTimeEvent(
  2108  		this.ref, js.Pointer(&ret),
  2109  		typeArg.Ref(),
  2110  		viewArg.Ref(),
  2111  		int32(detailArg),
  2112  	)
  2113  
  2114  	return
  2115  }
  2116  
  2117  // TryInitTimeEvent calls the method "TimeEvent.initTimeEvent"
  2118  // in a try/catch block and returns (_, err, ok = false) when it went through
  2119  // the catch clause.
  2120  func (this TimeEvent) TryInitTimeEvent(typeArg js.String, viewArg Window, detailArg int32) (ret js.Void, exception js.Any, ok bool) {
  2121  	ok = js.True == bindings.TryTimeEventInitTimeEvent(
  2122  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2123  		typeArg.Ref(),
  2124  		viewArg.Ref(),
  2125  		int32(detailArg),
  2126  	)
  2127  
  2128  	return
  2129  }
  2130  
  2131  type ToggleEventInit struct {
  2132  	// OldState is "ToggleEventInit.oldState"
  2133  	//
  2134  	// Optional, defaults to "".
  2135  	OldState js.String
  2136  	// NewState is "ToggleEventInit.newState"
  2137  	//
  2138  	// Optional, defaults to "".
  2139  	NewState js.String
  2140  	// Bubbles is "ToggleEventInit.bubbles"
  2141  	//
  2142  	// Optional, defaults to false.
  2143  	//
  2144  	// NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective.
  2145  	Bubbles bool
  2146  	// Cancelable is "ToggleEventInit.cancelable"
  2147  	//
  2148  	// Optional, defaults to false.
  2149  	//
  2150  	// NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective.
  2151  	Cancelable bool
  2152  	// Composed is "ToggleEventInit.composed"
  2153  	//
  2154  	// Optional, defaults to false.
  2155  	//
  2156  	// NOTE: FFI_USE_Composed MUST be set to true to make this field effective.
  2157  	Composed bool
  2158  
  2159  	FFI_USE_Bubbles    bool // for Bubbles.
  2160  	FFI_USE_Cancelable bool // for Cancelable.
  2161  	FFI_USE_Composed   bool // for Composed.
  2162  
  2163  	FFI_USE bool
  2164  }
  2165  
  2166  // FromRef calls UpdateFrom and returns a ToggleEventInit with all fields set.
  2167  func (p ToggleEventInit) FromRef(ref js.Ref) ToggleEventInit {
  2168  	p.UpdateFrom(ref)
  2169  	return p
  2170  }
  2171  
  2172  // New creates a new ToggleEventInit in the application heap.
  2173  func (p ToggleEventInit) New() js.Ref {
  2174  	return bindings.ToggleEventInitJSLoad(
  2175  		js.Pointer(&p), js.True, 0,
  2176  	)
  2177  }
  2178  
  2179  // UpdateFrom copies value of all fields of the heap object to p.
  2180  func (p *ToggleEventInit) UpdateFrom(ref js.Ref) {
  2181  	bindings.ToggleEventInitJSStore(
  2182  		js.Pointer(p), ref,
  2183  	)
  2184  }
  2185  
  2186  // Update writes all fields of the p to the heap object referenced by ref.
  2187  func (p *ToggleEventInit) Update(ref js.Ref) {
  2188  	bindings.ToggleEventInitJSLoad(
  2189  		js.Pointer(p), js.False, ref,
  2190  	)
  2191  }
  2192  
  2193  // FreeMembers frees fields with heap reference, if recursive is true
  2194  // free all heap references reachable from p.
  2195  func (p *ToggleEventInit) FreeMembers(recursive bool) {
  2196  	js.Free(
  2197  		p.OldState.Ref(),
  2198  		p.NewState.Ref(),
  2199  	)
  2200  	p.OldState = p.OldState.FromRef(js.Undefined)
  2201  	p.NewState = p.NewState.FromRef(js.Undefined)
  2202  }
  2203  
  2204  func NewToggleEvent(typ js.String, eventInitDict ToggleEventInit) (ret ToggleEvent) {
  2205  	ret.ref = bindings.NewToggleEventByToggleEvent(
  2206  		typ.Ref(),
  2207  		js.Pointer(&eventInitDict))
  2208  	return
  2209  }
  2210  
  2211  func NewToggleEventByToggleEvent1(typ js.String) (ret ToggleEvent) {
  2212  	ret.ref = bindings.NewToggleEventByToggleEvent1(
  2213  		typ.Ref())
  2214  	return
  2215  }
  2216  
  2217  type ToggleEvent struct {
  2218  	Event
  2219  }
  2220  
  2221  func (this ToggleEvent) Once() ToggleEvent {
  2222  	this.ref.Once()
  2223  	return this
  2224  }
  2225  
  2226  func (this ToggleEvent) Ref() js.Ref {
  2227  	return this.Event.Ref()
  2228  }
  2229  
  2230  func (this ToggleEvent) FromRef(ref js.Ref) ToggleEvent {
  2231  	this.Event = this.Event.FromRef(ref)
  2232  	return this
  2233  }
  2234  
  2235  func (this ToggleEvent) Free() {
  2236  	this.ref.Free()
  2237  }
  2238  
  2239  // OldState returns the value of property "ToggleEvent.oldState".
  2240  //
  2241  // It returns ok=false if there is no such property.
  2242  func (this ToggleEvent) OldState() (ret js.String, ok bool) {
  2243  	ok = js.True == bindings.GetToggleEventOldState(
  2244  		this.ref, js.Pointer(&ret),
  2245  	)
  2246  	return
  2247  }
  2248  
  2249  // NewState returns the value of property "ToggleEvent.newState".
  2250  //
  2251  // It returns ok=false if there is no such property.
  2252  func (this ToggleEvent) NewState() (ret js.String, ok bool) {
  2253  	ok = js.True == bindings.GetToggleEventNewState(
  2254  		this.ref, js.Pointer(&ret),
  2255  	)
  2256  	return
  2257  }
  2258  
  2259  type TokenBinding struct {
  2260  	// Status is "TokenBinding.status"
  2261  	//
  2262  	// Required
  2263  	Status js.String
  2264  	// Id is "TokenBinding.id"
  2265  	//
  2266  	// Optional
  2267  	Id js.String
  2268  
  2269  	FFI_USE bool
  2270  }
  2271  
  2272  // FromRef calls UpdateFrom and returns a TokenBinding with all fields set.
  2273  func (p TokenBinding) FromRef(ref js.Ref) TokenBinding {
  2274  	p.UpdateFrom(ref)
  2275  	return p
  2276  }
  2277  
  2278  // New creates a new TokenBinding in the application heap.
  2279  func (p TokenBinding) New() js.Ref {
  2280  	return bindings.TokenBindingJSLoad(
  2281  		js.Pointer(&p), js.True, 0,
  2282  	)
  2283  }
  2284  
  2285  // UpdateFrom copies value of all fields of the heap object to p.
  2286  func (p *TokenBinding) UpdateFrom(ref js.Ref) {
  2287  	bindings.TokenBindingJSStore(
  2288  		js.Pointer(p), ref,
  2289  	)
  2290  }
  2291  
  2292  // Update writes all fields of the p to the heap object referenced by ref.
  2293  func (p *TokenBinding) Update(ref js.Ref) {
  2294  	bindings.TokenBindingJSLoad(
  2295  		js.Pointer(p), js.False, ref,
  2296  	)
  2297  }
  2298  
  2299  // FreeMembers frees fields with heap reference, if recursive is true
  2300  // free all heap references reachable from p.
  2301  func (p *TokenBinding) FreeMembers(recursive bool) {
  2302  	js.Free(
  2303  		p.Status.Ref(),
  2304  		p.Id.Ref(),
  2305  	)
  2306  	p.Status = p.Status.FromRef(js.Undefined)
  2307  	p.Id = p.Id.FromRef(js.Undefined)
  2308  }
  2309  
  2310  type TokenBindingStatus uint32
  2311  
  2312  const (
  2313  	_ TokenBindingStatus = iota
  2314  
  2315  	TokenBindingStatus_PRESENT
  2316  	TokenBindingStatus_SUPPORTED
  2317  )
  2318  
  2319  func (TokenBindingStatus) FromRef(str js.Ref) TokenBindingStatus {
  2320  	return TokenBindingStatus(bindings.ConstOfTokenBindingStatus(str))
  2321  }
  2322  
  2323  func (x TokenBindingStatus) String() (string, bool) {
  2324  	switch x {
  2325  	case TokenBindingStatus_PRESENT:
  2326  		return "present", true
  2327  	case TokenBindingStatus_SUPPORTED:
  2328  		return "supported", true
  2329  	default:
  2330  		return "", false
  2331  	}
  2332  }
  2333  
  2334  type TopLevelStorageAccessPermissionDescriptor struct {
  2335  	// RequestedOrigin is "TopLevelStorageAccessPermissionDescriptor.requestedOrigin"
  2336  	//
  2337  	// Optional, defaults to "".
  2338  	RequestedOrigin js.String
  2339  	// Name is "TopLevelStorageAccessPermissionDescriptor.name"
  2340  	//
  2341  	// Required
  2342  	Name js.String
  2343  
  2344  	FFI_USE bool
  2345  }
  2346  
  2347  // FromRef calls UpdateFrom and returns a TopLevelStorageAccessPermissionDescriptor with all fields set.
  2348  func (p TopLevelStorageAccessPermissionDescriptor) FromRef(ref js.Ref) TopLevelStorageAccessPermissionDescriptor {
  2349  	p.UpdateFrom(ref)
  2350  	return p
  2351  }
  2352  
  2353  // New creates a new TopLevelStorageAccessPermissionDescriptor in the application heap.
  2354  func (p TopLevelStorageAccessPermissionDescriptor) New() js.Ref {
  2355  	return bindings.TopLevelStorageAccessPermissionDescriptorJSLoad(
  2356  		js.Pointer(&p), js.True, 0,
  2357  	)
  2358  }
  2359  
  2360  // UpdateFrom copies value of all fields of the heap object to p.
  2361  func (p *TopLevelStorageAccessPermissionDescriptor) UpdateFrom(ref js.Ref) {
  2362  	bindings.TopLevelStorageAccessPermissionDescriptorJSStore(
  2363  		js.Pointer(p), ref,
  2364  	)
  2365  }
  2366  
  2367  // Update writes all fields of the p to the heap object referenced by ref.
  2368  func (p *TopLevelStorageAccessPermissionDescriptor) Update(ref js.Ref) {
  2369  	bindings.TopLevelStorageAccessPermissionDescriptorJSLoad(
  2370  		js.Pointer(p), js.False, ref,
  2371  	)
  2372  }
  2373  
  2374  // FreeMembers frees fields with heap reference, if recursive is true
  2375  // free all heap references reachable from p.
  2376  func (p *TopLevelStorageAccessPermissionDescriptor) FreeMembers(recursive bool) {
  2377  	js.Free(
  2378  		p.RequestedOrigin.Ref(),
  2379  		p.Name.Ref(),
  2380  	)
  2381  	p.RequestedOrigin = p.RequestedOrigin.FromRef(js.Undefined)
  2382  	p.Name = p.Name.FromRef(js.Undefined)
  2383  }
  2384  
  2385  type TouchType uint32
  2386  
  2387  const (
  2388  	_ TouchType = iota
  2389  
  2390  	TouchType_DIRECT
  2391  	TouchType_STYLUS
  2392  )
  2393  
  2394  func (TouchType) FromRef(str js.Ref) TouchType {
  2395  	return TouchType(bindings.ConstOfTouchType(str))
  2396  }
  2397  
  2398  func (x TouchType) String() (string, bool) {
  2399  	switch x {
  2400  	case TouchType_DIRECT:
  2401  		return "direct", true
  2402  	case TouchType_STYLUS:
  2403  		return "stylus", true
  2404  	default:
  2405  		return "", false
  2406  	}
  2407  }
  2408  
  2409  type TouchInit struct {
  2410  	// Identifier is "TouchInit.identifier"
  2411  	//
  2412  	// Required
  2413  	Identifier int32
  2414  	// Target is "TouchInit.target"
  2415  	//
  2416  	// Required
  2417  	Target EventTarget
  2418  	// ClientX is "TouchInit.clientX"
  2419  	//
  2420  	// Optional, defaults to 0.
  2421  	//
  2422  	// NOTE: FFI_USE_ClientX MUST be set to true to make this field effective.
  2423  	ClientX float64
  2424  	// ClientY is "TouchInit.clientY"
  2425  	//
  2426  	// Optional, defaults to 0.
  2427  	//
  2428  	// NOTE: FFI_USE_ClientY MUST be set to true to make this field effective.
  2429  	ClientY float64
  2430  	// ScreenX is "TouchInit.screenX"
  2431  	//
  2432  	// Optional, defaults to 0.
  2433  	//
  2434  	// NOTE: FFI_USE_ScreenX MUST be set to true to make this field effective.
  2435  	ScreenX float64
  2436  	// ScreenY is "TouchInit.screenY"
  2437  	//
  2438  	// Optional, defaults to 0.
  2439  	//
  2440  	// NOTE: FFI_USE_ScreenY MUST be set to true to make this field effective.
  2441  	ScreenY float64
  2442  	// PageX is "TouchInit.pageX"
  2443  	//
  2444  	// Optional, defaults to 0.
  2445  	//
  2446  	// NOTE: FFI_USE_PageX MUST be set to true to make this field effective.
  2447  	PageX float64
  2448  	// PageY is "TouchInit.pageY"
  2449  	//
  2450  	// Optional, defaults to 0.
  2451  	//
  2452  	// NOTE: FFI_USE_PageY MUST be set to true to make this field effective.
  2453  	PageY float64
  2454  	// RadiusX is "TouchInit.radiusX"
  2455  	//
  2456  	// Optional, defaults to 0.
  2457  	//
  2458  	// NOTE: FFI_USE_RadiusX MUST be set to true to make this field effective.
  2459  	RadiusX float32
  2460  	// RadiusY is "TouchInit.radiusY"
  2461  	//
  2462  	// Optional, defaults to 0.
  2463  	//
  2464  	// NOTE: FFI_USE_RadiusY MUST be set to true to make this field effective.
  2465  	RadiusY float32
  2466  	// RotationAngle is "TouchInit.rotationAngle"
  2467  	//
  2468  	// Optional, defaults to 0.
  2469  	//
  2470  	// NOTE: FFI_USE_RotationAngle MUST be set to true to make this field effective.
  2471  	RotationAngle float32
  2472  	// Force is "TouchInit.force"
  2473  	//
  2474  	// Optional, defaults to 0.
  2475  	//
  2476  	// NOTE: FFI_USE_Force MUST be set to true to make this field effective.
  2477  	Force float32
  2478  	// AltitudeAngle is "TouchInit.altitudeAngle"
  2479  	//
  2480  	// Optional, defaults to 0.
  2481  	//
  2482  	// NOTE: FFI_USE_AltitudeAngle MUST be set to true to make this field effective.
  2483  	AltitudeAngle float64
  2484  	// AzimuthAngle is "TouchInit.azimuthAngle"
  2485  	//
  2486  	// Optional, defaults to 0.
  2487  	//
  2488  	// NOTE: FFI_USE_AzimuthAngle MUST be set to true to make this field effective.
  2489  	AzimuthAngle float64
  2490  	// TouchType is "TouchInit.touchType"
  2491  	//
  2492  	// Optional, defaults to "direct".
  2493  	TouchType TouchType
  2494  
  2495  	FFI_USE_ClientX       bool // for ClientX.
  2496  	FFI_USE_ClientY       bool // for ClientY.
  2497  	FFI_USE_ScreenX       bool // for ScreenX.
  2498  	FFI_USE_ScreenY       bool // for ScreenY.
  2499  	FFI_USE_PageX         bool // for PageX.
  2500  	FFI_USE_PageY         bool // for PageY.
  2501  	FFI_USE_RadiusX       bool // for RadiusX.
  2502  	FFI_USE_RadiusY       bool // for RadiusY.
  2503  	FFI_USE_RotationAngle bool // for RotationAngle.
  2504  	FFI_USE_Force         bool // for Force.
  2505  	FFI_USE_AltitudeAngle bool // for AltitudeAngle.
  2506  	FFI_USE_AzimuthAngle  bool // for AzimuthAngle.
  2507  
  2508  	FFI_USE bool
  2509  }
  2510  
  2511  // FromRef calls UpdateFrom and returns a TouchInit with all fields set.
  2512  func (p TouchInit) FromRef(ref js.Ref) TouchInit {
  2513  	p.UpdateFrom(ref)
  2514  	return p
  2515  }
  2516  
  2517  // New creates a new TouchInit in the application heap.
  2518  func (p TouchInit) New() js.Ref {
  2519  	return bindings.TouchInitJSLoad(
  2520  		js.Pointer(&p), js.True, 0,
  2521  	)
  2522  }
  2523  
  2524  // UpdateFrom copies value of all fields of the heap object to p.
  2525  func (p *TouchInit) UpdateFrom(ref js.Ref) {
  2526  	bindings.TouchInitJSStore(
  2527  		js.Pointer(p), ref,
  2528  	)
  2529  }
  2530  
  2531  // Update writes all fields of the p to the heap object referenced by ref.
  2532  func (p *TouchInit) Update(ref js.Ref) {
  2533  	bindings.TouchInitJSLoad(
  2534  		js.Pointer(p), js.False, ref,
  2535  	)
  2536  }
  2537  
  2538  // FreeMembers frees fields with heap reference, if recursive is true
  2539  // free all heap references reachable from p.
  2540  func (p *TouchInit) FreeMembers(recursive bool) {
  2541  	js.Free(
  2542  		p.Target.Ref(),
  2543  	)
  2544  	p.Target = p.Target.FromRef(js.Undefined)
  2545  }
  2546  
  2547  func NewTouch(touchInitDict TouchInit) (ret Touch) {
  2548  	ret.ref = bindings.NewTouchByTouch(
  2549  		js.Pointer(&touchInitDict))
  2550  	return
  2551  }
  2552  
  2553  type Touch struct {
  2554  	ref js.Ref
  2555  }
  2556  
  2557  func (this Touch) Once() Touch {
  2558  	this.ref.Once()
  2559  	return this
  2560  }
  2561  
  2562  func (this Touch) Ref() js.Ref {
  2563  	return this.ref
  2564  }
  2565  
  2566  func (this Touch) FromRef(ref js.Ref) Touch {
  2567  	this.ref = ref
  2568  	return this
  2569  }
  2570  
  2571  func (this Touch) Free() {
  2572  	this.ref.Free()
  2573  }
  2574  
  2575  // Identifier returns the value of property "Touch.identifier".
  2576  //
  2577  // It returns ok=false if there is no such property.
  2578  func (this Touch) Identifier() (ret int32, ok bool) {
  2579  	ok = js.True == bindings.GetTouchIdentifier(
  2580  		this.ref, js.Pointer(&ret),
  2581  	)
  2582  	return
  2583  }
  2584  
  2585  // Target returns the value of property "Touch.target".
  2586  //
  2587  // It returns ok=false if there is no such property.
  2588  func (this Touch) Target() (ret EventTarget, ok bool) {
  2589  	ok = js.True == bindings.GetTouchTarget(
  2590  		this.ref, js.Pointer(&ret),
  2591  	)
  2592  	return
  2593  }
  2594  
  2595  // ScreenX returns the value of property "Touch.screenX".
  2596  //
  2597  // It returns ok=false if there is no such property.
  2598  func (this Touch) ScreenX() (ret float64, ok bool) {
  2599  	ok = js.True == bindings.GetTouchScreenX(
  2600  		this.ref, js.Pointer(&ret),
  2601  	)
  2602  	return
  2603  }
  2604  
  2605  // ScreenY returns the value of property "Touch.screenY".
  2606  //
  2607  // It returns ok=false if there is no such property.
  2608  func (this Touch) ScreenY() (ret float64, ok bool) {
  2609  	ok = js.True == bindings.GetTouchScreenY(
  2610  		this.ref, js.Pointer(&ret),
  2611  	)
  2612  	return
  2613  }
  2614  
  2615  // ClientX returns the value of property "Touch.clientX".
  2616  //
  2617  // It returns ok=false if there is no such property.
  2618  func (this Touch) ClientX() (ret float64, ok bool) {
  2619  	ok = js.True == bindings.GetTouchClientX(
  2620  		this.ref, js.Pointer(&ret),
  2621  	)
  2622  	return
  2623  }
  2624  
  2625  // ClientY returns the value of property "Touch.clientY".
  2626  //
  2627  // It returns ok=false if there is no such property.
  2628  func (this Touch) ClientY() (ret float64, ok bool) {
  2629  	ok = js.True == bindings.GetTouchClientY(
  2630  		this.ref, js.Pointer(&ret),
  2631  	)
  2632  	return
  2633  }
  2634  
  2635  // PageX returns the value of property "Touch.pageX".
  2636  //
  2637  // It returns ok=false if there is no such property.
  2638  func (this Touch) PageX() (ret float64, ok bool) {
  2639  	ok = js.True == bindings.GetTouchPageX(
  2640  		this.ref, js.Pointer(&ret),
  2641  	)
  2642  	return
  2643  }
  2644  
  2645  // PageY returns the value of property "Touch.pageY".
  2646  //
  2647  // It returns ok=false if there is no such property.
  2648  func (this Touch) PageY() (ret float64, ok bool) {
  2649  	ok = js.True == bindings.GetTouchPageY(
  2650  		this.ref, js.Pointer(&ret),
  2651  	)
  2652  	return
  2653  }
  2654  
  2655  // RadiusX returns the value of property "Touch.radiusX".
  2656  //
  2657  // It returns ok=false if there is no such property.
  2658  func (this Touch) RadiusX() (ret float32, ok bool) {
  2659  	ok = js.True == bindings.GetTouchRadiusX(
  2660  		this.ref, js.Pointer(&ret),
  2661  	)
  2662  	return
  2663  }
  2664  
  2665  // RadiusY returns the value of property "Touch.radiusY".
  2666  //
  2667  // It returns ok=false if there is no such property.
  2668  func (this Touch) RadiusY() (ret float32, ok bool) {
  2669  	ok = js.True == bindings.GetTouchRadiusY(
  2670  		this.ref, js.Pointer(&ret),
  2671  	)
  2672  	return
  2673  }
  2674  
  2675  // RotationAngle returns the value of property "Touch.rotationAngle".
  2676  //
  2677  // It returns ok=false if there is no such property.
  2678  func (this Touch) RotationAngle() (ret float32, ok bool) {
  2679  	ok = js.True == bindings.GetTouchRotationAngle(
  2680  		this.ref, js.Pointer(&ret),
  2681  	)
  2682  	return
  2683  }
  2684  
  2685  // Force returns the value of property "Touch.force".
  2686  //
  2687  // It returns ok=false if there is no such property.
  2688  func (this Touch) Force() (ret float32, ok bool) {
  2689  	ok = js.True == bindings.GetTouchForce(
  2690  		this.ref, js.Pointer(&ret),
  2691  	)
  2692  	return
  2693  }
  2694  
  2695  // AltitudeAngle returns the value of property "Touch.altitudeAngle".
  2696  //
  2697  // It returns ok=false if there is no such property.
  2698  func (this Touch) AltitudeAngle() (ret float32, ok bool) {
  2699  	ok = js.True == bindings.GetTouchAltitudeAngle(
  2700  		this.ref, js.Pointer(&ret),
  2701  	)
  2702  	return
  2703  }
  2704  
  2705  // AzimuthAngle returns the value of property "Touch.azimuthAngle".
  2706  //
  2707  // It returns ok=false if there is no such property.
  2708  func (this Touch) AzimuthAngle() (ret float32, ok bool) {
  2709  	ok = js.True == bindings.GetTouchAzimuthAngle(
  2710  		this.ref, js.Pointer(&ret),
  2711  	)
  2712  	return
  2713  }
  2714  
  2715  // TouchType returns the value of property "Touch.touchType".
  2716  //
  2717  // It returns ok=false if there is no such property.
  2718  func (this Touch) TouchType() (ret TouchType, ok bool) {
  2719  	ok = js.True == bindings.GetTouchTouchType(
  2720  		this.ref, js.Pointer(&ret),
  2721  	)
  2722  	return
  2723  }
  2724  
  2725  type TouchEventInit struct {
  2726  	// Touches is "TouchEventInit.touches"
  2727  	//
  2728  	// Optional, defaults to [].
  2729  	Touches js.Array[Touch]
  2730  	// TargetTouches is "TouchEventInit.targetTouches"
  2731  	//
  2732  	// Optional, defaults to [].
  2733  	TargetTouches js.Array[Touch]
  2734  	// ChangedTouches is "TouchEventInit.changedTouches"
  2735  	//
  2736  	// Optional, defaults to [].
  2737  	ChangedTouches js.Array[Touch]
  2738  	// CtrlKey is "TouchEventInit.ctrlKey"
  2739  	//
  2740  	// Optional, defaults to false.
  2741  	//
  2742  	// NOTE: FFI_USE_CtrlKey MUST be set to true to make this field effective.
  2743  	CtrlKey bool
  2744  	// ShiftKey is "TouchEventInit.shiftKey"
  2745  	//
  2746  	// Optional, defaults to false.
  2747  	//
  2748  	// NOTE: FFI_USE_ShiftKey MUST be set to true to make this field effective.
  2749  	ShiftKey bool
  2750  	// AltKey is "TouchEventInit.altKey"
  2751  	//
  2752  	// Optional, defaults to false.
  2753  	//
  2754  	// NOTE: FFI_USE_AltKey MUST be set to true to make this field effective.
  2755  	AltKey bool
  2756  	// MetaKey is "TouchEventInit.metaKey"
  2757  	//
  2758  	// Optional, defaults to false.
  2759  	//
  2760  	// NOTE: FFI_USE_MetaKey MUST be set to true to make this field effective.
  2761  	MetaKey bool
  2762  	// ModifierAltGraph is "TouchEventInit.modifierAltGraph"
  2763  	//
  2764  	// Optional, defaults to false.
  2765  	//
  2766  	// NOTE: FFI_USE_ModifierAltGraph MUST be set to true to make this field effective.
  2767  	ModifierAltGraph bool
  2768  	// ModifierCapsLock is "TouchEventInit.modifierCapsLock"
  2769  	//
  2770  	// Optional, defaults to false.
  2771  	//
  2772  	// NOTE: FFI_USE_ModifierCapsLock MUST be set to true to make this field effective.
  2773  	ModifierCapsLock bool
  2774  	// ModifierFn is "TouchEventInit.modifierFn"
  2775  	//
  2776  	// Optional, defaults to false.
  2777  	//
  2778  	// NOTE: FFI_USE_ModifierFn MUST be set to true to make this field effective.
  2779  	ModifierFn bool
  2780  	// ModifierFnLock is "TouchEventInit.modifierFnLock"
  2781  	//
  2782  	// Optional, defaults to false.
  2783  	//
  2784  	// NOTE: FFI_USE_ModifierFnLock MUST be set to true to make this field effective.
  2785  	ModifierFnLock bool
  2786  	// ModifierHyper is "TouchEventInit.modifierHyper"
  2787  	//
  2788  	// Optional, defaults to false.
  2789  	//
  2790  	// NOTE: FFI_USE_ModifierHyper MUST be set to true to make this field effective.
  2791  	ModifierHyper bool
  2792  	// ModifierNumLock is "TouchEventInit.modifierNumLock"
  2793  	//
  2794  	// Optional, defaults to false.
  2795  	//
  2796  	// NOTE: FFI_USE_ModifierNumLock MUST be set to true to make this field effective.
  2797  	ModifierNumLock bool
  2798  	// ModifierScrollLock is "TouchEventInit.modifierScrollLock"
  2799  	//
  2800  	// Optional, defaults to false.
  2801  	//
  2802  	// NOTE: FFI_USE_ModifierScrollLock MUST be set to true to make this field effective.
  2803  	ModifierScrollLock bool
  2804  	// ModifierSuper is "TouchEventInit.modifierSuper"
  2805  	//
  2806  	// Optional, defaults to false.
  2807  	//
  2808  	// NOTE: FFI_USE_ModifierSuper MUST be set to true to make this field effective.
  2809  	ModifierSuper bool
  2810  	// ModifierSymbol is "TouchEventInit.modifierSymbol"
  2811  	//
  2812  	// Optional, defaults to false.
  2813  	//
  2814  	// NOTE: FFI_USE_ModifierSymbol MUST be set to true to make this field effective.
  2815  	ModifierSymbol bool
  2816  	// ModifierSymbolLock is "TouchEventInit.modifierSymbolLock"
  2817  	//
  2818  	// Optional, defaults to false.
  2819  	//
  2820  	// NOTE: FFI_USE_ModifierSymbolLock MUST be set to true to make this field effective.
  2821  	ModifierSymbolLock bool
  2822  	// View is "TouchEventInit.view"
  2823  	//
  2824  	// Optional, defaults to null.
  2825  	View Window
  2826  	// Detail is "TouchEventInit.detail"
  2827  	//
  2828  	// Optional, defaults to 0.
  2829  	//
  2830  	// NOTE: FFI_USE_Detail MUST be set to true to make this field effective.
  2831  	Detail int32
  2832  	// Bubbles is "TouchEventInit.bubbles"
  2833  	//
  2834  	// Optional, defaults to false.
  2835  	//
  2836  	// NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective.
  2837  	Bubbles bool
  2838  	// Cancelable is "TouchEventInit.cancelable"
  2839  	//
  2840  	// Optional, defaults to false.
  2841  	//
  2842  	// NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective.
  2843  	Cancelable bool
  2844  	// Composed is "TouchEventInit.composed"
  2845  	//
  2846  	// Optional, defaults to false.
  2847  	//
  2848  	// NOTE: FFI_USE_Composed MUST be set to true to make this field effective.
  2849  	Composed bool
  2850  
  2851  	FFI_USE_CtrlKey            bool // for CtrlKey.
  2852  	FFI_USE_ShiftKey           bool // for ShiftKey.
  2853  	FFI_USE_AltKey             bool // for AltKey.
  2854  	FFI_USE_MetaKey            bool // for MetaKey.
  2855  	FFI_USE_ModifierAltGraph   bool // for ModifierAltGraph.
  2856  	FFI_USE_ModifierCapsLock   bool // for ModifierCapsLock.
  2857  	FFI_USE_ModifierFn         bool // for ModifierFn.
  2858  	FFI_USE_ModifierFnLock     bool // for ModifierFnLock.
  2859  	FFI_USE_ModifierHyper      bool // for ModifierHyper.
  2860  	FFI_USE_ModifierNumLock    bool // for ModifierNumLock.
  2861  	FFI_USE_ModifierScrollLock bool // for ModifierScrollLock.
  2862  	FFI_USE_ModifierSuper      bool // for ModifierSuper.
  2863  	FFI_USE_ModifierSymbol     bool // for ModifierSymbol.
  2864  	FFI_USE_ModifierSymbolLock bool // for ModifierSymbolLock.
  2865  	FFI_USE_Detail             bool // for Detail.
  2866  	FFI_USE_Bubbles            bool // for Bubbles.
  2867  	FFI_USE_Cancelable         bool // for Cancelable.
  2868  	FFI_USE_Composed           bool // for Composed.
  2869  
  2870  	FFI_USE bool
  2871  }
  2872  
  2873  // FromRef calls UpdateFrom and returns a TouchEventInit with all fields set.
  2874  func (p TouchEventInit) FromRef(ref js.Ref) TouchEventInit {
  2875  	p.UpdateFrom(ref)
  2876  	return p
  2877  }
  2878  
  2879  // New creates a new TouchEventInit in the application heap.
  2880  func (p TouchEventInit) New() js.Ref {
  2881  	return bindings.TouchEventInitJSLoad(
  2882  		js.Pointer(&p), js.True, 0,
  2883  	)
  2884  }
  2885  
  2886  // UpdateFrom copies value of all fields of the heap object to p.
  2887  func (p *TouchEventInit) UpdateFrom(ref js.Ref) {
  2888  	bindings.TouchEventInitJSStore(
  2889  		js.Pointer(p), ref,
  2890  	)
  2891  }
  2892  
  2893  // Update writes all fields of the p to the heap object referenced by ref.
  2894  func (p *TouchEventInit) Update(ref js.Ref) {
  2895  	bindings.TouchEventInitJSLoad(
  2896  		js.Pointer(p), js.False, ref,
  2897  	)
  2898  }
  2899  
  2900  // FreeMembers frees fields with heap reference, if recursive is true
  2901  // free all heap references reachable from p.
  2902  func (p *TouchEventInit) FreeMembers(recursive bool) {
  2903  	js.Free(
  2904  		p.Touches.Ref(),
  2905  		p.TargetTouches.Ref(),
  2906  		p.ChangedTouches.Ref(),
  2907  		p.View.Ref(),
  2908  	)
  2909  	p.Touches = p.Touches.FromRef(js.Undefined)
  2910  	p.TargetTouches = p.TargetTouches.FromRef(js.Undefined)
  2911  	p.ChangedTouches = p.ChangedTouches.FromRef(js.Undefined)
  2912  	p.View = p.View.FromRef(js.Undefined)
  2913  }
  2914  
  2915  type TouchList struct {
  2916  	ref js.Ref
  2917  }
  2918  
  2919  func (this TouchList) Once() TouchList {
  2920  	this.ref.Once()
  2921  	return this
  2922  }
  2923  
  2924  func (this TouchList) Ref() js.Ref {
  2925  	return this.ref
  2926  }
  2927  
  2928  func (this TouchList) FromRef(ref js.Ref) TouchList {
  2929  	this.ref = ref
  2930  	return this
  2931  }
  2932  
  2933  func (this TouchList) Free() {
  2934  	this.ref.Free()
  2935  }
  2936  
  2937  // Length returns the value of property "TouchList.length".
  2938  //
  2939  // It returns ok=false if there is no such property.
  2940  func (this TouchList) Length() (ret uint32, ok bool) {
  2941  	ok = js.True == bindings.GetTouchListLength(
  2942  		this.ref, js.Pointer(&ret),
  2943  	)
  2944  	return
  2945  }
  2946  
  2947  // HasFuncItem returns true if the method "TouchList.item" exists.
  2948  func (this TouchList) HasFuncItem() bool {
  2949  	return js.True == bindings.HasFuncTouchListItem(
  2950  		this.ref,
  2951  	)
  2952  }
  2953  
  2954  // FuncItem returns the method "TouchList.item".
  2955  func (this TouchList) FuncItem() (fn js.Func[func(index uint32) Touch]) {
  2956  	bindings.FuncTouchListItem(
  2957  		this.ref, js.Pointer(&fn),
  2958  	)
  2959  	return
  2960  }
  2961  
  2962  // Item calls the method "TouchList.item".
  2963  func (this TouchList) Item(index uint32) (ret Touch) {
  2964  	bindings.CallTouchListItem(
  2965  		this.ref, js.Pointer(&ret),
  2966  		uint32(index),
  2967  	)
  2968  
  2969  	return
  2970  }
  2971  
  2972  // TryItem calls the method "TouchList.item"
  2973  // in a try/catch block and returns (_, err, ok = false) when it went through
  2974  // the catch clause.
  2975  func (this TouchList) TryItem(index uint32) (ret Touch, exception js.Any, ok bool) {
  2976  	ok = js.True == bindings.TryTouchListItem(
  2977  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2978  		uint32(index),
  2979  	)
  2980  
  2981  	return
  2982  }
  2983  
  2984  func NewTouchEvent(typ js.String, eventInitDict TouchEventInit) (ret TouchEvent) {
  2985  	ret.ref = bindings.NewTouchEventByTouchEvent(
  2986  		typ.Ref(),
  2987  		js.Pointer(&eventInitDict))
  2988  	return
  2989  }
  2990  
  2991  func NewTouchEventByTouchEvent1(typ js.String) (ret TouchEvent) {
  2992  	ret.ref = bindings.NewTouchEventByTouchEvent1(
  2993  		typ.Ref())
  2994  	return
  2995  }
  2996  
  2997  type TouchEvent struct {
  2998  	UIEvent
  2999  }
  3000  
  3001  func (this TouchEvent) Once() TouchEvent {
  3002  	this.ref.Once()
  3003  	return this
  3004  }
  3005  
  3006  func (this TouchEvent) Ref() js.Ref {
  3007  	return this.UIEvent.Ref()
  3008  }
  3009  
  3010  func (this TouchEvent) FromRef(ref js.Ref) TouchEvent {
  3011  	this.UIEvent = this.UIEvent.FromRef(ref)
  3012  	return this
  3013  }
  3014  
  3015  func (this TouchEvent) Free() {
  3016  	this.ref.Free()
  3017  }
  3018  
  3019  // Touches returns the value of property "TouchEvent.touches".
  3020  //
  3021  // It returns ok=false if there is no such property.
  3022  func (this TouchEvent) Touches() (ret TouchList, ok bool) {
  3023  	ok = js.True == bindings.GetTouchEventTouches(
  3024  		this.ref, js.Pointer(&ret),
  3025  	)
  3026  	return
  3027  }
  3028  
  3029  // TargetTouches returns the value of property "TouchEvent.targetTouches".
  3030  //
  3031  // It returns ok=false if there is no such property.
  3032  func (this TouchEvent) TargetTouches() (ret TouchList, ok bool) {
  3033  	ok = js.True == bindings.GetTouchEventTargetTouches(
  3034  		this.ref, js.Pointer(&ret),
  3035  	)
  3036  	return
  3037  }
  3038  
  3039  // ChangedTouches returns the value of property "TouchEvent.changedTouches".
  3040  //
  3041  // It returns ok=false if there is no such property.
  3042  func (this TouchEvent) ChangedTouches() (ret TouchList, ok bool) {
  3043  	ok = js.True == bindings.GetTouchEventChangedTouches(
  3044  		this.ref, js.Pointer(&ret),
  3045  	)
  3046  	return
  3047  }
  3048  
  3049  // AltKey returns the value of property "TouchEvent.altKey".
  3050  //
  3051  // It returns ok=false if there is no such property.
  3052  func (this TouchEvent) AltKey() (ret bool, ok bool) {
  3053  	ok = js.True == bindings.GetTouchEventAltKey(
  3054  		this.ref, js.Pointer(&ret),
  3055  	)
  3056  	return
  3057  }
  3058  
  3059  // MetaKey returns the value of property "TouchEvent.metaKey".
  3060  //
  3061  // It returns ok=false if there is no such property.
  3062  func (this TouchEvent) MetaKey() (ret bool, ok bool) {
  3063  	ok = js.True == bindings.GetTouchEventMetaKey(
  3064  		this.ref, js.Pointer(&ret),
  3065  	)
  3066  	return
  3067  }
  3068  
  3069  // CtrlKey returns the value of property "TouchEvent.ctrlKey".
  3070  //
  3071  // It returns ok=false if there is no such property.
  3072  func (this TouchEvent) CtrlKey() (ret bool, ok bool) {
  3073  	ok = js.True == bindings.GetTouchEventCtrlKey(
  3074  		this.ref, js.Pointer(&ret),
  3075  	)
  3076  	return
  3077  }
  3078  
  3079  // ShiftKey returns the value of property "TouchEvent.shiftKey".
  3080  //
  3081  // It returns ok=false if there is no such property.
  3082  func (this TouchEvent) ShiftKey() (ret bool, ok bool) {
  3083  	ok = js.True == bindings.GetTouchEventShiftKey(
  3084  		this.ref, js.Pointer(&ret),
  3085  	)
  3086  	return
  3087  }
  3088  
  3089  // HasFuncGetModifierState returns true if the method "TouchEvent.getModifierState" exists.
  3090  func (this TouchEvent) HasFuncGetModifierState() bool {
  3091  	return js.True == bindings.HasFuncTouchEventGetModifierState(
  3092  		this.ref,
  3093  	)
  3094  }
  3095  
  3096  // FuncGetModifierState returns the method "TouchEvent.getModifierState".
  3097  func (this TouchEvent) FuncGetModifierState() (fn js.Func[func(keyArg js.String) bool]) {
  3098  	bindings.FuncTouchEventGetModifierState(
  3099  		this.ref, js.Pointer(&fn),
  3100  	)
  3101  	return
  3102  }
  3103  
  3104  // GetModifierState calls the method "TouchEvent.getModifierState".
  3105  func (this TouchEvent) GetModifierState(keyArg js.String) (ret bool) {
  3106  	bindings.CallTouchEventGetModifierState(
  3107  		this.ref, js.Pointer(&ret),
  3108  		keyArg.Ref(),
  3109  	)
  3110  
  3111  	return
  3112  }
  3113  
  3114  // TryGetModifierState calls the method "TouchEvent.getModifierState"
  3115  // in a try/catch block and returns (_, err, ok = false) when it went through
  3116  // the catch clause.
  3117  func (this TouchEvent) TryGetModifierState(keyArg js.String) (ret bool, exception js.Any, ok bool) {
  3118  	ok = js.True == bindings.TryTouchEventGetModifierState(
  3119  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3120  		keyArg.Ref(),
  3121  	)
  3122  
  3123  	return
  3124  }
  3125  
  3126  type OneOf_VideoTrack_AudioTrack_TextTrack struct {
  3127  	ref js.Ref
  3128  }
  3129  
  3130  func (x OneOf_VideoTrack_AudioTrack_TextTrack) Ref() js.Ref {
  3131  	return x.ref
  3132  }
  3133  
  3134  func (x OneOf_VideoTrack_AudioTrack_TextTrack) Free() {
  3135  	x.ref.Free()
  3136  }
  3137  
  3138  func (x OneOf_VideoTrack_AudioTrack_TextTrack) FromRef(ref js.Ref) OneOf_VideoTrack_AudioTrack_TextTrack {
  3139  	return OneOf_VideoTrack_AudioTrack_TextTrack{
  3140  		ref: ref,
  3141  	}
  3142  }
  3143  
  3144  func (x OneOf_VideoTrack_AudioTrack_TextTrack) VideoTrack() VideoTrack {
  3145  	return VideoTrack{}.FromRef(x.ref)
  3146  }
  3147  
  3148  func (x OneOf_VideoTrack_AudioTrack_TextTrack) AudioTrack() AudioTrack {
  3149  	return AudioTrack{}.FromRef(x.ref)
  3150  }
  3151  
  3152  func (x OneOf_VideoTrack_AudioTrack_TextTrack) TextTrack() TextTrack {
  3153  	return TextTrack{}.FromRef(x.ref)
  3154  }
  3155  
  3156  type TrackEventInit struct {
  3157  	// Track is "TrackEventInit.track"
  3158  	//
  3159  	// Optional, defaults to null.
  3160  	Track OneOf_VideoTrack_AudioTrack_TextTrack
  3161  	// Bubbles is "TrackEventInit.bubbles"
  3162  	//
  3163  	// Optional, defaults to false.
  3164  	//
  3165  	// NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective.
  3166  	Bubbles bool
  3167  	// Cancelable is "TrackEventInit.cancelable"
  3168  	//
  3169  	// Optional, defaults to false.
  3170  	//
  3171  	// NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective.
  3172  	Cancelable bool
  3173  	// Composed is "TrackEventInit.composed"
  3174  	//
  3175  	// Optional, defaults to false.
  3176  	//
  3177  	// NOTE: FFI_USE_Composed MUST be set to true to make this field effective.
  3178  	Composed bool
  3179  
  3180  	FFI_USE_Bubbles    bool // for Bubbles.
  3181  	FFI_USE_Cancelable bool // for Cancelable.
  3182  	FFI_USE_Composed   bool // for Composed.
  3183  
  3184  	FFI_USE bool
  3185  }
  3186  
  3187  // FromRef calls UpdateFrom and returns a TrackEventInit with all fields set.
  3188  func (p TrackEventInit) FromRef(ref js.Ref) TrackEventInit {
  3189  	p.UpdateFrom(ref)
  3190  	return p
  3191  }
  3192  
  3193  // New creates a new TrackEventInit in the application heap.
  3194  func (p TrackEventInit) New() js.Ref {
  3195  	return bindings.TrackEventInitJSLoad(
  3196  		js.Pointer(&p), js.True, 0,
  3197  	)
  3198  }
  3199  
  3200  // UpdateFrom copies value of all fields of the heap object to p.
  3201  func (p *TrackEventInit) UpdateFrom(ref js.Ref) {
  3202  	bindings.TrackEventInitJSStore(
  3203  		js.Pointer(p), ref,
  3204  	)
  3205  }
  3206  
  3207  // Update writes all fields of the p to the heap object referenced by ref.
  3208  func (p *TrackEventInit) Update(ref js.Ref) {
  3209  	bindings.TrackEventInitJSLoad(
  3210  		js.Pointer(p), js.False, ref,
  3211  	)
  3212  }
  3213  
  3214  // FreeMembers frees fields with heap reference, if recursive is true
  3215  // free all heap references reachable from p.
  3216  func (p *TrackEventInit) FreeMembers(recursive bool) {
  3217  	js.Free(
  3218  		p.Track.Ref(),
  3219  	)
  3220  	p.Track = p.Track.FromRef(js.Undefined)
  3221  }
  3222  
  3223  func NewTrackEvent(typ js.String, eventInitDict TrackEventInit) (ret TrackEvent) {
  3224  	ret.ref = bindings.NewTrackEventByTrackEvent(
  3225  		typ.Ref(),
  3226  		js.Pointer(&eventInitDict))
  3227  	return
  3228  }
  3229  
  3230  func NewTrackEventByTrackEvent1(typ js.String) (ret TrackEvent) {
  3231  	ret.ref = bindings.NewTrackEventByTrackEvent1(
  3232  		typ.Ref())
  3233  	return
  3234  }
  3235  
  3236  type TrackEvent struct {
  3237  	Event
  3238  }
  3239  
  3240  func (this TrackEvent) Once() TrackEvent {
  3241  	this.ref.Once()
  3242  	return this
  3243  }
  3244  
  3245  func (this TrackEvent) Ref() js.Ref {
  3246  	return this.Event.Ref()
  3247  }
  3248  
  3249  func (this TrackEvent) FromRef(ref js.Ref) TrackEvent {
  3250  	this.Event = this.Event.FromRef(ref)
  3251  	return this
  3252  }
  3253  
  3254  func (this TrackEvent) Free() {
  3255  	this.ref.Free()
  3256  }
  3257  
  3258  // Track returns the value of property "TrackEvent.track".
  3259  //
  3260  // It returns ok=false if there is no such property.
  3261  func (this TrackEvent) Track() (ret OneOf_VideoTrack_AudioTrack_TextTrack, ok bool) {
  3262  	ok = js.True == bindings.GetTrackEventTrack(
  3263  		this.ref, js.Pointer(&ret),
  3264  	)
  3265  	return
  3266  }
  3267  
  3268  func NewTransformStream(transformer js.Object, writableStrategy QueuingStrategy, readableStrategy QueuingStrategy) (ret TransformStream) {
  3269  	ret.ref = bindings.NewTransformStreamByTransformStream(
  3270  		transformer.Ref(),
  3271  		js.Pointer(&writableStrategy),
  3272  		js.Pointer(&readableStrategy))
  3273  	return
  3274  }
  3275  
  3276  func NewTransformStreamByTransformStream1(transformer js.Object, writableStrategy QueuingStrategy) (ret TransformStream) {
  3277  	ret.ref = bindings.NewTransformStreamByTransformStream1(
  3278  		transformer.Ref(),
  3279  		js.Pointer(&writableStrategy))
  3280  	return
  3281  }
  3282  
  3283  func NewTransformStreamByTransformStream2(transformer js.Object) (ret TransformStream) {
  3284  	ret.ref = bindings.NewTransformStreamByTransformStream2(
  3285  		transformer.Ref())
  3286  	return
  3287  }
  3288  
  3289  func NewTransformStreamByTransformStream3() (ret TransformStream) {
  3290  	ret.ref = bindings.NewTransformStreamByTransformStream3()
  3291  	return
  3292  }
  3293  
  3294  type TransformStream struct {
  3295  	ref js.Ref
  3296  }
  3297  
  3298  func (this TransformStream) Once() TransformStream {
  3299  	this.ref.Once()
  3300  	return this
  3301  }
  3302  
  3303  func (this TransformStream) Ref() js.Ref {
  3304  	return this.ref
  3305  }
  3306  
  3307  func (this TransformStream) FromRef(ref js.Ref) TransformStream {
  3308  	this.ref = ref
  3309  	return this
  3310  }
  3311  
  3312  func (this TransformStream) Free() {
  3313  	this.ref.Free()
  3314  }
  3315  
  3316  // Readable returns the value of property "TransformStream.readable".
  3317  //
  3318  // It returns ok=false if there is no such property.
  3319  func (this TransformStream) Readable() (ret ReadableStream, ok bool) {
  3320  	ok = js.True == bindings.GetTransformStreamReadable(
  3321  		this.ref, js.Pointer(&ret),
  3322  	)
  3323  	return
  3324  }
  3325  
  3326  // Writable returns the value of property "TransformStream.writable".
  3327  //
  3328  // It returns ok=false if there is no such property.
  3329  func (this TransformStream) Writable() (ret WritableStream, ok bool) {
  3330  	ok = js.True == bindings.GetTransformStreamWritable(
  3331  		this.ref, js.Pointer(&ret),
  3332  	)
  3333  	return
  3334  }
  3335  
  3336  type TransformStreamDefaultController struct {
  3337  	ref js.Ref
  3338  }
  3339  
  3340  func (this TransformStreamDefaultController) Once() TransformStreamDefaultController {
  3341  	this.ref.Once()
  3342  	return this
  3343  }
  3344  
  3345  func (this TransformStreamDefaultController) Ref() js.Ref {
  3346  	return this.ref
  3347  }
  3348  
  3349  func (this TransformStreamDefaultController) FromRef(ref js.Ref) TransformStreamDefaultController {
  3350  	this.ref = ref
  3351  	return this
  3352  }
  3353  
  3354  func (this TransformStreamDefaultController) Free() {
  3355  	this.ref.Free()
  3356  }
  3357  
  3358  // DesiredSize returns the value of property "TransformStreamDefaultController.desiredSize".
  3359  //
  3360  // It returns ok=false if there is no such property.
  3361  func (this TransformStreamDefaultController) DesiredSize() (ret float64, ok bool) {
  3362  	ok = js.True == bindings.GetTransformStreamDefaultControllerDesiredSize(
  3363  		this.ref, js.Pointer(&ret),
  3364  	)
  3365  	return
  3366  }
  3367  
  3368  // HasFuncEnqueue returns true if the method "TransformStreamDefaultController.enqueue" exists.
  3369  func (this TransformStreamDefaultController) HasFuncEnqueue() bool {
  3370  	return js.True == bindings.HasFuncTransformStreamDefaultControllerEnqueue(
  3371  		this.ref,
  3372  	)
  3373  }
  3374  
  3375  // FuncEnqueue returns the method "TransformStreamDefaultController.enqueue".
  3376  func (this TransformStreamDefaultController) FuncEnqueue() (fn js.Func[func(chunk js.Any)]) {
  3377  	bindings.FuncTransformStreamDefaultControllerEnqueue(
  3378  		this.ref, js.Pointer(&fn),
  3379  	)
  3380  	return
  3381  }
  3382  
  3383  // Enqueue calls the method "TransformStreamDefaultController.enqueue".
  3384  func (this TransformStreamDefaultController) Enqueue(chunk js.Any) (ret js.Void) {
  3385  	bindings.CallTransformStreamDefaultControllerEnqueue(
  3386  		this.ref, js.Pointer(&ret),
  3387  		chunk.Ref(),
  3388  	)
  3389  
  3390  	return
  3391  }
  3392  
  3393  // TryEnqueue calls the method "TransformStreamDefaultController.enqueue"
  3394  // in a try/catch block and returns (_, err, ok = false) when it went through
  3395  // the catch clause.
  3396  func (this TransformStreamDefaultController) TryEnqueue(chunk js.Any) (ret js.Void, exception js.Any, ok bool) {
  3397  	ok = js.True == bindings.TryTransformStreamDefaultControllerEnqueue(
  3398  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3399  		chunk.Ref(),
  3400  	)
  3401  
  3402  	return
  3403  }
  3404  
  3405  // HasFuncEnqueue1 returns true if the method "TransformStreamDefaultController.enqueue" exists.
  3406  func (this TransformStreamDefaultController) HasFuncEnqueue1() bool {
  3407  	return js.True == bindings.HasFuncTransformStreamDefaultControllerEnqueue1(
  3408  		this.ref,
  3409  	)
  3410  }
  3411  
  3412  // FuncEnqueue1 returns the method "TransformStreamDefaultController.enqueue".
  3413  func (this TransformStreamDefaultController) FuncEnqueue1() (fn js.Func[func()]) {
  3414  	bindings.FuncTransformStreamDefaultControllerEnqueue1(
  3415  		this.ref, js.Pointer(&fn),
  3416  	)
  3417  	return
  3418  }
  3419  
  3420  // Enqueue1 calls the method "TransformStreamDefaultController.enqueue".
  3421  func (this TransformStreamDefaultController) Enqueue1() (ret js.Void) {
  3422  	bindings.CallTransformStreamDefaultControllerEnqueue1(
  3423  		this.ref, js.Pointer(&ret),
  3424  	)
  3425  
  3426  	return
  3427  }
  3428  
  3429  // TryEnqueue1 calls the method "TransformStreamDefaultController.enqueue"
  3430  // in a try/catch block and returns (_, err, ok = false) when it went through
  3431  // the catch clause.
  3432  func (this TransformStreamDefaultController) TryEnqueue1() (ret js.Void, exception js.Any, ok bool) {
  3433  	ok = js.True == bindings.TryTransformStreamDefaultControllerEnqueue1(
  3434  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3435  	)
  3436  
  3437  	return
  3438  }
  3439  
  3440  // HasFuncError returns true if the method "TransformStreamDefaultController.error" exists.
  3441  func (this TransformStreamDefaultController) HasFuncError() bool {
  3442  	return js.True == bindings.HasFuncTransformStreamDefaultControllerError(
  3443  		this.ref,
  3444  	)
  3445  }
  3446  
  3447  // FuncError returns the method "TransformStreamDefaultController.error".
  3448  func (this TransformStreamDefaultController) FuncError() (fn js.Func[func(reason js.Any)]) {
  3449  	bindings.FuncTransformStreamDefaultControllerError(
  3450  		this.ref, js.Pointer(&fn),
  3451  	)
  3452  	return
  3453  }
  3454  
  3455  // Error calls the method "TransformStreamDefaultController.error".
  3456  func (this TransformStreamDefaultController) Error(reason js.Any) (ret js.Void) {
  3457  	bindings.CallTransformStreamDefaultControllerError(
  3458  		this.ref, js.Pointer(&ret),
  3459  		reason.Ref(),
  3460  	)
  3461  
  3462  	return
  3463  }
  3464  
  3465  // TryError calls the method "TransformStreamDefaultController.error"
  3466  // in a try/catch block and returns (_, err, ok = false) when it went through
  3467  // the catch clause.
  3468  func (this TransformStreamDefaultController) TryError(reason js.Any) (ret js.Void, exception js.Any, ok bool) {
  3469  	ok = js.True == bindings.TryTransformStreamDefaultControllerError(
  3470  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3471  		reason.Ref(),
  3472  	)
  3473  
  3474  	return
  3475  }
  3476  
  3477  // HasFuncError1 returns true if the method "TransformStreamDefaultController.error" exists.
  3478  func (this TransformStreamDefaultController) HasFuncError1() bool {
  3479  	return js.True == bindings.HasFuncTransformStreamDefaultControllerError1(
  3480  		this.ref,
  3481  	)
  3482  }
  3483  
  3484  // FuncError1 returns the method "TransformStreamDefaultController.error".
  3485  func (this TransformStreamDefaultController) FuncError1() (fn js.Func[func()]) {
  3486  	bindings.FuncTransformStreamDefaultControllerError1(
  3487  		this.ref, js.Pointer(&fn),
  3488  	)
  3489  	return
  3490  }
  3491  
  3492  // Error1 calls the method "TransformStreamDefaultController.error".
  3493  func (this TransformStreamDefaultController) Error1() (ret js.Void) {
  3494  	bindings.CallTransformStreamDefaultControllerError1(
  3495  		this.ref, js.Pointer(&ret),
  3496  	)
  3497  
  3498  	return
  3499  }
  3500  
  3501  // TryError1 calls the method "TransformStreamDefaultController.error"
  3502  // in a try/catch block and returns (_, err, ok = false) when it went through
  3503  // the catch clause.
  3504  func (this TransformStreamDefaultController) TryError1() (ret js.Void, exception js.Any, ok bool) {
  3505  	ok = js.True == bindings.TryTransformStreamDefaultControllerError1(
  3506  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3507  	)
  3508  
  3509  	return
  3510  }
  3511  
  3512  // HasFuncTerminate returns true if the method "TransformStreamDefaultController.terminate" exists.
  3513  func (this TransformStreamDefaultController) HasFuncTerminate() bool {
  3514  	return js.True == bindings.HasFuncTransformStreamDefaultControllerTerminate(
  3515  		this.ref,
  3516  	)
  3517  }
  3518  
  3519  // FuncTerminate returns the method "TransformStreamDefaultController.terminate".
  3520  func (this TransformStreamDefaultController) FuncTerminate() (fn js.Func[func()]) {
  3521  	bindings.FuncTransformStreamDefaultControllerTerminate(
  3522  		this.ref, js.Pointer(&fn),
  3523  	)
  3524  	return
  3525  }
  3526  
  3527  // Terminate calls the method "TransformStreamDefaultController.terminate".
  3528  func (this TransformStreamDefaultController) Terminate() (ret js.Void) {
  3529  	bindings.CallTransformStreamDefaultControllerTerminate(
  3530  		this.ref, js.Pointer(&ret),
  3531  	)
  3532  
  3533  	return
  3534  }
  3535  
  3536  // TryTerminate calls the method "TransformStreamDefaultController.terminate"
  3537  // in a try/catch block and returns (_, err, ok = false) when it went through
  3538  // the catch clause.
  3539  func (this TransformStreamDefaultController) TryTerminate() (ret js.Void, exception js.Any, ok bool) {
  3540  	ok = js.True == bindings.TryTransformStreamDefaultControllerTerminate(
  3541  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3542  	)
  3543  
  3544  	return
  3545  }
  3546  
  3547  type TransformerStartCallbackFunc func(this js.Ref, controller TransformStreamDefaultController) js.Ref
  3548  
  3549  func (fn TransformerStartCallbackFunc) Register() js.Func[func(controller TransformStreamDefaultController) js.Any] {
  3550  	return js.RegisterCallback[func(controller TransformStreamDefaultController) js.Any](
  3551  		fn, abi.FuncPCABIInternal(fn),
  3552  	)
  3553  }
  3554  
  3555  func (fn TransformerStartCallbackFunc) DispatchCallback(
  3556  	targetPC uintptr, ctx *js.CallbackContext,
  3557  ) {
  3558  	args := ctx.Args()
  3559  	if len(args) != 1+1 /* js this */ ||
  3560  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  3561  		js.ThrowInvalidCallbackInvocation()
  3562  	}
  3563  
  3564  	if ctx.Return(fn(
  3565  		args[0],
  3566  
  3567  		TransformStreamDefaultController{}.FromRef(args[0+1]),
  3568  	)) {
  3569  		return
  3570  	}
  3571  
  3572  	js.ThrowCallbackValueNotReturned()
  3573  }
  3574  
  3575  type TransformerStartCallback[T any] struct {
  3576  	Fn  func(arg T, this js.Ref, controller TransformStreamDefaultController) js.Ref
  3577  	Arg T
  3578  }
  3579  
  3580  func (cb *TransformerStartCallback[T]) Register() js.Func[func(controller TransformStreamDefaultController) js.Any] {
  3581  	return js.RegisterCallback[func(controller TransformStreamDefaultController) js.Any](
  3582  		cb, abi.FuncPCABIInternal(cb.Fn),
  3583  	)
  3584  }
  3585  
  3586  func (cb *TransformerStartCallback[T]) DispatchCallback(
  3587  	targetPC uintptr, ctx *js.CallbackContext,
  3588  ) {
  3589  	args := ctx.Args()
  3590  	if len(args) != 1+1 /* js this */ ||
  3591  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  3592  		js.ThrowInvalidCallbackInvocation()
  3593  	}
  3594  
  3595  	if ctx.Return(cb.Fn(
  3596  		cb.Arg,
  3597  		args[0],
  3598  
  3599  		TransformStreamDefaultController{}.FromRef(args[0+1]),
  3600  	)) {
  3601  		return
  3602  	}
  3603  
  3604  	js.ThrowCallbackValueNotReturned()
  3605  }
  3606  
  3607  type TransformerTransformCallbackFunc func(this js.Ref, chunk js.Any, controller TransformStreamDefaultController) js.Ref
  3608  
  3609  func (fn TransformerTransformCallbackFunc) Register() js.Func[func(chunk js.Any, controller TransformStreamDefaultController) js.Promise[js.Void]] {
  3610  	return js.RegisterCallback[func(chunk js.Any, controller TransformStreamDefaultController) js.Promise[js.Void]](
  3611  		fn, abi.FuncPCABIInternal(fn),
  3612  	)
  3613  }
  3614  
  3615  func (fn TransformerTransformCallbackFunc) DispatchCallback(
  3616  	targetPC uintptr, ctx *js.CallbackContext,
  3617  ) {
  3618  	args := ctx.Args()
  3619  	if len(args) != 2+1 /* js this */ ||
  3620  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  3621  		js.ThrowInvalidCallbackInvocation()
  3622  	}
  3623  
  3624  	if ctx.Return(fn(
  3625  		args[0],
  3626  
  3627  		js.Any{}.FromRef(args[0+1]),
  3628  		TransformStreamDefaultController{}.FromRef(args[1+1]),
  3629  	)) {
  3630  		return
  3631  	}
  3632  
  3633  	js.ThrowCallbackValueNotReturned()
  3634  }
  3635  
  3636  type TransformerTransformCallback[T any] struct {
  3637  	Fn  func(arg T, this js.Ref, chunk js.Any, controller TransformStreamDefaultController) js.Ref
  3638  	Arg T
  3639  }
  3640  
  3641  func (cb *TransformerTransformCallback[T]) Register() js.Func[func(chunk js.Any, controller TransformStreamDefaultController) js.Promise[js.Void]] {
  3642  	return js.RegisterCallback[func(chunk js.Any, controller TransformStreamDefaultController) js.Promise[js.Void]](
  3643  		cb, abi.FuncPCABIInternal(cb.Fn),
  3644  	)
  3645  }
  3646  
  3647  func (cb *TransformerTransformCallback[T]) DispatchCallback(
  3648  	targetPC uintptr, ctx *js.CallbackContext,
  3649  ) {
  3650  	args := ctx.Args()
  3651  	if len(args) != 2+1 /* js this */ ||
  3652  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  3653  		js.ThrowInvalidCallbackInvocation()
  3654  	}
  3655  
  3656  	if ctx.Return(cb.Fn(
  3657  		cb.Arg,
  3658  		args[0],
  3659  
  3660  		js.Any{}.FromRef(args[0+1]),
  3661  		TransformStreamDefaultController{}.FromRef(args[1+1]),
  3662  	)) {
  3663  		return
  3664  	}
  3665  
  3666  	js.ThrowCallbackValueNotReturned()
  3667  }
  3668  
  3669  type TransformerFlushCallbackFunc func(this js.Ref, controller TransformStreamDefaultController) js.Ref
  3670  
  3671  func (fn TransformerFlushCallbackFunc) Register() js.Func[func(controller TransformStreamDefaultController) js.Promise[js.Void]] {
  3672  	return js.RegisterCallback[func(controller TransformStreamDefaultController) js.Promise[js.Void]](
  3673  		fn, abi.FuncPCABIInternal(fn),
  3674  	)
  3675  }
  3676  
  3677  func (fn TransformerFlushCallbackFunc) DispatchCallback(
  3678  	targetPC uintptr, ctx *js.CallbackContext,
  3679  ) {
  3680  	args := ctx.Args()
  3681  	if len(args) != 1+1 /* js this */ ||
  3682  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  3683  		js.ThrowInvalidCallbackInvocation()
  3684  	}
  3685  
  3686  	if ctx.Return(fn(
  3687  		args[0],
  3688  
  3689  		TransformStreamDefaultController{}.FromRef(args[0+1]),
  3690  	)) {
  3691  		return
  3692  	}
  3693  
  3694  	js.ThrowCallbackValueNotReturned()
  3695  }
  3696  
  3697  type TransformerFlushCallback[T any] struct {
  3698  	Fn  func(arg T, this js.Ref, controller TransformStreamDefaultController) js.Ref
  3699  	Arg T
  3700  }
  3701  
  3702  func (cb *TransformerFlushCallback[T]) Register() js.Func[func(controller TransformStreamDefaultController) js.Promise[js.Void]] {
  3703  	return js.RegisterCallback[func(controller TransformStreamDefaultController) js.Promise[js.Void]](
  3704  		cb, abi.FuncPCABIInternal(cb.Fn),
  3705  	)
  3706  }
  3707  
  3708  func (cb *TransformerFlushCallback[T]) DispatchCallback(
  3709  	targetPC uintptr, ctx *js.CallbackContext,
  3710  ) {
  3711  	args := ctx.Args()
  3712  	if len(args) != 1+1 /* js this */ ||
  3713  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  3714  		js.ThrowInvalidCallbackInvocation()
  3715  	}
  3716  
  3717  	if ctx.Return(cb.Fn(
  3718  		cb.Arg,
  3719  		args[0],
  3720  
  3721  		TransformStreamDefaultController{}.FromRef(args[0+1]),
  3722  	)) {
  3723  		return
  3724  	}
  3725  
  3726  	js.ThrowCallbackValueNotReturned()
  3727  }