import { EventEnvelope } from "./wireTypes.js"; export type ParseError = { line: number; kind: "invalid_json" | "missing_fields" | "unsupported_version"; detail: string; }; export type ParseResult = { events: EventEnvelope[]; errors: ParseError[]; }; /** One validated event together with the exact line it came from. */ export type ParsedEventLine = { event: EventEnvelope; raw: string; /** One-based line number in the source text. */ line: number; }; export type ParseWithLinesResult = { lines: ParsedEventLine[]; errors: ParseError[]; }; /** What one line of a statelog holds: an event, a reason it is not one, or * nothing at all. */ export type ParsedStatelogLine = { kind: "event"; entry: ParsedEventLine; } | { kind: "error"; error: ParseError; } | { kind: "blank"; }; /** The one owner of statelog line decoding: JSON, version check, envelope * validation. Callers that need the original bytes (per-trace digests, * extracting a trace verbatim) read `entry.raw`. */ export declare function parseStatelogLine(raw: string, lineNumber: number): ParsedStatelogLine; /** Lines of a statelog in file order, the first of them numbered * `firstLineNumber`. Blank lines are skipped but still counted. */ export declare function parseStatelogLines(lines: readonly string[], firstLineNumber: number): ParseWithLinesResult; /** Statelog records that are already decoded, such as the logs a statelog * server returns, checked the way a line from a file is. Record `i` is * reported as line `i + 1`. */ export declare function parseStatelogRecords(records: readonly unknown[]): ParseResult; /** Statelog text, for tests and callers that already hold it. A file is read * line by line through `makeLineReader` instead. */ export declare function parseStatelogJsonl(text: string): ParseResult; export declare function parseStatelogJsonlWithLines(text: string): ParseWithLinesResult;