/** * Composition Root * * This is the single place where all dependencies are wired together. * The composition root creates concrete implementations and injects them * into use cases and services. * * This is the only file that knows about concrete implementations. * Everything else depends only on interfaces (ports). */ import type { Config } from "./domain/entities"; import type { FileSystem } from "./domain/ports"; import type { IndexModule, IndexContext, SearchContext } from "./types"; import { FileIndexStorage } from "./infrastructure/storage"; /** * Container for all application services. * Created once and passed to use cases. */ export interface ServiceContainer { fileSystem: FileSystem; storage: FileIndexStorage; getEnabledModules: (config: Config) => IndexModule[]; getModule: (moduleId: string) => IndexModule | undefined; initializeModule: (module: IndexModule, config: Config) => Promise; } /** * Create a service container for a specific project directory. */ export declare function createServiceContainer(rootDir: string): Promise; import type { IndexDirectoryDependencies } from "./domain/usecases/indexDirectory"; import type { SearchIndexDependencies } from "./domain/usecases/searchIndex"; import type { CleanupIndexDependencies } from "./domain/usecases/cleanupIndex"; /** * Create dependencies for the indexDirectory use case. */ export declare function createIndexDependencies(container: ServiceContainer): IndexDirectoryDependencies; /** * Create dependencies for the searchIndex use case. */ export declare function createSearchDependencies(container: ServiceContainer): SearchIndexDependencies; /** * Create dependencies for the cleanupIndex use case. */ export declare function createCleanupDependencies(container: ServiceContainer): CleanupIndexDependencies; /** * Create an IndexContext for a module. */ export declare function createIndexContext(rootDir: string, config: Config, fileSystem: FileSystem): IndexContext; /** * Create a SearchContext for a module. */ export declare function createSearchContext(rootDir: string, moduleId: string, config: Config, storage: FileIndexStorage): SearchContext;