interface CardFields {
    colorManaCost(card: Card): Set<string>;
    colorUnion(card: Card): readonly string[];
    langCode(card: Card): string;
    manaCost(card: Card): string;
    partsCMC(card: Card): number[];
    partsColors(card: Card): Colors[];
    partsManaCost(card: Card): string[];
    partsName(card: Card): string[];
    partsOracleText(card: Card): string[];
    partsPrintedName(card: Card): string[];
    partsTypeLine(card: Card): string[];
}
Index

Methods

  • Parse card colors from mana cost. Some card categories like Devoid do not have an associated colors array, but do have a mana cost potentially with casting colors.

    Parameters

    Returns Set<string>

    A set with mana cost colors.

  • Calculate union for colors field taking into account card faces.

    Parameters

    Returns readonly string[]

    Read only union of all card colors.

  • Defer to original CSV language code if available and differs from the Scryfall card lang field.

    Alas, currently most online MTG collection services do not associate cards w/ foreign language Scryfall IDs. A temporary solution is to defer to any language set by the collection service exported CSV instead of the found Scryfall card data / language when these values differ. This requires the user to correctly set the language in the online MTG collection service.

    Parameters

    Returns string

    Normalized language code.

  • The mana cost string. Multi-face cards potentially have multiple mana cost seperated by //.

    Parameters

    Returns string

    The mana cost string.

  • Return all colors parts for single or dual face cards.

    Parameters

    Returns number[]

    The colors string array parts.

  • Return all colors parts for single or dual face cards.

    Parameters

    Returns Colors[]

    The colors string array parts.

  • Return all name parts for single or dual face cards.

    Parameters

    Returns string[]

    mana_cost text parts.

  • Return all name parts for single or dual face cards.

    Parameters

    Returns string[]

    name text parts.

  • Return all oracle_text parts for single or dual face cards.

    Parameters

    Returns string[]

    oracle_text text parts.

  • Return all printed_name parts for single or dual face cards.

    Parameters

    Returns string[]

    printed_name text parts.

  • Return all type_line parts for single or dual face cards.

    Parameters

    Returns string[]

    type_line text parts.