coh-content-db 2.0.0-rc.1 → 2.0.0-rc.11

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.
Files changed (100) hide show
  1. package/.editorconfig +10 -11
  2. package/.github/workflows/build.yml +4 -2
  3. package/.github/workflows/pull-request.yml +1 -1
  4. package/.github/workflows/release.yml +2 -2
  5. package/CHANGELOG.md +43 -0
  6. package/README.md +52 -24
  7. package/dist/coh-content-db.d.ts +678 -279
  8. package/dist/coh-content-db.js +828 -371
  9. package/dist/coh-content-db.js.map +1 -1
  10. package/dist/coh-content-db.mjs +803 -362
  11. package/dist/coh-content-db.mjs.map +1 -1
  12. package/eslint.config.mjs +1 -0
  13. package/package.json +1 -1
  14. package/src/main/api/alignment.ts +18 -2
  15. package/src/main/api/alternate-data.ts +2 -2
  16. package/src/main/api/badge-data.ts +20 -48
  17. package/src/main/api/badge-requirement-data.ts +64 -0
  18. package/src/main/api/badge-requirement-type.ts +32 -0
  19. package/src/main/api/badge-type.ts +15 -15
  20. package/src/main/api/bundle-data.ts +47 -0
  21. package/src/main/api/bundle-header-data.ts +37 -0
  22. package/src/main/api/contact-data.ts +48 -0
  23. package/src/main/api/enhancement-category.ts +26 -26
  24. package/src/main/api/location-data.ts +28 -0
  25. package/src/main/api/markdown-string.ts +4 -0
  26. package/src/main/api/mission-data.ts +83 -0
  27. package/src/main/api/mission-type.ts +2 -0
  28. package/src/main/api/morality.ts +31 -0
  29. package/src/main/api/sex.ts +8 -1
  30. package/src/main/api/zone-data.ts +20 -0
  31. package/src/main/db/abstract-index.ts +37 -0
  32. package/src/main/db/alignment-list.ts +54 -0
  33. package/src/main/db/alternates.ts +28 -42
  34. package/src/main/db/badge-index.ts +60 -0
  35. package/src/main/db/badge-requirement.ts +81 -0
  36. package/src/main/db/badge-search-options.ts +47 -0
  37. package/src/main/db/badge.ts +76 -71
  38. package/src/main/db/bundle-header.ts +44 -0
  39. package/src/main/db/coh-content-database.ts +123 -14
  40. package/src/main/db/contact.ts +62 -0
  41. package/src/main/db/location.ts +30 -0
  42. package/src/main/db/mission.ts +107 -0
  43. package/src/main/db/morality-list.ts +99 -0
  44. package/src/main/db/paged.ts +7 -0
  45. package/src/main/db/zone.ts +28 -0
  46. package/src/main/index.ts +23 -15
  47. package/src/main/util.ts +108 -7
  48. package/src/test/api/alignment.test.ts +38 -4
  49. package/src/test/api/badge-data.fixture.ts +1 -15
  50. package/src/test/api/badge-data.test.ts +4 -4
  51. package/src/test/api/badge-requirement-data.fixture.ts +7 -0
  52. package/src/test/api/badge-requirement-type.test.ts +31 -0
  53. package/src/test/api/badge-type.test.ts +5 -5
  54. package/src/test/api/bundle-data.fixture.ts +6 -0
  55. package/src/test/api/bundle-header-data.fixture.ts +6 -0
  56. package/src/test/api/contact-data.fixture.ts +7 -0
  57. package/src/test/api/enhancement-category.test.ts +5 -5
  58. package/src/test/api/mission-data.fixture.ts +12 -0
  59. package/src/test/api/sex.test.ts +33 -1
  60. package/src/test/api/zone-data.fixture.ts +8 -0
  61. package/src/test/db/abstract-index.test.ts +55 -0
  62. package/src/test/db/alignment-list.test.ts +200 -0
  63. package/src/test/db/alternates.test.ts +82 -117
  64. package/src/test/db/badge-index.test.ts +547 -0
  65. package/src/test/db/badge-requirement.test.ts +145 -0
  66. package/src/test/db/badge.test.ts +322 -14
  67. package/src/test/db/bundle-header.test.ts +76 -0
  68. package/src/test/db/coh-content-database.test.ts +264 -24
  69. package/src/test/db/contact.test.ts +97 -0
  70. package/src/test/db/location.test.ts +51 -0
  71. package/src/test/db/mission.test.ts +171 -0
  72. package/src/test/db/morality-list.test.ts +457 -0
  73. package/src/test/db/zone.test.ts +36 -0
  74. package/src/test/integration.test.ts +16 -0
  75. package/src/test/util.test.ts +144 -18
  76. package/src/main/api/badge-partial-data.ts +0 -65
  77. package/src/main/api/badge-partial-type.ts +0 -8
  78. package/src/main/api/change.ts +0 -14
  79. package/src/main/api/game-map-data.ts +0 -26
  80. package/src/main/api/plaque-type.ts +0 -6
  81. package/src/main/api/server-group-data.ts +0 -65
  82. package/src/main/api/vidiot-map-data.ts +0 -18
  83. package/src/main/api/vidiot-map-point-of-interest-data.ts +0 -30
  84. package/src/main/changelog.ts +0 -20
  85. package/src/main/db/badge-partial.ts +0 -35
  86. package/src/main/db/game-map.ts +0 -33
  87. package/src/main/db/server-group.ts +0 -112
  88. package/src/main/db/vidiot-map-point-of-interest.ts +0 -40
  89. package/src/main/db/vidiot-map.ts +0 -25
  90. package/src/test/api/badge-partial-data.fixture.ts +0 -17
  91. package/src/test/api/badge-partial-type.test.ts +0 -31
  92. package/src/test/api/game-map-data.fixture.ts +0 -10
  93. package/src/test/api/plaque-type.test.ts +0 -31
  94. package/src/test/api/server-group-data.fixture.ts +0 -23
  95. package/src/test/api/server-group-data.test.ts +0 -15
  96. package/src/test/api/vidiot-map-point-of-interest.fixture.ts +0 -10
  97. package/src/test/api/vidiot-map.fixture.ts +0 -9
  98. package/src/test/changelog.test.ts +0 -36
  99. package/src/test/db/server-group.test.ts +0 -124
  100. package/src/test/index.test.ts +0 -10
@@ -1,8 +1,19 @@
1
- declare const ALIGNMENT: readonly ["H", "V", "P"];
1
+ declare const ALIGNMENT: readonly ["hero", "villain", "praetorian"];
2
2
  type Alignment = typeof ALIGNMENT[number];
3
+ type AlignmentExtended = Alignment
4
+ /**
5
+ * The alignments available for Primal Earth characters - Hero and Villain.
6
+ */
7
+ | 'primal'
8
+ /**
9
+ * All the alignments.
10
+ */
11
+ | 'all';
12
+ declare function compareAlignment(a?: Alignment, b?: Alignment): number;
3
13
 
4
14
  declare const SEX: readonly ["M", "F"];
5
15
  type Sex = typeof SEX[number];
16
+ declare function compareSex(a?: Sex, b?: Sex): number;
6
17
 
7
18
  /**
8
19
  * Some badge values differ based on the alignment or sex of the character.
@@ -11,11 +22,11 @@ interface AlternateData<V> {
11
22
  /**
12
23
  * The character alignment this alternate applies to.
13
24
  */
14
- readonly alignment?: Alignment | string;
25
+ readonly alignment?: Alignment;
15
26
  /**
16
27
  * The character sex this alternate applies to.
17
28
  */
18
- readonly sex?: Sex | string;
29
+ readonly sex?: Sex;
19
30
  /**
20
31
  * The value for this combination.
21
32
  */
@@ -28,289 +39,412 @@ interface ArchetypeData {
28
39
  readonly description?: string;
29
40
  }
30
41
 
31
- declare const ENHANCEMENT_CATEGORY: readonly ["DEFENSE_DEBUFF", "TO_HIT_DEBUFF", "TAUNT", "CONFUSE", "HEALING", "DEFENSE_BUFF", "RESIST_DAMAGE", "INTANGIBILITY", "SLEEP", "SLOW", "HOLD", "STUN", "IMMOBILIZE", "FEAR", "ENDURANCE_MODIFICATION", "ENDURANCE_REDUCTION", "RECHARGE_REDUCTION", "INTERRUPT_DURATION", "ACCURACY", "TO_HIT_BUFF", "DAMAGE", "KNOCKBACK", "RUN_SPEED", "JUMP", "FLY_SPEED", "RANGE"];
42
+ declare const ENHANCEMENT_CATEGORY: readonly ["defense-debuff", "to-hit-debuff", "taunt", "confuse", "healing", "defense-buff", "resist-damage", "intangibility", "sleep", "slow", "hold", "stun", "immobilize", "fear", "endurance-modification", "endurance-reduction", "recharge-reduction", "interrupt-duration", "accuracy", "to-hit-buff", "damage", "knockback", "run-speed", "jump", "fly-speed", "range"];
32
43
  type EnhancementCategory = typeof ENHANCEMENT_CATEGORY[number];
33
44
 
34
- declare const BADGE_PARTIAL_TYPE: readonly ["PLAQUE", "BADGE", "INVENTION", "INVENTION_PLUS_ONE"];
35
- type BadgePartialType = typeof BADGE_PARTIAL_TYPE[number];
45
+ declare const BADGE_REQUIREMENT_TYPE: readonly ["badge", "invention", "invention-plus-one", "location", "monument", "mission", "task"];
46
+ type BadgeRequirementType = typeof BADGE_REQUIREMENT_TYPE[number];
36
47
 
37
- declare const PLAQUE_TYPE: string[];
38
- type PlaqueType = typeof PLAQUE_TYPE[number];
48
+ /**
49
+ * Tage type to indicate that a string will accept {@link https://www.markdownguide.org/|Markdown} format.
50
+ */
51
+ type MarkdownString = string;
52
+
53
+ interface Link {
54
+ title: string;
55
+ href: string;
56
+ }
39
57
 
40
- interface BadgePartialData {
58
+ interface LocationData {
41
59
  /**
42
- * Key.
60
+ * Key of the {@link Zone} that the location references.
43
61
  */
44
- readonly key: string;
62
+ readonly zoneKey?: string;
45
63
  /**
46
- * Type of partial.
64
+ * In-game `/loc` coordinates of the location.
47
65
  */
48
- readonly type: BadgePartialType | string;
66
+ readonly coords?: Coords;
49
67
  /**
50
- * Map the partial is located on.
68
+ * The type of icon to use if the location appears on a map. (Typically the Vidiot map icon).
51
69
  */
52
- readonly mapKey?: string;
70
+ readonly icon?: LocationIcon;
53
71
  /**
54
- * /loc coordinates.
72
+ * The text that should appear in the location icon. (Typically a number or symbol from the Vidiot map).
55
73
  */
56
- readonly loc?: number[];
74
+ readonly iconText?: string;
75
+ }
76
+ /**
77
+ * Coordinates as they appear using the in-game `/loc` command.
78
+ */
79
+ type Coords = [number, number, number];
80
+ type LocationIcon = 'badge' | 'plaque' | 'pedestal' | 'object';
81
+
82
+ interface BadgeRequirementData {
57
83
  /**
58
- * Is it a wall plaque or a physical monument?
84
+ * Unique key used to reference this badge requirement.
85
+ *
86
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
59
87
  */
60
- readonly plaqueType?: PlaqueType | string;
88
+ readonly key: string;
61
89
  /**
62
- * Plaque inscription.
90
+ * The requirement type.
63
91
  */
64
- readonly inscription?: string;
92
+ readonly type: BadgeRequirementType;
65
93
  /**
66
- * The number or letter the partial appears as on Vidiot Maps.
94
+ * If the requirement involves a location, where it is.
67
95
  */
68
- readonly vidiotMapKey?: string;
96
+ readonly location?: LocationData | LocationData[];
69
97
  /**
70
- * The badge required for this partial.
98
+ * If the requirement involves a badge, the badge key.
71
99
  */
72
100
  readonly badgeKey?: string;
73
101
  /**
74
- * Level of the invention required.
102
+ * If the requirement involves a mission, the mission key.
103
+ */
104
+ readonly missionKey?: string;
105
+ /**
106
+ * If the requirement involves a monument, the text that is displayed thereon.
107
+ */
108
+ readonly monumentText?: string;
109
+ /**
110
+ * If the requirement involves crafting an invention, the Level of the invention required.
75
111
  */
76
112
  readonly inventionLevel?: number;
77
113
  /**
78
- * The types of enhancements required to be crafted.
114
+ * If the requirement involves crafting an invention, the types of enhancements that will qualify.
79
115
  */
80
- readonly inventionTypes?: (EnhancementCategory | string)[];
116
+ readonly inventionTypes?: EnhancementCategory[];
81
117
  /**
82
- * Number of invention crafts required.
118
+ * Number of times the task needs to be repeated.
83
119
  */
84
- readonly inventionCount?: number;
120
+ readonly count?: number;
85
121
  /**
86
- * Any additional notes.
122
+ * Additional information about the requirement.
87
123
  */
88
- readonly notes?: string;
89
- }
90
-
91
- interface Link {
92
- title: string;
93
- href: string;
124
+ readonly notes?: MarkdownString;
125
+ /**
126
+ * List of external links. Wiki, forums, etc.
127
+ */
128
+ readonly links?: Link[];
94
129
  }
95
130
 
96
- declare const BADGE_TYPE: readonly ["EXPLORATION", "HISTORY", "ACCOMPLISHMENT", "ACHIEVEMENT", "ACCOLADE", "GLADIATOR", "VETERAN", "PVP", "INVENTION", "DEFEAT", "EVENT", "OUROBOROS", "CONSIGNMENT", "DAY_JOB", "AE"];
131
+ declare const BADGE_TYPE: readonly ["exploration", "history", "accomplishment", "achievement", "accolade", "gladiator", "veteran", "pvp", "invention", "defeat", "event", "ouroboros", "consignment", "day-job", "architect-entertainment"];
97
132
  type BadgeType = typeof BADGE_TYPE[number];
98
133
 
134
+ declare const MORALITY: readonly ["hero", "vigilante", "villain", "rogue", "resistance", "loyalist"];
135
+ type Morality = typeof MORALITY[number];
136
+ type MoralityExtended = Morality
137
+ /**
138
+ * Any of the Primal Earth moralities - Hero, Vigilante, Villain, Rogue.
139
+ */
140
+ | 'primal'
141
+ /**
142
+ * Either of the Praetorian Earth moralities - Resistance or Loyalist.
143
+ */
144
+ | 'praetorian'
145
+ /**
146
+ * The moralities that roll up to the Hero {@link Alignment} - Hero and Vigilante.
147
+ */
148
+ | 'heroic'
149
+ /**
150
+ * The moralities that roll up to the Villain {@link Alignment} - Villain and Rogue.
151
+ */
152
+ | 'villainous'
153
+ /**
154
+ * Moralities with access to Paragon City - Hero, Vigilante and Rogue.
155
+ */
156
+ | 'paragon-city-access'
157
+ /**
158
+ * Moralities with access to the Rogue Isles - Villain, Rogue and Vigilante.
159
+ */
160
+ | 'rogue-isles-access'
161
+ /**
162
+ * All the moralities.
163
+ */
164
+ | 'all';
165
+
99
166
  interface BadgeData {
100
167
  /**
101
168
  * Unique key used to reference this badge.
102
169
  *
103
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
170
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
104
171
  */
105
172
  readonly key: string;
106
173
  /**
107
174
  * The type of badge.
108
175
  */
109
- readonly type: BadgeType | string;
176
+ readonly type: BadgeType;
110
177
  /**
111
178
  * The name of this badge.
112
179
  *
113
180
  * If the value differs by sex or alignment, include an {@link AlternateData} for each variant.
114
181
  */
115
- readonly name: AlternateData<string>[];
182
+ readonly name: string | AlternateData<string>[];
116
183
  /**
117
- * The character alignments that this badge is available to.
184
+ * The {@link MoralityExtended|moralities} that this badge is available to. If undefined then all moralities will be assumed.
118
185
  */
119
- readonly alignment: Alignment[];
186
+ readonly morality?: MoralityExtended | MoralityExtended[];
120
187
  /**
121
188
  * The badge text as it appears in-game. May vary by character sex or alignment.
122
189
  */
123
- readonly badgeText?: AlternateData<string>[];
190
+ readonly badgeText?: AlternateData<MarkdownString>[] | MarkdownString;
124
191
  /**
125
- * Description of how to acquire the badge.
126
- *
127
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
192
+ * Short description of how to acquire the badge. Detailed instructions should go in the notes field.
128
193
  */
129
- readonly acquisition?: string;
194
+ readonly acquisition?: MarkdownString;
130
195
  /**
131
196
  * List of absolute URLs for this badge's icons.
132
197
  *
133
198
  * If the value differs by sex or alignment, include an {@link AlternateData} for each variant.
134
199
  */
135
- readonly icon?: AlternateData<string>[];
200
+ readonly icon?: string | AlternateData<string>[];
136
201
  /**
137
202
  * Freeform notes or tips about the badge.
138
- *
139
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
140
203
  */
141
- readonly notes?: string;
204
+ readonly notes?: MarkdownString;
142
205
  /**
143
- * List of external links for this Badge. Wiki, forums, etc.
206
+ * List of external links. Wiki, forums, etc.
144
207
  */
145
208
  readonly links?: Link[];
146
209
  /**
147
- * For exploration badges, the key of the {@link GameMapData|GameMap} that this badge is found on.
210
+ * The id used with the in-game `/settitle` command to apply the badge.
211
+ * The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
148
212
  */
149
- readonly mapKey?: string;
150
- /**
151
- * For exploration badges, the `/loc` coordinates of the badge on the in-game map.
152
- */
153
- readonly loc?: [number, number, number];
154
- /**
155
- * For badges that appear on a Vidiot Map, the number or letter the badge appears as.
156
- */
157
- readonly vidiotMapKey?: string;
158
- /**
159
- * ID used with the in-game `/settitle` command to apply the badge.
160
- */
161
- readonly setTitle?: {
162
- /**
163
- * `/settitle` id.
164
- */
165
- id?: number;
166
- /**
167
- * `/settitle` id if different for praetorian characters.
168
- */
169
- praetorianId?: number;
170
- };
213
+ readonly setTitleId?: [number, number?];
171
214
  /**
172
215
  * A description of the effect the badge will have, such as a buff or granting a temporary power.
173
- *
174
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
175
216
  */
176
- readonly effect?: string;
217
+ readonly effect?: MarkdownString;
177
218
  /**
178
- * A list of requirements for badges that have partial fulfilment steps, such as visiting plaques for history badges, or collecting other badges for meta-badges like accolades.
219
+ * Represents the requirements for badges with multiple fulfillment steps, such as visiting monuments for history badges, completing missions, or collecting other badges.
179
220
  */
180
- readonly partials?: BadgePartialData[];
221
+ readonly requirements?: BadgeRequirementData[];
181
222
  /**
182
223
  * Some badges are not included in the badge total count... such as Flames of Prometheus, which can be removed by redeeming it for a Notice of the Well.
183
224
  */
184
225
  readonly ignoreInTotals?: boolean;
185
226
  }
186
227
 
187
- interface Change {
228
+ interface ZoneData {
188
229
  /**
189
- * The version number in {@link http://semver.org|semver} format.
230
+ * Unique key used to reference this zone.
231
+ *
232
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
190
233
  */
191
- version: string;
234
+ readonly key: string;
192
235
  /**
193
- * Date of the change.
236
+ * The name of the zone as it appears in-game.
194
237
  */
195
- date: Date;
238
+ readonly name: string;
196
239
  /**
197
- * Description of the change in {@link https://www.markdownguide.org/|Markdown} format.
240
+ * List of external links. Wiki, forums, etc.
198
241
  */
199
- description: string;
242
+ readonly links?: Link[];
200
243
  }
201
244
 
202
- interface VidiotMapPointOfInterestData {
245
+ interface ContactData {
203
246
  /**
204
- * The pixel-space position of the PoI on the map graphic.
247
+ * Unique key used to reference this contact.
205
248
  *
206
- * Screen-space, pixels from top-left `[0, 0]`.
249
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
207
250
  */
208
- readonly pos?: [number, number];
251
+ readonly key: string;
209
252
  /**
210
- * Freeform notes about the PoI.
211
- *
212
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
253
+ * The name of this contact.
213
254
  */
214
- readonly notes?: string;
255
+ readonly name: string;
215
256
  /**
216
- * If the POI is a zone transfer, the map it transfers to.
257
+ * The contact's title.
217
258
  */
218
- readonly mapKey?: string;
259
+ readonly title?: string;
219
260
  /**
220
- * If the POI is a badge, the badge.
261
+ * The character moralities that this contact will interact with.
221
262
  */
222
- readonly badgeKey?: string;
263
+ readonly morality?: MoralityExtended | MoralityExtended[];
223
264
  /**
224
- * If the POI is a partial for a badge, the partial key.
265
+ * The location of this contact.
225
266
  */
226
- readonly badgePartialKey?: string;
227
- }
228
-
229
- interface VidiotMapData {
267
+ readonly location?: LocationData;
230
268
  /**
231
- * URL of the map image.
269
+ * The level range this contact will offer missions for.
232
270
  */
233
- readonly imageUrl: string;
271
+ readonly levelRange?: [number, number?];
234
272
  /**
235
- * Name to display for the Vidiot map.
273
+ * Freeform notes or tips about the contact.
236
274
  */
237
- readonly name?: string;
275
+ readonly notes?: MarkdownString;
238
276
  /**
239
- * List of Points of Interest labelled on the image.
277
+ * List of external links. Wiki, forums, etc.
240
278
  */
241
- readonly pointsOfInterest?: VidiotMapPointOfInterestData[];
279
+ readonly links?: Link[];
242
280
  }
243
281
 
244
- interface GameMapData {
282
+ declare const MISSION_TYPE: readonly ["story-arc", "mission", "task-force", "strike-force", "trial", "personal-story"];
283
+ type MissionType = typeof MISSION_TYPE[number];
284
+
285
+ interface MissionData {
245
286
  /**
246
- * Unique key used to reference this badge.
287
+ * Unique key used to reference this mission.
247
288
  *
248
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
289
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
249
290
  */
250
291
  readonly key: string;
251
292
  /**
252
- * The name of the map as it appears in-game.
293
+ * The name of the mission as it appears from the contact.
294
+ *
295
+ * The name may be different when viewed in Ouroboros as a Flashback.
253
296
  */
254
297
  readonly name: string;
255
298
  /**
256
- * List of external links for this Map. Wiki, forums, etc.
299
+ * The type of mission... Story arc, task force, trial, etc.
300
+ */
301
+ readonly type: MissionType;
302
+ /**
303
+ * The character moralities that may accept the mission.
304
+ */
305
+ readonly morality?: MoralityExtended | MoralityExtended[];
306
+ /**
307
+ * The keys of any contacts that provide this mission.
308
+ */
309
+ readonly contactKeys?: string | string[];
310
+ /**
311
+ * The level range this mission is available for.
312
+ */
313
+ readonly levelRange?: [number, number?];
314
+ /**
315
+ * Freeform notes or tips about the mission.
316
+ */
317
+ readonly notes?: MarkdownString;
318
+ /**
319
+ * List of external links. Wiki, forums, etc.
257
320
  */
258
321
  readonly links?: Link[];
259
322
  /**
260
- * List of Vidiot Map assets for this map.
323
+ * If the mission is available in Ouroboros as a Flashback.
324
+ */
325
+ readonly flashback?: MissionFlashbackData;
326
+ }
327
+ interface MissionFlashbackData {
328
+ /**
329
+ * The id of the mission as seen in the Flashback menu, i.e. '14.01'.
330
+ */
331
+ readonly id: string;
332
+ /**
333
+ * The level range this mission appears under as a Flashback. Leave undefined if the same as the base mission.
334
+ */
335
+ readonly levelRange?: [number, number?];
336
+ /**
337
+ * The name as it appears in the Flashback list. Leave undefined if the same as the base mission.
261
338
  */
262
- readonly vidiotMaps?: VidiotMapData[];
339
+ readonly name?: string;
340
+ /**
341
+ * The character moralities that the mission will appear for in the Flashback list. Leave undefined if the same as the base mission.
342
+ */
343
+ readonly morality?: MoralityExtended | MoralityExtended[];
344
+ /**
345
+ * Freeform notes or tips about the Flashback version of the mission.
346
+ */
347
+ readonly notes?: MarkdownString;
263
348
  }
264
349
 
265
350
  /**
266
- * A server group is a group or company that hosts a set of game servers, such as Homecoming (https://forums.homecomingservers.com/).
351
+ * Metadata about a content bundle.
267
352
  */
268
- interface ServerGroupData {
353
+ interface BundleHeaderData {
269
354
  /**
270
- * Unique key used to reference this server group.
271
- *
272
- * Keys can only contain lowercase letters, numbers and hyphens (`-`).
355
+ * Name of the fork this bundle contains data for.
273
356
  */
274
- readonly key: string;
357
+ readonly name?: string;
275
358
  /**
276
- * Name of the server group.
359
+ * Description of the fork.
277
360
  */
278
- readonly name: string;
361
+ readonly description?: MarkdownString;
279
362
  /**
280
- * Description of the server group.
281
- *
282
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
363
+ * Url for the repository where the bundle is maintained.
283
364
  */
284
- readonly description?: string;
365
+ readonly repositoryUrl?: string;
285
366
  /**
286
- * Repository where the db content package is maintained.
367
+ * Url for the location of the changelog.
287
368
  */
288
- readonly repository?: string;
369
+ readonly changelogUrl?: string;
289
370
  /**
290
- * List of external links for this Badge. Wiki, forums, etc.
371
+ * List of external links. Wiki, forums, etc.
291
372
  */
292
373
  readonly links?: Link[];
293
374
  /**
294
- * List of the game server names in this server group.
375
+ * Version number for this data package.
376
+ */
377
+ readonly version?: string;
378
+ }
379
+
380
+ /**
381
+ * A bundle of game data from a forked instance of the game, such as Homecoming (https://forums.homecomingservers.com/).
382
+ */
383
+ interface BundleData {
384
+ /**
385
+ * Bundle header.
386
+ */
387
+ readonly header?: BundleHeaderData;
388
+ /**
389
+ * List of the game server names in this fork.
295
390
  * Torchbearer, Excelsior, etc.
296
391
  */
297
392
  readonly servers?: string[];
298
393
  /**
299
- * List of archetypes available in this server group.
394
+ * List of archetypes available in this fork.
300
395
  */
301
396
  readonly archetypes?: ArchetypeData[];
302
397
  /**
303
- * List of game maps supported by this server group.
398
+ * List of zones supported by this fork.
304
399
  */
305
- readonly maps?: GameMapData[];
400
+ readonly zones?: ZoneData[];
306
401
  /**
307
- * List of badges available on this server group.
402
+ * List of contacts available in this fork.
403
+ */
404
+ readonly contacts?: ContactData[];
405
+ /**
406
+ * List of missions available in this fork.
407
+ */
408
+ readonly missions?: MissionData[];
409
+ /**
410
+ * List of badges available on this fork.
308
411
  */
309
412
  readonly badges?: BadgeData[];
413
+ }
414
+
415
+ declare class AlignmentList {
416
+ #private;
417
+ readonly hero: boolean;
418
+ readonly villain: boolean;
419
+ readonly praetorian: boolean;
420
+ readonly primal: boolean;
421
+ readonly all: boolean;
422
+ constructor(items?: AlignmentExtended[]);
423
+ get items(): Alignment[];
424
+ has(alignment?: AlignmentExtended): boolean;
425
+ }
426
+
427
+ declare class Alternates<T> {
428
+ #private;
429
+ /**
430
+ * Create an alternate set from either a list of categorized values, or a single value when there are no alternates.
431
+ * @param value List of alternates, or a single value.
432
+ */
433
+ constructor(value: AlternateData<T>[] | T);
434
+ getValue(alignment?: Alignment, sex?: Sex): T | undefined;
435
+ /**
436
+ * Get the default value for this list of alternates, the value with the highest priority and lowest specificity.
437
+ */
438
+ get default(): AlternateData<T> | undefined;
310
439
  /**
311
- * Change log for this data package.
440
+ * Get the list of alternates sorted in canonical order (alignment then sex, low to high specificity).
312
441
  */
313
- readonly changelog?: Change[];
442
+ get canonical(): AlternateData<T>[];
443
+ /**
444
+ * Create a joined string from the alternate values in canonical order.
445
+ * @param separator Separator to use. Default is ' / '
446
+ */
447
+ toString(separator: string): string;
314
448
  }
315
449
 
316
450
  declare class Archetype {
@@ -320,34 +454,94 @@ declare class Archetype {
320
454
  constructor(data: ArchetypeData);
321
455
  }
322
456
 
323
- declare class BadgePartial {
457
+ declare class Location {
458
+ /**
459
+ * Key of the {@link Zone} that the location references.
460
+ */
461
+ readonly zoneKey?: string;
462
+ /**
463
+ * In-game `/loc` coordinates of the location.
464
+ */
465
+ readonly coords?: Coords;
466
+ /**
467
+ * The type of icon to use if the location appears on a map. (Typically the Vidiot map icon).
468
+ */
469
+ readonly icon?: LocationIcon;
470
+ /**
471
+ * The text that should appear in the location icon. (Typically a number or symbol from the Vidiot map).
472
+ */
473
+ readonly iconText?: string;
474
+ constructor(data: LocationData);
475
+ }
476
+
477
+ declare class BadgeRequirement {
478
+ /**
479
+ * Unique key used to reference this badge requirement.
480
+ *
481
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
482
+ */
324
483
  readonly key: string;
325
- readonly type: BadgePartialType | string;
326
- readonly mapKey?: string;
327
- readonly loc?: number[];
328
- readonly plaqueType?: PlaqueType | string;
329
- readonly inscription?: string;
330
- readonly vidiotMapKey?: string;
484
+ /**
485
+ * The requirement type.
486
+ */
487
+ readonly type: BadgeRequirementType;
488
+ /**
489
+ * If the requirement involves a location, where it is.
490
+ */
491
+ readonly location?: Location[];
492
+ /**
493
+ * If the requirement involves a badge, the badge key.
494
+ */
331
495
  readonly badgeKey?: string;
496
+ /**
497
+ * If the requirement involves a mission, the mission key.
498
+ */
499
+ readonly missionKey?: string;
500
+ /**
501
+ * If the requirement involves a monument, the text that is displayed thereon.
502
+ */
503
+ readonly monumentText?: string;
504
+ /**
505
+ * If the requirement involves crafting an invention, the Level of the invention required.
506
+ */
332
507
  readonly inventionLevel?: number;
333
- readonly inventionTypes?: (EnhancementCategory | string)[];
334
- readonly inventionCount?: number;
335
- readonly notes?: string;
336
- constructor(data: BadgePartialData);
337
- }
338
-
339
- declare class Alternates<T> {
340
- #private;
341
- constructor(values: AlternateData<T>[]);
342
- getValue(alignment?: Alignment | string, sex?: Sex | string): T | undefined;
343
508
  /**
344
- * Get the default value for this list of alternates, the value with the highest priority and lowest specificity.
509
+ * If the requirement involves crafting an invention, the types of enhancements that will qualify.
345
510
  */
346
- get default(): T | undefined;
511
+ readonly inventionTypes?: EnhancementCategory[];
347
512
  /**
348
- * Get the list of alternates sorted in canonical order (alignment then sex, low to high specificity).
513
+ * Number of times the task needs to be repeated.
349
514
  */
350
- get canonical(): AlternateData<T>[];
515
+ readonly count?: number;
516
+ /**
517
+ * Additional information about the requirement.
518
+ */
519
+ readonly notes?: MarkdownString;
520
+ /**
521
+ * List of external links. Wiki, forums, etc.
522
+ */
523
+ readonly links: Link[];
524
+ constructor(data: BadgeRequirementData);
525
+ }
526
+
527
+ declare class MoralityList {
528
+ #private;
529
+ readonly hero: boolean;
530
+ readonly vigilante: boolean;
531
+ readonly villain: boolean;
532
+ readonly rogue: boolean;
533
+ readonly resistance: boolean;
534
+ readonly loyalist: boolean;
535
+ readonly primal: boolean;
536
+ readonly praetorian: boolean;
537
+ readonly heroic: boolean;
538
+ readonly villainous: boolean;
539
+ readonly paragonCityAccess: boolean;
540
+ readonly rogueIslesAccess: boolean;
541
+ readonly all: boolean;
542
+ constructor(items?: MoralityExtended[]);
543
+ get items(): Morality[];
544
+ has(morality?: MoralityExtended): boolean;
351
545
  }
352
546
 
353
547
  declare class Badge {
@@ -359,7 +553,7 @@ declare class Badge {
359
553
  /**
360
554
  * The type of badge.
361
555
  */
362
- readonly type: BadgeType | string;
556
+ readonly type: BadgeType;
363
557
  /**
364
558
  * The name of this badge.
365
559
  *
@@ -367,19 +561,17 @@ declare class Badge {
367
561
  */
368
562
  readonly name: Alternates<string>;
369
563
  /**
370
- * The character alignments that this badge is available to.
564
+ * The character moralities that this badge is available to.
371
565
  */
372
- readonly alignment: Alignment[];
566
+ readonly morality: MoralityList;
373
567
  /**
374
568
  * The badge text as it appears in-game. May vary by character sex or alignment.
375
569
  */
376
- readonly badgeText: Alternates<string>;
570
+ readonly badgeText: Alternates<MarkdownString>;
377
571
  /**
378
- * Description of how to acquire the badge.
379
- *
380
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
572
+ * Short description of how to acquire the badge. Detailed instructions will be in the notes field.
381
573
  */
382
- readonly acquisition?: string;
574
+ readonly acquisition?: MarkdownString;
383
575
  /**
384
576
  * Absolute URL to this badge's icon.
385
577
  *
@@ -388,188 +580,337 @@ declare class Badge {
388
580
  readonly icon: Alternates<string>;
389
581
  /**
390
582
  * Freeform notes or tips about the badge.
391
- *
392
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
393
583
  */
394
- readonly notes?: string;
584
+ readonly notes?: MarkdownString;
395
585
  /**
396
- * List of external links for this Badge. Wiki, forums, etc.
586
+ * List of external links. Wiki, forums, etc.
397
587
  */
398
- readonly links?: Link[];
588
+ readonly links: Link[];
399
589
  /**
400
- * For exploration badges, the key of the {@link GameMap} that this badge is found on.
590
+ * The id used with the in-game `/settitle` command to apply the badge.
591
+ * The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
401
592
  */
402
- readonly mapKey?: string;
593
+ readonly setTitleId?: [number, number?];
403
594
  /**
404
- * For exploration badges, the `/loc` coordinates of the badge on the in-game map.
595
+ * A description of the effect the badge will have, such as a buff or granting a temporary power.
405
596
  */
406
- readonly loc?: [number, number, number];
597
+ readonly effect?: MarkdownString;
407
598
  /**
408
- * For badges that appear on a Vidiot Map, the number or letter the badge appears as.
599
+ * Some badges are not included in the badge total count... such as Flames of Prometheus, which can be removed by redeeming it for a Notice of the Well.
409
600
  */
410
- readonly vidiotMapKey?: string;
601
+ readonly ignoreInTotals: boolean;
602
+ constructor(badgeData: BadgeData);
411
603
  /**
412
- * ID used with the in-game `/settitle` command to apply the badge.
604
+ * Represents the requirements for badges with multiple fulfillment steps, such as visiting monuments for history badges, completing missions, or collecting other badges.
413
605
  */
414
- readonly setTitle?: {
415
- /**
416
- * `/settitle` id.
417
- */
418
- id?: number;
419
- /**
420
- * `/settitle` id if different for praetorian characters.
421
- */
422
- praetorianId?: number;
606
+ get requirements(): BadgeRequirement[];
607
+ getRequirement(key: string): BadgeRequirement | undefined;
608
+ /**
609
+ * Return a list of all the zone keys referenced by this badge.
610
+ */
611
+ get zoneKeys(): string[];
612
+ /**
613
+ * The zone key if this badge relates to a single zone.
614
+ */
615
+ get zoneKey(): string | undefined;
616
+ }
617
+ declare function compareByDefaultName(a?: Badge, b?: Badge): number;
618
+ declare function compareByZoneKey(a?: Badge, b?: Badge): number;
619
+
620
+ type BadgeQueryableField = 'name' | 'badge-text' | 'acquisition' | 'notes' | 'effect' | 'set-title-id';
621
+ type BadgeSortableField = 'canonical' | 'badge-name' | 'zone-key';
622
+ interface BadgeSearchOptions {
623
+ /**
624
+ * Text-based search.
625
+ *
626
+ * Case-insensitive. Defaults to searching on name only.
627
+ */
628
+ query?: {
629
+ str?: string;
630
+ fields?: BadgeQueryableField[];
423
631
  };
424
632
  /**
425
- * A description of the effect the badge will have, such as a buff or granting a temporary power.
633
+ * Filter results matching the given values.
634
+ */
635
+ filter?: {
636
+ type?: BadgeType;
637
+ zoneKey?: string;
638
+ morality?: MoralityExtended;
639
+ };
640
+ /**
641
+ * Sort results.
426
642
  *
427
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
643
+ * Badges are assumed to be in canonical order in the content bundle, and should match the in-game display order.
428
644
  */
429
- readonly effect?: string;
645
+ sort?: {
646
+ by?: BadgeSortableField;
647
+ dir?: 'asc' | 'desc';
648
+ };
430
649
  /**
431
- * A list of requirements for badges that have partial fulfilment steps, such as visiting plaques for history badges, or collecting other badges for meta-badges like accolades.
650
+ * The page (1-based)
432
651
  */
433
- readonly partials?: BadgePartial[];
652
+ page?: number;
434
653
  /**
435
- * Some badges are not included in the badge total count... such as Flames of Prometheus, which can be removed by redeeming it for a Notice of the Well.
654
+ * How many results per page
436
655
  */
437
- readonly ignoreInTotals: boolean;
438
- constructor(data: BadgeData);
439
- getPartial(key: string): BadgePartial;
656
+ pageSize?: number;
657
+ }
658
+
659
+ interface Paged<T> {
660
+ items: T[];
661
+ page: number;
662
+ pageSize?: number;
663
+ totalItems: number;
664
+ totalPages: number;
440
665
  }
441
666
 
442
- declare class VidiotMapPointOfInterest {
667
+ type KeysOfType<T, V> = {
668
+ [P in keyof T]: T[P] extends V ? P : never;
669
+ }[keyof T];
670
+ declare class AbstractIndex<T> {
671
+ protected _values: T[];
672
+ protected _hashTable: Record<string, T>;
443
673
  /**
444
- * The pixel-space position of the PoI on the map graphic.
445
- *
446
- * Screen-space, pixels from top-left `[0, 0]`.
674
+ * Create a new index.
675
+ * @param keyField The field of the values that will act as the key.
676
+ * @param values Values to index.
447
677
  */
448
- readonly pos?: [number, number];
678
+ constructor(keyField: KeysOfType<T, string>, values: T[] | undefined);
449
679
  /**
450
- * Freeform notes about the PoI.
451
- *
452
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
680
+ * Return all indexed values
453
681
  */
454
- readonly notes?: string;
682
+ get values(): T[];
455
683
  /**
456
- * If the POI is a zone transfer, the map it transfers to.
684
+ * Get a value from the index
685
+ * @param key Key string
457
686
  */
458
- readonly mapKey?: string;
687
+ get(key: string | undefined): T | undefined;
688
+ }
689
+
690
+ declare class BadgeIndex extends AbstractIndex<Badge> {
691
+ #private;
692
+ constructor(values: Badge[] | undefined);
693
+ search(options?: BadgeSearchOptions): Paged<Badge>;
694
+ }
695
+
696
+ declare class BundleHeader {
459
697
  /**
460
- * If the POI is a badge, the badge.
698
+ * Name of the content bundle.
461
699
  */
462
- readonly badgeKey?: string;
700
+ readonly name?: string;
701
+ /**
702
+ * Description of the fork.
703
+ */
704
+ readonly description?: MarkdownString;
705
+ /**
706
+ * Url for the repository where the bundle is maintained.
707
+ */
708
+ readonly repositoryUrl?: string;
709
+ /**
710
+ * Url for the location of the changelog.
711
+ */
712
+ readonly changelogUrl?: string;
463
713
  /**
464
- * If the POI is a partial for a badge, the partial key.
714
+ * List of external links. Wiki, forums, etc.
465
715
  */
466
- readonly badgePartialKey?: string;
467
- constructor(data: VidiotMapPointOfInterestData);
716
+ readonly links?: Link[];
717
+ /**
718
+ * The current version of the data package.
719
+ */
720
+ readonly version?: string;
721
+ constructor(data: BundleHeaderData | undefined);
468
722
  }
469
723
 
470
- declare class VidiotMap {
724
+ declare class Zone {
471
725
  /**
472
- * URL of the map image.
726
+ * Unique key used to reference this zone.
727
+ *
728
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
473
729
  */
474
- readonly imageUrl: string;
730
+ readonly key: string;
475
731
  /**
476
- * Name to display for the Vidiot map.
732
+ * The name of the zone as it appears in-game.
477
733
  */
478
- readonly name?: string;
734
+ readonly name: string;
479
735
  /**
480
- * List of Points of Interest labelled on the image.
736
+ * List of external links. Wiki, forums, etc.
481
737
  */
482
- readonly pointsOfInterest?: VidiotMapPointOfInterest[];
483
- constructor(data: VidiotMapData);
738
+ readonly links: Link[];
739
+ constructor(data: ZoneData);
484
740
  }
485
741
 
486
- declare class GameMap {
742
+ declare class Contact {
487
743
  /**
488
- * The database key for this map.
744
+ * Unique key used to reference this contact.
745
+ *
746
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
489
747
  */
490
748
  readonly key: string;
491
749
  /**
492
- * The name of the map as it appears in-game.
750
+ * The name of this contact.
493
751
  */
494
752
  readonly name: string;
495
753
  /**
496
- * List of external links for this Map. Wiki, forums, etc.
754
+ * The contact's title.
497
755
  */
498
- readonly links?: Link[];
756
+ readonly title?: string;
757
+ /**
758
+ * The character moralities that this contact will interact with.
759
+ */
760
+ readonly morality?: MoralityList;
761
+ /**
762
+ * The location of this contact.
763
+ */
764
+ readonly location?: Location;
499
765
  /**
500
- * List of Vidiot Map assets for this map.
766
+ * The level range this contact will offer missions for.
501
767
  */
502
- readonly vidiotMaps?: VidiotMap[];
503
- constructor(data: GameMapData);
768
+ readonly levelRange?: [number, number?];
769
+ /**
770
+ * Freeform notes or tips about the contact.
771
+ */
772
+ readonly notes?: MarkdownString;
773
+ /**
774
+ * List of external links. Wiki, forums, etc.
775
+ */
776
+ readonly links: Link[];
777
+ constructor(data: ContactData);
504
778
  }
505
779
 
506
- declare class ServerGroup {
507
- #private;
780
+ declare class Mission {
508
781
  /**
509
- * The database key for this server group.
782
+ * Unique key used to reference this mission.
783
+ *
784
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
510
785
  */
511
786
  readonly key: string;
512
787
  /**
513
- * Name of the server group.
514
- */
515
- readonly name: string;
516
- /**
517
- * Description of the server group.
788
+ * The name of the mission as it appears from the contact.
518
789
  *
519
- * Supports {@link https://www.markdownguide.org/|Markdown} format.
790
+ * The name may be different when viewed in Ouroboros as a Flashback.
520
791
  */
521
- readonly description?: string;
792
+ readonly name: string;
522
793
  /**
523
- * Repository where the db content package is maintained.
794
+ * The type of mission... Story arc, task force, trial, etc.
524
795
  */
525
- readonly repository?: string;
796
+ readonly type: MissionType;
526
797
  /**
527
- * List of external links for this Server Group. Wiki, forums, etc.
798
+ * The character moralities that may accept the mission.
528
799
  */
529
- readonly links?: Link[];
800
+ readonly morality: MoralityList;
530
801
  /**
531
- * List of the game server names in this server group.
532
- * Torchbearer, Excelsior, etc.
802
+ * The keys of any contacts that provide this mission.
533
803
  */
534
- readonly servers: string[];
804
+ readonly contactKeys?: string[];
535
805
  /**
536
- * List of archetypes available in this server group.
806
+ * The level range this mission is available for.
537
807
  */
538
- readonly archetypes: Archetype[];
808
+ readonly levelRange?: [number, number?];
539
809
  /**
540
- * List of game maps supported by this server group.
810
+ * Freeform notes or tips about the mission.
541
811
  */
542
- readonly maps: GameMap[];
812
+ readonly notes?: MarkdownString;
543
813
  /**
544
- * List of badges available on this server group.
814
+ * List of external links. Wiki, forums, etc.
545
815
  */
546
- readonly badges: Badge[];
816
+ readonly links: Link[];
547
817
  /**
548
- * Change log for this data package.
818
+ * If the mission is available in Ouroboros as a Flashback.
549
819
  */
550
- readonly changelog?: Change[];
551
- constructor(data: ServerGroupData);
552
- getArchetype(key: string): Archetype;
553
- getMap(key: string): GameMap;
554
- getBadge(key: string): Badge;
820
+ readonly flashback?: {
821
+ /**
822
+ * The id of the mission as seen in the Flashback menu, i.e. '14.01'.
823
+ */
824
+ readonly id: string;
825
+ /**
826
+ * The level range this mission appears under as a Flashback. Leave undefined if the same as the base mission.
827
+ */
828
+ readonly levelRange?: [number, number?];
829
+ /**
830
+ * The name as it appears in the Flashback list. Leave undefined if the same as the base mission.
831
+ */
832
+ readonly name?: string;
833
+ /**
834
+ * The character moralities that the mission will appear for in the Flashback list. Leave undefined if the same as the base mission.
835
+ */
836
+ readonly morality?: MoralityList;
837
+ /**
838
+ * Freeform notes or tips about the Flashback version of the mission.
839
+ */
840
+ readonly notes?: MarkdownString;
841
+ };
842
+ constructor(data: MissionData);
555
843
  }
556
844
 
557
845
  declare class CohContentDatabase {
558
846
  #private;
559
847
  /**
560
- * Load a server group data package into the database.
561
- * @param data The data to load.
848
+ * Create a db instance from the given content bundle.
849
+ * @param bundle The bundle to load.
850
+ */
851
+ constructor(bundle: BundleData);
852
+ /**
853
+ * Header information about the content bundle.
854
+ */
855
+ get header(): BundleHeader;
856
+ /**
857
+ * List of the game server names.
858
+ *
859
+ * Torchbearer, Excelsior, etc.
860
+ */
861
+ get servers(): string[];
862
+ /**
863
+ * List of archetypes.
864
+ */
865
+ get archetypes(): Archetype[];
866
+ /**
867
+ * Get archetype by key.
868
+ * @param key The key.
869
+ */
870
+ getArchetype(key: string | undefined): Archetype | undefined;
871
+ /**
872
+ * List of game zones.
873
+ */
874
+ get zones(): Zone[];
875
+ /**
876
+ * Get zone by key.
877
+ * @param key The key.
878
+ */
879
+ getZone(key: string | undefined): Zone | undefined;
880
+ /**
881
+ * List of contacts.
882
+ */
883
+ get contacts(): Contact[];
884
+ /**
885
+ * Get contact by key.
886
+ * @param key The key.
887
+ */
888
+ getContact(key: string | undefined): Contact | undefined;
889
+ /**
890
+ * List of missions.
891
+ */
892
+ get missions(): Mission[];
893
+ /**
894
+ * Get mission by key.
895
+ * @param key The key.
896
+ */
897
+ getMission(key: string | undefined): Mission | undefined;
898
+ /**
899
+ * List of badges.
562
900
  */
563
- loadServerGroupData(data: ServerGroupData): void;
901
+ get badges(): Badge[];
564
902
  /**
565
- * Get all the server groups currently loaded in the database.
903
+ * Get badge by key.
904
+ * @param key The key.
566
905
  */
567
- listServerGroups(): ServerGroup[];
906
+ getBadge(key: string | undefined): Badge | undefined;
568
907
  /**
569
- * get a server group by key.
570
- * @param serverGroupKey The key.
908
+ * Search, sort and filter the badge list.
909
+ * This is a fairly brute-forced approach and will not be as performant as loading the badge data into a traditional
910
+ * database engine, but is sufficient for most operations.
911
+ * @param options {@link BadgeSearchOptions}
571
912
  */
572
- getServerGroup(serverGroupKey: string): ServerGroup | null;
913
+ searchBadges(options?: BadgeSearchOptions): Paged<Badge>;
573
914
  }
574
915
 
575
916
  declare class Key {
@@ -578,21 +919,79 @@ declare class Key {
578
919
  get value(): string;
579
920
  }
580
921
 
581
- declare const CHANGELOG: Change[];
582
-
583
922
  /**
584
- * Create a reference string that can be used in most text strings to display a link to the given badge.
923
+ * Returns the URI of the given badge that can be used in {@link MarkdownString} fields.
924
+ *
925
+ * URI format: `badge://<key>`
926
+ *
585
927
  * @param target The badge or badge key to target.
586
928
  */
587
- declare function createBadgeReference(target: string | {
588
- key: string;
589
- }): string;
929
+ declare function badgeUri(target: string | Badge | BadgeData): string;
930
+ /**
931
+ * Returns a {@link MarkdownString} link to the given badge.
932
+ *
933
+ * Link format: `[<key>](badge://<key>)`
934
+ *
935
+ * @param target The {@link Badge} or badge key to target.
936
+ */
937
+ declare function badgeLink(target: string | Badge | BadgeData): string;
938
+ /**
939
+ * Returns the URI of the given contact that can be used in {@link MarkdownString} fields.
940
+ *
941
+ * URI format: `contact://<key>`
942
+ *
943
+ * @param target The {@link Contact} or contact key to target.
944
+ */
945
+ declare function contactUri(target: string | Contact | ContactData): string;
946
+ /**
947
+ * Returns a {@link MarkdownString} link to the given contact.
948
+ *
949
+ * Link format: `[<key>](contact://<key>)`
950
+ *
951
+ * @param target The {@link Contact} or contact key to target.
952
+ */
953
+ declare function contactLink(target: string | Contact | ContactData): string;
954
+ /**
955
+ * Returns the URI of the given mission that can be used in {@link MarkdownString} fields.
956
+ *
957
+ * URI format: `mission://<key>`
958
+ *
959
+ * @param target The {@link Mission} or mission key to target.
960
+ */
961
+ declare function missionUri(target: string | Mission | MissionData): string;
962
+ /**
963
+ * Returns a {@link MarkdownString} link to the given mission.
964
+ *
965
+ * Link format: `[<key>](mission://<key>)`
966
+ *
967
+ * @param target The {@link Mission} or mission key to target.
968
+ */
969
+ declare function missionLink(target: string | Mission | MissionData): string;
970
+ /**
971
+ * Returns the URI of the given zone that can be used in {@link MarkdownString} fields.
972
+ *
973
+ * URI format: `zone://<key>`
974
+ *
975
+ * @param target The {@link Zone} or zone key to target.
976
+ */
977
+ declare function zoneUri(target: string | Zone | ZoneData): string;
978
+ /**
979
+ * Returns a {@link MarkdownString} link to the given zone.
980
+ *
981
+ * Link format: `[<key>](zone://<key>)`
982
+ *
983
+ * @param target The {@link Zone} or zone key to target.
984
+ */
985
+ declare function zoneLink(target: string | Zone | ZoneData): string;
590
986
  /**
591
- * Create a reference string that can be used in most text strings to display a link to the given map.
592
- * @param target The {@link GameMap} or map key to target.
987
+ * For fields that accept either an array of values or a single value, coalesces the value to an array.
988
+ *
989
+ * Arrays are returned as-is.
990
+ * Single values are returned as a single-value array.
991
+ * Undefined values are returned as undefined.
992
+ *
993
+ * @param value The value to coalesce.
593
994
  */
594
- declare function createMapReference(target: string | {
595
- key: string;
596
- }): string;
995
+ declare function coalesceToArray<T>(value?: T | T[]): T[] | undefined;
597
996
 
598
- export { ALIGNMENT, type Alignment, type AlternateData, Archetype, type ArchetypeData, BADGE_PARTIAL_TYPE, BADGE_TYPE, Badge, type BadgeData, BadgePartial, type BadgePartialData, type BadgePartialType, type BadgeType, CHANGELOG, type Change, CohContentDatabase, ENHANCEMENT_CATEGORY, type EnhancementCategory, GameMap, type GameMapData, Key, type Link, PLAQUE_TYPE, type PlaqueType, SEX, ServerGroup, type ServerGroupData, type Sex, VidiotMap, type VidiotMapData, VidiotMapPointOfInterest, type VidiotMapPointOfInterestData, createBadgeReference, createMapReference };
997
+ export { ALIGNMENT, type Alignment, type AlignmentExtended, AlignmentList, type AlternateData, Alternates, Archetype, type ArchetypeData, BADGE_REQUIREMENT_TYPE, BADGE_TYPE, Badge, type BadgeData, BadgeIndex, type BadgeQueryableField, BadgeRequirement, type BadgeRequirementData, type BadgeRequirementType, type BadgeSearchOptions, type BadgeSortableField, type BadgeType, type BundleData, BundleHeader, type BundleHeaderData, CohContentDatabase, Contact, type ContactData, type Coords, ENHANCEMENT_CATEGORY, type EnhancementCategory, Key, type Link, Location, type LocationData, type LocationIcon, MISSION_TYPE, MORALITY, type MarkdownString, Mission, type MissionData, type MissionFlashbackData, type MissionType, type Morality, type MoralityExtended, MoralityList, type Paged, SEX, type Sex, Zone, type ZoneData, badgeLink, badgeUri, coalesceToArray, compareAlignment, compareByDefaultName, compareByZoneKey, compareSex, contactLink, contactUri, missionLink, missionUri, zoneLink, zoneUri };