From 525f61c0bd9ba6eecda3d264da9421a194500e46 Mon Sep 17 00:00:00 2001 From: zergetaev Date: Tue, 14 Jan 2020 22:19:27 +0300 Subject: [PATCH] Make Locale an enum --- index.d.ts | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/index.d.ts b/index.d.ts index f158baa..8a752e3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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; + get( + build: Build, + locale?: Locale = Locale.AmericanEnglish + ): Promise; - getLatest(locale?: Locale): Promise; + getLatest(locale?: Locale = Locale.AmericanEnglish): Promise; } export enum CardClass {