@types/credential
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

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ú.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/credential

Weekly Downloads

150

Version

2.0.3

License

MIT

Unpacked Size

3.8 kB

Total Files

5

Last publish

Collaborators

  • types