[@types/scryptsy] Add scryptsy type definition

This commit is contained in:
Mick Charuwichitratana
2017-12-23 21:42:12 +07:00
parent f98225f66f
commit ebab4eed1c
4 changed files with 55 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for scryptsy 2.0
// Project: https://github.com/cryptocoinjs/scryptsy
// Definitions by: Satana Charuwichitratana <https://github.com/micksatana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export = scryptsy;
declare function scryptsy(key: Buffer | string, salt: Buffer | string, N: number, r: number, p: number, dkLen: number,
progressCallback?: (status: { current: number, total: number, percent: number }) => void): Buffer;
declare namespace scryptsy {
const prototype: {};
}
+14
View File
@@ -0,0 +1,14 @@
import * as scrypt from 'scryptsy';
const key = 'TheKey';
const salt = 'Salty';
// Test without processCallback
const data: Buffer = scrypt(key, salt, 16384, 8, 1, 64);
// Test with processCallback
scrypt(key, salt, 16384, 8, 1, 64, (status) => {
status.current;
status.total;
status.percent;
});
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"scryptsy-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}