/** * Content source registry for the plugin system. * * The registry enables runtime source type resolution without modifying core code. * Sources are registered by type identifier and instantiated on demand. * * @example * ```typescript * // Register a custom source * sourceRegistry.register('notion', () => new NotionSource()); * * // Get a source instance * const source = sourceRegistry.get('notion'); * ``` */ import type { ContentSource, BaseSourceConfig, SourceFactory } from './types.js'; /** * Registry for content source types. * * Provides a centralized way to register and retrieve content sources. * Built-in sources (web, github, markdown) are registered automatically * when the sources module is imported. */ declare class SourceRegistry { private sources; /** * Register a content source type. * * @param type - Unique source type identifier (e.g., 'web', 'github') * @param factory - Factory function that creates source instances * @throws Error if type is already registered * * @example * ```typescript * registry.register('confluence', () => new ConfluenceSource()); * ``` */ register(type: string, factory: SourceFactory): void; /** * Get a source instance by type. * * Creates a new instance each time to ensure clean state. * * @param type - Source type identifier * @returns New source instance * @throws Error if type is not registered * * @example * ```typescript * const source = registry.get('web'); * const result = await source.process(config, context); * ``` */ get(type: string): ContentSource; /** * Check if a source type is registered. * * @param type - Source type identifier * @returns true if type is registered */ has(type: string): boolean; /** * Get all registered source type identifiers. * * @returns Array of registered type identifiers */ getAvailableTypes(): string[]; /** * Unregister a source type. * * Primarily useful for testing. * * @param type - Source type identifier to remove * @returns true if the type was registered and removed */ unregister(type: string): boolean; /** * Clear all registered sources. * * Primarily useful for testing. */ clear(): void; } /** * Singleton registry instance. * * This is the primary way to access source types throughout the application. * Built-in sources are registered when `sources/index.ts` is imported. */ export declare const sourceRegistry: SourceRegistry; /** * Register a custom content source. * * Convenience function for adding new source types without directly * accessing the registry instance. * * @param type - Unique source type identifier * @param factory - Factory function that creates source instances * * @example * ```typescript * import { registerSource } from '@classic-homes/chat-indexer'; * * registerSource('custom', () => new CustomSource()); * ``` */ export declare function registerSource(type: string, factory: SourceFactory): void; export {}; //# sourceMappingURL=registry.d.ts.map