export interface JsonPosition { line: number; column: number; } export interface JsonRange { start: JsonPosition; end: JsonPosition; } export interface JsonDiagnostic { code: string; message: string; offset: number; length: number; location: JsonRange; excerpt: string; } export interface JsonParseResult { value?: T; diagnostics: JsonDiagnostic[]; /** True when JSON.parse accepted the original document without extensions. */ valid: boolean; /** True when the parser could reconstruct the document without discarding values. */ recovered: boolean; /** True when an explicit fixer may rewrite the document as canonical JSON. */ repairable: boolean; } /** * Parses strict JSON first, then performs a fault-tolerant structural parse for * diagnostics and safe recovery. The returned value is intentionally withheld * for unsafe syntax so callers do not analyse a partially reconstructed object. */ export declare function parseJsonDocument(input: string): JsonParseResult; /** Returns canonical strict JSON only for documents proven safe to reconstruct. */ export declare function repairJsonDocument(input: string): string | undefined; export declare function formatJsonDiagnostic(diagnostic: JsonDiagnostic): string;