import { ElementRef, OnDestroy, OnInit, Renderer2, ViewContainerRef } from "@angular/core";
import { GuiCommand } from "@magic-xpa/gui";
import { TaskBaseMagicComponent } from "../task-base.magic.component";
import { TaskMagicService } from "../../services/task.magics.service";
import { RowMagicDirective } from "./magic/row.magic.directive";
import { Subscription } from "rxjs";
/**
 * Connects HTML elements to the Magic Web Client engine
 */
export declare class MagicDirective implements OnInit, OnDestroy {
    protected _task: TaskMagicService;
    protected element: ElementRef;
    protected renderer: Renderer2;
    protected vcRef: ViewContainerRef;
    protected magicRow: RowMagicDirective;
    magic: any;
    /**
     * This flag is used when we only want to register to events, but do not want to execute commands sent from server
     */
    eventsOnly: any;
    /**
     * Row id of the control, for when it is on a table
     */
    rowId: string;
    /**
     *
     */
    /**
     * The HTML element connected to this directive
     */
    protected htmlElement: HTMLElement;
    /**
     * Magic's component handling this control
     */
    component: TaskBaseMagicComponent;
    /**
     * Collection of event handlers for this element
     */
    private eventHandlers;
    /**
     * Id of this element
     */
    id: string;
    /**
     * @ignore
     */
    protected selector: string;
    /**
     * @ignore
     */
    subscribeRefreshDom: Subscription;
    private focusUnlistener;
    eventsOnlyVal: boolean;
    static opened: boolean;
    /**
     *
     * @param _task The task service
     * @param element The element for which the directive is applied
     * @param renderer Renderer for the element
     * @param vcRef
     * @param magicRow
     */
    constructor(_task: TaskMagicService, element: ElementRef, renderer: Renderer2, vcRef: ViewContainerRef, magicRow: RowMagicDirective);
    /**
     * Get the task service
     * @returns
     */
    readonly task: TaskMagicService;
    /**
     * Register to the events this element may need to handle
     */
    protected regEvents(): void;
    /**
     * Handle focus event
     */
    private OnFocus;
    /**
     * Is the command's element the same as this directive's element
     * @param command
     * @returns true/false
     */
    private IsSameElement;
    /**
     * @ignore
     */
    private regUpdatesUI;
    /**
     * Initializes this object
     */
    ngOnInit(): void;
    /**
     * Handles the commands received from the Magic WebClient engine
     * @param command
     */
    handleCommand(command: GuiCommand): void;
    /**
     * Handle the Magic set-property command
     * @param command
     */
    handleSetProperty(command: GuiCommand): void;
    /**
     * Cleanup
     */
    ngOnDestroy(): void;
}
