@bp1222/stats-api
Version:
Library for Typescript Client to query MLB StatsAPI
2,194 lines (2,028 loc) • 249 kB
TypeScript
export declare interface ApiResponse<T> {
raw: Response;
value(): Promise<T>;
}
/**
* Attendance data for teams, leagues, or sports.
*
* @export
* @interface Attendance
*/
export declare interface Attendance {
/**
*
* @type {Array<AttendanceRecord>}
* @memberof Attendance
*/
records: Array<AttendanceRecord>;
/**
*
* @type {AttendanceTotals}
* @memberof Attendance
*/
aggregateTotals: AttendanceTotals;
}
export declare function AttendanceFromJSON(json: any): Attendance;
export declare function AttendanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attendance;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface AttendanceGameType
*/
export declare interface AttendanceGameType {
/**
*
* @type {string}
* @memberof AttendanceGameType
*/
id?: string;
/**
*
* @type {string}
* @memberof AttendanceGameType
*/
description?: string;
}
export declare function AttendanceGameTypeFromJSON(json: any): AttendanceGameType;
export declare function AttendanceGameTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttendanceGameType;
export declare function AttendanceGameTypeToJSON(json: any): AttendanceGameType;
export declare function AttendanceGameTypeToJSONTyped(value?: AttendanceGameType | null, ignoreDiscriminator?: boolean): any;
/**
*
* @export
* @interface AttendanceRecord
*/
export declare interface AttendanceRecord {
/**
*
* @type {Team}
* @memberof AttendanceRecord
*/
team?: Team;
/**
*
* @type {string}
* @memberof AttendanceRecord
*/
year?: string;
/**
*
* @type {AttendanceGameType}
* @memberof AttendanceRecord
*/
gameType?: AttendanceGameType;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
gamesTotal?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
gamesAwayTotal?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
gamesHomeTotal?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
openingsTotal?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
openingsTotalAway?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
openingsTotalHome?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
openingsTotalLost?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceTotal?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceTotalAway?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceTotalHome?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceAverageAway?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceAverageHome?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceAverageYtd?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceOpeningAverage?: number;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceHigh?: number;
/**
*
* @type {string}
* @memberof AttendanceRecord
*/
attendanceHighDate?: string;
/**
*
* @type {AttendanceRecordAttendanceHighGame}
* @memberof AttendanceRecord
*/
attendanceHighGame?: AttendanceRecordAttendanceHighGame;
/**
*
* @type {number}
* @memberof AttendanceRecord
*/
attendanceLow?: number;
/**
*
* @type {string}
* @memberof AttendanceRecord
*/
attendanceLowDate?: string;
/**
*
* @type {AttendanceRecordAttendanceHighGame}
* @memberof AttendanceRecord
*/
attendanceLowGame?: AttendanceRecordAttendanceHighGame;
}
/**
*
* @export
* @interface AttendanceRecordAttendanceHighGame
*/
export declare interface AttendanceRecordAttendanceHighGame {
/**
*
* @type {number}
* @memberof AttendanceRecordAttendanceHighGame
*/
gamePk?: number;
/**
*
* @type {string}
* @memberof AttendanceRecordAttendanceHighGame
*/
link?: string;
/**
*
* @type {Content}
* @memberof AttendanceRecordAttendanceHighGame
*/
content?: Content;
/**
*
* @type {string}
* @memberof AttendanceRecordAttendanceHighGame
*/
dayNight?: string;
}
export declare function AttendanceRecordAttendanceHighGameFromJSON(json: any): AttendanceRecordAttendanceHighGame;
export declare function AttendanceRecordAttendanceHighGameFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttendanceRecordAttendanceHighGame;
export declare function AttendanceRecordAttendanceHighGameToJSON(json: any): AttendanceRecordAttendanceHighGame;
export declare function AttendanceRecordAttendanceHighGameToJSONTyped(value?: AttendanceRecordAttendanceHighGame | null, ignoreDiscriminator?: boolean): any;
export declare function AttendanceRecordFromJSON(json: any): AttendanceRecord;
export declare function AttendanceRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttendanceRecord;
export declare function AttendanceRecordToJSON(json: any): AttendanceRecord;
export declare function AttendanceRecordToJSONTyped(value?: AttendanceRecord | null, ignoreDiscriminator?: boolean): any;
export declare function AttendanceToJSON(json: any): Attendance;
export declare function AttendanceToJSONTyped(value?: Attendance | null, ignoreDiscriminator?: boolean): any;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface AttendanceTotals
*/
export declare interface AttendanceTotals {
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
openingsTotalAway?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
openingsTotalHome?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
openingsTotalLost?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
openingsTotalYtd?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
attendanceTotal?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
attendanceTotalAway?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
attendanceTotalHome?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
attendanceAverageAway?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
attendanceAverageHome?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
attendanceAverageYtd?: number;
/**
*
* @type {number}
* @memberof AttendanceTotals
*/
attendanceHigh?: number;
/**
*
* @type {string}
* @memberof AttendanceTotals
*/
attendanceHighDate?: string;
}
export declare function AttendanceTotalsFromJSON(json: any): AttendanceTotals;
export declare function AttendanceTotalsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttendanceTotals;
export declare function AttendanceTotalsToJSON(json: any): AttendanceTotals;
export declare function AttendanceTotalsToJSONTyped(value?: AttendanceTotals | null, ignoreDiscriminator?: boolean): any;
/**
* An award recipient record.
*
* @export
* @interface Award
*/
export declare interface Award {
/**
*
* @type {string}
* @memberof Award
*/
id?: string;
/**
*
* @type {string}
* @memberof Award
*/
name?: string;
/**
*
* @type {string}
* @memberof Award
*/
date?: string;
/**
*
* @type {string}
* @memberof Award
*/
season?: string;
/**
*
* @type {Team}
* @memberof Award
*/
team?: Team;
/**
*
* @type {Person}
* @memberof Award
*/
player?: Person;
/**
*
* @type {string}
* @memberof Award
*/
notes?: string;
/**
*
* @type {string}
* @memberof Award
*/
awardType?: string;
}
export declare function AwardFromJSON(json: any): Award;
export declare function AwardFromJSONTyped(json: any, ignoreDiscriminator: boolean): Award;
/**
*
* @export
* @interface AwardsResponse
*/
export declare interface AwardsResponse {
/**
*
* @type {Array<Award>}
* @memberof AwardsResponse
*/
awards?: Array<Award>;
}
export declare function AwardsResponseFromJSON(json: any): AwardsResponse;
export declare function AwardsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AwardsResponse;
export declare function AwardsResponseToJSON(json: any): AwardsResponse;
export declare function AwardsResponseToJSONTyped(value?: AwardsResponse | null, ignoreDiscriminator?: boolean): any;
export declare function AwardToJSON(json: any): Award;
export declare function AwardToJSONTyped(value?: Award | null, ignoreDiscriminator?: boolean): any;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export declare const BASE_PATH: string;
/**
* This is the base class for all generated API classes.
*/
export declare class BaseAPI {
protected configuration: Configuration;
private static readonly jsonRegex;
private middleware;
constructor(configuration?: Configuration);
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
protected isJsonMime(mime: string | null | undefined): boolean;
protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
private createFetchParams;
private fetchApi;
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
private clone;
}
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Batting Stats
*
* @export
* @interface BattingStats
*/
export declare interface BattingStats {
/**
*
* @type {string}
* @memberof BattingStats
*/
summary?: string;
/**
*
* @type {number}
* @memberof BattingStats
*/
gamesPlayed?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
flyOuts?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
groundOuts?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
airOuts?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
runs?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
doubles?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
triples?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
homeRuns?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
strikeOuts?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
baseOnBalls?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
intentionalWalks?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
hits?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
hitByPitch?: number;
/**
*
* @type {string}
* @memberof BattingStats
*/
avg?: string;
/**
*
* @type {number}
* @memberof BattingStats
*/
atBats?: number;
/**
*
* @type {string}
* @memberof BattingStats
*/
obp?: string;
/**
*
* @type {string}
* @memberof BattingStats
*/
slg?: string;
/**
*
* @type {string}
* @memberof BattingStats
*/
ops?: string;
/**
*
* @type {string}
* @memberof BattingStats
*/
babip?: string;
/**
*
* @type {number}
* @memberof BattingStats
*/
caughtStealing?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
stolenBases?: number;
/**
*
* @type {string}
* @memberof BattingStats
*/
stolenBasePercentage?: string;
/**
*
* @type {string}
* @memberof BattingStats
*/
caughtStealingPercentage?: string;
/**
*
* @type {number}
* @memberof BattingStats
*/
groundIntoDoublePlay?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
groundIntoTriplePlay?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
plateAppearances?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
totalBases?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
rbi?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
leftOnBase?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
sacBunts?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
sacFlies?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
catchersInterference?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
pickoffs?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
numberOfPitches?: number;
/**
*
* @type {string}
* @memberof BattingStats
*/
groundOutsToAirouts?: string;
/**
*
* @type {string}
* @memberof BattingStats
*/
atBatsPerHomeRun?: string;
/**
*
* @type {number}
* @memberof BattingStats
*/
popOuts?: number;
/**
*
* @type {number}
* @memberof BattingStats
*/
lineOuts?: number;
}
export declare function BattingStatsFromJSON(json: any): BattingStats;
export declare function BattingStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BattingStats;
export declare function BattingStatsToJSON(json: any): BattingStats;
export declare function BattingStatsToJSONTyped(value?: BattingStats | null, ignoreDiscriminator?: boolean): any;
export declare class BlobApiResponse {
raw: Response;
constructor(raw: Response);
value(): Promise<Blob>;
}
/**
* Boxscore
*
* @export
* @interface Boxscore
*/
export declare interface Boxscore {
/**
*
* @type {BoxscoreTeams}
* @memberof Boxscore
*/
teams: BoxscoreTeams;
/**
*
* @type {Array<GameOfficial>}
* @memberof Boxscore
*/
officials: Array<GameOfficial>;
/**
*
* @type {Array<BoxscoreInfoItem>}
* @memberof Boxscore
*/
info?: Array<BoxscoreInfoItem>;
/**
*
* @type {Array<string>}
* @memberof Boxscore
*/
pitchingNotes?: Array<string>;
/**
*
* @type {Array<object>}
* @memberof Boxscore
*/
topPerformers?: Array<object>;
}
export declare function BoxscoreFromJSON(json: any): Boxscore;
export declare function BoxscoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): Boxscore;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface BoxscoreInfoItem
*/
export declare interface BoxscoreInfoItem {
/**
*
* @type {string}
* @memberof BoxscoreInfoItem
*/
label?: string;
/**
*
* @type {string}
* @memberof BoxscoreInfoItem
*/
value?: string;
}
export declare function BoxscoreInfoItemFromJSON(json: any): BoxscoreInfoItem;
export declare function BoxscoreInfoItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoxscoreInfoItem;
export declare function BoxscoreInfoItemToJSON(json: any): BoxscoreInfoItem;
export declare function BoxscoreInfoItemToJSONTyped(value?: BoxscoreInfoItem | null, ignoreDiscriminator?: boolean): any;
/**
* Boxscore Team
*
* @export
* @interface BoxscoreTeam
*/
export declare interface BoxscoreTeam {
/**
*
* @type {Team}
* @memberof BoxscoreTeam
*/
team: Team;
/**
*
* @type {TeamStats}
* @memberof BoxscoreTeam
*/
teamStats: TeamStats;
/**
*
* @type {Array<number>}
* @memberof BoxscoreTeam
*/
batters: Array<number>;
/**
*
* @type {Array<number>}
* @memberof BoxscoreTeam
*/
pitchers: Array<number>;
/**
*
* @type {Array<number>}
* @memberof BoxscoreTeam
*/
bullpen: Array<number>;
/**
*
* @type {Array<number>}
* @memberof BoxscoreTeam
*/
bench: Array<number>;
/**
*
* @type {Array<number>}
* @memberof BoxscoreTeam
*/
battingOrder?: Array<number>;
/**
*
* @type {{ [key: string]: Player; }}
* @memberof BoxscoreTeam
*/
players: {
[key: string]: Player;
};
/**
*
* @type {Array<BoxscoreTeamInfoSection>}
* @memberof BoxscoreTeam
*/
info?: Array<BoxscoreTeamInfoSection>;
/**
*
* @type {Array<BoxscoreTeamInfoSectionFieldListInner>}
* @memberof BoxscoreTeam
*/
note?: Array<BoxscoreTeamInfoSectionFieldListInner>;
}
export declare function BoxscoreTeamFromJSON(json: any): BoxscoreTeam;
export declare function BoxscoreTeamFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoxscoreTeam;
/**
*
* @export
* @interface BoxscoreTeamInfoSection
*/
export declare interface BoxscoreTeamInfoSection {
/**
*
* @type {string}
* @memberof BoxscoreTeamInfoSection
*/
title?: string;
/**
*
* @type {Array<BoxscoreTeamInfoSectionFieldListInner>}
* @memberof BoxscoreTeamInfoSection
*/
fieldList?: Array<BoxscoreTeamInfoSectionFieldListInner>;
}
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface BoxscoreTeamInfoSectionFieldListInner
*/
export declare interface BoxscoreTeamInfoSectionFieldListInner {
/**
*
* @type {string}
* @memberof BoxscoreTeamInfoSectionFieldListInner
*/
label?: string;
/**
*
* @type {string}
* @memberof BoxscoreTeamInfoSectionFieldListInner
*/
value?: string;
}
export declare function BoxscoreTeamInfoSectionFieldListInnerFromJSON(json: any): BoxscoreTeamInfoSectionFieldListInner;
export declare function BoxscoreTeamInfoSectionFieldListInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoxscoreTeamInfoSectionFieldListInner;
export declare function BoxscoreTeamInfoSectionFieldListInnerToJSON(json: any): BoxscoreTeamInfoSectionFieldListInner;
export declare function BoxscoreTeamInfoSectionFieldListInnerToJSONTyped(value?: BoxscoreTeamInfoSectionFieldListInner | null, ignoreDiscriminator?: boolean): any;
export declare function BoxscoreTeamInfoSectionFromJSON(json: any): BoxscoreTeamInfoSection;
export declare function BoxscoreTeamInfoSectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoxscoreTeamInfoSection;
export declare function BoxscoreTeamInfoSectionToJSON(json: any): BoxscoreTeamInfoSection;
export declare function BoxscoreTeamInfoSectionToJSONTyped(value?: BoxscoreTeamInfoSection | null, ignoreDiscriminator?: boolean): any;
/**
*
* @export
* @interface BoxscoreTeams
*/
export declare interface BoxscoreTeams {
/**
*
* @type {BoxscoreTeam}
* @memberof BoxscoreTeams
*/
away: BoxscoreTeam;
/**
*
* @type {BoxscoreTeam}
* @memberof BoxscoreTeams
*/
home: BoxscoreTeam;
}
export declare function BoxscoreTeamsFromJSON(json: any): BoxscoreTeams;
export declare function BoxscoreTeamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoxscoreTeams;
export declare function BoxscoreTeamsToJSON(json: any): BoxscoreTeams;
export declare function BoxscoreTeamsToJSONTyped(value?: BoxscoreTeams | null, ignoreDiscriminator?: boolean): any;
export declare function BoxscoreTeamToJSON(json: any): BoxscoreTeam;
export declare function BoxscoreTeamToJSONTyped(value?: BoxscoreTeam | null, ignoreDiscriminator?: boolean): any;
export declare function BoxscoreToJSON(json: any): Boxscore;
export declare function BoxscoreToJSONTyped(value?: Boxscore | null, ignoreDiscriminator?: boolean): any;
export declare function canConsumeForm(consumes: Consume[]): boolean;
/**
* A coach on a team's coaching staff.
*
* @export
* @interface Coach
*/
export declare interface Coach {
/**
*
* @type {Person}
* @memberof Coach
*/
person?: Person;
/**
*
* @type {string}
* @memberof Coach
*/
jerseyNumber?: string;
/**
*
* @type {string}
* @memberof Coach
*/
job?: string;
/**
*
* @type {string}
* @memberof Coach
*/
jobId?: string;
/**
*
* @type {string}
* @memberof Coach
*/
title?: string;
}
/**
*
* @export
* @interface CoachesResponse
*/
export declare interface CoachesResponse {
/**
*
* @type {Array<Coach>}
* @memberof CoachesResponse
*/
roster: Array<Coach>;
/**
*
* @type {string}
* @memberof CoachesResponse
*/
link?: string;
/**
*
* @type {number}
* @memberof CoachesResponse
*/
teamId?: number;
/**
*
* @type {string}
* @memberof CoachesResponse
*/
rosterType?: string;
}
export declare function CoachesResponseFromJSON(json: any): CoachesResponse;
export declare function CoachesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CoachesResponse;
export declare function CoachesResponseToJSON(json: any): CoachesResponse;
export declare function CoachesResponseToJSONTyped(value?: CoachesResponse | null, ignoreDiscriminator?: boolean): any;
export declare function CoachFromJSON(json: any): Coach;
export declare function CoachFromJSONTyped(json: any, ignoreDiscriminator: boolean): Coach;
export declare function CoachToJSON(json: any): Coach;
export declare function CoachToJSONTyped(value?: Coach | null, ignoreDiscriminator?: boolean): any;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Code and description pair (e.g. batSide, pitchHand).
*
* @export
* @interface CodeDescription
*/
export declare interface CodeDescription {
/**
*
* @type {string}
* @memberof CodeDescription
*/
code?: string;
/**
*
* @type {string}
* @memberof CodeDescription
*/
description?: string;
}
export declare function CodeDescriptionFromJSON(json: any): CodeDescription;
export declare function CodeDescriptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): CodeDescription;
export declare function CodeDescriptionToJSON(json: any): CodeDescription;
export declare function CodeDescriptionToJSONTyped(value?: CodeDescription | null, ignoreDiscriminator?: boolean): any;
export declare const COLLECTION_FORMATS: {
csv: string;
ssv: string;
tsv: string;
pipes: string;
};
export declare class Configuration {
private configuration;
constructor(configuration?: ConfigurationParameters);
set config(configuration: Configuration);
get basePath(): string;
get fetchApi(): FetchAPI | undefined;
get middleware(): Middleware[];
get queryParamsStringify(): (params: HTTPQuery) => string;
get username(): string | undefined;
get password(): string | undefined;
get apiKey(): ((name: string) => string | Promise<string>) | undefined;
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
get headers(): HTTPHeaders | undefined;
get credentials(): RequestCredentials | undefined;
}
export declare interface ConfigurationParameters {
basePath?: string;
fetchApi?: FetchAPI;
middleware?: Middleware[];
queryParamsStringify?: (params: HTTPQuery) => string;
username?: string;
password?: string;
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
headers?: HTTPHeaders;
credentials?: RequestCredentials;
}
export declare interface Consume {
contentType: string;
}
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Links to game-related content (highlights, editorials, etc.). Present on schedule games.
*
* @export
* @interface Content
*/
export declare interface Content {
/**
* API path for this game's content
* @type {string}
* @memberof Content
*/
link?: string;
}
export declare function ContentFromJSON(json: any): Content;
export declare function ContentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Content;
export declare function ContentToJSON(json: any): Content;
export declare function ContentToJSONTyped(value?: Content | null, ignoreDiscriminator?: boolean): any;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface Coordinates
*/
export declare interface Coordinates {
/**
*
* @type {number}
* @memberof Coordinates
*/
latitude?: number;
/**
*
* @type {number}
* @memberof Coordinates
*/
longitude?: number;
}
export declare function CoordinatesFromJSON(json: any): Coordinates;
export declare function CoordinatesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Coordinates;
export declare function CoordinatesToJSON(json: any): Coordinates;
export declare function CoordinatesToJSONTyped(value?: Coordinates | null, ignoreDiscriminator?: boolean): any;
export declare const DefaultConfig: Configuration;
/**
* Division
*
* @export
* @interface Division
*/
export declare interface Division {
/**
*
* @type {number}
* @memberof Division
*/
id: number;
/**
*
* @type {string}
* @memberof Division
*/
name: string;
/**
*
* @type {string}
* @memberof Division
*/
season?: string;
/**
*
* @type {string}
* @memberof Division
*/
nameShort?: string;
/**
*
* @type {string}
* @memberof Division
*/
link?: string;
/**
*
* @type {string}
* @memberof Division
*/
abbreviation?: string;
/**
*
* @type {League}
* @memberof Division
*/
league?: League;
/**
*
* @type {Sport}
* @memberof Division
*/
sport?: Sport;
/**
*
* @type {boolean}
* @memberof Division
*/
hasWildcard?: boolean;
/**
*
* @type {number}
* @memberof Division
*/
sortOrder?: number;
/**
*
* @type {number}
* @memberof Division
*/
numPlayoffTeams?: number;
/**
*
* @type {boolean}
* @memberof Division
*/
active?: boolean;
}
export declare function DivisionFromJSON(json: any): Division;
export declare function DivisionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Division;
/**
*
* @export
* @interface Divisions
*/
export declare interface Divisions {
/**
*
* @type {Array<Division>}
* @memberof Divisions
*/
divisions: Array<Division>;
}
export declare function DivisionsFromJSON(json: any): Divisions;
export declare function DivisionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Divisions;
/**
* Standings
*
* @export
* @interface DivisionStandings
*/
export declare interface DivisionStandings {
/**
*
* @type {string}
* @memberof DivisionStandings
*/
standingsType?: string;
/**
*
* @type {League}
* @memberof DivisionStandings
*/
league: League;
/**
*
* @type {Division}
* @memberof DivisionStandings
*/
division: Division;
/**
*
* @type {Sport}
* @memberof DivisionStandings
*/
sport: Sport;
/**
*
* @type {RoundRobin}
* @memberof DivisionStandings
*/
roundRobin?: RoundRobin;
/**
*
* @type {string}
* @memberof DivisionStandings
*/
lastUpdated?: string;
/**
*
* @type {Array<ModelRecord>}
* @memberof DivisionStandings
*/
teamRecords: Array<ModelRecord>;
}
export declare function DivisionStandingsFromJSON(json: any): DivisionStandings;
export declare function DivisionStandingsFromJSONTyped(json: any, ignoreDiscriminator: boolean): DivisionStandings;
/**
*
* @export
* @interface DivisionStandingsList
*/
export declare interface DivisionStandingsList {
/**
*
* @type {Array<DivisionStandings>}
* @memberof DivisionStandingsList
*/
records: Array<DivisionStandings>;
}
export declare function DivisionStandingsListFromJSON(json: any): DivisionStandingsList;
export declare function DivisionStandingsListFromJSONTyped(json: any, ignoreDiscriminator: boolean): DivisionStandingsList;
export declare function DivisionStandingsListToJSON(json: any): DivisionStandingsList;
export declare function DivisionStandingsListToJSONTyped(value?: DivisionStandingsList | null, ignoreDiscriminator?: boolean): any;
export declare function DivisionStandingsToJSON(json: any): DivisionStandings;
export declare function DivisionStandingsToJSONTyped(value?: DivisionStandings | null, ignoreDiscriminator?: boolean): any;
export declare function DivisionsToJSON(json: any): Divisions;
export declare function DivisionsToJSONTyped(value?: Divisions | null, ignoreDiscriminator?: boolean): any;
export declare function DivisionToJSON(json: any): Division;
export declare function DivisionToJSONTyped(value?: Division | null, ignoreDiscriminator?: boolean): any;
/**
*
* @export
* @interface DraftData
*/
export declare interface DraftData {
/**
*
* @type {number}
* @memberof DraftData
*/
draftYear?: number;
/**
*
* @type {Array<DraftRound>}
* @memberof DraftData
*/
rounds?: Array<DraftRound>;
}
export declare function DraftDataFromJSON(json: any): DraftData;
export declare function DraftDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): DraftData;
export declare function DraftDataToJSON(json: any): DraftData;
export declare function DraftDataToJSONTyped(value?: DraftData | null, ignoreDiscriminator?: boolean): any;
/**
* A pick made in the MLB draft.
*
* @export
* @interface DraftPick
*/
export declare interface DraftPick {
/**
*
* @type {number}
* @memberof DraftPick
*/
bisPlayerId?: number;
/**
*
* @type {string}
* @memberof DraftPick
*/
pickRound: string;
/**
*
* @type {number}
* @memberof DraftPick
*/
pickNumber: number;
/**
*
* @type {number}
* @memberof DraftPick
*/
roundPickNumber: number;
/**
*
* @type {number}
* @memberof DraftPick
*/
displayPickNumber?: number;
/**
*
* @type {number}
* @memberof DraftPick
*/
rank?: number;
/**
*
* @type {string}
* @memberof DraftPick
*/
pickValue?: string;
/**
*
* @type {string}
* @memberof DraftPick
*/
signingBonus?: string;
/**
*
* @type {DraftPickHome}
* @memberof DraftPick
*/
home?: DraftPickHome;
/**
*
* @type {string}
* @memberof DraftPick
*/
scoutingReport?: string;
/**
*
* @type {DraftPickSchool}
* @memberof DraftPick
*/
school?: DraftPickSchool;
/**
*
* @type {string}
* @memberof DraftPick
*/
blurb?: string;
/**
*
* @type {string}
* @memberof DraftPick
*/
headshotLink?: string;
/**
*
* @type {Person}
* @memberof DraftPick
*/
person?: Person;
/**
*
* @type {Team}
* @memberof DraftPick
*/
team?: Team;
/**
*
* @type {CodeDescription}
* @memberof DraftPick
*/
draftType?: CodeDescription;
/**
*
* @type {boolean}
* @memberof DraftPick
*/
isDrafted?: boolean;
/**
*
* @type {boolean}
* @memberof DraftPick
*/
isPass?: boolean;
/**
*
* @type {string}
* @memberof DraftPick
*/
year?: string;
}
export declare function DraftPickFromJSON(json: any): DraftPick;
export declare function DraftPickFromJSONTyped(json: any, ignoreDiscriminator: boolean): DraftPick;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface DraftPickHome
*/
export declare interface DraftPickHome {
/**
*
* @type {string}
* @memberof DraftPickHome
*/
city?: string;
/**
*
* @type {string}
* @memberof DraftPickHome
*/
state?: string;
/**
*
* @type {string}
* @memberof DraftPickHome
*/
country?: string;
}
export declare function DraftPickHomeFromJSON(json: any): DraftPickHome;
export declare function DraftPickHomeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DraftPickHome;
export declare function DraftPickHomeToJSON(json: any): DraftPickHome;
export declare function DraftPickHomeToJSONTyped(value?: DraftPickHome | null, ignoreDiscriminator?: boolean): any;
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface DraftPickSchool
*/
export declare interface DraftPickSchool {
/**
*
* @type {string}
* @memberof DraftPickSchool
*/
name?: string;
/**
*
* @type {string}
* @memberof DraftPickSchool
*/
schoolClass?: string;
/**
*
* @type {string}
* @memberof DraftPickSchool
*/
city?: string;
/**
*
* @type {string}
* @memberof DraftPickSchool
*/
state?: string;
/**
*
* @type {string}
* @memberof DraftPickSchool
*/
country?: string;
}
export declare function DraftPickSchoolFromJSON(json: any): DraftPickSchool;
export declare function DraftPickSchoolFromJSONTyped(json: any, ignoreDiscriminator: boolean): DraftPickSchool;
export declare function DraftPickSchoolToJSON(json: any): DraftPickSchool;
export declare function DraftPickSchoolToJSONTyped(value?: DraftPickSchool | null, ignoreDiscriminator?: boolean): any;
export declare function DraftPickToJSON(json: any): DraftPick;
export declare function DraftPickToJSONTyped(value?: DraftPick | null, ignoreDiscriminator?: boolean): any;
/**
*
* @export
* @interface DraftResponse
*/
export declare interface DraftResponse {
/**
*
* @type {DraftData}
* @memberof DraftResponse
*/
drafts?: DraftData;
}
export declare function DraftResponseFromJSON(json: any): DraftResponse;
export declare function DraftResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DraftResponse;
export declare function DraftResponseToJSON(json: any): DraftResponse;
export declare function DraftResponseToJSONTyped(value?: DraftResponse | null, ignoreDiscriminator?: boolean): any;
/**
* A round in the MLB draft containing picks.
*
* @export
* @interface DraftRound
*/
export declare interface DraftRound {
/**
*
* @type {string}
* @memberof DraftRound
*/
round?: string;
/**
*
* @type {Array<DraftPick>}
* @memberof DraftRound
*/
picks?: Array<DraftPick>;
}
export declare function DraftRoundFromJSON(json: any): DraftRound;
export declare function DraftRoundFromJSONTyped(json: any, ignoreDiscriminator: boolean): DraftRound;
export declare function DraftRoundToJSON(json: any): DraftRound;
export declare function DraftRoundToJSONTyped(value?: DraftRound | null, ignoreDiscriminator?: boolean): any;
export declare interface ErrorContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
error: unknown;
response?: Response;
}
export declare function exists(json: any, key: string): boolean;
export declare type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
export declare class FetchError extends Error {
cause: Error;
name: "FetchError";
constructor(cause: Error, msg?: string);
}
export declare interface FetchParams {
url: string;
init: RequestInit;
}
/**
* MLB StatAPI
* OpenAPI spec for the MLB Stats API (upstream API is undocumented). Derived from the python-mlb-statsapi library by zero-sum-seattle.
*
* The version of the OpenAPI document: 0.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fielding Stats
*
* @export
* @interface FieldingStats
*/
export declare interface FieldingStats {
/**
*
* @type {number}
* @memberof FieldingStats
*/
caughtStealing?: number;
/**
*
* @type {number}
* @memberof FieldingStats
*/
stolenBases?: number;
/**
*
* @type {string}
* @memberof FieldingStats
*/
stolenBasePercentage?: string;
/**
*
* @type {string}
* @memberof FieldingStats
*/
caughtStealingPercentage?: string;
/**
*
* @type {number}
* @memberof FieldingStats
*/
assists?: number;
/**
*
* @type {number}
* @memberof FieldingStats
*/
putOuts?: number;
/**
*
* @type {number}
* @memberof FieldingStats
*/
errors?: number;
/**
*
* @type {number}
* @memberof FieldingStats
*/
chances?: number;
/**
*
* @type {string}
* @memberof FieldingStats
*/
fielding?: string;
/**
*
* @type {number}
* @memberof FieldingStats
*/
passedBall?: number;
/**
*
* @type {number}
* @memberof FieldingStats
*/
pickoffs?: number;
}
export declare function FieldingStatsFromJSON(json: any): FieldingStats;
export declare function FieldingStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FieldingStats;
export declare function FieldingStatsToJSON(json: any): FieldingStats;
export declare function FieldingStatsToJSONTyped(value?: FieldingStats | null, ignoreDiscriminator?: boolean): any;
/**
* Game Thing
*
* @export
* @interface Game
*/
export declare interface Game {
/**
*
* @type {number}
* @memberof Game
*/
gamePk: number;
/**
*
* @type {string}
* @memberof Game
*/
gameGuid: string;
/**
*
* @type {string}
* @memberof Game
*/
link?: string;
/**
*
* @type {GameType}
* @memberof Game
*/
gameType: GameType;
/**
*
* @type {string}
* @memberof Game
*/
season: string;
/**
*
* @type {string}
* @memberof Game
*/
gameDate: string;
/**
*
* @type {string}
* @memberof Game
*/
officialDate: string;
/**
*
* @type {string}
* @memberof Game
*/
rescheduledTo?: string;
/**
*
* @type {string}
* @memberof Game
*/
rescheduledToDate?: string;
/**
*
* @type {string}
* @memberof Game
*/
rescheduledFrom?: string;
/**
*
* @type {string}
* @memberof Game
*/
rescheduledFromDate?: string;
/**
*
* @type {GameStatus}
* @memberof Game
*/
status: GameStatus;
/**
*
* @type {GameTeams}
* @memberof Game
*/
teams: GameTeams;
/**
*
* @type {Venue}
* @memberof Game
*/
venue?: Venue;
/**
*
* @type {Content}
* @memberof Game
*/
content?: Content;
/**
*
* @type {boolean}
* @memberof Game
*/
isTie?: boolean;
/**
*
* @type {number}
* @memberof Game
*/
gameNumber?: number;
/**
*
* @type {boolean}
* @memberof Game
*/
publicFacing?: boolean;
/**
*
* @type {string}
* @memberof Game
*/
doubleHeader?: string;
/**
*
* @type {string}
* @memberof Game
*/
gamedayType?: string;
/**
*
* @type {string}
* @memberof Game
*/
tiebreaker?: string;
/**
*
* @type {string}
* @memberof Game
*/
calendarEventID?: string;
/**
*
* @type {string}
* @memberof Game
*/
seasonDisplay?: string;
/**
*
* @type {string}
* @memberof Game
*/
dayNight?: string;
/**
*
* @type {string}
* @memberof Game
*/
description?: string;
/**
*
* @type {number}
* @memberof Game
*/
scheduledInnings?: number;
/**
*
* @type {boolean}
* @memberof Game
*/
reverseHomeAwayStatus?: boolean;
/**
*
* @type {number}
* @memberof Game
*/
inningBreakLength?: number;
/**
*
* @type {number}
* @memberof Game
*/
gamesInSeries?: number;
/**
*
* @type {number}
* @memberof Game
*/
seriesGameNumber?: number;
/**
*
* @type {string}
* @memberof Game
*/
seriesDescription?: string;
/**
*
* @type {string}
* @memberof Game
*/
recordSource?: string;
/**
*
* @type {string}
* @memberof Game
*/
ifNecessary?: string;
/**
*
* @type {string}
* @memberof Game
*/
ifNecessaryDescription?: string;
}
/**
*
* @export
* @interface GameData
*/
export declare interface GameData {
/**
*
* @type {GameDataGame}
* @memberof GameData
*/
game?: GameDataGame;
/**
*
* @type {GameDatetime}
* @memberof GameData
*/
datetime?: GameDatetime;
/**
*
* @type {GameLiveFeedStatus}
* @memberof GameData
*/
status?: GameLiveFeedStatus;
/**
*
* @type {GameDataTeams}
* @memberof GameData
*/
teams?: GameDataTeams;
/**
*
* @type {{ [key: string]: Person; }}
* @memberof GameData
*/
players?: {
[key: string]: Person;
};
/**
*
* @type {Venue}
* @memberof GameData
*/
venue?: Venue;
/**
*
* @type {GameWeather}
* @memberof GameData
*/
weather?: GameWeather;
/**
*
* @type {Person}
* @memberof GameData
*/
officialScorer?: Person;
/**
*
* @type {Person}
* @memberof GameData
*/
primaryDatacaster?: Person;
/**
*
* @type {GameDataMoundVisits}
* @memberof GameData
*/
moundVisits?: GameDataMoundVisits;
/**
*
* @type {GameDataFlags}
* @memberof GameData
*/
flags?: GameDataFlags;
/**
*
* @type {Array<object>}
* @memberof GameData
*/
alerts?: Array<object>;
/**
*
* @type {GameDataReview}
* @memberof GameData
*/
review?: GameDataReview;
/**
*
* @type {{ [key: string]: any; }}
* @memberof G