import { Injector, OnDestroy } from '@angular/core';
import { Logger } from '@anglr/common';
import { DynamicItemLoader } from '@anglr/dynamic';
import { Dictionary, NoopAction } from '@jscrpt/common';
import { Subscription } from 'rxjs';
import { RelationsComponent, RelationsComponentMetadata, RelationsComponentType } from '../../interfaces';
import { RelationsComponentManager } from '../relationsComponentManager/relationsComponentManager.service';
import { RelationsManager } from '../relationsManager/relationsManager.service';
import { RelationsDataTransferInstruction, RelationsProcessorComponentData, RelationsProcessorInputOutputData } from './relationsProcessor.interface';
import { RelationsComponentDef, RelationsProcessorComponent } from '../../misc/types';
import { RelationsChangeDetector } from '../relationsChangeDetector/relationsChangeDetector.service';
import { RelationsDebugger } from '../relationsDebugger/relationsDebugger.service';
import * as i0 from "@angular/core";
/**
 * Processor that applies relations to registered components
 */
export declare class RelationsProcessor implements OnDestroy {
    protected relationsManager: RelationsManager;
    protected componentManager: RelationsComponentManager;
    protected injector: Injector;
    protected loader: DynamicItemLoader<RelationsComponentDef>;
    protected logger?: Logger | undefined;
    /**
     * Promise used for indication that processor was initialized
     */
    protected ɵInitialized: Promise<void>;
    /**
     * Relations metadata
     */
    protected ɵRelations: Dictionary<RelationsProcessorComponentData>;
    /**
     * Array of backward relations, relations that are used for obtaining data for inputs
     */
    protected ɵBackwardRelations: Dictionary<RelationsProcessorInputOutputData[]>;
    /**
     * Resolves initialized
     */
    protected resolveInitialized: NoopAction;
    /**
     * Subscriptions created during initialization
     */
    protected initSubscriptions: Subscription;
    /**
     * Gets or sets relations metadata
     */
    protected get relations(): Dictionary<RelationsProcessorComponentData>;
    protected set relations(value: Dictionary<RelationsProcessorComponentData>);
    /**
     * Gets or sets array of backward relations, relations that are used for obtaining data for inputs
     */
    protected get backwardRelations(): Dictionary<RelationsProcessorInputOutputData[]>;
    protected set backwardRelations(value: Dictionary<RelationsProcessorInputOutputData[]>);
    /**
     * Instance of parent relations processor
     */
    protected parent: RelationsProcessor | null;
    /**
     * Id of scope
     */
    protected scopeId: string | null;
    /**
     * Injected relations change detector
     */
    protected relationsChangeDetector: RelationsChangeDetector;
    /**
     * Instance of relations debugger
     */
    protected relationsDebugger: RelationsDebugger | undefined | null;
    /**
     * Gets promise that completes when processor was initialized
     */
    get initialized(): Promise<void>;
    constructor(relationsManager: RelationsManager, componentManager: RelationsComponentManager, injector: Injector, loader: DynamicItemLoader<RelationsComponentDef>, logger?: Logger | undefined, skipInit?: boolean);
    /**
     * Called when component is destroyed
     */
    ngOnDestroy(): void;
    /**
     * Updates relations
     * @param id - Id of component to be registered
     */
    updateRelations(id: string): void;
    /**
     * Method used for destroying component
     */
    destroyComponent(id: string): void;
    /**
     * Opens new scope of relations processor
     * @param id - Id of newly created scope
     * @param componentManager - Scoped instance of component manager
     * @param injector - Injector for current scope
     */
    openScope(id: string, componentManager: RelationsComponentManager, injector: Injector): RelationsProcessor;
    /**
     * Destroyes opened scope itself
     */
    destroyScope(): void;
    /**
     * Transfers data for specified component using its output relations, all data are transfered in single change set per component
     * @param id - Id of component whose outputs relations should be applied to transfer data
     * @param delayed - Indication whether delay data transfer and only generate instructions, if true returns dictionary with data transfer instructions per components
     */
    transferOutputsData(id: string, delayed: true, forceTransfer?: boolean): Dictionary<RelationsDataTransferInstruction>;
    transferOutputsData(id: string, delayed: false, forceTransfer?: boolean): null;
    /**
     * Transfers data for specified component using its inputs relations, all data are transfered in single change
     * @param id - Id of component whose inputs relations should be applied to transfer data
     * @param delayed - Indication whether delay data transfer and only generate instructions, if true returns transfer instructions
     */
    transferInputsData(id: string, delayed: true): RelationsDataTransferInstruction;
    /**
     * Transfers data for specified component using its inputs relations, all data are transfered in single change
     * @param id - Id of component whose inputs relations should be applied to transfer data
     * @param delayed - Indication whether delay data transfer and only generate instructions, if true returns transfer instructions
     */
    transferInputsData(id: string, delayed: false): null;
    /**
     * Transfers data for specified component using its inputs relations, all data are transfered in single change
     * @param id - Id of component whose inputs relations should be applied to transfer data
     * @param delayed - Indication whether delay data transfer and only generate instructions, if true returns transfer instructions
     * @param inputs - Optional array of inputs that should be displayed
     */
    transferInputsData(id: string, delayed: true, inputs: string[]): RelationsDataTransferInstruction;
    /**
     * Transfers data for specified component using its inputs relations, all data are transfered in single change
     * @param id - Id of component whose inputs relations should be applied to transfer data
     * @param delayed - Indication whether delay data transfer and only generate instructions, if true returns transfer instructions
     * @param inputs - Optional array of inputs that should be displayed
     */
    transferInputsData(id: string, delayed: false, inputs: string[]): null;
    /**
     * Initialize relations from metadata
     */
    protected initializeRelations(): Promise<void>;
    /**
     * Initialize backward relations
     * @param inputOutput - Data for input and output
     */
    protected initBackwardRelation(inputOutput: RelationsProcessorInputOutputData): void;
    /**
     * Transfers data from source property to target property
     * @param source - Instance of source object containing source property with data
     * @param target - Instance of target object containing target property for data
     * @param sourceTarget - Definition of source target names and ids
     * @param initial - Indication whether is transfer of data initial, or on event
     */
    protected transferData(source: RelationsComponent, target: RelationsComponent, sourceTarget: RelationsProcessorInputOutputData, initial: boolean): boolean;
    /**
     * Initialize relation component
     * @param meta - Metadata for relations component
     * @param outputs - Array of outputs data for relations component
     */
    protected initComponent(meta: RelationsComponentMetadata, outputs: RelationsProcessorInputOutputData[]): Promise<void>;
    /**
     * Initialize relation for metadata and component
     * @param autoCreated - Indication whether was component auto created or not
     * @param meta - Metadata for relations component
     * @param inputOutputs - Array of outputs data for relations
     * @param scope - Current scope used for this relations component
     * @param componentType - Type used for creation of relations component (only for scoped ones)
     */
    protected initRelation(autoCreated: boolean, meta: RelationsComponentMetadata, inputOutputs: RelationsProcessorInputOutputData[], scope: string | null, componentType: RelationsComponentType | null): void;
    /**
     * Initialize relations component options
     * @param components - Components which options should be initialized
     * @param meta - Metadata containing options for initialization
     */
    protected initOptions(components: RelationsProcessorComponent | RelationsProcessorComponent[], meta: RelationsProcessorComponentData): void;
    /**
     * Sets initialized promise
     */
    protected setInitializePromise(): void;
    /**
     * Destroys initialized relations
     */
    protected destroyRelations(): Promise<void>;
    static ɵfac: i0.ɵɵFactoryDeclaration<RelationsProcessor, [null, null, null, null, { optional: true; }, { optional: true; }]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<RelationsProcessor>;
}
//# sourceMappingURL=relationsProcessor.service.d.ts.map