export interface DirEntry { name: string; isDir: boolean; size: number; mtime: number; } export interface TextFileContent { content: string; mtime: number; size: number; } export interface RawFile { bytes: Buffer; contentType: string; size: number; } export interface HexSample { size: number; bytes: number[]; } export type FilesErrorCode = 'forbidden' | 'not_found' | 'too_large' | 'conflict' | 'bad_request'; export declare class FilesError extends Error { readonly code: FilesErrorCode; readonly latestContent?: string | undefined; readonly latestMtime?: number | undefined; constructor(code: FilesErrorCode, message: string, latestContent?: string | undefined, latestMtime?: number | undefined); } export declare const TEXT_EXTS: ReadonlySet; export declare const IMG_EXTS: ReadonlySet; export declare const AUDIO_EXTS: ReadonlySet; export declare const HEX_SAMPLE_BYTES = 4096; export declare class FilesApi { private readonly backupDir; constructor(opts?: { backupDir?: string; }); listDir(projectPath: string, sub: string): Promise<{ entries: DirEntry[]; }>; readText(projectPath: string, rel: string): Promise; readRaw(projectPath: string, rel: string): Promise; readHex(projectPath: string, rel: string): Promise; saveText(projectPath: string, rel: string, content: string, baseMtime: number): Promise<{ mtime: number; }>; }