Skip to content

Commit

Permalink
refactor(card): refactor card type
Browse files Browse the repository at this point in the history
  • Loading branch information
Kadphol committed Jan 2, 2025
1 parent ed2a850 commit 6a373ca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/constants/card.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export const SUIT = {
import { RankType, SuitType } from '@/types/card'

export const SUIT: Record<string, SuitType> = {
HEARTS: 'hearts',
DIAMONDS: 'diamonds',
CLUBS: 'clubs',
SPADES: 'spades',
}

export const RANK = {
export const RANK: Record<string, RankType> = {
TWO: '2',
THREE: '3',
FOUR: '4',
Expand All @@ -21,8 +23,8 @@ export const RANK = {
ACE: 'A',
}

export const SUITS = [SUIT.HEARTS, SUIT.DIAMONDS, SUIT.CLUBS, SUIT.SPADES]
export const RANKS = [
export const SUITS: SuitType[] = [SUIT.HEARTS, SUIT.DIAMONDS, SUIT.CLUBS, SUIT.SPADES]
export const RANKS: RankType[] = [
RANK.TWO,
RANK.THREE,
RANK.FOUR,
Expand Down

0 comments on commit 6a373ca

Please sign in to comment.