import { UntypedFormControl, UntypedFormGroup } from "@angular/forms"; export type StarkFormControlState = "untouched" | "touched" | "pristine" | "dirty"; export type StarkFormState = "untouched" | "pristine" | "submitted" | "dirty"; /** * Util class used to perform common operations on Angular {@link https://v12.angular.io/api/forms/FormGroup|FormGroups} and * {@link https://v12.angular.io/api/forms/FormControl|FormControls} */ export declare class StarkFormUtil { /** * Set all the fields of the given {@link https://v12.angular.io/api/forms/FormGroup|FormGroup} to the specified state(s) * @param formGroup - Angular form group object * @param statesToBeSet - States to be set to the different controls in the form */ static setFormChildControlsState(formGroup: UntypedFormGroup, statesToBeSet: StarkFormControlState[]): void; /** * Set the given {@link https://v12.angular.io/api/forms/FormControl|FormControl} to the specified state(s) * @param formControl - Angular form control object contained in an Angular form group * @param statesToBeSet - States to be set to the form control */ static setFormControlState(formControl: UntypedFormControl, statesToBeSet: StarkFormControlState[]): void; /** * Set the given {@link https://v12.angular.io/api/forms/FormGroup|FormGroup} to the specified state(s). * Possible states: `untouched`, `pristine`, `dirty`, `submitted` * @param formGroup - Angular form group object * @param statesToBeSet - States to be set to the form */ static setFormGroupState(formGroup: UntypedFormGroup, statesToBeSet: StarkFormState[]): void; /** * Check whether the given {@link https://v12.angular.io/api/forms/FormGroup|FormGroup} is valid (all fields are valid). * If valid, all the form fields will be set to their `pristine` state, otherwise to their `touched` state * (calling `setFormControlState` function). * @param formGroup - Angular form group object */ static isFormGroupValid(formGroup: UntypedFormGroup): boolean; /** * {@link https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards|TypeGuard} to check that the given object * is an actual instance of an Angular {@link https://v12.angular.io/api/forms/FormGroup|FormGroup}. * @param formGroup - Angular form object */ static isFormGroup(formGroup: any): formGroup is UntypedFormGroup; /** * {@link https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards|TypeGuard} to check that the given object * is an actual instance of an Angular {@link https://v12.angular.io/api/forms/FormControl|FormControl}. * @param formControl - Angular form field object */ static isFormControl(formControl: any): formControl is UntypedFormControl; }