import { Observable } from "rxjs";

/**
 * Contains the base methods and properties that all fields
 * should have.
 *
 * @export
 * @class FieldBase
 */
export declare class FieldBase {
    /**
     * Observable that emits information if the field is being focused.
     *
     * @type {Observable<boolean>}
     * @memberof FieldBase
     */
    readonly focus$:  Observable<boolean>;

    /**
     * Updates the value property. Useful if you want to plug additional functionaly before or after
     * the value is updated.
     *
     * @param {*} value
     * @memberof FieldBase
     */
    writeValue(value: any): void;

    /**
     * Gets the current value of the field.
     *
     * @returns {*}
     * @memberof FieldBase
     */
    getValue(): any;

    /**
     * Processes the errors that come from the validators. Users can return
     * user friendly messages using this method
     * @param errors The errors object
     */
    processErrors(errors: { [key: string]: any }): Array<string>;
}
