Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SetResume>
export type SerieList = Array<SerieResume>
export type CardList = Array<CardResume>
export type BoosterList = Array<booster>

export interface SetResume {
id: string
Expand Down Expand Up @@ -105,6 +114,8 @@ export interface Set extends SetResume {
}

cards: CardList

boosters?: BoosterList
}

export interface CardResume {
Expand Down Expand Up @@ -302,6 +313,8 @@ export interface Card<SetType extends SetResume = SetResume> extends CardResume
*/
expanded: boolean
}

boosters?: BoosterList
}

export type StringEndpointList = Array<string>
Expand Down
4 changes: 3 additions & 1 deletion src/models/Card.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -188,6 +188,8 @@ export default class Card extends CardResume {
expanded: boolean
}

public boosters?: Array<Booster>

public override async getCard(): Promise<Card> {
return this
}
Expand Down
9 changes: 9 additions & 0 deletions src/models/Other.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 3 additions & 1 deletion src/models/Set.ts
Original file line number Diff line number Diff line change
@@ -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: <explanation>
Expand Down Expand Up @@ -70,6 +70,8 @@ export default class Set extends Model {

public cards!: Array<CardResume>

public boosters?: Array<Booster>

public async getSerie() {
return this.sdk.serie.get(this.serie.id)
}
Expand Down