Common interface for all imported collection data.

Implements
Index

Constructors

Accessors

  • get size(): number

    Returns number

    Total count of all unique cards in the collection

Methods

  • Clear all card data stored in all indexes.

    Returns void

  • Deletes card from all collection indexes.

    Parameters

    • key: string

      Scryfall ID.

    Returns void

  • Get all CSV card entries across all CSV indexed files for the given Scryfall ID.

    Parameters

    • key: string

      Scryfall ID.

    Returns CSVCard[]

    An array of all CSV card entries matching the given key.

  • Parameters

    • key: string

      Scryfall ID.

    Returns boolean

    Does any collection index have the given card.

  • Does this collection contain a specific variant by Scryfall ID?

    Parameters

    • query: { finish?: CardFinish; scryfall_id: string; user_lang?: string }

      Specific variant query.

      • Optionalfinish?: CardFinish

        Finish; default: normal.

      • scryfall_id: string

        Scryfall ID

      • Optionaluser_lang?: string

        User defined language code; default: en.

    Returns boolean

  • Checks the meta external file names for a card file name match.

    Parameters

    Returns boolean

  • Load collection.

    Parameters

    • options: { groups?: MetadataGroups<string>; logger?: BasicLogger; path: string }

      Options.

      • Optionalgroups?: MetadataGroups<string>

        Input CSV file or directory path to CSV files for card collections representing various groups.

      • Optionallogger?: BasicLogger

        Optional logger instance.

      • path: string

        A single CSV file path or a directory path to load all .csv files.

    Returns Promise<CSVCollection>

    A new collection of all CSV card data.