import type { FileData } from "../value-objects/FileData.js" import type { FileAST } from "../value-objects/FileAST.js" import type { FileMeta } from "../value-objects/FileMeta.js" /** * Symbol index mapping symbol names to their locations. */ export interface SymbolLocation { path: string line: number type: "function" | "class" | "interface" | "type" | "variable" } export type SymbolIndex = Map /** * Dependencies graph for the project. */ export interface DepsGraph { /** Map from file path to its imports */ imports: Map /** Map from file path to files that import it */ importedBy: Map } /** * Storage service interface (port). * Abstracts the persistence layer for project data. */ export interface IStorage { // File data operations getFile(path: string): Promise setFile(path: string, data: FileData): Promise deleteFile(path: string): Promise getAllFiles(): Promise> getFileCount(): Promise // AST operations getAST(path: string): Promise setAST(path: string, ast: FileAST): Promise deleteAST(path: string): Promise getAllASTs(): Promise> // Meta operations getMeta(path: string): Promise setMeta(path: string, meta: FileMeta): Promise deleteMeta(path: string): Promise getAllMetas(): Promise> // Index operations getSymbolIndex(): Promise setSymbolIndex(index: SymbolIndex): Promise getDepsGraph(): Promise setDepsGraph(graph: DepsGraph): Promise // Config operations getProjectConfig(key: string): Promise setProjectConfig(key: string, value: unknown): Promise // Lifecycle connect(): Promise disconnect(): Promise isConnected(): boolean clear(): Promise }