提交 4a31b6b6 编写于 作者: 杜庆泉's avatar 杜庆泉

wifi 新增ts-doc 描述

上级 e9cd4eeb
......@@ -5,6 +5,13 @@
"style": {
"navigationBarTitleText": "uni-app"
}
},
{
"path": "pages/autotest/uni-getbatteryinfo/uni-getbatteryinfo",
"style": {
"navigationBarTitleText": "uni-getbatteryinfo",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
......
/**
* Wifi 函数通用入参封装
*/
export type WifiOption = {
success?: (res: UniWifiResult) => void;
fail?: (res: UniWifiResult) => void;
complete?: (res: UniWifiResult) => void;
export type WifiOption = {
success ?: (res : UniWifiResult) => void;
fail ?: (res : UniWifiResult) => void;
complete ?: (res : UniWifiResult) => void;
};
/**
* Wifi 链接参数封装
*/
export type WifiConnectOption = {
SSID?: string;
BSSID?: string;
password?: string;
maunal?: boolean;
partialInfo?: boolean; //ios不生效
success?: (res: UniWifiResult) => void;
fail?: (res: UniWifiResult) => void;
complete?: (res: UniWifiResult) => void;
SSID ?: string;
BSSID ?: string;
password ?: string;
maunal ?: boolean;
partialInfo ?: boolean; //ios不生效
success ?: (res : UniWifiResult) => void;
fail ?: (res : UniWifiResult) => void;
complete ?: (res : UniWifiResult) => void;
}
/**
* 获取当前链接的wifi信息
*/
export type GetConnectedWifiOptions = {
partialInfo?: boolean
success?: (res: UniWifiResult) => void
fail?: (res: UniWifiResult) => void
complete?: (res: UniWifiResult) => void
partialInfo ?: boolean
success ?: (res : UniWifiResult) => void
fail ?: (res : UniWifiResult) => void
complete ?: (res : UniWifiResult) => void
}
/*
* 对外暴露的wifi信息
*/
export type UniWifiInfo = {
SSID: string;
BSSID?: string;
secure?: boolean;
signalStrength?: number;
frequency?: number;
SSID : string;
BSSID ?: string;
secure ?: boolean;
signalStrength ?: number;
frequency ?: number;
}
......@@ -47,35 +47,35 @@ export type UniWifiResult = {
errCode : number,
errSubject : string,
errMsg : string,
wifi: UniWifiInfo | null
wifi : UniWifiInfo | null
}
export type UniWifiCallback = () => void
export type StartWifi = (option: WifiOption) => void
export type StartWifi = (option : WifiOption) => void
export type StopWifi = (option: WifiOption) => void
export type StopWifi = (option : WifiOption) => void
export type GetWifiList = (option: WifiOption) => void
export type GetWifiList = (option : WifiOption) => void
export type OnGetWifiList = (callback: UniWifiCallback) => void
export type OnGetWifiList = (callback : UniWifiCallback) => void
export type OffGetWifiList = (callback: UniWifiCallback) => void
export type OffGetWifiList = (callback : UniWifiCallback) => void
export type GetConnectedWifi = (option: GetConnectedWifiOptions) => void
export type GetConnectedWifi = (option : GetConnectedWifiOptions) => void
export type ConnectWifi = (option: WifiConnectOption) => void
export type ConnectWifi = (option : WifiConnectOption) => void
export type OnWifiConnected = (callback: UniWifiCallback) => void
export type OnWifiConnected = (callback : UniWifiCallback) => void
export type OnWifiConnectedWithPartialInfo = (callback: UniWifiCallback) => void
export type OnWifiConnectedWithPartialInfo = (callback : UniWifiCallback) => void
export type OffWifiConnected = (callback: UniWifiCallback | null) => void
export type OffWifiConnected = (callback : UniWifiCallback | null) => void
export type OnOffWifiConnectedWithPartialInfo = (callback: UniWifiCallback | null) => void
export type OnOffWifiConnectedWithPartialInfo = (callback : UniWifiCallback | null) => void
export type SetWifiList = (option: WifiOption) => void
export type SetWifiList = (option : WifiOption) => void
interface Uni {
/**
......@@ -85,9 +85,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -101,9 +108,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#stopwifi
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -115,9 +129,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#connectWifi
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -142,16 +163,23 @@ interface Uni {
]
}
*/
connectWifi: ConnectWifi,
connectWifi : ConnectWifi,
/**
* 请求获取 Wi-Fi 列表。wifiList 数据会在 onGetWifiList 注册的回调中返回。
* @param {WifiOption} option
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#getWifiList
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -174,9 +202,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onGetWifiList
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -190,9 +225,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#offGetWifiList
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -206,9 +248,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#getConnectedWifi
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -222,9 +271,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnected
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -238,9 +294,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnectedWithPartialInfo
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -254,9 +317,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#offWifiConnected
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......@@ -270,9 +340,16 @@ interface Uni {
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onOffWifiConnectedWithPartialInfo
* @uniPlatform {
* app: {
* android: "4.4.4",
* ios: "9.0",
* page: ['vue','uvue','nvue']
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.0",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册