warframe-worldstate-parser
Version:
An Open parser for Warframe's Worldstate in Javascript
101 lines (100 loc) • 2.25 kB
text/typescript
import { r as WorldStateObject, t as BaseContentObject } from "./WorldStateObject-CIJgXUCx.mjs";
import { Locale } from "warframe-worldstate-data";
import { ContentTimestamp } from "warframe-worldstate-data/utilities";
//#region lib/models/News.d.ts
interface RawNews extends BaseContentObject {
Messages: {
LanguageCode: string;
Message: string;
}[];
Prop: string;
Links?: {
LanguageCode: string;
Link: string;
}[];
ImageUrl: string;
Priority: boolean;
MobileOnly: boolean;
Date: ContentTimestamp;
EventStartDate?: ContentTimestamp;
EventEndDate?: ContentTimestamp;
}
/**
* Represents a game news item
* @augments {WorldStateObject}
*/
declare class News extends WorldStateObject {
/**
* The news message
*/
message: string;
/**
* The link to the forum post
*/
link: string;
/**
* The news's image link
*/
imageLink: string;
/**
* Whether this has priority over other news or not
*/
priority: boolean;
/**
* The date at which the post was published
*/
date: Date;
/**
* The message translated into different locales
*/
translations: Record<string, string>;
/**
* Whether this is an update news item
*/
update: boolean;
/**
* Whether this is a prime access news item
*/
primeAccess: boolean;
/**
* Whether or not this is a stream
*/
stream: boolean;
/**
* Whether or not this news is mobile only.
*/
mobileOnly: boolean;
/**
* @param data The news data
* @param locale Locale to use for determining language
*/
constructor(data: RawNews, {
locale
}?: {
locale: Locale;
});
/**
* Whether or not this is about a game update
*/
isUpdate(): boolean;
/**
* Whether this is about a new Prime Access
*/
isPrimeAccess(): boolean;
/**
* Whether this is about a new stream
*/
isStream(): boolean;
/**
* ETA string (at time of object creation)
*/
get eta(): string;
/**
* 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: Locale): string;
}
//#endregion
export { RawNews as n, News as t };