Class CardDB
Index
Accessors
Methods
Accessors
StaticCardFields
Returns CardFields
StaticCardFilter
Returns CardDB.Services.CardFilter
StaticPrice
Returns Price
StaticPrintCardFields
Returns PrintCardFields
Methods
StaticisGroupKind
Provides a type guard for CardDB.File.MetadataGroups keys.
Parameters
- value: unknown
Returns value is keyof MetadataGroups<string[]>
StaticisValidType
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<CardDB.Stream.Reader>
CardDB.Stream.Reader instance.
- options: { filepath: string }
StaticloadAll
- loadAll(
options: {
dirpath: string;
format?: GameFormat | Iterable<GameFormat, any, any>;
type?: CardDB.File.DBType | Iterable<CardDB.File.DBType, any, any>;
walk?: boolean;
},
): Promise<CardDB.Stream.Reader[]>Load all JSON card DBs in the specified directory path. Additional options allow filtering by DB type and game format.
Parameters
- options: {
dirpath: string;
format?: GameFormat | Iterable<GameFormat, any, any>;
type?: CardDB.File.DBType | Iterable<CardDB.File.DBType, any, any>;
walk?: boolean;
}Options.
dirpath: string
Directory path to load.
Optionalformat?: GameFormat | Iterable<GameFormat, any, any>Match exact game format of a
sorted_formatCardDB.Optionaltype?: CardDB.File.DBType | Iterable<CardDB.File.DBType, any, any>Match type of CardDB.
Optionalwalk?: booleanWalk all subdirectories for CardDB files to load; default:
false
Returns Promise<CardDB.Stream.Reader[]>
Configured CardDB.Stream.Reader instances for the found JSON card DB collections.
- options: {
Staticsave
StaticuniqueCardKey
Creates a unique composite key coalescing the
:<Foil / Finish>: . Parameters
- card: Card
Returns string
Unique card key.
Provides loading / saving of Scrydex CardDB files including streaming support.