-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathindex.d.ts
More file actions
28 lines (25 loc) · 753 Bytes
/
index.d.ts
File metadata and controls
28 lines (25 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
type PingOptions = {
/** Amount of time in ms to wait before reporting ping failed (Default: 1000ms) */
timeout?: number;
/** [iOS only] Size of the payload to send to the server (Default: 56 bytes) */
payloadSize?: number;
};
type TrafficStats = {
receivedNetworkSpeed: string;
receivedNetworkTotal: string;
sendNetworkSpeed: string;
sendNetworkTotal: string;
};
export default class Ping {
/**
* Ping a specified server and return the RTT (Round-trip time) in ms
*
* @param ipAddress IP Address of the server to ping (eg: 8.8.8.8)
* @param options Optional parameters
*/
static start(
ipAddress: string,
options?: PingOptions,
): Promise<number>;
static getTrafficStats(): Promise<TrafficStats>;
}