@sapientpro/json-stream
Version:
A JSON stream parser
17 lines (16 loc) • 613 B
TypeScript
import { Readable, Writable } from 'node:stream';
import { Observable } from "rxjs";
export declare const Any: unique symbol;
export declare const Rest: unique symbol;
type Path = string | (string | number | typeof Any)[] | [...(string | number | typeof Any)[], typeof Rest];
export declare class JsonStream extends Writable {
#private;
constructor(start?: string, collectJson?: boolean);
observe<T = any>(path?: Path): Observable<{
path: string[];
value: T;
}>;
stream(path: string | string[]): Readable;
value<T = any>(path?: string | string[]): Promise<T>;
}
export {};