UNPKG

warframe-worldstate-parser

Version:

An Open parser for Warframe's Worldstate in Javascript

51 lines (50 loc) 1.61 kB
import { n as __decorateMetadata, t as __decorate } from "../../decorate-BCC26nnB.mjs"; import { IsInt, IsString, Min } from "class-validator"; import { languageString } from "warframe-worldstate-data/utilities"; //#region lib/models/VoidTraderItem.ts /** * A void trader inventory item */ var VoidTraderItem = class { uniqueName; /** * The name of the inventory item */ item; /** * Ducat cost of the item */ ducats; /** * Credit cost of the item */ credits; /** * @param data The void trader item data * @param data.ItemType Worldstate Item i18n path * @param data.PrimePrice Ducat cost of the item * @param data.RegularPrice Credit price of the item * @param deps The dependencies object * @param deps.locale Locale to use for translations */ constructor({ ItemType, PrimePrice, RegularPrice }, { locale = "en" } = { locale: "en" }) { this.uniqueName = ItemType; this.item = languageString(ItemType, locale); this.ducats = Number.parseInt(String(PrimePrice), 10); this.credits = Number.parseInt(String(RegularPrice), 10); } }; __decorate([IsString(), __decorateMetadata("design:type", String)], VoidTraderItem.prototype, "uniqueName", void 0); __decorate([IsString(), __decorateMetadata("design:type", String)], VoidTraderItem.prototype, "item", void 0); __decorate([ IsInt(), Min(0), __decorateMetadata("design:type", Number) ], VoidTraderItem.prototype, "ducats", void 0); __decorate([ IsInt(), Min(0), __decorateMetadata("design:type", Number) ], VoidTraderItem.prototype, "credits", void 0); //#endregion export { VoidTraderItem };