UNPKG

etcher-sdk

Version:
25 lines (24 loc) 955 B
/// <reference types="node" /> /// <reference types="node" /> import { ZipArchiveEntry, ZipArchiveOutputStream } from 'compress-commons'; import { Readable, Transform } from 'node:stream'; import type { ImagePartInfo } from './compressed-source-types'; export interface RawDeflatePart { filename: string; parts: Array<{ crc: number; zLen: number; stream: Readable | Buffer; len: number; }>; } /** * A ZipArchiveOutputStream sub-class that supports writing * pre-deflated entries without decompressing and recompressing them. */ declare class RawDeflateZipStream extends ZipArchiveOutputStream { _smartStream(ae: ZipArchiveEntry, callback: (error: Error | null, ae?: ZipArchiveEntry) => void): Transform; } export declare function createZipStreamFromParts(partsByImage: RawDeflatePart[]): RawDeflateZipStream; export declare function getZipSizeFromParts(partsByImage: ImagePartInfo[]): number; export {};