Merge pull request #22485 from micksatana/add-scryptsy-type-definition

[@types/scryptsy] Add scryptsy type definition
This commit is contained in:
Paul van Brenk
2017-12-27 13:33:17 -08:00
committed by GitHub
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 scrypt = require('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"
}