-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
71 lines (47 loc) · 1.22 KB
/
types.ts
File metadata and controls
71 lines (47 loc) · 1.22 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import type { ServerConfig } from './config/servers.js';
export type { ServerConfig } from './config/servers.js';
export type { Location } from './services/geolocation/ip-lookup.js';
export type AppView = 'selection' | 'testing' | 'results';
export type AutoStartMode = 'nearest' | 'nearest-asn';
export type KeyboardAction =
| 'up'
| 'down'
| 'enter'
| 'escape'
| 'space'
| 'quit'
| 'reset'
| 'nearest';
export interface EnrichedServer extends ServerConfig {
ping: number | null;
score: number | null;
status: 'checking' | 'online' | 'offline';
}
export interface CurrentTest {
server: ServerConfig;
progress: number;
currentBandwidth: number;
elapsed: number;
intervalData: number[];
testIndex: number;
totalTests: number;
direction: 'upload' | 'download';
}
export interface TestMetrics {
bandwidth: { normalized: number };
latency?: { normalized: number };
}
export interface DirectionResult {
server: ServerConfig;
metrics: TestMetrics | null;
success: boolean;
error: string | null;
duration: number;
timestamp: string;
}
export interface CombinedResult {
server: ServerConfig;
upload?: DirectionResult;
download?: DirectionResult;
success: boolean;
}