import { AbstractControl, FormBuilder, FormControl, FormGroup, AbstractControlOptions, FormArray } from '@angular/forms';
import { Observable } from 'rxjs';
export declare type RecursivePartial<T> = {
    [P in keyof T]?: RecursivePartial<T[P]>;
};
export declare type FormGroupControlsOf<T> = {
    [P in keyof T]: FormControl | FormGroup | FormArray;
};
export declare type ControlStatus = 'VALID' | 'INVALID' | 'PENDING' | 'DISABLED';
export interface AbstractControlTypeSafe<T> extends AbstractControl {
    readonly value: T;
    readonly valueChanges: Observable<T>;
    get(path: Array<string> | string): AbstractControl | null;
    get(path: number[]): AbstractControlTypeSafe<T extends (infer R)[] ? R : T> | null;
    readonly statusChanges: Observable<ControlStatus>;
}
export interface FormGroupTypeSafe<T> extends FormGroup {
    readonly value: T;
    readonly valueChanges: Observable<T>;
    getSafe<P>(propertyFunction: (typeVal: T) => P): AbstractControlTypeSafe<P> | null;
    setControlSafe(propertyFunction: (typeVal: T) => any, control: AbstractControl): void;
    removeControlSafe(propertyFunction: (typeVal: T) => any): void;
    setValue(value: T, options?: {
        onlySelf?: boolean;
        emitEvent?: boolean;
    }): void;
    patchValue(value: RecursivePartial<T>, options?: Object): void;
    readonly status: ControlStatus;
    readonly statusChanges: Observable<ControlStatus>;
    controls: {
        [P in keyof T]: AbstractControlTypeSafe<T[P]>;
    };
}
export interface FormControlTypeSafe<T> extends FormControl {
    value: T | undefined;
}
export declare const generateGetSafeFunction: <T extends unknown>(gr: FormGroupTypeSafe<T>) => (propertyFunction: (typeVal: T) => any) => AbstractControl;
export declare const generateSetControlSafeFunction: <T extends unknown>(gr: FormGroupTypeSafe<T>) => (propertyFunction: (typeVal: T) => any, control: AbstractControl) => void;
export declare const generateRemoveControlSafeFunction: <T extends unknown>(gr: FormGroupTypeSafe<T>) => (propertyFunction: (typeVal: T) => any) => void;
export declare class FormBuilderTypeSafe extends FormBuilder {
    group<T>(controlsConfig: FormGroupControlsOf<T>, options?: AbstractControlOptions | {
        [key: string]: any;
    } | null): FormGroupTypeSafe<T>;
}
