import type { FormAssociatedConstructor } from '../../../Types/Constructor';
import type { IControlValidityResult } from '../Interfaces/IControlValidityResult';
import type { IControlValidator } from './Interfaces/IControlValidator';
/**
 * A class that computes and caches `ValidityStateFlags` for a component with a given `State` interface.
 *
 * Cached performance before computing validity is important since constraint validation must be
 * checked frequently and synchronously when properties change.
 *
 * @template TState The expected interface of properties relevant to constraint  validation.
 */
export declare abstract class ControlValidatorBase<TControl extends TState & InstanceType<FormAssociatedConstructor> & IControlValidityResult, TState> implements IControlValidator<TControl, TState> {
    private readonly _control;
    private readonly _getCurrentState;
    private _prevState?;
    private _currentValidity;
    /**
     * Constructs a new instance of the `Validator` class.
     *
     * @protected
     * @param control - The control that the validator is attached to.
     * @param stateFn - A callback that returns the current state of constraint validation-related properties.
     */
    protected constructor(control: TControl, stateFn: () => TState);
    /**
     * Returns the control that the validator is attached to.
     *
     * @public
     * @readonly
     */
    get control(): TControl;
    /**
     * @public
     */
    getValidity(): IControlValidityResult;
    /**
     * Computes the `ValidityStateFlags` and validation message for a given set
     * of constraint validation properties.
     *
     * Implementations can use platform elements like `<input>` and `<select>` to
     * sync state and compute validation along with i18n'd messages. This function
     * may be expensive, and is only called when state changes.
     *
     * @protected
     * @abstract
     * @param state - The new state of constraint validation properties.
     * @return An object containing a `validity` property with `ValidityStateFlags` and a `validationMessage` property.
     */
    protected abstract computeValidity(state: TState): IControlValidityResult;
    /**
     * Checks if two states are equal. This is used to check against cached state
     * to see if validity needs to be re-computed.
     *
     * @protected
     * @abstract
     * @param prev - The previous state.
     * @param next - The next state.
     * @return True if the states are equal, or false if not.
     */
    protected abstract equals(prev: TState, next: TState): boolean;
    /**
     * Creates a copy of a state. This is used to cache state and check if it
     * changes.
     *
     * Note: do NOT spread the `...state` to copy it. The actual state object is
     * a web component, and trying to spread its getter/setter properties won't
     * work.
     *
     * @protected
     * @abstract
     * @param state - The state to copy.
     * @return A copy of the state.
     */
    protected abstract copy(state: TState): TState;
}
//# sourceMappingURL=ControlValidatorBase.d.ts.map