import { AbstractControl, AbstractControlOptions, AsyncValidatorFn, UntypedFormArray, ValidatorFn, ɵTypedOrUntyped } from '@angular/forms';
export type QdFormArrayValuesOrControls<T> = T[] | AbstractControl[];
export type QdFormArrayItemValidator = ValidatorFn | ValidatorFn[] | null;
export type QdFormArrayItemValidatorOrOpts = QdFormArrayItemValidator | QdFormArrayOptions;
export type QdFormArrayItemAsyncValidator = AsyncValidatorFn | AsyncValidatorFn[] | null;
export type QdFormArrayValidator = QdFormArrayItemValidator;
export type QdFormArrayAsyncValidator = QdFormArrayItemAsyncValidator;
export declare class QdFormArray<T> extends UntypedFormArray implements AbstractControl {
    private _itemControlOptions;
    private _onChange;
    constructor(valuesOrControls: QdFormArrayValuesOrControls<T>, itemValidatorOrOpts?: QdFormArrayItemValidatorOrOpts, itemAsyncValidator?: QdFormArrayItemAsyncValidator, validator?: QdFormArrayValidator, asyncValidator?: QdFormArrayAsyncValidator);
    /**
     * Register a listener for value changes.
     *
     * @param fn The method that is called when the value changes.
     */
    registerOnChange(fn: (value: T) => void): void;
    /**
     * Function to unregister a value change event listener.
     */
    _unregisterOnChange(fn: (value: T) => void): void;
    /**
     * Register a listener for disabled events.
     *
     * @param fn The method that is called when the disabled status changes.
     */
    registerOnDisabledChange(fn: (isDisabled: boolean) => void): void;
    /**
     * Function to unregister a disabled event listener.
     */
    _unregisterOnDisabledChange(fn: (isDisabled: boolean) => void): void;
    /**
     * Insert a new `AbstractControl` at the end of the array.
     *
     * @param valueOrControl Value for automatically generated form control or given form control to be inserted
     * @param options Specifies whether this FormArray instance should emit events after a new
     *     control is added.
     * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
     * `valueChanges` observables emit events with the latest status and value when the control is
     * inserted. When false, no events are emitted.
     */
    push(valueOrControl: T | AbstractControl, options?: {
        emitEvent?: boolean;
    }): void;
    /**
     * Insert a new `AbstractControl` at the given `index` in the array.
     *
     * @param index Index in the array to insert the control
     * @param valueOrControl Value for automatically generated form control or given form control to be inserted
     * @param options Specifies whether this FormArray instance should emit events after a new
     *     control is inserted.
     * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
     * `valueChanges` observables emit events with the latest status and value when the control is
     * inserted. When false, no events are emitted.
     */
    insert(index: number, valueOrControl: T | AbstractControl, options?: {
        emitEvent?: boolean;
    }): void;
    /**
     * Replace an existing control.
     *
     * @param index Index in the array to replace the control
     * @param valueOrControl The value for automatically generated form control or
     *     given form control to replace the existing control
     * @param options Specifies whether this FormArray instance should emit events after an
     *     existing control is replaced with a new one.
     * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
     * `valueChanges` observables emit events with the latest status and value when the control is
     * replaced with a new one. When false, no events are emitted.
     */
    setControl(index: number, valueOrControl: T | AbstractControl, options?: {
        emitEvent?: boolean;
    }): void;
    reset(value?: ɵTypedOrUntyped<T, any, any>, options?: {
        onlySelf?: boolean;
        emitEvent?: boolean;
    }): void;
    /**
     * Sets the synchronous item validators that are active on this control.  Calling
     * this overwrites any existing synchronous validators for every item.
     *
     * When you add or remove an item validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     * If you want to add a new item validator without affecting existing ones, consider
     * using `addItemValidators()` method instead.
     */
    setItemValidators(validators: ValidatorFn | ValidatorFn[] | null): void;
    /**
     * Sets the asynchronous item validators that are active on this control. Calling this
     * overwrites any existing asynchronous validators for every item.
     *
     * When you add or remove an item validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     * If you want to add a new item validator without affecting existing ones, consider
     * using `addItemAsyncValidators()` method instead.
     */
    setItemAsyncValidators(validators: AsyncValidatorFn | AsyncValidatorFn[] | null): void;
    /**
     * Add a synchronous item validator or validators to all item controls, without affecting other validators.
     *
     * When you add or remove an item validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     * Adding a validator that already exists will have no effect. If duplicate validator functions
     * are present in the `validators` array, only the first instance would be added to a form
     * control.
     *
     * @param validators The new item validator function or functions to add to all item controls.
     */
    addItemValidators(validators: ValidatorFn | ValidatorFn[]): void;
    /**
     * Add an asynchronous item validator or validators to all item controls, without affecting other
     * validators.
     *
     * When you add or remove an item validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     * Adding a validator that already exists will have no effect.
     *
     * @param validators The new asynchronous item validator function or functions to add to all item controls.
     */
    addItemAsyncValidators(validators: AsyncValidatorFn | AsyncValidatorFn[]): void;
    /**
     * Remove a synchronous item validator from all item controls, without affecting other validators.
     * Validators are compared by function reference; you must pass a reference to the exact same
     * validator function as the one that was originally set. If a provided validator is not found,
     * it is ignored.
     *
     * When you add or remove an item validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     * @param validators The item validator or validators to remove.
     */
    removeItemValidators(validators: ValidatorFn | ValidatorFn[]): void;
    /**
     * Remove an asynchronous item validator from all item controls, without affecting other validators.
     * Validators are compared by function reference; you must pass a reference to the exact same
     * validator function as the one that was originally set. If a provided validator is not found, it
     * is ignored.
     *
     * When you add or remove an item validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     * @param validators The asynchronous item validator or validators to remove.
     */
    removeItemAsyncValidators(validators: AsyncValidatorFn | AsyncValidatorFn[]): void;
    /**
     * Check whether a synchronous item validator function is present on all item controls. The provided
     * validator must be a reference to the exact same function that was provided.
     *
     * @param validator The item validator to check for presence. Compared by function reference.
     * @returns Whether the provided validator was found on all item controls.
     */
    hasItemValidator(validator: ValidatorFn): boolean;
    /**
     * Check whether an asynchronous item validator function is present on all item controls. The provided
     * validator must be a reference to the exact same function that was provided.
     *
     * @param validator The asynchronous item validator to check for presence. Compared by function
     *     reference.
     * @returns Whether the provided asynchronous validator was found on all item controls.
     */
    hasItemAsyncValidator(validator: AsyncValidatorFn): boolean;
    /**
     * Empties out the synchronous validator list for every item.
     *
     * When you add or remove an item validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     */
    clearItemValidators(): void;
    /**
     * Empties out the async validator list for every item.
     *
     * When you add or remove a validator at run time, you must call
     * `updateItemValuesAndValidity()` for the new validation to take effect.
     *
     */
    clearItemAsyncValidators(): void;
    /**
     * Recalculates the value and validation status for all item controls.
     *
     * By default, it also updates the value and validity of its ancestors.
     *
     * @param opts Configuration options determine how the control propagates changes and emits events
     * after updates and validity checks are applied.
     * * `onlySelf`: When true, only update each single item control. When false or not supplied,
     * update all direct ancestors. Default is false.
     * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
     * `valueChanges`
     * observables emit events with the latest status and value when the item control is updated.
     * When false, no events are emitted.
     */
    updateItemValuesAndValidity(opts?: {
        onlySelf?: boolean;
        emitEvent?: boolean;
    }): void;
}
export interface QdFormArrayOptions extends AbstractControlOptions {
    /**
     * @description
     * The list of validators applied to the controls of the items.
     */
    itemValidators?: QdFormArrayValidator;
    /**
     * @description
     * The list of async validators applied to the controls of the items.
     */
    itemAsyncValidators?: QdFormArrayAsyncValidator;
    /**
     * @description
     * The event name for the controls of the items to update upon.
     */
    itemUpdateOn?: 'change' | 'blur' | 'submit';
    /**
     * @description
     * Whether to use the initial value used to construct the QdFormControl as its default value as
     * well. If this option is false or not provided, the default value of a QdFormControl is `null`.
     * When a QdFormControl is {@link QdFormControl#reset} without an explicit value, its value reverts to
     * its default value.
     */
    itemInitialValueIsDefault?: boolean;
}
/**
 * Gets item validators from either an options object or given validators.
 */
export declare function pickItemValidators(itemValidatorOrOpts?: QdFormArrayItemValidatorOrOpts): QdFormArrayValidator;
/**
 * Gets item async validators from either an options object or given validators.
 */
export declare function pickItemAsyncValidators(itemAsyncValidator?: QdFormArrayAsyncValidator, itemValidatorOrOpts?: QdFormArrayItemValidatorOrOpts): QdFormArrayAsyncValidator;
//# sourceMappingURL=form-array.d.ts.map