mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 19:48:11 +00:00
restruct: types organization
This commit is contained in:
@@ -100,7 +100,7 @@ import { useStore } from '../../store';
|
|||||||
import imageMixin from '../../mixins/imageMixin';
|
import imageMixin from '../../mixins/imageMixin';
|
||||||
import stockMixin from '../../mixins/stockMixin';
|
import stockMixin from '../../mixins/stockMixin';
|
||||||
|
|
||||||
import { IRealComposition, VehicleGroupType } from '../../types';
|
import { IRealComposition, VehicleGroupType } from '../../types/common.types';
|
||||||
|
|
||||||
function getVehicleType(stockType: string): VehicleGroupType {
|
function getVehicleType(stockType: string): VehicleGroupType {
|
||||||
if (/^E/.test(stockType)) return 'loco-electric';
|
if (/^E/.test(stockType)) return 'loco-electric';
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ import imageMixin from '../../mixins/imageMixin';
|
|||||||
import { useStore } from '../../store';
|
import { useStore } from '../../store';
|
||||||
import stockPreviewMixin from '../../mixins/stockPreviewMixin';
|
import stockPreviewMixin from '../../mixins/stockPreviewMixin';
|
||||||
import stockMixin from '../../mixins/stockMixin';
|
import stockMixin from '../../mixins/stockMixin';
|
||||||
import { LocoGroupType, WagonGroupType } from '../../types';
|
import { LocoGroupType, WagonGroupType } from '../../types/common.types';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
mixins: [imageMixin, stockPreviewMixin, stockMixin],
|
mixins: [imageMixin, stockPreviewMixin, stockMixin],
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ import { defineComponent } from 'vue';
|
|||||||
import { useStore } from '../../store';
|
import { useStore } from '../../store';
|
||||||
|
|
||||||
import stockMixin from '../../mixins/stockMixin';
|
import stockMixin from '../../mixins/stockMixin';
|
||||||
import { ICargo, ICarWagon, IStock } from '../../types';
|
import { ICargo, ICarWagon, IStock } from '../../types/common.types';
|
||||||
import { isTractionUnit } from '../../utils/vehicleUtils';
|
import { isTractionUnit } from '../../utils/vehicleUtils';
|
||||||
|
|
||||||
import generatorDataJSON from '../../data/generatorData.json';
|
import generatorDataJSON from '../../data/generatorData.json';
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { useStore } from '../../store';
|
import { useStore } from '../../store';
|
||||||
import stockPreviewMixin from '../../mixins/stockPreviewMixin';
|
import stockPreviewMixin from '../../mixins/stockPreviewMixin';
|
||||||
import { IVehicle } from '../../types';
|
import { IVehicle } from '../../types/common.types';
|
||||||
import { isTractionUnit } from '../../utils/vehicleUtils';
|
import { isTractionUnit } from '../../utils/vehicleUtils';
|
||||||
import stockMixin from '../../mixins/stockMixin';
|
import stockMixin from '../../mixins/stockMixin';
|
||||||
import imageMixin from '../../mixins/imageMixin';
|
import imageMixin from '../../mixins/imageMixin';
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
class ApiStockManager {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { useStore } from '../store';
|
import { useStore } from '../store';
|
||||||
import { ICarWagon, ILocomotive, IStock, ICargo, IVehicle } from '../types';
|
import { ICarWagon, ILocomotive, IStock, ICargo, IVehicle } from '../types/common.types';
|
||||||
import { isTractionUnit } from '../utils/vehicleUtils';
|
import { isTractionUnit } from '../utils/vehicleUtils';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { useStore } from '../store';
|
import { useStore } from '../store';
|
||||||
import { ICarWagon, ILocomotive, IStock, IVehicle, LocoGroupType, WagonGroupType } from '../types';
|
import { ICarWagon, ILocomotive, IStock, IVehicle, LocoGroupType, WagonGroupType } from '../types/common.types';
|
||||||
import { isTractionUnit } from '../utils/vehicleUtils';
|
import { isTractionUnit } from '../utils/vehicleUtils';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ import {
|
|||||||
LocoGroupType,
|
LocoGroupType,
|
||||||
WagonGroupType,
|
WagonGroupType,
|
||||||
IVehicleData,
|
IVehicleData,
|
||||||
} from './types';
|
} from './types/common.types';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import {
|
import {
|
||||||
acceptableWeight,
|
acceptableWeight,
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
// API namespace
|
||||||
|
export namespace API {
|
||||||
|
export interface ActiveData {
|
||||||
|
trains: Train[];
|
||||||
|
activeSceneries: ActiveScenery[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ActiveScenery {
|
||||||
|
dispatcherId: number;
|
||||||
|
dispatcherName: string;
|
||||||
|
dispatcherIsSupporter: boolean;
|
||||||
|
stationName: string;
|
||||||
|
stationHash: string;
|
||||||
|
region: string;
|
||||||
|
maxUsers: number;
|
||||||
|
currentUsers: number;
|
||||||
|
spawn: number;
|
||||||
|
lastSeen: number;
|
||||||
|
dispatcherExp: number;
|
||||||
|
nameFromHeader: string;
|
||||||
|
spawnString?: string;
|
||||||
|
networkConnectionString: string;
|
||||||
|
isOnline: number;
|
||||||
|
dispatcherRate: number;
|
||||||
|
dispatcherStatus: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Train {
|
||||||
|
id: string;
|
||||||
|
trainNo: number;
|
||||||
|
mass: number;
|
||||||
|
speed: number;
|
||||||
|
length: number;
|
||||||
|
distance: number;
|
||||||
|
stockString: string;
|
||||||
|
driverName: string;
|
||||||
|
driverId: number;
|
||||||
|
driverIsSupporter: boolean;
|
||||||
|
driverLevel: number;
|
||||||
|
currentStationHash: string;
|
||||||
|
currentStationName: string;
|
||||||
|
signal: string;
|
||||||
|
connectedTrack: string;
|
||||||
|
online: number;
|
||||||
|
lastSeen: number;
|
||||||
|
region: string;
|
||||||
|
isTimeout: boolean;
|
||||||
|
timetable?: Timetable;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Timetable {
|
||||||
|
SKR: boolean;
|
||||||
|
TWR: boolean;
|
||||||
|
hasDangerousCargo: boolean;
|
||||||
|
hasExtraDeliveries: boolean;
|
||||||
|
warningNotes: string;
|
||||||
|
category: string;
|
||||||
|
stopList: TimetableStop[];
|
||||||
|
route: string;
|
||||||
|
timetableId: number;
|
||||||
|
sceneries: string[];
|
||||||
|
path: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TimetableStop {
|
||||||
|
stopName: string;
|
||||||
|
stopNameRAW: string;
|
||||||
|
stopType: string;
|
||||||
|
stopDistance: number;
|
||||||
|
pointId: string;
|
||||||
|
comments?: (null | string)[];
|
||||||
|
mainStop: boolean;
|
||||||
|
arrivalLine?: string;
|
||||||
|
arrivalTimestamp: number;
|
||||||
|
arrivalRealTimestamp: number;
|
||||||
|
arrivalDelay: number;
|
||||||
|
departureLine?: string;
|
||||||
|
departureTimestamp: number;
|
||||||
|
departureRealTimestamp: number;
|
||||||
|
departureDelay: number;
|
||||||
|
beginsHere: boolean;
|
||||||
|
terminatesHere: boolean;
|
||||||
|
confirmed: number;
|
||||||
|
stopped: number;
|
||||||
|
stopTime?: number;
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
IVehiclesAPIResponse,
|
IVehiclesAPIResponse,
|
||||||
LocoGroupType,
|
LocoGroupType,
|
||||||
WagonGroupType,
|
WagonGroupType,
|
||||||
} from '../types';
|
} from '../types/common.types';
|
||||||
import {
|
import {
|
||||||
MassLimitLocoType,
|
MassLimitLocoType,
|
||||||
SpeedLimitLocoType,
|
SpeedLimitLocoType,
|
||||||
|
|||||||
Reference in New Issue
Block a user