@zthun/romulator-api 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/files/files-games-repository.d.mts +27 -0
- package/dist/files/files-module.d.mts +2 -2
- package/dist/files/files-repository.d.mts +119 -0
- package/dist/files/files-systems-repository.d.mts +27 -0
- package/dist/games/games-service.d.mts +8 -8
- package/dist/main.cjs +620 -470
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +627 -477
- package/dist/main.js.map +1 -1
- package/dist/media/media-service.d.mts +2 -2
- package/dist/systems/systems-service.d.mts +3 -4
- package/package.json +17 -17
- package/assets/systems.json +0 -4057
- package/dist/files/files-service.d.mts +0 -120
- package/dist/systems/system-known.d.mts +0 -80
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { IZFileRepository, IZFileSystemNode, IZFileSystemService } from '@zthun/crumbtrail-fs';
|
|
2
|
-
import { IZRomulatorConfigsService } from '../config/configs-service.mjs';
|
|
3
|
-
export declare const ZRomulatorFilesToken: unique symbol;
|
|
4
|
-
/**
|
|
5
|
-
* Represents the service that you can use to
|
|
6
|
-
* scan the games folder for media, info, games, and systems.
|
|
7
|
-
*/
|
|
8
|
-
export interface IZRomulatorFilesService {
|
|
9
|
-
/**
|
|
10
|
-
* Retrieves all media found in the games .media folder.
|
|
11
|
-
*
|
|
12
|
-
* @returns
|
|
13
|
-
* A list of all media found in the game media folder.
|
|
14
|
-
*/
|
|
15
|
-
media(): Promise<IZFileSystemNode[]>;
|
|
16
|
-
/**
|
|
17
|
-
* Retrieves a single media node found in the .media folder.
|
|
18
|
-
*
|
|
19
|
-
* @param path -
|
|
20
|
-
* The path of the media node to retrieve. This will
|
|
21
|
-
* be relative to the configured games directory. If this
|
|
22
|
-
* starts with a root OS folder, then the path by itself
|
|
23
|
-
* is used.
|
|
24
|
-
*
|
|
25
|
-
* @returns
|
|
26
|
-
* The node with the given path or null if no such
|
|
27
|
-
* file exists.
|
|
28
|
-
*/
|
|
29
|
-
media(path: string): Promise<IZFileSystemNode | null>;
|
|
30
|
-
/**
|
|
31
|
-
* Retrieves all systems found in the games folder.
|
|
32
|
-
*
|
|
33
|
-
* A system is a root folder that is a slug of a supported
|
|
34
|
-
* system.
|
|
35
|
-
*
|
|
36
|
-
* @returns
|
|
37
|
-
* A list of all systems found in the games folder.
|
|
38
|
-
*/
|
|
39
|
-
systems(): Promise<IZFileSystemNode[]>;
|
|
40
|
-
/**
|
|
41
|
-
* Retrieves a single system found in the games folder.
|
|
42
|
-
*
|
|
43
|
-
* @param path -
|
|
44
|
-
* The id of the system, which is also the name of the folder.
|
|
45
|
-
*
|
|
46
|
-
* @returns
|
|
47
|
-
* The node that represents the system slug. Returns null if
|
|
48
|
-
* the folder does not exist or is not supported. Note
|
|
49
|
-
* that the path is relative to the configured games folder. If you
|
|
50
|
-
* want to supply a fully qualified absolute path, then this string
|
|
51
|
-
* should start with the root of an OS drive (not recommended).
|
|
52
|
-
*/
|
|
53
|
-
systems(path: string): Promise<IZFileSystemNode | null>;
|
|
54
|
-
/**
|
|
55
|
-
* Retrieves all info found in the games .info folder.
|
|
56
|
-
*
|
|
57
|
-
* Info is the metadata scraped from a scraper service.
|
|
58
|
-
* The data format is stored in json.
|
|
59
|
-
*
|
|
60
|
-
* @returns
|
|
61
|
-
* A list of all info found in the games folder.
|
|
62
|
-
*/
|
|
63
|
-
info(): Promise<IZFileSystemNode[]>;
|
|
64
|
-
/**
|
|
65
|
-
* Retrieves specific information found in the games .info folder.
|
|
66
|
-
*
|
|
67
|
-
* @param path -
|
|
68
|
-
* The path of the info node to retrieve.
|
|
69
|
-
*
|
|
70
|
-
* @returns
|
|
71
|
-
* The node with the given path or null if no such file exists.
|
|
72
|
-
*/
|
|
73
|
-
info(path: string): Promise<IZFileSystemNode | null>;
|
|
74
|
-
/**
|
|
75
|
-
* Gets the contents of the file.
|
|
76
|
-
*
|
|
77
|
-
* @param info -
|
|
78
|
-
* The file to read and store.
|
|
79
|
-
*
|
|
80
|
-
* @returns
|
|
81
|
-
* The buffer of data that the file contained.
|
|
82
|
-
*/
|
|
83
|
-
read(info: IZFileSystemNode): Promise<Buffer>;
|
|
84
|
-
/**
|
|
85
|
-
* Initializes the file repository.
|
|
86
|
-
*/
|
|
87
|
-
init(): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Cleans up internal resources.
|
|
90
|
-
*/
|
|
91
|
-
dispose(): Promise<void>;
|
|
92
|
-
}
|
|
93
|
-
export declare class ZRomulatorFilesService implements IZRomulatorFilesService {
|
|
94
|
-
private readonly _configs;
|
|
95
|
-
private readonly _fileSystem;
|
|
96
|
-
private static readonly MediaFolderName;
|
|
97
|
-
private static readonly InfoFolderName;
|
|
98
|
-
private _repository;
|
|
99
|
-
private _folderStream;
|
|
100
|
-
private _fileStream;
|
|
101
|
-
private _globs;
|
|
102
|
-
private _systems;
|
|
103
|
-
constructor(_configs: IZRomulatorConfigsService, _fileSystem: IZFileSystemService);
|
|
104
|
-
private gamesFolder;
|
|
105
|
-
private mediaFolder;
|
|
106
|
-
private infoFolder;
|
|
107
|
-
private contents;
|
|
108
|
-
init(): Promise<void>;
|
|
109
|
-
dispose(): Promise<void>;
|
|
110
|
-
seed(): Promise<IZFileRepository>;
|
|
111
|
-
media(): Promise<IZFileSystemNode[]>;
|
|
112
|
-
media(path: string): Promise<IZFileSystemNode | null>;
|
|
113
|
-
systems(): Promise<IZFileSystemNode[]>;
|
|
114
|
-
systems(path: string): Promise<IZFileSystemNode | null>;
|
|
115
|
-
info(): Promise<IZFileSystemNode[]>;
|
|
116
|
-
info(path: string): Promise<IZFileSystemNode | null>;
|
|
117
|
-
games(): Promise<IZFileSystemNode[]>;
|
|
118
|
-
games(path: string): Promise<IZFileSystemNode | null>;
|
|
119
|
-
read(node: IZFileSystemNode): Promise<Buffer>;
|
|
120
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { IZRomulatorSystem } from '@zthun/romulator-client';
|
|
2
|
-
/**
|
|
3
|
-
* A helper factory class for creating supported systems.
|
|
4
|
-
*/
|
|
5
|
-
export declare abstract class ZRomulatorSystemKnown {
|
|
6
|
-
/**
|
|
7
|
-
* Returns all known systems.
|
|
8
|
-
*
|
|
9
|
-
* @returns
|
|
10
|
-
* All supported systems.
|
|
11
|
-
*/
|
|
12
|
-
static all(): IZRomulatorSystem[];
|
|
13
|
-
/**
|
|
14
|
-
* Creates a system that represents the Nintendo
|
|
15
|
-
* Entertainment System (NES).
|
|
16
|
-
*
|
|
17
|
-
* @returns
|
|
18
|
-
* A {@link ZRomulatorSystemBuilder} instance that has
|
|
19
|
-
* built the nes.
|
|
20
|
-
*/
|
|
21
|
-
static nes(): IZRomulatorSystem;
|
|
22
|
-
/**
|
|
23
|
-
* Creates a system that represents the Super
|
|
24
|
-
* Nintendo Entertainment System (SNES).
|
|
25
|
-
*
|
|
26
|
-
* @returns
|
|
27
|
-
* This instance.
|
|
28
|
-
*/
|
|
29
|
-
static snes(): IZRomulatorSystem;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a system that represents the Nintendo
|
|
32
|
-
* 64 (N64).
|
|
33
|
-
*
|
|
34
|
-
* @returns
|
|
35
|
-
* This instance.
|
|
36
|
-
*/
|
|
37
|
-
static n64(): IZRomulatorSystem;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a system that represents the Nintendo
|
|
40
|
-
* GameCube (GC).
|
|
41
|
-
*
|
|
42
|
-
* @returns
|
|
43
|
-
* This instance.
|
|
44
|
-
*/
|
|
45
|
-
static gc(): IZRomulatorSystem;
|
|
46
|
-
/**
|
|
47
|
-
* Creates a system that represents the Nintendo
|
|
48
|
-
* Wii (Wii).
|
|
49
|
-
*
|
|
50
|
-
* @returns
|
|
51
|
-
* This instance.
|
|
52
|
-
*/
|
|
53
|
-
static wii(): IZRomulatorSystem;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a system that represents the Nintendo
|
|
56
|
-
* Wii U (WiiU).
|
|
57
|
-
*
|
|
58
|
-
* @returns
|
|
59
|
-
* This instance.
|
|
60
|
-
*/
|
|
61
|
-
static wiiu(): IZRomulatorSystem;
|
|
62
|
-
/**
|
|
63
|
-
* Creates a system that represents the Nintendo
|
|
64
|
-
* Switch (Switch).
|
|
65
|
-
*
|
|
66
|
-
* @returns
|
|
67
|
-
* This instance.
|
|
68
|
-
*/
|
|
69
|
-
static switch(): IZRomulatorSystem;
|
|
70
|
-
/**
|
|
71
|
-
* Creates a system from an id slug.
|
|
72
|
-
*
|
|
73
|
-
* @param id -
|
|
74
|
-
* The id slug of the system to create.
|
|
75
|
-
*
|
|
76
|
-
* @return
|
|
77
|
-
* The system, or null if the id is not known.
|
|
78
|
-
*/
|
|
79
|
-
static from(id: string): IZRomulatorSystem | null;
|
|
80
|
-
}
|