UNPKG

813 BTypeScriptView Raw
1import Taro from '@tarojs/api';
2export declare const getNetworkType: typeof Taro.getNetworkType;
3/**
4 * 在最近的八次网络请求中, 出现下列三个现象之一则判定弱网。
5 * - 出现三次以上连接超时
6 * - 出现三次 rtt 超过 400
7 * - 出现三次以上的丢包
8 * > 弱网事件通知规则是: 弱网状态变化时立即通知, 状态不变时 30s 内最多通知一次。
9 */
10export declare const onNetworkWeakChange: () => Promise<{
11 errMsg: string;
12}>;
13export declare const onNetworkStatusChange: typeof Taro.onNetworkStatusChange;
14export declare const offNetworkWeakChange: () => Promise<{
15 errMsg: string;
16}>;
17export declare const offNetworkStatusChange: typeof Taro.offNetworkStatusChange;
18export declare const getLocalIPAddress: () => Promise<{
19 errMsg: string;
20}>;