import { OnDestroy } from '@angular/core';
import { Logger } from '@anglr/common';
import { LayoutComponentMetadata } from '@anglr/dynamic/layout';
import { EditorHotkeys, MetadataStateManager } from '@anglr/dynamic';
import { Dictionary } from '@jscrpt/common';
import { Observable, Subject, Subscription } from 'rxjs';
import type { LayoutDesignerSAComponent } from '../../components';
import { LayoutEditorMetadataManagerComponent } from './layoutEditorMetadataManager.interface';
import * as i0 from "@angular/core";
/**
 * Class used for handling layout metadata
 */
export declare class LayoutEditorMetadataManager implements MetadataStateManager<LayoutComponentMetadata>, OnDestroy {
    protected _editorHotkeys: EditorHotkeys;
    protected _logger?: Logger | undefined;
    /**
     * Subscriptions created during initialization
     */
    protected initSubscriptions: Subscription;
    /**
     * Clipboard for layout metadata copy/paste/cut operations
     */
    protected metadataClipboard: LayoutComponentMetadata | undefined | null;
    /**
     * Array of all registered layout designer components
     */
    protected components: Dictionary<LayoutEditorMetadataManagerComponent>;
    /**
     * Id of root component
     */
    protected rootComponentId: string | null;
    /**
     * Id of selected component
     */
    protected _selectedComponent: string | null;
    /**
     * Id of highlighted component
     */
    protected _highlightedComponent: string | null;
    /**
     * Used for emitting layout changes
     */
    protected layoutChangeSubject: Subject<void>;
    /**
     * Used for emitting selected component changes
     */
    protected _selectedChange: Subject<void>;
    /**
     * Used for emitting highlighted component changes
     */
    protected _highlightedChange: Subject<void>;
    /**
     * Used for emitting changes in components display name
     */
    protected _displayNameChanges: Subject<void>;
    /**
     * Flattened tree of components tree
     */
    protected _flatTree: LayoutEditorMetadataManagerComponent[] | null;
    /**
     * Id of dragged over component
     */
    protected _draggedOverComponent: string | null;
    /**
     * Used for emitting dragged over component changes
     */
    protected _draggedOverComponentChange: Subject<void>;
    /**
     * Gets id of selected component
     */
    get selectedComponent(): string | null;
    /**
     * Gets id of highlighted component
     */
    get highlightedComponent(): string | null;
    /**
     * Gets id of dragged over component
     */
    get draggedOverComponent(): string | null;
    /**
     * Gets tree root for component tree
     */
    get root(): LayoutEditorMetadataManagerComponent | undefined | null;
    /**
     * Occurs when layout changes
     */
    get layoutChange(): Observable<void>;
    /**
     * Occurs when selected component changes
     */
    get selectedChange(): Observable<void>;
    /**
     * Occurs when highlighted component changes
     */
    get highlightedChange(): Observable<void>;
    /**
     * Occurs when display name of component changes
     */
    get displayNameChange(): Observable<void>;
    /**
     * Occurs when dragged over component changes
     */
    get draggedOverComponentChange(): Observable<void>;
    /**
     * Gets flattened tree of components tree
     */
    get flatTree(): LayoutEditorMetadataManagerComponent[];
    constructor(_editorHotkeys: EditorHotkeys, _logger?: Logger | undefined);
    /**
     * Called when component is destroyed
     */
    ngOnDestroy(): void;
    /**
     * Marks component as selected
     * @param id - Id of component that will be marked as selected
     */
    selectComponent(id?: string): void;
    /**
     * Removes selection of component
     */
    unselectComponent(): void;
    /**
     * Marks component as highlighted
     * @param id - Id of component that will be marked as selected
     */
    highlightComponent(id?: string): void;
    /**
     * Removes highlight of component
     */
    cancelHighlightedComponent(): void;
    /**
     * Mark component as being dragged over
     * @param id - Id of component that will be marked
     */
    dragOverComponent(id?: string): void;
    /**
     * Removes indication of component being dragged over
     * @param id - Id of component that will be marked
     */
    cancelDragOverComponent(): void;
    /**
     * Registers layout designer component and returns true if component was registered successfuly, otherwise false
     * @param component - Component instance that is being registered
     * @param id - Id of registered component
     * @param parentId - Id of parent that holds this component
     */
    registerLayoutDesignerComponent(component: LayoutDesignerSAComponent, id: string, parentId: string | undefined): boolean;
    /**
     * Gets component from designer component tree
     * @param id - Id of component to be get
     */
    getComponent(id: string): LayoutDesignerSAComponent | null;
    /**
     * Gets parent of component by id
     * @param id - Id of component which parent will be get
     */
    getParent(id: string): LayoutDesignerSAComponent | null;
    /**
     * Gets index of componet in its parent, if not parent or id not found null is returned
     * @param id - Id of component which index from parent will be obtained
     */
    getIndex(id: string): number | null;
    /**
     * Gets component definition with information about component tree
     * @param id - Id of component definition
     */
    getComponentDef(id: string): LayoutEditorMetadataManagerComponent | null;
    /**
     * Unregisters layout designer component
     * @param id - Id of component that will be unregistered
     */
    unregisterLayoutDesignerComponent(id: string): void;
    /**
     * Fires event indicating that display name of any component has changed
     */
    displayNameUpdated(): void;
    /**
     * Gets layout component metadata which is using this service
     */
    getMetadata(): LayoutComponentMetadata | null;
    /**
     * Builds flattened tree of components tree
     */
    protected _buildFlatTree(): LayoutEditorMetadataManagerComponent[];
    /**
     * Builds flattened tree of components tree
     * @param component - Component which tree should be flattened
     */
    protected _buildFlatTreeForComponent(component: LayoutEditorMetadataManagerComponent): LayoutEditorMetadataManagerComponent[];
    static ɵfac: i0.ɵɵFactoryDeclaration<LayoutEditorMetadataManager, [null, { optional: true; }]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<LayoutEditorMetadataManager>;
}
//# sourceMappingURL=layoutEditorMetadataManager.service.d.ts.map