supa-seed
Version:
A constraint-aware, framework-agnostic database seeding framework with deep PostgreSQL business logic discovery and MakerKit integration support
123 lines • 4.15 kB
TypeScript
/**
* Configuration Layer System for SupaSeed v2.5.0
* Implements Task 5.1.2: Implement configuration layer system
* Core layer management, composition, and conflict resolution
*/
import type { UniversalCoreConfig, SmartDetectionConfig, ExtensionsLayerConfig, ConfigurationLayerType, LayerStatus, LayerChangeEvent, ConfigurationTemplate } from './config-layers';
import type { PlatformArchitectureType, ContentDomainType } from '../../features/detection/detection-types';
/**
* Default Universal Core Configuration
* Layer 1: Always active, provides MakerKit compatibility
*/
export declare const DEFAULT_UNIVERSAL_CONFIG: UniversalCoreConfig;
/**
* Default Smart Detection Configuration Template
* Layer 2: Auto-configured based on platform detection
*/
export declare const DEFAULT_DETECTION_CONFIG: Omit<SmartDetectionConfig, 'layer'>;
/**
* Default Extensions Configuration Template
* Layer 3: Pluggable extensions and customizations
*/
export declare const DEFAULT_EXTENSIONS_CONFIG: Omit<ExtensionsLayerConfig, 'layer'>;
/**
* Configuration Layer System - manages the 3-layer architecture
*/
export declare class ConfigurationLayerSystem {
private layers;
private layerStatus;
private changeListeners;
private templates;
constructor();
/**
* Initialize the system with default layer configurations
*/
private initializeDefaultLayers;
/**
* Set configuration for a specific layer
*/
setLayer(layerType: ConfigurationLayerType, config: any): void;
/**
* Get configuration for a specific layer
*/
getLayer<T = any>(layerType: ConfigurationLayerType): T | undefined;
/**
* Get all layer configurations
*/
getAllLayers(): Record<ConfigurationLayerType, any>;
/**
* Update smart detection layer with detection results
*/
updateDetectionLayer(architecture: PlatformArchitectureType, domain: ContentDomainType, confidence: number, evidence: any): void;
/**
* Enable or disable a specific layer
*/
setLayerEnabled(layerType: ConfigurationLayerType, enabled: boolean): void;
/**
* Get the status of all layers
*/
getLayerStatuses(): Record<ConfigurationLayerType, LayerStatus>;
/**
* Get the status of a specific layer
*/
getLayerStatus(layerType: ConfigurationLayerType): LayerStatus | undefined;
/**
* Validate all layers for consistency and compatibility
*/
validateLayers(): {
valid: boolean;
errors: {
layer: ConfigurationLayerType;
error: string;
}[];
warnings: {
layer: ConfigurationLayerType;
warning: string;
}[];
};
/**
* Register a template for use with the layer system
*/
registerTemplate(template: ConfigurationTemplate): void;
/**
* Apply a configuration template
*/
applyTemplate(templateId: string, overrides?: Record<string, any>): boolean;
/**
* Get all registered templates
*/
getTemplates(): ConfigurationTemplate[];
/**
* Get templates matching specific criteria
*/
getMatchingTemplates(architecture?: PlatformArchitectureType, domain?: ContentDomainType, complexity?: string): ConfigurationTemplate[];
/**
* Add a change listener
*/
addChangeListener(id: string, listener: (event: LayerChangeEvent) => void): void;
/**
* Remove a change listener
*/
removeChangeListener(id: string): void;
/**
* Reset all layers to default configuration
*/
reset(): void;
private updateLayerStatus;
private validateLayer;
private validateUniversalLayer;
private validateDetectionLayer;
private validateExtensionsLayer;
private validateLayerInteractions;
private generateArchitectureSettings;
private generateDomainSettings;
private generateOptimizations;
private mergeConfigurations;
private deepMerge;
private fallbackMerge;
private applyOverrides;
private setNestedValue;
private estimateMemoryUsage;
private emitChangeEvent;
}
//# sourceMappingURL=layer-system.d.ts.map