@retropak/types 1.0.0-draft

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 ADDED
@@ -0,0 +1,33 @@
1
+ # @retropak/types
2
+
3
+ TypeScript type definitions for Retropak manifests, automatically generated from the JSON Schema.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @retropak/types
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import type { RetropakManifest } from '@retropak/types';
15
+
16
+ const manifest: RetropakManifest = {
17
+ // Your manifest data with full type safety
18
+ };
19
+ ```
20
+
21
+ ## Development
22
+
23
+ This package is part of the Retropak monorepo. Types are automatically generated from the JSON Schema.
24
+
25
+ To regenerate types after schema changes:
26
+
27
+ ```bash
28
+ npm run build
29
+ ```
30
+
31
+ ## License
32
+
33
+ CC0-1.0
@@ -0,0 +1,497 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * A classification for the type/nature of the software.
8
+ */
9
+ export type Category = "addon" | "application" | "beta" | "bios" | "compilation" | "coverdisk" | "demo" | "educational" | "firmware" | "freeware" | "game" | "homebrew" | "multimedia" | "promotional" | "prototype" | "scene_demo" | "shareware" | "unlicensed" | "utility";
10
+ /**
11
+ * Genre classification.
12
+ */
13
+ export type Genre = "action_rpg" | "action" | "adventure" | "american_football" | "arcade" | "artillery" | "athletics" | "baseball" | "basketball" | "beat_em_up" | "billiards" | "block_puzzle" | "board_game" | "bowling" | "boxing" | "bullet_hell" | "card_game" | "casino" | "casual" | "cricket" | "cute_em_up" | "dating_sim" | "dungeon_crawler" | "educational" | "endless_runner" | "extreme_sports" | "fighting" | "fishing" | "flight" | "fps" | "golf" | "hack_and_slash" | "hockey" | "horror" | "horse_racing" | "life_sim" | "light_gun" | "logic_puzzle" | "mahjong" | "management" | "match_3" | "maze" | "mech" | "metroidvania" | "minigames" | "mmorpg" | "moba" | "music_rhythm" | "open_world" | "pachinko" | "party" | "pinball" | "platformer" | "point_and_click" | "pool" | "puzzle" | "quiz" | "racing" | "rail_shooter" | "real_time_strategy" | "roguelike" | "rpg" | "run_and_gun" | "sandbox" | "shoot_em_up" | "shooter" | "simulation" | "skateboarding" | "skiing" | "snooker" | "snowboarding" | "soccer" | "sports" | "stealth" | "strategy" | "surfing" | "survival" | "tactical_rpg" | "tennis" | "text_adventure" | "tower_defense" | "trivia" | "turn_based_strategy" | "twin_stick" | "vehicle_combat" | "visual_novel" | "volleyball" | "word_puzzle" | "wrestling";
14
+ /**
15
+ * Input device, peripheral, or capability.
16
+ */
17
+ export type Feature = "analog_stick" | "arcade_stick" | "balance_board" | "bongos" | "buzzer" | "camera" | "crank" | "dance_mat" | "dongle" | "drums" | "fishing_rod" | "flight_stick" | "gamepad" | "guitar" | "instrument" | "keyboard_controller" | "keyboard" | "light_gun" | "link_cable" | "maracas" | "mech_controller" | "microphone" | "motion_controls" | "mouse" | "multitap" | "nfc_portal" | "online" | "paddle" | "pedals" | "pointer" | "rumble" | "save_file" | "spinner" | "steering_wheel" | "stylus" | "touch_screen" | "trackball" | "train_controller" | "turntable" | "twin_stick" | "vr_headset" | "zapper";
18
+ /**
19
+ * Name of a title included in a compilation release.
20
+ */
21
+ export type CompilationTitle = string;
22
+ /**
23
+ * The format/medium type of the file.
24
+ */
25
+ export type MediaType = "archive" | "bluray" | "cartridge" | "cdrom" | "download" | "dvd" | "floppy" | "gd_rom" | "hdd_image" | "laserdisc" | "memory_card" | "tape" | "umd";
26
+ /**
27
+ * Region encoding.
28
+ */
29
+ export type Region = "asia" | "australia" | "brazil" | "canada" | "china" | "europe" | "france" | "germany" | "hong-kong" | "india" | "italy" | "japan" | "korea" | "mexico" | "netherlands" | "ntsc-j" | "ntsc-u" | "pal-a" | "pal-b" | "pal-g" | "pal" | "russia" | "scandinavia" | "spain" | "taiwan" | "uk" | "usa" | "world";
30
+ /**
31
+ * Quality/status of the ROM dump.
32
+ */
33
+ export type DumpStatus = "alternate" | "bad" | "good" | "hacked" | "overdump" | "pirate" | "prototype" | "trained" | "translated" | "underdump" | "unknown" | "unlicensed";
34
+ /**
35
+ * Metadata specification for Retropak software containers
36
+ */
37
+ export interface RetropakManifest {
38
+ /**
39
+ * The schema version this manifest conforms to, using schemaver format MODEL-REVISION-ADDITION (e.g., '1-0-0').
40
+ */
41
+ schemaVersion: string;
42
+ /**
43
+ * Version of this manifest file, for tracking revisions (e.g., '1', '2.1').
44
+ */
45
+ manifestVersion?: string;
46
+ /**
47
+ * Title metadata and information.
48
+ */
49
+ info: {
50
+ /**
51
+ * The primary display name of the title.
52
+ */
53
+ title: string;
54
+ /**
55
+ * Alternative names (e.g. regional titles, translated names).
56
+ */
57
+ alternativeTitles?: string[];
58
+ /**
59
+ * Unique identifier for the platform.
60
+ */
61
+ platform: "32x" | "3do" | "3ds" | "a2600" | "a5200" | "a7800" | "a800" | "amiga" | "apple2" | "aquarius" | "archimedes" | "arduboy" | "astrocade" | "bbc" | "c128" | "c64" | "cd32" | "cdi" | "cdtv" | "channelf" | "coco" | "coleco" | "cpc" | "dos" | "dragon" | "dreamcast" | "einstein" | "electron" | "emerson" | "enterprise" | "fds" | "fmtowns" | "gamecom" | "gamecube" | "gamewave" | "gamate" | "gb" | "gba" | "gbc" | "gg" | "gizmondo" | "gnw" | "gp2x" | "gp32" | "gx4000" | "hyperscan" | "intellivision" | "jaguar" | "jaguarcd" | "laseractive" | "lynx" | "markiii" | "mcd" | "md" | "megaduck" | "microvision" | "mp1000" | "msx" | "msx2" | "n64" | "nds" | "nes" | "ng" | "ngage" | "ngcd" | "ngp" | "ngpc" | "nuon" | "o2" | "oric" | "pc88" | "pc98" | "pce" | "pcecd" | "pcfx" | "pet" | "pico" | "pippin" | "playdate" | "plus4" | "pokemini" | "ps2" | "ps3" | "ps4" | "ps5" | "psp" | "psx" | "pv1000" | "ql" | "sam" | "saturn" | "scv" | "sg1000" | "sgx" | "sms" | "snes" | "spectrum" | "st" | "studio2" | "supervision" | "switch" | "thomson" | "ti994a" | "tigerhandheld" | "trs80" | "tutor" | "vb" | "vcg" | "vectrex" | "vic20" | "videopac" | "vita" | "wii" | "wiiu" | "ws" | "wsc" | "x360" | "x68000" | "xavix" | "xbox" | "xone" | "xsx" | "zeebo" | "zx80" | "zx81";
62
+ /**
63
+ * The studio or individual who developed the title.
64
+ */
65
+ developer?: string;
66
+ /**
67
+ * The company that published the title.
68
+ */
69
+ publisher?: string;
70
+ /**
71
+ * Country of origin where the title was developed (ISO 3166-1 alpha-2 code, e.g. 'jp', 'us', 'gb').
72
+ */
73
+ country?: string;
74
+ /**
75
+ * Original release date in ISO 8601 format (YYYY-MM-DD).
76
+ */
77
+ releaseDate?: string;
78
+ /**
79
+ * A text summary or synopsis of the title.
80
+ */
81
+ description?: string;
82
+ /**
83
+ * One or more classifications for the type/nature of the software.
84
+ */
85
+ category?: Category[];
86
+ /**
87
+ * One or more genre classifications.
88
+ */
89
+ genre?: Genre[];
90
+ players?: Players;
91
+ features?: Features;
92
+ /**
93
+ * Languages supported (ISO 639-1 codes, e.g. 'en', 'ja', 'de').
94
+ */
95
+ languages?: string[];
96
+ /**
97
+ * People who worked on the title.
98
+ */
99
+ credits?: CreditEntry[];
100
+ /**
101
+ * For compilations: list of titles included in this release. Include "compilation" in the category array when using this field.
102
+ */
103
+ contents?: CompilationTitle[];
104
+ /**
105
+ * Identifiers from external databases for cross-referencing.
106
+ */
107
+ externalIds?: {
108
+ /**
109
+ * IGDB (Internet Game Database) ID.
110
+ */
111
+ igdb?: number;
112
+ /**
113
+ * MobyGames ID.
114
+ */
115
+ mobygames?: number;
116
+ /**
117
+ * TheGamesDB ID.
118
+ */
119
+ thegamesdb?: number;
120
+ /**
121
+ * ScreenScraper ID.
122
+ */
123
+ screenscraper?: number;
124
+ /**
125
+ * RAWG ID.
126
+ */
127
+ rawg?: number;
128
+ /**
129
+ * GameFAQs ID.
130
+ */
131
+ gamefaqs?: number;
132
+ [k: string]: unknown;
133
+ };
134
+ rating?: AgeRating;
135
+ /**
136
+ * Additional notes, warnings, or information (e.g. access codes, compatibility notes, copy protection details).
137
+ */
138
+ notes?: string;
139
+ [k: string]: unknown;
140
+ };
141
+ /**
142
+ * The media files (ROMs, disc images, tapes, etc.) included in this package.
143
+ *
144
+ * @minItems 1
145
+ */
146
+ media: [MediaItem, ...MediaItem[]];
147
+ /**
148
+ * Artwork, documentation, and other supplementary files.
149
+ */
150
+ assets?: {
151
+ boxFront?: Image;
152
+ boxBack?: Image1;
153
+ boxSpine?: Image2;
154
+ /**
155
+ * Images of the physical media (cartridge, disc, tape, floppy, etc.).
156
+ */
157
+ physicalMedia?: PhysicalMediaImage[];
158
+ logo?: Image3;
159
+ backdrop?: Image4;
160
+ titleScreen?: Image5;
161
+ /**
162
+ * Gameplay screenshots.
163
+ */
164
+ gameplay?: Image6[];
165
+ /**
166
+ * Path to the manual (PDF, image, html or text).
167
+ */
168
+ manual?: string;
169
+ map?: Image7;
170
+ /**
171
+ * Soundtrack or audio files from the game.
172
+ */
173
+ music?: MusicTrack[];
174
+ [k: string]: unknown;
175
+ };
176
+ /**
177
+ * External configuration files for emulators or platforms.
178
+ */
179
+ config?: ConfigFile[];
180
+ [k: string]: unknown;
181
+ }
182
+ /**
183
+ * Multiplayer capabilities.
184
+ */
185
+ export interface Players {
186
+ /**
187
+ * Minimum number of players required to play.
188
+ */
189
+ min?: number;
190
+ /**
191
+ * Maximum number of simultaneous players supported.
192
+ */
193
+ max?: number;
194
+ /**
195
+ * Whether cooperative play is supported.
196
+ */
197
+ coop?: boolean;
198
+ [k: string]: unknown;
199
+ }
200
+ /**
201
+ * Input devices, peripherals, and capabilities.
202
+ */
203
+ export interface Features {
204
+ /**
205
+ * Features required to use this title.
206
+ */
207
+ required?: Feature[];
208
+ /**
209
+ * Optional features the title supports.
210
+ */
211
+ supported?: Feature[];
212
+ [k: string]: unknown;
213
+ }
214
+ /**
215
+ * A person credited for work on the title.
216
+ */
217
+ export interface CreditEntry {
218
+ /**
219
+ * Person's name.
220
+ */
221
+ name: string;
222
+ /**
223
+ * Job titles or roles (e.g. 'Director', 'Lead Programmer', 'Composer').
224
+ */
225
+ roles?: string[];
226
+ [k: string]: unknown;
227
+ }
228
+ /**
229
+ * Age/content ratings from various rating boards.
230
+ */
231
+ export interface AgeRating {
232
+ /**
233
+ * Whether the title contains adult or explicit content.
234
+ */
235
+ nsfw?: boolean;
236
+ /**
237
+ * Generic minimum recommended age when no official rating exists.
238
+ */
239
+ minimum?: number;
240
+ /**
241
+ * ESRB rating (North America).
242
+ */
243
+ esrb?: "ec" | "e" | "e10" | "t" | "m" | "ao" | "rp";
244
+ /**
245
+ * PEGI rating (Europe).
246
+ */
247
+ pegi?: "3" | "7" | "12" | "16" | "18";
248
+ /**
249
+ * CERO rating (Japan).
250
+ */
251
+ cero?: "a" | "b" | "c" | "d" | "z";
252
+ /**
253
+ * USK rating (Germany).
254
+ */
255
+ usk?: "0" | "6" | "12" | "16" | "18";
256
+ /**
257
+ * ACB rating (Australia).
258
+ */
259
+ acb?: "g" | "pg" | "m" | "ma15" | "r18" | "rc";
260
+ /**
261
+ * GRAC rating (South Korea).
262
+ */
263
+ grac?: "all" | "12" | "15" | "18";
264
+ /**
265
+ * BBFC rating (United Kingdom).
266
+ */
267
+ bbfc?: "u" | "pg" | "12" | "12a" | "15" | "18" | "r18";
268
+ [k: string]: unknown;
269
+ }
270
+ /**
271
+ * A media file (ROM, disc image, tape, etc.).
272
+ */
273
+ export interface MediaItem {
274
+ /**
275
+ * Unique identifier for this media item, used for referencing in other fields.
276
+ */
277
+ id?: string;
278
+ /**
279
+ * Relative path to the media file within the archive.
280
+ */
281
+ filename: string;
282
+ /**
283
+ * Display name for this specific media item (e.g. 'Disc 1').
284
+ */
285
+ label?: string;
286
+ type: MediaType;
287
+ /**
288
+ * Whether the title can be started from this media. Set to false for data-only discs.
289
+ */
290
+ bootable?: boolean;
291
+ /**
292
+ * Sequence number for multi-part media.
293
+ */
294
+ index?: number;
295
+ region?: Region;
296
+ /**
297
+ * MD5 checksum of the media file for verification.
298
+ */
299
+ md5?: string;
300
+ /**
301
+ * SHA-1 checksum of the media file for verification.
302
+ */
303
+ sha1?: string;
304
+ /**
305
+ * CRC32 checksum of the media file for verification.
306
+ */
307
+ crc32?: string;
308
+ /**
309
+ * Version identifier for this ROM/media (e.g. 'Rev A', '1.1', 'v1.0').
310
+ */
311
+ version?: string;
312
+ status?: DumpStatus;
313
+ /**
314
+ * Whether this dump has been verified against a known database (No-Intro, Redump, etc.).
315
+ */
316
+ verified?: boolean;
317
+ /**
318
+ * Source database or group that verified the dump (e.g. 'No-Intro', 'Redump', 'TOSEC').
319
+ */
320
+ source?: string;
321
+ /**
322
+ * Official product serial/catalog number from the original media.
323
+ */
324
+ serial?: string;
325
+ /**
326
+ * Additional notes about this specific media file (e.g. distribution method, requirements, known issues).
327
+ */
328
+ notes?: string;
329
+ [k: string]: unknown;
330
+ }
331
+ /**
332
+ * Front box/case cover image.
333
+ */
334
+ export interface Image {
335
+ /**
336
+ * Path to the image file.
337
+ */
338
+ file: string;
339
+ /**
340
+ * Alternative text describing the image for accessibility.
341
+ */
342
+ alt?: string;
343
+ [k: string]: unknown;
344
+ }
345
+ /**
346
+ * Back box/case cover image.
347
+ */
348
+ export interface Image1 {
349
+ /**
350
+ * Path to the image file.
351
+ */
352
+ file: string;
353
+ /**
354
+ * Alternative text describing the image for accessibility.
355
+ */
356
+ alt?: string;
357
+ [k: string]: unknown;
358
+ }
359
+ /**
360
+ * Box/case spine image.
361
+ */
362
+ export interface Image2 {
363
+ /**
364
+ * Path to the image file.
365
+ */
366
+ file: string;
367
+ /**
368
+ * Alternative text describing the image for accessibility.
369
+ */
370
+ alt?: string;
371
+ [k: string]: unknown;
372
+ }
373
+ /**
374
+ * An image of physical media (cartridge, disc, tape, etc.).
375
+ */
376
+ export interface PhysicalMediaImage {
377
+ /**
378
+ * Path to the physical media image file.
379
+ */
380
+ file: string;
381
+ /**
382
+ * Alternative text describing the image for accessibility.
383
+ */
384
+ alt?: string;
385
+ /**
386
+ * References the 'id' field of a media item, if specific to one disc/cart.
387
+ */
388
+ mediaId?: string;
389
+ type?: MediaType;
390
+ [k: string]: unknown;
391
+ }
392
+ /**
393
+ * Logo/wordmark with transparent background.
394
+ */
395
+ export interface Image3 {
396
+ /**
397
+ * Path to the image file.
398
+ */
399
+ file: string;
400
+ /**
401
+ * Alternative text describing the image for accessibility.
402
+ */
403
+ alt?: string;
404
+ [k: string]: unknown;
405
+ }
406
+ /**
407
+ * Widescreen background artwork for TV/big screen interfaces. Should be free of text or logos.
408
+ */
409
+ export interface Image4 {
410
+ /**
411
+ * Path to the image file.
412
+ */
413
+ file: string;
414
+ /**
415
+ * Alternative text describing the image for accessibility.
416
+ */
417
+ alt?: string;
418
+ [k: string]: unknown;
419
+ }
420
+ /**
421
+ * Title screen screenshot.
422
+ */
423
+ export interface Image5 {
424
+ /**
425
+ * Path to the image file.
426
+ */
427
+ file: string;
428
+ /**
429
+ * Alternative text describing the image for accessibility.
430
+ */
431
+ alt?: string;
432
+ [k: string]: unknown;
433
+ }
434
+ /**
435
+ * An image file with optional alt text for accessibility.
436
+ */
437
+ export interface Image6 {
438
+ /**
439
+ * Path to the image file.
440
+ */
441
+ file: string;
442
+ /**
443
+ * Alternative text describing the image for accessibility.
444
+ */
445
+ alt?: string;
446
+ [k: string]: unknown;
447
+ }
448
+ /**
449
+ * An image file with optional alt text for accessibility.
450
+ */
451
+ export interface Image7 {
452
+ /**
453
+ * Path to the image file.
454
+ */
455
+ file: string;
456
+ /**
457
+ * Alternative text describing the image for accessibility.
458
+ */
459
+ alt?: string;
460
+ [k: string]: unknown;
461
+ }
462
+ /**
463
+ * A soundtrack or audio file from the title.
464
+ */
465
+ export interface MusicTrack {
466
+ /**
467
+ * Display name of the music track.
468
+ */
469
+ title?: string;
470
+ /**
471
+ * Path to the audio file.
472
+ */
473
+ file: string;
474
+ /**
475
+ * Whether this track is suitable for background/menu music when browsing titles.
476
+ */
477
+ background?: boolean;
478
+ [k: string]: unknown;
479
+ }
480
+ /**
481
+ * An external configuration file for emulator or platform-specific settings.
482
+ */
483
+ export interface ConfigFile {
484
+ /**
485
+ * Path to the configuration file.
486
+ */
487
+ file: string;
488
+ /**
489
+ * Target emulator, core, or platform (e.g. 'retroarch', 'mame', 'dolphin').
490
+ */
491
+ target?: string;
492
+ /**
493
+ * What this config file does or overrides.
494
+ */
495
+ description?: string;
496
+ [k: string]: unknown;
497
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Re-export all generated types from the schema
3
+ */
4
+ export * from "./generated";
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Re-export all generated types from the schema
4
+ */
5
+ export * from "./generated";
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@retropak/types",
3
+ "version": "1.0.0-draft",
4
+ "description": "TypeScript type definitions for Retropak manifests",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "src"
17
+ ],
18
+ "scripts": {
19
+ "prebuild": "rm -rf dist",
20
+ "build": "npm run generate && tsc",
21
+ "generate": "json2ts -i ../schema/schemas/v1/retropak.schema.json -o src/generated.ts",
22
+ "validate": "tsc --noEmit",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "keywords": [
26
+ "retropak",
27
+ "types",
28
+ "typescript"
29
+ ],
30
+ "author": "piers@retropak.org",
31
+ "license": "CC0-1.0",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/piersroberts/retropak.git",
35
+ "directory": "packages/types"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/piersroberts/retropak/issues"
39
+ },
40
+ "homepage": "https://retropak.org",
41
+ "dependencies": {
42
+ "@retropak/schema": "*"
43
+ },
44
+ "devDependencies": {
45
+ "json-schema-to-typescript": "^13.1.2",
46
+ "typescript": "^5.3.3"
47
+ },
48
+ "peerDependencies": {
49
+ "typescript": ">=4.5.0"
50
+ }
51
+ }