/**
 * Template Library
 *
 * Local template management with browsing, search, and organization.
 *
 * @since v1.69.3
 */
import type { ConfigTemplate, TemplateCategory, TemplateSearchOptions, TemplateSearchResult } from './template-types.js';
/**
 * Library statistics
 */
export interface LibraryStats {
    totalTemplates: number;
    byCategory: Record<TemplateCategory, number>;
    bySource: Record<ConfigTemplate['source'], number>;
    totalUsage: number;
    recentlyUsed: string[];
    favorites: string[];
}
/**
 * Template collection
 */
export interface TemplateCollection {
    id: string;
    name: string;
    description: string;
    templateIds: string[];
    createdAt: string;
    updatedAt: string;
}
/**
 * Template history entry
 */
export interface TemplateHistoryEntry {
    templateId: string;
    action: 'created' | 'modified' | 'applied' | 'exported' | 'duplicated';
    timestamp: string;
    details?: string;
}
/**
 * Template library service
 */
export declare class TemplateLibrary {
    private templates;
    private collections;
    private favorites;
    private recentlyUsed;
    private history;
    private maxRecentItems;
    private maxHistoryItems;
    constructor(options?: {
        maxRecentItems?: number;
        maxHistoryItems?: number;
    });
    /**
     * Add template to library
     */
    add(template: ConfigTemplate): void;
    /**
     * Get template by ID
     */
    get(id: string): ConfigTemplate | undefined;
    /**
     * Remove template
     */
    remove(id: string): boolean;
    /**
     * Get all templates
     */
    getAll(): ConfigTemplate[];
    /**
     * Search templates
     */
    search(options?: TemplateSearchOptions): TemplateSearchResult;
    /**
     * Get templates by category
     */
    getByCategory(category: TemplateCategory): ConfigTemplate[];
    /**
     * Get templates for plugin
     */
    getForPlugin(pluginId: string): ConfigTemplate[];
    /**
     * Get available categories with counts
     */
    getCategories(): Array<{
        category: TemplateCategory;
        count: number;
        label: string;
        icon: string;
    }>;
    /**
     * Get all unique tags
     */
    getTags(): Array<{
        tag: string;
        count: number;
    }>;
    /**
     * Get all unique authors
     */
    getAuthors(): Array<{
        author: string;
        count: number;
    }>;
    /**
     * Add to favorites
     */
    addFavorite(templateId: string): boolean;
    /**
     * Remove from favorites
     */
    removeFavorite(templateId: string): boolean;
    /**
     * Check if favorite
     */
    isFavorite(templateId: string): boolean;
    /**
     * Get favorite templates
     */
    getFavorites(): ConfigTemplate[];
    /**
     * Mark as recently used
     */
    markUsed(templateId: string): void;
    /**
     * Get recently used templates
     */
    getRecentlyUsed(): ConfigTemplate[];
    /**
     * Create a collection
     */
    createCollection(id: string, name: string, description: string, templateIds?: string[]): TemplateCollection;
    /**
     * Get collection
     */
    getCollection(id: string): TemplateCollection | undefined;
    /**
     * Get all collections
     */
    getCollections(): TemplateCollection[];
    /**
     * Add template to collection
     */
    addToCollection(collectionId: string, templateId: string): boolean;
    /**
     * Remove template from collection
     */
    removeFromCollection(collectionId: string, templateId: string): boolean;
    /**
     * Delete collection
     */
    deleteCollection(id: string): boolean;
    /**
     * Get templates in collection
     */
    getCollectionTemplates(collectionId: string): ConfigTemplate[];
    /**
     * Add history entry
     */
    addHistory(templateId: string, action: TemplateHistoryEntry['action'], details?: string): void;
    /**
     * Get history
     */
    getHistory(limit?: number): TemplateHistoryEntry[];
    /**
     * Get history for template
     */
    getTemplateHistory(templateId: string): TemplateHistoryEntry[];
    /**
     * Get library statistics
     */
    getStats(): LibraryStats;
    /**
     * Get template count
     */
    count(): number;
    /**
     * Clear all data
     */
    clear(): void;
    /**
     * Import templates (bulk add)
     */
    import(templates: ConfigTemplate[]): number;
    /**
     * Export all templates
     */
    export(): ConfigTemplate[];
}
/**
 * Create a new template library
 */
export declare function createTemplateLibrary(options?: {
    maxRecentItems?: number;
    maxHistoryItems?: number;
}): TemplateLibrary;
/**
 * Get template library singleton
 */
export declare function getTemplateLibrary(): TemplateLibrary;
/**
 * Reset template library singleton
 */
export declare function resetTemplateLibrary(): void;
//# sourceMappingURL=template-library.d.ts.map