soccer-go
Version:
Soccer CLI for stats and results.
108 lines (107 loc) • 2.66 kB
TypeScript
import Table from 'cli-table3';
import { IRowable } from '../tableBuilders/BaseTableBuilder';
export declare enum Status {
Scheduled = "SCHEDULED",
Timed = "TIMED",
InPlay = "IN_PLAY",
Paused = "PAUSED",
ExtraTime = "EXTRA_TIME",
Penalty = "PENALTY_SHOOTOUT",
Finished = "FINISHED",
Suspended = "SUSPENDED",
Postponed = "POSTPONED",
Cancelled = "CANCELLED",
Awarded = "AWARDED"
}
export declare enum Stage {
Final = "FINAL",
ThirdPlace = "THIRD_PLACE",
SemiFinals = "SEMI_FINALS",
QuarterFinals = "QUARTER_FINALS",
Last16 = "LAST_16",
Last32 = "LAST_32",
Last64 = "LAST_64",
Round4 = "ROUND_4",
Round3 = "ROUND_3",
Round2 = "ROUND_2",
Round1 = "ROUND_1",
GroupStage = "GROUP_STAGE",
Preliminary_Round = "PRELIMINARY_ROUND",
Qualification = "QUALIFICATION",
QualificationRound1 = "QUALIFICATION_ROUND_1",
QualificationRound2 = "QUALIFICATION_ROUND_2",
QualificationRound3 = "QUALIFICATION_ROUND_3",
PlayoffRound = "PLAYOFF_ROUND",
PlayoffRound1 = "PLAYOFF_ROUND_1",
PlayoffRound2 = "PLAYOFF_ROUND_2",
Playoffs = "PLAYOFFS",
RegularSeason = "REGULAR_SEASON",
Clausura = "CLAUSURA",
Apertura = "APERTURA",
Championship = "CHAMPIONSHIP",
Relegation = "RELEGATION",
RelegationRound = "RELEGATION_ROUND",
LeagueStage = "LEAGUE_STAGE"
}
export declare const stageDisplayString: Record<Stage, string>;
export interface ISide {
team: string;
goals: number;
}
export interface IFixtureLinks {
self: string;
homeTeam: string;
awayTeam: string;
}
export default class Fixture implements IRowable {
id: number;
home: ISide;
away: ISide;
matchday: number | null;
stage: Stage;
status: Status;
date: Date;
referee: IReferee | null;
links: IFixtureLinks;
constructor(data: IFixtureJson);
toRow(): Table.Cell[];
private getScores;
}
export interface IFixtureJson {
id: number;
utcDate: Date;
status: Status;
matchday: number | null;
stage: Stage;
homeTeam: ITeamSide;
awayTeam: ITeamSide;
venue: string | null;
referees?: IReferee[];
score: {
winner: string | null;
duration: string;
fullTime: Score;
halfTime: Score;
regularTime?: Score;
extraTime?: Score;
penalties?: Score;
};
}
export interface IReferee {
id: number;
name: string;
type: string;
nationality: string;
}
interface ITeamSide {
id: number;
name: string;
}
type Score = {
home: number;
away: number;
} | {
home: null;
away: null;
};
export {};