mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-03-16 18:20:50 +00:00
Add pull-handshake
This commit is contained in:
parent
fa429746fd
commit
bd937b9987
25
types/pull-handshake/index.d.ts
vendored
Normal file
25
types/pull-handshake/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// 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: {
|
||||
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;
|
||||
}
|
0
types/pull-handshake/pull-handshake-tests.ts
Normal file
0
types/pull-handshake/pull-handshake-tests.ts
Normal file
16
types/pull-handshake/tsconfig.json
Normal file
16
types/pull-handshake/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "bn.js-tests.ts"]
|
||||
}
|
1
types/pull-handshake/tslint.json
Normal file
1
types/pull-handshake/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
2
types/pull-stream/index.d.ts
vendored
2
types/pull-stream/index.d.ts
vendored
@ -8,7 +8,7 @@
|
||||
declare module 'pull-stream' {
|
||||
export type PullStream = {
|
||||
// FIXME this should be actual streams, not 'any'
|
||||
(source: any, sink: any): void;
|
||||
(...streams: Array<any>): void;
|
||||
|
||||
collect: (cb: (error: Error | null, values: Array<Buffer>) => any) => void,
|
||||
drain: (handler: (message: Buffer) => void, errorHandler?: (error: Error) => boolean) => void;
|
||||
|
Loading…
x
Reference in New Issue
Block a user