/** * Reading a line-delimited log without loading it. * * A session file on a working machine can be hundreds of megabytes -- the largest * on the machine this was written on is 204MB -- so nothing here reads a whole * file, and the read it does make does not block the process making it. The head * goes into a fixed buffer and the last partial line is dropped, because half a JSON object parses as nothing and a caller that did not * know it was truncated would report a clean pass over a file it barely opened. */ /** How much of one session file is read when a caller does not say. */ export declare const DEFAULT_MAX_BYTES: number; export interface HeadResult { readonly lines: readonly string[]; /** True when the file was longer than the budget. */ readonly truncated: boolean; } /** Read up to `maxBytes` of a file and split it into whole lines. */ export declare function readJsonlHead(path: string, maxBytes?: number): Promise; /** Parse a line, or return null. A corrupt line is one lost record, not a crash. */ export declare function parseLine(line: string): Record | null; /** Flatten whatever a log put where text belongs into one string. */ export declare function textOf(value: unknown, limit?: number): string; /** A string field, or ''. */ export declare function stringField(record: Record, key: string): string; /** A nested record, or null. */ export declare function recordField(record: Record, key: string): Record | null; //# sourceMappingURL=jsonl.d.ts.map