From 1a9762daea1aabc2737f95be49fa944ce80f6cc1 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Sun, 28 Jul 2019 17:03:41 -0400 Subject: [PATCH] Add type model. --- src/model/module.ts | 3 ++- src/model/type.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/model/type.ts diff --git a/src/model/module.ts b/src/model/module.ts index a895d41..1ea66db 100644 --- a/src/model/module.ts +++ b/src/model/module.ts @@ -1,5 +1,6 @@ import { Artifact } from './artifact' import { Required } from './required' +import { Type } from './type' export interface Module { @@ -27,7 +28,7 @@ export interface Module { /** * The type of the module. */ - type: string + type: Type /** * Defines whether or not the module is required. If omitted, then the module will be required. diff --git a/src/model/type.ts b/src/model/type.ts new file mode 100644 index 0000000..c009bf6 --- /dev/null +++ b/src/model/type.ts @@ -0,0 +1,42 @@ +export const Types: {[property: string]: Type} = { + + Library: { + id: 'Library', + defaultExtension: 'jar' + }, + ForgeHosted: { + id: 'ForgeHosted', + defaultExtension: 'jar' + }, + Forge: { + id: 'Forge', + defaultExtension: 'jar' + }, + LiteLoader: { + id: 'LiteLoader', + defaultExtension: 'jar' + }, + ForgeMod: { + id: 'ForgeMod', + defaultExtension: 'jar' + }, + LiteMod: { + id: 'LiteMod', + defaultExtension: 'litemod' + }, + File: { + id: 'File' + }, + VersionManifest: { + id: 'VersionManifest', + defaultExtension: 'json' + } + +} + +export interface Type { + + id: string + defaultExtension?: string + +}