summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/tuf-js/dist/models/file.d.ts
blob: 9678cf1efefd59850ec431458c72661b21c107d7 (plain)
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
/// <reference types="node" />
/// <reference types="node" />
import { Readable } from 'stream';
import { JSONObject, JSONValue } from '../utils/types';
interface MetaFileOptions {
    version: number;
    length?: number;
    hashes?: Record<string, string>;
    unrecognizedFields?: Record<string, JSONValue>;
}
export declare class MetaFile {
    readonly version: number;
    readonly length?: number;
    readonly hashes?: Record<string, string>;
    readonly unrecognizedFields?: Record<string, JSONValue>;
    constructor(opts: MetaFileOptions);
    equals(other: MetaFile): boolean;
    verify(data: Buffer): void;
    toJSON(): JSONObject;
    static fromJSON(data: JSONObject): MetaFile;
}
interface TargetFileOptions {
    length: number;
    path: string;
    hashes: Record<string, string>;
    unrecognizedFields?: Record<string, JSONValue>;
}
export declare class TargetFile {
    readonly length: number;
    readonly path: string;
    readonly hashes: Record<string, string>;
    readonly unrecognizedFields: Record<string, JSONValue>;
    constructor(opts: TargetFileOptions);
    get custom(): Record<string, unknown>;
    equals(other: TargetFile): boolean;
    verify(stream: Readable): Promise<void>;
    toJSON(): JSONObject;
    static fromJSON(path: string, data: JSONObject): TargetFile;
}
export {};