import { FormControl, FormGroup, ValidatorFn } from '@angular/forms'; import { TerraFormFieldInterface } from '../model/terra-form-field.interface'; /** * @description This class provides functionality which may be used in relation to the and reactive forms. */ export declare class TerraFormHelper { /** * @description Generates a list of validators based on the given formField's options that may be attached to a FormControl instance. * @param formField */ static generateValidators(formField: TerraFormFieldInterface): Array; /** * @description Parses a set of _formFields (TerraFormFieldInterface) and creates a representative FormGroup instance. * @description Generates a list of validators based on the given formField's options that may be attached to a FormArray instance. * @param formField */ static generateFormArrayValidators(formField: TerraFormFieldInterface): Array; /** * This FormGroup instance may be initialized by passing a set of values. * @param formFields * @param values */ static parseReactiveForm(formFields: { [key: string]: TerraFormFieldInterface; }, values?: {}): FormGroup; /** * @description Recursively scans the given form for FormArray instances and adapts the amount of controls of those FormArrays to the * amount of values that will be patched to them. * @param form * @param formFields * @param values */ static updateFormArrays(form: FormGroup, formFields: { [key: string]: TerraFormFieldInterface; }, values: any): any; /** * @description Creates a new FormControl or FormGroup instance depending on whether the given formField has children or not. * The given value is used to initialize the control's value. * @param value * @param formField */ static createNewControl(value: any, formField: TerraFormFieldInterface): FormControl | FormGroup; /** * @description sanitise a string containing css-classes. Check whether it contains only valid bootstrap grid classes. * @param width */ static sanitiseWidth(width: string): string; /** * @description Fits the given list of controls into the range of the given formField by adding/removing controls. * @param formField * @param controls */ private static _fitControlsToRange; }