chore: fetching & caching vehicles data information

This commit is contained in:
2024-06-03 01:31:31 +02:00
parent 785a42b849
commit 8190dfa2cb
4 changed files with 61 additions and 15 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { Status } from './common';
import { Status, VehiclesData } from './common';
export enum APIDataStatus {
OK = 'OK',
@@ -19,6 +19,7 @@ export namespace API {
apiStatuses?: APIStatuses;
}
}
export namespace DispatcherHistory {
export type Response = Data[];
@@ -316,6 +317,10 @@ export namespace API {
export namespace Donators {
export type Response = string[];
}
export namespace Vehicles {
export type Response = VehiclesData;
}
}
export namespace GithubAPI {
+24
View File
@@ -189,3 +189,27 @@ export interface CheckpointTrain {
checkpointStop: TrainStop;
train: Train;
}
// Vehicles Data
export interface VehiclesData {
simulatorVersion: string;
vehicleList: any[][];
vehicleProps: VehicleProps[];
}
export interface VehicleProps {
type: string;
speed: number;
length: number;
weight: number;
cargoTypes?: VehicleCargo[];
coldStart?: boolean;
doubleManned?: boolean;
}
export interface VehicleCargo {
id: string;
weight: number;
}