@xcpcio/types 0.64.5 → 0.65.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
@@ -6,6 +6,7 @@
6
6
  * '2019-01-01T00:00:00.000Z'
7
7
  */
8
8
  type DateTimeISO8601String = string;
9
+ type Lang = "en" | "zh-CN";
9
10
  /**
10
11
  * Color HEX.
11
12
  * @example
@@ -49,13 +50,22 @@ interface BalloonColor {
49
50
  /**
50
51
  * i18n string set.
51
52
  * @example
52
- * { "en-US": 'English', "zh-CN": '中文', fallback: 'English' }
53
+ * { "en": 'English', "zh-CN": '中文', fallback: 'English' }
54
+ * { "en": 'English', "zh-CN": '中文', fallback_lang: 'en' }
53
55
  */
54
56
  interface I18NStringSet {
55
- /** The fallback string if renderer cannot determine the language to use. */
56
- fallback: string;
57
- /** The key is the IETF BCP 47 language tag, and the value is the string for this language tag. */
58
- [key: string]: string;
57
+ /**
58
+ * The fallback string if renderer cannot determine the language to use.
59
+ */
60
+ fallback?: string;
61
+ /**
62
+ * The fallback language to use if the requested language is not available.
63
+ */
64
+ fallback_lang?: Lang;
65
+ /**
66
+ * Language-specific text mappings.
67
+ */
68
+ texts?: Partial<Record<Lang, string>>;
59
69
  }
60
70
  /**
61
71
  * Text (i18n supported).
@@ -79,7 +89,6 @@ interface Image {
79
89
  base64?: Base64;
80
90
  type?: "png" | "svg" | "jpg" | "jpeg";
81
91
  preset?: ImagePreset;
82
- [key: string]: string | undefined;
83
92
  }
84
93
  interface StatusTimeDisplay {
85
94
  correct: boolean;
@@ -91,7 +100,7 @@ type TimeUnit = "second" | "millisecond" | "microsecond" | "nanosecond";
91
100
  interface Problem {
92
101
  id: string;
93
102
  label: string;
94
- name?: string;
103
+ name?: Text;
95
104
  time_limit?: string;
96
105
  memory_limit?: string;
97
106
  balloon_color?: BalloonColor;
@@ -116,7 +125,7 @@ interface ContestOptions {
116
125
  type MedalPreset = "ccpc" | "icpc";
117
126
  type BannerMode = "ONLY_BANNER" | "ALL";
118
127
  interface Contest {
119
- contest_name: string;
128
+ contest_name: Text;
120
129
  start_time: number | DateTimeISO8601String;
121
130
  end_time: number | DateTimeISO8601String;
122
131
  penalty: number;
@@ -124,11 +133,11 @@ interface Contest {
124
133
  frozen_time?: number;
125
134
  problems?: Array<Problem>;
126
135
  problem_id?: Array<string>;
127
- organization?: string;
128
- status_time_display?: Record<string, boolean>;
136
+ balloon_color?: Array<BalloonColor>;
137
+ status_time_display?: StatusTimeDisplay;
129
138
  badge?: string;
139
+ organization?: string;
130
140
  medal?: Record<string, Record<string, number>> | MedalPreset;
131
- balloon_color?: Array<BalloonColor>;
132
141
  group?: Record<string, string>;
133
142
  tag?: Record<string, string>;
134
143
  logo?: Image;
@@ -140,7 +149,7 @@ interface Contest {
140
149
  }
141
150
 
142
151
  interface ContestIndexConfig {
143
- contest_name: string;
152
+ contest_name: Text;
144
153
  start_time: number;
145
154
  end_time: number;
146
155
  frozen_time: number;
@@ -151,12 +160,12 @@ interface ContestIndex {
151
160
  board_link: string;
152
161
  }
153
162
 
154
- type Lang = "en" | "zh-CN";
155
-
156
- interface IPerson {
157
- name: string;
163
+ interface Person {
164
+ name: Text;
165
+ cf_id?: string;
166
+ icpc_id?: string;
158
167
  }
159
- type IPersons = Array<IPerson>;
168
+ type Persons = Array<Person>;
160
169
 
161
170
  interface IRatingIndex {
162
171
  id: string;
@@ -165,21 +174,21 @@ interface IRatingIndex {
165
174
  interface IRatingHistory {
166
175
  rank: number;
167
176
  rating: number;
168
- teamName: string;
177
+ teamName: Text;
169
178
  organization: string;
170
- members: IPersons;
171
- coaches: IPersons;
179
+ members: Persons;
180
+ coaches: Persons;
172
181
  contestID: string;
173
- contestName: string;
182
+ contestName: Text;
174
183
  contestLink: string;
175
184
  contestTime: Date;
176
185
  }
177
186
  interface IRatingUser {
178
187
  id: string;
179
- name: string;
188
+ name: Text;
180
189
  organization: string;
181
- members: IPersons;
182
- coaches: IPersons;
190
+ members: Persons;
191
+ coaches: Persons;
183
192
  rating: number;
184
193
  minRating: number;
185
194
  maxRating: number;
@@ -187,7 +196,7 @@ interface IRatingUser {
187
196
  }
188
197
  interface IRating {
189
198
  id: string;
190
- name: string;
199
+ name: Text;
191
200
  baseRating: number;
192
201
  contestIDs: string[];
193
202
  users: IRatingUser[];
@@ -253,13 +262,14 @@ type Submissions = Array<Submission> | Record<string, Submission>;
253
262
  interface Team {
254
263
  id?: string;
255
264
  team_id?: string;
256
- name?: string;
257
- team_name?: string;
265
+ name?: Text;
266
+ team_name?: Text;
258
267
  organization?: string;
259
268
  group?: Array<string>;
260
269
  tag?: Array<string>;
261
- coach?: string | Array<string>;
262
- members?: string | Array<string>;
270
+ coach?: Text | Array<Text> | Persons;
271
+ coaches?: Text | Array<Text> | Persons;
272
+ members?: Text | Array<Text> | Persons;
263
273
  official?: boolean;
264
274
  unofficial?: boolean;
265
275
  girl?: boolean;
@@ -270,4 +280,4 @@ interface Team {
270
280
  type Teams = Array<Team> | Record<string, Team>;
271
281
 
272
282
  export { ContestState, SubmissionStatus, SubmissionStatusToSimpleString, SubmissionStatusToString };
273
- export type { BalloonColor, BannerMode, Base64, CalculationOfPenalty, Color, ColorHEX, ColorRGB, ColorRGBA, Contest, ContestIndex, ContestIndexConfig, ContestOptions, Contributor, DateTimeISO8601String, I18NStringSet, IPerson, IPersons, IRating, IRatingHistory, IRatingIndex, IRatingUser, Image, ImagePreset, Lang, Link, LinkString, MedalPreset, Problem, Problems, StatusTimeDisplay, Style, Submission, SubmissionReaction, Submissions, Team, Teams, Text, ThemeColor, TimeUnit };
283
+ export type { BalloonColor, BannerMode, Base64, CalculationOfPenalty, Color, ColorHEX, ColorRGB, ColorRGBA, Contest, ContestIndex, ContestIndexConfig, ContestOptions, Contributor, DateTimeISO8601String, I18NStringSet, IRating, IRatingHistory, IRatingIndex, IRatingUser, Image, ImagePreset, Lang, Link, LinkString, MedalPreset, Person, Persons, Problem, Problems, StatusTimeDisplay, Style, Submission, SubmissionReaction, Submissions, Team, Teams, Text, ThemeColor, TimeUnit };
package/dist/index.d.mts CHANGED
@@ -6,6 +6,7 @@
6
6
  * '2019-01-01T00:00:00.000Z'
7
7
  */
8
8
  type DateTimeISO8601String = string;
9
+ type Lang = "en" | "zh-CN";
9
10
  /**
10
11
  * Color HEX.
11
12
  * @example
@@ -49,13 +50,22 @@ interface BalloonColor {
49
50
  /**
50
51
  * i18n string set.
51
52
  * @example
52
- * { "en-US": 'English', "zh-CN": '中文', fallback: 'English' }
53
+ * { "en": 'English', "zh-CN": '中文', fallback: 'English' }
54
+ * { "en": 'English', "zh-CN": '中文', fallback_lang: 'en' }
53
55
  */
54
56
  interface I18NStringSet {
55
- /** The fallback string if renderer cannot determine the language to use. */
56
- fallback: string;
57
- /** The key is the IETF BCP 47 language tag, and the value is the string for this language tag. */
58
- [key: string]: string;
57
+ /**
58
+ * The fallback string if renderer cannot determine the language to use.
59
+ */
60
+ fallback?: string;
61
+ /**
62
+ * The fallback language to use if the requested language is not available.
63
+ */
64
+ fallback_lang?: Lang;
65
+ /**
66
+ * Language-specific text mappings.
67
+ */
68
+ texts?: Partial<Record<Lang, string>>;
59
69
  }
60
70
  /**
61
71
  * Text (i18n supported).
@@ -79,7 +89,6 @@ interface Image {
79
89
  base64?: Base64;
80
90
  type?: "png" | "svg" | "jpg" | "jpeg";
81
91
  preset?: ImagePreset;
82
- [key: string]: string | undefined;
83
92
  }
84
93
  interface StatusTimeDisplay {
85
94
  correct: boolean;
@@ -91,7 +100,7 @@ type TimeUnit = "second" | "millisecond" | "microsecond" | "nanosecond";
91
100
  interface Problem {
92
101
  id: string;
93
102
  label: string;
94
- name?: string;
103
+ name?: Text;
95
104
  time_limit?: string;
96
105
  memory_limit?: string;
97
106
  balloon_color?: BalloonColor;
@@ -116,7 +125,7 @@ interface ContestOptions {
116
125
  type MedalPreset = "ccpc" | "icpc";
117
126
  type BannerMode = "ONLY_BANNER" | "ALL";
118
127
  interface Contest {
119
- contest_name: string;
128
+ contest_name: Text;
120
129
  start_time: number | DateTimeISO8601String;
121
130
  end_time: number | DateTimeISO8601String;
122
131
  penalty: number;
@@ -124,11 +133,11 @@ interface Contest {
124
133
  frozen_time?: number;
125
134
  problems?: Array<Problem>;
126
135
  problem_id?: Array<string>;
127
- organization?: string;
128
- status_time_display?: Record<string, boolean>;
136
+ balloon_color?: Array<BalloonColor>;
137
+ status_time_display?: StatusTimeDisplay;
129
138
  badge?: string;
139
+ organization?: string;
130
140
  medal?: Record<string, Record<string, number>> | MedalPreset;
131
- balloon_color?: Array<BalloonColor>;
132
141
  group?: Record<string, string>;
133
142
  tag?: Record<string, string>;
134
143
  logo?: Image;
@@ -140,7 +149,7 @@ interface Contest {
140
149
  }
141
150
 
142
151
  interface ContestIndexConfig {
143
- contest_name: string;
152
+ contest_name: Text;
144
153
  start_time: number;
145
154
  end_time: number;
146
155
  frozen_time: number;
@@ -151,12 +160,12 @@ interface ContestIndex {
151
160
  board_link: string;
152
161
  }
153
162
 
154
- type Lang = "en" | "zh-CN";
155
-
156
- interface IPerson {
157
- name: string;
163
+ interface Person {
164
+ name: Text;
165
+ cf_id?: string;
166
+ icpc_id?: string;
158
167
  }
159
- type IPersons = Array<IPerson>;
168
+ type Persons = Array<Person>;
160
169
 
161
170
  interface IRatingIndex {
162
171
  id: string;
@@ -165,21 +174,21 @@ interface IRatingIndex {
165
174
  interface IRatingHistory {
166
175
  rank: number;
167
176
  rating: number;
168
- teamName: string;
177
+ teamName: Text;
169
178
  organization: string;
170
- members: IPersons;
171
- coaches: IPersons;
179
+ members: Persons;
180
+ coaches: Persons;
172
181
  contestID: string;
173
- contestName: string;
182
+ contestName: Text;
174
183
  contestLink: string;
175
184
  contestTime: Date;
176
185
  }
177
186
  interface IRatingUser {
178
187
  id: string;
179
- name: string;
188
+ name: Text;
180
189
  organization: string;
181
- members: IPersons;
182
- coaches: IPersons;
190
+ members: Persons;
191
+ coaches: Persons;
183
192
  rating: number;
184
193
  minRating: number;
185
194
  maxRating: number;
@@ -187,7 +196,7 @@ interface IRatingUser {
187
196
  }
188
197
  interface IRating {
189
198
  id: string;
190
- name: string;
199
+ name: Text;
191
200
  baseRating: number;
192
201
  contestIDs: string[];
193
202
  users: IRatingUser[];
@@ -253,13 +262,14 @@ type Submissions = Array<Submission> | Record<string, Submission>;
253
262
  interface Team {
254
263
  id?: string;
255
264
  team_id?: string;
256
- name?: string;
257
- team_name?: string;
265
+ name?: Text;
266
+ team_name?: Text;
258
267
  organization?: string;
259
268
  group?: Array<string>;
260
269
  tag?: Array<string>;
261
- coach?: string | Array<string>;
262
- members?: string | Array<string>;
270
+ coach?: Text | Array<Text> | Persons;
271
+ coaches?: Text | Array<Text> | Persons;
272
+ members?: Text | Array<Text> | Persons;
263
273
  official?: boolean;
264
274
  unofficial?: boolean;
265
275
  girl?: boolean;
@@ -270,4 +280,4 @@ interface Team {
270
280
  type Teams = Array<Team> | Record<string, Team>;
271
281
 
272
282
  export { ContestState, SubmissionStatus, SubmissionStatusToSimpleString, SubmissionStatusToString };
273
- export type { BalloonColor, BannerMode, Base64, CalculationOfPenalty, Color, ColorHEX, ColorRGB, ColorRGBA, Contest, ContestIndex, ContestIndexConfig, ContestOptions, Contributor, DateTimeISO8601String, I18NStringSet, IPerson, IPersons, IRating, IRatingHistory, IRatingIndex, IRatingUser, Image, ImagePreset, Lang, Link, LinkString, MedalPreset, Problem, Problems, StatusTimeDisplay, Style, Submission, SubmissionReaction, Submissions, Team, Teams, Text, ThemeColor, TimeUnit };
283
+ export type { BalloonColor, BannerMode, Base64, CalculationOfPenalty, Color, ColorHEX, ColorRGB, ColorRGBA, Contest, ContestIndex, ContestIndexConfig, ContestOptions, Contributor, DateTimeISO8601String, I18NStringSet, IRating, IRatingHistory, IRatingIndex, IRatingUser, Image, ImagePreset, Lang, Link, LinkString, MedalPreset, Person, Persons, Problem, Problems, StatusTimeDisplay, Style, Submission, SubmissionReaction, Submissions, Team, Teams, Text, ThemeColor, TimeUnit };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * '2019-01-01T00:00:00.000Z'
7
7
  */
8
8
  type DateTimeISO8601String = string;
9
+ type Lang = "en" | "zh-CN";
9
10
  /**
10
11
  * Color HEX.
11
12
  * @example
@@ -49,13 +50,22 @@ interface BalloonColor {
49
50
  /**
50
51
  * i18n string set.
51
52
  * @example
52
- * { "en-US": 'English', "zh-CN": '中文', fallback: 'English' }
53
+ * { "en": 'English', "zh-CN": '中文', fallback: 'English' }
54
+ * { "en": 'English', "zh-CN": '中文', fallback_lang: 'en' }
53
55
  */
54
56
  interface I18NStringSet {
55
- /** The fallback string if renderer cannot determine the language to use. */
56
- fallback: string;
57
- /** The key is the IETF BCP 47 language tag, and the value is the string for this language tag. */
58
- [key: string]: string;
57
+ /**
58
+ * The fallback string if renderer cannot determine the language to use.
59
+ */
60
+ fallback?: string;
61
+ /**
62
+ * The fallback language to use if the requested language is not available.
63
+ */
64
+ fallback_lang?: Lang;
65
+ /**
66
+ * Language-specific text mappings.
67
+ */
68
+ texts?: Partial<Record<Lang, string>>;
59
69
  }
60
70
  /**
61
71
  * Text (i18n supported).
@@ -79,7 +89,6 @@ interface Image {
79
89
  base64?: Base64;
80
90
  type?: "png" | "svg" | "jpg" | "jpeg";
81
91
  preset?: ImagePreset;
82
- [key: string]: string | undefined;
83
92
  }
84
93
  interface StatusTimeDisplay {
85
94
  correct: boolean;
@@ -91,7 +100,7 @@ type TimeUnit = "second" | "millisecond" | "microsecond" | "nanosecond";
91
100
  interface Problem {
92
101
  id: string;
93
102
  label: string;
94
- name?: string;
103
+ name?: Text;
95
104
  time_limit?: string;
96
105
  memory_limit?: string;
97
106
  balloon_color?: BalloonColor;
@@ -116,7 +125,7 @@ interface ContestOptions {
116
125
  type MedalPreset = "ccpc" | "icpc";
117
126
  type BannerMode = "ONLY_BANNER" | "ALL";
118
127
  interface Contest {
119
- contest_name: string;
128
+ contest_name: Text;
120
129
  start_time: number | DateTimeISO8601String;
121
130
  end_time: number | DateTimeISO8601String;
122
131
  penalty: number;
@@ -124,11 +133,11 @@ interface Contest {
124
133
  frozen_time?: number;
125
134
  problems?: Array<Problem>;
126
135
  problem_id?: Array<string>;
127
- organization?: string;
128
- status_time_display?: Record<string, boolean>;
136
+ balloon_color?: Array<BalloonColor>;
137
+ status_time_display?: StatusTimeDisplay;
129
138
  badge?: string;
139
+ organization?: string;
130
140
  medal?: Record<string, Record<string, number>> | MedalPreset;
131
- balloon_color?: Array<BalloonColor>;
132
141
  group?: Record<string, string>;
133
142
  tag?: Record<string, string>;
134
143
  logo?: Image;
@@ -140,7 +149,7 @@ interface Contest {
140
149
  }
141
150
 
142
151
  interface ContestIndexConfig {
143
- contest_name: string;
152
+ contest_name: Text;
144
153
  start_time: number;
145
154
  end_time: number;
146
155
  frozen_time: number;
@@ -151,12 +160,12 @@ interface ContestIndex {
151
160
  board_link: string;
152
161
  }
153
162
 
154
- type Lang = "en" | "zh-CN";
155
-
156
- interface IPerson {
157
- name: string;
163
+ interface Person {
164
+ name: Text;
165
+ cf_id?: string;
166
+ icpc_id?: string;
158
167
  }
159
- type IPersons = Array<IPerson>;
168
+ type Persons = Array<Person>;
160
169
 
161
170
  interface IRatingIndex {
162
171
  id: string;
@@ -165,21 +174,21 @@ interface IRatingIndex {
165
174
  interface IRatingHistory {
166
175
  rank: number;
167
176
  rating: number;
168
- teamName: string;
177
+ teamName: Text;
169
178
  organization: string;
170
- members: IPersons;
171
- coaches: IPersons;
179
+ members: Persons;
180
+ coaches: Persons;
172
181
  contestID: string;
173
- contestName: string;
182
+ contestName: Text;
174
183
  contestLink: string;
175
184
  contestTime: Date;
176
185
  }
177
186
  interface IRatingUser {
178
187
  id: string;
179
- name: string;
188
+ name: Text;
180
189
  organization: string;
181
- members: IPersons;
182
- coaches: IPersons;
190
+ members: Persons;
191
+ coaches: Persons;
183
192
  rating: number;
184
193
  minRating: number;
185
194
  maxRating: number;
@@ -187,7 +196,7 @@ interface IRatingUser {
187
196
  }
188
197
  interface IRating {
189
198
  id: string;
190
- name: string;
199
+ name: Text;
191
200
  baseRating: number;
192
201
  contestIDs: string[];
193
202
  users: IRatingUser[];
@@ -253,13 +262,14 @@ type Submissions = Array<Submission> | Record<string, Submission>;
253
262
  interface Team {
254
263
  id?: string;
255
264
  team_id?: string;
256
- name?: string;
257
- team_name?: string;
265
+ name?: Text;
266
+ team_name?: Text;
258
267
  organization?: string;
259
268
  group?: Array<string>;
260
269
  tag?: Array<string>;
261
- coach?: string | Array<string>;
262
- members?: string | Array<string>;
270
+ coach?: Text | Array<Text> | Persons;
271
+ coaches?: Text | Array<Text> | Persons;
272
+ members?: Text | Array<Text> | Persons;
263
273
  official?: boolean;
264
274
  unofficial?: boolean;
265
275
  girl?: boolean;
@@ -270,4 +280,4 @@ interface Team {
270
280
  type Teams = Array<Team> | Record<string, Team>;
271
281
 
272
282
  export { ContestState, SubmissionStatus, SubmissionStatusToSimpleString, SubmissionStatusToString };
273
- export type { BalloonColor, BannerMode, Base64, CalculationOfPenalty, Color, ColorHEX, ColorRGB, ColorRGBA, Contest, ContestIndex, ContestIndexConfig, ContestOptions, Contributor, DateTimeISO8601String, I18NStringSet, IPerson, IPersons, IRating, IRatingHistory, IRatingIndex, IRatingUser, Image, ImagePreset, Lang, Link, LinkString, MedalPreset, Problem, Problems, StatusTimeDisplay, Style, Submission, SubmissionReaction, Submissions, Team, Teams, Text, ThemeColor, TimeUnit };
283
+ export type { BalloonColor, BannerMode, Base64, CalculationOfPenalty, Color, ColorHEX, ColorRGB, ColorRGBA, Contest, ContestIndex, ContestIndexConfig, ContestOptions, Contributor, DateTimeISO8601String, I18NStringSet, IRating, IRatingHistory, IRatingIndex, IRatingUser, Image, ImagePreset, Lang, Link, LinkString, MedalPreset, Person, Persons, Problem, Problems, StatusTimeDisplay, Style, Submission, SubmissionReaction, Submissions, Team, Teams, Text, ThemeColor, TimeUnit };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xcpcio/types",
3
3
  "type": "module",
4
- "version": "0.64.5",
4
+ "version": "0.65.0",
5
5
  "description": "Types for XCPCIO",
6
6
  "author": "Dup4 <hi@dup4.com>",
7
7
  "license": "MIT",