mkmrare/types.ts

134 lines
2.5 KiB
TypeScript

export interface ForeignData {
flavorText: string;
language: string;
multiverseId: number;
name: string;
text: string;
type: string;
}
export interface Legalities {
commander: string;
duel: string;
legacy: string;
modern: string;
vintage: string;
}
export interface Prices {
mtgo: Record<string, number>;
mtgoFoil: Record<string, number>;
paper: Record<string, number>;
paperFoil: Record<string, number>;
}
export interface PurchaseUrls {
cardmarket: string;
tcgplayer: string;
}
export interface MCMCard {
artist: string;
borderColor: string;
colorIdentity: string[];
colors: string[];
convertedManaCost: number;
edhrecRank: number;
flavorText: string;
foreignData: ForeignData[];
frameVersion: string;
hasFoil: boolean;
hasNonFoil: boolean;
isMtgo: boolean;
isPaper: boolean;
layout: string;
legalities: Legalities;
manaCost: string;
mcmId: number;
mcmMetaId: number;
mtgoFoilId: number;
mtgoId: number;
multiverseId: number;
name: string;
number: string;
originalText: string;
originalType: string;
power: string;
prices: Prices;
printings: string[];
purchaseUrls: PurchaseUrls;
rarity: string;
rulings: any[];
scryfallId: string;
scryfallIllustrationId: string;
scryfallOracleId: string;
subtypes: string[];
supertypes: any[];
tcgplayerProductId: number;
text: string;
toughness: string;
type: string;
types: string[];
uuid: string;
set: string;
}
export type MCMDB = Record<string, MCMCard>;
// Lighther version of MCMCard without a lot of useless information
export interface LeanMCMCard {
colorIdentity: string[];
colors: string[];
convertedManaCost: number;
edhrecRank: number;
manaCost: string;
mcmId: number;
name: string;
rarity: string;
scryfallId: string;
subtypes: string[];
supertypes: any[];
text: string;
type: string;
types: string[];
set: string;
}
export interface Language {
idLanguage: number;
languageName: string;
}
export interface Link {
rel: string;
href: string;
method: string;
action: string;
idArticle?: number;
}
export interface Article {
idArticle: number;
idProduct: number;
language: Language;
comments: string;
price: number;
count: number;
inShoppingCart: boolean;
condition: string;
isFoil: boolean;
isSigned: boolean;
isPlayset: boolean;
isAltered: boolean;
links: Link[];
}
export interface LeanArticle {
idArticle: number;
language: string;
comments: string;
price: number;
count: number;
condition: string;
}