separated type definitions and util functions

This commit is contained in:
2022-02-15 15:06:34 -06:00
parent 513a9d1582
commit 5348ab487b
21 changed files with 559 additions and 428 deletions

13
src/types/api.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
export interface uniteApiData {
name: string,
id: string,
avatar: string,
level: string,
rank: string,
class: string|null,
elo: string|null,
battles: string,
wins: string,
winrate: string
}

55
src/types/lang.d.ts vendored Normal file
View File

@@ -0,0 +1,55 @@
//this is a generic type, and needs 'any'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type basicObject = {[keys: string]: any};
type basicObjectStr = {[keys: string]: string};
type bigString = string | string[];
interface embedData {
content?: string,
embeds: MessageEmbed[]
}
interface embedField {
name: string,
value: bigString,
inline?: boolean
}
interface authorData {
name: string,
url?: string,
icon?: string
}
interface footerData {
text: string,
icon?: string
}
interface embedObj {
embed: true,
content?: string,
title?: string,
description?: bigString,
/**
* URL
*/
url?: string,
/**
* #FFFFFF
*/
color?: string,
footer?: string | footerData,
thumbnail?: string,
/**
* URL
*/
image?: string,
/**
* URL
*/
author?: string | authorData,
fields?: embedField[],
timestamp?: boolean | string | number
}
type LangObj = { [keys:string]: LangObj | embedObj | string }
type LangObjWhole = { [langid:string]: LangObj }

8
src/types/queue.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
import { GuildMember } from 'discord.js';
export interface queueInfoBase {
teamsize: number
}
export interface queueInfo extends queueInfoBase {
players: GuildMember[]
}