You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
826 B
TypeScript
19 lines
826 B
TypeScript
/// <reference types="node" />
|
|
import { Transform, TransformCallback, TransformOptions } from 'stream';
|
|
export interface ReadyParserOptions extends TransformOptions {
|
|
/** delimiter to use to detect the input is ready */
|
|
delimiter: string | Buffer | number[];
|
|
}
|
|
/**
|
|
* A transform stream that waits for a sequence of "ready" bytes before emitting a ready event and emitting data events
|
|
*
|
|
* To use the `Ready` parser provide a byte start sequence. After the bytes have been received a ready event is fired and data events are passed through.
|
|
*/
|
|
export declare class ReadyParser extends Transform {
|
|
delimiter: Buffer;
|
|
readOffset: number;
|
|
ready: boolean;
|
|
constructor({ delimiter, ...options }: ReadyParserOptions);
|
|
_transform(chunk: Buffer, encoding: BufferEncoding, cb: TransformCallback): void;
|
|
}
|