UNPKG

@sapientpro/json-stream

Version:
17 lines (16 loc) 613 B
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 {};