mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-15 01:32:56 +08:00
Merge pull request #3352 from jt000/aspnet-identity-pw
Adding aspnet-identity-pw.d.ts
This commit is contained in:
21
aspnet-identity-pw/aspnet-identity-pw-tests.ts
Normal file
21
aspnet-identity-pw/aspnet-identity-pw-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path="aspnet-identity-pw.d.ts" />
|
||||
|
||||
import passwordHasher = require('aspnet-identity-pw');
|
||||
|
||||
function usageSync() {
|
||||
var hashedPassword: string = passwordHasher.hashPassword('SomePassword');
|
||||
var isValid: boolean = passwordHasher.validatePassword('SomePassword', hashedPassword);
|
||||
}
|
||||
|
||||
function usageAsync() {
|
||||
var hashedPassword: string = null;
|
||||
var isValid: boolean = null;
|
||||
|
||||
passwordHasher.hashPassword('SomePassword', function(err, result) {
|
||||
hashedPassword = result;
|
||||
});
|
||||
|
||||
passwordHasher.validatePassword('SomePassword', hashedPassword, function(err, result) {
|
||||
isValid = result;
|
||||
});
|
||||
}
|
||||
13
aspnet-identity-pw/aspnet-identity-pw.d.ts
vendored
Normal file
13
aspnet-identity-pw/aspnet-identity-pw.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for aspnet-identity-pw 1.0.0
|
||||
// Project: https://github.com/Syncbak-Git/aspnet-identity-pw
|
||||
// Definitions by: jt000 <https://github.com/jt000>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "aspnet-identity-pw" {
|
||||
|
||||
export function hashPassword(password: string): string;
|
||||
export function hashPassword(password: string, callback: (err: any, result: string)=>void): void;
|
||||
|
||||
export function validatePassword(password: string, hashedPass: string): boolean;
|
||||
export function validatePassword(password: string, hashedPass: string, callback: (err: any, result: boolean) => void): void;
|
||||
}
|
||||
Reference in New Issue
Block a user