/**
 * Instance Factory Library
 *
 * Manages a collection of instance factories and provides
 * lookup, filtering, and version resolution.
 */
import { type LoadResult } from './loader.js';
import { type CompatibilityResult } from './validator.js';
import type { InstanceFactory, LibrarySource, LibraryConfig } from '../types/index.js';
/**
 * Query options for finding instance factories
 */
export interface QueryOptions {
    /** Filter by type category */
    category?: InstanceFactory['category'];
    /** Filter by capability (supports wildcards) */
    capability?: string;
    /** Filter by technology stack */
    technology?: {
        runtime?: string;
        language?: string;
        framework?: string;
        orm?: string;
        validation?: string;
    };
    /** Filter by version range */
    version?: string;
    /** Filter by tags */
    tags?: string[];
}
/**
 * Library for managing instance factories
 */
export declare class InstanceFactoryLibrary {
    private types;
    private validator;
    private sources;
    constructor();
    /**
     * Load instance factories from a directory
     */
    load(baseDir: string, options?: {
        pattern?: string;
        validate?: boolean;
    }): Promise<void>;
    /**
     * Load from multiple sources with priority ordering
     */
    loadFromSources(sources: LibrarySource[]): Promise<void>;
    /**
     * Load from configuration
     */
    loadFromConfig(config: LibraryConfig): Promise<void>;
    /**
     * Get an instance factory by name and optional version
     */
    get(name: string, versionRange?: string): InstanceFactory | undefined;
    /**
     * Get all versions of an instance factory
     */
    getVersions(name: string): InstanceFactory[];
    /**
     * Check if an instance factory exists
     */
    has(name: string, versionRange?: string): boolean;
    /**
     * Find instance factories matching query
     */
    find(query: QueryOptions): InstanceFactory[];
    /**
     * Find instance factories by capability
     */
    findByCapability(capability: string): InstanceFactory[];
    /**
     * Find instance factories by category
     */
    findByCategory(category: InstanceFactory['category']): InstanceFactory[];
    /**
     * Get all instance factory names
     */
    getNames(): string[];
    /**
     * Get total number of instance factories (all versions)
     */
    size(): number;
    /**
     * Get number of unique instance factories
     */
    uniqueCount(): number;
    /**
     * Validate an instance factory
     */
    validate(factory: InstanceFactory, options?: {
        specverseVersion?: string;
        nodeVersion?: string;
        availableCapabilities?: string[];
    }): CompatibilityResult;
    /**
     * Resolve an instance factory reference
     *
     * Supports formats:
     * - "FastifyPrismaAPI" (latest version)
     * - "FastifyPrismaAPI@1.0.0" (specific version)
     * - "FastifyPrismaAPI@^1.0.0" (version range)
     * - "backend/FastifyPrismaAPI" (with path prefix)
     * - "@org/impl-types/FastifyPrismaAPI" (npm package style)
     */
    resolve(ref: string): InstanceFactory | undefined;
    /**
     * Resolve an implementation type by reference and return metadata
     * Returns the LoadResult which includes filePath for template resolution
     */
    resolveWithMetadata(ref: string): LoadResult | undefined;
    /**
     * Clear all loaded implementation types
     */
    clear(): void;
    /**
     * Get statistics about the library
     */
    getStats(): {
        uniqueTypes: number;
        totalVersions: number;
        byType: Record<string, number>;
        byCapability: Record<string, number>;
    };
}
/**
 * Create a library with default configuration
 */
export declare function createDefaultLibrary(projectRoot?: string): Promise<InstanceFactoryLibrary>;
//# sourceMappingURL=library.d.ts.map