coh-content-db 2.0.0-rc.5 → 2.0.0-rc.6
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/README.md +4 -4
- package/dist/coh-content-db.d.ts +203 -156
- package/dist/coh-content-db.js +263 -197
- package/dist/coh-content-db.js.map +1 -1
- package/dist/coh-content-db.mjs +256 -191
- package/dist/coh-content-db.mjs.map +1 -1
- package/package.json +1 -1
- package/src/main/api/badge-data.ts +16 -9
- package/src/main/api/{badge-partial-data.ts → badge-requirement-data.ts} +24 -8
- package/src/main/api/badge-requirement-type.ts +11 -0
- package/src/main/api/contact-data.ts +46 -0
- package/src/main/api/content-bundle.ts +10 -4
- package/src/main/api/zone-data.ts +20 -0
- package/src/main/changelog.ts +5 -1
- package/src/main/db/badge-index.ts +17 -11
- package/src/main/db/{badge-partial.ts → badge-requirement.ts} +30 -11
- package/src/main/db/badge-search-options.ts +2 -2
- package/src/main/db/badge.ts +48 -36
- package/src/main/db/bundle-metadata.ts +3 -3
- package/src/main/db/coh-content-database.ts +51 -18
- package/src/main/db/contact.ts +59 -0
- package/src/main/db/zone.ts +28 -0
- package/src/main/index.ts +8 -10
- package/src/main/util.ts +44 -13
- package/src/test/api/badge-data.fixture.ts +9 -7
- package/src/test/api/badge-requirement-data.fixture.ts +17 -0
- package/src/test/api/badge-requirement-type.test.ts +31 -0
- package/src/test/api/contact-data.fixture.ts +13 -0
- package/src/test/api/content-bundle.fixture.ts +2 -2
- package/src/test/api/content-bundle.test.ts +1 -1
- package/src/test/api/zone-data.fixture.ts +8 -0
- package/src/test/db/badge-index.test.ts +73 -41
- package/src/test/db/badge-requirement.test.ts +180 -0
- package/src/test/db/badge.test.ts +190 -15
- package/src/test/db/coh-content-database.test.ts +110 -18
- package/src/test/db/contact.test.ts +96 -0
- package/src/test/db/zone.test.ts +36 -0
- package/src/test/index.test.ts +4 -2
- package/src/test/util.test.ts +59 -22
- package/src/main/api/badge-partial-type.ts +0 -8
- package/src/main/api/game-map-data.ts +0 -26
- package/src/main/api/vidiot-map-data.ts +0 -18
- package/src/main/api/vidiot-map-point-of-interest-data.ts +0 -30
- package/src/main/db/game-map.ts +0 -33
- package/src/main/db/vidiot-map-point-of-interest.ts +0 -39
- package/src/main/db/vidiot-map.ts +0 -25
- package/src/test/api/badge-partial-data.fixture.ts +0 -17
- package/src/test/api/badge-partial-type.test.ts +0 -31
- package/src/test/api/game-map-data.fixture.ts +0 -10
- package/src/test/api/vidiot-map-point-of-interest.fixture.ts +0 -10
- package/src/test/api/vidiot-map.fixture.ts +0 -9
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ that can be loaded into the db for consumption by DB consumers such as [Badger](
|
|
|
25
25
|
|
|
26
26
|
For an example data package, see the [coh-content-db-homecoming](https://github.com/n15g/coh-content-db-homecoming) project.
|
|
27
27
|
|
|
28
|
-
### Defining archetypes,
|
|
28
|
+
### Defining archetypes, zones, badges, etc.
|
|
29
29
|
|
|
30
30
|
To define content, create a new instance using the appropriate `Data` interface and provide values for the required fields:
|
|
31
31
|
|
|
@@ -41,13 +41,13 @@ export const TEST_BADGE: BadgeData = {
|
|
|
41
41
|
}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Then, create a `
|
|
44
|
+
Then, create a `ContentBundle` instance and load your content into the appropriate field.
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
47
|
import { ContentBundle } from './content-bundle'
|
|
48
48
|
import { TEST_BADGE } from './test-badge'
|
|
49
49
|
|
|
50
|
-
export const
|
|
50
|
+
export const MY_CONTENT_BUNDLE: ContentBundle = {
|
|
51
51
|
name: 'My Content Bundle',
|
|
52
52
|
badges: [TEST_BADGE],
|
|
53
53
|
}
|
|
@@ -57,7 +57,7 @@ export const TEST_SERVER_GROUP: ContentBundle = {
|
|
|
57
57
|
|
|
58
58
|
Fields with long text values can typically accept [Markdown](https://www.markdownguide.org/) format. These fields will also be typed with the tag type [MarkdownString](src/main/api/markdown-string.ts).
|
|
59
59
|
|
|
60
|
-
Within markdown, you can construct a link to a badge or
|
|
60
|
+
Within markdown, you can construct a link to a badge or zone using the special `badge://` and `zone://` protocol indicators that consumer apps can use to provide runtime links or tooltips.
|
|
61
61
|
This replaces the custom `[badge:xyz]` format from v1 and data packages will need to update accordingly.
|
|
62
62
|
|
|
63
63
|
To create a link, use the standard Markdown link format, with the url as following:
|
package/dist/coh-content-db.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ interface ArchetypeData {
|
|
|
31
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"];
|
|
32
32
|
type EnhancementCategory = typeof ENHANCEMENT_CATEGORY[number];
|
|
33
33
|
|
|
34
|
-
declare const
|
|
35
|
-
type
|
|
34
|
+
declare const BADGE_REQUIREMENT_TYPE: readonly ["PLAQUE", "BADGE", "INVENTION", "MISSION", "ARC", "TASK_FORCE", "INVENTION_PLUS_ONE"];
|
|
35
|
+
type BadgeRequirementType = typeof BADGE_REQUIREMENT_TYPE[number];
|
|
36
36
|
|
|
37
37
|
declare const PLAQUE_TYPE: string[];
|
|
38
38
|
type PlaqueType = typeof PLAQUE_TYPE[number];
|
|
@@ -42,19 +42,24 @@ type PlaqueType = typeof PLAQUE_TYPE[number];
|
|
|
42
42
|
*/
|
|
43
43
|
type MarkdownString = string;
|
|
44
44
|
|
|
45
|
-
interface
|
|
45
|
+
interface Link {
|
|
46
|
+
title: string;
|
|
47
|
+
href: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface BadgeRequirementData {
|
|
46
51
|
/**
|
|
47
52
|
* Key.
|
|
48
53
|
*/
|
|
49
54
|
readonly key: string;
|
|
50
55
|
/**
|
|
51
|
-
* Type of
|
|
56
|
+
* Type of requirement.
|
|
52
57
|
*/
|
|
53
|
-
readonly type:
|
|
58
|
+
readonly type: BadgeRequirementType;
|
|
54
59
|
/**
|
|
55
|
-
*
|
|
60
|
+
* Zone the requirement is located in.
|
|
56
61
|
*/
|
|
57
|
-
readonly
|
|
62
|
+
readonly zoneKey?: string;
|
|
58
63
|
/**
|
|
59
64
|
* /loc coordinates.
|
|
60
65
|
*/
|
|
@@ -68,13 +73,21 @@ interface BadgePartialData {
|
|
|
68
73
|
*/
|
|
69
74
|
readonly plaqueInscription?: string;
|
|
70
75
|
/**
|
|
71
|
-
* The number or letter the
|
|
76
|
+
* The number or letter the plaque appears as on Vidiot Maps.
|
|
72
77
|
*/
|
|
73
78
|
readonly vidiotMapKey?: string;
|
|
74
79
|
/**
|
|
75
|
-
* The badge
|
|
80
|
+
* The key of the badge for this requirement.
|
|
76
81
|
*/
|
|
77
82
|
readonly badgeKey?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Mission name.
|
|
85
|
+
*/
|
|
86
|
+
readonly missionName?: string;
|
|
87
|
+
/**
|
|
88
|
+
* {@link Contact} key for the story arc.
|
|
89
|
+
*/
|
|
90
|
+
readonly contactKey?: string;
|
|
78
91
|
/**
|
|
79
92
|
* Level of the invention required.
|
|
80
93
|
*/
|
|
@@ -91,11 +104,10 @@ interface BadgePartialData {
|
|
|
91
104
|
* Any additional notes.
|
|
92
105
|
*/
|
|
93
106
|
readonly notes?: MarkdownString;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
href: string;
|
|
107
|
+
/**
|
|
108
|
+
* List of external links. Wiki, forums, etc.
|
|
109
|
+
*/
|
|
110
|
+
readonly links?: Link[];
|
|
99
111
|
}
|
|
100
112
|
|
|
101
113
|
declare const BADGE_TYPE: readonly ["EXPLORATION", "HISTORY", "ACCOMPLISHMENT", "ACHIEVEMENT", "ACCOLADE", "GLADIATOR", "VETERAN", "PVP", "INVENTION", "DEFEAT", "EVENT", "OUROBOROS", "CONSIGNMENT", "DAY_JOB", "AE"];
|
|
@@ -127,7 +139,7 @@ interface BadgeData {
|
|
|
127
139
|
*/
|
|
128
140
|
readonly badgeText?: AlternateData<string>[];
|
|
129
141
|
/**
|
|
130
|
-
*
|
|
142
|
+
* Short description of how to acquire the badge. Detailed instructions should go in the notes field.
|
|
131
143
|
*/
|
|
132
144
|
readonly acquisition?: MarkdownString;
|
|
133
145
|
/**
|
|
@@ -141,19 +153,19 @@ interface BadgeData {
|
|
|
141
153
|
*/
|
|
142
154
|
readonly notes?: MarkdownString;
|
|
143
155
|
/**
|
|
144
|
-
* List of external links
|
|
156
|
+
* List of external links. Wiki, forums, etc.
|
|
145
157
|
*/
|
|
146
158
|
readonly links?: Link[];
|
|
147
159
|
/**
|
|
148
|
-
* For exploration badges, the key of the {@link
|
|
160
|
+
* For exploration badges, the key of the {@link ZoneData|Zone} that this badge is found on.
|
|
149
161
|
*/
|
|
150
|
-
readonly
|
|
162
|
+
readonly zoneKey?: string;
|
|
151
163
|
/**
|
|
152
|
-
* For exploration badges, the `/loc` coordinates of the badge
|
|
164
|
+
* For exploration badges, the `/loc` coordinates of the badge.
|
|
153
165
|
*/
|
|
154
166
|
readonly loc?: [number, number, number];
|
|
155
167
|
/**
|
|
156
|
-
* For
|
|
168
|
+
* For plaques that appear on a Vidiot Map, the number or letter the badge appears as.
|
|
157
169
|
*/
|
|
158
170
|
readonly vidiotMapKey?: string;
|
|
159
171
|
/**
|
|
@@ -174,9 +186,16 @@ interface BadgeData {
|
|
|
174
186
|
*/
|
|
175
187
|
readonly effect?: MarkdownString;
|
|
176
188
|
/**
|
|
177
|
-
*
|
|
189
|
+
* Represents the layered requirements for badges with multiple fulfillment steps,
|
|
190
|
+
* such as visiting plaques for history badges or collecting other badges.
|
|
191
|
+
*
|
|
192
|
+
* The outer array represents groups of requirements evaluated with OR logic —
|
|
193
|
+
* fulfilling any group satisfies the badge.
|
|
194
|
+
*
|
|
195
|
+
* Each inner array represents individual requirements evaluated with AND logic —
|
|
196
|
+
* all conditions in the group must be met.
|
|
178
197
|
*/
|
|
179
|
-
readonly
|
|
198
|
+
readonly requirements?: BadgeRequirementData[][];
|
|
180
199
|
/**
|
|
181
200
|
* 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.
|
|
182
201
|
*/
|
|
@@ -198,65 +217,58 @@ interface Change {
|
|
|
198
217
|
description: MarkdownString;
|
|
199
218
|
}
|
|
200
219
|
|
|
201
|
-
interface
|
|
220
|
+
interface ContactData {
|
|
202
221
|
/**
|
|
203
|
-
*
|
|
222
|
+
* Unique key used to reference this contact.
|
|
204
223
|
*
|
|
205
|
-
*
|
|
224
|
+
* Keys can only contain lowercase letters, numbers and hyphens (`-`).
|
|
206
225
|
*/
|
|
207
|
-
readonly
|
|
226
|
+
readonly key: string;
|
|
208
227
|
/**
|
|
209
|
-
*
|
|
228
|
+
* The name of this contact.
|
|
210
229
|
*/
|
|
211
|
-
readonly
|
|
230
|
+
readonly name: string;
|
|
212
231
|
/**
|
|
213
|
-
*
|
|
232
|
+
* The contact's title.
|
|
214
233
|
*/
|
|
215
|
-
readonly
|
|
234
|
+
readonly title?: string;
|
|
216
235
|
/**
|
|
217
|
-
*
|
|
236
|
+
* The zone this character is located in.
|
|
218
237
|
*/
|
|
219
|
-
readonly
|
|
238
|
+
readonly zoneKey?: string;
|
|
220
239
|
/**
|
|
221
|
-
*
|
|
240
|
+
* The `/loc` coordinates of the contact.
|
|
222
241
|
*/
|
|
223
|
-
readonly
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
interface VidiotMapData {
|
|
242
|
+
readonly loc?: [number, number, number];
|
|
227
243
|
/**
|
|
228
|
-
*
|
|
244
|
+
* The level range this contact will offer missions for.
|
|
229
245
|
*/
|
|
230
|
-
readonly
|
|
246
|
+
readonly levelRange?: [number, number?];
|
|
231
247
|
/**
|
|
232
|
-
*
|
|
248
|
+
* Freeform notes or tips about the contact.
|
|
233
249
|
*/
|
|
234
|
-
readonly
|
|
250
|
+
readonly notes?: MarkdownString;
|
|
235
251
|
/**
|
|
236
|
-
* List of
|
|
252
|
+
* List of external links. Wiki, forums, etc.
|
|
237
253
|
*/
|
|
238
|
-
readonly
|
|
254
|
+
readonly links?: Link[];
|
|
239
255
|
}
|
|
240
256
|
|
|
241
|
-
interface
|
|
257
|
+
interface ZoneData {
|
|
242
258
|
/**
|
|
243
|
-
* Unique key used to reference this
|
|
259
|
+
* Unique key used to reference this zone.
|
|
244
260
|
*
|
|
245
261
|
* Keys can only contain lowercase letters, numbers and hyphens (`-`).
|
|
246
262
|
*/
|
|
247
263
|
readonly key: string;
|
|
248
264
|
/**
|
|
249
|
-
* The name of the
|
|
265
|
+
* The name of the zone as it appears in-game.
|
|
250
266
|
*/
|
|
251
267
|
readonly name: string;
|
|
252
268
|
/**
|
|
253
|
-
* List of external links
|
|
269
|
+
* List of external links. Wiki, forums, etc.
|
|
254
270
|
*/
|
|
255
271
|
readonly links?: Link[];
|
|
256
|
-
/**
|
|
257
|
-
* List of Vidiot Map assets for this map.
|
|
258
|
-
*/
|
|
259
|
-
readonly vidiotMaps?: VidiotMapData[];
|
|
260
272
|
}
|
|
261
273
|
|
|
262
274
|
/**
|
|
@@ -276,7 +288,7 @@ interface ContentBundle {
|
|
|
276
288
|
*/
|
|
277
289
|
readonly repository?: string;
|
|
278
290
|
/**
|
|
279
|
-
* List of external links
|
|
291
|
+
* List of external links. Wiki, forums, etc.
|
|
280
292
|
*/
|
|
281
293
|
readonly links?: Link[];
|
|
282
294
|
/**
|
|
@@ -289,9 +301,13 @@ interface ContentBundle {
|
|
|
289
301
|
*/
|
|
290
302
|
readonly archetypes?: ArchetypeData[];
|
|
291
303
|
/**
|
|
292
|
-
* List of
|
|
304
|
+
* List of zones supported by this fork.
|
|
293
305
|
*/
|
|
294
|
-
readonly
|
|
306
|
+
readonly zones?: ZoneData[];
|
|
307
|
+
/**
|
|
308
|
+
* List of contacts available in this fork.
|
|
309
|
+
*/
|
|
310
|
+
readonly contacts?: ContactData[];
|
|
295
311
|
/**
|
|
296
312
|
* List of badges available on this fork.
|
|
297
313
|
*/
|
|
@@ -337,19 +353,19 @@ declare class Archetype {
|
|
|
337
353
|
constructor(data: ArchetypeData);
|
|
338
354
|
}
|
|
339
355
|
|
|
340
|
-
declare class
|
|
356
|
+
declare class BadgeRequirement {
|
|
341
357
|
/**
|
|
342
358
|
* Key.
|
|
343
359
|
*/
|
|
344
360
|
readonly key: string;
|
|
345
361
|
/**
|
|
346
|
-
* Type of
|
|
362
|
+
* Type of requirement.
|
|
347
363
|
*/
|
|
348
|
-
readonly type:
|
|
364
|
+
readonly type: BadgeRequirementType;
|
|
349
365
|
/**
|
|
350
|
-
*
|
|
366
|
+
* Zone the requirement is located in.
|
|
351
367
|
*/
|
|
352
|
-
readonly
|
|
368
|
+
readonly zoneKey?: string;
|
|
353
369
|
/**
|
|
354
370
|
* /loc coordinates.
|
|
355
371
|
*/
|
|
@@ -363,13 +379,21 @@ declare class BadgePartial {
|
|
|
363
379
|
*/
|
|
364
380
|
readonly plaqueInscription?: string;
|
|
365
381
|
/**
|
|
366
|
-
* The number or letter the
|
|
382
|
+
* The number or letter the plaque appears as on Vidiot Maps.
|
|
367
383
|
*/
|
|
368
384
|
readonly vidiotMapKey?: string;
|
|
369
385
|
/**
|
|
370
|
-
* The badge
|
|
386
|
+
* The key of the badge for this requirement.
|
|
371
387
|
*/
|
|
372
388
|
readonly badgeKey?: string;
|
|
389
|
+
/**
|
|
390
|
+
* Mission name.
|
|
391
|
+
*/
|
|
392
|
+
readonly missionName?: string;
|
|
393
|
+
/**
|
|
394
|
+
* {@link Contact} key for the story arc.
|
|
395
|
+
*/
|
|
396
|
+
readonly contactKey?: string;
|
|
373
397
|
/**
|
|
374
398
|
* Level of the invention required.
|
|
375
399
|
*/
|
|
@@ -386,7 +410,11 @@ declare class BadgePartial {
|
|
|
386
410
|
* Any additional notes.
|
|
387
411
|
*/
|
|
388
412
|
readonly notes?: MarkdownString;
|
|
389
|
-
|
|
413
|
+
/**
|
|
414
|
+
* List of external links. Wiki, forums, etc.
|
|
415
|
+
*/
|
|
416
|
+
readonly links: Link[];
|
|
417
|
+
constructor(data: BadgeRequirementData);
|
|
390
418
|
}
|
|
391
419
|
|
|
392
420
|
declare class Badge {
|
|
@@ -414,7 +442,7 @@ declare class Badge {
|
|
|
414
442
|
*/
|
|
415
443
|
readonly badgeText: Alternates<string>;
|
|
416
444
|
/**
|
|
417
|
-
*
|
|
445
|
+
* Short description of how to acquire the badge. Detailed instructions will be in the notes field.
|
|
418
446
|
*/
|
|
419
447
|
readonly acquisition?: MarkdownString;
|
|
420
448
|
/**
|
|
@@ -428,19 +456,19 @@ declare class Badge {
|
|
|
428
456
|
*/
|
|
429
457
|
readonly notes?: MarkdownString;
|
|
430
458
|
/**
|
|
431
|
-
* List of external links
|
|
459
|
+
* List of external links. Wiki, forums, etc.
|
|
432
460
|
*/
|
|
433
|
-
readonly links
|
|
461
|
+
readonly links: Link[];
|
|
434
462
|
/**
|
|
435
|
-
* For exploration badges, the key of the {@link
|
|
463
|
+
* For exploration badges, the key of the {@link Zone} that this badge is found on.
|
|
436
464
|
*/
|
|
437
|
-
readonly
|
|
465
|
+
readonly zoneKey?: string;
|
|
438
466
|
/**
|
|
439
|
-
* For exploration badges, the `/loc` coordinates of the badge
|
|
467
|
+
* For exploration badges, the `/loc` coordinates of the badge.
|
|
440
468
|
*/
|
|
441
469
|
readonly loc?: [number, number, number];
|
|
442
470
|
/**
|
|
443
|
-
* For
|
|
471
|
+
* For plaques that appear on a Vidiot Map, the number or letter the badge appears as.
|
|
444
472
|
*/
|
|
445
473
|
readonly vidiotMapKey?: string;
|
|
446
474
|
/**
|
|
@@ -461,15 +489,22 @@ declare class Badge {
|
|
|
461
489
|
*/
|
|
462
490
|
readonly effect?: MarkdownString;
|
|
463
491
|
/**
|
|
464
|
-
*
|
|
492
|
+
* Represents the layered requirements for badges with multiple fulfillment steps,
|
|
493
|
+
* such as visiting plaques for history badges or collecting other badges.
|
|
494
|
+
*
|
|
495
|
+
* The outer array represents groups of requirements evaluated with OR logic —
|
|
496
|
+
* fulfilling any group satisfies the badge.
|
|
497
|
+
*
|
|
498
|
+
* Each inner array represents individual requirements evaluated with AND logic —
|
|
499
|
+
* all conditions in the group must be met.
|
|
465
500
|
*/
|
|
466
|
-
readonly
|
|
501
|
+
readonly requirements?: BadgeRequirement[][];
|
|
467
502
|
/**
|
|
468
503
|
* 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.
|
|
469
504
|
*/
|
|
470
505
|
readonly ignoreInTotals: boolean;
|
|
471
|
-
constructor(
|
|
472
|
-
|
|
506
|
+
constructor(badgeData: BadgeData);
|
|
507
|
+
getRequirement(key: string): BadgeRequirement;
|
|
473
508
|
}
|
|
474
509
|
|
|
475
510
|
interface BadgeSearchOptions {
|
|
@@ -494,7 +529,7 @@ interface BadgeSearchOptions {
|
|
|
494
529
|
*/
|
|
495
530
|
filter?: {
|
|
496
531
|
type?: BadgeType;
|
|
497
|
-
|
|
532
|
+
zoneKey?: string;
|
|
498
533
|
alignment?: Alignment;
|
|
499
534
|
};
|
|
500
535
|
/**
|
|
@@ -503,7 +538,7 @@ interface BadgeSearchOptions {
|
|
|
503
538
|
* Badges are assumed to be in canonical order in the content bundle, and should match the in-game display order.
|
|
504
539
|
*/
|
|
505
540
|
sort?: {
|
|
506
|
-
by?: 'CANONICAL' | 'BADGE_NAME' | '
|
|
541
|
+
by?: 'CANONICAL' | 'BADGE_NAME' | 'ZONE_NAME';
|
|
507
542
|
dir?: 'ASC' | 'DESC';
|
|
508
543
|
};
|
|
509
544
|
/**
|
|
@@ -516,66 +551,22 @@ interface BadgeSearchOptions {
|
|
|
516
551
|
pageSize?: number;
|
|
517
552
|
}
|
|
518
553
|
|
|
519
|
-
declare class
|
|
554
|
+
declare class Zone {
|
|
520
555
|
/**
|
|
521
|
-
*
|
|
556
|
+
* Unique key used to reference this zone.
|
|
522
557
|
*
|
|
523
|
-
*
|
|
524
|
-
*/
|
|
525
|
-
readonly pos?: [number, number];
|
|
526
|
-
/**
|
|
527
|
-
* Freeform notes about the PoI.
|
|
528
|
-
*/
|
|
529
|
-
readonly notes?: MarkdownString;
|
|
530
|
-
/**
|
|
531
|
-
* If the POI is a zone transfer, the map it transfers to.
|
|
532
|
-
*/
|
|
533
|
-
readonly mapKey?: string;
|
|
534
|
-
/**
|
|
535
|
-
* If the POI is a badge, the badge.
|
|
536
|
-
*/
|
|
537
|
-
readonly badgeKey?: string;
|
|
538
|
-
/**
|
|
539
|
-
* If the POI is a partial for a badge, the partial key.
|
|
540
|
-
*/
|
|
541
|
-
readonly badgePartialKey?: string;
|
|
542
|
-
constructor(data: VidiotMapPointOfInterestData);
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
declare class VidiotMap {
|
|
546
|
-
/**
|
|
547
|
-
* URL of the map image.
|
|
548
|
-
*/
|
|
549
|
-
readonly imageUrl: string;
|
|
550
|
-
/**
|
|
551
|
-
* Name to display for the Vidiot map.
|
|
552
|
-
*/
|
|
553
|
-
readonly name?: string;
|
|
554
|
-
/**
|
|
555
|
-
* List of Points of Interest labelled on the image.
|
|
556
|
-
*/
|
|
557
|
-
readonly pointsOfInterest?: VidiotMapPointOfInterest[];
|
|
558
|
-
constructor(data: VidiotMapData);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
declare class GameMap {
|
|
562
|
-
/**
|
|
563
|
-
* The database key for this map.
|
|
558
|
+
* Keys can only contain lowercase letters, numbers and hyphens (`-`).
|
|
564
559
|
*/
|
|
565
560
|
readonly key: string;
|
|
566
561
|
/**
|
|
567
|
-
* The name of the
|
|
562
|
+
* The name of the zone as it appears in-game.
|
|
568
563
|
*/
|
|
569
564
|
readonly name: string;
|
|
570
565
|
/**
|
|
571
|
-
* List of external links
|
|
572
|
-
*/
|
|
573
|
-
readonly links?: Link[];
|
|
574
|
-
/**
|
|
575
|
-
* List of Vidiot Map assets for this map.
|
|
566
|
+
* List of external links. Wiki, forums, etc.
|
|
576
567
|
*/
|
|
577
|
-
readonly
|
|
578
|
-
constructor(data:
|
|
568
|
+
readonly links: Link[];
|
|
569
|
+
constructor(data: ZoneData);
|
|
579
570
|
}
|
|
580
571
|
|
|
581
572
|
interface Paged<T> {
|
|
@@ -588,18 +579,19 @@ interface Paged<T> {
|
|
|
588
579
|
|
|
589
580
|
declare class BadgeIndex {
|
|
590
581
|
#private;
|
|
591
|
-
constructor(badges: Badge[],
|
|
582
|
+
constructor(badges: Badge[], zones?: Zone[]);
|
|
592
583
|
getBadge(key: string): Badge;
|
|
584
|
+
badgeExists(key: string): boolean;
|
|
593
585
|
searchBadges(options?: BadgeSearchOptions): Paged<Badge>;
|
|
594
586
|
}
|
|
595
587
|
|
|
596
588
|
declare class BundleMetadata {
|
|
597
589
|
/**
|
|
598
|
-
* Name of the
|
|
590
|
+
* Name of the content bundle.
|
|
599
591
|
*/
|
|
600
592
|
readonly name: string;
|
|
601
593
|
/**
|
|
602
|
-
* Description of the
|
|
594
|
+
* Description of the fork.
|
|
603
595
|
*/
|
|
604
596
|
readonly description?: MarkdownString;
|
|
605
597
|
/**
|
|
@@ -607,7 +599,7 @@ declare class BundleMetadata {
|
|
|
607
599
|
*/
|
|
608
600
|
readonly repository?: string;
|
|
609
601
|
/**
|
|
610
|
-
* List of external links
|
|
602
|
+
* List of external links. Wiki, forums, etc.
|
|
611
603
|
*/
|
|
612
604
|
readonly links: Link[];
|
|
613
605
|
/**
|
|
@@ -617,6 +609,44 @@ declare class BundleMetadata {
|
|
|
617
609
|
constructor(bundle: ContentBundle);
|
|
618
610
|
}
|
|
619
611
|
|
|
612
|
+
declare class Contact {
|
|
613
|
+
/**
|
|
614
|
+
* Unique key used to reference this contact.
|
|
615
|
+
*
|
|
616
|
+
* Keys can only contain lowercase letters, numbers and hyphens (`-`).
|
|
617
|
+
*/
|
|
618
|
+
readonly key: string;
|
|
619
|
+
/**
|
|
620
|
+
* The name of this contact.
|
|
621
|
+
*/
|
|
622
|
+
readonly name: string;
|
|
623
|
+
/**
|
|
624
|
+
* The contact's title.
|
|
625
|
+
*/
|
|
626
|
+
readonly title?: string;
|
|
627
|
+
/**
|
|
628
|
+
* The zone this character is located in.
|
|
629
|
+
*/
|
|
630
|
+
readonly zoneKey?: string;
|
|
631
|
+
/**
|
|
632
|
+
* The `/loc` coordinates of the contact.
|
|
633
|
+
*/
|
|
634
|
+
readonly loc?: [number, number, number];
|
|
635
|
+
/**
|
|
636
|
+
* The level range this contact will offer missions for.
|
|
637
|
+
*/
|
|
638
|
+
readonly levelRange?: [number, number?];
|
|
639
|
+
/**
|
|
640
|
+
* Freeform notes or tips about the contact.
|
|
641
|
+
*/
|
|
642
|
+
readonly notes?: MarkdownString;
|
|
643
|
+
/**
|
|
644
|
+
* List of external links. Wiki, forums, etc.
|
|
645
|
+
*/
|
|
646
|
+
readonly links: Link[];
|
|
647
|
+
constructor(contactData: ContactData);
|
|
648
|
+
}
|
|
649
|
+
|
|
620
650
|
declare class CohContentDatabase {
|
|
621
651
|
#private;
|
|
622
652
|
/**
|
|
@@ -624,20 +654,25 @@ declare class CohContentDatabase {
|
|
|
624
654
|
*/
|
|
625
655
|
readonly metadata: BundleMetadata;
|
|
626
656
|
/**
|
|
627
|
-
* List of the game server names
|
|
657
|
+
* List of the game server names.
|
|
658
|
+
*
|
|
628
659
|
* Torchbearer, Excelsior, etc.
|
|
629
660
|
*/
|
|
630
661
|
readonly servers: string[];
|
|
631
662
|
/**
|
|
632
|
-
* List of archetypes
|
|
663
|
+
* List of archetypes.
|
|
633
664
|
*/
|
|
634
665
|
readonly archetypes: Archetype[];
|
|
635
666
|
/**
|
|
636
|
-
* List of game
|
|
667
|
+
* List of game zones.
|
|
668
|
+
*/
|
|
669
|
+
readonly zones: Zone[];
|
|
670
|
+
/**
|
|
671
|
+
* List of contacts.
|
|
637
672
|
*/
|
|
638
|
-
readonly
|
|
673
|
+
readonly contacts: Contact[];
|
|
639
674
|
/**
|
|
640
|
-
* List of badges
|
|
675
|
+
* List of badges.
|
|
641
676
|
*/
|
|
642
677
|
readonly badges: Badge[];
|
|
643
678
|
/**
|
|
@@ -646,8 +681,12 @@ declare class CohContentDatabase {
|
|
|
646
681
|
*/
|
|
647
682
|
constructor(bundle: ContentBundle);
|
|
648
683
|
getArchetype(key: string): Archetype;
|
|
649
|
-
|
|
684
|
+
getZone(key: string): Zone;
|
|
685
|
+
getContact(key: string): Contact;
|
|
686
|
+
zoneExists(key: string): boolean;
|
|
687
|
+
contactExists(key: string): boolean;
|
|
650
688
|
getBadge(key: string): Badge;
|
|
689
|
+
badgeExists(key: string): boolean;
|
|
651
690
|
/**
|
|
652
691
|
* Search, sort and filter the badge list.
|
|
653
692
|
* This is a fairly brute-forced approach and will not be as performant as loading the badge data into a traditional
|
|
@@ -672,38 +711,46 @@ declare const CHANGELOG: Change[];
|
|
|
672
711
|
*
|
|
673
712
|
* @param target The badge or badge key to target.
|
|
674
713
|
*/
|
|
675
|
-
declare function badgeUri(target: string |
|
|
676
|
-
key: string;
|
|
677
|
-
}): string;
|
|
714
|
+
declare function badgeUri(target: string | Badge | BadgeData): string;
|
|
678
715
|
/**
|
|
679
716
|
* Returns a {@link MarkdownString} link to the given badge.
|
|
680
717
|
*
|
|
681
718
|
* Link format: `[<key>](badge://<key>)`
|
|
682
719
|
*
|
|
683
|
-
* @param target The
|
|
720
|
+
* @param target The {@link Badge} or badge key to target.
|
|
721
|
+
*/
|
|
722
|
+
declare function badgeLink(target: string | Badge | BadgeData): string;
|
|
723
|
+
/**
|
|
724
|
+
* Returns the URI of the given contact that can be used in {@link MarkdownString} links.
|
|
725
|
+
*
|
|
726
|
+
* URI format: `contact://<key>`
|
|
727
|
+
*
|
|
728
|
+
* @param target The {@link Contact} or contact key to target.
|
|
729
|
+
*/
|
|
730
|
+
declare function contactUri(target: string | Contact | ContactData): string;
|
|
731
|
+
/**
|
|
732
|
+
* Returns a {@link MarkdownString} link to the given contact.
|
|
733
|
+
*
|
|
734
|
+
* Link format: `[<key>](contact://<key>)`
|
|
735
|
+
*
|
|
736
|
+
* @param target The {@link Contact} or contact key to target.
|
|
684
737
|
*/
|
|
685
|
-
declare function
|
|
686
|
-
key: string;
|
|
687
|
-
}): string;
|
|
738
|
+
declare function contactLink(target: string | Contact | ContactData): string;
|
|
688
739
|
/**
|
|
689
|
-
* Returns the URI of the given
|
|
740
|
+
* Returns the URI of the given zone that can be used in {@link MarkdownString} links.
|
|
690
741
|
*
|
|
691
|
-
* URI format: `
|
|
742
|
+
* URI format: `zone://<key>`
|
|
692
743
|
*
|
|
693
|
-
* @param target The {@link
|
|
744
|
+
* @param target The {@link Zone} or zone key to target.
|
|
694
745
|
*/
|
|
695
|
-
declare function
|
|
696
|
-
key: string;
|
|
697
|
-
}): string;
|
|
746
|
+
declare function zoneUri(target: string | Zone | ZoneData): string;
|
|
698
747
|
/**
|
|
699
|
-
* Returns a {@link MarkdownString} link to the given
|
|
748
|
+
* Returns a {@link MarkdownString} link to the given zone.
|
|
700
749
|
*
|
|
701
|
-
* Link format: `[<key>](
|
|
750
|
+
* Link format: `[<key>](zone://<key>)`
|
|
702
751
|
*
|
|
703
|
-
* @param target The
|
|
752
|
+
* @param target The {@link Zone} or zone key to target.
|
|
704
753
|
*/
|
|
705
|
-
declare function
|
|
706
|
-
key: string;
|
|
707
|
-
}): string;
|
|
754
|
+
declare function zoneLink(target: string | Zone | ZoneData): string;
|
|
708
755
|
|
|
709
|
-
export { ALIGNMENT, type Alignment, Alignments, type AlternateData, Alternates, Archetype, type ArchetypeData,
|
|
756
|
+
export { ALIGNMENT, type Alignment, Alignments, type AlternateData, Alternates, Archetype, type ArchetypeData, BADGE_REQUIREMENT_TYPE, BADGE_TYPE, Badge, type BadgeData, BadgeIndex, BadgeRequirement, type BadgeRequirementData, type BadgeRequirementType, type BadgeSearchOptions, type BadgeType, BundleMetadata, CHANGELOG, type Change, CohContentDatabase, Contact, type ContactData, type ContentBundle, ENHANCEMENT_CATEGORY, type EnhancementCategory, Key, type Link, type MarkdownString, PLAQUE_TYPE, type Paged, type PlaqueType, SEX, type Sex, Zone, type ZoneData, badgeLink, badgeUri, contactLink, contactUri, zoneLink, zoneUri };
|