Merge pull request #28473 from danwbyrne/scrypt-js

adds typings for the 'scrypt-js' package
This commit is contained in:
Armando Aguirre
2018-08-31 16:15:22 -07:00
committed by GitHub
4 changed files with 51 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
// Type definitions for scrypt-js 2.0
// Project: https://github.com/ricmoo/scrypt-js
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types= "node" />
declare function scrypt(
password: Buffer,
salt: Buffer,
N: number,
r: number,
p: number,
dklen: number,
callback: (
error: Error | undefined | null,
progress: number,
key?: ReadonlyArray<number>,
) => void
): void;
export = scrypt;
+7
View File
@@ -0,0 +1,7 @@
import scrypt = require('scrypt-js');
const testBuffer = Buffer.from('test');
const testCB = (err: Error | undefined | null, progress: number) => {};
// $ExpectType void
scrypt(testBuffer, testBuffer, 1, 1, 1, 1, testCB);
+19
View File
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"scrypt-js-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}