/** * Generic parser for any MLB Stats API response that wraps a list of records * under a known top-level key. Walks `LIST_KEYS` in order and flattens the * first key that resolves to a non-empty array of objects. * * Use a dedicated parser (`parse_mlb_api_schedule`, `parse_mlb_api_standings`, * `parse_mlb_api_person_stats`, …) for endpoints that need extra unrolling. */ export declare function parse_mlb_api_list(raw: any): Record[]; /** Parse `mlb_api_teams()` into one row per team (from `teams[]`). */ export declare function parse_mlb_api_teams(raw: any): Record[]; /** * Parse `mlb_api_schedule()` into one row per game. * * The Stats API ships the schedule as `{dates: [{date, games: [...]}, ...]}`; * this walks every `dates[].games[]`, prefixes the schedule `date` onto each * game row, and flattens the nested `teams.*` / `venue.*` / `status.*` fields. */ export declare function parse_mlb_api_schedule(raw: any): Record[]; /** * Parse `mlb_api_team_roster()` into one row per player (from `roster[]`). * * Input: `{roster: [{person, jerseyNumber, position, status}, ...]}`. The * `person` / `position` / `status` sub-dicts flatten to `person_id`, * `position_abbreviation`, `status_code`, etc. */ export declare function parse_mlb_api_team_roster(raw: any): Record[]; /** * Parse `mlb_api_standings()` into one row per (division × team). * * Input: `{records: [{standingsType, league, division, teamRecords: [...]}, * ...]}`. Walks each division's `teamRecords[]` and prefixes the (namespaced) * division identifiers onto each team row so a single output row carries both * the division context and the team's full standing stats. */ export declare function parse_mlb_api_standings(raw: any): Record[]; /** * Parse `mlb_api_person_stats()` / `mlb_api_team_stats()` into one row per * stats split. * * Input: `{stats: [{type, group, splits: [{season, stat, team, player, ...}, * ...]}, ...]}`. Each `stats[]` entry is a (statsType × statsGroup) bucket; * each `splits[]` row is one sliced view. Flattens each `splits[]` row and * prefixes `stats_type` / `stats_group` from the parent. */ export declare function parse_mlb_api_person_stats(raw: any): Record[]; /** * Parse `mlb_api_boxscore()` into one row per (team-side × player). * * Input: `{teams: {home: {team, players: {ID######: {...}}}, away: {...}}}`. * The `players` block is a *dict keyed by* `ID` (not a list), so this * walks each side's players, prefixes `team_side` / `team_id` / `team_name`, * and flattens the nested `person` / `position` / `stats.*` sub-dicts. */ export declare function parse_mlb_api_boxscore(raw: any): Record[]; /** * Parse `mlb_api_linescore()` into one row per inning (from `innings[]`). * * Input: `{innings: [{num, ordinalNum, home: {runs, hits, errors}, away: * {...}}, ...]}`. Each inning flattens so home/away become `home_runs` / * `away_hits` columns. */ export declare function parse_mlb_api_linescore(raw: any): Record[]; /** * Parse `mlb_api_play_by_play()` into one row per play (from `allPlays[]`). * * Input: `{allPlays: [{result, about, count, matchup, ...}, ...]}`. Each entry * flattens: nested `result.*` / `about.*` / `count.*` / `matchup.*` dicts * become columns, list fields are stringified. */ export declare function parse_mlb_api_play_by_play(raw: any): Record[]; /** * Parse `mlb_api_win_probability()` into one row per play. * * Unlike most Stats API endpoints, `winProbability` returns a *bare top-level * JSON array* of play objects carrying win-probability series fields. Flattened * directly. */ export declare function parse_mlb_api_win_probability(raw: any): Record[]; /** * Parse `mlb_api_draft_latest()` into a single-row frame. * * The latest-pick endpoint returns `{pick: {...}, number, nextUp}` — a single * object rather than a list — so it is flattened as one row (with the * `copyright` boilerplate dropped). The nested `pick` sub-dict unrolls into * `pick_*` columns. */ export declare function parse_mlb_api_draft_latest(raw: any): Record[]; /** * Parse a bare list of GUMBO / color timecodes into a one-column frame. * * The `feed/live/timestamps` and `feed/color/timestamps` endpoints return a * bare JSON array of timecode strings (e.g. `"20230929_215457"`). Shaped into a * single `timecode` column, one row per timestamp. */ export declare function parse_mlb_api_timecodes(raw: any): Record[]; /** * Endpoint (parser name) → parser. Mirrors the Python * `MLB_API_ENDPOINT_PARSERS` registry but is keyed by the *parser function * name* the YAML references (the JS generator threads `def.parser` straight * through `parserFor`). Endpoints whose `parser:` is `parse_mlb_api_list` are * not listed individually — they resolve to the generic flattener by name. */ export declare const MLB_API_PARSERS: { parse_mlb_api_list: typeof parse_mlb_api_list; parse_mlb_api_teams: typeof parse_mlb_api_teams; parse_mlb_api_schedule: typeof parse_mlb_api_schedule; parse_mlb_api_team_roster: typeof parse_mlb_api_team_roster; parse_mlb_api_standings: typeof parse_mlb_api_standings; parse_mlb_api_person_stats: typeof parse_mlb_api_person_stats; parse_mlb_api_boxscore: typeof parse_mlb_api_boxscore; parse_mlb_api_linescore: typeof parse_mlb_api_linescore; parse_mlb_api_play_by_play: typeof parse_mlb_api_play_by_play; parse_mlb_api_win_probability: typeof parse_mlb_api_win_probability; parse_mlb_api_draft_latest: typeof parse_mlb_api_draft_latest; parse_mlb_api_timecodes: typeof parse_mlb_api_timecodes; }; //# sourceMappingURL=mlb_api.d.ts.map