diff --git a/types/libp2p/index.d.ts b/types/libp2p/index.d.ts index 3cd3d51..8a8955f 100644 --- a/types/libp2p/index.d.ts +++ b/types/libp2p/index.d.ts @@ -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; } diff --git a/types/libsodium-wrappers/index.d.ts b/types/libsodium-wrappers/index.d.ts new file mode 100644 index 0000000..4f1cf4d --- /dev/null +++ b/types/libsodium-wrappers/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for libsodium 0.7.3 +// Project: https://github.com/jedisct1/libsodium.js +// Definitions by: Jaco Greeff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'libsodium-wrappers' { +type LibSodium = { + ready: Promise; +} + +const sodium: LibSodium; + +export default sodium; +} diff --git a/types/sodium/store-tests.ts b/types/libsodium-wrappers/libsodium-wrappers-tests.ts similarity index 100% rename from types/sodium/store-tests.ts rename to types/libsodium-wrappers/libsodium-wrappers-tests.ts diff --git a/types/libsodium-wrappers/tsconfig.json b/types/libsodium-wrappers/tsconfig.json new file mode 100644 index 0000000..932e246 --- /dev/null +++ b/types/libsodium-wrappers/tsconfig.json @@ -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"] +} diff --git a/types/libsodium-wrappers/tslint.json b/types/libsodium-wrappers/tslint.json new file mode 100644 index 0000000..3db14f8 --- /dev/null +++ b/types/libsodium-wrappers/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/sodium/sodium-tests.ts b/types/sodium/sodium-tests.ts new file mode 100644 index 0000000..e69de29