import { FormGroup, FormControl, FormArray, FormBuilder, AbstractControl } from '@angular/forms'; import { DescriptorFormControl } from '../descriptor'; import * as i0 from "@angular/core"; /** * Service that provides methods for creating reactive form. */ export declare class FormService { private formBuilder; constructor(formBuilder: FormBuilder); /** * Method for creating a group of controls as a {@link FormGroup} by passing * an array of {@link DescriptorFormControl}. * * @param descriptors the list of controls */ createFormGroup(descriptors?: DescriptorFormControl[]): FormGroup; /** * Method for creating a control. * * If the control type is 'ARRAY_CONTROLS', then we create * a {@link FormArray} otherwise {@link FormControl} is created. * * @param descriptor */ createFormControl(descriptor: DescriptorFormControl): FormControl | FormArray; /** * Helper method for creating a {@link FormControl}. * * @param descriptor */ private createControl; /** * Helper method for creating a {@link FormControl} with value. * * @param descriptor * @param value * @returns */ private createControlWithValue; /** * Helper method for checking if control is readonly * @param descriptor */ private isDisabled; /** * Helper method for creating autocomplete with value * @param descriptor * @returns */ private createControlWithAutocomplete; /** * Helper method for creating a {@link FormArray}. * * @param descriptor */ private createControlWithChildren; private createGroupsFromChildrenWithValues; private createGroupsFromChildrenWithoutValue; private createControlWithMatrix; private createControlWithNvp; private createControlWithChips; getFormArray(form: FormGroup, fieldName: string): FormArray; private addMatrix; private addEntries; private addChipEntries; /** * Helper method for generating the list of validations per control * * @param ctrl */ private createValidation; private validationToMap; getComponent(control: AbstractControl, controlName: string): FormControl; getComponents(control: AbstractControl, controlName: string): FormArray; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }