Skip to content

Commit 197afa6

Browse files
authored
Merge pull request #21 from MarvNC/update-schemas
Update Types for Schemas
2 parents cb8b906 + ab12a4f commit 197afa6

File tree

3 files changed

+227
-5
lines changed

3 files changed

+227
-5
lines changed

src/types/IsoLanguageCode.ts

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
/**
2+
* ISO language code (ISO 639-1 where possible, ISO 639-3 otherwise).
3+
*/
4+
export type IsoLanguageCode =
5+
| 'aa'
6+
| 'ab'
7+
| 'ae'
8+
| 'af'
9+
| 'ak'
10+
| 'am'
11+
| 'an'
12+
| 'ar'
13+
| 'as'
14+
| 'av'
15+
| 'ay'
16+
| 'az'
17+
| 'az'
18+
| 'ba'
19+
| 'be'
20+
| 'bg'
21+
| 'bh'
22+
| 'bi'
23+
| 'bm'
24+
| 'bn'
25+
| 'bo'
26+
| 'br'
27+
| 'bs'
28+
| 'ca'
29+
| 'ce'
30+
| 'ch'
31+
| 'co'
32+
| 'cr'
33+
| 'cs'
34+
| 'cu'
35+
| 'cv'
36+
| 'cy'
37+
| 'da'
38+
| 'de'
39+
| 'dv'
40+
| 'dz'
41+
| 'ee'
42+
| 'el'
43+
| 'en'
44+
| 'eo'
45+
| 'es'
46+
| 'et'
47+
| 'eu'
48+
| 'fa'
49+
| 'ff'
50+
| 'fi'
51+
| 'fj'
52+
| 'fo'
53+
| 'fr'
54+
| 'fy'
55+
| 'ga'
56+
| 'gd'
57+
| 'gl'
58+
| 'gn'
59+
| 'grc'
60+
| 'gu'
61+
| 'gv'
62+
| 'ha'
63+
| 'he'
64+
| 'hi'
65+
| 'ho'
66+
| 'hr'
67+
| 'ht'
68+
| 'hu'
69+
| 'hy'
70+
| 'hz'
71+
| 'ia'
72+
| 'id'
73+
| 'ie'
74+
| 'ig'
75+
| 'ii'
76+
| 'ik'
77+
| 'io'
78+
| 'is'
79+
| 'it'
80+
| 'iu'
81+
| 'ja'
82+
| 'jv'
83+
| 'ka'
84+
| 'kg'
85+
| 'ki'
86+
| 'kj'
87+
| 'kk'
88+
| 'kl'
89+
| 'km'
90+
| 'kn'
91+
| 'ko'
92+
| 'kr'
93+
| 'ks'
94+
| 'ku'
95+
| 'kv'
96+
| 'kw'
97+
| 'ky'
98+
| 'la'
99+
| 'lb'
100+
| 'lg'
101+
| 'li'
102+
| 'ln'
103+
| 'lo'
104+
| 'lt'
105+
| 'lu'
106+
| 'lv'
107+
| 'mg'
108+
| 'mh'
109+
| 'mi'
110+
| 'mk'
111+
| 'ml'
112+
| 'mn'
113+
| 'mr'
114+
| 'ms'
115+
| 'mt'
116+
| 'my'
117+
| 'na'
118+
| 'nb'
119+
| 'nd'
120+
| 'ne'
121+
| 'ng'
122+
| 'nl'
123+
| 'nn'
124+
| 'no'
125+
| 'nr'
126+
| 'nv'
127+
| 'ny'
128+
| 'oc'
129+
| 'oj'
130+
| 'om'
131+
| 'or'
132+
| 'os'
133+
| 'pa'
134+
| 'pi'
135+
| 'pl'
136+
| 'ps'
137+
| 'pt'
138+
| 'qu'
139+
| 'rm'
140+
| 'rn'
141+
| 'ro'
142+
| 'ru'
143+
| 'rw'
144+
| 'sa'
145+
| 'sc'
146+
| 'sd'
147+
| 'se'
148+
| 'sg'
149+
| 'sh'
150+
| 'si'
151+
| 'sk'
152+
| 'sl'
153+
| 'sm'
154+
| 'sn'
155+
| 'so'
156+
| 'sq'
157+
| 'sr'
158+
| 'ss'
159+
| 'st'
160+
| 'su'
161+
| 'sv'
162+
| 'sw'
163+
| 'ta'
164+
| 'te'
165+
| 'tg'
166+
| 'th'
167+
| 'ti'
168+
| 'tk'
169+
| 'tl'
170+
| 'tn'
171+
| 'to'
172+
| 'tr'
173+
| 'ts'
174+
| 'tt'
175+
| 'tw'
176+
| 'ty'
177+
| 'ug'
178+
| 'uk'
179+
| 'ur'
180+
| 'uz'
181+
| 've'
182+
| 'vi'
183+
| 'vo'
184+
| 'wa'
185+
| 'wo'
186+
| 'xh'
187+
| 'yi'
188+
| 'yo'
189+
| 'za'
190+
| 'zh'
191+
| 'zu';

src/types/yomitan/dictionaryindex.ts

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,41 @@
1+
import { IsoLanguageCode } from '../IsoLanguageCode';
2+
3+
/**
4+
* Information about a single tag.
5+
*/
6+
type TagInfo = {
7+
category?: string;
8+
order?: number;
9+
notes?: string;
10+
score?: number;
11+
};
12+
13+
/**
14+
* Represents the structure of a dictionary index file.
15+
*/
116
type DictionaryIndexType = {
17+
/** Title of the dictionary. */
218
title: string;
19+
/** Revision of the dictionary. This value is only used for displaying information. */
320
revision: string;
21+
/** Whether or not this dictionary contains sequencing information for related terms. */
422
sequenced?: boolean;
23+
/** Format of data found in the JSON data files. */
524
format?: 1 | 2 | 3;
6-
author: string;
25+
/** Creator of the dictionary. */
26+
author?: string;
27+
/** URL for the source of the dictionary. */
728
url?: string;
8-
description: string;
9-
attribution: string;
29+
/** Description of the dictionary data. */
30+
description?: string;
31+
/** Attribution information for the dictionary data. */
32+
attribution?: string;
33+
/** Language of the terms in the dictionary. */
34+
sourceLanguage?: IsoLanguageCode;
35+
/** Main language of the definitions in the dictionary. */
36+
targetLanguage?: IsoLanguageCode;
37+
/** Frequency mode of the dictionary. */
1038
frequencyMode?: 'occurrence-based' | 'rank-based';
1139
};
1240

13-
export type { DictionaryIndexType };
41+
export type { DictionaryIndexType, IsoLanguageCode, TagInfo };

src/types/yomitan/termbank.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type StructuredContentStyle = {
3737
fontWeight?: 'normal' | 'bold';
3838
fontSize?: string;
3939
color?: string;
40+
background?: string;
4041
backgroundColor?: string;
4142
textDecorationLine?:
4243
| 'none'
@@ -50,6 +51,7 @@ type StructuredContentStyle = {
5051
borderStyle?: string;
5152
borderRadius?: string;
5253
borderWidth?: string;
54+
clipPath?: string;
5355
verticalAlign?:
5456
| 'baseline'
5557
| 'sub'
@@ -68,6 +70,7 @@ type StructuredContentStyle = {
6870
| 'justify'
6971
| 'justify-all'
7072
| 'match-parent';
73+
textEmphasis?: string;
7174
textShadow?: string;
7275
margin?: string;
7376
marginTop?: number | string;
@@ -108,7 +111,7 @@ type StructuredContentNode =
108111
lang?: string;
109112
}
110113
| {
111-
tag: 'span' | 'div' | 'ol' | 'ul' | 'li';
114+
tag: 'span' | 'div' | 'ol' | 'ul' | 'li' | 'details' | 'summary';
112115
content?: StructuredContentNode;
113116
data?: StructuredContentData;
114117
style?: StructuredContentStyle;

0 commit comments

Comments
 (0)