UNPKG

poke-sdk-typescript

Version:
55 lines (54 loc) 1.39 kB
import { Config } from './config'; import { Nature, Pokemon, Stat } from './types'; export declare class Poke { private config; constructor(config: Config); request<T>(path: string): Promise<T>; /** * * Get a Pokemon by ID or Name * * @param id numeric id or name of the Pokemon * * @example * ```ts * getStat('1') * getStat('bulbasaur') * ``` * * @returns {Promise<Pokemon>} The Pokemon * @see {@link https://pokeapi.co/docs/v2#pokemon} */ getPokemon(id: string): Promise<Pokemon>; /** * Get a Pokemon nature by ID or Name. Natures influence how a Pokemon's stats grow. * * @param id numeric id or name of the nature * * @example * ```ts * getNature('1') * getNature('hardy') * ``` * * returns {Promise<Pokemon>} The Pokemon Nature * @see {@link https://pokeapi.co/docs/v2#natures} */ getNature(id: string): Promise<Nature>; /** * * Get a Pokemon Stat by ID or Name. Stats determine certain aspects of battles. * * @param id numeric id or name of the statistic * * @example * ```ts * getStat('1') * getStat('hp') * ``` * * @returns {Promise<Stat>} The Stat * @see {@link https://pokeapi.co/docs/v2#stats} */ getStat(id: string): Promise<Stat>; }