@hashbrownai/core
Version:
Runtime helpers for Hashbrown AI
22 lines • 713 B
TypeScript
import { Frame } from './frame-types';
/**
* Decode options.
*
* @public
*/
export interface DecodeFramesOptions {
signal: AbortSignal;
}
/**
* Decode a ReadableStream\<Uint8Array\> of length-prefixed JSON frames into a stream of T.
*
* Frame format: [4-byte BE length][UTF-8 JSON payload]
*
* @public
* @param stream - ReadableStream producing Uint8Array chunks
* @param options - decoding options
* @typeParam T - The type of the parsed JSON objects
* @returns - A stream of parsed JSON objects of type T
*/
export declare function decodeFrames(stream: ReadableStream<Uint8Array>, options: DecodeFramesOptions): AsyncGenerator<Frame, void, unknown>;
//# sourceMappingURL=decode-frames.d.ts.map