/**
 * Filesystem service for listing, reading, and writing files within a project.
 */
import type { FsNode } from "@pocketcoder/shared";
/**
 * Validates that a resolved path is within the project root.
 * Prevents path traversal and symlink escapes.
 */
export declare function validatePathWithinProject(projectPath: string, relativePath: string): Promise<string>;
/**
 * Validates a path without requiring the target to exist (for new files).
 * Checks the parent directory is within the project root.
 */
export declare function validateParentWithinProject(projectPath: string, relativePath: string): Promise<string>;
export declare class PathEscapeError extends Error {
    constructor(message: string);
}
export declare class FileTooLargeError extends Error {
    size: number;
    limit: number;
    constructor(size: number, limit: number);
}
export declare class UnsupportedFormatError extends Error {
    constructor(message: string);
}
export declare class FileNotFoundError extends Error {
    constructor(filePath: string);
}
export declare class ContentTooLargeError extends Error {
    size: number;
    limit: number;
    constructor(size: number, limit: number);
}
/**
 * Write a file within a project directory.
 * Creates parent directories if createDirs is true.
 * Returns path, size, and mtime.
 * Throws ContentTooLargeError if content exceeds MAX_WRITE_SIZE (1MB).
 * Throws PathEscapeError if path is outside project root.
 */
export declare function writeFile(projectPath: string, relativePath: string, content: string, createDirs?: boolean): Promise<{
    path: string;
    size: number;
    mtime: string;
}>;
/**
 * Read a file within a project directory.
 * Returns content, encoding, size, and mtime.
 * Throws FileTooLargeError if file exceeds MAX_FILE_SIZE (10MB).
 * Throws UnsupportedFormatError if file is binary.
 * Throws FileNotFoundError if file does not exist.
 * Throws PathEscapeError if path is outside project root.
 */
export declare function readFile(projectPath: string, relativePath: string): Promise<{
    content: string;
    encoding: string;
    size: number;
    mtime: string;
}>;
/**
 * List directory contents at a given path within a project.
 * Returns FsNode[] with lazy loading (depth parameter).
 */
export declare function listDirectory(projectPath: string, relativePath: string, depth?: number): Promise<{
    children: FsNode[];
    truncated: boolean;
}>;
//# sourceMappingURL=filesystem.d.ts.map