@funidata/ngx-fudis
Version:
Funidata Design System.
58 lines (57 loc) • 1.93 kB
TypeScript
import { AbstractControl, FormGroup } from '@angular/forms';
/**
* All of these functions are used to check if component's control has different validators. The
* return value of these functions is usually assigned for internal variable to sort out wanted
* logic.
*/
export declare const FudisValidatorUtilities: {
required: typeof required;
oneRequiredOrMin: typeof oneRequiredOrMin;
maxLength: typeof maxLength;
minLength: typeof minLength;
max: typeof max;
min: typeof min;
minDate: typeof minDate;
maxDate: typeof maxDate;
};
/**
* @param control
* @returns If provided FormControl has 'required' validator
*/
declare function required(control: AbstractControl): boolean;
/**
* @param group FormGroup
* @returns If provided FormGroup has oneRequired or min validator
*/
declare function oneRequiredOrMin(group: FormGroup): boolean;
/**
* @param control
* @returns If provided FormControl has max length value binded to its validators
*/
declare function maxLength(control: AbstractControl): number | null;
/**
* @param control
* @returns If provided FormControl has min length value binded to its validators
*/
declare function minLength(control: AbstractControl): number | null;
/**
* @param control
* @returns If provided FormControl has max value binded to its validators
*/
declare function max(control: AbstractControl): number | null;
/**
* @param control
* @returns If provided FormControl has min value binded to its validators
*/
declare function min(control: AbstractControl): number | null;
/**
* @param control
* @returns If provided FormControl has datepickerMin value binded to its validators
*/
declare function minDate(control: AbstractControl): Date | undefined;
/**
* @param control
* @returns If provided FormControl has datepickerMax value binded to its validators
*/
declare function maxDate(control: AbstractControl): Date | undefined;
export {};