import type { AppConfig } from '../config.js';
import type { FileDeletePreviewResponse, FileDeleteResponse, FileEntry, FileListResponse, FileReadResponse, FileVersion, FileWriteResponse } from '../../shared/protocol.js';
export type FileExplorerConfig = Pick<AppConfig, 'sessionSecret' | 'fileListMaxEntries' | 'fileTextMaxBytes' | 'filePreviewMaxBytes'>;
export interface FilePreviewResult {
    absolutePath: string;
    contentType: string;
    size: number;
    stream: NodeJS.ReadableStream;
}
export declare class FileExplorerError extends Error {
    readonly statusCode: number;
    readonly code: string;
    constructor(statusCode: number, code: string);
}
export declare class FileExplorerService {
    private readonly config;
    constructor(config: FileExplorerConfig);
    resolveRootPath(rootPath: string): Promise<string>;
    list(rootPath: string, requestPath: string): Promise<FileListResponse>;
    readText(rootPath: string, requestPath: string): Promise<FileReadResponse>;
    resolveFileForTerminalOpen(rootPath: string, requestPath: string): Promise<{
        path: string;
        absolutePath: string;
    }>;
    writeText(rootPath: string, requestPath: string, content: string, expectedVersion: FileVersion): Promise<FileWriteResponse>;
    createEntry(rootPath: string, requestPath: string, kind: 'file' | 'directory'): Promise<FileEntry>;
    moveEntry(rootPath: string, sourcePath: string, destinationPath: string): Promise<FileEntry>;
    previewDelete(rootPath: string, requestPath: string, rootToken: string): Promise<FileDeletePreviewResponse>;
    deleteEntry(rootPath: string, requestPath: string, previewToken: string, rootToken: string): Promise<FileDeleteResponse>;
    previewFile(rootPath: string, requestPath: string): Promise<FilePreviewResult>;
    private resolveExistingPath;
    private resolveNewPath;
    private assertNoSymlinkSegments;
    private entryForPath;
    private inspectDeleteTarget;
    private countDescendants;
    private openNoFollow;
}
