/** * Fast single-pass YAML cleaning function. * Combines multiple string operations to reduce intermediate allocations. */ export declare function cleanYamlFast(yaml: string): string; /** * Read the session-info byte range from the .ibt fixed header (first 48+ * bytes are sufficient). For consumers that range-download instead of * loading the whole file. */ export declare function readSessionInfoRange(headerBytes: ArrayBuffer | Uint8Array): { sessionInfoLen: number; sessionInfoOffset: number; }; /** * Canonical text decode (RFC C5/D5): UTF-8 first; if replacement characters * appear, fall back to windows-1252 (older iRacing builds and non-ASCII * driver/team names). A plain lossy UTF-8 decode corrupts those names — * that was divergence D5. */ export declare function decodeSessionYaml(bytes: Uint8Array): string; export interface SessionYamlDoc { WeekendInfo?: Record; DriverInfo?: { DriverCarIdx?: number; Drivers?: Array>; [key: string]: unknown; }; SplitTimeInfo?: { Sectors?: Array<{ SectorNum?: number; SectorStartPct?: number; }>; }; SessionInfo?: { Sessions?: Array>; }; [key: string]: unknown; } /** Clean + parse the raw YAML text with a real YAML parser (never regex). */ export declare function parseSessionYaml(raw: string): SessionYamlDoc | null; export interface ResolvedSessionEntry { sessionNum: number | null; /** Full string, e.g. "Offline Testing", "Lone Qualify" — never truncated. */ sessionType: string | null; sessionName: string | null; raw: Record; } export interface SessionMetadata { trackId: number | null; trackName: string | null; trackConfigName: string | null; trackLengthKm: number | null; trackNumTurns: number | null; eventType: string | null; category: string | null; seriesId: number | null; seasonId: number | null; sessionId: number | null; subSessionId: number | null; raceWeek: number | null; official: boolean | null; driverCarIdx: number; driverName: string | null; driverUserId: number | null; carId: number | null; carScreenName: string | null; carPath: string | null; carClassId: number | null; carNumber: string | null; teamName: string | null; sessions: ResolvedSessionEntry[]; /** Raw parsed doc for specialized consumers (results positions, sectors…). */ doc: SessionYamlDoc; } export declare function parseTrackLengthKm(value: unknown): number | null; export declare function resolveSessionMetadata(doc: SessionYamlDoc): SessionMetadata; /** * Session-type resolution per RFC C5: the type of the session the telemetry * was recorded in is Sessions[n].SessionType where n comes from the * SessionNum CHANNEL — never "the first SessionType in the document" (that * was divergence D4) and never WeekendInfo.EventType (kept separately). */ export declare function sessionTypeForSessionNum(meta: Pick, sessionNum: number): string | null; /** Convenience: raw YAML byte range → resolved metadata (or null on parse failure). */ export declare function sessionMetadataFromYamlBytes(bytes: Uint8Array): SessionMetadata | null; //# sourceMappingURL=session-yaml.d.ts.map