mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add definitions for pbkdf2
This commit is contained in:
9
types/pbkdf2/index.d.ts
vendored
Normal file
9
types/pbkdf2/index.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Type definitions for pbkdf2 3.0
|
||||
// Project: https://github.com/crypto-browserify/pbkdf2
|
||||
// Definitions by: Timon Engelke <https://github.com/timonegk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference types="node" />
|
||||
|
||||
export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => void): void;
|
||||
export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => void): void;
|
||||
export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest?: string): Buffer;
|
||||
6
types/pbkdf2/pbkdf2-tests.ts
Normal file
6
types/pbkdf2/pbkdf2-tests.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import * as pbkdf2 from "pbkdf2";
|
||||
|
||||
pbkdf2.pbkdf2("password", "salt", 1000, 32, "sha1", (err, derivedKey) => {}); // $ExpectType void
|
||||
pbkdf2.pbkdf2("password", "salt", 1000, 32, (err, derivedKey) => {}); // $ExpectType void
|
||||
pbkdf2.pbkdf2Sync("password", "salt", 1000, 32, "sha1"); // $ExpectType Buffer
|
||||
pbkdf2.pbkdf2Sync("password", "salt", 1000, 32); // $ExpectType Buffer
|
||||
23
types/pbkdf2/tsconfig.json
Normal file
23
types/pbkdf2/tsconfig.json
Normal 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",
|
||||
"pbkdf2-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/pbkdf2/tslint.json
Normal file
1
types/pbkdf2/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user