expand createHash API support (#39991)

This commit is contained in:
Jordan Sexton
2019-11-04 16:26:58 -08:00
committed by Nathan Shively-Sanders
parent c3e2aba0eb
commit bda57b42ef
+13 -5
View File
@@ -1,16 +1,24 @@
// Type definitions for create-hash 1.2
// Project: https://github.com/crypto-browserify/createHash
// Definitions by: BendingBender <https://github.com/BendingBender>,
// Konstantin Yuriev <https://github.com/gallowsmaker>
// Max Boguslavskiy <https://github.com/maxbogus>
// Konstantin Yuriev <https://github.com/gallowsmaker>,
// Max Boguslavskiy <https://github.com/maxbogus>,
// Jordan Sexton <https://github.com/jordansexton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="node" />
declare namespace createHash {
type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
interface HashAlgorithm {
update(data: string): void;
digest(target?: encoding): string;
write(data: string): void;
digest(target: encoding): string;
digest(): Buffer;
update(data: string | Buffer | TypedArray | DataView, encoding?: string): this;
write(data: string | Buffer | TypedArray | DataView, encoding?: string): this;
end(): void;
read(): void;
}