/**
 * Registry Type Definitions
 *
 * Types for interacting with the SpecVerse Registry API for instance factory metadata.
 *
 * @module registry/types/registry
 * @version 2.0.0
 */
/**
 * Source type for instance factory
 */
export type SourceType = 'npm' | 'git' | 'url';
/**
 * Instance factory source information
 * Points to WHERE the actual factory definition is located
 */
export interface FactorySource {
    /** Source type (npm package, git repo, or direct URL) */
    type: SourceType;
    /** npm package name (for type="npm") */
    package?: string;
    /** Package version or git tag (for type="npm" or type="git") */
    version?: string;
    /** Path to factory YAML file within package/repo */
    entrypoint: string;
    /** Git repository URL (for type="git") or direct download URL (for type="url") */
    url?: string;
    /** SHA-256 checksum for verification (for type="url") */
    checksum?: string;
}
/**
 * Statistics about factory usage
 */
export interface FactoryStats {
    /** Total download count */
    downloads: number;
    /** Star/favorite count */
    stars: number;
}
/**
 * Instance factory metadata from registry
 *
 * This represents the metadata stored in the registry about an instance factory.
 * The registry does NOT store the actual factory YAML file - it stores metadata
 * that points to where the factory can be found (npm, git, etc.).
 */
export interface RegistryFactoryMetadata {
    /** Factory name (e.g., "PrismaPostgres") */
    name: string;
    /** Display name for UI (e.g., "Prisma PostgreSQL") */
    displayName: string;
    /** Category (e.g., "storage.database") */
    category: string;
    /** Capabilities advertised by this factory (e.g., ["storage.database", "orm"]) */
    capabilities: string[];
    /** Framework compatibility (e.g., "fastify", "nestjs", or null for framework-agnostic) */
    framework: string | null;
    /** Whether this factory is deprecated */
    deprecated: boolean;
    /** Reason for deprecation (if deprecated) */
    deprecationReason?: string;
    /** Name of factory that replaces this one (if deprecated) */
    replacedBy?: string;
    /** Names of alternative factories users might consider */
    alternatives: string[];
    /** Source information - WHERE to get the actual factory */
    source: FactorySource;
    /** Tags for categorization and search */
    tags: string[];
    /** Factory description */
    description: string;
    /** License (e.g., "MIT") */
    license?: string;
    /** Repository URL for source code */
    repository?: string;
    /** Usage statistics */
    stats?: FactoryStats;
    /** When this metadata was created */
    createdAt: string;
    /** When this metadata was last updated */
    updatedAt: string;
}
/**
 * Registry API response for listing factories
 */
export interface RegistryResponse {
    /** Array of factory metadata */
    results: RegistryFactoryMetadata[];
    /** Total number of factories matching query */
    total: number;
    /** Current page number */
    page: number;
    /** Number of results per page */
    pageSize: number;
}
/**
 * Match type for search results
 */
export type SearchMatchType = 'exact' | 'partial' | 'fuzzy';
/**
 * Search result with scoring
 */
export interface SearchResult {
    /** Factory metadata */
    factory: RegistryFactoryMetadata;
    /** Similarity score (0-1) */
    score: number;
    /** Type of match */
    match: SearchMatchType;
}
/**
 * Search response from registry
 */
export interface SearchResponse {
    /** Original search query */
    query: string;
    /** Matching factories with scores */
    results: SearchResult[];
    /** Suggested corrections for query */
    suggestions: string[];
}
/**
 * Capability information
 */
export interface CapabilityInfo {
    /** Capability name (e.g., "storage.database") */
    name: string;
    /** Factories that provide this capability */
    factories: string[];
    /** Number of factories providing this capability */
    count: number;
    /** Optional description of the capability */
    description?: string;
}
/**
 * Capabilities response from registry
 */
export interface CapabilitiesResponse {
    /** List of capabilities with their factories */
    capabilities: CapabilityInfo[];
}
/**
 * Factory detail response (for GET /api/factories/:name)
 */
export interface FactoryDetailResponse {
    /** Primary factory metadata */
    factory: RegistryFactoryMetadata;
    /** Alternative factories */
    alternatives: RegistryFactoryMetadata[];
    /** Related factories (similar tags/category) */
    relatedFactories: RegistryFactoryMetadata[];
}
/**
 * Options for fetching factories
 */
export interface FetchFactoriesOptions {
    /** Filter by capability */
    capability?: string;
    /** Filter by framework */
    framework?: string;
    /** Filter by tags */
    tags?: string[];
    /** Include deprecated factories */
    deprecated?: boolean;
    /** Page number (for pagination) */
    page?: number;
    /** Results per page */
    pageSize?: number;
}
/**
 * Options for searching factories
 */
export interface SearchFactoriesOptions {
    /** Filter by capability */
    capability?: string;
    /** Filter by framework */
    framework?: string;
    /** Filter by tags */
    tags?: string[];
}
/**
 * Type guard to check if source is npm
 */
export declare function isNpmSource(source: FactorySource): source is FactorySource & {
    package: string;
    version: string;
};
/**
 * Type guard to check if source is git
 */
export declare function isGitSource(source: FactorySource): source is FactorySource & {
    url: string;
    version?: string;
};
/**
 * Type guard to check if source is URL
 */
export declare function isUrlSource(source: FactorySource): source is FactorySource & {
    url: string;
    checksum?: string;
};
/**
 * Type guard to check if factory is deprecated
 */
export declare function isDeprecated(factory: RegistryFactoryMetadata): factory is RegistryFactoryMetadata & {
    deprecationReason: string;
};
/**
 * Helper to get npm install command for a factory
 */
export declare function getInstallCommand(factory: RegistryFactoryMetadata): string | null;
/**
 * Helper to check if factory provides a specific capability
 */
export declare function providesCapability(factory: RegistryFactoryMetadata, capability: string): boolean;
/**
 * Helper to check if factory supports a specific framework
 */
export declare function supportsFramework(factory: RegistryFactoryMetadata, framework: string): boolean;
//# sourceMappingURL=registry.d.ts.map