/**
 * Domain-Specific Rule File Type Definitions
 *
 * Defines the structure for different types of inference rule files.
 * Each rule file type serves a specific purpose and has an optimized structure.
 */
export type RuleFileType = 'pattern-inference' | 'configuration' | 'expansion-template' | 'deployment';
export interface BaseRuleFile {
    ruleFileType: RuleFileType;
    version: string;
    description?: string;
}
/**
 * Pattern-based inference rules for conditional code generation.
 * Used for controllers, services, events, and base views.
 */
export interface PatternInferenceRuleFile extends BaseRuleFile {
    ruleFileType: 'pattern-inference';
    category: 'controllers' | 'services' | 'events' | 'views';
    rules: InferenceRule[];
}
export interface InferenceRule {
    name: string;
    pattern: string;
    condition: string;
    priority: number;
    description: string;
    template: {
        type: 'yaml' | 'json' | 'specly' | 'handlebars';
        content: string | string[];
    };
}
/**
 * Configuration files for lookup-based mappings.
 * Used for component type mappings and view patterns.
 */
export interface ConfigurationRuleFile extends BaseRuleFile {
    ruleFileType: 'configuration';
    category: 'component-mappings' | 'view-patterns';
    mappings: ComponentMappings | ViewPatternMappings;
}
export interface ComponentMappings {
    description: string;
    attributes: AttributeComponentMapping[];
    relationships: RelationshipComponentMapping[];
    listViewPattern?: ListViewPattern;
    detailViewPattern?: DetailViewPattern;
    formViewPattern?: FormViewPattern;
}
export interface AttributeComponentMapping {
    attributeType: string;
    constraints?: {
        has?: string;
        minLength?: string;
        maxLength?: string;
        pattern?: string;
    };
    default?: boolean;
    componentType: string;
    properties?: Record<string, any>;
    description: string;
}
export interface RelationshipComponentMapping {
    relationshipType: 'belongsTo' | 'hasOne' | 'hasMany' | 'manyToMany';
    componentType: string;
    properties?: Record<string, any>;
    description: string;
}
export interface ListViewPattern {
    searchBar: {
        type: string;
        properties?: Record<string, any>;
    };
    filterPanel: {
        type: string;
        properties?: Record<string, any>;
    };
    table: {
        type: string;
        properties?: Record<string, any>;
    };
    actionToolbar: {
        type: string;
        properties?: Record<string, any>;
    };
}
export interface DetailViewPattern {
    header: {
        type: string;
        properties?: Record<string, any>;
    };
    card: {
        type: string;
        properties?: Record<string, any>;
    };
    tabs?: {
        type: string;
        properties?: Record<string, any>;
    };
    actions: {
        type: string;
        properties?: Record<string, any>;
    };
}
export interface FormViewPattern {
    header: {
        type: string;
        properties?: Record<string, any>;
    };
    form: {
        type: string;
        properties?: Record<string, any>;
    };
    actions: {
        type: string;
        properties?: Record<string, any>;
    };
}
export interface ViewPatternMappings {
    description: string;
    patterns: Record<string, ViewPattern>;
}
export interface ViewPattern {
    description: string;
    components: Record<string, {
        type: string;
        properties?: Record<string, any>;
    }>;
}
/**
 * Expansion templates for specialist views.
 * Defines how abstract view types expand to atomic components.
 */
export interface ExpansionTemplateRuleFile extends BaseRuleFile {
    ruleFileType: 'expansion-template';
    category: 'specialist-views';
    templates: Record<string, SpecialistViewTemplate>;
}
export interface SpecialistViewTemplate {
    description: string;
    components: ComponentTemplate[];
}
export interface ComponentTemplate {
    name: string;
    type: string;
    for?: string;
    properties?: Record<string, any>;
}
/**
 * Deployment inference rules for generating deployment topology.
 * Used for instances, channels, capabilities, and bindings.
 */
export interface DeploymentRuleFile extends BaseRuleFile {
    ruleFileType: 'deployment';
    deployment_inference: {
        instances?: DeploymentInstanceRule[];
        channels?: DeploymentChannelRule[];
        capabilities?: DeploymentCapabilityRule[];
        bindings?: DeploymentBindingRule[];
    };
}
export interface DeploymentInstanceRule {
    name: string;
    pattern: string;
    condition: string;
    priority: number;
    description: string;
    template: {
        type: 'yaml' | 'json' | 'specly' | 'handlebars';
        content: string | string[];
    };
}
export interface DeploymentChannelRule {
    name: string;
    pattern: string;
    condition: string;
    priority: number;
    description: string;
    template: {
        type: 'yaml' | 'json' | 'specly' | 'handlebars';
        content: string | string[];
    };
}
export interface DeploymentCapabilityRule {
    name: string;
    pattern: string;
    condition: string;
    priority: number;
    description: string;
    template: {
        type: 'yaml' | 'json' | 'specly' | 'handlebars';
        content: string | string[];
    };
}
export interface DeploymentBindingRule {
    name: string;
    pattern: string;
    condition: string;
    priority: number;
    description: string;
    template: {
        type: 'yaml' | 'json' | 'specly' | 'handlebars';
        content: string | string[];
    };
}
/**
 * Legacy format (v3.1) with logical_inference wrapper.
 * Supported for backward compatibility.
 */
export interface LegacyRuleFile {
    version: string;
    description?: string;
    logical_inference: {
        [category: string]: InferenceRule[] | any;
    };
}
export type RuleFile = PatternInferenceRuleFile | ConfigurationRuleFile | ExpansionTemplateRuleFile | DeploymentRuleFile | LegacyRuleFile;
export declare function isPatternInferenceFile(file: any): file is PatternInferenceRuleFile;
export declare function isConfigurationFile(file: any): file is ConfigurationRuleFile;
export declare function isExpansionTemplateFile(file: any): file is ExpansionTemplateRuleFile;
export declare function isDeploymentFile(file: any): file is DeploymentRuleFile;
export declare function isLegacyRuleFile(file: any): file is LegacyRuleFile;
export declare function detectRuleFileType(content: any): RuleFileType | 'legacy';
export declare function migrateLegacyToNewFormat(legacy: LegacyRuleFile): RuleFile[];
//# sourceMappingURL=rule-file-types.d.ts.map