mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
25 lines
852 B
TypeScript
25 lines
852 B
TypeScript
// Type definitions for check-sum 0.1
|
|
// Project: https://github.com/stream-utils/check-sum
|
|
// Definitions by: BendingBender <https://github.com/BendingBender>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="node" />
|
|
import { Readable } from 'stream';
|
|
|
|
export = checksum;
|
|
|
|
declare function checksum(stream: Readable, hashes: checksum.Hashes, callback: (error: checksum.ChecksumError | any) => void): (fn: () => void) => void;
|
|
declare function checksum(path: string, hashes: checksum.Hashes, callback: (error: checksum.ChecksumError | Error | undefined) => void): (fn: () => void) => void;
|
|
|
|
declare namespace checksum {
|
|
interface ChecksumError {
|
|
algorithm: string;
|
|
expected: string;
|
|
actual: string;
|
|
}
|
|
|
|
interface Hashes {
|
|
[algorithm: string]: string | Buffer;
|
|
}
|
|
}
|