forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
object-hash.d.ts
52 lines (44 loc) · 1.2 KB
/
object-hash.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Type definitions for object-hash v0.5.0
// Project: https://github.com/puleos/object-hash
// Definitions by: Michael Zabka <https://github.com/misak113/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ObjectHash {
export interface IOptions {
algorithm?: string;
encoding?: string;
excludeValues?: boolean;
}
interface HashTableItem {
value: any;
count: number;
}
interface HashTableItemWithKey extends HashTableItem {
hash: string;
}
export interface HashTable {
add(...values: any[]): HashTable;
remove(...values: any[]): HashTable;
hasKey(key: string): boolean;
getValue(key: string): any;
getCount(key: string): number;
table(): { [key: string]: HashTableItem };
toArray(): HashTableItemWithKey[];
reset(): HashTable;
}
export interface HashTableStatic {
(options?: IOptions): HashTable;
}
export interface Hash {
(object: any, options?: IOptions): string;
sha1(object: any): string;
keys(object: any): string;
MD5(object: any): string;
keysMD5(object: any): string;
HashTable: HashTableStatic;
}
export var HashStatic: Hash;
}
declare module 'object-hash' {
import HashStatic = ObjectHash.HashStatic;
export = HashStatic;
}