import { type FeedFormat, type FeedGame } from "./feeds.core.ts"; export { FEED_FORMATS, FEED_LIMITS, FeedError, feedText } from "./feeds.core.ts"; export type { FeedFormat, FeedGame, FeedPlayer, FeedSide } from "./feeds.core.ts"; /** * Read kyogijo's own open timeline: a bare timeline (`{ frames, events?, periods?, stoppages?, penalties?, teams?, from? }`) or a game file (`{ kind: "kyogijo-game", sport, teams, periods, timeline }`, as * `examples/games` has them). Every frame, object, event, period, stoppage and penalty is checked; what is not of the format is left out, and a timeline with no frame is an error. */ export declare function kyogijoFeed(json: unknown): FeedGame; /** Which format a feed's answer is in: a timeline or a game file of kyogijo's, or a play-by-play shaped as the NHL's. `undefined` when it is neither. */ export declare function feedFormatOf(json: unknown): Exclude | undefined; /** * Read a feed's answer into a game: in the format asked, or the one `feedFormatOf` finds. Throws a `FeedError` (`format`, `empty`) that says what was wrong in plain words. * @example * ```ts * import { readFeed } from "@johnmorrisdotca/kyogijo-stadiums/feeds"; * const answer = { frames: [{ t: 0, objects: [{ id: "puck", team: "puck", x: 0, y: 0 }] }, { t: 30, objects: [{ id: "puck", team: "puck", x: 80, y: 4 }] }], events: [{ t: 30, kind: "goal", team: "home" }], from: "nhl-api" }; * const game = readFeed(answer); * console.log(game.format, game.timeline.frames.length, game.timeline.events?.length); * try { readFeed({ hello: "world" }); } catch (error) { console.log((error as Error).name, (error as { kind?: string }).kind); } * // kyogijo 2 1 * // FeedError format * ``` */ export declare function readFeed(json: unknown, format?: FeedFormat): FeedGame; /** Read text (a file or what was pasted) as JSON and then as a feed. */ export declare function readFeedText(text: string, format?: FeedFormat): FeedGame;