-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.tsx
64 lines (54 loc) · 1.26 KB
/
types.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* Learn more about using TypeScript with React Navigation:
* https://reactnavigation.org/docs/typescript/
*/
import { GAME_ACTION_TYPES } from "./reducers/gameActions"
export type RootStackParamList = {
Root: undefined
Advert: undefined
}
export type BottomTabParamList = {
Lobby: undefined
Game: undefined
}
export type LobbyParamList = {
LobbyScreen: undefined
}
export type GameParamList = {
GameScreen: undefined
}
export type Deck = {
success: boolean
deck_id: string
shuffled: boolean
remaining: number
}
export type Card = {
code: string
image: string
suit: "SPADES" | "HEARTS" | "CLUBS" | "DIAMONDS"
value: string
}
export type DeckState = {
decks: Deck[]
loading: boolean
addDeck: (deck: Deck) => void
}
export type TGameState = {
started: boolean
ended: boolean
houseCards: Card[]
playerCards: Card[]
loading: boolean
playerScore: number
houseScore: number
result: string
deck: Deck | undefined
}
export type TGameActionTypeKey = keyof typeof GAME_ACTION_TYPES
export type TGameActionType = typeof GAME_ACTION_TYPES[TGameActionTypeKey]
export type TDrawSuccessPayload = { houseCards?: Card[]; playerCards?: Card[] }
export type TOpenGamePayload = { deck: Deck }
export interface ICurrentGameProps {
deck: Deck
}