import { ChangeDetectorRef, EventEmitter, OnDestroy } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
import { IonInput } from '@ionic/angular';
import { Observable, Subscription } from 'rxjs';
import * as i0 from "@angular/core";
export declare namespace InlineEditorComponent {
    type InputOptions = ToggleOptions | NumberOptions | PasswordOptions | TextOptions;
    interface ToggleOptions {
        type: 'toggle';
    }
    interface NumberOptions {
        min?: number;
        max?: number;
        type: 'number';
    }
    interface PasswordOptions {
        pattern?: RegExp;
        minLength?: number;
        maxLength?: number;
        type: 'password';
    }
    interface TextOptions {
        pattern?: RegExp;
        minLength?: number;
        maxLength?: number;
        placeholder?: string;
        type: 'text';
    }
    namespace SelectOptions {
        type Options = {
            key: any;
            text: string;
        }[];
    }
}
export declare class InlineEditorComponent<ValueType = any> implements OnDestroy {
    private changeDetectorRef;
    /**
     * Emitter when form is submit
     */
    onSubmit: EventEmitter<{
        target: {
            value: string;
        };
    }>;
    valueChange: EventEmitter<string | number>;
    /**
     * Enable/disable edit mode
     */
    set editMode(v: boolean);
    editModeChange: EventEmitter<boolean>;
    /**
     * True if field can be edited
     */
    editable: boolean;
    unitValue?: string;
    /**
     * Input option
     * You can defined how input will be rendered: text, number, toggle, select, ...
     */
    inputOptions: InlineEditorComponent.InputOptions | any;
    /**
     * Additional style for value
     */
    valueStyle?: string;
    /**
     * Set observable to subscribe to get value updates
     */
    set value(obs: Observable<ValueType> | ValueType);
    /**
     * Set value snapshot
     */
    set forceValue(value: any);
    /**
     * Enable/disable loader when submitting a value
     */
    showLoader: boolean;
    /**
     * Set field error message
     */
    set fieldError(err: Error);
    inputView: IonInput;
    private originalValue?;
    form: FormGroup;
    _editMode: boolean;
    currentValue: any;
    valueSubscription?: Subscription;
    field: AbstractControl;
    private destroyed;
    constructor(formBuilder: FormBuilder, changeDetectorRef: ChangeDetectorRef);
    ngOnDestroy(): void;
    onValueSubmit(): void;
    isEdited(): boolean;
    restoreValue(): void;
    setFieldValue(value: ValueType | undefined): void;
    onValueClick(): Promise<void>;
    onCancelEdit(): void;
    enableEditMode(): Promise<void>;
    private setInputFocus;
    private updateValue;
    onValueChange(event: CustomEvent<{
        value: string;
    }>): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<InlineEditorComponent<any>, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<InlineEditorComponent<any>, "tap-inline-editor", never, { "editMode": "editMode"; "editable": "editable"; "unitValue": "unitValue"; "inputOptions": "inputOptions"; "valueStyle": "valueStyle"; "value": "value"; "forceValue": "forceValue"; "showLoader": "showLoader"; "fieldError": "fieldError"; }, { "onSubmit": "onSubmit"; "valueChange": "valueChange"; "editModeChange": "editModeChange"; }, never, never, false, never>;
}
