From 7dec2bd445ded054aab3dc277a0a503b1b6ace17 Mon Sep 17 00:00:00 2001 From: marley Date: Thu, 18 May 2023 09:56:04 -0700 Subject: [PATCH] Removing unneeded types. --- src/@types/journalLines.d.ts | 37 ++---------------------------------- src/models/System.ts | 7 ++++--- 2 files changed, 6 insertions(+), 38 deletions(-) diff --git a/src/@types/journalLines.d.ts b/src/@types/journalLines.d.ts index 6b7a282..a585234 100755 --- a/src/@types/journalLines.d.ts +++ b/src/@types/journalLines.d.ts @@ -3,29 +3,6 @@ interface journalEntry { event: eventType, } -export interface discoveryHonk extends journalEntry<'FSSDiscoveryScan'> { - Progress: number, - BodyCount: number, - NonBodyCount: number, - SystemName: string, - SystemAddress: number, -} - -export interface completedSystemFSSScan extends journalEntry<'FSSAllBodiesFound'> { - event: 'FSSAllBodiesFound', - SystemName: string, - SystemAddress: number, - Count: number, -} - -export interface dssIndicator extends journalEntry<'SAAScanComplete'> { - BodyName: string, - SystemAddress: number, - BodyID: number, - ProbesUsed: number, - EfficiencyTarget: number, -} - interface bodyParent { [index: string]: number, } @@ -131,18 +108,8 @@ export interface planetScan extends journalEntry<'Scan'> { WasMapped: boolean, } -export type autoScan = starScan<'AutoScan'> | asteroidScan<'AutoScan'> | planetScan<'AutoScan'> -export type detailedScan = starScan<'Detailed'> & asteroidScan<'Detailed'> & planetScan<'Detailed'> -export type discoveryScan = detailedScan -export type fssScan = detailedScan -export type dssScan = detailedScan - -export interface startFsdJump extends journalEntry<'StartJump'> { - JumpType: 'Hyperspace', - StarSystem: string, - SystemAddress: number, - StarClass: string, -} +export type autoScan = starScan<'AutoScan'>|asteroidScan<'AutoScan'>|planetScan<'AutoScan'> +export type detailedScan = starScan<'Detailed'>&asteroidScan<'Detailed'>&planetScan<'Detailed'> interface faction { Name: string, diff --git a/src/models/System.ts b/src/models/System.ts index b95d8f6..ac5dc4e 100755 --- a/src/models/System.ts +++ b/src/models/System.ts @@ -1,11 +1,12 @@ -import { FSDJump } from '@kayahr/ed-journal'; -import type { location, navRouteSystem } from '../@types/journalLines'; +import { FSDJump, ExtendedNavRoute, Location } from '@kayahr/ed-journal'; import * as _ from 'lodash-es'; import { Body } from './Body'; import { EDSM } from './EDSM'; +type ExtendedNavRouteSystem = (ExtendedNavRoute)['Route'][0]; + export class System { name: string; SystemAddress?: number; @@ -18,7 +19,7 @@ export class System { estimatedValueMapped?: number; valuableBodies?: Body[]; - constructor(line?: navRouteSystem|FSDJump|location) { + constructor(line?: ExtendedNavRouteSystem|FSDJump|Location) { if (!line) { this.name = 'Unknown'; } else {