//#region ../ai/src/object-stream/parse-partial-json.d.ts /** * Best-effort parse of a possibly-truncated JSON string into the value it * is "on its way to" becoming. Used by {@link streamObject} to emit a * partial object snapshot from each streamed delta before the full reply * has arrived. * * Returns `undefined` when the prefix can't yet be coerced into a value * (so the caller simply waits for more text). The FINAL parse in * `streamObject` is always strict `JSON.parse` — this tolerant parser only * powers the in-flight snapshots, so a too-clever completion never affects * the authoritative result. * * @example * parsePartialJson('{"name":"Al'); // → { name: "Al" } * parsePartialJson('{"items":[1,2,'); // → { items: [1, 2] } * parsePartialJson('{"a":1,"b"'); // → { a: 1 } (drops the dangling key) */ declare function parsePartialJson(text: string): unknown | undefined; //#endregion export { parsePartialJson }; //# sourceMappingURL=parse-partial-json.d.mts.map