import { DeckParams } from "./utils/decks/deckParams"; import { DeckBuilder } from "./DeckBuilder"; import { Pile } from "./Pile"; /** * Represents a deck of cards */ export declare class Deck { /** * The moment the deck was created */ createdAt: Date; /** * The moment the deck was last updated (draw, shuffle, reset, ...) */ updatedAt: Date; private type; private count; private baseCards?; private cardStack; private piles; /** * Returns a new DeckBuilder instance */ static builder(): DeckBuilder; constructor(opts: DeckParams, shuffle?: boolean, piles?: string[]); /** * Reset a deck, recreating it's card content. This method can be used when you need to reuse a deck or when it's empty. * @param shuffle (Optionnal) Shall the deck be shuffled */ reset(shuffle?: boolean): void; /** * Shuffle the remaining cards in the deck */ shuffle(): void; /** * Add cards at the top of the deck * @param cards cards to add */ add(cards: string[]): void; /** * Add cards at the bottom of the deck * @param cards cards to add */ addBottom(cards: string[]): void; /** * Draw one or more cards from the top of the deck * @param amount (Optionnal) amount of cards to draw, defaults to 1 */ draw(amount?: number): string[]; /** * Draw one or more cards from the bottom of the deck * @param amount (Optionnal) amount of cards to draw, defaults to 1 */ drawBottom(amount?: number): string[]; /** * Returns if the deck is shuffled */ isShuffled(): boolean; /** * Return how many cards are left in the deck */ remaining(): number; /** * Return the cards array used by the deck, you should normaly not have to use this. */ getCards(): string[]; /** * Get or create a pile of cards in the deck. * @param name Name of the pile */ getPile(name: string): Pile; }