@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/index.d.cts CHANGED
@@ -1,8 +1,49 @@
1
- import { Q as QuestionType, a as QuestionObject, D as Difficulty, U as UserChapterProgress, b as UserSubjectProgress, c as UserTopicProgress } from './client-BaOC79Nc.cjs';
2
- export { A as AIService, d as AIUsageLog, e as AddQuestionTagInput, C as Chapter, f as CheckParticipationResponse, g as Contest, h as ContestAnswersResponse, i as ContestOption, j as ContestParticipant, k as ContestQuestion, l as ContestQuestionsResponse, m as ContestService, n as Course, o as CourseEnrolled, p as CourseEnrollmentRequest, q as CourseItem, r as CourseItemType, s as CourseLiveExam, t as CourseLiveExamParticipant, u as CourseLiveExamQuestionsResponse, v as CourseService, w as CreateContestInput, x as CreateCourseInput, y as CreateCourseItemInput, z as CreateCourseLiveExamInput, B as CreateCourseResponse, E as CreateCourseVideoInput, F as CreateCourseVideoResponse, G as CreatePackInput, H as CreateQuestionInput, I as CreateQuestionResponse, J as CurriculumService, K as DeleteCourseItemInput, L as EnrollStudentInput, M as EvaluateWrittenAnswerInput, N as EvaluateWrittenAnswerResponse, P as GetSignedFileURLInput, R as GetSignedURLInput, S as Language, T as LeaderboardResponse, V as Level, W as ListByCurriculumInput, X as ListByRandomHashInput, Y as MediaService, Z as ModelType, _ as NewsArticle, $ as NewsService, a0 as Option, O as OrjokClient, a1 as OrjokClientConfig, a2 as Pack, a3 as PackExamResults, a4 as PackGroup, a5 as PackReport, a6 as PackService, a7 as PackTag, a8 as PaginatedList, a9 as PaymentStatus, aa as PaymentTransaction, ab as ProgressService, ac as QuestionReport, ad as QuestionService, ae as QuestionTag, af as QuestionTracking, ag as QuestionTrackingStatus, ah as QuestionVote, ai as SendEnrollmentRequestInput, aj as SignedURLResponse, ak as SortDirection, al as StatusIdResponse, am as StatusResponse, an as Subject, ao as SubmitPackExamInput, ap as Tag, aq as Tier, ar as Topic, as as TrackPracticeProgressInput, at as UpdateUserAvatarInput, au as UploadImageResponse, av as UploadVideoToBunnyInput, aw as User, ax as UserService, ay as UserTopicMetric, az as Verification, aA as VerificationType, aB as VoteInput, aC as VoteType, aD as createOrjokClient } from './client-BaOC79Nc.cjs';
1
+ import { D as Difficulty, L as Language, i as Level, j as QuestionType, Q as QuestionObject } from './practice-QnWtC5A7.cjs';
2
+ export { A as AIService, k as AIUsageLog, l as AddQuestionTagInput, C as Chapter, b as CheckParticipationResponse, a as Contest, m as ContestAnswersResponse, n as ContestOption, o as ContestParticipant, p as ContestQuestion, q as ContestQuestionsResponse, r as ContestService, c as Course, s as CourseEnrolled, t as CourseEnrollmentRequest, d as CourseItem, u as CourseItemType, e as CourseLiveExam, v as CourseLiveExamParticipant, w as CourseLiveExamQuestionsResponse, x as CourseService, y as CreateContestInput, z as CreateCourseInput, B as CreateCourseItemInput, E as CreateCourseLiveExamInput, F as CreateCourseResponse, G as CreateCourseVideoInput, H as CreateCourseVideoResponse, I as CreatePackInput, J as CreateQuestionInput, K as CreateQuestionResponse, M as CurriculumService, N as DeleteCourseItemInput, R as EnrollStudentInput, V as EvaluateWrittenAnswerInput, W as EvaluateWrittenAnswerResponse, X as GetSignedFileURLInput, Y as GetSignedURLInput, Z as LeaderboardResponse, _ as ListByCurriculumInput, $ as ListByRandomHashInput, a0 as MediaService, a1 as ModelType, a2 as NewsArticle, a3 as NewsService, a4 as Option, O as OrjokClient, a5 as OrjokClientConfig, P as Pack, a6 as PackExamResults, a7 as PackGroup, a8 as PackReport, a9 as PackService, aa as PackTag, ab as PaginatedList, ac as PaymentStatus, ad as PaymentTransaction, h as PracticeMetrics, ae as ProgressService, af as QuestionReport, ag as QuestionService, ah as QuestionTag, ai as QuestionTracking, aj as QuestionTrackingStatus, ak as QuestionVote, al as SendEnrollmentRequestInput, am as SignedURLResponse, an as SortDirection, ao as StatusIdResponse, ap as StatusResponse, S as Subject, aq as SubmitPackExamInput, ar as Tag, as as Tier, T as Topic, at as TrackPracticeProgressInput, au as UpdateUserAvatarInput, av as UploadImageResponse, aw as UploadVideoToBunnyInput, ax as User, f as UserChapterProgress, ay as UserService, U as UserSubjectProgress, az as UserTopicMetric, g as UserTopicProgress, aA as Verification, aB as VerificationType, aC as VoteInput, aD as VoteType, aE as aggregateChapterMetrics, aF as aggregateSubjectMetrics, aG as aggregateTopicMetrics, aH as calculateAccuracy, aI as createOrjokClient, aJ as isDifficultyMatch, aK as isLanguageMatch, aL as isValidMCQ } from './practice-QnWtC5A7.cjs';
3
3
  import { S as StorageProvider } from './storage-DLqdJgQt.cjs';
4
4
  export { A as AuthProvider, a as AuthSession, G as GraphQLResult, N as NetworkProvider, b as UploadOptions, U as UserAttributes } from './storage-DLqdJgQt.cjs';
5
5
 
6
+ type RenderCategory = "Background" | "Hair Back" | "Skin Color Body" | "Skin Color Head" | "Skin Color" | "Clothes Back" | "Clothes Front" | "Accessories" | "Headwears" | "Facial Expression" | "Beard" | "Eyewear" | "Hair Front";
7
+ type UICategory = "Background" | "Hair" | "Skin Color" | "Clothes" | "Accessories" | "Headwears" | "Eyewear" | "Facial Expression" | "Beard";
8
+ interface ColorOption {
9
+ name: string;
10
+ filter: string;
11
+ hex: string;
12
+ brightness: number;
13
+ }
14
+ interface AvatarConfigItem {
15
+ raw_name: string;
16
+ safe_name: string;
17
+ base_name: string;
18
+ conditions: string[];
19
+ is_multicolor: boolean;
20
+ has_inner_color?: boolean;
21
+ brightness?: number;
22
+ hue?: number;
23
+ }
24
+ type AvatarConfig = Record<string, AvatarConfigItem[]>;
25
+ interface AvatarState {
26
+ selections: Record<string, string>;
27
+ colors: Record<string, string>;
28
+ }
29
+
30
+ interface SelectOption<T = string> {
31
+ value: T;
32
+ label: string;
33
+ }
34
+ declare const levelOptions: SelectOption<Level>[];
35
+ declare const languageOptions: SelectOption<Language>[];
36
+ declare const difficultyOptions: SelectOption<Difficulty>[];
37
+
38
+ declare const HAIR_COLORS: ColorOption[];
39
+ declare const CLOTHES_COLORS: ColorOption[];
40
+ declare const COLOR_HUES: Record<string, number>;
41
+ declare const RENDER_ORDER: readonly ["Background", "Hair Back", "Clothes Back", "Skin Color Body", "Clothes Front", "Skin Color Head", "Accessories", "Facial Expression", "Beard", "Hair Front", "Eyewear", "Headwears"];
42
+ declare const INITIAL_AVATAR_DATA: Record<UICategory, string[]>;
43
+ declare function getActualOptionFileName(category: string, baseName: string, config: AvatarConfig, selections: Record<string, string>): AvatarConfigItem | null;
44
+ declare function parseAvatarConfig(configStr: string | null | undefined): AvatarState;
45
+ declare function serializeAvatarConfig(state: AvatarState): string;
46
+
6
47
  interface EloTier {
7
48
  name: string;
8
49
  minRating: number;
@@ -35,6 +76,15 @@ declare function parseImageKeys(answer: string): string[];
35
76
  declare function buildImageAnswer(keys: string[]): string;
36
77
  declare function normalizeDifficulty(raw: string): Difficulty | undefined;
37
78
  declare function detectQuestionType(option2: string, option3: string, option4: string): QuestionType;
79
+ declare function isCorrectAnswer(selected: string | null | undefined, correct: string | null | undefined): boolean;
80
+ declare function calculateDefaultExamMinutes(mode: ExamMode, questions: Array<{
81
+ type?: string | null;
82
+ }>): number;
83
+ declare function reorderObjectKeys<T>(obj: {
84
+ [key: number]: T;
85
+ }, oldIndex: number, newIndex: number, length: number): {
86
+ [key: number]: T;
87
+ };
38
88
 
39
89
  interface ParsedQuestion {
40
90
  id?: string;
@@ -80,26 +130,48 @@ declare function resolveMediaUrl(value: string | null | undefined, storage: Stor
80
130
  declare function resolveMediaUrls<T extends Record<string, unknown>>(obj: T, fields: (keyof T)[], storage: StorageProvider | undefined, cache?: MediaUrlCache): Promise<T>;
81
131
  declare function _resetMediaUrlWarning(): void;
82
132
 
83
- interface PracticeMetrics {
84
- totalPracticed: number;
85
- totalMistakes: number;
86
- totalCorrected: number;
87
- accuracy: number;
88
- }
89
- declare function aggregateSubjectMetrics(progress: UserSubjectProgress[]): PracticeMetrics;
90
- declare function aggregateChapterMetrics(progress: UserChapterProgress[]): PracticeMetrics;
91
- declare function aggregateTopicMetrics(progress: UserTopicProgress[]): PracticeMetrics;
92
- declare function calculateAccuracy(practiced: number, mistakes: number): number;
133
+ type PrimaryTab = "home" | "learn" | "contests" | "courses" | "profile";
134
+ declare function getActiveTab(pathname: string): PrimaryTab;
135
+ declare function getCanonicalPath(pathname: string): string;
136
+ declare function isAuthGatedRoute(pathname: string): boolean;
93
137
 
94
138
  declare function shuffle<T>(array: T[]): T[];
95
139
  declare function shuffleInPlace<T>(array: T[]): void;
96
140
 
97
141
  declare function engToBanglaNumber(num: number | string): string;
98
142
 
99
- declare function formatCurriculumName(idString: string, dbName?: string | null): string;
143
+ /**
144
+ * Splits a bilingual string formatted as "Bangla Name (English Name)"
145
+ * into the requested language ("bn" or "en").
146
+ * If the string does not follow the bilingual pattern, returns the clean string.
147
+ */
148
+ declare function extractBilingualName(name: string, language?: "bn" | "en" | string): string;
149
+ declare function formatCurriculumName(idString: string, dbName?: string | null, language?: "bn" | "en" | string): string;
100
150
 
101
151
  declare function getRelativeTime(startTime: string | Date, endTime?: string | Date): string;
102
152
 
103
153
  declare function processLatexText(str: string): string;
104
154
 
105
- export { Difficulty, type EloTier, type ExamConfig, type ExamMode, MediaUrlCache, type ParseResult, type ParsedQuestion, type PracticeMetrics, QuestionObject, QuestionType, type RatingField, StorageProvider, UserChapterProgress, UserSubjectProgress, UserTopicProgress, _resetMediaUrlWarning, aggregateChapterMetrics, aggregateSubjectMetrics, aggregateTopicMetrics, buildImageAnswer, calculateAccuracy, calculateExamTime, computeRatingDelta, detectQuestionType, engToBanglaNumber, filterQuestionsByMode, formatCurriculumName, formatExamTime, formatQuestionsToCsv, formatQuestionsToText, getAllTiers, getEloProgress, getEloTier, getRatingForSubject, getRelativeTime, isImageAnswer, isStorageKey, normalizeDifficulty, parseCsvQuestions, parseImageKeys, parseTextQuestions, processLatexText, resolveMediaUrl, resolveMediaUrls, scoreExam, shuffle, shuffleInPlace };
155
+ interface TimeLeft {
156
+ days: number;
157
+ hours: number;
158
+ minutes: number;
159
+ seconds: number;
160
+ isEnded: boolean;
161
+ }
162
+ declare function convertToBangladeshTime(isoString: string): string;
163
+ declare function getDhakaNow(): Date;
164
+ declare function calculateTimeLeft(endTime: string | Date): TimeLeft;
165
+ declare function formatDate(date: Date | string, locale?: string): string;
166
+
167
+ declare function formatBDT(amount: number): string;
168
+
169
+ declare function getYouTubeId(url: string | null | undefined): string | null;
170
+
171
+ declare function sanitizeFileName(name: string): string;
172
+
173
+ declare function isQuestionLevel(value: unknown): value is Level;
174
+ declare function isLanguage(value: unknown): value is Language;
175
+ declare function isDifficulty(value: unknown): value is Difficulty;
176
+
177
+ export { type AvatarConfig, type AvatarConfigItem, type AvatarState, CLOTHES_COLORS, COLOR_HUES, type ColorOption, Difficulty, type EloTier, type ExamConfig, type ExamMode, HAIR_COLORS, INITIAL_AVATAR_DATA, Language, Level, MediaUrlCache, type ParseResult, type ParsedQuestion, type PrimaryTab, QuestionObject, QuestionType, RENDER_ORDER, type RatingField, type RenderCategory, type SelectOption, StorageProvider, type TimeLeft, type UICategory, _resetMediaUrlWarning, buildImageAnswer, calculateDefaultExamMinutes, calculateExamTime, calculateTimeLeft, computeRatingDelta, convertToBangladeshTime, detectQuestionType, difficultyOptions, engToBanglaNumber, extractBilingualName, filterQuestionsByMode, formatBDT, formatCurriculumName, formatDate, formatExamTime, formatQuestionsToCsv, formatQuestionsToText, getActiveTab, getActualOptionFileName, getAllTiers, getCanonicalPath, getDhakaNow, getEloProgress, getEloTier, getRatingForSubject, getRelativeTime, getYouTubeId, isAuthGatedRoute, isCorrectAnswer, isDifficulty, isImageAnswer, isLanguage, isQuestionLevel, isStorageKey, languageOptions, levelOptions, normalizeDifficulty, parseAvatarConfig, parseCsvQuestions, parseImageKeys, parseTextQuestions, processLatexText, reorderObjectKeys, resolveMediaUrl, resolveMediaUrls, sanitizeFileName, scoreExam, serializeAvatarConfig, shuffle, shuffleInPlace };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,49 @@
1
- import { Q as QuestionType, a as QuestionObject, D as Difficulty, U as UserChapterProgress, b as UserSubjectProgress, c as UserTopicProgress } from './client-Bm9aiyTx.js';
2
- export { A as AIService, d as AIUsageLog, e as AddQuestionTagInput, C as Chapter, f as CheckParticipationResponse, g as Contest, h as ContestAnswersResponse, i as ContestOption, j as ContestParticipant, k as ContestQuestion, l as ContestQuestionsResponse, m as ContestService, n as Course, o as CourseEnrolled, p as CourseEnrollmentRequest, q as CourseItem, r as CourseItemType, s as CourseLiveExam, t as CourseLiveExamParticipant, u as CourseLiveExamQuestionsResponse, v as CourseService, w as CreateContestInput, x as CreateCourseInput, y as CreateCourseItemInput, z as CreateCourseLiveExamInput, B as CreateCourseResponse, E as CreateCourseVideoInput, F as CreateCourseVideoResponse, G as CreatePackInput, H as CreateQuestionInput, I as CreateQuestionResponse, J as CurriculumService, K as DeleteCourseItemInput, L as EnrollStudentInput, M as EvaluateWrittenAnswerInput, N as EvaluateWrittenAnswerResponse, P as GetSignedFileURLInput, R as GetSignedURLInput, S as Language, T as LeaderboardResponse, V as Level, W as ListByCurriculumInput, X as ListByRandomHashInput, Y as MediaService, Z as ModelType, _ as NewsArticle, $ as NewsService, a0 as Option, O as OrjokClient, a1 as OrjokClientConfig, a2 as Pack, a3 as PackExamResults, a4 as PackGroup, a5 as PackReport, a6 as PackService, a7 as PackTag, a8 as PaginatedList, a9 as PaymentStatus, aa as PaymentTransaction, ab as ProgressService, ac as QuestionReport, ad as QuestionService, ae as QuestionTag, af as QuestionTracking, ag as QuestionTrackingStatus, ah as QuestionVote, ai as SendEnrollmentRequestInput, aj as SignedURLResponse, ak as SortDirection, al as StatusIdResponse, am as StatusResponse, an as Subject, ao as SubmitPackExamInput, ap as Tag, aq as Tier, ar as Topic, as as TrackPracticeProgressInput, at as UpdateUserAvatarInput, au as UploadImageResponse, av as UploadVideoToBunnyInput, aw as User, ax as UserService, ay as UserTopicMetric, az as Verification, aA as VerificationType, aB as VoteInput, aC as VoteType, aD as createOrjokClient } from './client-Bm9aiyTx.js';
1
+ import { D as Difficulty, L as Language, i as Level, j as QuestionType, Q as QuestionObject } from './practice-Dh2Tv80G.js';
2
+ export { A as AIService, k as AIUsageLog, l as AddQuestionTagInput, C as Chapter, b as CheckParticipationResponse, a as Contest, m as ContestAnswersResponse, n as ContestOption, o as ContestParticipant, p as ContestQuestion, q as ContestQuestionsResponse, r as ContestService, c as Course, s as CourseEnrolled, t as CourseEnrollmentRequest, d as CourseItem, u as CourseItemType, e as CourseLiveExam, v as CourseLiveExamParticipant, w as CourseLiveExamQuestionsResponse, x as CourseService, y as CreateContestInput, z as CreateCourseInput, B as CreateCourseItemInput, E as CreateCourseLiveExamInput, F as CreateCourseResponse, G as CreateCourseVideoInput, H as CreateCourseVideoResponse, I as CreatePackInput, J as CreateQuestionInput, K as CreateQuestionResponse, M as CurriculumService, N as DeleteCourseItemInput, R as EnrollStudentInput, V as EvaluateWrittenAnswerInput, W as EvaluateWrittenAnswerResponse, X as GetSignedFileURLInput, Y as GetSignedURLInput, Z as LeaderboardResponse, _ as ListByCurriculumInput, $ as ListByRandomHashInput, a0 as MediaService, a1 as ModelType, a2 as NewsArticle, a3 as NewsService, a4 as Option, O as OrjokClient, a5 as OrjokClientConfig, P as Pack, a6 as PackExamResults, a7 as PackGroup, a8 as PackReport, a9 as PackService, aa as PackTag, ab as PaginatedList, ac as PaymentStatus, ad as PaymentTransaction, h as PracticeMetrics, ae as ProgressService, af as QuestionReport, ag as QuestionService, ah as QuestionTag, ai as QuestionTracking, aj as QuestionTrackingStatus, ak as QuestionVote, al as SendEnrollmentRequestInput, am as SignedURLResponse, an as SortDirection, ao as StatusIdResponse, ap as StatusResponse, S as Subject, aq as SubmitPackExamInput, ar as Tag, as as Tier, T as Topic, at as TrackPracticeProgressInput, au as UpdateUserAvatarInput, av as UploadImageResponse, aw as UploadVideoToBunnyInput, ax as User, f as UserChapterProgress, ay as UserService, U as UserSubjectProgress, az as UserTopicMetric, g as UserTopicProgress, aA as Verification, aB as VerificationType, aC as VoteInput, aD as VoteType, aE as aggregateChapterMetrics, aF as aggregateSubjectMetrics, aG as aggregateTopicMetrics, aH as calculateAccuracy, aI as createOrjokClient, aJ as isDifficultyMatch, aK as isLanguageMatch, aL as isValidMCQ } from './practice-Dh2Tv80G.js';
3
3
  import { S as StorageProvider } from './storage-DLqdJgQt.js';
4
4
  export { A as AuthProvider, a as AuthSession, G as GraphQLResult, N as NetworkProvider, b as UploadOptions, U as UserAttributes } from './storage-DLqdJgQt.js';
5
5
 
6
+ type RenderCategory = "Background" | "Hair Back" | "Skin Color Body" | "Skin Color Head" | "Skin Color" | "Clothes Back" | "Clothes Front" | "Accessories" | "Headwears" | "Facial Expression" | "Beard" | "Eyewear" | "Hair Front";
7
+ type UICategory = "Background" | "Hair" | "Skin Color" | "Clothes" | "Accessories" | "Headwears" | "Eyewear" | "Facial Expression" | "Beard";
8
+ interface ColorOption {
9
+ name: string;
10
+ filter: string;
11
+ hex: string;
12
+ brightness: number;
13
+ }
14
+ interface AvatarConfigItem {
15
+ raw_name: string;
16
+ safe_name: string;
17
+ base_name: string;
18
+ conditions: string[];
19
+ is_multicolor: boolean;
20
+ has_inner_color?: boolean;
21
+ brightness?: number;
22
+ hue?: number;
23
+ }
24
+ type AvatarConfig = Record<string, AvatarConfigItem[]>;
25
+ interface AvatarState {
26
+ selections: Record<string, string>;
27
+ colors: Record<string, string>;
28
+ }
29
+
30
+ interface SelectOption<T = string> {
31
+ value: T;
32
+ label: string;
33
+ }
34
+ declare const levelOptions: SelectOption<Level>[];
35
+ declare const languageOptions: SelectOption<Language>[];
36
+ declare const difficultyOptions: SelectOption<Difficulty>[];
37
+
38
+ declare const HAIR_COLORS: ColorOption[];
39
+ declare const CLOTHES_COLORS: ColorOption[];
40
+ declare const COLOR_HUES: Record<string, number>;
41
+ declare const RENDER_ORDER: readonly ["Background", "Hair Back", "Clothes Back", "Skin Color Body", "Clothes Front", "Skin Color Head", "Accessories", "Facial Expression", "Beard", "Hair Front", "Eyewear", "Headwears"];
42
+ declare const INITIAL_AVATAR_DATA: Record<UICategory, string[]>;
43
+ declare function getActualOptionFileName(category: string, baseName: string, config: AvatarConfig, selections: Record<string, string>): AvatarConfigItem | null;
44
+ declare function parseAvatarConfig(configStr: string | null | undefined): AvatarState;
45
+ declare function serializeAvatarConfig(state: AvatarState): string;
46
+
6
47
  interface EloTier {
7
48
  name: string;
8
49
  minRating: number;
@@ -35,6 +76,15 @@ declare function parseImageKeys(answer: string): string[];
35
76
  declare function buildImageAnswer(keys: string[]): string;
36
77
  declare function normalizeDifficulty(raw: string): Difficulty | undefined;
37
78
  declare function detectQuestionType(option2: string, option3: string, option4: string): QuestionType;
79
+ declare function isCorrectAnswer(selected: string | null | undefined, correct: string | null | undefined): boolean;
80
+ declare function calculateDefaultExamMinutes(mode: ExamMode, questions: Array<{
81
+ type?: string | null;
82
+ }>): number;
83
+ declare function reorderObjectKeys<T>(obj: {
84
+ [key: number]: T;
85
+ }, oldIndex: number, newIndex: number, length: number): {
86
+ [key: number]: T;
87
+ };
38
88
 
39
89
  interface ParsedQuestion {
40
90
  id?: string;
@@ -80,26 +130,48 @@ declare function resolveMediaUrl(value: string | null | undefined, storage: Stor
80
130
  declare function resolveMediaUrls<T extends Record<string, unknown>>(obj: T, fields: (keyof T)[], storage: StorageProvider | undefined, cache?: MediaUrlCache): Promise<T>;
81
131
  declare function _resetMediaUrlWarning(): void;
82
132
 
83
- interface PracticeMetrics {
84
- totalPracticed: number;
85
- totalMistakes: number;
86
- totalCorrected: number;
87
- accuracy: number;
88
- }
89
- declare function aggregateSubjectMetrics(progress: UserSubjectProgress[]): PracticeMetrics;
90
- declare function aggregateChapterMetrics(progress: UserChapterProgress[]): PracticeMetrics;
91
- declare function aggregateTopicMetrics(progress: UserTopicProgress[]): PracticeMetrics;
92
- declare function calculateAccuracy(practiced: number, mistakes: number): number;
133
+ type PrimaryTab = "home" | "learn" | "contests" | "courses" | "profile";
134
+ declare function getActiveTab(pathname: string): PrimaryTab;
135
+ declare function getCanonicalPath(pathname: string): string;
136
+ declare function isAuthGatedRoute(pathname: string): boolean;
93
137
 
94
138
  declare function shuffle<T>(array: T[]): T[];
95
139
  declare function shuffleInPlace<T>(array: T[]): void;
96
140
 
97
141
  declare function engToBanglaNumber(num: number | string): string;
98
142
 
99
- declare function formatCurriculumName(idString: string, dbName?: string | null): string;
143
+ /**
144
+ * Splits a bilingual string formatted as "Bangla Name (English Name)"
145
+ * into the requested language ("bn" or "en").
146
+ * If the string does not follow the bilingual pattern, returns the clean string.
147
+ */
148
+ declare function extractBilingualName(name: string, language?: "bn" | "en" | string): string;
149
+ declare function formatCurriculumName(idString: string, dbName?: string | null, language?: "bn" | "en" | string): string;
100
150
 
101
151
  declare function getRelativeTime(startTime: string | Date, endTime?: string | Date): string;
102
152
 
103
153
  declare function processLatexText(str: string): string;
104
154
 
105
- export { Difficulty, type EloTier, type ExamConfig, type ExamMode, MediaUrlCache, type ParseResult, type ParsedQuestion, type PracticeMetrics, QuestionObject, QuestionType, type RatingField, StorageProvider, UserChapterProgress, UserSubjectProgress, UserTopicProgress, _resetMediaUrlWarning, aggregateChapterMetrics, aggregateSubjectMetrics, aggregateTopicMetrics, buildImageAnswer, calculateAccuracy, calculateExamTime, computeRatingDelta, detectQuestionType, engToBanglaNumber, filterQuestionsByMode, formatCurriculumName, formatExamTime, formatQuestionsToCsv, formatQuestionsToText, getAllTiers, getEloProgress, getEloTier, getRatingForSubject, getRelativeTime, isImageAnswer, isStorageKey, normalizeDifficulty, parseCsvQuestions, parseImageKeys, parseTextQuestions, processLatexText, resolveMediaUrl, resolveMediaUrls, scoreExam, shuffle, shuffleInPlace };
155
+ interface TimeLeft {
156
+ days: number;
157
+ hours: number;
158
+ minutes: number;
159
+ seconds: number;
160
+ isEnded: boolean;
161
+ }
162
+ declare function convertToBangladeshTime(isoString: string): string;
163
+ declare function getDhakaNow(): Date;
164
+ declare function calculateTimeLeft(endTime: string | Date): TimeLeft;
165
+ declare function formatDate(date: Date | string, locale?: string): string;
166
+
167
+ declare function formatBDT(amount: number): string;
168
+
169
+ declare function getYouTubeId(url: string | null | undefined): string | null;
170
+
171
+ declare function sanitizeFileName(name: string): string;
172
+
173
+ declare function isQuestionLevel(value: unknown): value is Level;
174
+ declare function isLanguage(value: unknown): value is Language;
175
+ declare function isDifficulty(value: unknown): value is Difficulty;
176
+
177
+ export { type AvatarConfig, type AvatarConfigItem, type AvatarState, CLOTHES_COLORS, COLOR_HUES, type ColorOption, Difficulty, type EloTier, type ExamConfig, type ExamMode, HAIR_COLORS, INITIAL_AVATAR_DATA, Language, Level, MediaUrlCache, type ParseResult, type ParsedQuestion, type PrimaryTab, QuestionObject, QuestionType, RENDER_ORDER, type RatingField, type RenderCategory, type SelectOption, StorageProvider, type TimeLeft, type UICategory, _resetMediaUrlWarning, buildImageAnswer, calculateDefaultExamMinutes, calculateExamTime, calculateTimeLeft, computeRatingDelta, convertToBangladeshTime, detectQuestionType, difficultyOptions, engToBanglaNumber, extractBilingualName, filterQuestionsByMode, formatBDT, formatCurriculumName, formatDate, formatExamTime, formatQuestionsToCsv, formatQuestionsToText, getActiveTab, getActualOptionFileName, getAllTiers, getCanonicalPath, getDhakaNow, getEloProgress, getEloTier, getRatingForSubject, getRelativeTime, getYouTubeId, isAuthGatedRoute, isCorrectAnswer, isDifficulty, isImageAnswer, isLanguage, isQuestionLevel, isStorageKey, languageOptions, levelOptions, normalizeDifficulty, parseAvatarConfig, parseCsvQuestions, parseImageKeys, parseTextQuestions, processLatexText, reorderObjectKeys, resolveMediaUrl, resolveMediaUrls, sanitizeFileName, scoreExam, serializeAvatarConfig, shuffle, shuffleInPlace };