/** * @interface RawPreload * @description Represents the raw preload data. * @proprety {string} prefix - The prefix file of the preload. */ export interface RawPreload { [prefix: string]: { prefix: string totalSize: number dataStorage: Uint8Array } } /** * @type {Function} errorDirectory * @description Creates a directory for error messages. * @param {string} p - The path to the directory. * @returns {stirng} - Error message. */ export declare const errorDirectory: Function /** * Generates a random UUID (Universal Unique Identifier). * * @returns {string} A randomly generated UUID string. */ export declare const UUID: () => string /** * Resolves and normalizes a file path. * If the path starts with `~`, it is replaced with the user's home directory. * * @param {...string[]} paths - The parts of the file path. * @returns {string} The resolved file path. */ export declare function resolvePath(...paths: string[]): string /** * Sets the cache directory to either the system temporary directory or the project's root cache directory. * * @param {boolean} [useTemp=false] - Whether to use the system temporary directory for cache. */ export declare function setCacheDirectory(useTemp?: boolean): void /** * Ensures that the cache directory exists, creating it if it does not. * * @returns {string} The path of the cache directory. */ export declare function ensureDirectoryExists(): string /** * Removes a cache file from the specified directory. * * @param {string} filename - The name of the file to remove. * @param {string} dir - The directory containing the file. */ export declare function removeCacheFile(filename: string, dir: string): void /** * Lists all cache files in the specified directory. * * @param {string} dir - The directory to list files from. * @returns {string[]} An array of file names in the directory. */ export declare function listCacheFiles(dir: string): string[] /** * Writes binary data to a cache file. * * @param {Uint8Array} data - The binary data to write to the cache file. * @param {string} dir - The directory where the file will be saved. * @param {string} uuid - A unique identifier for the file. * @param {number} dataCount - A count of the data size or chunks. * @returns {Uint8Array} The UUID converted to bytes for later retrieval. */ export declare function writeFileBit( data: Uint8Array, dir: string, uuid: string, dataCount: number ): Uint8Array /** * Reads binary data from a cache file. * * @param {string} nameFileBit - The name of the cache file to read. * @param {string} dir - The directory containing the cache file. * @returns {Uint8Array} The binary data read from the cache file. */ export declare function readFileBit( nameFileBit: string, dir: string ): Uint8Array /** * Finds files in the cache directory that match a specified prefix. * * @param {Uint8Array} prefix - The prefix to search for in the file names. * @param {string} dir - The directory to search in. * @returns {string | undefined} The first matching file name, or undefined if none is found. */ export declare function findFilesByPrefix( prefix: Uint8Array, dir: string ): string | undefined /** * Preloads all cache files from the specified directory. * * @param {string} dir - The directory to preload files from. * @returns {RawPreload} An object containing the preloaded cache data. */ export declare function preloadAllCacheFiles(dir: string): RawPreload /** * Analyzes cache files in the specified directory. * * @param {string} dir - The directory to analyze. * @param {Uint8Array} [PREFIX] - An optional prefix to search for specific files. * @returns {RawPreload} An object containing the cache data. */ export declare function analyzeFiles( dir: string, PREFIX?: Uint8Array ): RawPreload /** * Processes multiple cache files. * * @param {string[]} fileCache - The array of cache file names. * @param {string} dir - The directory containing the cache files. * @param {RawPreload} result - The result object to store the processed data. */ export declare function processMultipleFiles( fileCache: string[], dir: string, result: RawPreload ): void /** * Processes a single cache file. * * @param {string} file - The cache file name. * @param {string} dir - The directory containing the cache file. * @param {RawPreload} result - The result object to store the processed data. */ export declare function processSingleFile( file: string, dir: string, result: RawPreload ): void /** * Extracts file information such as the prefix and total size from the file name. * * @param {string} fileName - The file name to extract information from. * @returns {Object} An object containing the file prefix and total size. */ export declare function extractFileInfo(fileName: string): { prefix: string totalSize: number } //# sourceMappingURL=handlersFiles.d.ts.map