From 2b444f1631173d4cbdfc91fb67f256215c4c57b0 Mon Sep 17 00:00:00 2001 From: maxswa Date: Thu, 13 Jun 2019 17:08:32 -0400 Subject: [PATCH] Add types --- src/types.ts | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/types.ts diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..42f5693 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,73 @@ +export type Gamemode = 'main' | 'iron' | 'hc' | 'ult' | 'dmm' | 'sdmm' | 'dmmt'; + +export type Mode = Gamemode | 'full'; + +export interface Skill { + rank: number; + level: number; + xp: number; +} + +export interface Activity { + rank: number; + score: number; +} + +export type SkillName = + | 'overall' + | 'attack' + | 'defence' + | 'strength' + | 'hitpoints' + | 'ranged' + | 'prayer' + | 'magic' + | 'cooking' + | 'woodcutting' + | 'fletching' + | 'fishing' + | 'firemaking' + | 'crafting' + | 'smithing' + | 'mining' + | 'herblore' + | 'agility' + | 'thieving' + | 'slayer' + | 'farming' + | 'runecraft' + | 'hunter' + | 'construction'; + +export type Skills = { [Name in SkillName]: Skill }; + +export type ClueType = + | 'all' + | 'beginner' + | 'easy' + | 'medium' + | 'hard' + | 'elite' + | 'master'; + +export type Clues = { [Type in ClueType]: Activity }; + +export type BHType = 'rogue' | 'hunter'; + +export type BH = { [Type in BHType]: Activity }; + +export interface Stats { + skills: Skills; + clues: Clues; + bh: BH; + lms: Activity; +} + +export type Modes = { [M in Gamemode]?: Stats }; + +export interface Player extends Modes { + rsn: string; + mode: Gamemode; + dead: boolean; + deironed: boolean; +}