chore: adjusted to new version of API vehicles data

This commit is contained in:
2024-06-08 20:53:22 +02:00
parent c252213ed9
commit 59a5fbe5ac
6 changed files with 61 additions and 68 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { Status, VehiclesData } from './common';
import { Status, VehicleData } from './common';
export enum APIDataStatus {
OK = 'OK',
@@ -320,7 +320,7 @@ export namespace API {
}
export namespace Vehicles {
export type Response = VehiclesData;
export type Response = VehicleData[];
}
}
+16 -10
View File
@@ -191,22 +191,28 @@ export interface CheckpointTrain {
}
// Vehicles Data
export interface VehiclesData {
simulatorVersion: string;
vehicleList: any[][];
vehicleProps: VehicleProps[];
export interface VehicleData {
id: number;
name: string;
type: string;
cabinName: string | null;
restrictions: Record<string, any> | null;
vehicleGroupsId: number;
group: VehiclesGroup;
}
export interface VehicleProps {
type: string;
export interface VehiclesGroup {
id: number;
name: string;
speed: number;
length: number;
weight: number;
cargoTypes?: VehicleCargo[];
coldStart?: boolean;
doubleManned?: boolean;
cargoTypes: VehicleCargo[] | null;
locoProps: {
coldStart: boolean;
doubleManned: boolean;
} | null;
}
export interface VehicleCargo {