File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 3
3
"version" : " 0.9.1" ,
4
4
"description" : " React Quiz Component" ,
5
5
"main" : " dist/index.js" ,
6
+ "types" : " lib/react-quiz-component.d.ts" ,
6
7
"module" : " dist/index.es.js" ,
7
8
"scripts" : {
8
9
"dev" : " webpack-dev-server --mode development" ,
Original file line number Diff line number Diff line change
1
+ declare module 'react-quiz-component' {
2
+ import { ReactElement } from 'react' ;
3
+
4
+ type QuestionType = "text" | "photo"
5
+
6
+ type AnswerSelectionType = "single" | "multiple"
7
+
8
+ type Question = {
9
+ question : string
10
+ questionType : QuestionType
11
+ answers : string [ ]
12
+ correctAnswer : string
13
+ answerSelectionType : AnswerSelectionType
14
+ messageForCorrectAnswer ?: string
15
+ messageForIncorrectAnswer ?: string
16
+ explanation ?: string
17
+ point ?: string
18
+ segment ?: string
19
+ }
20
+
21
+ type QuizStructure = {
22
+ quizTitle : string
23
+ questions : Question [ ]
24
+ }
25
+
26
+ type QuizProps = {
27
+ quiz : QuizStructure ;
28
+ disableSynopsis ?: boolean ;
29
+ shuffleAnswer ?: boolean ;
30
+ shuffle ?: boolean ;
31
+ showDefaultResult ?: boolean ;
32
+ showInstantFeedback ?: boolean ;
33
+ continueTillCorrect ?: boolean ;
34
+ timer ?: number ;
35
+ allowPauseTimer ?: boolean
36
+ }
37
+
38
+ const Quiz : ( props : QuizProps ) => ReactElement ;
39
+ export default Quiz ;
40
+ }
You can’t perform that action at this time.
0 commit comments