From f7044c7b10beb9eb4723372a6e924cbb8eaaf5db Mon Sep 17 00:00:00 2001 From: Avior Date: Wed, 11 Mar 2020 10:12:38 +0100 Subject: [PATCH] Made lang settings public, Edited function params Signed-off-by: Avior --- tcgdex.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcgdex.ts b/tcgdex.ts index 892f224..4aab7a5 100644 --- a/tcgdex.ts +++ b/tcgdex.ts @@ -4,8 +4,8 @@ import { SetSingle, SetRequest } from './interfaces/Set' import { CardSingle } from './interfaces/Card' import { ExpansionSingle } from './interfaces/Expansion' -export default class TCGDex { - private lang: Langs = "en" +export default class TCGdex { + public lang: Langs = "en" public constructor(lang?: Langs) { if (lang) this.lang = lang @@ -19,7 +19,9 @@ export default class TCGDex { return this.getBaseUrl() } - public async getCard(id: string, set?: string): Promise { + public async getCard(id: string|number, set: string): Promise; + public async getCard(id: string): Promise; + public async getCard(id: string|number, set?: string): Promise { try { const txt = set ? `sets/${set}` : "cards" const resp = await fetch(`${this.gbu()}/${txt}/${id}`)