sdf-parser
Version:
34 lines • 1.25 kB
TypeScript
/**
* Options for {@link MolfileStream}.
*/
export interface MolfileStreamOptions {
/**
* Controls EOL normalisation:
* - `undefined` (default): inspect the first 10 000 characters; normalise only if `\r` is
* detected. Zero cost for pure-LF files. Assumes the EOL style is consistent throughout.
* - `true`: always normalise CRLF to LF.
* - `false`: never normalise; use when the file is known to be pure LF.
*/
mixedEOL?: boolean;
}
/**
* A `TransformStream` that splits an incoming SDF text stream on the `$$$$`
* record delimiter and emits individual molfile strings.
*
* Handles CRLF, LF, and mixed line endings. By default (`mixedEOL: undefined`)
* the stream sniffs the first 10 000 characters to detect `\r` and activates
* normalisation only when needed — zero overhead for pure-LF files.
*
* Entries shorter than 40 characters are discarded.
* @example
* ```ts
* const stream = readStream.pipeThrough(new MolfileStream());
* for await (const molfile of stream) {
* console.log(molfile);
* }
* ```
*/
export declare class MolfileStream extends TransformStream<string, string> {
constructor({ mixedEOL }?: MolfileStreamOptions);
}
//# sourceMappingURL=MolfileStream.d.ts.map