The result object returned by the useImperativeJsonParser hook.
API
interface UseImperativeJsonParserResult<Output> {error: ParserError |
Error |
undefined;parseChunk: (chunk: string) => void;parserState: ParserState; reset: () => void;value: Output | undefined;}UseImperativeJsonParserResult
@typeOutputerror
ParserError | Error | undefinedThe current parser or schema error, if any.
parseChunk
(chunk: string) => voidApply a JSON chunk to the parser.
parserState
ParserStateThe current streaming JSON parser state.
reset
() => voidReset the parser to its initial state.
value
Output | undefinedThe latest resolved value produced by the schema or parser state.