UNPKG

warframe-worldstate-parser

Version:

An Open parser for Warframe's Worldstate in Javascript

43 lines (42 loc) 1.15 kB
import { n as __decorateMetadata, t as __decorate } from "../../decorate-BCC26nnB.mjs"; import { IsArray, IsString } from "class-validator"; //#region lib/supporting/DuviriChoice.ts /** * Single category of duviri choices */ var DuviriChoice = class { /** * Category of the choice. One of 'normal', 'hard' */ category; /** * Raw category key from the API */ categoryKey; /** * Array of available choices */ choices; constructor(data) { switch (data.Category) { case "EXC_NORMAL": this.category = "normal"; break; case "EXC_HARD": this.category = "hard"; break; default: throw new Error(`Unknown category ${data.Category}`); } this.categoryKey = data.Category; this.choices = data.Choices; } }; __decorate([IsString(), __decorateMetadata("design:type", String)], DuviriChoice.prototype, "category", void 0); __decorate([IsString(), __decorateMetadata("design:type", String)], DuviriChoice.prototype, "categoryKey", void 0); __decorate([ IsArray(), IsString({ each: true }), __decorateMetadata("design:type", Array) ], DuviriChoice.prototype, "choices", void 0); //#endregion export { DuviriChoice };