/**
 * Settings Service
 * Manages application settings with persistence, validation, and real-time updates
 */
import { EventEmitter } from "events";
import { ZodSchema } from "zod";
export interface SettingsCategory {
    id: string;
    label: string;
    description?: string;
    icon?: string;
    schema?: ZodSchema;
    fields: SettingsField[];
    order?: number;
}
export interface SettingsField {
    key: string;
    label: string;
    type: "text" | "number" | "boolean" | "select" | "multiselect" | "json" | "password" | "email" | "url" | "color" | "date" | "time" | "datetime";
    description?: string;
    placeholder?: string;
    defaultValue?: any;
    required?: boolean;
    validation?: ZodSchema;
    options?: Array<{
        value: any;
        label: string;
        description?: string;
    }>;
    min?: number;
    max?: number;
    step?: number;
    pattern?: string;
    readonly?: boolean;
    hidden?: boolean;
    dependsOn?: {
        field: string;
        value: any;
    };
    transform?: (value: any) => any;
    format?: (value: any) => string;
}
export interface SettingsOptions {
    storagePath?: string;
    autoSave?: boolean;
    saveDebounce?: number;
    encryptSensitive?: boolean;
    sensitiveFields?: string[];
}
export declare class SettingsService extends EventEmitter {
    private options;
    private categories;
    private settings;
    private storagePath?;
    private autoSave;
    private saveDebounce;
    private saveTimeout?;
    private sensitiveFields;
    constructor(options?: SettingsOptions);
    /**
     * Register a settings category
     */
    registerCategory(category: SettingsCategory): void;
    /**
     * Load settings from storage
     */
    load(): Promise<void>;
    /**
     * Save settings to storage
     */
    save(): Promise<void>;
    /**
     * Get a setting value
     */
    get<T = any>(key: string, defaultValue?: T): T;
    /**
     * Set a setting value
     */
    set(key: string, value: any): Promise<void>;
    /**
     * Update multiple settings
     */
    update(updates: Record<string, any>): Promise<void>;
    /**
     * Get all settings
     */
    getAll(): Record<string, any>;
    /**
     * Get settings by category
     */
    getByCategory(categoryId: string): Record<string, any>;
    /**
     * Get all categories
     */
    getCategories(): SettingsCategory[];
    /**
     * Get category by ID
     */
    getCategory(id: string): SettingsCategory | undefined;
    /**
     * Validate all settings
     */
    validate(): {
        valid: boolean;
        errors: Record<string, string>;
    };
    /**
     * Reset settings to defaults
     */
    reset(categoryId?: string): void;
    /**
     * Export settings
     */
    export(categoryId?: string): string;
    /**
     * Import settings
     */
    import(data: string): Promise<void>;
    private findField;
    private scheduleSave;
    private encryptSensitiveFields;
    private decryptSensitiveFields;
    private getNestedValue;
    private setNestedValue;
}
/**
 * Create common settings categories
 */
export declare const CommonSettingsCategories: {
    general: () => SettingsCategory;
    server: () => SettingsCategory;
    logging: () => SettingsCategory;
};
export default SettingsService;
//# sourceMappingURL=settingsService.d.ts.map