diff --git a/src/types/payload.ts b/src/types/payload.ts new file mode 100644 index 00000000..bab2933a --- /dev/null +++ b/src/types/payload.ts @@ -0,0 +1,4 @@ +export type ISimrailPayload = { + result: boolean; + description: string; +} \ No newline at end of file diff --git a/src/types/player.ts b/src/types/player.ts new file mode 100644 index 00000000..2edc7122 --- /dev/null +++ b/src/types/player.ts @@ -0,0 +1,26 @@ +export type IPlayer = { + steamid: string, + communityvisibilitystate: number, + profilestate: number, + personaname: string, + commentpermission: number, + profileurl: string, + avatar: string, + avatarmedium: string, + avatarfull: string, + avatarhash: string, + personastate: number, + primaryclanid: string, + timecreated: number, + personastateflags: number, + gameextrainfo: string, + gameid: string, + loccountrycode: string, + locstatecode: string +} + +export type IPlayerPayload = { + response: { + players: IPlayer[] + } +} \ No newline at end of file diff --git a/src/types/station.ts b/src/types/station.ts new file mode 100644 index 00000000..946bb647 --- /dev/null +++ b/src/types/station.ts @@ -0,0 +1,23 @@ +import { ISimrailPayload } from './payload.js'; + +export type IStation = { + Name: string; + Prefix: string; + DifficultyLevel: number; + Latititude: number; + Longitude: number; + MainImageURL: string; + AdditionalImage1URL: string; + AdditionalImage2URL: string; + DispatchedBy: IStationDispatch[]; +} + +export type IStationDispatch = { + ServerCode: string, + SteamId: number +} + +export type IStationPayload = { + data: IStation[]; + count: number; +} & ISimrailPayload; \ No newline at end of file diff --git a/src/types/typings.d.ts b/src/types/typings.d.ts new file mode 100644 index 00000000..c879e3be --- /dev/null +++ b/src/types/typings.d.ts @@ -0,0 +1,9 @@ +import { RedisClient, RedisClientType } from 'redis' +import { SimrailClient } from '../util/SimrailClient.ts' +/* eslint no-var: off */ +declare global +{ + declare var redis: RedisClientType, + client: SimrailClient; + +} \ No newline at end of file