-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.d.ts
102 lines (87 loc) · 2.01 KB
/
type.d.ts
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
interface DataProps {
category: string
correct_answer: string
difficulty: string
incorrect_answers: string[]
question: string
type: string
}
interface QuestionProps extends DataProps {
allAnswers: string[]
}
interface CategoryProps {
[key: number]: string
}
interface FetchData {
data: QuestionProps[]
err: string
}
interface CardProps {
questionNum: number
totalQuestions: number
nextQuestion: () => void
question: string
answers: string[]
userAnswer: AnswerProps | undefined
checkAnswers: (e: React.MouseEvent<HTMLButtonElement>) => void
}
interface AnswerProps {
question: string,
answer: string,
isCorrect: boolean,
correctAnswer: string,
}
interface ConditionBoardProps {
form: FormProps
handleConditionChange: (e: React.ChangeEvent<HTMLSelectElement | HTMLInputElement>) => void
}
interface FormProps {
amount: number
type: string
difficulty: string
category: number
}
interface SubRowProps {
id: number
createdAt: string
category: number
type: string
difficulty: string
score: number
totalNumber: number
}
interface RowProps {
date: string
frequency: number
highest: string
lowest: string
average: string
}
interface ParentRowProps {
[key: string]: SubRowProps[]
}
interface RecordsProps {
date: string
frequency: number
highest: string
lowest: string
average: string
}
interface RowContextProps {
gameOver: boolean
setGameOver: React.Dispatch<React.SetStateAction<boolean>>
loading: boolean
setLoading: React.Dispatch<React.SetStateAction<boolean>>
userAnswers: AnswerProps[]
setUserAnswers: React.Dispatch<React.SetStateAction<AnswerProps[]>>
number: number
setNumber: React.Dispatch<React.SetStateAction<number>>
questions: QuestionProps[]
setQuestions: React.Dispatch<React.SetStateAction<QuestionProps[]>>
rows: SubRowProps[]
setRows: React.Dispatch<React.SetStateAction<SubRowProps[]>>
table: ParentRowProps
setTable: React.Dispatch<React.SetStateAction<ParentRowProps>>
parentRecords: RecordsProps[]
setParentRecords: React.Dispatch<React.SetStateAction<RecordsProps[]>>
}