warframe-worldstate-parser
Version:
An Open parser for Warframe's Worldstate in Javascript
79 lines (78 loc) • 1.9 kB
TypeScript
/**
* Represents a daily deal
*/
export default class DailyDeal {
/**
* @param {object} data The deal data
* @param {object} deps The dependencies object
* @param {string} deps.locale Locale to use for translations
*/
constructor(data: object, { locale }?: {
locale: string;
});
/**
* The item that is being offered in the sale
* @type {string}
*/
item: string;
/**
* The uniqueName for the item on sale.
* @type {string}
*/
uniqueName: string;
/**
* The date and time at which the deal will expire
* @type {Date}
*/
expiry: Date;
/**
* The date and time at which the deal will or did start
* @type {Date}
*/
activation: Date;
/**
* The item's original price
* @type {number}
*/
originalPrice: number;
/**
* The item's discounted price
* @type {number}
*/
salePrice: number;
/**
* The number of available items on sale
* @type {number}
*/
total: number;
/**
* The number of items that have already been sold
* @type {number}
*/
sold: number;
/**
* Unique identifier for this deal built from the end time and item
* @type {string}
*/
id: string;
/**
* ETA string (at time of object creation)
* @type {string}
*/
eta: string;
/**
* Percent discount
* @type {number}
*/
discount: number;
/**
* Get a string indicating how much time is left before the deal expires
* @returns {string} estimated time remaining on the deal
*/
getETAString(): string;
/**
* Returns a string representation of the daily deal
* @returns {string} The string representation of the daily deal
*/
toString(): string;
}