import Vnmf from '../../index' declare module '../../index' { namespace stopWifi { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.WifiError) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.WifiError) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.WifiError) => void } } namespace startWifi { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.WifiError) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.WifiError) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.WifiError) => void } } namespace setWifiList { interface Option { /** Provision of predefined Wi-Fi Cannot initialise Evolution's mail component. */ wifiList: WifiData[] /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.WifiError) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.WifiError) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.WifiError) => void } /** Provision of predefined Wi-Fi Cannot initialise Evolution's mail component. */ interface WifiData { /** Wi-Fi It's... it's... BSSID */ BSSID?: string /** Wi-Fi It's... it's... SSID */ SSID?: string /** Wi-Fi Device Password */ password?: string } } namespace onWifiConnectedWithPartialInfo { /** Connect Wi-Fi The echo function for events */ type Callback = ( result: CallbackResult, ) => void interface CallbackResult { /** Include only SSID Properties WifiInfo Object */ wifi: Pick } } namespace onWifiConnected { /** Connect Wi-Fi The echo function for events */ type Callback = ( result: CallbackResult, ) => void interface CallbackResult { /** Wi-Fi Information */ wifi: WifiInfo } } namespace onGetWifiList { /** Retrieve Wi-Fi The callback function for list data events */ type Callback = (result: CallbackResult) => void interface CallbackResult { /** Wi-Fi List Data */ wifiList: WifiInfo[] } } namespace getWifiList { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.WifiError) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.WifiError) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.WifiError) => void } } namespace getConnectedWifi { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.WifiError) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.WifiError) => void /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.WifiError { /** Wi-Fi Information */ wifi: WifiInfo /** Call Results */ errMsg: string } } namespace connectWifi { interface Option { /** Wi-Fi Equipment SSID */ SSID: string /** Wi-Fi Device Password */ password: string /** Wi-Fi Equipment BSSID */ BSSID?: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.WifiError) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.WifiError) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.WifiError) => void } } /** Wifi Information * * Attention.: * André. Vnmf.connectWifi / Vnmf.getConnectedWifi If set partialInfo:true ,Or it's called. Vnmf.onWifiConnectedWithPartialInfo Events。Will return only to include SSID Properties WifiInfo Object。 In some cases,Maybe. Wi-Fi Connected successfully,But it won't be complete. WifiInfo Object Wrong。Specific Error Message As errCode: 12010, errMsg: can't gain current wifi 。If the developers don't need complete, WifiInfo Object,We can solve the problem of misreporting by using strategy described above.。 */ interface WifiInfo { /** Wi-Fi It's... it's... SSID */ SSID: string /** Wi-Fi It's... it's... BSSID */ BSSID: string /** Wi-Fi Is it safe? */ secure: boolean /** Wi-Fi Signal strength, Andrew's taking values. 0 ~ 100 ,iOS Value 0 ~ 1 ,The greater the value, stronger value. */ signalStrength: number /** Wi-Fi Frequency Unit MHz */ frequency?: number } interface VnmfStatic { /** Close Wi-Fi Module。 * @supported weapp * @example * ```tsx * Vnmf.stopWifi({ * success: function (res) { * console.log(res.errMsg) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.stopWifi.html */ stopWifi(option?: stopWifi.Option): Promise /** Initialization Wi-Fi Module。 * @supported weapp * @example * ```tsx * Vnmf.startWifi({ * success: function (res) { * console.log(res.errMsg) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.startWifi.html */ startWifi(option?: startWifi.Option): Promise /** Settings `wifiList` Medium AP of the Convention on Elimination All Forms Discrimination against Women。Yes. `onGetWifiList` Call when calling back.,**iOSA unique interface.**。 * * **Attention.** * - The interface can only... `onGetWifiList` I can't call until I'm back.。 * - At this point, the client will hang up.,Waiting for Applet Settings Wi-Fi Information,Please call the interface as soon possible.,Enter an empty array if no data are available。 * - It could be along the perimeter. Wi-Fi Refreshing Lists,Multiple duplicates received in individual processes Wi-Fi Reply to List。 * @supported weapp * @example * ```tsx * Vnmf.onGetWifiList(function (res) { * if (res.wifiList.length) { * Vnmf.setWifiList({ * wifiList: [{ * SSID: res.wifiList[0].SSID, * BSSID: res.wifiList[0].BSSID, * password: '123456' * }] * }) * } else { * Vnmf.setWifiList({ * wifiList: [] * }) * } * }) * Vnmf.getWifiList() * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.setWifiList.html */ setWifiList(option: setWifiList.Option): Promise /** Listen to the connection. Wi-Fi Events * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnectedWithPartialInfo.html */ onWifiConnectedWithPartialInfo( /** Connect Wi-Fi The echo function for events */ callback: onWifiConnectedWithPartialInfo.Callback, ): void /** Listen to the connection. Wi-Fi Events。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnected.html */ onWifiConnected( /** Connect Wi-Fi The echo function for events */ callback: onWifiConnected.Callback, ): void /** I'm listening to you. Wi-Fi List Data Events * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onGetWifiList.html */ onGetWifiList( /** Retrieve Wi-Fi The callback function for list data events */ callback: onGetWifiList.Callback, ): void /** Disable listening connection Wi-Fi Events * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offWifiConnectedWithPartialInfo.html */ offWifiConnectedWithPartialInfo( /** Connect Wi-Fi The echo function for events */ callback: onWifiConnectedWithPartialInfo.Callback, ): void /** * Disable listening connection Wi-Fi Events。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offWifiConnected.html */ offWifiConnected( /** Connect Wi-Fi The echo function for events */ callback: onWifiConnected.Callback, ): void /** * Disable listening access Wi-Fi List Data Events。 * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offGetWifiList.html */ offGetWifiList( /** Retrieve Wi-Fi The callback function for list data events */ callback: onGetWifiList.Callback, ): void /** Request for Access Wi-Fi List。Yes. `onGetWifiList` Returns in registered return `wifiList` Data。 **Android Required before calling [User Permissions](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.userLocation。** * * iOS Jump to System Wi-Fi Interface,Android Can't jump.。 iOS 11.0 and iOS 11.1 Two versions due to system problems,It's not working.。But... iOS 11.2 Fixed。 * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getWifiList.html */ getWifiList(option?: getWifiList.Option): Promise /** Fetching Connected Wi-Fi Information。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getConnectedWifi.html */ getConnectedWifi(option?: getConnectedWifi.Option): Promise /** * Connection Wi-Fi。♪ If you know Wi-Fi Information,The interface can be connected directly.。Only Android and iOS 11 Support for the above version。 * @example * ```tsx * Vnmf.connectWifi({ * SSID: '', * BSSID: '', * success: function (res) { * console.log(res.errMsg) * } * }) * ``` * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.connectWifi.html */ connectWifi(option: connectWifi.Option): Promise } }