1 | import { Transform } from 'stream';
|
2 | import { CRC32CValidatorGenerator, CRC32CValidator } from './crc32c.js';
|
3 | interface HashStreamValidatorOptions {
|
4 |
|
5 | crc32c: boolean;
|
6 |
|
7 | md5: boolean;
|
8 |
|
9 | crc32cInstance: CRC32CValidator;
|
10 |
|
11 | crc32cGenerator: CRC32CValidatorGenerator;
|
12 |
|
13 | crc32cExpected?: string;
|
14 |
|
15 | md5Expected?: string;
|
16 |
|
17 | updateHashesOnly?: boolean;
|
18 | }
|
19 | declare class HashStreamValidator extends Transform {
|
20 | #private;
|
21 | readonly crc32cEnabled: boolean;
|
22 | readonly md5Enabled: boolean;
|
23 | readonly crc32cExpected: string | undefined;
|
24 | readonly md5Expected: string | undefined;
|
25 | readonly updateHashesOnly: boolean;
|
26 | constructor(options?: Partial<HashStreamValidatorOptions>);
|
27 | /**
|
28 | * Return the current CRC32C value, if available.
|
29 | */
|
30 | get crc32c(): string | undefined;
|
31 | _flush(callback: (error?: Error | null | undefined) => void): void;
|
32 | _transform(chunk: Buffer, encoding: BufferEncoding, callback: (e?: Error) => void): void;
|
33 | test(hash: 'crc32c' | 'md5', sum: Buffer | string): boolean;
|
34 | }
|
35 | export { HashStreamValidator, HashStreamValidatorOptions };
|