UNPKG

@kayahr/ed-journal

Version:

Typescript library to read/watch the player journal of Frontier's game Elite Dangerous

40 lines (39 loc) 1.46 kB
import { type JournalEvent } from "../../JournalEvent.ts"; import type { ID } from "../types/ID.ts"; /** The possible progress states of an engineer. */ export type EngineerProgressState = "Known" | "Invited" | "Unlocked"; /** * Base interface for an engineer extended by {@link LockedEngineer} and {@link UnlockedEngineer} */ export interface EngineerBase { /** The engineer's name. */ Engineer: string; /** The engineer ID. Not present in older events, therefor optional. */ EngineerID?: ID; /** The engineer's progress state. */ Progress: EngineerProgressState; } /** * A locked engineer (known or invited state) without rank and rang progress information. */ export interface LockedEngineer extends EngineerBase { Progress: "Known" | "Invited"; } /** * An unlocked engineer with rank and rank progress. */ export interface UnlockedEngineer extends EngineerBase { Progress: "Unlocked"; /** The unlocked rank. */ Rank: number; RankProgress: number; } /** Union type of {@link LockedEngineer} and {@link UnlockedEngineer}. */ export type Engineer = LockedEngineer | UnlockedEngineer; export interface EngineerProgress extends JournalEvent<"EngineerProgress"> { /** * List of engineers. As old event formats (containing only one engineer) are converted to new event format this list may only contain one engineer * and the event may be fired multiple times. */ Engineers: Engineer[]; }