import Vnmf from '../../index' declare module '../../index' { namespace onNetworkWeakChange { /** Respond function for weak network state change events */ type Callback = ( result: CallbackResult, ) => void interface CallbackResult { /** Are you in a state of weakness? */ weakNet: boolean /** Current Network Type */ networkType: keyof getNetworkType.NetworkType } } namespace onNetworkStatusChange { /** Network state change event echo function */ type Callback = ( result: CallbackResult, ) => void interface CallbackResult { /** Existing network connection */ isConnected: boolean /** Network Type */ networkType: keyof getNetworkType.NetworkType } } namespace getNetworkType { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Network Type */ networkType: keyof NetworkType /** Call Results */ errMsg: string } /** Network Type */ interface NetworkType { /** wifi Network */ wifi /** 2g Network */ '2g' /** 3g Network */ '3g' /** 4g Network */ '4g' /** 5g Network */ '5g' /** Android The type of network that is not common */ 'unknown' /** No Network */ 'none' } } namespace getLocalIPAddress { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Local area network (LAN) of this aircraftIPAddress */ localip: string /** Call Results */ errMsg: string } } interface VnmfStatic { /** Listening to changes in the state of weak net * @supported weapp * @example * ```tsx * Vnmf.onNetworkWeakChange(function (res) { * console.log(res.weakNet) * console.log(res.networkType) * }) * // Disable listening. * Vnmf.offNetworkWeakChange() * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.onNetworkWeakChange.html */ onNetworkWeakChange( /** Respond function for weak network state change events */ callback: onNetworkWeakChange.Callback, ): void /** Listen to network status changes。 * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.onNetworkStatusChange(function (res) { * console.log(res.isConnected) * console.log(res.networkType) * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.onNetworkStatusChange.html */ onNetworkStatusChange( /** Network state change event echo function */ callback: onNetworkStatusChange.Callback, ): void /** Disable listening to low-net state changes * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkWeakChange.html */ offNetworkWeakChange( /** Respond function for weak network state change events */ callback: onNetworkWeakChange.Callback, ): void /** Disable listening to network state change events,Parameter is empty,And cancel all bugs.。 * @supported weapp, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html */ offNetworkStatusChange( /** Disable listening to network state change events,Parameter is empty,And cancel all bugs. */ callback?: onNetworkStatusChange.Callback, ): void /** Get Network Type。 * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.getNetworkType({ * success: function (res) { * // Returns network type, Valid value: * // wifi/2g/3g/4g/unknown(AndroidThe type of network that is not common)/none(No Network) * var networkType = res.networkType * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getNetworkType.html */ getNetworkType(option?: getNetworkType.Option): Promise /** Retrieving local area networksIPAddress。 * @supported weapp * @example * ```tsx * Vnmf.getLocalIPAddress() * .then(res => { * const localip = res.localip * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getLocalIPAddress.html */ getLocalIPAddress(option?: getLocalIPAddress.Option): Promise } }