import { VegaSlimmer } from '../../vega-slimmer/vega-slimmer-core';
import { FormFieldValidationRule } from '../validator/rules/form-field-validation-rule';
import { FormFieldController, FormFieldDefaultValueType, FormFieldElement } from '../validator/form-field-controller';
import { Nullable } from '../../types/general';
import { FieldErrorControllerSlimmer } from './field-error-controller-silmmer';
import { FormFieldValidInvokeSlimmer } from './form-field-valid-invoke-slimmer';
import { MutationObserverSlimmer } from './mutation-observer/mutation-observer-slimmer';
import { InternalFormFieldValidationRule } from '../validator/rules/internal-form-field-validation-rule.abstract';
import { FormFieldStateControllerSlimmer } from './form-field-state-controller-slimmer';
export declare type FormFieldOptionForSlimmer<T> = {
  propertyRules: PropertyRuleTypeForSlimmer<T>[];
  validationRulesName?: string;
  defaultValue: FormFieldDefaultValueType<T> | null;
  attributeGetter: (propertyName: string) => unknown;
  inputContainerGetter: () => Nullable<HTMLElement>;
  touchableAreaGetter: () => Nullable<HTMLElement>[];
};
declare type RuleFactory<T> = (propValue: unknown, ...dependence: unknown[]) => InternalFormFieldValidationRule<T> | null;
export declare type PropertyRuleTypeForSlimmer<T> = {
  propertyName: string;
  ruleFactory: RuleFactory<T>;
  dependence?: string | string[];
};
/**
 * The `FormFieldControllerSlimmer` class is a TypeScript class that extends `VegaSlimmer` and provides functionality for managing form field components.
 * TODO:
 * 1.Apply formFieldController to slimmer
 * 2.There should be a decorator or other type to access the component interface for the `attributeGetter`
 */
export declare class FormFieldControllerSlimmer<T> extends VegaSlimmer {
  host: FormFieldElement<T>;
  validationRules: FormFieldValidationRule<unknown>[];
  disabled: boolean;
  autoValidation: boolean;
  isValid: Nullable<boolean>;
  fieldErrorSlimmer: FieldErrorControllerSlimmer;
  formFieldValidInvokeSlimmer: FormFieldValidInvokeSlimmer;
  mutationObserverSlimmer: MutationObserverSlimmer;
  formFormStateController: FormFieldStateControllerSlimmer<T>;
  options: FormFieldOptionForSlimmer<T>;
  validator: Nullable<FormFieldController<T>>;
  /**
   * listen the attributes change when connectedCallback method call
   */
  connectedCallback(): void;
  /**
   * It destroys the validator and disconnects the observer
   */
  disconnectedCallback(): void;
  /**
   * listen the attributes change when componentDidLoad method call
   */
  componentDidLoad(): void;
  /**
   * The constructor function initializes a FormFieldOptionForSlimmer object with the provided options.
   *
   * @param {FormFieldOptionForSlimmer<unknown>} options - The `options` parameter is an object of type `FormFieldOptionForSlimmer<T>`. It is used to
   * provide additional configuration options for the form field. The specific properties and their
   * types within the `FormFieldOptionForSlimmer` object would depend on the implementation of the `FormField` class.
   */
  constructor(options: FormFieldOptionForSlimmer<T>);
  /**
   * "If the element exists and has a data-vega-form attribute, return true, otherwise return false."
   * The function isValidFormField() is used to determine if an element is a form field
   *
   * @param {HTMLElement} element - The element to check.
   * @returns {boolean} A function that takes an element and returns a boolean.
   */
  static isValidFormField(element: HTMLElement): element is FormFieldElement<unknown>;
  /**
   * watch the prop validationRules and call the valid method
   * some components has not a prop validationRules
   *
   * @param {FormFieldValidationRule<unknown>[]} newRules the component property validationRules new value
   * @param {FormFieldValidationRule<unknown>[]} oldRules the component property validationRules old value
   */
  watchValidationRulesByFormControllerSlimmer(newRules: FormFieldValidationRule<unknown>[], oldRules: FormFieldValidationRule<unknown>[]): void;
  /**
   * inject form file help when componentWillLoad method call
   */
  setInjectFormFieldHelper(): void;
  /**
   * It sets the additional rules on the validator
   */
  private setAdditionalRules;
  /**
   * It creates a new rule for each property rule map option, and then sets the default rules on the
   * target's validator
   */
  private setDefaultRules;
  /**
   * It takes the property rules from the option, maps them to a function that returns a validation rule,
   * and then filters out any falsy values
   *
   * @typedef T generic type
   * @returns {FormFieldValidationRule<T>[]} An array of validation rules.
   */
  private getPropertyRules;
  /**
   * "If the target is not disabled, then call the validate function on the target's validator
   * property."
   *
   * The validator property is a property that we'll add to the target element. It's a property that
   * will hold a reference to the validator object that we'll create
   */
  private internalValidate;
  private setMutationObserverSlimmer;
  private mutationObserverCallBack;
}
export {};
