@loaders.gl/i3s
Version:
i3s .
39 lines • 1.55 kB
TypeScript
import { MD5Hash } from '@loaders.gl/crypto';
import type { ReadableFile } from '@loaders.gl/loader-utils';
import { IndexedArchive } from '@loaders.gl/zip';
/**
* Class for handling information about slpk file
*/
export declare class SLPKArchive extends IndexedArchive {
private hashTable?;
protected _textEncoder: TextEncoder;
protected _textDecoder: TextDecoder;
protected _md5Hash: MD5Hash;
/**
* Constructor
* @param fileProvider - readable file handle for random access
* @param hashTable - pre-loaded hashTable. If presented, getFile will skip reading the hash file
* @param fileName - name of the archive. It is used to add to an URL of a loader context
*/
constructor(fileProvider: ReadableFile, hashTable?: Record<string, bigint>, fileName?: string);
/**
* Returns file with the given path from slpk archive
* @param path - path inside the slpk
* @param mode - currently only raw mode supported
* @returns buffer with ready to use file
*/
getFile(path: string, mode?: 'http' | 'raw'): Promise<ArrayBuffer>;
/**
* returning uncompressed data for paths that ends with .gz and raw data for all other paths
* @param path - path inside the archive
* @returns buffer with the file data
*/
private getDataByPath;
/**
* Trying to get raw file data by address
* @param path - path inside the archive
* @returns buffer with the raw file data
*/
private getFileBytes;
}
//# sourceMappingURL=slpk-archieve.d.ts.map