mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #13775 from jkeylu/keygrip
Type definitions for keygrip
This commit is contained in:
Vendored
+19
@@ -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;
|
||||
@@ -0,0 +1,4 @@
|
||||
import * as Keygrip from 'keygrip';
|
||||
|
||||
let keys = Keygrip(['123']);
|
||||
let hash = keys.sign('abc');
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user