@orjok/commons 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-DB3CMKPP.cjs +165 -0
- package/dist/chunk-DB3CMKPP.cjs.map +1 -0
- package/dist/chunk-ZDGYAVEC.js +165 -0
- package/dist/chunk-ZDGYAVEC.js.map +1 -0
- package/dist/hooks.cjs +492 -2
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +130 -2
- package/dist/hooks.d.ts +130 -2
- package/dist/hooks.js +491 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +590 -224
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -14
- package/dist/index.d.ts +86 -14
- package/dist/index.js +549 -183
- package/dist/index.js.map +1 -1
- package/dist/{client-Bm9aiyTx.d.ts → practice-Dh2Tv80G.d.ts} +36 -5
- package/dist/{client-BaOC79Nc.d.cts → practice-QnWtC5A7.d.cts} +36 -5
- package/dist/testing.cjs +10 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +2 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +10 -0
- package/dist/testing.js.map +1 -1
- package/package.json +5 -3
package/dist/hooks.d.cts
CHANGED
|
@@ -1,8 +1,136 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { O as OrjokClient } from './
|
|
2
|
+
import { O as OrjokClient, S as Subject, C as Chapter, T as Topic, L as Language, D as Difficulty, Q as QuestionObject, P as Pack, a as Contest, b as CheckParticipationResponse, c as Course, d as CourseItem, e as CourseLiveExam, U as UserSubjectProgress, f as UserChapterProgress, g as UserTopicProgress, h as PracticeMetrics } from './practice-QnWtC5A7.cjs';
|
|
3
3
|
import './storage-DLqdJgQt.cjs';
|
|
4
4
|
|
|
5
5
|
declare const OrjokProvider: react.Provider<OrjokClient | null>;
|
|
6
6
|
declare function useOrjokClient(): OrjokClient;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
declare function useMediaUrl(key: string | null | undefined): {
|
|
9
|
+
url: string | null;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface UseCurriculumParams {
|
|
14
|
+
level?: string;
|
|
15
|
+
subjectId?: string;
|
|
16
|
+
chapterId?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function useCurriculum({ level, subjectId, chapterId }?: UseCurriculumParams): {
|
|
19
|
+
subjects: Subject[];
|
|
20
|
+
chapters: Chapter[];
|
|
21
|
+
topics: Topic[];
|
|
22
|
+
isLoadingSubjects: boolean;
|
|
23
|
+
isLoadingChapters: boolean;
|
|
24
|
+
isLoadingTopics: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface UseQuestionsParams {
|
|
28
|
+
subjectId?: string;
|
|
29
|
+
chapterId?: string;
|
|
30
|
+
topicId?: string;
|
|
31
|
+
language?: Language | "All";
|
|
32
|
+
difficulty?: Difficulty | "All";
|
|
33
|
+
limit?: number;
|
|
34
|
+
nextToken?: string | null;
|
|
35
|
+
}
|
|
36
|
+
declare function useQuestions({ subjectId, chapterId, topicId, language, difficulty, limit, nextToken, }?: UseQuestionsParams): {
|
|
37
|
+
questions: QuestionObject[];
|
|
38
|
+
nextToken: string | null;
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
refetch: () => Promise<unknown>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
interface UsePacksParams {
|
|
44
|
+
subjectId?: string;
|
|
45
|
+
chapterId?: string;
|
|
46
|
+
topicId?: string;
|
|
47
|
+
language?: Language | "All";
|
|
48
|
+
difficulty?: Difficulty | "All";
|
|
49
|
+
limit?: number;
|
|
50
|
+
nextToken?: string | null;
|
|
51
|
+
}
|
|
52
|
+
declare function usePacks({ subjectId, chapterId, topicId, language, difficulty, limit, nextToken, }?: UsePacksParams): {
|
|
53
|
+
packs: Pack[];
|
|
54
|
+
nextToken: string | null;
|
|
55
|
+
isLoading: boolean;
|
|
56
|
+
refetch: () => Promise<unknown>;
|
|
57
|
+
};
|
|
58
|
+
declare function usePackDetail(packId: string | undefined): {
|
|
59
|
+
pack: Pack | null;
|
|
60
|
+
questions: QuestionObject[];
|
|
61
|
+
isLoading: boolean;
|
|
62
|
+
refetch: () => Promise<unknown>;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
declare function useContest(contestId: string | undefined, checkParticipation?: boolean): {
|
|
66
|
+
contest: Contest | null;
|
|
67
|
+
participation: CheckParticipationResponse | null;
|
|
68
|
+
isLoading: boolean;
|
|
69
|
+
refetch: () => Promise<unknown>;
|
|
70
|
+
};
|
|
71
|
+
declare function useContestsList({ level, nextToken }?: {
|
|
72
|
+
level?: string;
|
|
73
|
+
nextToken?: string;
|
|
74
|
+
}): {
|
|
75
|
+
contests: Contest[];
|
|
76
|
+
nextToken: string | null;
|
|
77
|
+
isLoading: boolean;
|
|
78
|
+
refetch: () => Promise<unknown>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare function useCourse(courseId: string | undefined): {
|
|
82
|
+
course: Course | null;
|
|
83
|
+
isLoading: boolean;
|
|
84
|
+
refetch: () => Promise<unknown>;
|
|
85
|
+
};
|
|
86
|
+
declare function useCourseItems(courseId: string | undefined): {
|
|
87
|
+
items: CourseItem[];
|
|
88
|
+
isLoading: boolean;
|
|
89
|
+
refetch: () => Promise<unknown>;
|
|
90
|
+
};
|
|
91
|
+
declare function useCourseLiveExams(courseId: string | undefined): {
|
|
92
|
+
exams: CourseLiveExam[];
|
|
93
|
+
isLoading: boolean;
|
|
94
|
+
refetch: () => Promise<unknown>;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare function useProgress(userId: string | undefined): {
|
|
98
|
+
subjectsProgress: UserSubjectProgress[];
|
|
99
|
+
chaptersProgress: UserChapterProgress[];
|
|
100
|
+
topicsProgress: UserTopicProgress[];
|
|
101
|
+
metrics: PracticeMetrics;
|
|
102
|
+
isLoading: boolean;
|
|
103
|
+
refetch: () => Promise<unknown>;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type PracticeMode = "setup" | "practice" | "summary";
|
|
107
|
+
interface UsePracticeProps {
|
|
108
|
+
subjectId?: string;
|
|
109
|
+
chapterIds?: string[];
|
|
110
|
+
topicIds?: string[];
|
|
111
|
+
language?: string;
|
|
112
|
+
difficulty?: string;
|
|
113
|
+
userId?: string;
|
|
114
|
+
isCreator?: boolean;
|
|
115
|
+
}
|
|
116
|
+
declare function usePractice({ subjectId, chapterIds, topicIds, language, difficulty, userId, isCreator, }?: UsePracticeProps): {
|
|
117
|
+
mode: PracticeMode;
|
|
118
|
+
questions: QuestionObject[];
|
|
119
|
+
currentIdx: number;
|
|
120
|
+
currentQuestion: QuestionObject | null;
|
|
121
|
+
selectedOption: string | null;
|
|
122
|
+
isAnswered: boolean;
|
|
123
|
+
isCorrect: boolean | null;
|
|
124
|
+
score: number;
|
|
125
|
+
totalPracticed: number;
|
|
126
|
+
accuracy: number;
|
|
127
|
+
isLoading: boolean;
|
|
128
|
+
isValidating: boolean;
|
|
129
|
+
startPractice: () => Promise<void>;
|
|
130
|
+
selectOption: (optionId: string) => Promise<void>;
|
|
131
|
+
nextQuestion: () => void;
|
|
132
|
+
finishPractice: () => void;
|
|
133
|
+
resetPractice: () => void;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { OrjokProvider, useContest, useContestsList, useCourse, useCourseItems, useCourseLiveExams, useCurriculum, useMediaUrl, useOrjokClient, usePackDetail, usePacks, usePractice, useProgress, useQuestions };
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,8 +1,136 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { O as OrjokClient } from './
|
|
2
|
+
import { O as OrjokClient, S as Subject, C as Chapter, T as Topic, L as Language, D as Difficulty, Q as QuestionObject, P as Pack, a as Contest, b as CheckParticipationResponse, c as Course, d as CourseItem, e as CourseLiveExam, U as UserSubjectProgress, f as UserChapterProgress, g as UserTopicProgress, h as PracticeMetrics } from './practice-Dh2Tv80G.js';
|
|
3
3
|
import './storage-DLqdJgQt.js';
|
|
4
4
|
|
|
5
5
|
declare const OrjokProvider: react.Provider<OrjokClient | null>;
|
|
6
6
|
declare function useOrjokClient(): OrjokClient;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
declare function useMediaUrl(key: string | null | undefined): {
|
|
9
|
+
url: string | null;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface UseCurriculumParams {
|
|
14
|
+
level?: string;
|
|
15
|
+
subjectId?: string;
|
|
16
|
+
chapterId?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function useCurriculum({ level, subjectId, chapterId }?: UseCurriculumParams): {
|
|
19
|
+
subjects: Subject[];
|
|
20
|
+
chapters: Chapter[];
|
|
21
|
+
topics: Topic[];
|
|
22
|
+
isLoadingSubjects: boolean;
|
|
23
|
+
isLoadingChapters: boolean;
|
|
24
|
+
isLoadingTopics: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface UseQuestionsParams {
|
|
28
|
+
subjectId?: string;
|
|
29
|
+
chapterId?: string;
|
|
30
|
+
topicId?: string;
|
|
31
|
+
language?: Language | "All";
|
|
32
|
+
difficulty?: Difficulty | "All";
|
|
33
|
+
limit?: number;
|
|
34
|
+
nextToken?: string | null;
|
|
35
|
+
}
|
|
36
|
+
declare function useQuestions({ subjectId, chapterId, topicId, language, difficulty, limit, nextToken, }?: UseQuestionsParams): {
|
|
37
|
+
questions: QuestionObject[];
|
|
38
|
+
nextToken: string | null;
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
refetch: () => Promise<unknown>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
interface UsePacksParams {
|
|
44
|
+
subjectId?: string;
|
|
45
|
+
chapterId?: string;
|
|
46
|
+
topicId?: string;
|
|
47
|
+
language?: Language | "All";
|
|
48
|
+
difficulty?: Difficulty | "All";
|
|
49
|
+
limit?: number;
|
|
50
|
+
nextToken?: string | null;
|
|
51
|
+
}
|
|
52
|
+
declare function usePacks({ subjectId, chapterId, topicId, language, difficulty, limit, nextToken, }?: UsePacksParams): {
|
|
53
|
+
packs: Pack[];
|
|
54
|
+
nextToken: string | null;
|
|
55
|
+
isLoading: boolean;
|
|
56
|
+
refetch: () => Promise<unknown>;
|
|
57
|
+
};
|
|
58
|
+
declare function usePackDetail(packId: string | undefined): {
|
|
59
|
+
pack: Pack | null;
|
|
60
|
+
questions: QuestionObject[];
|
|
61
|
+
isLoading: boolean;
|
|
62
|
+
refetch: () => Promise<unknown>;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
declare function useContest(contestId: string | undefined, checkParticipation?: boolean): {
|
|
66
|
+
contest: Contest | null;
|
|
67
|
+
participation: CheckParticipationResponse | null;
|
|
68
|
+
isLoading: boolean;
|
|
69
|
+
refetch: () => Promise<unknown>;
|
|
70
|
+
};
|
|
71
|
+
declare function useContestsList({ level, nextToken }?: {
|
|
72
|
+
level?: string;
|
|
73
|
+
nextToken?: string;
|
|
74
|
+
}): {
|
|
75
|
+
contests: Contest[];
|
|
76
|
+
nextToken: string | null;
|
|
77
|
+
isLoading: boolean;
|
|
78
|
+
refetch: () => Promise<unknown>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare function useCourse(courseId: string | undefined): {
|
|
82
|
+
course: Course | null;
|
|
83
|
+
isLoading: boolean;
|
|
84
|
+
refetch: () => Promise<unknown>;
|
|
85
|
+
};
|
|
86
|
+
declare function useCourseItems(courseId: string | undefined): {
|
|
87
|
+
items: CourseItem[];
|
|
88
|
+
isLoading: boolean;
|
|
89
|
+
refetch: () => Promise<unknown>;
|
|
90
|
+
};
|
|
91
|
+
declare function useCourseLiveExams(courseId: string | undefined): {
|
|
92
|
+
exams: CourseLiveExam[];
|
|
93
|
+
isLoading: boolean;
|
|
94
|
+
refetch: () => Promise<unknown>;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare function useProgress(userId: string | undefined): {
|
|
98
|
+
subjectsProgress: UserSubjectProgress[];
|
|
99
|
+
chaptersProgress: UserChapterProgress[];
|
|
100
|
+
topicsProgress: UserTopicProgress[];
|
|
101
|
+
metrics: PracticeMetrics;
|
|
102
|
+
isLoading: boolean;
|
|
103
|
+
refetch: () => Promise<unknown>;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type PracticeMode = "setup" | "practice" | "summary";
|
|
107
|
+
interface UsePracticeProps {
|
|
108
|
+
subjectId?: string;
|
|
109
|
+
chapterIds?: string[];
|
|
110
|
+
topicIds?: string[];
|
|
111
|
+
language?: string;
|
|
112
|
+
difficulty?: string;
|
|
113
|
+
userId?: string;
|
|
114
|
+
isCreator?: boolean;
|
|
115
|
+
}
|
|
116
|
+
declare function usePractice({ subjectId, chapterIds, topicIds, language, difficulty, userId, isCreator, }?: UsePracticeProps): {
|
|
117
|
+
mode: PracticeMode;
|
|
118
|
+
questions: QuestionObject[];
|
|
119
|
+
currentIdx: number;
|
|
120
|
+
currentQuestion: QuestionObject | null;
|
|
121
|
+
selectedOption: string | null;
|
|
122
|
+
isAnswered: boolean;
|
|
123
|
+
isCorrect: boolean | null;
|
|
124
|
+
score: number;
|
|
125
|
+
totalPracticed: number;
|
|
126
|
+
accuracy: number;
|
|
127
|
+
isLoading: boolean;
|
|
128
|
+
isValidating: boolean;
|
|
129
|
+
startPractice: () => Promise<void>;
|
|
130
|
+
selectOption: (optionId: string) => Promise<void>;
|
|
131
|
+
nextQuestion: () => void;
|
|
132
|
+
finishPractice: () => void;
|
|
133
|
+
resetPractice: () => void;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { OrjokProvider, useContest, useContestsList, useCourse, useCourseItems, useCourseLiveExams, useCurriculum, useMediaUrl, useOrjokClient, usePackDetail, usePacks, usePractice, useProgress, useQuestions };
|