Upload files to "src/types"

This commit is contained in:
Aleksander Wilczyński 2024-08-02 12:54:36 +02:00
parent a74d75d6db
commit 71b873faf7
Signed by: gitea
GPG Key ID: CECFC30736A3D1C8
4 changed files with 62 additions and 0 deletions

4
src/types/payload.ts Normal file
View File

@ -0,0 +1,4 @@
export type ISimrailPayload = {
result: boolean;
description: string;
}

26
src/types/player.ts Normal file
View File

@ -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[]
}
}

23
src/types/station.ts Normal file
View File

@ -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;

9
src/types/typings.d.ts vendored Normal file
View File

@ -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;
}