/** * PanelFileSystemAdapter * * Implements FileSystemAdapter interface by wrapping the panel framework's * file access APIs (fileTree slice and openFile action). * * For read operations: Uses the fileTree slice and fetchFile function * For write operations: Delegates to the host's fileSystem adapter (if available) */ import type { FileSystemAdapter } from '@backlog-md/core'; /** * Host file system adapter interface (subset of what web-ade provides) * Uses void | Promise to match the panel-framework-core FileSystemAdapter */ export interface HostFileSystemAdapter { writeFile?: (path: string, content: string) => void | Promise; createDir?: (path: string) => void | Promise; deleteFile?: (path: string) => void | Promise; } export interface PanelFileAccess { /** Function to fetch file content by path */ fetchFile: (path: string) => Promise; /** List of all file paths in the repository */ filePaths: string[]; /** Optional host file system adapter for write operations */ hostFileSystem?: HostFileSystemAdapter; } /** * FileSystemAdapter implementation for the panel framework * * This adapter wraps the panel's file access mechanisms to provide * a standard FileSystemAdapter interface for @backlog-md/core. */ export declare class PanelFileSystemAdapter implements FileSystemAdapter { private readonly filePaths; private readonly directories; private readonly fetchFile; private readonly hostFileSystem?; constructor(access: PanelFileAccess); /** * Check if write operations are available */ get canWrite(): boolean; exists(path: string): Promise; readFile(path: string): Promise; writeFile(path: string, content: string): Promise; deleteFile(path: string): Promise; createDir(path: string, _options?: { recursive?: boolean; }): Promise; readDir(path: string): Promise; isDirectory(path: string): Promise; rename(_from: string, _to: string): Promise; stat(path: string): Promise<{ mtime: Date; isDirectory: boolean; size: number; }>; join(...paths: string[]): string; dirname(path: string): string; basename(path: string, ext?: string): string; extname(path: string): string; relative(from: string, to: string): string; isAbsolute(path: string): boolean; normalize(path: string): string; homedir(): string; private normalizePath; } //# sourceMappingURL=PanelFileSystemAdapter.d.ts.map