import { Events, EventTrigger, PropertyChange } from '../coreUtils/events';
import { MetadataProvider } from '../data/metadataProvider';
import { ValidationProvider } from '../data/validationProvider';
import { ElementModel, LinkModel, ElementIri } from '../data/model';
import { Element, Link } from '../diagram/elements';
import type { VisualAuthoringCommands } from '../widgets/visualAuthoring';
import { AuthoringState, AuthoringEvent, TemporaryState } from './authoringState';
import { DataDiagramModel } from './dataDiagramModel';
import { EntityElement, RelationLink } from './dataElements';
import { ValidationState } from './validation';
/** @hidden */
export interface EditorProps {
    readonly model: DataDiagramModel;
    readonly authoringCommands: Events<VisualAuthoringCommands> & EventTrigger<VisualAuthoringCommands>;
    readonly metadataProvider?: MetadataProvider;
    readonly validationProvider?: ValidationProvider;
}
/**
 * Event data for {@link EditorController} events.
 *
 * @see {@link EditorController}
 */
export interface EditorEvents {
    /**
     * Triggered on {@link EditorController.inAuthoringMode} property change.
     */
    changeMode: PropertyChange<EditorController, boolean>;
    /**
     * Triggered on {@link EditorController.authoringState} property change.
     */
    changeAuthoringState: PropertyChange<EditorController, AuthoringState>;
    /**
     * Triggered on {@link EditorController.validationState} property change.
     */
    changeValidationState: PropertyChange<EditorController, ValidationState>;
    /**
     * Triggered on {@link EditorController.temporaryState} property change.
     */
    changeTemporaryState: PropertyChange<EditorController, TemporaryState>;
}
/**
 * Stores, modifies and validates changes from the visual graph authoring
 * (added, deleted or changed graph entities and/or relations).
 *
 * @category Core
 */
export declare class EditorController {
    private readonly listener;
    private readonly source;
    /**
     * Events for the editor controller.
     */
    readonly events: Events<EditorEvents>;
    private readonly model;
    private readonly _authoringCommands;
    private _inAuthoringMode;
    private _metadataProvider;
    private _validationProvider;
    private _authoringState;
    private _validationState;
    private _temporaryState;
    private readonly cancellation;
    /** @hidden */
    constructor(props: EditorProps);
    /** @hidden */
    dispose(): void;
    /**
     * Event bus to connect {@link VisualAuthoring} to other components.
     */
    get authoringCommands(): Events<VisualAuthoringCommands> & EventTrigger<VisualAuthoringCommands>;
    /**
     * Returns `true` if the editor is in the graph authoring mode;
     * otherwise `false`.
     */
    get inAuthoringMode(): boolean;
    /**
     * Toggles the graph authoring mode for the editor.
     *
     * Does nothing if {@link metadataProvider} is not set.
     */
    setAuthoringMode(value: boolean): void;
    /**
     * Provides strategy for the graph authoring mode.
     */
    get metadataProvider(): MetadataProvider | undefined;
    /**
     * Provides strategy to validate data changes from the graph authoring.
     */
    get validationProvider(): ValidationProvider | undefined;
    /**
     * Graph authoring state snapshot.
     */
    get authoringState(): AuthoringState;
    /**
     * Sets graph authoring state.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    setAuthoringState(value: AuthoringState): void;
    private updateAuthoringState;
    /**
     * Validation state snapshot for the data changes from the graph authoring.
     */
    get validationState(): ValidationState;
    /**
     * Sets validation state for the data changes from the graph authoring.
     */
    setValidationState(value: ValidationState): void;
    /**
     * Temporary (transient) state for the graph authoring.
     */
    get temporaryState(): TemporaryState;
    /**
     * Sets temporary (transient) state for the graph authoring.
     */
    setTemporaryState(value: TemporaryState): void;
    private validateChangedFrom;
    /**
     * Forces re-validation for the specified entities.
     */
    revalidateEntities(entities: ReadonlySet<ElementIri>): void;
    private onKeyUp;
    /**
     * Removes all selected diagram elements from the diagram
     * and discards any associated graph authoring state.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    removeSelectedElements(): void;
    /**
     * Removes the specified diagram cells from the diagram
     * and discards any associated graph authoring state.
     *
     * The links are only removed when its a new relation
     * added by the graph authoring.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    removeItems(items: ReadonlyArray<Element | Link>): void;
    /**
     * Creates a new entity with graph authoring.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    createEntity(data: ElementModel, options?: {
        temporary?: boolean;
    }): EntityElement;
    /**
     * Changes an existing entity with graph authoring.
     *
     * If no entities with target IRI found on the diagram,
     * no changes will be applied to the graph authoring state.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    changeEntity(targetIri: ElementIri, newData: ElementModel): void;
    /**
     * Deletes an existing entity with graph authoring.
     *
     * If no entities with target IRI found on the diagram,
     * no changes will be applied to the graph authoring state.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    deleteEntity(elementIri: ElementIri): void;
    /**
     * Creates a new relation with graph authoring.
     *
     * An error will be thrown if the relation with same identity
     * already exists on the diagram.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    createRelation(base: RelationLink, options?: {
        temporary?: boolean;
    }): RelationLink;
    /**
     * Changes an existing relation with graph authoring.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    changeRelation(oldData: LinkModel, newData: LinkModel): void;
    /**
     * Changes an existing relation with graph authoring
     * by moving its source to another entity element.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    moveRelationSource(params: {
        link: RelationLink;
        newSource: EntityElement;
    }): RelationLink;
    /**
     * Changes an existing relation with graph authoring
     * by moving its target to another entity element.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    moveRelationTarget(params: {
        link: RelationLink;
        newTarget: EntityElement;
    }): RelationLink;
    /**
     * Deletes an existing relation with graph authoring.
     *
     * The operation puts a command to the {@link DiagramModel.history command history}.
     */
    deleteRelation(data: LinkModel): void;
    /**
     * Removes all diagram cells from the temporary state for the graph authoring.
     *
     * @see {@link temporaryState}
     */
    removeAllTemporaryCells(): void;
    /**
     * Removes the specified diagram cells from the temporary state
     * for the graph authoring.
     *
     * @see {@link temporaryState}
     */
    removeTemporaryCells(cells: ReadonlyArray<Element | Link>): void;
    /**
     * Discards the specified graph authoring event from the state
     * while reverting associated changes to the diagram:
     *   - new entities and links are removed;
     *   - changed entities and links have their data reverted back.
     */
    discardChange(event: AuthoringEvent): void;
    private discardItemFromGroup;
    private removeRelationsFromLinks;
}
//# sourceMappingURL=editorController.d.ts.map