UNPKG

warframe-worldstate-parser

Version:

An Open parser for Warframe's Worldstate in Javascript

194 lines (193 loc) 5.94 kB
/** * * @param {object} ParserClass class for parsing data * @param {Array<BaseContentObject>} dataArray array of raw data * @param {Dependency} deps shared dependency object * @param {*} [uniqueField] field to treat as unique * @returns {WorldstateObject[]} array of parsed objects */ export function parseArray(ParserClass: object, dataArray: Array<BaseContentObject>, deps: Dependency, uniqueField?: any): WorldstateObject[]; export function parseAsyncArray(ParserClass: object, dataArray: Array<BaseContentObject>, deps: Dependency, uniqueField?: any): Promise<WorldstateObject[]>; /** * Parses Warframe Worldstate JSON */ export class WorldState { static build(json: any, deps?: Dependency): Promise<WorldState>; /** * Generates the worldstate json as a string into usable objects * @param {string} json The worldstate JSON string * @param {Dependency} [deps] The options object * @class * @async */ constructor(json: string, deps?: Dependency); /** * The date and time at which the World State was generated * @type {Date} */ timestamp: Date; /** * The in-game news * @type {Array.<News>} */ news: Array<News>; /** * The current events * @type {Array.<WorldEvent>} */ events: Array<WorldEvent>; /** * The current alerts * @type {Array.<Alert>} */ alerts: Array<Alert>; /** * The current syndicate missions * @type {Array.<SyndicateMission>} */ syndicateMissions: Array<SyndicateMission>; /** * The current fissures: 'ActiveMissions' & 'VoidStorms' * @type {Array.<Fissure>} */ fissures: Array<Fissure>; /** * The current global upgrades * @type {Array.<GlobalUpgrade>} */ globalUpgrades: Array<GlobalUpgrade>; /** * The current flash sales * @type {Array.<FlashSale>} */ flashSales: Array<FlashSale>; /** * The current invasions * @type {Array.<Invasion>} */ invasions: Array<Invasion>; /** * The state of the dark sectors * @type {Array.<DarkSector>} */ darkSectors: Array<DarkSector>; /** * The state of all Void Traders * @type {VoidTrader[]} */ voidTraders: VoidTrader[]; /** * The current daily deals * @type {Array.<DailyDeal>} */ dailyDeals: Array<DailyDeal>; /** * The state of the sanctuary synthesis targets * @type {Simaris} */ simaris: Simaris; /** * The current conclave challenges * @type {Array.<ConclaveChallenge>} */ conclaveChallenges: Array<ConclaveChallenge>; /** * The currently active persistent enemies * @type {Array.<PersistentEnemy>} */ persistentEnemies: Array<PersistentEnemy>; /** * The current earth cycle * @type {EarthCycle} */ earthCycle: EarthCycle; /** * The current Cetus cycle * @type {CetusCycle} */ cetusCycle: CetusCycle; /** * Cambion Drift Cycle * @type {CambionCycle} */ cambionCycle: CambionCycle; /** * The current Zariman cycle based off current time * @type {ZarimanCycle} */ zarimanCycle: ZarimanCycle; /** * Weekly challenges * @type {Array.<WeeklyChallenge>} */ weeklyChallenges: Array<WeeklyChallenge>; /** * The Current construction progress for Fomorians/Razorback/etc. * @type {ConstructionProgress} */ constructionProgress: ConstructionProgress; /** * The current Orb Vallis cycle state * @type {VallisCycle} */ vallisCycle: VallisCycle; /** * The current nightwave season * @type {Nightwave} */ nightwave: Nightwave; arbitration: any; /** * Current sentient outposts * @type {SentientOutpost} */ sentientOutposts: SentientOutpost; /** * Steel path offering rotation * @type {SteelPathOffering} */ steelPath: SteelPathOffering; duviriCycle: DuviriCycle; kinepage: Kinepage; /** * The current Deep Archimedea missions and modifiers * @type {DeepArchimedea} */ deepArchimedea: DeepArchimedea; /** * The current Temporal Archimedea missions and modifiers * @type {DeepArchimedea} */ temporalArchimedea: DeepArchimedea; calendar: WorldstateObject[]; } declare function _default(json: any, deps: any): Promise<WorldState>; export default _default; import Dependency from './supporting/Dependency.js'; import News from './models/News.js'; import WorldEvent from './models/WorldEvent.js'; import Alert from './models/Alert.js'; import SyndicateMission from './models/SyndicateMission.js'; import Fissure from './models/Fissure.js'; import GlobalUpgrade from './models/GlobalUpgrade.js'; import FlashSale from './models/FlashSale.js'; import Invasion from './models/Invasion.js'; import DarkSector from './models/DarkSector.js'; import VoidTrader from './models/VoidTrader.js'; import DailyDeal from './models/DailyDeal.js'; import Simaris from './models/Simaris.js'; import ConclaveChallenge from './models/ConclaveChallenge.js'; import PersistentEnemy from './models/PersistentEnemy.js'; import EarthCycle from './models/EarthCycle.js'; import CetusCycle from './models/CetusCycle.js'; import CambionCycle from './models/CambionCycle.js'; import ZarimanCycle from './models/ZarimanCycle.js'; import WeeklyChallenge from './models/WeeklyChallenge.js'; import ConstructionProgress from './models/ConstructionProgress.js'; import VallisCycle from './models/VallisCycle.js'; import Nightwave from './models/Nightwave.js'; import SentientOutpost from './models/SentientOutpost.js'; import SteelPathOffering from './models/SteelPathOffering.js'; import DuviriCycle from './models/DuviriCycle.js'; import Kinepage from './models/Kinepage.js'; import DeepArchimedea from './models/DeepArchidemea.js';