import * as zenFS from "@zenfs/core";
import * as nodeFS from "fs";
/** Proxy Object to make File System volumes case insensitive, same as Roku devices */
export declare class FileSystem {
    private readonly paths;
    private readonly mfs;
    private readonly tfs;
    private readonly cfs;
    private pfs;
    private xfs;
    private root?;
    private ext?;
    /**
     * Creates a new FileSystem instance.
     * @param root Optional root path for pkg: volume (uses Node.js fs if provided)
     * @param ext Optional external storage path for ext1: volume (uses Node.js fs if provided)
     */
    constructor(root?: string, ext?: string);
    /**
     * Saves the original case-preserved path mapping.
     * @param uri File URI to save
     */
    private savePath;
    /**
     * Deletes a path from the case-preserved mapping.
     * @param uri File URI to delete
     * @returns True if path was deleted, false if not found
     */
    private deletePath;
    /**
     * Gets the original case-preserved path.
     * @param uri File URI (case-insensitive)
     * @returns Original path with preserved case or undefined if not found
     */
    private getOriginalPath;
    /**
     * Sets the root path for pkg: volume.
     * Switches to Node.js file system for pkg: access.
     * @param root Root directory path
     */
    setRoot(root: string): void;
    /**
     * Sets the external storage path for ext1: volume.
     * Switches to Node.js file system for ext1: access.
     * @param ext External storage directory path
     */
    setExt(ext: string): void;
    /**
     * Resets the memory-based file systems (tmp: and cachefs:).
     * Unmounts and remounts volumes with new buffers.
     * @param tmpBuffer ArrayBufferLike for tmp: volume
     * @param cacheFSBuffer ArrayBufferLike for cachefs: volume
     */
    resetMemoryFS(tmpBuffer: ArrayBufferLike, cacheFSBuffer: ArrayBufferLike): Promise<void>;
    /**
     * Gets the appropriate file system for a given URI.
     * @param uri File URI with volume prefix
     * @returns File system instance for the volume
     */
    getFS(uri: string): typeof zenFS.fs | typeof nodeFS;
    /**
     * Converts a Roku volume URI to an actual file system path.
     * Handles pkg: and ext1: volume path resolution.
     * @param uri Roku volume URI
     * @returns Resolved file system path
     */
    getPath(uri: string): string;
    /**
     * Lists all available mounted volumes.
     * @returns Array of volume names (e.g., ["pkg:", "tmp:", "cachefs:"])
     */
    volumesSync(): string[];
    /**
     * Checks if a file or directory exists.
     * @param uri File or directory URI
     * @returns True if exists, false otherwise
     */
    existsSync(uri: string): boolean;
    /**
     * Reads a file synchronously.
     * @param uri File URI
     * @param encoding Optional encoding (e.g., "utf8")
     * @returns File contents as string or Buffer
     */
    readFileSync(uri: string, encoding?: any): any;
    /**
     * Reads directory contents synchronously.
     * Preserves original case for writeable volumes.
     * @param uri Directory URI
     * @returns Array of file/directory names
     */
    readdirSync(uri: string): string[];
    /**
     * Creates a directory synchronously.
     * Saves path mapping for case preservation.
     * @param uri Directory URI to create
     */
    mkdirSync(uri: string): void;
    /**
     * Removes a directory synchronously.
     * Throws error if directory is not empty.
     * @param uri Directory URI to remove
     */
    rmdirSync(uri: string): void;
    /**
     * Deletes a file synchronously.
     * @param uri File URI to delete
     */
    unlinkSync(uri: string): void;
    /**
     * Renames a file by copying and deleting.
     * @param oldName Current file URI
     * @param newName New file URI
     */
    renameSync(oldName: string, newName: string): void;
    /**
     * Writes a file synchronously.
     * Saves path mapping for case preservation.
     * @param uri File URI to write
     * @param content File content (string or Buffer)
     * @param encoding Optional encoding
     */
    writeFileSync(uri: string, content: string | Buffer, encoding?: any): void;
    /**
     * Gets file or directory statistics.
     * @param uri File or directory URI
     * @returns Stats object with file information
     */
    statSync(uri: string): nodeFS.Stats | zenFS.fs.Stats;
    /**
     * Recursively finds all files with a given extension.
     * @param uri Directory URI to search
     * @param ext File extension to match (without dot)
     * @returns Array of file paths matching the extension
     */
    findSync(uri: string, ext: string): string[];
}
/**
 * Extracts the volume prefix from a file URI.
 * @param fileUri File URI with volume prefix (e.g., "tmp:/test/test1.txt")
 * @returns Volume prefix (e.g., "tmp:")
 * @example getVolume("tmp:/test/test1.txt") returns "tmp:"
 */
export declare function getVolume(fileUri: string): string;
/**
 * Checks if a URI is valid Roku file URI format.
 * Valid URIs must contain ":/ " and not start with "/" or "\".
 * @param uri URI to validate
 * @returns True if URI is valid, false otherwise
 */
export declare function validUri(uri: string): boolean;
/**
 * Checks if a URI points to a writeable volume.
 * Only tmp: and cachefs: volumes are writeable.
 * @param uri URI to check
 * @returns True if URI is from tmp: or cachefs: volume, false otherwise
 */
export declare function writeUri(uri: string): boolean;
/**
 * Initializes the File System with the provided zip files.
 * @param commonZip ArrayBufferLike with the common volume zip file.
 * @param tmp ArrayBufferLike with the tmp volume zip file.
 * @param cacheFS ArrayBufferLike with the cacheFS volume zip file.
 * @param pkgZip ArrayBufferLike with the package zip file.
 * @param extZip ArrayBufferLike with the external storage zip file.
 */
export declare function configureFileSystem(commonZip: ArrayBufferLike, tmp: ArrayBufferLike, cacheFS: ArrayBufferLike, pkgZip?: ArrayBufferLike, extZip?: ArrayBufferLike): Promise<void>;
