-
Notifications
You must be signed in to change notification settings - Fork 0
/
Custom.d.ts
57 lines (45 loc) · 1.05 KB
/
Custom.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { NS } from 'defs/NetscriptDefinitions'
// Generics
export interface Dict<T> {
[key: string]: T;
}
export type DictMapND<K extends number | string,V> = {
[key in K]?: V
}
export type DictMap<K extends number | string,V> = DictMapND<K,V> & {
[key in K]: V
}
// Interfaces
export interface Hack {
file: string;
exec: (ns: NS, target: string) => void;
}
export interface Script {
file: string;
}
export interface Action {
file: string;
ram: number;
mult: number;
flat: number;
}
export interface Run {
action: ActionType;
server: string;
threads: number;
sleep: number;
runType: string;
run: number;
}
export interface HackConstants {
host: string;
target: string;
servers: Dict<number>;
runSleep: number;
weakenTime: number;
}
// Types
export type ScriptType = 'nuke' | 'hack'
export type ActionType = 'hack' | 'grow' | 'weaken'
export type ServerTag = 'home' | 'rooted' | 'owned' | 'optimal' | 'nukable'
export type RoundType = 'ceil' | 'up' | 'down' | 'floor' | 'normal'