diff --git a/src/interfaces.d.ts b/src/interfaces.d.ts index 6cecb0d..70eb685 100644 --- a/src/interfaces.d.ts +++ b/src/interfaces.d.ts @@ -22,9 +22,18 @@ interface variants { firstEdition?: boolean } +interface booster { + id: string + name: string + logo?: string + artwork_front?: string + artwork_back?: string +} + export type SetList = Array export type SerieList = Array export type CardList = Array +export type BoosterList = Array export interface SetResume { id: string @@ -105,6 +114,8 @@ export interface Set extends SetResume { } cards: CardList + + boosters?: BoosterList } export interface CardResume { @@ -302,6 +313,8 @@ export interface Card extends CardResume */ expanded: boolean } + + boosters?: BoosterList } export type StringEndpointList = Array diff --git a/src/models/Card.ts b/src/models/Card.ts index 5d27cab..d46e040 100644 --- a/src/models/Card.ts +++ b/src/models/Card.ts @@ -1,5 +1,5 @@ import CardResume from './CardResume' -import type { Variants } from './Other' +import type { Booster, Variants } from './Other' import type TCGdexSet from './Set' import type SetResume from './SetResume' @@ -188,6 +188,8 @@ export default class Card extends CardResume { expanded: boolean } + public boosters?: Array + public override async getCard(): Promise { return this } diff --git a/src/models/Other.d.ts b/src/models/Other.d.ts index 0f88424..2c0441d 100644 --- a/src/models/Other.d.ts +++ b/src/models/Other.d.ts @@ -4,3 +4,12 @@ export interface Variants { holo?: boolean firstEdition?: boolean } + +export interface Booster { + + id: string + name: string + logo?: string + artwork_front?: string + artwork_back?: string +} \ No newline at end of file diff --git a/src/models/Set.ts b/src/models/Set.ts index b4c8d47..8ca5188 100644 --- a/src/models/Set.ts +++ b/src/models/Set.ts @@ -1,7 +1,7 @@ import { objectLoop } from '@dzeio/object-util' import CardResume from './CardResume' import Model from './Model' -import type { Variants } from './Other' +import type { Booster, Variants } from './Other' import type SerieResume from './SerieResume' // biome-ignore lint/suspicious/noShadowRestrictedNames: @@ -70,6 +70,8 @@ export default class Set extends Model { public cards!: Array + public boosters?: Array + public async getSerie() { return this.sdk.serie.get(this.serie.id) }