import { Entity, IEntityDatum } from '@alephdata/followthemoney';
import { Vertex } from './Vertex';
import { Edge } from './Edge';
import { Grouping } from './Grouping';
import { Point } from './Point';
import { Rectangle } from './Rectangle';
import { EntityManager } from '../EntityManager';
import { GraphConfig } from '../GraphConfig';
export interface IGraphLayoutData {
    entities: Array<IEntityDatum>;
    vertices: Array<any>;
    edges: Array<any>;
    groupings?: Array<any>;
    selection?: Array<string>;
}
export declare type VertexPredicate = (vertex: Vertex) => boolean;
export declare type GraphElement = Vertex | Edge;
export declare class GraphLayout {
    readonly config: GraphConfig;
    readonly entityManager: EntityManager;
    vertices: Map<string, Vertex>;
    edges: Map<string, Edge>;
    entities: Map<string, Entity>;
    groupings: Map<string, Grouping>;
    selection: string[];
    private hasDraggedSelection;
    constructor(config: GraphConfig, entityManager: EntityManager);
    addVertex(vertex: Vertex): Vertex;
    getVertices(): Vertex[];
    addEdge(edge: Edge): Edge;
    getEdges(): Edge[];
    private generate;
    createEntity(entityData: any): Entity;
    addEntities(entities: Array<Entity>): void;
    updateEntity(entity: Entity): Entity;
    removeEntity(entityId: string, propagate?: boolean): void;
    getEntities(): Entity[];
    hasEntity(entity: Entity): boolean;
    addGrouping(grouping: Grouping): void;
    getGroupings(): Grouping[];
    getVertexByEntity(entity: Entity): Vertex | undefined;
    selectElement(element: GraphElement | Array<GraphElement>, additional?: boolean, allowUnselect?: boolean): void;
    selectVerticesByFilter(predicate: VertexPredicate, additional?: boolean, allowUnselect?: boolean): void;
    selectArea(area: Rectangle): void;
    getSelectedVertices(): Vertex[];
    getSelectedEntities(): Entity[];
    getSelectedGroupings(): Grouping[];
    getRelatedEntities(...elements: Array<GraphElement>): Array<Entity>;
    getSelectedEdges(): Edge[];
    getHighlightedEdges(): Edge[];
    getSelectionAdjacentEdges(): Edge[];
    hasSelection(): boolean;
    clearSelection(): void;
    isElementSelected(element: GraphElement | Array<GraphElement>): boolean;
    isGroupingSelected(grouping: Grouping): boolean;
    isGroupingMemberSelected(grouping: Grouping): boolean;
    isEdgeHighlighted(edge: Edge): boolean;
    isEdgeSelectionAdjacent(edge: Edge): boolean;
    dragSelection(offset: Point, initialPosition?: Point): void;
    dragEdge(edge: Edge, offset: Point, initialPosition?: Point): void;
    removeSubgroups(): void;
    dropSelection(): true | undefined;
    removeSelection(): (Entity | undefined)[];
    ungroupSelection(): void;
    addVertexToGroupings(vertex: Vertex): void;
    getVisibleVertexRect(): Rectangle;
    layout(): void;
    layoutPositions(): void;
    clone(): GraphLayout;
    update(withData: IGraphLayoutData): GraphLayout;
    toJSON(): IGraphLayoutData;
    static fromJSON(config: GraphConfig, entityManager: EntityManager, data: any): GraphLayout;
}
