pokemon-showdown/tools/set-import/sets/index.d.ts
Kirk Scheibelhut 19d768e00e Fix mistakes from #5749
- and error 'ls' found its way into the source
- the sets/{README.md,index.d.ts} were excluded which also meant
  the sets/ directory didn't exist, causing errors
- the command is `npm publish --access public` not `publish`
2019-09-10 21:16:49 -07:00

38 lines
1011 B
TypeScript

export declare type StatName = 'hp' | 'atk' | 'def' | 'spa' | 'spd' | 'spe';
export declare type StatsTable<T> = {
[stat in StatName]: T;
};
export interface PokemonSet {
name: string;
species: string;
item: string;
ability: string;
moves: string[];
nature: string;
gender: string;
evs: StatsTable<number>;
ivs: StatsTable<number>;
level: number;
shiny?: boolean;
happiness?: number;
pokeball?: string;
hpType?: string;
}
export declare type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer I> ? Array<DeepPartial<I>> : DeepPartial<T[P]>;
};
export interface GenerationData {
[formatid: string]: FormatData;
}
export interface FormatData {
[source: string]: {
[speciesid: string]: {
[name: string]: DeepPartial<PokemonSet>;
};
};
}
export declare type Generation = 1 | 2 | 3 | 4 | 5 | 6 | 7;
export declare function forGen(gen: Generation): Promise<GenerationData> | undefined;
export declare function forFormat(format: string): Promise<FormatData> | undefined;
export {};