import type { RaceFeed } from "./circuits.feed.ts"; /** A lap row: who, which lap, when it started and how long it took. */ export interface OpenF1Lap { driver_number: number; lap_number: number; date_start?: string | null; lap_duration?: number | null; } /** A pit row: who, on which lap, when it entered the pit lane and how long it was in it and standing. */ export interface OpenF1Pit { driver_number: number; lap_number?: number; date: string; pit_duration?: number | null; lane_duration?: number | null; stop_duration?: number | null; } /** A driver row: the code, the name and the team as the source gives them. */ export interface OpenF1Driver { driver_number: number; name_acronym?: string; broadcast_name?: string; last_name?: string; team_name?: string; team_colour?: string; } /** A location row: where a car was, in the source's own frame. */ export interface OpenF1Location { driver_number: number; date: string; x: number; y: number; } /** What the adapter is given: the rows of each answer the user's source gave. Only `laps` is needed. */ export interface OpenF1Rows { laps: readonly OpenF1Lap[]; pit?: readonly OpenF1Pit[]; drivers?: readonly OpenF1Driver[]; location?: readonly OpenF1Location[]; /** The laps of the race, if known. */ totalLaps?: number; /** True while the session is going on. */ live?: boolean; } /** Whether a list looks like OpenF1's lap rows: objects with a driver number and a lap number. */ export declare const looksLikeOpenF1Laps: (input: unknown) => input is OpenF1Lap[]; /** * OpenF1-style rows as a race feed. The start is the earliest start of a first lap; a lap is completed at its start plus its duration (or, where the duration is missing, at the next lap's start). A pit stop runs from * its row's time for its lane duration. Location rows, when given, become the feed's positions. * @example * ```ts * import { openF1Feed } from "@johnmorrisdotca/kyogijo-stadiums/circuits"; * const feed = openF1Feed({ laps: [ * { driver_number: 7, lap_number: 1, date_start: "2030-01-01T20:00:00Z", lap_duration: 101 }, * { driver_number: 7, lap_number: 2, date_start: "2030-01-01T20:01:41Z", lap_duration: 97.5 }, * ], drivers: [{ driver_number: 7, name_acronym: "ABC", team_name: "Made-up Team", team_colour: "3366CC" }] }); * console.log(feed.cars[0].code, feed.cars[0].colour, feed.crossings.map((c) => c.t).join(" ")); * // ABC #3366cc 101 198.5 * ``` */ export declare function openF1Feed(rows: OpenF1Rows): RaceFeed;