-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodule.d.ts
More file actions
132 lines (117 loc) · 4.21 KB
/
Copy pathmodule.d.ts
File metadata and controls
132 lines (117 loc) · 4.21 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
interface ModuleEvents {
/**
* Called on any module being enabled.
*/
"enable": () => void,
/**
* Called on any module being disabled.
*/
"disable": () => void,
/**
* Called on every frame. Return a bool to set the toggle form of the module - `true` makes it a hold module, like player list; `false`, standard toggle form.
*/
"get-hold-to-toggle": () => boolean, // I had no idea how to write this
/**
* Called on every frame; use this to render something arbitrary.
* @note Only available in HUD modules.
* @param isPreview If it's a preview in the main menu (when module settings are extended.)
* @param isEditor If it's in the HUD editor where you move modules around.
*/
"render": (isPreview: boolean, isEditor: boolean) => void,
/**
* Only available in HUD modules.
*/
//"shouldRender": () => boolean;
/**
* Called on every frame; use this to render text. Return a string to render it on the next frame.
* @note Only available in text modules.
*/
"text": (isPreview: boolean, isEditor: boolean) => string;
}
declare class Module {
readonly name: string
readonly displayName: string
readonly description: string
readonly key: KeyCode
/**
* IDs for script modules are always 255.
*/
readonly id: number;
/**
* If the module is a HUD module (that you can move in the hud editor)
*/
readonly visual: boolean;
/**
* If the module is visible in the ClickGui
*/
readonly visible: boolean;
/**
*
* @param name The internal name of the module.
* @param displayName The display name of the module. Shown in the ClickGUI.
* @param description A short description of what the module does.
* @param key The default keybind to activate the module.
*/
constructor(name: string, displayName: string, description: string, key: KeyCode);
on: <K extends keyof ModuleEvents>(eventName: K, handler: ModuleEvents[K]) => void;
/**
* Checks if the module is enabled.
*/
isEnabled(): boolean;
/**
* Set the module to be enabled or not.
* @param b The new status of the module.
*/
setEnabled(b: boolean): void;
/**
* Check if the module is blocked.
*/
isBlocked(): boolean;
/**
* Gets the settings of the module.
*/
getSettings(): Setting[];
/**
* Adds a setting.
* @param name The internal name
* @param displayName The name that shows in the menu
* @param description A short description of what the setting does
* @param defVal The default value
*/
addBoolSetting(name: string, displayName: string, description: string, defVal: boolean): Setting;
/**
* Adds a setting.
* @param name The internal name
* @param displayName The name that shows in the menu
* @param description A short description of what the setting does
* @param min The minimum value
* @param max The maximum value
* @param interval The precision of the setting
* @param defVal The default value
*/
addNumberSetting(name: string, displayName: string, description: string, min: number, max: number, interval: number, defVal: number): Setting;
/**
Adds a setting.
* @param name The internal name
* @param displayName The name that shows in the menu
* @param description A short description of what the setting does
* @param defVal The default value
*/
addKeySetting(name: string, displayName: string, description: string, defVal: KeyCode): Setting;
/**
Adds a setting.
* @param name The internal name
* @param displayName The name that shows in the menu
* @param description A short description of what the setting does
* @param defVal The default value
*/
addTextSetting(name: string, displayName: string, description: string, defVal: string): Setting;
/**
Adds a setting.
* @param name The internal name
* @param displayName The name that shows in the menu
* @param description A short description of what the setting does
* @param defVal The default value
*/
addColorSetting(name: string, displayName: string, description: string, defVal: Color): Setting;
}