card-games-utils
Version:
Utility package for card games
59 lines • 2.17 kB
TypeScript
import { StandardCardColor, StandardCardName, StandardCardRank, StandardCardSuite } from '../constants/StandardDeckEnum';
import { type StandardCard } from '../interfaces/StandardCard';
/**
* Class for Standard Deck of Standard Playing cards
* @class
*/
export declare class StandardDeck {
/**
* @method
* get an Array of standard playing cards
*
* @static
*
* @param {boolean} withJoker - boolean to decide should the deck include Joker card or not
* @returns {StandardCard[]} The array of standard playing cards.
*/
static getStandardDeck(withJoker?: boolean): StandardCard[];
/**
* @method
* @static
* Returns the suite of a given card.
*
* @param {StandardCardName} card - The name of the card whose suite is being retrieved.
* @returns {StandardCardSuite} The suite of the card.
* @throws {Error} - when suite not found
*/
static getSuite(card: keyof typeof StandardCardName): keyof typeof StandardCardSuite;
/**
* @method
* @static
* Returns the color of a given card.
*
* @param {StandardCardName} card - The name of the card whose color is being retrieved.
* @returns {StandardCardColor} The color of the card.
* @throws {Error} - when color not found
*/
static getColor(card: keyof typeof StandardCardName): keyof typeof StandardCardColor;
/**
* @method
* @static
* Returns the rank of a given card.
*
* @param {StandardCardName} card - The name of the card whose rank is being retrieved.
* @returns {StandardCardRank} The rank of the card.
* @throws {Error} - when rank not found
*/
static getRank(card: keyof typeof StandardCardName): keyof typeof StandardCardRank;
/**
* @method
* @static
* Returns the number of a given card.
*
* @param {StandardCardName} card - The name of the card whose number is being retrieved.
* @returns {number} The number of the card.
* @throws {Error} - when number not found
*/
static getNumber(card: keyof typeof StandardCardName): number;
}
//# sourceMappingURL=StandardDeck.d.ts.map