/** * @fileoverview Rule Configuration Parser * @module @nahisaho/musubix-security/rules/config/config-parser * @trace TSK-RULE-002 */ import type { RuleConfig, RuleSeverity } from '../types.js'; /** * Configuration file formats */ export type ConfigFormat = 'json' | 'yaml' | 'js' | 'ts'; /** * Raw configuration from file */ export interface RawRuleConfig { /** Profile name or 'custom' */ profile?: string; /** Extends another config */ extends?: string | string[]; /** Rule-specific settings */ rules?: Record; /** Include patterns */ include?: string[]; /** Exclude patterns */ exclude?: string[]; /** Severity threshold */ severityThreshold?: RuleSeverity; /** Enable taint analysis */ enableTaintAnalysis?: boolean; /** Enable DFG analysis */ enableDFG?: boolean; } /** * Raw rule settings */ export interface RawRuleSettings { enabled?: boolean; severity?: RuleSeverity; options?: Record; } /** * Default configuration */ export declare const DEFAULT_CONFIG: RuleConfig; /** * Configuration parser result */ export interface ParseResult { config: RuleConfig; configPath?: string; errors: string[]; warnings: string[]; } /** * Parse and normalize rule configuration */ export declare function parseConfig(raw: RawRuleConfig): RuleConfig; /** * Load configuration from file */ export declare function loadConfigFile(filePath: string): Promise; /** * Find configuration file in project */ export declare function findConfigFile(projectRoot: string): Promise; /** * Load configuration from project directory */ export declare function loadProjectConfig(projectRoot: string): Promise; /** * Create configuration builder */ export declare function createConfigBuilder(): ConfigBuilder; /** * Configuration builder for programmatic config creation */ export declare class ConfigBuilder { private config; /** * Set profile */ withProfile(profileName: string): this; /** * Set include patterns */ withInclude(patterns: string[]): this; /** * Set exclude patterns */ withExclude(patterns: string[]): this; /** * Set severity threshold */ withSeverityThreshold(severity: RuleSeverity): this; /** * Enable/disable a rule */ withRule(ruleId: string, enabled: boolean, severity?: RuleSeverity): this; /** * Enable taint analysis */ withTaintAnalysis(enabled?: boolean): this; /** * Enable DFG analysis */ withDFG(enabled?: boolean): this; /** * Build the configuration */ build(): RuleConfig; } /** * Validate configuration */ export declare function validateConfig(config: RuleConfig): string[]; /** * Write configuration to file */ export declare function writeConfigFile(filePath: string, config: RuleConfig): Promise; //# sourceMappingURL=config-parser.d.ts.map