Tighten up typescript rules and fix resulting compilation errors

This commit is contained in:
Casper Warden
2020-12-03 13:55:02 +00:00
parent 6e0d79715e
commit 4431fb8d15
526 changed files with 1579 additions and 920 deletions

View File

@@ -1,12 +1,13 @@
import Signals = NodeJS.Signals;
import Timeout = NodeJS.Timeout;
import * as path from 'path';
import { LoginResponse } from '../lib/classes/LoginResponse';
import { Bot } from '../lib/Bot';
import { LoginParameters } from '../lib/classes/LoginParameters';
import { BotOptionFlags } from '../lib/enums/BotOptionFlags';
import * as path from 'path';
import Signals = NodeJS.Signals;
import Timeout = NodeJS.Timeout;
export class ExampleBot
{
protected masterAvatar = 'd1cd5b71-6209-4595-9bf0-771bf689ce00';
@@ -47,7 +48,7 @@ export class ExampleBot
this.bot.stayPut(true);
}
public async run()
public async run(): Promise<void>
{
const exitHandler = async(options: { exit?: boolean }, err: Error | number | Signals) =>
{
@@ -94,12 +95,12 @@ export class ExampleBot
await this.login();
}
protected async onConnected()
protected async onConnected(): Promise<void>
{
}
private async login()
private async login(): Promise<void>
{
if (this.isConnecting)
{
@@ -134,7 +135,7 @@ export class ExampleBot
return this.connected();
}
private async reconnectCheck()
private async reconnectCheck(): Promise<void>
{
if (!this.isConnected)
{
@@ -142,7 +143,7 @@ export class ExampleBot
}
}
private async connected()
private async connected(): Promise<void>
{
this.bot.clientEvents.onDisconnected.subscribe((event) =>
{
@@ -159,7 +160,8 @@ export class ExampleBot
await this.onConnected();
}
private async close()
// @ts-ignore
private async close(): Promise<void>
{
if (this.reconnectTimer !== undefined)
{