import { Events, EventSource, PropertyChange } from '../coreUtils/events';
import { ReadonlyHashSet } from '../coreUtils/hashMap';
import { ElementIri, ElementModel, ElementTypeIri, ElementTypeModel, LinkKey, LinkModel, LinkTypeIri, LinkTypeModel, PropertyTypeIri, PropertyTypeModel } from '../data/model';
import { Element, ElementEvents, ElementProps, ElementTemplateState, Link, LinkEvents, LinkProps, LinkTemplateState } from '../diagram/elements';
import { Command } from '../diagram/history';
import { DiagramModel } from '../diagram/model';
/**
 * Event data for {@link EntityElement} events.
 *
 * @see {@link EntityElement}
 */
export interface EntityElementEvents extends ElementEvents {
    /**
     * Triggered on {@link EntityElement.data} property change.
     */
    changeData: PropertyChange<EntityElement, ElementModel>;
}
/**
 * Properties for {@link EntityElement}.
 *
 * @see {@link EntityElement}
 */
export interface EntityElementProps extends ElementProps {
    data: ElementModel;
}
/**
 * Diagram element representing an graph entity referenced by an IRI.
 *
 * @category Core
 */
export declare class EntityElement extends Element {
    readonly events: Events<EntityElementEvents>;
    private _data;
    constructor(props: EntityElementProps);
    /**
     * Creates an empty (placeholder) data for the specified entity IRI.
     *
     * This data can be used to display an entity in the UI
     * until the actual data is loaded from a data provider.
     */
    static placeholderData(iri: ElementIri): ElementModel;
    protected get entitySource(): EventSource<EntityElementEvents>;
    get iri(): ElementIri;
    get data(): ElementModel;
    setData(value: ElementModel): void;
}
/**
 * Command to set {@link EntityElement.data entity element data}.
 *
 * @category Commands
 */
export declare function setEntityElementData(entity: EntityElement, data: ElementModel): Command;
/**
 * Event data for {@link EntityGroup} events.
 *
 * @see {@link EntityGroup}
 */
export interface EntityGroupEvents extends ElementEvents {
    /**
     * Triggered on {@link EntityGroup.items} property change.
     */
    changeItems: PropertyChange<EntityGroup, ReadonlyArray<EntityGroupItem>>;
}
/**
 * Properties for {@link EntityGroup}.
 *
 * @see {@link EntityGroup}
 */
export interface EntityGroupProps extends ElementProps {
    items?: ReadonlyArray<EntityGroupItem>;
}
/**
 * Diagram element representing a group of multiple graph entities.
 *
 * @category Core
 */
export declare class EntityGroup extends Element {
    readonly events: Events<EntityGroupEvents>;
    private _items;
    private _itemIris;
    constructor(props: EntityGroupProps);
    protected get entitySource(): EventSource<EntityGroupEvents>;
    get items(): ReadonlyArray<EntityGroupItem>;
    setItems(value: ReadonlyArray<EntityGroupItem>): void;
    get itemIris(): ReadonlySet<ElementIri>;
    private updateItemIris;
}
/**
 * Represents a single entity contained in the entity group.
 *
 * @see {@link EntityGroup.items}
 */
export interface EntityGroupItem {
    readonly data: ElementModel;
    readonly elementState?: ElementTemplateState | undefined;
}
/**
 * Command to set {@link EntityGroup.items entity group items}.
 *
 * @category Commands
 */
export declare function setEntityGroupItems(group: EntityGroup, items: ReadonlyArray<EntityGroupItem>): Command;
/**
 * Iterates over data for all entities of the target element.
 *
 * @category Core
 */
export declare function iterateEntitiesOf(element: Element): Iterable<ElementModel>;
/**
 * Event data for {@link RelationLink} events.
 *
 * @see {@link RelationLink}
 */
export interface RelationLinkEvents extends LinkEvents {
    /**
     * Triggered on {@link RelationLink.data} property change.
     */
    changeData: PropertyChange<RelationLink, LinkModel>;
}
/**
 * Properties for {@link RelationLink}.
 *
 * @see {@link RelationLink}
 */
export interface RelationLinkProps extends LinkProps {
    data: LinkModel;
}
/**
 * Diagram link representing a graph relation, uniquely identified by
 * (source entity IRI, target entity IRI, link type IRI) tuple.
 *
 * @category Core
 */
export declare class RelationLink extends Link {
    readonly events: Events<RelationLinkEvents>;
    private _data;
    constructor(props: RelationLinkProps);
    protected get relationSource(): EventSource<RelationLinkEvents>;
    protected getTypeId(): LinkTypeIri;
    get data(): LinkModel;
    setData(value: LinkModel): void;
    withDirection(data: LinkModel): RelationLink;
}
/**
 * Command to set relation {@link RelationLink.data relation link data}.
 *
 * @category Commands
 */
export declare function setRelationLinkData(relation: RelationLink, data: LinkModel): Command;
/**
 * Event data for {@link RelationGroup} events.
 *
 * @see {@link RelationGroup}
 */
export interface RelationGroupEvents extends LinkEvents {
    /**
     * Triggered on {@link RelationGroup.items} property change.
     */
    changeItems: PropertyChange<RelationGroup, ReadonlyArray<RelationGroupItem>>;
}
/**
 * Properties for {@link RelationGroup}.
 *
 * @see {@link RelationGroup}
 */
export interface RelationGroupProps extends LinkProps {
    typeId: LinkTypeIri;
    items: ReadonlyArray<RelationGroupItem>;
}
/**
 * Diagram link representing a group of multiple graph relations.
 *
 * @category Core
 */
export declare class RelationGroup extends Link {
    readonly events: Events<RelationGroupEvents>;
    private readonly _typeId;
    private _items;
    private readonly _itemKeys;
    private readonly _sources;
    private readonly _targets;
    constructor(props: RelationGroupProps);
    protected get relationSource(): EventSource<RelationGroupEvents>;
    protected getTypeId(): LinkTypeIri;
    get items(): ReadonlyArray<RelationGroupItem>;
    setItems(value: ReadonlyArray<RelationGroupItem>): void;
    get itemKeys(): ReadonlyHashSet<LinkKey>;
    get itemSources(): ReadonlySet<ElementIri>;
    get itemTargets(): ReadonlySet<ElementIri>;
    private updateItemKeys;
}
/**
 * Represents a single relation contained in the relation group.
 *
 * @see {@link RelationGroup.items}
 */
export interface RelationGroupItem {
    readonly data: LinkModel;
    readonly linkState?: LinkTemplateState | undefined;
}
/**
 * Command to set {@link RelationGroup.items relation group items}.
 *
 * @category Commands
 */
export declare function setRelationGroupItems(group: RelationGroup, items: ReadonlyArray<RelationGroupItem>): Command;
/**
 * Iterates over data for all relations of the target link.
 *
 * @category Core
 */
export declare function iterateRelationsOf(link: Link): Iterable<LinkModel>;
/**
 * Event data for {@link ElementType} events.
 *
 * @see {@link ElementType}
 */
export interface ElementTypeEvents {
    /**
     * Triggered on {@link ElementType.data} property change.
     */
    changeData: PropertyChange<ElementType, ElementTypeModel | undefined>;
}
/**
 * Stores data of an entity type in the graph.
 *
 * @category Core
 */
export declare class ElementType {
    private readonly source;
    readonly events: Events<ElementTypeEvents>;
    readonly id: ElementTypeIri;
    private _data;
    constructor(props: {
        id: ElementTypeIri;
        data?: ElementTypeModel;
    });
    get data(): ElementTypeModel | undefined;
    setData(value: ElementTypeModel | undefined): void;
}
/**
 * Event data for {@link PropertyType} events.
 *
 * @see {@link PropertyType}
 */
export interface PropertyTypeEvents {
    /**
     * Triggered on {@link PropertyType.data} property change.
     */
    changeData: PropertyChange<PropertyType, PropertyTypeModel | undefined>;
}
/**
 * Stores data of a property type in the graph.
 *
 * @category Core
 */
export declare class PropertyType {
    private readonly source;
    readonly events: Events<PropertyTypeEvents>;
    readonly id: PropertyTypeIri;
    private _data;
    constructor(props: {
        id: PropertyTypeIri;
        data?: PropertyTypeModel;
    });
    get data(): PropertyTypeModel | undefined;
    setData(value: PropertyTypeModel | undefined): void;
}
/**
 * Event data for {@link LinkType} events.
 *
 * @see {@link LinkType}
 */
export interface LinkTypeEvents {
    /**
     * Triggered on {@link LinkType.data} property change.
     */
    changeData: PropertyChange<LinkType, LinkTypeModel | undefined>;
}
/**
 * Stores data of a link type in the graph.
 *
 * @category Core
 */
export declare class LinkType {
    private readonly source;
    readonly events: Events<LinkTypeEvents>;
    readonly id: LinkTypeIri;
    private _data;
    constructor(props: {
        id: LinkTypeIri;
        data?: LinkTypeModel | undefined;
    });
    get data(): LinkTypeModel | undefined;
    setData(value: LinkTypeModel | undefined): void;
}
/**
 * Command to replace {@link EntityElement.data data} for all entities with target IRI on the diagram.
 *
 * If IRI in the new `data` is different from the `target`, the relations
 * connected to the entities will have their data changed as well to refer
 * to the same entities by the new IRI.
 *
 * @category Commands
 */
export declare function changeEntityData(model: DiagramModel, target: ElementIri, data: ElementModel): Command;
/**
 * Command to replace {@link RelationLink.data data} for all relations with same target identity.
 *
 * The relation identity should be the same for both `oldData` and `newData`
 * otherwise an error wil be thrown.
 *
 * @category Commands
 */
export declare function changeRelationData(model: DiagramModel, oldData: LinkModel, newData: LinkModel): Command;
//# sourceMappingURL=dataElements.d.ts.map