import * as i0 from '@angular/core'; import { EventEmitter, Provider, OnInit, OnDestroy, OnChanges, AfterViewInit, ElementRef, ChangeDetectorRef, SimpleChanges } from '@angular/core'; import { JsonLogicExpression, ComponentDocMeta, ComponentAuthoringManifest, FormLayoutRule, RulePropertySchema, PraxisI18nService } from '@praxisui/core'; import { Observable } from 'rxjs'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; import { AiResponseValidatorService, AiRuleResponse } from '@praxisui/ai'; import { FormBuilder, FormGroup, FormControl, FormArray } from '@angular/forms'; import { MatSelectChange } from '@angular/material/select'; import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { MatButtonToggleChange } from '@angular/material/button-toggle'; import { MatChipInputEvent } from '@angular/material/chips'; /** * Models for the Visual Rule Builder */ interface RuleContextProvider { hasValue(path: string): boolean; getValue(path: string): T | undefined; } type RuleFunctionRegistry = Record; interface DocumentationLink { title?: string; url?: string; } interface SpecificationMetadata { code?: string; message?: string; tag?: string; description?: string; priority?: string; uiConfig?: Record; customProperties?: Record; conditionExpression?: JsonLogicExpression | null; fallbackMetadata?: SpecificationMetadata; internalNotes?: string; documentationLinks?: DocumentationLink[]; [key: string]: unknown; } /** * Value types for rule configuration */ type ValueType = 'literal' | 'field' | 'context' | 'function'; type FieldOperandTransform = 'coalesce'; /** * Valid comparison operators supported by the visual builder */ type ValidComparisonOperator = 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'notIn' | 'matches' | 'notMatches' | 'isNull' | 'isNotNull' | 'isEmpty' | 'isNotEmpty'; interface RuleNode { /** Unique identifier for this rule node */ id: string; /** Type of rule node */ type: RuleNodeType | RuleNodeTypeString; /** Human-readable label for this rule */ label?: string; /** Rule metadata */ metadata?: SpecificationMetadata; /** Whether this node is currently selected */ selected?: boolean; /** Whether this node is expanded (for groups) */ expanded?: boolean; /** Parent node ID */ parentId?: string; /** Child node IDs (for groups) */ children?: string[]; /** Rule-specific configuration */ config?: RuleNodeConfig; } declare enum RuleNodeType { FIELD_CONDITION = "fieldCondition", PROPERTY_RULE = "propertyRule", AND_GROUP = "andGroup", OR_GROUP = "orGroup", NOT_GROUP = "notGroup", XOR_GROUP = "xorGroup", IMPLIES_GROUP = "impliesGroup", REQUIRED_IF = "requiredIf", VISIBLE_IF = "visibleIf", DISABLED_IF = "disabledIf", READONLY_IF = "readonlyIf", FOR_EACH = "forEach", UNIQUE_BY = "uniqueBy", MIN_LENGTH = "minLength", MAX_LENGTH = "maxLength", IF_DEFINED = "ifDefined", IF_NOT_NULL = "ifNotNull", IF_EXISTS = "ifExists", WITH_DEFAULT = "withDefault", FUNCTION_CALL = "functionCall", FIELD_TO_FIELD = "fieldToField", CONTEXTUAL = "contextual", AT_LEAST = "atLeast", EXACTLY = "exactly", EXPRESSION = "expression", CONTEXTUAL_TEMPLATE = "contextualTemplate", CUSTOM = "custom" } /** * String literal type for rule node types (for flexibility) */ type RuleNodeTypeString = 'fieldCondition' | 'propertyRule' | 'andGroup' | 'orGroup' | 'notGroup' | 'xorGroup' | 'impliesGroup' | 'requiredIf' | 'visibleIf' | 'disabledIf' | 'readonlyIf' | 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength' | 'ifDefined' | 'ifNotNull' | 'ifExists' | 'withDefault' | 'functionCall' | 'fieldToField' | 'contextual' | 'atLeast' | 'exactly' | 'expression' | 'contextualTemplate' | 'custom'; type RuleNodeConfig = FieldConditionConfig | PropertyRuleConfig | BooleanGroupConfig | ConditionalValidatorConfig | CollectionValidationConfig | CollectionValidatorConfig | OptionalFieldConfig | FunctionCallConfig | FieldToFieldConfig | ContextualConfig | CardinalityConfig | ExpressionConfig | ContextualTemplateConfig | CustomConfig; interface FieldConditionConfig { type: 'fieldCondition'; /** Primary field name */ fieldName: string; /** Comparison operator supported by the visual builder */ operator: ValidComparisonOperator | string; /** Comparison value */ value?: unknown; /** Type of value for proper handling */ valueType?: ValueType; /** Field to compare against (for field-to-field comparisons) */ compareToField?: string; /** Canonical JSON Logic transform applied to the left field operand. */ fieldValueTransform?: FieldOperandTransform; /** Canonical JSON Logic transform applied to a field-valued right operand. */ compareToFieldValueTransform?: FieldOperandTransform; /** Context variable to use as value */ contextVariable?: string; /** Optional metadata for error messages and UI hints */ metadata?: SpecificationMetadata; /** Legacy field alias for backward compatibility */ field?: string; } interface PropertyRuleConfig { type: 'propertyRule'; targetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock'; /** Target IDs without prefix (namespace is defined by targetType) */ targets: string[]; /** Properties applied when condition is true */ properties?: Record; /** Properties applied when condition is false */ propertiesWhenFalse?: Record; /** Optional condition node or inline condition expression */ condition?: RuleNode | JsonLogicExpression | null; /** Optional reference to a condition node inside the graph */ conditionNodeId?: string; /** Metadata for UI/description */ metadata?: SpecificationMetadata; } interface BooleanGroupConfig { type: 'booleanGroup' | 'andGroup' | 'orGroup' | 'notGroup' | 'xorGroup' | 'impliesGroup'; /** Boolean operator type */ operator: 'and' | 'or' | 'not' | 'xor' | 'implies'; /** Minimum required true conditions (for atLeast scenarios) */ minimumRequired?: number; /** Exact required true conditions (for exactly scenarios) */ exactRequired?: number; /** Optional metadata for group validation */ metadata?: SpecificationMetadata; } interface ConditionalValidatorConfig { type: 'requiredIf' | 'visibleIf' | 'disabledIf' | 'readonlyIf'; /** Specific validator type (mirrors type for backward compatibility) */ validatorType: 'requiredIf' | 'visibleIf' | 'disabledIf' | 'readonlyIf'; /** Target field to apply conditional logic */ targetField: string; /** Optional single condition (legacy support) */ condition?: RuleNode; /** Multiple conditions for advanced mode */ conditions?: RuleNode[]; /** Reference to condition rule node ID (for backward compatibility) */ conditionNodeId?: string; /** Whether to invert the condition result */ inverse?: boolean; /** Logic operator to combine multiple conditions */ logicOperator?: 'and' | 'or'; /** Custom error message */ errorMessage?: string; /** Validate on value change */ validateOnChange?: boolean; /** Validate on blur */ validateOnBlur?: boolean; /** Show error immediately */ showErrorImmediately?: boolean; /** Animation type */ animation?: string; /** Hide field label */ hideLabel?: boolean; /** Preserve space when hidden */ preserveSpace?: boolean; /** Style when disabled */ disabledStyle?: string; /** Clear value when disabled */ clearOnDisable?: boolean; /** Show disabled message */ showDisabledMessage?: boolean; /** Custom disabled message */ disabledMessage?: string; /** Readonly style */ readonlyStyle?: string; /** Show readonly indicator */ showReadonlyIndicator?: boolean; /** Optional metadata for validation messages and UI hints */ metadata?: SpecificationMetadata; } interface CollectionValidationConfig { type: 'collectionValidation'; /** Type of collection validation */ validationType: 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength'; /** Array field to validate */ arrayField: string; /** Reference to rule node ID for forEach validation */ itemCondition?: string; /** Property name for uniqueBy validation */ uniqueKey?: string; /** Length value for min/max length validation */ lengthValue?: number; /** Optional metadata for validation */ metadata?: SpecificationMetadata; } /** * Enhanced collection validator configuration (Phase 2 Implementation) */ interface CollectionValidatorConfig { type: 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength'; /** Target collection field name */ targetCollection: string; /** Variable name for current item in forEach */ itemVariable?: string; /** Variable name for current index in forEach */ indexVariable?: string; /** Validation rules applied to each item */ itemValidationRules?: { ruleType: string; fieldPath: string; errorMessage?: string; }[]; /** Fields to check uniqueness by */ uniqueByFields?: string[]; /** Case-sensitive uniqueness check */ caseSensitive?: boolean; /** Ignore empty values in uniqueness check */ ignoreEmpty?: boolean; /** Custom error message for duplicates */ duplicateErrorMessage?: string; /** Minimum number of items */ minItems?: number; /** Maximum number of items */ maxItems?: number; /** Custom error message for length validation */ lengthErrorMessage?: string; /** Show current item count in UI */ showItemCount?: boolean; /** Prevent adding items beyond maxItems */ preventExcess?: boolean; /** Validate when items are added */ validateOnAdd?: boolean; /** Validate when items are removed */ validateOnRemove?: boolean; /** Validate when items are changed */ validateOnChange?: boolean; /** Validate on form submit */ validateOnSubmit?: boolean; /** Error display strategy */ errorStrategy?: 'summary' | 'inline' | 'both'; /** Stop validation on first error */ stopOnFirstError?: boolean; /** Highlight items with errors */ highlightErrorItems?: boolean; /** Batch size for large collections */ batchSize?: number; /** Debounce validation for performance */ debounceValidation?: boolean; /** Debounce delay in milliseconds */ debounceDelay?: number; /** Optional metadata for validation messages */ metadata?: SpecificationMetadata; } interface FunctionCallConfig { type: 'functionCall'; /** Name of the function to call */ functionName: string; /** Function parameters with type information */ parameters: FunctionParameter[]; /** Optional metadata for validation */ metadata?: SpecificationMetadata; } interface FunctionParameter { /** Parameter name */ name: string; /** Parameter value */ value: unknown; /** Type of parameter value */ valueType: ValueType; /** Field name if valueType is 'field' */ fieldName?: string; /** Context variable name if valueType is 'context' */ contextVariable?: string; } interface FieldToFieldConfig { type: 'fieldToField'; /** Left side field name */ leftField: string; /** Comparison operator */ operator: ValidComparisonOperator | string; /** Right side field name */ rightField: string; /** Transform functions applied to left field */ leftTransforms?: string[]; /** Transform functions applied to right field */ rightTransforms?: string[]; /** Optional metadata for validation */ metadata?: SpecificationMetadata; } interface ContextualConfig { type: 'contextual'; /** Template string with context placeholders */ template: string; /** Available context variables */ contextVariables: Record; /** Optional context provider for dynamic values */ contextProvider?: RuleContextProvider; /** Strict validation of context tokens */ strictContextValidation?: boolean; /** Optional metadata */ metadata?: SpecificationMetadata; } interface CardinalityConfig { type: 'cardinality'; /** Type of cardinality check */ cardinalityType: 'atLeast' | 'exactly'; /** Required count of true conditions */ count: number; /** References to rule node IDs to evaluate */ conditions: string[]; /** Optional metadata for validation */ metadata?: SpecificationMetadata; } interface CustomConfig { type: 'custom'; /** Custom configuration type identifier */ customType: string; /** Custom properties specific to the type */ properties: Record; /** Optional metadata for validation */ metadata?: SpecificationMetadata; } /** * Validator types for conditional validation */ declare enum ConditionalValidatorType { REQUIRED_IF = "requiredIf", VISIBLE_IF = "visibleIf", DISABLED_IF = "disabledIf", READONLY_IF = "readonlyIf" } /** * Preview data for conditional validator simulation */ interface ConditionalValidatorPreview { targetField: string; currentValue: unknown; conditionResult: boolean; validatorType: ConditionalValidatorType; resultingState: { isRequired?: boolean; isVisible?: boolean; isDisabled?: boolean; isReadonly?: boolean; }; example: string; } /** * Rule building session state */ interface RuleBuilderState { /** All rule nodes in the current session */ nodes: Record; /** Root node IDs (top-level rules) */ rootNodes: string[]; /** Currently selected node ID */ selectedNodeId?: string; /** Current JSON representation */ currentJSON?: unknown; /** Validation errors */ validationErrors: ValidationError$1[]; /** Build mode */ mode: 'visual' | 'json'; /** Whether the rule is dirty (has unsaved changes) */ isDirty: boolean; /** Undo/redo history */ history: RuleBuilderSnapshot[]; /** Current history position */ historyPosition: number; } interface ValidationError$1 { /** Error ID */ id: string; /** Error message */ message: string; /** Error severity */ severity: 'error' | 'warning' | 'info'; /** Associated node ID */ nodeId?: string; /** Error code for programmatic handling */ code?: string; /** Suggested fix */ suggestion?: string; } interface RuleBuilderSnapshot { /** Timestamp of this snapshot */ timestamp: number; /** Description of the change */ description: string; /** Complete state at this point */ state: { nodes: Record; rootNodes: string[]; selectedNodeId?: string; currentJSON?: any; validationErrors?: ValidationError$1[]; mode?: 'visual' | 'json'; isDirty?: boolean; }; } /** * Public rendering mode for the visual builder host component. */ type VisualBuilderMode = 'rules' | 'condition'; /** * Rule template for common scenarios */ interface RuleTemplate { /** Template ID */ id: string; /** Template name */ name: string; /** Template description */ description: string; /** Template category */ category: string; /** Template tags for search */ tags: string[]; /** Rule nodes that make up this template */ nodes: RuleNode[]; /** Root node IDs */ rootNodes: string[]; /** Required field schemas for this template */ requiredFields?: string[]; /** Example usage */ example?: string; /** Template preview image/icon */ icon?: string; /** Template metadata */ metadata?: TemplateMetadata; } /** * Template metadata for tracking and management */ interface TemplateMetadata { /** Creation date */ createdAt?: Date; /** Last update date */ updatedAt?: Date; /** Last used date */ lastUsed?: Date; /** Import date (if imported) */ importedAt?: Date; /** Template version */ version?: string; /** Usage count */ usageCount?: number; /** Template complexity */ complexity?: 'simple' | 'medium' | 'complex'; /** Original template ID (for imports/copies) */ originalId?: string; /** Author information */ author?: { name?: string; email?: string; organization?: string; }; /** Template size metrics */ metrics?: { nodeCount?: number; maxDepth?: number; fieldCount?: number; }; } /** * Export options for rules */ interface ExportOptions { /** Export format */ format: 'json' | 'typescript' | 'form-config'; /** Include metadata in export */ includeMetadata?: boolean; /** Pretty print JSON */ prettyPrint?: boolean; /** TypeScript interface name (for TS export) */ interfaceName?: string; /** Additional export configuration */ config?: Record; } /** * Import options for rules */ interface ImportOptions { /** Source format */ format: 'json' | 'form-config'; /** Whether to merge with existing rules */ merge?: boolean; /** Whether to preserve existing metadata */ preserveMetadata?: boolean; /** Field schema mapping for validation */ fieldSchemas?: Record; } /** * Rule builder configuration */ interface RuleBuilderConfig { /** Available field schemas */ fieldSchemas: Record; /** Optional map of available targets by type (fields, sections, actions) */ targetSchemas?: { fields?: Record; sections?: Record; actions?: Record; rows?: Record; columns?: Record; visualBlocks?: Record; }; /** Optional property schema per targetType for typed property editing */ targetPropertySchemas?: Record<'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock', Array<{ name: string; type: 'string' | 'boolean' | 'object' | 'enum' | 'number'; label?: string; description?: string; enumValues?: Array<{ value: string; label?: string; }>; }>>; /** Backward-compatible property schema key */ propertySchema?: Record; /** Context variables */ contextVariables?: unknown[]; /** Custom functions */ customFunctions?: unknown[]; /** Available rule templates */ templates?: RuleTemplate[]; /** UI configuration */ ui?: { /** Theme */ theme?: 'light' | 'dark' | 'auto'; /** Show advanced features */ showAdvanced?: boolean; /** Enable drag and drop */ enableDragDrop?: boolean; /** Show validation errors inline */ showInlineErrors?: boolean; /** Auto-save interval (ms) */ autoSaveInterval?: number; }; /** Validation configuration */ validation?: { /** Enable real-time validation */ realTime?: boolean; /** Validation strictness */ strictness?: 'strict' | 'normal' | 'loose'; /** Custom validation rules */ customRules?: unknown[]; }; /** Export/import configuration */ exportImport?: { /** Default export format */ defaultExportFormat?: 'json' | 'typescript'; /** Supported formats */ supportedFormats?: string[]; /** Include metadata by default */ includeMetadataByDefault?: boolean; }; } /** * Configuration for optional field handling */ interface OptionalFieldConfig { type: 'optionalField'; /** Type of optional field validation */ validationType: 'ifDefined' | 'ifNotNull' | 'ifExists' | 'withDefault'; /** Target field name */ fieldName: string; /** Default value when field is undefined/null */ defaultValue?: unknown; /** Reference to condition rule node ID */ conditionNodeId?: string; /** Optional metadata for validation */ metadata?: SpecificationMetadata; } /** * Configuration for legacy expression authoring support */ interface ExpressionConfig { type: 'expression'; /** Legacy textual expression string */ expression: string; /** Function registry for validation */ functionRegistry?: RuleFunctionRegistry; /** Context provider for variable resolution */ contextProvider?: RuleContextProvider; /** Known field names for validation */ knownFields?: string[]; /** Enable performance warnings */ enablePerformanceWarnings?: boolean; /** Maximum expression complexity */ maxComplexity?: number; /** Optional metadata for UI/description */ metadata?: SpecificationMetadata; } /** * Configuration for contextual template authoring */ interface ContextualTemplateConfig { type: 'contextualTemplate'; /** Template string with context tokens */ template: string; /** Available context variables */ contextVariables?: Record; /** Context provider instance */ contextProvider?: RuleContextProvider; /** Enable strict validation of context tokens */ strictContextValidation?: boolean; /** Optional metadata for UI/description */ metadata?: SpecificationMetadata; } declare class PraxisVisualBuilder { mode: VisualBuilderMode; config: RuleBuilderConfig | null; initialRules: any; initialCondition: JsonLogicExpression | null; rulesChanged: EventEmitter; conditionChanged: EventEmitter; exportRequested: EventEmitter; importRequested: EventEmitter; onRulesChanged(rules: RuleBuilderState): void; onConditionChanged(condition: JsonLogicExpression | null): void; onExportRequested(options: any): void; onImportRequested(options: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Metadata for Praxis Visual Builder component */ declare const PRAXIS_VISUAL_BUILDER_COMPONENT_METADATA: ComponentDocMeta; /** Provider para auto-registrar metadados do componente Visual Builder. */ declare function providePraxisVisualBuilderMetadata(): Provider; declare const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST: ComponentAuthoringManifest; /** * Field schema model for dynamic field configuration in the Visual Builder */ interface FieldSchema { /** Unique field identifier */ name: string; /** Human-readable field label */ label: string; /** Logical origin to help context-sensitive filtering (form field, section, row, column, table column, etc.) */ origin?: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock' | 'tableField' | 'tableColumn'; /** Field data type */ type: FieldType | string; /** Optional description or help text */ description?: string; /** Whether this field is required */ required?: boolean; /** Allowed values for enum/select fields */ allowedValues?: FieldOption[]; /** Format constraints for the field */ format?: FieldFormat; /** UI configuration for field display */ uiConfig?: FieldUIConfig; /** Nested fields for object types */ properties?: Record; /** Item schema for array types */ items?: FieldSchema; } interface FieldOption { /** Option value */ value: any; /** Option display label */ label: string; /** Optional description */ description?: string; /** Whether this option is disabled */ disabled?: boolean; } interface FieldFormat { /** Minimum value (for numbers) or length (for strings/arrays) */ minimum?: number; /** Maximum value (for numbers) or length (for strings/arrays) */ maximum?: number; /** Regular expression pattern for string validation */ pattern?: string; /** Date format for date fields */ dateFormat?: string; /** Number format options */ numberFormat?: { decimals?: number; currency?: string; percentage?: boolean; }; } interface FieldUIConfig { /** Icon to display with the field */ icon?: string; /** Color theme for the field */ color?: string; /** Field category for grouping */ category?: string; /** Field priority for sorting */ priority?: number; /** Whether to show this field in simple mode */ showInSimpleMode?: boolean; /** Custom CSS classes */ cssClass?: string; } declare enum FieldType { STRING = "string", NUMBER = "number", INTEGER = "integer", BOOLEAN = "boolean", DATE = "date", DATETIME = "datetime", TIME = "time", EMAIL = "email", URL = "url", PHONE = "phone", ARRAY = "array", OBJECT = "object", ENUM = "enum", UUID = "uuid", JSON = "json" } /** * Available comparison operators for each field type */ declare const FIELD_TYPE_OPERATORS: Record; /** * Operator display labels for UI */ declare const OPERATOR_LABELS: Record; /** * Context for field schema interpretation */ interface FieldSchemaContext { /** Available context variables (e.g., ${user.role}, ${now}) */ contextVariables?: ContextVariable[]; /** Available custom functions */ customFunctions?: CustomFunction[]; /** Global configuration */ config?: { /** Whether to show advanced features */ showAdvanced?: boolean; /** Default locale for formatting */ locale?: string; /** Theme configuration */ theme?: 'light' | 'dark' | 'auto'; }; } interface ContextVariable { /** Variable name (without ${} wrapper) */ name: string; /** Display label */ label: string; /** Variable type */ type: FieldType; /** Example value for preview */ example?: any; /** Description */ description?: string; } interface CustomFunction { /** Function name */ name: string; /** Display label */ label: string; /** Function description */ description?: string; /** Expected parameter types */ parameters: { name: string; type: FieldType; required?: boolean; description?: string; }[]; /** Return type */ returnType: FieldType; /** Example usage */ example?: string; } /** * Array Field Schema Support for Collection Validators * Phase 2 Implementation */ /** * Extended field schema for array types */ interface ArrayFieldSchema extends FieldSchema { type: FieldType.ARRAY; /** Schema for individual items in the array */ itemSchema?: FieldSchema; /** Minimum number of items */ minItems?: number; /** Maximum number of items */ maxItems?: number; /** Whether items must be unique */ uniqueItems?: boolean; /** Fields to check for uniqueness */ uniqueBy?: string[]; /** Default value for new items */ defaultItem?: any; /** Whether to allow adding items */ allowAdd?: boolean; /** Whether to allow removing items */ allowRemove?: boolean; /** Whether to allow reordering items */ allowReorder?: boolean; /** Custom validation rules for the array */ arrayValidation?: { forEach?: { rules: any[]; stopOnFirstError?: boolean; }; uniqueBy?: { fields: string[]; caseSensitive?: boolean; ignoreEmpty?: boolean; }; length?: { min?: number; max?: number; errorMessage?: string; }; }; /** UI configuration specific to arrays */ arrayUiConfig?: { /** How to display the array */ displayMode?: 'table' | 'cards' | 'list' | 'accordion'; /** Whether to show item count */ showCount?: boolean; /** Custom add button text */ addButtonText?: string; /** Custom remove button text */ removeButtonText?: string; /** Whether to confirm before removing */ confirmRemove?: boolean; /** Message to show when array is empty */ emptyMessage?: string; /** Whether to collapse items by default */ collapsedByDefault?: boolean; /** Maximum items to show before pagination */ pageSize?: number; }; } /** * Utility to check if a field schema is an array */ declare function isArrayFieldSchema(schema: FieldSchema): schema is ArrayFieldSchema; /** * Utility to get nested field paths from an array schema */ declare function getArrayItemFieldPaths(schema: ArrayFieldSchema, prefix?: string): string[]; /** * Array validation context for runtime validation */ interface ArrayValidationContext { /** The array being validated */ array: any[]; /** Current item being validated (for forEach) */ currentItem?: any; /** Current item index (for forEach) */ currentIndex?: number; /** Parent context */ parentContext?: any; /** Field schema */ schema: ArrayFieldSchema; /** Accumulated errors */ errors: ArrayValidationError[]; } /** * Array validation error */ interface ArrayValidationError { /** Error type */ type: 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength' | 'other'; /** Error message */ message: string; /** Item index (if applicable) */ itemIndex?: number; /** Field path within item (if applicable) */ fieldPath?: string; /** Duplicate indices (for uniqueBy) */ duplicateIndices?: number[]; /** Expected value */ expected?: any; /** Actual value */ actual?: any; } /** * Array field analyzer for detecting array fields in schemas */ declare class ArrayFieldAnalyzer { /** * Analyze a schema tree and find all array fields */ static findArrayFields(schemas: Record): Record; /** * Get validation rules for an array field */ static getValidationRules(schema: ArrayFieldSchema): ArrayCollectionValidationRule[]; } /** * Array collection validation rule */ interface ArrayCollectionValidationRule { type: 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength'; value?: any; fields?: string[]; rules?: any[]; message: string; } declare class FieldSchemaService { private readonly _fieldSchemas; private readonly _context; readonly fieldSchemas$: Observable>; readonly context$: Observable; constructor(); /** * Set field schemas for the visual builder */ setFieldSchemas(schemas: Record): void; /** * Add a single field schema */ addFieldSchema(name: string, schema: FieldSchema): void; /** * Remove a field schema */ removeFieldSchema(name: string): void; /** * Get field schema by name */ getFieldSchema(name: string): FieldSchema | undefined; /** * Get all field schemas */ getAllFieldSchemas(): Record; /** * Get field schemas as array with enhanced info */ getFieldSchemasArray(): Observable; /** * Set context for field schemas */ setContext(context: FieldSchemaContext): void; /** * Get available operators for a field type */ getAvailableOperators(fieldType: FieldType | string): string[]; /** * Get operator labels for a field type */ getOperatorLabels(fieldType: FieldType | string): Record; /** * Validate field value against schema */ validateFieldValue(fieldName: string, value: any): ValidationResult; /** * Get field suggestions based on partial input */ getFieldSuggestions(partial: string, category?: string): FieldSchema[]; /** * Create field schema from JSON Schema */ createFromJsonSchema(jsonSchema: any): Record; /** * Create field schema from form metadata */ createFromFormMetadata(formFields: any[]): Record; /** * Get context variables */ getContextVariables(): Observable; /** * Get custom functions */ getCustomFunctions(): Observable; /** * Group field schemas by category */ getFieldSchemasByCategory(): Observable>; private isValidType; private validateFormat; private convertJsonSchemaProperty; private mapJsonSchemaType; private mapFormFieldType; private extractFormatFromField; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface EnhancedFieldSchema extends FieldSchema { operators: string[]; operatorLabels: Record; } interface ValidationResult { valid: boolean; errors: string[]; } /** * Registry service for managing RuleNode instances and their relationships. * Solves the core problem of resolving string IDs to actual RuleNode objects. */ declare class RuleNodeRegistryService { private nodes; private nodesSubject; /** * Observable stream of all registered nodes */ nodes$: Observable>; /** * Register a node in the registry */ register(node: RuleNode): void; /** * Backwards-compatible alias for register() */ registerNode(node: RuleNode): void; /** * Register multiple nodes at once */ registerAll(nodes: RuleNode[]): void; /** * Unregister a node from the registry */ unregister(nodeId: string): boolean; /** * Resolve a node by its ID */ resolve(nodeId: string): RuleNode | null; /** * Retrieve a node synchronously by its ID. * * Provided for backwards compatibility with code that expected a * synchronous `getNode` API. Internally this simply delegates to * {@link resolve}. */ getNode(nodeId: string): RuleNode | null; /** * Resolve multiple nodes by their IDs */ resolveMultiple(nodeIds: string[]): RuleNode[]; /** * Resolve children nodes for a given node */ resolveChildren(node: RuleNode): RuleNode[]; /** * Get all nodes that have the specified parent ID */ getChildrenOf(parentId: string): RuleNode[]; /** * Get the parent node of a given node */ getParent(node: RuleNode): RuleNode | null; /** * Get all root nodes (nodes without parents) */ getRootNodes(): RuleNode[]; /** * Check if a node exists in the registry */ exists(nodeId: string): boolean; /** * Get all registered node IDs */ getAllIds(): string[]; /** * Get all registered nodes */ getAllNodes(): RuleNode[]; /** * Clear all nodes from the registry */ clear(): void; /** * Get the size of the registry */ size(): number; /** * Remove orphaned nodes (nodes without parents and not referenced by others) */ cleanupOrphanedNodes(): string[]; /** * Detect circular references in the registry */ detectCircularReferences(): CircularReference[]; /** * Get memory usage statistics */ getMemoryStats(): MemoryStats; /** * Validate registry integrity */ validateIntegrity(): RegistryIntegrityResult; /** * Perform automatic cleanup operations */ performCleanup(): CleanupResult; /** * Build a tree structure starting from root nodes */ buildTree(): RuleNodeTree[]; /** * Build tree structure for a specific node */ buildNodeTree(node: RuleNode): RuleNodeTree; /** * Find nodes by a predicate function */ findNodes(predicate: (node: RuleNode) => boolean): RuleNode[]; /** * Find nodes by type */ findNodesByType(type: string): RuleNode[]; /** * Validate the graph structure integrity (legacy method for backward compatibility) */ validateGraphIntegrity(): RegistryValidationResult; /** * Check if a node has circular references */ private hasCircularReference; /** * Get observable for a specific node */ getNode$(nodeId: string): Observable; /** * Get observable for children of a node */ getChildren$(nodeId: string): Observable; private notifyChange; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Tree structure for representing node hierarchies */ interface RuleNodeTree { node: RuleNode; children: RuleNodeTree[]; } /** * Result of registry integrity validation */ interface RegistryValidationResult { isValid: boolean; errors: string[]; warnings: string[]; } /** * Circular reference information */ interface CircularReference { cycle: string[]; affectedNodes: string[]; } /** * Memory usage statistics */ interface MemoryStats { totalNodes: number; estimatedSizeBytes: number; breakdown: { config: number; children: number; metadata: number; other: number; }; } /** * Registry integrity validation result */ interface RegistryIntegrityResult { isValid: boolean; issues: string[]; warnings: string[]; circularReferences: CircularReference[]; memoryStats: MemoryStats; } /** * Cleanup operation result */ interface CleanupResult { orphanedNodesRemoved: string[]; circularReferencesDetected: CircularReference[]; memoryFreed: number; } declare class RuleBuilderService { private nodeRegistry; private readonly _state; private readonly _validationErrors; private readonly _nodeSelected; private readonly _stateChanged; private config; readonly state$: Observable; readonly validationErrors$: Observable; readonly nodeSelected$: Observable; readonly stateChanged$: Observable; constructor(nodeRegistry: RuleNodeRegistryService); /** * Initialize the rule builder with configuration */ initialize(config: RuleBuilderConfig): void; /** * Get current state */ getCurrentState(): RuleBuilderState; /** * Initial empty builder state */ private getInitialState; /** * Add a high-level property rule (bridge method) */ addPropertyRule(rule: FormLayoutRule): string; /** * Update a high-level property rule (bridge method) */ updatePropertyRule(id: string, rule: Partial): void; /** * Add a new rule node */ addNode(node: Partial, parentId?: string): string; /** * Update an existing rule node */ updateNode(nodeId: string, updates: Partial): void; /** * Remove a rule node (and its descendants) */ removeNode(nodeId: string): void; /** * Select a rule node */ selectNode(nodeId?: string): void; /** * Undo last change */ undo(): void; /** * Redo previously undone change */ redo(): void; /** * Clear all rules */ clear(): void; /** * Import rules from supported formats */ import(content: string, options: ImportOptions): void; /** * Export rules to JSON payload */ export(options: ExportOptions): string; toSpecification(): null; private updateState; validateRules(): void; loadFromConditionExpression(condition: JsonLogicExpression, description?: string): void; buildConditionExpressionFromGraph(nodes: Record, rootNodes: string[]): JsonLogicExpression | null; private saveSnapshot; private generateNodeLabel; private withRuleTimestamps; private isPropertyRuleNode; private containsPropertyRule; /** * Constrói um array de FormLayoutRule a partir do estado atual do builder, * focando em nós propertyRule ou nós com propriedades/targets definidos. */ private exportFormRulesFromState; private toFormLayoutRule; private normalizeTargets; private buildJsonLogicFromCondition; private buildJsonLogicFromState; private applyBuilderState; private extractFormRules; private isFormRuleCandidate; private validateFormRulesPayload; private sanitizeRuleProperties; private coerceRulePropertyValue; private sanitizeStructuredArray; private sanitizeStructuredValue; private formRulesToBuilderState; private inferRuleTypeFromFormRule; private parseConditionExpression; private normalizeJsonLogicCondition; private parseJsonLogicCondition; private parseJsonLogicChild; private normalizeOperator; private builderOperatorToJsonLogicOperator; private jsonLogicOperatorToBuilderOperator; private normalizeConditionValue; private buildConditionRightOperand; private buildFieldOperand; private parseFieldOperand; private isJsonLogicExpressionCandidate; private isVarExpression; private extractVarPath; private flattenConditionNodes; private prefixTarget; private buildRuleNodeTree; private flattenRuleNodeTree; private validateNode; private validateStructure; private validateFieldConditionNode; private validateBooleanGroupNode; private validatePropertyRuleNode; private validateExpressionNode; private addValidationError; private exportToTypeScript; private exportToFormConfig; private normalizeSpecJson; private isBuilderState; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface ExportFormat { id: string; name: string; description: string; fileExtension: string; mimeType: string; supportsMetadata: boolean; supportsComments: boolean; } interface ExportResult { success: boolean; content: string; format: ExportFormat; filename: string; size: number; metadata?: { rulesCount: number; complexity: 'low' | 'medium' | 'high'; exportedAt: string; version: string; }; errors?: string[]; warnings?: string[]; } interface IntegrationEndpoint { id: string; name: string; description: string; url?: string; method: 'GET' | 'POST' | 'PUT' | 'PATCH'; headers?: Record; authentication?: { type: 'none' | 'basic' | 'bearer' | 'apikey'; credentials?: any; }; supportedFormats: string[]; responseFormat?: 'json' | 'xml' | 'text'; } interface IntegrationResult { success: boolean; endpoint: IntegrationEndpoint; response?: any; statusCode?: number; error?: string; timestamp: string; } interface ExternalSystemConfig { id: string; name: string; type: 'rest-api' | 'webhook' | 'file-system' | 'database' | 'cloud-storage'; config: any; endpoints: IntegrationEndpoint[]; enabled: boolean; } declare class ExportIntegrationService { private ruleBuilderService; private readonly SUPPORTED_FORMATS; private externalSystems; constructor(ruleBuilderService: RuleBuilderService); /** * Gets all supported export formats */ getSupportedFormats(): ExportFormat[]; /** * Gets a specific export format by ID */ getFormat(formatId: string): ExportFormat | null; /** * Exports current rules in the specified format */ exportRules(options: { format: string; includeMetadata?: boolean; prettyPrint?: boolean; includeComments?: boolean; customFilename?: string; downloadFile?: boolean; }): Observable; /** * Exports rules to multiple formats simultaneously */ exportToMultipleFormats(formats: string[], options?: any): Observable; /** * Integrates with external system */ integrateWithSystem(systemId: string, endpointId: string, exportFormat: string, options?: any): Observable; /** * Registers a new external system configuration */ registerExternalSystem(config: ExternalSystemConfig): void; /** * Gets all registered external systems */ getExternalSystems(): ExternalSystemConfig[]; /** * Tests connectivity to an external system */ testSystemConnectivity(systemId: string): Observable<{ success: boolean; message: string; }>; /** * Creates a shareable link for rules */ createShareableLink(options: { format: string; expiration?: Date; accessLevel?: 'public' | 'protected' | 'private'; password?: string; }): Observable<{ url: string; token: string; expiresAt?: Date; }>; /** * Imports rules from external source */ importFromExternal(source: { type: 'url' | 'file' | 'system'; location: string; format: string; authentication?: any; }): Observable<{ success: boolean; imported: any; errors?: string[]; }>; /** * Private implementation methods */ private performExport; private generateContent; private generateJson; private generateJsonSchema; private generateYaml; private generateXml; private generateTypeScript; private generateOpenApi; private generateCsv; private performIntegration; private sendToEndpoint; private performConnectivityTest; private generateShareableLink; private performExternalImport; private buildCompleteRuleNode; private flattenCompleteRuleNode; private generateExportMetadata; private generateFilename; private downloadFile; private generateToken; private generateSchemaProperties; private generateSchemaRequired; private convertNodeToYamlObject; private objectToYaml; private nodeToXml; private escapeXml; private generateOpenApiSchemas; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface WebhookConfig { id: string; name: string; url: string; method: 'POST' | 'PUT' | 'PATCH'; headers?: Record; authentication?: { type: 'none' | 'basic' | 'bearer' | 'apikey'; credentials: any; }; format: string; events: WebhookEvent[]; enabled: boolean; retryConfig?: { maxRetries: number; retryDelay: number; backoffMultiplier: number; }; filtering?: { includeMetadata: boolean; minRuleCount?: number; maxRuleCount?: number; ruleTypes?: string[]; }; } interface WebhookEvent { type: 'rule-added' | 'rule-updated' | 'rule-deleted' | 'rules-imported' | 'rules-exported' | 'validation-changed'; description: string; enabled: boolean; } interface WebhookDelivery { id: string; webhookId: string; event: string; url: string; payload: any; status: 'pending' | 'delivered' | 'failed' | 'retrying'; attempts: number; lastAttempt?: Date; nextRetry?: Date; response?: { statusCode: number; headers: Record; body: string; }; error?: string; createdAt: Date; deliveredAt?: Date; } interface WebhookStats { totalDeliveries: number; successfulDeliveries: number; failedDeliveries: number; pendingDeliveries: number; successRate: number; lastDelivery?: Date; averageResponseTime?: number; } declare class WebhookIntegrationService { private ruleBuilderService; private exportService; private webhooks; private deliveries; private deliveryQueue; private statusUpdates; private readonly SUPPORTED_EVENTS; readonly webhookStats$: Observable>; constructor(ruleBuilderService: RuleBuilderService, exportService: ExportIntegrationService); /** * Registers a new webhook configuration */ registerWebhook(config: WebhookConfig): void; /** * Removes a webhook configuration */ unregisterWebhook(webhookId: string): void; /** * Gets all registered webhooks */ getWebhooks(): WebhookConfig[]; /** * Gets a specific webhook by ID */ getWebhook(webhookId: string): WebhookConfig | null; /** * Updates webhook configuration */ updateWebhook(webhookId: string, updates: Partial): void; /** * Enables or disables a webhook */ toggleWebhook(webhookId: string, enabled: boolean): void; /** * Tests a webhook by sending a test payload */ testWebhook(webhookId: string): Observable; /** * Gets delivery history for a webhook */ getDeliveryHistory(webhookId: string, limit?: number): WebhookDelivery[]; /** * Gets overall delivery statistics */ getDeliveryStats(webhookId?: string): WebhookStats; /** * Retries failed deliveries */ retryFailedDeliveries(webhookId?: string): void; /** * Clears delivery history */ clearDeliveryHistory(webhookId?: string): void; /** * Gets supported webhook events */ getSupportedEvents(): WebhookEvent[]; /** * Manually triggers a webhook for testing */ triggerWebhook(webhookId: string, eventType: string, payload: any): Observable; /** * Private implementation methods */ private initializeWebhookProcessing; private subscribeToRuleChanges; private handleRuleChange; private handleValidationChange; private shouldTriggerWebhook; private generateEventPayload; private queueDelivery; private preparePayload; private deliverWebhook; private sendWebhookRequest; private toHeaderRecord; private updateDelivery; private processRetries; private updateStats; private generateDeliveryId; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Template category for organization */ interface TemplateCategory { id: string; name: string; description?: string; icon?: string; color?: string; templates: RuleTemplate[]; } /** * Template search criteria */ interface TemplateSearchCriteria { query?: string; category?: string; tags?: string[]; nodeTypes?: string[]; complexity?: 'simple' | 'medium' | 'complex'; dateRange?: { from?: Date; to?: Date; }; } /** * Template validation result */ interface TemplateValidationResult { isValid: boolean; errors: string[]; warnings: string[]; missingFields?: string[]; incompatibleFeatures?: string[]; } /** * Template application result */ interface TemplateApplicationResult { success: boolean; appliedNodes: RuleNode[]; errors: string[]; warnings: string[]; modifiedNodeIds: string[]; } /** * Template statistics */ interface TemplateStats { totalTemplates: number; categoriesCount: number; mostUsedTemplate?: RuleTemplate; recentlyUsed: RuleTemplate[]; popularTags: string[]; } declare class RuleTemplateService { private readonly STORAGE_KEY; private readonly VERSION_KEY; private readonly CURRENT_VERSION; private templatesSubject; private categoriesSubject; private recentlyUsedSubject; templates$: Observable; categories$: Observable; recentlyUsed$: Observable; constructor(); /** * Get all templates */ getTemplates(): Observable; /** * Get templates by category */ getTemplatesByCategory(categoryId: string): Observable; /** * Search templates */ searchTemplates(criteria: TemplateSearchCriteria): Observable; /** * Get template by ID */ getTemplate(id: string): Observable; /** * Create new template */ createTemplate(name: string, description: string, category: string, nodes: RuleNode[], rootNodes: string[], tags?: string[], requiredFields?: string[]): Observable; /** * Update template */ updateTemplate(id: string, updates: Partial): Observable; /** * Delete template */ deleteTemplate(id: string): Observable; /** * Duplicate template */ duplicateTemplate(id: string, newName?: string): Observable; /** * Apply template to current builder state */ applyTemplate(templateId: string, targetBuilderState?: RuleBuilderState): Observable; /** * Validate template compatibility */ validateTemplate(template: RuleTemplate, availableFields?: string[]): TemplateValidationResult; /** * Export template to JSON */ exportTemplate(id: string, options?: ExportOptions): Observable; /** * Import template from JSON */ importTemplate(jsonData: string, options?: ImportOptions): Observable; /** * Get template statistics */ getTemplateStats(): Observable; /** * Get categories with template counts */ getCategories(): Observable; private loadTemplatesFromStorage; private saveTemplatesToStorage; private updateCategories; private initializeDefaultTemplates; private createDefaultTemplates; private generateTemplateId; private cloneTemplateNodes; private generateNodeId; private replaceTemplateVariables; private incrementTemplateUsage; private addToRecentlyUsed; private getTemplateComplexity; private calculateComplexity; private detectComplexFeatures; private getCategoryDisplayName; private getCategoryDescription; private getDefaultIconForCategory; private incrementVersion; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Validation issue severity levels */ declare enum ValidationSeverity { ERROR = "error", WARNING = "warning", INFO = "info" } /** * Validation issue categories */ declare enum ValidationCategory { STRUCTURE = "structure", DEPENDENCY = "dependency", BUSINESS_LOGIC = "business_logic", PERFORMANCE = "performance", SEMANTIC = "semantic" } /** * Validation issue details */ interface ValidationIssue { /** Unique identifier for this issue */ id: string; /** Issue severity level */ severity: ValidationSeverity; /** Issue category */ category: ValidationCategory; /** Human-readable message */ message: string; /** Affected node ID */ nodeId: string; /** Suggested fix (optional) */ suggestion?: string; /** Additional context data */ context?: Record; } /** * Validation result for a rule tree */ interface RuleValidationResult { /** Whether validation passed */ isValid: boolean; /** Total number of issues found */ issueCount: number; /** Issues found during validation */ issues: ValidationIssue[]; /** Performance metrics */ metrics: { validationTime: number; nodeCount: number; maxDepth: number; complexity: number; }; } /** * Validation configuration options */ interface ValidationConfig { /** Enable strict validation mode */ strict?: boolean; /** Maximum allowed tree depth */ maxDepth?: number; /** Maximum allowed complexity score */ maxComplexity?: number; /** Enable performance warnings */ enablePerformanceWarnings?: boolean; /** Custom validation rules */ customRules?: ValidationRule[]; } /** * Custom validation rule interface */ interface ValidationRule { /** Rule identifier */ id: string; /** Rule description */ description: string; /** Validation function */ validate: (node: RuleNode, context: ValidationContext) => ValidationIssue[]; } /** * Validation context passed to validators */ interface ValidationContext { /** Registry service for node resolution */ registry: RuleNodeRegistryService; /** Current validation config */ config: ValidationConfig; /** Visited nodes (for cycle detection) */ visitedNodes: Set; /** Current depth level */ currentDepth: number; /** All nodes in the tree */ allNodes: Map; } /** * Centralized service for validating rule business logic and integrity */ declare class RuleValidationService { private nodeRegistry; private defaultConfig; constructor(nodeRegistry: RuleNodeRegistryService); /** * Validate a complete rule tree */ validateRuleTree(rootNode: RuleNode, config?: Partial): RuleValidationResult; /** * Validate a single node */ validateNode(node: RuleNode, context: ValidationContext): ValidationIssue[]; private validateStructure; private validateDependencies; private validateBusinessLogic; private validatePerformance; private validateNodeByType; private validateFieldCondition; private validateBooleanGroup; private validateCardinality; private getRequiredChildrenCount; private collectAllNodes; private calculateMetrics; private getNodeComplexity; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Context variable definition used by the context management service * Renamed to avoid conflicts with other ContextVariable interfaces */ interface ContextEntry { /** Full path identifier for the variable */ path: string; /** Actual value of the variable */ value: unknown; /** Optional type hint for validation */ type?: string; } /** * Context variable value with metadata */ interface ContextValue { /** The actual value */ value: any; /** Variable type */ type: 'string' | 'number' | 'boolean' | 'object' | 'array'; /** Whether the value is computed */ computed?: boolean; /** Last updated timestamp */ lastUpdated?: Date; } /** * Context scope for variable resolution */ interface ContextScope { /** Scope identifier */ id: string; /** Scope name */ name: string; /** Parent scope (for hierarchical contexts) */ parentId?: string; /** Variables in this scope */ variables: Map; } /** * Dedicated service for context management and variable resolution * Extracted from the old bridge-oriented implementation to follow SRP */ declare class ContextManagementService { private scopes; private globalScope; constructor(); /** * Create a context provider from context variables */ createContextProvider(contextVariables: ContextEntry[]): RuleContextProvider; /** * Create a new context scope */ createScope(id: string, name: string, parentId?: string): ContextScope; /** * Set a variable in a specific scope */ setVariable(scopeId: string, name: string, value: any, type?: ContextValue['type']): void; /** * Get a variable value from a scope (with inheritance) */ getVariable(scopeId: string, name: string): ContextValue | undefined; /** * Get all variables in a scope (including inherited) */ getAllVariables(scopeId: string): Map; /** * Validate context variables */ validateContext(contextVariables: ContextEntry[]): { isValid: boolean; issues: string[]; }; /** * Create a scoped context provider */ createScopedProvider(scopeId: string): RuleContextProvider; /** * Merge multiple context providers */ mergeProviders(...providers: RuleContextProvider[]): RuleContextProvider; /** * Get context statistics */ getContextStatistics(scopeId?: string): { scopeCount: number; variableCount: number; totalSize: number; scopes: { id: string; name: string; variableCount: number; }[]; }; private hasContextValue; private getContextValue; private collectVariablesRecursive; private isValidPath; private inferType; private estimateSize; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Typed error system for Visual Builder operations * Provides structured error handling with codes, categories, and context */ /** * Error categories for classification */ declare enum ErrorCategory { VALIDATION = "validation", CONVERSION = "conversion", REGISTRY = "registry", EXPRESSION = "expression", CONTEXT = "context", CONFIGURATION = "configuration", NETWORK = "network", INTERNAL = "internal" } /** * Error severity levels */ declare enum ErrorSeverity { LOW = "low", MEDIUM = "medium", HIGH = "high", CRITICAL = "critical" } /** * Base error class for all Visual Builder errors */ declare abstract class VisualBuilderError extends Error { abstract readonly code: string; abstract readonly category: ErrorCategory; abstract readonly severity: ErrorSeverity; readonly timestamp: Date; readonly context: Record; constructor(message: string, context?: Record, cause?: Error); /** * Get structured error information */ toJSON(): ErrorInfo; } /** * Validation-related errors */ declare class ValidationError extends VisualBuilderError { readonly nodeId?: string | undefined; readonly validationRules?: string[] | undefined; readonly code = "VALIDATION_ERROR"; readonly category = ErrorCategory.VALIDATION; readonly severity = ErrorSeverity.HIGH; constructor(message: string, nodeId?: string | undefined, validationRules?: string[] | undefined, context?: Record); } /** * Conversion-related errors */ declare class ConversionError extends VisualBuilderError { readonly nodeId?: string | undefined; readonly code: string; readonly category = ErrorCategory.CONVERSION; readonly severity = ErrorSeverity.HIGH; constructor(code: string, message: string, nodeId?: string | undefined, context?: Record, cause?: Error); } /** * Registry-related errors */ declare class RegistryError extends VisualBuilderError { readonly nodeId?: string | undefined; readonly code: string; readonly category = ErrorCategory.REGISTRY; readonly severity = ErrorSeverity.MEDIUM; constructor(operation: string, message: string, nodeId?: string | undefined, context?: Record); } /** * Expression parsing and processing errors */ declare class ExpressionError extends VisualBuilderError { readonly expression?: string | undefined; readonly position?: { start: number; end: number; } | undefined; readonly code: string; readonly category = ErrorCategory.EXPRESSION; readonly severity = ErrorSeverity.HIGH; constructor(type: 'PARSING' | 'VALIDATION' | 'EXPORT' | 'IMPORT', message: string, expression?: string | undefined, position?: { start: number; end: number; } | undefined, context?: Record); } /** * Context management errors */ declare class ContextError extends VisualBuilderError { readonly scopeId?: string | undefined; readonly variablePath?: string | undefined; readonly code: string; readonly category = ErrorCategory.CONTEXT; readonly severity = ErrorSeverity.MEDIUM; constructor(operation: string, message: string, scopeId?: string | undefined, variablePath?: string | undefined, context?: Record); } /** * Configuration errors */ declare class ConfigurationError extends VisualBuilderError { readonly configPath?: string | undefined; readonly expectedType?: string | undefined; readonly code = "CONFIGURATION_ERROR"; readonly category = ErrorCategory.CONFIGURATION; readonly severity = ErrorSeverity.HIGH; constructor(message: string, configPath?: string | undefined, expectedType?: string | undefined, context?: Record); } /** * Internal system errors */ declare class InternalError extends VisualBuilderError { readonly code = "INTERNAL_ERROR"; readonly category = ErrorCategory.INTERNAL; readonly severity = ErrorSeverity.CRITICAL; constructor(message: string, context?: Record, cause?: Error); } /** * Structured error information */ interface ErrorInfo { code: string; category: ErrorCategory; severity: ErrorSeverity; message: string; timestamp: string; context: Record; stack?: string; cause?: { name: string; message: string; stack?: string; }; } /** * Error handler for collecting and processing errors */ declare class ErrorHandler { private errors; private maxErrors; /** * Handle an error */ handle(error: Error | VisualBuilderError): void; /** * Get all errors */ getErrors(): VisualBuilderError[]; /** * Get errors by category */ getErrorsByCategory(category: ErrorCategory): VisualBuilderError[]; /** * Get errors by severity */ getErrorsBySeverity(severity: ErrorSeverity): VisualBuilderError[]; /** * Clear all errors */ clear(): void; /** * Get error statistics */ getStatistics(): ErrorStatistics; private logError; } /** * Error statistics interface */ interface ErrorStatistics { total: number; byCategory: Record; bySeverity: Record; recent: VisualBuilderError[]; } /** * Global error handler instance */ declare const globalErrorHandler: ErrorHandler; /** * Utility function to create typed errors */ declare const createError: { validation: (message: string, nodeId?: string, rules?: string[]) => ValidationError; conversion: (code: string, message: string, nodeId?: string) => ConversionError; registry: (operation: string, message: string, nodeId?: string) => RegistryError; expression: (type: "PARSING" | "VALIDATION" | "EXPORT" | "IMPORT", message: string, expression?: string) => ExpressionError; context: (operation: string, message: string, scopeId?: string, variablePath?: string) => ContextError; configuration: (message: string, configPath?: string, expectedType?: string) => ConfigurationError; internal: (message: string, cause?: Error) => InternalError; }; type TargetType = 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock'; type RuleNodeConfigExtended = RuleNodeConfig & { targetType?: TargetType; properties?: Record; propertiesWhenFalse?: Record; targets?: string[]; condition?: RuleNode | JsonLogicExpression | null; }; declare class RuleEditorComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit { private readonly ruleBuilderService; private readonly fieldSchemaService; private readonly aiResponseValidator; private readonly snackBar; private readonly dialog; private readonly cdr; private readonly i18n?; embedded: boolean; mode: VisualBuilderMode; config: RuleBuilderConfig | null; initialRules: any; initialCondition: JsonLogicExpression | null; stateChanged: EventEmitter; save: EventEmitter; rulesChanged: EventEmitter; conditionChanged: EventEmitter; exportRequested: EventEmitter; importRequested: EventEmitter; fileInput: ElementRef; private destroy$; private initialized; private lastInitialConditionSignature; currentState: RuleBuilderState | null; fieldSchemas: Record; showDebugPanel: boolean; validationErrors: ValidationError$1[]; isListPanelOpen: boolean; selectedNode: RuleNode | null; propertySchemaMap: RulePropertySchema; targetSchemas?: RuleBuilderConfig['targetSchemas']; private lastErrorCount; get canUndo(): boolean; get canRedo(): boolean; constructor(ruleBuilderService: RuleBuilderService, fieldSchemaService: FieldSchemaService, aiResponseValidator: AiResponseValidatorService, snackBar: MatSnackBar, dialog: MatDialog, cdr: ChangeDetectorRef, i18n?: PraxisI18nService | undefined); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; ngOnDestroy(): void; undo(): void; redo(): void; clearRules(): void; toggleListPanel(): void; shouldShowShellChrome(): boolean; shouldShowStatusBar(): boolean; openAiWizard(): void; createRuleFromAI(aiResponse: AiRuleResponse): Promise; addPropertyRule(): void; selectNode(nodeId: string): void; onConditionNodeAdded(event: { type: RuleNodeType; parentId?: string; config?: RuleNodeConfig; }): void; onConditionNodeUpdated(event: { nodeId: string; updates: Partial; }): void; removeConditionNode(nodeId: string): void; duplicateNode(nodeId: string): void; onRuleUpdated(config: RuleNodeConfigExtended): void; removeNode(nodeId: string): void; isPropertyRule(node: RuleNode | null): boolean; openExportDialog(): void; importRules(): void; onFileSelected(event: Event): void; getRuleCount(): number; t(key: string, fallback: string): string; private setupSubscriptions; private loadInitialConditionIfNeeded; private validateAiResponse; private buildPropertyRuleLabel; private stripTargetPrefix; private normalizeRuleConfig; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class RuleCanvasComponent implements OnInit, OnDestroy { private readonly i18n?; conditionOnly: boolean; state: RuleBuilderState | null; fieldSchemas: Record; validationErrors: ValidationError$1[]; nodeSelected: EventEmitter; nodeAdded: EventEmitter<{ type: RuleNodeType; parentId?: string; config?: RuleNodeConfig; }>; nodeUpdated: EventEmitter<{ nodeId: string; updates: Partial; }>; nodeRemoved: EventEmitter; private destroy$; isDragOver: boolean; showAddMenu: boolean; addMenuOptions: { type: RuleNodeType; icon: string; label: string; color: string; }[]; get isEmpty(): boolean; get filteredAddMenuOptions(): typeof this.addMenuOptions; constructor(i18n?: PraxisI18nService | undefined); ngOnInit(): void; ngOnDestroy(): void; trackByNodeId(index: number, nodeId: string): string; getNode(nodeId: string): RuleNode | null; isNodeSelected(nodeId: string): boolean; isLastRootNode(nodeId: string): boolean; getNodeValidationErrors(nodeId: string): ValidationError$1[]; emptyStateIcon(): string; emptyStateTitle(): string; emptyStateCta(): string; conditionOnlyEmptyHint(): string; dropZoneLabel(): string; addMenuAriaLabel(): string; hasBlockingConditionErrors(): boolean; conditionValidationTitle(): string; conditionValidationDescription(): string; selectNode(nodeId: string): void; updateNode(event: { nodeId: string; updates: Partial; }): void; deleteNode(nodeId: string): void; addChildNode(parentId: string, childType: RuleNodeType): void; moveChildNode(event: any): void; onDragOver(event: DragEvent): void; onDragEnter(event: DragEvent): void; onDragLeave(event: DragEvent): void; onDrop(event: DragEvent): void; private createFieldConditionFromDrop; toggleAddMenu(): void; addFirstRule(): void; addRule(type: RuleNodeType): void; private isAllowedConditionType; private isDescendantOf; private t; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class RuleNodeComponent { private fb; node: RuleNode | null; nodes: Record; fieldSchemas: Record; level: number; isSelected: boolean; validationErrors: ValidationError$1[]; nodeClicked: EventEmitter; nodeUpdated: EventEmitter<{ nodeId: string; updates: Partial; }>; nodeDeleted: EventEmitter; childAdded: EventEmitter; childMoved: EventEmitter>; get hasValidationErrors(): boolean; get ownValidationErrors(): ValidationError$1[]; constructor(fb: FormBuilder); selectNode(): void; getNodeIcon(): string; getNodeLabel(): string; getNodeTypeClass(): string; getErrorIcon(severity: string): string; isFieldCondition(): boolean; isBooleanGroup(): boolean; isConditionalValidator(): boolean; isCollectionValidation(): boolean; getFieldConditionConfig(): FieldConditionConfig | null; getBooleanGroupConfig(): BooleanGroupConfig | null; getConditionalValidatorConfig(): ConditionalValidatorConfig | null; getCollectionValidationConfig(): CollectionValidatorConfig | null; getBooleanOperator(): string; hasChildren(): boolean; canHaveChildren(): boolean; getChildOptions(): { type: RuleNodeType; icon: string; label: string; }[]; trackByChildId(index: number, childId: string): string; getChildNode(childId: string): RuleNode | null; isChildSelected(childId: string): boolean; getChildValidationErrors(childId: string): ValidationError$1[]; isLastChild(childId: string): boolean; private isDescendantOf; editNode(): void; duplicateNode(): void; deleteNode(): void; addChild(type: RuleNodeType): void; showAddChildMenu(): void; onBooleanOperatorChanged(event: MatSelectChange): void; onFieldConditionChanged(config: FieldConditionConfig): void; onConditionalValidatorChanged(config: ConditionalValidatorConfig): void; onCollectionValidationChanged(config: CollectionValidatorConfig): void; onChildClicked(childId: string): void; onChildUpdated(event: { nodeId: string; updates: Partial; }): void; onChildDeleted(childId: string): void; onChildAdded(event: RuleNodeType): void; onChildMoved(event: CdkDragDrop): void; onChildDrop(event: CdkDragDrop): void; private formatNodeType; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class FieldConditionEditorComponent implements OnInit, OnChanges { private fb; config: FieldConditionConfig | null; fieldSchemas: Record; configChanged: EventEmitter; searchInput?: ElementRef; private destroy$; conditionForm: FormGroup; searchControl: FormControl; fieldCategories: { name: string; fields: FieldSchema[]; }[]; filteredFieldCategories: { name: string; fields: FieldSchema[]; }[]; contextVariables: any[]; customFunctions: any[]; selectedField: FieldSchema | null; selectedOperator: string | null; valueType: string; availableOperators: string[]; constructor(fb: FormBuilder); focusSearchInput(): void; clearSearch(event: Event): void; ngOnInit(): void; filterCategories(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private createForm; private setupFormSubscriptions; private setupFieldCategories; private loadInitialConfig; private emitConfigChange; private processValue; private normalizeFieldName; private resolveFieldSchema; private normalizeOperatorForForm; private normalizeValueTypeForVisualEditor; getFieldIcon(type: string): string; getOperatorLabel(operator: string): string; getValuePlaceholder(): string; getValueHint(): string; getBooleanLabel(): string; getCompatibleFields(): FieldSchema[]; getPreviewText(): string; private formatValueForPreview; isStringField(): boolean; isNumberField(): boolean; isBooleanField(): boolean; isDateField(): boolean; isEnumField(): boolean; isArrayOperator(): boolean; needsValue(): boolean; onFieldChanged(event: string | MatSelectChange): void; onOperatorChanged(event: MatSelectChange): void; onValueTypeChanged(event: MatSelectChange): void; hasValidationErrors(): boolean; getValidationErrors(): string[]; isValid(): boolean; hasFieldOptions(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges, OnDestroy { private fb; private readonly i18n?; config: ConditionalValidatorConfig | null; fieldSchemas: Record; configChanged: EventEmitter; private destroy$; validatorForm: FormGroup; fieldCategories: { name: string; fields: FieldSchema[]; }[]; advancedConditions: any[]; validatorType: string; targetField: string; conditionMode: string; validatorTypeLabels: Record; get showDisabledMessage(): boolean; constructor(fb: FormBuilder, i18n?: PraxisI18nService | undefined); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private createForm; private setupFormSubscriptions; private setupFieldCategories; private loadInitialConfig; private emitConfigChange; getFieldIcon(type: string): string; trackByIndex(index: number): number; getSimpleConditionConfig(): any; getFieldLabel(fieldName: string): string; private findFieldByNameFragment; getPreviewText(): string; getLogicPreview(): string; onValidatorTypeChanged(event: MatSelectChange): void; onTargetFieldChanged(event: MatSelectChange): void; onConditionModeChanged(event: MatButtonToggleChange): void; onSimpleConditionChanged(condition: any): void; updateAdvancedCondition(index: number, condition: any): void; addCondition(): void; removeCondition(index: number): void; hasValidationErrors(): boolean; getValidationErrors(): string[]; isValid(): boolean; private createEmptyCondition; private isConditionIncomplete; private mapRuleTypeToValidatorType; private mapValidatorTypeToRuleType; private refreshValidatorTypeLabels; t(key: string, fallback: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class CollectionValidatorEditorComponent implements OnInit, OnChanges { private fb; config: CollectionValidatorConfig | null; fieldSchemas: Record; configChanged: EventEmitter; private destroy$; collectionForm: FormGroup; collectionFieldCategories: { name: string; fields: FieldSchema[]; }[]; validatorType: string; targetCollection: string; get itemValidationRules(): FormArray; get uniqueByFields(): FormArray; get minItems(): number; get maxItems(): number; get debounceValidation(): boolean; constructor(fb: FormBuilder); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private createForm; private setupFormSubscriptions; private setupFieldCategories; private loadInitialConfig; private loadItemValidationRules; private loadUniqueByFields; private emitConfigChange; private getItemValidationRulesValue; private getUniqueByFieldsValue; getFieldIcon(type: string): string; getLengthErrorPlaceholder(): string; getPreviewText(): string; getForEachRulesPreview(): string; getUniqueFieldsPreview(): string; getLengthConstraintsPreview(): string; onValidatorTypeChanged(event: MatSelectChange): void; onTargetCollectionChanged(event: MatSelectChange): void; addItemValidationRule(): void; removeItemValidationRule(index: number): void; addUniqueField(): void; removeUniqueField(index: number): void; hasValidationErrors(): boolean; getValidationErrors(): string[]; isValid(): boolean; private mapRuleTypeToValidatorType; private mapValidatorTypeToRuleType; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class MetadataEditorComponent implements OnInit, OnChanges { private fb; selectedNode: RuleNode | null; metadataUpdated: EventEmitter; private destroy$; private lastSelectedNodeId; metadataForm: FormGroup; activeTabIndex: number; hasUnsavedChanges: boolean; availableTags: string[]; filteredTags: Observable; availableIcons: { value: string; label: string; }[]; get customProperties(): FormArray; get documentationLinks(): FormArray; get enableConditionalMetadata(): boolean; constructor(fb: FormBuilder); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private createForm; private setupFormSubscriptions; private setupTagAutocomplete; private filterTags; private loadMetadata; private resetForm; private loadCustomProperties; private loadDocumentationLinks; private emitMetadataUpdate; private cleanUiConfig; private getCustomPropertiesValue; private getDocumentationLinksValue; private inferType; private convertValueByType; private normalizePriority; getPriorityLabel(priority: string | null | undefined): string; getNodeIcon(): string; getNodeTitle(): string; getNodeSubtitle(): string; getNodeTypeIcon(type: string): string; getMetadataPreview(): string; addCustomProperty(): void; removeCustomProperty(index: number): void; addDocumentationLink(): void; removeDocumentationLink(index: number): void; private stringifyJsonEditorValue; private parseJsonEditorObject; private static readonly invalidJsonEditorValue; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class JsonViewerComponent implements OnInit, OnChanges { private snackBar; json: any; editable: boolean; jsonChanged: EventEmitter; formattedJson: string; originalJson: string; hasChanges: boolean; validationError: string; showLineNumbers: boolean; wordWrap: boolean; constructor(snackBar: MatSnackBar); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; private updateJsonContent; onJsonInput(event: any): void; getValidationStatusClass(): string; getValidationIcon(): string; getValidationText(): string; getEditorInfo(): string; getLineNumbers(): number[]; formatJson(): void; validateJson(): void; applyChanges(): void; discardChanges(): void; copyToClipboard(): void; downloadJson(): void; toggleLineNumbers(): void; toggleWordWrap(): void; private syncWordWrapWithMode; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface ExportDialogData { title?: string; allowMultipleFormats?: boolean; preselectedFormat?: string; showIntegrationTab?: boolean; showSharingTab?: boolean; onExport?: (options: ExportOptions) => void; } declare class ExportDialogComponent implements OnInit { dialogRef: MatDialogRef; data: ExportDialogData; private fb; private exportService; private snackBar; private cdr; exportForm: FormGroup; integrationForm: FormGroup; sharingForm: FormGroup; activeTabIndex: number; isProcessing: boolean; enableBatchExport: boolean; isTestingConnectivity: boolean; supportedFormats: ExportFormat[]; selectedFormat: ExportFormat | null; externalSystems: ExternalSystemConfig[]; selectedSystem: ExternalSystemConfig | null; exportResults: ExportResult[]; integrationResults: any[]; shareResult: any; constructor(dialogRef: MatDialogRef, data: ExportDialogData, fb: FormBuilder, exportService: ExportIntegrationService, snackBar: MatSnackBar, cdr: ChangeDetectorRef); ngOnInit(): void; private createExportForm; private createIntegrationForm; private createSharingForm; private loadSupportedFormats; private loadExternalSystems; selectFormat(formatId: string): void; isFormatSelected(formatId: string): boolean; onSystemChange(event: MatSelectChange): void; testConnectivity(): Promise; onExport(): Promise; onIntegrate(): Promise; onCreateShare(): Promise; canExport(): boolean; canIntegrate(): boolean; canShare(): boolean; downloadResult(result: ExportResult): void; previewResult(result: ExportResult): void; copyToClipboard(content: string): void; copyShareUrl(): void; formatFileSize(bytes: number): string; onCancel(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Placeholder Visual Rule Builder Component * * This is a placeholder component for the template integration example. * In a real implementation, this would be the main visual rule builder interface. */ declare class VisualRuleBuilderComponent { fieldSchemas: any[]; builderState: RuleBuilderState | null; stateChanged: EventEmitter; selectionChanged: EventEmitter; get nodeCount(): number; addSampleNode(): void; clearNodes(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Template display mode */ type TemplateDisplayMode = 'grid' | 'list' | 'compact'; /** * Template sort option */ interface TemplateSortOption { field: keyof RuleTemplate | keyof TemplateMetadata; direction: 'asc' | 'desc'; label: string; } declare class TemplateGalleryComponent implements OnInit, OnDestroy { private templateService; private fb; private dialog; private snackBar; availableFields: string[]; templateApplied: EventEmitter; templateCreated: EventEmitter; templateDeleted: EventEmitter; private destroy$; searchForm: FormGroup; displayMode: TemplateDisplayMode; showPreview: boolean; selectedTags: Set; popularTags: string[]; templates$: Observable; categories$: Observable; recentlyUsed$: Observable; stats$: Observable; filteredTemplates$: Observable; Array: ArrayConstructor; constructor(templateService: RuleTemplateService, fb: FormBuilder, dialog: MatDialog, snackBar: MatSnackBar); ngOnInit(): void; ngOnDestroy(): void; private createSearchForm; private createFilteredTemplatesStream; private setupFormSubscriptions; private loadPopularTags; private filterTemplates; private sortTemplates; trackByTemplateId(index: number, template: RuleTemplate): string; setDisplayMode(mode: TemplateDisplayMode): void; toggleTag(tag: string): void; hasActiveFilters(): boolean; clearFilter(field: string): void; clearAllFilters(): void; getCategoryName(categoryId: string): string; getRelativeDate(date?: Date | string): string; getNodeLabel(template: RuleTemplate, nodeId: string): string; showCreateTemplateDialog(selectedNodes?: RuleNode[]): void; importTemplate(): void; applyTemplate(template: RuleTemplate): void; previewTemplate(template: RuleTemplate): void; editTemplate(template: RuleTemplate): void; duplicateTemplate(template: RuleTemplate): void; exportTemplate(template: RuleTemplate): void; deleteTemplate(template: RuleTemplate): void; private downloadFile; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface TemplateEditorDialogData { mode: 'create' | 'edit'; template?: RuleTemplate; selectedNodes?: RuleNode[]; availableCategories?: string[]; } interface TemplateEditorResult { action: 'save' | 'cancel'; template?: RuleTemplate; } declare class TemplateEditorDialogComponent implements OnInit { private dialogRef; data: TemplateEditorDialogData; private fb; private templateService; private snackBar; basicInfoForm: FormGroup; rulesForm: FormGroup; advancedForm: FormGroup; tags: string[]; requiredFields: string[]; separatorKeysCodes: number[]; availableCategories: { id: string; name: string; icon: string; }[]; availableIcons: { value: string; label: string; }[]; previewNodes: RuleNode[]; detectedVariables: string[]; get nodeCount(): number; constructor(dialogRef: MatDialogRef, data: TemplateEditorDialogData, fb: FormBuilder, templateService: RuleTemplateService, snackBar: MatSnackBar); ngOnInit(): void; private createBasicInfoForm; private createRulesForm; private createAdvancedForm; private loadTemplateData; private setupPreviewNodes; private detectTemplateVariables; addTag(event: MatChipInputEvent): void; removeTag(tag: string): void; addRequiredField(event: MatChipInputEvent): void; removeRequiredField(field: string): void; isRootNode(node: RuleNode): boolean; getNodeIcon(node: RuleNode): string; canSave(): boolean; canPreview(): boolean; saveTemplate(): void; previewTemplate(): void; deleteTemplate(): void; cancel(): void; private calculateComplexity; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface TemplatePreviewDialogData { template: RuleTemplate; } declare class TemplatePreviewDialogComponent { private dialogRef; data: TemplatePreviewDialogData; constructor(dialogRef: MatDialogRef, data: TemplatePreviewDialogData); getRootNode(nodeId: string): RuleNode | undefined; getNodeHierarchy(rootNodeId: string): { node: RuleNode; level: number; }[]; getNodeIcon(node?: RuleNode): string; getNodeDescription(node?: RuleNode): string; formatConfig(config: any): string; formatDate(date?: Date | string): string; applyTemplate(): void; exportTemplate(): void; cancel(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type RuleListItem = string | RuleNode; type RuleCardStatus = 'draft' | 'incomplete' | 'error' | 'valid'; type StatusFilter = 'all' | RuleCardStatus; declare class RuleListComponent { private readonly i18n?; rules: RuleListItem[]; selectedRuleId: string; nodeMap: Record; validationErrors: ValidationError$1[]; ruleSelected: EventEmitter; ruleDeleted: EventEmitter; ruleDuplicated: EventEmitter; ruleAdded: EventEmitter; aiRequested: EventEmitter; searchTerm: string; statusFilter: StatusFilter; constructor(i18n?: PraxisI18nService | undefined); get filteredRules(): RuleListItem[]; trackById: (_index: number, item: RuleListItem) => string; isSelected(item: RuleListItem): boolean; getLabel(item: RuleListItem): string; getTooltip(item: RuleListItem): string; getStatus(item: RuleListItem): RuleCardStatus; getStatusLabel(item: RuleListItem): string; countRulesByStatus(status: RuleCardStatus): number; getConditionPill(item: RuleListItem): string; getConditionDetail(item: RuleListItem): string; getPrimaryTargetLabel(item: RuleListItem): string; getMainTargetName(item: RuleListItem): string; getPrimaryEffectLabel(item: RuleListItem): string; getEffectDetail(item: RuleListItem): string; getSummary(item: RuleListItem): string; private hasConfiguredCondition; getRelativeTime(item: RuleListItem): string | null; getTargetPreview(item: RuleListItem): string[]; t(key: string, fallback: string): string; onSelect(item: RuleListItem): void; onDelete(item: RuleListItem, event: MouseEvent): void; onDuplicate(item: RuleListItem, event: MouseEvent): void; onKeySelect(item: RuleListItem, event: Event): void; onAddRule(): void; onAiRequest(): void; private getNode; private getItemId; private getTargetTypeLabel; private describeProperty; private stripTargetPrefix; private parseTimestamp; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { ArrayFieldAnalyzer, CollectionValidatorEditorComponent, ConditionalValidatorEditorComponent, ConditionalValidatorType, ConfigurationError, ContextError, ContextManagementService, ConversionError, ErrorCategory, ErrorHandler, ErrorSeverity, ExportDialogComponent, ExportIntegrationService, ExpressionError, FIELD_TYPE_OPERATORS, FieldConditionEditorComponent, FieldSchemaService, FieldType, InternalError, JsonViewerComponent, MetadataEditorComponent, OPERATOR_LABELS, PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST, PRAXIS_VISUAL_BUILDER_COMPONENT_METADATA, PraxisVisualBuilder, RegistryError, RuleBuilderService, RuleCanvasComponent, RuleEditorComponent, RuleListComponent, RuleNodeComponent, RuleNodeRegistryService, RuleNodeType, RuleTemplateService, RuleValidationService, TemplateEditorDialogComponent, TemplateGalleryComponent, TemplatePreviewDialogComponent, ValidationError as VBValidationError, ValidationCategory, ValidationSeverity, VisualBuilderError, VisualRuleBuilderComponent, WebhookIntegrationService, createError, getArrayItemFieldPaths, globalErrorHandler, isArrayFieldSchema, providePraxisVisualBuilderMetadata }; export type { ArrayCollectionValidationRule, ArrayFieldSchema, ArrayValidationContext, ArrayValidationError, BooleanGroupConfig, CardinalityConfig, CircularReference, CleanupResult, CollectionValidationConfig, CollectionValidatorConfig, ConditionalValidatorConfig, ConditionalValidatorPreview, ContextEntry, ContextScope, ContextValue, ContextVariable, ContextualConfig, ContextualTemplateConfig, CustomConfig, CustomFunction, DocumentationLink, EnhancedFieldSchema, ErrorInfo, ErrorStatistics, ExportDialogData, ExportFormat, ExportOptions, ExportResult, ExpressionConfig, ExternalSystemConfig, FieldConditionConfig, FieldFormat, FieldOperandTransform, FieldOption, FieldSchema, FieldSchemaContext, FieldToFieldConfig, FieldUIConfig, FunctionCallConfig, FunctionParameter, ImportOptions, IntegrationEndpoint, IntegrationResult, MemoryStats, OptionalFieldConfig, PropertyRuleConfig, RegistryIntegrityResult, RegistryValidationResult, RuleBuilderConfig, RuleBuilderSnapshot, RuleBuilderState, RuleContextProvider, RuleFunctionRegistry, RuleNode, RuleNodeConfig, RuleNodeTree, RuleNodeTypeString, RuleTemplate, RuleValidationResult, SpecificationMetadata, TemplateApplicationResult, TemplateCategory, TemplateDisplayMode, TemplateEditorDialogData, TemplateEditorResult, TemplateMetadata, TemplatePreviewDialogData, TemplateSearchCriteria, TemplateSortOption, TemplateStats, TemplateValidationResult, ValidComparisonOperator, ValidationConfig, ValidationContext, ValidationError$1 as ValidationError, ValidationIssue, ValidationResult, ValidationRule, ValueType, VisualBuilderMode, WebhookConfig, WebhookDelivery, WebhookEvent, WebhookStats };