mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 08:23:12 +09:00
Port remaining lib/data modules to TypeScript
This commit is contained in:
1 parent
2a52a82fb7
commit
679c00527f
6 files changed
+156
-227
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { Type, Static } from "@sinclair/typebox";
|
||||
|
||||
/**
|
||||
* Export manifest for a mod pack
|
||||
*
|
||||
* Tracks files stored on disk for data that extracted from Factorio using a
|
||||
* given mod pack.
|
||||
*/
|
||||
export default class ExportManifest {
|
||||
constructor(
|
||||
/**
|
||||
* Mapping between known assets and their file names.
|
||||
*
|
||||
* Currently exported assets are
|
||||
* - settings: JSON of mod settings prototypes.
|
||||
* - prototypes: JSON of all game prototypes except settings.
|
||||
* - item-spritesheet: PNG containing icons from the game.
|
||||
* - item-metadata: JSON of Map entries describing icons in item-spritesheet
|
||||
* - locale: JSON of flattened Map entries of en locale strings from the game.
|
||||
*/
|
||||
public assets: Record<string, string>
|
||||
) {
|
||||
if (assets) { this.assets = assets; }
|
||||
}
|
||||
|
||||
static jsonSchema = Type.Object({
|
||||
"assets": Type.Record(Type.String(), Type.String()),
|
||||
});
|
||||
|
||||
static fromJSON(json: Static<typeof ExportManifest.jsonSchema>) {
|
||||
return new this(json.assets);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user