Installation
npm install --save @types/credential
Summary
This package contains type definitions for credential (https://github.com/ericelliott/credential).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/credential.
index.d.ts
interface defaultOptions {
keyLength: number;
work: number;
hashMethod: string;
}
type HashCallback = (err: Error, hash: string) => void;
type VerifyCallback = (err: Error, isValid: boolean) => void;
declare function credential(defaultOptions?: defaultOptions): {
hash(password: string, callback: HashCallback): void;
hash(password: string): Promise<string>;
// iterations(work: number, base): number;
verify(hash: string, password: string, callback: VerifyCallback): void;
verify(hash: string, password: string): Promise<boolean>;
expired(hash: string, days: number): boolean;
};
export = credential;
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by Phú.