mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added callback definitions to throught2
This commit is contained in:
Vendored
+9
-5
@@ -1,6 +1,6 @@
|
||||
// Type definitions for through2 v 0.4.2
|
||||
// Type definitions for through2 v 2.0.0
|
||||
// Project: https://github.com/rvagg/through2
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, jedmao <https://github.com/jedmao>
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, jedmao <https://github.com/jedmao>, Georgios Valotasios <https://github.com/valotas>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
@@ -8,14 +8,18 @@
|
||||
declare module 'through2' {
|
||||
|
||||
import stream = require('stream');
|
||||
|
||||
type TransfofmCallback = (err?: any, data?: any) => void;
|
||||
type TransformFunction = (chunk: any, enc: string, callback: TransfofmCallback) => void;
|
||||
type FlashCallback = (flushCallback: () => void) => void;
|
||||
|
||||
function through2(transform?: (chunk: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream;
|
||||
function through2(transform?: TransformFunction, flush?: FlashCallback): NodeJS.ReadWriteStream;
|
||||
|
||||
function through2(opts?: stream.DuplexOptions, transform?: (chunk: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream;
|
||||
function through2(opts?: stream.DuplexOptions, transform?: TransformFunction, flush?: FlashCallback): NodeJS.ReadWriteStream;
|
||||
|
||||
module through2 {
|
||||
|
||||
export function obj(transform?: (chunk: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream;
|
||||
export function obj(transform?: TransformFunction, flush?: FlashCallback): NodeJS.ReadWriteStream;
|
||||
|
||||
export function push(data: any): void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user