github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis23_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 IdleRequestCallbackFunc func(this js.Ref, deadline IdleDeadline) js.Ref
    13  
    14  func (fn IdleRequestCallbackFunc) Register() js.Func[func(deadline IdleDeadline)] {
    15  	return js.RegisterCallback[func(deadline IdleDeadline)](
    16  		fn, abi.FuncPCABIInternal(fn),
    17  	)
    18  }
    19  
    20  func (fn IdleRequestCallbackFunc) DispatchCallback(
    21  	targetPC uintptr, ctx *js.CallbackContext,
    22  ) {
    23  	args := ctx.Args()
    24  	if len(args) != 1+1 /* js this */ ||
    25  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
    26  		js.ThrowInvalidCallbackInvocation()
    27  	}
    28  
    29  	if ctx.Return(fn(
    30  		args[0],
    31  
    32  		IdleDeadline{}.FromRef(args[0+1]),
    33  	)) {
    34  		return
    35  	}
    36  
    37  	js.ThrowCallbackValueNotReturned()
    38  }
    39  
    40  type IdleRequestCallback[T any] struct {
    41  	Fn  func(arg T, this js.Ref, deadline IdleDeadline) js.Ref
    42  	Arg T
    43  }
    44  
    45  func (cb *IdleRequestCallback[T]) Register() js.Func[func(deadline IdleDeadline)] {
    46  	return js.RegisterCallback[func(deadline IdleDeadline)](
    47  		cb, abi.FuncPCABIInternal(cb.Fn),
    48  	)
    49  }
    50  
    51  func (cb *IdleRequestCallback[T]) DispatchCallback(
    52  	targetPC uintptr, ctx *js.CallbackContext,
    53  ) {
    54  	args := ctx.Args()
    55  	if len(args) != 1+1 /* js this */ ||
    56  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
    57  		js.ThrowInvalidCallbackInvocation()
    58  	}
    59  
    60  	if ctx.Return(cb.Fn(
    61  		cb.Arg,
    62  		args[0],
    63  
    64  		IdleDeadline{}.FromRef(args[0+1]),
    65  	)) {
    66  		return
    67  	}
    68  
    69  	js.ThrowCallbackValueNotReturned()
    70  }
    71  
    72  type IdleDeadline struct {
    73  	ref js.Ref
    74  }
    75  
    76  func (this IdleDeadline) Once() IdleDeadline {
    77  	this.ref.Once()
    78  	return this
    79  }
    80  
    81  func (this IdleDeadline) Ref() js.Ref {
    82  	return this.ref
    83  }
    84  
    85  func (this IdleDeadline) FromRef(ref js.Ref) IdleDeadline {
    86  	this.ref = ref
    87  	return this
    88  }
    89  
    90  func (this IdleDeadline) Free() {
    91  	this.ref.Free()
    92  }
    93  
    94  // DidTimeout returns the value of property "IdleDeadline.didTimeout".
    95  //
    96  // It returns ok=false if there is no such property.
    97  func (this IdleDeadline) DidTimeout() (ret bool, ok bool) {
    98  	ok = js.True == bindings.GetIdleDeadlineDidTimeout(
    99  		this.ref, js.Pointer(&ret),
   100  	)
   101  	return
   102  }
   103  
   104  // HasFuncTimeRemaining returns true if the method "IdleDeadline.timeRemaining" exists.
   105  func (this IdleDeadline) HasFuncTimeRemaining() bool {
   106  	return js.True == bindings.HasFuncIdleDeadlineTimeRemaining(
   107  		this.ref,
   108  	)
   109  }
   110  
   111  // FuncTimeRemaining returns the method "IdleDeadline.timeRemaining".
   112  func (this IdleDeadline) FuncTimeRemaining() (fn js.Func[func() DOMHighResTimeStamp]) {
   113  	bindings.FuncIdleDeadlineTimeRemaining(
   114  		this.ref, js.Pointer(&fn),
   115  	)
   116  	return
   117  }
   118  
   119  // TimeRemaining calls the method "IdleDeadline.timeRemaining".
   120  func (this IdleDeadline) TimeRemaining() (ret DOMHighResTimeStamp) {
   121  	bindings.CallIdleDeadlineTimeRemaining(
   122  		this.ref, js.Pointer(&ret),
   123  	)
   124  
   125  	return
   126  }
   127  
   128  // TryTimeRemaining calls the method "IdleDeadline.timeRemaining"
   129  // in a try/catch block and returns (_, err, ok = false) when it went through
   130  // the catch clause.
   131  func (this IdleDeadline) TryTimeRemaining() (ret DOMHighResTimeStamp, exception js.Any, ok bool) {
   132  	ok = js.True == bindings.TryIdleDeadlineTimeRemaining(
   133  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   134  	)
   135  
   136  	return
   137  }
   138  
   139  type IdleRequestOptions struct {
   140  	// Timeout is "IdleRequestOptions.timeout"
   141  	//
   142  	// Optional
   143  	//
   144  	// NOTE: FFI_USE_Timeout MUST be set to true to make this field effective.
   145  	Timeout uint32
   146  
   147  	FFI_USE_Timeout bool // for Timeout.
   148  
   149  	FFI_USE bool
   150  }
   151  
   152  // FromRef calls UpdateFrom and returns a IdleRequestOptions with all fields set.
   153  func (p IdleRequestOptions) FromRef(ref js.Ref) IdleRequestOptions {
   154  	p.UpdateFrom(ref)
   155  	return p
   156  }
   157  
   158  // New creates a new IdleRequestOptions in the application heap.
   159  func (p IdleRequestOptions) New() js.Ref {
   160  	return bindings.IdleRequestOptionsJSLoad(
   161  		js.Pointer(&p), js.True, 0,
   162  	)
   163  }
   164  
   165  // UpdateFrom copies value of all fields of the heap object to p.
   166  func (p *IdleRequestOptions) UpdateFrom(ref js.Ref) {
   167  	bindings.IdleRequestOptionsJSStore(
   168  		js.Pointer(p), ref,
   169  	)
   170  }
   171  
   172  // Update writes all fields of the p to the heap object referenced by ref.
   173  func (p *IdleRequestOptions) Update(ref js.Ref) {
   174  	bindings.IdleRequestOptionsJSLoad(
   175  		js.Pointer(p), js.False, ref,
   176  	)
   177  }
   178  
   179  // FreeMembers frees fields with heap reference, if recursive is true
   180  // free all heap references reachable from p.
   181  func (p *IdleRequestOptions) FreeMembers(recursive bool) {
   182  }
   183  
   184  type WriteCommandType uint32
   185  
   186  const (
   187  	_ WriteCommandType = iota
   188  
   189  	WriteCommandType_WRITE
   190  	WriteCommandType_SEEK
   191  	WriteCommandType_TRUNCATE
   192  )
   193  
   194  func (WriteCommandType) FromRef(str js.Ref) WriteCommandType {
   195  	return WriteCommandType(bindings.ConstOfWriteCommandType(str))
   196  }
   197  
   198  func (x WriteCommandType) String() (string, bool) {
   199  	switch x {
   200  	case WriteCommandType_WRITE:
   201  		return "write", true
   202  	case WriteCommandType_SEEK:
   203  		return "seek", true
   204  	case WriteCommandType_TRUNCATE:
   205  		return "truncate", true
   206  	default:
   207  		return "", false
   208  	}
   209  }
   210  
   211  type WriteParams struct {
   212  	// Type is "WriteParams.type"
   213  	//
   214  	// Required
   215  	Type WriteCommandType
   216  	// Size is "WriteParams.size"
   217  	//
   218  	// Optional
   219  	//
   220  	// NOTE: FFI_USE_Size MUST be set to true to make this field effective.
   221  	Size uint64
   222  	// Position is "WriteParams.position"
   223  	//
   224  	// Optional
   225  	//
   226  	// NOTE: FFI_USE_Position MUST be set to true to make this field effective.
   227  	Position uint64
   228  	// Data is "WriteParams.data"
   229  	//
   230  	// Optional
   231  	Data OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String
   232  
   233  	FFI_USE_Size     bool // for Size.
   234  	FFI_USE_Position bool // for Position.
   235  
   236  	FFI_USE bool
   237  }
   238  
   239  // FromRef calls UpdateFrom and returns a WriteParams with all fields set.
   240  func (p WriteParams) FromRef(ref js.Ref) WriteParams {
   241  	p.UpdateFrom(ref)
   242  	return p
   243  }
   244  
   245  // New creates a new WriteParams in the application heap.
   246  func (p WriteParams) New() js.Ref {
   247  	return bindings.WriteParamsJSLoad(
   248  		js.Pointer(&p), js.True, 0,
   249  	)
   250  }
   251  
   252  // UpdateFrom copies value of all fields of the heap object to p.
   253  func (p *WriteParams) UpdateFrom(ref js.Ref) {
   254  	bindings.WriteParamsJSStore(
   255  		js.Pointer(p), ref,
   256  	)
   257  }
   258  
   259  // Update writes all fields of the p to the heap object referenced by ref.
   260  func (p *WriteParams) Update(ref js.Ref) {
   261  	bindings.WriteParamsJSLoad(
   262  		js.Pointer(p), js.False, ref,
   263  	)
   264  }
   265  
   266  // FreeMembers frees fields with heap reference, if recursive is true
   267  // free all heap references reachable from p.
   268  func (p *WriteParams) FreeMembers(recursive bool) {
   269  	js.Free(
   270  		p.Data.Ref(),
   271  	)
   272  	p.Data = p.Data.FromRef(js.Undefined)
   273  }
   274  
   275  type OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams struct {
   276  	ref js.Ref
   277  }
   278  
   279  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) Ref() js.Ref {
   280  	return x.ref
   281  }
   282  
   283  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) Free() {
   284  	x.ref.Free()
   285  }
   286  
   287  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) FromRef(ref js.Ref) OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams {
   288  	return OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams{
   289  		ref: ref,
   290  	}
   291  }
   292  
   293  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayInt8() js.TypedArray[int8] {
   294  	return js.TypedArray[int8]{}.FromRef(x.ref)
   295  }
   296  
   297  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayInt16() js.TypedArray[int16] {
   298  	return js.TypedArray[int16]{}.FromRef(x.ref)
   299  }
   300  
   301  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayInt32() js.TypedArray[int32] {
   302  	return js.TypedArray[int32]{}.FromRef(x.ref)
   303  }
   304  
   305  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayUint8() js.TypedArray[uint8] {
   306  	return js.TypedArray[uint8]{}.FromRef(x.ref)
   307  }
   308  
   309  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayUint16() js.TypedArray[uint16] {
   310  	return js.TypedArray[uint16]{}.FromRef(x.ref)
   311  }
   312  
   313  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayUint32() js.TypedArray[uint32] {
   314  	return js.TypedArray[uint32]{}.FromRef(x.ref)
   315  }
   316  
   317  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayInt64() js.TypedArray[int64] {
   318  	return js.TypedArray[int64]{}.FromRef(x.ref)
   319  }
   320  
   321  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayUint64() js.TypedArray[uint64] {
   322  	return js.TypedArray[uint64]{}.FromRef(x.ref)
   323  }
   324  
   325  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayFloat32() js.TypedArray[float32] {
   326  	return js.TypedArray[float32]{}.FromRef(x.ref)
   327  }
   328  
   329  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) TypedArrayFloat64() js.TypedArray[float64] {
   330  	return js.TypedArray[float64]{}.FromRef(x.ref)
   331  }
   332  
   333  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) DataView() js.DataView {
   334  	return js.DataView{}.FromRef(x.ref)
   335  }
   336  
   337  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) ArrayBuffer() js.ArrayBuffer {
   338  	return js.ArrayBuffer{}.FromRef(x.ref)
   339  }
   340  
   341  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) Blob() Blob {
   342  	return Blob{}.FromRef(x.ref)
   343  }
   344  
   345  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) String() js.String {
   346  	return js.String{}.FromRef(x.ref)
   347  }
   348  
   349  func (x OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams) WriteParams() WriteParams {
   350  	var ret WriteParams
   351  	ret.UpdateFrom(x.ref)
   352  	return ret
   353  }
   354  
   355  type FileSystemWriteChunkType = OneOf_TypedArrayInt8_TypedArrayInt16_TypedArrayInt32_TypedArrayUint8_TypedArrayUint16_TypedArrayUint32_TypedArrayInt64_TypedArrayUint64_TypedArrayFloat32_TypedArrayFloat64_DataView_ArrayBuffer_Blob_String_WriteParams
   356  
   357  func NewFileSystemWritableFileStream(underlyingSink js.Object, strategy QueuingStrategy) (ret FileSystemWritableFileStream) {
   358  	ret.ref = bindings.NewFileSystemWritableFileStreamByFileSystemWritableFileStream(
   359  		underlyingSink.Ref(),
   360  		js.Pointer(&strategy))
   361  	return
   362  }
   363  
   364  func NewFileSystemWritableFileStreamByFileSystemWritableFileStream1(underlyingSink js.Object) (ret FileSystemWritableFileStream) {
   365  	ret.ref = bindings.NewFileSystemWritableFileStreamByFileSystemWritableFileStream1(
   366  		underlyingSink.Ref())
   367  	return
   368  }
   369  
   370  func NewFileSystemWritableFileStreamByFileSystemWritableFileStream2() (ret FileSystemWritableFileStream) {
   371  	ret.ref = bindings.NewFileSystemWritableFileStreamByFileSystemWritableFileStream2()
   372  	return
   373  }
   374  
   375  type FileSystemWritableFileStream struct {
   376  	WritableStream
   377  }
   378  
   379  func (this FileSystemWritableFileStream) Once() FileSystemWritableFileStream {
   380  	this.ref.Once()
   381  	return this
   382  }
   383  
   384  func (this FileSystemWritableFileStream) Ref() js.Ref {
   385  	return this.WritableStream.Ref()
   386  }
   387  
   388  func (this FileSystemWritableFileStream) FromRef(ref js.Ref) FileSystemWritableFileStream {
   389  	this.WritableStream = this.WritableStream.FromRef(ref)
   390  	return this
   391  }
   392  
   393  func (this FileSystemWritableFileStream) Free() {
   394  	this.ref.Free()
   395  }
   396  
   397  // HasFuncWrite returns true if the method "FileSystemWritableFileStream.write" exists.
   398  func (this FileSystemWritableFileStream) HasFuncWrite() bool {
   399  	return js.True == bindings.HasFuncFileSystemWritableFileStreamWrite(
   400  		this.ref,
   401  	)
   402  }
   403  
   404  // FuncWrite returns the method "FileSystemWritableFileStream.write".
   405  func (this FileSystemWritableFileStream) FuncWrite() (fn js.Func[func(data FileSystemWriteChunkType) js.Promise[js.Void]]) {
   406  	bindings.FuncFileSystemWritableFileStreamWrite(
   407  		this.ref, js.Pointer(&fn),
   408  	)
   409  	return
   410  }
   411  
   412  // Write calls the method "FileSystemWritableFileStream.write".
   413  func (this FileSystemWritableFileStream) Write(data FileSystemWriteChunkType) (ret js.Promise[js.Void]) {
   414  	bindings.CallFileSystemWritableFileStreamWrite(
   415  		this.ref, js.Pointer(&ret),
   416  		data.Ref(),
   417  	)
   418  
   419  	return
   420  }
   421  
   422  // TryWrite calls the method "FileSystemWritableFileStream.write"
   423  // in a try/catch block and returns (_, err, ok = false) when it went through
   424  // the catch clause.
   425  func (this FileSystemWritableFileStream) TryWrite(data FileSystemWriteChunkType) (ret js.Promise[js.Void], exception js.Any, ok bool) {
   426  	ok = js.True == bindings.TryFileSystemWritableFileStreamWrite(
   427  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   428  		data.Ref(),
   429  	)
   430  
   431  	return
   432  }
   433  
   434  // HasFuncSeek returns true if the method "FileSystemWritableFileStream.seek" exists.
   435  func (this FileSystemWritableFileStream) HasFuncSeek() bool {
   436  	return js.True == bindings.HasFuncFileSystemWritableFileStreamSeek(
   437  		this.ref,
   438  	)
   439  }
   440  
   441  // FuncSeek returns the method "FileSystemWritableFileStream.seek".
   442  func (this FileSystemWritableFileStream) FuncSeek() (fn js.Func[func(position uint64) js.Promise[js.Void]]) {
   443  	bindings.FuncFileSystemWritableFileStreamSeek(
   444  		this.ref, js.Pointer(&fn),
   445  	)
   446  	return
   447  }
   448  
   449  // Seek calls the method "FileSystemWritableFileStream.seek".
   450  func (this FileSystemWritableFileStream) Seek(position uint64) (ret js.Promise[js.Void]) {
   451  	bindings.CallFileSystemWritableFileStreamSeek(
   452  		this.ref, js.Pointer(&ret),
   453  		float64(position),
   454  	)
   455  
   456  	return
   457  }
   458  
   459  // TrySeek calls the method "FileSystemWritableFileStream.seek"
   460  // in a try/catch block and returns (_, err, ok = false) when it went through
   461  // the catch clause.
   462  func (this FileSystemWritableFileStream) TrySeek(position uint64) (ret js.Promise[js.Void], exception js.Any, ok bool) {
   463  	ok = js.True == bindings.TryFileSystemWritableFileStreamSeek(
   464  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   465  		float64(position),
   466  	)
   467  
   468  	return
   469  }
   470  
   471  // HasFuncTruncate returns true if the method "FileSystemWritableFileStream.truncate" exists.
   472  func (this FileSystemWritableFileStream) HasFuncTruncate() bool {
   473  	return js.True == bindings.HasFuncFileSystemWritableFileStreamTruncate(
   474  		this.ref,
   475  	)
   476  }
   477  
   478  // FuncTruncate returns the method "FileSystemWritableFileStream.truncate".
   479  func (this FileSystemWritableFileStream) FuncTruncate() (fn js.Func[func(size uint64) js.Promise[js.Void]]) {
   480  	bindings.FuncFileSystemWritableFileStreamTruncate(
   481  		this.ref, js.Pointer(&fn),
   482  	)
   483  	return
   484  }
   485  
   486  // Truncate calls the method "FileSystemWritableFileStream.truncate".
   487  func (this FileSystemWritableFileStream) Truncate(size uint64) (ret js.Promise[js.Void]) {
   488  	bindings.CallFileSystemWritableFileStreamTruncate(
   489  		this.ref, js.Pointer(&ret),
   490  		float64(size),
   491  	)
   492  
   493  	return
   494  }
   495  
   496  // TryTruncate calls the method "FileSystemWritableFileStream.truncate"
   497  // in a try/catch block and returns (_, err, ok = false) when it went through
   498  // the catch clause.
   499  func (this FileSystemWritableFileStream) TryTruncate(size uint64) (ret js.Promise[js.Void], exception js.Any, ok bool) {
   500  	ok = js.True == bindings.TryFileSystemWritableFileStreamTruncate(
   501  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   502  		float64(size),
   503  	)
   504  
   505  	return
   506  }
   507  
   508  type FileSystemCreateWritableOptions struct {
   509  	// KeepExistingData is "FileSystemCreateWritableOptions.keepExistingData"
   510  	//
   511  	// Optional, defaults to false.
   512  	//
   513  	// NOTE: FFI_USE_KeepExistingData MUST be set to true to make this field effective.
   514  	KeepExistingData bool
   515  
   516  	FFI_USE_KeepExistingData bool // for KeepExistingData.
   517  
   518  	FFI_USE bool
   519  }
   520  
   521  // FromRef calls UpdateFrom and returns a FileSystemCreateWritableOptions with all fields set.
   522  func (p FileSystemCreateWritableOptions) FromRef(ref js.Ref) FileSystemCreateWritableOptions {
   523  	p.UpdateFrom(ref)
   524  	return p
   525  }
   526  
   527  // New creates a new FileSystemCreateWritableOptions in the application heap.
   528  func (p FileSystemCreateWritableOptions) New() js.Ref {
   529  	return bindings.FileSystemCreateWritableOptionsJSLoad(
   530  		js.Pointer(&p), js.True, 0,
   531  	)
   532  }
   533  
   534  // UpdateFrom copies value of all fields of the heap object to p.
   535  func (p *FileSystemCreateWritableOptions) UpdateFrom(ref js.Ref) {
   536  	bindings.FileSystemCreateWritableOptionsJSStore(
   537  		js.Pointer(p), ref,
   538  	)
   539  }
   540  
   541  // Update writes all fields of the p to the heap object referenced by ref.
   542  func (p *FileSystemCreateWritableOptions) Update(ref js.Ref) {
   543  	bindings.FileSystemCreateWritableOptionsJSLoad(
   544  		js.Pointer(p), js.False, ref,
   545  	)
   546  }
   547  
   548  // FreeMembers frees fields with heap reference, if recursive is true
   549  // free all heap references reachable from p.
   550  func (p *FileSystemCreateWritableOptions) FreeMembers(recursive bool) {
   551  }
   552  
   553  type FileSystemReadWriteOptions struct {
   554  	// At is "FileSystemReadWriteOptions.at"
   555  	//
   556  	// Optional
   557  	//
   558  	// NOTE: FFI_USE_At MUST be set to true to make this field effective.
   559  	At uint64
   560  
   561  	FFI_USE_At bool // for At.
   562  
   563  	FFI_USE bool
   564  }
   565  
   566  // FromRef calls UpdateFrom and returns a FileSystemReadWriteOptions with all fields set.
   567  func (p FileSystemReadWriteOptions) FromRef(ref js.Ref) FileSystemReadWriteOptions {
   568  	p.UpdateFrom(ref)
   569  	return p
   570  }
   571  
   572  // New creates a new FileSystemReadWriteOptions in the application heap.
   573  func (p FileSystemReadWriteOptions) New() js.Ref {
   574  	return bindings.FileSystemReadWriteOptionsJSLoad(
   575  		js.Pointer(&p), js.True, 0,
   576  	)
   577  }
   578  
   579  // UpdateFrom copies value of all fields of the heap object to p.
   580  func (p *FileSystemReadWriteOptions) UpdateFrom(ref js.Ref) {
   581  	bindings.FileSystemReadWriteOptionsJSStore(
   582  		js.Pointer(p), ref,
   583  	)
   584  }
   585  
   586  // Update writes all fields of the p to the heap object referenced by ref.
   587  func (p *FileSystemReadWriteOptions) Update(ref js.Ref) {
   588  	bindings.FileSystemReadWriteOptionsJSLoad(
   589  		js.Pointer(p), js.False, ref,
   590  	)
   591  }
   592  
   593  // FreeMembers frees fields with heap reference, if recursive is true
   594  // free all heap references reachable from p.
   595  func (p *FileSystemReadWriteOptions) FreeMembers(recursive bool) {
   596  }
   597  
   598  type FileSystemSyncAccessHandle struct {
   599  	ref js.Ref
   600  }
   601  
   602  func (this FileSystemSyncAccessHandle) Once() FileSystemSyncAccessHandle {
   603  	this.ref.Once()
   604  	return this
   605  }
   606  
   607  func (this FileSystemSyncAccessHandle) Ref() js.Ref {
   608  	return this.ref
   609  }
   610  
   611  func (this FileSystemSyncAccessHandle) FromRef(ref js.Ref) FileSystemSyncAccessHandle {
   612  	this.ref = ref
   613  	return this
   614  }
   615  
   616  func (this FileSystemSyncAccessHandle) Free() {
   617  	this.ref.Free()
   618  }
   619  
   620  // HasFuncRead returns true if the method "FileSystemSyncAccessHandle.read" exists.
   621  func (this FileSystemSyncAccessHandle) HasFuncRead() bool {
   622  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleRead(
   623  		this.ref,
   624  	)
   625  }
   626  
   627  // FuncRead returns the method "FileSystemSyncAccessHandle.read".
   628  func (this FileSystemSyncAccessHandle) FuncRead() (fn js.Func[func(buffer AllowSharedBufferSource, options FileSystemReadWriteOptions) uint64]) {
   629  	bindings.FuncFileSystemSyncAccessHandleRead(
   630  		this.ref, js.Pointer(&fn),
   631  	)
   632  	return
   633  }
   634  
   635  // Read calls the method "FileSystemSyncAccessHandle.read".
   636  func (this FileSystemSyncAccessHandle) Read(buffer AllowSharedBufferSource, options FileSystemReadWriteOptions) (ret uint64) {
   637  	bindings.CallFileSystemSyncAccessHandleRead(
   638  		this.ref, js.Pointer(&ret),
   639  		buffer.Ref(),
   640  		js.Pointer(&options),
   641  	)
   642  
   643  	return
   644  }
   645  
   646  // TryRead calls the method "FileSystemSyncAccessHandle.read"
   647  // in a try/catch block and returns (_, err, ok = false) when it went through
   648  // the catch clause.
   649  func (this FileSystemSyncAccessHandle) TryRead(buffer AllowSharedBufferSource, options FileSystemReadWriteOptions) (ret uint64, exception js.Any, ok bool) {
   650  	ok = js.True == bindings.TryFileSystemSyncAccessHandleRead(
   651  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   652  		buffer.Ref(),
   653  		js.Pointer(&options),
   654  	)
   655  
   656  	return
   657  }
   658  
   659  // HasFuncRead1 returns true if the method "FileSystemSyncAccessHandle.read" exists.
   660  func (this FileSystemSyncAccessHandle) HasFuncRead1() bool {
   661  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleRead1(
   662  		this.ref,
   663  	)
   664  }
   665  
   666  // FuncRead1 returns the method "FileSystemSyncAccessHandle.read".
   667  func (this FileSystemSyncAccessHandle) FuncRead1() (fn js.Func[func(buffer AllowSharedBufferSource) uint64]) {
   668  	bindings.FuncFileSystemSyncAccessHandleRead1(
   669  		this.ref, js.Pointer(&fn),
   670  	)
   671  	return
   672  }
   673  
   674  // Read1 calls the method "FileSystemSyncAccessHandle.read".
   675  func (this FileSystemSyncAccessHandle) Read1(buffer AllowSharedBufferSource) (ret uint64) {
   676  	bindings.CallFileSystemSyncAccessHandleRead1(
   677  		this.ref, js.Pointer(&ret),
   678  		buffer.Ref(),
   679  	)
   680  
   681  	return
   682  }
   683  
   684  // TryRead1 calls the method "FileSystemSyncAccessHandle.read"
   685  // in a try/catch block and returns (_, err, ok = false) when it went through
   686  // the catch clause.
   687  func (this FileSystemSyncAccessHandle) TryRead1(buffer AllowSharedBufferSource) (ret uint64, exception js.Any, ok bool) {
   688  	ok = js.True == bindings.TryFileSystemSyncAccessHandleRead1(
   689  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   690  		buffer.Ref(),
   691  	)
   692  
   693  	return
   694  }
   695  
   696  // HasFuncWrite returns true if the method "FileSystemSyncAccessHandle.write" exists.
   697  func (this FileSystemSyncAccessHandle) HasFuncWrite() bool {
   698  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleWrite(
   699  		this.ref,
   700  	)
   701  }
   702  
   703  // FuncWrite returns the method "FileSystemSyncAccessHandle.write".
   704  func (this FileSystemSyncAccessHandle) FuncWrite() (fn js.Func[func(buffer AllowSharedBufferSource, options FileSystemReadWriteOptions) uint64]) {
   705  	bindings.FuncFileSystemSyncAccessHandleWrite(
   706  		this.ref, js.Pointer(&fn),
   707  	)
   708  	return
   709  }
   710  
   711  // Write calls the method "FileSystemSyncAccessHandle.write".
   712  func (this FileSystemSyncAccessHandle) Write(buffer AllowSharedBufferSource, options FileSystemReadWriteOptions) (ret uint64) {
   713  	bindings.CallFileSystemSyncAccessHandleWrite(
   714  		this.ref, js.Pointer(&ret),
   715  		buffer.Ref(),
   716  		js.Pointer(&options),
   717  	)
   718  
   719  	return
   720  }
   721  
   722  // TryWrite calls the method "FileSystemSyncAccessHandle.write"
   723  // in a try/catch block and returns (_, err, ok = false) when it went through
   724  // the catch clause.
   725  func (this FileSystemSyncAccessHandle) TryWrite(buffer AllowSharedBufferSource, options FileSystemReadWriteOptions) (ret uint64, exception js.Any, ok bool) {
   726  	ok = js.True == bindings.TryFileSystemSyncAccessHandleWrite(
   727  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   728  		buffer.Ref(),
   729  		js.Pointer(&options),
   730  	)
   731  
   732  	return
   733  }
   734  
   735  // HasFuncWrite1 returns true if the method "FileSystemSyncAccessHandle.write" exists.
   736  func (this FileSystemSyncAccessHandle) HasFuncWrite1() bool {
   737  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleWrite1(
   738  		this.ref,
   739  	)
   740  }
   741  
   742  // FuncWrite1 returns the method "FileSystemSyncAccessHandle.write".
   743  func (this FileSystemSyncAccessHandle) FuncWrite1() (fn js.Func[func(buffer AllowSharedBufferSource) uint64]) {
   744  	bindings.FuncFileSystemSyncAccessHandleWrite1(
   745  		this.ref, js.Pointer(&fn),
   746  	)
   747  	return
   748  }
   749  
   750  // Write1 calls the method "FileSystemSyncAccessHandle.write".
   751  func (this FileSystemSyncAccessHandle) Write1(buffer AllowSharedBufferSource) (ret uint64) {
   752  	bindings.CallFileSystemSyncAccessHandleWrite1(
   753  		this.ref, js.Pointer(&ret),
   754  		buffer.Ref(),
   755  	)
   756  
   757  	return
   758  }
   759  
   760  // TryWrite1 calls the method "FileSystemSyncAccessHandle.write"
   761  // in a try/catch block and returns (_, err, ok = false) when it went through
   762  // the catch clause.
   763  func (this FileSystemSyncAccessHandle) TryWrite1(buffer AllowSharedBufferSource) (ret uint64, exception js.Any, ok bool) {
   764  	ok = js.True == bindings.TryFileSystemSyncAccessHandleWrite1(
   765  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   766  		buffer.Ref(),
   767  	)
   768  
   769  	return
   770  }
   771  
   772  // HasFuncTruncate returns true if the method "FileSystemSyncAccessHandle.truncate" exists.
   773  func (this FileSystemSyncAccessHandle) HasFuncTruncate() bool {
   774  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleTruncate(
   775  		this.ref,
   776  	)
   777  }
   778  
   779  // FuncTruncate returns the method "FileSystemSyncAccessHandle.truncate".
   780  func (this FileSystemSyncAccessHandle) FuncTruncate() (fn js.Func[func(newSize uint64)]) {
   781  	bindings.FuncFileSystemSyncAccessHandleTruncate(
   782  		this.ref, js.Pointer(&fn),
   783  	)
   784  	return
   785  }
   786  
   787  // Truncate calls the method "FileSystemSyncAccessHandle.truncate".
   788  func (this FileSystemSyncAccessHandle) Truncate(newSize uint64) (ret js.Void) {
   789  	bindings.CallFileSystemSyncAccessHandleTruncate(
   790  		this.ref, js.Pointer(&ret),
   791  		float64(newSize),
   792  	)
   793  
   794  	return
   795  }
   796  
   797  // TryTruncate calls the method "FileSystemSyncAccessHandle.truncate"
   798  // in a try/catch block and returns (_, err, ok = false) when it went through
   799  // the catch clause.
   800  func (this FileSystemSyncAccessHandle) TryTruncate(newSize uint64) (ret js.Void, exception js.Any, ok bool) {
   801  	ok = js.True == bindings.TryFileSystemSyncAccessHandleTruncate(
   802  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   803  		float64(newSize),
   804  	)
   805  
   806  	return
   807  }
   808  
   809  // HasFuncGetSize returns true if the method "FileSystemSyncAccessHandle.getSize" exists.
   810  func (this FileSystemSyncAccessHandle) HasFuncGetSize() bool {
   811  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleGetSize(
   812  		this.ref,
   813  	)
   814  }
   815  
   816  // FuncGetSize returns the method "FileSystemSyncAccessHandle.getSize".
   817  func (this FileSystemSyncAccessHandle) FuncGetSize() (fn js.Func[func() uint64]) {
   818  	bindings.FuncFileSystemSyncAccessHandleGetSize(
   819  		this.ref, js.Pointer(&fn),
   820  	)
   821  	return
   822  }
   823  
   824  // GetSize calls the method "FileSystemSyncAccessHandle.getSize".
   825  func (this FileSystemSyncAccessHandle) GetSize() (ret uint64) {
   826  	bindings.CallFileSystemSyncAccessHandleGetSize(
   827  		this.ref, js.Pointer(&ret),
   828  	)
   829  
   830  	return
   831  }
   832  
   833  // TryGetSize calls the method "FileSystemSyncAccessHandle.getSize"
   834  // in a try/catch block and returns (_, err, ok = false) when it went through
   835  // the catch clause.
   836  func (this FileSystemSyncAccessHandle) TryGetSize() (ret uint64, exception js.Any, ok bool) {
   837  	ok = js.True == bindings.TryFileSystemSyncAccessHandleGetSize(
   838  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   839  	)
   840  
   841  	return
   842  }
   843  
   844  // HasFuncFlush returns true if the method "FileSystemSyncAccessHandle.flush" exists.
   845  func (this FileSystemSyncAccessHandle) HasFuncFlush() bool {
   846  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleFlush(
   847  		this.ref,
   848  	)
   849  }
   850  
   851  // FuncFlush returns the method "FileSystemSyncAccessHandle.flush".
   852  func (this FileSystemSyncAccessHandle) FuncFlush() (fn js.Func[func()]) {
   853  	bindings.FuncFileSystemSyncAccessHandleFlush(
   854  		this.ref, js.Pointer(&fn),
   855  	)
   856  	return
   857  }
   858  
   859  // Flush calls the method "FileSystemSyncAccessHandle.flush".
   860  func (this FileSystemSyncAccessHandle) Flush() (ret js.Void) {
   861  	bindings.CallFileSystemSyncAccessHandleFlush(
   862  		this.ref, js.Pointer(&ret),
   863  	)
   864  
   865  	return
   866  }
   867  
   868  // TryFlush calls the method "FileSystemSyncAccessHandle.flush"
   869  // in a try/catch block and returns (_, err, ok = false) when it went through
   870  // the catch clause.
   871  func (this FileSystemSyncAccessHandle) TryFlush() (ret js.Void, exception js.Any, ok bool) {
   872  	ok = js.True == bindings.TryFileSystemSyncAccessHandleFlush(
   873  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   874  	)
   875  
   876  	return
   877  }
   878  
   879  // HasFuncClose returns true if the method "FileSystemSyncAccessHandle.close" exists.
   880  func (this FileSystemSyncAccessHandle) HasFuncClose() bool {
   881  	return js.True == bindings.HasFuncFileSystemSyncAccessHandleClose(
   882  		this.ref,
   883  	)
   884  }
   885  
   886  // FuncClose returns the method "FileSystemSyncAccessHandle.close".
   887  func (this FileSystemSyncAccessHandle) FuncClose() (fn js.Func[func()]) {
   888  	bindings.FuncFileSystemSyncAccessHandleClose(
   889  		this.ref, js.Pointer(&fn),
   890  	)
   891  	return
   892  }
   893  
   894  // Close calls the method "FileSystemSyncAccessHandle.close".
   895  func (this FileSystemSyncAccessHandle) Close() (ret js.Void) {
   896  	bindings.CallFileSystemSyncAccessHandleClose(
   897  		this.ref, js.Pointer(&ret),
   898  	)
   899  
   900  	return
   901  }
   902  
   903  // TryClose calls the method "FileSystemSyncAccessHandle.close"
   904  // in a try/catch block and returns (_, err, ok = false) when it went through
   905  // the catch clause.
   906  func (this FileSystemSyncAccessHandle) TryClose() (ret js.Void, exception js.Any, ok bool) {
   907  	ok = js.True == bindings.TryFileSystemSyncAccessHandleClose(
   908  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   909  	)
   910  
   911  	return
   912  }
   913  
   914  type FileSystemFileHandle struct {
   915  	FileSystemHandle
   916  }
   917  
   918  func (this FileSystemFileHandle) Once() FileSystemFileHandle {
   919  	this.ref.Once()
   920  	return this
   921  }
   922  
   923  func (this FileSystemFileHandle) Ref() js.Ref {
   924  	return this.FileSystemHandle.Ref()
   925  }
   926  
   927  func (this FileSystemFileHandle) FromRef(ref js.Ref) FileSystemFileHandle {
   928  	this.FileSystemHandle = this.FileSystemHandle.FromRef(ref)
   929  	return this
   930  }
   931  
   932  func (this FileSystemFileHandle) Free() {
   933  	this.ref.Free()
   934  }
   935  
   936  // HasFuncGetFile returns true if the method "FileSystemFileHandle.getFile" exists.
   937  func (this FileSystemFileHandle) HasFuncGetFile() bool {
   938  	return js.True == bindings.HasFuncFileSystemFileHandleGetFile(
   939  		this.ref,
   940  	)
   941  }
   942  
   943  // FuncGetFile returns the method "FileSystemFileHandle.getFile".
   944  func (this FileSystemFileHandle) FuncGetFile() (fn js.Func[func() js.Promise[File]]) {
   945  	bindings.FuncFileSystemFileHandleGetFile(
   946  		this.ref, js.Pointer(&fn),
   947  	)
   948  	return
   949  }
   950  
   951  // GetFile calls the method "FileSystemFileHandle.getFile".
   952  func (this FileSystemFileHandle) GetFile() (ret js.Promise[File]) {
   953  	bindings.CallFileSystemFileHandleGetFile(
   954  		this.ref, js.Pointer(&ret),
   955  	)
   956  
   957  	return
   958  }
   959  
   960  // TryGetFile calls the method "FileSystemFileHandle.getFile"
   961  // in a try/catch block and returns (_, err, ok = false) when it went through
   962  // the catch clause.
   963  func (this FileSystemFileHandle) TryGetFile() (ret js.Promise[File], exception js.Any, ok bool) {
   964  	ok = js.True == bindings.TryFileSystemFileHandleGetFile(
   965  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
   966  	)
   967  
   968  	return
   969  }
   970  
   971  // HasFuncCreateWritable returns true if the method "FileSystemFileHandle.createWritable" exists.
   972  func (this FileSystemFileHandle) HasFuncCreateWritable() bool {
   973  	return js.True == bindings.HasFuncFileSystemFileHandleCreateWritable(
   974  		this.ref,
   975  	)
   976  }
   977  
   978  // FuncCreateWritable returns the method "FileSystemFileHandle.createWritable".
   979  func (this FileSystemFileHandle) FuncCreateWritable() (fn js.Func[func(options FileSystemCreateWritableOptions) js.Promise[FileSystemWritableFileStream]]) {
   980  	bindings.FuncFileSystemFileHandleCreateWritable(
   981  		this.ref, js.Pointer(&fn),
   982  	)
   983  	return
   984  }
   985  
   986  // CreateWritable calls the method "FileSystemFileHandle.createWritable".
   987  func (this FileSystemFileHandle) CreateWritable(options FileSystemCreateWritableOptions) (ret js.Promise[FileSystemWritableFileStream]) {
   988  	bindings.CallFileSystemFileHandleCreateWritable(
   989  		this.ref, js.Pointer(&ret),
   990  		js.Pointer(&options),
   991  	)
   992  
   993  	return
   994  }
   995  
   996  // TryCreateWritable calls the method "FileSystemFileHandle.createWritable"
   997  // in a try/catch block and returns (_, err, ok = false) when it went through
   998  // the catch clause.
   999  func (this FileSystemFileHandle) TryCreateWritable(options FileSystemCreateWritableOptions) (ret js.Promise[FileSystemWritableFileStream], exception js.Any, ok bool) {
  1000  	ok = js.True == bindings.TryFileSystemFileHandleCreateWritable(
  1001  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1002  		js.Pointer(&options),
  1003  	)
  1004  
  1005  	return
  1006  }
  1007  
  1008  // HasFuncCreateWritable1 returns true if the method "FileSystemFileHandle.createWritable" exists.
  1009  func (this FileSystemFileHandle) HasFuncCreateWritable1() bool {
  1010  	return js.True == bindings.HasFuncFileSystemFileHandleCreateWritable1(
  1011  		this.ref,
  1012  	)
  1013  }
  1014  
  1015  // FuncCreateWritable1 returns the method "FileSystemFileHandle.createWritable".
  1016  func (this FileSystemFileHandle) FuncCreateWritable1() (fn js.Func[func() js.Promise[FileSystemWritableFileStream]]) {
  1017  	bindings.FuncFileSystemFileHandleCreateWritable1(
  1018  		this.ref, js.Pointer(&fn),
  1019  	)
  1020  	return
  1021  }
  1022  
  1023  // CreateWritable1 calls the method "FileSystemFileHandle.createWritable".
  1024  func (this FileSystemFileHandle) CreateWritable1() (ret js.Promise[FileSystemWritableFileStream]) {
  1025  	bindings.CallFileSystemFileHandleCreateWritable1(
  1026  		this.ref, js.Pointer(&ret),
  1027  	)
  1028  
  1029  	return
  1030  }
  1031  
  1032  // TryCreateWritable1 calls the method "FileSystemFileHandle.createWritable"
  1033  // in a try/catch block and returns (_, err, ok = false) when it went through
  1034  // the catch clause.
  1035  func (this FileSystemFileHandle) TryCreateWritable1() (ret js.Promise[FileSystemWritableFileStream], exception js.Any, ok bool) {
  1036  	ok = js.True == bindings.TryFileSystemFileHandleCreateWritable1(
  1037  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1038  	)
  1039  
  1040  	return
  1041  }
  1042  
  1043  // HasFuncCreateSyncAccessHandle returns true if the method "FileSystemFileHandle.createSyncAccessHandle" exists.
  1044  func (this FileSystemFileHandle) HasFuncCreateSyncAccessHandle() bool {
  1045  	return js.True == bindings.HasFuncFileSystemFileHandleCreateSyncAccessHandle(
  1046  		this.ref,
  1047  	)
  1048  }
  1049  
  1050  // FuncCreateSyncAccessHandle returns the method "FileSystemFileHandle.createSyncAccessHandle".
  1051  func (this FileSystemFileHandle) FuncCreateSyncAccessHandle() (fn js.Func[func() js.Promise[FileSystemSyncAccessHandle]]) {
  1052  	bindings.FuncFileSystemFileHandleCreateSyncAccessHandle(
  1053  		this.ref, js.Pointer(&fn),
  1054  	)
  1055  	return
  1056  }
  1057  
  1058  // CreateSyncAccessHandle calls the method "FileSystemFileHandle.createSyncAccessHandle".
  1059  func (this FileSystemFileHandle) CreateSyncAccessHandle() (ret js.Promise[FileSystemSyncAccessHandle]) {
  1060  	bindings.CallFileSystemFileHandleCreateSyncAccessHandle(
  1061  		this.ref, js.Pointer(&ret),
  1062  	)
  1063  
  1064  	return
  1065  }
  1066  
  1067  // TryCreateSyncAccessHandle calls the method "FileSystemFileHandle.createSyncAccessHandle"
  1068  // in a try/catch block and returns (_, err, ok = false) when it went through
  1069  // the catch clause.
  1070  func (this FileSystemFileHandle) TryCreateSyncAccessHandle() (ret js.Promise[FileSystemSyncAccessHandle], exception js.Any, ok bool) {
  1071  	ok = js.True == bindings.TryFileSystemFileHandleCreateSyncAccessHandle(
  1072  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1073  	)
  1074  
  1075  	return
  1076  }
  1077  
  1078  type FilePickerAcceptType struct {
  1079  	// Description is "FilePickerAcceptType.description"
  1080  	//
  1081  	// Optional, defaults to "".
  1082  	Description js.String
  1083  	// Accept is "FilePickerAcceptType.accept"
  1084  	//
  1085  	// Optional
  1086  	Accept js.Record[OneOf_String_ArrayString]
  1087  
  1088  	FFI_USE bool
  1089  }
  1090  
  1091  // FromRef calls UpdateFrom and returns a FilePickerAcceptType with all fields set.
  1092  func (p FilePickerAcceptType) FromRef(ref js.Ref) FilePickerAcceptType {
  1093  	p.UpdateFrom(ref)
  1094  	return p
  1095  }
  1096  
  1097  // New creates a new FilePickerAcceptType in the application heap.
  1098  func (p FilePickerAcceptType) New() js.Ref {
  1099  	return bindings.FilePickerAcceptTypeJSLoad(
  1100  		js.Pointer(&p), js.True, 0,
  1101  	)
  1102  }
  1103  
  1104  // UpdateFrom copies value of all fields of the heap object to p.
  1105  func (p *FilePickerAcceptType) UpdateFrom(ref js.Ref) {
  1106  	bindings.FilePickerAcceptTypeJSStore(
  1107  		js.Pointer(p), ref,
  1108  	)
  1109  }
  1110  
  1111  // Update writes all fields of the p to the heap object referenced by ref.
  1112  func (p *FilePickerAcceptType) Update(ref js.Ref) {
  1113  	bindings.FilePickerAcceptTypeJSLoad(
  1114  		js.Pointer(p), js.False, ref,
  1115  	)
  1116  }
  1117  
  1118  // FreeMembers frees fields with heap reference, if recursive is true
  1119  // free all heap references reachable from p.
  1120  func (p *FilePickerAcceptType) FreeMembers(recursive bool) {
  1121  	js.Free(
  1122  		p.Description.Ref(),
  1123  		p.Accept.Ref(),
  1124  	)
  1125  	p.Description = p.Description.FromRef(js.Undefined)
  1126  	p.Accept = p.Accept.FromRef(js.Undefined)
  1127  }
  1128  
  1129  type WellKnownDirectory uint32
  1130  
  1131  const (
  1132  	_ WellKnownDirectory = iota
  1133  
  1134  	WellKnownDirectory_DESKTOP
  1135  	WellKnownDirectory_DOCUMENTS
  1136  	WellKnownDirectory_DOWNLOADS
  1137  	WellKnownDirectory_MUSIC
  1138  	WellKnownDirectory_PICTURES
  1139  	WellKnownDirectory_VIDEOS
  1140  )
  1141  
  1142  func (WellKnownDirectory) FromRef(str js.Ref) WellKnownDirectory {
  1143  	return WellKnownDirectory(bindings.ConstOfWellKnownDirectory(str))
  1144  }
  1145  
  1146  func (x WellKnownDirectory) String() (string, bool) {
  1147  	switch x {
  1148  	case WellKnownDirectory_DESKTOP:
  1149  		return "desktop", true
  1150  	case WellKnownDirectory_DOCUMENTS:
  1151  		return "documents", true
  1152  	case WellKnownDirectory_DOWNLOADS:
  1153  		return "downloads", true
  1154  	case WellKnownDirectory_MUSIC:
  1155  		return "music", true
  1156  	case WellKnownDirectory_PICTURES:
  1157  		return "pictures", true
  1158  	case WellKnownDirectory_VIDEOS:
  1159  		return "videos", true
  1160  	default:
  1161  		return "", false
  1162  	}
  1163  }
  1164  
  1165  type OneOf_WellKnownDirectory_FileSystemHandle struct {
  1166  	ref js.Ref
  1167  }
  1168  
  1169  func (x OneOf_WellKnownDirectory_FileSystemHandle) Ref() js.Ref {
  1170  	return x.ref
  1171  }
  1172  
  1173  func (x OneOf_WellKnownDirectory_FileSystemHandle) Free() {
  1174  	x.ref.Free()
  1175  }
  1176  
  1177  func (x OneOf_WellKnownDirectory_FileSystemHandle) FromRef(ref js.Ref) OneOf_WellKnownDirectory_FileSystemHandle {
  1178  	return OneOf_WellKnownDirectory_FileSystemHandle{
  1179  		ref: ref,
  1180  	}
  1181  }
  1182  
  1183  func (x OneOf_WellKnownDirectory_FileSystemHandle) WellKnownDirectory() WellKnownDirectory {
  1184  	return WellKnownDirectory(0).FromRef(x.ref)
  1185  }
  1186  
  1187  func (x OneOf_WellKnownDirectory_FileSystemHandle) FileSystemHandle() FileSystemHandle {
  1188  	return FileSystemHandle{}.FromRef(x.ref)
  1189  }
  1190  
  1191  type StartInDirectory = OneOf_WellKnownDirectory_FileSystemHandle
  1192  
  1193  type OpenFilePickerOptions struct {
  1194  	// Multiple is "OpenFilePickerOptions.multiple"
  1195  	//
  1196  	// Optional, defaults to false.
  1197  	//
  1198  	// NOTE: FFI_USE_Multiple MUST be set to true to make this field effective.
  1199  	Multiple bool
  1200  	// Types is "OpenFilePickerOptions.types"
  1201  	//
  1202  	// Optional
  1203  	Types js.Array[FilePickerAcceptType]
  1204  	// ExcludeAcceptAllOption is "OpenFilePickerOptions.excludeAcceptAllOption"
  1205  	//
  1206  	// Optional, defaults to false.
  1207  	//
  1208  	// NOTE: FFI_USE_ExcludeAcceptAllOption MUST be set to true to make this field effective.
  1209  	ExcludeAcceptAllOption bool
  1210  	// Id is "OpenFilePickerOptions.id"
  1211  	//
  1212  	// Optional
  1213  	Id js.String
  1214  	// StartIn is "OpenFilePickerOptions.startIn"
  1215  	//
  1216  	// Optional
  1217  	StartIn StartInDirectory
  1218  
  1219  	FFI_USE_Multiple               bool // for Multiple.
  1220  	FFI_USE_ExcludeAcceptAllOption bool // for ExcludeAcceptAllOption.
  1221  
  1222  	FFI_USE bool
  1223  }
  1224  
  1225  // FromRef calls UpdateFrom and returns a OpenFilePickerOptions with all fields set.
  1226  func (p OpenFilePickerOptions) FromRef(ref js.Ref) OpenFilePickerOptions {
  1227  	p.UpdateFrom(ref)
  1228  	return p
  1229  }
  1230  
  1231  // New creates a new OpenFilePickerOptions in the application heap.
  1232  func (p OpenFilePickerOptions) New() js.Ref {
  1233  	return bindings.OpenFilePickerOptionsJSLoad(
  1234  		js.Pointer(&p), js.True, 0,
  1235  	)
  1236  }
  1237  
  1238  // UpdateFrom copies value of all fields of the heap object to p.
  1239  func (p *OpenFilePickerOptions) UpdateFrom(ref js.Ref) {
  1240  	bindings.OpenFilePickerOptionsJSStore(
  1241  		js.Pointer(p), ref,
  1242  	)
  1243  }
  1244  
  1245  // Update writes all fields of the p to the heap object referenced by ref.
  1246  func (p *OpenFilePickerOptions) Update(ref js.Ref) {
  1247  	bindings.OpenFilePickerOptionsJSLoad(
  1248  		js.Pointer(p), js.False, ref,
  1249  	)
  1250  }
  1251  
  1252  // FreeMembers frees fields with heap reference, if recursive is true
  1253  // free all heap references reachable from p.
  1254  func (p *OpenFilePickerOptions) FreeMembers(recursive bool) {
  1255  	js.Free(
  1256  		p.Types.Ref(),
  1257  		p.Id.Ref(),
  1258  		p.StartIn.Ref(),
  1259  	)
  1260  	p.Types = p.Types.FromRef(js.Undefined)
  1261  	p.Id = p.Id.FromRef(js.Undefined)
  1262  	p.StartIn = p.StartIn.FromRef(js.Undefined)
  1263  }
  1264  
  1265  type SaveFilePickerOptions struct {
  1266  	// SuggestedName is "SaveFilePickerOptions.suggestedName"
  1267  	//
  1268  	// Optional
  1269  	SuggestedName js.String
  1270  	// Types is "SaveFilePickerOptions.types"
  1271  	//
  1272  	// Optional
  1273  	Types js.Array[FilePickerAcceptType]
  1274  	// ExcludeAcceptAllOption is "SaveFilePickerOptions.excludeAcceptAllOption"
  1275  	//
  1276  	// Optional, defaults to false.
  1277  	//
  1278  	// NOTE: FFI_USE_ExcludeAcceptAllOption MUST be set to true to make this field effective.
  1279  	ExcludeAcceptAllOption bool
  1280  	// Id is "SaveFilePickerOptions.id"
  1281  	//
  1282  	// Optional
  1283  	Id js.String
  1284  	// StartIn is "SaveFilePickerOptions.startIn"
  1285  	//
  1286  	// Optional
  1287  	StartIn StartInDirectory
  1288  
  1289  	FFI_USE_ExcludeAcceptAllOption bool // for ExcludeAcceptAllOption.
  1290  
  1291  	FFI_USE bool
  1292  }
  1293  
  1294  // FromRef calls UpdateFrom and returns a SaveFilePickerOptions with all fields set.
  1295  func (p SaveFilePickerOptions) FromRef(ref js.Ref) SaveFilePickerOptions {
  1296  	p.UpdateFrom(ref)
  1297  	return p
  1298  }
  1299  
  1300  // New creates a new SaveFilePickerOptions in the application heap.
  1301  func (p SaveFilePickerOptions) New() js.Ref {
  1302  	return bindings.SaveFilePickerOptionsJSLoad(
  1303  		js.Pointer(&p), js.True, 0,
  1304  	)
  1305  }
  1306  
  1307  // UpdateFrom copies value of all fields of the heap object to p.
  1308  func (p *SaveFilePickerOptions) UpdateFrom(ref js.Ref) {
  1309  	bindings.SaveFilePickerOptionsJSStore(
  1310  		js.Pointer(p), ref,
  1311  	)
  1312  }
  1313  
  1314  // Update writes all fields of the p to the heap object referenced by ref.
  1315  func (p *SaveFilePickerOptions) Update(ref js.Ref) {
  1316  	bindings.SaveFilePickerOptionsJSLoad(
  1317  		js.Pointer(p), js.False, ref,
  1318  	)
  1319  }
  1320  
  1321  // FreeMembers frees fields with heap reference, if recursive is true
  1322  // free all heap references reachable from p.
  1323  func (p *SaveFilePickerOptions) FreeMembers(recursive bool) {
  1324  	js.Free(
  1325  		p.SuggestedName.Ref(),
  1326  		p.Types.Ref(),
  1327  		p.Id.Ref(),
  1328  		p.StartIn.Ref(),
  1329  	)
  1330  	p.SuggestedName = p.SuggestedName.FromRef(js.Undefined)
  1331  	p.Types = p.Types.FromRef(js.Undefined)
  1332  	p.Id = p.Id.FromRef(js.Undefined)
  1333  	p.StartIn = p.StartIn.FromRef(js.Undefined)
  1334  }
  1335  
  1336  type FileSystemGetFileOptions struct {
  1337  	// Create is "FileSystemGetFileOptions.create"
  1338  	//
  1339  	// Optional, defaults to false.
  1340  	//
  1341  	// NOTE: FFI_USE_Create MUST be set to true to make this field effective.
  1342  	Create bool
  1343  
  1344  	FFI_USE_Create bool // for Create.
  1345  
  1346  	FFI_USE bool
  1347  }
  1348  
  1349  // FromRef calls UpdateFrom and returns a FileSystemGetFileOptions with all fields set.
  1350  func (p FileSystemGetFileOptions) FromRef(ref js.Ref) FileSystemGetFileOptions {
  1351  	p.UpdateFrom(ref)
  1352  	return p
  1353  }
  1354  
  1355  // New creates a new FileSystemGetFileOptions in the application heap.
  1356  func (p FileSystemGetFileOptions) New() js.Ref {
  1357  	return bindings.FileSystemGetFileOptionsJSLoad(
  1358  		js.Pointer(&p), js.True, 0,
  1359  	)
  1360  }
  1361  
  1362  // UpdateFrom copies value of all fields of the heap object to p.
  1363  func (p *FileSystemGetFileOptions) UpdateFrom(ref js.Ref) {
  1364  	bindings.FileSystemGetFileOptionsJSStore(
  1365  		js.Pointer(p), ref,
  1366  	)
  1367  }
  1368  
  1369  // Update writes all fields of the p to the heap object referenced by ref.
  1370  func (p *FileSystemGetFileOptions) Update(ref js.Ref) {
  1371  	bindings.FileSystemGetFileOptionsJSLoad(
  1372  		js.Pointer(p), js.False, ref,
  1373  	)
  1374  }
  1375  
  1376  // FreeMembers frees fields with heap reference, if recursive is true
  1377  // free all heap references reachable from p.
  1378  func (p *FileSystemGetFileOptions) FreeMembers(recursive bool) {
  1379  }
  1380  
  1381  type FileSystemGetDirectoryOptions struct {
  1382  	// Create is "FileSystemGetDirectoryOptions.create"
  1383  	//
  1384  	// Optional, defaults to false.
  1385  	//
  1386  	// NOTE: FFI_USE_Create MUST be set to true to make this field effective.
  1387  	Create bool
  1388  
  1389  	FFI_USE_Create bool // for Create.
  1390  
  1391  	FFI_USE bool
  1392  }
  1393  
  1394  // FromRef calls UpdateFrom and returns a FileSystemGetDirectoryOptions with all fields set.
  1395  func (p FileSystemGetDirectoryOptions) FromRef(ref js.Ref) FileSystemGetDirectoryOptions {
  1396  	p.UpdateFrom(ref)
  1397  	return p
  1398  }
  1399  
  1400  // New creates a new FileSystemGetDirectoryOptions in the application heap.
  1401  func (p FileSystemGetDirectoryOptions) New() js.Ref {
  1402  	return bindings.FileSystemGetDirectoryOptionsJSLoad(
  1403  		js.Pointer(&p), js.True, 0,
  1404  	)
  1405  }
  1406  
  1407  // UpdateFrom copies value of all fields of the heap object to p.
  1408  func (p *FileSystemGetDirectoryOptions) UpdateFrom(ref js.Ref) {
  1409  	bindings.FileSystemGetDirectoryOptionsJSStore(
  1410  		js.Pointer(p), ref,
  1411  	)
  1412  }
  1413  
  1414  // Update writes all fields of the p to the heap object referenced by ref.
  1415  func (p *FileSystemGetDirectoryOptions) Update(ref js.Ref) {
  1416  	bindings.FileSystemGetDirectoryOptionsJSLoad(
  1417  		js.Pointer(p), js.False, ref,
  1418  	)
  1419  }
  1420  
  1421  // FreeMembers frees fields with heap reference, if recursive is true
  1422  // free all heap references reachable from p.
  1423  func (p *FileSystemGetDirectoryOptions) FreeMembers(recursive bool) {
  1424  }
  1425  
  1426  type FileSystemRemoveOptions struct {
  1427  	// Recursive is "FileSystemRemoveOptions.recursive"
  1428  	//
  1429  	// Optional, defaults to false.
  1430  	//
  1431  	// NOTE: FFI_USE_Recursive MUST be set to true to make this field effective.
  1432  	Recursive bool
  1433  
  1434  	FFI_USE_Recursive bool // for Recursive.
  1435  
  1436  	FFI_USE bool
  1437  }
  1438  
  1439  // FromRef calls UpdateFrom and returns a FileSystemRemoveOptions with all fields set.
  1440  func (p FileSystemRemoveOptions) FromRef(ref js.Ref) FileSystemRemoveOptions {
  1441  	p.UpdateFrom(ref)
  1442  	return p
  1443  }
  1444  
  1445  // New creates a new FileSystemRemoveOptions in the application heap.
  1446  func (p FileSystemRemoveOptions) New() js.Ref {
  1447  	return bindings.FileSystemRemoveOptionsJSLoad(
  1448  		js.Pointer(&p), js.True, 0,
  1449  	)
  1450  }
  1451  
  1452  // UpdateFrom copies value of all fields of the heap object to p.
  1453  func (p *FileSystemRemoveOptions) UpdateFrom(ref js.Ref) {
  1454  	bindings.FileSystemRemoveOptionsJSStore(
  1455  		js.Pointer(p), ref,
  1456  	)
  1457  }
  1458  
  1459  // Update writes all fields of the p to the heap object referenced by ref.
  1460  func (p *FileSystemRemoveOptions) Update(ref js.Ref) {
  1461  	bindings.FileSystemRemoveOptionsJSLoad(
  1462  		js.Pointer(p), js.False, ref,
  1463  	)
  1464  }
  1465  
  1466  // FreeMembers frees fields with heap reference, if recursive is true
  1467  // free all heap references reachable from p.
  1468  func (p *FileSystemRemoveOptions) FreeMembers(recursive bool) {
  1469  }
  1470  
  1471  type FileSystemDirectoryHandle struct {
  1472  	FileSystemHandle
  1473  }
  1474  
  1475  func (this FileSystemDirectoryHandle) Once() FileSystemDirectoryHandle {
  1476  	this.ref.Once()
  1477  	return this
  1478  }
  1479  
  1480  func (this FileSystemDirectoryHandle) Ref() js.Ref {
  1481  	return this.FileSystemHandle.Ref()
  1482  }
  1483  
  1484  func (this FileSystemDirectoryHandle) FromRef(ref js.Ref) FileSystemDirectoryHandle {
  1485  	this.FileSystemHandle = this.FileSystemHandle.FromRef(ref)
  1486  	return this
  1487  }
  1488  
  1489  func (this FileSystemDirectoryHandle) Free() {
  1490  	this.ref.Free()
  1491  }
  1492  
  1493  // HasFuncGetFileHandle returns true if the method "FileSystemDirectoryHandle.getFileHandle" exists.
  1494  func (this FileSystemDirectoryHandle) HasFuncGetFileHandle() bool {
  1495  	return js.True == bindings.HasFuncFileSystemDirectoryHandleGetFileHandle(
  1496  		this.ref,
  1497  	)
  1498  }
  1499  
  1500  // FuncGetFileHandle returns the method "FileSystemDirectoryHandle.getFileHandle".
  1501  func (this FileSystemDirectoryHandle) FuncGetFileHandle() (fn js.Func[func(name js.String, options FileSystemGetFileOptions) js.Promise[FileSystemFileHandle]]) {
  1502  	bindings.FuncFileSystemDirectoryHandleGetFileHandle(
  1503  		this.ref, js.Pointer(&fn),
  1504  	)
  1505  	return
  1506  }
  1507  
  1508  // GetFileHandle calls the method "FileSystemDirectoryHandle.getFileHandle".
  1509  func (this FileSystemDirectoryHandle) GetFileHandle(name js.String, options FileSystemGetFileOptions) (ret js.Promise[FileSystemFileHandle]) {
  1510  	bindings.CallFileSystemDirectoryHandleGetFileHandle(
  1511  		this.ref, js.Pointer(&ret),
  1512  		name.Ref(),
  1513  		js.Pointer(&options),
  1514  	)
  1515  
  1516  	return
  1517  }
  1518  
  1519  // TryGetFileHandle calls the method "FileSystemDirectoryHandle.getFileHandle"
  1520  // in a try/catch block and returns (_, err, ok = false) when it went through
  1521  // the catch clause.
  1522  func (this FileSystemDirectoryHandle) TryGetFileHandle(name js.String, options FileSystemGetFileOptions) (ret js.Promise[FileSystemFileHandle], exception js.Any, ok bool) {
  1523  	ok = js.True == bindings.TryFileSystemDirectoryHandleGetFileHandle(
  1524  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1525  		name.Ref(),
  1526  		js.Pointer(&options),
  1527  	)
  1528  
  1529  	return
  1530  }
  1531  
  1532  // HasFuncGetFileHandle1 returns true if the method "FileSystemDirectoryHandle.getFileHandle" exists.
  1533  func (this FileSystemDirectoryHandle) HasFuncGetFileHandle1() bool {
  1534  	return js.True == bindings.HasFuncFileSystemDirectoryHandleGetFileHandle1(
  1535  		this.ref,
  1536  	)
  1537  }
  1538  
  1539  // FuncGetFileHandle1 returns the method "FileSystemDirectoryHandle.getFileHandle".
  1540  func (this FileSystemDirectoryHandle) FuncGetFileHandle1() (fn js.Func[func(name js.String) js.Promise[FileSystemFileHandle]]) {
  1541  	bindings.FuncFileSystemDirectoryHandleGetFileHandle1(
  1542  		this.ref, js.Pointer(&fn),
  1543  	)
  1544  	return
  1545  }
  1546  
  1547  // GetFileHandle1 calls the method "FileSystemDirectoryHandle.getFileHandle".
  1548  func (this FileSystemDirectoryHandle) GetFileHandle1(name js.String) (ret js.Promise[FileSystemFileHandle]) {
  1549  	bindings.CallFileSystemDirectoryHandleGetFileHandle1(
  1550  		this.ref, js.Pointer(&ret),
  1551  		name.Ref(),
  1552  	)
  1553  
  1554  	return
  1555  }
  1556  
  1557  // TryGetFileHandle1 calls the method "FileSystemDirectoryHandle.getFileHandle"
  1558  // in a try/catch block and returns (_, err, ok = false) when it went through
  1559  // the catch clause.
  1560  func (this FileSystemDirectoryHandle) TryGetFileHandle1(name js.String) (ret js.Promise[FileSystemFileHandle], exception js.Any, ok bool) {
  1561  	ok = js.True == bindings.TryFileSystemDirectoryHandleGetFileHandle1(
  1562  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1563  		name.Ref(),
  1564  	)
  1565  
  1566  	return
  1567  }
  1568  
  1569  // HasFuncGetDirectoryHandle returns true if the method "FileSystemDirectoryHandle.getDirectoryHandle" exists.
  1570  func (this FileSystemDirectoryHandle) HasFuncGetDirectoryHandle() bool {
  1571  	return js.True == bindings.HasFuncFileSystemDirectoryHandleGetDirectoryHandle(
  1572  		this.ref,
  1573  	)
  1574  }
  1575  
  1576  // FuncGetDirectoryHandle returns the method "FileSystemDirectoryHandle.getDirectoryHandle".
  1577  func (this FileSystemDirectoryHandle) FuncGetDirectoryHandle() (fn js.Func[func(name js.String, options FileSystemGetDirectoryOptions) js.Promise[FileSystemDirectoryHandle]]) {
  1578  	bindings.FuncFileSystemDirectoryHandleGetDirectoryHandle(
  1579  		this.ref, js.Pointer(&fn),
  1580  	)
  1581  	return
  1582  }
  1583  
  1584  // GetDirectoryHandle calls the method "FileSystemDirectoryHandle.getDirectoryHandle".
  1585  func (this FileSystemDirectoryHandle) GetDirectoryHandle(name js.String, options FileSystemGetDirectoryOptions) (ret js.Promise[FileSystemDirectoryHandle]) {
  1586  	bindings.CallFileSystemDirectoryHandleGetDirectoryHandle(
  1587  		this.ref, js.Pointer(&ret),
  1588  		name.Ref(),
  1589  		js.Pointer(&options),
  1590  	)
  1591  
  1592  	return
  1593  }
  1594  
  1595  // TryGetDirectoryHandle calls the method "FileSystemDirectoryHandle.getDirectoryHandle"
  1596  // in a try/catch block and returns (_, err, ok = false) when it went through
  1597  // the catch clause.
  1598  func (this FileSystemDirectoryHandle) TryGetDirectoryHandle(name js.String, options FileSystemGetDirectoryOptions) (ret js.Promise[FileSystemDirectoryHandle], exception js.Any, ok bool) {
  1599  	ok = js.True == bindings.TryFileSystemDirectoryHandleGetDirectoryHandle(
  1600  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1601  		name.Ref(),
  1602  		js.Pointer(&options),
  1603  	)
  1604  
  1605  	return
  1606  }
  1607  
  1608  // HasFuncGetDirectoryHandle1 returns true if the method "FileSystemDirectoryHandle.getDirectoryHandle" exists.
  1609  func (this FileSystemDirectoryHandle) HasFuncGetDirectoryHandle1() bool {
  1610  	return js.True == bindings.HasFuncFileSystemDirectoryHandleGetDirectoryHandle1(
  1611  		this.ref,
  1612  	)
  1613  }
  1614  
  1615  // FuncGetDirectoryHandle1 returns the method "FileSystemDirectoryHandle.getDirectoryHandle".
  1616  func (this FileSystemDirectoryHandle) FuncGetDirectoryHandle1() (fn js.Func[func(name js.String) js.Promise[FileSystemDirectoryHandle]]) {
  1617  	bindings.FuncFileSystemDirectoryHandleGetDirectoryHandle1(
  1618  		this.ref, js.Pointer(&fn),
  1619  	)
  1620  	return
  1621  }
  1622  
  1623  // GetDirectoryHandle1 calls the method "FileSystemDirectoryHandle.getDirectoryHandle".
  1624  func (this FileSystemDirectoryHandle) GetDirectoryHandle1(name js.String) (ret js.Promise[FileSystemDirectoryHandle]) {
  1625  	bindings.CallFileSystemDirectoryHandleGetDirectoryHandle1(
  1626  		this.ref, js.Pointer(&ret),
  1627  		name.Ref(),
  1628  	)
  1629  
  1630  	return
  1631  }
  1632  
  1633  // TryGetDirectoryHandle1 calls the method "FileSystemDirectoryHandle.getDirectoryHandle"
  1634  // in a try/catch block and returns (_, err, ok = false) when it went through
  1635  // the catch clause.
  1636  func (this FileSystemDirectoryHandle) TryGetDirectoryHandle1(name js.String) (ret js.Promise[FileSystemDirectoryHandle], exception js.Any, ok bool) {
  1637  	ok = js.True == bindings.TryFileSystemDirectoryHandleGetDirectoryHandle1(
  1638  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1639  		name.Ref(),
  1640  	)
  1641  
  1642  	return
  1643  }
  1644  
  1645  // HasFuncRemoveEntry returns true if the method "FileSystemDirectoryHandle.removeEntry" exists.
  1646  func (this FileSystemDirectoryHandle) HasFuncRemoveEntry() bool {
  1647  	return js.True == bindings.HasFuncFileSystemDirectoryHandleRemoveEntry(
  1648  		this.ref,
  1649  	)
  1650  }
  1651  
  1652  // FuncRemoveEntry returns the method "FileSystemDirectoryHandle.removeEntry".
  1653  func (this FileSystemDirectoryHandle) FuncRemoveEntry() (fn js.Func[func(name js.String, options FileSystemRemoveOptions) js.Promise[js.Void]]) {
  1654  	bindings.FuncFileSystemDirectoryHandleRemoveEntry(
  1655  		this.ref, js.Pointer(&fn),
  1656  	)
  1657  	return
  1658  }
  1659  
  1660  // RemoveEntry calls the method "FileSystemDirectoryHandle.removeEntry".
  1661  func (this FileSystemDirectoryHandle) RemoveEntry(name js.String, options FileSystemRemoveOptions) (ret js.Promise[js.Void]) {
  1662  	bindings.CallFileSystemDirectoryHandleRemoveEntry(
  1663  		this.ref, js.Pointer(&ret),
  1664  		name.Ref(),
  1665  		js.Pointer(&options),
  1666  	)
  1667  
  1668  	return
  1669  }
  1670  
  1671  // TryRemoveEntry calls the method "FileSystemDirectoryHandle.removeEntry"
  1672  // in a try/catch block and returns (_, err, ok = false) when it went through
  1673  // the catch clause.
  1674  func (this FileSystemDirectoryHandle) TryRemoveEntry(name js.String, options FileSystemRemoveOptions) (ret js.Promise[js.Void], exception js.Any, ok bool) {
  1675  	ok = js.True == bindings.TryFileSystemDirectoryHandleRemoveEntry(
  1676  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1677  		name.Ref(),
  1678  		js.Pointer(&options),
  1679  	)
  1680  
  1681  	return
  1682  }
  1683  
  1684  // HasFuncRemoveEntry1 returns true if the method "FileSystemDirectoryHandle.removeEntry" exists.
  1685  func (this FileSystemDirectoryHandle) HasFuncRemoveEntry1() bool {
  1686  	return js.True == bindings.HasFuncFileSystemDirectoryHandleRemoveEntry1(
  1687  		this.ref,
  1688  	)
  1689  }
  1690  
  1691  // FuncRemoveEntry1 returns the method "FileSystemDirectoryHandle.removeEntry".
  1692  func (this FileSystemDirectoryHandle) FuncRemoveEntry1() (fn js.Func[func(name js.String) js.Promise[js.Void]]) {
  1693  	bindings.FuncFileSystemDirectoryHandleRemoveEntry1(
  1694  		this.ref, js.Pointer(&fn),
  1695  	)
  1696  	return
  1697  }
  1698  
  1699  // RemoveEntry1 calls the method "FileSystemDirectoryHandle.removeEntry".
  1700  func (this FileSystemDirectoryHandle) RemoveEntry1(name js.String) (ret js.Promise[js.Void]) {
  1701  	bindings.CallFileSystemDirectoryHandleRemoveEntry1(
  1702  		this.ref, js.Pointer(&ret),
  1703  		name.Ref(),
  1704  	)
  1705  
  1706  	return
  1707  }
  1708  
  1709  // TryRemoveEntry1 calls the method "FileSystemDirectoryHandle.removeEntry"
  1710  // in a try/catch block and returns (_, err, ok = false) when it went through
  1711  // the catch clause.
  1712  func (this FileSystemDirectoryHandle) TryRemoveEntry1(name js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) {
  1713  	ok = js.True == bindings.TryFileSystemDirectoryHandleRemoveEntry1(
  1714  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1715  		name.Ref(),
  1716  	)
  1717  
  1718  	return
  1719  }
  1720  
  1721  // HasFuncResolve returns true if the method "FileSystemDirectoryHandle.resolve" exists.
  1722  func (this FileSystemDirectoryHandle) HasFuncResolve() bool {
  1723  	return js.True == bindings.HasFuncFileSystemDirectoryHandleResolve(
  1724  		this.ref,
  1725  	)
  1726  }
  1727  
  1728  // FuncResolve returns the method "FileSystemDirectoryHandle.resolve".
  1729  func (this FileSystemDirectoryHandle) FuncResolve() (fn js.Func[func(possibleDescendant FileSystemHandle) js.Promise[js.Array[js.String]]]) {
  1730  	bindings.FuncFileSystemDirectoryHandleResolve(
  1731  		this.ref, js.Pointer(&fn),
  1732  	)
  1733  	return
  1734  }
  1735  
  1736  // Resolve calls the method "FileSystemDirectoryHandle.resolve".
  1737  func (this FileSystemDirectoryHandle) Resolve(possibleDescendant FileSystemHandle) (ret js.Promise[js.Array[js.String]]) {
  1738  	bindings.CallFileSystemDirectoryHandleResolve(
  1739  		this.ref, js.Pointer(&ret),
  1740  		possibleDescendant.Ref(),
  1741  	)
  1742  
  1743  	return
  1744  }
  1745  
  1746  // TryResolve calls the method "FileSystemDirectoryHandle.resolve"
  1747  // in a try/catch block and returns (_, err, ok = false) when it went through
  1748  // the catch clause.
  1749  func (this FileSystemDirectoryHandle) TryResolve(possibleDescendant FileSystemHandle) (ret js.Promise[js.Array[js.String]], exception js.Any, ok bool) {
  1750  	ok = js.True == bindings.TryFileSystemDirectoryHandleResolve(
  1751  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1752  		possibleDescendant.Ref(),
  1753  	)
  1754  
  1755  	return
  1756  }
  1757  
  1758  type DirectoryPickerOptions struct {
  1759  	// Id is "DirectoryPickerOptions.id"
  1760  	//
  1761  	// Optional
  1762  	Id js.String
  1763  	// StartIn is "DirectoryPickerOptions.startIn"
  1764  	//
  1765  	// Optional
  1766  	StartIn StartInDirectory
  1767  	// Mode is "DirectoryPickerOptions.mode"
  1768  	//
  1769  	// Optional, defaults to "read".
  1770  	Mode FileSystemPermissionMode
  1771  
  1772  	FFI_USE bool
  1773  }
  1774  
  1775  // FromRef calls UpdateFrom and returns a DirectoryPickerOptions with all fields set.
  1776  func (p DirectoryPickerOptions) FromRef(ref js.Ref) DirectoryPickerOptions {
  1777  	p.UpdateFrom(ref)
  1778  	return p
  1779  }
  1780  
  1781  // New creates a new DirectoryPickerOptions in the application heap.
  1782  func (p DirectoryPickerOptions) New() js.Ref {
  1783  	return bindings.DirectoryPickerOptionsJSLoad(
  1784  		js.Pointer(&p), js.True, 0,
  1785  	)
  1786  }
  1787  
  1788  // UpdateFrom copies value of all fields of the heap object to p.
  1789  func (p *DirectoryPickerOptions) UpdateFrom(ref js.Ref) {
  1790  	bindings.DirectoryPickerOptionsJSStore(
  1791  		js.Pointer(p), ref,
  1792  	)
  1793  }
  1794  
  1795  // Update writes all fields of the p to the heap object referenced by ref.
  1796  func (p *DirectoryPickerOptions) Update(ref js.Ref) {
  1797  	bindings.DirectoryPickerOptionsJSLoad(
  1798  		js.Pointer(p), js.False, ref,
  1799  	)
  1800  }
  1801  
  1802  // FreeMembers frees fields with heap reference, if recursive is true
  1803  // free all heap references reachable from p.
  1804  func (p *DirectoryPickerOptions) FreeMembers(recursive bool) {
  1805  	js.Free(
  1806  		p.Id.Ref(),
  1807  		p.StartIn.Ref(),
  1808  	)
  1809  	p.Id = p.Id.FromRef(js.Undefined)
  1810  	p.StartIn = p.StartIn.FromRef(js.Undefined)
  1811  }
  1812  
  1813  type FontData struct {
  1814  	ref js.Ref
  1815  }
  1816  
  1817  func (this FontData) Once() FontData {
  1818  	this.ref.Once()
  1819  	return this
  1820  }
  1821  
  1822  func (this FontData) Ref() js.Ref {
  1823  	return this.ref
  1824  }
  1825  
  1826  func (this FontData) FromRef(ref js.Ref) FontData {
  1827  	this.ref = ref
  1828  	return this
  1829  }
  1830  
  1831  func (this FontData) Free() {
  1832  	this.ref.Free()
  1833  }
  1834  
  1835  // PostscriptName returns the value of property "FontData.postscriptName".
  1836  //
  1837  // It returns ok=false if there is no such property.
  1838  func (this FontData) PostscriptName() (ret js.String, ok bool) {
  1839  	ok = js.True == bindings.GetFontDataPostscriptName(
  1840  		this.ref, js.Pointer(&ret),
  1841  	)
  1842  	return
  1843  }
  1844  
  1845  // FullName returns the value of property "FontData.fullName".
  1846  //
  1847  // It returns ok=false if there is no such property.
  1848  func (this FontData) FullName() (ret js.String, ok bool) {
  1849  	ok = js.True == bindings.GetFontDataFullName(
  1850  		this.ref, js.Pointer(&ret),
  1851  	)
  1852  	return
  1853  }
  1854  
  1855  // Family returns the value of property "FontData.family".
  1856  //
  1857  // It returns ok=false if there is no such property.
  1858  func (this FontData) Family() (ret js.String, ok bool) {
  1859  	ok = js.True == bindings.GetFontDataFamily(
  1860  		this.ref, js.Pointer(&ret),
  1861  	)
  1862  	return
  1863  }
  1864  
  1865  // Style returns the value of property "FontData.style".
  1866  //
  1867  // It returns ok=false if there is no such property.
  1868  func (this FontData) Style() (ret js.String, ok bool) {
  1869  	ok = js.True == bindings.GetFontDataStyle(
  1870  		this.ref, js.Pointer(&ret),
  1871  	)
  1872  	return
  1873  }
  1874  
  1875  // HasFuncBlob returns true if the method "FontData.blob" exists.
  1876  func (this FontData) HasFuncBlob() bool {
  1877  	return js.True == bindings.HasFuncFontDataBlob(
  1878  		this.ref,
  1879  	)
  1880  }
  1881  
  1882  // FuncBlob returns the method "FontData.blob".
  1883  func (this FontData) FuncBlob() (fn js.Func[func() js.Promise[Blob]]) {
  1884  	bindings.FuncFontDataBlob(
  1885  		this.ref, js.Pointer(&fn),
  1886  	)
  1887  	return
  1888  }
  1889  
  1890  // Blob calls the method "FontData.blob".
  1891  func (this FontData) Blob() (ret js.Promise[Blob]) {
  1892  	bindings.CallFontDataBlob(
  1893  		this.ref, js.Pointer(&ret),
  1894  	)
  1895  
  1896  	return
  1897  }
  1898  
  1899  // TryBlob calls the method "FontData.blob"
  1900  // in a try/catch block and returns (_, err, ok = false) when it went through
  1901  // the catch clause.
  1902  func (this FontData) TryBlob() (ret js.Promise[Blob], exception js.Any, ok bool) {
  1903  	ok = js.True == bindings.TryFontDataBlob(
  1904  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  1905  	)
  1906  
  1907  	return
  1908  }
  1909  
  1910  type QueryOptions struct {
  1911  	// PostscriptNames is "QueryOptions.postscriptNames"
  1912  	//
  1913  	// Optional
  1914  	PostscriptNames js.Array[js.String]
  1915  
  1916  	FFI_USE bool
  1917  }
  1918  
  1919  // FromRef calls UpdateFrom and returns a QueryOptions with all fields set.
  1920  func (p QueryOptions) FromRef(ref js.Ref) QueryOptions {
  1921  	p.UpdateFrom(ref)
  1922  	return p
  1923  }
  1924  
  1925  // New creates a new QueryOptions in the application heap.
  1926  func (p QueryOptions) New() js.Ref {
  1927  	return bindings.QueryOptionsJSLoad(
  1928  		js.Pointer(&p), js.True, 0,
  1929  	)
  1930  }
  1931  
  1932  // UpdateFrom copies value of all fields of the heap object to p.
  1933  func (p *QueryOptions) UpdateFrom(ref js.Ref) {
  1934  	bindings.QueryOptionsJSStore(
  1935  		js.Pointer(p), ref,
  1936  	)
  1937  }
  1938  
  1939  // Update writes all fields of the p to the heap object referenced by ref.
  1940  func (p *QueryOptions) Update(ref js.Ref) {
  1941  	bindings.QueryOptionsJSLoad(
  1942  		js.Pointer(p), js.False, ref,
  1943  	)
  1944  }
  1945  
  1946  // FreeMembers frees fields with heap reference, if recursive is true
  1947  // free all heap references reachable from p.
  1948  func (p *QueryOptions) FreeMembers(recursive bool) {
  1949  	js.Free(
  1950  		p.PostscriptNames.Ref(),
  1951  	)
  1952  	p.PostscriptNames = p.PostscriptNames.FromRef(js.Undefined)
  1953  }
  1954  
  1955  type ScreenDetails struct {
  1956  	EventTarget
  1957  }
  1958  
  1959  func (this ScreenDetails) Once() ScreenDetails {
  1960  	this.ref.Once()
  1961  	return this
  1962  }
  1963  
  1964  func (this ScreenDetails) Ref() js.Ref {
  1965  	return this.EventTarget.Ref()
  1966  }
  1967  
  1968  func (this ScreenDetails) FromRef(ref js.Ref) ScreenDetails {
  1969  	this.EventTarget = this.EventTarget.FromRef(ref)
  1970  	return this
  1971  }
  1972  
  1973  func (this ScreenDetails) Free() {
  1974  	this.ref.Free()
  1975  }
  1976  
  1977  // Screens returns the value of property "ScreenDetails.screens".
  1978  //
  1979  // It returns ok=false if there is no such property.
  1980  func (this ScreenDetails) Screens() (ret js.FrozenArray[ScreenDetailed], ok bool) {
  1981  	ok = js.True == bindings.GetScreenDetailsScreens(
  1982  		this.ref, js.Pointer(&ret),
  1983  	)
  1984  	return
  1985  }
  1986  
  1987  // CurrentScreen returns the value of property "ScreenDetails.currentScreen".
  1988  //
  1989  // It returns ok=false if there is no such property.
  1990  func (this ScreenDetails) CurrentScreen() (ret ScreenDetailed, ok bool) {
  1991  	ok = js.True == bindings.GetScreenDetailsCurrentScreen(
  1992  		this.ref, js.Pointer(&ret),
  1993  	)
  1994  	return
  1995  }
  1996  
  1997  type ItemType uint32
  1998  
  1999  const (
  2000  	_ ItemType = iota
  2001  
  2002  	ItemType_PRODUCT
  2003  	ItemType_SUBSCRIPTION
  2004  )
  2005  
  2006  func (ItemType) FromRef(str js.Ref) ItemType {
  2007  	return ItemType(bindings.ConstOfItemType(str))
  2008  }
  2009  
  2010  func (x ItemType) String() (string, bool) {
  2011  	switch x {
  2012  	case ItemType_PRODUCT:
  2013  		return "product", true
  2014  	case ItemType_SUBSCRIPTION:
  2015  		return "subscription", true
  2016  	default:
  2017  		return "", false
  2018  	}
  2019  }
  2020  
  2021  type ItemDetails struct {
  2022  	// ItemId is "ItemDetails.itemId"
  2023  	//
  2024  	// Required
  2025  	ItemId js.String
  2026  	// Title is "ItemDetails.title"
  2027  	//
  2028  	// Required
  2029  	Title js.String
  2030  	// Price is "ItemDetails.price"
  2031  	//
  2032  	// Required
  2033  	//
  2034  	// NOTE: Price.FFI_USE MUST be set to true to get Price used.
  2035  	Price PaymentCurrencyAmount
  2036  	// Type is "ItemDetails.type"
  2037  	//
  2038  	// Optional
  2039  	Type ItemType
  2040  	// Description is "ItemDetails.description"
  2041  	//
  2042  	// Optional
  2043  	Description js.String
  2044  	// IconURLs is "ItemDetails.iconURLs"
  2045  	//
  2046  	// Optional
  2047  	IconURLs js.Array[js.String]
  2048  	// SubscriptionPeriod is "ItemDetails.subscriptionPeriod"
  2049  	//
  2050  	// Optional
  2051  	SubscriptionPeriod js.String
  2052  	// FreeTrialPeriod is "ItemDetails.freeTrialPeriod"
  2053  	//
  2054  	// Optional
  2055  	FreeTrialPeriod js.String
  2056  	// IntroductoryPrice is "ItemDetails.introductoryPrice"
  2057  	//
  2058  	// Optional
  2059  	//
  2060  	// NOTE: IntroductoryPrice.FFI_USE MUST be set to true to get IntroductoryPrice used.
  2061  	IntroductoryPrice PaymentCurrencyAmount
  2062  	// IntroductoryPricePeriod is "ItemDetails.introductoryPricePeriod"
  2063  	//
  2064  	// Optional
  2065  	IntroductoryPricePeriod js.String
  2066  	// IntroductoryPriceCycles is "ItemDetails.introductoryPriceCycles"
  2067  	//
  2068  	// Optional
  2069  	//
  2070  	// NOTE: FFI_USE_IntroductoryPriceCycles MUST be set to true to make this field effective.
  2071  	IntroductoryPriceCycles uint64
  2072  
  2073  	FFI_USE_IntroductoryPriceCycles bool // for IntroductoryPriceCycles.
  2074  
  2075  	FFI_USE bool
  2076  }
  2077  
  2078  // FromRef calls UpdateFrom and returns a ItemDetails with all fields set.
  2079  func (p ItemDetails) FromRef(ref js.Ref) ItemDetails {
  2080  	p.UpdateFrom(ref)
  2081  	return p
  2082  }
  2083  
  2084  // New creates a new ItemDetails in the application heap.
  2085  func (p ItemDetails) New() js.Ref {
  2086  	return bindings.ItemDetailsJSLoad(
  2087  		js.Pointer(&p), js.True, 0,
  2088  	)
  2089  }
  2090  
  2091  // UpdateFrom copies value of all fields of the heap object to p.
  2092  func (p *ItemDetails) UpdateFrom(ref js.Ref) {
  2093  	bindings.ItemDetailsJSStore(
  2094  		js.Pointer(p), ref,
  2095  	)
  2096  }
  2097  
  2098  // Update writes all fields of the p to the heap object referenced by ref.
  2099  func (p *ItemDetails) Update(ref js.Ref) {
  2100  	bindings.ItemDetailsJSLoad(
  2101  		js.Pointer(p), js.False, ref,
  2102  	)
  2103  }
  2104  
  2105  // FreeMembers frees fields with heap reference, if recursive is true
  2106  // free all heap references reachable from p.
  2107  func (p *ItemDetails) FreeMembers(recursive bool) {
  2108  	js.Free(
  2109  		p.ItemId.Ref(),
  2110  		p.Title.Ref(),
  2111  		p.Description.Ref(),
  2112  		p.IconURLs.Ref(),
  2113  		p.SubscriptionPeriod.Ref(),
  2114  		p.FreeTrialPeriod.Ref(),
  2115  		p.IntroductoryPricePeriod.Ref(),
  2116  	)
  2117  	p.ItemId = p.ItemId.FromRef(js.Undefined)
  2118  	p.Title = p.Title.FromRef(js.Undefined)
  2119  	p.Description = p.Description.FromRef(js.Undefined)
  2120  	p.IconURLs = p.IconURLs.FromRef(js.Undefined)
  2121  	p.SubscriptionPeriod = p.SubscriptionPeriod.FromRef(js.Undefined)
  2122  	p.FreeTrialPeriod = p.FreeTrialPeriod.FromRef(js.Undefined)
  2123  	p.IntroductoryPricePeriod = p.IntroductoryPricePeriod.FromRef(js.Undefined)
  2124  	if recursive {
  2125  		p.Price.FreeMembers(true)
  2126  		p.IntroductoryPrice.FreeMembers(true)
  2127  	}
  2128  }
  2129  
  2130  type PurchaseDetails struct {
  2131  	// ItemId is "PurchaseDetails.itemId"
  2132  	//
  2133  	// Required
  2134  	ItemId js.String
  2135  	// PurchaseToken is "PurchaseDetails.purchaseToken"
  2136  	//
  2137  	// Required
  2138  	PurchaseToken js.String
  2139  
  2140  	FFI_USE bool
  2141  }
  2142  
  2143  // FromRef calls UpdateFrom and returns a PurchaseDetails with all fields set.
  2144  func (p PurchaseDetails) FromRef(ref js.Ref) PurchaseDetails {
  2145  	p.UpdateFrom(ref)
  2146  	return p
  2147  }
  2148  
  2149  // New creates a new PurchaseDetails in the application heap.
  2150  func (p PurchaseDetails) New() js.Ref {
  2151  	return bindings.PurchaseDetailsJSLoad(
  2152  		js.Pointer(&p), js.True, 0,
  2153  	)
  2154  }
  2155  
  2156  // UpdateFrom copies value of all fields of the heap object to p.
  2157  func (p *PurchaseDetails) UpdateFrom(ref js.Ref) {
  2158  	bindings.PurchaseDetailsJSStore(
  2159  		js.Pointer(p), ref,
  2160  	)
  2161  }
  2162  
  2163  // Update writes all fields of the p to the heap object referenced by ref.
  2164  func (p *PurchaseDetails) Update(ref js.Ref) {
  2165  	bindings.PurchaseDetailsJSLoad(
  2166  		js.Pointer(p), js.False, ref,
  2167  	)
  2168  }
  2169  
  2170  // FreeMembers frees fields with heap reference, if recursive is true
  2171  // free all heap references reachable from p.
  2172  func (p *PurchaseDetails) FreeMembers(recursive bool) {
  2173  	js.Free(
  2174  		p.ItemId.Ref(),
  2175  		p.PurchaseToken.Ref(),
  2176  	)
  2177  	p.ItemId = p.ItemId.FromRef(js.Undefined)
  2178  	p.PurchaseToken = p.PurchaseToken.FromRef(js.Undefined)
  2179  }
  2180  
  2181  type DigitalGoodsService struct {
  2182  	ref js.Ref
  2183  }
  2184  
  2185  func (this DigitalGoodsService) Once() DigitalGoodsService {
  2186  	this.ref.Once()
  2187  	return this
  2188  }
  2189  
  2190  func (this DigitalGoodsService) Ref() js.Ref {
  2191  	return this.ref
  2192  }
  2193  
  2194  func (this DigitalGoodsService) FromRef(ref js.Ref) DigitalGoodsService {
  2195  	this.ref = ref
  2196  	return this
  2197  }
  2198  
  2199  func (this DigitalGoodsService) Free() {
  2200  	this.ref.Free()
  2201  }
  2202  
  2203  // HasFuncGetDetails returns true if the method "DigitalGoodsService.getDetails" exists.
  2204  func (this DigitalGoodsService) HasFuncGetDetails() bool {
  2205  	return js.True == bindings.HasFuncDigitalGoodsServiceGetDetails(
  2206  		this.ref,
  2207  	)
  2208  }
  2209  
  2210  // FuncGetDetails returns the method "DigitalGoodsService.getDetails".
  2211  func (this DigitalGoodsService) FuncGetDetails() (fn js.Func[func(itemIds js.Array[js.String]) js.Promise[js.Array[ItemDetails]]]) {
  2212  	bindings.FuncDigitalGoodsServiceGetDetails(
  2213  		this.ref, js.Pointer(&fn),
  2214  	)
  2215  	return
  2216  }
  2217  
  2218  // GetDetails calls the method "DigitalGoodsService.getDetails".
  2219  func (this DigitalGoodsService) GetDetails(itemIds js.Array[js.String]) (ret js.Promise[js.Array[ItemDetails]]) {
  2220  	bindings.CallDigitalGoodsServiceGetDetails(
  2221  		this.ref, js.Pointer(&ret),
  2222  		itemIds.Ref(),
  2223  	)
  2224  
  2225  	return
  2226  }
  2227  
  2228  // TryGetDetails calls the method "DigitalGoodsService.getDetails"
  2229  // in a try/catch block and returns (_, err, ok = false) when it went through
  2230  // the catch clause.
  2231  func (this DigitalGoodsService) TryGetDetails(itemIds js.Array[js.String]) (ret js.Promise[js.Array[ItemDetails]], exception js.Any, ok bool) {
  2232  	ok = js.True == bindings.TryDigitalGoodsServiceGetDetails(
  2233  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2234  		itemIds.Ref(),
  2235  	)
  2236  
  2237  	return
  2238  }
  2239  
  2240  // HasFuncListPurchases returns true if the method "DigitalGoodsService.listPurchases" exists.
  2241  func (this DigitalGoodsService) HasFuncListPurchases() bool {
  2242  	return js.True == bindings.HasFuncDigitalGoodsServiceListPurchases(
  2243  		this.ref,
  2244  	)
  2245  }
  2246  
  2247  // FuncListPurchases returns the method "DigitalGoodsService.listPurchases".
  2248  func (this DigitalGoodsService) FuncListPurchases() (fn js.Func[func() js.Promise[js.Array[PurchaseDetails]]]) {
  2249  	bindings.FuncDigitalGoodsServiceListPurchases(
  2250  		this.ref, js.Pointer(&fn),
  2251  	)
  2252  	return
  2253  }
  2254  
  2255  // ListPurchases calls the method "DigitalGoodsService.listPurchases".
  2256  func (this DigitalGoodsService) ListPurchases() (ret js.Promise[js.Array[PurchaseDetails]]) {
  2257  	bindings.CallDigitalGoodsServiceListPurchases(
  2258  		this.ref, js.Pointer(&ret),
  2259  	)
  2260  
  2261  	return
  2262  }
  2263  
  2264  // TryListPurchases calls the method "DigitalGoodsService.listPurchases"
  2265  // in a try/catch block and returns (_, err, ok = false) when it went through
  2266  // the catch clause.
  2267  func (this DigitalGoodsService) TryListPurchases() (ret js.Promise[js.Array[PurchaseDetails]], exception js.Any, ok bool) {
  2268  	ok = js.True == bindings.TryDigitalGoodsServiceListPurchases(
  2269  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2270  	)
  2271  
  2272  	return
  2273  }
  2274  
  2275  // HasFuncListPurchaseHistory returns true if the method "DigitalGoodsService.listPurchaseHistory" exists.
  2276  func (this DigitalGoodsService) HasFuncListPurchaseHistory() bool {
  2277  	return js.True == bindings.HasFuncDigitalGoodsServiceListPurchaseHistory(
  2278  		this.ref,
  2279  	)
  2280  }
  2281  
  2282  // FuncListPurchaseHistory returns the method "DigitalGoodsService.listPurchaseHistory".
  2283  func (this DigitalGoodsService) FuncListPurchaseHistory() (fn js.Func[func() js.Promise[js.Array[PurchaseDetails]]]) {
  2284  	bindings.FuncDigitalGoodsServiceListPurchaseHistory(
  2285  		this.ref, js.Pointer(&fn),
  2286  	)
  2287  	return
  2288  }
  2289  
  2290  // ListPurchaseHistory calls the method "DigitalGoodsService.listPurchaseHistory".
  2291  func (this DigitalGoodsService) ListPurchaseHistory() (ret js.Promise[js.Array[PurchaseDetails]]) {
  2292  	bindings.CallDigitalGoodsServiceListPurchaseHistory(
  2293  		this.ref, js.Pointer(&ret),
  2294  	)
  2295  
  2296  	return
  2297  }
  2298  
  2299  // TryListPurchaseHistory calls the method "DigitalGoodsService.listPurchaseHistory"
  2300  // in a try/catch block and returns (_, err, ok = false) when it went through
  2301  // the catch clause.
  2302  func (this DigitalGoodsService) TryListPurchaseHistory() (ret js.Promise[js.Array[PurchaseDetails]], exception js.Any, ok bool) {
  2303  	ok = js.True == bindings.TryDigitalGoodsServiceListPurchaseHistory(
  2304  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2305  	)
  2306  
  2307  	return
  2308  }
  2309  
  2310  // HasFuncConsume returns true if the method "DigitalGoodsService.consume" exists.
  2311  func (this DigitalGoodsService) HasFuncConsume() bool {
  2312  	return js.True == bindings.HasFuncDigitalGoodsServiceConsume(
  2313  		this.ref,
  2314  	)
  2315  }
  2316  
  2317  // FuncConsume returns the method "DigitalGoodsService.consume".
  2318  func (this DigitalGoodsService) FuncConsume() (fn js.Func[func(purchaseToken js.String) js.Promise[js.Void]]) {
  2319  	bindings.FuncDigitalGoodsServiceConsume(
  2320  		this.ref, js.Pointer(&fn),
  2321  	)
  2322  	return
  2323  }
  2324  
  2325  // Consume calls the method "DigitalGoodsService.consume".
  2326  func (this DigitalGoodsService) Consume(purchaseToken js.String) (ret js.Promise[js.Void]) {
  2327  	bindings.CallDigitalGoodsServiceConsume(
  2328  		this.ref, js.Pointer(&ret),
  2329  		purchaseToken.Ref(),
  2330  	)
  2331  
  2332  	return
  2333  }
  2334  
  2335  // TryConsume calls the method "DigitalGoodsService.consume"
  2336  // in a try/catch block and returns (_, err, ok = false) when it went through
  2337  // the catch clause.
  2338  func (this DigitalGoodsService) TryConsume(purchaseToken js.String) (ret js.Promise[js.Void], exception js.Any, ok bool) {
  2339  	ok = js.True == bindings.TryDigitalGoodsServiceConsume(
  2340  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2341  		purchaseToken.Ref(),
  2342  	)
  2343  
  2344  	return
  2345  }
  2346  
  2347  type OneOf_String_FuncFunction struct {
  2348  	ref js.Ref
  2349  }
  2350  
  2351  func (x OneOf_String_FuncFunction) Ref() js.Ref {
  2352  	return x.ref
  2353  }
  2354  
  2355  func (x OneOf_String_FuncFunction) Free() {
  2356  	x.ref.Free()
  2357  }
  2358  
  2359  func (x OneOf_String_FuncFunction) FromRef(ref js.Ref) OneOf_String_FuncFunction {
  2360  	return OneOf_String_FuncFunction{
  2361  		ref: ref,
  2362  	}
  2363  }
  2364  
  2365  func (x OneOf_String_FuncFunction) String() js.String {
  2366  	return js.String{}.FromRef(x.ref)
  2367  }
  2368  
  2369  func (x OneOf_String_FuncFunction) FuncFunction() js.Func[func(arguments ...js.Any) js.Any] {
  2370  	return js.Func[func(arguments ...js.Any) js.Any]{}.FromRef(x.ref)
  2371  }
  2372  
  2373  type TimerHandler = OneOf_String_FuncFunction
  2374  
  2375  type VoidFunctionFunc func(this js.Ref) js.Ref
  2376  
  2377  func (fn VoidFunctionFunc) Register() js.Func[func()] {
  2378  	return js.RegisterCallback[func()](
  2379  		fn, abi.FuncPCABIInternal(fn),
  2380  	)
  2381  }
  2382  
  2383  func (fn VoidFunctionFunc) DispatchCallback(
  2384  	targetPC uintptr, ctx *js.CallbackContext,
  2385  ) {
  2386  	args := ctx.Args()
  2387  	if len(args) != 0+1 /* js this */ ||
  2388  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  2389  		js.ThrowInvalidCallbackInvocation()
  2390  	}
  2391  
  2392  	if ctx.Return(fn(
  2393  		args[0],
  2394  	)) {
  2395  		return
  2396  	}
  2397  
  2398  	js.ThrowCallbackValueNotReturned()
  2399  }
  2400  
  2401  type VoidFunction[T any] struct {
  2402  	Fn  func(arg T, this js.Ref) js.Ref
  2403  	Arg T
  2404  }
  2405  
  2406  func (cb *VoidFunction[T]) Register() js.Func[func()] {
  2407  	return js.RegisterCallback[func()](
  2408  		cb, abi.FuncPCABIInternal(cb.Fn),
  2409  	)
  2410  }
  2411  
  2412  func (cb *VoidFunction[T]) DispatchCallback(
  2413  	targetPC uintptr, ctx *js.CallbackContext,
  2414  ) {
  2415  	args := ctx.Args()
  2416  	if len(args) != 0+1 /* js this */ ||
  2417  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  2418  		js.ThrowInvalidCallbackInvocation()
  2419  	}
  2420  
  2421  	if ctx.Return(cb.Fn(
  2422  		cb.Arg,
  2423  		args[0],
  2424  	)) {
  2425  		return
  2426  	}
  2427  
  2428  	js.ThrowCallbackValueNotReturned()
  2429  }
  2430  
  2431  type ImageOrientation uint32
  2432  
  2433  const (
  2434  	_ ImageOrientation = iota
  2435  
  2436  	ImageOrientation_FROM_IMAGE
  2437  	ImageOrientation_FLIP_Y
  2438  )
  2439  
  2440  func (ImageOrientation) FromRef(str js.Ref) ImageOrientation {
  2441  	return ImageOrientation(bindings.ConstOfImageOrientation(str))
  2442  }
  2443  
  2444  func (x ImageOrientation) String() (string, bool) {
  2445  	switch x {
  2446  	case ImageOrientation_FROM_IMAGE:
  2447  		return "from-image", true
  2448  	case ImageOrientation_FLIP_Y:
  2449  		return "flipY", true
  2450  	default:
  2451  		return "", false
  2452  	}
  2453  }
  2454  
  2455  type PremultiplyAlpha uint32
  2456  
  2457  const (
  2458  	_ PremultiplyAlpha = iota
  2459  
  2460  	PremultiplyAlpha_NONE
  2461  	PremultiplyAlpha_PREMULTIPLY
  2462  	PremultiplyAlpha_DEFAULT
  2463  )
  2464  
  2465  func (PremultiplyAlpha) FromRef(str js.Ref) PremultiplyAlpha {
  2466  	return PremultiplyAlpha(bindings.ConstOfPremultiplyAlpha(str))
  2467  }
  2468  
  2469  func (x PremultiplyAlpha) String() (string, bool) {
  2470  	switch x {
  2471  	case PremultiplyAlpha_NONE:
  2472  		return "none", true
  2473  	case PremultiplyAlpha_PREMULTIPLY:
  2474  		return "premultiply", true
  2475  	case PremultiplyAlpha_DEFAULT:
  2476  		return "default", true
  2477  	default:
  2478  		return "", false
  2479  	}
  2480  }
  2481  
  2482  type ResizeQuality uint32
  2483  
  2484  const (
  2485  	_ ResizeQuality = iota
  2486  
  2487  	ResizeQuality_PIXELATED
  2488  	ResizeQuality_LOW
  2489  	ResizeQuality_MEDIUM
  2490  	ResizeQuality_HIGH
  2491  )
  2492  
  2493  func (ResizeQuality) FromRef(str js.Ref) ResizeQuality {
  2494  	return ResizeQuality(bindings.ConstOfResizeQuality(str))
  2495  }
  2496  
  2497  func (x ResizeQuality) String() (string, bool) {
  2498  	switch x {
  2499  	case ResizeQuality_PIXELATED:
  2500  		return "pixelated", true
  2501  	case ResizeQuality_LOW:
  2502  		return "low", true
  2503  	case ResizeQuality_MEDIUM:
  2504  		return "medium", true
  2505  	case ResizeQuality_HIGH:
  2506  		return "high", true
  2507  	default:
  2508  		return "", false
  2509  	}
  2510  }
  2511  
  2512  type ImageBitmapOptions struct {
  2513  	// ImageOrientation is "ImageBitmapOptions.imageOrientation"
  2514  	//
  2515  	// Optional, defaults to "from-image".
  2516  	ImageOrientation ImageOrientation
  2517  	// PremultiplyAlpha is "ImageBitmapOptions.premultiplyAlpha"
  2518  	//
  2519  	// Optional, defaults to "default".
  2520  	PremultiplyAlpha PremultiplyAlpha
  2521  	// ColorSpaceConversion is "ImageBitmapOptions.colorSpaceConversion"
  2522  	//
  2523  	// Optional, defaults to "default".
  2524  	ColorSpaceConversion ColorSpaceConversion
  2525  	// ResizeWidth is "ImageBitmapOptions.resizeWidth"
  2526  	//
  2527  	// Optional
  2528  	//
  2529  	// NOTE: FFI_USE_ResizeWidth MUST be set to true to make this field effective.
  2530  	ResizeWidth uint32
  2531  	// ResizeHeight is "ImageBitmapOptions.resizeHeight"
  2532  	//
  2533  	// Optional
  2534  	//
  2535  	// NOTE: FFI_USE_ResizeHeight MUST be set to true to make this field effective.
  2536  	ResizeHeight uint32
  2537  	// ResizeQuality is "ImageBitmapOptions.resizeQuality"
  2538  	//
  2539  	// Optional, defaults to "low".
  2540  	ResizeQuality ResizeQuality
  2541  
  2542  	FFI_USE_ResizeWidth  bool // for ResizeWidth.
  2543  	FFI_USE_ResizeHeight bool // for ResizeHeight.
  2544  
  2545  	FFI_USE bool
  2546  }
  2547  
  2548  // FromRef calls UpdateFrom and returns a ImageBitmapOptions with all fields set.
  2549  func (p ImageBitmapOptions) FromRef(ref js.Ref) ImageBitmapOptions {
  2550  	p.UpdateFrom(ref)
  2551  	return p
  2552  }
  2553  
  2554  // New creates a new ImageBitmapOptions in the application heap.
  2555  func (p ImageBitmapOptions) New() js.Ref {
  2556  	return bindings.ImageBitmapOptionsJSLoad(
  2557  		js.Pointer(&p), js.True, 0,
  2558  	)
  2559  }
  2560  
  2561  // UpdateFrom copies value of all fields of the heap object to p.
  2562  func (p *ImageBitmapOptions) UpdateFrom(ref js.Ref) {
  2563  	bindings.ImageBitmapOptionsJSStore(
  2564  		js.Pointer(p), ref,
  2565  	)
  2566  }
  2567  
  2568  // Update writes all fields of the p to the heap object referenced by ref.
  2569  func (p *ImageBitmapOptions) Update(ref js.Ref) {
  2570  	bindings.ImageBitmapOptionsJSLoad(
  2571  		js.Pointer(p), js.False, ref,
  2572  	)
  2573  }
  2574  
  2575  // FreeMembers frees fields with heap reference, if recursive is true
  2576  // free all heap references reachable from p.
  2577  func (p *ImageBitmapOptions) FreeMembers(recursive bool) {
  2578  }
  2579  
  2580  type FrameRequestCallbackFunc func(this js.Ref, time DOMHighResTimeStamp) js.Ref
  2581  
  2582  func (fn FrameRequestCallbackFunc) Register() js.Func[func(time DOMHighResTimeStamp)] {
  2583  	return js.RegisterCallback[func(time DOMHighResTimeStamp)](
  2584  		fn, abi.FuncPCABIInternal(fn),
  2585  	)
  2586  }
  2587  
  2588  func (fn FrameRequestCallbackFunc) DispatchCallback(
  2589  	targetPC uintptr, ctx *js.CallbackContext,
  2590  ) {
  2591  	args := ctx.Args()
  2592  	if len(args) != 1+1 /* js this */ ||
  2593  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  2594  		js.ThrowInvalidCallbackInvocation()
  2595  	}
  2596  
  2597  	if ctx.Return(fn(
  2598  		args[0],
  2599  
  2600  		js.Number[DOMHighResTimeStamp]{}.FromRef(args[0+1]).Get(),
  2601  	)) {
  2602  		return
  2603  	}
  2604  
  2605  	js.ThrowCallbackValueNotReturned()
  2606  }
  2607  
  2608  type FrameRequestCallback[T any] struct {
  2609  	Fn  func(arg T, this js.Ref, time DOMHighResTimeStamp) js.Ref
  2610  	Arg T
  2611  }
  2612  
  2613  func (cb *FrameRequestCallback[T]) Register() js.Func[func(time DOMHighResTimeStamp)] {
  2614  	return js.RegisterCallback[func(time DOMHighResTimeStamp)](
  2615  		cb, abi.FuncPCABIInternal(cb.Fn),
  2616  	)
  2617  }
  2618  
  2619  func (cb *FrameRequestCallback[T]) DispatchCallback(
  2620  	targetPC uintptr, ctx *js.CallbackContext,
  2621  ) {
  2622  	args := ctx.Args()
  2623  	if len(args) != 1+1 /* js this */ ||
  2624  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  2625  		js.ThrowInvalidCallbackInvocation()
  2626  	}
  2627  
  2628  	if ctx.Return(cb.Fn(
  2629  		cb.Arg,
  2630  		args[0],
  2631  
  2632  		js.Number[DOMHighResTimeStamp]{}.FromRef(args[0+1]).Get(),
  2633  	)) {
  2634  		return
  2635  	}
  2636  
  2637  	js.ThrowCallbackValueNotReturned()
  2638  }
  2639  
  2640  type ScrollRestoration uint32
  2641  
  2642  const (
  2643  	_ ScrollRestoration = iota
  2644  
  2645  	ScrollRestoration_AUTO
  2646  	ScrollRestoration_MANUAL
  2647  )
  2648  
  2649  func (ScrollRestoration) FromRef(str js.Ref) ScrollRestoration {
  2650  	return ScrollRestoration(bindings.ConstOfScrollRestoration(str))
  2651  }
  2652  
  2653  func (x ScrollRestoration) String() (string, bool) {
  2654  	switch x {
  2655  	case ScrollRestoration_AUTO:
  2656  		return "auto", true
  2657  	case ScrollRestoration_MANUAL:
  2658  		return "manual", true
  2659  	default:
  2660  		return "", false
  2661  	}
  2662  }
  2663  
  2664  type History struct {
  2665  	ref js.Ref
  2666  }
  2667  
  2668  func (this History) Once() History {
  2669  	this.ref.Once()
  2670  	return this
  2671  }
  2672  
  2673  func (this History) Ref() js.Ref {
  2674  	return this.ref
  2675  }
  2676  
  2677  func (this History) FromRef(ref js.Ref) History {
  2678  	this.ref = ref
  2679  	return this
  2680  }
  2681  
  2682  func (this History) Free() {
  2683  	this.ref.Free()
  2684  }
  2685  
  2686  // Length returns the value of property "History.length".
  2687  //
  2688  // It returns ok=false if there is no such property.
  2689  func (this History) Length() (ret uint32, ok bool) {
  2690  	ok = js.True == bindings.GetHistoryLength(
  2691  		this.ref, js.Pointer(&ret),
  2692  	)
  2693  	return
  2694  }
  2695  
  2696  // ScrollRestoration returns the value of property "History.scrollRestoration".
  2697  //
  2698  // It returns ok=false if there is no such property.
  2699  func (this History) ScrollRestoration() (ret ScrollRestoration, ok bool) {
  2700  	ok = js.True == bindings.GetHistoryScrollRestoration(
  2701  		this.ref, js.Pointer(&ret),
  2702  	)
  2703  	return
  2704  }
  2705  
  2706  // SetScrollRestoration sets the value of property "History.scrollRestoration" to val.
  2707  //
  2708  // It returns false if the property cannot be set.
  2709  func (this History) SetScrollRestoration(val ScrollRestoration) bool {
  2710  	return js.True == bindings.SetHistoryScrollRestoration(
  2711  		this.ref,
  2712  		uint32(val),
  2713  	)
  2714  }
  2715  
  2716  // State returns the value of property "History.state".
  2717  //
  2718  // It returns ok=false if there is no such property.
  2719  func (this History) State() (ret js.Any, ok bool) {
  2720  	ok = js.True == bindings.GetHistoryState(
  2721  		this.ref, js.Pointer(&ret),
  2722  	)
  2723  	return
  2724  }
  2725  
  2726  // HasFuncGo returns true if the method "History.go" exists.
  2727  func (this History) HasFuncGo() bool {
  2728  	return js.True == bindings.HasFuncHistoryGo(
  2729  		this.ref,
  2730  	)
  2731  }
  2732  
  2733  // FuncGo returns the method "History.go".
  2734  func (this History) FuncGo() (fn js.Func[func(delta int32)]) {
  2735  	bindings.FuncHistoryGo(
  2736  		this.ref, js.Pointer(&fn),
  2737  	)
  2738  	return
  2739  }
  2740  
  2741  // Go calls the method "History.go".
  2742  func (this History) Go(delta int32) (ret js.Void) {
  2743  	bindings.CallHistoryGo(
  2744  		this.ref, js.Pointer(&ret),
  2745  		int32(delta),
  2746  	)
  2747  
  2748  	return
  2749  }
  2750  
  2751  // TryGo calls the method "History.go"
  2752  // in a try/catch block and returns (_, err, ok = false) when it went through
  2753  // the catch clause.
  2754  func (this History) TryGo(delta int32) (ret js.Void, exception js.Any, ok bool) {
  2755  	ok = js.True == bindings.TryHistoryGo(
  2756  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2757  		int32(delta),
  2758  	)
  2759  
  2760  	return
  2761  }
  2762  
  2763  // HasFuncGo1 returns true if the method "History.go" exists.
  2764  func (this History) HasFuncGo1() bool {
  2765  	return js.True == bindings.HasFuncHistoryGo1(
  2766  		this.ref,
  2767  	)
  2768  }
  2769  
  2770  // FuncGo1 returns the method "History.go".
  2771  func (this History) FuncGo1() (fn js.Func[func()]) {
  2772  	bindings.FuncHistoryGo1(
  2773  		this.ref, js.Pointer(&fn),
  2774  	)
  2775  	return
  2776  }
  2777  
  2778  // Go1 calls the method "History.go".
  2779  func (this History) Go1() (ret js.Void) {
  2780  	bindings.CallHistoryGo1(
  2781  		this.ref, js.Pointer(&ret),
  2782  	)
  2783  
  2784  	return
  2785  }
  2786  
  2787  // TryGo1 calls the method "History.go"
  2788  // in a try/catch block and returns (_, err, ok = false) when it went through
  2789  // the catch clause.
  2790  func (this History) TryGo1() (ret js.Void, exception js.Any, ok bool) {
  2791  	ok = js.True == bindings.TryHistoryGo1(
  2792  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2793  	)
  2794  
  2795  	return
  2796  }
  2797  
  2798  // HasFuncBack returns true if the method "History.back" exists.
  2799  func (this History) HasFuncBack() bool {
  2800  	return js.True == bindings.HasFuncHistoryBack(
  2801  		this.ref,
  2802  	)
  2803  }
  2804  
  2805  // FuncBack returns the method "History.back".
  2806  func (this History) FuncBack() (fn js.Func[func()]) {
  2807  	bindings.FuncHistoryBack(
  2808  		this.ref, js.Pointer(&fn),
  2809  	)
  2810  	return
  2811  }
  2812  
  2813  // Back calls the method "History.back".
  2814  func (this History) Back() (ret js.Void) {
  2815  	bindings.CallHistoryBack(
  2816  		this.ref, js.Pointer(&ret),
  2817  	)
  2818  
  2819  	return
  2820  }
  2821  
  2822  // TryBack calls the method "History.back"
  2823  // in a try/catch block and returns (_, err, ok = false) when it went through
  2824  // the catch clause.
  2825  func (this History) TryBack() (ret js.Void, exception js.Any, ok bool) {
  2826  	ok = js.True == bindings.TryHistoryBack(
  2827  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2828  	)
  2829  
  2830  	return
  2831  }
  2832  
  2833  // HasFuncForward returns true if the method "History.forward" exists.
  2834  func (this History) HasFuncForward() bool {
  2835  	return js.True == bindings.HasFuncHistoryForward(
  2836  		this.ref,
  2837  	)
  2838  }
  2839  
  2840  // FuncForward returns the method "History.forward".
  2841  func (this History) FuncForward() (fn js.Func[func()]) {
  2842  	bindings.FuncHistoryForward(
  2843  		this.ref, js.Pointer(&fn),
  2844  	)
  2845  	return
  2846  }
  2847  
  2848  // Forward calls the method "History.forward".
  2849  func (this History) Forward() (ret js.Void) {
  2850  	bindings.CallHistoryForward(
  2851  		this.ref, js.Pointer(&ret),
  2852  	)
  2853  
  2854  	return
  2855  }
  2856  
  2857  // TryForward calls the method "History.forward"
  2858  // in a try/catch block and returns (_, err, ok = false) when it went through
  2859  // the catch clause.
  2860  func (this History) TryForward() (ret js.Void, exception js.Any, ok bool) {
  2861  	ok = js.True == bindings.TryHistoryForward(
  2862  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2863  	)
  2864  
  2865  	return
  2866  }
  2867  
  2868  // HasFuncPushState returns true if the method "History.pushState" exists.
  2869  func (this History) HasFuncPushState() bool {
  2870  	return js.True == bindings.HasFuncHistoryPushState(
  2871  		this.ref,
  2872  	)
  2873  }
  2874  
  2875  // FuncPushState returns the method "History.pushState".
  2876  func (this History) FuncPushState() (fn js.Func[func(data js.Any, unused js.String, url js.String)]) {
  2877  	bindings.FuncHistoryPushState(
  2878  		this.ref, js.Pointer(&fn),
  2879  	)
  2880  	return
  2881  }
  2882  
  2883  // PushState calls the method "History.pushState".
  2884  func (this History) PushState(data js.Any, unused js.String, url js.String) (ret js.Void) {
  2885  	bindings.CallHistoryPushState(
  2886  		this.ref, js.Pointer(&ret),
  2887  		data.Ref(),
  2888  		unused.Ref(),
  2889  		url.Ref(),
  2890  	)
  2891  
  2892  	return
  2893  }
  2894  
  2895  // TryPushState calls the method "History.pushState"
  2896  // in a try/catch block and returns (_, err, ok = false) when it went through
  2897  // the catch clause.
  2898  func (this History) TryPushState(data js.Any, unused js.String, url js.String) (ret js.Void, exception js.Any, ok bool) {
  2899  	ok = js.True == bindings.TryHistoryPushState(
  2900  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2901  		data.Ref(),
  2902  		unused.Ref(),
  2903  		url.Ref(),
  2904  	)
  2905  
  2906  	return
  2907  }
  2908  
  2909  // HasFuncPushState1 returns true if the method "History.pushState" exists.
  2910  func (this History) HasFuncPushState1() bool {
  2911  	return js.True == bindings.HasFuncHistoryPushState1(
  2912  		this.ref,
  2913  	)
  2914  }
  2915  
  2916  // FuncPushState1 returns the method "History.pushState".
  2917  func (this History) FuncPushState1() (fn js.Func[func(data js.Any, unused js.String)]) {
  2918  	bindings.FuncHistoryPushState1(
  2919  		this.ref, js.Pointer(&fn),
  2920  	)
  2921  	return
  2922  }
  2923  
  2924  // PushState1 calls the method "History.pushState".
  2925  func (this History) PushState1(data js.Any, unused js.String) (ret js.Void) {
  2926  	bindings.CallHistoryPushState1(
  2927  		this.ref, js.Pointer(&ret),
  2928  		data.Ref(),
  2929  		unused.Ref(),
  2930  	)
  2931  
  2932  	return
  2933  }
  2934  
  2935  // TryPushState1 calls the method "History.pushState"
  2936  // in a try/catch block and returns (_, err, ok = false) when it went through
  2937  // the catch clause.
  2938  func (this History) TryPushState1(data js.Any, unused js.String) (ret js.Void, exception js.Any, ok bool) {
  2939  	ok = js.True == bindings.TryHistoryPushState1(
  2940  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2941  		data.Ref(),
  2942  		unused.Ref(),
  2943  	)
  2944  
  2945  	return
  2946  }
  2947  
  2948  // HasFuncReplaceState returns true if the method "History.replaceState" exists.
  2949  func (this History) HasFuncReplaceState() bool {
  2950  	return js.True == bindings.HasFuncHistoryReplaceState(
  2951  		this.ref,
  2952  	)
  2953  }
  2954  
  2955  // FuncReplaceState returns the method "History.replaceState".
  2956  func (this History) FuncReplaceState() (fn js.Func[func(data js.Any, unused js.String, url js.String)]) {
  2957  	bindings.FuncHistoryReplaceState(
  2958  		this.ref, js.Pointer(&fn),
  2959  	)
  2960  	return
  2961  }
  2962  
  2963  // ReplaceState calls the method "History.replaceState".
  2964  func (this History) ReplaceState(data js.Any, unused js.String, url js.String) (ret js.Void) {
  2965  	bindings.CallHistoryReplaceState(
  2966  		this.ref, js.Pointer(&ret),
  2967  		data.Ref(),
  2968  		unused.Ref(),
  2969  		url.Ref(),
  2970  	)
  2971  
  2972  	return
  2973  }
  2974  
  2975  // TryReplaceState calls the method "History.replaceState"
  2976  // in a try/catch block and returns (_, err, ok = false) when it went through
  2977  // the catch clause.
  2978  func (this History) TryReplaceState(data js.Any, unused js.String, url js.String) (ret js.Void, exception js.Any, ok bool) {
  2979  	ok = js.True == bindings.TryHistoryReplaceState(
  2980  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  2981  		data.Ref(),
  2982  		unused.Ref(),
  2983  		url.Ref(),
  2984  	)
  2985  
  2986  	return
  2987  }
  2988  
  2989  // HasFuncReplaceState1 returns true if the method "History.replaceState" exists.
  2990  func (this History) HasFuncReplaceState1() bool {
  2991  	return js.True == bindings.HasFuncHistoryReplaceState1(
  2992  		this.ref,
  2993  	)
  2994  }
  2995  
  2996  // FuncReplaceState1 returns the method "History.replaceState".
  2997  func (this History) FuncReplaceState1() (fn js.Func[func(data js.Any, unused js.String)]) {
  2998  	bindings.FuncHistoryReplaceState1(
  2999  		this.ref, js.Pointer(&fn),
  3000  	)
  3001  	return
  3002  }
  3003  
  3004  // ReplaceState1 calls the method "History.replaceState".
  3005  func (this History) ReplaceState1(data js.Any, unused js.String) (ret js.Void) {
  3006  	bindings.CallHistoryReplaceState1(
  3007  		this.ref, js.Pointer(&ret),
  3008  		data.Ref(),
  3009  		unused.Ref(),
  3010  	)
  3011  
  3012  	return
  3013  }
  3014  
  3015  // TryReplaceState1 calls the method "History.replaceState"
  3016  // in a try/catch block and returns (_, err, ok = false) when it went through
  3017  // the catch clause.
  3018  func (this History) TryReplaceState1(data js.Any, unused js.String) (ret js.Void, exception js.Any, ok bool) {
  3019  	ok = js.True == bindings.TryHistoryReplaceState1(
  3020  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3021  		data.Ref(),
  3022  		unused.Ref(),
  3023  	)
  3024  
  3025  	return
  3026  }
  3027  
  3028  type NavigationHistoryEntry struct {
  3029  	EventTarget
  3030  }
  3031  
  3032  func (this NavigationHistoryEntry) Once() NavigationHistoryEntry {
  3033  	this.ref.Once()
  3034  	return this
  3035  }
  3036  
  3037  func (this NavigationHistoryEntry) Ref() js.Ref {
  3038  	return this.EventTarget.Ref()
  3039  }
  3040  
  3041  func (this NavigationHistoryEntry) FromRef(ref js.Ref) NavigationHistoryEntry {
  3042  	this.EventTarget = this.EventTarget.FromRef(ref)
  3043  	return this
  3044  }
  3045  
  3046  func (this NavigationHistoryEntry) Free() {
  3047  	this.ref.Free()
  3048  }
  3049  
  3050  // Url returns the value of property "NavigationHistoryEntry.url".
  3051  //
  3052  // It returns ok=false if there is no such property.
  3053  func (this NavigationHistoryEntry) Url() (ret js.String, ok bool) {
  3054  	ok = js.True == bindings.GetNavigationHistoryEntryUrl(
  3055  		this.ref, js.Pointer(&ret),
  3056  	)
  3057  	return
  3058  }
  3059  
  3060  // Key returns the value of property "NavigationHistoryEntry.key".
  3061  //
  3062  // It returns ok=false if there is no such property.
  3063  func (this NavigationHistoryEntry) Key() (ret js.String, ok bool) {
  3064  	ok = js.True == bindings.GetNavigationHistoryEntryKey(
  3065  		this.ref, js.Pointer(&ret),
  3066  	)
  3067  	return
  3068  }
  3069  
  3070  // Id returns the value of property "NavigationHistoryEntry.id".
  3071  //
  3072  // It returns ok=false if there is no such property.
  3073  func (this NavigationHistoryEntry) Id() (ret js.String, ok bool) {
  3074  	ok = js.True == bindings.GetNavigationHistoryEntryId(
  3075  		this.ref, js.Pointer(&ret),
  3076  	)
  3077  	return
  3078  }
  3079  
  3080  // Index returns the value of property "NavigationHistoryEntry.index".
  3081  //
  3082  // It returns ok=false if there is no such property.
  3083  func (this NavigationHistoryEntry) Index() (ret int64, ok bool) {
  3084  	ok = js.True == bindings.GetNavigationHistoryEntryIndex(
  3085  		this.ref, js.Pointer(&ret),
  3086  	)
  3087  	return
  3088  }
  3089  
  3090  // SameDocument returns the value of property "NavigationHistoryEntry.sameDocument".
  3091  //
  3092  // It returns ok=false if there is no such property.
  3093  func (this NavigationHistoryEntry) SameDocument() (ret bool, ok bool) {
  3094  	ok = js.True == bindings.GetNavigationHistoryEntrySameDocument(
  3095  		this.ref, js.Pointer(&ret),
  3096  	)
  3097  	return
  3098  }
  3099  
  3100  // HasFuncGetState returns true if the method "NavigationHistoryEntry.getState" exists.
  3101  func (this NavigationHistoryEntry) HasFuncGetState() bool {
  3102  	return js.True == bindings.HasFuncNavigationHistoryEntryGetState(
  3103  		this.ref,
  3104  	)
  3105  }
  3106  
  3107  // FuncGetState returns the method "NavigationHistoryEntry.getState".
  3108  func (this NavigationHistoryEntry) FuncGetState() (fn js.Func[func() js.Any]) {
  3109  	bindings.FuncNavigationHistoryEntryGetState(
  3110  		this.ref, js.Pointer(&fn),
  3111  	)
  3112  	return
  3113  }
  3114  
  3115  // GetState calls the method "NavigationHistoryEntry.getState".
  3116  func (this NavigationHistoryEntry) GetState() (ret js.Any) {
  3117  	bindings.CallNavigationHistoryEntryGetState(
  3118  		this.ref, js.Pointer(&ret),
  3119  	)
  3120  
  3121  	return
  3122  }
  3123  
  3124  // TryGetState calls the method "NavigationHistoryEntry.getState"
  3125  // in a try/catch block and returns (_, err, ok = false) when it went through
  3126  // the catch clause.
  3127  func (this NavigationHistoryEntry) TryGetState() (ret js.Any, exception js.Any, ok bool) {
  3128  	ok = js.True == bindings.TryNavigationHistoryEntryGetState(
  3129  		this.ref, js.Pointer(&ret), js.Pointer(&exception),
  3130  	)
  3131  
  3132  	return
  3133  }
  3134  
  3135  type NavigationUpdateCurrentEntryOptions struct {
  3136  	// State is "NavigationUpdateCurrentEntryOptions.state"
  3137  	//
  3138  	// Required
  3139  	State js.Any
  3140  
  3141  	FFI_USE bool
  3142  }
  3143  
  3144  // FromRef calls UpdateFrom and returns a NavigationUpdateCurrentEntryOptions with all fields set.
  3145  func (p NavigationUpdateCurrentEntryOptions) FromRef(ref js.Ref) NavigationUpdateCurrentEntryOptions {
  3146  	p.UpdateFrom(ref)
  3147  	return p
  3148  }
  3149  
  3150  // New creates a new NavigationUpdateCurrentEntryOptions in the application heap.
  3151  func (p NavigationUpdateCurrentEntryOptions) New() js.Ref {
  3152  	return bindings.NavigationUpdateCurrentEntryOptionsJSLoad(
  3153  		js.Pointer(&p), js.True, 0,
  3154  	)
  3155  }
  3156  
  3157  // UpdateFrom copies value of all fields of the heap object to p.
  3158  func (p *NavigationUpdateCurrentEntryOptions) UpdateFrom(ref js.Ref) {
  3159  	bindings.NavigationUpdateCurrentEntryOptionsJSStore(
  3160  		js.Pointer(p), ref,
  3161  	)
  3162  }
  3163  
  3164  // Update writes all fields of the p to the heap object referenced by ref.
  3165  func (p *NavigationUpdateCurrentEntryOptions) Update(ref js.Ref) {
  3166  	bindings.NavigationUpdateCurrentEntryOptionsJSLoad(
  3167  		js.Pointer(p), js.False, ref,
  3168  	)
  3169  }
  3170  
  3171  // FreeMembers frees fields with heap reference, if recursive is true
  3172  // free all heap references reachable from p.
  3173  func (p *NavigationUpdateCurrentEntryOptions) FreeMembers(recursive bool) {
  3174  	js.Free(
  3175  		p.State.Ref(),
  3176  	)
  3177  	p.State = p.State.FromRef(js.Undefined)
  3178  }
  3179  
  3180  type NavigationResult struct {
  3181  	// Committed is "NavigationResult.committed"
  3182  	//
  3183  	// Optional
  3184  	Committed js.Promise[NavigationHistoryEntry]
  3185  	// Finished is "NavigationResult.finished"
  3186  	//
  3187  	// Optional
  3188  	Finished js.Promise[NavigationHistoryEntry]
  3189  
  3190  	FFI_USE bool
  3191  }
  3192  
  3193  // FromRef calls UpdateFrom and returns a NavigationResult with all fields set.
  3194  func (p NavigationResult) FromRef(ref js.Ref) NavigationResult {
  3195  	p.UpdateFrom(ref)
  3196  	return p
  3197  }
  3198  
  3199  // New creates a new NavigationResult in the application heap.
  3200  func (p NavigationResult) New() js.Ref {
  3201  	return bindings.NavigationResultJSLoad(
  3202  		js.Pointer(&p), js.True, 0,
  3203  	)
  3204  }
  3205  
  3206  // UpdateFrom copies value of all fields of the heap object to p.
  3207  func (p *NavigationResult) UpdateFrom(ref js.Ref) {
  3208  	bindings.NavigationResultJSStore(
  3209  		js.Pointer(p), ref,
  3210  	)
  3211  }
  3212  
  3213  // Update writes all fields of the p to the heap object referenced by ref.
  3214  func (p *NavigationResult) Update(ref js.Ref) {
  3215  	bindings.NavigationResultJSLoad(
  3216  		js.Pointer(p), js.False, ref,
  3217  	)
  3218  }
  3219  
  3220  // FreeMembers frees fields with heap reference, if recursive is true
  3221  // free all heap references reachable from p.
  3222  func (p *NavigationResult) FreeMembers(recursive bool) {
  3223  	js.Free(
  3224  		p.Committed.Ref(),
  3225  		p.Finished.Ref(),
  3226  	)
  3227  	p.Committed = p.Committed.FromRef(js.Undefined)
  3228  	p.Finished = p.Finished.FromRef(js.Undefined)
  3229  }