mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-04-25 13:42:15 +00:00
Add pull-{pushable,streams}, cleanup commonjs exports
This commit is contained in:
parent
c96c7b7003
commit
d0869fbebc
@ -27,3 +27,5 @@ This following libraries are currently included. Where possible add the relevant
|
|||||||
- [peer-book](https://github.com/libp2p/js-peer-book)
|
- [peer-book](https://github.com/libp2p/js-peer-book)
|
||||||
- [peer-id](https://github.com/libp2p/js-peer-id)
|
- [peer-id](https://github.com/libp2p/js-peer-id)
|
||||||
- [peer-info](https://github.com/libp2p/js-peer-info)
|
- [peer-info](https://github.com/libp2p/js-peer-info)
|
||||||
|
- [pull-pushable](https://github.com/pull-stream/pull-pushable)
|
||||||
|
- [pull-stream](https://github.com/pull-stream/pull-stream)
|
||||||
|
4
interface-connection/index.d.ts
vendored
4
interface-connection/index.d.ts
vendored
@ -3,10 +3,10 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import PeerInfo from 'peer-info';
|
import PeerInfo = require('peer-info');
|
||||||
|
|
||||||
declare interface Connection {
|
declare interface Connection {
|
||||||
getPeerInfo (cb: (error: Error | null, peerInfo?: PeerInfo) => any): void;
|
getPeerInfo (cb: (error: Error | null, peerInfo?: PeerInfo) => any): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Connection;
|
export = Connection;
|
||||||
|
2
interface-transport/index.d.ts
vendored
2
interface-transport/index.d.ts
vendored
@ -6,4 +6,4 @@
|
|||||||
declare interface Transport {
|
declare interface Transport {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Transport;
|
export = Transport;
|
||||||
|
2
libp2p-kad-dht/index.d.ts
vendored
2
libp2p-kad-dht/index.d.ts
vendored
@ -6,4 +6,4 @@
|
|||||||
declare class LibP2pKadDht {
|
declare class LibP2pKadDht {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pKadDht;
|
export = LibP2pKadDht;
|
||||||
|
4
libp2p-mdns/index.d.ts
vendored
4
libp2p-mdns/index.d.ts
vendored
@ -3,7 +3,7 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import PeerInfo from 'peer-info';
|
import PeerInfo = require('peer-info');
|
||||||
|
|
||||||
type Options = {
|
type Options = {
|
||||||
broadcast?: boolean,
|
broadcast?: boolean,
|
||||||
@ -21,4 +21,4 @@ declare class LibP2pMdns {
|
|||||||
on (event: Events, cb: (peerInfo: PeerInfo) => any): void;
|
on (event: Events, cb: (peerInfo: PeerInfo) => any): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pMdns;
|
export = LibP2pMdns;
|
||||||
|
2
libp2p-mplex/index.d.ts
vendored
2
libp2p-mplex/index.d.ts
vendored
@ -14,4 +14,4 @@ declare type LibP2pMplex = {
|
|||||||
muticodec: string;
|
muticodec: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pMplex;
|
export = LibP2pMplex;
|
||||||
|
6
libp2p-railing/index.d.ts
vendored
6
libp2p-railing/index.d.ts
vendored
@ -3,8 +3,8 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import MultiAddr from 'multiaddr';
|
import MultiAddr = require('multiaddr');
|
||||||
import PeerInfo from 'peer-info';
|
import PeerInfo = require('peer-info');
|
||||||
|
|
||||||
type Options = {
|
type Options = {
|
||||||
list: Array<string | MultiAddr>,
|
list: Array<string | MultiAddr>,
|
||||||
@ -19,4 +19,4 @@ declare class LibP2pRailing {
|
|||||||
on (event: Events, cb: (peerInfo: PeerInfo) => any): void;
|
on (event: Events, cb: (peerInfo: PeerInfo) => any): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pRailing;
|
export = LibP2pRailing;
|
||||||
|
4
libp2p-secio/index.d.ts
vendored
4
libp2p-secio/index.d.ts
vendored
@ -3,7 +3,7 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import PeerId from 'peer-id';
|
import PeerId = require('peer-id');
|
||||||
|
|
||||||
declare type LibP2pSecio = {
|
declare type LibP2pSecio = {
|
||||||
tag: '/secio/1.0.0',
|
tag: '/secio/1.0.0',
|
||||||
@ -11,4 +11,4 @@ declare type LibP2pSecio = {
|
|||||||
encrypt (localId: PeerId, conn: any, remoteId: PeerId, callback: () => any): void
|
encrypt (localId: PeerId, conn: any, remoteId: PeerId, callback: () => any): void
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pSecio;
|
export = LibP2pSecio;
|
||||||
|
2
libp2p-spdy/index.d.ts
vendored
2
libp2p-spdy/index.d.ts
vendored
@ -14,4 +14,4 @@ declare type LibP2pSpdy = {
|
|||||||
muticodec: string;
|
muticodec: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pSpdy;
|
export = LibP2pSpdy;
|
||||||
|
4
libp2p-tcp/index.d.ts
vendored
4
libp2p-tcp/index.d.ts
vendored
@ -3,9 +3,9 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import Transport from 'interface-transport';
|
import Transport = require('interface-transport');
|
||||||
|
|
||||||
declare class LibP2pTcp implements Transport {
|
declare class LibP2pTcp implements Transport {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pTcp;
|
export = LibP2pTcp;
|
||||||
|
4
libp2p-webrtc-direct/index.d.ts
vendored
4
libp2p-webrtc-direct/index.d.ts
vendored
@ -3,9 +3,9 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import Transport from 'interface-transport';
|
import Transport = require('interface-transport');
|
||||||
|
|
||||||
declare class LibP2pWebRtcDirect implements Transport {
|
declare class LibP2pWebRtcDirect implements Transport {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pWebRtcDirect;
|
export = LibP2pWebRtcDirect;
|
||||||
|
4
libp2p-webrtc-star/index.d.ts
vendored
4
libp2p-webrtc-star/index.d.ts
vendored
@ -3,9 +3,9 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import Transport from 'interface-transport';
|
import Transport = require('interface-transport');
|
||||||
|
|
||||||
declare class LibP2pWebRtcStar implements Transport {
|
declare class LibP2pWebRtcStar implements Transport {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pWebRtcStar;
|
export = LibP2pWebRtcStar;
|
||||||
|
4
libp2p-websockets/index.d.ts
vendored
4
libp2p-websockets/index.d.ts
vendored
@ -3,9 +3,9 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import Transport from 'interface-transport';
|
import Transport = require('interface-transport');
|
||||||
|
|
||||||
declare class LibP2pWebsockets implements Transport {
|
declare class LibP2pWebsockets implements Transport {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2pWebsockets;
|
export = LibP2pWebsockets;
|
||||||
|
22
libp2p/index.d.ts
vendored
22
libp2p/index.d.ts
vendored
@ -3,16 +3,16 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import Connection from 'interface-connection';
|
import Connection = require('interface-connection');
|
||||||
import Transport from 'interface-transport';
|
import Transport = require('interface-transport');
|
||||||
import Libp2pKadDHT from 'libp2p-kad-dht';
|
import Libp2pKadDHT = require('libp2p-kad-dht');
|
||||||
import LibP2pMdns from 'libp2p-mdns';
|
import LibP2pMdns = require('libp2p-mdns');
|
||||||
import LibP2pMplex from 'libp2p-mplex';
|
import LibP2pMplex = require('libp2p-mplex');
|
||||||
import LibP2pRailing from 'libp2p-railing';
|
import LibP2pRailing = require('libp2p-railing');
|
||||||
import LibP2pSecio from 'libp2p-secio';
|
import LibP2pSecio = require('libp2p-secio');
|
||||||
import LibP2pSpdy from 'libp2p-spdy';
|
import LibP2pSpdy = require('libp2p-spdy');
|
||||||
import PeerBook from 'peer-book';
|
import PeerBook = require('peer-book');
|
||||||
import PeerInfo from 'peer-info';
|
import PeerInfo = require('peer-info');
|
||||||
|
|
||||||
type CreateOptions = {
|
type CreateOptions = {
|
||||||
DHT: typeof Libp2pKadDHT,
|
DHT: typeof Libp2pKadDHT,
|
||||||
@ -38,4 +38,4 @@ declare class LibP2p {
|
|||||||
stop (cb: (error: Error | null) => any): void;
|
stop (cb: (error: Error | null) => any): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LibP2p;
|
export = LibP2p;
|
||||||
|
4
multiaddr/index.d.ts
vendored
4
multiaddr/index.d.ts
vendored
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
/// <reference types="node"/>
|
/// <reference types="node"/>
|
||||||
|
|
||||||
import PeerId from 'peer-id';
|
import PeerId = require('peer-id');
|
||||||
|
|
||||||
type Address = {
|
type Address = {
|
||||||
family: string,
|
family: string,
|
||||||
@ -50,4 +50,4 @@ declare class MultiAddr {
|
|||||||
toString (): string;
|
toString (): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MultiAddr;
|
export = MultiAddr;
|
||||||
|
6
peer-book/index.d.ts
vendored
6
peer-book/index.d.ts
vendored
@ -3,8 +3,8 @@
|
|||||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
import PeerId from 'peer-id';
|
import PeerId = require('peer-id');
|
||||||
import PeerInfo from 'peer-info';
|
import PeerInfo = require('peer-info');
|
||||||
|
|
||||||
declare class PeerBook {
|
declare class PeerBook {
|
||||||
constructor ();
|
constructor ();
|
||||||
@ -18,4 +18,4 @@ declare class PeerBook {
|
|||||||
remove (peerInfo: PeerInfo, replace?: boolean): void;
|
remove (peerInfo: PeerInfo, replace?: boolean): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PeerBook;
|
export = PeerBook;
|
||||||
|
2
peer-id/index.d.ts
vendored
2
peer-id/index.d.ts
vendored
@ -35,4 +35,4 @@ declare class PeerId {
|
|||||||
toJSON (): JSON;
|
toJSON (): JSON;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PeerId;
|
export = PeerId;
|
||||||
|
6
peer-info/index.d.ts
vendored
6
peer-info/index.d.ts
vendored
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
/// <reference types="node"/>
|
/// <reference types="node"/>
|
||||||
|
|
||||||
import MultiAddr from 'multiaddr';
|
import MultiAddr = require('multiaddr');
|
||||||
import PeerId from 'peer-id';
|
import PeerId = require('peer-id');
|
||||||
|
|
||||||
type CreateCb = (error: Error | null, peerId?: PeerId) => any;
|
type CreateCb = (error: Error | null, peerId?: PeerId) => any;
|
||||||
|
|
||||||
@ -45,4 +45,4 @@ declare class PeerInfo {
|
|||||||
isConnected (): boolean;
|
isConnected (): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PeerInfo;
|
export = PeerInfo;
|
||||||
|
14
pull-pushable/index.d.ts
vendored
Normal file
14
pull-pushable/index.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Type definitions for pull-pushable 2.0.0
|
||||||
|
// Project: https://github.com/pull-stream/pull-pushable
|
||||||
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
|
/// <reference types="node"/>
|
||||||
|
|
||||||
|
type Pushable = {
|
||||||
|
push: (buffer: Buffer) => void
|
||||||
|
};
|
||||||
|
|
||||||
|
declare type PullPushable = () => Pushable;
|
||||||
|
|
||||||
|
export = PullPushable;
|
0
pull-pushable/pull-pushable-tests.ts
Normal file
0
pull-pushable/pull-pushable-tests.ts
Normal file
16
pull-pushable/tsconfig.json
Normal file
16
pull-pushable/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
pull-pushable/tslint.json
Normal file
1
pull-pushable/tslint.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "extends": "dtslint/dt.json" }
|
16
pull-stream/index.d.ts
vendored
Normal file
16
pull-stream/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Type definitions for pull-stream 3.6.8
|
||||||
|
// Project: https://github.com/pull-stream/pull-stream
|
||||||
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
|
/// <reference types="node"/>
|
||||||
|
|
||||||
|
type Pull = {
|
||||||
|
(source: any, sink: any): void;
|
||||||
|
|
||||||
|
collect: (cb: (error: Error | null, values: Array<Buffer>) => any) => void,
|
||||||
|
drain: (handler: (message: Buffer) => void, errorHandler?: () => boolean) => void;
|
||||||
|
values: (values: Array<string | Buffer>) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export = Pull;
|
0
pull-stream/pull-stream-tests.ts
Normal file
0
pull-stream/pull-stream-tests.ts
Normal file
16
pull-stream/tsconfig.json
Normal file
16
pull-stream/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
pull-stream/tslint.json
Normal file
1
pull-stream/tslint.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "extends": "dtslint/dt.json" }
|
Loading…
x
Reference in New Issue
Block a user