Merge pull request #13775 from jkeylu/keygrip

Type definitions for keygrip
This commit is contained in:
Andy
2017-01-05 14:44:52 -08:00
committed by GitHub
4 changed files with 44 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for keygrip 1.0
// Project: https://github.com/crypto-utils/keygrip
// Definitions by: jKey Lu <https://github.com/jkeylu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare interface Keygrip {
sign(data: any): string;
verify(data: any, digest: string): boolean;
index(data: any, digest: string): number;
}
declare interface KeygripFunction {
new (keys: string[], algorithm?: string, encoding?: string): Keygrip;
(keys: string[], algorithm?: string, encoding?: string): Keygrip;
}
declare const Keygrip: KeygripFunction;
export = Keygrip;
+4
View File
@@ -0,0 +1,4 @@
import * as Keygrip from 'keygrip';
let keys = Keygrip(['123']);
let hash = keys.sign('abc');
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"keygrip-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }