import { Observable, Subject, BehaviorSubject } from 'rxjs';
import { IsolatedMultiReduxHelper, MultiStoreService } from './multi-redux.service';
import { FormArray, FormGroup } from '@angular/forms';
import { FormService } from './form.service';
import { FormState } from '../state/form/form.reducers';
import { UxDynFormFrameMetaData, UxDynFormModelArray, UxFieldId } from '../model/ux-dyn-core.model';
import { SaveFieldDataEvent } from '../model/ux-dyn-rules.model';
import { UxDynFormOptions } from '../model/ux-dyn-forms.model';
import { FormModes } from '../model/ux-dyn-forms.model';
import * as i0 from "@angular/core";
export declare class DynFormApiService {
    private multipleStore;
    private formService;
    constructor(multipleStore: MultiStoreService, formService: FormService);
    createForm(metaData: UxDynFormModelArray, initialData?: object, options?: UxDynFormOptions): DynFormApi;
    createFormByFrameMetaData(formFrameData: UxDynFormFrameMetaData): DynFormApi;
    /**
     * It will give the frame's run-time DynFormApi instance
     */
    getFormInstanceById(frameId: string): DynFormApi;
    deleteFormInstanceById(frameId: string): void;
    static ɵfac: i0.ɵɵFactoryDef<DynFormApiService, never>;
    static ɵprov: i0.ɵɵInjectableDef<DynFormApiService>;
}
export declare class FormConstructor {
    metaData: UxDynFormModelArray;
    initialData: object;
    options: object;
    formService: FormService;
    constructor(metaData: UxDynFormModelArray, initialData: object, options: object, formService: FormService);
}
export declare class FormSelector {
    frameId: string;
    formService: FormService;
    constructor(frameId: string, formService: FormService);
}
export declare class DynFormApi {
    unsubscribe$: Subject<boolean>;
    isReady: BehaviorSubject<boolean>;
    private formMultiStore;
    private formState;
    private rootGroup;
    private formModel;
    private initialData;
    private metaData;
    private options;
    private mode;
    private frameId;
    private formService;
    private pubSubject;
    private ruleSubject;
    constructor(data: FormConstructor | FormSelector);
    /**
     * Returns the generated or defined frameId of the DynFormApi instance
     */
    getFrameId(): string;
    /**
     * Returns the passed MetaData
     */
    getMetaData(): UxDynFormModelArray;
    /**
     * Returns passed initialData
     * */
    getInitialData(): any;
    /**
     * Returns subscription(selector) of Its isolated formState that is sub-selection by its frameId from global State.(form+frameId)
     * Whenever instance's formState change, this selection subscription will be triggered.
     */
    getFormState(): Observable<FormState>;
    /**
     * Returns instance's isolated Store ,as instance of IsolatedMultiReduxHelper
     * that you can dispatch actions or select by selector function on it.
     * the actions and selectors will be working in the same scope of your instance(frameId).
     */
    getFormMultiStore(): IsolatedMultiReduxHelper;
    /**
     * Returns latest state of the formModel. When user interact with inputs,
     * latest changes will reflect to the formModel
     */
    getFormModel(): any;
    /**
     * Returns latest state of the formModel. When user interact with inputs,
     * latest changes will reflect to the formModel
     */
    getFormModelChanges(): Observable<any>;
    /**
     * Returns Forms's mode edit/view ->FormModes
     */
    getMode(): Observable<FormModes>;
    /**
     * Returns Angular's FormGroup instance's root of your form.
     * It will generate form tree based on the structure of your metaData
     * and It is free to access/use its methods and properties in native way.
     */
    getParentFormGroup(): FormGroup;
    /**
     * Setting errors by respecting formModel object structure,
     * It is usefule to provide the server side validations to form instance/view.
     */
    setErrors(object: any, options?: {
        emitEvent?: boolean;
        clear?: boolean;
    }): void;
    /**
     * Setting errors by respecting formModel object structure,
     * It is usefule to provide the server side validations to form instance/view.
     */
    clearErrors(): void;
    /**
     * This method accepts new metadata
     * and updates to the Form Instance by assuming latest state as new initial data.
     */
    updateMetaData(newMetaData: UxDynFormModelArray): void;
    /**
     * Whenever this method runs, It updates formModel like you provided initialValues (by emitting event).
     * getParentFormGroup() is returning FormGroup, and its patchValue() function could be used for custom scenarios.
     */
    patchFormValue(newData: any): void;
    /**
     * To publish custom/default events inside your form instance. (PUB/SUB)
     * DynFormApi is using this method to publish Life Cycle Event like FormModelReady
     */
    pubEvent(evt: any): void;
    /**
     * Returns subscribtion to the custom/default events that published for your formInstance.
     * This method is accessible from custom components/fields that you implemented.
     * You can use this communication layer for inter-component interactions/behaviours
     */
    subEvent(): Observable<any>;
    /**
     * Every form Instance has its state and customData property in that state.
     * This method is saving your 'data' to customData state by respecting the 'key' that you provide
     */
    saveCustomData(key: string, data: any): void;
    /**
     * Every form Instance has its state and customData property in that state.
     * This method is subscribing to your instance's customData state's sub state by 'key' that you provide
     * After you called saveCustomData('your_key',yourData)
     *  getCustomData('your_key').subscribe((newData)=>
     *  //subscription will be triggered , and newData will be yourData
     *  )
     */
    getCustomData(key: string): Observable<any>;
    /**
     * By this method, you can save custom key:data pair for the field itself.
     * Every field has a fieldId( automatically generated or defined into generator function)
     * and has a sub-state on the NGRX_state->form_frameId->fieldData->fieldId->key1:data1,key2:data2...
     * note:this method is used by BaseDynComponent (and by BaseControl-Group-Array classes that extends BaseDynComponent class)
     * from every field that you extended base-classes,
     * you can use this.saveFieldData(key,val) helper method without defining frameId or fieldId
     */
    saveFieldData(fieldId: UxFieldId, key: string, data: any, levelId?: string, interpreted?: boolean): void;
    /**
     * By this method, you can get custom data with key pair from the field's state.
     * Every field has a fieldId( automatically generated or defined into generator function)
     * and has a sub-state on the NGRX_state->form_frameId->fieldData->fieldId->key1:data1,key2:data2...
     * note:this method is used by BaseDynComponent (and by BaseControl-Group-Array classes that extends BaseDynComponent class)
     * from every field that you extended base-classes,
     * you can use this.getFieldData(key) helper method without defining frameId or fieldId
     */
    getFieldData(fieldId: UxFieldId, key: string, levelId?: string): Observable<any>;
    /**
     * By this method, you can listen fieldData events for a particular fieldId
     */
    getFieldDataEvent(fieldId: UxFieldId, key: string): Observable<SaveFieldDataEvent>;
    /**
     * Kills all the subscription attached to the FormApi instance
     */
    stopSubscriptions(): void;
    /**
     * Sets the mode as edit or view
     */
    setMode(newMode: FormModes): void;
    /**
     *  Marks as touched and sets errors for provided form-group/control ancestors
     *  If It is not provided, It is root group.
     */
    runValidationErrorFeedbacks(controlSet?: FormGroup | FormArray): void;
    /**
     * By this method, you can send fieldData events for a fieldId
     */
    private sendFieldDataEvent;
    private createString;
    private splitValues;
    private selectAndSetControlErrors;
    private initByFrameId;
    private registerFormConfigDataToState;
    private initFormState;
    private reGenerateForm;
    private generateNgFormStructure;
    private calculateInitialData;
    /**
     *Merges the initial data which is generated by controls,
     * to provided initial data by calculating null objects
     * for example generated -> [key]: {a:null,b:null} provided->[key]:null
     * result will be -> [key]: {a:null,b:null}
     */
    private prepareInitialData;
    private initOptions;
    private initFrameIdOption;
    private initRulesOption;
    private initActionsOption;
    private bindTo;
}
/**
 * DynFormApi life cycle event, when config change
 */
export declare class OnFormConfigChange {
    name: string;
    constructor();
}
export declare enum StringSelectorNotation {
    separator = "*uniques*",
    array = "[@@@]",
    object = "{...}"
}
export declare const keySeparator = ".";
/**
 * DynFormApi life cycle event, when form model is ready
 */
export declare class FormModelReady {
    name: string;
    constructor();
}
