import { OtConstraint } from '@opentext/forms-common'; import { Config, OcpdStringLocalizationHelper } from '../ocpd-common-components'; import { OcpdFormClientAPIService } from './ocpd-form-client-api-service'; import { OcpdItemManagerHelper } from './ocpd-item-manager-helper'; import { Constraint, ConstraintComponentModel } from './ocpd-constraints-config'; import { ConstraintsEditor } from '../models/localization-types'; export declare class OcpdConstraintsManager { private static _instance; private readonly FALLBACK_DATA_TYPE; 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; _defaultModelIDs: Record; _localeDataConstraintsEditor: ConstraintsEditor; constructor(_ocpdItemManagerHelper: OcpdItemManagerHelper); userInterfaceLocaleChanged(locale?: string): Promise; /** * Initializes the model ID mappings for root and default component models */ initializeModelIdMappings(): void; /** * 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 */ getNewConstraintSkeleton(propertyName: string, config: Config): Constraint; /** * Gets available component models for a specific row index * @param {string} rowIndex - The row index to get available models for * @param {Config} config * @returns {ConstraintComponentModel[]} An array of available component models for the given row index */ getAvailableComponentModels(rowIndex: string, config: Config): ConstraintComponentModel[]; /** * 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 {Config} config */ loadPropertyComponentModel(config: Config): void; /** * Deletes the component model for a specific property * @param {Config} config * @param {string} [dataType] - Optional data type to avoid having to resolve it again if already known */ deletePropertyComponentModel(config: Config, dataType?: string): void; /** * Updates the component model and constraint references when a property's name is changed * @param {string} oldPropertyName - The old name of the property before the change * @param {string} newPropertyName - The new name of the property after the change * @param {Config} config */ updatePropertyNameInConstraints(oldPropertyName: string, newPropertyName: string, config: Config): void; updateTypeInComponentModel(oldType: string, newType: string, config: Config): void; /** * Converts saved constraint components into component rows for a constraint * @param {Config}config * @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(config: Config, constraint: Constraint, savedConstraint: OtConstraint): void; /** * Determines the component ID for a follow-up component based on the saved constraint's component value and type */ updateConstraints(config: Config, oldComponentValue: any, newComponentValue: any, workingModel: any, rowIndex: string, schemaItemId: string, hasErrors?: boolean): Promise; private getRootModelIdByDataType; private getDefaultModelIdByDataType; private createComponentRow; private createFollowUpComponentRow; private getComponentOutputDataType; private getPreviousConcreteDataType; private getModelsFromRoot; private isModelCompatibleWithPrevious; private isValidAsFirstComponent; private isCompatibleWithArrayType; private clearOldModels; private loadDefaultComponentModel; private loadDefaultComponentModelsForArrayType; private loadRootComponentModel; private loadComponentModel; private getSupportedModelsForDataType; private getAllPropertyModelsByDataType; private findPropertyComponentModel; private getSchemaProperty; private getDataTypeFromSchema; private isArrayTypeProperty; private getPropertyIdFromComponentValue; private createModelsFromConfig; private createPropertyComponent; private removeIncompatibleFollowUpComponents; private shouldRemoveFollowUpComponents; private isEmptyConstantComponent; }