import { OtConstraint } from '@opentext/forms-common';
import { OcpdStringLocalizationHelper } from '../ocpd-common-components';
import { OcpdFormClientAPIService } from './ocpd-form-client-api-service';
import { OcpdItemManagerHelper } from './ocpd-item-manager-helper';
import { Constraint, ComponentRow, ConstraintComponentModel } from './ocpd-constraints-config';
export declare class OcpdConstraintsManager {
    private static _instance;
    readonly COMPONENT_ROOT_MODEL_SCHEMA_IDS_PREFIX = "exp-root";
    readonly COMPONENT_DEFAULT_MODELS_PREFIX = "exp-default";
    readonly COMPONENT_SCHEMA_ID = "https://www.opentext.com/ocp/devx/ui/2.0.0/Component";
    readonly COMPONENT_ROOT_MODEL_SCHEMA_ID = "https://www.opentext.com/ocp/devx/ui/2.0.0/ComponentRootModel";
    _ocpdItemManagerHelper: OcpdItemManagerHelper;
    _ocpdFormClientAPIService: OcpdFormClientAPIService;
    _ocpdStringLocalizationHelper: OcpdStringLocalizationHelper;
    _rootModelIDs: Record<string, string>;
    _defaultModelIDs: Record<string, string>;
    constructor(_ocpdItemManagerHelper: OcpdItemManagerHelper);
    /**
     * Initializes the model ID mappings for root and default component models
     * Sets up the mapping between data types and their corresponding model IDs
     */
    initializeModelIdMappings(): void;
    /**
     * Gets the root model ID for a specific data type
     * @param dataType - The data type to get the root model ID for
     * @returns The unique ID for the root model of this data type
     */
    private getRootModelIdByDataType;
    /**
     * Gets the default model ID for a specific data type
     * @param dataType - The data type to get the default model ID for
     * @returns The unique ID for the default model of this data type
     */
    private getDefaultModelIdByDataType;
    /**
     * Initializes component models for all supported data types
     */
    initializeComponentModels(): void;
    /**
     * Builds a new constraint object for a given property
     * @param propertyName - The name of the property to build the constraint for
     * @returns {Constraint} The constructed Constraint object
     */
    buildConstraintForProperty(propertyName: string): Constraint;
    /**
     * Builds a component row for a constraint
     * @param dataType - The data type of the component
     * @param allowUserInput - Whether user input is allowed for this component
     * @param isRepeating - Whether this component is repeating
     * @param component - The component or component value
     * @returns {ComponentRow} The constructed ComponentRow object
     */
    private buildComponentRow;
    /**
     * Builds a follow-up component row based on the previous row ID
     * @param previousRowId - The ID of the previous component row
     * @returns {ComponentRow} The constructed follow-up ComponentRow object
     */
    buildFollowUpComponentRow(previousRowId: string): ComponentRow;
    /**
     * Determines the data type for a follow-up component based on the previous component
     * @param constraint - The constraint containing the components
     * @param componentRowId - The row ID of the component Row
     * @returns {string} The determined data type for the follow-up component
     */
    private determineFollowUpComponentDataType;
    private findConstraintByRowId;
    private findComponentRowByRowId;
    private findComponentIndexByRowId;
    /**
     * Resolves the data type for the first component in a constraint
     * @param constraint - The constraint to analyze
     * @returns The appropriate data type for the first component
     */
    private resolveFirstComponentType;
    /**
     * Extracts the item type from an array property
     * @param propertyName - The name of the array property
     * @returns The type of items in the array, or undefined if not an array
     */
    private extractArrayItemType;
    /**
     * Finds the data type of the last non-array component before the current index
     * @param constraint - The constraint to search in
     * @param currentIndex - The current position to search backwards from
     * @returns The data type of the previous non-array component, or null if none found
     */
    private findPreviousNonArrayDataType;
    /**
     * Gets the complete schema for validation and type checking
     * @returns The current schema object
     */
    private getSchema;
    /**
     * Retrieves a property definition from the schema based on the property path
     * @param propertyPath - The path to the property in the schema
     * @returns The property definition object, or undefined if not found
     */
    private getPropertyFromSchema;
    /**
     * Extracts display texts for an array of component rows
     * @param componentRows - The array of component rows to extract texts from
     * @returns An array of display texts for the given component rows
     */
    extractComponentDisplayTexts(componentRows: ComponentRow[]): any[];
    /**
     * Gets the display text for a single component row
     * @param componentRow - The component row to get the text for
     * @returns The display text for the given component row
     */
    private getComponentText;
    /**
     * Gets available component models for a specific row index
     * @param rowIndex - The row index to get available models for
     * @returns An array of available component models for the given row index
     */
    getAvailableComponentModels(rowIndex: string): ConstraintComponentModel[];
    /**
     * Determines if a model is compatible with the previously selected model
     * Checks compatibility rules including preventing duplicate selections and
     * ensuring component type compatibility based on unsupported combinations
     * @param previousModel - The previously selected model
     * @param currentModel - The current model to check for compatibility
     * @param constraints - The constraint context for additional validation
     * @returns True if the model is compatible and can be selected
     */
    private isModelCompatibleWithPrevious;
    /**
     * Finds the model ID of the previously selected component in a constraint
     * @param rowIndex - The row index to find the previous model for
     * @param constraints - The constraint containing the components
     * @returns The model ID of the previously selected component, or an empty string if none found
     */
    private findPreviousSelectedModelId;
    /**
     * Retrieves the data type for a given property path from the schema
     * @param propertyPath - The path to the property in the schema
     * @returns The data type string (e.g., 'string', 'number', 'array', etc.)
     */
    private getDataTypeForProperty;
    /**
     * Clears old components models from the item manager
     */
    private clearOldModels;
    /**
     * Loads a default empty component model for a specific data type
     * @param dataType - The data type for the component model
     * @param modelId - The unique ID for the model
     * @returns The created default component model
     */
    private loadDefaultComponentModel;
    /**
     * Loads the root component model for a specific data type
     * Contains references to all supported component models for that data type
     * @param dataType - The data type for the root component model
     */
    private loadRootComponentModel;
    /**
     * Loads a component model into the item manager
     * @param component - The constraint component to load
     * @param modelId - The unique ID for the model
     * @returns The created component model
     */
    private loadComponentModel;
    /**
     * Gets all supported component models for a specific data type
     * @param dataType - The data type to get supported models for
     * @returns Array of supported component models
     */
    private getSupportedModelsForDataType;
    /**
     * Gets models from a constraint configuration for a specific data type
     * @param dataType - The data type to get models for
     * @returns Array of condition models
     */
    private getConditionModelsByDataType;
    /**
     * Gets function models for a specific data type
     * @param dataType - The data type to get function models for
     * @returns Array of function models
     */
    private getFunctionModelsByDataType;
    /**
     * Gets field-based models for a specific data type
     * @param dataType - The data type to get field models for
     * @returns Array of field-based models
     */
    private getPropertyModelsByDataType;
    /**
     * Gets system value models for a specific data type
     * @param dataType - The data type for which system value models are retrieved
     * @returns Array of system value models for the specified data type
     */
    private getSystemValuesModelsByDataType;
    /**
     * Loads a field model for the specified property name
     * Creates and registers a field property component model based on the property's schema definition
     * @param propertyName - The name of the property to load the field model for
     */
    loadPropertyComponentModel(propertyName: string): void;
    /**
     * Deletes the component model for a specific property
     * @param propertyName - The name of the property to delete the component model for
     */
    deletePropertyComponentModel(propertyName: string): void;
    /**
     * Finds the component model for a specific property
     * @param propertyName - The name of the property to find the component model for
     * @returns The component model if found, otherwise undefined
     */
    private findPropertyComponentModel;
    /**
     * Converts saved constraint components into component rows for a constraint
     * @param propertyName - The name of the property for which the components are being converted
     * @param constraint - The constraint object to which the component rows will be added
     * @param savedConstraint - The saved constraint containing the components to be converted
     */
    convertSavedComponents(propertyName: string, constraint: Constraint, savedConstraint: OtConstraint): void;
    /**
     * Converts configuration objects to component models
     * @param config - The configuration object containing component definitions
     * @returns Array of component models created from the configuration
     */
    private getModelsFromConfigForDataType;
}
