Skip to content

Commit

Permalink
style: add docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Dec 21, 2019
1 parent 0d2f670 commit 580d673
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions adonis-typings/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@ declare module '@ioc:Adonis/Core/Hash' {
params: {
[key: string]: string,
}

/**
* Hash plain text value using the default mapping
*/
hash (value: string): Promise<string>

/**
* Check the hash against the current config to find it needs
* to be re-hashed or not
*/
needsReHash (hashedValue: string): boolean

/**
* Verify plain value against the hashed value to find if it's
* valid or not
*/
verify (hashedValue: string, plainValue: string): Promise<boolean>
}

Expand Down Expand Up @@ -114,8 +128,21 @@ declare module '@ioc:Adonis/Core/Hash' {
HashDriverContract,
{ [P in keyof HashersList]: HashersList[P]['implementation'] }
> {
/**
* Hash plain text value using the default mapping
*/
hash (value: string): ReturnType<DriverMethod<DefaultDriver, 'hash'>>

/**
* Verify plain value against the hashed value to find if it's
* valid or not
*/
verify (hashedValue: string, plainValue: string): ReturnType<DriverMethod<DefaultDriver, 'verify'>>

/**
* Check the hash against the current config to find it needs
* to be re-hashed or not
*/
needsReHash (hashedValue: string): ReturnType<DriverMethod<DefaultDriver, 'needsReHash'>>
}

Expand Down

0 comments on commit 580d673

Please sign in to comment.