import type { ResourceLimits } from '../limits.js'; import type { SafetyProfile } from '../safety.js'; export type { ResourceLimits } from '../limits.js'; export type { SafetyProfile } from '../safety.js'; /** Supported compression algorithms. */ export type CompressionAlgorithm = 'gzip' | 'deflate' | 'deflate-raw' | 'brotli' | 'zstd' | 'bzip2' | 'xz'; /** Backend used for compression/decompression in the current runtime. */ export type CompressionBackend = 'web' | 'node-zlib' | 'pure-js' | 'none'; /** Progress event for compression/decompression streams. */ export type CompressionProgressEvent = { /** Pipeline direction emitting the event. */ kind: 'compress' | 'decompress'; /** Algorithm associated with the active transform. */ algorithm: CompressionAlgorithm; /** Source bytes consumed so far. */ bytesIn: bigint; /** Output bytes produced so far. */ bytesOut: bigint; }; /** Resource ceilings used directly by decompression transforms. */ export type DecompressionLimits = Pick; /** Options for creating a compressor. */ export type CompressorOptions = { /** Compression algorithm for the transform pipeline. */ algorithm: CompressionAlgorithm; /** Abort signal for stream setup and processing. */ signal?: AbortSignal; /** Progress callback for byte counters per stage. */ onProgress?: (event: CompressionProgressEvent) => void; /** Integer compression level: -1 through 9 for gzip/deflate, or -131072 through 22 for Zstandard. */ level?: number; /** Brotli quality from 0 through 11. */ quality?: number; }; /** Options for creating a decompressor. */ export type DecompressorOptions = { /** Compression algorithm for the transform pipeline. */ algorithm: CompressionAlgorithm; /** Abort signal for stream setup and processing. */ signal?: AbortSignal; /** Progress callback for byte counters per stage. */ onProgress?: (event: CompressionProgressEvent) => void; /** Maximum output bytes allowed from the transform. */ maxOutputBytes?: bigint | number; /** Maximum permitted output/input expansion ratio. */ maxCompressionRatio?: number; /** Maximum dictionary bytes allowed by codec backends. */ maxDictionaryBytes?: bigint | number; /** Maximum buffered input bytes for streaming decoders. */ maxBufferedInputBytes?: number; /** Resource ceilings relevant to decompression transforms. */ limits?: DecompressionLimits; /** Safety preset controlling default resource ceilings. */ safetyProfile?: SafetyProfile; }; /** Runtime compression capabilities report. */ export type CompressionCapabilities = { /** Runtime family where capability probing executed. */ runtime: 'node' | 'deno' | 'bun' | 'web' | 'unknown'; /** Per-algorithm compress/decompress support and backend source. */ algorithms: Record; /** Supplemental notes describing gating/compatibility details. */ limitations: string[]; }; //# sourceMappingURL=types.d.ts.map