-
Notifications
You must be signed in to change notification settings - Fork 33
/
app.d.ts
36 lines (33 loc) · 1 KB
/
app.d.ts
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
29
30
31
32
33
34
35
36
declare module "network-speed" {
type Measures = {
bps:string
kbps:string
mbps:string
}
type UploadOptions = {
hostname:string
port:number
path:string
method:string
headers: {
[key:string]:string
}
}
class NetworkSpeedCheck {
/**
* Function to check download speed
* @param {String} baseUrl {Required} The url to which the request should be made
* @param {Number} fileSizeInBytes {Required} The size (in bytes) of the file to be downloaded
* @returns {Promise<Measures>}
*/
checkDownloadSpeed:(baseUrl:string, fileSizeInBytes:number) => Promise<Measures>
/**
* Function to check upload speed
* @param {UploadOptions} options {Required} Upload options to test with
* @param {Number} fileSizeInBytes {Optional} The size (in bytes) of the file to be downloaded
* @returns {Promise<Measures>}
*/
checkUploadSpeed:(options:UploadOptions, fileSizeInBytes?:number) => Promise<Measures>
}
export = NetworkSpeedCheck
}