mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-04-24 21:32:14 +00:00
revert PeerInfo deletion
This commit is contained in:
parent
dfe89412b7
commit
4586039e00
45
types/peer-info/index.d.ts
vendored
Normal file
45
types/peer-info/index.d.ts
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
// Type definitions for peer-info 0.14.1
|
||||
// Project: https://github.com/libp2p/js-peer-info
|
||||
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
/// <reference types="multiaddr"/>
|
||||
|
||||
declare namespace PeerInfo {
|
||||
type CreateCb = (error: Error | null, peerId?: PeerInfo) => any;
|
||||
|
||||
type CreateOptions = {
|
||||
bits: number
|
||||
};
|
||||
|
||||
type MultiaddrSet = {
|
||||
readonly size: number;
|
||||
|
||||
add(addr: import("multiaddr") | string): void;
|
||||
addSafe(add: import("multiaddr") | string): void;
|
||||
delete(addr: import("multiaddr")): void;
|
||||
forEach(cb: (addr: import("multiaddr"), index: number) => any): void;
|
||||
has(addr: import("multiaddr")): boolean;
|
||||
replace(addr: import("multiaddr"), other: import("multiaddr")): void;
|
||||
toArray(): import("multiaddr")[];
|
||||
};
|
||||
}
|
||||
|
||||
declare class PeerInfo {
|
||||
constructor(id?: import("peer-id"));
|
||||
|
||||
static create(optsOrCb: PeerInfo.CreateOptions | PeerInfo.CreateCb, cb?: PeerInfo.CreateCb): void;
|
||||
static isPeerInfo(info: any): info is PeerInfo;
|
||||
|
||||
readonly id: import("peer-id");
|
||||
readonly multiaddrs: PeerInfo.MultiaddrSet;
|
||||
|
||||
connect(addr: import("multiaddr")): void;
|
||||
disconnect(): void;
|
||||
isConnected(): boolean;
|
||||
}
|
||||
|
||||
declare module 'peer-info' {
|
||||
export default PeerInfo;
|
||||
}
|
0
types/peer-info/peer-info-tests.ts
Normal file
0
types/peer-info/peer-info-tests.ts
Normal file
16
types/peer-info/tsconfig.json
Normal file
16
types/peer-info/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/peer-info/tslint.json
Normal file
1
types/peer-info/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
Loading…
x
Reference in New Issue
Block a user