Class ScryfallDBAbstract
Index
Methods
Methods
StaticisValidSourceType
Type guard for ScryfallDB.File.DBType.
Parameters
- type: unknown
Returns type is ScryfallDB.File.DBType
Staticload
Attempts to load a Scrydex JSON card DB from the given file path.
Parameters
- options: { filepath: string }
Options.
filepath: string
Filepath to load.
Returns Promise<ScryfallDB.Stream.Reader>
ScryfallDB.Stream.Reader instance.
- options: { filepath: string }
StaticloadAll
- loadAll(
options: {
dirpath: string;
type?: ScryfallDB.File.DBType | Iterable<ScryfallDB.File.DBType, any, any>;
walk?: boolean;
},
): Promise<ScryfallDB.Stream.Reader[]>Load all ScryfallDBs in the specified directory path. Additional options allow filtering by DB type.
Parameters
- options: {
dirpath: string;
type?: ScryfallDB.File.DBType | Iterable<ScryfallDB.File.DBType, any, any>;
walk?: boolean;
}Options.
dirpath: string
Directory path to load.
Optionaltype?: ScryfallDB.File.DBType | Iterable<ScryfallDB.File.DBType, any, any>Match type of CardDB.
Optionalwalk?: booleanWalk all subdirectories for CardDB files to load; default:
false
Returns Promise<ScryfallDB.Stream.Reader[]>
Configured CardDB.Stream.Reader instances for the found JSON card DB collections.
- options: {
Provides a reusable / generic streamable interface over the Scryfall card DB.