UNPKG

scryfall-sdk

Version:

A Node.js SDK for https://scryfall.com/docs/api written in Typescript.

47 lines (46 loc) 2.09 kB
import { IScry } from "./IScry"; import { SearchError } from "./util/MagicQuerier"; export * from "./api/BulkData"; export { default as BulkData } from "./api/BulkData"; export * from "./api/Cards"; export { default as Cards } from "./api/Cards"; export * from "./api/Catalog"; export { default as Catalog } from "./api/Catalog"; export * from "./api/Migrations"; export { default as Migrations } from "./api/Migrations"; export * from "./api/Rulings"; export { default as Rulings } from "./api/Rulings"; export * from "./api/Sets"; export { default as Sets } from "./api/Sets"; export * from "./api/Symbology"; export { default as Symbology } from "./api/Symbology"; export * from "./IScry"; /** * Sets the name and version of this agent. This is required for all non-browser applications. */ export declare function setAgent(agent: string, version: string): void; /** * Sets the API calls to retry if they fail, for any reason. * @param attempts The number of attempts that can be made (includes the initial call). * @param timeout The time that the query should wait before attempting the request again. */ export declare function setRetry(attempts: number, timeout?: number, canRetry?: (error: SearchError) => boolean): void; /** * Sets the API calls to be spaced by at least this amount of time. Respects the minimum requested timeout provided by Scryfall. */ export declare function setTimeout(timeout: number): void; /** * Clears the cache */ export declare function clearCache(): void; /** * Sets the duration that most API calls will be cached. By default, the cache duration is 1 day. * To disable caching entirely, set the timeout to `0` */ export declare function setCacheDuration(ms: number): void; /** * Sets the maximum number of query results that can be cached at one time. By default, the maximum is 500 objects. * To disable caching entirely, set the amount to `0` */ export declare function setCacheLimit(amount: number): void; export declare function setFuzzySearch(search?: typeof IScry["fuzzySearch"]): void;