import { api } from './client'
import type { Pokemon } from '../types/game'
import type { EvolutionAdmin, PokemonEncounterLocation } from '../types/admin'

export function getPokemon(id: number): Promise<Pokemon> {
  return api.get(`/pokemon/${id}`)
}

export function fetchPokemonFamilies(): Promise<{ families: number[][] }> {
  return api.get('/pokemon/families')
}

export function fetchPokemonEncounterLocations(pokemonId: number): Promise<PokemonEncounterLocation[]> {
  return api.get(`/pokemon/${pokemonId}/encounter-locations`)
}

export function fetchPokemonEvolutionChain(pokemonId: number): Promise<EvolutionAdmin[]> {
  return api.get(`/pokemon/${pokemonId}/evolution-chain`)
}
