import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { FormGroupDirective } from '@angular/forms';
import { ToggleSubject } from '@rxap/rxjs';
import { LoadingIndicatorService } from '@rxap/services';
import { BehaviorSubject } from 'rxjs';
import { RxapFormBuilder } from '../form-builder';
import { RxapFormGroup } from '../form-group';
import { FormDefinition } from '../model';
import { FormLoadFailedMethod, FormLoadMethod, FormLoadSuccessfulMethod, FormSubmitFailedMethod, FormSubmitMethod, FormSubmitSuccessfulMethod } from './models';
import * as i0 from "@angular/core";
export declare class FormDirective<T = any> extends FormGroupDirective implements OnInit, OnChanges, OnDestroy {
    readonly cdr: ChangeDetectorRef;
    protected readonly loadMethod: FormLoadMethod | null;
    protected readonly loadFailedMethod: FormLoadFailedMethod | null;
    protected readonly loadSuccessfulMethod: FormLoadSuccessfulMethod | null;
    protected readonly submitFailedMethod: FormSubmitFailedMethod | null;
    protected readonly submitSuccessfulMethod: FormSubmitSuccessfulMethod | null;
    protected readonly formDefinitionBuilder: RxapFormBuilder | null;
    protected readonly loadingIndicatorService: LoadingIndicatorService | null;
    form: RxapFormGroup<T>;
    initial?: T;
    readonly context: import("@angular/core").InputSignal<Record<string, unknown>>;
    /**
     * Emits when the submit method is executed without errors. The result of the
     * submit method is passed as event object.
     *
     * If no submit method is defined then emit after the submit button
     * is clicked.
     */
    rxapSubmit: EventEmitter<any>;
    invalidSubmit: EventEmitter<Record<string, any>>;
    submitSuccessful$: EventEmitter<any>;
    get submitting(): boolean;
    get submitError(): Error | null;
    get loading(): boolean;
    get loaded(): boolean;
    get loadingError(): Error | null;
    set useFormDefinition(value: FormDefinition<T> | '');
    get formDefinition(): FormDefinition<T>;
    readonly submitting$: ToggleSubject;
    readonly submitError$: BehaviorSubject<Error | null>;
    readonly loading$: ToggleSubject;
    readonly loaded$: ToggleSubject;
    readonly loadingError$: BehaviorSubject<Error | null>;
    protected _formDefinition: FormDefinition<T>;
    submitMethod: FormSubmitMethod<any> | null;
    private _autoSubmitSubscription;
    constructor(cdr: ChangeDetectorRef, formDefinition?: FormDefinition | null, submitMethod?: FormSubmitMethod<any> | null, loadMethod?: FormLoadMethod | null, loadFailedMethod?: FormLoadFailedMethod | null, loadSuccessfulMethod?: FormLoadSuccessfulMethod | null, submitFailedMethod?: FormSubmitFailedMethod | null, submitSuccessfulMethod?: FormSubmitSuccessfulMethod | null, formDefinitionBuilder?: RxapFormBuilder | null, loadingIndicatorService?: LoadingIndicatorService | null);
    ngOnChanges(changes: SimpleChanges): void;
    ngOnInit(): void;
    onSubmit($event: Event): boolean;
    protected loadInitialState(form: RxapFormGroup): void;
    protected loadSuccessful(value: any): void;
    protected loadFailed(error: Error): void;
    protected getSubmitValue(): T;
    protected submit(): void;
    protected submitFailed(error: Error): void;
    protected submitSuccessful(value: any): void;
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormDirective<any>, [null, { optional: true; }, { optional: true; skipSelf: true; }, { optional: true; skipSelf: true; }, { optional: true; skipSelf: true; }, { optional: true; skipSelf: true; }, { optional: true; skipSelf: true; }, { optional: true; skipSelf: true; }, { optional: true; skipSelf: true; }, { optional: true; }]>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<FormDirective<any>, "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", ["rxapForm"], { "initial": { "alias": "initial"; "required": false; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; "useFormDefinition": { "alias": "rxapForm"; "required": false; }; "submitMethod": { "alias": "submitMethod"; "required": false; }; }, { "ngSubmit": "ngSubmit"; "rxapSubmit": "rxapSubmit"; "invalidSubmit": "invalidSubmit"; "submitSuccessful$": "submitSuccessful"; }, never, never, true, never>;
}
