import { AbstractControl, FormGroup, ValidatorFn } from "@angular/forms"; import { AbstractFormBaseComponent } from "@hmcts/opal-frontend-common/components/abstract/abstract-form-base"; import * as i0 from "@angular/core"; export declare abstract class AbstractNestedFormBaseComponent extends AbstractFormBaseComponent { /** * Installs all controls from a **detached** builder group into a target FormGroup (defaults to `this.form`). * * @param source A FormGroup created locally (its controls must not already belong to another parent). * @param target The FormGroup to install the controls into. Defaults to `this.form`. * * Notes: * - This method **moves** the control instances from `source` into `target` (no cloning). * - If a control already has a parent, Angular will throw when adding it to `target`. */ protected addControlsToNestedFormGroup(source: FormGroup, target?: FormGroup): void; /** * Removes controls from `target` whose names are present in `source` (defaults to `this.form`). * * @param source A FormGroup whose control names identify which controls to remove. * @param target The FormGroup to remove controls from. Defaults to `this.form`. * * Use this with the same builder group you used to add controls so you only remove what you added. */ protected removeControlsFromNestedFormGroup(source: FormGroup, target?: FormGroup): void; /** * Adds or removes one or more validators on a control and updates validity without emitting events. * * @param control The control to modify. If null/undefined, the method no-ops and returns `false`. * @param validators A single `ValidatorFn` or an array of `ValidatorFn`s to add/remove. * @param present When `true`, validators are added; when `false`, the same validators are removed. * @returns The `present` flag (for convenient inline use in conditionals). */ protected setValidatorPresence(control: AbstractControl | null, validators: ValidatorFn | ValidatorFn[], present: boolean): boolean; /** * Truthy-value helper used by multiple sub-forms. * * Returns `false` for `null`/`undefined`. For strings, trims whitespace and checks for non-zero length. * For all other types, returns `true` (treat non-string values as present). */ protected hasValue(v: unknown): boolean; /** * Resets a list of controls and re-computes validity without emitting value-change events. * * For each control: clears errors, resets the value to `null`, and calls `updateValueAndValidity`. * This means built-in validators (e.g. `required`) will be re-applied after reset. */ protected resetAndValidateControls(controls: (AbstractControl | null)[]): void; /** * Resets a FormGroup’s value/state and re-computes validity without emitting value-change events. * * Performs: `group.reset(undefined)`, marks pristine/untouched, then `updateValueAndValidity`. */ protected resetAndValidateFormGroup(group: FormGroup): void; /** * Subscribes a handler to the `valueChanges` of multiple controls, with auto-unsubscribe on destroy. * * @param handler Function invoked whenever **any** provided control emits a value change. * @param controls One or more controls to observe; falsy entries are ignored. * * Implementation detail: merges the streams and unsubscribes via `takeUntil(this.ngUnsubscribe)`. */ protected subscribeValidation(handler: () => void, ...controls: (AbstractControl | null)[]): void; /** * @inheritdoc * * Handles cleanup logic when the component is destroyed. * * - Clears local child error definitions and emits an empty map to the parent. * - Removes all controls added by this sub-form from the parent form, if nested. * - Calls the base class's `ngOnDestroy` for additional teardown. */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }