-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.interfaces.ts
49 lines (42 loc) · 890 Bytes
/
main.interfaces.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
37
38
39
40
41
42
43
44
45
46
47
48
49
export interface StandardDataset {
[key: string]: any;
}
export interface Errors {
[key: string]: string;
}
export interface Options extends StandardDataset {
stdTTL?: number;
autoUpdate?: boolean;
updateInterval?: number;
checkPeriod?: number;
}
export interface OptionsInternal extends StandardDataset {
stdTTL: number;
autoUpdate: boolean;
updateInterval: number;
checkPeriod: number;
}
export interface Request extends StandardDataset {
url: string;
method: string;
body?: {
[key: string]: any;
};
headers?: {
[key: string]: string;
};
}
export interface CacheInput extends StandardDataset {
request: Request;
resProcessor?: any;
updateInterval?: number;
ttl?: number;
}
export interface CacheUnit extends CacheInput {
setTime: number;
lastUpdate: number;
value: any;
}
export interface Cache {
[key: string]: CacheUnit;
}