UNPKG

uefa-api

Version:

Typescript bindings and utils for the UEFA APIs

58 lines (57 loc) 2.25 kB
import type { Lineup, Match, MatchEventDetails, MatchStats } from '../api'; export declare enum SortOrder { ASCENDING = "ASC", DESCENDING = "DESC" } interface FilterCriteria { competitionId?: string | number; groupId?: string | number; seasonYear?: string | number; opponentTeamIds?: string | number | (string | number)[]; order?: SortOrder; matchId?: string | number | (string | number)[]; } /** * Get matches based on filter criteria * The API response is paginated by a limit and offset, except when filtering by match ids * * @param filter The criteria to filter matches by (match id, competition id, group id, opponent team ids, season year) * @param order Sort order of the matches * @param limit Maximum number of matches to return * @param offset Number of matches to skip * @returns Promise resolving to an array of matches */ export declare const getMatches: (filter: FilterCriteria, order?: SortOrder, limit?: number, offset?: number) => Promise<Match[]>; /** * Get a single match by its id * * @param matchId The id of the match to retrieve * @returns Promise resolving to the match * @throws Error if the match is not found */ export declare const getMatch: (matchId: string | number) => Promise<Match>; /** * Get match statistics by match id * * @param matchId The id of the match to retrieve statistics for * @returns Promise resolving to the match statistics */ export declare const getMatchStats: (matchId: string | number) => Promise<MatchStats[]>; /** * Get match events by match id * * @param matchId The id of the match to retrieve events for * @param order Sort order of the events * @param limit Maximum number of events to return * @param offset Number of events to skip * @returns Promise resolving to the match events */ export declare const getMatchEvents: (matchId: string | number, order?: SortOrder, limit?: number, offset?: number) => Promise<MatchEventDetails[]>; /** * Get lineups by match id * * @param matchId The id of the match to retrieve lineups for * @returns Promise resolving to the lineups */ export declare const getLineups: (matchId: string | number) => Promise<Lineup>; export {};