warframe-worldstate-parser
Version:
An Open parser for Warframe's Worldstate in Javascript
105 lines (104 loc) • 2.71 kB
TypeScript
/**
* Represents a game news item
* @augments {WorldstateObject}
*/
export default class News extends WorldstateObject {
/**
* @param {object} data The news data
* @param {string} locale Locale to use for determining language
*/
constructor(data: object, { locale }?: string);
/**
* The news message
* @type {string}
*/
message: string;
/**
* The link to the forum post
* @type {string}
*/
link: string;
/**
* The news's image link
* @type {string}
*/
imageLink: string;
/**
* Whether this has priority over other news or not
* @type {boolean}
*/
priority: boolean;
/**
* The date at which the post was published
* @type {Date}
*/
date: Date;
/**
* The date at which the event starts
* @type {?Date}
*/
startDate: Date | null;
/**
* The date at which the event ends
* @type {?Date}
*/
endDate: Date | null;
/**
* ETA string (at time of object creation)
* @type {string}
*/
eta: string;
/**
* Whether this is an update news item
* @type {boolean}
*/
update: boolean;
/**
* Whether this is a prime access news item
* @type {boolean}
*/
primeAccess: boolean;
/**
* Whether or not this is a stream
* @type {boolean}
*/
stream: boolean;
/**
* Translation of the news item
* @type {Record<string, string>}
*/
translations: Record<string, string>;
/**
* The string representation of this object at creation
* @type {string}
*/
asString: string;
/**
* Get a string indicating how long it will take for the event to start or
* how long it's been since the news went up
* @returns {string} the estimated time of arrival for the event
*/
getETAString(): string;
/**
* Whether or not this is about a game update
* @returns {boolean} whether the news is about an update
*/
isUpdate(): boolean;
/**
* Whether this is about a new Prime Access
* @returns {boolean} whether the news is about a new Prime Access
*/
isPrimeAccess(): boolean;
/**
* Whether this is about a new stream
* @returns {boolean} whether the news is for a stream
*/
isStream(): boolean;
/**
* The title of the news item in the specified language
* @param {string} langCode Ex. 'es', 'de', 'fr'
* @returns {string} The title of the news item in the specified language
*/
getTitle(langCode: string): string;
}
import WorldstateObject from './WorldstateObject.js';