Initial update to v2 data structures

This commit is contained in:
CptSpaceToaster
2021-02-21 01:09:46 -05:00
parent 25e1972242
commit 239b18bcd3
11 changed files with 88 additions and 40 deletions

View File

@ -1,5 +1,5 @@
export interface IAttack {
convertedEnergyCost: string;
convertedEnergyCost: number;
cost: string[];
damage: string;
name: string;

View File

@ -3,30 +3,34 @@ import { IAncientTrait } from './ancientTrait';
import { IAttack } from '../interfaces/attack';
import { IResistance } from '../interfaces/resistance';
import { IWeakness } from '../interfaces/weakness';
import { ICardImage } from './image';
import { ILegality } from './legality';
import { ISet } from './set';
import { ITCGPlayer } from './tcgplayer';
export interface ICard {
ability: IAbility;
ancientTrait?: IAncientTrait;
abilities: IAbility[];
artist: string;
ancientTrait?: IAncientTrait;
attacks: IAttack[];
convertedRetreatCost: number;
evolvesFrom: string;
flavorText: string;
hp: string;
id: string;
imageUrl: string;
imageUrlHiRes: string;
images: ICardImage;
legalities: ILegality;
name: string;
nationalPokedexNumber: number;
nationalPokedexNumbers: number[];
number: string;
rarity: string;
resistances: IResistance[];
retreatCost: string[];
series: string;
set: string;
setCode: string;
subtype: string;
rules: string[];
set: ISet;
subtypes: string[];
supertype: string;
text: string[];
tcgplayer: ITCGPlayer | undefined;
types: string[];
weaknesses: IWeakness[];
}

9
src/interfaces/image.ts Normal file
View File

@ -0,0 +1,9 @@
export interface ISetImage {
symbol: string;
logo: string;
}
export interface ICardImage {
small: string;
large: string;
}

View File

@ -0,0 +1,10 @@
export enum Legality {
LEGAL = 'Legal',
BANNED = 'Banned',
}
export interface ILegality {
expanded: Legality | undefined
standard: Legality | undefined
unlimited: Legality | undefined
}

View File

@ -1,14 +1,15 @@
import { ISetImage } from "./image";
import { ILegality } from "./legality";
export interface ISet {
code: string;
expandedLegal: boolean;
logoUrl: string;
name: string;
id: string;
images: ISetImage;
legalities: ILegality;
name: string;
printedTotal: number;
ptcgoCode: string;
releaseDate: string;
series: string;
standardLegal: boolean;
symbolUrl: string;
totalCards: number;
series: string;
total: number;
updatedAt: string;
updatedSince: string;
}

View File

@ -0,0 +1,17 @@
export interface ITCGPlayer {
url: string;
updatedAt: string;
prices: {
normal: IPrice | undefined;
holofoil: IPrice | undefined;
reverseHolofoil: IPrice | undefined;
}
}
export interface IPrice {
low: number | null
mid: number | null
high: number | null
market: number | null
directLow: number | null
}