mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Merge pull request #28473 from danwbyrne/scrypt-js
adds typings for the 'scrypt-js' package
This commit is contained in:
Vendored
+22
@@ -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;
|
||||
@@ -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);
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user