github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/chromeos/telemetry/apis_js_wasm.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package telemetry
     5  
     6  import (
     7  	"github.com/primecitizens/pcz/std/core/abi"
     8  	"github.com/primecitizens/pcz/std/core/mark"
     9  	"github.com/primecitizens/pcz/std/ffi/js"
    10  	"github.com/primecitizens/pcz/std/plat/js/webext/chromeos/telemetry/bindings"
    11  )
    12  
    13  type AudioOutputNodeInfo struct {
    14  	// Id is "AudioOutputNodeInfo.id"
    15  	//
    16  	// Optional
    17  	//
    18  	// NOTE: FFI_USE_Id MUST be set to true to make this field effective.
    19  	Id float64
    20  	// Name is "AudioOutputNodeInfo.name"
    21  	//
    22  	// Optional
    23  	Name js.String
    24  	// DeviceName is "AudioOutputNodeInfo.deviceName"
    25  	//
    26  	// Optional
    27  	DeviceName js.String
    28  	// Active is "AudioOutputNodeInfo.active"
    29  	//
    30  	// Optional
    31  	//
    32  	// NOTE: FFI_USE_Active MUST be set to true to make this field effective.
    33  	Active bool
    34  	// NodeVolume is "AudioOutputNodeInfo.nodeVolume"
    35  	//
    36  	// Optional
    37  	//
    38  	// NOTE: FFI_USE_NodeVolume MUST be set to true to make this field effective.
    39  	NodeVolume int32
    40  
    41  	FFI_USE_Id         bool // for Id.
    42  	FFI_USE_Active     bool // for Active.
    43  	FFI_USE_NodeVolume bool // for NodeVolume.
    44  
    45  	FFI_USE bool
    46  }
    47  
    48  // FromRef calls UpdateFrom and returns a AudioOutputNodeInfo with all fields set.
    49  func (p AudioOutputNodeInfo) FromRef(ref js.Ref) AudioOutputNodeInfo {
    50  	p.UpdateFrom(ref)
    51  	return p
    52  }
    53  
    54  // New creates a new AudioOutputNodeInfo in the application heap.
    55  func (p AudioOutputNodeInfo) New() js.Ref {
    56  	return bindings.AudioOutputNodeInfoJSLoad(
    57  		js.Pointer(&p), js.True, 0,
    58  	)
    59  }
    60  
    61  // UpdateFrom copies value of all fields of the heap object to p.
    62  func (p *AudioOutputNodeInfo) UpdateFrom(ref js.Ref) {
    63  	bindings.AudioOutputNodeInfoJSStore(
    64  		js.Pointer(p), ref,
    65  	)
    66  }
    67  
    68  // Update writes all fields of the p to the heap object referenced by ref.
    69  func (p *AudioOutputNodeInfo) Update(ref js.Ref) {
    70  	bindings.AudioOutputNodeInfoJSLoad(
    71  		js.Pointer(p), js.False, ref,
    72  	)
    73  }
    74  
    75  // FreeMembers frees fields with heap reference, if recursive is true
    76  // free all heap references reachable from p.
    77  func (p *AudioOutputNodeInfo) FreeMembers(recursive bool) {
    78  	js.Free(
    79  		p.Name.Ref(),
    80  		p.DeviceName.Ref(),
    81  	)
    82  	p.Name = p.Name.FromRef(js.Undefined)
    83  	p.DeviceName = p.DeviceName.FromRef(js.Undefined)
    84  }
    85  
    86  type AudioInputNodeInfo struct {
    87  	// Id is "AudioInputNodeInfo.id"
    88  	//
    89  	// Optional
    90  	//
    91  	// NOTE: FFI_USE_Id MUST be set to true to make this field effective.
    92  	Id float64
    93  	// Name is "AudioInputNodeInfo.name"
    94  	//
    95  	// Optional
    96  	Name js.String
    97  	// DeviceName is "AudioInputNodeInfo.deviceName"
    98  	//
    99  	// Optional
   100  	DeviceName js.String
   101  	// Active is "AudioInputNodeInfo.active"
   102  	//
   103  	// Optional
   104  	//
   105  	// NOTE: FFI_USE_Active MUST be set to true to make this field effective.
   106  	Active bool
   107  	// NodeGain is "AudioInputNodeInfo.nodeGain"
   108  	//
   109  	// Optional
   110  	//
   111  	// NOTE: FFI_USE_NodeGain MUST be set to true to make this field effective.
   112  	NodeGain int32
   113  
   114  	FFI_USE_Id       bool // for Id.
   115  	FFI_USE_Active   bool // for Active.
   116  	FFI_USE_NodeGain bool // for NodeGain.
   117  
   118  	FFI_USE bool
   119  }
   120  
   121  // FromRef calls UpdateFrom and returns a AudioInputNodeInfo with all fields set.
   122  func (p AudioInputNodeInfo) FromRef(ref js.Ref) AudioInputNodeInfo {
   123  	p.UpdateFrom(ref)
   124  	return p
   125  }
   126  
   127  // New creates a new AudioInputNodeInfo in the application heap.
   128  func (p AudioInputNodeInfo) New() js.Ref {
   129  	return bindings.AudioInputNodeInfoJSLoad(
   130  		js.Pointer(&p), js.True, 0,
   131  	)
   132  }
   133  
   134  // UpdateFrom copies value of all fields of the heap object to p.
   135  func (p *AudioInputNodeInfo) UpdateFrom(ref js.Ref) {
   136  	bindings.AudioInputNodeInfoJSStore(
   137  		js.Pointer(p), ref,
   138  	)
   139  }
   140  
   141  // Update writes all fields of the p to the heap object referenced by ref.
   142  func (p *AudioInputNodeInfo) Update(ref js.Ref) {
   143  	bindings.AudioInputNodeInfoJSLoad(
   144  		js.Pointer(p), js.False, ref,
   145  	)
   146  }
   147  
   148  // FreeMembers frees fields with heap reference, if recursive is true
   149  // free all heap references reachable from p.
   150  func (p *AudioInputNodeInfo) FreeMembers(recursive bool) {
   151  	js.Free(
   152  		p.Name.Ref(),
   153  		p.DeviceName.Ref(),
   154  	)
   155  	p.Name = p.Name.FromRef(js.Undefined)
   156  	p.DeviceName = p.DeviceName.FromRef(js.Undefined)
   157  }
   158  
   159  type AudioInfo struct {
   160  	// OutputMute is "AudioInfo.outputMute"
   161  	//
   162  	// Optional
   163  	//
   164  	// NOTE: FFI_USE_OutputMute MUST be set to true to make this field effective.
   165  	OutputMute bool
   166  	// InputMute is "AudioInfo.inputMute"
   167  	//
   168  	// Optional
   169  	//
   170  	// NOTE: FFI_USE_InputMute MUST be set to true to make this field effective.
   171  	InputMute bool
   172  	// Underruns is "AudioInfo.underruns"
   173  	//
   174  	// Optional
   175  	//
   176  	// NOTE: FFI_USE_Underruns MUST be set to true to make this field effective.
   177  	Underruns int32
   178  	// SevereUnderruns is "AudioInfo.severeUnderruns"
   179  	//
   180  	// Optional
   181  	//
   182  	// NOTE: FFI_USE_SevereUnderruns MUST be set to true to make this field effective.
   183  	SevereUnderruns int32
   184  	// OutputNodes is "AudioInfo.outputNodes"
   185  	//
   186  	// Optional
   187  	OutputNodes js.Array[AudioOutputNodeInfo]
   188  	// InputNodes is "AudioInfo.inputNodes"
   189  	//
   190  	// Optional
   191  	InputNodes js.Array[AudioInputNodeInfo]
   192  
   193  	FFI_USE_OutputMute      bool // for OutputMute.
   194  	FFI_USE_InputMute       bool // for InputMute.
   195  	FFI_USE_Underruns       bool // for Underruns.
   196  	FFI_USE_SevereUnderruns bool // for SevereUnderruns.
   197  
   198  	FFI_USE bool
   199  }
   200  
   201  // FromRef calls UpdateFrom and returns a AudioInfo with all fields set.
   202  func (p AudioInfo) FromRef(ref js.Ref) AudioInfo {
   203  	p.UpdateFrom(ref)
   204  	return p
   205  }
   206  
   207  // New creates a new AudioInfo in the application heap.
   208  func (p AudioInfo) New() js.Ref {
   209  	return bindings.AudioInfoJSLoad(
   210  		js.Pointer(&p), js.True, 0,
   211  	)
   212  }
   213  
   214  // UpdateFrom copies value of all fields of the heap object to p.
   215  func (p *AudioInfo) UpdateFrom(ref js.Ref) {
   216  	bindings.AudioInfoJSStore(
   217  		js.Pointer(p), ref,
   218  	)
   219  }
   220  
   221  // Update writes all fields of the p to the heap object referenced by ref.
   222  func (p *AudioInfo) Update(ref js.Ref) {
   223  	bindings.AudioInfoJSLoad(
   224  		js.Pointer(p), js.False, ref,
   225  	)
   226  }
   227  
   228  // FreeMembers frees fields with heap reference, if recursive is true
   229  // free all heap references reachable from p.
   230  func (p *AudioInfo) FreeMembers(recursive bool) {
   231  	js.Free(
   232  		p.OutputNodes.Ref(),
   233  		p.InputNodes.Ref(),
   234  	)
   235  	p.OutputNodes = p.OutputNodes.FromRef(js.Undefined)
   236  	p.InputNodes = p.InputNodes.FromRef(js.Undefined)
   237  }
   238  
   239  type AudioInfoCallbackFunc func(this js.Ref, audioInfo *AudioInfo) js.Ref
   240  
   241  func (fn AudioInfoCallbackFunc) Register() js.Func[func(audioInfo *AudioInfo)] {
   242  	return js.RegisterCallback[func(audioInfo *AudioInfo)](
   243  		fn, abi.FuncPCABIInternal(fn),
   244  	)
   245  }
   246  
   247  func (fn AudioInfoCallbackFunc) DispatchCallback(
   248  	targetPC uintptr, ctx *js.CallbackContext,
   249  ) {
   250  	args := ctx.Args()
   251  	if len(args) != 1+1 /* js this */ ||
   252  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   253  		js.ThrowInvalidCallbackInvocation()
   254  	}
   255  	var arg0 AudioInfo
   256  	arg0.UpdateFrom(args[0+1])
   257  	defer arg0.FreeMembers(true)
   258  
   259  	if ctx.Return(fn(
   260  		args[0],
   261  
   262  		mark.NoEscape(&arg0),
   263  	)) {
   264  		return
   265  	}
   266  
   267  	js.ThrowCallbackValueNotReturned()
   268  }
   269  
   270  type AudioInfoCallback[T any] struct {
   271  	Fn  func(arg T, this js.Ref, audioInfo *AudioInfo) js.Ref
   272  	Arg T
   273  }
   274  
   275  func (cb *AudioInfoCallback[T]) Register() js.Func[func(audioInfo *AudioInfo)] {
   276  	return js.RegisterCallback[func(audioInfo *AudioInfo)](
   277  		cb, abi.FuncPCABIInternal(cb.Fn),
   278  	)
   279  }
   280  
   281  func (cb *AudioInfoCallback[T]) DispatchCallback(
   282  	targetPC uintptr, ctx *js.CallbackContext,
   283  ) {
   284  	args := ctx.Args()
   285  	if len(args) != 1+1 /* js this */ ||
   286  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   287  		js.ThrowInvalidCallbackInvocation()
   288  	}
   289  	var arg0 AudioInfo
   290  	arg0.UpdateFrom(args[0+1])
   291  	defer arg0.FreeMembers(true)
   292  
   293  	if ctx.Return(cb.Fn(
   294  		cb.Arg,
   295  		args[0],
   296  
   297  		mark.NoEscape(&arg0),
   298  	)) {
   299  		return
   300  	}
   301  
   302  	js.ThrowCallbackValueNotReturned()
   303  }
   304  
   305  type BatteryInfo struct {
   306  	// CycleCount is "BatteryInfo.cycleCount"
   307  	//
   308  	// Optional
   309  	//
   310  	// NOTE: FFI_USE_CycleCount MUST be set to true to make this field effective.
   311  	CycleCount float64
   312  	// VoltageNow is "BatteryInfo.voltageNow"
   313  	//
   314  	// Optional
   315  	//
   316  	// NOTE: FFI_USE_VoltageNow MUST be set to true to make this field effective.
   317  	VoltageNow float64
   318  	// Vendor is "BatteryInfo.vendor"
   319  	//
   320  	// Optional
   321  	Vendor js.String
   322  	// SerialNumber is "BatteryInfo.serialNumber"
   323  	//
   324  	// Optional
   325  	SerialNumber js.String
   326  	// ChargeFullDesign is "BatteryInfo.chargeFullDesign"
   327  	//
   328  	// Optional
   329  	//
   330  	// NOTE: FFI_USE_ChargeFullDesign MUST be set to true to make this field effective.
   331  	ChargeFullDesign float64
   332  	// ChargeFull is "BatteryInfo.chargeFull"
   333  	//
   334  	// Optional
   335  	//
   336  	// NOTE: FFI_USE_ChargeFull MUST be set to true to make this field effective.
   337  	ChargeFull float64
   338  	// VoltageMinDesign is "BatteryInfo.voltageMinDesign"
   339  	//
   340  	// Optional
   341  	//
   342  	// NOTE: FFI_USE_VoltageMinDesign MUST be set to true to make this field effective.
   343  	VoltageMinDesign float64
   344  	// ModelName is "BatteryInfo.modelName"
   345  	//
   346  	// Optional
   347  	ModelName js.String
   348  	// ChargeNow is "BatteryInfo.chargeNow"
   349  	//
   350  	// Optional
   351  	//
   352  	// NOTE: FFI_USE_ChargeNow MUST be set to true to make this field effective.
   353  	ChargeNow float64
   354  	// CurrentNow is "BatteryInfo.currentNow"
   355  	//
   356  	// Optional
   357  	//
   358  	// NOTE: FFI_USE_CurrentNow MUST be set to true to make this field effective.
   359  	CurrentNow float64
   360  	// Technology is "BatteryInfo.technology"
   361  	//
   362  	// Optional
   363  	Technology js.String
   364  	// Status is "BatteryInfo.status"
   365  	//
   366  	// Optional
   367  	Status js.String
   368  	// ManufactureDate is "BatteryInfo.manufactureDate"
   369  	//
   370  	// Optional
   371  	ManufactureDate js.String
   372  	// Temperature is "BatteryInfo.temperature"
   373  	//
   374  	// Optional
   375  	//
   376  	// NOTE: FFI_USE_Temperature MUST be set to true to make this field effective.
   377  	Temperature float64
   378  
   379  	FFI_USE_CycleCount       bool // for CycleCount.
   380  	FFI_USE_VoltageNow       bool // for VoltageNow.
   381  	FFI_USE_ChargeFullDesign bool // for ChargeFullDesign.
   382  	FFI_USE_ChargeFull       bool // for ChargeFull.
   383  	FFI_USE_VoltageMinDesign bool // for VoltageMinDesign.
   384  	FFI_USE_ChargeNow        bool // for ChargeNow.
   385  	FFI_USE_CurrentNow       bool // for CurrentNow.
   386  	FFI_USE_Temperature      bool // for Temperature.
   387  
   388  	FFI_USE bool
   389  }
   390  
   391  // FromRef calls UpdateFrom and returns a BatteryInfo with all fields set.
   392  func (p BatteryInfo) FromRef(ref js.Ref) BatteryInfo {
   393  	p.UpdateFrom(ref)
   394  	return p
   395  }
   396  
   397  // New creates a new BatteryInfo in the application heap.
   398  func (p BatteryInfo) New() js.Ref {
   399  	return bindings.BatteryInfoJSLoad(
   400  		js.Pointer(&p), js.True, 0,
   401  	)
   402  }
   403  
   404  // UpdateFrom copies value of all fields of the heap object to p.
   405  func (p *BatteryInfo) UpdateFrom(ref js.Ref) {
   406  	bindings.BatteryInfoJSStore(
   407  		js.Pointer(p), ref,
   408  	)
   409  }
   410  
   411  // Update writes all fields of the p to the heap object referenced by ref.
   412  func (p *BatteryInfo) Update(ref js.Ref) {
   413  	bindings.BatteryInfoJSLoad(
   414  		js.Pointer(p), js.False, ref,
   415  	)
   416  }
   417  
   418  // FreeMembers frees fields with heap reference, if recursive is true
   419  // free all heap references reachable from p.
   420  func (p *BatteryInfo) FreeMembers(recursive bool) {
   421  	js.Free(
   422  		p.Vendor.Ref(),
   423  		p.SerialNumber.Ref(),
   424  		p.ModelName.Ref(),
   425  		p.Technology.Ref(),
   426  		p.Status.Ref(),
   427  		p.ManufactureDate.Ref(),
   428  	)
   429  	p.Vendor = p.Vendor.FromRef(js.Undefined)
   430  	p.SerialNumber = p.SerialNumber.FromRef(js.Undefined)
   431  	p.ModelName = p.ModelName.FromRef(js.Undefined)
   432  	p.Technology = p.Technology.FromRef(js.Undefined)
   433  	p.Status = p.Status.FromRef(js.Undefined)
   434  	p.ManufactureDate = p.ManufactureDate.FromRef(js.Undefined)
   435  }
   436  
   437  type BatteryInfoCallbackFunc func(this js.Ref, batteryInfo *BatteryInfo) js.Ref
   438  
   439  func (fn BatteryInfoCallbackFunc) Register() js.Func[func(batteryInfo *BatteryInfo)] {
   440  	return js.RegisterCallback[func(batteryInfo *BatteryInfo)](
   441  		fn, abi.FuncPCABIInternal(fn),
   442  	)
   443  }
   444  
   445  func (fn BatteryInfoCallbackFunc) DispatchCallback(
   446  	targetPC uintptr, ctx *js.CallbackContext,
   447  ) {
   448  	args := ctx.Args()
   449  	if len(args) != 1+1 /* js this */ ||
   450  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   451  		js.ThrowInvalidCallbackInvocation()
   452  	}
   453  	var arg0 BatteryInfo
   454  	arg0.UpdateFrom(args[0+1])
   455  	defer arg0.FreeMembers(true)
   456  
   457  	if ctx.Return(fn(
   458  		args[0],
   459  
   460  		mark.NoEscape(&arg0),
   461  	)) {
   462  		return
   463  	}
   464  
   465  	js.ThrowCallbackValueNotReturned()
   466  }
   467  
   468  type BatteryInfoCallback[T any] struct {
   469  	Fn  func(arg T, this js.Ref, batteryInfo *BatteryInfo) js.Ref
   470  	Arg T
   471  }
   472  
   473  func (cb *BatteryInfoCallback[T]) Register() js.Func[func(batteryInfo *BatteryInfo)] {
   474  	return js.RegisterCallback[func(batteryInfo *BatteryInfo)](
   475  		cb, abi.FuncPCABIInternal(cb.Fn),
   476  	)
   477  }
   478  
   479  func (cb *BatteryInfoCallback[T]) DispatchCallback(
   480  	targetPC uintptr, ctx *js.CallbackContext,
   481  ) {
   482  	args := ctx.Args()
   483  	if len(args) != 1+1 /* js this */ ||
   484  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   485  		js.ThrowInvalidCallbackInvocation()
   486  	}
   487  	var arg0 BatteryInfo
   488  	arg0.UpdateFrom(args[0+1])
   489  	defer arg0.FreeMembers(true)
   490  
   491  	if ctx.Return(cb.Fn(
   492  		cb.Arg,
   493  		args[0],
   494  
   495  		mark.NoEscape(&arg0),
   496  	)) {
   497  		return
   498  	}
   499  
   500  	js.ThrowCallbackValueNotReturned()
   501  }
   502  
   503  type CpuArchitectureEnum uint32
   504  
   505  const (
   506  	_ CpuArchitectureEnum = iota
   507  
   508  	CpuArchitectureEnum_UNKNOWN
   509  	CpuArchitectureEnum_X86_64
   510  	CpuArchitectureEnum_AARCH64
   511  	CpuArchitectureEnum_ARMV_7L
   512  )
   513  
   514  func (CpuArchitectureEnum) FromRef(str js.Ref) CpuArchitectureEnum {
   515  	return CpuArchitectureEnum(bindings.ConstOfCpuArchitectureEnum(str))
   516  }
   517  
   518  func (x CpuArchitectureEnum) String() (string, bool) {
   519  	switch x {
   520  	case CpuArchitectureEnum_UNKNOWN:
   521  		return "unknown", true
   522  	case CpuArchitectureEnum_X86_64:
   523  		return "x86_64", true
   524  	case CpuArchitectureEnum_AARCH64:
   525  		return "aarch64", true
   526  	case CpuArchitectureEnum_ARMV_7L:
   527  		return "armv7l", true
   528  	default:
   529  		return "", false
   530  	}
   531  }
   532  
   533  type CpuCStateInfo struct {
   534  	// Name is "CpuCStateInfo.name"
   535  	//
   536  	// Optional
   537  	Name js.String
   538  	// TimeInStateSinceLastBootUs is "CpuCStateInfo.timeInStateSinceLastBootUs"
   539  	//
   540  	// Optional
   541  	//
   542  	// NOTE: FFI_USE_TimeInStateSinceLastBootUs MUST be set to true to make this field effective.
   543  	TimeInStateSinceLastBootUs float64
   544  
   545  	FFI_USE_TimeInStateSinceLastBootUs bool // for TimeInStateSinceLastBootUs.
   546  
   547  	FFI_USE bool
   548  }
   549  
   550  // FromRef calls UpdateFrom and returns a CpuCStateInfo with all fields set.
   551  func (p CpuCStateInfo) FromRef(ref js.Ref) CpuCStateInfo {
   552  	p.UpdateFrom(ref)
   553  	return p
   554  }
   555  
   556  // New creates a new CpuCStateInfo in the application heap.
   557  func (p CpuCStateInfo) New() js.Ref {
   558  	return bindings.CpuCStateInfoJSLoad(
   559  		js.Pointer(&p), js.True, 0,
   560  	)
   561  }
   562  
   563  // UpdateFrom copies value of all fields of the heap object to p.
   564  func (p *CpuCStateInfo) UpdateFrom(ref js.Ref) {
   565  	bindings.CpuCStateInfoJSStore(
   566  		js.Pointer(p), ref,
   567  	)
   568  }
   569  
   570  // Update writes all fields of the p to the heap object referenced by ref.
   571  func (p *CpuCStateInfo) Update(ref js.Ref) {
   572  	bindings.CpuCStateInfoJSLoad(
   573  		js.Pointer(p), js.False, ref,
   574  	)
   575  }
   576  
   577  // FreeMembers frees fields with heap reference, if recursive is true
   578  // free all heap references reachable from p.
   579  func (p *CpuCStateInfo) FreeMembers(recursive bool) {
   580  	js.Free(
   581  		p.Name.Ref(),
   582  	)
   583  	p.Name = p.Name.FromRef(js.Undefined)
   584  }
   585  
   586  type LogicalCpuInfo struct {
   587  	// MaxClockSpeedKhz is "LogicalCpuInfo.maxClockSpeedKhz"
   588  	//
   589  	// Optional
   590  	//
   591  	// NOTE: FFI_USE_MaxClockSpeedKhz MUST be set to true to make this field effective.
   592  	MaxClockSpeedKhz int32
   593  	// ScalingMaxFrequencyKhz is "LogicalCpuInfo.scalingMaxFrequencyKhz"
   594  	//
   595  	// Optional
   596  	//
   597  	// NOTE: FFI_USE_ScalingMaxFrequencyKhz MUST be set to true to make this field effective.
   598  	ScalingMaxFrequencyKhz int32
   599  	// ScalingCurrentFrequencyKhz is "LogicalCpuInfo.scalingCurrentFrequencyKhz"
   600  	//
   601  	// Optional
   602  	//
   603  	// NOTE: FFI_USE_ScalingCurrentFrequencyKhz MUST be set to true to make this field effective.
   604  	ScalingCurrentFrequencyKhz int32
   605  	// IdleTimeMs is "LogicalCpuInfo.idleTimeMs"
   606  	//
   607  	// Optional
   608  	//
   609  	// NOTE: FFI_USE_IdleTimeMs MUST be set to true to make this field effective.
   610  	IdleTimeMs float64
   611  	// CStates is "LogicalCpuInfo.cStates"
   612  	//
   613  	// Optional
   614  	CStates js.Array[CpuCStateInfo]
   615  	// CoreId is "LogicalCpuInfo.coreId"
   616  	//
   617  	// Optional
   618  	//
   619  	// NOTE: FFI_USE_CoreId MUST be set to true to make this field effective.
   620  	CoreId int32
   621  
   622  	FFI_USE_MaxClockSpeedKhz           bool // for MaxClockSpeedKhz.
   623  	FFI_USE_ScalingMaxFrequencyKhz     bool // for ScalingMaxFrequencyKhz.
   624  	FFI_USE_ScalingCurrentFrequencyKhz bool // for ScalingCurrentFrequencyKhz.
   625  	FFI_USE_IdleTimeMs                 bool // for IdleTimeMs.
   626  	FFI_USE_CoreId                     bool // for CoreId.
   627  
   628  	FFI_USE bool
   629  }
   630  
   631  // FromRef calls UpdateFrom and returns a LogicalCpuInfo with all fields set.
   632  func (p LogicalCpuInfo) FromRef(ref js.Ref) LogicalCpuInfo {
   633  	p.UpdateFrom(ref)
   634  	return p
   635  }
   636  
   637  // New creates a new LogicalCpuInfo in the application heap.
   638  func (p LogicalCpuInfo) New() js.Ref {
   639  	return bindings.LogicalCpuInfoJSLoad(
   640  		js.Pointer(&p), js.True, 0,
   641  	)
   642  }
   643  
   644  // UpdateFrom copies value of all fields of the heap object to p.
   645  func (p *LogicalCpuInfo) UpdateFrom(ref js.Ref) {
   646  	bindings.LogicalCpuInfoJSStore(
   647  		js.Pointer(p), ref,
   648  	)
   649  }
   650  
   651  // Update writes all fields of the p to the heap object referenced by ref.
   652  func (p *LogicalCpuInfo) Update(ref js.Ref) {
   653  	bindings.LogicalCpuInfoJSLoad(
   654  		js.Pointer(p), js.False, ref,
   655  	)
   656  }
   657  
   658  // FreeMembers frees fields with heap reference, if recursive is true
   659  // free all heap references reachable from p.
   660  func (p *LogicalCpuInfo) FreeMembers(recursive bool) {
   661  	js.Free(
   662  		p.CStates.Ref(),
   663  	)
   664  	p.CStates = p.CStates.FromRef(js.Undefined)
   665  }
   666  
   667  type PhysicalCpuInfo struct {
   668  	// ModelName is "PhysicalCpuInfo.modelName"
   669  	//
   670  	// Optional
   671  	ModelName js.String
   672  	// LogicalCpus is "PhysicalCpuInfo.logicalCpus"
   673  	//
   674  	// Optional
   675  	LogicalCpus js.Array[LogicalCpuInfo]
   676  
   677  	FFI_USE bool
   678  }
   679  
   680  // FromRef calls UpdateFrom and returns a PhysicalCpuInfo with all fields set.
   681  func (p PhysicalCpuInfo) FromRef(ref js.Ref) PhysicalCpuInfo {
   682  	p.UpdateFrom(ref)
   683  	return p
   684  }
   685  
   686  // New creates a new PhysicalCpuInfo in the application heap.
   687  func (p PhysicalCpuInfo) New() js.Ref {
   688  	return bindings.PhysicalCpuInfoJSLoad(
   689  		js.Pointer(&p), js.True, 0,
   690  	)
   691  }
   692  
   693  // UpdateFrom copies value of all fields of the heap object to p.
   694  func (p *PhysicalCpuInfo) UpdateFrom(ref js.Ref) {
   695  	bindings.PhysicalCpuInfoJSStore(
   696  		js.Pointer(p), ref,
   697  	)
   698  }
   699  
   700  // Update writes all fields of the p to the heap object referenced by ref.
   701  func (p *PhysicalCpuInfo) Update(ref js.Ref) {
   702  	bindings.PhysicalCpuInfoJSLoad(
   703  		js.Pointer(p), js.False, ref,
   704  	)
   705  }
   706  
   707  // FreeMembers frees fields with heap reference, if recursive is true
   708  // free all heap references reachable from p.
   709  func (p *PhysicalCpuInfo) FreeMembers(recursive bool) {
   710  	js.Free(
   711  		p.ModelName.Ref(),
   712  		p.LogicalCpus.Ref(),
   713  	)
   714  	p.ModelName = p.ModelName.FromRef(js.Undefined)
   715  	p.LogicalCpus = p.LogicalCpus.FromRef(js.Undefined)
   716  }
   717  
   718  type CpuInfo struct {
   719  	// NumTotalThreads is "CpuInfo.numTotalThreads"
   720  	//
   721  	// Optional
   722  	//
   723  	// NOTE: FFI_USE_NumTotalThreads MUST be set to true to make this field effective.
   724  	NumTotalThreads int32
   725  	// Architecture is "CpuInfo.architecture"
   726  	//
   727  	// Optional
   728  	Architecture CpuArchitectureEnum
   729  	// PhysicalCpus is "CpuInfo.physicalCpus"
   730  	//
   731  	// Optional
   732  	PhysicalCpus js.Array[PhysicalCpuInfo]
   733  
   734  	FFI_USE_NumTotalThreads bool // for NumTotalThreads.
   735  
   736  	FFI_USE bool
   737  }
   738  
   739  // FromRef calls UpdateFrom and returns a CpuInfo with all fields set.
   740  func (p CpuInfo) FromRef(ref js.Ref) CpuInfo {
   741  	p.UpdateFrom(ref)
   742  	return p
   743  }
   744  
   745  // New creates a new CpuInfo in the application heap.
   746  func (p CpuInfo) New() js.Ref {
   747  	return bindings.CpuInfoJSLoad(
   748  		js.Pointer(&p), js.True, 0,
   749  	)
   750  }
   751  
   752  // UpdateFrom copies value of all fields of the heap object to p.
   753  func (p *CpuInfo) UpdateFrom(ref js.Ref) {
   754  	bindings.CpuInfoJSStore(
   755  		js.Pointer(p), ref,
   756  	)
   757  }
   758  
   759  // Update writes all fields of the p to the heap object referenced by ref.
   760  func (p *CpuInfo) Update(ref js.Ref) {
   761  	bindings.CpuInfoJSLoad(
   762  		js.Pointer(p), js.False, ref,
   763  	)
   764  }
   765  
   766  // FreeMembers frees fields with heap reference, if recursive is true
   767  // free all heap references reachable from p.
   768  func (p *CpuInfo) FreeMembers(recursive bool) {
   769  	js.Free(
   770  		p.PhysicalCpus.Ref(),
   771  	)
   772  	p.PhysicalCpus = p.PhysicalCpus.FromRef(js.Undefined)
   773  }
   774  
   775  type CpuInfoCallbackFunc func(this js.Ref, cpuInfo *CpuInfo) js.Ref
   776  
   777  func (fn CpuInfoCallbackFunc) Register() js.Func[func(cpuInfo *CpuInfo)] {
   778  	return js.RegisterCallback[func(cpuInfo *CpuInfo)](
   779  		fn, abi.FuncPCABIInternal(fn),
   780  	)
   781  }
   782  
   783  func (fn CpuInfoCallbackFunc) DispatchCallback(
   784  	targetPC uintptr, ctx *js.CallbackContext,
   785  ) {
   786  	args := ctx.Args()
   787  	if len(args) != 1+1 /* js this */ ||
   788  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   789  		js.ThrowInvalidCallbackInvocation()
   790  	}
   791  	var arg0 CpuInfo
   792  	arg0.UpdateFrom(args[0+1])
   793  	defer arg0.FreeMembers(true)
   794  
   795  	if ctx.Return(fn(
   796  		args[0],
   797  
   798  		mark.NoEscape(&arg0),
   799  	)) {
   800  		return
   801  	}
   802  
   803  	js.ThrowCallbackValueNotReturned()
   804  }
   805  
   806  type CpuInfoCallback[T any] struct {
   807  	Fn  func(arg T, this js.Ref, cpuInfo *CpuInfo) js.Ref
   808  	Arg T
   809  }
   810  
   811  func (cb *CpuInfoCallback[T]) Register() js.Func[func(cpuInfo *CpuInfo)] {
   812  	return js.RegisterCallback[func(cpuInfo *CpuInfo)](
   813  		cb, abi.FuncPCABIInternal(cb.Fn),
   814  	)
   815  }
   816  
   817  func (cb *CpuInfoCallback[T]) DispatchCallback(
   818  	targetPC uintptr, ctx *js.CallbackContext,
   819  ) {
   820  	args := ctx.Args()
   821  	if len(args) != 1+1 /* js this */ ||
   822  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   823  		js.ThrowInvalidCallbackInvocation()
   824  	}
   825  	var arg0 CpuInfo
   826  	arg0.UpdateFrom(args[0+1])
   827  	defer arg0.FreeMembers(true)
   828  
   829  	if ctx.Return(cb.Fn(
   830  		cb.Arg,
   831  		args[0],
   832  
   833  		mark.NoEscape(&arg0),
   834  	)) {
   835  		return
   836  	}
   837  
   838  	js.ThrowCallbackValueNotReturned()
   839  }
   840  
   841  type DisplayInputType uint32
   842  
   843  const (
   844  	_ DisplayInputType = iota
   845  
   846  	DisplayInputType_UNKNOWN
   847  	DisplayInputType_DIGITAL
   848  	DisplayInputType_ANALOG
   849  )
   850  
   851  func (DisplayInputType) FromRef(str js.Ref) DisplayInputType {
   852  	return DisplayInputType(bindings.ConstOfDisplayInputType(str))
   853  }
   854  
   855  func (x DisplayInputType) String() (string, bool) {
   856  	switch x {
   857  	case DisplayInputType_UNKNOWN:
   858  		return "unknown", true
   859  	case DisplayInputType_DIGITAL:
   860  		return "digital", true
   861  	case DisplayInputType_ANALOG:
   862  		return "analog", true
   863  	default:
   864  		return "", false
   865  	}
   866  }
   867  
   868  type EmbeddedDisplayInfo struct {
   869  	// PrivacyScreenSupported is "EmbeddedDisplayInfo.privacyScreenSupported"
   870  	//
   871  	// Optional
   872  	//
   873  	// NOTE: FFI_USE_PrivacyScreenSupported MUST be set to true to make this field effective.
   874  	PrivacyScreenSupported bool
   875  	// PrivacyScreenEnabled is "EmbeddedDisplayInfo.privacyScreenEnabled"
   876  	//
   877  	// Optional
   878  	//
   879  	// NOTE: FFI_USE_PrivacyScreenEnabled MUST be set to true to make this field effective.
   880  	PrivacyScreenEnabled bool
   881  	// DisplayWidth is "EmbeddedDisplayInfo.displayWidth"
   882  	//
   883  	// Optional
   884  	//
   885  	// NOTE: FFI_USE_DisplayWidth MUST be set to true to make this field effective.
   886  	DisplayWidth int32
   887  	// DisplayHeight is "EmbeddedDisplayInfo.displayHeight"
   888  	//
   889  	// Optional
   890  	//
   891  	// NOTE: FFI_USE_DisplayHeight MUST be set to true to make this field effective.
   892  	DisplayHeight int32
   893  	// ResolutionHorizontal is "EmbeddedDisplayInfo.resolutionHorizontal"
   894  	//
   895  	// Optional
   896  	//
   897  	// NOTE: FFI_USE_ResolutionHorizontal MUST be set to true to make this field effective.
   898  	ResolutionHorizontal int32
   899  	// ResolutionVertical is "EmbeddedDisplayInfo.resolutionVertical"
   900  	//
   901  	// Optional
   902  	//
   903  	// NOTE: FFI_USE_ResolutionVertical MUST be set to true to make this field effective.
   904  	ResolutionVertical int32
   905  	// RefreshRate is "EmbeddedDisplayInfo.refreshRate"
   906  	//
   907  	// Optional
   908  	//
   909  	// NOTE: FFI_USE_RefreshRate MUST be set to true to make this field effective.
   910  	RefreshRate float64
   911  	// Manufacturer is "EmbeddedDisplayInfo.manufacturer"
   912  	//
   913  	// Optional
   914  	Manufacturer js.String
   915  	// ModelId is "EmbeddedDisplayInfo.modelId"
   916  	//
   917  	// Optional
   918  	//
   919  	// NOTE: FFI_USE_ModelId MUST be set to true to make this field effective.
   920  	ModelId int32
   921  	// SerialNumber is "EmbeddedDisplayInfo.serialNumber"
   922  	//
   923  	// Optional
   924  	//
   925  	// NOTE: FFI_USE_SerialNumber MUST be set to true to make this field effective.
   926  	SerialNumber int32
   927  	// ManufactureWeek is "EmbeddedDisplayInfo.manufactureWeek"
   928  	//
   929  	// Optional
   930  	//
   931  	// NOTE: FFI_USE_ManufactureWeek MUST be set to true to make this field effective.
   932  	ManufactureWeek int32
   933  	// ManufactureYear is "EmbeddedDisplayInfo.manufactureYear"
   934  	//
   935  	// Optional
   936  	//
   937  	// NOTE: FFI_USE_ManufactureYear MUST be set to true to make this field effective.
   938  	ManufactureYear int32
   939  	// EdidVersion is "EmbeddedDisplayInfo.edidVersion"
   940  	//
   941  	// Optional
   942  	EdidVersion js.String
   943  	// InputType is "EmbeddedDisplayInfo.inputType"
   944  	//
   945  	// Optional
   946  	InputType DisplayInputType
   947  	// DisplayName is "EmbeddedDisplayInfo.displayName"
   948  	//
   949  	// Optional
   950  	DisplayName js.String
   951  
   952  	FFI_USE_PrivacyScreenSupported bool // for PrivacyScreenSupported.
   953  	FFI_USE_PrivacyScreenEnabled   bool // for PrivacyScreenEnabled.
   954  	FFI_USE_DisplayWidth           bool // for DisplayWidth.
   955  	FFI_USE_DisplayHeight          bool // for DisplayHeight.
   956  	FFI_USE_ResolutionHorizontal   bool // for ResolutionHorizontal.
   957  	FFI_USE_ResolutionVertical     bool // for ResolutionVertical.
   958  	FFI_USE_RefreshRate            bool // for RefreshRate.
   959  	FFI_USE_ModelId                bool // for ModelId.
   960  	FFI_USE_SerialNumber           bool // for SerialNumber.
   961  	FFI_USE_ManufactureWeek        bool // for ManufactureWeek.
   962  	FFI_USE_ManufactureYear        bool // for ManufactureYear.
   963  
   964  	FFI_USE bool
   965  }
   966  
   967  // FromRef calls UpdateFrom and returns a EmbeddedDisplayInfo with all fields set.
   968  func (p EmbeddedDisplayInfo) FromRef(ref js.Ref) EmbeddedDisplayInfo {
   969  	p.UpdateFrom(ref)
   970  	return p
   971  }
   972  
   973  // New creates a new EmbeddedDisplayInfo in the application heap.
   974  func (p EmbeddedDisplayInfo) New() js.Ref {
   975  	return bindings.EmbeddedDisplayInfoJSLoad(
   976  		js.Pointer(&p), js.True, 0,
   977  	)
   978  }
   979  
   980  // UpdateFrom copies value of all fields of the heap object to p.
   981  func (p *EmbeddedDisplayInfo) UpdateFrom(ref js.Ref) {
   982  	bindings.EmbeddedDisplayInfoJSStore(
   983  		js.Pointer(p), ref,
   984  	)
   985  }
   986  
   987  // Update writes all fields of the p to the heap object referenced by ref.
   988  func (p *EmbeddedDisplayInfo) Update(ref js.Ref) {
   989  	bindings.EmbeddedDisplayInfoJSLoad(
   990  		js.Pointer(p), js.False, ref,
   991  	)
   992  }
   993  
   994  // FreeMembers frees fields with heap reference, if recursive is true
   995  // free all heap references reachable from p.
   996  func (p *EmbeddedDisplayInfo) FreeMembers(recursive bool) {
   997  	js.Free(
   998  		p.Manufacturer.Ref(),
   999  		p.EdidVersion.Ref(),
  1000  		p.DisplayName.Ref(),
  1001  	)
  1002  	p.Manufacturer = p.Manufacturer.FromRef(js.Undefined)
  1003  	p.EdidVersion = p.EdidVersion.FromRef(js.Undefined)
  1004  	p.DisplayName = p.DisplayName.FromRef(js.Undefined)
  1005  }
  1006  
  1007  type ExternalDisplayInfo struct {
  1008  	// DisplayWidth is "ExternalDisplayInfo.displayWidth"
  1009  	//
  1010  	// Optional
  1011  	//
  1012  	// NOTE: FFI_USE_DisplayWidth MUST be set to true to make this field effective.
  1013  	DisplayWidth int32
  1014  	// DisplayHeight is "ExternalDisplayInfo.displayHeight"
  1015  	//
  1016  	// Optional
  1017  	//
  1018  	// NOTE: FFI_USE_DisplayHeight MUST be set to true to make this field effective.
  1019  	DisplayHeight int32
  1020  	// ResolutionHorizontal is "ExternalDisplayInfo.resolutionHorizontal"
  1021  	//
  1022  	// Optional
  1023  	//
  1024  	// NOTE: FFI_USE_ResolutionHorizontal MUST be set to true to make this field effective.
  1025  	ResolutionHorizontal int32
  1026  	// ResolutionVertical is "ExternalDisplayInfo.resolutionVertical"
  1027  	//
  1028  	// Optional
  1029  	//
  1030  	// NOTE: FFI_USE_ResolutionVertical MUST be set to true to make this field effective.
  1031  	ResolutionVertical int32
  1032  	// RefreshRate is "ExternalDisplayInfo.refreshRate"
  1033  	//
  1034  	// Optional
  1035  	//
  1036  	// NOTE: FFI_USE_RefreshRate MUST be set to true to make this field effective.
  1037  	RefreshRate float64
  1038  	// Manufacturer is "ExternalDisplayInfo.manufacturer"
  1039  	//
  1040  	// Optional
  1041  	Manufacturer js.String
  1042  	// ModelId is "ExternalDisplayInfo.modelId"
  1043  	//
  1044  	// Optional
  1045  	//
  1046  	// NOTE: FFI_USE_ModelId MUST be set to true to make this field effective.
  1047  	ModelId int32
  1048  	// SerialNumber is "ExternalDisplayInfo.serialNumber"
  1049  	//
  1050  	// Optional
  1051  	//
  1052  	// NOTE: FFI_USE_SerialNumber MUST be set to true to make this field effective.
  1053  	SerialNumber int32
  1054  	// ManufactureWeek is "ExternalDisplayInfo.manufactureWeek"
  1055  	//
  1056  	// Optional
  1057  	//
  1058  	// NOTE: FFI_USE_ManufactureWeek MUST be set to true to make this field effective.
  1059  	ManufactureWeek int32
  1060  	// ManufactureYear is "ExternalDisplayInfo.manufactureYear"
  1061  	//
  1062  	// Optional
  1063  	//
  1064  	// NOTE: FFI_USE_ManufactureYear MUST be set to true to make this field effective.
  1065  	ManufactureYear int32
  1066  	// EdidVersion is "ExternalDisplayInfo.edidVersion"
  1067  	//
  1068  	// Optional
  1069  	EdidVersion js.String
  1070  	// InputType is "ExternalDisplayInfo.inputType"
  1071  	//
  1072  	// Optional
  1073  	InputType DisplayInputType
  1074  	// DisplayName is "ExternalDisplayInfo.displayName"
  1075  	//
  1076  	// Optional
  1077  	DisplayName js.String
  1078  
  1079  	FFI_USE_DisplayWidth         bool // for DisplayWidth.
  1080  	FFI_USE_DisplayHeight        bool // for DisplayHeight.
  1081  	FFI_USE_ResolutionHorizontal bool // for ResolutionHorizontal.
  1082  	FFI_USE_ResolutionVertical   bool // for ResolutionVertical.
  1083  	FFI_USE_RefreshRate          bool // for RefreshRate.
  1084  	FFI_USE_ModelId              bool // for ModelId.
  1085  	FFI_USE_SerialNumber         bool // for SerialNumber.
  1086  	FFI_USE_ManufactureWeek      bool // for ManufactureWeek.
  1087  	FFI_USE_ManufactureYear      bool // for ManufactureYear.
  1088  
  1089  	FFI_USE bool
  1090  }
  1091  
  1092  // FromRef calls UpdateFrom and returns a ExternalDisplayInfo with all fields set.
  1093  func (p ExternalDisplayInfo) FromRef(ref js.Ref) ExternalDisplayInfo {
  1094  	p.UpdateFrom(ref)
  1095  	return p
  1096  }
  1097  
  1098  // New creates a new ExternalDisplayInfo in the application heap.
  1099  func (p ExternalDisplayInfo) New() js.Ref {
  1100  	return bindings.ExternalDisplayInfoJSLoad(
  1101  		js.Pointer(&p), js.True, 0,
  1102  	)
  1103  }
  1104  
  1105  // UpdateFrom copies value of all fields of the heap object to p.
  1106  func (p *ExternalDisplayInfo) UpdateFrom(ref js.Ref) {
  1107  	bindings.ExternalDisplayInfoJSStore(
  1108  		js.Pointer(p), ref,
  1109  	)
  1110  }
  1111  
  1112  // Update writes all fields of the p to the heap object referenced by ref.
  1113  func (p *ExternalDisplayInfo) Update(ref js.Ref) {
  1114  	bindings.ExternalDisplayInfoJSLoad(
  1115  		js.Pointer(p), js.False, ref,
  1116  	)
  1117  }
  1118  
  1119  // FreeMembers frees fields with heap reference, if recursive is true
  1120  // free all heap references reachable from p.
  1121  func (p *ExternalDisplayInfo) FreeMembers(recursive bool) {
  1122  	js.Free(
  1123  		p.Manufacturer.Ref(),
  1124  		p.EdidVersion.Ref(),
  1125  		p.DisplayName.Ref(),
  1126  	)
  1127  	p.Manufacturer = p.Manufacturer.FromRef(js.Undefined)
  1128  	p.EdidVersion = p.EdidVersion.FromRef(js.Undefined)
  1129  	p.DisplayName = p.DisplayName.FromRef(js.Undefined)
  1130  }
  1131  
  1132  type DisplayInfo struct {
  1133  	// EmbeddedDisplay is "DisplayInfo.embeddedDisplay"
  1134  	//
  1135  	// Optional
  1136  	//
  1137  	// NOTE: EmbeddedDisplay.FFI_USE MUST be set to true to get EmbeddedDisplay used.
  1138  	EmbeddedDisplay EmbeddedDisplayInfo
  1139  	// ExternalDisplays is "DisplayInfo.externalDisplays"
  1140  	//
  1141  	// Optional
  1142  	ExternalDisplays js.Array[ExternalDisplayInfo]
  1143  
  1144  	FFI_USE bool
  1145  }
  1146  
  1147  // FromRef calls UpdateFrom and returns a DisplayInfo with all fields set.
  1148  func (p DisplayInfo) FromRef(ref js.Ref) DisplayInfo {
  1149  	p.UpdateFrom(ref)
  1150  	return p
  1151  }
  1152  
  1153  // New creates a new DisplayInfo in the application heap.
  1154  func (p DisplayInfo) New() js.Ref {
  1155  	return bindings.DisplayInfoJSLoad(
  1156  		js.Pointer(&p), js.True, 0,
  1157  	)
  1158  }
  1159  
  1160  // UpdateFrom copies value of all fields of the heap object to p.
  1161  func (p *DisplayInfo) UpdateFrom(ref js.Ref) {
  1162  	bindings.DisplayInfoJSStore(
  1163  		js.Pointer(p), ref,
  1164  	)
  1165  }
  1166  
  1167  // Update writes all fields of the p to the heap object referenced by ref.
  1168  func (p *DisplayInfo) Update(ref js.Ref) {
  1169  	bindings.DisplayInfoJSLoad(
  1170  		js.Pointer(p), js.False, ref,
  1171  	)
  1172  }
  1173  
  1174  // FreeMembers frees fields with heap reference, if recursive is true
  1175  // free all heap references reachable from p.
  1176  func (p *DisplayInfo) FreeMembers(recursive bool) {
  1177  	js.Free(
  1178  		p.ExternalDisplays.Ref(),
  1179  	)
  1180  	p.ExternalDisplays = p.ExternalDisplays.FromRef(js.Undefined)
  1181  	if recursive {
  1182  		p.EmbeddedDisplay.FreeMembers(true)
  1183  	}
  1184  }
  1185  
  1186  type DisplayInfoCallbackFunc func(this js.Ref, displayInfo *DisplayInfo) js.Ref
  1187  
  1188  func (fn DisplayInfoCallbackFunc) Register() js.Func[func(displayInfo *DisplayInfo)] {
  1189  	return js.RegisterCallback[func(displayInfo *DisplayInfo)](
  1190  		fn, abi.FuncPCABIInternal(fn),
  1191  	)
  1192  }
  1193  
  1194  func (fn DisplayInfoCallbackFunc) DispatchCallback(
  1195  	targetPC uintptr, ctx *js.CallbackContext,
  1196  ) {
  1197  	args := ctx.Args()
  1198  	if len(args) != 1+1 /* js this */ ||
  1199  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1200  		js.ThrowInvalidCallbackInvocation()
  1201  	}
  1202  	var arg0 DisplayInfo
  1203  	arg0.UpdateFrom(args[0+1])
  1204  	defer arg0.FreeMembers(true)
  1205  
  1206  	if ctx.Return(fn(
  1207  		args[0],
  1208  
  1209  		mark.NoEscape(&arg0),
  1210  	)) {
  1211  		return
  1212  	}
  1213  
  1214  	js.ThrowCallbackValueNotReturned()
  1215  }
  1216  
  1217  type DisplayInfoCallback[T any] struct {
  1218  	Fn  func(arg T, this js.Ref, displayInfo *DisplayInfo) js.Ref
  1219  	Arg T
  1220  }
  1221  
  1222  func (cb *DisplayInfoCallback[T]) Register() js.Func[func(displayInfo *DisplayInfo)] {
  1223  	return js.RegisterCallback[func(displayInfo *DisplayInfo)](
  1224  		cb, abi.FuncPCABIInternal(cb.Fn),
  1225  	)
  1226  }
  1227  
  1228  func (cb *DisplayInfoCallback[T]) DispatchCallback(
  1229  	targetPC uintptr, ctx *js.CallbackContext,
  1230  ) {
  1231  	args := ctx.Args()
  1232  	if len(args) != 1+1 /* js this */ ||
  1233  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1234  		js.ThrowInvalidCallbackInvocation()
  1235  	}
  1236  	var arg0 DisplayInfo
  1237  	arg0.UpdateFrom(args[0+1])
  1238  	defer arg0.FreeMembers(true)
  1239  
  1240  	if ctx.Return(cb.Fn(
  1241  		cb.Arg,
  1242  		args[0],
  1243  
  1244  		mark.NoEscape(&arg0),
  1245  	)) {
  1246  		return
  1247  	}
  1248  
  1249  	js.ThrowCallbackValueNotReturned()
  1250  }
  1251  
  1252  type EOFFunc func(this js.Ref) js.Ref
  1253  
  1254  func (fn EOFFunc) Register() js.Func[func()] {
  1255  	return js.RegisterCallback[func()](
  1256  		fn, abi.FuncPCABIInternal(fn),
  1257  	)
  1258  }
  1259  
  1260  func (fn EOFFunc) DispatchCallback(
  1261  	targetPC uintptr, ctx *js.CallbackContext,
  1262  ) {
  1263  	args := ctx.Args()
  1264  	if len(args) != 0+1 /* js this */ ||
  1265  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1266  		js.ThrowInvalidCallbackInvocation()
  1267  	}
  1268  
  1269  	if ctx.Return(fn(
  1270  		args[0],
  1271  	)) {
  1272  		return
  1273  	}
  1274  
  1275  	js.ThrowCallbackValueNotReturned()
  1276  }
  1277  
  1278  type EOF[T any] struct {
  1279  	Fn  func(arg T, this js.Ref) js.Ref
  1280  	Arg T
  1281  }
  1282  
  1283  func (cb *EOF[T]) Register() js.Func[func()] {
  1284  	return js.RegisterCallback[func()](
  1285  		cb, abi.FuncPCABIInternal(cb.Fn),
  1286  	)
  1287  }
  1288  
  1289  func (cb *EOF[T]) DispatchCallback(
  1290  	targetPC uintptr, ctx *js.CallbackContext,
  1291  ) {
  1292  	args := ctx.Args()
  1293  	if len(args) != 0+1 /* js this */ ||
  1294  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1295  		js.ThrowInvalidCallbackInvocation()
  1296  	}
  1297  
  1298  	if ctx.Return(cb.Fn(
  1299  		cb.Arg,
  1300  		args[0],
  1301  	)) {
  1302  		return
  1303  	}
  1304  
  1305  	js.ThrowCallbackValueNotReturned()
  1306  }
  1307  
  1308  type FwupdVersionFormat uint32
  1309  
  1310  const (
  1311  	_ FwupdVersionFormat = iota
  1312  
  1313  	FwupdVersionFormat_PLAIN
  1314  	FwupdVersionFormat_NUMBER
  1315  	FwupdVersionFormat_PAIR
  1316  	FwupdVersionFormat_TRIPLET
  1317  	FwupdVersionFormat_QUAD
  1318  	FwupdVersionFormat_BCD
  1319  	FwupdVersionFormat_INTEL_ME
  1320  	FwupdVersionFormat_INTEL_ME2
  1321  	FwupdVersionFormat_SURFACE_LEGACY
  1322  	FwupdVersionFormat_SURFACE
  1323  	FwupdVersionFormat_DELL_BIOS
  1324  	FwupdVersionFormat_HEX
  1325  )
  1326  
  1327  func (FwupdVersionFormat) FromRef(str js.Ref) FwupdVersionFormat {
  1328  	return FwupdVersionFormat(bindings.ConstOfFwupdVersionFormat(str))
  1329  }
  1330  
  1331  func (x FwupdVersionFormat) String() (string, bool) {
  1332  	switch x {
  1333  	case FwupdVersionFormat_PLAIN:
  1334  		return "plain", true
  1335  	case FwupdVersionFormat_NUMBER:
  1336  		return "number", true
  1337  	case FwupdVersionFormat_PAIR:
  1338  		return "pair", true
  1339  	case FwupdVersionFormat_TRIPLET:
  1340  		return "triplet", true
  1341  	case FwupdVersionFormat_QUAD:
  1342  		return "quad", true
  1343  	case FwupdVersionFormat_BCD:
  1344  		return "bcd", true
  1345  	case FwupdVersionFormat_INTEL_ME:
  1346  		return "intelMe", true
  1347  	case FwupdVersionFormat_INTEL_ME2:
  1348  		return "intelMe2", true
  1349  	case FwupdVersionFormat_SURFACE_LEGACY:
  1350  		return "surfaceLegacy", true
  1351  	case FwupdVersionFormat_SURFACE:
  1352  		return "surface", true
  1353  	case FwupdVersionFormat_DELL_BIOS:
  1354  		return "dellBios", true
  1355  	case FwupdVersionFormat_HEX:
  1356  		return "hex", true
  1357  	default:
  1358  		return "", false
  1359  	}
  1360  }
  1361  
  1362  type FwupdFirmwareVersionInfo struct {
  1363  	// Version is "FwupdFirmwareVersionInfo.version"
  1364  	//
  1365  	// Optional
  1366  	Version js.String
  1367  	// VersionFormat is "FwupdFirmwareVersionInfo.version_format"
  1368  	//
  1369  	// Optional
  1370  	VersionFormat FwupdVersionFormat
  1371  
  1372  	FFI_USE bool
  1373  }
  1374  
  1375  // FromRef calls UpdateFrom and returns a FwupdFirmwareVersionInfo with all fields set.
  1376  func (p FwupdFirmwareVersionInfo) FromRef(ref js.Ref) FwupdFirmwareVersionInfo {
  1377  	p.UpdateFrom(ref)
  1378  	return p
  1379  }
  1380  
  1381  // New creates a new FwupdFirmwareVersionInfo in the application heap.
  1382  func (p FwupdFirmwareVersionInfo) New() js.Ref {
  1383  	return bindings.FwupdFirmwareVersionInfoJSLoad(
  1384  		js.Pointer(&p), js.True, 0,
  1385  	)
  1386  }
  1387  
  1388  // UpdateFrom copies value of all fields of the heap object to p.
  1389  func (p *FwupdFirmwareVersionInfo) UpdateFrom(ref js.Ref) {
  1390  	bindings.FwupdFirmwareVersionInfoJSStore(
  1391  		js.Pointer(p), ref,
  1392  	)
  1393  }
  1394  
  1395  // Update writes all fields of the p to the heap object referenced by ref.
  1396  func (p *FwupdFirmwareVersionInfo) Update(ref js.Ref) {
  1397  	bindings.FwupdFirmwareVersionInfoJSLoad(
  1398  		js.Pointer(p), js.False, ref,
  1399  	)
  1400  }
  1401  
  1402  // FreeMembers frees fields with heap reference, if recursive is true
  1403  // free all heap references reachable from p.
  1404  func (p *FwupdFirmwareVersionInfo) FreeMembers(recursive bool) {
  1405  	js.Free(
  1406  		p.Version.Ref(),
  1407  	)
  1408  	p.Version = p.Version.FromRef(js.Undefined)
  1409  }
  1410  
  1411  type NetworkType uint32
  1412  
  1413  const (
  1414  	_ NetworkType = iota
  1415  
  1416  	NetworkType_CELLULAR
  1417  	NetworkType_ETHERNET
  1418  	NetworkType_TETHER
  1419  	NetworkType_VPN
  1420  	NetworkType_WIFI
  1421  )
  1422  
  1423  func (NetworkType) FromRef(str js.Ref) NetworkType {
  1424  	return NetworkType(bindings.ConstOfNetworkType(str))
  1425  }
  1426  
  1427  func (x NetworkType) String() (string, bool) {
  1428  	switch x {
  1429  	case NetworkType_CELLULAR:
  1430  		return "cellular", true
  1431  	case NetworkType_ETHERNET:
  1432  		return "ethernet", true
  1433  	case NetworkType_TETHER:
  1434  		return "tether", true
  1435  	case NetworkType_VPN:
  1436  		return "vpn", true
  1437  	case NetworkType_WIFI:
  1438  		return "wifi", true
  1439  	default:
  1440  		return "", false
  1441  	}
  1442  }
  1443  
  1444  type NetworkState uint32
  1445  
  1446  const (
  1447  	_ NetworkState = iota
  1448  
  1449  	NetworkState_UNINITIALIZED
  1450  	NetworkState_DISABLED
  1451  	NetworkState_PROHIBITED
  1452  	NetworkState_NOT_CONNECTED
  1453  	NetworkState_CONNECTING
  1454  	NetworkState_PORTAL
  1455  	NetworkState_CONNECTED
  1456  	NetworkState_ONLINE
  1457  )
  1458  
  1459  func (NetworkState) FromRef(str js.Ref) NetworkState {
  1460  	return NetworkState(bindings.ConstOfNetworkState(str))
  1461  }
  1462  
  1463  func (x NetworkState) String() (string, bool) {
  1464  	switch x {
  1465  	case NetworkState_UNINITIALIZED:
  1466  		return "uninitialized", true
  1467  	case NetworkState_DISABLED:
  1468  		return "disabled", true
  1469  	case NetworkState_PROHIBITED:
  1470  		return "prohibited", true
  1471  	case NetworkState_NOT_CONNECTED:
  1472  		return "not_connected", true
  1473  	case NetworkState_CONNECTING:
  1474  		return "connecting", true
  1475  	case NetworkState_PORTAL:
  1476  		return "portal", true
  1477  	case NetworkState_CONNECTED:
  1478  		return "connected", true
  1479  	case NetworkState_ONLINE:
  1480  		return "online", true
  1481  	default:
  1482  		return "", false
  1483  	}
  1484  }
  1485  
  1486  type NetworkInfo struct {
  1487  	// Type is "NetworkInfo.type"
  1488  	//
  1489  	// Optional
  1490  	Type NetworkType
  1491  	// State is "NetworkInfo.state"
  1492  	//
  1493  	// Optional
  1494  	State NetworkState
  1495  	// MacAddress is "NetworkInfo.macAddress"
  1496  	//
  1497  	// Optional
  1498  	MacAddress js.String
  1499  	// Ipv4Address is "NetworkInfo.ipv4Address"
  1500  	//
  1501  	// Optional
  1502  	Ipv4Address js.String
  1503  	// Ipv6Addresses is "NetworkInfo.ipv6Addresses"
  1504  	//
  1505  	// Optional
  1506  	Ipv6Addresses js.Array[js.String]
  1507  	// SignalStrength is "NetworkInfo.signalStrength"
  1508  	//
  1509  	// Optional
  1510  	//
  1511  	// NOTE: FFI_USE_SignalStrength MUST be set to true to make this field effective.
  1512  	SignalStrength float64
  1513  
  1514  	FFI_USE_SignalStrength bool // for SignalStrength.
  1515  
  1516  	FFI_USE bool
  1517  }
  1518  
  1519  // FromRef calls UpdateFrom and returns a NetworkInfo with all fields set.
  1520  func (p NetworkInfo) FromRef(ref js.Ref) NetworkInfo {
  1521  	p.UpdateFrom(ref)
  1522  	return p
  1523  }
  1524  
  1525  // New creates a new NetworkInfo in the application heap.
  1526  func (p NetworkInfo) New() js.Ref {
  1527  	return bindings.NetworkInfoJSLoad(
  1528  		js.Pointer(&p), js.True, 0,
  1529  	)
  1530  }
  1531  
  1532  // UpdateFrom copies value of all fields of the heap object to p.
  1533  func (p *NetworkInfo) UpdateFrom(ref js.Ref) {
  1534  	bindings.NetworkInfoJSStore(
  1535  		js.Pointer(p), ref,
  1536  	)
  1537  }
  1538  
  1539  // Update writes all fields of the p to the heap object referenced by ref.
  1540  func (p *NetworkInfo) Update(ref js.Ref) {
  1541  	bindings.NetworkInfoJSLoad(
  1542  		js.Pointer(p), js.False, ref,
  1543  	)
  1544  }
  1545  
  1546  // FreeMembers frees fields with heap reference, if recursive is true
  1547  // free all heap references reachable from p.
  1548  func (p *NetworkInfo) FreeMembers(recursive bool) {
  1549  	js.Free(
  1550  		p.MacAddress.Ref(),
  1551  		p.Ipv4Address.Ref(),
  1552  		p.Ipv6Addresses.Ref(),
  1553  	)
  1554  	p.MacAddress = p.MacAddress.FromRef(js.Undefined)
  1555  	p.Ipv4Address = p.Ipv4Address.FromRef(js.Undefined)
  1556  	p.Ipv6Addresses = p.Ipv6Addresses.FromRef(js.Undefined)
  1557  }
  1558  
  1559  type InternetConnectivityInfo struct {
  1560  	// Networks is "InternetConnectivityInfo.networks"
  1561  	//
  1562  	// Optional
  1563  	Networks js.Array[NetworkInfo]
  1564  
  1565  	FFI_USE bool
  1566  }
  1567  
  1568  // FromRef calls UpdateFrom and returns a InternetConnectivityInfo with all fields set.
  1569  func (p InternetConnectivityInfo) FromRef(ref js.Ref) InternetConnectivityInfo {
  1570  	p.UpdateFrom(ref)
  1571  	return p
  1572  }
  1573  
  1574  // New creates a new InternetConnectivityInfo in the application heap.
  1575  func (p InternetConnectivityInfo) New() js.Ref {
  1576  	return bindings.InternetConnectivityInfoJSLoad(
  1577  		js.Pointer(&p), js.True, 0,
  1578  	)
  1579  }
  1580  
  1581  // UpdateFrom copies value of all fields of the heap object to p.
  1582  func (p *InternetConnectivityInfo) UpdateFrom(ref js.Ref) {
  1583  	bindings.InternetConnectivityInfoJSStore(
  1584  		js.Pointer(p), ref,
  1585  	)
  1586  }
  1587  
  1588  // Update writes all fields of the p to the heap object referenced by ref.
  1589  func (p *InternetConnectivityInfo) Update(ref js.Ref) {
  1590  	bindings.InternetConnectivityInfoJSLoad(
  1591  		js.Pointer(p), js.False, ref,
  1592  	)
  1593  }
  1594  
  1595  // FreeMembers frees fields with heap reference, if recursive is true
  1596  // free all heap references reachable from p.
  1597  func (p *InternetConnectivityInfo) FreeMembers(recursive bool) {
  1598  	js.Free(
  1599  		p.Networks.Ref(),
  1600  	)
  1601  	p.Networks = p.Networks.FromRef(js.Undefined)
  1602  }
  1603  
  1604  type InternetConnectivityInfoCallbackFunc func(this js.Ref, networkInfo *InternetConnectivityInfo) js.Ref
  1605  
  1606  func (fn InternetConnectivityInfoCallbackFunc) Register() js.Func[func(networkInfo *InternetConnectivityInfo)] {
  1607  	return js.RegisterCallback[func(networkInfo *InternetConnectivityInfo)](
  1608  		fn, abi.FuncPCABIInternal(fn),
  1609  	)
  1610  }
  1611  
  1612  func (fn InternetConnectivityInfoCallbackFunc) DispatchCallback(
  1613  	targetPC uintptr, ctx *js.CallbackContext,
  1614  ) {
  1615  	args := ctx.Args()
  1616  	if len(args) != 1+1 /* js this */ ||
  1617  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1618  		js.ThrowInvalidCallbackInvocation()
  1619  	}
  1620  	var arg0 InternetConnectivityInfo
  1621  	arg0.UpdateFrom(args[0+1])
  1622  	defer arg0.FreeMembers(true)
  1623  
  1624  	if ctx.Return(fn(
  1625  		args[0],
  1626  
  1627  		mark.NoEscape(&arg0),
  1628  	)) {
  1629  		return
  1630  	}
  1631  
  1632  	js.ThrowCallbackValueNotReturned()
  1633  }
  1634  
  1635  type InternetConnectivityInfoCallback[T any] struct {
  1636  	Fn  func(arg T, this js.Ref, networkInfo *InternetConnectivityInfo) js.Ref
  1637  	Arg T
  1638  }
  1639  
  1640  func (cb *InternetConnectivityInfoCallback[T]) Register() js.Func[func(networkInfo *InternetConnectivityInfo)] {
  1641  	return js.RegisterCallback[func(networkInfo *InternetConnectivityInfo)](
  1642  		cb, abi.FuncPCABIInternal(cb.Fn),
  1643  	)
  1644  }
  1645  
  1646  func (cb *InternetConnectivityInfoCallback[T]) DispatchCallback(
  1647  	targetPC uintptr, ctx *js.CallbackContext,
  1648  ) {
  1649  	args := ctx.Args()
  1650  	if len(args) != 1+1 /* js this */ ||
  1651  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1652  		js.ThrowInvalidCallbackInvocation()
  1653  	}
  1654  	var arg0 InternetConnectivityInfo
  1655  	arg0.UpdateFrom(args[0+1])
  1656  	defer arg0.FreeMembers(true)
  1657  
  1658  	if ctx.Return(cb.Fn(
  1659  		cb.Arg,
  1660  		args[0],
  1661  
  1662  		mark.NoEscape(&arg0),
  1663  	)) {
  1664  		return
  1665  	}
  1666  
  1667  	js.ThrowCallbackValueNotReturned()
  1668  }
  1669  
  1670  type MarketingInfo struct {
  1671  	// MarketingName is "MarketingInfo.marketingName"
  1672  	//
  1673  	// Optional
  1674  	MarketingName js.String
  1675  
  1676  	FFI_USE bool
  1677  }
  1678  
  1679  // FromRef calls UpdateFrom and returns a MarketingInfo with all fields set.
  1680  func (p MarketingInfo) FromRef(ref js.Ref) MarketingInfo {
  1681  	p.UpdateFrom(ref)
  1682  	return p
  1683  }
  1684  
  1685  // New creates a new MarketingInfo in the application heap.
  1686  func (p MarketingInfo) New() js.Ref {
  1687  	return bindings.MarketingInfoJSLoad(
  1688  		js.Pointer(&p), js.True, 0,
  1689  	)
  1690  }
  1691  
  1692  // UpdateFrom copies value of all fields of the heap object to p.
  1693  func (p *MarketingInfo) UpdateFrom(ref js.Ref) {
  1694  	bindings.MarketingInfoJSStore(
  1695  		js.Pointer(p), ref,
  1696  	)
  1697  }
  1698  
  1699  // Update writes all fields of the p to the heap object referenced by ref.
  1700  func (p *MarketingInfo) Update(ref js.Ref) {
  1701  	bindings.MarketingInfoJSLoad(
  1702  		js.Pointer(p), js.False, ref,
  1703  	)
  1704  }
  1705  
  1706  // FreeMembers frees fields with heap reference, if recursive is true
  1707  // free all heap references reachable from p.
  1708  func (p *MarketingInfo) FreeMembers(recursive bool) {
  1709  	js.Free(
  1710  		p.MarketingName.Ref(),
  1711  	)
  1712  	p.MarketingName = p.MarketingName.FromRef(js.Undefined)
  1713  }
  1714  
  1715  type MarketingInfoCallbackFunc func(this js.Ref, marketingInfo *MarketingInfo) js.Ref
  1716  
  1717  func (fn MarketingInfoCallbackFunc) Register() js.Func[func(marketingInfo *MarketingInfo)] {
  1718  	return js.RegisterCallback[func(marketingInfo *MarketingInfo)](
  1719  		fn, abi.FuncPCABIInternal(fn),
  1720  	)
  1721  }
  1722  
  1723  func (fn MarketingInfoCallbackFunc) DispatchCallback(
  1724  	targetPC uintptr, ctx *js.CallbackContext,
  1725  ) {
  1726  	args := ctx.Args()
  1727  	if len(args) != 1+1 /* js this */ ||
  1728  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1729  		js.ThrowInvalidCallbackInvocation()
  1730  	}
  1731  	var arg0 MarketingInfo
  1732  	arg0.UpdateFrom(args[0+1])
  1733  	defer arg0.FreeMembers(true)
  1734  
  1735  	if ctx.Return(fn(
  1736  		args[0],
  1737  
  1738  		mark.NoEscape(&arg0),
  1739  	)) {
  1740  		return
  1741  	}
  1742  
  1743  	js.ThrowCallbackValueNotReturned()
  1744  }
  1745  
  1746  type MarketingInfoCallback[T any] struct {
  1747  	Fn  func(arg T, this js.Ref, marketingInfo *MarketingInfo) js.Ref
  1748  	Arg T
  1749  }
  1750  
  1751  func (cb *MarketingInfoCallback[T]) Register() js.Func[func(marketingInfo *MarketingInfo)] {
  1752  	return js.RegisterCallback[func(marketingInfo *MarketingInfo)](
  1753  		cb, abi.FuncPCABIInternal(cb.Fn),
  1754  	)
  1755  }
  1756  
  1757  func (cb *MarketingInfoCallback[T]) DispatchCallback(
  1758  	targetPC uintptr, ctx *js.CallbackContext,
  1759  ) {
  1760  	args := ctx.Args()
  1761  	if len(args) != 1+1 /* js this */ ||
  1762  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1763  		js.ThrowInvalidCallbackInvocation()
  1764  	}
  1765  	var arg0 MarketingInfo
  1766  	arg0.UpdateFrom(args[0+1])
  1767  	defer arg0.FreeMembers(true)
  1768  
  1769  	if ctx.Return(cb.Fn(
  1770  		cb.Arg,
  1771  		args[0],
  1772  
  1773  		mark.NoEscape(&arg0),
  1774  	)) {
  1775  		return
  1776  	}
  1777  
  1778  	js.ThrowCallbackValueNotReturned()
  1779  }
  1780  
  1781  type MemoryInfo struct {
  1782  	// TotalMemoryKiB is "MemoryInfo.totalMemoryKiB"
  1783  	//
  1784  	// Optional
  1785  	//
  1786  	// NOTE: FFI_USE_TotalMemoryKiB MUST be set to true to make this field effective.
  1787  	TotalMemoryKiB int32
  1788  	// FreeMemoryKiB is "MemoryInfo.freeMemoryKiB"
  1789  	//
  1790  	// Optional
  1791  	//
  1792  	// NOTE: FFI_USE_FreeMemoryKiB MUST be set to true to make this field effective.
  1793  	FreeMemoryKiB int32
  1794  	// AvailableMemoryKiB is "MemoryInfo.availableMemoryKiB"
  1795  	//
  1796  	// Optional
  1797  	//
  1798  	// NOTE: FFI_USE_AvailableMemoryKiB MUST be set to true to make this field effective.
  1799  	AvailableMemoryKiB int32
  1800  	// PageFaultsSinceLastBoot is "MemoryInfo.pageFaultsSinceLastBoot"
  1801  	//
  1802  	// Optional
  1803  	//
  1804  	// NOTE: FFI_USE_PageFaultsSinceLastBoot MUST be set to true to make this field effective.
  1805  	PageFaultsSinceLastBoot float64
  1806  
  1807  	FFI_USE_TotalMemoryKiB          bool // for TotalMemoryKiB.
  1808  	FFI_USE_FreeMemoryKiB           bool // for FreeMemoryKiB.
  1809  	FFI_USE_AvailableMemoryKiB      bool // for AvailableMemoryKiB.
  1810  	FFI_USE_PageFaultsSinceLastBoot bool // for PageFaultsSinceLastBoot.
  1811  
  1812  	FFI_USE bool
  1813  }
  1814  
  1815  // FromRef calls UpdateFrom and returns a MemoryInfo with all fields set.
  1816  func (p MemoryInfo) FromRef(ref js.Ref) MemoryInfo {
  1817  	p.UpdateFrom(ref)
  1818  	return p
  1819  }
  1820  
  1821  // New creates a new MemoryInfo in the application heap.
  1822  func (p MemoryInfo) New() js.Ref {
  1823  	return bindings.MemoryInfoJSLoad(
  1824  		js.Pointer(&p), js.True, 0,
  1825  	)
  1826  }
  1827  
  1828  // UpdateFrom copies value of all fields of the heap object to p.
  1829  func (p *MemoryInfo) UpdateFrom(ref js.Ref) {
  1830  	bindings.MemoryInfoJSStore(
  1831  		js.Pointer(p), ref,
  1832  	)
  1833  }
  1834  
  1835  // Update writes all fields of the p to the heap object referenced by ref.
  1836  func (p *MemoryInfo) Update(ref js.Ref) {
  1837  	bindings.MemoryInfoJSLoad(
  1838  		js.Pointer(p), js.False, ref,
  1839  	)
  1840  }
  1841  
  1842  // FreeMembers frees fields with heap reference, if recursive is true
  1843  // free all heap references reachable from p.
  1844  func (p *MemoryInfo) FreeMembers(recursive bool) {
  1845  }
  1846  
  1847  type MemoryInfoCallbackFunc func(this js.Ref, cpuInfo *MemoryInfo) js.Ref
  1848  
  1849  func (fn MemoryInfoCallbackFunc) Register() js.Func[func(cpuInfo *MemoryInfo)] {
  1850  	return js.RegisterCallback[func(cpuInfo *MemoryInfo)](
  1851  		fn, abi.FuncPCABIInternal(fn),
  1852  	)
  1853  }
  1854  
  1855  func (fn MemoryInfoCallbackFunc) DispatchCallback(
  1856  	targetPC uintptr, ctx *js.CallbackContext,
  1857  ) {
  1858  	args := ctx.Args()
  1859  	if len(args) != 1+1 /* js this */ ||
  1860  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1861  		js.ThrowInvalidCallbackInvocation()
  1862  	}
  1863  	var arg0 MemoryInfo
  1864  	arg0.UpdateFrom(args[0+1])
  1865  	defer arg0.FreeMembers(true)
  1866  
  1867  	if ctx.Return(fn(
  1868  		args[0],
  1869  
  1870  		mark.NoEscape(&arg0),
  1871  	)) {
  1872  		return
  1873  	}
  1874  
  1875  	js.ThrowCallbackValueNotReturned()
  1876  }
  1877  
  1878  type MemoryInfoCallback[T any] struct {
  1879  	Fn  func(arg T, this js.Ref, cpuInfo *MemoryInfo) js.Ref
  1880  	Arg T
  1881  }
  1882  
  1883  func (cb *MemoryInfoCallback[T]) Register() js.Func[func(cpuInfo *MemoryInfo)] {
  1884  	return js.RegisterCallback[func(cpuInfo *MemoryInfo)](
  1885  		cb, abi.FuncPCABIInternal(cb.Fn),
  1886  	)
  1887  }
  1888  
  1889  func (cb *MemoryInfoCallback[T]) DispatchCallback(
  1890  	targetPC uintptr, ctx *js.CallbackContext,
  1891  ) {
  1892  	args := ctx.Args()
  1893  	if len(args) != 1+1 /* js this */ ||
  1894  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1895  		js.ThrowInvalidCallbackInvocation()
  1896  	}
  1897  	var arg0 MemoryInfo
  1898  	arg0.UpdateFrom(args[0+1])
  1899  	defer arg0.FreeMembers(true)
  1900  
  1901  	if ctx.Return(cb.Fn(
  1902  		cb.Arg,
  1903  		args[0],
  1904  
  1905  		mark.NoEscape(&arg0),
  1906  	)) {
  1907  		return
  1908  	}
  1909  
  1910  	js.ThrowCallbackValueNotReturned()
  1911  }
  1912  
  1913  type NonRemovableBlockDeviceInfo struct {
  1914  	// Name is "NonRemovableBlockDeviceInfo.name"
  1915  	//
  1916  	// Optional
  1917  	Name js.String
  1918  	// Type is "NonRemovableBlockDeviceInfo.type"
  1919  	//
  1920  	// Optional
  1921  	Type js.String
  1922  	// Size is "NonRemovableBlockDeviceInfo.size"
  1923  	//
  1924  	// Optional
  1925  	//
  1926  	// NOTE: FFI_USE_Size MUST be set to true to make this field effective.
  1927  	Size float64
  1928  
  1929  	FFI_USE_Size bool // for Size.
  1930  
  1931  	FFI_USE bool
  1932  }
  1933  
  1934  // FromRef calls UpdateFrom and returns a NonRemovableBlockDeviceInfo with all fields set.
  1935  func (p NonRemovableBlockDeviceInfo) FromRef(ref js.Ref) NonRemovableBlockDeviceInfo {
  1936  	p.UpdateFrom(ref)
  1937  	return p
  1938  }
  1939  
  1940  // New creates a new NonRemovableBlockDeviceInfo in the application heap.
  1941  func (p NonRemovableBlockDeviceInfo) New() js.Ref {
  1942  	return bindings.NonRemovableBlockDeviceInfoJSLoad(
  1943  		js.Pointer(&p), js.True, 0,
  1944  	)
  1945  }
  1946  
  1947  // UpdateFrom copies value of all fields of the heap object to p.
  1948  func (p *NonRemovableBlockDeviceInfo) UpdateFrom(ref js.Ref) {
  1949  	bindings.NonRemovableBlockDeviceInfoJSStore(
  1950  		js.Pointer(p), ref,
  1951  	)
  1952  }
  1953  
  1954  // Update writes all fields of the p to the heap object referenced by ref.
  1955  func (p *NonRemovableBlockDeviceInfo) Update(ref js.Ref) {
  1956  	bindings.NonRemovableBlockDeviceInfoJSLoad(
  1957  		js.Pointer(p), js.False, ref,
  1958  	)
  1959  }
  1960  
  1961  // FreeMembers frees fields with heap reference, if recursive is true
  1962  // free all heap references reachable from p.
  1963  func (p *NonRemovableBlockDeviceInfo) FreeMembers(recursive bool) {
  1964  	js.Free(
  1965  		p.Name.Ref(),
  1966  		p.Type.Ref(),
  1967  	)
  1968  	p.Name = p.Name.FromRef(js.Undefined)
  1969  	p.Type = p.Type.FromRef(js.Undefined)
  1970  }
  1971  
  1972  type NonRemovableBlockDeviceInfoResponse struct {
  1973  	// DeviceInfos is "NonRemovableBlockDeviceInfoResponse.deviceInfos"
  1974  	//
  1975  	// Optional
  1976  	DeviceInfos js.Array[NonRemovableBlockDeviceInfo]
  1977  
  1978  	FFI_USE bool
  1979  }
  1980  
  1981  // FromRef calls UpdateFrom and returns a NonRemovableBlockDeviceInfoResponse with all fields set.
  1982  func (p NonRemovableBlockDeviceInfoResponse) FromRef(ref js.Ref) NonRemovableBlockDeviceInfoResponse {
  1983  	p.UpdateFrom(ref)
  1984  	return p
  1985  }
  1986  
  1987  // New creates a new NonRemovableBlockDeviceInfoResponse in the application heap.
  1988  func (p NonRemovableBlockDeviceInfoResponse) New() js.Ref {
  1989  	return bindings.NonRemovableBlockDeviceInfoResponseJSLoad(
  1990  		js.Pointer(&p), js.True, 0,
  1991  	)
  1992  }
  1993  
  1994  // UpdateFrom copies value of all fields of the heap object to p.
  1995  func (p *NonRemovableBlockDeviceInfoResponse) UpdateFrom(ref js.Ref) {
  1996  	bindings.NonRemovableBlockDeviceInfoResponseJSStore(
  1997  		js.Pointer(p), ref,
  1998  	)
  1999  }
  2000  
  2001  // Update writes all fields of the p to the heap object referenced by ref.
  2002  func (p *NonRemovableBlockDeviceInfoResponse) Update(ref js.Ref) {
  2003  	bindings.NonRemovableBlockDeviceInfoResponseJSLoad(
  2004  		js.Pointer(p), js.False, ref,
  2005  	)
  2006  }
  2007  
  2008  // FreeMembers frees fields with heap reference, if recursive is true
  2009  // free all heap references reachable from p.
  2010  func (p *NonRemovableBlockDeviceInfoResponse) FreeMembers(recursive bool) {
  2011  	js.Free(
  2012  		p.DeviceInfos.Ref(),
  2013  	)
  2014  	p.DeviceInfos = p.DeviceInfos.FromRef(js.Undefined)
  2015  }
  2016  
  2017  type NonRemovableBlockDevicesInfoCallbackFunc func(this js.Ref, deviceInfoResponse *NonRemovableBlockDeviceInfoResponse) js.Ref
  2018  
  2019  func (fn NonRemovableBlockDevicesInfoCallbackFunc) Register() js.Func[func(deviceInfoResponse *NonRemovableBlockDeviceInfoResponse)] {
  2020  	return js.RegisterCallback[func(deviceInfoResponse *NonRemovableBlockDeviceInfoResponse)](
  2021  		fn, abi.FuncPCABIInternal(fn),
  2022  	)
  2023  }
  2024  
  2025  func (fn NonRemovableBlockDevicesInfoCallbackFunc) DispatchCallback(
  2026  	targetPC uintptr, ctx *js.CallbackContext,
  2027  ) {
  2028  	args := ctx.Args()
  2029  	if len(args) != 1+1 /* js this */ ||
  2030  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  2031  		js.ThrowInvalidCallbackInvocation()
  2032  	}
  2033  	var arg0 NonRemovableBlockDeviceInfoResponse
  2034  	arg0.UpdateFrom(args[0+1])
  2035  	defer arg0.FreeMembers(true)
  2036  
  2037  	if ctx.Return(fn(
  2038  		args[0],
  2039  
  2040  		mark.NoEscape(&arg0),
  2041  	)) {
  2042  		return
  2043  	}
  2044  
  2045  	js.ThrowCallbackValueNotReturned()
  2046  }
  2047  
  2048  type NonRemovableBlockDevicesInfoCallback[T any] struct {
  2049  	Fn  func(arg T, this js.Ref, deviceInfoResponse *NonRemovableBlockDeviceInfoResponse) js.Ref
  2050  	Arg T
  2051  }
  2052  
  2053  func (cb *NonRemovableBlockDevicesInfoCallback[T]) Register() js.Func[func(deviceInfoResponse *NonRemovableBlockDeviceInfoResponse)] {
  2054  	return js.RegisterCallback[func(deviceInfoResponse *NonRemovableBlockDeviceInfoResponse)](
  2055  		cb, abi.FuncPCABIInternal(cb.Fn),
  2056  	)
  2057  }
  2058  
  2059  func (cb *NonRemovableBlockDevicesInfoCallback[T]) DispatchCallback(
  2060  	targetPC uintptr, ctx *js.CallbackContext,
  2061  ) {
  2062  	args := ctx.Args()
  2063  	if len(args) != 1+1 /* js this */ ||
  2064  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  2065  		js.ThrowInvalidCallbackInvocation()
  2066  	}
  2067  	var arg0 NonRemovableBlockDeviceInfoResponse
  2068  	arg0.UpdateFrom(args[0+1])
  2069  	defer arg0.FreeMembers(true)
  2070  
  2071  	if ctx.Return(cb.Fn(
  2072  		cb.Arg,
  2073  		args[0],
  2074  
  2075  		mark.NoEscape(&arg0),
  2076  	)) {
  2077  		return
  2078  	}
  2079  
  2080  	js.ThrowCallbackValueNotReturned()
  2081  }
  2082  
  2083  type OemData struct {
  2084  	// OemData is "OemData.oemData"
  2085  	//
  2086  	// Optional
  2087  	OemData js.String
  2088  
  2089  	FFI_USE bool
  2090  }
  2091  
  2092  // FromRef calls UpdateFrom and returns a OemData with all fields set.
  2093  func (p OemData) FromRef(ref js.Ref) OemData {
  2094  	p.UpdateFrom(ref)
  2095  	return p
  2096  }
  2097  
  2098  // New creates a new OemData in the application heap.
  2099  func (p OemData) New() js.Ref {
  2100  	return bindings.OemDataJSLoad(
  2101  		js.Pointer(&p), js.True, 0,
  2102  	)
  2103  }
  2104  
  2105  // UpdateFrom copies value of all fields of the heap object to p.
  2106  func (p *OemData) UpdateFrom(ref js.Ref) {
  2107  	bindings.OemDataJSStore(
  2108  		js.Pointer(p), ref,
  2109  	)
  2110  }
  2111  
  2112  // Update writes all fields of the p to the heap object referenced by ref.
  2113  func (p *OemData) Update(ref js.Ref) {
  2114  	bindings.OemDataJSLoad(
  2115  		js.Pointer(p), js.False, ref,
  2116  	)
  2117  }
  2118  
  2119  // FreeMembers frees fields with heap reference, if recursive is true
  2120  // free all heap references reachable from p.
  2121  func (p *OemData) FreeMembers(recursive bool) {
  2122  	js.Free(
  2123  		p.OemData.Ref(),
  2124  	)
  2125  	p.OemData = p.OemData.FromRef(js.Undefined)
  2126  }
  2127  
  2128  type OemDataCallbackFunc func(this js.Ref, oemData *OemData) js.Ref
  2129  
  2130  func (fn OemDataCallbackFunc) Register() js.Func[func(oemData *OemData)] {
  2131  	return js.RegisterCallback[func(oemData *OemData)](
  2132  		fn, abi.FuncPCABIInternal(fn),
  2133  	)
  2134  }
  2135  
  2136  func (fn OemDataCallbackFunc) DispatchCallback(
  2137  	targetPC uintptr, ctx *js.CallbackContext,
  2138  ) {
  2139  	args := ctx.Args()
  2140  	if len(args) != 1+1 /* js this */ ||
  2141  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  2142  		js.ThrowInvalidCallbackInvocation()
  2143  	}
  2144  	var arg0 OemData
  2145  	arg0.UpdateFrom(args[0+1])
  2146  	defer arg0.FreeMembers(true)
  2147  
  2148  	if ctx.Return(fn(
  2149  		args[0],
  2150  
  2151  		mark.NoEscape(&arg0),
  2152  	)) {
  2153  		return
  2154  	}
  2155  
  2156  	js.ThrowCallbackValueNotReturned()
  2157  }
  2158  
  2159  type OemDataCallback[T any] struct {
  2160  	Fn  func(arg T, this js.Ref, oemData *OemData) js.Ref
  2161  	Arg T
  2162  }
  2163  
  2164  func (cb *OemDataCallback[T]) Register() js.Func[func(oemData *OemData)] {
  2165  	return js.RegisterCallback[func(oemData *OemData)](
  2166  		cb, abi.FuncPCABIInternal(cb.Fn),
  2167  	)
  2168  }
  2169  
  2170  func (cb *OemDataCallback[T]) DispatchCallback(
  2171  	targetPC uintptr, ctx *js.CallbackContext,
  2172  ) {
  2173  	args := ctx.Args()
  2174  	if len(args) != 1+1 /* js this */ ||
  2175  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  2176  		js.ThrowInvalidCallbackInvocation()
  2177  	}
  2178  	var arg0 OemData
  2179  	arg0.UpdateFrom(args[0+1])
  2180  	defer arg0.FreeMembers(true)
  2181  
  2182  	if ctx.Return(cb.Fn(
  2183  		cb.Arg,
  2184  		args[0],
  2185  
  2186  		mark.NoEscape(&arg0),
  2187  	)) {
  2188  		return
  2189  	}
  2190  
  2191  	js.ThrowCallbackValueNotReturned()
  2192  }
  2193  
  2194  type OsVersionInfo struct {
  2195  	// ReleaseMilestone is "OsVersionInfo.releaseMilestone"
  2196  	//
  2197  	// Optional
  2198  	ReleaseMilestone js.String
  2199  	// BuildNumber is "OsVersionInfo.buildNumber"
  2200  	//
  2201  	// Optional
  2202  	BuildNumber js.String
  2203  	// PatchNumber is "OsVersionInfo.patchNumber"
  2204  	//
  2205  	// Optional
  2206  	PatchNumber js.String
  2207  	// ReleaseChannel is "OsVersionInfo.releaseChannel"
  2208  	//
  2209  	// Optional
  2210  	ReleaseChannel js.String
  2211  
  2212  	FFI_USE bool
  2213  }
  2214  
  2215  // FromRef calls UpdateFrom and returns a OsVersionInfo with all fields set.
  2216  func (p OsVersionInfo) FromRef(ref js.Ref) OsVersionInfo {
  2217  	p.UpdateFrom(ref)
  2218  	return p
  2219  }
  2220  
  2221  // New creates a new OsVersionInfo in the application heap.
  2222  func (p OsVersionInfo) New() js.Ref {
  2223  	return bindings.OsVersionInfoJSLoad(
  2224  		js.Pointer(&p), js.True, 0,
  2225  	)
  2226  }
  2227  
  2228  // UpdateFrom copies value of all fields of the heap object to p.
  2229  func (p *OsVersionInfo) UpdateFrom(ref js.Ref) {
  2230  	bindings.OsVersionInfoJSStore(
  2231  		js.Pointer(p), ref,
  2232  	)
  2233  }
  2234  
  2235  // Update writes all fields of the p to the heap object referenced by ref.
  2236  func (p *OsVersionInfo) Update(ref js.Ref) {
  2237  	bindings.OsVersionInfoJSLoad(
  2238  		js.Pointer(p), js.False, ref,
  2239  	)
  2240  }
  2241  
  2242  // FreeMembers frees fields with heap reference, if recursive is true
  2243  // free all heap references reachable from p.
  2244  func (p *OsVersionInfo) FreeMembers(recursive bool) {
  2245  	js.Free(
  2246  		p.ReleaseMilestone.Ref(),
  2247  		p.BuildNumber.Ref(),
  2248  		p.PatchNumber.Ref(),
  2249  		p.ReleaseChannel.Ref(),
  2250  	)
  2251  	p.ReleaseMilestone = p.ReleaseMilestone.FromRef(js.Undefined)
  2252  	p.BuildNumber = p.BuildNumber.FromRef(js.Undefined)
  2253  	p.PatchNumber = p.PatchNumber.FromRef(js.Undefined)
  2254  	p.ReleaseChannel = p.ReleaseChannel.FromRef(js.Undefined)
  2255  }
  2256  
  2257  type OsVersionInfoCallbackFunc func(this js.Ref, osVersionInfo *OsVersionInfo) js.Ref
  2258  
  2259  func (fn OsVersionInfoCallbackFunc) Register() js.Func[func(osVersionInfo *OsVersionInfo)] {
  2260  	return js.RegisterCallback[func(osVersionInfo *OsVersionInfo)](
  2261  		fn, abi.FuncPCABIInternal(fn),
  2262  	)
  2263  }
  2264  
  2265  func (fn OsVersionInfoCallbackFunc) DispatchCallback(
  2266  	targetPC uintptr, ctx *js.CallbackContext,
  2267  ) {
  2268  	args := ctx.Args()
  2269  	if len(args) != 1+1 /* js this */ ||
  2270  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  2271  		js.ThrowInvalidCallbackInvocation()
  2272  	}
  2273  	var arg0 OsVersionInfo
  2274  	arg0.UpdateFrom(args[0+1])
  2275  	defer arg0.FreeMembers(true)
  2276  
  2277  	if ctx.Return(fn(
  2278  		args[0],
  2279  
  2280  		mark.NoEscape(&arg0),
  2281  	)) {
  2282  		return
  2283  	}
  2284  
  2285  	js.ThrowCallbackValueNotReturned()
  2286  }
  2287  
  2288  type OsVersionInfoCallback[T any] struct {
  2289  	Fn  func(arg T, this js.Ref, osVersionInfo *OsVersionInfo) js.Ref
  2290  	Arg T
  2291  }
  2292  
  2293  func (cb *OsVersionInfoCallback[T]) Register() js.Func[func(osVersionInfo *OsVersionInfo)] {
  2294  	return js.RegisterCallback[func(osVersionInfo *OsVersionInfo)](
  2295  		cb, abi.FuncPCABIInternal(cb.Fn),
  2296  	)
  2297  }
  2298  
  2299  func (cb *OsVersionInfoCallback[T]) DispatchCallback(
  2300  	targetPC uintptr, ctx *js.CallbackContext,
  2301  ) {
  2302  	args := ctx.Args()
  2303  	if len(args) != 1+1 /* js this */ ||
  2304  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  2305  		js.ThrowInvalidCallbackInvocation()
  2306  	}
  2307  	var arg0 OsVersionInfo
  2308  	arg0.UpdateFrom(args[0+1])
  2309  	defer arg0.FreeMembers(true)
  2310  
  2311  	if ctx.Return(cb.Fn(
  2312  		cb.Arg,
  2313  		args[0],
  2314  
  2315  		mark.NoEscape(&arg0),
  2316  	)) {
  2317  		return
  2318  	}
  2319  
  2320  	js.ThrowCallbackValueNotReturned()
  2321  }
  2322  
  2323  type StatefulPartitionInfo struct {
  2324  	// AvailableSpace is "StatefulPartitionInfo.availableSpace"
  2325  	//
  2326  	// Optional
  2327  	//
  2328  	// NOTE: FFI_USE_AvailableSpace MUST be set to true to make this field effective.
  2329  	AvailableSpace float64
  2330  	// TotalSpace is "StatefulPartitionInfo.totalSpace"
  2331  	//
  2332  	// Optional
  2333  	//
  2334  	// NOTE: FFI_USE_TotalSpace MUST be set to true to make this field effective.
  2335  	TotalSpace float64
  2336  
  2337  	FFI_USE_AvailableSpace bool // for AvailableSpace.
  2338  	FFI_USE_TotalSpace     bool // for TotalSpace.
  2339  
  2340  	FFI_USE bool
  2341  }
  2342  
  2343  // FromRef calls UpdateFrom and returns a StatefulPartitionInfo with all fields set.
  2344  func (p StatefulPartitionInfo) FromRef(ref js.Ref) StatefulPartitionInfo {
  2345  	p.UpdateFrom(ref)
  2346  	return p
  2347  }
  2348  
  2349  // New creates a new StatefulPartitionInfo in the application heap.
  2350  func (p StatefulPartitionInfo) New() js.Ref {
  2351  	return bindings.StatefulPartitionInfoJSLoad(
  2352  		js.Pointer(&p), js.True, 0,
  2353  	)
  2354  }
  2355  
  2356  // UpdateFrom copies value of all fields of the heap object to p.
  2357  func (p *StatefulPartitionInfo) UpdateFrom(ref js.Ref) {
  2358  	bindings.StatefulPartitionInfoJSStore(
  2359  		js.Pointer(p), ref,
  2360  	)
  2361  }
  2362  
  2363  // Update writes all fields of the p to the heap object referenced by ref.
  2364  func (p *StatefulPartitionInfo) Update(ref js.Ref) {
  2365  	bindings.StatefulPartitionInfoJSLoad(
  2366  		js.Pointer(p), js.False, ref,
  2367  	)
  2368  }
  2369  
  2370  // FreeMembers frees fields with heap reference, if recursive is true
  2371  // free all heap references reachable from p.
  2372  func (p *StatefulPartitionInfo) FreeMembers(recursive bool) {
  2373  }
  2374  
  2375  type StatefulPartitionInfoCallbackFunc func(this js.Ref, statefulPartitionInfo *StatefulPartitionInfo) js.Ref
  2376  
  2377  func (fn StatefulPartitionInfoCallbackFunc) Register() js.Func[func(statefulPartitionInfo *StatefulPartitionInfo)] {
  2378  	return js.RegisterCallback[func(statefulPartitionInfo *StatefulPartitionInfo)](
  2379  		fn, abi.FuncPCABIInternal(fn),
  2380  	)
  2381  }
  2382  
  2383  func (fn StatefulPartitionInfoCallbackFunc) DispatchCallback(
  2384  	targetPC uintptr, ctx *js.CallbackContext,
  2385  ) {
  2386  	args := ctx.Args()
  2387  	if len(args) != 1+1 /* js this */ ||
  2388  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  2389  		js.ThrowInvalidCallbackInvocation()
  2390  	}
  2391  	var arg0 StatefulPartitionInfo
  2392  	arg0.UpdateFrom(args[0+1])
  2393  	defer arg0.FreeMembers(true)
  2394  
  2395  	if ctx.Return(fn(
  2396  		args[0],
  2397  
  2398  		mark.NoEscape(&arg0),
  2399  	)) {
  2400  		return
  2401  	}
  2402  
  2403  	js.ThrowCallbackValueNotReturned()
  2404  }
  2405  
  2406  type StatefulPartitionInfoCallback[T any] struct {
  2407  	Fn  func(arg T, this js.Ref, statefulPartitionInfo *StatefulPartitionInfo) js.Ref
  2408  	Arg T
  2409  }
  2410  
  2411  func (cb *StatefulPartitionInfoCallback[T]) Register() js.Func[func(statefulPartitionInfo *StatefulPartitionInfo)] {
  2412  	return js.RegisterCallback[func(statefulPartitionInfo *StatefulPartitionInfo)](
  2413  		cb, abi.FuncPCABIInternal(cb.Fn),
  2414  	)
  2415  }
  2416  
  2417  func (cb *StatefulPartitionInfoCallback[T]) DispatchCallback(
  2418  	targetPC uintptr, ctx *js.CallbackContext,
  2419  ) {
  2420  	args := ctx.Args()
  2421  	if len(args) != 1+1 /* js this */ ||
  2422  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  2423  		js.ThrowInvalidCallbackInvocation()
  2424  	}
  2425  	var arg0 StatefulPartitionInfo
  2426  	arg0.UpdateFrom(args[0+1])
  2427  	defer arg0.FreeMembers(true)
  2428  
  2429  	if ctx.Return(cb.Fn(
  2430  		cb.Arg,
  2431  		args[0],
  2432  
  2433  		mark.NoEscape(&arg0),
  2434  	)) {
  2435  		return
  2436  	}
  2437  
  2438  	js.ThrowCallbackValueNotReturned()
  2439  }
  2440  
  2441  type TpmDictionaryAttack struct {
  2442  	// Counter is "TpmDictionaryAttack.counter"
  2443  	//
  2444  	// Optional
  2445  	//
  2446  	// NOTE: FFI_USE_Counter MUST be set to true to make this field effective.
  2447  	Counter int32
  2448  	// Threshold is "TpmDictionaryAttack.threshold"
  2449  	//
  2450  	// Optional
  2451  	//
  2452  	// NOTE: FFI_USE_Threshold MUST be set to true to make this field effective.
  2453  	Threshold int32
  2454  	// LockoutInEffect is "TpmDictionaryAttack.lockoutInEffect"
  2455  	//
  2456  	// Optional
  2457  	//
  2458  	// NOTE: FFI_USE_LockoutInEffect MUST be set to true to make this field effective.
  2459  	LockoutInEffect bool
  2460  	// LockoutSecondsRemaining is "TpmDictionaryAttack.lockoutSecondsRemaining"
  2461  	//
  2462  	// Optional
  2463  	//
  2464  	// NOTE: FFI_USE_LockoutSecondsRemaining MUST be set to true to make this field effective.
  2465  	LockoutSecondsRemaining int32
  2466  
  2467  	FFI_USE_Counter                 bool // for Counter.
  2468  	FFI_USE_Threshold               bool // for Threshold.
  2469  	FFI_USE_LockoutInEffect         bool // for LockoutInEffect.
  2470  	FFI_USE_LockoutSecondsRemaining bool // for LockoutSecondsRemaining.
  2471  
  2472  	FFI_USE bool
  2473  }
  2474  
  2475  // FromRef calls UpdateFrom and returns a TpmDictionaryAttack with all fields set.
  2476  func (p TpmDictionaryAttack) FromRef(ref js.Ref) TpmDictionaryAttack {
  2477  	p.UpdateFrom(ref)
  2478  	return p
  2479  }
  2480  
  2481  // New creates a new TpmDictionaryAttack in the application heap.
  2482  func (p TpmDictionaryAttack) New() js.Ref {
  2483  	return bindings.TpmDictionaryAttackJSLoad(
  2484  		js.Pointer(&p), js.True, 0,
  2485  	)
  2486  }
  2487  
  2488  // UpdateFrom copies value of all fields of the heap object to p.
  2489  func (p *TpmDictionaryAttack) UpdateFrom(ref js.Ref) {
  2490  	bindings.TpmDictionaryAttackJSStore(
  2491  		js.Pointer(p), ref,
  2492  	)
  2493  }
  2494  
  2495  // Update writes all fields of the p to the heap object referenced by ref.
  2496  func (p *TpmDictionaryAttack) Update(ref js.Ref) {
  2497  	bindings.TpmDictionaryAttackJSLoad(
  2498  		js.Pointer(p), js.False, ref,
  2499  	)
  2500  }
  2501  
  2502  // FreeMembers frees fields with heap reference, if recursive is true
  2503  // free all heap references reachable from p.
  2504  func (p *TpmDictionaryAttack) FreeMembers(recursive bool) {
  2505  }
  2506  
  2507  type TpmGSCVersion uint32
  2508  
  2509  const (
  2510  	_ TpmGSCVersion = iota
  2511  
  2512  	TpmGSCVersion_NOT_GSC
  2513  	TpmGSCVersion_CR50
  2514  	TpmGSCVersion_TI50
  2515  )
  2516  
  2517  func (TpmGSCVersion) FromRef(str js.Ref) TpmGSCVersion {
  2518  	return TpmGSCVersion(bindings.ConstOfTpmGSCVersion(str))
  2519  }
  2520  
  2521  func (x TpmGSCVersion) String() (string, bool) {
  2522  	switch x {
  2523  	case TpmGSCVersion_NOT_GSC:
  2524  		return "not_gsc", true
  2525  	case TpmGSCVersion_CR50:
  2526  		return "cr50", true
  2527  	case TpmGSCVersion_TI50:
  2528  		return "ti50", true
  2529  	default:
  2530  		return "", false
  2531  	}
  2532  }
  2533  
  2534  type TpmVersion struct {
  2535  	// GscVersion is "TpmVersion.gscVersion"
  2536  	//
  2537  	// Optional
  2538  	GscVersion TpmGSCVersion
  2539  	// Family is "TpmVersion.family"
  2540  	//
  2541  	// Optional
  2542  	//
  2543  	// NOTE: FFI_USE_Family MUST be set to true to make this field effective.
  2544  	Family int32
  2545  	// SpecLevel is "TpmVersion.specLevel"
  2546  	//
  2547  	// Optional
  2548  	//
  2549  	// NOTE: FFI_USE_SpecLevel MUST be set to true to make this field effective.
  2550  	SpecLevel float64
  2551  	// Manufacturer is "TpmVersion.manufacturer"
  2552  	//
  2553  	// Optional
  2554  	//
  2555  	// NOTE: FFI_USE_Manufacturer MUST be set to true to make this field effective.
  2556  	Manufacturer int32
  2557  	// TpmModel is "TpmVersion.tpmModel"
  2558  	//
  2559  	// Optional
  2560  	//
  2561  	// NOTE: FFI_USE_TpmModel MUST be set to true to make this field effective.
  2562  	TpmModel int32
  2563  	// FirmwareVersion is "TpmVersion.firmwareVersion"
  2564  	//
  2565  	// Optional
  2566  	//
  2567  	// NOTE: FFI_USE_FirmwareVersion MUST be set to true to make this field effective.
  2568  	FirmwareVersion float64
  2569  	// VendorSpecific is "TpmVersion.vendorSpecific"
  2570  	//
  2571  	// Optional
  2572  	VendorSpecific js.String
  2573  
  2574  	FFI_USE_Family          bool // for Family.
  2575  	FFI_USE_SpecLevel       bool // for SpecLevel.
  2576  	FFI_USE_Manufacturer    bool // for Manufacturer.
  2577  	FFI_USE_TpmModel        bool // for TpmModel.
  2578  	FFI_USE_FirmwareVersion bool // for FirmwareVersion.
  2579  
  2580  	FFI_USE bool
  2581  }
  2582  
  2583  // FromRef calls UpdateFrom and returns a TpmVersion with all fields set.
  2584  func (p TpmVersion) FromRef(ref js.Ref) TpmVersion {
  2585  	p.UpdateFrom(ref)
  2586  	return p
  2587  }
  2588  
  2589  // New creates a new TpmVersion in the application heap.
  2590  func (p TpmVersion) New() js.Ref {
  2591  	return bindings.TpmVersionJSLoad(
  2592  		js.Pointer(&p), js.True, 0,
  2593  	)
  2594  }
  2595  
  2596  // UpdateFrom copies value of all fields of the heap object to p.
  2597  func (p *TpmVersion) UpdateFrom(ref js.Ref) {
  2598  	bindings.TpmVersionJSStore(
  2599  		js.Pointer(p), ref,
  2600  	)
  2601  }
  2602  
  2603  // Update writes all fields of the p to the heap object referenced by ref.
  2604  func (p *TpmVersion) Update(ref js.Ref) {
  2605  	bindings.TpmVersionJSLoad(
  2606  		js.Pointer(p), js.False, ref,
  2607  	)
  2608  }
  2609  
  2610  // FreeMembers frees fields with heap reference, if recursive is true
  2611  // free all heap references reachable from p.
  2612  func (p *TpmVersion) FreeMembers(recursive bool) {
  2613  	js.Free(
  2614  		p.VendorSpecific.Ref(),
  2615  	)
  2616  	p.VendorSpecific = p.VendorSpecific.FromRef(js.Undefined)
  2617  }
  2618  
  2619  type TpmStatus struct {
  2620  	// Enabled is "TpmStatus.enabled"
  2621  	//
  2622  	// Optional
  2623  	//
  2624  	// NOTE: FFI_USE_Enabled MUST be set to true to make this field effective.
  2625  	Enabled bool
  2626  	// Owned is "TpmStatus.owned"
  2627  	//
  2628  	// Optional
  2629  	//
  2630  	// NOTE: FFI_USE_Owned MUST be set to true to make this field effective.
  2631  	Owned bool
  2632  	// OwnerPasswordIsPresent is "TpmStatus.ownerPasswordIsPresent"
  2633  	//
  2634  	// Optional
  2635  	//
  2636  	// NOTE: FFI_USE_OwnerPasswordIsPresent MUST be set to true to make this field effective.
  2637  	OwnerPasswordIsPresent bool
  2638  
  2639  	FFI_USE_Enabled                bool // for Enabled.
  2640  	FFI_USE_Owned                  bool // for Owned.
  2641  	FFI_USE_OwnerPasswordIsPresent bool // for OwnerPasswordIsPresent.
  2642  
  2643  	FFI_USE bool
  2644  }
  2645  
  2646  // FromRef calls UpdateFrom and returns a TpmStatus with all fields set.
  2647  func (p TpmStatus) FromRef(ref js.Ref) TpmStatus {
  2648  	p.UpdateFrom(ref)
  2649  	return p
  2650  }
  2651  
  2652  // New creates a new TpmStatus in the application heap.
  2653  func (p TpmStatus) New() js.Ref {
  2654  	return bindings.TpmStatusJSLoad(
  2655  		js.Pointer(&p), js.True, 0,
  2656  	)
  2657  }
  2658  
  2659  // UpdateFrom copies value of all fields of the heap object to p.
  2660  func (p *TpmStatus) UpdateFrom(ref js.Ref) {
  2661  	bindings.TpmStatusJSStore(
  2662  		js.Pointer(p), ref,
  2663  	)
  2664  }
  2665  
  2666  // Update writes all fields of the p to the heap object referenced by ref.
  2667  func (p *TpmStatus) Update(ref js.Ref) {
  2668  	bindings.TpmStatusJSLoad(
  2669  		js.Pointer(p), js.False, ref,
  2670  	)
  2671  }
  2672  
  2673  // FreeMembers frees fields with heap reference, if recursive is true
  2674  // free all heap references reachable from p.
  2675  func (p *TpmStatus) FreeMembers(recursive bool) {
  2676  }
  2677  
  2678  type TpmInfo struct {
  2679  	// Version is "TpmInfo.version"
  2680  	//
  2681  	// Optional
  2682  	//
  2683  	// NOTE: Version.FFI_USE MUST be set to true to get Version used.
  2684  	Version TpmVersion
  2685  	// Status is "TpmInfo.status"
  2686  	//
  2687  	// Optional
  2688  	//
  2689  	// NOTE: Status.FFI_USE MUST be set to true to get Status used.
  2690  	Status TpmStatus
  2691  	// DictionaryAttack is "TpmInfo.dictionaryAttack"
  2692  	//
  2693  	// Optional
  2694  	//
  2695  	// NOTE: DictionaryAttack.FFI_USE MUST be set to true to get DictionaryAttack used.
  2696  	DictionaryAttack TpmDictionaryAttack
  2697  
  2698  	FFI_USE bool
  2699  }
  2700  
  2701  // FromRef calls UpdateFrom and returns a TpmInfo with all fields set.
  2702  func (p TpmInfo) FromRef(ref js.Ref) TpmInfo {
  2703  	p.UpdateFrom(ref)
  2704  	return p
  2705  }
  2706  
  2707  // New creates a new TpmInfo in the application heap.
  2708  func (p TpmInfo) New() js.Ref {
  2709  	return bindings.TpmInfoJSLoad(
  2710  		js.Pointer(&p), js.True, 0,
  2711  	)
  2712  }
  2713  
  2714  // UpdateFrom copies value of all fields of the heap object to p.
  2715  func (p *TpmInfo) UpdateFrom(ref js.Ref) {
  2716  	bindings.TpmInfoJSStore(
  2717  		js.Pointer(p), ref,
  2718  	)
  2719  }
  2720  
  2721  // Update writes all fields of the p to the heap object referenced by ref.
  2722  func (p *TpmInfo) Update(ref js.Ref) {
  2723  	bindings.TpmInfoJSLoad(
  2724  		js.Pointer(p), js.False, ref,
  2725  	)
  2726  }
  2727  
  2728  // FreeMembers frees fields with heap reference, if recursive is true
  2729  // free all heap references reachable from p.
  2730  func (p *TpmInfo) FreeMembers(recursive bool) {
  2731  	if recursive {
  2732  		p.Version.FreeMembers(true)
  2733  		p.Status.FreeMembers(true)
  2734  		p.DictionaryAttack.FreeMembers(true)
  2735  	}
  2736  }
  2737  
  2738  type TpmInfoCallbackFunc func(this js.Ref, tpmInfo *TpmInfo) js.Ref
  2739  
  2740  func (fn TpmInfoCallbackFunc) Register() js.Func[func(tpmInfo *TpmInfo)] {
  2741  	return js.RegisterCallback[func(tpmInfo *TpmInfo)](
  2742  		fn, abi.FuncPCABIInternal(fn),
  2743  	)
  2744  }
  2745  
  2746  func (fn TpmInfoCallbackFunc) DispatchCallback(
  2747  	targetPC uintptr, ctx *js.CallbackContext,
  2748  ) {
  2749  	args := ctx.Args()
  2750  	if len(args) != 1+1 /* js this */ ||
  2751  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  2752  		js.ThrowInvalidCallbackInvocation()
  2753  	}
  2754  	var arg0 TpmInfo
  2755  	arg0.UpdateFrom(args[0+1])
  2756  	defer arg0.FreeMembers(true)
  2757  
  2758  	if ctx.Return(fn(
  2759  		args[0],
  2760  
  2761  		mark.NoEscape(&arg0),
  2762  	)) {
  2763  		return
  2764  	}
  2765  
  2766  	js.ThrowCallbackValueNotReturned()
  2767  }
  2768  
  2769  type TpmInfoCallback[T any] struct {
  2770  	Fn  func(arg T, this js.Ref, tpmInfo *TpmInfo) js.Ref
  2771  	Arg T
  2772  }
  2773  
  2774  func (cb *TpmInfoCallback[T]) Register() js.Func[func(tpmInfo *TpmInfo)] {
  2775  	return js.RegisterCallback[func(tpmInfo *TpmInfo)](
  2776  		cb, abi.FuncPCABIInternal(cb.Fn),
  2777  	)
  2778  }
  2779  
  2780  func (cb *TpmInfoCallback[T]) DispatchCallback(
  2781  	targetPC uintptr, ctx *js.CallbackContext,
  2782  ) {
  2783  	args := ctx.Args()
  2784  	if len(args) != 1+1 /* js this */ ||
  2785  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  2786  		js.ThrowInvalidCallbackInvocation()
  2787  	}
  2788  	var arg0 TpmInfo
  2789  	arg0.UpdateFrom(args[0+1])
  2790  	defer arg0.FreeMembers(true)
  2791  
  2792  	if ctx.Return(cb.Fn(
  2793  		cb.Arg,
  2794  		args[0],
  2795  
  2796  		mark.NoEscape(&arg0),
  2797  	)) {
  2798  		return
  2799  	}
  2800  
  2801  	js.ThrowCallbackValueNotReturned()
  2802  }
  2803  
  2804  type UsbBusInterfaceInfo struct {
  2805  	// InterfaceNumber is "UsbBusInterfaceInfo.interfaceNumber"
  2806  	//
  2807  	// Optional
  2808  	//
  2809  	// NOTE: FFI_USE_InterfaceNumber MUST be set to true to make this field effective.
  2810  	InterfaceNumber float64
  2811  	// ClassId is "UsbBusInterfaceInfo.classId"
  2812  	//
  2813  	// Optional
  2814  	//
  2815  	// NOTE: FFI_USE_ClassId MUST be set to true to make this field effective.
  2816  	ClassId float64
  2817  	// SubclassId is "UsbBusInterfaceInfo.subclassId"
  2818  	//
  2819  	// Optional
  2820  	//
  2821  	// NOTE: FFI_USE_SubclassId MUST be set to true to make this field effective.
  2822  	SubclassId float64
  2823  	// ProtocolId is "UsbBusInterfaceInfo.protocolId"
  2824  	//
  2825  	// Optional
  2826  	//
  2827  	// NOTE: FFI_USE_ProtocolId MUST be set to true to make this field effective.
  2828  	ProtocolId float64
  2829  	// Driver is "UsbBusInterfaceInfo.driver"
  2830  	//
  2831  	// Optional
  2832  	Driver js.String
  2833  
  2834  	FFI_USE_InterfaceNumber bool // for InterfaceNumber.
  2835  	FFI_USE_ClassId         bool // for ClassId.
  2836  	FFI_USE_SubclassId      bool // for SubclassId.
  2837  	FFI_USE_ProtocolId      bool // for ProtocolId.
  2838  
  2839  	FFI_USE bool
  2840  }
  2841  
  2842  // FromRef calls UpdateFrom and returns a UsbBusInterfaceInfo with all fields set.
  2843  func (p UsbBusInterfaceInfo) FromRef(ref js.Ref) UsbBusInterfaceInfo {
  2844  	p.UpdateFrom(ref)
  2845  	return p
  2846  }
  2847  
  2848  // New creates a new UsbBusInterfaceInfo in the application heap.
  2849  func (p UsbBusInterfaceInfo) New() js.Ref {
  2850  	return bindings.UsbBusInterfaceInfoJSLoad(
  2851  		js.Pointer(&p), js.True, 0,
  2852  	)
  2853  }
  2854  
  2855  // UpdateFrom copies value of all fields of the heap object to p.
  2856  func (p *UsbBusInterfaceInfo) UpdateFrom(ref js.Ref) {
  2857  	bindings.UsbBusInterfaceInfoJSStore(
  2858  		js.Pointer(p), ref,
  2859  	)
  2860  }
  2861  
  2862  // Update writes all fields of the p to the heap object referenced by ref.
  2863  func (p *UsbBusInterfaceInfo) Update(ref js.Ref) {
  2864  	bindings.UsbBusInterfaceInfoJSLoad(
  2865  		js.Pointer(p), js.False, ref,
  2866  	)
  2867  }
  2868  
  2869  // FreeMembers frees fields with heap reference, if recursive is true
  2870  // free all heap references reachable from p.
  2871  func (p *UsbBusInterfaceInfo) FreeMembers(recursive bool) {
  2872  	js.Free(
  2873  		p.Driver.Ref(),
  2874  	)
  2875  	p.Driver = p.Driver.FromRef(js.Undefined)
  2876  }
  2877  
  2878  type UsbVersion uint32
  2879  
  2880  const (
  2881  	_ UsbVersion = iota
  2882  
  2883  	UsbVersion_UNKNOWN
  2884  	UsbVersion_USB1
  2885  	UsbVersion_USB2
  2886  	UsbVersion_USB3
  2887  )
  2888  
  2889  func (UsbVersion) FromRef(str js.Ref) UsbVersion {
  2890  	return UsbVersion(bindings.ConstOfUsbVersion(str))
  2891  }
  2892  
  2893  func (x UsbVersion) String() (string, bool) {
  2894  	switch x {
  2895  	case UsbVersion_UNKNOWN:
  2896  		return "unknown", true
  2897  	case UsbVersion_USB1:
  2898  		return "usb1", true
  2899  	case UsbVersion_USB2:
  2900  		return "usb2", true
  2901  	case UsbVersion_USB3:
  2902  		return "usb3", true
  2903  	default:
  2904  		return "", false
  2905  	}
  2906  }
  2907  
  2908  type UsbSpecSpeed uint32
  2909  
  2910  const (
  2911  	_ UsbSpecSpeed = iota
  2912  
  2913  	UsbSpecSpeed_UNKNOWN
  2914  	UsbSpecSpeed_N1_5_MBPS
  2915  	UsbSpecSpeed_N12_MBPS
  2916  	UsbSpecSpeed_N480_MBPS
  2917  	UsbSpecSpeed_N5_GBPS
  2918  	UsbSpecSpeed_N10_GBPS
  2919  	UsbSpecSpeed_N20_GBPS
  2920  )
  2921  
  2922  func (UsbSpecSpeed) FromRef(str js.Ref) UsbSpecSpeed {
  2923  	return UsbSpecSpeed(bindings.ConstOfUsbSpecSpeed(str))
  2924  }
  2925  
  2926  func (x UsbSpecSpeed) String() (string, bool) {
  2927  	switch x {
  2928  	case UsbSpecSpeed_UNKNOWN:
  2929  		return "unknown", true
  2930  	case UsbSpecSpeed_N1_5_MBPS:
  2931  		return "n1_5Mbps", true
  2932  	case UsbSpecSpeed_N12_MBPS:
  2933  		return "n12Mbps", true
  2934  	case UsbSpecSpeed_N480_MBPS:
  2935  		return "n480Mbps", true
  2936  	case UsbSpecSpeed_N5_GBPS:
  2937  		return "n5Gbps", true
  2938  	case UsbSpecSpeed_N10_GBPS:
  2939  		return "n10Gbps", true
  2940  	case UsbSpecSpeed_N20_GBPS:
  2941  		return "n20Gbps", true
  2942  	default:
  2943  		return "", false
  2944  	}
  2945  }
  2946  
  2947  type UsbBusInfo struct {
  2948  	// ClassId is "UsbBusInfo.classId"
  2949  	//
  2950  	// Optional
  2951  	//
  2952  	// NOTE: FFI_USE_ClassId MUST be set to true to make this field effective.
  2953  	ClassId float64
  2954  	// SubclassId is "UsbBusInfo.subclassId"
  2955  	//
  2956  	// Optional
  2957  	//
  2958  	// NOTE: FFI_USE_SubclassId MUST be set to true to make this field effective.
  2959  	SubclassId float64
  2960  	// ProtocolId is "UsbBusInfo.protocolId"
  2961  	//
  2962  	// Optional
  2963  	//
  2964  	// NOTE: FFI_USE_ProtocolId MUST be set to true to make this field effective.
  2965  	ProtocolId float64
  2966  	// VendorId is "UsbBusInfo.vendorId"
  2967  	//
  2968  	// Optional
  2969  	//
  2970  	// NOTE: FFI_USE_VendorId MUST be set to true to make this field effective.
  2971  	VendorId float64
  2972  	// ProductId is "UsbBusInfo.productId"
  2973  	//
  2974  	// Optional
  2975  	//
  2976  	// NOTE: FFI_USE_ProductId MUST be set to true to make this field effective.
  2977  	ProductId float64
  2978  	// Interfaces is "UsbBusInfo.interfaces"
  2979  	//
  2980  	// Optional
  2981  	Interfaces js.Array[UsbBusInterfaceInfo]
  2982  	// FwupdFirmwareVersionInfo is "UsbBusInfo.fwupdFirmwareVersionInfo"
  2983  	//
  2984  	// Optional
  2985  	//
  2986  	// NOTE: FwupdFirmwareVersionInfo.FFI_USE MUST be set to true to get FwupdFirmwareVersionInfo used.
  2987  	FwupdFirmwareVersionInfo FwupdFirmwareVersionInfo
  2988  	// Version is "UsbBusInfo.version"
  2989  	//
  2990  	// Optional
  2991  	Version UsbVersion
  2992  	// SpecSpeed is "UsbBusInfo.spec_speed"
  2993  	//
  2994  	// Optional
  2995  	SpecSpeed UsbSpecSpeed
  2996  
  2997  	FFI_USE_ClassId    bool // for ClassId.
  2998  	FFI_USE_SubclassId bool // for SubclassId.
  2999  	FFI_USE_ProtocolId bool // for ProtocolId.
  3000  	FFI_USE_VendorId   bool // for VendorId.
  3001  	FFI_USE_ProductId  bool // for ProductId.
  3002  
  3003  	FFI_USE bool
  3004  }
  3005  
  3006  // FromRef calls UpdateFrom and returns a UsbBusInfo with all fields set.
  3007  func (p UsbBusInfo) FromRef(ref js.Ref) UsbBusInfo {
  3008  	p.UpdateFrom(ref)
  3009  	return p
  3010  }
  3011  
  3012  // New creates a new UsbBusInfo in the application heap.
  3013  func (p UsbBusInfo) New() js.Ref {
  3014  	return bindings.UsbBusInfoJSLoad(
  3015  		js.Pointer(&p), js.True, 0,
  3016  	)
  3017  }
  3018  
  3019  // UpdateFrom copies value of all fields of the heap object to p.
  3020  func (p *UsbBusInfo) UpdateFrom(ref js.Ref) {
  3021  	bindings.UsbBusInfoJSStore(
  3022  		js.Pointer(p), ref,
  3023  	)
  3024  }
  3025  
  3026  // Update writes all fields of the p to the heap object referenced by ref.
  3027  func (p *UsbBusInfo) Update(ref js.Ref) {
  3028  	bindings.UsbBusInfoJSLoad(
  3029  		js.Pointer(p), js.False, ref,
  3030  	)
  3031  }
  3032  
  3033  // FreeMembers frees fields with heap reference, if recursive is true
  3034  // free all heap references reachable from p.
  3035  func (p *UsbBusInfo) FreeMembers(recursive bool) {
  3036  	js.Free(
  3037  		p.Interfaces.Ref(),
  3038  	)
  3039  	p.Interfaces = p.Interfaces.FromRef(js.Undefined)
  3040  	if recursive {
  3041  		p.FwupdFirmwareVersionInfo.FreeMembers(true)
  3042  	}
  3043  }
  3044  
  3045  type UsbBusDevices struct {
  3046  	// Devices is "UsbBusDevices.devices"
  3047  	//
  3048  	// Optional
  3049  	Devices js.Array[UsbBusInfo]
  3050  
  3051  	FFI_USE bool
  3052  }
  3053  
  3054  // FromRef calls UpdateFrom and returns a UsbBusDevices with all fields set.
  3055  func (p UsbBusDevices) FromRef(ref js.Ref) UsbBusDevices {
  3056  	p.UpdateFrom(ref)
  3057  	return p
  3058  }
  3059  
  3060  // New creates a new UsbBusDevices in the application heap.
  3061  func (p UsbBusDevices) New() js.Ref {
  3062  	return bindings.UsbBusDevicesJSLoad(
  3063  		js.Pointer(&p), js.True, 0,
  3064  	)
  3065  }
  3066  
  3067  // UpdateFrom copies value of all fields of the heap object to p.
  3068  func (p *UsbBusDevices) UpdateFrom(ref js.Ref) {
  3069  	bindings.UsbBusDevicesJSStore(
  3070  		js.Pointer(p), ref,
  3071  	)
  3072  }
  3073  
  3074  // Update writes all fields of the p to the heap object referenced by ref.
  3075  func (p *UsbBusDevices) Update(ref js.Ref) {
  3076  	bindings.UsbBusDevicesJSLoad(
  3077  		js.Pointer(p), js.False, ref,
  3078  	)
  3079  }
  3080  
  3081  // FreeMembers frees fields with heap reference, if recursive is true
  3082  // free all heap references reachable from p.
  3083  func (p *UsbBusDevices) FreeMembers(recursive bool) {
  3084  	js.Free(
  3085  		p.Devices.Ref(),
  3086  	)
  3087  	p.Devices = p.Devices.FromRef(js.Undefined)
  3088  }
  3089  
  3090  type UsbBusDevicesCallbackFunc func(this js.Ref, UsbBusDevices *UsbBusDevices) js.Ref
  3091  
  3092  func (fn UsbBusDevicesCallbackFunc) Register() js.Func[func(UsbBusDevices *UsbBusDevices)] {
  3093  	return js.RegisterCallback[func(UsbBusDevices *UsbBusDevices)](
  3094  		fn, abi.FuncPCABIInternal(fn),
  3095  	)
  3096  }
  3097  
  3098  func (fn UsbBusDevicesCallbackFunc) DispatchCallback(
  3099  	targetPC uintptr, ctx *js.CallbackContext,
  3100  ) {
  3101  	args := ctx.Args()
  3102  	if len(args) != 1+1 /* js this */ ||
  3103  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  3104  		js.ThrowInvalidCallbackInvocation()
  3105  	}
  3106  	var arg0 UsbBusDevices
  3107  	arg0.UpdateFrom(args[0+1])
  3108  	defer arg0.FreeMembers(true)
  3109  
  3110  	if ctx.Return(fn(
  3111  		args[0],
  3112  
  3113  		mark.NoEscape(&arg0),
  3114  	)) {
  3115  		return
  3116  	}
  3117  
  3118  	js.ThrowCallbackValueNotReturned()
  3119  }
  3120  
  3121  type UsbBusDevicesCallback[T any] struct {
  3122  	Fn  func(arg T, this js.Ref, UsbBusDevices *UsbBusDevices) js.Ref
  3123  	Arg T
  3124  }
  3125  
  3126  func (cb *UsbBusDevicesCallback[T]) Register() js.Func[func(UsbBusDevices *UsbBusDevices)] {
  3127  	return js.RegisterCallback[func(UsbBusDevices *UsbBusDevices)](
  3128  		cb, abi.FuncPCABIInternal(cb.Fn),
  3129  	)
  3130  }
  3131  
  3132  func (cb *UsbBusDevicesCallback[T]) DispatchCallback(
  3133  	targetPC uintptr, ctx *js.CallbackContext,
  3134  ) {
  3135  	args := ctx.Args()
  3136  	if len(args) != 1+1 /* js this */ ||
  3137  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  3138  		js.ThrowInvalidCallbackInvocation()
  3139  	}
  3140  	var arg0 UsbBusDevices
  3141  	arg0.UpdateFrom(args[0+1])
  3142  	defer arg0.FreeMembers(true)
  3143  
  3144  	if ctx.Return(cb.Fn(
  3145  		cb.Arg,
  3146  		args[0],
  3147  
  3148  		mark.NoEscape(&arg0),
  3149  	)) {
  3150  		return
  3151  	}
  3152  
  3153  	js.ThrowCallbackValueNotReturned()
  3154  }
  3155  
  3156  type VpdInfo struct {
  3157  	// ActivateDate is "VpdInfo.activateDate"
  3158  	//
  3159  	// Optional
  3160  	ActivateDate js.String
  3161  	// ModelName is "VpdInfo.modelName"
  3162  	//
  3163  	// Optional
  3164  	ModelName js.String
  3165  	// SerialNumber is "VpdInfo.serialNumber"
  3166  	//
  3167  	// Optional
  3168  	SerialNumber js.String
  3169  	// SkuNumber is "VpdInfo.skuNumber"
  3170  	//
  3171  	// Optional
  3172  	SkuNumber js.String
  3173  
  3174  	FFI_USE bool
  3175  }
  3176  
  3177  // FromRef calls UpdateFrom and returns a VpdInfo with all fields set.
  3178  func (p VpdInfo) FromRef(ref js.Ref) VpdInfo {
  3179  	p.UpdateFrom(ref)
  3180  	return p
  3181  }
  3182  
  3183  // New creates a new VpdInfo in the application heap.
  3184  func (p VpdInfo) New() js.Ref {
  3185  	return bindings.VpdInfoJSLoad(
  3186  		js.Pointer(&p), js.True, 0,
  3187  	)
  3188  }
  3189  
  3190  // UpdateFrom copies value of all fields of the heap object to p.
  3191  func (p *VpdInfo) UpdateFrom(ref js.Ref) {
  3192  	bindings.VpdInfoJSStore(
  3193  		js.Pointer(p), ref,
  3194  	)
  3195  }
  3196  
  3197  // Update writes all fields of the p to the heap object referenced by ref.
  3198  func (p *VpdInfo) Update(ref js.Ref) {
  3199  	bindings.VpdInfoJSLoad(
  3200  		js.Pointer(p), js.False, ref,
  3201  	)
  3202  }
  3203  
  3204  // FreeMembers frees fields with heap reference, if recursive is true
  3205  // free all heap references reachable from p.
  3206  func (p *VpdInfo) FreeMembers(recursive bool) {
  3207  	js.Free(
  3208  		p.ActivateDate.Ref(),
  3209  		p.ModelName.Ref(),
  3210  		p.SerialNumber.Ref(),
  3211  		p.SkuNumber.Ref(),
  3212  	)
  3213  	p.ActivateDate = p.ActivateDate.FromRef(js.Undefined)
  3214  	p.ModelName = p.ModelName.FromRef(js.Undefined)
  3215  	p.SerialNumber = p.SerialNumber.FromRef(js.Undefined)
  3216  	p.SkuNumber = p.SkuNumber.FromRef(js.Undefined)
  3217  }
  3218  
  3219  type VpdInfoCallbackFunc func(this js.Ref, vpdInfo *VpdInfo) js.Ref
  3220  
  3221  func (fn VpdInfoCallbackFunc) Register() js.Func[func(vpdInfo *VpdInfo)] {
  3222  	return js.RegisterCallback[func(vpdInfo *VpdInfo)](
  3223  		fn, abi.FuncPCABIInternal(fn),
  3224  	)
  3225  }
  3226  
  3227  func (fn VpdInfoCallbackFunc) DispatchCallback(
  3228  	targetPC uintptr, ctx *js.CallbackContext,
  3229  ) {
  3230  	args := ctx.Args()
  3231  	if len(args) != 1+1 /* js this */ ||
  3232  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  3233  		js.ThrowInvalidCallbackInvocation()
  3234  	}
  3235  	var arg0 VpdInfo
  3236  	arg0.UpdateFrom(args[0+1])
  3237  	defer arg0.FreeMembers(true)
  3238  
  3239  	if ctx.Return(fn(
  3240  		args[0],
  3241  
  3242  		mark.NoEscape(&arg0),
  3243  	)) {
  3244  		return
  3245  	}
  3246  
  3247  	js.ThrowCallbackValueNotReturned()
  3248  }
  3249  
  3250  type VpdInfoCallback[T any] struct {
  3251  	Fn  func(arg T, this js.Ref, vpdInfo *VpdInfo) js.Ref
  3252  	Arg T
  3253  }
  3254  
  3255  func (cb *VpdInfoCallback[T]) Register() js.Func[func(vpdInfo *VpdInfo)] {
  3256  	return js.RegisterCallback[func(vpdInfo *VpdInfo)](
  3257  		cb, abi.FuncPCABIInternal(cb.Fn),
  3258  	)
  3259  }
  3260  
  3261  func (cb *VpdInfoCallback[T]) DispatchCallback(
  3262  	targetPC uintptr, ctx *js.CallbackContext,
  3263  ) {
  3264  	args := ctx.Args()
  3265  	if len(args) != 1+1 /* js this */ ||
  3266  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  3267  		js.ThrowInvalidCallbackInvocation()
  3268  	}
  3269  	var arg0 VpdInfo
  3270  	arg0.UpdateFrom(args[0+1])
  3271  	defer arg0.FreeMembers(true)
  3272  
  3273  	if ctx.Return(cb.Fn(
  3274  		cb.Arg,
  3275  		args[0],
  3276  
  3277  		mark.NoEscape(&arg0),
  3278  	)) {
  3279  		return
  3280  	}
  3281  
  3282  	js.ThrowCallbackValueNotReturned()
  3283  }
  3284  
  3285  // HasFuncGetAudioInfo returns true if the function "WEBEXT.os.telemetry.getAudioInfo" exists.
  3286  func HasFuncGetAudioInfo() bool {
  3287  	return js.True == bindings.HasFuncGetAudioInfo()
  3288  }
  3289  
  3290  // FuncGetAudioInfo returns the function "WEBEXT.os.telemetry.getAudioInfo".
  3291  func FuncGetAudioInfo() (fn js.Func[func() js.Promise[AudioInfo]]) {
  3292  	bindings.FuncGetAudioInfo(
  3293  		js.Pointer(&fn),
  3294  	)
  3295  	return
  3296  }
  3297  
  3298  // GetAudioInfo calls the function "WEBEXT.os.telemetry.getAudioInfo" directly.
  3299  func GetAudioInfo() (ret js.Promise[AudioInfo]) {
  3300  	bindings.CallGetAudioInfo(
  3301  		js.Pointer(&ret),
  3302  	)
  3303  
  3304  	return
  3305  }
  3306  
  3307  // TryGetAudioInfo calls the function "WEBEXT.os.telemetry.getAudioInfo"
  3308  // in a try/catch block and returns (_, err, ok = false) when it went through
  3309  // the catch clause.
  3310  func TryGetAudioInfo() (ret js.Promise[AudioInfo], exception js.Any, ok bool) {
  3311  	ok = js.True == bindings.TryGetAudioInfo(
  3312  		js.Pointer(&ret), js.Pointer(&exception),
  3313  	)
  3314  
  3315  	return
  3316  }
  3317  
  3318  // HasFuncGetBatteryInfo returns true if the function "WEBEXT.os.telemetry.getBatteryInfo" exists.
  3319  func HasFuncGetBatteryInfo() bool {
  3320  	return js.True == bindings.HasFuncGetBatteryInfo()
  3321  }
  3322  
  3323  // FuncGetBatteryInfo returns the function "WEBEXT.os.telemetry.getBatteryInfo".
  3324  func FuncGetBatteryInfo() (fn js.Func[func() js.Promise[BatteryInfo]]) {
  3325  	bindings.FuncGetBatteryInfo(
  3326  		js.Pointer(&fn),
  3327  	)
  3328  	return
  3329  }
  3330  
  3331  // GetBatteryInfo calls the function "WEBEXT.os.telemetry.getBatteryInfo" directly.
  3332  func GetBatteryInfo() (ret js.Promise[BatteryInfo]) {
  3333  	bindings.CallGetBatteryInfo(
  3334  		js.Pointer(&ret),
  3335  	)
  3336  
  3337  	return
  3338  }
  3339  
  3340  // TryGetBatteryInfo calls the function "WEBEXT.os.telemetry.getBatteryInfo"
  3341  // in a try/catch block and returns (_, err, ok = false) when it went through
  3342  // the catch clause.
  3343  func TryGetBatteryInfo() (ret js.Promise[BatteryInfo], exception js.Any, ok bool) {
  3344  	ok = js.True == bindings.TryGetBatteryInfo(
  3345  		js.Pointer(&ret), js.Pointer(&exception),
  3346  	)
  3347  
  3348  	return
  3349  }
  3350  
  3351  // HasFuncGetCpuInfo returns true if the function "WEBEXT.os.telemetry.getCpuInfo" exists.
  3352  func HasFuncGetCpuInfo() bool {
  3353  	return js.True == bindings.HasFuncGetCpuInfo()
  3354  }
  3355  
  3356  // FuncGetCpuInfo returns the function "WEBEXT.os.telemetry.getCpuInfo".
  3357  func FuncGetCpuInfo() (fn js.Func[func() js.Promise[CpuInfo]]) {
  3358  	bindings.FuncGetCpuInfo(
  3359  		js.Pointer(&fn),
  3360  	)
  3361  	return
  3362  }
  3363  
  3364  // GetCpuInfo calls the function "WEBEXT.os.telemetry.getCpuInfo" directly.
  3365  func GetCpuInfo() (ret js.Promise[CpuInfo]) {
  3366  	bindings.CallGetCpuInfo(
  3367  		js.Pointer(&ret),
  3368  	)
  3369  
  3370  	return
  3371  }
  3372  
  3373  // TryGetCpuInfo calls the function "WEBEXT.os.telemetry.getCpuInfo"
  3374  // in a try/catch block and returns (_, err, ok = false) when it went through
  3375  // the catch clause.
  3376  func TryGetCpuInfo() (ret js.Promise[CpuInfo], exception js.Any, ok bool) {
  3377  	ok = js.True == bindings.TryGetCpuInfo(
  3378  		js.Pointer(&ret), js.Pointer(&exception),
  3379  	)
  3380  
  3381  	return
  3382  }
  3383  
  3384  // HasFuncGetDisplayInfo returns true if the function "WEBEXT.os.telemetry.getDisplayInfo" exists.
  3385  func HasFuncGetDisplayInfo() bool {
  3386  	return js.True == bindings.HasFuncGetDisplayInfo()
  3387  }
  3388  
  3389  // FuncGetDisplayInfo returns the function "WEBEXT.os.telemetry.getDisplayInfo".
  3390  func FuncGetDisplayInfo() (fn js.Func[func() js.Promise[DisplayInfo]]) {
  3391  	bindings.FuncGetDisplayInfo(
  3392  		js.Pointer(&fn),
  3393  	)
  3394  	return
  3395  }
  3396  
  3397  // GetDisplayInfo calls the function "WEBEXT.os.telemetry.getDisplayInfo" directly.
  3398  func GetDisplayInfo() (ret js.Promise[DisplayInfo]) {
  3399  	bindings.CallGetDisplayInfo(
  3400  		js.Pointer(&ret),
  3401  	)
  3402  
  3403  	return
  3404  }
  3405  
  3406  // TryGetDisplayInfo calls the function "WEBEXT.os.telemetry.getDisplayInfo"
  3407  // in a try/catch block and returns (_, err, ok = false) when it went through
  3408  // the catch clause.
  3409  func TryGetDisplayInfo() (ret js.Promise[DisplayInfo], exception js.Any, ok bool) {
  3410  	ok = js.True == bindings.TryGetDisplayInfo(
  3411  		js.Pointer(&ret), js.Pointer(&exception),
  3412  	)
  3413  
  3414  	return
  3415  }
  3416  
  3417  // HasFuncGetInternetConnectivityInfo returns true if the function "WEBEXT.os.telemetry.getInternetConnectivityInfo" exists.
  3418  func HasFuncGetInternetConnectivityInfo() bool {
  3419  	return js.True == bindings.HasFuncGetInternetConnectivityInfo()
  3420  }
  3421  
  3422  // FuncGetInternetConnectivityInfo returns the function "WEBEXT.os.telemetry.getInternetConnectivityInfo".
  3423  func FuncGetInternetConnectivityInfo() (fn js.Func[func() js.Promise[InternetConnectivityInfo]]) {
  3424  	bindings.FuncGetInternetConnectivityInfo(
  3425  		js.Pointer(&fn),
  3426  	)
  3427  	return
  3428  }
  3429  
  3430  // GetInternetConnectivityInfo calls the function "WEBEXT.os.telemetry.getInternetConnectivityInfo" directly.
  3431  func GetInternetConnectivityInfo() (ret js.Promise[InternetConnectivityInfo]) {
  3432  	bindings.CallGetInternetConnectivityInfo(
  3433  		js.Pointer(&ret),
  3434  	)
  3435  
  3436  	return
  3437  }
  3438  
  3439  // TryGetInternetConnectivityInfo calls the function "WEBEXT.os.telemetry.getInternetConnectivityInfo"
  3440  // in a try/catch block and returns (_, err, ok = false) when it went through
  3441  // the catch clause.
  3442  func TryGetInternetConnectivityInfo() (ret js.Promise[InternetConnectivityInfo], exception js.Any, ok bool) {
  3443  	ok = js.True == bindings.TryGetInternetConnectivityInfo(
  3444  		js.Pointer(&ret), js.Pointer(&exception),
  3445  	)
  3446  
  3447  	return
  3448  }
  3449  
  3450  // HasFuncGetMarketingInfo returns true if the function "WEBEXT.os.telemetry.getMarketingInfo" exists.
  3451  func HasFuncGetMarketingInfo() bool {
  3452  	return js.True == bindings.HasFuncGetMarketingInfo()
  3453  }
  3454  
  3455  // FuncGetMarketingInfo returns the function "WEBEXT.os.telemetry.getMarketingInfo".
  3456  func FuncGetMarketingInfo() (fn js.Func[func() js.Promise[MarketingInfo]]) {
  3457  	bindings.FuncGetMarketingInfo(
  3458  		js.Pointer(&fn),
  3459  	)
  3460  	return
  3461  }
  3462  
  3463  // GetMarketingInfo calls the function "WEBEXT.os.telemetry.getMarketingInfo" directly.
  3464  func GetMarketingInfo() (ret js.Promise[MarketingInfo]) {
  3465  	bindings.CallGetMarketingInfo(
  3466  		js.Pointer(&ret),
  3467  	)
  3468  
  3469  	return
  3470  }
  3471  
  3472  // TryGetMarketingInfo calls the function "WEBEXT.os.telemetry.getMarketingInfo"
  3473  // in a try/catch block and returns (_, err, ok = false) when it went through
  3474  // the catch clause.
  3475  func TryGetMarketingInfo() (ret js.Promise[MarketingInfo], exception js.Any, ok bool) {
  3476  	ok = js.True == bindings.TryGetMarketingInfo(
  3477  		js.Pointer(&ret), js.Pointer(&exception),
  3478  	)
  3479  
  3480  	return
  3481  }
  3482  
  3483  // HasFuncGetMemoryInfo returns true if the function "WEBEXT.os.telemetry.getMemoryInfo" exists.
  3484  func HasFuncGetMemoryInfo() bool {
  3485  	return js.True == bindings.HasFuncGetMemoryInfo()
  3486  }
  3487  
  3488  // FuncGetMemoryInfo returns the function "WEBEXT.os.telemetry.getMemoryInfo".
  3489  func FuncGetMemoryInfo() (fn js.Func[func() js.Promise[MemoryInfo]]) {
  3490  	bindings.FuncGetMemoryInfo(
  3491  		js.Pointer(&fn),
  3492  	)
  3493  	return
  3494  }
  3495  
  3496  // GetMemoryInfo calls the function "WEBEXT.os.telemetry.getMemoryInfo" directly.
  3497  func GetMemoryInfo() (ret js.Promise[MemoryInfo]) {
  3498  	bindings.CallGetMemoryInfo(
  3499  		js.Pointer(&ret),
  3500  	)
  3501  
  3502  	return
  3503  }
  3504  
  3505  // TryGetMemoryInfo calls the function "WEBEXT.os.telemetry.getMemoryInfo"
  3506  // in a try/catch block and returns (_, err, ok = false) when it went through
  3507  // the catch clause.
  3508  func TryGetMemoryInfo() (ret js.Promise[MemoryInfo], exception js.Any, ok bool) {
  3509  	ok = js.True == bindings.TryGetMemoryInfo(
  3510  		js.Pointer(&ret), js.Pointer(&exception),
  3511  	)
  3512  
  3513  	return
  3514  }
  3515  
  3516  // HasFuncGetNonRemovableBlockDevicesInfo returns true if the function "WEBEXT.os.telemetry.getNonRemovableBlockDevicesInfo" exists.
  3517  func HasFuncGetNonRemovableBlockDevicesInfo() bool {
  3518  	return js.True == bindings.HasFuncGetNonRemovableBlockDevicesInfo()
  3519  }
  3520  
  3521  // FuncGetNonRemovableBlockDevicesInfo returns the function "WEBEXT.os.telemetry.getNonRemovableBlockDevicesInfo".
  3522  func FuncGetNonRemovableBlockDevicesInfo() (fn js.Func[func() js.Promise[NonRemovableBlockDeviceInfoResponse]]) {
  3523  	bindings.FuncGetNonRemovableBlockDevicesInfo(
  3524  		js.Pointer(&fn),
  3525  	)
  3526  	return
  3527  }
  3528  
  3529  // GetNonRemovableBlockDevicesInfo calls the function "WEBEXT.os.telemetry.getNonRemovableBlockDevicesInfo" directly.
  3530  func GetNonRemovableBlockDevicesInfo() (ret js.Promise[NonRemovableBlockDeviceInfoResponse]) {
  3531  	bindings.CallGetNonRemovableBlockDevicesInfo(
  3532  		js.Pointer(&ret),
  3533  	)
  3534  
  3535  	return
  3536  }
  3537  
  3538  // TryGetNonRemovableBlockDevicesInfo calls the function "WEBEXT.os.telemetry.getNonRemovableBlockDevicesInfo"
  3539  // in a try/catch block and returns (_, err, ok = false) when it went through
  3540  // the catch clause.
  3541  func TryGetNonRemovableBlockDevicesInfo() (ret js.Promise[NonRemovableBlockDeviceInfoResponse], exception js.Any, ok bool) {
  3542  	ok = js.True == bindings.TryGetNonRemovableBlockDevicesInfo(
  3543  		js.Pointer(&ret), js.Pointer(&exception),
  3544  	)
  3545  
  3546  	return
  3547  }
  3548  
  3549  // HasFuncGetOemData returns true if the function "WEBEXT.os.telemetry.getOemData" exists.
  3550  func HasFuncGetOemData() bool {
  3551  	return js.True == bindings.HasFuncGetOemData()
  3552  }
  3553  
  3554  // FuncGetOemData returns the function "WEBEXT.os.telemetry.getOemData".
  3555  func FuncGetOemData() (fn js.Func[func() js.Promise[OemData]]) {
  3556  	bindings.FuncGetOemData(
  3557  		js.Pointer(&fn),
  3558  	)
  3559  	return
  3560  }
  3561  
  3562  // GetOemData calls the function "WEBEXT.os.telemetry.getOemData" directly.
  3563  func GetOemData() (ret js.Promise[OemData]) {
  3564  	bindings.CallGetOemData(
  3565  		js.Pointer(&ret),
  3566  	)
  3567  
  3568  	return
  3569  }
  3570  
  3571  // TryGetOemData calls the function "WEBEXT.os.telemetry.getOemData"
  3572  // in a try/catch block and returns (_, err, ok = false) when it went through
  3573  // the catch clause.
  3574  func TryGetOemData() (ret js.Promise[OemData], exception js.Any, ok bool) {
  3575  	ok = js.True == bindings.TryGetOemData(
  3576  		js.Pointer(&ret), js.Pointer(&exception),
  3577  	)
  3578  
  3579  	return
  3580  }
  3581  
  3582  // HasFuncGetOsVersionInfo returns true if the function "WEBEXT.os.telemetry.getOsVersionInfo" exists.
  3583  func HasFuncGetOsVersionInfo() bool {
  3584  	return js.True == bindings.HasFuncGetOsVersionInfo()
  3585  }
  3586  
  3587  // FuncGetOsVersionInfo returns the function "WEBEXT.os.telemetry.getOsVersionInfo".
  3588  func FuncGetOsVersionInfo() (fn js.Func[func() js.Promise[OsVersionInfo]]) {
  3589  	bindings.FuncGetOsVersionInfo(
  3590  		js.Pointer(&fn),
  3591  	)
  3592  	return
  3593  }
  3594  
  3595  // GetOsVersionInfo calls the function "WEBEXT.os.telemetry.getOsVersionInfo" directly.
  3596  func GetOsVersionInfo() (ret js.Promise[OsVersionInfo]) {
  3597  	bindings.CallGetOsVersionInfo(
  3598  		js.Pointer(&ret),
  3599  	)
  3600  
  3601  	return
  3602  }
  3603  
  3604  // TryGetOsVersionInfo calls the function "WEBEXT.os.telemetry.getOsVersionInfo"
  3605  // in a try/catch block and returns (_, err, ok = false) when it went through
  3606  // the catch clause.
  3607  func TryGetOsVersionInfo() (ret js.Promise[OsVersionInfo], exception js.Any, ok bool) {
  3608  	ok = js.True == bindings.TryGetOsVersionInfo(
  3609  		js.Pointer(&ret), js.Pointer(&exception),
  3610  	)
  3611  
  3612  	return
  3613  }
  3614  
  3615  // HasFuncGetStatefulPartitionInfo returns true if the function "WEBEXT.os.telemetry.getStatefulPartitionInfo" exists.
  3616  func HasFuncGetStatefulPartitionInfo() bool {
  3617  	return js.True == bindings.HasFuncGetStatefulPartitionInfo()
  3618  }
  3619  
  3620  // FuncGetStatefulPartitionInfo returns the function "WEBEXT.os.telemetry.getStatefulPartitionInfo".
  3621  func FuncGetStatefulPartitionInfo() (fn js.Func[func() js.Promise[StatefulPartitionInfo]]) {
  3622  	bindings.FuncGetStatefulPartitionInfo(
  3623  		js.Pointer(&fn),
  3624  	)
  3625  	return
  3626  }
  3627  
  3628  // GetStatefulPartitionInfo calls the function "WEBEXT.os.telemetry.getStatefulPartitionInfo" directly.
  3629  func GetStatefulPartitionInfo() (ret js.Promise[StatefulPartitionInfo]) {
  3630  	bindings.CallGetStatefulPartitionInfo(
  3631  		js.Pointer(&ret),
  3632  	)
  3633  
  3634  	return
  3635  }
  3636  
  3637  // TryGetStatefulPartitionInfo calls the function "WEBEXT.os.telemetry.getStatefulPartitionInfo"
  3638  // in a try/catch block and returns (_, err, ok = false) when it went through
  3639  // the catch clause.
  3640  func TryGetStatefulPartitionInfo() (ret js.Promise[StatefulPartitionInfo], exception js.Any, ok bool) {
  3641  	ok = js.True == bindings.TryGetStatefulPartitionInfo(
  3642  		js.Pointer(&ret), js.Pointer(&exception),
  3643  	)
  3644  
  3645  	return
  3646  }
  3647  
  3648  // HasFuncGetTpmInfo returns true if the function "WEBEXT.os.telemetry.getTpmInfo" exists.
  3649  func HasFuncGetTpmInfo() bool {
  3650  	return js.True == bindings.HasFuncGetTpmInfo()
  3651  }
  3652  
  3653  // FuncGetTpmInfo returns the function "WEBEXT.os.telemetry.getTpmInfo".
  3654  func FuncGetTpmInfo() (fn js.Func[func() js.Promise[TpmInfo]]) {
  3655  	bindings.FuncGetTpmInfo(
  3656  		js.Pointer(&fn),
  3657  	)
  3658  	return
  3659  }
  3660  
  3661  // GetTpmInfo calls the function "WEBEXT.os.telemetry.getTpmInfo" directly.
  3662  func GetTpmInfo() (ret js.Promise[TpmInfo]) {
  3663  	bindings.CallGetTpmInfo(
  3664  		js.Pointer(&ret),
  3665  	)
  3666  
  3667  	return
  3668  }
  3669  
  3670  // TryGetTpmInfo calls the function "WEBEXT.os.telemetry.getTpmInfo"
  3671  // in a try/catch block and returns (_, err, ok = false) when it went through
  3672  // the catch clause.
  3673  func TryGetTpmInfo() (ret js.Promise[TpmInfo], exception js.Any, ok bool) {
  3674  	ok = js.True == bindings.TryGetTpmInfo(
  3675  		js.Pointer(&ret), js.Pointer(&exception),
  3676  	)
  3677  
  3678  	return
  3679  }
  3680  
  3681  // HasFuncGetUsbBusInfo returns true if the function "WEBEXT.os.telemetry.getUsbBusInfo" exists.
  3682  func HasFuncGetUsbBusInfo() bool {
  3683  	return js.True == bindings.HasFuncGetUsbBusInfo()
  3684  }
  3685  
  3686  // FuncGetUsbBusInfo returns the function "WEBEXT.os.telemetry.getUsbBusInfo".
  3687  func FuncGetUsbBusInfo() (fn js.Func[func() js.Promise[UsbBusDevices]]) {
  3688  	bindings.FuncGetUsbBusInfo(
  3689  		js.Pointer(&fn),
  3690  	)
  3691  	return
  3692  }
  3693  
  3694  // GetUsbBusInfo calls the function "WEBEXT.os.telemetry.getUsbBusInfo" directly.
  3695  func GetUsbBusInfo() (ret js.Promise[UsbBusDevices]) {
  3696  	bindings.CallGetUsbBusInfo(
  3697  		js.Pointer(&ret),
  3698  	)
  3699  
  3700  	return
  3701  }
  3702  
  3703  // TryGetUsbBusInfo calls the function "WEBEXT.os.telemetry.getUsbBusInfo"
  3704  // in a try/catch block and returns (_, err, ok = false) when it went through
  3705  // the catch clause.
  3706  func TryGetUsbBusInfo() (ret js.Promise[UsbBusDevices], exception js.Any, ok bool) {
  3707  	ok = js.True == bindings.TryGetUsbBusInfo(
  3708  		js.Pointer(&ret), js.Pointer(&exception),
  3709  	)
  3710  
  3711  	return
  3712  }
  3713  
  3714  // HasFuncGetVpdInfo returns true if the function "WEBEXT.os.telemetry.getVpdInfo" exists.
  3715  func HasFuncGetVpdInfo() bool {
  3716  	return js.True == bindings.HasFuncGetVpdInfo()
  3717  }
  3718  
  3719  // FuncGetVpdInfo returns the function "WEBEXT.os.telemetry.getVpdInfo".
  3720  func FuncGetVpdInfo() (fn js.Func[func() js.Promise[VpdInfo]]) {
  3721  	bindings.FuncGetVpdInfo(
  3722  		js.Pointer(&fn),
  3723  	)
  3724  	return
  3725  }
  3726  
  3727  // GetVpdInfo calls the function "WEBEXT.os.telemetry.getVpdInfo" directly.
  3728  func GetVpdInfo() (ret js.Promise[VpdInfo]) {
  3729  	bindings.CallGetVpdInfo(
  3730  		js.Pointer(&ret),
  3731  	)
  3732  
  3733  	return
  3734  }
  3735  
  3736  // TryGetVpdInfo calls the function "WEBEXT.os.telemetry.getVpdInfo"
  3737  // in a try/catch block and returns (_, err, ok = false) when it went through
  3738  // the catch clause.
  3739  func TryGetVpdInfo() (ret js.Promise[VpdInfo], exception js.Any, ok bool) {
  3740  	ok = js.True == bindings.TryGetVpdInfo(
  3741  		js.Pointer(&ret), js.Pointer(&exception),
  3742  	)
  3743  
  3744  	return
  3745  }