mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
Added callback definitions to throught2
This commit is contained in:
@@ -22,6 +22,12 @@ rws = through2(function (entry: any, enc: string, callback: () => void) {
|
||||
|
||||
});
|
||||
|
||||
rws = through2(function (entry: any, enc: string, callback: (error: any, data?: any) => void) {
|
||||
callback(null, 'foo');
|
||||
}, (flushCallback: () => void) => {
|
||||
flushCallback();
|
||||
});
|
||||
|
||||
rws = through2(function (entry: any, enc: string, callback: () => void) {
|
||||
this.push('foo');
|
||||
callback();
|
||||
@@ -42,3 +48,8 @@ rws = through2.obj(function (entry: any, enc: string, callback: () => void) {
|
||||
callback();
|
||||
});
|
||||
|
||||
rws = through2.obj(function (entry: any, enc: string, callback: (err: any) => void) {
|
||||
callback('Oups!');
|
||||
}, (flashCallback) => {
|
||||
flashCallback();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user