import { OnChanges, SimpleChanges } from "@angular/core"; import { AbstractControl, ValidationErrors, Validator, ValidatorFn } from "@angular/forms"; import * as i0 from "@angular/core"; declare abstract class AbstractValidatorDirective implements Validator, OnChanges { private _validator; private _onChange; /** * A flag that tracks whether this validator is enabled. * * Marking it `internal` (vs `protected`), so that this flag can be used in host bindings of * directive classes that extend this base class. * @internal */ _enabled?: boolean; /** * Name of an input that matches directive selector attribute (e.g. `minlength` for * `MinLengthDirective`). An input with a given name might contain configuration information (like * `minlength='10'`) or a flag that indicates whether validator should be enabled (like * `[required]='false'`). * * @internal */ abstract inputName: string; /** * Creates an instance of a validator (specific to a directive that extends this base class). * * @internal */ abstract createValidator(input: unknown): ValidatorFn; /** * Performs the necessary input normalization based on a specific logic of a Directive. * For example, the function might be used to convert string-based representation of the * `minlength` input to an integer value that can later be used in the `Validators.minLength` * validator. * * @internal */ abstract normalizeInput(input: unknown): unknown; /** @nodoc */ ngOnChanges(changes: SimpleChanges): void; /** @nodoc */ validate(control: AbstractControl): ValidationErrors | null; /** @nodoc */ registerOnValidatorChange(fn: () => void): void; /** * @description * Determines whether this validator should be active or not based on an input. * Base class implementation checks whether an input is defined (if the value is different from * `null` and `undefined`). Validator classes that extend this base class can override this * function with the logic specific to a particular validator directive. */ enabled(input: unknown): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export declare const RANGE_VALIDATOR: any; export declare class RangeValidator extends AbstractValidatorDirective { range: [number, number] | null; /** @internal */ inputName: string; /** @internal */ normalizeInput: (input: string | number) => number; /** @internal */ createValidator: (range: [number]) => ValidatorFn; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * @description * Provider which adds `MatchValidator` to the `NG_VALIDATORS` multi-provider list. */ export declare const MATCH_VALIDATOR: any; export declare class MatchValidator extends AbstractValidatorDirective { match: string; /** @internal */ inputName: string; /** @internal */ normalizeInput: (input: string) => string; /** @internal */ createValidator: (input: string) => ValidatorFn; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export {};