diff --git a/keygrip/index.d.ts b/keygrip/index.d.ts new file mode 100644 index 0000000000..b5929aaec6 --- /dev/null +++ b/keygrip/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for keygrip 1.0 +// Project: https://github.com/crypto-utils/keygrip +// Definitions by: jKey Lu +// 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; diff --git a/keygrip/keygrip-tests.ts b/keygrip/keygrip-tests.ts new file mode 100644 index 0000000000..afa66e04b1 --- /dev/null +++ b/keygrip/keygrip-tests.ts @@ -0,0 +1,4 @@ +import * as Keygrip from 'keygrip'; + +let keys = Keygrip(['123']); +let hash = keys.sign('abc'); diff --git a/keygrip/tsconfig.json b/keygrip/tsconfig.json new file mode 100644 index 0000000000..07650e90f3 --- /dev/null +++ b/keygrip/tsconfig.json @@ -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" + ] +} diff --git a/keygrip/tslint.json b/keygrip/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/keygrip/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" }