Files
factorio-clusterio/packages/lib/src/data/ExportManifest.ts
T
Hornwitser ec734c92bc Fix bad typings detected by linting
Fix badly typed expressions that were detected by turning on
`@typescript-eslint/no-unnecessary-condition` in eslint.
2023-12-02 01:47:02 +01:00

32 lines
935 B
TypeScript

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>
) { }
static jsonSchema = Type.Object({
"assets": Type.Record(Type.String(), Type.String()),
});
static fromJSON(json: Static<typeof ExportManifest.jsonSchema>) {
return new this(json.assets);
}
}