DefinitelyTyped/types/object-hash/index.d.ts
Artur Diniz Adam 5788e4e16c object-hash updated to v1.3.1 (#36071)
* Drop hashtable impl from object-hash as of v1.0

* Adding writeToStream method in object-hash

* Addin missing options in object-hash

* Bumping version and "Definitions by" headers
2019-06-11 14:38:14 -07:00

42 lines
1.2 KiB
TypeScript

// Type definitions for object-hash v1.3.1
// Project: https://github.com/puleos/object-hash
// Definitions by: Michael Zabka <https://github.com/misak113>, Artur Diniz <https://github.com/artdiniz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import stream = require("stream");
import HashStatic = ObjectHash.HashStatic;
export = HashStatic;
export as namespace objectHash;
declare namespace ObjectHash {
export interface IOptions {
algorithm?: string;
encoding?: string;
excludeValues?: boolean;
ignoreUnknown?: boolean;
replacer?: (value: any) => any;
respectFunctionProperties?: boolean;
respectFunctionNames?: boolean;
respectType?: boolean;
unorderedArrays?: boolean;
unorderedSets?: boolean;
unorderedObjects?: boolean;
excludeKeys?: (key: string) => boolean;
}
export interface Hash {
(object: any, options?: IOptions): string;
sha1(object: any): string;
keys(object: any): string;
MD5(object: any): string;
keysMD5(object: any): string;
writeToStream(value: any, stream: stream.PassThrough): void;
writeToStream(value: any, options: IOptions, stream: stream.PassThrough): void;
}
export var HashStatic: Hash;
}