import { OnInit, OnDestroy, ChangeDetectorRef, Type } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { Logger, PermanentStorage } from '@anglr/common';
import { FormModelBuilder } from '@anglr/common/forms';
import { MetadataHistoryManager } from '@anglr/dynamic';
import { LayoutComponentMetadata } from '@anglr/dynamic/layout';
import { Dictionary } from '@jscrpt/common';
import { Subscription } from 'rxjs';
import { LayoutEditorMetadataExtractor, LayoutEditorMetadataManager, LayoutEditorPropertyMetadataExtractor } from '../../services';
import { LayoutDesignerSAComponent } from '../layoutDesigner/layoutDesigner.component';
import { LayoutEditorMetadataDescriptor, LayoutEditorPropertiesDefinitionMetadata, LayoutPropertyTypeData } from '../../decorators';
import { LayoutEditorPropertyMetadata } from '../../misc/types';
import { PropertiesControl } from '../../interfaces';
import * as i0 from "@angular/core";
/**
 * State of properties editor
 */
interface PropertiesEditorState {
    /**
     * Indication whether is properties editor opened
     */
    opened: boolean;
    /**
     * Current width of properties editor
     */
    width: number;
}
/**
 * Properties editor data
 */
interface PropertiesEditorData {
    /**
     * Properties form
     */
    form: FormGroup;
    /**
     * Properties metadata
     */
    metadata: Dictionary<LayoutEditorPropertyMetadata & LayoutPropertyTypeData> | null;
    /**
     * Array of properties controls used for editation of properties/options
     */
    controls: Type<PropertiesControl>[];
}
/**
 * Component that represents editor for components options/properties
 */
export declare class PropertiesEditorSAComponent implements OnInit, OnDestroy {
    protected manager: LayoutEditorMetadataManager;
    protected metadataExtractor: LayoutEditorMetadataExtractor;
    protected propertyExtractor: LayoutEditorPropertyMetadataExtractor;
    protected formModelBuilder: FormModelBuilder;
    protected changeDetector: ChangeDetectorRef;
    protected storage: PermanentStorage;
    protected history: MetadataHistoryManager<LayoutComponentMetadata>;
    protected logger?: Logger | undefined;
    /**
     * Subscriptions created during initialization
     */
    protected initSubscriptions: Subscription;
    /**
     * Subscription for options form
     */
    protected optionsFormSubscription: Subscription | null;
    /**
     * Id of last component that was used for property editation
     */
    protected lastComponentId: string | null;
    /**
     * Instance of last component that was used for property editation
     */
    protected lastComponent: LayoutDesignerSAComponent | null;
    /**
     * Instance of selected designer component
     */
    protected component: LayoutDesignerSAComponent | null;
    /**
     * Instance of metadata for selected designed component
     */
    protected metadata: LayoutEditorMetadataDescriptor | null;
    /**
     * Control for display name of component
     */
    protected displayName: FormControl<string | null>;
    /**
     * Properties data for editation
     */
    protected propertiesData: PropertiesEditorData[];
    /**
     * Instance of properties editor state
     */
    protected state: PropertiesEditorState;
    constructor(manager: LayoutEditorMetadataManager, metadataExtractor: LayoutEditorMetadataExtractor, propertyExtractor: LayoutEditorPropertyMetadataExtractor, formModelBuilder: FormModelBuilder, changeDetector: ChangeDetectorRef, storage: PermanentStorage, history: MetadataHistoryManager<LayoutComponentMetadata>, logger?: Logger | undefined);
    /**
     * Initialize component
     */
    ngOnInit(): Promise<void>;
    /**
     * Called when component is destroyed
     */
    ngOnDestroy(): void;
    /**
     * Toggles collapsed state of properties
     */
    protected toggleCollapsed(): void;
    protected updateSize(size: number): void;
    /**
     * Initialize properties for selected component
     */
    protected initProperties(): Promise<void>;
    /**
     * Gets metadta for selected component
     */
    protected getMetadata(): Promise<void>;
    /**
     * Hides properties
     */
    protected hide(): void;
    /**
     * Initialize dynamic property
     * @param props - Property to be initialized
     */
    protected initDynamicProperty(props: LayoutEditorPropertiesDefinitionMetadata): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<PropertiesEditorSAComponent, [null, null, null, null, null, null, null, { optional: true; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<PropertiesEditorSAComponent, "properties-editor", never, {}, {}, never, never, true, never>;
}
export {};
//# sourceMappingURL=propertiesEditor.component.d.ts.map