mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
readline-transform: convert to export = (#29560)
* readline-transform: TypeScript Version: 2.7 * readline-transform: convert to `export =`
This commit is contained in:
Vendored
+13
-9
@@ -7,15 +7,19 @@
|
||||
|
||||
import { Transform, TransformOptions } from 'stream';
|
||||
|
||||
export interface ReadlineTransformOptions extends TransformOptions {
|
||||
/** line break matcher for str.split() (default: /\r?\n/) */
|
||||
breakMatcher?: RegExp;
|
||||
/** if content ends with line break, ignore last empty line (default: true) */
|
||||
ignoreEndOfBreak?: boolean;
|
||||
/** if line is empty string, skip it (default: false) */
|
||||
skipEmpty?: boolean;
|
||||
declare namespace ReadlineTransform {
|
||||
interface Options extends TransformOptions {
|
||||
/** line break matcher for str.split() (default: /\r?\n/) */
|
||||
breakMatcher?: RegExp;
|
||||
/** if content ends with line break, ignore last empty line (default: true) */
|
||||
ignoreEndOfBreak?: boolean;
|
||||
/** if line is empty string, skip it (default: false) */
|
||||
skipEmpty?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export default class ReadlineTransform extends Transform {
|
||||
constructor(options?: ReadlineTransformOptions);
|
||||
declare class ReadlineTransform extends Transform {
|
||||
constructor(options?: ReadlineTransform.Options);
|
||||
}
|
||||
|
||||
export = ReadlineTransform;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PassThrough } from 'stream';
|
||||
import ReadlineTransform from 'readline-transform';
|
||||
import ReadlineTransform = require('readline-transform');
|
||||
|
||||
const readStream = new PassThrough();
|
||||
const transform = new ReadlineTransform({
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"readline-transform-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user