-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
112 lines (101 loc) · 2.35 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { PokeAPI } from 'pokeapi-types';
import { cardColor, typeColor } from './constants/colors';
type Name = {
name: string;
};
export type StackParamList = {
PokeDex: undefined;
AbilityList: undefined;
ItemList: undefined;
MoveList: undefined;
About: undefined;
PokemonDetail: Name;
MoveDetail: Name;
TypeDetail: {
name: keyof typeof cardColor;
};
AbilityDetail: Name;
ItemDetail: Name;
};
export type Chain = {
species_name: string;
min_level: number;
trigger_name: EvolutionTriggerName | null;
item: PokeAPI.NamedAPIResource | null;
};
type EvolutionTriggerName =
| 'level-up'
| 'trade'
| 'use-item'
| 'shed'
| 'spin'
| 'tower-of-darkness'
| 'tower-of-waters'
| 'three-critical-hits'
| 'take-damage'
| string
| 'other';
export type AbilityType = {
isHidden: boolean;
slot: number;
name: string;
};
export type PokemonSmDetailType = {
name: string;
sprite: string | null;
types: (keyof typeof typeColor)[];
id: number;
};
export type PokemonDetailType = {
id: number;
name: string;
profile: {
sprite: string | null;
species: string;
types: (keyof typeof typeColor)[];
height: string;
weight: string;
abilities: AbilityType[];
flavorTextEntry: {
diamond: string;
};
gender: {
female: number;
male: number;
} | null;
};
training: {
catchRate: number;
growthRate: string;
baseHappiness: number | null;
baseExp: number | null;
evYield: string;
};
breeding: { eggGroups: string[]; eggCycles: number | null };
stats: {
hp: number[];
attack: number[];
defense: number[];
specialAttack: number[];
specialDefense: number[];
speed: number[];
total: number[];
};
evolutions: string[];
moves: {
levelUp: [string, number | null][];
egg: string[];
tutor: string[];
machine: string[];
};
};
export type PokemonMoveDetailType = {
name: string;
type: string;
damageClass: string;
power: number | null;
accuracy: number | null;
pp: number | null;
description: string | null;
};
export type MoveLearnMethod = 'levelUp' | 'machine' | 'tutor' | 'egg';