import * as log from "loglevel";
import { TeamAppsUiContext } from "../TeamAppsUiContext";
import { UiField_BlurEvent, UiField_FocusEvent, UiField_ValueChangedEvent, UiFieldCommandHandler, UiFieldConfig, UiFieldEventSource } from "../../generated/UiFieldConfig";
import { TeamAppsEvent } from "../util/TeamAppsEvent";
import { UiFieldEditingMode } from "../../generated/UiFieldEditingMode";
import { AbstractUiComponent } from "../AbstractUiComponent";
import { UiFieldMessageConfig } from "../../generated/UiFieldMessageConfig";
import { UiFieldMessagePosition } from "../../generated/UiFieldMessagePosition";
import Logger = log.Logger;
export interface ValueChangeEventData {
    value: any;
}
export declare abstract class UiField<C extends UiFieldConfig = UiFieldConfig, V = any> extends AbstractUiComponent<C> implements UiFieldCommandHandler, UiFieldEventSource {
    readonly onValueChanged: TeamAppsEvent<UiField_ValueChangedEvent>;
    readonly onFocus: TeamAppsEvent<UiField_FocusEvent>;
    readonly onBlur: TeamAppsEvent<UiField_BlurEvent>;
    readonly onUserManipulation: TeamAppsEvent<void>;
    static editingModeCssClasses: {
        [x: number]: string;
    };
    protected logger: Logger;
    private committedValue;
    private $fieldWrapper;
    private _messageTooltip;
    private $messagesContainerAbove;
    private $messagesContainerBelow;
    private fieldMessages;
    private hovering;
    private focused;
    constructor(_config: C, _context: TeamAppsUiContext);
    protected initFocusHandling(): void;
    private updateFieldMessageVisibilities;
    private getHighestVisibilitiesByMessagePosition;
    protected abstract initialize(config: C, context: TeamAppsUiContext): void;
    getTeamAppsType(): string;
    doGetMainElement(): HTMLElement;
    abstract getMainInnerDomElement(): HTMLElement;
    hasFocus(): boolean;
    abstract focus(): void;
    destroy(): void;
    abstract isValidData(v: V): boolean;
    abstract getTransientValue(): V;
    /**
     * the value to be set if no other value has been set.
     */
    getDefaultValue(): V;
    protected abstract displayCommittedValue(): void;
    abstract valuesChanged(v1: V, v2: V): boolean;
    setValue(value: any): void;
    setCommittedValue(v: V): void;
    getCommittedValue(): V;
    private fireCommittedChangeEvent;
    protected convertValueForSendingToServer(value: V): any;
    commit(forceEvenIfNotChanged?: boolean): boolean;
    setEditingMode(editingMode?: UiFieldEditingMode): void;
    protected abstract onEditingModeChanged(editingMode: UiFieldEditingMode, oldEditingMode?: UiFieldEditingMode): void;
    getEditingMode(): UiFieldEditingMode;
    isEditable(): boolean;
    static defaultOnEditingModeChangedImpl(field: UiField<UiFieldConfig, any>, $focusableElementProvider: () => HTMLElement): void;
    getReadOnlyHtml(value: V, availableWidth: number): string;
    getFieldMessages(): UiFieldMessageConfig[];
    setFieldMessages(fieldMessageConfigs: UiFieldMessageConfig[]): void;
    private createMessageElement;
    private get messageTooltip();
    private updatePopperPosition;
    protected getMessagesContainer(position: UiFieldMessagePosition): HTMLElement;
}
