Add types

This commit is contained in:
maxswa
2019-06-13 17:08:32 -04:00
parent 2b6c62ae0b
commit 2b444f1631

73
src/types.ts Normal file
View File

@@ -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;
}