UNPKG

warframe-worldstate-parser

Version:

An Open parser for Warframe's Worldstate in Javascript

255 lines (254 loc) 7.51 kB
import { t as Dependency } from "../Dependency-fgtm0qdZ.mjs"; import { B as DuviriCycle, C as Sortie, D as Simaris, E as LibraryInfo, F as RawGlobalUpgrade, G as RawDailyDeal, I as FlashSale, J as ClanInitiativeRewards, K as ConclaveChallenge, L as RawFlashSale, N as RawInvasion, P as GlobalUpgrade, R as Fissure, S as RawSortie, U as RawDarkSector, V as DarkSector, W as DailyDeal, Z as WeeklyVaultBonusReward, _ as RawSyndicateMission, a as WorldEvent, c as RawVoidTrader, et as Archimedea, i as RawWorldEvent, j as Invasion, k as SentientOutpost, l as VoidTrader, lt as Alert, o as RawWeeklyChallenge, q as RawChallenge, s as WeeklyChallenge, st as RawArchimedea, ut as RawAlert, v as SyndicateMission, vt as RawChoice, z as RawFissure } from "../index-DazGDTMo.mjs"; import { t as ExternalMission } from "../ExternalMission-CyjaiHtM.mjs"; import { r as WorldStateObject, t as BaseContentObject } from "../WorldStateObject-CIJgXUCx.mjs"; import { r as RawCalender, t as Calendar } from "../Calendar-D7QlYdGs.mjs"; import { t as CetusCycle } from "../CetusCycle-LdcGs_wx.mjs"; import { t as CambionCycle } from "../CambionCycle-zMzaSuKG.mjs"; import { t as ConstructionProgress } from "../ConstructionProgress-fM9jbjFW.mjs"; import { t as EarthCycle } from "../EarthCycle-tuV5mFzh.mjs"; import { t as Kinepage } from "../Kinepage-ChaoLN-v.mjs"; import { n as RawNews, t as News } from "../News-CKODxayp.mjs"; import { n as RawNightwave, t as Nightwave } from "../Nightwave-D7wrORCe.mjs"; import { n as RawPersistentEnemy, t as PersistentEnemy } from "../PersistentEnemy-CgRe5bWz.mjs"; import { n as SteelPathOfferings } from "../SteelPathOffering-BRZtir78.mjs"; import { t as VallisCycle } from "../VallisCycle-DpoQ9hBT.mjs"; import { n as ZarimanCycle } from "../ZarimanCycle-crkro6pa.mjs"; //#region lib/WorldState.d.ts /** * * @param ParserClass class for parsing data * @param dataArray array of raw data * @param deps shared dependency object * @param uniqueField field to treat as unique * @returns array of parsed objects */ declare function parseArray<T, D extends BaseContentObject>(ParserClass: new (data: D, deps: Dependency) => T, dataArray: Array<D>, deps: Dependency, uniqueField?: keyof T): T[]; /** * Parse array of objects that requires async parsing * @param ParserClass class for parsing data - must expose a static build method * @param dataArray array of raw data * @param deps shared dependency object * @param uniqueField field to treat as unique * @returns array of parsed objects */ declare function parseAsyncArray<T extends WorldStateObject, D extends BaseContentObject>(ParserClass: { build: (data: D, deps: Dependency) => Promise<T>; }, dataArray: Array<D>, deps: Dependency, uniqueField?: keyof T): Promise<T[]>; interface InitialWorldState { Time: number; BuildLabel: string; Events: RawNews[]; Goals: RawWorldEvent[]; Alerts: RawAlert[]; Sorties: RawSortie[]; LiteSorties: RawSortie[]; SyndicateMissions: RawSyndicateMission[]; ActiveMissions: RawFissure[]; VoidStorms: RawFissure[]; GlobalUpgrades: RawGlobalUpgrade[]; FlashSales: RawFlashSale[]; Invasions: RawInvasion[]; BadlandNodes: RawDarkSector[]; VoidTraders: RawVoidTrader[]; DailyDeals: RawDailyDeal[]; LibraryInfo?: LibraryInfo; PVPChallengeInstances: RawChallenge[]; PersistentEnemies: RawPersistentEnemy[]; WeeklyChallenges?: RawWeeklyChallenge; ProjectPct: number[]; SeasonInfo: RawNightwave; PrimeVaultTraders: RawVoidTrader[]; EndlessXpSchedule: Array<{ CategoryChoices: RawChoice[]; }>; KnownCalendarSeasons: RawCalender[]; Conquests: RawArchimedea[]; WeeklyVaultBonusRewards: WeeklyVaultBonusReward[]; Tmp: string; } /** * Parses Warframe Worldstate JSON */ declare class WorldState { /** * The date and time at which the World State was generated */ timestamp: Date; /** * Current Warframe version */ buildLabel: string; /** * The in-game news */ news: News[]; /** * The current events */ events: WorldEvent[]; /** * The current alerts */ alerts: Alert[]; /** * The current sortie */ sortie: Sortie; /** * The current syndicate missions */ syndicateMissions: SyndicateMission[]; /** * The current fissures: 'ActiveMissions' & 'VoidStorms' */ fissures: Fissure[]; /** * The current global upgrades */ globalUpgrades: GlobalUpgrade[]; /** * The current flash sales */ flashSales: FlashSale[]; /** * The current invasions */ invasions: Invasion[]; /** * The state of the dark sectors */ darkSectors: DarkSector[]; /** * The state of all Void Traders */ voidTraders: VoidTrader[]; /** * The first entry for voidTraders * @deprecated */ voidTrader: VoidTrader; /** * The current daily deals */ dailyDeals: DailyDeal[]; /** * The state of the sanctuary synthesis targets */ simaris: Simaris; /** * The current conclave challenges */ conclaveChallenges: ConclaveChallenge[]; /** * The currently active persistent enemies */ persistentEnemies: PersistentEnemy[]; /** * The current earth cycle */ earthCycle: EarthCycle; /** * The current Cetus cycle */ cetusCycle: CetusCycle; /** * Cambion Drift Cycle */ cambionCycle: CambionCycle; /** * The current Zariman cycle based off current time */ zarimanCycle: ZarimanCycle; /** * Midrath cycle (soulframe) * Game seems to desync while you play and appearntly it changes between updates. */ /** * Weekly challenges */ weeklyChallenges?: WeeklyChallenge; /** * The Current construction progress for Fomorians/Razorback/etc. */ constructionProgress: ConstructionProgress; /** * The current Orb Vallis cycle state */ vallisCycle: VallisCycle; /** * The current nightwave season */ nightwave?: Nightwave; /** * Kuva missions array */ kuva?: ExternalMission[]; /** * Arbitration mission */ arbitration?: ExternalMission; /** * Current sentient outposts */ sentientOutposts: SentientOutpost; /** * Steel path offering rotation */ steelPath: SteelPathOfferings; /** * The current prime resurgence */ vaultTrader: VoidTrader; /** * The current archon hunt */ archonHunt: Sortie; /** * Current Duviri circuit choices */ duviriCycle: DuviriCycle; /** * Current kinepage message */ kinepage: Kinepage; /** * The current Archimedea missions and modifiers */ archimedeas: Archimedea[]; /** * The current calendar for 1999 */ calendar: Calendar; /** * Faceoff bonus current state */ faceoffBonus?: { activation: Date; expiry: Date; next: Date; }; /** * Warframe's annual Quest to Conquer Cancer donation count and next tier goal */ questToConquerCancer?: { count: number; goal: number; }; /** * The current week's clan initiative rewards */ clanWeeklyInitiative?: ClanInitiativeRewards; /** * Generates the worldstate json as a string into usable objects */ static build(json: string, deps?: Dependency): Promise<WorldState>; /** * @param data The worldstate JSON string * @param deps The options object */ constructor(data: InitialWorldState, deps?: Dependency); } declare const _default: (json: string, deps: Dependency) => Promise<WorldState>; //#endregion export { InitialWorldState, WorldState, _default as default, parseArray, parseAsyncArray };