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

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package onc
     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/networking/onc/bindings"
    11  )
    12  
    13  type ActivationStateType uint32
    14  
    15  const (
    16  	_ ActivationStateType = iota
    17  
    18  	ActivationStateType_ACTIVATED
    19  	ActivationStateType_ACTIVATING
    20  	ActivationStateType_NOT_ACTIVATED
    21  	ActivationStateType_PARTIALLY_ACTIVATED
    22  )
    23  
    24  func (ActivationStateType) FromRef(str js.Ref) ActivationStateType {
    25  	return ActivationStateType(bindings.ConstOfActivationStateType(str))
    26  }
    27  
    28  func (x ActivationStateType) String() (string, bool) {
    29  	switch x {
    30  	case ActivationStateType_ACTIVATED:
    31  		return "Activated", true
    32  	case ActivationStateType_ACTIVATING:
    33  		return "Activating", true
    34  	case ActivationStateType_NOT_ACTIVATED:
    35  		return "NotActivated", true
    36  	case ActivationStateType_PARTIALLY_ACTIVATED:
    37  		return "PartiallyActivated", true
    38  	default:
    39  		return "", false
    40  	}
    41  }
    42  
    43  type BooleanCallbackFunc func(this js.Ref, result bool) js.Ref
    44  
    45  func (fn BooleanCallbackFunc) Register() js.Func[func(result bool)] {
    46  	return js.RegisterCallback[func(result bool)](
    47  		fn, abi.FuncPCABIInternal(fn),
    48  	)
    49  }
    50  
    51  func (fn BooleanCallbackFunc) DispatchCallback(
    52  	targetPC uintptr, ctx *js.CallbackContext,
    53  ) {
    54  	args := ctx.Args()
    55  	if len(args) != 1+1 /* js this */ ||
    56  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
    57  		js.ThrowInvalidCallbackInvocation()
    58  	}
    59  
    60  	if ctx.Return(fn(
    61  		args[0],
    62  
    63  		args[0+1] == js.True,
    64  	)) {
    65  		return
    66  	}
    67  
    68  	js.ThrowCallbackValueNotReturned()
    69  }
    70  
    71  type BooleanCallback[T any] struct {
    72  	Fn  func(arg T, this js.Ref, result bool) js.Ref
    73  	Arg T
    74  }
    75  
    76  func (cb *BooleanCallback[T]) Register() js.Func[func(result bool)] {
    77  	return js.RegisterCallback[func(result bool)](
    78  		cb, abi.FuncPCABIInternal(cb.Fn),
    79  	)
    80  }
    81  
    82  func (cb *BooleanCallback[T]) DispatchCallback(
    83  	targetPC uintptr, ctx *js.CallbackContext,
    84  ) {
    85  	args := ctx.Args()
    86  	if len(args) != 1+1 /* js this */ ||
    87  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
    88  		js.ThrowInvalidCallbackInvocation()
    89  	}
    90  
    91  	if ctx.Return(cb.Fn(
    92  		cb.Arg,
    93  		args[0],
    94  
    95  		args[0+1] == js.True,
    96  	)) {
    97  		return
    98  	}
    99  
   100  	js.ThrowCallbackValueNotReturned()
   101  }
   102  
   103  type CaptivePortalStatus uint32
   104  
   105  const (
   106  	_ CaptivePortalStatus = iota
   107  
   108  	CaptivePortalStatus_UNKNOWN
   109  	CaptivePortalStatus_OFFLINE
   110  	CaptivePortalStatus_ONLINE
   111  	CaptivePortalStatus_PORTAL
   112  	CaptivePortalStatus_PROXY_AUTH_REQUIRED
   113  )
   114  
   115  func (CaptivePortalStatus) FromRef(str js.Ref) CaptivePortalStatus {
   116  	return CaptivePortalStatus(bindings.ConstOfCaptivePortalStatus(str))
   117  }
   118  
   119  func (x CaptivePortalStatus) String() (string, bool) {
   120  	switch x {
   121  	case CaptivePortalStatus_UNKNOWN:
   122  		return "Unknown", true
   123  	case CaptivePortalStatus_OFFLINE:
   124  		return "Offline", true
   125  	case CaptivePortalStatus_ONLINE:
   126  		return "Online", true
   127  	case CaptivePortalStatus_PORTAL:
   128  		return "Portal", true
   129  	case CaptivePortalStatus_PROXY_AUTH_REQUIRED:
   130  		return "ProxyAuthRequired", true
   131  	default:
   132  		return "", false
   133  	}
   134  }
   135  
   136  type CaptivePortalStatusCallbackFunc func(this js.Ref, result CaptivePortalStatus) js.Ref
   137  
   138  func (fn CaptivePortalStatusCallbackFunc) Register() js.Func[func(result CaptivePortalStatus)] {
   139  	return js.RegisterCallback[func(result CaptivePortalStatus)](
   140  		fn, abi.FuncPCABIInternal(fn),
   141  	)
   142  }
   143  
   144  func (fn CaptivePortalStatusCallbackFunc) DispatchCallback(
   145  	targetPC uintptr, ctx *js.CallbackContext,
   146  ) {
   147  	args := ctx.Args()
   148  	if len(args) != 1+1 /* js this */ ||
   149  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
   150  		js.ThrowInvalidCallbackInvocation()
   151  	}
   152  
   153  	if ctx.Return(fn(
   154  		args[0],
   155  
   156  		CaptivePortalStatus(0).FromRef(args[0+1]),
   157  	)) {
   158  		return
   159  	}
   160  
   161  	js.ThrowCallbackValueNotReturned()
   162  }
   163  
   164  type CaptivePortalStatusCallback[T any] struct {
   165  	Fn  func(arg T, this js.Ref, result CaptivePortalStatus) js.Ref
   166  	Arg T
   167  }
   168  
   169  func (cb *CaptivePortalStatusCallback[T]) Register() js.Func[func(result CaptivePortalStatus)] {
   170  	return js.RegisterCallback[func(result CaptivePortalStatus)](
   171  		cb, abi.FuncPCABIInternal(cb.Fn),
   172  	)
   173  }
   174  
   175  func (cb *CaptivePortalStatusCallback[T]) DispatchCallback(
   176  	targetPC uintptr, ctx *js.CallbackContext,
   177  ) {
   178  	args := ctx.Args()
   179  	if len(args) != 1+1 /* js this */ ||
   180  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
   181  		js.ThrowInvalidCallbackInvocation()
   182  	}
   183  
   184  	if ctx.Return(cb.Fn(
   185  		cb.Arg,
   186  		args[0],
   187  
   188  		CaptivePortalStatus(0).FromRef(args[0+1]),
   189  	)) {
   190  		return
   191  	}
   192  
   193  	js.ThrowCallbackValueNotReturned()
   194  }
   195  
   196  type FoundNetworkProperties struct {
   197  	// Status is "FoundNetworkProperties.Status"
   198  	//
   199  	// Optional
   200  	Status js.String
   201  	// NetworkId is "FoundNetworkProperties.NetworkId"
   202  	//
   203  	// Optional
   204  	NetworkId js.String
   205  	// Technology is "FoundNetworkProperties.Technology"
   206  	//
   207  	// Optional
   208  	Technology js.String
   209  	// ShortName is "FoundNetworkProperties.ShortName"
   210  	//
   211  	// Optional
   212  	ShortName js.String
   213  	// LongName is "FoundNetworkProperties.LongName"
   214  	//
   215  	// Optional
   216  	LongName js.String
   217  
   218  	FFI_USE bool
   219  }
   220  
   221  // FromRef calls UpdateFrom and returns a FoundNetworkProperties with all fields set.
   222  func (p FoundNetworkProperties) FromRef(ref js.Ref) FoundNetworkProperties {
   223  	p.UpdateFrom(ref)
   224  	return p
   225  }
   226  
   227  // New creates a new FoundNetworkProperties in the application heap.
   228  func (p FoundNetworkProperties) New() js.Ref {
   229  	return bindings.FoundNetworkPropertiesJSLoad(
   230  		js.Pointer(&p), js.True, 0,
   231  	)
   232  }
   233  
   234  // UpdateFrom copies value of all fields of the heap object to p.
   235  func (p *FoundNetworkProperties) UpdateFrom(ref js.Ref) {
   236  	bindings.FoundNetworkPropertiesJSStore(
   237  		js.Pointer(p), ref,
   238  	)
   239  }
   240  
   241  // Update writes all fields of the p to the heap object referenced by ref.
   242  func (p *FoundNetworkProperties) Update(ref js.Ref) {
   243  	bindings.FoundNetworkPropertiesJSLoad(
   244  		js.Pointer(p), js.False, ref,
   245  	)
   246  }
   247  
   248  // FreeMembers frees fields with heap reference, if recursive is true
   249  // free all heap references reachable from p.
   250  func (p *FoundNetworkProperties) FreeMembers(recursive bool) {
   251  	js.Free(
   252  		p.Status.Ref(),
   253  		p.NetworkId.Ref(),
   254  		p.Technology.Ref(),
   255  		p.ShortName.Ref(),
   256  		p.LongName.Ref(),
   257  	)
   258  	p.Status = p.Status.FromRef(js.Undefined)
   259  	p.NetworkId = p.NetworkId.FromRef(js.Undefined)
   260  	p.Technology = p.Technology.FromRef(js.Undefined)
   261  	p.ShortName = p.ShortName.FromRef(js.Undefined)
   262  	p.LongName = p.LongName.FromRef(js.Undefined)
   263  }
   264  
   265  type CellularProviderProperties struct {
   266  	// Name is "CellularProviderProperties.Name"
   267  	//
   268  	// Optional
   269  	Name js.String
   270  	// Code is "CellularProviderProperties.Code"
   271  	//
   272  	// Optional
   273  	Code js.String
   274  	// Country is "CellularProviderProperties.Country"
   275  	//
   276  	// Optional
   277  	Country js.String
   278  
   279  	FFI_USE bool
   280  }
   281  
   282  // FromRef calls UpdateFrom and returns a CellularProviderProperties with all fields set.
   283  func (p CellularProviderProperties) FromRef(ref js.Ref) CellularProviderProperties {
   284  	p.UpdateFrom(ref)
   285  	return p
   286  }
   287  
   288  // New creates a new CellularProviderProperties in the application heap.
   289  func (p CellularProviderProperties) New() js.Ref {
   290  	return bindings.CellularProviderPropertiesJSLoad(
   291  		js.Pointer(&p), js.True, 0,
   292  	)
   293  }
   294  
   295  // UpdateFrom copies value of all fields of the heap object to p.
   296  func (p *CellularProviderProperties) UpdateFrom(ref js.Ref) {
   297  	bindings.CellularProviderPropertiesJSStore(
   298  		js.Pointer(p), ref,
   299  	)
   300  }
   301  
   302  // Update writes all fields of the p to the heap object referenced by ref.
   303  func (p *CellularProviderProperties) Update(ref js.Ref) {
   304  	bindings.CellularProviderPropertiesJSLoad(
   305  		js.Pointer(p), js.False, ref,
   306  	)
   307  }
   308  
   309  // FreeMembers frees fields with heap reference, if recursive is true
   310  // free all heap references reachable from p.
   311  func (p *CellularProviderProperties) FreeMembers(recursive bool) {
   312  	js.Free(
   313  		p.Name.Ref(),
   314  		p.Code.Ref(),
   315  		p.Country.Ref(),
   316  	)
   317  	p.Name = p.Name.FromRef(js.Undefined)
   318  	p.Code = p.Code.FromRef(js.Undefined)
   319  	p.Country = p.Country.FromRef(js.Undefined)
   320  }
   321  
   322  type PaymentPortal struct {
   323  	// Method is "PaymentPortal.Method"
   324  	//
   325  	// Optional
   326  	Method js.String
   327  	// PostData is "PaymentPortal.PostData"
   328  	//
   329  	// Optional
   330  	PostData js.String
   331  	// Url is "PaymentPortal.Url"
   332  	//
   333  	// Optional
   334  	Url js.String
   335  
   336  	FFI_USE bool
   337  }
   338  
   339  // FromRef calls UpdateFrom and returns a PaymentPortal with all fields set.
   340  func (p PaymentPortal) FromRef(ref js.Ref) PaymentPortal {
   341  	p.UpdateFrom(ref)
   342  	return p
   343  }
   344  
   345  // New creates a new PaymentPortal in the application heap.
   346  func (p PaymentPortal) New() js.Ref {
   347  	return bindings.PaymentPortalJSLoad(
   348  		js.Pointer(&p), js.True, 0,
   349  	)
   350  }
   351  
   352  // UpdateFrom copies value of all fields of the heap object to p.
   353  func (p *PaymentPortal) UpdateFrom(ref js.Ref) {
   354  	bindings.PaymentPortalJSStore(
   355  		js.Pointer(p), ref,
   356  	)
   357  }
   358  
   359  // Update writes all fields of the p to the heap object referenced by ref.
   360  func (p *PaymentPortal) Update(ref js.Ref) {
   361  	bindings.PaymentPortalJSLoad(
   362  		js.Pointer(p), js.False, ref,
   363  	)
   364  }
   365  
   366  // FreeMembers frees fields with heap reference, if recursive is true
   367  // free all heap references reachable from p.
   368  func (p *PaymentPortal) FreeMembers(recursive bool) {
   369  	js.Free(
   370  		p.Method.Ref(),
   371  		p.PostData.Ref(),
   372  		p.Url.Ref(),
   373  	)
   374  	p.Method = p.Method.FromRef(js.Undefined)
   375  	p.PostData = p.PostData.FromRef(js.Undefined)
   376  	p.Url = p.Url.FromRef(js.Undefined)
   377  }
   378  
   379  type SIMLockStatus struct {
   380  	// LockType is "SIMLockStatus.LockType"
   381  	//
   382  	// Optional
   383  	LockType js.String
   384  	// LockEnabled is "SIMLockStatus.LockEnabled"
   385  	//
   386  	// Optional
   387  	//
   388  	// NOTE: FFI_USE_LockEnabled MUST be set to true to make this field effective.
   389  	LockEnabled bool
   390  	// RetriesLeft is "SIMLockStatus.RetriesLeft"
   391  	//
   392  	// Optional
   393  	//
   394  	// NOTE: FFI_USE_RetriesLeft MUST be set to true to make this field effective.
   395  	RetriesLeft int32
   396  
   397  	FFI_USE_LockEnabled bool // for LockEnabled.
   398  	FFI_USE_RetriesLeft bool // for RetriesLeft.
   399  
   400  	FFI_USE bool
   401  }
   402  
   403  // FromRef calls UpdateFrom and returns a SIMLockStatus with all fields set.
   404  func (p SIMLockStatus) FromRef(ref js.Ref) SIMLockStatus {
   405  	p.UpdateFrom(ref)
   406  	return p
   407  }
   408  
   409  // New creates a new SIMLockStatus in the application heap.
   410  func (p SIMLockStatus) New() js.Ref {
   411  	return bindings.SIMLockStatusJSLoad(
   412  		js.Pointer(&p), js.True, 0,
   413  	)
   414  }
   415  
   416  // UpdateFrom copies value of all fields of the heap object to p.
   417  func (p *SIMLockStatus) UpdateFrom(ref js.Ref) {
   418  	bindings.SIMLockStatusJSStore(
   419  		js.Pointer(p), ref,
   420  	)
   421  }
   422  
   423  // Update writes all fields of the p to the heap object referenced by ref.
   424  func (p *SIMLockStatus) Update(ref js.Ref) {
   425  	bindings.SIMLockStatusJSLoad(
   426  		js.Pointer(p), js.False, ref,
   427  	)
   428  }
   429  
   430  // FreeMembers frees fields with heap reference, if recursive is true
   431  // free all heap references reachable from p.
   432  func (p *SIMLockStatus) FreeMembers(recursive bool) {
   433  	js.Free(
   434  		p.LockType.Ref(),
   435  	)
   436  	p.LockType = p.LockType.FromRef(js.Undefined)
   437  }
   438  
   439  type CellularProperties struct {
   440  	// AutoConnect is "CellularProperties.AutoConnect"
   441  	//
   442  	// Optional
   443  	//
   444  	// NOTE: FFI_USE_AutoConnect MUST be set to true to make this field effective.
   445  	AutoConnect bool
   446  	// ActivationType is "CellularProperties.ActivationType"
   447  	//
   448  	// Optional
   449  	ActivationType js.String
   450  	// ActivationState is "CellularProperties.ActivationState"
   451  	//
   452  	// Optional
   453  	ActivationState ActivationStateType
   454  	// AllowRoaming is "CellularProperties.AllowRoaming"
   455  	//
   456  	// Optional
   457  	//
   458  	// NOTE: FFI_USE_AllowRoaming MUST be set to true to make this field effective.
   459  	AllowRoaming bool
   460  	// Family is "CellularProperties.Family"
   461  	//
   462  	// Optional
   463  	Family js.String
   464  	// FirmwareRevision is "CellularProperties.FirmwareRevision"
   465  	//
   466  	// Optional
   467  	FirmwareRevision js.String
   468  	// FoundNetworks is "CellularProperties.FoundNetworks"
   469  	//
   470  	// Optional
   471  	FoundNetworks js.Array[FoundNetworkProperties]
   472  	// HardwareRevision is "CellularProperties.HardwareRevision"
   473  	//
   474  	// Optional
   475  	HardwareRevision js.String
   476  	// HomeProvider is "CellularProperties.HomeProvider"
   477  	//
   478  	// Optional
   479  	//
   480  	// NOTE: HomeProvider.FFI_USE MUST be set to true to get HomeProvider used.
   481  	HomeProvider CellularProviderProperties
   482  	// Manufacturer is "CellularProperties.Manufacturer"
   483  	//
   484  	// Optional
   485  	Manufacturer js.String
   486  	// ModelID is "CellularProperties.ModelID"
   487  	//
   488  	// Optional
   489  	ModelID js.String
   490  	// NetworkTechnology is "CellularProperties.NetworkTechnology"
   491  	//
   492  	// Optional
   493  	NetworkTechnology js.String
   494  	// PaymentPortal is "CellularProperties.PaymentPortal"
   495  	//
   496  	// Optional
   497  	//
   498  	// NOTE: PaymentPortal.FFI_USE MUST be set to true to get PaymentPortal used.
   499  	PaymentPortal PaymentPortal
   500  	// RoamingState is "CellularProperties.RoamingState"
   501  	//
   502  	// Optional
   503  	RoamingState js.String
   504  	// Scanning is "CellularProperties.Scanning"
   505  	//
   506  	// Optional
   507  	//
   508  	// NOTE: FFI_USE_Scanning MUST be set to true to make this field effective.
   509  	Scanning bool
   510  	// ServingOperator is "CellularProperties.ServingOperator"
   511  	//
   512  	// Optional
   513  	//
   514  	// NOTE: ServingOperator.FFI_USE MUST be set to true to get ServingOperator used.
   515  	ServingOperator CellularProviderProperties
   516  	// SIMLockStatus is "CellularProperties.SIMLockStatus"
   517  	//
   518  	// Optional
   519  	//
   520  	// NOTE: SIMLockStatus.FFI_USE MUST be set to true to get SIMLockStatus used.
   521  	SIMLockStatus SIMLockStatus
   522  	// SIMPresent is "CellularProperties.SIMPresent"
   523  	//
   524  	// Optional
   525  	//
   526  	// NOTE: FFI_USE_SIMPresent MUST be set to true to make this field effective.
   527  	SIMPresent bool
   528  	// SignalStrength is "CellularProperties.SignalStrength"
   529  	//
   530  	// Optional
   531  	//
   532  	// NOTE: FFI_USE_SignalStrength MUST be set to true to make this field effective.
   533  	SignalStrength int32
   534  	// SupportNetworkScan is "CellularProperties.SupportNetworkScan"
   535  	//
   536  	// Optional
   537  	//
   538  	// NOTE: FFI_USE_SupportNetworkScan MUST be set to true to make this field effective.
   539  	SupportNetworkScan bool
   540  
   541  	FFI_USE_AutoConnect        bool // for AutoConnect.
   542  	FFI_USE_AllowRoaming       bool // for AllowRoaming.
   543  	FFI_USE_Scanning           bool // for Scanning.
   544  	FFI_USE_SIMPresent         bool // for SIMPresent.
   545  	FFI_USE_SignalStrength     bool // for SignalStrength.
   546  	FFI_USE_SupportNetworkScan bool // for SupportNetworkScan.
   547  
   548  	FFI_USE bool
   549  }
   550  
   551  // FromRef calls UpdateFrom and returns a CellularProperties with all fields set.
   552  func (p CellularProperties) FromRef(ref js.Ref) CellularProperties {
   553  	p.UpdateFrom(ref)
   554  	return p
   555  }
   556  
   557  // New creates a new CellularProperties in the application heap.
   558  func (p CellularProperties) New() js.Ref {
   559  	return bindings.CellularPropertiesJSLoad(
   560  		js.Pointer(&p), js.True, 0,
   561  	)
   562  }
   563  
   564  // UpdateFrom copies value of all fields of the heap object to p.
   565  func (p *CellularProperties) UpdateFrom(ref js.Ref) {
   566  	bindings.CellularPropertiesJSStore(
   567  		js.Pointer(p), ref,
   568  	)
   569  }
   570  
   571  // Update writes all fields of the p to the heap object referenced by ref.
   572  func (p *CellularProperties) Update(ref js.Ref) {
   573  	bindings.CellularPropertiesJSLoad(
   574  		js.Pointer(p), js.False, ref,
   575  	)
   576  }
   577  
   578  // FreeMembers frees fields with heap reference, if recursive is true
   579  // free all heap references reachable from p.
   580  func (p *CellularProperties) FreeMembers(recursive bool) {
   581  	js.Free(
   582  		p.ActivationType.Ref(),
   583  		p.Family.Ref(),
   584  		p.FirmwareRevision.Ref(),
   585  		p.FoundNetworks.Ref(),
   586  		p.HardwareRevision.Ref(),
   587  		p.Manufacturer.Ref(),
   588  		p.ModelID.Ref(),
   589  		p.NetworkTechnology.Ref(),
   590  		p.RoamingState.Ref(),
   591  	)
   592  	p.ActivationType = p.ActivationType.FromRef(js.Undefined)
   593  	p.Family = p.Family.FromRef(js.Undefined)
   594  	p.FirmwareRevision = p.FirmwareRevision.FromRef(js.Undefined)
   595  	p.FoundNetworks = p.FoundNetworks.FromRef(js.Undefined)
   596  	p.HardwareRevision = p.HardwareRevision.FromRef(js.Undefined)
   597  	p.Manufacturer = p.Manufacturer.FromRef(js.Undefined)
   598  	p.ModelID = p.ModelID.FromRef(js.Undefined)
   599  	p.NetworkTechnology = p.NetworkTechnology.FromRef(js.Undefined)
   600  	p.RoamingState = p.RoamingState.FromRef(js.Undefined)
   601  	if recursive {
   602  		p.HomeProvider.FreeMembers(true)
   603  		p.PaymentPortal.FreeMembers(true)
   604  		p.ServingOperator.FreeMembers(true)
   605  		p.SIMLockStatus.FreeMembers(true)
   606  	}
   607  }
   608  
   609  type CellularStateProperties struct {
   610  	// ActivationState is "CellularStateProperties.ActivationState"
   611  	//
   612  	// Optional
   613  	ActivationState ActivationStateType
   614  	// NetworkTechnology is "CellularStateProperties.NetworkTechnology"
   615  	//
   616  	// Optional
   617  	NetworkTechnology js.String
   618  	// RoamingState is "CellularStateProperties.RoamingState"
   619  	//
   620  	// Optional
   621  	RoamingState js.String
   622  	// SIMPresent is "CellularStateProperties.SIMPresent"
   623  	//
   624  	// Optional
   625  	//
   626  	// NOTE: FFI_USE_SIMPresent MUST be set to true to make this field effective.
   627  	SIMPresent bool
   628  	// SignalStrength is "CellularStateProperties.SignalStrength"
   629  	//
   630  	// Optional
   631  	//
   632  	// NOTE: FFI_USE_SignalStrength MUST be set to true to make this field effective.
   633  	SignalStrength int32
   634  
   635  	FFI_USE_SIMPresent     bool // for SIMPresent.
   636  	FFI_USE_SignalStrength bool // for SignalStrength.
   637  
   638  	FFI_USE bool
   639  }
   640  
   641  // FromRef calls UpdateFrom and returns a CellularStateProperties with all fields set.
   642  func (p CellularStateProperties) FromRef(ref js.Ref) CellularStateProperties {
   643  	p.UpdateFrom(ref)
   644  	return p
   645  }
   646  
   647  // New creates a new CellularStateProperties in the application heap.
   648  func (p CellularStateProperties) New() js.Ref {
   649  	return bindings.CellularStatePropertiesJSLoad(
   650  		js.Pointer(&p), js.True, 0,
   651  	)
   652  }
   653  
   654  // UpdateFrom copies value of all fields of the heap object to p.
   655  func (p *CellularStateProperties) UpdateFrom(ref js.Ref) {
   656  	bindings.CellularStatePropertiesJSStore(
   657  		js.Pointer(p), ref,
   658  	)
   659  }
   660  
   661  // Update writes all fields of the p to the heap object referenced by ref.
   662  func (p *CellularStateProperties) Update(ref js.Ref) {
   663  	bindings.CellularStatePropertiesJSLoad(
   664  		js.Pointer(p), js.False, ref,
   665  	)
   666  }
   667  
   668  // FreeMembers frees fields with heap reference, if recursive is true
   669  // free all heap references reachable from p.
   670  func (p *CellularStateProperties) FreeMembers(recursive bool) {
   671  	js.Free(
   672  		p.NetworkTechnology.Ref(),
   673  		p.RoamingState.Ref(),
   674  	)
   675  	p.NetworkTechnology = p.NetworkTechnology.FromRef(js.Undefined)
   676  	p.RoamingState = p.RoamingState.FromRef(js.Undefined)
   677  }
   678  
   679  type IssuerSubjectPattern struct {
   680  	// CommonName is "IssuerSubjectPattern.CommonName"
   681  	//
   682  	// Optional
   683  	CommonName js.String
   684  	// Locality is "IssuerSubjectPattern.Locality"
   685  	//
   686  	// Optional
   687  	Locality js.String
   688  	// Organization is "IssuerSubjectPattern.Organization"
   689  	//
   690  	// Optional
   691  	Organization js.String
   692  	// OrganizationalUnit is "IssuerSubjectPattern.OrganizationalUnit"
   693  	//
   694  	// Optional
   695  	OrganizationalUnit js.String
   696  
   697  	FFI_USE bool
   698  }
   699  
   700  // FromRef calls UpdateFrom and returns a IssuerSubjectPattern with all fields set.
   701  func (p IssuerSubjectPattern) FromRef(ref js.Ref) IssuerSubjectPattern {
   702  	p.UpdateFrom(ref)
   703  	return p
   704  }
   705  
   706  // New creates a new IssuerSubjectPattern in the application heap.
   707  func (p IssuerSubjectPattern) New() js.Ref {
   708  	return bindings.IssuerSubjectPatternJSLoad(
   709  		js.Pointer(&p), js.True, 0,
   710  	)
   711  }
   712  
   713  // UpdateFrom copies value of all fields of the heap object to p.
   714  func (p *IssuerSubjectPattern) UpdateFrom(ref js.Ref) {
   715  	bindings.IssuerSubjectPatternJSStore(
   716  		js.Pointer(p), ref,
   717  	)
   718  }
   719  
   720  // Update writes all fields of the p to the heap object referenced by ref.
   721  func (p *IssuerSubjectPattern) Update(ref js.Ref) {
   722  	bindings.IssuerSubjectPatternJSLoad(
   723  		js.Pointer(p), js.False, ref,
   724  	)
   725  }
   726  
   727  // FreeMembers frees fields with heap reference, if recursive is true
   728  // free all heap references reachable from p.
   729  func (p *IssuerSubjectPattern) FreeMembers(recursive bool) {
   730  	js.Free(
   731  		p.CommonName.Ref(),
   732  		p.Locality.Ref(),
   733  		p.Organization.Ref(),
   734  		p.OrganizationalUnit.Ref(),
   735  	)
   736  	p.CommonName = p.CommonName.FromRef(js.Undefined)
   737  	p.Locality = p.Locality.FromRef(js.Undefined)
   738  	p.Organization = p.Organization.FromRef(js.Undefined)
   739  	p.OrganizationalUnit = p.OrganizationalUnit.FromRef(js.Undefined)
   740  }
   741  
   742  type CertificatePattern struct {
   743  	// EnrollmentURI is "CertificatePattern.EnrollmentURI"
   744  	//
   745  	// Optional
   746  	EnrollmentURI js.Array[js.String]
   747  	// Issuer is "CertificatePattern.Issuer"
   748  	//
   749  	// Optional
   750  	//
   751  	// NOTE: Issuer.FFI_USE MUST be set to true to get Issuer used.
   752  	Issuer IssuerSubjectPattern
   753  	// IssuerCARef is "CertificatePattern.IssuerCARef"
   754  	//
   755  	// Optional
   756  	IssuerCARef js.Array[js.String]
   757  	// Subject is "CertificatePattern.Subject"
   758  	//
   759  	// Optional
   760  	//
   761  	// NOTE: Subject.FFI_USE MUST be set to true to get Subject used.
   762  	Subject IssuerSubjectPattern
   763  
   764  	FFI_USE bool
   765  }
   766  
   767  // FromRef calls UpdateFrom and returns a CertificatePattern with all fields set.
   768  func (p CertificatePattern) FromRef(ref js.Ref) CertificatePattern {
   769  	p.UpdateFrom(ref)
   770  	return p
   771  }
   772  
   773  // New creates a new CertificatePattern in the application heap.
   774  func (p CertificatePattern) New() js.Ref {
   775  	return bindings.CertificatePatternJSLoad(
   776  		js.Pointer(&p), js.True, 0,
   777  	)
   778  }
   779  
   780  // UpdateFrom copies value of all fields of the heap object to p.
   781  func (p *CertificatePattern) UpdateFrom(ref js.Ref) {
   782  	bindings.CertificatePatternJSStore(
   783  		js.Pointer(p), ref,
   784  	)
   785  }
   786  
   787  // Update writes all fields of the p to the heap object referenced by ref.
   788  func (p *CertificatePattern) Update(ref js.Ref) {
   789  	bindings.CertificatePatternJSLoad(
   790  		js.Pointer(p), js.False, ref,
   791  	)
   792  }
   793  
   794  // FreeMembers frees fields with heap reference, if recursive is true
   795  // free all heap references reachable from p.
   796  func (p *CertificatePattern) FreeMembers(recursive bool) {
   797  	js.Free(
   798  		p.EnrollmentURI.Ref(),
   799  		p.IssuerCARef.Ref(),
   800  	)
   801  	p.EnrollmentURI = p.EnrollmentURI.FromRef(js.Undefined)
   802  	p.IssuerCARef = p.IssuerCARef.FromRef(js.Undefined)
   803  	if recursive {
   804  		p.Issuer.FreeMembers(true)
   805  		p.Subject.FreeMembers(true)
   806  	}
   807  }
   808  
   809  type ClientCertificateType uint32
   810  
   811  const (
   812  	_ ClientCertificateType = iota
   813  
   814  	ClientCertificateType_REF
   815  	ClientCertificateType_PATTERN
   816  )
   817  
   818  func (ClientCertificateType) FromRef(str js.Ref) ClientCertificateType {
   819  	return ClientCertificateType(bindings.ConstOfClientCertificateType(str))
   820  }
   821  
   822  func (x ClientCertificateType) String() (string, bool) {
   823  	switch x {
   824  	case ClientCertificateType_REF:
   825  		return "Ref", true
   826  	case ClientCertificateType_PATTERN:
   827  		return "Pattern", true
   828  	default:
   829  		return "", false
   830  	}
   831  }
   832  
   833  type ConnectionStateType uint32
   834  
   835  const (
   836  	_ ConnectionStateType = iota
   837  
   838  	ConnectionStateType_CONNECTED
   839  	ConnectionStateType_CONNECTING
   840  	ConnectionStateType_NOT_CONNECTED
   841  )
   842  
   843  func (ConnectionStateType) FromRef(str js.Ref) ConnectionStateType {
   844  	return ConnectionStateType(bindings.ConstOfConnectionStateType(str))
   845  }
   846  
   847  func (x ConnectionStateType) String() (string, bool) {
   848  	switch x {
   849  	case ConnectionStateType_CONNECTED:
   850  		return "Connected", true
   851  	case ConnectionStateType_CONNECTING:
   852  		return "Connecting", true
   853  	case ConnectionStateType_NOT_CONNECTED:
   854  		return "NotConnected", true
   855  	default:
   856  		return "", false
   857  	}
   858  }
   859  
   860  type DeviceStateType uint32
   861  
   862  const (
   863  	_ DeviceStateType = iota
   864  
   865  	DeviceStateType_UNINITIALIZED
   866  	DeviceStateType_DISABLED
   867  	DeviceStateType_ENABLING
   868  	DeviceStateType_ENABLED
   869  	DeviceStateType_PROHIBITED
   870  )
   871  
   872  func (DeviceStateType) FromRef(str js.Ref) DeviceStateType {
   873  	return DeviceStateType(bindings.ConstOfDeviceStateType(str))
   874  }
   875  
   876  func (x DeviceStateType) String() (string, bool) {
   877  	switch x {
   878  	case DeviceStateType_UNINITIALIZED:
   879  		return "Uninitialized", true
   880  	case DeviceStateType_DISABLED:
   881  		return "Disabled", true
   882  	case DeviceStateType_ENABLING:
   883  		return "Enabling", true
   884  	case DeviceStateType_ENABLED:
   885  		return "Enabled", true
   886  	case DeviceStateType_PROHIBITED:
   887  		return "Prohibited", true
   888  	default:
   889  		return "", false
   890  	}
   891  }
   892  
   893  type NetworkType uint32
   894  
   895  const (
   896  	_ NetworkType = iota
   897  
   898  	NetworkType_ALL
   899  	NetworkType_CELLULAR
   900  	NetworkType_ETHERNET
   901  	NetworkType_TETHER
   902  	NetworkType_VPN
   903  	NetworkType_WIRELESS
   904  	NetworkType_WI_FI
   905  )
   906  
   907  func (NetworkType) FromRef(str js.Ref) NetworkType {
   908  	return NetworkType(bindings.ConstOfNetworkType(str))
   909  }
   910  
   911  func (x NetworkType) String() (string, bool) {
   912  	switch x {
   913  	case NetworkType_ALL:
   914  		return "All", true
   915  	case NetworkType_CELLULAR:
   916  		return "Cellular", true
   917  	case NetworkType_ETHERNET:
   918  		return "Ethernet", true
   919  	case NetworkType_TETHER:
   920  		return "Tether", true
   921  	case NetworkType_VPN:
   922  		return "VPN", true
   923  	case NetworkType_WIRELESS:
   924  		return "Wireless", true
   925  	case NetworkType_WI_FI:
   926  		return "WiFi", true
   927  	default:
   928  		return "", false
   929  	}
   930  }
   931  
   932  type DeviceStateProperties struct {
   933  	// Scanning is "DeviceStateProperties.Scanning"
   934  	//
   935  	// Optional
   936  	//
   937  	// NOTE: FFI_USE_Scanning MUST be set to true to make this field effective.
   938  	Scanning bool
   939  	// SIMLockStatus is "DeviceStateProperties.SIMLockStatus"
   940  	//
   941  	// Optional
   942  	//
   943  	// NOTE: SIMLockStatus.FFI_USE MUST be set to true to get SIMLockStatus used.
   944  	SIMLockStatus SIMLockStatus
   945  	// SIMPresent is "DeviceStateProperties.SIMPresent"
   946  	//
   947  	// Optional
   948  	//
   949  	// NOTE: FFI_USE_SIMPresent MUST be set to true to make this field effective.
   950  	SIMPresent bool
   951  	// State is "DeviceStateProperties.State"
   952  	//
   953  	// Optional
   954  	State DeviceStateType
   955  	// Type is "DeviceStateProperties.Type"
   956  	//
   957  	// Optional
   958  	Type NetworkType
   959  
   960  	FFI_USE_Scanning   bool // for Scanning.
   961  	FFI_USE_SIMPresent bool // for SIMPresent.
   962  
   963  	FFI_USE bool
   964  }
   965  
   966  // FromRef calls UpdateFrom and returns a DeviceStateProperties with all fields set.
   967  func (p DeviceStateProperties) FromRef(ref js.Ref) DeviceStateProperties {
   968  	p.UpdateFrom(ref)
   969  	return p
   970  }
   971  
   972  // New creates a new DeviceStateProperties in the application heap.
   973  func (p DeviceStateProperties) New() js.Ref {
   974  	return bindings.DeviceStatePropertiesJSLoad(
   975  		js.Pointer(&p), js.True, 0,
   976  	)
   977  }
   978  
   979  // UpdateFrom copies value of all fields of the heap object to p.
   980  func (p *DeviceStateProperties) UpdateFrom(ref js.Ref) {
   981  	bindings.DeviceStatePropertiesJSStore(
   982  		js.Pointer(p), ref,
   983  	)
   984  }
   985  
   986  // Update writes all fields of the p to the heap object referenced by ref.
   987  func (p *DeviceStateProperties) Update(ref js.Ref) {
   988  	bindings.DeviceStatePropertiesJSLoad(
   989  		js.Pointer(p), js.False, ref,
   990  	)
   991  }
   992  
   993  // FreeMembers frees fields with heap reference, if recursive is true
   994  // free all heap references reachable from p.
   995  func (p *DeviceStateProperties) FreeMembers(recursive bool) {
   996  	if recursive {
   997  		p.SIMLockStatus.FreeMembers(true)
   998  	}
   999  }
  1000  
  1001  type ManagedDOMString struct {
  1002  	// Active is "ManagedDOMString.Active"
  1003  	//
  1004  	// Optional
  1005  	Active js.String
  1006  	// Effective is "ManagedDOMString.Effective"
  1007  	//
  1008  	// Optional
  1009  	Effective js.String
  1010  	// UserPolicy is "ManagedDOMString.UserPolicy"
  1011  	//
  1012  	// Optional
  1013  	UserPolicy js.String
  1014  	// DevicePolicy is "ManagedDOMString.DevicePolicy"
  1015  	//
  1016  	// Optional
  1017  	DevicePolicy js.String
  1018  	// UserSetting is "ManagedDOMString.UserSetting"
  1019  	//
  1020  	// Optional
  1021  	UserSetting js.String
  1022  	// SharedSetting is "ManagedDOMString.SharedSetting"
  1023  	//
  1024  	// Optional
  1025  	SharedSetting js.String
  1026  	// UserEditable is "ManagedDOMString.UserEditable"
  1027  	//
  1028  	// Optional
  1029  	//
  1030  	// NOTE: FFI_USE_UserEditable MUST be set to true to make this field effective.
  1031  	UserEditable bool
  1032  	// DeviceEditable is "ManagedDOMString.DeviceEditable"
  1033  	//
  1034  	// Optional
  1035  	//
  1036  	// NOTE: FFI_USE_DeviceEditable MUST be set to true to make this field effective.
  1037  	DeviceEditable bool
  1038  
  1039  	FFI_USE_UserEditable   bool // for UserEditable.
  1040  	FFI_USE_DeviceEditable bool // for DeviceEditable.
  1041  
  1042  	FFI_USE bool
  1043  }
  1044  
  1045  // FromRef calls UpdateFrom and returns a ManagedDOMString with all fields set.
  1046  func (p ManagedDOMString) FromRef(ref js.Ref) ManagedDOMString {
  1047  	p.UpdateFrom(ref)
  1048  	return p
  1049  }
  1050  
  1051  // New creates a new ManagedDOMString in the application heap.
  1052  func (p ManagedDOMString) New() js.Ref {
  1053  	return bindings.ManagedDOMStringJSLoad(
  1054  		js.Pointer(&p), js.True, 0,
  1055  	)
  1056  }
  1057  
  1058  // UpdateFrom copies value of all fields of the heap object to p.
  1059  func (p *ManagedDOMString) UpdateFrom(ref js.Ref) {
  1060  	bindings.ManagedDOMStringJSStore(
  1061  		js.Pointer(p), ref,
  1062  	)
  1063  }
  1064  
  1065  // Update writes all fields of the p to the heap object referenced by ref.
  1066  func (p *ManagedDOMString) Update(ref js.Ref) {
  1067  	bindings.ManagedDOMStringJSLoad(
  1068  		js.Pointer(p), js.False, ref,
  1069  	)
  1070  }
  1071  
  1072  // FreeMembers frees fields with heap reference, if recursive is true
  1073  // free all heap references reachable from p.
  1074  func (p *ManagedDOMString) FreeMembers(recursive bool) {
  1075  	js.Free(
  1076  		p.Active.Ref(),
  1077  		p.Effective.Ref(),
  1078  		p.UserPolicy.Ref(),
  1079  		p.DevicePolicy.Ref(),
  1080  		p.UserSetting.Ref(),
  1081  		p.SharedSetting.Ref(),
  1082  	)
  1083  	p.Active = p.Active.FromRef(js.Undefined)
  1084  	p.Effective = p.Effective.FromRef(js.Undefined)
  1085  	p.UserPolicy = p.UserPolicy.FromRef(js.Undefined)
  1086  	p.DevicePolicy = p.DevicePolicy.FromRef(js.Undefined)
  1087  	p.UserSetting = p.UserSetting.FromRef(js.Undefined)
  1088  	p.SharedSetting = p.SharedSetting.FromRef(js.Undefined)
  1089  }
  1090  
  1091  type EAPProperties struct {
  1092  	// AnonymousIdentity is "EAPProperties.AnonymousIdentity"
  1093  	//
  1094  	// Optional
  1095  	AnonymousIdentity js.String
  1096  	// ClientCertPattern is "EAPProperties.ClientCertPattern"
  1097  	//
  1098  	// Optional
  1099  	//
  1100  	// NOTE: ClientCertPattern.FFI_USE MUST be set to true to get ClientCertPattern used.
  1101  	ClientCertPattern CertificatePattern
  1102  	// ClientCertPKCS11Id is "EAPProperties.ClientCertPKCS11Id"
  1103  	//
  1104  	// Optional
  1105  	ClientCertPKCS11Id js.String
  1106  	// ClientCertProvisioningProfileId is "EAPProperties.ClientCertProvisioningProfileId"
  1107  	//
  1108  	// Optional
  1109  	ClientCertProvisioningProfileId js.String
  1110  	// ClientCertRef is "EAPProperties.ClientCertRef"
  1111  	//
  1112  	// Optional
  1113  	ClientCertRef js.String
  1114  	// ClientCertType is "EAPProperties.ClientCertType"
  1115  	//
  1116  	// Optional
  1117  	ClientCertType ClientCertificateType
  1118  	// Identity is "EAPProperties.Identity"
  1119  	//
  1120  	// Optional
  1121  	Identity js.String
  1122  	// Inner is "EAPProperties.Inner"
  1123  	//
  1124  	// Optional
  1125  	Inner js.String
  1126  	// Outer is "EAPProperties.Outer"
  1127  	//
  1128  	// Optional
  1129  	Outer js.String
  1130  	// Password is "EAPProperties.Password"
  1131  	//
  1132  	// Optional
  1133  	Password js.String
  1134  	// SaveCredentials is "EAPProperties.SaveCredentials"
  1135  	//
  1136  	// Optional
  1137  	//
  1138  	// NOTE: FFI_USE_SaveCredentials MUST be set to true to make this field effective.
  1139  	SaveCredentials bool
  1140  	// ServerCAPEMs is "EAPProperties.ServerCAPEMs"
  1141  	//
  1142  	// Optional
  1143  	ServerCAPEMs js.Array[js.String]
  1144  	// ServerCARefs is "EAPProperties.ServerCARefs"
  1145  	//
  1146  	// Optional
  1147  	ServerCARefs js.Array[js.String]
  1148  	// SubjectMatch is "EAPProperties.SubjectMatch"
  1149  	//
  1150  	// Optional
  1151  	//
  1152  	// NOTE: SubjectMatch.FFI_USE MUST be set to true to get SubjectMatch used.
  1153  	SubjectMatch ManagedDOMString
  1154  	// UseProactiveKeyCaching is "EAPProperties.UseProactiveKeyCaching"
  1155  	//
  1156  	// Optional
  1157  	//
  1158  	// NOTE: FFI_USE_UseProactiveKeyCaching MUST be set to true to make this field effective.
  1159  	UseProactiveKeyCaching bool
  1160  	// UseSystemCAs is "EAPProperties.UseSystemCAs"
  1161  	//
  1162  	// Optional
  1163  	//
  1164  	// NOTE: FFI_USE_UseSystemCAs MUST be set to true to make this field effective.
  1165  	UseSystemCAs bool
  1166  
  1167  	FFI_USE_SaveCredentials        bool // for SaveCredentials.
  1168  	FFI_USE_UseProactiveKeyCaching bool // for UseProactiveKeyCaching.
  1169  	FFI_USE_UseSystemCAs           bool // for UseSystemCAs.
  1170  
  1171  	FFI_USE bool
  1172  }
  1173  
  1174  // FromRef calls UpdateFrom and returns a EAPProperties with all fields set.
  1175  func (p EAPProperties) FromRef(ref js.Ref) EAPProperties {
  1176  	p.UpdateFrom(ref)
  1177  	return p
  1178  }
  1179  
  1180  // New creates a new EAPProperties in the application heap.
  1181  func (p EAPProperties) New() js.Ref {
  1182  	return bindings.EAPPropertiesJSLoad(
  1183  		js.Pointer(&p), js.True, 0,
  1184  	)
  1185  }
  1186  
  1187  // UpdateFrom copies value of all fields of the heap object to p.
  1188  func (p *EAPProperties) UpdateFrom(ref js.Ref) {
  1189  	bindings.EAPPropertiesJSStore(
  1190  		js.Pointer(p), ref,
  1191  	)
  1192  }
  1193  
  1194  // Update writes all fields of the p to the heap object referenced by ref.
  1195  func (p *EAPProperties) Update(ref js.Ref) {
  1196  	bindings.EAPPropertiesJSLoad(
  1197  		js.Pointer(p), js.False, ref,
  1198  	)
  1199  }
  1200  
  1201  // FreeMembers frees fields with heap reference, if recursive is true
  1202  // free all heap references reachable from p.
  1203  func (p *EAPProperties) FreeMembers(recursive bool) {
  1204  	js.Free(
  1205  		p.AnonymousIdentity.Ref(),
  1206  		p.ClientCertPKCS11Id.Ref(),
  1207  		p.ClientCertProvisioningProfileId.Ref(),
  1208  		p.ClientCertRef.Ref(),
  1209  		p.Identity.Ref(),
  1210  		p.Inner.Ref(),
  1211  		p.Outer.Ref(),
  1212  		p.Password.Ref(),
  1213  		p.ServerCAPEMs.Ref(),
  1214  		p.ServerCARefs.Ref(),
  1215  	)
  1216  	p.AnonymousIdentity = p.AnonymousIdentity.FromRef(js.Undefined)
  1217  	p.ClientCertPKCS11Id = p.ClientCertPKCS11Id.FromRef(js.Undefined)
  1218  	p.ClientCertProvisioningProfileId = p.ClientCertProvisioningProfileId.FromRef(js.Undefined)
  1219  	p.ClientCertRef = p.ClientCertRef.FromRef(js.Undefined)
  1220  	p.Identity = p.Identity.FromRef(js.Undefined)
  1221  	p.Inner = p.Inner.FromRef(js.Undefined)
  1222  	p.Outer = p.Outer.FromRef(js.Undefined)
  1223  	p.Password = p.Password.FromRef(js.Undefined)
  1224  	p.ServerCAPEMs = p.ServerCAPEMs.FromRef(js.Undefined)
  1225  	p.ServerCARefs = p.ServerCARefs.FromRef(js.Undefined)
  1226  	if recursive {
  1227  		p.ClientCertPattern.FreeMembers(true)
  1228  		p.SubjectMatch.FreeMembers(true)
  1229  	}
  1230  }
  1231  
  1232  type EthernetProperties struct {
  1233  	// AutoConnect is "EthernetProperties.AutoConnect"
  1234  	//
  1235  	// Optional
  1236  	//
  1237  	// NOTE: FFI_USE_AutoConnect MUST be set to true to make this field effective.
  1238  	AutoConnect bool
  1239  	// Authentication is "EthernetProperties.Authentication"
  1240  	//
  1241  	// Optional
  1242  	Authentication js.String
  1243  	// EAP is "EthernetProperties.EAP"
  1244  	//
  1245  	// Optional
  1246  	//
  1247  	// NOTE: EAP.FFI_USE MUST be set to true to get EAP used.
  1248  	EAP EAPProperties
  1249  
  1250  	FFI_USE_AutoConnect bool // for AutoConnect.
  1251  
  1252  	FFI_USE bool
  1253  }
  1254  
  1255  // FromRef calls UpdateFrom and returns a EthernetProperties with all fields set.
  1256  func (p EthernetProperties) FromRef(ref js.Ref) EthernetProperties {
  1257  	p.UpdateFrom(ref)
  1258  	return p
  1259  }
  1260  
  1261  // New creates a new EthernetProperties in the application heap.
  1262  func (p EthernetProperties) New() js.Ref {
  1263  	return bindings.EthernetPropertiesJSLoad(
  1264  		js.Pointer(&p), js.True, 0,
  1265  	)
  1266  }
  1267  
  1268  // UpdateFrom copies value of all fields of the heap object to p.
  1269  func (p *EthernetProperties) UpdateFrom(ref js.Ref) {
  1270  	bindings.EthernetPropertiesJSStore(
  1271  		js.Pointer(p), ref,
  1272  	)
  1273  }
  1274  
  1275  // Update writes all fields of the p to the heap object referenced by ref.
  1276  func (p *EthernetProperties) Update(ref js.Ref) {
  1277  	bindings.EthernetPropertiesJSLoad(
  1278  		js.Pointer(p), js.False, ref,
  1279  	)
  1280  }
  1281  
  1282  // FreeMembers frees fields with heap reference, if recursive is true
  1283  // free all heap references reachable from p.
  1284  func (p *EthernetProperties) FreeMembers(recursive bool) {
  1285  	js.Free(
  1286  		p.Authentication.Ref(),
  1287  	)
  1288  	p.Authentication = p.Authentication.FromRef(js.Undefined)
  1289  	if recursive {
  1290  		p.EAP.FreeMembers(true)
  1291  	}
  1292  }
  1293  
  1294  type EthernetStateProperties struct {
  1295  	// Authentication is "EthernetStateProperties.Authentication"
  1296  	//
  1297  	// Optional
  1298  	Authentication js.String
  1299  
  1300  	FFI_USE bool
  1301  }
  1302  
  1303  // FromRef calls UpdateFrom and returns a EthernetStateProperties with all fields set.
  1304  func (p EthernetStateProperties) FromRef(ref js.Ref) EthernetStateProperties {
  1305  	p.UpdateFrom(ref)
  1306  	return p
  1307  }
  1308  
  1309  // New creates a new EthernetStateProperties in the application heap.
  1310  func (p EthernetStateProperties) New() js.Ref {
  1311  	return bindings.EthernetStatePropertiesJSLoad(
  1312  		js.Pointer(&p), js.True, 0,
  1313  	)
  1314  }
  1315  
  1316  // UpdateFrom copies value of all fields of the heap object to p.
  1317  func (p *EthernetStateProperties) UpdateFrom(ref js.Ref) {
  1318  	bindings.EthernetStatePropertiesJSStore(
  1319  		js.Pointer(p), ref,
  1320  	)
  1321  }
  1322  
  1323  // Update writes all fields of the p to the heap object referenced by ref.
  1324  func (p *EthernetStateProperties) Update(ref js.Ref) {
  1325  	bindings.EthernetStatePropertiesJSLoad(
  1326  		js.Pointer(p), js.False, ref,
  1327  	)
  1328  }
  1329  
  1330  // FreeMembers frees fields with heap reference, if recursive is true
  1331  // free all heap references reachable from p.
  1332  func (p *EthernetStateProperties) FreeMembers(recursive bool) {
  1333  	js.Free(
  1334  		p.Authentication.Ref(),
  1335  	)
  1336  	p.Authentication = p.Authentication.FromRef(js.Undefined)
  1337  }
  1338  
  1339  type GetDeviceStatesCallbackFunc func(this js.Ref, result js.Array[DeviceStateProperties]) js.Ref
  1340  
  1341  func (fn GetDeviceStatesCallbackFunc) Register() js.Func[func(result js.Array[DeviceStateProperties])] {
  1342  	return js.RegisterCallback[func(result js.Array[DeviceStateProperties])](
  1343  		fn, abi.FuncPCABIInternal(fn),
  1344  	)
  1345  }
  1346  
  1347  func (fn GetDeviceStatesCallbackFunc) DispatchCallback(
  1348  	targetPC uintptr, ctx *js.CallbackContext,
  1349  ) {
  1350  	args := ctx.Args()
  1351  	if len(args) != 1+1 /* js this */ ||
  1352  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1353  		js.ThrowInvalidCallbackInvocation()
  1354  	}
  1355  
  1356  	if ctx.Return(fn(
  1357  		args[0],
  1358  
  1359  		js.Array[DeviceStateProperties]{}.FromRef(args[0+1]),
  1360  	)) {
  1361  		return
  1362  	}
  1363  
  1364  	js.ThrowCallbackValueNotReturned()
  1365  }
  1366  
  1367  type GetDeviceStatesCallback[T any] struct {
  1368  	Fn  func(arg T, this js.Ref, result js.Array[DeviceStateProperties]) js.Ref
  1369  	Arg T
  1370  }
  1371  
  1372  func (cb *GetDeviceStatesCallback[T]) Register() js.Func[func(result js.Array[DeviceStateProperties])] {
  1373  	return js.RegisterCallback[func(result js.Array[DeviceStateProperties])](
  1374  		cb, abi.FuncPCABIInternal(cb.Fn),
  1375  	)
  1376  }
  1377  
  1378  func (cb *GetDeviceStatesCallback[T]) DispatchCallback(
  1379  	targetPC uintptr, ctx *js.CallbackContext,
  1380  ) {
  1381  	args := ctx.Args()
  1382  	if len(args) != 1+1 /* js this */ ||
  1383  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1384  		js.ThrowInvalidCallbackInvocation()
  1385  	}
  1386  
  1387  	if ctx.Return(cb.Fn(
  1388  		cb.Arg,
  1389  		args[0],
  1390  
  1391  		js.Array[DeviceStateProperties]{}.FromRef(args[0+1]),
  1392  	)) {
  1393  		return
  1394  	}
  1395  
  1396  	js.ThrowCallbackValueNotReturned()
  1397  }
  1398  
  1399  type GetEnabledNetworkTypesCallbackFunc func(this js.Ref, result js.Array[NetworkType]) js.Ref
  1400  
  1401  func (fn GetEnabledNetworkTypesCallbackFunc) Register() js.Func[func(result js.Array[NetworkType])] {
  1402  	return js.RegisterCallback[func(result js.Array[NetworkType])](
  1403  		fn, abi.FuncPCABIInternal(fn),
  1404  	)
  1405  }
  1406  
  1407  func (fn GetEnabledNetworkTypesCallbackFunc) DispatchCallback(
  1408  	targetPC uintptr, ctx *js.CallbackContext,
  1409  ) {
  1410  	args := ctx.Args()
  1411  	if len(args) != 1+1 /* js this */ ||
  1412  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1413  		js.ThrowInvalidCallbackInvocation()
  1414  	}
  1415  
  1416  	if ctx.Return(fn(
  1417  		args[0],
  1418  
  1419  		js.Array[NetworkType]{}.FromRef(args[0+1]),
  1420  	)) {
  1421  		return
  1422  	}
  1423  
  1424  	js.ThrowCallbackValueNotReturned()
  1425  }
  1426  
  1427  type GetEnabledNetworkTypesCallback[T any] struct {
  1428  	Fn  func(arg T, this js.Ref, result js.Array[NetworkType]) js.Ref
  1429  	Arg T
  1430  }
  1431  
  1432  func (cb *GetEnabledNetworkTypesCallback[T]) Register() js.Func[func(result js.Array[NetworkType])] {
  1433  	return js.RegisterCallback[func(result js.Array[NetworkType])](
  1434  		cb, abi.FuncPCABIInternal(cb.Fn),
  1435  	)
  1436  }
  1437  
  1438  func (cb *GetEnabledNetworkTypesCallback[T]) DispatchCallback(
  1439  	targetPC uintptr, ctx *js.CallbackContext,
  1440  ) {
  1441  	args := ctx.Args()
  1442  	if len(args) != 1+1 /* js this */ ||
  1443  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1444  		js.ThrowInvalidCallbackInvocation()
  1445  	}
  1446  
  1447  	if ctx.Return(cb.Fn(
  1448  		cb.Arg,
  1449  		args[0],
  1450  
  1451  		js.Array[NetworkType]{}.FromRef(args[0+1]),
  1452  	)) {
  1453  		return
  1454  	}
  1455  
  1456  	js.ThrowCallbackValueNotReturned()
  1457  }
  1458  
  1459  type GetGlobalPolicyCallbackFunc func(this js.Ref, result *GlobalPolicy) js.Ref
  1460  
  1461  func (fn GetGlobalPolicyCallbackFunc) Register() js.Func[func(result *GlobalPolicy)] {
  1462  	return js.RegisterCallback[func(result *GlobalPolicy)](
  1463  		fn, abi.FuncPCABIInternal(fn),
  1464  	)
  1465  }
  1466  
  1467  func (fn GetGlobalPolicyCallbackFunc) DispatchCallback(
  1468  	targetPC uintptr, ctx *js.CallbackContext,
  1469  ) {
  1470  	args := ctx.Args()
  1471  	if len(args) != 1+1 /* js this */ ||
  1472  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1473  		js.ThrowInvalidCallbackInvocation()
  1474  	}
  1475  	var arg0 GlobalPolicy
  1476  	arg0.UpdateFrom(args[0+1])
  1477  	defer arg0.FreeMembers(true)
  1478  
  1479  	if ctx.Return(fn(
  1480  		args[0],
  1481  
  1482  		mark.NoEscape(&arg0),
  1483  	)) {
  1484  		return
  1485  	}
  1486  
  1487  	js.ThrowCallbackValueNotReturned()
  1488  }
  1489  
  1490  type GetGlobalPolicyCallback[T any] struct {
  1491  	Fn  func(arg T, this js.Ref, result *GlobalPolicy) js.Ref
  1492  	Arg T
  1493  }
  1494  
  1495  func (cb *GetGlobalPolicyCallback[T]) Register() js.Func[func(result *GlobalPolicy)] {
  1496  	return js.RegisterCallback[func(result *GlobalPolicy)](
  1497  		cb, abi.FuncPCABIInternal(cb.Fn),
  1498  	)
  1499  }
  1500  
  1501  func (cb *GetGlobalPolicyCallback[T]) DispatchCallback(
  1502  	targetPC uintptr, ctx *js.CallbackContext,
  1503  ) {
  1504  	args := ctx.Args()
  1505  	if len(args) != 1+1 /* js this */ ||
  1506  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1507  		js.ThrowInvalidCallbackInvocation()
  1508  	}
  1509  	var arg0 GlobalPolicy
  1510  	arg0.UpdateFrom(args[0+1])
  1511  	defer arg0.FreeMembers(true)
  1512  
  1513  	if ctx.Return(cb.Fn(
  1514  		cb.Arg,
  1515  		args[0],
  1516  
  1517  		mark.NoEscape(&arg0),
  1518  	)) {
  1519  		return
  1520  	}
  1521  
  1522  	js.ThrowCallbackValueNotReturned()
  1523  }
  1524  
  1525  type GlobalPolicy struct {
  1526  	// AllowOnlyPolicyNetworksToAutoconnect is "GlobalPolicy.AllowOnlyPolicyNetworksToAutoconnect"
  1527  	//
  1528  	// Optional
  1529  	//
  1530  	// NOTE: FFI_USE_AllowOnlyPolicyNetworksToAutoconnect MUST be set to true to make this field effective.
  1531  	AllowOnlyPolicyNetworksToAutoconnect bool
  1532  	// AllowOnlyPolicyNetworksToConnect is "GlobalPolicy.AllowOnlyPolicyNetworksToConnect"
  1533  	//
  1534  	// Optional
  1535  	//
  1536  	// NOTE: FFI_USE_AllowOnlyPolicyNetworksToConnect MUST be set to true to make this field effective.
  1537  	AllowOnlyPolicyNetworksToConnect bool
  1538  	// AllowOnlyPolicyNetworksToConnectIfAvailable is "GlobalPolicy.AllowOnlyPolicyNetworksToConnectIfAvailable"
  1539  	//
  1540  	// Optional
  1541  	//
  1542  	// NOTE: FFI_USE_AllowOnlyPolicyNetworksToConnectIfAvailable MUST be set to true to make this field effective.
  1543  	AllowOnlyPolicyNetworksToConnectIfAvailable bool
  1544  	// BlockedHexSSIDs is "GlobalPolicy.BlockedHexSSIDs"
  1545  	//
  1546  	// Optional
  1547  	BlockedHexSSIDs js.Array[js.String]
  1548  
  1549  	FFI_USE_AllowOnlyPolicyNetworksToAutoconnect        bool // for AllowOnlyPolicyNetworksToAutoconnect.
  1550  	FFI_USE_AllowOnlyPolicyNetworksToConnect            bool // for AllowOnlyPolicyNetworksToConnect.
  1551  	FFI_USE_AllowOnlyPolicyNetworksToConnectIfAvailable bool // for AllowOnlyPolicyNetworksToConnectIfAvailable.
  1552  
  1553  	FFI_USE bool
  1554  }
  1555  
  1556  // FromRef calls UpdateFrom and returns a GlobalPolicy with all fields set.
  1557  func (p GlobalPolicy) FromRef(ref js.Ref) GlobalPolicy {
  1558  	p.UpdateFrom(ref)
  1559  	return p
  1560  }
  1561  
  1562  // New creates a new GlobalPolicy in the application heap.
  1563  func (p GlobalPolicy) New() js.Ref {
  1564  	return bindings.GlobalPolicyJSLoad(
  1565  		js.Pointer(&p), js.True, 0,
  1566  	)
  1567  }
  1568  
  1569  // UpdateFrom copies value of all fields of the heap object to p.
  1570  func (p *GlobalPolicy) UpdateFrom(ref js.Ref) {
  1571  	bindings.GlobalPolicyJSStore(
  1572  		js.Pointer(p), ref,
  1573  	)
  1574  }
  1575  
  1576  // Update writes all fields of the p to the heap object referenced by ref.
  1577  func (p *GlobalPolicy) Update(ref js.Ref) {
  1578  	bindings.GlobalPolicyJSLoad(
  1579  		js.Pointer(p), js.False, ref,
  1580  	)
  1581  }
  1582  
  1583  // FreeMembers frees fields with heap reference, if recursive is true
  1584  // free all heap references reachable from p.
  1585  func (p *GlobalPolicy) FreeMembers(recursive bool) {
  1586  	js.Free(
  1587  		p.BlockedHexSSIDs.Ref(),
  1588  	)
  1589  	p.BlockedHexSSIDs = p.BlockedHexSSIDs.FromRef(js.Undefined)
  1590  }
  1591  
  1592  type GetManagedPropertiesCallbackFunc func(this js.Ref, result *ManagedProperties) js.Ref
  1593  
  1594  func (fn GetManagedPropertiesCallbackFunc) Register() js.Func[func(result *ManagedProperties)] {
  1595  	return js.RegisterCallback[func(result *ManagedProperties)](
  1596  		fn, abi.FuncPCABIInternal(fn),
  1597  	)
  1598  }
  1599  
  1600  func (fn GetManagedPropertiesCallbackFunc) DispatchCallback(
  1601  	targetPC uintptr, ctx *js.CallbackContext,
  1602  ) {
  1603  	args := ctx.Args()
  1604  	if len(args) != 1+1 /* js this */ ||
  1605  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  1606  		js.ThrowInvalidCallbackInvocation()
  1607  	}
  1608  	var arg0 ManagedProperties
  1609  	arg0.UpdateFrom(args[0+1])
  1610  	defer arg0.FreeMembers(true)
  1611  
  1612  	if ctx.Return(fn(
  1613  		args[0],
  1614  
  1615  		mark.NoEscape(&arg0),
  1616  	)) {
  1617  		return
  1618  	}
  1619  
  1620  	js.ThrowCallbackValueNotReturned()
  1621  }
  1622  
  1623  type GetManagedPropertiesCallback[T any] struct {
  1624  	Fn  func(arg T, this js.Ref, result *ManagedProperties) js.Ref
  1625  	Arg T
  1626  }
  1627  
  1628  func (cb *GetManagedPropertiesCallback[T]) Register() js.Func[func(result *ManagedProperties)] {
  1629  	return js.RegisterCallback[func(result *ManagedProperties)](
  1630  		cb, abi.FuncPCABIInternal(cb.Fn),
  1631  	)
  1632  }
  1633  
  1634  func (cb *GetManagedPropertiesCallback[T]) DispatchCallback(
  1635  	targetPC uintptr, ctx *js.CallbackContext,
  1636  ) {
  1637  	args := ctx.Args()
  1638  	if len(args) != 1+1 /* js this */ ||
  1639  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  1640  		js.ThrowInvalidCallbackInvocation()
  1641  	}
  1642  	var arg0 ManagedProperties
  1643  	arg0.UpdateFrom(args[0+1])
  1644  	defer arg0.FreeMembers(true)
  1645  
  1646  	if ctx.Return(cb.Fn(
  1647  		cb.Arg,
  1648  		args[0],
  1649  
  1650  		mark.NoEscape(&arg0),
  1651  	)) {
  1652  		return
  1653  	}
  1654  
  1655  	js.ThrowCallbackValueNotReturned()
  1656  }
  1657  
  1658  type ManagedBoolean struct {
  1659  	// Active is "ManagedBoolean.Active"
  1660  	//
  1661  	// Optional
  1662  	//
  1663  	// NOTE: FFI_USE_Active MUST be set to true to make this field effective.
  1664  	Active bool
  1665  	// Effective is "ManagedBoolean.Effective"
  1666  	//
  1667  	// Optional
  1668  	Effective js.String
  1669  	// UserPolicy is "ManagedBoolean.UserPolicy"
  1670  	//
  1671  	// Optional
  1672  	//
  1673  	// NOTE: FFI_USE_UserPolicy MUST be set to true to make this field effective.
  1674  	UserPolicy bool
  1675  	// DevicePolicy is "ManagedBoolean.DevicePolicy"
  1676  	//
  1677  	// Optional
  1678  	//
  1679  	// NOTE: FFI_USE_DevicePolicy MUST be set to true to make this field effective.
  1680  	DevicePolicy bool
  1681  	// UserSetting is "ManagedBoolean.UserSetting"
  1682  	//
  1683  	// Optional
  1684  	//
  1685  	// NOTE: FFI_USE_UserSetting MUST be set to true to make this field effective.
  1686  	UserSetting bool
  1687  	// SharedSetting is "ManagedBoolean.SharedSetting"
  1688  	//
  1689  	// Optional
  1690  	//
  1691  	// NOTE: FFI_USE_SharedSetting MUST be set to true to make this field effective.
  1692  	SharedSetting bool
  1693  	// UserEditable is "ManagedBoolean.UserEditable"
  1694  	//
  1695  	// Optional
  1696  	//
  1697  	// NOTE: FFI_USE_UserEditable MUST be set to true to make this field effective.
  1698  	UserEditable bool
  1699  	// DeviceEditable is "ManagedBoolean.DeviceEditable"
  1700  	//
  1701  	// Optional
  1702  	//
  1703  	// NOTE: FFI_USE_DeviceEditable MUST be set to true to make this field effective.
  1704  	DeviceEditable bool
  1705  
  1706  	FFI_USE_Active         bool // for Active.
  1707  	FFI_USE_UserPolicy     bool // for UserPolicy.
  1708  	FFI_USE_DevicePolicy   bool // for DevicePolicy.
  1709  	FFI_USE_UserSetting    bool // for UserSetting.
  1710  	FFI_USE_SharedSetting  bool // for SharedSetting.
  1711  	FFI_USE_UserEditable   bool // for UserEditable.
  1712  	FFI_USE_DeviceEditable bool // for DeviceEditable.
  1713  
  1714  	FFI_USE bool
  1715  }
  1716  
  1717  // FromRef calls UpdateFrom and returns a ManagedBoolean with all fields set.
  1718  func (p ManagedBoolean) FromRef(ref js.Ref) ManagedBoolean {
  1719  	p.UpdateFrom(ref)
  1720  	return p
  1721  }
  1722  
  1723  // New creates a new ManagedBoolean in the application heap.
  1724  func (p ManagedBoolean) New() js.Ref {
  1725  	return bindings.ManagedBooleanJSLoad(
  1726  		js.Pointer(&p), js.True, 0,
  1727  	)
  1728  }
  1729  
  1730  // UpdateFrom copies value of all fields of the heap object to p.
  1731  func (p *ManagedBoolean) UpdateFrom(ref js.Ref) {
  1732  	bindings.ManagedBooleanJSStore(
  1733  		js.Pointer(p), ref,
  1734  	)
  1735  }
  1736  
  1737  // Update writes all fields of the p to the heap object referenced by ref.
  1738  func (p *ManagedBoolean) Update(ref js.Ref) {
  1739  	bindings.ManagedBooleanJSLoad(
  1740  		js.Pointer(p), js.False, ref,
  1741  	)
  1742  }
  1743  
  1744  // FreeMembers frees fields with heap reference, if recursive is true
  1745  // free all heap references reachable from p.
  1746  func (p *ManagedBoolean) FreeMembers(recursive bool) {
  1747  	js.Free(
  1748  		p.Effective.Ref(),
  1749  	)
  1750  	p.Effective = p.Effective.FromRef(js.Undefined)
  1751  }
  1752  
  1753  type ManagedCellularProperties struct {
  1754  	// AutoConnect is "ManagedCellularProperties.AutoConnect"
  1755  	//
  1756  	// Optional
  1757  	//
  1758  	// NOTE: AutoConnect.FFI_USE MUST be set to true to get AutoConnect used.
  1759  	AutoConnect ManagedBoolean
  1760  	// ActivationType is "ManagedCellularProperties.ActivationType"
  1761  	//
  1762  	// Optional
  1763  	ActivationType js.String
  1764  	// ActivationState is "ManagedCellularProperties.ActivationState"
  1765  	//
  1766  	// Optional
  1767  	ActivationState ActivationStateType
  1768  	// AllowRoaming is "ManagedCellularProperties.AllowRoaming"
  1769  	//
  1770  	// Optional
  1771  	//
  1772  	// NOTE: FFI_USE_AllowRoaming MUST be set to true to make this field effective.
  1773  	AllowRoaming bool
  1774  	// Family is "ManagedCellularProperties.Family"
  1775  	//
  1776  	// Optional
  1777  	Family js.String
  1778  	// FirmwareRevision is "ManagedCellularProperties.FirmwareRevision"
  1779  	//
  1780  	// Optional
  1781  	FirmwareRevision js.String
  1782  	// FoundNetworks is "ManagedCellularProperties.FoundNetworks"
  1783  	//
  1784  	// Optional
  1785  	FoundNetworks js.Array[FoundNetworkProperties]
  1786  	// HardwareRevision is "ManagedCellularProperties.HardwareRevision"
  1787  	//
  1788  	// Optional
  1789  	HardwareRevision js.String
  1790  	// HomeProvider is "ManagedCellularProperties.HomeProvider"
  1791  	//
  1792  	// Optional
  1793  	HomeProvider js.Array[CellularProviderProperties]
  1794  	// Manufacturer is "ManagedCellularProperties.Manufacturer"
  1795  	//
  1796  	// Optional
  1797  	Manufacturer js.String
  1798  	// ModelID is "ManagedCellularProperties.ModelID"
  1799  	//
  1800  	// Optional
  1801  	ModelID js.String
  1802  	// NetworkTechnology is "ManagedCellularProperties.NetworkTechnology"
  1803  	//
  1804  	// Optional
  1805  	NetworkTechnology js.String
  1806  	// PaymentPortal is "ManagedCellularProperties.PaymentPortal"
  1807  	//
  1808  	// Optional
  1809  	//
  1810  	// NOTE: PaymentPortal.FFI_USE MUST be set to true to get PaymentPortal used.
  1811  	PaymentPortal PaymentPortal
  1812  	// RoamingState is "ManagedCellularProperties.RoamingState"
  1813  	//
  1814  	// Optional
  1815  	RoamingState js.String
  1816  	// Scanning is "ManagedCellularProperties.Scanning"
  1817  	//
  1818  	// Optional
  1819  	//
  1820  	// NOTE: FFI_USE_Scanning MUST be set to true to make this field effective.
  1821  	Scanning bool
  1822  	// ServingOperator is "ManagedCellularProperties.ServingOperator"
  1823  	//
  1824  	// Optional
  1825  	//
  1826  	// NOTE: ServingOperator.FFI_USE MUST be set to true to get ServingOperator used.
  1827  	ServingOperator CellularProviderProperties
  1828  	// SIMLockStatus is "ManagedCellularProperties.SIMLockStatus"
  1829  	//
  1830  	// Optional
  1831  	//
  1832  	// NOTE: SIMLockStatus.FFI_USE MUST be set to true to get SIMLockStatus used.
  1833  	SIMLockStatus SIMLockStatus
  1834  	// SIMPresent is "ManagedCellularProperties.SIMPresent"
  1835  	//
  1836  	// Optional
  1837  	//
  1838  	// NOTE: FFI_USE_SIMPresent MUST be set to true to make this field effective.
  1839  	SIMPresent bool
  1840  	// SignalStrength is "ManagedCellularProperties.SignalStrength"
  1841  	//
  1842  	// Optional
  1843  	//
  1844  	// NOTE: FFI_USE_SignalStrength MUST be set to true to make this field effective.
  1845  	SignalStrength int32
  1846  	// SupportNetworkScan is "ManagedCellularProperties.SupportNetworkScan"
  1847  	//
  1848  	// Optional
  1849  	//
  1850  	// NOTE: FFI_USE_SupportNetworkScan MUST be set to true to make this field effective.
  1851  	SupportNetworkScan bool
  1852  
  1853  	FFI_USE_AllowRoaming       bool // for AllowRoaming.
  1854  	FFI_USE_Scanning           bool // for Scanning.
  1855  	FFI_USE_SIMPresent         bool // for SIMPresent.
  1856  	FFI_USE_SignalStrength     bool // for SignalStrength.
  1857  	FFI_USE_SupportNetworkScan bool // for SupportNetworkScan.
  1858  
  1859  	FFI_USE bool
  1860  }
  1861  
  1862  // FromRef calls UpdateFrom and returns a ManagedCellularProperties with all fields set.
  1863  func (p ManagedCellularProperties) FromRef(ref js.Ref) ManagedCellularProperties {
  1864  	p.UpdateFrom(ref)
  1865  	return p
  1866  }
  1867  
  1868  // New creates a new ManagedCellularProperties in the application heap.
  1869  func (p ManagedCellularProperties) New() js.Ref {
  1870  	return bindings.ManagedCellularPropertiesJSLoad(
  1871  		js.Pointer(&p), js.True, 0,
  1872  	)
  1873  }
  1874  
  1875  // UpdateFrom copies value of all fields of the heap object to p.
  1876  func (p *ManagedCellularProperties) UpdateFrom(ref js.Ref) {
  1877  	bindings.ManagedCellularPropertiesJSStore(
  1878  		js.Pointer(p), ref,
  1879  	)
  1880  }
  1881  
  1882  // Update writes all fields of the p to the heap object referenced by ref.
  1883  func (p *ManagedCellularProperties) Update(ref js.Ref) {
  1884  	bindings.ManagedCellularPropertiesJSLoad(
  1885  		js.Pointer(p), js.False, ref,
  1886  	)
  1887  }
  1888  
  1889  // FreeMembers frees fields with heap reference, if recursive is true
  1890  // free all heap references reachable from p.
  1891  func (p *ManagedCellularProperties) FreeMembers(recursive bool) {
  1892  	js.Free(
  1893  		p.ActivationType.Ref(),
  1894  		p.Family.Ref(),
  1895  		p.FirmwareRevision.Ref(),
  1896  		p.FoundNetworks.Ref(),
  1897  		p.HardwareRevision.Ref(),
  1898  		p.HomeProvider.Ref(),
  1899  		p.Manufacturer.Ref(),
  1900  		p.ModelID.Ref(),
  1901  		p.NetworkTechnology.Ref(),
  1902  		p.RoamingState.Ref(),
  1903  	)
  1904  	p.ActivationType = p.ActivationType.FromRef(js.Undefined)
  1905  	p.Family = p.Family.FromRef(js.Undefined)
  1906  	p.FirmwareRevision = p.FirmwareRevision.FromRef(js.Undefined)
  1907  	p.FoundNetworks = p.FoundNetworks.FromRef(js.Undefined)
  1908  	p.HardwareRevision = p.HardwareRevision.FromRef(js.Undefined)
  1909  	p.HomeProvider = p.HomeProvider.FromRef(js.Undefined)
  1910  	p.Manufacturer = p.Manufacturer.FromRef(js.Undefined)
  1911  	p.ModelID = p.ModelID.FromRef(js.Undefined)
  1912  	p.NetworkTechnology = p.NetworkTechnology.FromRef(js.Undefined)
  1913  	p.RoamingState = p.RoamingState.FromRef(js.Undefined)
  1914  	if recursive {
  1915  		p.AutoConnect.FreeMembers(true)
  1916  		p.PaymentPortal.FreeMembers(true)
  1917  		p.ServingOperator.FreeMembers(true)
  1918  		p.SIMLockStatus.FreeMembers(true)
  1919  	}
  1920  }
  1921  
  1922  type ManagedEthernetProperties struct {
  1923  	// AutoConnect is "ManagedEthernetProperties.AutoConnect"
  1924  	//
  1925  	// Optional
  1926  	//
  1927  	// NOTE: AutoConnect.FFI_USE MUST be set to true to get AutoConnect used.
  1928  	AutoConnect ManagedBoolean
  1929  	// Authentication is "ManagedEthernetProperties.Authentication"
  1930  	//
  1931  	// Optional
  1932  	//
  1933  	// NOTE: Authentication.FFI_USE MUST be set to true to get Authentication used.
  1934  	Authentication ManagedDOMString
  1935  
  1936  	FFI_USE bool
  1937  }
  1938  
  1939  // FromRef calls UpdateFrom and returns a ManagedEthernetProperties with all fields set.
  1940  func (p ManagedEthernetProperties) FromRef(ref js.Ref) ManagedEthernetProperties {
  1941  	p.UpdateFrom(ref)
  1942  	return p
  1943  }
  1944  
  1945  // New creates a new ManagedEthernetProperties in the application heap.
  1946  func (p ManagedEthernetProperties) New() js.Ref {
  1947  	return bindings.ManagedEthernetPropertiesJSLoad(
  1948  		js.Pointer(&p), js.True, 0,
  1949  	)
  1950  }
  1951  
  1952  // UpdateFrom copies value of all fields of the heap object to p.
  1953  func (p *ManagedEthernetProperties) UpdateFrom(ref js.Ref) {
  1954  	bindings.ManagedEthernetPropertiesJSStore(
  1955  		js.Pointer(p), ref,
  1956  	)
  1957  }
  1958  
  1959  // Update writes all fields of the p to the heap object referenced by ref.
  1960  func (p *ManagedEthernetProperties) Update(ref js.Ref) {
  1961  	bindings.ManagedEthernetPropertiesJSLoad(
  1962  		js.Pointer(p), js.False, ref,
  1963  	)
  1964  }
  1965  
  1966  // FreeMembers frees fields with heap reference, if recursive is true
  1967  // free all heap references reachable from p.
  1968  func (p *ManagedEthernetProperties) FreeMembers(recursive bool) {
  1969  	if recursive {
  1970  		p.AutoConnect.FreeMembers(true)
  1971  		p.Authentication.FreeMembers(true)
  1972  	}
  1973  }
  1974  
  1975  type IPConfigType uint32
  1976  
  1977  const (
  1978  	_ IPConfigType = iota
  1979  
  1980  	IPConfigType_DHCP
  1981  	IPConfigType_STATIC
  1982  )
  1983  
  1984  func (IPConfigType) FromRef(str js.Ref) IPConfigType {
  1985  	return IPConfigType(bindings.ConstOfIPConfigType(str))
  1986  }
  1987  
  1988  func (x IPConfigType) String() (string, bool) {
  1989  	switch x {
  1990  	case IPConfigType_DHCP:
  1991  		return "DHCP", true
  1992  	case IPConfigType_STATIC:
  1993  		return "Static", true
  1994  	default:
  1995  		return "", false
  1996  	}
  1997  }
  1998  
  1999  type ManagedIPConfigType struct {
  2000  	// Active is "ManagedIPConfigType.Active"
  2001  	//
  2002  	// Optional
  2003  	Active IPConfigType
  2004  	// Effective is "ManagedIPConfigType.Effective"
  2005  	//
  2006  	// Optional
  2007  	Effective js.String
  2008  	// UserPolicy is "ManagedIPConfigType.UserPolicy"
  2009  	//
  2010  	// Optional
  2011  	UserPolicy IPConfigType
  2012  	// DevicePolicy is "ManagedIPConfigType.DevicePolicy"
  2013  	//
  2014  	// Optional
  2015  	DevicePolicy IPConfigType
  2016  	// UserSetting is "ManagedIPConfigType.UserSetting"
  2017  	//
  2018  	// Optional
  2019  	UserSetting IPConfigType
  2020  	// SharedSetting is "ManagedIPConfigType.SharedSetting"
  2021  	//
  2022  	// Optional
  2023  	SharedSetting IPConfigType
  2024  	// UserEditable is "ManagedIPConfigType.UserEditable"
  2025  	//
  2026  	// Optional
  2027  	//
  2028  	// NOTE: FFI_USE_UserEditable MUST be set to true to make this field effective.
  2029  	UserEditable bool
  2030  	// DeviceEditable is "ManagedIPConfigType.DeviceEditable"
  2031  	//
  2032  	// Optional
  2033  	//
  2034  	// NOTE: FFI_USE_DeviceEditable MUST be set to true to make this field effective.
  2035  	DeviceEditable bool
  2036  
  2037  	FFI_USE_UserEditable   bool // for UserEditable.
  2038  	FFI_USE_DeviceEditable bool // for DeviceEditable.
  2039  
  2040  	FFI_USE bool
  2041  }
  2042  
  2043  // FromRef calls UpdateFrom and returns a ManagedIPConfigType with all fields set.
  2044  func (p ManagedIPConfigType) FromRef(ref js.Ref) ManagedIPConfigType {
  2045  	p.UpdateFrom(ref)
  2046  	return p
  2047  }
  2048  
  2049  // New creates a new ManagedIPConfigType in the application heap.
  2050  func (p ManagedIPConfigType) New() js.Ref {
  2051  	return bindings.ManagedIPConfigTypeJSLoad(
  2052  		js.Pointer(&p), js.True, 0,
  2053  	)
  2054  }
  2055  
  2056  // UpdateFrom copies value of all fields of the heap object to p.
  2057  func (p *ManagedIPConfigType) UpdateFrom(ref js.Ref) {
  2058  	bindings.ManagedIPConfigTypeJSStore(
  2059  		js.Pointer(p), ref,
  2060  	)
  2061  }
  2062  
  2063  // Update writes all fields of the p to the heap object referenced by ref.
  2064  func (p *ManagedIPConfigType) Update(ref js.Ref) {
  2065  	bindings.ManagedIPConfigTypeJSLoad(
  2066  		js.Pointer(p), js.False, ref,
  2067  	)
  2068  }
  2069  
  2070  // FreeMembers frees fields with heap reference, if recursive is true
  2071  // free all heap references reachable from p.
  2072  func (p *ManagedIPConfigType) FreeMembers(recursive bool) {
  2073  	js.Free(
  2074  		p.Effective.Ref(),
  2075  	)
  2076  	p.Effective = p.Effective.FromRef(js.Undefined)
  2077  }
  2078  
  2079  type IPConfigProperties struct {
  2080  	// Gateway is "IPConfigProperties.Gateway"
  2081  	//
  2082  	// Optional
  2083  	Gateway js.String
  2084  	// IPAddress is "IPConfigProperties.IPAddress"
  2085  	//
  2086  	// Optional
  2087  	IPAddress js.String
  2088  	// ExcludedRoutes is "IPConfigProperties.ExcludedRoutes"
  2089  	//
  2090  	// Optional
  2091  	ExcludedRoutes js.Array[js.String]
  2092  	// IncludedRoutes is "IPConfigProperties.IncludedRoutes"
  2093  	//
  2094  	// Optional
  2095  	IncludedRoutes js.Array[js.String]
  2096  	// NameServers is "IPConfigProperties.NameServers"
  2097  	//
  2098  	// Optional
  2099  	NameServers js.Array[js.String]
  2100  	// SearchDomains is "IPConfigProperties.SearchDomains"
  2101  	//
  2102  	// Optional
  2103  	SearchDomains js.Array[js.String]
  2104  	// RoutingPrefix is "IPConfigProperties.RoutingPrefix"
  2105  	//
  2106  	// Optional
  2107  	//
  2108  	// NOTE: FFI_USE_RoutingPrefix MUST be set to true to make this field effective.
  2109  	RoutingPrefix int32
  2110  	// Type is "IPConfigProperties.Type"
  2111  	//
  2112  	// Optional
  2113  	Type js.String
  2114  	// WebProxyAutoDiscoveryUrl is "IPConfigProperties.WebProxyAutoDiscoveryUrl"
  2115  	//
  2116  	// Optional
  2117  	WebProxyAutoDiscoveryUrl js.String
  2118  
  2119  	FFI_USE_RoutingPrefix bool // for RoutingPrefix.
  2120  
  2121  	FFI_USE bool
  2122  }
  2123  
  2124  // FromRef calls UpdateFrom and returns a IPConfigProperties with all fields set.
  2125  func (p IPConfigProperties) FromRef(ref js.Ref) IPConfigProperties {
  2126  	p.UpdateFrom(ref)
  2127  	return p
  2128  }
  2129  
  2130  // New creates a new IPConfigProperties in the application heap.
  2131  func (p IPConfigProperties) New() js.Ref {
  2132  	return bindings.IPConfigPropertiesJSLoad(
  2133  		js.Pointer(&p), js.True, 0,
  2134  	)
  2135  }
  2136  
  2137  // UpdateFrom copies value of all fields of the heap object to p.
  2138  func (p *IPConfigProperties) UpdateFrom(ref js.Ref) {
  2139  	bindings.IPConfigPropertiesJSStore(
  2140  		js.Pointer(p), ref,
  2141  	)
  2142  }
  2143  
  2144  // Update writes all fields of the p to the heap object referenced by ref.
  2145  func (p *IPConfigProperties) Update(ref js.Ref) {
  2146  	bindings.IPConfigPropertiesJSLoad(
  2147  		js.Pointer(p), js.False, ref,
  2148  	)
  2149  }
  2150  
  2151  // FreeMembers frees fields with heap reference, if recursive is true
  2152  // free all heap references reachable from p.
  2153  func (p *IPConfigProperties) FreeMembers(recursive bool) {
  2154  	js.Free(
  2155  		p.Gateway.Ref(),
  2156  		p.IPAddress.Ref(),
  2157  		p.ExcludedRoutes.Ref(),
  2158  		p.IncludedRoutes.Ref(),
  2159  		p.NameServers.Ref(),
  2160  		p.SearchDomains.Ref(),
  2161  		p.Type.Ref(),
  2162  		p.WebProxyAutoDiscoveryUrl.Ref(),
  2163  	)
  2164  	p.Gateway = p.Gateway.FromRef(js.Undefined)
  2165  	p.IPAddress = p.IPAddress.FromRef(js.Undefined)
  2166  	p.ExcludedRoutes = p.ExcludedRoutes.FromRef(js.Undefined)
  2167  	p.IncludedRoutes = p.IncludedRoutes.FromRef(js.Undefined)
  2168  	p.NameServers = p.NameServers.FromRef(js.Undefined)
  2169  	p.SearchDomains = p.SearchDomains.FromRef(js.Undefined)
  2170  	p.Type = p.Type.FromRef(js.Undefined)
  2171  	p.WebProxyAutoDiscoveryUrl = p.WebProxyAutoDiscoveryUrl.FromRef(js.Undefined)
  2172  }
  2173  
  2174  type ManagedLong struct {
  2175  	// Active is "ManagedLong.Active"
  2176  	//
  2177  	// Optional
  2178  	//
  2179  	// NOTE: FFI_USE_Active MUST be set to true to make this field effective.
  2180  	Active int32
  2181  	// Effective is "ManagedLong.Effective"
  2182  	//
  2183  	// Optional
  2184  	Effective js.String
  2185  	// UserPolicy is "ManagedLong.UserPolicy"
  2186  	//
  2187  	// Optional
  2188  	//
  2189  	// NOTE: FFI_USE_UserPolicy MUST be set to true to make this field effective.
  2190  	UserPolicy int32
  2191  	// DevicePolicy is "ManagedLong.DevicePolicy"
  2192  	//
  2193  	// Optional
  2194  	//
  2195  	// NOTE: FFI_USE_DevicePolicy MUST be set to true to make this field effective.
  2196  	DevicePolicy int32
  2197  	// UserSetting is "ManagedLong.UserSetting"
  2198  	//
  2199  	// Optional
  2200  	//
  2201  	// NOTE: FFI_USE_UserSetting MUST be set to true to make this field effective.
  2202  	UserSetting int32
  2203  	// SharedSetting is "ManagedLong.SharedSetting"
  2204  	//
  2205  	// Optional
  2206  	//
  2207  	// NOTE: FFI_USE_SharedSetting MUST be set to true to make this field effective.
  2208  	SharedSetting int32
  2209  	// UserEditable is "ManagedLong.UserEditable"
  2210  	//
  2211  	// Optional
  2212  	//
  2213  	// NOTE: FFI_USE_UserEditable MUST be set to true to make this field effective.
  2214  	UserEditable bool
  2215  	// DeviceEditable is "ManagedLong.DeviceEditable"
  2216  	//
  2217  	// Optional
  2218  	//
  2219  	// NOTE: FFI_USE_DeviceEditable MUST be set to true to make this field effective.
  2220  	DeviceEditable bool
  2221  
  2222  	FFI_USE_Active         bool // for Active.
  2223  	FFI_USE_UserPolicy     bool // for UserPolicy.
  2224  	FFI_USE_DevicePolicy   bool // for DevicePolicy.
  2225  	FFI_USE_UserSetting    bool // for UserSetting.
  2226  	FFI_USE_SharedSetting  bool // for SharedSetting.
  2227  	FFI_USE_UserEditable   bool // for UserEditable.
  2228  	FFI_USE_DeviceEditable bool // for DeviceEditable.
  2229  
  2230  	FFI_USE bool
  2231  }
  2232  
  2233  // FromRef calls UpdateFrom and returns a ManagedLong with all fields set.
  2234  func (p ManagedLong) FromRef(ref js.Ref) ManagedLong {
  2235  	p.UpdateFrom(ref)
  2236  	return p
  2237  }
  2238  
  2239  // New creates a new ManagedLong in the application heap.
  2240  func (p ManagedLong) New() js.Ref {
  2241  	return bindings.ManagedLongJSLoad(
  2242  		js.Pointer(&p), js.True, 0,
  2243  	)
  2244  }
  2245  
  2246  // UpdateFrom copies value of all fields of the heap object to p.
  2247  func (p *ManagedLong) UpdateFrom(ref js.Ref) {
  2248  	bindings.ManagedLongJSStore(
  2249  		js.Pointer(p), ref,
  2250  	)
  2251  }
  2252  
  2253  // Update writes all fields of the p to the heap object referenced by ref.
  2254  func (p *ManagedLong) Update(ref js.Ref) {
  2255  	bindings.ManagedLongJSLoad(
  2256  		js.Pointer(p), js.False, ref,
  2257  	)
  2258  }
  2259  
  2260  // FreeMembers frees fields with heap reference, if recursive is true
  2261  // free all heap references reachable from p.
  2262  func (p *ManagedLong) FreeMembers(recursive bool) {
  2263  	js.Free(
  2264  		p.Effective.Ref(),
  2265  	)
  2266  	p.Effective = p.Effective.FromRef(js.Undefined)
  2267  }
  2268  
  2269  type ProxySettingsType uint32
  2270  
  2271  const (
  2272  	_ ProxySettingsType = iota
  2273  
  2274  	ProxySettingsType_DIRECT
  2275  	ProxySettingsType_MANUAL
  2276  	ProxySettingsType_PAC
  2277  	ProxySettingsType_WPAD
  2278  )
  2279  
  2280  func (ProxySettingsType) FromRef(str js.Ref) ProxySettingsType {
  2281  	return ProxySettingsType(bindings.ConstOfProxySettingsType(str))
  2282  }
  2283  
  2284  func (x ProxySettingsType) String() (string, bool) {
  2285  	switch x {
  2286  	case ProxySettingsType_DIRECT:
  2287  		return "Direct", true
  2288  	case ProxySettingsType_MANUAL:
  2289  		return "Manual", true
  2290  	case ProxySettingsType_PAC:
  2291  		return "PAC", true
  2292  	case ProxySettingsType_WPAD:
  2293  		return "WPAD", true
  2294  	default:
  2295  		return "", false
  2296  	}
  2297  }
  2298  
  2299  type ManagedProxySettingsType struct {
  2300  	// Active is "ManagedProxySettingsType.Active"
  2301  	//
  2302  	// Optional
  2303  	Active ProxySettingsType
  2304  	// Effective is "ManagedProxySettingsType.Effective"
  2305  	//
  2306  	// Optional
  2307  	Effective js.String
  2308  	// UserPolicy is "ManagedProxySettingsType.UserPolicy"
  2309  	//
  2310  	// Optional
  2311  	UserPolicy ProxySettingsType
  2312  	// DevicePolicy is "ManagedProxySettingsType.DevicePolicy"
  2313  	//
  2314  	// Optional
  2315  	DevicePolicy ProxySettingsType
  2316  	// UserSetting is "ManagedProxySettingsType.UserSetting"
  2317  	//
  2318  	// Optional
  2319  	UserSetting ProxySettingsType
  2320  	// SharedSetting is "ManagedProxySettingsType.SharedSetting"
  2321  	//
  2322  	// Optional
  2323  	SharedSetting ProxySettingsType
  2324  	// UserEditable is "ManagedProxySettingsType.UserEditable"
  2325  	//
  2326  	// Optional
  2327  	//
  2328  	// NOTE: FFI_USE_UserEditable MUST be set to true to make this field effective.
  2329  	UserEditable bool
  2330  	// DeviceEditable is "ManagedProxySettingsType.DeviceEditable"
  2331  	//
  2332  	// Optional
  2333  	//
  2334  	// NOTE: FFI_USE_DeviceEditable MUST be set to true to make this field effective.
  2335  	DeviceEditable bool
  2336  
  2337  	FFI_USE_UserEditable   bool // for UserEditable.
  2338  	FFI_USE_DeviceEditable bool // for DeviceEditable.
  2339  
  2340  	FFI_USE bool
  2341  }
  2342  
  2343  // FromRef calls UpdateFrom and returns a ManagedProxySettingsType with all fields set.
  2344  func (p ManagedProxySettingsType) FromRef(ref js.Ref) ManagedProxySettingsType {
  2345  	p.UpdateFrom(ref)
  2346  	return p
  2347  }
  2348  
  2349  // New creates a new ManagedProxySettingsType in the application heap.
  2350  func (p ManagedProxySettingsType) New() js.Ref {
  2351  	return bindings.ManagedProxySettingsTypeJSLoad(
  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 *ManagedProxySettingsType) UpdateFrom(ref js.Ref) {
  2358  	bindings.ManagedProxySettingsTypeJSStore(
  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 *ManagedProxySettingsType) Update(ref js.Ref) {
  2365  	bindings.ManagedProxySettingsTypeJSLoad(
  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 *ManagedProxySettingsType) FreeMembers(recursive bool) {
  2373  	js.Free(
  2374  		p.Effective.Ref(),
  2375  	)
  2376  	p.Effective = p.Effective.FromRef(js.Undefined)
  2377  }
  2378  
  2379  type ManagedProxyLocation struct {
  2380  	// Host is "ManagedProxyLocation.Host"
  2381  	//
  2382  	// Optional
  2383  	//
  2384  	// NOTE: Host.FFI_USE MUST be set to true to get Host used.
  2385  	Host ManagedDOMString
  2386  	// Port is "ManagedProxyLocation.Port"
  2387  	//
  2388  	// Optional
  2389  	//
  2390  	// NOTE: Port.FFI_USE MUST be set to true to get Port used.
  2391  	Port ManagedLong
  2392  
  2393  	FFI_USE bool
  2394  }
  2395  
  2396  // FromRef calls UpdateFrom and returns a ManagedProxyLocation with all fields set.
  2397  func (p ManagedProxyLocation) FromRef(ref js.Ref) ManagedProxyLocation {
  2398  	p.UpdateFrom(ref)
  2399  	return p
  2400  }
  2401  
  2402  // New creates a new ManagedProxyLocation in the application heap.
  2403  func (p ManagedProxyLocation) New() js.Ref {
  2404  	return bindings.ManagedProxyLocationJSLoad(
  2405  		js.Pointer(&p), js.True, 0,
  2406  	)
  2407  }
  2408  
  2409  // UpdateFrom copies value of all fields of the heap object to p.
  2410  func (p *ManagedProxyLocation) UpdateFrom(ref js.Ref) {
  2411  	bindings.ManagedProxyLocationJSStore(
  2412  		js.Pointer(p), ref,
  2413  	)
  2414  }
  2415  
  2416  // Update writes all fields of the p to the heap object referenced by ref.
  2417  func (p *ManagedProxyLocation) Update(ref js.Ref) {
  2418  	bindings.ManagedProxyLocationJSLoad(
  2419  		js.Pointer(p), js.False, ref,
  2420  	)
  2421  }
  2422  
  2423  // FreeMembers frees fields with heap reference, if recursive is true
  2424  // free all heap references reachable from p.
  2425  func (p *ManagedProxyLocation) FreeMembers(recursive bool) {
  2426  	if recursive {
  2427  		p.Host.FreeMembers(true)
  2428  		p.Port.FreeMembers(true)
  2429  	}
  2430  }
  2431  
  2432  type ManagedManualProxySettings struct {
  2433  	// HTTPProxy is "ManagedManualProxySettings.HTTPProxy"
  2434  	//
  2435  	// Optional
  2436  	//
  2437  	// NOTE: HTTPProxy.FFI_USE MUST be set to true to get HTTPProxy used.
  2438  	HTTPProxy ManagedProxyLocation
  2439  	// SecureHTTPProxy is "ManagedManualProxySettings.SecureHTTPProxy"
  2440  	//
  2441  	// Optional
  2442  	//
  2443  	// NOTE: SecureHTTPProxy.FFI_USE MUST be set to true to get SecureHTTPProxy used.
  2444  	SecureHTTPProxy ManagedProxyLocation
  2445  	// FTPProxy is "ManagedManualProxySettings.FTPProxy"
  2446  	//
  2447  	// Optional
  2448  	//
  2449  	// NOTE: FTPProxy.FFI_USE MUST be set to true to get FTPProxy used.
  2450  	FTPProxy ManagedProxyLocation
  2451  	// SOCKS is "ManagedManualProxySettings.SOCKS"
  2452  	//
  2453  	// Optional
  2454  	//
  2455  	// NOTE: SOCKS.FFI_USE MUST be set to true to get SOCKS used.
  2456  	SOCKS ManagedProxyLocation
  2457  
  2458  	FFI_USE bool
  2459  }
  2460  
  2461  // FromRef calls UpdateFrom and returns a ManagedManualProxySettings with all fields set.
  2462  func (p ManagedManualProxySettings) FromRef(ref js.Ref) ManagedManualProxySettings {
  2463  	p.UpdateFrom(ref)
  2464  	return p
  2465  }
  2466  
  2467  // New creates a new ManagedManualProxySettings in the application heap.
  2468  func (p ManagedManualProxySettings) New() js.Ref {
  2469  	return bindings.ManagedManualProxySettingsJSLoad(
  2470  		js.Pointer(&p), js.True, 0,
  2471  	)
  2472  }
  2473  
  2474  // UpdateFrom copies value of all fields of the heap object to p.
  2475  func (p *ManagedManualProxySettings) UpdateFrom(ref js.Ref) {
  2476  	bindings.ManagedManualProxySettingsJSStore(
  2477  		js.Pointer(p), ref,
  2478  	)
  2479  }
  2480  
  2481  // Update writes all fields of the p to the heap object referenced by ref.
  2482  func (p *ManagedManualProxySettings) Update(ref js.Ref) {
  2483  	bindings.ManagedManualProxySettingsJSLoad(
  2484  		js.Pointer(p), js.False, ref,
  2485  	)
  2486  }
  2487  
  2488  // FreeMembers frees fields with heap reference, if recursive is true
  2489  // free all heap references reachable from p.
  2490  func (p *ManagedManualProxySettings) FreeMembers(recursive bool) {
  2491  	if recursive {
  2492  		p.HTTPProxy.FreeMembers(true)
  2493  		p.SecureHTTPProxy.FreeMembers(true)
  2494  		p.FTPProxy.FreeMembers(true)
  2495  		p.SOCKS.FreeMembers(true)
  2496  	}
  2497  }
  2498  
  2499  type ManagedDOMStringList struct {
  2500  	// Active is "ManagedDOMStringList.Active"
  2501  	//
  2502  	// Optional
  2503  	Active js.Array[js.String]
  2504  	// Effective is "ManagedDOMStringList.Effective"
  2505  	//
  2506  	// Optional
  2507  	Effective js.String
  2508  	// UserPolicy is "ManagedDOMStringList.UserPolicy"
  2509  	//
  2510  	// Optional
  2511  	UserPolicy js.Array[js.String]
  2512  	// DevicePolicy is "ManagedDOMStringList.DevicePolicy"
  2513  	//
  2514  	// Optional
  2515  	DevicePolicy js.Array[js.String]
  2516  	// UserSetting is "ManagedDOMStringList.UserSetting"
  2517  	//
  2518  	// Optional
  2519  	UserSetting js.Array[js.String]
  2520  	// SharedSetting is "ManagedDOMStringList.SharedSetting"
  2521  	//
  2522  	// Optional
  2523  	SharedSetting js.Array[js.String]
  2524  	// UserEditable is "ManagedDOMStringList.UserEditable"
  2525  	//
  2526  	// Optional
  2527  	//
  2528  	// NOTE: FFI_USE_UserEditable MUST be set to true to make this field effective.
  2529  	UserEditable bool
  2530  	// DeviceEditable is "ManagedDOMStringList.DeviceEditable"
  2531  	//
  2532  	// Optional
  2533  	//
  2534  	// NOTE: FFI_USE_DeviceEditable MUST be set to true to make this field effective.
  2535  	DeviceEditable bool
  2536  
  2537  	FFI_USE_UserEditable   bool // for UserEditable.
  2538  	FFI_USE_DeviceEditable bool // for DeviceEditable.
  2539  
  2540  	FFI_USE bool
  2541  }
  2542  
  2543  // FromRef calls UpdateFrom and returns a ManagedDOMStringList with all fields set.
  2544  func (p ManagedDOMStringList) FromRef(ref js.Ref) ManagedDOMStringList {
  2545  	p.UpdateFrom(ref)
  2546  	return p
  2547  }
  2548  
  2549  // New creates a new ManagedDOMStringList in the application heap.
  2550  func (p ManagedDOMStringList) New() js.Ref {
  2551  	return bindings.ManagedDOMStringListJSLoad(
  2552  		js.Pointer(&p), js.True, 0,
  2553  	)
  2554  }
  2555  
  2556  // UpdateFrom copies value of all fields of the heap object to p.
  2557  func (p *ManagedDOMStringList) UpdateFrom(ref js.Ref) {
  2558  	bindings.ManagedDOMStringListJSStore(
  2559  		js.Pointer(p), ref,
  2560  	)
  2561  }
  2562  
  2563  // Update writes all fields of the p to the heap object referenced by ref.
  2564  func (p *ManagedDOMStringList) Update(ref js.Ref) {
  2565  	bindings.ManagedDOMStringListJSLoad(
  2566  		js.Pointer(p), js.False, ref,
  2567  	)
  2568  }
  2569  
  2570  // FreeMembers frees fields with heap reference, if recursive is true
  2571  // free all heap references reachable from p.
  2572  func (p *ManagedDOMStringList) FreeMembers(recursive bool) {
  2573  	js.Free(
  2574  		p.Active.Ref(),
  2575  		p.Effective.Ref(),
  2576  		p.UserPolicy.Ref(),
  2577  		p.DevicePolicy.Ref(),
  2578  		p.UserSetting.Ref(),
  2579  		p.SharedSetting.Ref(),
  2580  	)
  2581  	p.Active = p.Active.FromRef(js.Undefined)
  2582  	p.Effective = p.Effective.FromRef(js.Undefined)
  2583  	p.UserPolicy = p.UserPolicy.FromRef(js.Undefined)
  2584  	p.DevicePolicy = p.DevicePolicy.FromRef(js.Undefined)
  2585  	p.UserSetting = p.UserSetting.FromRef(js.Undefined)
  2586  	p.SharedSetting = p.SharedSetting.FromRef(js.Undefined)
  2587  }
  2588  
  2589  type ManagedProxySettings struct {
  2590  	// Type is "ManagedProxySettings.Type"
  2591  	//
  2592  	// Optional
  2593  	//
  2594  	// NOTE: Type.FFI_USE MUST be set to true to get Type used.
  2595  	Type ManagedProxySettingsType
  2596  	// Manual is "ManagedProxySettings.Manual"
  2597  	//
  2598  	// Optional
  2599  	//
  2600  	// NOTE: Manual.FFI_USE MUST be set to true to get Manual used.
  2601  	Manual ManagedManualProxySettings
  2602  	// ExcludeDomains is "ManagedProxySettings.ExcludeDomains"
  2603  	//
  2604  	// Optional
  2605  	//
  2606  	// NOTE: ExcludeDomains.FFI_USE MUST be set to true to get ExcludeDomains used.
  2607  	ExcludeDomains ManagedDOMStringList
  2608  	// PAC is "ManagedProxySettings.PAC"
  2609  	//
  2610  	// Optional
  2611  	//
  2612  	// NOTE: PAC.FFI_USE MUST be set to true to get PAC used.
  2613  	PAC ManagedDOMString
  2614  
  2615  	FFI_USE bool
  2616  }
  2617  
  2618  // FromRef calls UpdateFrom and returns a ManagedProxySettings with all fields set.
  2619  func (p ManagedProxySettings) FromRef(ref js.Ref) ManagedProxySettings {
  2620  	p.UpdateFrom(ref)
  2621  	return p
  2622  }
  2623  
  2624  // New creates a new ManagedProxySettings in the application heap.
  2625  func (p ManagedProxySettings) New() js.Ref {
  2626  	return bindings.ManagedProxySettingsJSLoad(
  2627  		js.Pointer(&p), js.True, 0,
  2628  	)
  2629  }
  2630  
  2631  // UpdateFrom copies value of all fields of the heap object to p.
  2632  func (p *ManagedProxySettings) UpdateFrom(ref js.Ref) {
  2633  	bindings.ManagedProxySettingsJSStore(
  2634  		js.Pointer(p), ref,
  2635  	)
  2636  }
  2637  
  2638  // Update writes all fields of the p to the heap object referenced by ref.
  2639  func (p *ManagedProxySettings) Update(ref js.Ref) {
  2640  	bindings.ManagedProxySettingsJSLoad(
  2641  		js.Pointer(p), js.False, ref,
  2642  	)
  2643  }
  2644  
  2645  // FreeMembers frees fields with heap reference, if recursive is true
  2646  // free all heap references reachable from p.
  2647  func (p *ManagedProxySettings) FreeMembers(recursive bool) {
  2648  	if recursive {
  2649  		p.Type.FreeMembers(true)
  2650  		p.Manual.FreeMembers(true)
  2651  		p.ExcludeDomains.FreeMembers(true)
  2652  		p.PAC.FreeMembers(true)
  2653  	}
  2654  }
  2655  
  2656  type ManagedIPConfigProperties struct {
  2657  	// Gateway is "ManagedIPConfigProperties.Gateway"
  2658  	//
  2659  	// Optional
  2660  	//
  2661  	// NOTE: Gateway.FFI_USE MUST be set to true to get Gateway used.
  2662  	Gateway ManagedDOMString
  2663  	// IPAddress is "ManagedIPConfigProperties.IPAddress"
  2664  	//
  2665  	// Optional
  2666  	//
  2667  	// NOTE: IPAddress.FFI_USE MUST be set to true to get IPAddress used.
  2668  	IPAddress ManagedDOMString
  2669  	// NameServers is "ManagedIPConfigProperties.NameServers"
  2670  	//
  2671  	// Optional
  2672  	//
  2673  	// NOTE: NameServers.FFI_USE MUST be set to true to get NameServers used.
  2674  	NameServers ManagedDOMStringList
  2675  	// RoutingPrefix is "ManagedIPConfigProperties.RoutingPrefix"
  2676  	//
  2677  	// Optional
  2678  	//
  2679  	// NOTE: RoutingPrefix.FFI_USE MUST be set to true to get RoutingPrefix used.
  2680  	RoutingPrefix ManagedLong
  2681  	// Type is "ManagedIPConfigProperties.Type"
  2682  	//
  2683  	// Optional
  2684  	//
  2685  	// NOTE: Type.FFI_USE MUST be set to true to get Type used.
  2686  	Type ManagedDOMString
  2687  	// WebProxyAutoDiscoveryUrl is "ManagedIPConfigProperties.WebProxyAutoDiscoveryUrl"
  2688  	//
  2689  	// Optional
  2690  	//
  2691  	// NOTE: WebProxyAutoDiscoveryUrl.FFI_USE MUST be set to true to get WebProxyAutoDiscoveryUrl used.
  2692  	WebProxyAutoDiscoveryUrl ManagedDOMString
  2693  
  2694  	FFI_USE bool
  2695  }
  2696  
  2697  // FromRef calls UpdateFrom and returns a ManagedIPConfigProperties with all fields set.
  2698  func (p ManagedIPConfigProperties) FromRef(ref js.Ref) ManagedIPConfigProperties {
  2699  	p.UpdateFrom(ref)
  2700  	return p
  2701  }
  2702  
  2703  // New creates a new ManagedIPConfigProperties in the application heap.
  2704  func (p ManagedIPConfigProperties) New() js.Ref {
  2705  	return bindings.ManagedIPConfigPropertiesJSLoad(
  2706  		js.Pointer(&p), js.True, 0,
  2707  	)
  2708  }
  2709  
  2710  // UpdateFrom copies value of all fields of the heap object to p.
  2711  func (p *ManagedIPConfigProperties) UpdateFrom(ref js.Ref) {
  2712  	bindings.ManagedIPConfigPropertiesJSStore(
  2713  		js.Pointer(p), ref,
  2714  	)
  2715  }
  2716  
  2717  // Update writes all fields of the p to the heap object referenced by ref.
  2718  func (p *ManagedIPConfigProperties) Update(ref js.Ref) {
  2719  	bindings.ManagedIPConfigPropertiesJSLoad(
  2720  		js.Pointer(p), js.False, ref,
  2721  	)
  2722  }
  2723  
  2724  // FreeMembers frees fields with heap reference, if recursive is true
  2725  // free all heap references reachable from p.
  2726  func (p *ManagedIPConfigProperties) FreeMembers(recursive bool) {
  2727  	if recursive {
  2728  		p.Gateway.FreeMembers(true)
  2729  		p.IPAddress.FreeMembers(true)
  2730  		p.NameServers.FreeMembers(true)
  2731  		p.RoutingPrefix.FreeMembers(true)
  2732  		p.Type.FreeMembers(true)
  2733  		p.WebProxyAutoDiscoveryUrl.FreeMembers(true)
  2734  	}
  2735  }
  2736  
  2737  type ManagedVPNProperties struct {
  2738  	// AutoConnect is "ManagedVPNProperties.AutoConnect"
  2739  	//
  2740  	// Optional
  2741  	//
  2742  	// NOTE: AutoConnect.FFI_USE MUST be set to true to get AutoConnect used.
  2743  	AutoConnect ManagedBoolean
  2744  	// Host is "ManagedVPNProperties.Host"
  2745  	//
  2746  	// Optional
  2747  	//
  2748  	// NOTE: Host.FFI_USE MUST be set to true to get Host used.
  2749  	Host ManagedDOMString
  2750  	// Type is "ManagedVPNProperties.Type"
  2751  	//
  2752  	// Optional
  2753  	//
  2754  	// NOTE: Type.FFI_USE MUST be set to true to get Type used.
  2755  	Type ManagedDOMString
  2756  
  2757  	FFI_USE bool
  2758  }
  2759  
  2760  // FromRef calls UpdateFrom and returns a ManagedVPNProperties with all fields set.
  2761  func (p ManagedVPNProperties) FromRef(ref js.Ref) ManagedVPNProperties {
  2762  	p.UpdateFrom(ref)
  2763  	return p
  2764  }
  2765  
  2766  // New creates a new ManagedVPNProperties in the application heap.
  2767  func (p ManagedVPNProperties) New() js.Ref {
  2768  	return bindings.ManagedVPNPropertiesJSLoad(
  2769  		js.Pointer(&p), js.True, 0,
  2770  	)
  2771  }
  2772  
  2773  // UpdateFrom copies value of all fields of the heap object to p.
  2774  func (p *ManagedVPNProperties) UpdateFrom(ref js.Ref) {
  2775  	bindings.ManagedVPNPropertiesJSStore(
  2776  		js.Pointer(p), ref,
  2777  	)
  2778  }
  2779  
  2780  // Update writes all fields of the p to the heap object referenced by ref.
  2781  func (p *ManagedVPNProperties) Update(ref js.Ref) {
  2782  	bindings.ManagedVPNPropertiesJSLoad(
  2783  		js.Pointer(p), js.False, ref,
  2784  	)
  2785  }
  2786  
  2787  // FreeMembers frees fields with heap reference, if recursive is true
  2788  // free all heap references reachable from p.
  2789  func (p *ManagedVPNProperties) FreeMembers(recursive bool) {
  2790  	if recursive {
  2791  		p.AutoConnect.FreeMembers(true)
  2792  		p.Host.FreeMembers(true)
  2793  		p.Type.FreeMembers(true)
  2794  	}
  2795  }
  2796  
  2797  type ManagedWiFiProperties struct {
  2798  	// AllowGatewayARPPolling is "ManagedWiFiProperties.AllowGatewayARPPolling"
  2799  	//
  2800  	// Optional
  2801  	//
  2802  	// NOTE: AllowGatewayARPPolling.FFI_USE MUST be set to true to get AllowGatewayARPPolling used.
  2803  	AllowGatewayARPPolling ManagedBoolean
  2804  	// AutoConnect is "ManagedWiFiProperties.AutoConnect"
  2805  	//
  2806  	// Optional
  2807  	//
  2808  	// NOTE: AutoConnect.FFI_USE MUST be set to true to get AutoConnect used.
  2809  	AutoConnect ManagedBoolean
  2810  	// BSSID is "ManagedWiFiProperties.BSSID"
  2811  	//
  2812  	// Optional
  2813  	BSSID js.String
  2814  	// Frequency is "ManagedWiFiProperties.Frequency"
  2815  	//
  2816  	// Optional
  2817  	//
  2818  	// NOTE: FFI_USE_Frequency MUST be set to true to make this field effective.
  2819  	Frequency int32
  2820  	// FrequencyList is "ManagedWiFiProperties.FrequencyList"
  2821  	//
  2822  	// Optional
  2823  	FrequencyList js.Array[int32]
  2824  	// HexSSID is "ManagedWiFiProperties.HexSSID"
  2825  	//
  2826  	// Optional
  2827  	//
  2828  	// NOTE: HexSSID.FFI_USE MUST be set to true to get HexSSID used.
  2829  	HexSSID ManagedDOMString
  2830  	// HiddenSSID is "ManagedWiFiProperties.HiddenSSID"
  2831  	//
  2832  	// Optional
  2833  	//
  2834  	// NOTE: HiddenSSID.FFI_USE MUST be set to true to get HiddenSSID used.
  2835  	HiddenSSID ManagedBoolean
  2836  	// RoamThreshold is "ManagedWiFiProperties.RoamThreshold"
  2837  	//
  2838  	// Optional
  2839  	//
  2840  	// NOTE: RoamThreshold.FFI_USE MUST be set to true to get RoamThreshold used.
  2841  	RoamThreshold ManagedLong
  2842  	// SSID is "ManagedWiFiProperties.SSID"
  2843  	//
  2844  	// Optional
  2845  	//
  2846  	// NOTE: SSID.FFI_USE MUST be set to true to get SSID used.
  2847  	SSID ManagedDOMString
  2848  	// Security is "ManagedWiFiProperties.Security"
  2849  	//
  2850  	// Optional
  2851  	//
  2852  	// NOTE: Security.FFI_USE MUST be set to true to get Security used.
  2853  	Security ManagedDOMString
  2854  	// SignalStrength is "ManagedWiFiProperties.SignalStrength"
  2855  	//
  2856  	// Optional
  2857  	//
  2858  	// NOTE: FFI_USE_SignalStrength MUST be set to true to make this field effective.
  2859  	SignalStrength int32
  2860  
  2861  	FFI_USE_Frequency      bool // for Frequency.
  2862  	FFI_USE_SignalStrength bool // for SignalStrength.
  2863  
  2864  	FFI_USE bool
  2865  }
  2866  
  2867  // FromRef calls UpdateFrom and returns a ManagedWiFiProperties with all fields set.
  2868  func (p ManagedWiFiProperties) FromRef(ref js.Ref) ManagedWiFiProperties {
  2869  	p.UpdateFrom(ref)
  2870  	return p
  2871  }
  2872  
  2873  // New creates a new ManagedWiFiProperties in the application heap.
  2874  func (p ManagedWiFiProperties) New() js.Ref {
  2875  	return bindings.ManagedWiFiPropertiesJSLoad(
  2876  		js.Pointer(&p), js.True, 0,
  2877  	)
  2878  }
  2879  
  2880  // UpdateFrom copies value of all fields of the heap object to p.
  2881  func (p *ManagedWiFiProperties) UpdateFrom(ref js.Ref) {
  2882  	bindings.ManagedWiFiPropertiesJSStore(
  2883  		js.Pointer(p), ref,
  2884  	)
  2885  }
  2886  
  2887  // Update writes all fields of the p to the heap object referenced by ref.
  2888  func (p *ManagedWiFiProperties) Update(ref js.Ref) {
  2889  	bindings.ManagedWiFiPropertiesJSLoad(
  2890  		js.Pointer(p), js.False, ref,
  2891  	)
  2892  }
  2893  
  2894  // FreeMembers frees fields with heap reference, if recursive is true
  2895  // free all heap references reachable from p.
  2896  func (p *ManagedWiFiProperties) FreeMembers(recursive bool) {
  2897  	js.Free(
  2898  		p.BSSID.Ref(),
  2899  		p.FrequencyList.Ref(),
  2900  	)
  2901  	p.BSSID = p.BSSID.FromRef(js.Undefined)
  2902  	p.FrequencyList = p.FrequencyList.FromRef(js.Undefined)
  2903  	if recursive {
  2904  		p.AllowGatewayARPPolling.FreeMembers(true)
  2905  		p.AutoConnect.FreeMembers(true)
  2906  		p.HexSSID.FreeMembers(true)
  2907  		p.HiddenSSID.FreeMembers(true)
  2908  		p.RoamThreshold.FreeMembers(true)
  2909  		p.SSID.FreeMembers(true)
  2910  		p.Security.FreeMembers(true)
  2911  	}
  2912  }
  2913  
  2914  type ManagedProperties struct {
  2915  	// Cellular is "ManagedProperties.Cellular"
  2916  	//
  2917  	// Optional
  2918  	//
  2919  	// NOTE: Cellular.FFI_USE MUST be set to true to get Cellular used.
  2920  	Cellular ManagedCellularProperties
  2921  	// Connectable is "ManagedProperties.Connectable"
  2922  	//
  2923  	// Optional
  2924  	//
  2925  	// NOTE: FFI_USE_Connectable MUST be set to true to make this field effective.
  2926  	Connectable bool
  2927  	// ConnectionState is "ManagedProperties.ConnectionState"
  2928  	//
  2929  	// Optional
  2930  	ConnectionState ConnectionStateType
  2931  	// ErrorState is "ManagedProperties.ErrorState"
  2932  	//
  2933  	// Optional
  2934  	ErrorState js.String
  2935  	// Ethernet is "ManagedProperties.Ethernet"
  2936  	//
  2937  	// Optional
  2938  	//
  2939  	// NOTE: Ethernet.FFI_USE MUST be set to true to get Ethernet used.
  2940  	Ethernet ManagedEthernetProperties
  2941  	// GUID is "ManagedProperties.GUID"
  2942  	//
  2943  	// Optional
  2944  	GUID js.String
  2945  	// IPAddressConfigType is "ManagedProperties.IPAddressConfigType"
  2946  	//
  2947  	// Optional
  2948  	//
  2949  	// NOTE: IPAddressConfigType.FFI_USE MUST be set to true to get IPAddressConfigType used.
  2950  	IPAddressConfigType ManagedIPConfigType
  2951  	// IPConfigs is "ManagedProperties.IPConfigs"
  2952  	//
  2953  	// Optional
  2954  	IPConfigs js.Array[IPConfigProperties]
  2955  	// MacAddress is "ManagedProperties.MacAddress"
  2956  	//
  2957  	// Optional
  2958  	MacAddress js.String
  2959  	// Metered is "ManagedProperties.Metered"
  2960  	//
  2961  	// Optional
  2962  	//
  2963  	// NOTE: Metered.FFI_USE MUST be set to true to get Metered used.
  2964  	Metered ManagedBoolean
  2965  	// Name is "ManagedProperties.Name"
  2966  	//
  2967  	// Optional
  2968  	//
  2969  	// NOTE: Name.FFI_USE MUST be set to true to get Name used.
  2970  	Name ManagedDOMString
  2971  	// NameServersConfigType is "ManagedProperties.NameServersConfigType"
  2972  	//
  2973  	// Optional
  2974  	//
  2975  	// NOTE: NameServersConfigType.FFI_USE MUST be set to true to get NameServersConfigType used.
  2976  	NameServersConfigType ManagedIPConfigType
  2977  	// Priority is "ManagedProperties.Priority"
  2978  	//
  2979  	// Optional
  2980  	//
  2981  	// NOTE: Priority.FFI_USE MUST be set to true to get Priority used.
  2982  	Priority ManagedLong
  2983  	// ProxySettings is "ManagedProperties.ProxySettings"
  2984  	//
  2985  	// Optional
  2986  	//
  2987  	// NOTE: ProxySettings.FFI_USE MUST be set to true to get ProxySettings used.
  2988  	ProxySettings ManagedProxySettings
  2989  	// RestrictedConnectivity is "ManagedProperties.RestrictedConnectivity"
  2990  	//
  2991  	// Optional
  2992  	//
  2993  	// NOTE: FFI_USE_RestrictedConnectivity MUST be set to true to make this field effective.
  2994  	RestrictedConnectivity bool
  2995  	// StaticIPConfig is "ManagedProperties.StaticIPConfig"
  2996  	//
  2997  	// Optional
  2998  	//
  2999  	// NOTE: StaticIPConfig.FFI_USE MUST be set to true to get StaticIPConfig used.
  3000  	StaticIPConfig ManagedIPConfigProperties
  3001  	// SavedIPConfig is "ManagedProperties.SavedIPConfig"
  3002  	//
  3003  	// Optional
  3004  	//
  3005  	// NOTE: SavedIPConfig.FFI_USE MUST be set to true to get SavedIPConfig used.
  3006  	SavedIPConfig IPConfigProperties
  3007  	// Source is "ManagedProperties.Source"
  3008  	//
  3009  	// Optional
  3010  	Source js.String
  3011  	// Type is "ManagedProperties.Type"
  3012  	//
  3013  	// Optional
  3014  	Type NetworkType
  3015  	// VPN is "ManagedProperties.VPN"
  3016  	//
  3017  	// Optional
  3018  	//
  3019  	// NOTE: VPN.FFI_USE MUST be set to true to get VPN used.
  3020  	VPN ManagedVPNProperties
  3021  	// WiFi is "ManagedProperties.WiFi"
  3022  	//
  3023  	// Optional
  3024  	//
  3025  	// NOTE: WiFi.FFI_USE MUST be set to true to get WiFi used.
  3026  	WiFi ManagedWiFiProperties
  3027  
  3028  	FFI_USE_Connectable            bool // for Connectable.
  3029  	FFI_USE_RestrictedConnectivity bool // for RestrictedConnectivity.
  3030  
  3031  	FFI_USE bool
  3032  }
  3033  
  3034  // FromRef calls UpdateFrom and returns a ManagedProperties with all fields set.
  3035  func (p ManagedProperties) FromRef(ref js.Ref) ManagedProperties {
  3036  	p.UpdateFrom(ref)
  3037  	return p
  3038  }
  3039  
  3040  // New creates a new ManagedProperties in the application heap.
  3041  func (p ManagedProperties) New() js.Ref {
  3042  	return bindings.ManagedPropertiesJSLoad(
  3043  		js.Pointer(&p), js.True, 0,
  3044  	)
  3045  }
  3046  
  3047  // UpdateFrom copies value of all fields of the heap object to p.
  3048  func (p *ManagedProperties) UpdateFrom(ref js.Ref) {
  3049  	bindings.ManagedPropertiesJSStore(
  3050  		js.Pointer(p), ref,
  3051  	)
  3052  }
  3053  
  3054  // Update writes all fields of the p to the heap object referenced by ref.
  3055  func (p *ManagedProperties) Update(ref js.Ref) {
  3056  	bindings.ManagedPropertiesJSLoad(
  3057  		js.Pointer(p), js.False, ref,
  3058  	)
  3059  }
  3060  
  3061  // FreeMembers frees fields with heap reference, if recursive is true
  3062  // free all heap references reachable from p.
  3063  func (p *ManagedProperties) FreeMembers(recursive bool) {
  3064  	js.Free(
  3065  		p.ErrorState.Ref(),
  3066  		p.GUID.Ref(),
  3067  		p.IPConfigs.Ref(),
  3068  		p.MacAddress.Ref(),
  3069  		p.Source.Ref(),
  3070  	)
  3071  	p.ErrorState = p.ErrorState.FromRef(js.Undefined)
  3072  	p.GUID = p.GUID.FromRef(js.Undefined)
  3073  	p.IPConfigs = p.IPConfigs.FromRef(js.Undefined)
  3074  	p.MacAddress = p.MacAddress.FromRef(js.Undefined)
  3075  	p.Source = p.Source.FromRef(js.Undefined)
  3076  	if recursive {
  3077  		p.Cellular.FreeMembers(true)
  3078  		p.Ethernet.FreeMembers(true)
  3079  		p.IPAddressConfigType.FreeMembers(true)
  3080  		p.Metered.FreeMembers(true)
  3081  		p.Name.FreeMembers(true)
  3082  		p.NameServersConfigType.FreeMembers(true)
  3083  		p.Priority.FreeMembers(true)
  3084  		p.ProxySettings.FreeMembers(true)
  3085  		p.StaticIPConfig.FreeMembers(true)
  3086  		p.SavedIPConfig.FreeMembers(true)
  3087  		p.VPN.FreeMembers(true)
  3088  		p.WiFi.FreeMembers(true)
  3089  	}
  3090  }
  3091  
  3092  type GetNetworksCallbackFunc func(this js.Ref, result js.Array[NetworkStateProperties]) js.Ref
  3093  
  3094  func (fn GetNetworksCallbackFunc) Register() js.Func[func(result js.Array[NetworkStateProperties])] {
  3095  	return js.RegisterCallback[func(result js.Array[NetworkStateProperties])](
  3096  		fn, abi.FuncPCABIInternal(fn),
  3097  	)
  3098  }
  3099  
  3100  func (fn GetNetworksCallbackFunc) DispatchCallback(
  3101  	targetPC uintptr, ctx *js.CallbackContext,
  3102  ) {
  3103  	args := ctx.Args()
  3104  	if len(args) != 1+1 /* js this */ ||
  3105  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  3106  		js.ThrowInvalidCallbackInvocation()
  3107  	}
  3108  
  3109  	if ctx.Return(fn(
  3110  		args[0],
  3111  
  3112  		js.Array[NetworkStateProperties]{}.FromRef(args[0+1]),
  3113  	)) {
  3114  		return
  3115  	}
  3116  
  3117  	js.ThrowCallbackValueNotReturned()
  3118  }
  3119  
  3120  type GetNetworksCallback[T any] struct {
  3121  	Fn  func(arg T, this js.Ref, result js.Array[NetworkStateProperties]) js.Ref
  3122  	Arg T
  3123  }
  3124  
  3125  func (cb *GetNetworksCallback[T]) Register() js.Func[func(result js.Array[NetworkStateProperties])] {
  3126  	return js.RegisterCallback[func(result js.Array[NetworkStateProperties])](
  3127  		cb, abi.FuncPCABIInternal(cb.Fn),
  3128  	)
  3129  }
  3130  
  3131  func (cb *GetNetworksCallback[T]) DispatchCallback(
  3132  	targetPC uintptr, ctx *js.CallbackContext,
  3133  ) {
  3134  	args := ctx.Args()
  3135  	if len(args) != 1+1 /* js this */ ||
  3136  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  3137  		js.ThrowInvalidCallbackInvocation()
  3138  	}
  3139  
  3140  	if ctx.Return(cb.Fn(
  3141  		cb.Arg,
  3142  		args[0],
  3143  
  3144  		js.Array[NetworkStateProperties]{}.FromRef(args[0+1]),
  3145  	)) {
  3146  		return
  3147  	}
  3148  
  3149  	js.ThrowCallbackValueNotReturned()
  3150  }
  3151  
  3152  type VPNStateProperties struct {
  3153  	// Type is "VPNStateProperties.Type"
  3154  	//
  3155  	// Optional
  3156  	Type js.String
  3157  
  3158  	FFI_USE bool
  3159  }
  3160  
  3161  // FromRef calls UpdateFrom and returns a VPNStateProperties with all fields set.
  3162  func (p VPNStateProperties) FromRef(ref js.Ref) VPNStateProperties {
  3163  	p.UpdateFrom(ref)
  3164  	return p
  3165  }
  3166  
  3167  // New creates a new VPNStateProperties in the application heap.
  3168  func (p VPNStateProperties) New() js.Ref {
  3169  	return bindings.VPNStatePropertiesJSLoad(
  3170  		js.Pointer(&p), js.True, 0,
  3171  	)
  3172  }
  3173  
  3174  // UpdateFrom copies value of all fields of the heap object to p.
  3175  func (p *VPNStateProperties) UpdateFrom(ref js.Ref) {
  3176  	bindings.VPNStatePropertiesJSStore(
  3177  		js.Pointer(p), ref,
  3178  	)
  3179  }
  3180  
  3181  // Update writes all fields of the p to the heap object referenced by ref.
  3182  func (p *VPNStateProperties) Update(ref js.Ref) {
  3183  	bindings.VPNStatePropertiesJSLoad(
  3184  		js.Pointer(p), js.False, ref,
  3185  	)
  3186  }
  3187  
  3188  // FreeMembers frees fields with heap reference, if recursive is true
  3189  // free all heap references reachable from p.
  3190  func (p *VPNStateProperties) FreeMembers(recursive bool) {
  3191  	js.Free(
  3192  		p.Type.Ref(),
  3193  	)
  3194  	p.Type = p.Type.FromRef(js.Undefined)
  3195  }
  3196  
  3197  type WiFiStateProperties struct {
  3198  	// BSSID is "WiFiStateProperties.BSSID"
  3199  	//
  3200  	// Optional
  3201  	BSSID js.String
  3202  	// Frequency is "WiFiStateProperties.Frequency"
  3203  	//
  3204  	// Optional
  3205  	//
  3206  	// NOTE: FFI_USE_Frequency MUST be set to true to make this field effective.
  3207  	Frequency int32
  3208  	// HexSSID is "WiFiStateProperties.HexSSID"
  3209  	//
  3210  	// Optional
  3211  	HexSSID js.String
  3212  	// Security is "WiFiStateProperties.Security"
  3213  	//
  3214  	// Optional
  3215  	Security js.String
  3216  	// SignalStrength is "WiFiStateProperties.SignalStrength"
  3217  	//
  3218  	// Optional
  3219  	//
  3220  	// NOTE: FFI_USE_SignalStrength MUST be set to true to make this field effective.
  3221  	SignalStrength int32
  3222  	// SSID is "WiFiStateProperties.SSID"
  3223  	//
  3224  	// Optional
  3225  	SSID js.String
  3226  
  3227  	FFI_USE_Frequency      bool // for Frequency.
  3228  	FFI_USE_SignalStrength bool // for SignalStrength.
  3229  
  3230  	FFI_USE bool
  3231  }
  3232  
  3233  // FromRef calls UpdateFrom and returns a WiFiStateProperties with all fields set.
  3234  func (p WiFiStateProperties) FromRef(ref js.Ref) WiFiStateProperties {
  3235  	p.UpdateFrom(ref)
  3236  	return p
  3237  }
  3238  
  3239  // New creates a new WiFiStateProperties in the application heap.
  3240  func (p WiFiStateProperties) New() js.Ref {
  3241  	return bindings.WiFiStatePropertiesJSLoad(
  3242  		js.Pointer(&p), js.True, 0,
  3243  	)
  3244  }
  3245  
  3246  // UpdateFrom copies value of all fields of the heap object to p.
  3247  func (p *WiFiStateProperties) UpdateFrom(ref js.Ref) {
  3248  	bindings.WiFiStatePropertiesJSStore(
  3249  		js.Pointer(p), ref,
  3250  	)
  3251  }
  3252  
  3253  // Update writes all fields of the p to the heap object referenced by ref.
  3254  func (p *WiFiStateProperties) Update(ref js.Ref) {
  3255  	bindings.WiFiStatePropertiesJSLoad(
  3256  		js.Pointer(p), js.False, ref,
  3257  	)
  3258  }
  3259  
  3260  // FreeMembers frees fields with heap reference, if recursive is true
  3261  // free all heap references reachable from p.
  3262  func (p *WiFiStateProperties) FreeMembers(recursive bool) {
  3263  	js.Free(
  3264  		p.BSSID.Ref(),
  3265  		p.HexSSID.Ref(),
  3266  		p.Security.Ref(),
  3267  		p.SSID.Ref(),
  3268  	)
  3269  	p.BSSID = p.BSSID.FromRef(js.Undefined)
  3270  	p.HexSSID = p.HexSSID.FromRef(js.Undefined)
  3271  	p.Security = p.Security.FromRef(js.Undefined)
  3272  	p.SSID = p.SSID.FromRef(js.Undefined)
  3273  }
  3274  
  3275  type NetworkStateProperties struct {
  3276  	// Cellular is "NetworkStateProperties.Cellular"
  3277  	//
  3278  	// Optional
  3279  	//
  3280  	// NOTE: Cellular.FFI_USE MUST be set to true to get Cellular used.
  3281  	Cellular CellularStateProperties
  3282  	// Connectable is "NetworkStateProperties.Connectable"
  3283  	//
  3284  	// Optional
  3285  	//
  3286  	// NOTE: FFI_USE_Connectable MUST be set to true to make this field effective.
  3287  	Connectable bool
  3288  	// ConnectionState is "NetworkStateProperties.ConnectionState"
  3289  	//
  3290  	// Optional
  3291  	ConnectionState ConnectionStateType
  3292  	// Ethernet is "NetworkStateProperties.Ethernet"
  3293  	//
  3294  	// Optional
  3295  	//
  3296  	// NOTE: Ethernet.FFI_USE MUST be set to true to get Ethernet used.
  3297  	Ethernet EthernetStateProperties
  3298  	// ErrorState is "NetworkStateProperties.ErrorState"
  3299  	//
  3300  	// Optional
  3301  	ErrorState js.String
  3302  	// GUID is "NetworkStateProperties.GUID"
  3303  	//
  3304  	// Optional
  3305  	GUID js.String
  3306  	// Name is "NetworkStateProperties.Name"
  3307  	//
  3308  	// Optional
  3309  	Name js.String
  3310  	// Priority is "NetworkStateProperties.Priority"
  3311  	//
  3312  	// Optional
  3313  	//
  3314  	// NOTE: FFI_USE_Priority MUST be set to true to make this field effective.
  3315  	Priority int32
  3316  	// Source is "NetworkStateProperties.Source"
  3317  	//
  3318  	// Optional
  3319  	Source js.String
  3320  	// Type is "NetworkStateProperties.Type"
  3321  	//
  3322  	// Optional
  3323  	Type NetworkType
  3324  	// VPN is "NetworkStateProperties.VPN"
  3325  	//
  3326  	// Optional
  3327  	//
  3328  	// NOTE: VPN.FFI_USE MUST be set to true to get VPN used.
  3329  	VPN VPNStateProperties
  3330  	// WiFi is "NetworkStateProperties.WiFi"
  3331  	//
  3332  	// Optional
  3333  	//
  3334  	// NOTE: WiFi.FFI_USE MUST be set to true to get WiFi used.
  3335  	WiFi WiFiStateProperties
  3336  
  3337  	FFI_USE_Connectable bool // for Connectable.
  3338  	FFI_USE_Priority    bool // for Priority.
  3339  
  3340  	FFI_USE bool
  3341  }
  3342  
  3343  // FromRef calls UpdateFrom and returns a NetworkStateProperties with all fields set.
  3344  func (p NetworkStateProperties) FromRef(ref js.Ref) NetworkStateProperties {
  3345  	p.UpdateFrom(ref)
  3346  	return p
  3347  }
  3348  
  3349  // New creates a new NetworkStateProperties in the application heap.
  3350  func (p NetworkStateProperties) New() js.Ref {
  3351  	return bindings.NetworkStatePropertiesJSLoad(
  3352  		js.Pointer(&p), js.True, 0,
  3353  	)
  3354  }
  3355  
  3356  // UpdateFrom copies value of all fields of the heap object to p.
  3357  func (p *NetworkStateProperties) UpdateFrom(ref js.Ref) {
  3358  	bindings.NetworkStatePropertiesJSStore(
  3359  		js.Pointer(p), ref,
  3360  	)
  3361  }
  3362  
  3363  // Update writes all fields of the p to the heap object referenced by ref.
  3364  func (p *NetworkStateProperties) Update(ref js.Ref) {
  3365  	bindings.NetworkStatePropertiesJSLoad(
  3366  		js.Pointer(p), js.False, ref,
  3367  	)
  3368  }
  3369  
  3370  // FreeMembers frees fields with heap reference, if recursive is true
  3371  // free all heap references reachable from p.
  3372  func (p *NetworkStateProperties) FreeMembers(recursive bool) {
  3373  	js.Free(
  3374  		p.ErrorState.Ref(),
  3375  		p.GUID.Ref(),
  3376  		p.Name.Ref(),
  3377  		p.Source.Ref(),
  3378  	)
  3379  	p.ErrorState = p.ErrorState.FromRef(js.Undefined)
  3380  	p.GUID = p.GUID.FromRef(js.Undefined)
  3381  	p.Name = p.Name.FromRef(js.Undefined)
  3382  	p.Source = p.Source.FromRef(js.Undefined)
  3383  	if recursive {
  3384  		p.Cellular.FreeMembers(true)
  3385  		p.Ethernet.FreeMembers(true)
  3386  		p.VPN.FreeMembers(true)
  3387  		p.WiFi.FreeMembers(true)
  3388  	}
  3389  }
  3390  
  3391  type GetPropertiesCallbackFunc func(this js.Ref, result *NetworkProperties) js.Ref
  3392  
  3393  func (fn GetPropertiesCallbackFunc) Register() js.Func[func(result *NetworkProperties)] {
  3394  	return js.RegisterCallback[func(result *NetworkProperties)](
  3395  		fn, abi.FuncPCABIInternal(fn),
  3396  	)
  3397  }
  3398  
  3399  func (fn GetPropertiesCallbackFunc) DispatchCallback(
  3400  	targetPC uintptr, ctx *js.CallbackContext,
  3401  ) {
  3402  	args := ctx.Args()
  3403  	if len(args) != 1+1 /* js this */ ||
  3404  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  3405  		js.ThrowInvalidCallbackInvocation()
  3406  	}
  3407  	var arg0 NetworkProperties
  3408  	arg0.UpdateFrom(args[0+1])
  3409  	defer arg0.FreeMembers(true)
  3410  
  3411  	if ctx.Return(fn(
  3412  		args[0],
  3413  
  3414  		mark.NoEscape(&arg0),
  3415  	)) {
  3416  		return
  3417  	}
  3418  
  3419  	js.ThrowCallbackValueNotReturned()
  3420  }
  3421  
  3422  type GetPropertiesCallback[T any] struct {
  3423  	Fn  func(arg T, this js.Ref, result *NetworkProperties) js.Ref
  3424  	Arg T
  3425  }
  3426  
  3427  func (cb *GetPropertiesCallback[T]) Register() js.Func[func(result *NetworkProperties)] {
  3428  	return js.RegisterCallback[func(result *NetworkProperties)](
  3429  		cb, abi.FuncPCABIInternal(cb.Fn),
  3430  	)
  3431  }
  3432  
  3433  func (cb *GetPropertiesCallback[T]) DispatchCallback(
  3434  	targetPC uintptr, ctx *js.CallbackContext,
  3435  ) {
  3436  	args := ctx.Args()
  3437  	if len(args) != 1+1 /* js this */ ||
  3438  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  3439  		js.ThrowInvalidCallbackInvocation()
  3440  	}
  3441  	var arg0 NetworkProperties
  3442  	arg0.UpdateFrom(args[0+1])
  3443  	defer arg0.FreeMembers(true)
  3444  
  3445  	if ctx.Return(cb.Fn(
  3446  		cb.Arg,
  3447  		args[0],
  3448  
  3449  		mark.NoEscape(&arg0),
  3450  	)) {
  3451  		return
  3452  	}
  3453  
  3454  	js.ThrowCallbackValueNotReturned()
  3455  }
  3456  
  3457  type ProxyLocation struct {
  3458  	// Host is "ProxyLocation.Host"
  3459  	//
  3460  	// Optional
  3461  	Host js.String
  3462  	// Port is "ProxyLocation.Port"
  3463  	//
  3464  	// Optional
  3465  	//
  3466  	// NOTE: FFI_USE_Port MUST be set to true to make this field effective.
  3467  	Port int32
  3468  
  3469  	FFI_USE_Port bool // for Port.
  3470  
  3471  	FFI_USE bool
  3472  }
  3473  
  3474  // FromRef calls UpdateFrom and returns a ProxyLocation with all fields set.
  3475  func (p ProxyLocation) FromRef(ref js.Ref) ProxyLocation {
  3476  	p.UpdateFrom(ref)
  3477  	return p
  3478  }
  3479  
  3480  // New creates a new ProxyLocation in the application heap.
  3481  func (p ProxyLocation) New() js.Ref {
  3482  	return bindings.ProxyLocationJSLoad(
  3483  		js.Pointer(&p), js.True, 0,
  3484  	)
  3485  }
  3486  
  3487  // UpdateFrom copies value of all fields of the heap object to p.
  3488  func (p *ProxyLocation) UpdateFrom(ref js.Ref) {
  3489  	bindings.ProxyLocationJSStore(
  3490  		js.Pointer(p), ref,
  3491  	)
  3492  }
  3493  
  3494  // Update writes all fields of the p to the heap object referenced by ref.
  3495  func (p *ProxyLocation) Update(ref js.Ref) {
  3496  	bindings.ProxyLocationJSLoad(
  3497  		js.Pointer(p), js.False, ref,
  3498  	)
  3499  }
  3500  
  3501  // FreeMembers frees fields with heap reference, if recursive is true
  3502  // free all heap references reachable from p.
  3503  func (p *ProxyLocation) FreeMembers(recursive bool) {
  3504  	js.Free(
  3505  		p.Host.Ref(),
  3506  	)
  3507  	p.Host = p.Host.FromRef(js.Undefined)
  3508  }
  3509  
  3510  type ManualProxySettings struct {
  3511  	// HTTPProxy is "ManualProxySettings.HTTPProxy"
  3512  	//
  3513  	// Optional
  3514  	//
  3515  	// NOTE: HTTPProxy.FFI_USE MUST be set to true to get HTTPProxy used.
  3516  	HTTPProxy ProxyLocation
  3517  	// SecureHTTPProxy is "ManualProxySettings.SecureHTTPProxy"
  3518  	//
  3519  	// Optional
  3520  	//
  3521  	// NOTE: SecureHTTPProxy.FFI_USE MUST be set to true to get SecureHTTPProxy used.
  3522  	SecureHTTPProxy ProxyLocation
  3523  	// FTPProxy is "ManualProxySettings.FTPProxy"
  3524  	//
  3525  	// Optional
  3526  	//
  3527  	// NOTE: FTPProxy.FFI_USE MUST be set to true to get FTPProxy used.
  3528  	FTPProxy ProxyLocation
  3529  	// SOCKS is "ManualProxySettings.SOCKS"
  3530  	//
  3531  	// Optional
  3532  	//
  3533  	// NOTE: SOCKS.FFI_USE MUST be set to true to get SOCKS used.
  3534  	SOCKS ProxyLocation
  3535  
  3536  	FFI_USE bool
  3537  }
  3538  
  3539  // FromRef calls UpdateFrom and returns a ManualProxySettings with all fields set.
  3540  func (p ManualProxySettings) FromRef(ref js.Ref) ManualProxySettings {
  3541  	p.UpdateFrom(ref)
  3542  	return p
  3543  }
  3544  
  3545  // New creates a new ManualProxySettings in the application heap.
  3546  func (p ManualProxySettings) New() js.Ref {
  3547  	return bindings.ManualProxySettingsJSLoad(
  3548  		js.Pointer(&p), js.True, 0,
  3549  	)
  3550  }
  3551  
  3552  // UpdateFrom copies value of all fields of the heap object to p.
  3553  func (p *ManualProxySettings) UpdateFrom(ref js.Ref) {
  3554  	bindings.ManualProxySettingsJSStore(
  3555  		js.Pointer(p), ref,
  3556  	)
  3557  }
  3558  
  3559  // Update writes all fields of the p to the heap object referenced by ref.
  3560  func (p *ManualProxySettings) Update(ref js.Ref) {
  3561  	bindings.ManualProxySettingsJSLoad(
  3562  		js.Pointer(p), js.False, ref,
  3563  	)
  3564  }
  3565  
  3566  // FreeMembers frees fields with heap reference, if recursive is true
  3567  // free all heap references reachable from p.
  3568  func (p *ManualProxySettings) FreeMembers(recursive bool) {
  3569  	if recursive {
  3570  		p.HTTPProxy.FreeMembers(true)
  3571  		p.SecureHTTPProxy.FreeMembers(true)
  3572  		p.FTPProxy.FreeMembers(true)
  3573  		p.SOCKS.FreeMembers(true)
  3574  	}
  3575  }
  3576  
  3577  type ProxySettings struct {
  3578  	// Type is "ProxySettings.Type"
  3579  	//
  3580  	// Optional
  3581  	Type ProxySettingsType
  3582  	// Manual is "ProxySettings.Manual"
  3583  	//
  3584  	// Optional
  3585  	//
  3586  	// NOTE: Manual.FFI_USE MUST be set to true to get Manual used.
  3587  	Manual ManualProxySettings
  3588  	// ExcludeDomains is "ProxySettings.ExcludeDomains"
  3589  	//
  3590  	// Optional
  3591  	ExcludeDomains js.Array[js.String]
  3592  	// PAC is "ProxySettings.PAC"
  3593  	//
  3594  	// Optional
  3595  	PAC js.String
  3596  
  3597  	FFI_USE bool
  3598  }
  3599  
  3600  // FromRef calls UpdateFrom and returns a ProxySettings with all fields set.
  3601  func (p ProxySettings) FromRef(ref js.Ref) ProxySettings {
  3602  	p.UpdateFrom(ref)
  3603  	return p
  3604  }
  3605  
  3606  // New creates a new ProxySettings in the application heap.
  3607  func (p ProxySettings) New() js.Ref {
  3608  	return bindings.ProxySettingsJSLoad(
  3609  		js.Pointer(&p), js.True, 0,
  3610  	)
  3611  }
  3612  
  3613  // UpdateFrom copies value of all fields of the heap object to p.
  3614  func (p *ProxySettings) UpdateFrom(ref js.Ref) {
  3615  	bindings.ProxySettingsJSStore(
  3616  		js.Pointer(p), ref,
  3617  	)
  3618  }
  3619  
  3620  // Update writes all fields of the p to the heap object referenced by ref.
  3621  func (p *ProxySettings) Update(ref js.Ref) {
  3622  	bindings.ProxySettingsJSLoad(
  3623  		js.Pointer(p), js.False, ref,
  3624  	)
  3625  }
  3626  
  3627  // FreeMembers frees fields with heap reference, if recursive is true
  3628  // free all heap references reachable from p.
  3629  func (p *ProxySettings) FreeMembers(recursive bool) {
  3630  	js.Free(
  3631  		p.ExcludeDomains.Ref(),
  3632  		p.PAC.Ref(),
  3633  	)
  3634  	p.ExcludeDomains = p.ExcludeDomains.FromRef(js.Undefined)
  3635  	p.PAC = p.PAC.FromRef(js.Undefined)
  3636  	if recursive {
  3637  		p.Manual.FreeMembers(true)
  3638  	}
  3639  }
  3640  
  3641  type VPNProperties struct {
  3642  	// AutoConnect is "VPNProperties.AutoConnect"
  3643  	//
  3644  	// Optional
  3645  	//
  3646  	// NOTE: FFI_USE_AutoConnect MUST be set to true to make this field effective.
  3647  	AutoConnect bool
  3648  	// Host is "VPNProperties.Host"
  3649  	//
  3650  	// Optional
  3651  	Host js.String
  3652  	// Type is "VPNProperties.Type"
  3653  	//
  3654  	// Optional
  3655  	Type js.String
  3656  
  3657  	FFI_USE_AutoConnect bool // for AutoConnect.
  3658  
  3659  	FFI_USE bool
  3660  }
  3661  
  3662  // FromRef calls UpdateFrom and returns a VPNProperties with all fields set.
  3663  func (p VPNProperties) FromRef(ref js.Ref) VPNProperties {
  3664  	p.UpdateFrom(ref)
  3665  	return p
  3666  }
  3667  
  3668  // New creates a new VPNProperties in the application heap.
  3669  func (p VPNProperties) New() js.Ref {
  3670  	return bindings.VPNPropertiesJSLoad(
  3671  		js.Pointer(&p), js.True, 0,
  3672  	)
  3673  }
  3674  
  3675  // UpdateFrom copies value of all fields of the heap object to p.
  3676  func (p *VPNProperties) UpdateFrom(ref js.Ref) {
  3677  	bindings.VPNPropertiesJSStore(
  3678  		js.Pointer(p), ref,
  3679  	)
  3680  }
  3681  
  3682  // Update writes all fields of the p to the heap object referenced by ref.
  3683  func (p *VPNProperties) Update(ref js.Ref) {
  3684  	bindings.VPNPropertiesJSLoad(
  3685  		js.Pointer(p), js.False, ref,
  3686  	)
  3687  }
  3688  
  3689  // FreeMembers frees fields with heap reference, if recursive is true
  3690  // free all heap references reachable from p.
  3691  func (p *VPNProperties) FreeMembers(recursive bool) {
  3692  	js.Free(
  3693  		p.Host.Ref(),
  3694  		p.Type.Ref(),
  3695  	)
  3696  	p.Host = p.Host.FromRef(js.Undefined)
  3697  	p.Type = p.Type.FromRef(js.Undefined)
  3698  }
  3699  
  3700  type WiFiProperties struct {
  3701  	// AllowGatewayARPPolling is "WiFiProperties.AllowGatewayARPPolling"
  3702  	//
  3703  	// Optional
  3704  	//
  3705  	// NOTE: FFI_USE_AllowGatewayARPPolling MUST be set to true to make this field effective.
  3706  	AllowGatewayARPPolling bool
  3707  	// AutoConnect is "WiFiProperties.AutoConnect"
  3708  	//
  3709  	// Optional
  3710  	//
  3711  	// NOTE: FFI_USE_AutoConnect MUST be set to true to make this field effective.
  3712  	AutoConnect bool
  3713  	// BSSID is "WiFiProperties.BSSID"
  3714  	//
  3715  	// Optional
  3716  	BSSID js.String
  3717  	// EAP is "WiFiProperties.EAP"
  3718  	//
  3719  	// Optional
  3720  	//
  3721  	// NOTE: EAP.FFI_USE MUST be set to true to get EAP used.
  3722  	EAP EAPProperties
  3723  	// Frequency is "WiFiProperties.Frequency"
  3724  	//
  3725  	// Optional
  3726  	//
  3727  	// NOTE: FFI_USE_Frequency MUST be set to true to make this field effective.
  3728  	Frequency int32
  3729  	// FrequencyList is "WiFiProperties.FrequencyList"
  3730  	//
  3731  	// Optional
  3732  	FrequencyList js.Array[int32]
  3733  	// HexSSID is "WiFiProperties.HexSSID"
  3734  	//
  3735  	// Optional
  3736  	HexSSID js.String
  3737  	// HiddenSSID is "WiFiProperties.HiddenSSID"
  3738  	//
  3739  	// Optional
  3740  	//
  3741  	// NOTE: FFI_USE_HiddenSSID MUST be set to true to make this field effective.
  3742  	HiddenSSID bool
  3743  	// Passphrase is "WiFiProperties.Passphrase"
  3744  	//
  3745  	// Optional
  3746  	Passphrase js.String
  3747  	// RoamThreshold is "WiFiProperties.RoamThreshold"
  3748  	//
  3749  	// Optional
  3750  	//
  3751  	// NOTE: FFI_USE_RoamThreshold MUST be set to true to make this field effective.
  3752  	RoamThreshold int32
  3753  	// SSID is "WiFiProperties.SSID"
  3754  	//
  3755  	// Optional
  3756  	SSID js.String
  3757  	// Security is "WiFiProperties.Security"
  3758  	//
  3759  	// Optional
  3760  	Security js.String
  3761  	// SignalStrength is "WiFiProperties.SignalStrength"
  3762  	//
  3763  	// Optional
  3764  	//
  3765  	// NOTE: FFI_USE_SignalStrength MUST be set to true to make this field effective.
  3766  	SignalStrength int32
  3767  
  3768  	FFI_USE_AllowGatewayARPPolling bool // for AllowGatewayARPPolling.
  3769  	FFI_USE_AutoConnect            bool // for AutoConnect.
  3770  	FFI_USE_Frequency              bool // for Frequency.
  3771  	FFI_USE_HiddenSSID             bool // for HiddenSSID.
  3772  	FFI_USE_RoamThreshold          bool // for RoamThreshold.
  3773  	FFI_USE_SignalStrength         bool // for SignalStrength.
  3774  
  3775  	FFI_USE bool
  3776  }
  3777  
  3778  // FromRef calls UpdateFrom and returns a WiFiProperties with all fields set.
  3779  func (p WiFiProperties) FromRef(ref js.Ref) WiFiProperties {
  3780  	p.UpdateFrom(ref)
  3781  	return p
  3782  }
  3783  
  3784  // New creates a new WiFiProperties in the application heap.
  3785  func (p WiFiProperties) New() js.Ref {
  3786  	return bindings.WiFiPropertiesJSLoad(
  3787  		js.Pointer(&p), js.True, 0,
  3788  	)
  3789  }
  3790  
  3791  // UpdateFrom copies value of all fields of the heap object to p.
  3792  func (p *WiFiProperties) UpdateFrom(ref js.Ref) {
  3793  	bindings.WiFiPropertiesJSStore(
  3794  		js.Pointer(p), ref,
  3795  	)
  3796  }
  3797  
  3798  // Update writes all fields of the p to the heap object referenced by ref.
  3799  func (p *WiFiProperties) Update(ref js.Ref) {
  3800  	bindings.WiFiPropertiesJSLoad(
  3801  		js.Pointer(p), js.False, ref,
  3802  	)
  3803  }
  3804  
  3805  // FreeMembers frees fields with heap reference, if recursive is true
  3806  // free all heap references reachable from p.
  3807  func (p *WiFiProperties) FreeMembers(recursive bool) {
  3808  	js.Free(
  3809  		p.BSSID.Ref(),
  3810  		p.FrequencyList.Ref(),
  3811  		p.HexSSID.Ref(),
  3812  		p.Passphrase.Ref(),
  3813  		p.SSID.Ref(),
  3814  		p.Security.Ref(),
  3815  	)
  3816  	p.BSSID = p.BSSID.FromRef(js.Undefined)
  3817  	p.FrequencyList = p.FrequencyList.FromRef(js.Undefined)
  3818  	p.HexSSID = p.HexSSID.FromRef(js.Undefined)
  3819  	p.Passphrase = p.Passphrase.FromRef(js.Undefined)
  3820  	p.SSID = p.SSID.FromRef(js.Undefined)
  3821  	p.Security = p.Security.FromRef(js.Undefined)
  3822  	if recursive {
  3823  		p.EAP.FreeMembers(true)
  3824  	}
  3825  }
  3826  
  3827  type NetworkProperties struct {
  3828  	// Cellular is "NetworkProperties.Cellular"
  3829  	//
  3830  	// Optional
  3831  	//
  3832  	// NOTE: Cellular.FFI_USE MUST be set to true to get Cellular used.
  3833  	Cellular CellularProperties
  3834  	// Connectable is "NetworkProperties.Connectable"
  3835  	//
  3836  	// Optional
  3837  	//
  3838  	// NOTE: FFI_USE_Connectable MUST be set to true to make this field effective.
  3839  	Connectable bool
  3840  	// ConnectionState is "NetworkProperties.ConnectionState"
  3841  	//
  3842  	// Optional
  3843  	ConnectionState ConnectionStateType
  3844  	// ErrorState is "NetworkProperties.ErrorState"
  3845  	//
  3846  	// Optional
  3847  	ErrorState js.String
  3848  	// Ethernet is "NetworkProperties.Ethernet"
  3849  	//
  3850  	// Optional
  3851  	//
  3852  	// NOTE: Ethernet.FFI_USE MUST be set to true to get Ethernet used.
  3853  	Ethernet EthernetProperties
  3854  	// GUID is "NetworkProperties.GUID"
  3855  	//
  3856  	// Optional
  3857  	GUID js.String
  3858  	// IPAddressConfigType is "NetworkProperties.IPAddressConfigType"
  3859  	//
  3860  	// Optional
  3861  	IPAddressConfigType IPConfigType
  3862  	// IPConfigs is "NetworkProperties.IPConfigs"
  3863  	//
  3864  	// Optional
  3865  	IPConfigs js.Array[IPConfigProperties]
  3866  	// MacAddress is "NetworkProperties.MacAddress"
  3867  	//
  3868  	// Optional
  3869  	MacAddress js.String
  3870  	// Metered is "NetworkProperties.Metered"
  3871  	//
  3872  	// Optional
  3873  	//
  3874  	// NOTE: FFI_USE_Metered MUST be set to true to make this field effective.
  3875  	Metered bool
  3876  	// Name is "NetworkProperties.Name"
  3877  	//
  3878  	// Optional
  3879  	Name js.String
  3880  	// NameServersConfigType is "NetworkProperties.NameServersConfigType"
  3881  	//
  3882  	// Optional
  3883  	NameServersConfigType IPConfigType
  3884  	// Priority is "NetworkProperties.Priority"
  3885  	//
  3886  	// Optional
  3887  	//
  3888  	// NOTE: FFI_USE_Priority MUST be set to true to make this field effective.
  3889  	Priority int32
  3890  	// ProxySettings is "NetworkProperties.ProxySettings"
  3891  	//
  3892  	// Optional
  3893  	//
  3894  	// NOTE: ProxySettings.FFI_USE MUST be set to true to get ProxySettings used.
  3895  	ProxySettings ProxySettings
  3896  	// RestrictedConnectivity is "NetworkProperties.RestrictedConnectivity"
  3897  	//
  3898  	// Optional
  3899  	//
  3900  	// NOTE: FFI_USE_RestrictedConnectivity MUST be set to true to make this field effective.
  3901  	RestrictedConnectivity bool
  3902  	// StaticIPConfig is "NetworkProperties.StaticIPConfig"
  3903  	//
  3904  	// Optional
  3905  	//
  3906  	// NOTE: StaticIPConfig.FFI_USE MUST be set to true to get StaticIPConfig used.
  3907  	StaticIPConfig IPConfigProperties
  3908  	// SavedIPConfig is "NetworkProperties.SavedIPConfig"
  3909  	//
  3910  	// Optional
  3911  	//
  3912  	// NOTE: SavedIPConfig.FFI_USE MUST be set to true to get SavedIPConfig used.
  3913  	SavedIPConfig IPConfigProperties
  3914  	// Source is "NetworkProperties.Source"
  3915  	//
  3916  	// Optional
  3917  	Source js.String
  3918  	// Type is "NetworkProperties.Type"
  3919  	//
  3920  	// Optional
  3921  	Type NetworkType
  3922  	// VPN is "NetworkProperties.VPN"
  3923  	//
  3924  	// Optional
  3925  	//
  3926  	// NOTE: VPN.FFI_USE MUST be set to true to get VPN used.
  3927  	VPN VPNProperties
  3928  	// WiFi is "NetworkProperties.WiFi"
  3929  	//
  3930  	// Optional
  3931  	//
  3932  	// NOTE: WiFi.FFI_USE MUST be set to true to get WiFi used.
  3933  	WiFi WiFiProperties
  3934  
  3935  	FFI_USE_Connectable            bool // for Connectable.
  3936  	FFI_USE_Metered                bool // for Metered.
  3937  	FFI_USE_Priority               bool // for Priority.
  3938  	FFI_USE_RestrictedConnectivity bool // for RestrictedConnectivity.
  3939  
  3940  	FFI_USE bool
  3941  }
  3942  
  3943  // FromRef calls UpdateFrom and returns a NetworkProperties with all fields set.
  3944  func (p NetworkProperties) FromRef(ref js.Ref) NetworkProperties {
  3945  	p.UpdateFrom(ref)
  3946  	return p
  3947  }
  3948  
  3949  // New creates a new NetworkProperties in the application heap.
  3950  func (p NetworkProperties) New() js.Ref {
  3951  	return bindings.NetworkPropertiesJSLoad(
  3952  		js.Pointer(&p), js.True, 0,
  3953  	)
  3954  }
  3955  
  3956  // UpdateFrom copies value of all fields of the heap object to p.
  3957  func (p *NetworkProperties) UpdateFrom(ref js.Ref) {
  3958  	bindings.NetworkPropertiesJSStore(
  3959  		js.Pointer(p), ref,
  3960  	)
  3961  }
  3962  
  3963  // Update writes all fields of the p to the heap object referenced by ref.
  3964  func (p *NetworkProperties) Update(ref js.Ref) {
  3965  	bindings.NetworkPropertiesJSLoad(
  3966  		js.Pointer(p), js.False, ref,
  3967  	)
  3968  }
  3969  
  3970  // FreeMembers frees fields with heap reference, if recursive is true
  3971  // free all heap references reachable from p.
  3972  func (p *NetworkProperties) FreeMembers(recursive bool) {
  3973  	js.Free(
  3974  		p.ErrorState.Ref(),
  3975  		p.GUID.Ref(),
  3976  		p.IPConfigs.Ref(),
  3977  		p.MacAddress.Ref(),
  3978  		p.Name.Ref(),
  3979  		p.Source.Ref(),
  3980  	)
  3981  	p.ErrorState = p.ErrorState.FromRef(js.Undefined)
  3982  	p.GUID = p.GUID.FromRef(js.Undefined)
  3983  	p.IPConfigs = p.IPConfigs.FromRef(js.Undefined)
  3984  	p.MacAddress = p.MacAddress.FromRef(js.Undefined)
  3985  	p.Name = p.Name.FromRef(js.Undefined)
  3986  	p.Source = p.Source.FromRef(js.Undefined)
  3987  	if recursive {
  3988  		p.Cellular.FreeMembers(true)
  3989  		p.Ethernet.FreeMembers(true)
  3990  		p.ProxySettings.FreeMembers(true)
  3991  		p.StaticIPConfig.FreeMembers(true)
  3992  		p.SavedIPConfig.FreeMembers(true)
  3993  		p.VPN.FreeMembers(true)
  3994  		p.WiFi.FreeMembers(true)
  3995  	}
  3996  }
  3997  
  3998  type GetStatePropertiesCallbackFunc func(this js.Ref, result *NetworkStateProperties) js.Ref
  3999  
  4000  func (fn GetStatePropertiesCallbackFunc) Register() js.Func[func(result *NetworkStateProperties)] {
  4001  	return js.RegisterCallback[func(result *NetworkStateProperties)](
  4002  		fn, abi.FuncPCABIInternal(fn),
  4003  	)
  4004  }
  4005  
  4006  func (fn GetStatePropertiesCallbackFunc) DispatchCallback(
  4007  	targetPC uintptr, ctx *js.CallbackContext,
  4008  ) {
  4009  	args := ctx.Args()
  4010  	if len(args) != 1+1 /* js this */ ||
  4011  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  4012  		js.ThrowInvalidCallbackInvocation()
  4013  	}
  4014  	var arg0 NetworkStateProperties
  4015  	arg0.UpdateFrom(args[0+1])
  4016  	defer arg0.FreeMembers(true)
  4017  
  4018  	if ctx.Return(fn(
  4019  		args[0],
  4020  
  4021  		mark.NoEscape(&arg0),
  4022  	)) {
  4023  		return
  4024  	}
  4025  
  4026  	js.ThrowCallbackValueNotReturned()
  4027  }
  4028  
  4029  type GetStatePropertiesCallback[T any] struct {
  4030  	Fn  func(arg T, this js.Ref, result *NetworkStateProperties) js.Ref
  4031  	Arg T
  4032  }
  4033  
  4034  func (cb *GetStatePropertiesCallback[T]) Register() js.Func[func(result *NetworkStateProperties)] {
  4035  	return js.RegisterCallback[func(result *NetworkStateProperties)](
  4036  		cb, abi.FuncPCABIInternal(cb.Fn),
  4037  	)
  4038  }
  4039  
  4040  func (cb *GetStatePropertiesCallback[T]) DispatchCallback(
  4041  	targetPC uintptr, ctx *js.CallbackContext,
  4042  ) {
  4043  	args := ctx.Args()
  4044  	if len(args) != 1+1 /* js this */ ||
  4045  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  4046  		js.ThrowInvalidCallbackInvocation()
  4047  	}
  4048  	var arg0 NetworkStateProperties
  4049  	arg0.UpdateFrom(args[0+1])
  4050  	defer arg0.FreeMembers(true)
  4051  
  4052  	if ctx.Return(cb.Fn(
  4053  		cb.Arg,
  4054  		args[0],
  4055  
  4056  		mark.NoEscape(&arg0),
  4057  	)) {
  4058  		return
  4059  	}
  4060  
  4061  	js.ThrowCallbackValueNotReturned()
  4062  }
  4063  
  4064  type ManagedThirdPartyVPNProperties struct {
  4065  	// ExtensionID is "ManagedThirdPartyVPNProperties.ExtensionID"
  4066  	//
  4067  	// Optional
  4068  	//
  4069  	// NOTE: ExtensionID.FFI_USE MUST be set to true to get ExtensionID used.
  4070  	ExtensionID ManagedDOMString
  4071  	// ProviderName is "ManagedThirdPartyVPNProperties.ProviderName"
  4072  	//
  4073  	// Optional
  4074  	ProviderName js.String
  4075  
  4076  	FFI_USE bool
  4077  }
  4078  
  4079  // FromRef calls UpdateFrom and returns a ManagedThirdPartyVPNProperties with all fields set.
  4080  func (p ManagedThirdPartyVPNProperties) FromRef(ref js.Ref) ManagedThirdPartyVPNProperties {
  4081  	p.UpdateFrom(ref)
  4082  	return p
  4083  }
  4084  
  4085  // New creates a new ManagedThirdPartyVPNProperties in the application heap.
  4086  func (p ManagedThirdPartyVPNProperties) New() js.Ref {
  4087  	return bindings.ManagedThirdPartyVPNPropertiesJSLoad(
  4088  		js.Pointer(&p), js.True, 0,
  4089  	)
  4090  }
  4091  
  4092  // UpdateFrom copies value of all fields of the heap object to p.
  4093  func (p *ManagedThirdPartyVPNProperties) UpdateFrom(ref js.Ref) {
  4094  	bindings.ManagedThirdPartyVPNPropertiesJSStore(
  4095  		js.Pointer(p), ref,
  4096  	)
  4097  }
  4098  
  4099  // Update writes all fields of the p to the heap object referenced by ref.
  4100  func (p *ManagedThirdPartyVPNProperties) Update(ref js.Ref) {
  4101  	bindings.ManagedThirdPartyVPNPropertiesJSLoad(
  4102  		js.Pointer(p), js.False, ref,
  4103  	)
  4104  }
  4105  
  4106  // FreeMembers frees fields with heap reference, if recursive is true
  4107  // free all heap references reachable from p.
  4108  func (p *ManagedThirdPartyVPNProperties) FreeMembers(recursive bool) {
  4109  	js.Free(
  4110  		p.ProviderName.Ref(),
  4111  	)
  4112  	p.ProviderName = p.ProviderName.FromRef(js.Undefined)
  4113  	if recursive {
  4114  		p.ExtensionID.FreeMembers(true)
  4115  	}
  4116  }
  4117  
  4118  type WiMAXProperties struct {
  4119  	// AutoConnect is "WiMAXProperties.AutoConnect"
  4120  	//
  4121  	// Optional
  4122  	//
  4123  	// NOTE: FFI_USE_AutoConnect MUST be set to true to make this field effective.
  4124  	AutoConnect bool
  4125  	// EAP is "WiMAXProperties.EAP"
  4126  	//
  4127  	// Optional
  4128  	//
  4129  	// NOTE: EAP.FFI_USE MUST be set to true to get EAP used.
  4130  	EAP EAPProperties
  4131  
  4132  	FFI_USE_AutoConnect bool // for AutoConnect.
  4133  
  4134  	FFI_USE bool
  4135  }
  4136  
  4137  // FromRef calls UpdateFrom and returns a WiMAXProperties with all fields set.
  4138  func (p WiMAXProperties) FromRef(ref js.Ref) WiMAXProperties {
  4139  	p.UpdateFrom(ref)
  4140  	return p
  4141  }
  4142  
  4143  // New creates a new WiMAXProperties in the application heap.
  4144  func (p WiMAXProperties) New() js.Ref {
  4145  	return bindings.WiMAXPropertiesJSLoad(
  4146  		js.Pointer(&p), js.True, 0,
  4147  	)
  4148  }
  4149  
  4150  // UpdateFrom copies value of all fields of the heap object to p.
  4151  func (p *WiMAXProperties) UpdateFrom(ref js.Ref) {
  4152  	bindings.WiMAXPropertiesJSStore(
  4153  		js.Pointer(p), ref,
  4154  	)
  4155  }
  4156  
  4157  // Update writes all fields of the p to the heap object referenced by ref.
  4158  func (p *WiMAXProperties) Update(ref js.Ref) {
  4159  	bindings.WiMAXPropertiesJSLoad(
  4160  		js.Pointer(p), js.False, ref,
  4161  	)
  4162  }
  4163  
  4164  // FreeMembers frees fields with heap reference, if recursive is true
  4165  // free all heap references reachable from p.
  4166  func (p *WiMAXProperties) FreeMembers(recursive bool) {
  4167  	if recursive {
  4168  		p.EAP.FreeMembers(true)
  4169  	}
  4170  }
  4171  
  4172  type NetworkConfigProperties struct {
  4173  	// Cellular is "NetworkConfigProperties.Cellular"
  4174  	//
  4175  	// Optional
  4176  	//
  4177  	// NOTE: Cellular.FFI_USE MUST be set to true to get Cellular used.
  4178  	Cellular CellularProperties
  4179  	// Ethernet is "NetworkConfigProperties.Ethernet"
  4180  	//
  4181  	// Optional
  4182  	//
  4183  	// NOTE: Ethernet.FFI_USE MUST be set to true to get Ethernet used.
  4184  	Ethernet EthernetProperties
  4185  	// GUID is "NetworkConfigProperties.GUID"
  4186  	//
  4187  	// Optional
  4188  	GUID js.String
  4189  	// IPAddressConfigType is "NetworkConfigProperties.IPAddressConfigType"
  4190  	//
  4191  	// Optional
  4192  	IPAddressConfigType IPConfigType
  4193  	// Name is "NetworkConfigProperties.Name"
  4194  	//
  4195  	// Optional
  4196  	Name js.String
  4197  	// NameServersConfigType is "NetworkConfigProperties.NameServersConfigType"
  4198  	//
  4199  	// Optional
  4200  	NameServersConfigType IPConfigType
  4201  	// Priority is "NetworkConfigProperties.Priority"
  4202  	//
  4203  	// Optional
  4204  	//
  4205  	// NOTE: FFI_USE_Priority MUST be set to true to make this field effective.
  4206  	Priority int32
  4207  	// Type is "NetworkConfigProperties.Type"
  4208  	//
  4209  	// Optional
  4210  	Type NetworkType
  4211  	// VPN is "NetworkConfigProperties.VPN"
  4212  	//
  4213  	// Optional
  4214  	//
  4215  	// NOTE: VPN.FFI_USE MUST be set to true to get VPN used.
  4216  	VPN VPNProperties
  4217  	// WiFi is "NetworkConfigProperties.WiFi"
  4218  	//
  4219  	// Optional
  4220  	//
  4221  	// NOTE: WiFi.FFI_USE MUST be set to true to get WiFi used.
  4222  	WiFi WiFiProperties
  4223  	// WiMAX is "NetworkConfigProperties.WiMAX"
  4224  	//
  4225  	// Optional
  4226  	//
  4227  	// NOTE: WiMAX.FFI_USE MUST be set to true to get WiMAX used.
  4228  	WiMAX WiMAXProperties
  4229  
  4230  	FFI_USE_Priority bool // for Priority.
  4231  
  4232  	FFI_USE bool
  4233  }
  4234  
  4235  // FromRef calls UpdateFrom and returns a NetworkConfigProperties with all fields set.
  4236  func (p NetworkConfigProperties) FromRef(ref js.Ref) NetworkConfigProperties {
  4237  	p.UpdateFrom(ref)
  4238  	return p
  4239  }
  4240  
  4241  // New creates a new NetworkConfigProperties in the application heap.
  4242  func (p NetworkConfigProperties) New() js.Ref {
  4243  	return bindings.NetworkConfigPropertiesJSLoad(
  4244  		js.Pointer(&p), js.True, 0,
  4245  	)
  4246  }
  4247  
  4248  // UpdateFrom copies value of all fields of the heap object to p.
  4249  func (p *NetworkConfigProperties) UpdateFrom(ref js.Ref) {
  4250  	bindings.NetworkConfigPropertiesJSStore(
  4251  		js.Pointer(p), ref,
  4252  	)
  4253  }
  4254  
  4255  // Update writes all fields of the p to the heap object referenced by ref.
  4256  func (p *NetworkConfigProperties) Update(ref js.Ref) {
  4257  	bindings.NetworkConfigPropertiesJSLoad(
  4258  		js.Pointer(p), js.False, ref,
  4259  	)
  4260  }
  4261  
  4262  // FreeMembers frees fields with heap reference, if recursive is true
  4263  // free all heap references reachable from p.
  4264  func (p *NetworkConfigProperties) FreeMembers(recursive bool) {
  4265  	js.Free(
  4266  		p.GUID.Ref(),
  4267  		p.Name.Ref(),
  4268  	)
  4269  	p.GUID = p.GUID.FromRef(js.Undefined)
  4270  	p.Name = p.Name.FromRef(js.Undefined)
  4271  	if recursive {
  4272  		p.Cellular.FreeMembers(true)
  4273  		p.Ethernet.FreeMembers(true)
  4274  		p.VPN.FreeMembers(true)
  4275  		p.WiFi.FreeMembers(true)
  4276  		p.WiMAX.FreeMembers(true)
  4277  	}
  4278  }
  4279  
  4280  type NetworkFilter struct {
  4281  	// NetworkType is "NetworkFilter.networkType"
  4282  	//
  4283  	// Optional
  4284  	NetworkType NetworkType
  4285  	// Visible is "NetworkFilter.visible"
  4286  	//
  4287  	// Optional
  4288  	//
  4289  	// NOTE: FFI_USE_Visible MUST be set to true to make this field effective.
  4290  	Visible bool
  4291  	// Configured is "NetworkFilter.configured"
  4292  	//
  4293  	// Optional
  4294  	//
  4295  	// NOTE: FFI_USE_Configured MUST be set to true to make this field effective.
  4296  	Configured bool
  4297  	// Limit is "NetworkFilter.limit"
  4298  	//
  4299  	// Optional
  4300  	//
  4301  	// NOTE: FFI_USE_Limit MUST be set to true to make this field effective.
  4302  	Limit int32
  4303  
  4304  	FFI_USE_Visible    bool // for Visible.
  4305  	FFI_USE_Configured bool // for Configured.
  4306  	FFI_USE_Limit      bool // for Limit.
  4307  
  4308  	FFI_USE bool
  4309  }
  4310  
  4311  // FromRef calls UpdateFrom and returns a NetworkFilter with all fields set.
  4312  func (p NetworkFilter) FromRef(ref js.Ref) NetworkFilter {
  4313  	p.UpdateFrom(ref)
  4314  	return p
  4315  }
  4316  
  4317  // New creates a new NetworkFilter in the application heap.
  4318  func (p NetworkFilter) New() js.Ref {
  4319  	return bindings.NetworkFilterJSLoad(
  4320  		js.Pointer(&p), js.True, 0,
  4321  	)
  4322  }
  4323  
  4324  // UpdateFrom copies value of all fields of the heap object to p.
  4325  func (p *NetworkFilter) UpdateFrom(ref js.Ref) {
  4326  	bindings.NetworkFilterJSStore(
  4327  		js.Pointer(p), ref,
  4328  	)
  4329  }
  4330  
  4331  // Update writes all fields of the p to the heap object referenced by ref.
  4332  func (p *NetworkFilter) Update(ref js.Ref) {
  4333  	bindings.NetworkFilterJSLoad(
  4334  		js.Pointer(p), js.False, ref,
  4335  	)
  4336  }
  4337  
  4338  // FreeMembers frees fields with heap reference, if recursive is true
  4339  // free all heap references reachable from p.
  4340  func (p *NetworkFilter) FreeMembers(recursive bool) {
  4341  }
  4342  
  4343  type StringCallbackFunc func(this js.Ref, result js.String) js.Ref
  4344  
  4345  func (fn StringCallbackFunc) Register() js.Func[func(result js.String)] {
  4346  	return js.RegisterCallback[func(result js.String)](
  4347  		fn, abi.FuncPCABIInternal(fn),
  4348  	)
  4349  }
  4350  
  4351  func (fn StringCallbackFunc) DispatchCallback(
  4352  	targetPC uintptr, ctx *js.CallbackContext,
  4353  ) {
  4354  	args := ctx.Args()
  4355  	if len(args) != 1+1 /* js this */ ||
  4356  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  4357  		js.ThrowInvalidCallbackInvocation()
  4358  	}
  4359  
  4360  	if ctx.Return(fn(
  4361  		args[0],
  4362  
  4363  		js.String{}.FromRef(args[0+1]),
  4364  	)) {
  4365  		return
  4366  	}
  4367  
  4368  	js.ThrowCallbackValueNotReturned()
  4369  }
  4370  
  4371  type StringCallback[T any] struct {
  4372  	Fn  func(arg T, this js.Ref, result js.String) js.Ref
  4373  	Arg T
  4374  }
  4375  
  4376  func (cb *StringCallback[T]) Register() js.Func[func(result js.String)] {
  4377  	return js.RegisterCallback[func(result js.String)](
  4378  		cb, abi.FuncPCABIInternal(cb.Fn),
  4379  	)
  4380  }
  4381  
  4382  func (cb *StringCallback[T]) DispatchCallback(
  4383  	targetPC uintptr, ctx *js.CallbackContext,
  4384  ) {
  4385  	args := ctx.Args()
  4386  	if len(args) != 1+1 /* js this */ ||
  4387  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  4388  		js.ThrowInvalidCallbackInvocation()
  4389  	}
  4390  
  4391  	if ctx.Return(cb.Fn(
  4392  		cb.Arg,
  4393  		args[0],
  4394  
  4395  		js.String{}.FromRef(args[0+1]),
  4396  	)) {
  4397  		return
  4398  	}
  4399  
  4400  	js.ThrowCallbackValueNotReturned()
  4401  }
  4402  
  4403  type ThirdPartyVPNProperties struct {
  4404  	// ExtensionID is "ThirdPartyVPNProperties.ExtensionID"
  4405  	//
  4406  	// Optional
  4407  	ExtensionID js.String
  4408  	// ProviderName is "ThirdPartyVPNProperties.ProviderName"
  4409  	//
  4410  	// Optional
  4411  	ProviderName js.String
  4412  
  4413  	FFI_USE bool
  4414  }
  4415  
  4416  // FromRef calls UpdateFrom and returns a ThirdPartyVPNProperties with all fields set.
  4417  func (p ThirdPartyVPNProperties) FromRef(ref js.Ref) ThirdPartyVPNProperties {
  4418  	p.UpdateFrom(ref)
  4419  	return p
  4420  }
  4421  
  4422  // New creates a new ThirdPartyVPNProperties in the application heap.
  4423  func (p ThirdPartyVPNProperties) New() js.Ref {
  4424  	return bindings.ThirdPartyVPNPropertiesJSLoad(
  4425  		js.Pointer(&p), js.True, 0,
  4426  	)
  4427  }
  4428  
  4429  // UpdateFrom copies value of all fields of the heap object to p.
  4430  func (p *ThirdPartyVPNProperties) UpdateFrom(ref js.Ref) {
  4431  	bindings.ThirdPartyVPNPropertiesJSStore(
  4432  		js.Pointer(p), ref,
  4433  	)
  4434  }
  4435  
  4436  // Update writes all fields of the p to the heap object referenced by ref.
  4437  func (p *ThirdPartyVPNProperties) Update(ref js.Ref) {
  4438  	bindings.ThirdPartyVPNPropertiesJSLoad(
  4439  		js.Pointer(p), js.False, ref,
  4440  	)
  4441  }
  4442  
  4443  // FreeMembers frees fields with heap reference, if recursive is true
  4444  // free all heap references reachable from p.
  4445  func (p *ThirdPartyVPNProperties) FreeMembers(recursive bool) {
  4446  	js.Free(
  4447  		p.ExtensionID.Ref(),
  4448  		p.ProviderName.Ref(),
  4449  	)
  4450  	p.ExtensionID = p.ExtensionID.FromRef(js.Undefined)
  4451  	p.ProviderName = p.ProviderName.FromRef(js.Undefined)
  4452  }
  4453  
  4454  type VoidCallbackFunc func(this js.Ref) js.Ref
  4455  
  4456  func (fn VoidCallbackFunc) Register() js.Func[func()] {
  4457  	return js.RegisterCallback[func()](
  4458  		fn, abi.FuncPCABIInternal(fn),
  4459  	)
  4460  }
  4461  
  4462  func (fn VoidCallbackFunc) DispatchCallback(
  4463  	targetPC uintptr, ctx *js.CallbackContext,
  4464  ) {
  4465  	args := ctx.Args()
  4466  	if len(args) != 0+1 /* js this */ ||
  4467  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  4468  		js.ThrowInvalidCallbackInvocation()
  4469  	}
  4470  
  4471  	if ctx.Return(fn(
  4472  		args[0],
  4473  	)) {
  4474  		return
  4475  	}
  4476  
  4477  	js.ThrowCallbackValueNotReturned()
  4478  }
  4479  
  4480  type VoidCallback[T any] struct {
  4481  	Fn  func(arg T, this js.Ref) js.Ref
  4482  	Arg T
  4483  }
  4484  
  4485  func (cb *VoidCallback[T]) Register() js.Func[func()] {
  4486  	return js.RegisterCallback[func()](
  4487  		cb, abi.FuncPCABIInternal(cb.Fn),
  4488  	)
  4489  }
  4490  
  4491  func (cb *VoidCallback[T]) DispatchCallback(
  4492  	targetPC uintptr, ctx *js.CallbackContext,
  4493  ) {
  4494  	args := ctx.Args()
  4495  	if len(args) != 0+1 /* js this */ ||
  4496  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  4497  		js.ThrowInvalidCallbackInvocation()
  4498  	}
  4499  
  4500  	if ctx.Return(cb.Fn(
  4501  		cb.Arg,
  4502  		args[0],
  4503  	)) {
  4504  		return
  4505  	}
  4506  
  4507  	js.ThrowCallbackValueNotReturned()
  4508  }
  4509  
  4510  // HasFuncCreateNetwork returns true if the function "WEBEXT.networking.onc.createNetwork" exists.
  4511  func HasFuncCreateNetwork() bool {
  4512  	return js.True == bindings.HasFuncCreateNetwork()
  4513  }
  4514  
  4515  // FuncCreateNetwork returns the function "WEBEXT.networking.onc.createNetwork".
  4516  func FuncCreateNetwork() (fn js.Func[func(shared bool, properties NetworkConfigProperties, callback js.Func[func(result js.String)])]) {
  4517  	bindings.FuncCreateNetwork(
  4518  		js.Pointer(&fn),
  4519  	)
  4520  	return
  4521  }
  4522  
  4523  // CreateNetwork calls the function "WEBEXT.networking.onc.createNetwork" directly.
  4524  func CreateNetwork(shared bool, properties NetworkConfigProperties, callback js.Func[func(result js.String)]) (ret js.Void) {
  4525  	bindings.CallCreateNetwork(
  4526  		js.Pointer(&ret),
  4527  		js.Bool(bool(shared)),
  4528  		js.Pointer(&properties),
  4529  		callback.Ref(),
  4530  	)
  4531  
  4532  	return
  4533  }
  4534  
  4535  // TryCreateNetwork calls the function "WEBEXT.networking.onc.createNetwork"
  4536  // in a try/catch block and returns (_, err, ok = false) when it went through
  4537  // the catch clause.
  4538  func TryCreateNetwork(shared bool, properties NetworkConfigProperties, callback js.Func[func(result js.String)]) (ret js.Void, exception js.Any, ok bool) {
  4539  	ok = js.True == bindings.TryCreateNetwork(
  4540  		js.Pointer(&ret), js.Pointer(&exception),
  4541  		js.Bool(bool(shared)),
  4542  		js.Pointer(&properties),
  4543  		callback.Ref(),
  4544  	)
  4545  
  4546  	return
  4547  }
  4548  
  4549  // HasFuncDisableNetworkType returns true if the function "WEBEXT.networking.onc.disableNetworkType" exists.
  4550  func HasFuncDisableNetworkType() bool {
  4551  	return js.True == bindings.HasFuncDisableNetworkType()
  4552  }
  4553  
  4554  // FuncDisableNetworkType returns the function "WEBEXT.networking.onc.disableNetworkType".
  4555  func FuncDisableNetworkType() (fn js.Func[func(networkType NetworkType)]) {
  4556  	bindings.FuncDisableNetworkType(
  4557  		js.Pointer(&fn),
  4558  	)
  4559  	return
  4560  }
  4561  
  4562  // DisableNetworkType calls the function "WEBEXT.networking.onc.disableNetworkType" directly.
  4563  func DisableNetworkType(networkType NetworkType) (ret js.Void) {
  4564  	bindings.CallDisableNetworkType(
  4565  		js.Pointer(&ret),
  4566  		uint32(networkType),
  4567  	)
  4568  
  4569  	return
  4570  }
  4571  
  4572  // TryDisableNetworkType calls the function "WEBEXT.networking.onc.disableNetworkType"
  4573  // in a try/catch block and returns (_, err, ok = false) when it went through
  4574  // the catch clause.
  4575  func TryDisableNetworkType(networkType NetworkType) (ret js.Void, exception js.Any, ok bool) {
  4576  	ok = js.True == bindings.TryDisableNetworkType(
  4577  		js.Pointer(&ret), js.Pointer(&exception),
  4578  		uint32(networkType),
  4579  	)
  4580  
  4581  	return
  4582  }
  4583  
  4584  // HasFuncEnableNetworkType returns true if the function "WEBEXT.networking.onc.enableNetworkType" exists.
  4585  func HasFuncEnableNetworkType() bool {
  4586  	return js.True == bindings.HasFuncEnableNetworkType()
  4587  }
  4588  
  4589  // FuncEnableNetworkType returns the function "WEBEXT.networking.onc.enableNetworkType".
  4590  func FuncEnableNetworkType() (fn js.Func[func(networkType NetworkType)]) {
  4591  	bindings.FuncEnableNetworkType(
  4592  		js.Pointer(&fn),
  4593  	)
  4594  	return
  4595  }
  4596  
  4597  // EnableNetworkType calls the function "WEBEXT.networking.onc.enableNetworkType" directly.
  4598  func EnableNetworkType(networkType NetworkType) (ret js.Void) {
  4599  	bindings.CallEnableNetworkType(
  4600  		js.Pointer(&ret),
  4601  		uint32(networkType),
  4602  	)
  4603  
  4604  	return
  4605  }
  4606  
  4607  // TryEnableNetworkType calls the function "WEBEXT.networking.onc.enableNetworkType"
  4608  // in a try/catch block and returns (_, err, ok = false) when it went through
  4609  // the catch clause.
  4610  func TryEnableNetworkType(networkType NetworkType) (ret js.Void, exception js.Any, ok bool) {
  4611  	ok = js.True == bindings.TryEnableNetworkType(
  4612  		js.Pointer(&ret), js.Pointer(&exception),
  4613  		uint32(networkType),
  4614  	)
  4615  
  4616  	return
  4617  }
  4618  
  4619  // HasFuncForgetNetwork returns true if the function "WEBEXT.networking.onc.forgetNetwork" exists.
  4620  func HasFuncForgetNetwork() bool {
  4621  	return js.True == bindings.HasFuncForgetNetwork()
  4622  }
  4623  
  4624  // FuncForgetNetwork returns the function "WEBEXT.networking.onc.forgetNetwork".
  4625  func FuncForgetNetwork() (fn js.Func[func(networkGuid js.String, callback js.Func[func()])]) {
  4626  	bindings.FuncForgetNetwork(
  4627  		js.Pointer(&fn),
  4628  	)
  4629  	return
  4630  }
  4631  
  4632  // ForgetNetwork calls the function "WEBEXT.networking.onc.forgetNetwork" directly.
  4633  func ForgetNetwork(networkGuid js.String, callback js.Func[func()]) (ret js.Void) {
  4634  	bindings.CallForgetNetwork(
  4635  		js.Pointer(&ret),
  4636  		networkGuid.Ref(),
  4637  		callback.Ref(),
  4638  	)
  4639  
  4640  	return
  4641  }
  4642  
  4643  // TryForgetNetwork calls the function "WEBEXT.networking.onc.forgetNetwork"
  4644  // in a try/catch block and returns (_, err, ok = false) when it went through
  4645  // the catch clause.
  4646  func TryForgetNetwork(networkGuid js.String, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  4647  	ok = js.True == bindings.TryForgetNetwork(
  4648  		js.Pointer(&ret), js.Pointer(&exception),
  4649  		networkGuid.Ref(),
  4650  		callback.Ref(),
  4651  	)
  4652  
  4653  	return
  4654  }
  4655  
  4656  // HasFuncGetCaptivePortalStatus returns true if the function "WEBEXT.networking.onc.getCaptivePortalStatus" exists.
  4657  func HasFuncGetCaptivePortalStatus() bool {
  4658  	return js.True == bindings.HasFuncGetCaptivePortalStatus()
  4659  }
  4660  
  4661  // FuncGetCaptivePortalStatus returns the function "WEBEXT.networking.onc.getCaptivePortalStatus".
  4662  func FuncGetCaptivePortalStatus() (fn js.Func[func(networkGuid js.String, callback js.Func[func(result CaptivePortalStatus)])]) {
  4663  	bindings.FuncGetCaptivePortalStatus(
  4664  		js.Pointer(&fn),
  4665  	)
  4666  	return
  4667  }
  4668  
  4669  // GetCaptivePortalStatus calls the function "WEBEXT.networking.onc.getCaptivePortalStatus" directly.
  4670  func GetCaptivePortalStatus(networkGuid js.String, callback js.Func[func(result CaptivePortalStatus)]) (ret js.Void) {
  4671  	bindings.CallGetCaptivePortalStatus(
  4672  		js.Pointer(&ret),
  4673  		networkGuid.Ref(),
  4674  		callback.Ref(),
  4675  	)
  4676  
  4677  	return
  4678  }
  4679  
  4680  // TryGetCaptivePortalStatus calls the function "WEBEXT.networking.onc.getCaptivePortalStatus"
  4681  // in a try/catch block and returns (_, err, ok = false) when it went through
  4682  // the catch clause.
  4683  func TryGetCaptivePortalStatus(networkGuid js.String, callback js.Func[func(result CaptivePortalStatus)]) (ret js.Void, exception js.Any, ok bool) {
  4684  	ok = js.True == bindings.TryGetCaptivePortalStatus(
  4685  		js.Pointer(&ret), js.Pointer(&exception),
  4686  		networkGuid.Ref(),
  4687  		callback.Ref(),
  4688  	)
  4689  
  4690  	return
  4691  }
  4692  
  4693  // HasFuncGetDeviceStates returns true if the function "WEBEXT.networking.onc.getDeviceStates" exists.
  4694  func HasFuncGetDeviceStates() bool {
  4695  	return js.True == bindings.HasFuncGetDeviceStates()
  4696  }
  4697  
  4698  // FuncGetDeviceStates returns the function "WEBEXT.networking.onc.getDeviceStates".
  4699  func FuncGetDeviceStates() (fn js.Func[func(callback js.Func[func(result js.Array[DeviceStateProperties])])]) {
  4700  	bindings.FuncGetDeviceStates(
  4701  		js.Pointer(&fn),
  4702  	)
  4703  	return
  4704  }
  4705  
  4706  // GetDeviceStates calls the function "WEBEXT.networking.onc.getDeviceStates" directly.
  4707  func GetDeviceStates(callback js.Func[func(result js.Array[DeviceStateProperties])]) (ret js.Void) {
  4708  	bindings.CallGetDeviceStates(
  4709  		js.Pointer(&ret),
  4710  		callback.Ref(),
  4711  	)
  4712  
  4713  	return
  4714  }
  4715  
  4716  // TryGetDeviceStates calls the function "WEBEXT.networking.onc.getDeviceStates"
  4717  // in a try/catch block and returns (_, err, ok = false) when it went through
  4718  // the catch clause.
  4719  func TryGetDeviceStates(callback js.Func[func(result js.Array[DeviceStateProperties])]) (ret js.Void, exception js.Any, ok bool) {
  4720  	ok = js.True == bindings.TryGetDeviceStates(
  4721  		js.Pointer(&ret), js.Pointer(&exception),
  4722  		callback.Ref(),
  4723  	)
  4724  
  4725  	return
  4726  }
  4727  
  4728  // HasFuncGetGlobalPolicy returns true if the function "WEBEXT.networking.onc.getGlobalPolicy" exists.
  4729  func HasFuncGetGlobalPolicy() bool {
  4730  	return js.True == bindings.HasFuncGetGlobalPolicy()
  4731  }
  4732  
  4733  // FuncGetGlobalPolicy returns the function "WEBEXT.networking.onc.getGlobalPolicy".
  4734  func FuncGetGlobalPolicy() (fn js.Func[func(callback js.Func[func(result *GlobalPolicy)])]) {
  4735  	bindings.FuncGetGlobalPolicy(
  4736  		js.Pointer(&fn),
  4737  	)
  4738  	return
  4739  }
  4740  
  4741  // GetGlobalPolicy calls the function "WEBEXT.networking.onc.getGlobalPolicy" directly.
  4742  func GetGlobalPolicy(callback js.Func[func(result *GlobalPolicy)]) (ret js.Void) {
  4743  	bindings.CallGetGlobalPolicy(
  4744  		js.Pointer(&ret),
  4745  		callback.Ref(),
  4746  	)
  4747  
  4748  	return
  4749  }
  4750  
  4751  // TryGetGlobalPolicy calls the function "WEBEXT.networking.onc.getGlobalPolicy"
  4752  // in a try/catch block and returns (_, err, ok = false) when it went through
  4753  // the catch clause.
  4754  func TryGetGlobalPolicy(callback js.Func[func(result *GlobalPolicy)]) (ret js.Void, exception js.Any, ok bool) {
  4755  	ok = js.True == bindings.TryGetGlobalPolicy(
  4756  		js.Pointer(&ret), js.Pointer(&exception),
  4757  		callback.Ref(),
  4758  	)
  4759  
  4760  	return
  4761  }
  4762  
  4763  // HasFuncGetManagedProperties returns true if the function "WEBEXT.networking.onc.getManagedProperties" exists.
  4764  func HasFuncGetManagedProperties() bool {
  4765  	return js.True == bindings.HasFuncGetManagedProperties()
  4766  }
  4767  
  4768  // FuncGetManagedProperties returns the function "WEBEXT.networking.onc.getManagedProperties".
  4769  func FuncGetManagedProperties() (fn js.Func[func(networkGuid js.String, callback js.Func[func(result *ManagedProperties)])]) {
  4770  	bindings.FuncGetManagedProperties(
  4771  		js.Pointer(&fn),
  4772  	)
  4773  	return
  4774  }
  4775  
  4776  // GetManagedProperties calls the function "WEBEXT.networking.onc.getManagedProperties" directly.
  4777  func GetManagedProperties(networkGuid js.String, callback js.Func[func(result *ManagedProperties)]) (ret js.Void) {
  4778  	bindings.CallGetManagedProperties(
  4779  		js.Pointer(&ret),
  4780  		networkGuid.Ref(),
  4781  		callback.Ref(),
  4782  	)
  4783  
  4784  	return
  4785  }
  4786  
  4787  // TryGetManagedProperties calls the function "WEBEXT.networking.onc.getManagedProperties"
  4788  // in a try/catch block and returns (_, err, ok = false) when it went through
  4789  // the catch clause.
  4790  func TryGetManagedProperties(networkGuid js.String, callback js.Func[func(result *ManagedProperties)]) (ret js.Void, exception js.Any, ok bool) {
  4791  	ok = js.True == bindings.TryGetManagedProperties(
  4792  		js.Pointer(&ret), js.Pointer(&exception),
  4793  		networkGuid.Ref(),
  4794  		callback.Ref(),
  4795  	)
  4796  
  4797  	return
  4798  }
  4799  
  4800  // HasFuncGetNetworks returns true if the function "WEBEXT.networking.onc.getNetworks" exists.
  4801  func HasFuncGetNetworks() bool {
  4802  	return js.True == bindings.HasFuncGetNetworks()
  4803  }
  4804  
  4805  // FuncGetNetworks returns the function "WEBEXT.networking.onc.getNetworks".
  4806  func FuncGetNetworks() (fn js.Func[func(filter NetworkFilter, callback js.Func[func(result js.Array[NetworkStateProperties])])]) {
  4807  	bindings.FuncGetNetworks(
  4808  		js.Pointer(&fn),
  4809  	)
  4810  	return
  4811  }
  4812  
  4813  // GetNetworks calls the function "WEBEXT.networking.onc.getNetworks" directly.
  4814  func GetNetworks(filter NetworkFilter, callback js.Func[func(result js.Array[NetworkStateProperties])]) (ret js.Void) {
  4815  	bindings.CallGetNetworks(
  4816  		js.Pointer(&ret),
  4817  		js.Pointer(&filter),
  4818  		callback.Ref(),
  4819  	)
  4820  
  4821  	return
  4822  }
  4823  
  4824  // TryGetNetworks calls the function "WEBEXT.networking.onc.getNetworks"
  4825  // in a try/catch block and returns (_, err, ok = false) when it went through
  4826  // the catch clause.
  4827  func TryGetNetworks(filter NetworkFilter, callback js.Func[func(result js.Array[NetworkStateProperties])]) (ret js.Void, exception js.Any, ok bool) {
  4828  	ok = js.True == bindings.TryGetNetworks(
  4829  		js.Pointer(&ret), js.Pointer(&exception),
  4830  		js.Pointer(&filter),
  4831  		callback.Ref(),
  4832  	)
  4833  
  4834  	return
  4835  }
  4836  
  4837  // HasFuncGetProperties returns true if the function "WEBEXT.networking.onc.getProperties" exists.
  4838  func HasFuncGetProperties() bool {
  4839  	return js.True == bindings.HasFuncGetProperties()
  4840  }
  4841  
  4842  // FuncGetProperties returns the function "WEBEXT.networking.onc.getProperties".
  4843  func FuncGetProperties() (fn js.Func[func(networkGuid js.String, callback js.Func[func(result *NetworkProperties)])]) {
  4844  	bindings.FuncGetProperties(
  4845  		js.Pointer(&fn),
  4846  	)
  4847  	return
  4848  }
  4849  
  4850  // GetProperties calls the function "WEBEXT.networking.onc.getProperties" directly.
  4851  func GetProperties(networkGuid js.String, callback js.Func[func(result *NetworkProperties)]) (ret js.Void) {
  4852  	bindings.CallGetProperties(
  4853  		js.Pointer(&ret),
  4854  		networkGuid.Ref(),
  4855  		callback.Ref(),
  4856  	)
  4857  
  4858  	return
  4859  }
  4860  
  4861  // TryGetProperties calls the function "WEBEXT.networking.onc.getProperties"
  4862  // in a try/catch block and returns (_, err, ok = false) when it went through
  4863  // the catch clause.
  4864  func TryGetProperties(networkGuid js.String, callback js.Func[func(result *NetworkProperties)]) (ret js.Void, exception js.Any, ok bool) {
  4865  	ok = js.True == bindings.TryGetProperties(
  4866  		js.Pointer(&ret), js.Pointer(&exception),
  4867  		networkGuid.Ref(),
  4868  		callback.Ref(),
  4869  	)
  4870  
  4871  	return
  4872  }
  4873  
  4874  // HasFuncGetState returns true if the function "WEBEXT.networking.onc.getState" exists.
  4875  func HasFuncGetState() bool {
  4876  	return js.True == bindings.HasFuncGetState()
  4877  }
  4878  
  4879  // FuncGetState returns the function "WEBEXT.networking.onc.getState".
  4880  func FuncGetState() (fn js.Func[func(networkGuid js.String, callback js.Func[func(result *NetworkStateProperties)])]) {
  4881  	bindings.FuncGetState(
  4882  		js.Pointer(&fn),
  4883  	)
  4884  	return
  4885  }
  4886  
  4887  // GetState calls the function "WEBEXT.networking.onc.getState" directly.
  4888  func GetState(networkGuid js.String, callback js.Func[func(result *NetworkStateProperties)]) (ret js.Void) {
  4889  	bindings.CallGetState(
  4890  		js.Pointer(&ret),
  4891  		networkGuid.Ref(),
  4892  		callback.Ref(),
  4893  	)
  4894  
  4895  	return
  4896  }
  4897  
  4898  // TryGetState calls the function "WEBEXT.networking.onc.getState"
  4899  // in a try/catch block and returns (_, err, ok = false) when it went through
  4900  // the catch clause.
  4901  func TryGetState(networkGuid js.String, callback js.Func[func(result *NetworkStateProperties)]) (ret js.Void, exception js.Any, ok bool) {
  4902  	ok = js.True == bindings.TryGetState(
  4903  		js.Pointer(&ret), js.Pointer(&exception),
  4904  		networkGuid.Ref(),
  4905  		callback.Ref(),
  4906  	)
  4907  
  4908  	return
  4909  }
  4910  
  4911  type OnDeviceStateListChangedEventCallbackFunc func(this js.Ref) js.Ref
  4912  
  4913  func (fn OnDeviceStateListChangedEventCallbackFunc) Register() js.Func[func()] {
  4914  	return js.RegisterCallback[func()](
  4915  		fn, abi.FuncPCABIInternal(fn),
  4916  	)
  4917  }
  4918  
  4919  func (fn OnDeviceStateListChangedEventCallbackFunc) DispatchCallback(
  4920  	targetPC uintptr, ctx *js.CallbackContext,
  4921  ) {
  4922  	args := ctx.Args()
  4923  	if len(args) != 0+1 /* js this */ ||
  4924  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  4925  		js.ThrowInvalidCallbackInvocation()
  4926  	}
  4927  
  4928  	if ctx.Return(fn(
  4929  		args[0],
  4930  	)) {
  4931  		return
  4932  	}
  4933  
  4934  	js.ThrowCallbackValueNotReturned()
  4935  }
  4936  
  4937  type OnDeviceStateListChangedEventCallback[T any] struct {
  4938  	Fn  func(arg T, this js.Ref) js.Ref
  4939  	Arg T
  4940  }
  4941  
  4942  func (cb *OnDeviceStateListChangedEventCallback[T]) Register() js.Func[func()] {
  4943  	return js.RegisterCallback[func()](
  4944  		cb, abi.FuncPCABIInternal(cb.Fn),
  4945  	)
  4946  }
  4947  
  4948  func (cb *OnDeviceStateListChangedEventCallback[T]) DispatchCallback(
  4949  	targetPC uintptr, ctx *js.CallbackContext,
  4950  ) {
  4951  	args := ctx.Args()
  4952  	if len(args) != 0+1 /* js this */ ||
  4953  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  4954  		js.ThrowInvalidCallbackInvocation()
  4955  	}
  4956  
  4957  	if ctx.Return(cb.Fn(
  4958  		cb.Arg,
  4959  		args[0],
  4960  	)) {
  4961  		return
  4962  	}
  4963  
  4964  	js.ThrowCallbackValueNotReturned()
  4965  }
  4966  
  4967  // HasFuncOnDeviceStateListChanged returns true if the function "WEBEXT.networking.onc.onDeviceStateListChanged.addListener" exists.
  4968  func HasFuncOnDeviceStateListChanged() bool {
  4969  	return js.True == bindings.HasFuncOnDeviceStateListChanged()
  4970  }
  4971  
  4972  // FuncOnDeviceStateListChanged returns the function "WEBEXT.networking.onc.onDeviceStateListChanged.addListener".
  4973  func FuncOnDeviceStateListChanged() (fn js.Func[func(callback js.Func[func()])]) {
  4974  	bindings.FuncOnDeviceStateListChanged(
  4975  		js.Pointer(&fn),
  4976  	)
  4977  	return
  4978  }
  4979  
  4980  // OnDeviceStateListChanged calls the function "WEBEXT.networking.onc.onDeviceStateListChanged.addListener" directly.
  4981  func OnDeviceStateListChanged(callback js.Func[func()]) (ret js.Void) {
  4982  	bindings.CallOnDeviceStateListChanged(
  4983  		js.Pointer(&ret),
  4984  		callback.Ref(),
  4985  	)
  4986  
  4987  	return
  4988  }
  4989  
  4990  // TryOnDeviceStateListChanged calls the function "WEBEXT.networking.onc.onDeviceStateListChanged.addListener"
  4991  // in a try/catch block and returns (_, err, ok = false) when it went through
  4992  // the catch clause.
  4993  func TryOnDeviceStateListChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  4994  	ok = js.True == bindings.TryOnDeviceStateListChanged(
  4995  		js.Pointer(&ret), js.Pointer(&exception),
  4996  		callback.Ref(),
  4997  	)
  4998  
  4999  	return
  5000  }
  5001  
  5002  // HasFuncOffDeviceStateListChanged returns true if the function "WEBEXT.networking.onc.onDeviceStateListChanged.removeListener" exists.
  5003  func HasFuncOffDeviceStateListChanged() bool {
  5004  	return js.True == bindings.HasFuncOffDeviceStateListChanged()
  5005  }
  5006  
  5007  // FuncOffDeviceStateListChanged returns the function "WEBEXT.networking.onc.onDeviceStateListChanged.removeListener".
  5008  func FuncOffDeviceStateListChanged() (fn js.Func[func(callback js.Func[func()])]) {
  5009  	bindings.FuncOffDeviceStateListChanged(
  5010  		js.Pointer(&fn),
  5011  	)
  5012  	return
  5013  }
  5014  
  5015  // OffDeviceStateListChanged calls the function "WEBEXT.networking.onc.onDeviceStateListChanged.removeListener" directly.
  5016  func OffDeviceStateListChanged(callback js.Func[func()]) (ret js.Void) {
  5017  	bindings.CallOffDeviceStateListChanged(
  5018  		js.Pointer(&ret),
  5019  		callback.Ref(),
  5020  	)
  5021  
  5022  	return
  5023  }
  5024  
  5025  // TryOffDeviceStateListChanged calls the function "WEBEXT.networking.onc.onDeviceStateListChanged.removeListener"
  5026  // in a try/catch block and returns (_, err, ok = false) when it went through
  5027  // the catch clause.
  5028  func TryOffDeviceStateListChanged(callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  5029  	ok = js.True == bindings.TryOffDeviceStateListChanged(
  5030  		js.Pointer(&ret), js.Pointer(&exception),
  5031  		callback.Ref(),
  5032  	)
  5033  
  5034  	return
  5035  }
  5036  
  5037  // HasFuncHasOnDeviceStateListChanged returns true if the function "WEBEXT.networking.onc.onDeviceStateListChanged.hasListener" exists.
  5038  func HasFuncHasOnDeviceStateListChanged() bool {
  5039  	return js.True == bindings.HasFuncHasOnDeviceStateListChanged()
  5040  }
  5041  
  5042  // FuncHasOnDeviceStateListChanged returns the function "WEBEXT.networking.onc.onDeviceStateListChanged.hasListener".
  5043  func FuncHasOnDeviceStateListChanged() (fn js.Func[func(callback js.Func[func()]) bool]) {
  5044  	bindings.FuncHasOnDeviceStateListChanged(
  5045  		js.Pointer(&fn),
  5046  	)
  5047  	return
  5048  }
  5049  
  5050  // HasOnDeviceStateListChanged calls the function "WEBEXT.networking.onc.onDeviceStateListChanged.hasListener" directly.
  5051  func HasOnDeviceStateListChanged(callback js.Func[func()]) (ret bool) {
  5052  	bindings.CallHasOnDeviceStateListChanged(
  5053  		js.Pointer(&ret),
  5054  		callback.Ref(),
  5055  	)
  5056  
  5057  	return
  5058  }
  5059  
  5060  // TryHasOnDeviceStateListChanged calls the function "WEBEXT.networking.onc.onDeviceStateListChanged.hasListener"
  5061  // in a try/catch block and returns (_, err, ok = false) when it went through
  5062  // the catch clause.
  5063  func TryHasOnDeviceStateListChanged(callback js.Func[func()]) (ret bool, exception js.Any, ok bool) {
  5064  	ok = js.True == bindings.TryHasOnDeviceStateListChanged(
  5065  		js.Pointer(&ret), js.Pointer(&exception),
  5066  		callback.Ref(),
  5067  	)
  5068  
  5069  	return
  5070  }
  5071  
  5072  type OnNetworkListChangedEventCallbackFunc func(this js.Ref, changes js.Array[js.String]) js.Ref
  5073  
  5074  func (fn OnNetworkListChangedEventCallbackFunc) Register() js.Func[func(changes js.Array[js.String])] {
  5075  	return js.RegisterCallback[func(changes js.Array[js.String])](
  5076  		fn, abi.FuncPCABIInternal(fn),
  5077  	)
  5078  }
  5079  
  5080  func (fn OnNetworkListChangedEventCallbackFunc) DispatchCallback(
  5081  	targetPC uintptr, ctx *js.CallbackContext,
  5082  ) {
  5083  	args := ctx.Args()
  5084  	if len(args) != 1+1 /* js this */ ||
  5085  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  5086  		js.ThrowInvalidCallbackInvocation()
  5087  	}
  5088  
  5089  	if ctx.Return(fn(
  5090  		args[0],
  5091  
  5092  		js.Array[js.String]{}.FromRef(args[0+1]),
  5093  	)) {
  5094  		return
  5095  	}
  5096  
  5097  	js.ThrowCallbackValueNotReturned()
  5098  }
  5099  
  5100  type OnNetworkListChangedEventCallback[T any] struct {
  5101  	Fn  func(arg T, this js.Ref, changes js.Array[js.String]) js.Ref
  5102  	Arg T
  5103  }
  5104  
  5105  func (cb *OnNetworkListChangedEventCallback[T]) Register() js.Func[func(changes js.Array[js.String])] {
  5106  	return js.RegisterCallback[func(changes js.Array[js.String])](
  5107  		cb, abi.FuncPCABIInternal(cb.Fn),
  5108  	)
  5109  }
  5110  
  5111  func (cb *OnNetworkListChangedEventCallback[T]) DispatchCallback(
  5112  	targetPC uintptr, ctx *js.CallbackContext,
  5113  ) {
  5114  	args := ctx.Args()
  5115  	if len(args) != 1+1 /* js this */ ||
  5116  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  5117  		js.ThrowInvalidCallbackInvocation()
  5118  	}
  5119  
  5120  	if ctx.Return(cb.Fn(
  5121  		cb.Arg,
  5122  		args[0],
  5123  
  5124  		js.Array[js.String]{}.FromRef(args[0+1]),
  5125  	)) {
  5126  		return
  5127  	}
  5128  
  5129  	js.ThrowCallbackValueNotReturned()
  5130  }
  5131  
  5132  // HasFuncOnNetworkListChanged returns true if the function "WEBEXT.networking.onc.onNetworkListChanged.addListener" exists.
  5133  func HasFuncOnNetworkListChanged() bool {
  5134  	return js.True == bindings.HasFuncOnNetworkListChanged()
  5135  }
  5136  
  5137  // FuncOnNetworkListChanged returns the function "WEBEXT.networking.onc.onNetworkListChanged.addListener".
  5138  func FuncOnNetworkListChanged() (fn js.Func[func(callback js.Func[func(changes js.Array[js.String])])]) {
  5139  	bindings.FuncOnNetworkListChanged(
  5140  		js.Pointer(&fn),
  5141  	)
  5142  	return
  5143  }
  5144  
  5145  // OnNetworkListChanged calls the function "WEBEXT.networking.onc.onNetworkListChanged.addListener" directly.
  5146  func OnNetworkListChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void) {
  5147  	bindings.CallOnNetworkListChanged(
  5148  		js.Pointer(&ret),
  5149  		callback.Ref(),
  5150  	)
  5151  
  5152  	return
  5153  }
  5154  
  5155  // TryOnNetworkListChanged calls the function "WEBEXT.networking.onc.onNetworkListChanged.addListener"
  5156  // in a try/catch block and returns (_, err, ok = false) when it went through
  5157  // the catch clause.
  5158  func TryOnNetworkListChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void, exception js.Any, ok bool) {
  5159  	ok = js.True == bindings.TryOnNetworkListChanged(
  5160  		js.Pointer(&ret), js.Pointer(&exception),
  5161  		callback.Ref(),
  5162  	)
  5163  
  5164  	return
  5165  }
  5166  
  5167  // HasFuncOffNetworkListChanged returns true if the function "WEBEXT.networking.onc.onNetworkListChanged.removeListener" exists.
  5168  func HasFuncOffNetworkListChanged() bool {
  5169  	return js.True == bindings.HasFuncOffNetworkListChanged()
  5170  }
  5171  
  5172  // FuncOffNetworkListChanged returns the function "WEBEXT.networking.onc.onNetworkListChanged.removeListener".
  5173  func FuncOffNetworkListChanged() (fn js.Func[func(callback js.Func[func(changes js.Array[js.String])])]) {
  5174  	bindings.FuncOffNetworkListChanged(
  5175  		js.Pointer(&fn),
  5176  	)
  5177  	return
  5178  }
  5179  
  5180  // OffNetworkListChanged calls the function "WEBEXT.networking.onc.onNetworkListChanged.removeListener" directly.
  5181  func OffNetworkListChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void) {
  5182  	bindings.CallOffNetworkListChanged(
  5183  		js.Pointer(&ret),
  5184  		callback.Ref(),
  5185  	)
  5186  
  5187  	return
  5188  }
  5189  
  5190  // TryOffNetworkListChanged calls the function "WEBEXT.networking.onc.onNetworkListChanged.removeListener"
  5191  // in a try/catch block and returns (_, err, ok = false) when it went through
  5192  // the catch clause.
  5193  func TryOffNetworkListChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void, exception js.Any, ok bool) {
  5194  	ok = js.True == bindings.TryOffNetworkListChanged(
  5195  		js.Pointer(&ret), js.Pointer(&exception),
  5196  		callback.Ref(),
  5197  	)
  5198  
  5199  	return
  5200  }
  5201  
  5202  // HasFuncHasOnNetworkListChanged returns true if the function "WEBEXT.networking.onc.onNetworkListChanged.hasListener" exists.
  5203  func HasFuncHasOnNetworkListChanged() bool {
  5204  	return js.True == bindings.HasFuncHasOnNetworkListChanged()
  5205  }
  5206  
  5207  // FuncHasOnNetworkListChanged returns the function "WEBEXT.networking.onc.onNetworkListChanged.hasListener".
  5208  func FuncHasOnNetworkListChanged() (fn js.Func[func(callback js.Func[func(changes js.Array[js.String])]) bool]) {
  5209  	bindings.FuncHasOnNetworkListChanged(
  5210  		js.Pointer(&fn),
  5211  	)
  5212  	return
  5213  }
  5214  
  5215  // HasOnNetworkListChanged calls the function "WEBEXT.networking.onc.onNetworkListChanged.hasListener" directly.
  5216  func HasOnNetworkListChanged(callback js.Func[func(changes js.Array[js.String])]) (ret bool) {
  5217  	bindings.CallHasOnNetworkListChanged(
  5218  		js.Pointer(&ret),
  5219  		callback.Ref(),
  5220  	)
  5221  
  5222  	return
  5223  }
  5224  
  5225  // TryHasOnNetworkListChanged calls the function "WEBEXT.networking.onc.onNetworkListChanged.hasListener"
  5226  // in a try/catch block and returns (_, err, ok = false) when it went through
  5227  // the catch clause.
  5228  func TryHasOnNetworkListChanged(callback js.Func[func(changes js.Array[js.String])]) (ret bool, exception js.Any, ok bool) {
  5229  	ok = js.True == bindings.TryHasOnNetworkListChanged(
  5230  		js.Pointer(&ret), js.Pointer(&exception),
  5231  		callback.Ref(),
  5232  	)
  5233  
  5234  	return
  5235  }
  5236  
  5237  type OnNetworksChangedEventCallbackFunc func(this js.Ref, changes js.Array[js.String]) js.Ref
  5238  
  5239  func (fn OnNetworksChangedEventCallbackFunc) Register() js.Func[func(changes js.Array[js.String])] {
  5240  	return js.RegisterCallback[func(changes js.Array[js.String])](
  5241  		fn, abi.FuncPCABIInternal(fn),
  5242  	)
  5243  }
  5244  
  5245  func (fn OnNetworksChangedEventCallbackFunc) DispatchCallback(
  5246  	targetPC uintptr, ctx *js.CallbackContext,
  5247  ) {
  5248  	args := ctx.Args()
  5249  	if len(args) != 1+1 /* js this */ ||
  5250  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  5251  		js.ThrowInvalidCallbackInvocation()
  5252  	}
  5253  
  5254  	if ctx.Return(fn(
  5255  		args[0],
  5256  
  5257  		js.Array[js.String]{}.FromRef(args[0+1]),
  5258  	)) {
  5259  		return
  5260  	}
  5261  
  5262  	js.ThrowCallbackValueNotReturned()
  5263  }
  5264  
  5265  type OnNetworksChangedEventCallback[T any] struct {
  5266  	Fn  func(arg T, this js.Ref, changes js.Array[js.String]) js.Ref
  5267  	Arg T
  5268  }
  5269  
  5270  func (cb *OnNetworksChangedEventCallback[T]) Register() js.Func[func(changes js.Array[js.String])] {
  5271  	return js.RegisterCallback[func(changes js.Array[js.String])](
  5272  		cb, abi.FuncPCABIInternal(cb.Fn),
  5273  	)
  5274  }
  5275  
  5276  func (cb *OnNetworksChangedEventCallback[T]) DispatchCallback(
  5277  	targetPC uintptr, ctx *js.CallbackContext,
  5278  ) {
  5279  	args := ctx.Args()
  5280  	if len(args) != 1+1 /* js this */ ||
  5281  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  5282  		js.ThrowInvalidCallbackInvocation()
  5283  	}
  5284  
  5285  	if ctx.Return(cb.Fn(
  5286  		cb.Arg,
  5287  		args[0],
  5288  
  5289  		js.Array[js.String]{}.FromRef(args[0+1]),
  5290  	)) {
  5291  		return
  5292  	}
  5293  
  5294  	js.ThrowCallbackValueNotReturned()
  5295  }
  5296  
  5297  // HasFuncOnNetworksChanged returns true if the function "WEBEXT.networking.onc.onNetworksChanged.addListener" exists.
  5298  func HasFuncOnNetworksChanged() bool {
  5299  	return js.True == bindings.HasFuncOnNetworksChanged()
  5300  }
  5301  
  5302  // FuncOnNetworksChanged returns the function "WEBEXT.networking.onc.onNetworksChanged.addListener".
  5303  func FuncOnNetworksChanged() (fn js.Func[func(callback js.Func[func(changes js.Array[js.String])])]) {
  5304  	bindings.FuncOnNetworksChanged(
  5305  		js.Pointer(&fn),
  5306  	)
  5307  	return
  5308  }
  5309  
  5310  // OnNetworksChanged calls the function "WEBEXT.networking.onc.onNetworksChanged.addListener" directly.
  5311  func OnNetworksChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void) {
  5312  	bindings.CallOnNetworksChanged(
  5313  		js.Pointer(&ret),
  5314  		callback.Ref(),
  5315  	)
  5316  
  5317  	return
  5318  }
  5319  
  5320  // TryOnNetworksChanged calls the function "WEBEXT.networking.onc.onNetworksChanged.addListener"
  5321  // in a try/catch block and returns (_, err, ok = false) when it went through
  5322  // the catch clause.
  5323  func TryOnNetworksChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void, exception js.Any, ok bool) {
  5324  	ok = js.True == bindings.TryOnNetworksChanged(
  5325  		js.Pointer(&ret), js.Pointer(&exception),
  5326  		callback.Ref(),
  5327  	)
  5328  
  5329  	return
  5330  }
  5331  
  5332  // HasFuncOffNetworksChanged returns true if the function "WEBEXT.networking.onc.onNetworksChanged.removeListener" exists.
  5333  func HasFuncOffNetworksChanged() bool {
  5334  	return js.True == bindings.HasFuncOffNetworksChanged()
  5335  }
  5336  
  5337  // FuncOffNetworksChanged returns the function "WEBEXT.networking.onc.onNetworksChanged.removeListener".
  5338  func FuncOffNetworksChanged() (fn js.Func[func(callback js.Func[func(changes js.Array[js.String])])]) {
  5339  	bindings.FuncOffNetworksChanged(
  5340  		js.Pointer(&fn),
  5341  	)
  5342  	return
  5343  }
  5344  
  5345  // OffNetworksChanged calls the function "WEBEXT.networking.onc.onNetworksChanged.removeListener" directly.
  5346  func OffNetworksChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void) {
  5347  	bindings.CallOffNetworksChanged(
  5348  		js.Pointer(&ret),
  5349  		callback.Ref(),
  5350  	)
  5351  
  5352  	return
  5353  }
  5354  
  5355  // TryOffNetworksChanged calls the function "WEBEXT.networking.onc.onNetworksChanged.removeListener"
  5356  // in a try/catch block and returns (_, err, ok = false) when it went through
  5357  // the catch clause.
  5358  func TryOffNetworksChanged(callback js.Func[func(changes js.Array[js.String])]) (ret js.Void, exception js.Any, ok bool) {
  5359  	ok = js.True == bindings.TryOffNetworksChanged(
  5360  		js.Pointer(&ret), js.Pointer(&exception),
  5361  		callback.Ref(),
  5362  	)
  5363  
  5364  	return
  5365  }
  5366  
  5367  // HasFuncHasOnNetworksChanged returns true if the function "WEBEXT.networking.onc.onNetworksChanged.hasListener" exists.
  5368  func HasFuncHasOnNetworksChanged() bool {
  5369  	return js.True == bindings.HasFuncHasOnNetworksChanged()
  5370  }
  5371  
  5372  // FuncHasOnNetworksChanged returns the function "WEBEXT.networking.onc.onNetworksChanged.hasListener".
  5373  func FuncHasOnNetworksChanged() (fn js.Func[func(callback js.Func[func(changes js.Array[js.String])]) bool]) {
  5374  	bindings.FuncHasOnNetworksChanged(
  5375  		js.Pointer(&fn),
  5376  	)
  5377  	return
  5378  }
  5379  
  5380  // HasOnNetworksChanged calls the function "WEBEXT.networking.onc.onNetworksChanged.hasListener" directly.
  5381  func HasOnNetworksChanged(callback js.Func[func(changes js.Array[js.String])]) (ret bool) {
  5382  	bindings.CallHasOnNetworksChanged(
  5383  		js.Pointer(&ret),
  5384  		callback.Ref(),
  5385  	)
  5386  
  5387  	return
  5388  }
  5389  
  5390  // TryHasOnNetworksChanged calls the function "WEBEXT.networking.onc.onNetworksChanged.hasListener"
  5391  // in a try/catch block and returns (_, err, ok = false) when it went through
  5392  // the catch clause.
  5393  func TryHasOnNetworksChanged(callback js.Func[func(changes js.Array[js.String])]) (ret bool, exception js.Any, ok bool) {
  5394  	ok = js.True == bindings.TryHasOnNetworksChanged(
  5395  		js.Pointer(&ret), js.Pointer(&exception),
  5396  		callback.Ref(),
  5397  	)
  5398  
  5399  	return
  5400  }
  5401  
  5402  type OnPortalDetectionCompletedEventCallbackFunc func(this js.Ref, networkGuid js.String, status CaptivePortalStatus) js.Ref
  5403  
  5404  func (fn OnPortalDetectionCompletedEventCallbackFunc) Register() js.Func[func(networkGuid js.String, status CaptivePortalStatus)] {
  5405  	return js.RegisterCallback[func(networkGuid js.String, status CaptivePortalStatus)](
  5406  		fn, abi.FuncPCABIInternal(fn),
  5407  	)
  5408  }
  5409  
  5410  func (fn OnPortalDetectionCompletedEventCallbackFunc) DispatchCallback(
  5411  	targetPC uintptr, ctx *js.CallbackContext,
  5412  ) {
  5413  	args := ctx.Args()
  5414  	if len(args) != 2+1 /* js this */ ||
  5415  		targetPC != uintptr(abi.FuncPCABIInternal(fn)) {
  5416  		js.ThrowInvalidCallbackInvocation()
  5417  	}
  5418  
  5419  	if ctx.Return(fn(
  5420  		args[0],
  5421  
  5422  		js.String{}.FromRef(args[0+1]),
  5423  		CaptivePortalStatus(0).FromRef(args[1+1]),
  5424  	)) {
  5425  		return
  5426  	}
  5427  
  5428  	js.ThrowCallbackValueNotReturned()
  5429  }
  5430  
  5431  type OnPortalDetectionCompletedEventCallback[T any] struct {
  5432  	Fn  func(arg T, this js.Ref, networkGuid js.String, status CaptivePortalStatus) js.Ref
  5433  	Arg T
  5434  }
  5435  
  5436  func (cb *OnPortalDetectionCompletedEventCallback[T]) Register() js.Func[func(networkGuid js.String, status CaptivePortalStatus)] {
  5437  	return js.RegisterCallback[func(networkGuid js.String, status CaptivePortalStatus)](
  5438  		cb, abi.FuncPCABIInternal(cb.Fn),
  5439  	)
  5440  }
  5441  
  5442  func (cb *OnPortalDetectionCompletedEventCallback[T]) DispatchCallback(
  5443  	targetPC uintptr, ctx *js.CallbackContext,
  5444  ) {
  5445  	args := ctx.Args()
  5446  	if len(args) != 2+1 /* js this */ ||
  5447  		targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) {
  5448  		js.ThrowInvalidCallbackInvocation()
  5449  	}
  5450  
  5451  	if ctx.Return(cb.Fn(
  5452  		cb.Arg,
  5453  		args[0],
  5454  
  5455  		js.String{}.FromRef(args[0+1]),
  5456  		CaptivePortalStatus(0).FromRef(args[1+1]),
  5457  	)) {
  5458  		return
  5459  	}
  5460  
  5461  	js.ThrowCallbackValueNotReturned()
  5462  }
  5463  
  5464  // HasFuncOnPortalDetectionCompleted returns true if the function "WEBEXT.networking.onc.onPortalDetectionCompleted.addListener" exists.
  5465  func HasFuncOnPortalDetectionCompleted() bool {
  5466  	return js.True == bindings.HasFuncOnPortalDetectionCompleted()
  5467  }
  5468  
  5469  // FuncOnPortalDetectionCompleted returns the function "WEBEXT.networking.onc.onPortalDetectionCompleted.addListener".
  5470  func FuncOnPortalDetectionCompleted() (fn js.Func[func(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)])]) {
  5471  	bindings.FuncOnPortalDetectionCompleted(
  5472  		js.Pointer(&fn),
  5473  	)
  5474  	return
  5475  }
  5476  
  5477  // OnPortalDetectionCompleted calls the function "WEBEXT.networking.onc.onPortalDetectionCompleted.addListener" directly.
  5478  func OnPortalDetectionCompleted(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)]) (ret js.Void) {
  5479  	bindings.CallOnPortalDetectionCompleted(
  5480  		js.Pointer(&ret),
  5481  		callback.Ref(),
  5482  	)
  5483  
  5484  	return
  5485  }
  5486  
  5487  // TryOnPortalDetectionCompleted calls the function "WEBEXT.networking.onc.onPortalDetectionCompleted.addListener"
  5488  // in a try/catch block and returns (_, err, ok = false) when it went through
  5489  // the catch clause.
  5490  func TryOnPortalDetectionCompleted(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)]) (ret js.Void, exception js.Any, ok bool) {
  5491  	ok = js.True == bindings.TryOnPortalDetectionCompleted(
  5492  		js.Pointer(&ret), js.Pointer(&exception),
  5493  		callback.Ref(),
  5494  	)
  5495  
  5496  	return
  5497  }
  5498  
  5499  // HasFuncOffPortalDetectionCompleted returns true if the function "WEBEXT.networking.onc.onPortalDetectionCompleted.removeListener" exists.
  5500  func HasFuncOffPortalDetectionCompleted() bool {
  5501  	return js.True == bindings.HasFuncOffPortalDetectionCompleted()
  5502  }
  5503  
  5504  // FuncOffPortalDetectionCompleted returns the function "WEBEXT.networking.onc.onPortalDetectionCompleted.removeListener".
  5505  func FuncOffPortalDetectionCompleted() (fn js.Func[func(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)])]) {
  5506  	bindings.FuncOffPortalDetectionCompleted(
  5507  		js.Pointer(&fn),
  5508  	)
  5509  	return
  5510  }
  5511  
  5512  // OffPortalDetectionCompleted calls the function "WEBEXT.networking.onc.onPortalDetectionCompleted.removeListener" directly.
  5513  func OffPortalDetectionCompleted(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)]) (ret js.Void) {
  5514  	bindings.CallOffPortalDetectionCompleted(
  5515  		js.Pointer(&ret),
  5516  		callback.Ref(),
  5517  	)
  5518  
  5519  	return
  5520  }
  5521  
  5522  // TryOffPortalDetectionCompleted calls the function "WEBEXT.networking.onc.onPortalDetectionCompleted.removeListener"
  5523  // in a try/catch block and returns (_, err, ok = false) when it went through
  5524  // the catch clause.
  5525  func TryOffPortalDetectionCompleted(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)]) (ret js.Void, exception js.Any, ok bool) {
  5526  	ok = js.True == bindings.TryOffPortalDetectionCompleted(
  5527  		js.Pointer(&ret), js.Pointer(&exception),
  5528  		callback.Ref(),
  5529  	)
  5530  
  5531  	return
  5532  }
  5533  
  5534  // HasFuncHasOnPortalDetectionCompleted returns true if the function "WEBEXT.networking.onc.onPortalDetectionCompleted.hasListener" exists.
  5535  func HasFuncHasOnPortalDetectionCompleted() bool {
  5536  	return js.True == bindings.HasFuncHasOnPortalDetectionCompleted()
  5537  }
  5538  
  5539  // FuncHasOnPortalDetectionCompleted returns the function "WEBEXT.networking.onc.onPortalDetectionCompleted.hasListener".
  5540  func FuncHasOnPortalDetectionCompleted() (fn js.Func[func(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)]) bool]) {
  5541  	bindings.FuncHasOnPortalDetectionCompleted(
  5542  		js.Pointer(&fn),
  5543  	)
  5544  	return
  5545  }
  5546  
  5547  // HasOnPortalDetectionCompleted calls the function "WEBEXT.networking.onc.onPortalDetectionCompleted.hasListener" directly.
  5548  func HasOnPortalDetectionCompleted(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)]) (ret bool) {
  5549  	bindings.CallHasOnPortalDetectionCompleted(
  5550  		js.Pointer(&ret),
  5551  		callback.Ref(),
  5552  	)
  5553  
  5554  	return
  5555  }
  5556  
  5557  // TryHasOnPortalDetectionCompleted calls the function "WEBEXT.networking.onc.onPortalDetectionCompleted.hasListener"
  5558  // in a try/catch block and returns (_, err, ok = false) when it went through
  5559  // the catch clause.
  5560  func TryHasOnPortalDetectionCompleted(callback js.Func[func(networkGuid js.String, status CaptivePortalStatus)]) (ret bool, exception js.Any, ok bool) {
  5561  	ok = js.True == bindings.TryHasOnPortalDetectionCompleted(
  5562  		js.Pointer(&ret), js.Pointer(&exception),
  5563  		callback.Ref(),
  5564  	)
  5565  
  5566  	return
  5567  }
  5568  
  5569  // HasFuncRequestNetworkScan returns true if the function "WEBEXT.networking.onc.requestNetworkScan" exists.
  5570  func HasFuncRequestNetworkScan() bool {
  5571  	return js.True == bindings.HasFuncRequestNetworkScan()
  5572  }
  5573  
  5574  // FuncRequestNetworkScan returns the function "WEBEXT.networking.onc.requestNetworkScan".
  5575  func FuncRequestNetworkScan() (fn js.Func[func(networkType NetworkType)]) {
  5576  	bindings.FuncRequestNetworkScan(
  5577  		js.Pointer(&fn),
  5578  	)
  5579  	return
  5580  }
  5581  
  5582  // RequestNetworkScan calls the function "WEBEXT.networking.onc.requestNetworkScan" directly.
  5583  func RequestNetworkScan(networkType NetworkType) (ret js.Void) {
  5584  	bindings.CallRequestNetworkScan(
  5585  		js.Pointer(&ret),
  5586  		uint32(networkType),
  5587  	)
  5588  
  5589  	return
  5590  }
  5591  
  5592  // TryRequestNetworkScan calls the function "WEBEXT.networking.onc.requestNetworkScan"
  5593  // in a try/catch block and returns (_, err, ok = false) when it went through
  5594  // the catch clause.
  5595  func TryRequestNetworkScan(networkType NetworkType) (ret js.Void, exception js.Any, ok bool) {
  5596  	ok = js.True == bindings.TryRequestNetworkScan(
  5597  		js.Pointer(&ret), js.Pointer(&exception),
  5598  		uint32(networkType),
  5599  	)
  5600  
  5601  	return
  5602  }
  5603  
  5604  // HasFuncSetProperties returns true if the function "WEBEXT.networking.onc.setProperties" exists.
  5605  func HasFuncSetProperties() bool {
  5606  	return js.True == bindings.HasFuncSetProperties()
  5607  }
  5608  
  5609  // FuncSetProperties returns the function "WEBEXT.networking.onc.setProperties".
  5610  func FuncSetProperties() (fn js.Func[func(networkGuid js.String, properties NetworkConfigProperties, callback js.Func[func()])]) {
  5611  	bindings.FuncSetProperties(
  5612  		js.Pointer(&fn),
  5613  	)
  5614  	return
  5615  }
  5616  
  5617  // SetProperties calls the function "WEBEXT.networking.onc.setProperties" directly.
  5618  func SetProperties(networkGuid js.String, properties NetworkConfigProperties, callback js.Func[func()]) (ret js.Void) {
  5619  	bindings.CallSetProperties(
  5620  		js.Pointer(&ret),
  5621  		networkGuid.Ref(),
  5622  		js.Pointer(&properties),
  5623  		callback.Ref(),
  5624  	)
  5625  
  5626  	return
  5627  }
  5628  
  5629  // TrySetProperties calls the function "WEBEXT.networking.onc.setProperties"
  5630  // in a try/catch block and returns (_, err, ok = false) when it went through
  5631  // the catch clause.
  5632  func TrySetProperties(networkGuid js.String, properties NetworkConfigProperties, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  5633  	ok = js.True == bindings.TrySetProperties(
  5634  		js.Pointer(&ret), js.Pointer(&exception),
  5635  		networkGuid.Ref(),
  5636  		js.Pointer(&properties),
  5637  		callback.Ref(),
  5638  	)
  5639  
  5640  	return
  5641  }
  5642  
  5643  // HasFuncStartConnect returns true if the function "WEBEXT.networking.onc.startConnect" exists.
  5644  func HasFuncStartConnect() bool {
  5645  	return js.True == bindings.HasFuncStartConnect()
  5646  }
  5647  
  5648  // FuncStartConnect returns the function "WEBEXT.networking.onc.startConnect".
  5649  func FuncStartConnect() (fn js.Func[func(networkGuid js.String, callback js.Func[func()])]) {
  5650  	bindings.FuncStartConnect(
  5651  		js.Pointer(&fn),
  5652  	)
  5653  	return
  5654  }
  5655  
  5656  // StartConnect calls the function "WEBEXT.networking.onc.startConnect" directly.
  5657  func StartConnect(networkGuid js.String, callback js.Func[func()]) (ret js.Void) {
  5658  	bindings.CallStartConnect(
  5659  		js.Pointer(&ret),
  5660  		networkGuid.Ref(),
  5661  		callback.Ref(),
  5662  	)
  5663  
  5664  	return
  5665  }
  5666  
  5667  // TryStartConnect calls the function "WEBEXT.networking.onc.startConnect"
  5668  // in a try/catch block and returns (_, err, ok = false) when it went through
  5669  // the catch clause.
  5670  func TryStartConnect(networkGuid js.String, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  5671  	ok = js.True == bindings.TryStartConnect(
  5672  		js.Pointer(&ret), js.Pointer(&exception),
  5673  		networkGuid.Ref(),
  5674  		callback.Ref(),
  5675  	)
  5676  
  5677  	return
  5678  }
  5679  
  5680  // HasFuncStartDisconnect returns true if the function "WEBEXT.networking.onc.startDisconnect" exists.
  5681  func HasFuncStartDisconnect() bool {
  5682  	return js.True == bindings.HasFuncStartDisconnect()
  5683  }
  5684  
  5685  // FuncStartDisconnect returns the function "WEBEXT.networking.onc.startDisconnect".
  5686  func FuncStartDisconnect() (fn js.Func[func(networkGuid js.String, callback js.Func[func()])]) {
  5687  	bindings.FuncStartDisconnect(
  5688  		js.Pointer(&fn),
  5689  	)
  5690  	return
  5691  }
  5692  
  5693  // StartDisconnect calls the function "WEBEXT.networking.onc.startDisconnect" directly.
  5694  func StartDisconnect(networkGuid js.String, callback js.Func[func()]) (ret js.Void) {
  5695  	bindings.CallStartDisconnect(
  5696  		js.Pointer(&ret),
  5697  		networkGuid.Ref(),
  5698  		callback.Ref(),
  5699  	)
  5700  
  5701  	return
  5702  }
  5703  
  5704  // TryStartDisconnect calls the function "WEBEXT.networking.onc.startDisconnect"
  5705  // in a try/catch block and returns (_, err, ok = false) when it went through
  5706  // the catch clause.
  5707  func TryStartDisconnect(networkGuid js.String, callback js.Func[func()]) (ret js.Void, exception js.Any, ok bool) {
  5708  	ok = js.True == bindings.TryStartDisconnect(
  5709  		js.Pointer(&ret), js.Pointer(&exception),
  5710  		networkGuid.Ref(),
  5711  		callback.Ref(),
  5712  	)
  5713  
  5714  	return
  5715  }