/** * Tiny streaming tar parser (POSIX ustar format). * * Used by BundleFS to extract a `.tar` (or brotli/gzip-wrapped tar) into a * Map for MEMFS upload. * * Why hand-rolled: tar is dead simple (512-byte fixed headers) and bringing * in fflate/tarjs/etc. would add a dep just for this single use case. */ export interface TarEntry { path: string; content: Uint8Array; type: 'file' | 'dir' | 'other'; } export interface UntarOptions { /** * Ceiling on the number of entries. The full TeX tree is ~180k files, so * anything past this is not a TDS — it is an archive built to make us * allocate. Default: MAX_TAR_ENTRIES. */ maxEntries?: number; } /** * Ceiling on the entry count of a single archive. The full TL 2026 tree is * roughly 180k files; the bundles we publish are far smaller. */ export declare const MAX_TAR_ENTRIES = 250000; /** * Parse a tar archive into a list of entries. * * A malformed or hostile archive is an error, not a shorter list: a header * whose declared size runs past the end of the buffer, or an entry count no * TDS could have, means the bytes are not the archive we asked for. Entry * NAMES are not judged here — the caller owns the root they unpack into and * confines them with safeRelativePath (see vfs/bundlefs.ts). */ export declare function untar(bytes: Uint8Array, options?: UntarOptions): TarEntry[]; /** * Ceiling on what a single archive may expand to. The full TeX tree is the * largest thing we legitimately unpack (~275 MB), so anything past this is a * compression bomb or a wrong URL — and on a mobile WebView, unpacking it * would take the app down before any JS error surfaced. */ export declare const MAX_DECOMPRESSED_BYTES: number; /** * Decompress a gzip- or brotli-wrapped buffer using native DecompressionStream. * * `format` may be 'gzip' or 'deflate-raw' or 'br'. Brotli support varies by * runtime (Chrome 121+, Firefox 127+, Node 22+); gzip works everywhere since * 2023. Caller picks based on what their target supports. * * The output is bounded as it streams — checking the size after the fact * would mean the bomb has already been allocated. */ export declare function decompress(bytes: Uint8Array, format: 'gzip' | 'deflate-raw' | 'br', maxBytes?: number): Promise; //# sourceMappingURL=tar.d.ts.map