mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-03-31 01:11:04 +00:00
Add libsodium-wrappers
This commit is contained in:
parent
b4790bbe87
commit
fc574cd188
1
types/libp2p/index.d.ts
vendored
1
types/libp2p/index.d.ts
vendored
@ -70,6 +70,7 @@ declare class LibP2p {
|
|||||||
handle (protocol: string, handler: (protocol: string, conn: LibP2pConnection) => any, matcher?: (protocol: string, requestedProtocol: string, cb: (error: Error | null, accept: boolean) => void) => any): void;
|
handle (protocol: string, handler: (protocol: string, conn: LibP2pConnection) => any, matcher?: (protocol: string, requestedProtocol: string, cb: (error: Error | null, accept: boolean) => void) => any): void;
|
||||||
isStarted (): boolean;
|
isStarted (): boolean;
|
||||||
on (event: LibP2p.Events, cb: (event: any) => any): void;
|
on (event: LibP2p.Events, cb: (event: any) => any): void;
|
||||||
|
ping (peerInfo: PeerInfo, callback: (error: Error | null, ping: any) => void): void;
|
||||||
start (cb: (error: Error | null) => any): void;
|
start (cb: (error: Error | null) => any): void;
|
||||||
stop (cb: (error: Error | null) => any): void;
|
stop (cb: (error: Error | null) => any): void;
|
||||||
}
|
}
|
||||||
|
16
types/libsodium-wrappers/index.d.ts
vendored
Normal file
16
types/libsodium-wrappers/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Type definitions for libsodium 0.7.3
|
||||||
|
// Project: https://github.com/jedisct1/libsodium.js
|
||||||
|
// Definitions by: Jaco Greeff <https://github.com/jacogr>
|
||||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
|
/// <reference types="node"/>
|
||||||
|
|
||||||
|
declare module 'libsodium-wrappers' {
|
||||||
|
type LibSodium = {
|
||||||
|
ready: Promise<any>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const sodium: LibSodium;
|
||||||
|
|
||||||
|
export default sodium;
|
||||||
|
}
|
16
types/libsodium-wrappers/tsconfig.json
Normal file
16
types/libsodium-wrappers/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/libsodium-wrappers/tslint.json
Normal file
1
types/libsodium-wrappers/tslint.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "extends": "dtslint/dt.json" }
|
0
types/sodium/sodium-tests.ts
Normal file
0
types/sodium/sodium-tests.ts
Normal file
Loading…
x
Reference in New Issue
Block a user