@push.rocks/webstream
Version:
A cross-platform streaming package designed for node and web environments.
19 lines (18 loc) • 613 B
TypeScript
export interface IDuplexStream {
read(): any;
write(chunk: any, callback?: (error?: Error | null) => void): boolean;
on(event: string, listener: (...args: any[]) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
end(callback?: () => void): void;
destroy(error?: Error): void;
}
export interface IReadableStreamOptions {
highWaterMark?: number;
}
export interface IWritableStreamOptions {
highWaterMark?: number;
}
export declare function convertDuplexToWebStream(duplex: IDuplexStream): {
readable: ReadableStream;
writable: WritableStream;
};