Skip to content

Commit aa0d6cc

Browse files
committed
get rid of whatever the fuck i just did
1 parent ead420f commit aa0d6cc

34 files changed

+1773
-14
lines changed

definitions/api/TextColor.d.ts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
interface ITextColor {
2+
FORMAT_CHAR: string;
3+
4+
// Formatting
5+
6+
OBFUSCATE: string; // k
7+
BOLD: string; // l
8+
ITALIC: string; // o
9+
RESET: string; // r
10+
11+
// Base Colors
12+
13+
BLACK: string;//, '0');
14+
DARK_BLUE: string;//, '1');
15+
DARK_GREEN: string;//, '2');
16+
DARK_AQUA: string;//, '3');
17+
DARK_RED: string;//, '4');
18+
DARK_PURPLE: string;//, '5');
19+
GOLD: string;//, '6');
20+
GRAY: string;//, '7');
21+
DARK_GRAY: string;//, '8');
22+
BLUE: string;//, '9');
23+
GREEN: string;//, 'a');
24+
AQUA: string;//, 'b');
25+
RED: string;//, 'c');
26+
LIGHT_PURPLE: string;//, 'd');
27+
YELLOW: string;//, 'e');
28+
WHITE: string;//, 'f');
29+
30+
// Bedrock Specific Colors
31+
32+
MINECOIN_GOLD: string;//, 'g');
33+
34+
/**
35+
* 1.20 ONLY
36+
*/
37+
MATERIAL_QUARTZ: string;//, 'h');
38+
/**
39+
* 1.20 ONLY
40+
*/
41+
MATERIAL_IRON: string;//, 'i');
42+
/**
43+
* 1.20 ONLY
44+
*/
45+
MATERIAL_NETHERITE: string;//, 'j');
46+
/**
47+
* 1.20 ONLY
48+
*/
49+
MATERIAL_REDSTONE: string;//, 'm');
50+
/**
51+
* 1.20 ONLY
52+
*/
53+
MATERIAL_COPPER: string;//, 'n');
54+
/**
55+
* 1.20 ONLY
56+
*/
57+
MATERIAL_GOLD: string;//, 'p');
58+
/**
59+
* 1.20 ONLY
60+
*/
61+
MATERIAL_EMERALD: string;//, 'q');
62+
/**
63+
* 1.20 ONLY
64+
*/
65+
MATERIAL_DIAMOND: string;//, 's');
66+
/**
67+
* 1.20 ONLY
68+
*/
69+
MATERIAL_LAPIS: string;//, 't');
70+
/**
71+
* 1.20 ONLY
72+
*/
73+
MATERIAL_AMETHYST: string;//, 'u');
74+
75+
/**
76+
* Formats '&' into colorcoded string.
77+
* @param str The string to format into colorcoded string.
78+
*/
79+
formatText(str: string): string;
80+
}
81+
82+
declare const TextColor: ITextColor;

definitions/feature/command.d.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
interface CommandEvents {
2+
/**
3+
* Called on any command being used.
4+
* @param label The beginning of the command line (for example, `'test'` in '.test 123')
5+
* @param args The list of arguments of the command line (for example, `['123']` in '.test 123')
6+
* @param commandLine The command line (for example, `'.test 123 test'` in '.test 123 test')
7+
* @returns Whether the command usage is successful or not (return `false` if the user misused the command)
8+
*/
9+
"execute" : (label: string, args: string[], commandLine: string) => boolean;
10+
}
11+
12+
// A class representing a Latite Client command.
13+
declare class Command {
14+
readonly name: string;
15+
readonly description: string;
16+
readonly aliases: string[];
17+
18+
/**
19+
*
20+
* @param name The name of the command
21+
* @param description A short description of what the command does
22+
* @param usage The usage of the command put '$' in place of the actual command name and preifx. Example: usage: "$ <name>" -> ".commandname <name>"
23+
* @param aliases Alternative command names the user can use the execute the same command. Can be empty
24+
*/
25+
constructor(name: string, description: string, usage: string, aliases: string[]);
26+
27+
on: <K extends keyof CommandEvents>(eventName: K, handler: CommandEvents[K]) => void;
28+
}

definitions/feature/hudmodule.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
declare class HudModule extends Module {
2+
constructor(name: string, displayName: string, description: string, key: KeyCode, resizable: boolean);
3+
4+
getRect(): Rect;
5+
setRect(newRect: Rect): void;
6+
setBounds(width: number, height: number): void;
7+
getSize(): number;
8+
setSize(): number;
9+
getPos(): Vector2;
10+
setPos(x: number, y: number): void;
11+
}
12+
13+
declare class TextModule extends HudModule {
14+
constructor(name: string, displayName: string, description: string, key: KeyCode);
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
declare class CommandManager {
2+
/**
3+
* Gets the command prefix, default is '.'
4+
*/
5+
getPrefix(): string;
6+
7+
/**
8+
* Adds a command into the client
9+
* @param cmd The command to add
10+
*/
11+
registerCommand(cmd: Command): void;
12+
13+
//deregisterCommand(cmd: Command): void;
14+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
interface ModuleManager {
2+
/**
3+
* Registers a module into the Latite mod. This makes it appear in the mod menu, and be interactive.
4+
* @param mod The module to register.
5+
*/
6+
registerModule(mod: Module): void;
7+
8+
//deregisterModule(mod: Module): void;
9+
10+
/**
11+
* Gets a module by the specified InternalName.
12+
* For example, ArmorHud is the internal name for Armor Hud.
13+
* Position is the internal name of Coordinates
14+
* @param name The name of the module to get.
15+
*/
16+
getModuleByName(name: string): Module | null;
17+
18+
/**
19+
* Loop through each module.
20+
* @param callback
21+
*/
22+
forEachModule(callback: (mod: Module) => void): void;
23+
}

definitions/feature/module.d.ts

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
interface ModuleEvents {
2+
/**
3+
* Called on any module being enabled.
4+
*/
5+
"enable": () => void,
6+
/**
7+
* Called on any module being disabled.
8+
*/
9+
"disable": () => void,
10+
/**
11+
* 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.
12+
*/
13+
"get-hold-to-toggle": () => boolean, // I had no idea how to write this
14+
15+
/**
16+
* Called on every frame; use this to render something arbitrary.
17+
* @note Only available in HUD modules.
18+
* @param isPreview If it's a preview in the main menu (when module settings are extended.)
19+
* @param isEditor If it's in the HUD editor where you move modules around.
20+
*/
21+
"render": (isPreview: boolean, isEditor: boolean) => void,
22+
/**
23+
* Only available in HUD modules.
24+
*/
25+
//"shouldRender": () => boolean;
26+
27+
/**
28+
* Called on every frame; use this to render text. Return a string to render it on the next frame.
29+
* @note Only available in text modules.
30+
*/
31+
"text": (isPreview: boolean, isEditor: boolean) => string;
32+
}
33+
34+
declare class Module {
35+
readonly name: string
36+
readonly displayName: string
37+
readonly description: string
38+
readonly key: KeyCode
39+
40+
/**
41+
* IDs for script modules are always 255.
42+
*/
43+
readonly id: number;
44+
/**
45+
* If the module is a HUD module (that you can move in the hud editor)
46+
*/
47+
readonly visual: boolean;
48+
/**
49+
* If the module is visible in the ClickGui
50+
*/
51+
readonly visible: boolean;
52+
53+
/**
54+
*
55+
* @param name The internal name of the module.
56+
* @param displayName The display name of the module. Shown in the ClickGUI.
57+
* @param description A short description of what the module does.
58+
* @param key The default keybind to activate the module.
59+
*/
60+
constructor(name: string, displayName: string, description: string, key: KeyCode);
61+
62+
on: <K extends keyof ModuleEvents>(eventName: K, handler: ModuleEvents[K]) => void;
63+
64+
/**
65+
* Checks if the module is enabled.
66+
*/
67+
isEnabled(): boolean;
68+
69+
/**
70+
* Set the module to be enabled or not.
71+
* @param b The new status of the module.
72+
*/
73+
setEnabled(b: boolean): void;
74+
75+
/**
76+
* Check if the module is blocked.
77+
*/
78+
isBlocked(): boolean;
79+
80+
/**
81+
* Gets the settings of the module.
82+
*/
83+
getSettings(): Setting[];
84+
85+
/**
86+
* Adds a setting.
87+
* @param name The internal name
88+
* @param displayName The name that shows in the menu
89+
* @param description A short description of what the setting does
90+
* @param defVal The default value
91+
*/
92+
addBoolSetting(name: string, displayName: string, description: string, defVal: boolean): Setting;
93+
94+
/**
95+
* Adds a setting.
96+
* @param name The internal name
97+
* @param displayName The name that shows in the menu
98+
* @param description A short description of what the setting does
99+
* @param min The minimum value
100+
* @param max The maximum value
101+
* @param interval The precision of the setting
102+
* @param defVal The default value
103+
*/
104+
addNumberSetting(name: string, displayName: string, description: string, min: number, max: number, interval: number, defVal: number): Setting;
105+
106+
/**
107+
Adds a setting.
108+
* @param name The internal name
109+
* @param displayName The name that shows in the menu
110+
* @param description A short description of what the setting does
111+
* @param defVal The default value
112+
*/
113+
addKeySetting(name: string, displayName: string, description: string, defVal: KeyCode): Setting;
114+
115+
/**
116+
Adds a setting.
117+
* @param name The internal name
118+
* @param displayName The name that shows in the menu
119+
* @param description A short description of what the setting does
120+
* @param defVal The default value
121+
*/
122+
addTextSetting(name: string, displayName: string, description: string, defVal: string): Setting;
123+
124+
/**
125+
Adds a setting.
126+
* @param name The internal name
127+
* @param displayName The name that shows in the menu
128+
* @param description A short description of what the setting does
129+
* @param defVal The default value
130+
*/
131+
addColorSetting(name: string, displayName: string, description: string, defVal: Color): Setting;
132+
}

definitions/feature/setting.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
declare class Setting {
2+
/**
3+
* DO NOT USE - not implemented
4+
*/
5+
constructor();
6+
7+
/**
8+
* The name of the setting
9+
*/
10+
readonly name: string;
11+
readonly displayName: string;
12+
readonly description: string;
13+
14+
toString(): string;
15+
16+
/**
17+
* Gets the value of the setting. Could be null.
18+
*/
19+
getValue(): any;
20+
21+
/**
22+
* Sets the setting value.
23+
* @param value The value to set. Must be of type corresponding to the type of the setting.
24+
*/
25+
setValue(value: any): void;
26+
27+
/**
28+
* Set that this setting will only show when another setting is on or off.
29+
* @param settingName The setting that this setting will depend on (internal name).
30+
* @param value The value the other setting needs to be for this setting to show
31+
*/
32+
setCondition(settingName: string, value?: boolean): void;
33+
}

0 commit comments

Comments
 (0)