Add functions for card constants
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
import { Query } from "../interfaces/query";
|
||||
import { Card } from "../interfaces/card";
|
||||
import { Type } from '../enums/type';
|
||||
import { Supertype } from '../enums/supertype';
|
||||
import { Subtype } from '../enums/subtype';
|
||||
import { Rarity } from '../enums/rarity';
|
||||
import { Client } from "../client";
|
||||
|
||||
export async function findCardByID(id: string): Promise<Card> {
|
||||
@ -20,4 +24,32 @@ export async function getAllCards(): Promise<Card[]> {
|
||||
const client: Client = Client.getInstance();
|
||||
const response: Card[] = await client.get<Card[]>('cards', param);
|
||||
return response;
|
||||
}
|
||||
|
||||
export async function getTypes(): Promise<Type[]> {
|
||||
const client: Client = Client.getInstance();
|
||||
|
||||
const response: Type[] = await client.get<Type[]>('types');
|
||||
return response;
|
||||
}
|
||||
|
||||
export async function getSupertypes(): Promise<Supertype[]> {
|
||||
const client: Client = Client.getInstance();
|
||||
|
||||
const response: Supertype[] = await client.get<Supertype[]>('supertypes');
|
||||
return response;
|
||||
}
|
||||
|
||||
export async function getSubtypes(): Promise<Subtype[]> {
|
||||
const client: Client = Client.getInstance();
|
||||
|
||||
const response: Subtype[] = await client.get<Subtype[]>('subtypes');
|
||||
return response;
|
||||
}
|
||||
|
||||
export async function getRarities(): Promise<Rarity[]> {
|
||||
const client: Client = Client.getInstance();
|
||||
|
||||
const response: Rarity[] = await client.get<Rarity[]>('rarities');
|
||||
return response;
|
||||
}
|
||||
Reference in New Issue
Block a user