/**
 * Allowlist Store
 *
 * Persists approval patterns to ~/.codebuddy/exec-approvals.json
 * Provides CRUD operations for patterns and configuration.
 */
import { EventEmitter } from 'events';
import type { ApprovalPattern, AllowlistConfig, PatternType, ApprovalDecision, PatternSource } from './types.js';
/**
 * Store for bash command approval patterns
 */
export declare class AllowlistStore extends EventEmitter {
    private config;
    private configPath;
    private initialized;
    constructor(configDir?: string);
    /**
     * Initialize the store (load config, add defaults)
     */
    initialize(): Promise<void>;
    /**
     * Check if store is initialized
     */
    isInitialized(): boolean;
    /**
     * Add a new pattern
     */
    addPattern(pattern: string, type: PatternType, decision: ApprovalDecision, options?: {
        description?: string;
        tags?: string[];
        source?: PatternSource;
        expiresAt?: Date | null;
    }): ApprovalPattern;
    /**
     * Remove a pattern by ID
     */
    removePattern(id: string): boolean;
    /**
     * Update a pattern
     */
    updatePattern(id: string, updates: Partial<Omit<ApprovalPattern, 'id' | 'createdAt'>>): ApprovalPattern | undefined;
    /**
     * Get a pattern by ID
     */
    getPattern(id: string): ApprovalPattern | undefined;
    /**
     * Find pattern by value and type
     */
    findPatternByValue(pattern: string, type: PatternType): ApprovalPattern | undefined;
    /**
     * Get all patterns
     */
    getAllPatterns(): ApprovalPattern[];
    /**
     * Get patterns by tag
     */
    getPatternsByTag(tag: string): ApprovalPattern[];
    /**
     * Get patterns by decision
     */
    getPatternsByDecision(decision: ApprovalDecision): ApprovalPattern[];
    /**
     * Enable/disable a pattern
     */
    setPatternEnabled(id: string, enabled: boolean): boolean;
    /**
     * Check a command against stored patterns
     */
    checkCommand(command: string): {
        matched: boolean;
        pattern?: ApprovalPattern;
        decision: ApprovalDecision | 'prompt';
    };
    /**
     * Record a command approval (for creating patterns from prompts)
     */
    recordApproval(command: string, decision: ApprovalDecision, options?: {
        pattern?: string;
        patternType?: PatternType;
        description?: string;
    }): ApprovalPattern | undefined;
    /**
     * Get configuration
     */
    getConfig(): AllowlistConfig;
    /**
     * Update defaults
     */
    updateDefaults(updates: Partial<AllowlistConfig['defaults']>): void;
    /**
     * Get statistics
     */
    getStats(): AllowlistConfig['stats'];
    /**
     * Reset statistics
     */
    resetStats(): void;
    /**
     * Get config file path
     */
    private getConfigPath;
    /**
     * Load configuration from file
     */
    private loadConfig;
    /**
     * Save configuration to file
     */
    private saveConfig;
    /**
     * Migrate old config format
     */
    private migrateConfig;
    /**
     * Add default patterns if not present
     */
    private addDefaultPatterns;
    /**
     * Clean expired patterns
     */
    private cleanExpiredPatterns;
    /**
     * Export patterns to JSON
     */
    exportPatterns(options?: {
        includeStats?: boolean;
        tagsFilter?: string[];
    }): string;
    /**
     * Import patterns from JSON
     */
    importPatterns(json: string, options?: {
        merge?: boolean;
        overwrite?: boolean;
    }): {
        imported: number;
        skipped: number;
    };
    /**
     * Clear all user patterns (keep system patterns)
     */
    clearUserPatterns(): number;
}
/**
 * Get or create the AllowlistStore singleton
 */
export declare function getAllowlistStore(configDir?: string): AllowlistStore;
/**
 * Reset the AllowlistStore singleton
 */
export declare function resetAllowlistStore(): void;
