2018-09-14 14:02:35 +02:00

27 lines
705 B
TypeScript

// Type definitions for pull-handshake 1.1.4
// Project: https://github.com/pull-stream/pull-handshake
// Definitions by: Jaco Greeff <https://github.com/jacogr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
declare module 'pull-handshake' {
type Options = {
timeout: number
};
export type Handshake = {
handshake: {
abort: () => void;
read: (length: number, cb: (error: Error, buffer: Buffer) => void) => void;
write: (buffer: Buffer) => void;
}
};
export type PullHandshake = (options?: Options, errorHandler?: (error?: Error) => void) => Handshake;
const handshake: PullHandshake;
export default handshake;
}