Add types for new trainService(Timetable) data

This commit is contained in:
Fred Boniface 2023-10-12 20:45:26 +01:00
parent fd6eb64cc4
commit c5f5b07ddb
3 changed files with 39 additions and 0 deletions

View File

@ -11,5 +11,7 @@ export { ApiResponse } from './src/owlboardApi/apiResponse'
export { Versions } from './src/owlboardApi/versions'
export { StaffLdb, NrccMessage, TrainServices,
ServiceLocation } from './src/owlboardApi/staffLdb'
export { OB_TrainTT_service, OB_TrainTT_stopDetail } from './src/owlboardApi/trainTimetable'
export { OB_Pis_SimpleObject } from './src/owlboardApi/pis'
// Upstream API

13
src/owlboardApi/pis.ts Normal file
View File

@ -0,0 +1,13 @@
export interface OB_Pis_SimpleObject {
code: number;
match: "full" | "partial";
msg: string;
}
/* NOT IN USE YET
export interface OB_Pis_FullObject {
code: number;
crs: string[];
tiploc?: string[];
}
*/

View File

@ -0,0 +1,24 @@
import type { OB_Pis_SimpleObject } from "./pis";
export interface OB_TrainTT_service {
stpIndicator: string;
operator: string;
trainUid: string;
headcode: string;
powerType: string;
planSpeed: number;
scheduleStart: Date;
scheduleEnd: Date;
daysRun: string[];
stops: OB_TrainTT_stopDetail[];
pis: OB_Pis_SimpleObject;
}
export interface OB_TrainTT_stopDetail {
publicDeparture?: string;
publicArrival?: string;
wttDeparture?: string;
wttArrival?: string;
tiploc: string;
isPublic: boolean;
}