Skip to content

Commit

Permalink
Make Locale an enum
Browse files Browse the repository at this point in the history
  • Loading branch information
zernie committed Jan 14, 2020
1 parent 4b97f79 commit 525f61c
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
declare module "hearthstonejson-client" {
export type BuildNumber = number;
export type Build = BuildNumber | "latest";
export type Locale =
| "enUS"
| "enGB"
| "frFR"
| "deDE"
| "koKR"
| "esES"
| "esMX"
| "ruRU"
| "zhTW"
| "zhCN"
| "itIT"
| "ptBR"
| "plPL"
| "ptPT"
| "jaJP"
| "thTH";
export enum Locale {
AmericanEnglish = "enUS",
English = "enGB",
French = "frFR",
German = "deDE",
Korean = "koKR",
Spanish = "esES",
MexicanSpanish = "esMX",
Russian = "ruRU",
TraditionalChinese = "zhTW",
SimplifiedChinese = "zhCN",
Italian = "itIT",
BrasilianPortuguese = "ptBR",
Polish = "plPL",
Portuguese = "ptPT",
Japanese = "jaJP",
Thai = "thTH",
}

export default class HearthstoneJSON {
public readonly cached: boolean;
public readonly fallback: boolean;

get(build: Build, locale?: Locale): Promise<CardData[]>;
get(
build: Build,
locale?: Locale = Locale.AmericanEnglish
): Promise<CardData[]>;

getLatest(locale?: Locale): Promise<CardData[]>;
getLatest(locale?: Locale = Locale.AmericanEnglish): Promise<CardData[]>;
}

export enum CardClass {
Expand Down

0 comments on commit 525f61c

Please sign in to comment.