@playcanvas/splat-transform
Version:
Library and CLI tool for 3D Gaussian splat format conversion and transformation
52 lines (51 loc) • 1.56 kB
TypeScript
import { type ReadFileSystem, type ProgressCallback, type ReadSource } from './file-system';
/**
* Metadata for a zip file entry.
*/
type ZipEntry = {
name: string;
compressedSize: number;
uncompressedSize: number;
offset: number;
method: number;
};
/**
* Virtual filesystem for reading files from a zip archive.
* Wraps any ReadSource and provides memory-efficient streaming access.
*/
declare class ZipReadFileSystem implements ReadFileSystem {
private source;
private entries;
private parsePromise;
private closed;
constructor(source: ReadSource);
/**
* Parse the central directory from the zip file.
* Called lazily on first createSource() or list() call.
* @returns Map of entry names to ZipEntry metadata
*/
private parseDirectory;
/**
* Get the data offset for an entry by reading its local header.
* @param entry - Zip entry metadata
* @returns Byte offset where entry data begins
*/
private getDataOffset;
createSource(filename: string, _progress?: ProgressCallback): Promise<ReadSource>;
/**
* List all entries in the zip file.
* @returns Array of entry names
*/
list(): Promise<string[]>;
/**
* Get entry metadata.
* @param filename - Entry name
* @returns Entry metadata or undefined if not found
*/
getEntry(filename: string): Promise<ZipEntry | undefined>;
/**
* Close the zip filesystem and underlying source.
*/
close(): void;
}
export { ZipReadFileSystem, type ZipEntry };