2018-09-14 14:01:24 +02:00
|
|
|
// 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: {
|
2018-09-14 14:02:35 +02:00
|
|
|
abort: () => void;
|
2018-09-14 14:01:24 +02:00
|
|
|
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;
|
|
|
|
}
|