@zthun/romulator-api 1.5.0 → 1.7.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/config/config-known.d.mts +0 -1
- package/dist/files/files-module.d.mts +2 -0
- package/dist/files/files-service.d.mts +96 -0
- package/dist/main.cjs +328 -167
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +333 -172
- package/dist/main.js.map +1 -1
- package/dist/media/media-service.d.mts +3 -6
- package/dist/systems/systems-service.d.mts +5 -5
- package/package.json +13 -13
|
@@ -2,5 +2,4 @@ export declare abstract class ZRomulatorConfigKnown {
|
|
|
2
2
|
static all(): import('@zthun/romulator-client').IZRomulatorConfig<any>[];
|
|
3
3
|
private static create;
|
|
4
4
|
static games(): import('@zthun/romulator-client').IZRomulatorConfig<any>;
|
|
5
|
-
static media(): import('@zthun/romulator-client').IZRomulatorConfig<any>;
|
|
6
5
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
export declare class ZRomulatorFilesService implements IZRomulatorFilesService {
|
|
76
|
+
private readonly _configs;
|
|
77
|
+
private readonly _fileSystem;
|
|
78
|
+
private static readonly MediaFolderName;
|
|
79
|
+
private static readonly InfoFolderName;
|
|
80
|
+
private _repository;
|
|
81
|
+
private _folderStream;
|
|
82
|
+
private _globs;
|
|
83
|
+
private _systems;
|
|
84
|
+
constructor(_configs: IZRomulatorConfigsService, _fileSystem: IZFileSystemService);
|
|
85
|
+
private gamesFolder;
|
|
86
|
+
private mediaFolder;
|
|
87
|
+
private infoFolder;
|
|
88
|
+
private contents;
|
|
89
|
+
seed(): Promise<IZFileRepository>;
|
|
90
|
+
media(): Promise<IZFileSystemNode[]>;
|
|
91
|
+
media(path: string): Promise<IZFileSystemNode | null>;
|
|
92
|
+
systems(): Promise<IZFileSystemNode[]>;
|
|
93
|
+
systems(path: string): Promise<IZFileSystemNode | null>;
|
|
94
|
+
info(): Promise<IZFileSystemNode[]>;
|
|
95
|
+
info(path: string): Promise<IZFileSystemNode | null>;
|
|
96
|
+
}
|