mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[@types/scryptsy] Add scryptsy type definition
This commit is contained in:
Vendored
+15
@@ -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: {};
|
||||
}
|
||||
@@ -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;
|
||||
});
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user