UNPKG

scryfall-client

Version:
33 lines (32 loc) 1.63 kB
import type Card from "../models/card"; import List from "../models/list"; import type Catalog from "../models/catalog"; import type { CardCollectionIdentifier } from "../types/card-collection-identifier"; type UniqueOption = "cards" | "art" | "prints"; type OrderOption = "name" | "set" | "released" | "rarity" | "color" | "usd" | "tix" | "eur" | "cmc" | "power" | "toughness" | "edhrec" | "artist"; type DirectionOption = "auto" | "asc" | "desc"; type SearchQueryOptions = { unique?: UniqueOption; order?: OrderOption; dir?: DirectionOption; include_extras?: boolean; include_multilingual?: boolean; include_variations?: boolean; page?: number; }; type NamedOptions = { kind?: string; set?: string; }; type AutoCompleteOptions = { include_extras?: boolean; }; export declare function search(searchString: string, options?: SearchQueryOptions): Promise<List<Card>>; export declare function getCardNamed(name: string, options?: NamedOptions): Promise<Card>; export declare function autocomplete(searchString: string, options?: AutoCompleteOptions): Promise<Catalog>; export declare function random(searchString?: string): Promise<Card>; export declare function getCollection(identifiers: CardCollectionIdentifier[]): Promise<List<Card>>; export declare function getCardBySetCodeAndCollectorNumber(code: string, collectorNumber: string, lang?: string): Promise<Card>; type GetCardKind = "id" | "scryfall" | "multiverse" | "arena" | "mtgo" | "tcg" | "name" | "exactName" | "fuzzyName"; export declare function getCard(idOrName: string | number, kind?: GetCardKind): Promise<Card>; export {};