typing-genius-content 1.0.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.
@@ -0,0 +1,18 @@
1
+ {
2
+ "code": "kz",
3
+ "name": "Қазақша",
4
+ "nameEnglish": "Kazakh",
5
+ "keyboard": "kazakh",
6
+ "contributors": [],
7
+ "availableContent": {
8
+ "quotes": false,
9
+ "words": {
10
+ "easy": false,
11
+ "medium": false,
12
+ "hard": false,
13
+ "byLength": []
14
+ }
15
+ },
16
+ "status": "needs-contribution",
17
+ "note": "This language needs contributors! See CONTRIBUTING.md for how to add content."
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "code": "ru",
3
+ "name": "Русский",
4
+ "nameEnglish": "Russian",
5
+ "keyboard": "jcuken",
6
+ "contributors": [],
7
+ "availableContent": {
8
+ "quotes": false,
9
+ "words": {
10
+ "easy": false,
11
+ "medium": false,
12
+ "hard": false,
13
+ "byLength": []
14
+ }
15
+ },
16
+ "status": "needs-contribution",
17
+ "note": "This language needs contributors! See CONTRIBUTING.md for how to add content."
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "code": "uz",
3
+ "name": "O'zbek",
4
+ "nameEnglish": "Uzbek",
5
+ "keyboard": "uzbek",
6
+ "contributors": [],
7
+ "availableContent": {
8
+ "quotes": false,
9
+ "words": {
10
+ "easy": false,
11
+ "medium": false,
12
+ "hard": false,
13
+ "byLength": []
14
+ }
15
+ },
16
+ "status": "needs-contribution",
17
+ "note": "This language needs contributors! See CONTRIBUTING.md for how to add content."
18
+ }
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Typing Genius Content - Type Definitions
3
+ *
4
+ * Core types for typing test content structure.
5
+ * These types ensure consistency across all content contributions.
6
+ */
7
+ /**
8
+ * A quote for typing practice
9
+ */
10
+ interface Quote {
11
+ /** The quote text to type */
12
+ text: string;
13
+ /** Optional author of the quote */
14
+ author?: string;
15
+ /** Optional source (book, movie, etc.) */
16
+ source?: string;
17
+ }
18
+ /**
19
+ * A word list with metadata
20
+ */
21
+ interface WordList {
22
+ /** The language code (ISO 639-1) */
23
+ language: string;
24
+ /** Difficulty level */
25
+ difficulty?: Difficulty;
26
+ /** Category description */
27
+ category?: string;
28
+ /** Word length (for by-length lists) */
29
+ wordLength?: number;
30
+ /** The actual words */
31
+ words: string[];
32
+ }
33
+ /**
34
+ * Word difficulty levels
35
+ */
36
+ type Difficulty = 'easy' | 'medium' | 'hard';
37
+ /**
38
+ * Supported language codes
39
+ * Add new languages here as they become available
40
+ */
41
+ type SupportedLanguage = 'en' | 'kg' | 'ru' | 'kz' | 'uz';
42
+ /**
43
+ * Language metadata describing available content
44
+ */
45
+ interface LanguageMeta {
46
+ /** ISO 639-1 language code */
47
+ code: SupportedLanguage;
48
+ /** Language name in the native language */
49
+ name: string;
50
+ /** Language name in English */
51
+ nameEnglish: string;
52
+ /** Default keyboard layout identifier */
53
+ keyboard: string;
54
+ /** RTL (right-to-left) language */
55
+ rtl?: boolean;
56
+ /** Available content for this language */
57
+ availableContent: AvailableContent;
58
+ }
59
+ /**
60
+ * Describes what content is available for a language
61
+ */
62
+ interface AvailableContent {
63
+ /** Whether quotes are available */
64
+ quotes: boolean;
65
+ /** Word content availability */
66
+ words: {
67
+ easy: boolean;
68
+ medium: boolean;
69
+ hard: boolean;
70
+ /** Available word lengths for by-length word lists */
71
+ byLength: number[];
72
+ };
73
+ }
74
+ /**
75
+ * Global content metadata
76
+ */
77
+ interface GlobalMeta {
78
+ /** Package version */
79
+ version: string;
80
+ /** Last updated timestamp */
81
+ lastUpdated: string;
82
+ /** List of available languages */
83
+ languages: SupportedLanguage[];
84
+ }
85
+ /**
86
+ * Options for getting random content
87
+ */
88
+ interface RandomOptions {
89
+ /** Number of items to return */
90
+ count?: number;
91
+ /** Minimum length (for words or quotes) */
92
+ minLength?: number;
93
+ /** Maximum length (for words or quotes) */
94
+ maxLength?: number;
95
+ /** Exclude items (for avoiding repeats) */
96
+ exclude?: string[];
97
+ }
98
+ /**
99
+ * Options for filtering quotes
100
+ */
101
+ interface QuoteFilterOptions {
102
+ /** Minimum quote length in characters */
103
+ minLength?: number;
104
+ /** Maximum quote length in characters */
105
+ maxLength?: number;
106
+ /** Filter by author */
107
+ author?: string;
108
+ }
109
+ /**
110
+ * Options for filtering words
111
+ */
112
+ interface WordFilterOptions {
113
+ /** Minimum word length */
114
+ minLength?: number;
115
+ /** Maximum word length */
116
+ maxLength?: number;
117
+ /** Exact word length */
118
+ length?: number;
119
+ }
120
+
121
+ /**
122
+ * Language Registry
123
+ *
124
+ * Defines all supported languages and their metadata.
125
+ * To add a new language, add an entry here and create the content folder.
126
+ */
127
+
128
+ /**
129
+ * Registry of all supported languages with their metadata
130
+ */
131
+ declare const LANGUAGES: Record<SupportedLanguage, LanguageMeta>;
132
+ /**
133
+ * Get list of all supported language codes
134
+ */
135
+ declare function getSupportedLanguageCodes(): SupportedLanguage[];
136
+ /**
137
+ * Get metadata for a specific language
138
+ */
139
+ declare function getLanguageMeta(code: SupportedLanguage): LanguageMeta;
140
+ /**
141
+ * Get all language metadata
142
+ */
143
+ declare function getAllLanguages(): LanguageMeta[];
144
+ /**
145
+ * Check if a language code is supported
146
+ */
147
+ declare function isLanguageSupported(code: string): code is SupportedLanguage;
148
+ /**
149
+ * Get languages that have content available
150
+ */
151
+ declare function getLanguagesWithContent(): LanguageMeta[];
152
+
153
+ /**
154
+ * Content Loader
155
+ *
156
+ * Provides functions to load and access typing content.
157
+ * All content is loaded synchronously for simplicity.
158
+ */
159
+
160
+ /**
161
+ * Get all quotes for a language
162
+ */
163
+ declare function getQuotes(lang: SupportedLanguage): Quote[];
164
+ /**
165
+ * Get quotes filtered by options
166
+ */
167
+ declare function getFilteredQuotes(lang: SupportedLanguage, options?: QuoteFilterOptions): Quote[];
168
+ /**
169
+ * Get a random quote
170
+ */
171
+ declare function getRandomQuote(lang: SupportedLanguage): Quote | null;
172
+ /**
173
+ * Get multiple random quotes
174
+ */
175
+ declare function getRandomQuotes(lang: SupportedLanguage, options?: RandomOptions): Quote[];
176
+ /**
177
+ * Get all words for a language and difficulty
178
+ */
179
+ declare function getWords(lang: SupportedLanguage, difficulty: Difficulty): string[];
180
+ /**
181
+ * Get all words for a language (all difficulties combined)
182
+ */
183
+ declare function getAllWords(lang: SupportedLanguage): string[];
184
+ /**
185
+ * Get words by specific length
186
+ */
187
+ declare function getWordsByLength(lang: SupportedLanguage, length: number): string[];
188
+ /**
189
+ * Get words filtered by options
190
+ */
191
+ declare function getFilteredWords(lang: SupportedLanguage, difficulty: Difficulty, options?: WordFilterOptions): string[];
192
+ /**
193
+ * Get random words
194
+ */
195
+ declare function getRandomWords(lang: SupportedLanguage, difficulty: Difficulty, options?: RandomOptions): string[];
196
+
197
+ /**
198
+ * Get languages that have quotes available
199
+ */
200
+ declare function getLanguagesWithQuotes(): LanguageMeta[];
201
+ /**
202
+ * Get languages that have words available
203
+ */
204
+ declare function getLanguagesWithWords(): LanguageMeta[];
205
+ /**
206
+ * Get content statistics for a language
207
+ */
208
+ declare function getContentStats(lang: SupportedLanguage): {
209
+ quotes: number;
210
+ words: {
211
+ easy: number;
212
+ medium: number;
213
+ hard: number;
214
+ total: number;
215
+ };
216
+ byLength: {
217
+ length: number;
218
+ count: number;
219
+ }[];
220
+ };
221
+
222
+ export { type AvailableContent, type Difficulty, type GlobalMeta, LANGUAGES, type LanguageMeta, type Quote, type QuoteFilterOptions, type RandomOptions, type SupportedLanguage, type WordFilterOptions, type WordList, getAllLanguages, getAllWords, getContentStats, getFilteredQuotes, getFilteredWords, getLanguageMeta, getLanguagesWithContent, getLanguagesWithQuotes, getLanguagesWithWords, getQuotes, getRandomQuote, getRandomQuotes, getRandomWords, getSupportedLanguageCodes, getWords, getWordsByLength, isLanguageSupported };
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Typing Genius Content - Type Definitions
3
+ *
4
+ * Core types for typing test content structure.
5
+ * These types ensure consistency across all content contributions.
6
+ */
7
+ /**
8
+ * A quote for typing practice
9
+ */
10
+ interface Quote {
11
+ /** The quote text to type */
12
+ text: string;
13
+ /** Optional author of the quote */
14
+ author?: string;
15
+ /** Optional source (book, movie, etc.) */
16
+ source?: string;
17
+ }
18
+ /**
19
+ * A word list with metadata
20
+ */
21
+ interface WordList {
22
+ /** The language code (ISO 639-1) */
23
+ language: string;
24
+ /** Difficulty level */
25
+ difficulty?: Difficulty;
26
+ /** Category description */
27
+ category?: string;
28
+ /** Word length (for by-length lists) */
29
+ wordLength?: number;
30
+ /** The actual words */
31
+ words: string[];
32
+ }
33
+ /**
34
+ * Word difficulty levels
35
+ */
36
+ type Difficulty = 'easy' | 'medium' | 'hard';
37
+ /**
38
+ * Supported language codes
39
+ * Add new languages here as they become available
40
+ */
41
+ type SupportedLanguage = 'en' | 'kg' | 'ru' | 'kz' | 'uz';
42
+ /**
43
+ * Language metadata describing available content
44
+ */
45
+ interface LanguageMeta {
46
+ /** ISO 639-1 language code */
47
+ code: SupportedLanguage;
48
+ /** Language name in the native language */
49
+ name: string;
50
+ /** Language name in English */
51
+ nameEnglish: string;
52
+ /** Default keyboard layout identifier */
53
+ keyboard: string;
54
+ /** RTL (right-to-left) language */
55
+ rtl?: boolean;
56
+ /** Available content for this language */
57
+ availableContent: AvailableContent;
58
+ }
59
+ /**
60
+ * Describes what content is available for a language
61
+ */
62
+ interface AvailableContent {
63
+ /** Whether quotes are available */
64
+ quotes: boolean;
65
+ /** Word content availability */
66
+ words: {
67
+ easy: boolean;
68
+ medium: boolean;
69
+ hard: boolean;
70
+ /** Available word lengths for by-length word lists */
71
+ byLength: number[];
72
+ };
73
+ }
74
+ /**
75
+ * Global content metadata
76
+ */
77
+ interface GlobalMeta {
78
+ /** Package version */
79
+ version: string;
80
+ /** Last updated timestamp */
81
+ lastUpdated: string;
82
+ /** List of available languages */
83
+ languages: SupportedLanguage[];
84
+ }
85
+ /**
86
+ * Options for getting random content
87
+ */
88
+ interface RandomOptions {
89
+ /** Number of items to return */
90
+ count?: number;
91
+ /** Minimum length (for words or quotes) */
92
+ minLength?: number;
93
+ /** Maximum length (for words or quotes) */
94
+ maxLength?: number;
95
+ /** Exclude items (for avoiding repeats) */
96
+ exclude?: string[];
97
+ }
98
+ /**
99
+ * Options for filtering quotes
100
+ */
101
+ interface QuoteFilterOptions {
102
+ /** Minimum quote length in characters */
103
+ minLength?: number;
104
+ /** Maximum quote length in characters */
105
+ maxLength?: number;
106
+ /** Filter by author */
107
+ author?: string;
108
+ }
109
+ /**
110
+ * Options for filtering words
111
+ */
112
+ interface WordFilterOptions {
113
+ /** Minimum word length */
114
+ minLength?: number;
115
+ /** Maximum word length */
116
+ maxLength?: number;
117
+ /** Exact word length */
118
+ length?: number;
119
+ }
120
+
121
+ /**
122
+ * Language Registry
123
+ *
124
+ * Defines all supported languages and their metadata.
125
+ * To add a new language, add an entry here and create the content folder.
126
+ */
127
+
128
+ /**
129
+ * Registry of all supported languages with their metadata
130
+ */
131
+ declare const LANGUAGES: Record<SupportedLanguage, LanguageMeta>;
132
+ /**
133
+ * Get list of all supported language codes
134
+ */
135
+ declare function getSupportedLanguageCodes(): SupportedLanguage[];
136
+ /**
137
+ * Get metadata for a specific language
138
+ */
139
+ declare function getLanguageMeta(code: SupportedLanguage): LanguageMeta;
140
+ /**
141
+ * Get all language metadata
142
+ */
143
+ declare function getAllLanguages(): LanguageMeta[];
144
+ /**
145
+ * Check if a language code is supported
146
+ */
147
+ declare function isLanguageSupported(code: string): code is SupportedLanguage;
148
+ /**
149
+ * Get languages that have content available
150
+ */
151
+ declare function getLanguagesWithContent(): LanguageMeta[];
152
+
153
+ /**
154
+ * Content Loader
155
+ *
156
+ * Provides functions to load and access typing content.
157
+ * All content is loaded synchronously for simplicity.
158
+ */
159
+
160
+ /**
161
+ * Get all quotes for a language
162
+ */
163
+ declare function getQuotes(lang: SupportedLanguage): Quote[];
164
+ /**
165
+ * Get quotes filtered by options
166
+ */
167
+ declare function getFilteredQuotes(lang: SupportedLanguage, options?: QuoteFilterOptions): Quote[];
168
+ /**
169
+ * Get a random quote
170
+ */
171
+ declare function getRandomQuote(lang: SupportedLanguage): Quote | null;
172
+ /**
173
+ * Get multiple random quotes
174
+ */
175
+ declare function getRandomQuotes(lang: SupportedLanguage, options?: RandomOptions): Quote[];
176
+ /**
177
+ * Get all words for a language and difficulty
178
+ */
179
+ declare function getWords(lang: SupportedLanguage, difficulty: Difficulty): string[];
180
+ /**
181
+ * Get all words for a language (all difficulties combined)
182
+ */
183
+ declare function getAllWords(lang: SupportedLanguage): string[];
184
+ /**
185
+ * Get words by specific length
186
+ */
187
+ declare function getWordsByLength(lang: SupportedLanguage, length: number): string[];
188
+ /**
189
+ * Get words filtered by options
190
+ */
191
+ declare function getFilteredWords(lang: SupportedLanguage, difficulty: Difficulty, options?: WordFilterOptions): string[];
192
+ /**
193
+ * Get random words
194
+ */
195
+ declare function getRandomWords(lang: SupportedLanguage, difficulty: Difficulty, options?: RandomOptions): string[];
196
+
197
+ /**
198
+ * Get languages that have quotes available
199
+ */
200
+ declare function getLanguagesWithQuotes(): LanguageMeta[];
201
+ /**
202
+ * Get languages that have words available
203
+ */
204
+ declare function getLanguagesWithWords(): LanguageMeta[];
205
+ /**
206
+ * Get content statistics for a language
207
+ */
208
+ declare function getContentStats(lang: SupportedLanguage): {
209
+ quotes: number;
210
+ words: {
211
+ easy: number;
212
+ medium: number;
213
+ hard: number;
214
+ total: number;
215
+ };
216
+ byLength: {
217
+ length: number;
218
+ count: number;
219
+ }[];
220
+ };
221
+
222
+ export { type AvailableContent, type Difficulty, type GlobalMeta, LANGUAGES, type LanguageMeta, type Quote, type QuoteFilterOptions, type RandomOptions, type SupportedLanguage, type WordFilterOptions, type WordList, getAllLanguages, getAllWords, getContentStats, getFilteredQuotes, getFilteredWords, getLanguageMeta, getLanguagesWithContent, getLanguagesWithQuotes, getLanguagesWithWords, getQuotes, getRandomQuote, getRandomQuotes, getRandomWords, getSupportedLanguageCodes, getWords, getWordsByLength, isLanguageSupported };