From 76065683ef40e0c3521128f7bb89b09d0bf34bec Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Tue, 28 Feb 2023 22:33:06 +0100 Subject: [PATCH] Add a basic .d.ts file for TypescriptToLua --- docs/chatterino.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/chatterino.d.ts diff --git a/docs/chatterino.d.ts b/docs/chatterino.d.ts new file mode 100644 index 000000000..d2d668be7 --- /dev/null +++ b/docs/chatterino.d.ts @@ -0,0 +1,19 @@ +/** @noSelfInFile */ + +declare module c2 { + enum LogLevel { + Debug, + Info, + Warning, + Critical + } + class CommandContext { + words: String[]; + channel_name: String; + } + + function log(level: LogLevel, ...data: any[]): void; + function register_command(name: String, handler: (ctx: CommandContext)=>void): boolean; + function send_msg(channel: String, text: String): boolean; + function system_msg(channel: String, text: String): boolean; +}