import { AfterViewInit, ChangeDetectorRef, OnDestroy, QueryList } from '@angular/core';
import { AbstractControl, ControlValueAccessor, NgControl, ValidationErrors } from '@angular/forms';
import { ReplaySubject, Subject, Observable } from 'rxjs';
import * as i0 from "@angular/core";
export declare function createNestedFormControl<V, M = V>({ autoEmitChange, asyncValidator, }?: {
    autoEmitChange?: boolean;
    asyncValidator?: boolean;
}): new () => BaseNestedFormControl<V, M>;
export declare class BaseNestedFormControl<V, M = V> implements AfterViewInit, OnDestroy, ControlValueAccessor {
    get disabled(): boolean | '';
    set disabled(val: boolean | '');
    private _disabled;
    get readonly(): boolean | "";
    set readonly(val: boolean | "");
    protected controls: QueryList<NgControl>;
    onValidatorChange: () => void;
    onChange: (_: V) => void;
    onTouched: () => void;
    model: M;
    submitted: boolean;
    protected autoEmitChange: boolean;
    protected asyncValidator: boolean;
    protected cdr: ChangeDetectorRef;
    protected destroy$$: Subject<void>;
    constructor();
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    registerOnValidatorChange(fn: () => void): void;
    registerOnChange(fn: (_: V) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    writeValue(value: V): void;
    validate(_control?: AbstractControl): ValidationErrors | null | Observable<ValidationErrors | null>;
    emitModel(value: M): void;
    emitValue(value: V): void;
    protected valueIn(value: V): M;
    protected modelOut(model: M): V;
    static ɵfac: i0.ɵɵFactoryDeclaration<BaseNestedFormControl<any, any>, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<BaseNestedFormControl<any, any>, never, never, { "disabled": "disabled"; "readonly": "readonly"; }, {}, never, never, false>;
}
/**
 * @deprecated use `BaseNestedFormControl` instead.
 */
export declare class BaseNestedFormControlPure<V, M = V> extends BaseNestedFormControl<V, M> {
    model$: ReplaySubject<M>;
    constructor();
    writeValue(value: V): void;
    emitValue(value: V): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<BaseNestedFormControlPure<any, any>, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<BaseNestedFormControlPure<any, any>, never, never, {}, {}, never, never, false>;
}
declare type Path = string | Array<string | number>;
interface Mapper {
    [x: string]: Mapper | Path;
}
export declare function dataTransfer<S extends object, T extends object, M extends Record<keyof T, Path | Mapper> = Record<keyof T, Path | Mapper>>(mapper: M): [(source: S) => T, (target: T) => S];
export declare function copyValue<T extends object>(from: Path, to: Path, mapper?: (v: any) => any): (object: T) => T;
export {};
