Add libsodium-wrappers

This commit is contained in:
Jaco Greeff 2018-08-01 13:32:16 +02:00
parent b4790bbe87
commit fc574cd188
6 changed files with 34 additions and 0 deletions

View File

@ -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;
isStarted (): boolean;
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;
stop (cb: (error: Error | null) => any): void;
}

16
types/libsodium-wrappers/index.d.ts vendored Normal file
View 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;
}

View 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"]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File